@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
40 lines • 2.34 kB
TypeScript
declare const TOOL_RUNTIMES: readonly ["in-process", "child"];
export type ToolRuntimeKind = (typeof TOOL_RUNTIMES)[number];
export declare function isToolRuntimeKind(value: string): value is ToolRuntimeKind;
/**
* What the tool child already serves, advertised as `placement:<name>` beside `tool_runtime:child` (senpi#3566): each
* later todo appends the placement it lands, so a client (and the QA driver) can tell which work moved.
*/
export declare const TOOL_CHILD_PLACEMENTS: readonly ["launch-barrier", "job-policy", "hostcall", "offload", "terminal"];
/** Advertised in both runtimes: `ctx.offload` / `registerChildModule` exist (where they run is the runtime's choice). */
export declare const OFFLOAD_API_CAPABILITY = "offload_api";
export declare function toolRuntimeCapabilities(runtime: ToolRuntimeKind): string[];
export declare function isHostOwnedToolRuntimeCapability(capability: string): boolean;
export declare function toolRuntimeCapability(runtime: ToolRuntimeKind): `tool_runtime:${ToolRuntimeKind}`;
export type ToolRuntimeResolution = {
readonly ok: true;
readonly value: ToolRuntimeKind;
} | {
readonly ok: false;
readonly message: string;
};
/**
* Tool runtime of this process: `--tool-runtime` wins, then `SENPI_TOOL_RUNTIME`, then `in-process`.
* An env value outside the two kinds is a startup error, the same as an unknown flag value: a typo
* must never silently select the other runtime.
*/
export declare const TOOL_RUNTIME_UNSUPPORTED_HOST = "tool_runtime_unsupported_host";
/**
* Hosts the child runtime cannot serve yet. Windows needs its own containment (Job Objects, the breakaway shim), which
* lands separately (senpi#3566); until then `child` is refused there, so no half-gated launch path is ever reachable.
*/
export declare function toolRuntimeHostRefusal(runtime: ToolRuntimeKind, platform?: NodeJS.Platform, hasFfi?: () => boolean): string | undefined;
export declare class ToolRuntimeUnsupportedHostError extends Error {
readonly code = "tool_runtime_unsupported_host";
constructor(message: string);
}
export declare function resolveToolRuntime(parsed: {
readonly toolRuntime?: ToolRuntimeKind;
}, env?: NodeJS.ProcessEnv, platform?: NodeJS.Platform, hasFfi?: () => boolean): ToolRuntimeResolution;
export {};
//# sourceMappingURL=tool-runtime.d.ts.map