@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
43 lines • 2.36 kB
TypeScript
import { type SessionRuntimeKind } from "../../cli/args.ts";
import type { HostColdStart, HostLifecyclePolicyInput } from "./host-lifecycle.ts";
export interface HostLaunchSpecCore {
readonly session_runtime: SessionRuntimeKind;
/** A daemon serves many clients at once; a spec that says otherwise is refused, not honoured. */
readonly multi_session: true;
/** Extension paths, relative to the directory holding the spec file. */
readonly extensions: readonly string[];
}
/** The document itself, as a client writes it. */
export interface HostLaunchSpec {
readonly spec_version: 1;
readonly core: HostLaunchSpecCore;
readonly tunables?: {
readonly idleExitMs?: number;
readonly coldStart?: HostColdStart;
};
readonly env?: Readonly<Record<string, string>>;
}
export type HostLaunchSpecRefusal = "launch_spec_unreadable" | "launch_spec_invalid" | "launch_spec_insecure" | "launch_spec_path_escape" | "launch_spec_env_denied" | "launch_spec_missing_extension";
/** A spec that may not be acted on, naming the property that failed and the path that failed it. */
export declare class HostLaunchSpecError extends Error {
readonly reason: HostLaunchSpecRefusal;
readonly detail: string;
constructor(reason: HostLaunchSpecRefusal, detail: string);
}
/** A trusted spec, in the shape the ensure/handoff entry points take. */
export interface ResolvedHostLaunchSpec {
/** Host CLI arguments: the session runtime and one absolute `--extension` per listed path. */
readonly hostArgs: readonly string[];
readonly policy: HostLifecyclePolicyInput;
readonly env: Readonly<Record<string, string>>;
}
/** What an ensure without a spec launches: the daemon defaults, no extensions, no extra env. */
export declare const DEFAULT_HOST_LAUNCH_SPEC: ResolvedHostLaunchSpec;
/**
* Reads, trusts and resolves one launch spec. Every failure is a `HostLaunchSpecError`; nothing is
* started, and no daemon state is written, until this has returned.
*/
export declare function loadHostLaunchSpec(specPath: string, platform?: NodeJS.Platform): Promise<ResolvedHostLaunchSpec>;
/** Parses the document. A boundary: everything past it is typed and nothing re-validates it. */
export declare function parseHostLaunchSpec(text: string): HostLaunchSpec;
//# sourceMappingURL=host-launch-spec.d.ts.map