UNPKG

@code-yeongyu/senpi

Version:

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

62 lines • 2.54 kB
import type { ShareRedactionContext, ShareRedactionTally } from "./share-redaction.ts"; export type ShareDecision = "upload" | "include-outputs" | "exclude-outputs" | "review" | "cancel"; export interface ShareAskOptions { /** Tool outputs left out of this preview; above 0, offer to include them. */ readonly omittedOutputs: number; /** Tool outputs are in this preview; offer to leave them out again. */ readonly includesOutputs: boolean; } export interface ShareUploadResult { readonly code: number | null; readonly stdout: string; readonly stderr: string; readonly aborted: boolean; } export interface ShareDependencies { readonly disabledReason: () => string | undefined; readonly checkGh: () => "ok" | "missing" | "logged-out"; readonly render: (sanitize: <T>(value: T) => T) => string; readonly context: ShareRedactionContext; readonly ask: (preview: string, options: ShareAskOptions) => Promise<ShareDecision>; readonly showReviewCopy: (path: string) => void; readonly upload: (html: string) => Promise<ShareUploadResult>; readonly viewerBase: string | undefined; } export type ShareOutcome = { readonly kind: "disabled"; readonly reason: string; } | { readonly kind: "gh-missing"; } | { readonly kind: "gh-logged-out"; } | { readonly kind: "export-failed"; readonly message: string; } | { readonly kind: "cancelled"; } | { readonly kind: "upload-failed"; readonly message: string; } | { readonly kind: "shared"; readonly gistUrl: string; readonly viewerUrl: string | undefined; }; export interface PreparedShare { readonly html: string; readonly sha256: string; readonly tally: ShareRedactionTally; readonly includesOutputs: boolean; readonly omittedOutputs: number; } export declare function prepareShare(render: ShareDependencies["render"], context: ShareRedactionContext, includeOutputs?: boolean): PreparedShare; export declare function describeShare(prepared: PreparedShare, viewerBase: string | undefined): string; /** * `/share` end to end (#3524): nothing is uploaded until the user has seen a * description of the exact redacted bytes and chosen Upload. Tool outputs stay * out unless the user includes them, which re-renders and re-asks. A review copy is * written only on request, into a private temporary directory that is removed * on every exit path. */ export declare function runShare(deps: ShareDependencies): Promise<ShareOutcome>; //# sourceMappingURL=share-session.d.ts.map