{"_id":"@buckeyestudio/toh-client-ui-tool","name":"@buckeyestudio/toh-client-ui-tool","dist-tags":{"next":"0.1.1-rc.2","latest":"0.1.1-rc.2"},"versions":{"0.1.1-rc.2":{"name":"@buckeyestudio/toh-client-ui-tool","description":"Client Tool call-tree renderer and keyed per-tool presentation slot","version":"0.1.1-rc.2","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/dustinwloring1988/theopen-harness.git","directory":"packages/client/ui-tool"},"type":"module","main":"lib/index.js","types":"lib/types/index.d.ts","exports":{".":{"types":"./lib/types/index.d.ts","default":"./lib/index.js"},"./invariant":{"types":"./lib/types/invariant.d.ts","default":"./lib/invariant.js"},"./client":{"types":"./lib/types/client/index.d.ts","default":"./lib/client.js"},"./src/*":"./src/*","./package.json":"./package.json"},"toh":{"client":{"inject":["@buckeyestudio/toh-client-connection","@buckeyestudio/toh-client-runtime","@buckeyestudio/toh-client-locale","@buckeyestudio/toh-client-ui-conversation"],"platform":"web"}},"license":"MIT","author":{"name":"buckeyestudio"},"dependencies":{"clsx":"^2.0.0"},"peerDependencies":{"@buckeyestudio/cordis":"^4.0.1","@buckeyestudio/toh-api-remotes":"^0.1.1-rc.2","@buckeyestudio/toh-client-connection":"^0.1.1-rc.2","@buckeyestudio/toh-invariants":"^0.1.1-rc.2","@buckeyestudio/toh-client-locale":"^0.1.1-rc.2","@buckeyestudio/toh-client-ui-conversation":"^0.1.1-rc.2","@buckeyestudio/toh-client-runtime":"^0.1.1-rc.2"},"devDependencies":{"@testing-library/react":"^16.1.0","@types/react":"~19.2.3","react":"^19.2.8","react-dom":"^19.2.8","@buckeyestudio/cordis":"^4.0.1","@buckeyestudio/toh-api-remotes":"^0.1.1-rc.2","@buckeyestudio/toh-client-connection":"^0.1.1-rc.2","@buckeyestudio/toh-client-locale":"^0.1.1-rc.2","@buckeyestudio/toh-client-runtime":"^0.1.1-rc.2","@buckeyestudio/toh-client-test-runtime":"^0.1.1-rc.2","@buckeyestudio/toh-client-ui-conversation":"^0.1.1-rc.2","@buckeyestudio/toh-client-ui-primitives":"^0.1.1-rc.2","@buckeyestudio/toh-client-ui-slots":"^0.1.1-rc.2","@buckeyestudio/toh-invariants":"^0.1.1-rc.2"},"scripts":{"bundle":"tsdown","watch":"tsdown --watch"},"_id":"@buckeyestudio/toh-client-ui-tool@0.1.1-rc.2","bugs":{"url":"https://github.com/dustinwloring1988/theopen-harness/issues"},"homepage":"https://github.com/dustinwloring1988/theopen-harness#readme","_integrity":"sha512-oIn9EZF8bAo5hLXqal72I5hA5pJvZlidX5+rHyvNBTqYjmRjF0sEbjI37ZVSTgU3Wnt8bn0uGJkoZem4eyIJqg==","_resolved":"/home/runner/work/theopen-harness/theopen-harness/dist/npm/buckeyestudio-toh-client-ui-tool-0.1.1-rc.2.tgz","_from":"file:/home/runner/work/theopen-harness/theopen-harness/dist/npm/buckeyestudio-toh-client-ui-tool-0.1.1-rc.2.tgz","_nodeVersion":"24.19.0","_npmVersion":"11.17.0","dist":{"integrity":"sha512-oIn9EZF8bAo5hLXqal72I5hA5pJvZlidX5+rHyvNBTqYjmRjF0sEbjI37ZVSTgU3Wnt8bn0uGJkoZem4eyIJqg==","shasum":"7089711e1cf4d9348c8a78fdd3f824a23d6f32d8","tarball":"https://registry.npmjs.org/@buckeyestudio/toh-client-ui-tool/-/toh-client-ui-tool-0.1.1-rc.2.tgz","fileCount":32,"unpackedSize":132595,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCXh9cExKIRQ9Ys4m2BMYwLXCvfhqd+KmaN2QTTtoaU+gIhAJDcwElfZItpxAE6pBVBrwavhKyJGaiNYFdgbeA2NDcF"}]},"_npmUser":{"name":"buckeyestudio","email":"dustinwloring1988@gmail.com"},"directories":{},"maintainers":[{"name":"buckeyestudio","email":"dustinwloring1988@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/toh-client-ui-tool_0.1.1-rc.2_1787489500138_0.4542335588112474"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-23T12:51:39.923Z","0.1.1-rc.2":"2026-08-23T12:51:40.296Z","modified":"2026-08-23T12:51:40.561Z"},"maintainers":[{"name":"buckeyestudio","email":"dustinwloring1988@gmail.com"}],"description":"Client Tool call-tree renderer and keyed per-tool presentation slot","homepage":"https://github.com/dustinwloring1988/theopen-harness#readme","repository":{"type":"git","url":"git+https://github.com/dustinwloring1988/theopen-harness.git","directory":"packages/client/ui-tool"},"author":{"name":"buckeyestudio"},"bugs":{"url":"https://github.com/dustinwloring1988/theopen-harness/issues"},"license":"MIT","readme":"# @buckeyestudio/toh-client-ui-tool\n\n[English](README.md) | 中文\n\nClient 工具展示插件。`ui-conversation` 通过 `conversation.chat.node` 的匹配 key 分发每个已排序的 `tool-call` Conversation Node；本包渲染其中的 root 及其 Code Dispatch 子调用，并把每个原子调用通过 keyed slot `tool.call.toolview` 分发。没有注册的工具名称使用通用卡片。\n\n业务 UI 包只注册 wire 工具名称和原子视图，不配对会话事件、不重建 transcript（文本记录），也不拥有 root/subcall 拓扑。运行时仍对 call/result 配对、生命周期和递归 `subCalls` 投影拥有最终决定权；conversation view 仍对 ChatFlow 位置拥有最终决定权。\n\n## 渲染约定\n\n`ToolCallTree` 接收一个已经包含递归 `subCalls` 的 root `ToolCallBlock`、selection 状态、会话 `cwd`，以及用于打开文件和检查调用的 Host 回调。它递归遍历标准调用块，让 root 与任意深度的 child 经过同一条原子分发路径，不订阅独立的 parent-to-children map。\n\n每个 root 和 child 包装层都保留 `data-chat-anchor-key=\"call:<id>\"` 与 `data-chat-call-id` DOM 约定，供分页和 selection 使用。\n\n本包还通过 `ToolDetails` 填充 `conversation.details.tool`。行 renderer 与详情 renderer 共用同一组面向 `terminal`、`read`、`diff`、`search` 和 `web` render intent 的纯 card model。未知的 intent 标签和格式错误的 wire card 数据都会回退为压平的工具结果文本。\n\n通用行把已知工具名称归类为 search、read、shell、write、edit、code 或 generic 变体。运行中、成功、失败和中断状态只来自冻结的 call/result slice。只有用户调用 Host 打开文件回调时，文件路径才相对会话 `cwd` 解析；展示代码不读取会话服务。\n\n## 原子工具视图\n\n拥有该视图的业务包将其 wire 工具名称注册进 `tool.call.toolview`：\n\n```ts ignore-check\nctx.slots.inject('tool.call.toolview', () =>\n  ctx.slots.register({\n    name: 'tool.call.toolview',\n    key: '<wire tool name>',\n  }, BusinessToolRow))\n```\n\nowner 载荷为 `ToolCallOwnerProps`：`callId`、`toolName`、冻结的 `block`、可选 `cwd` 与 `home`，以及普通的 `openFile`、`inspect` 回调。路径摘要先相对会话 cwd 缩短，再把剩余的 POSIX 宿主家目录写成 `~`；`filePath` 与 Host 打开仍使用作者给出的文件系统路径。注册项会收到常规的会话 slot 运行时共享数据，但不会收到 React node、运行时服务或 root/subcall 知识。\n\n本包当前拥有 generic fallback，以及 shell/pwsh、read、write/edit、grep/glob、web、todo、question 和 Code Dispatch 的内置展示。`ui-skill` 展示了业务包自行拥有的 `skill` 注册项。\n\n各类卡片的上限与 fallback 规则仍由对应的 [terminal](../../../.agents/notes/implemented/feature/2026-07-28-web-terminal-card.zh.md)、[diff](../../../.agents/notes/implemented/feature/2026-07-30-web-diff-card.zh.md)、[read](../../../.agents/notes/implemented/feature/2026-07-30-web-read-card-frontend.zh.md)、[search](../../../.agents/notes/implemented/feature/2026-07-30-web-search-card.zh.md) 和 [web](../../../.agents/notes/implemented/feature/2026-07-30-web-result-card-frontend.zh.md) Agent Note 负责。\n\n## 模型体验\n\n无，因为本包只渲染已经记录的工具调用和结果，不改变模型请求、工具执行或会话事件。\n\n#### KV Cache 影响\n\n无。本包只负责 Client 展示。\n\n## 已知限制与后续工作\n\n- Host 不把 `run_code` 暴露为 Code Mode 程序 binding，因此生产事件只产生一层分发；递归的运行时/UI 约定支持嵌套。\n- 第一方工具视图集中在本包，可以通过 keyed slot 独立迁移到各自所属的业务包。\n- 工具文案复用 `ui-conversation` locale namespace。\n","readmeFilename":"README.zh.md","_rev":"1-8814c722b2376ff78c4fab01f3df461f"}