UNPKG

@code-yeongyu/senpi

Version:

Coding agent CLI with read, bash, edit, write tools and session management

36 lines • 2.18 kB
import type { ReadonlySessionManager } from "../../core/session-manager.ts"; export declare const MAX_HANDED_PAGE_CHARACTERS: number; export declare const MAX_HANDED_PAGES_CHARACTERS: number; export declare const SHOW_HTML_PAGE_NAME = "show_html_page"; export type HandedPageSession = Pick<ReadonlySessionManager, "getEntries">; /** * Pages handed but not yet in the session's entries, by tool call id: calls in one turn run concurrently, * and each result is recorded only after it returns. One ledger belongs to one session's page producer (the * html-render extension instance, or the brain's ToolHost for a hand), so it is released with it. Only * calls the model issued (ctx.issuedByModel, which the session sets for agent-loop and Cursor exec-frame * calls) are held: a call another tool makes through ctx.executeTool() (id <parent>/<n>) or an extension * makes through pi.executeTool() (id codemode-<uuid>) is never recorded in the transcript. */ export type PendingHandedPages = Map<string, number>; /** * Whether a page of `characters` inlined characters still fits the session's budget, and what the session already * hands. A page that fits is held in `pending` until its result is in the entries. */ export declare function reserveHandedPage(session: HandedPageSession, pending: PendingHandedPages, toolCallId: string, characters: number): { readonly inlined: boolean; readonly alreadyHanded: number; }; /** What a page result says when its images were inlined for the viewer. */ export declare const IMAGES_INLINED = "Local images were inlined."; /** What a page result says instead of IMAGES_INLINED when the session's budget has no room for its images. */ export declare const overSessionBudgetText: (alreadyHanded: number) => string; /** The result text of a written page: where it went, and whether a viewer on another machine sees its images. */ export declare function handedPageText(page: { readonly path: string; readonly shown: boolean; readonly imagesInlined: boolean; readonly fitsPage: boolean; readonly alreadyHanded: number; readonly inlinedLength: number; }): string; //# sourceMappingURL=handed-pages.d.ts.map