@code-yeongyu/senpi
Version:
Coding agent CLI with read, bash, edit, write tools and session management
24 lines • 1.49 kB
TypeScript
import type { AssistantMessage } from "@earendil-works/pi-ai";
export type AssistantEditReason = "empty" | "not-assistant" | "not-found" | "stale-leaf";
/** Wire-level code for an assistant-edit failure; stable across transports. */
export type AssistantEditCode = "empty" | "not_assistant" | "not_found" | "stale_leaf";
export declare class AssistantEditError extends Error {
readonly reason: AssistantEditReason;
constructor(reason: AssistantEditReason, message: string);
get code(): AssistantEditCode;
}
/** Thrown by every tree mutation while a response is streaming; outranks the stale-leaf guard. */
export declare class SessionStreamingError extends Error {
readonly code: "streaming";
constructor();
}
/** Optimistic-concurrency guard: the caller's leaf token must equal the session's current leaf. */
export declare function assertExpectedLeaf(expectedLeafId: string | undefined, currentLeafId: string | null): void;
export declare function assistantTextEquals(original: AssistantMessage, text: string): boolean;
/**
* Text replaces every content block: thinking signatures and tool calls belong to the abandoned
* response, and a leaf ending in tool calls without results is rejected by providers.
* Model identity and usage stay so per-path cost and context estimates remain accurate.
*/
export declare function buildEditedAssistantMessage(original: AssistantMessage, text: string): AssistantMessage;
//# sourceMappingURL=edited-assistant-message.d.ts.map