description: "Client Tool presentation plugin for the dsh web client: whole-call tree composition, the keyed per-tool view slot, and the built-in atomic tool cards."
English | 中文
dsh-client-ui-tool is the client Tool presentation plugin of the dsh web client: it renders every tool call in the conversation. ui-conversation dispatches each ordered tool-call Conversation Node through the matching key of conversation.chat.node; this package renders its root and Code Dispatch children, then dispatches every atomic call through the keyed tool.call.toolview slot. Unregistered Tool names use the generic card. Business UI packages register only their wire Tool names and atomic views — they do not pair Session events, rebuild the transcript, or own root/subcall topology, because the Runtime remains authoritative for call/result pairing, lifecycle, and recursive subCalls projection.
Tool calls appear in the conversation as cards: a root call tree with its nested subcalls, each atomic call rendered by its owning view. Users see running, successful, failed, and interrupted states that come only from the frozen call/result slice, and can open files or inspect calls through the Host callbacks.
An owning business package registers its wire Tool name into tool.call.toolview:
ctx.slots.inject('tool.call.toolview', () =>
ctx.slots.register({
name: 'tool.call.toolview',
key: '<wire tool name>',
}, BusinessToolRow))
The owner payload is ToolCallOwnerProps: callId, toolName, the frozen block, optional cwd and home, the session-authorized loadImage loader (for a view whose result carries durable images), and plain openFile/inspect callbacks. A Code Dispatch block retains its event's parentCallId; a root Session call has no such field, so descendants route through the same keyed dispatch — a registered view such as read_image renders its card there, and unregistered descendants keep the generic flattened form. Path summaries relativize to the Session cwd first, then replace a leftover POSIX Host home with ~; filePath and Host open keep the authored filesystem path. The registration receives the normal Session slot runtime share but no React node or Runtime service.
This package owns the generic fallback and the built-in shell/pwsh, read, read_image, write/edit, running str_replace_editor create/str_replace, grep/glob, web, todo, question, and Code Dispatch presentations. Structured cards derive directly from first-party raw event fields; Host presentCall and presentResult values never enter the Client. Running and settled foreground standard bash/pwsh and terminal_send calls use terminal cards at the root and in Code Dispatch children, subject to the same argument, result, and error checks. Persistent bash/pwsh calls use terminal cards only while running. Shell output ending in a recognized spill-policy notice uses expandable generic output in shell rows and generic output in Details; a displaced or omitted exit marker cannot establish success. Settled persistent-shell results stay generic because reset and partial-output diagnostics do not always describe one process exit status; root persistent results are expandable, while background acknowledgements remain collapsed. A successful question row pairs call questions with result answers by their stable ids and shows readable question/answer lines when expanded. A cancelled or interrupted row shows its verdict and original questions without inventing answers. Unsupported, malformed, or ambiguous inputs fall back to flattened Tool input/result text. ui-skill demonstrates a business-owned registration for skill.
These pages cover the conversation host, the view slots, and the card models.
tool-call nodes to this package.skill tool.None, as the package is a browser-side tool presentation layer that renders logged calls without changing model context.
None; this package neither assembles nor sends a provider request.
These limits define the dispatch depth and the view ownership; they are current package constraints.
run_code from PTC mode program bindings — production events produce one dispatch level; the recursive Runtime/UI contract supports nesting.ui-conversation locale namespace — tool titles, row chrome, and Cordis-free primitive labels use that dictionary; presenter models retain locale keys or data rather than rendered wording.Runtime invariant: No companion is published. Tool composition is browser-only and contributes no events or cross-plugin mutable state; slot ownership is checked by ui-slots.