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.
38 lines • 1.82 kB
TypeScript
/** The committed binding file. Safe to check in — it names, never authorizes. */
export declare const BINDING_FILE = ".run402.json";
/** The personal override. Gitignored; beats the committed file key-by-key. */
export declare const BINDING_LOCAL_FILE = ".run402.local.json";
export interface BindingKeyHit {
/** The trimmed value found. */
value: string;
/** The file it came from — surfaced in provenance and conflict messages. */
file: string;
}
/**
* Nearest binding of `key`, walking up from `startDir` to the filesystem root.
*
* Resolution is PER KEY, not per file: the nearest file that carries the key
* wins, so `/work/.run402.json` may supply the organization while
* `/work/api/.run402.json` supplies the wallet. A worktree nested under a bound
* checkout therefore inherits the binding without restating it.
*/
export declare function findBindingKey(startDir: string, key: string): BindingKeyHit | null;
/** Path of the committed binding file for a directory. */
export declare function bindingFilePath(dir?: string): string;
/** Parse a directory's committed binding file, or `{}` when absent/unreadable. */
export declare function readBindingFile(dir?: string): Record<string, unknown>;
/**
* MERGE keys into a directory's committed binding file. A `null` (or
* `undefined`) value removes its key; a file left with no keys is deleted
* rather than committed empty.
*
* The file is shared by tiers (`wallet` from `wallets bind`, `org`/`room` from
* `orgs bind`) and unknown keys are preserved, so one tier can never clobber
* another's binding.
*/
export declare function updateBindingFile(dir: string, patch: Record<string, unknown>): {
file: string;
contents: Record<string, unknown> | null;
removed: boolean;
};
//# sourceMappingURL=binding-file.d.ts.map