UNPKG

@code-yeongyu/senpi

Version:

Coding agent CLI with read, bash, edit, write tools and session management

59 lines • 2.52 kB
import { type ShardKind } from "./host-daemon-paths.ts"; import { type HostDecisionPolicy } from "./host-decision.ts"; import { type IdleHandoverTerms } from "./host-handover-request.ts"; import type { ResolvedHostLaunchSpec } from "./host-launch-spec.ts"; import { type HostOutcome } from "./host-outcome.ts"; import type { HostStopGeneration } from "./host-stop-generation.ts"; export { HOST_EXIT_ERROR, HOST_EXIT_FALLBACK, HOST_EXIT_OK, HOST_EXIT_REFUSED, HOST_EXIT_USAGE, type HostOutcome, } from "./host-outcome.ts"; import type { Duplex } from "node:stream"; /** Which daemon a request is about: the endpoint, and the agent directory holding its state. */ export interface HostTarget { readonly socket: string; readonly agentDir: string; } export type HostRequest = { readonly action: "ensure"; readonly target: HostTarget; readonly spec: ResolvedHostLaunchSpec; readonly policy: HostDecisionPolicy; } | { readonly action: "status"; readonly target: HostTarget; readonly includeWorkers: boolean; /** Every endpoint under `target.agentDir` (its socket is ignored), read without pruning. */ readonly all?: boolean; } | { readonly action: "stop"; readonly target: HostTarget; readonly drain: boolean; readonly force: boolean; readonly expectedGeneration?: HostStopGeneration; /** With `drain`: the generation to drain, by instance id (senpi#3653). */ readonly instanceId?: string; /** With `drain`: wait up to this long for that generation to exit. */ readonly waitMs?: number; } | { readonly action: "handoff"; readonly target: HostTarget; readonly spec: ResolvedHostLaunchSpec; /** The conditional form (`--when idle`): the running host hands over at its next safe idle point. */ readonly handover?: IdleHandoverTerms; /** `--allow-downgrade`: the caller consents to handing a newer host down to this engine (senpi#7018). */ readonly allowDowngrade?: boolean; } /** Removes endpoint state under `agentDir` only on the three-part evidence (`host-gc.ts`). */ | { readonly action: "gc"; readonly agentDir: string; } | { readonly action: "shard_path"; readonly kind: ShardKind; readonly owner: string; readonly root: string; }; export declare function runHostRequest(request: HostRequest, options?: { readonly keyRoot?: string; readonly presenterBootstrap?: Duplex; readonly mcpPresenterEnforcement?: boolean; }): Promise<HostOutcome>; //# sourceMappingURL=host-runner.d.ts.map