@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
33 lines • 1.97 kB
TypeScript
import type { Context, Message } from "@earendil-works/pi-ai";
import type { AnthropicSubscriptionAuthLane } from "./options.ts";
import type { ContentBlockParam, Options } from "./sdk-boundary.ts";
import type { AnthropicSubscriptionSessionEntry } from "./session-registry.ts";
export type SentMessage = Extract<Message, {
role: "user" | "toolResult";
}>;
export type SessionConfigFingerprint = {
systemPromptHash: string;
toolsetHash: string;
};
export declare function sessionSyncDigest(value: unknown): string;
export declare function sentMessages(context: Context): SentMessage[];
/**
* The one selection rule for "message the provider was sent". Branch-derived and
* context-derived hashes MUST share it: a content-less user message that only one
* side skips shifts every later index and reports a false divergence.
*/
export declare function isTransmittedMessage(message: {
role: string;
}): message is SentMessage;
/**
* Applies the transmitted-message rule itself, so no caller can produce a hash
* list that disagrees with another caller's by forgetting the filter.
*/
export declare function sentMessageHashes(messages: readonly SentMessage[]): string[];
export declare function sentHashPrefixDigest(hashes: readonly string[], count?: number): string;
/** Pure divergence guard: every non-proven continuation resolves to cold-seed. */
export declare function sentHashesForEntry(entry: AnthropicSubscriptionSessionEntry): readonly string[] | undefined;
export declare function recordSyncedStream(entry: AnthropicSubscriptionSessionEntry, hashes: readonly string[]): void;
export declare function configFingerprint(options: Options, context: Context, authLane: AnthropicSubscriptionAuthLane, accountName: string): SessionConfigFingerprint;
export declare function buildDeltaPromptBlocks(messages: readonly SentMessage[], customToolNameToSdk?: ReadonlyMap<string, string>): ContentBlockParam[];
//# sourceMappingURL=session-sync.d.ts.map