export interface CommandManifestEntry { name: string; summary: string; args?: string[]; subcommands?: string[]; /** True when the tina4 client implements this command, not the framework. */ delegated?: boolean; } /** * A stable, machine-readable pointer to the `generate` resolution envelope * this framework speaks. Consumers (the tina4 client, an AI agent, a * downstream tool) MUST NOT hard-code an envelope shape — instead they read * `resolution_contract.envelope` from this manifest and follow its version. * `version` bumps on any breaking key rename or removal; `envelope` is the * name of the schema (currently `generate_v1`). */ export interface ResolutionContract { version: string; envelope: string; } export interface CommandManifest { framework: string; version: string; commands: CommandManifestEntry[]; resolution_contract: ResolutionContract; } /** * Build the machine-readable manifest of the CLI's command surface. * * Pure data: reads the module-level COMMANDS and DELEGATED registries plus the * framework version — no bootstrap, no database, no migrations, no app imports. * This is exactly what `commands --json` serialises and what the tina4 Rust * client consumes to discover which commands this framework supports. * * Commands handed to the `tina4` client carry `delegated: true`, so the manifest * describes the WHOLE surface the CLI accepts while still saying who implements * each one. The client needs no change: its help renderer already drops manifest * names that clash with its own natives. * * Shape (identical keys to the Python master): * { framework: "nodejs", version: "", * commands: [{ name, summary, args?, subcommands?, delegated? }, ...] } */ export declare function buildCommandManifest(): CommandManifest; /** * Emit the CLI's own command surface — the self-describing manifest. * * tina4nodejs commands human-readable list * tina4nodejs commands --json machine-readable manifest (for the tina4 CLI) * * CHEAP + side-effect-free by contract: it only prints the static COMMANDS * registry plus the framework version. It MUST NOT bootstrap the framework, * open a database, run migrations, or import app modules — the Rust client * calls this on `tina4 --help`, in any directory, so it must be instant and * safe to run anywhere. */ export declare function runCommands(args?: string[]): void; export interface CommandSpec { handler: (cmdArgs: string[]) => void | Promise; summary: string; usage?: string; args?: string[]; subcommands?: string[]; } export declare const COMMANDS: Record; export interface DelegatedSpec { summary: string; usage?: string; args?: string[]; } export declare const DELEGATED: Record; export declare const CLIENT_BINARY = "tina4"; export declare const DELEGATION_GUARD_ENV = "TINA4_CLI_DELEGATED"; export declare const EXIT_CLIENT_UNAVAILABLE = 127; export declare const EXIT_UNKNOWN_COMMAND = 1; /** * Run `tina4 `, returning the client's exit code. * * Returns EXIT_CLIENT_UNAVAILABLE (127) with an actionable message when the * client is not on PATH, or when the re-entry guard shows the resolved `tina4` * came back to a framework CLI (a delegation loop). */ export declare function delegateToClient(command: string, args: string[]): number;