import type { SessionRef } from '../../agent/session-ref.js'; import type { ElicitationHandler } from '../../agent/elicitation-router.js'; import type { AgentModelInput } from '../../agent/types.js'; import type { TraceActor } from '../../agent/session/session-identity.js'; import type { PermissionMode } from '../../agent/types/sdk-types.js'; import type { TrustedSkillLedger } from '../trusted-skill-ledger.js'; import type { ImageAttachment } from '../input/attachments.js'; import type { ResolvedResumeTarget } from '../resume-session.js'; import type { FastModeContext, FastModeController } from '../../agent/fast-mode.js'; export type ResumeSwapResult = { ok: true; sessionId: string; } | { ok: false; reason: string; }; export type ThinkingUiMode = 'summary' | 'live' | 'digest' | 'off'; export interface ToolEvent { toolName: string; toolUseId: string; input: string; inputRaw?: string; result?: string; isError?: boolean; } export interface TurnRecord { user: string; assistant: string; timestamp: number; costUsd?: number; durationMs?: number; inputTokens?: number; outputTokens?: number; toolEvents?: ToolEvent[]; userContentBlocks?: import('@anthropic-ai/sdk/resources').ContentBlockParam[]; assistantContentBlocks?: import('@anthropic-ai/sdk/resources').ContentBlockParam[]; } export interface SessionStats { totalTurns: number; totalCostUsd: number; unpricedTurns: number; totalTokens: number; totalDurationMs: number; sessionStartTime: number; turnCosts: number[]; turnTokens: Array<{ input: number; output: number; cache: number; footprint?: number; }>; turns: TurnRecord[]; model: AgentModelInput; permissionMode: PermissionMode; thinkingUi?: ThinkingUiMode; sessionId?: string; name?: string; cwd?: string; source?: 'cli' | 'telegram' | 'daemon'; telegramChatId?: number; actor?: TraceActor; } export interface Writer { line(text?: string): void; raw(text: string): void; success(text: string): void; info(text: string): void; warn(text: string): void; error(text: string): void; } export interface UiSurface { clearScreen(): void; repaintStatusLine(): void; } export interface SlashContext { session: SessionRef; stats: SessionStats; out: Writer; ui: UiSurface; ledger?: TrustedSkillLedger; fastMode?: FastModeController; getFastModeContext?: () => FastModeContext; requestResume?: (target: ResolvedResumeTarget) => Promise; mcpManager?: import('../../agent/mcp/index.js').McpManager; getCompositor?: () => import('../terminal-compositor.js').TerminalCompositor | null; setSoftStopHandler?: (handler: (() => void) | null) => void; onStageChange?: (stage: import('../commands/interactive/loop-stage.js').LoopStage, signals?: import('../commands/interactive/loop-stage.js').StageSignals) => void; onContextProgress?: () => void | Promise; transcript?: { appendTurn(userInput: string, assistantText: string): Promise; appendUser?(userInput: string): Promise; }; swapElicitationHandler?: (handler: ElicitationHandler | null) => void; stdinElicitationHandler?: ElicitationHandler; suspendFooter?: () => void; resumeFooter?: () => void; } export type SlashResult = 'continue' | 'exit' | 'forward' | { rerun: string; } | { kind: 'submit'; message: string; } | { kind: 'prefill'; message: string; }; export interface SlashCommand { name: string; aliases?: string[]; summary: string; usage?: string; hint?: string; flags?: readonly string[]; acceptsAttachments?: boolean; handler(ctx: SlashContext, args: string, _attachments?: readonly ImageAttachment[]): Promise; }