import type { ToolCall } from "@stigmer/protos/ai/stigmer/agentic/agentexecution/v1/message_pb";
import { ToolKind } from "@stigmer/sdk";
/**
 * Discriminated tool categories for type-aware rendering.
 *
 * This is the presentation taxonomy. Classification (name -> kind) lives in
 * `@stigmer/sdk`'s `resolveToolKind` (single source of truth, shared with the
 * runner and Go CLI); this file maps each {@link ToolKind} to its presentation
 * metadata (label, primary argument). `"mcp"` covers tools originating from an
 * MCP server, whose names are dynamic.
 */
export type ToolCategory = "shell" | "read" | "write" | "edit" | "delete" | "search" | "list" | "fetch" | "web-search" | "think" | "sub-agent" | "internal" | "mcp" | "unknown";
/**
 * How much of a settled tool call to reveal inline by default in the thread.
 *
 * - `"summary"` — a compact one-line row. Used when the label + primary arg +
 *   result summary already tell the story (`Read foo.ts`, `Edit bar.ts +40 -0`,
 *   `Search … 2 matches`). The full detail is one click away.
 * - `"preview"` — the row renders its result body **always** (no card chevron),
 *   because the one-liner cannot convey what happened so the content itself IS
 *   the information (a shell command's output, an MCP result such as a
 *   screenshot, a fetched page, a web-search answer, or an unrecognised tool's
 *   output). The body's own in-place reveal expands it beyond the height budget.
 *
 * This is the *disclosure* axis (how much of a result to show); it is
 * orthogonal to {@link isRunGroupableCategory} (whether consecutive same-kind
 * calls fold into one chip). A category can be result-rich but never folded
 * (`shell`), or foldable but never previewed (`read`).
 */
export type ToolDisclosure = "summary" | "preview";
/**
 * Returns the default inline {@link ToolDisclosure} for a presentation
 * category. This is the headless policy behind the thread's "keep a live
 * preview for shell/MCP/unknown, keep generic tools compact" behaviour;
 * consumers can override per {@link ToolKind} via {@link registerToolPresenter}.
 */
export declare function defaultDisclosureForCategory(category: ToolCategory): ToolDisclosure;
/**
 * Returns whether a presentation category participates in run-grouping — i.e.
 * whether a maximal run of consecutive calls of this category folds into one
 * collapsible chip. See {@link RUN_GROUPABLE_CATEGORIES} and `segmentToolCalls`.
 */
export declare function isRunGroupableCategory(category: ToolCategory): boolean;
/**
 * Returns whether a category's primary argument is a file path — the file
 * tools (read / write / edit / delete). These render their path filename-first
 * via {@link FilePathLink} (full path on hover) in headers and previews, rather
 * than as a raw, often-absolute string.
 */
export declare function isFileCategory(category: ToolCategory): boolean;
/** Resolved display metadata for a tool call, returned by {@link resolveToolCategory}. */
export interface ToolCategoryInfo {
    /** Semantic category of the tool. */
    readonly category: ToolCategory;
    /** Human-readable label for the tool (e.g., `"Shell"`, `"Read"`). */
    readonly label: string;
    /** JSON argument key that provides the primary display value (e.g., `"command"` for shell). */
    readonly primaryArgField: string;
    /** Fallback argument keys tried when the primary key is absent. */
    readonly fallbackArgFields: readonly string[];
}
/**
 * Returns true if the tool is an internal state-management tool that should not
 * appear in the message thread (todos are rendered through a dedicated surface).
 */
export declare function isInternalTool(toolName: string): boolean;
/**
 * Returns true for a tool call the runner collapsed in place — a superseded
 * same-turn duplicate of an approval gate.
 *
 * When the agent emits one resource twice in a turn and both attempts are denied,
 * the runner overlays the FIRST as the WAITING_APPROVAL gate and blanks the
 * redundant twin to a content-less SKIPPED row (it cannot drop it — the backend's
 * append-only-at-identity guard forbids removing a committed tool-call id). This
 * predicate recognizes that blanked twin so the thread renders one card, not two.
 *
 * The signature is precise: a SKIPPED row with no approval flag, no result, no
 * error, and no args preview. A genuinely user-skipped tool always retains the
 * preview/args the user reviewed before skipping, so it is never blank and is
 * never hidden by this.
 */
export declare function isCollapsedToolCall(toolCall: ToolCall): boolean;
/** Maps a {@link ToolKind} to its presentation metadata. */
export declare function toolKindToCategoryInfo(kind: ToolKind, toolName: string): ToolCategoryInfo;
/**
 * Resolves a tool's presentation category from its name + MCP slug.
 *
 * Classification is delegated to `@stigmer/sdk`'s name-based resolver (the same
 * table the runner and Go CLI use), then mapped to presentation metadata. When
 * the caller has the full {@link ToolCall}, prefer {@link resolveToolCategoryFromCall},
 * which also honours the wire `tool_kind` for forward compatibility.
 */
export declare function resolveToolCategory(toolName: string, mcpServerSlug?: string): ToolCategoryInfo;
/**
 * Like {@link resolveToolCategory} but uses the wire `tool_kind` when present,
 * falling back to name-based resolution for legacy executions.
 */
export declare function resolveToolCategoryFromCall(toolCall: ToolCall): ToolCategoryInfo;
/**
 * Resolves presentation metadata from an explicit wire {@link ToolKind} plus the
 * tool name and MCP slug. Used by surfaces that carry a denormalized `tool_kind`
 * but not a full {@link ToolCall} — notably `PendingApproval`. Falls back to
 * name-based resolution when the kind is unset (legacy executions).
 */
export declare function resolveToolCategoryFromKind(toolKind: ToolKind, toolName: string, mcpServerSlug?: string): ToolCategoryInfo;
/**
 * Converts a snake_case or camelCase tool name into a
 * human-readable title.
 *
 * @example
 * humanizeToolName("apply_mcp_server") // "Apply MCP Server"
 * humanizeToolName("deleteAgent")      // "Delete Agent"
 */
export declare function humanizeToolName(name: string): string;
/**
 * Extracts the most relevant argument value from a tool call
 * based on its category (command for shell tools, path for file
 * tools, slug for MCP tools, etc.).
 *
 * Returns `null` when the tool has no recognised arguments.
 */
export declare function extractPrimaryArg(toolCall: ToolCall): string | null;
/**
 * Extracts the primary argument value from a JSON string
 * (typically `PendingApproval.argsPreview`). Returns `null` if
 * parsing fails or the expected field is not found.
 *
 * When the caller has the denormalized wire `tool_kind` (as `PendingApproval`
 * does), pass it so resolution honors the same kind that drives the label/icon —
 * a file tool whose NAME the classifier doesn't recognize still resolves to its
 * `path` field. This mirrors {@link extractPrimaryArg}, which uses the wire kind
 * via `resolveToolCategoryFromCall`. Falls back to name-based resolution when
 * the kind is unset (legacy executions).
 */
export declare function extractPrimaryArgFromPreview(toolName: string, argsPreview: string, mcpServerSlug?: string, toolKind?: ToolKind): string | null;
/**
 * Extracts the file content body from a JSON `argsPreview` string
 * for write/edit tool categories. Scans the same field names used
 * by the post-execution {@link ToolCallDetail} renderer so that
 * the approval preview matches the completed tool call display.
 *
 * Returns `null` if parsing fails or no content field is found.
 */
export declare function extractWriteContentFromPreview(argsPreview: string): string | null;
//# sourceMappingURL=tool-categories.d.ts.map