/** * Friendly, secret-safe tool activity copy shared by chat channels. * * `toolHintFor()` preserves the original one-line hint behavior used by * streaming channels. `formatToolActivityLine()` is the richer final-only * status used by Slack and Telegram: it includes a bounded preview from a small * allowlist of scalar argument fields, but never serializes arbitrary tool * input or invokes getters/proxies. */ import type { AgentStreamEvent } from "./index.js"; /** The routing variant of {@link AgentStreamEvent}, narrowed for the formatter below. */ type ProviderStatusStreamEvent = Extract; export declare function toolHintFor(toolName: string): string; /** * Separator the runtime puts between a subagent's profile name and the tool it * ran (`researcher▸Read`), so concurrent subagents stay visually distinct on * surfaces that render one flat list. */ export declare const SUBAGENT_TOOL_SEPARATOR = "\u25B8"; /** Whether this tool name launches a subagent (case/namespace insensitive). */ export declare function isSubagentLaunchToolName(toolName: string): boolean; /** * Split a forwarded subagent tool name into its profile and the underlying * tool. A name without the separator is returned unchanged with no profile, so * this is safe to call on every tool name. */ export declare function splitSubagentToolName(toolName: string): { readonly profile?: string; readonly tool: string; }; export interface ToolActivityLineOptions { /** Agent root used to relativize local paths; defaults to process.cwd(). */ readonly workspaceRoot?: string; /** Home directory collapsed to `~`; defaults to os.homedir(). */ readonly homeDir?: string; } /** * Set the process-wide roots used to relativize paths in activity previews. * * The streaming call site formats an event with no per-message context to hand * a workspace down from, so without this the root falls back to * `process.cwd()` — which for a service-managed agent is whatever directory the * supervisor happened to start it in, not the agent root. Explicit * {@link ToolActivityLineOptions} still take precedence. * * A module-level default is the right shape here because a host process runs * exactly one agent; call it once during composition. */ export declare function setToolActivityPathRoots(roots: ToolActivityLineOptions): void; /** * Format one cumulative tool-activity line for a user-visible transient status. * A malformed/proxied/accessor-backed argument object produces action-only copy. * Local absolute paths are shown relative to the agent root (or `~`) so the * operator's account/machine layout is not exposed in chat surfaces. */ export declare function formatToolActivityLine(toolName: string, toolArguments?: unknown, options?: ToolActivityLineOptions): string; /** * Format one applied live-input activity line for every structured stream. * The original follow-up remains a human message; this helper exposes only a * one-line, secret-redacted preview capped at the same 40-code-point boundary * used by transient tool activity. */ export declare function formatLiveInputActivityLine(text: string, options?: ToolActivityLineOptions): string; /** * Format the one non-tool detail retained after a chat activity ledger collapses * a completed subagent. Runtime-native completions can carry a direct summary; * the in-process Agent tool carries a structured text envelope whose answer or * `reason:` line precedes an `` block. Only that human-facing outcome * survives — status/count boilerplate and the tool log never do. */ export declare function formatSubagentOutcomeActivityLine(content: unknown, isError: boolean, options?: ToolActivityLineOptions): string | undefined; /** * Format one activity line for a provider routing transition, or `undefined` * when the kind is not worth a line. * * Only the two transitions an operator can act on are rendered: a route change * and a same-model retry. The request lifecycle is pure noise on a chat surface, * and `failover_completed` is deliberately silent — the run's final answer * carries the attribution, and a completion line would arrive after the answer * it explains. * * Route references are the full `sdk:provider:model` key rather than a short * name so the line can be matched against the configured chain unambiguously. * These come from the router's own `modelKey()`, never from tool arguments, so * no preview sanitization applies. */ export declare function formatProviderStatusLine(event: ProviderStatusStreamEvent): string | undefined; /** Return the leaf action from built-in, MCP-qualified, or forwarded tool names. */ export declare function toolNameLeaf(toolName: string): string; export {}; //# sourceMappingURL=tool-hints.d.ts.map