import { CHAT_EVENTS_SLOT, RECAP_PLUGIN, RECAP_RPC_CHANNEL, RECAP_SOURCE_KIND, RecapCard, RecapLogEvent, RecapPersistedState, RecapSettings, RecapStatus, RecapStore, defaultSettings } from "./contracts.js"; import { ProducerMessageSource, RpcResult, TaskCheckpoint, TaskContract } from "@klarkxy/dsh-plugin-kit/contracts"; import { LlmTextCaller } from "@klarkxy/dsh-plugin-kit"; import { z } from "zod"; import { Context } from "@deepseek-ai/cordis"; //#region src/checkpoints.d.ts declare function checkpointInjectPayload(checkpoint: TaskCheckpoint): { source: ProducerMessageSource & { kind: typeof RECAP_SOURCE_KIND; plugin: typeof RECAP_PLUGIN; form: 'snapshot'; sections: Array<{ name: string; text: string; }>; }; content: Array<{ type: 'text'; text: string; }>; }; //#endregion //#region src/service.d.ts interface RecapServiceOptions { store: RecapStore; now?: () => number; id?: () => string; readEvents: (sessionId: string) => RecapLogEvent[] | undefined; readContract?: (sessionId: string) => TaskContract | undefined; /** * Whether a session is a delegated child thread. Recaps and checkpoints describe a * human-driven conversation, and a lead agent's dispatch prompt reaches the child as * its own user message, so message-level source checks cannot exclude it. Absent keeps * every session in scope. */ isSubagentSession?: (sessionId: string) => boolean; llm?: LlmTextCaller; host?: unknown; createInjectMessage?: (payload: ReturnType) => unknown; } declare class RecapService { private readonly options; private settings; private cards; private checkpoints; private storageFailed; private disposed; private pending; private cardEpoch; private checkpointEpoch; private jobs; private checkpointRevisions; private checkpointInFlight; private readonly now; private readonly customId?; constructor(options: RecapServiceOptions); status(sessionId?: string): RecapStatus; autoWorkActive(): boolean; dispose(): Promise; updateSettings(settings: Omit, expectedRevision: number): Promise; call(endpoint: string, payload: unknown, signal: AbortSignal): Promise; private isSubagent; onSessionEvent(sessionId: string, event: RecapLogEvent): Promise; idleReturn(sessionId: string, signal?: AbortSignal): Promise; refresh(sessionId: string, signal?: AbortSignal): Promise; cancelCard(cardId: string, sessionId?: string): Promise; retryCard(cardId: string, sessionId?: string, hostSignal?: AbortSignal): Promise; handlePreStep(input: { sessionId: string; messages: T[]; step: number; signal: AbortSignal; next: () => Promise<{ kind: string; messages?: T[]; [flag: string]: unknown; }>; }): Promise<{ kind: string; messages?: Array; [flag: string]: unknown; }>; private capture; private generateCard; private enrichCheckpoint; private latestCheckpoint; private nextCheckpointRevision; private clearCheckpointInFlight; private requireCard; private isCardCurrent; private abortKind; private route; private mintId; private hasId; private snapshot; private commit; private persistProposed; private assertLive; private settledStatus; private serialize; } //#endregion //#region src/storage.d.ts declare const recapDomain: { name: string; version: number; /** v2 rows stay readable: absent model routes fill defaults. */ compatibleVersions: number[]; tables: { state: import("@deepseek-ai/dsh-storage-domain").DomainTableSpec; }; }; type RecapDomainHandle = { table(name: 'state'): { get(key: string): unknown; put(key: string, value: unknown): Promise; delete(key: string): Promise; entries(): IterableIterator<[string, unknown]>; }; close(): Promise; }; declare function domainStore(domain: RecapDomainHandle): RecapStore; //#endregion //#region src/index.d.ts declare const name = "@klarkxy/dsh-recap"; declare const inject: readonly ["connection", "webServer", "storageDomain", "sessions", "llm"]; declare module '@deepseek-ai/cordis' { interface Context { recap: RecapService; } } declare function toLogEvent(event: { seq: number | bigint; type: string; time: number; data: unknown; }): RecapLogEvent; declare function createPluginUserMessage(payload: ReturnType): unknown; declare function apply(ctx: Context): Promise; //#endregion export { CHAT_EVENTS_SLOT, RECAP_PLUGIN, RECAP_RPC_CHANNEL, RecapService, apply, createPluginUserMessage, defaultSettings, domainStore, inject, name, recapDomain, toLogEvent }; //# sourceMappingURL=index.d.ts.map