@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
36 lines • 1.75 kB
TypeScript
import type { SessionEntry } from "../../../session-manager.ts";
import type { ExtensionAPI, ExtensionContext } from "../../types.ts";
import { type TodoAsk, type TodoPhase } from "../todotools/state.ts";
declare const TODO_SNAPSHOT_SCHEMA = "senpi.compaction.todo-snapshot.v1";
export interface TodoEntry {
id?: string;
content?: string;
text?: string;
status?: string;
}
export type TodoSnapshotItems = TodoEntry[] | TodoPhase[];
export interface TodoSnapshotPayload {
schema: typeof TODO_SNAPSHOT_SCHEMA;
todos: TodoSnapshotItems;
capturedAt: number;
/** The user request the list served; the todo tool re-anchors to it when it rebuilds the list. */
ask?: TodoAsk;
}
interface AppendEntryTarget {
appendEntry<T = unknown>(customType: string, data?: T): void;
}
export interface RestoreResult<T extends TodoSnapshotItems = TodoSnapshotItems> {
applied: boolean;
restoredTodos: T;
}
export declare function findTodoEntries(entries: SessionEntry[], options?: {
branchId?: string;
}): TodoEntry[];
export declare function createTodoSnapshot(ctx: ExtensionContext): TodoSnapshotPayload;
export declare function persistTodoSnapshot(pi: AppendEntryTarget, snapshot: TodoSnapshotPayload): void;
export declare function captureTodoSnapshot(pi: ExtensionAPI, ctx: ExtensionContext): void;
export declare function captureTodoSnapshot(currentTodos: TodoSnapshotItems, pi: AppendEntryTarget, branchId?: string): void;
export declare function restoreTodosIfMissing(pi: ExtensionAPI, ctx: ExtensionContext): void;
export declare function restoreTodosIfMissing<T extends TodoSnapshotItems>(snapshot: T, currentTodos: T, pi: AppendEntryTarget): RestoreResult<T>;
export {};
//# sourceMappingURL=todo-bridge.d.ts.map