run402-mcp
Version:
MCP server for Run402 — full-stack backend infrastructure for AI agents: Postgres, auth, storage, serverless functions and atomic deploys. Paid with x402/MPP. Includes $0.03 image generation.
75 lines • 3.77 kB
TypeScript
export declare const DEFAULT_API_BASE = "https://api.run402.com";
export type ApiTargetKind = "cloud" | "core" | "unknown";
export interface ApiTargetConfig {
api_base?: string;
target_kind?: ApiTargetKind;
updated_at?: string;
health_status?: string;
health_error?: string;
}
export declare function getApiBase(): string;
export declare function getApiBaseSource(): "env" | "profile" | "default";
/**
* API base for the deploy-v2 routes. Defaults to the same value as
* `getApiBase()`. Set `RUN402_DEPLOY_API_BASE` to point only deploy traffic
* elsewhere — useful when running deploy-v2 against a staging gateway while
* the rest of the SDK still talks to production. In normal use callers
* should not need this override.
*/
export declare function getDeployApiBase(): string;
/**
* The base credential directory — the root under which the `default` wallet
* lives directly and named wallets live under `profiles/<name>/`. This is the
* value `RUN402_CONFIG_DIR` overrides; profiles nest *within* it.
*/
export declare function getConfigBaseDir(): string;
export declare const DEFAULT_PROFILE = "default";
export declare function isValidProfileName(name: string): boolean;
/**
* The active wallet/profile name from the environment. `RUN402_WALLET` is
* canonical; `RUN402_PROFILE` is accepted as an alias. Empty/unset → the
* reserved `default`. The CLI edge resolves the `--wallet` flag and any
* per-directory `.run402.json` binding into `RUN402_WALLET` *before* dispatch,
* so core stays env-only and never reads argv or cwd.
*/
export declare function getActiveProfile(): string;
/** Directory holding all named wallets: `{base}/profiles`. */
export declare function getProfilesDir(): string;
/**
* The effective config directory for the *active* wallet. The `default` wallet
* resolves to the base dir (zero migration for existing single-wallet
* installs); any named wallet resolves to `{base}/profiles/<name>`. Because
* keystore, wallet, and meta paths all derive from this, switching the
* profile env var moves the whole wallet bundle atomically — and the SDK/MCP
* inherit profile selection for free.
*/
export declare function getConfigDir(): string;
export declare function getKeystorePath(): string;
export declare function getLegacyProjectsPath(): string;
export declare function getProjectCredentialsPath(): string;
export declare function getProfileStatePath(): string;
export declare function getApiTargetConfigPath(): string;
export declare function readApiTargetConfig(path?: string): ApiTargetConfig | null;
export declare function saveApiTargetConfig(config: ApiTargetConfig, path?: string): void;
export declare function configureApiBase(apiBase: string, options?: Omit<ApiTargetConfig, "api_base" | "updated_at"> & {
updated_at?: string;
}): ApiTargetConfig;
export declare function getConfiguredApiBase(): string | null;
export declare function getApiTargetKind(): ApiTargetKind;
export declare function isCoreApiTarget(): boolean;
/**
* The file that holds a wallet's key, in the base config dir (the `default`
* wallet) and in each `profiles/<name>/` directory.
*/
export declare const WALLET_FILE_NAME = "wallet.json";
/**
* One-time local move of the wallet key file to its current name: in the base
* config dir and every `profiles/<name>/` directory, `allowance.json` is
* renamed to `wallet.json` (an atomic same-directory rename) when
* `wallet.json` is absent, then tightened to 0600. A directory that already
* holds `wallet.json` is left untouched. Runs once per base dir per process;
* nothing reads the previous name afterwards.
*/
export declare function moveWalletFiles(): void;
export declare function getWalletPath(): string;
//# sourceMappingURL=config.d.ts.map