@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
34 lines • 2.2 kB
TypeScript
/**
* Route-first dispatch for the one-shot commands whose implementations are heavy module graphs.
*
* `main()` calls the package and config handlers unconditionally, and each of them
* starts by rejecting argv that does not select it. Statically importing them to ask that question
* made every launch - interactive, print, RPC - evaluate `package-manager-cli.ts`
* before argv was even parsed. The rejection is a single
* argv[0] comparison, so it happens here and the implementation stays behind an `await import(...)`
* that only the selected command pays for.
*
* The argv[0] conditions below mirror the ones inside the implementations: `parsePackageCommand()`
* and `handleConfigCommand()` in `../package-manager-cli.ts`. The package verbs are pinned to
* the `PackageCommand` union at compile time.
*/
import type { PackageCommandRuntimeOptions } from "../package-manager-cli.ts";
export declare const CONFIG_COMMAND_ARGV = "config";
export declare const HOST_COMMAND_ARGV = "host";
export declare const SCHEDULE_COMMAND_ARGV = "schedule";
/** True when argv[0] selects a package-manager verb, matching `parsePackageCommand()`. */
export declare function isPackageCommandArgv(args: readonly string[]): boolean;
export declare function dispatchPackageCommand(args: string[], runtimeOptions?: PackageCommandRuntimeOptions): Promise<boolean>;
export declare function dispatchConfigCommand(args: string[], runtimeOptions?: PackageCommandRuntimeOptions): Promise<boolean>;
/**
* The daemon command answers with an EXIT CODE rather than a boolean: `senpi host` classifies its
* outcome (refused, fallback, unusable spec) in that code, and a caller parses it without reading
* the JSON line. `undefined` means this argv is not a host command at all.
*/
export declare function dispatchHostCommand(args: readonly string[]): Promise<number | undefined>;
/**
* `senpi schedule` fires durable scheduled prompts out of process; like `host` it answers with an
* exit code, and `undefined` means this argv is not a schedule command.
*/
export declare function dispatchScheduleCommand(args: readonly string[]): Promise<number | undefined>;
//# sourceMappingURL=deferred-commands.d.ts.map