@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
26 lines • 1.7 kB
TypeScript
/**
* Who may run tool calls on a loopless runtime (senpi#5413). Closed and fail-closed: a runtime built without a grant this
* module issued refuses every call. Two callers exist:
* - the in-process test harness, which runs tools directly;
* - the remote tool executor (S27a). A runtime built with its grant runs the extensions' `tool_call` handlers
* (permission checks among them) before every call and the `tool_result` handlers after it; a `tool_call` handler
* that blocks or throws stops the call before the tool runs.
*/
declare const LOOPLESS_EXECUTE_CALLERS: readonly ["in-process-test-harness", "remote-tool-executor"];
export type LooplessExecuteCaller = (typeof LOOPLESS_EXECUTE_CALLERS)[number];
export interface LooplessExecuteGrant {
readonly caller: LooplessExecuteCaller;
}
export declare class LooplessExecuteRefusedError extends Error {
constructor(reason: string);
}
/** Issues the test harness's grant; anywhere but a Vitest run it refuses. */
export declare function grantLooplessExecuteToTestHarness(): LooplessExecuteGrant;
/** Issues the remote tool executor's grant: every call made with it runs the extensions' tool handlers. */
export declare function grantLooplessExecuteToRemoteExecutor(): LooplessExecuteGrant;
/** True when calls made with `grant` must run the extensions' `tool_call`/`tool_result` handlers. */
export declare function looplessGrantRunsToolHandlers(grant: LooplessExecuteGrant | undefined): boolean;
/** True only for a grant this module issued to an allowed caller. */
export declare function isLooplessExecuteGranted(grant: LooplessExecuteGrant | undefined): boolean;
export {};
//# sourceMappingURL=loopless-execute-grant.d.ts.map