{"_id":"@buckeyestudio/toh-client-ui-subagent","name":"@buckeyestudio/toh-client-ui-subagent","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-subagent","description":"Subagent conversation catalog, continuation routing UI, and '@' reference source","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-subagent"},"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-locale","@buckeyestudio/toh-client-runtime","@buckeyestudio/toh-client-ui-conversation","@buckeyestudio/toh-client-ui-primitives","@buckeyestudio/toh-client-ui-input-trigger"],"platform":"web"}},"license":"MIT","author":{"name":"buckeyestudio"},"peerDependencies":{"@buckeyestudio/toh-client-locale":"^0.1.1-rc.2","@buckeyestudio/toh-client-runtime":"^0.1.1-rc.2","@buckeyestudio/toh-client-ui-input-trigger":"^0.1.1-rc.2","@buckeyestudio/toh-client-ui-conversation":"^0.1.1-rc.2","@buckeyestudio/toh-invariants":"^0.1.1-rc.2","@buckeyestudio/toh-subagent":"^0.1.1-rc.2","@buckeyestudio/toh-token-meter":"^0.1.1-rc.2","@buckeyestudio/cordis":"^4.0.1"},"devDependencies":{"@types/react":"~19.2.3","@types/react-dom":"~19.2.3","react":"^19.2.8","react-dom":"^19.2.8","@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-input-trigger":"^0.1.1-rc.2","@buckeyestudio/toh-client-ui-primitives":"^0.1.1-rc.2","@buckeyestudio/toh-client-ui-conversation":"^0.1.1-rc.2","@buckeyestudio/toh-client-ui-slots":"^0.1.1-rc.2","@buckeyestudio/toh-subagent":"^0.1.1-rc.2","@buckeyestudio/toh-invariants":"^0.1.1-rc.2","@buckeyestudio/cordis":"^4.0.1","@buckeyestudio/toh-token-meter":"^0.1.1-rc.2"},"scripts":{"bundle":"tsdown","watch":"tsdown --watch"},"_id":"@buckeyestudio/toh-client-ui-subagent@0.1.1-rc.2","bugs":{"url":"https://github.com/dustinwloring1988/theopen-harness/issues"},"homepage":"https://github.com/dustinwloring1988/theopen-harness#readme","_integrity":"sha512-qFecsyxWgUeLj6gLT5Wr3jvtnbE11SwlYi+yygY5EVoDdq7HKJRpikAyhi8z58I5pyqZihKyr3TFglwZ/xBrCA==","_resolved":"/home/runner/work/theopen-harness/theopen-harness/dist/npm/buckeyestudio-toh-client-ui-subagent-0.1.1-rc.2.tgz","_from":"file:/home/runner/work/theopen-harness/theopen-harness/dist/npm/buckeyestudio-toh-client-ui-subagent-0.1.1-rc.2.tgz","_nodeVersion":"24.19.0","_npmVersion":"11.17.0","dist":{"integrity":"sha512-qFecsyxWgUeLj6gLT5Wr3jvtnbE11SwlYi+yygY5EVoDdq7HKJRpikAyhi8z58I5pyqZihKyr3TFglwZ/xBrCA==","shasum":"6941d6d95490d9c1eeb76656d80d1dae111bc8f6","tarball":"https://registry.npmjs.org/@buckeyestudio/toh-client-ui-subagent/-/toh-client-ui-subagent-0.1.1-rc.2.tgz","fileCount":14,"unpackedSize":66128,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDXfF7evjbYgWUYbplF7UfYOzriY3ARRz1TgDLtE6wAWQIhANO6cA6n31pvkThC3g+DV5ySNC37RVrvtIzMM9Co1arB"}]},"_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-subagent_0.1.1-rc.2_1787489667916_0.1489104047828187"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-23T12:54:27.807Z","0.1.1-rc.2":"2026-08-23T12:54:28.052Z","modified":"2026-08-23T12:54:28.407Z"},"maintainers":[{"name":"buckeyestudio","email":"dustinwloring1988@gmail.com"}],"description":"Subagent conversation catalog, continuation routing UI, and '@' reference source","homepage":"https://github.com/dustinwloring1988/theopen-harness#readme","repository":{"type":"git","url":"git+https://github.com/dustinwloring1988/theopen-harness.git","directory":"packages/client/ui-subagent"},"author":{"name":"buckeyestudio"},"bugs":{"url":"https://github.com/dustinwloring1988/theopen-harness/issues"},"license":"MIT","readme":"# @buckeyestudio/toh-client-ui-subagent\n\n[English](README.md) | 中文\n\nWeb subagent 功能 owner：向 `conversation.session.header.lineage` 贡献当前 title 谱系导航，向会话编辑器链贡献按原因区分的只读替代呈现，并保留注册到 `ctx.inputTriggers` 的既有 `@` 引用 source。\n\n页头谱系 renderer 通过标准 `useSessions` 钩子读取 `subagentsByParent` 与会话摘要。普通会话保留当前 title，并在存在后代时，于页头操作行之前追加 `/` 和后代数量下拉菜单。每一级 subagent 面包屑都使用数量触发器的 12px 字号，并将 title 与固定显示的双向箭头组合成一个控件；当前面包屑保留主标签颜色和 500 字重，祖先面包屑则使用三级标签颜色和 400 字重。悬停组合控件 150ms 后会打开其直接 parent 目录，ArrowDown 保留为键盘入口；点击祖先面包屑会取消待打开的菜单并仅向上导航。每个目录都可切换 sibling，并会加粗选中行；目录 label 优先于会话摘要 title，尚未加载目录的每个切换器都会自动请求该目录。只有当前 subagent 会追加自己的后代数量下拉菜单。过长的面包屑 title 会截断，而双向箭头始终保留。数量触发器会统计仅含 subagent 的完整后代谱系，在普通 fork 处停止，并在任一计入统计的后代处于 `running` 时显示活动仍在进行。紧凑树仍以直接目录为权威依据：可继续和 one-shot 行会显示 mode、`running`／`inactive` 活动状态和由日志支撑的可选 title，尾随列则在上行显示提供方的持久化 token 用量总计，在下行显示活跃轮次耗时。token 用量总计为四个互不重叠的 `tokenUsage` 桶之和。视觉耗时在不足一天时精确到秒，达到一天后则最多使用两个相邻单位——天／小时、近似月份／天或近似年份／月份——而悬停信息与无障碍名称会保留精确的天／小时／分钟／秒数值。耗时会累加已完成的 `subagentTiming` 轮次，仅在运行中 child 存在未结束轮次时每秒递增一次，并在 child 变为 inactive 后冻结；被中断的未结束轮次以其同一切面的 `active.through` 为上界，绝不使用更新的会话元数据。没有 label 的 one-shot 行会回退到其会话 id，而损坏、不受支持或不可用的行仍保持可读但禁用。每个健康行的 `hasChildren` 提示会在交互前决定是否显示展开控件，因此已知叶子节点从不显示箭头；每层目录仅在其中至少一个健康行是分支时才预留展开列，使完全不含分支的层级能从最前面的状态标记开始。展开分支时，会立即为每个已知直接后代预留一行禁用的加载行，随后再用该 child 的权威目录懒加载结果替换这些占位行。每个可见分支都会上报给运行时，使成员帧只在树正被消费的位置触发去抖动刷新。选择任意深度的条目都会使用该行的确切地址 `{parentSessionId, childSessionId, mode}` 调用 `SessionRuntime.openSubagent()`。组件局部状态负责树的可见性、已展开分支、键盘焦点与运行中耗时时钟。ArrowRight／ArrowLeft 展开和折叠分支；ArrowUp／ArrowDown、Home、End 与 Escape 用于导航或关闭树；关闭后焦点返回触发器。样式只使用 token。\n\none-shot child 始终选用只读编辑器，并将 transcript（文本记录）说明为已完成的执行记录。可继续 child 仅在其确切 parent 不可用且 child 未在运行时选用只读编辑器，并以文案说明恢复路径；此类 child 仍在运行期间，selector 会让位给普通编辑器——其输入区与 Send 操作被禁用，但独立的 Stop 保持可用，停止后只读替代恢复。确切 parent 存活时，可继续 child 保留普通输入 chrome，其会话通过 `subagent.prompt` 路由提示词：child 运行期间输入和 Send 保持可用，因为每条后续消息都会进入 child 的 FIFO inbox，而独立的 Stop 经由 `subagent.interrupt` 路由。本包绝不接收宿主上下文，也不调用面向模型的工具。目录与编辑器行为由 [Web subagent 对话 Agent Note](../../../.agents/notes/implemented/feature/2026-07-27-web-subagent-conversations.zh.md) 与[当前轮次中断 Agent Note](../../../.agents/notes/implemented/feature/2026-08-06-continuable-subagent-interrupt.zh.md) 规定。\n\n普通侧边栏会省略带 subagent origin 的会话行，因此 parent 页头目录是它们的导航入口。普通 fork 仍保留在侧边栏中。\n\n`@` source 仍然刻意保持独立且惰性。候选是从 `ctx.sessions.list` 零 RPC 得到的运行中 child；pick 会插入字面文本 `@label `，codec 投影为 `@label`。它不参与命令裁决，也不会把 label 解析成继续执行地址。\n\n## 模型体验\n\n### 用户提示词中的 subagent label 文本\n\n#### 模型看到的内容\n\n只有旧有 `@` 引用 source 会影响模型输入：pick 的候选以字面文本 `@label` 进入普通用户消息，没有专用内容块或宿主侧解析。浏览目录、导航 child 与查看持久化 transcript 都不会添加提示词 section；已接收的继续交互内容会经宿主 subagent 适配器成为普通 FIFO 用户消息。\n\n#### Token 影响\n\n有条件且仅追加：字面 `@label` 或用户后续消息只会向对应的新用户消息增加 token。目录与 transcript 操作增加零模型 token。\n\n#### KV Cache 影响\n\n仅追加。本包绝不改写更早的请求 token。\n\n## 已知限制与暂缓事项\n\n- **目录没有持久化结果**：活动状态与计时无法区分完成、失败或取消，且 UI 不公开 Activation 身份；停止能力仅限编辑器上针对运行中可继续 child 的当前轮次 Stop。\n- **`@` 引用仍是显示标题文本**：重复或改名后的 label 会有歧义，因此它们刻意不获得继续执行语义。\n","readmeFilename":"README.zh.md","_rev":"1-7ef18cea5c33f70ab28e9b9da5e8c2f9"}