@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
27 lines • 1.41 kB
TypeScript
import type { AgentMessage } from "@earendil-works/pi-agent-core";
import type { ExtensionAPI, ExtensionContext } from "../../types.ts";
import type { HookDispatchResult } from "./dispatcher.ts";
import type { HookInputWire } from "./types.ts";
export declare const STOP_STATE_CUSTOM_TYPE = "senpi.hooks.stop-state";
export declare const STOP_DIAGNOSTICS_CUSTOM_TYPE = "senpi.hooks.stop-diagnostics";
export declare const STOP_OUTPUT_CUSTOM_TYPE = "senpi.hooks.stop-output";
type StopRuntime = Pick<ExtensionAPI, "appendEntry" | "sendUserMessage">;
/**
* The session and turn a Stop reports: the session id is read when the turn ended, the turn key when the Stop
* dispatches.
*/
export type StopTurn = {
readonly sessionId: string;
readonly turnKey: string;
};
export declare function buildStopHookInput(event: {
readonly messages: readonly AgentMessage[];
}, ctx: ExtensionContext): HookInputWire;
export declare function createStopTurnTracker(): {
readonly reset: () => void;
/** The current turn's key; with no leaf it names `sessionId`, the id the caller read when the turn ended. */
readonly turnKey: (ctx: ExtensionContext, sessionId: string) => string;
};
export declare function applyStopHookResult(pi: StopRuntime, ctx: ExtensionContext, result: HookDispatchResult, { sessionId, turnKey }: StopTurn): Promise<void>;
export {};
//# sourceMappingURL=stop-adapter.d.ts.map