import type { ToolDefinition, ToolExposure } from "./extensions/tool-types.ts"; import { type SourceInfo } from "./source-info.ts"; export type ToolSelectionSource = "default-tools-setting" | "built-in-defaults" | "tools-allowlist" | "explicit-selection" | "no-built-in-tools" | "no-tools"; /** Where the session's starting tool selection came from and what it contained. */ export interface ToolSelectionStatus { source: ToolSelectionSource; /** Human-readable origin, for example `the defaultTools setting with +codemode`. */ description: string; /** Tool names the selection asked for, in order. */ names: string[]; /** `+name`/`-name` entries applied on top of the defaults by the `tools` option or `--tools`. */ modifiers: string[]; } export interface ToolStatus { name: string; active: boolean; exposure: ToolExposure; /** Human-readable owner, for example `built-in`, `built-in extension "codemode"`, or `extension ./ext.ts`. */ source: string; /** Raw source path: ``, `builtin:codemode`, an extension file, or ``. */ sourcePath: string | undefined; /** First line of the tool description. */ summary: string; /** Why the tool is not active and how to enable it. Absent for active tools. */ inactiveReason?: string; } /** A selected tool name with no registered tool behind it, and why. */ export interface UnavailableToolStatus { name: string; reason: string; } export interface ToolStatusReport { selection: ToolSelectionStatus; /** Every registered tool: active ones first, then inactive ones, each group in registration order. */ tools: ToolStatus[]; /** Selected names that no built-in, extension, SDK custom tool, or MCP server registered. */ missing: UnavailableToolStatus[]; /** Selected names removed by an exclusion before they could register. */ excluded: UnavailableToolStatus[]; } export interface ToolStatusInput { tools: ReadonlyArray<{ definition: Pick; sourceInfo?: SourceInfo; }>; activeToolNames: readonly string[]; selection: ToolSelectionStatus; isExcluded?: (name: string) => boolean; /** Present only when the session runs from an explicit tool allowlist. */ isAllowed?: (name: string) => boolean; } export declare function describeToolSelection(source: ToolSelectionSource, modifiers: readonly string[]): string; export declare function buildToolStatusReport(input: ToolStatusInput): ToolStatusReport; export interface ToolStatusFormatStyle { heading(text: string): string; dim(text: string): string; warning(text: string): string; } /** Render a report as plain multi-line text; pass a style to add terminal colors. */ export declare function formatToolStatus(report: ToolStatusReport, style?: ToolStatusFormatStyle): string; //# sourceMappingURL=tool-status.d.ts.map