/** * Session import/export/share/copy/name command bodies extracted from * interactive-mode. * * These drive session serialization (JSONL/HTML export, JSONL import, secret * gist share), clipboard copy of the last agent message, and session naming * through narrow per-command host seams. `getPathCommandArgument` stays host-side * (pure parser, tested directly and shared by export/import); interactive-mode * keeps thin delegating wrappers, so the `/import` behaviour test keeps * exercising it unchanged. */ import type { SessionManager } from "@caupulican/pi-agent-core/node"; import type { EditorComponent, TUI } from "@caupulican/pi-tui"; import { Spacer, Text } from "@caupulican/pi-tui"; import type { AgentSession } from "../../core/agent-session.ts"; import type { AgentSessionRuntime } from "../../core/agent-session-runtime.ts"; import { MissingSessionCwdError } from "../../core/session-cwd.ts"; import type { EditorOverlayHost } from "./editor-overlay-host.ts"; import type { ExtensionUiHost } from "./extension-ui-host.ts"; type PathCommand = "/export" | "/import"; export interface ExportCommandHost { readonly session: Pick; getPathCommandArgument(text: string, command: PathCommand): string | undefined; showStatus(message: string): void; showError(message: string): void; } export interface ImportCommandHost { getPathCommandArgument(text: string, command: PathCommand): string | undefined; showError(message: string): void; showStatus(message: string): void; readonly extensionUiHost: Pick; loadingAnimation: { stop: () => void; } | undefined; readonly statusContainer: { clear: () => void; }; readonly runtimeHost: Pick; renderCurrentSessionState(): void; promptForMissingSessionCwd(error: MissingSessionCwdError): Promise; handleFatalRuntimeError(prefix: string, error: unknown): Promise; } export interface ShareCommandHost { showError(message: string): void; showStatus(message: string): void; readonly session: Pick; readonly ui: TUI; readonly overlayHost: EditorOverlayHost; readonly editor: EditorComponent; } export interface CopyCommandHost { readonly session: Pick; showError(message: string): void; showStatus(message: string): void; } export interface NameCommandHost { readonly sessionManager: Pick; readonly chatContainer: { addChild: (child: Text | Spacer) => void; }; showWarning(message: string): void; readonly session: Pick; readonly ui: { requestRender: () => void; }; } export declare function handleExportCommand(host: ExportCommandHost, text: string): Promise; export declare function handleImportCommand(host: ImportCommandHost, text: string): Promise; export declare function handleShareCommand(host: ShareCommandHost): Promise; export declare function handleCopyCommand(host: CopyCommandHost): Promise; export declare function handleNameCommand(host: NameCommandHost, text: string): void; export {}; //# sourceMappingURL=session-io-commands.d.ts.map