@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
48 lines • 2.81 kB
TypeScript
import type { ExtensionAPI, ExtensionContext, SessionBeforeCompactEvent, SessionBeforeCompactResult, SessionCompactEvent, SessionStartEvent } from "../../types.ts";
import { type HookDispatchResult } from "./dispatcher.ts";
import type { ExecutableHookHandler, HookDiagnostic, HookInputWire, HookTrustState } from "./types.ts";
type LifecycleHookEvent = "SessionStart" | "PreCompact" | "PostCompact" | "Notification";
type LifecycleDispatchOptions = {
readonly cwd: string;
readonly handlers: readonly ExecutableHookHandler[];
readonly input: HookInputWire;
readonly matcherInputs: readonly string[];
readonly signal?: AbortSignal;
readonly trustState: HookTrustState;
};
type LifecycleResultDetails = {
readonly cancel: boolean;
readonly contexts: readonly string[];
readonly diagnostics: readonly HookDiagnostic[];
readonly reason?: string;
};
export declare function buildSessionStartHookInput(event: SessionStartEvent, ctx: ExtensionContext): HookInputWire;
export declare function buildPreCompactHookInput(event: SessionBeforeCompactEvent, ctx: ExtensionContext): HookInputWire;
export type NotificationHookInput = {
readonly message: string;
readonly kind: string;
readonly title?: string;
readonly source?: string;
readonly requestId?: string;
readonly status?: string;
};
export declare function buildNotificationHookInput(input: NotificationHookInput, ctx: ExtensionContext): HookInputWire;
export declare function dispatchNotificationHookEvent(options: {
cwd: string;
handlers: readonly ExecutableHookHandler[];
input: HookInputWire;
signal?: AbortSignal;
trustState: HookTrustState;
}): Promise<HookDispatchResult | undefined>;
export declare function notificationResultDetails(result: HookDispatchResult | undefined): LifecycleResultDetails;
export declare function buildPostCompactHookInput(event: SessionCompactEvent, ctx: ExtensionContext): HookInputWire;
export declare function dispatchLifecycleHookEvent(options: LifecycleDispatchOptions): Promise<HookDispatchResult | undefined>;
export declare function sessionStartResultDetails(result: HookDispatchResult | undefined): LifecycleResultDetails;
export declare function preCompactResultDetails(result: HookDispatchResult | undefined): LifecycleResultDetails;
export declare function postCompactResultDetails(result: HookDispatchResult | undefined): LifecycleResultDetails;
export declare function sessionBeforeCompactResult(details: LifecycleResultDetails): SessionBeforeCompactResult | undefined;
export declare function recordLifecycleHookResult(pi: Pick<ExtensionAPI, "sendMessage">, event: LifecycleHookEvent, details: LifecycleResultDetails, options?: {
compactionRequestId?: string;
}): void;
export {};
//# sourceMappingURL=lifecycle-adapter.d.ts.map