meowtail 0.2.0-alpha.0 → 0.2.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (163) hide show
  1. package/AGENT-COMPONENTS.md +65 -65
  2. package/ASSISTANT.md +35 -35
  3. package/JSON.md +11 -11
  4. package/README.md +413 -385
  5. package/THIRD_PARTY_NOTICES.md +8 -0
  6. package/dist/src/chat/assistant-composer.js +58 -98
  7. package/dist/src/chat/assistant-content.d.ts +1 -3
  8. package/dist/src/chat/assistant-content.js +36 -44
  9. package/dist/src/chat/assistant-markdown.js +4 -8
  10. package/dist/src/chat/assistant-question.js +13 -14
  11. package/dist/src/chat/assistant.js +27 -26
  12. package/dist/src/chat/attachments.d.ts +3 -2
  13. package/dist/src/chat/attachments.js +43 -34
  14. package/dist/src/chat/composer-panel.d.ts +16 -0
  15. package/dist/src/chat/composer-panel.js +11 -0
  16. package/dist/src/chat/composer.d.ts +7 -3
  17. package/dist/src/chat/composer.js +71 -22
  18. package/dist/src/chat/conversation.js +2 -2
  19. package/dist/src/chat/index.d.ts +1 -0
  20. package/dist/src/chat/index.js +1 -0
  21. package/dist/src/chat/message-list.js +1 -1
  22. package/dist/src/chat/message.js +3 -3
  23. package/dist/src/chat/question.js +1 -1
  24. package/dist/src/chat/sources.js +1 -1
  25. package/dist/src/chat/task.js +9 -15
  26. package/dist/src/chat/tool-call.js +7 -14
  27. package/dist/src/components/accordion.d.ts +24 -0
  28. package/dist/src/components/accordion.js +50 -0
  29. package/dist/src/components/action-rail.d.ts +19 -0
  30. package/dist/src/components/action-rail.js +13 -0
  31. package/dist/src/components/add-button.js +1 -1
  32. package/dist/src/components/alert.d.ts +2 -0
  33. package/dist/src/components/alert.js +2 -1
  34. package/dist/src/components/app-bar.d.ts +17 -0
  35. package/dist/src/components/app-bar.js +10 -0
  36. package/dist/src/components/avatar.d.ts +22 -0
  37. package/dist/src/components/avatar.js +44 -0
  38. package/dist/src/components/breadcrumb.js +1 -1
  39. package/dist/src/components/checkbox.d.ts +6 -2
  40. package/dist/src/components/checkbox.js +36 -8
  41. package/dist/src/components/choice-group.d.ts +1 -0
  42. package/dist/src/components/choice-group.js +12 -17
  43. package/dist/src/components/choice-select.d.ts +3 -1
  44. package/dist/src/components/choice-select.js +56 -54
  45. package/dist/src/components/code-block.d.ts +3 -3
  46. package/dist/src/components/code-block.js +31 -27
  47. package/dist/src/components/context-menu.d.ts +16 -0
  48. package/dist/src/components/context-menu.js +49 -0
  49. package/dist/src/components/credential-source.js +12 -12
  50. package/dist/src/components/diff-block.js +1 -1
  51. package/dist/src/components/disclosure.d.ts +2 -2
  52. package/dist/src/components/disclosure.js +1 -1
  53. package/dist/src/components/hover-card.js +2 -2
  54. package/dist/src/components/image-lightbox.js +3 -3
  55. package/dist/src/components/image-preview.js +1 -1
  56. package/dist/src/components/index.d.ts +12 -0
  57. package/dist/src/components/index.js +12 -0
  58. package/dist/src/components/json-block.js +2 -2
  59. package/dist/src/components/json-tree.js +3 -3
  60. package/dist/src/components/link.d.ts +13 -0
  61. package/dist/src/components/link.js +9 -0
  62. package/dist/src/components/list-group.d.ts +1 -1
  63. package/dist/src/components/menu-button.d.ts +13 -0
  64. package/dist/src/components/menu-button.js +10 -0
  65. package/dist/src/components/menu.d.ts +4 -0
  66. package/dist/src/components/menu.js +3 -3
  67. package/dist/src/components/meta-row.d.ts +34 -0
  68. package/dist/src/components/meta-row.js +61 -0
  69. package/dist/src/components/nav-item.js +2 -5
  70. package/dist/src/components/number-input.d.ts +29 -0
  71. package/dist/src/components/number-input.js +137 -0
  72. package/dist/src/components/output-block.js +8 -15
  73. package/dist/src/components/page-frame.d.ts +6 -2
  74. package/dist/src/components/page-frame.js +2 -2
  75. package/dist/src/components/path-picker.js +9 -14
  76. package/dist/src/components/pill.js +2 -5
  77. package/dist/src/components/popover.js +4 -4
  78. package/dist/src/components/process-group.d.ts +2 -2
  79. package/dist/src/components/progress.d.ts +15 -0
  80. package/dist/src/components/progress.js +12 -0
  81. package/dist/src/components/rail-item.d.ts +2 -2
  82. package/dist/src/components/rail-section.d.ts +1 -1
  83. package/dist/src/components/read-block.js +2 -2
  84. package/dist/src/components/resource-card.d.ts +1 -1
  85. package/dist/src/components/resource-link.d.ts +1 -1
  86. package/dist/src/components/risk-confirmation.js +2 -5
  87. package/dist/src/components/search-block.js +2 -3
  88. package/dist/src/components/segmented-control.js +3 -3
  89. package/dist/src/components/skeleton-boundary.js +4 -7
  90. package/dist/src/components/slider.d.ts +22 -0
  91. package/dist/src/components/slider.js +49 -0
  92. package/dist/src/components/table.d.ts +41 -0
  93. package/dist/src/components/table.js +146 -0
  94. package/dist/src/components/tabs.d.ts +1 -1
  95. package/dist/src/components/tabs.js +11 -20
  96. package/dist/src/components/terminal-block.js +6 -6
  97. package/dist/src/components/text-shimmer.js +2 -5
  98. package/dist/src/components/web-block.js +3 -3
  99. package/dist/src/components/work-card.d.ts +2 -2
  100. package/dist/src/components/work-card.js +1 -1
  101. package/dist/src/icons/README.md +13 -2
  102. package/dist/src/icons/icon-frame.d.ts +11 -0
  103. package/dist/src/icons/icon-frame.js +4 -0
  104. package/dist/src/icons/icon-source.d.ts +17 -0
  105. package/dist/src/icons/icon-source.js +6 -0
  106. package/dist/src/icons/icon.d.ts +44 -37
  107. package/dist/src/icons/icon.js +55 -128
  108. package/dist/src/icons/index.d.ts +1 -0
  109. package/dist/src/icons/index.js +1 -0
  110. package/dist/src/icons/lucide.d.ts +1 -0
  111. package/dist/src/icons/lucide.js +4 -0
  112. package/dist/src/registry/index.d.ts +99 -5
  113. package/dist/src/registry/index.js +28 -3
  114. package/dist/src/shared/execution-state.js +7 -7
  115. package/dist/src/theme/chat/composer-panel.styles.d.ts +1 -0
  116. package/dist/src/theme/chat/composer-panel.styles.js +47 -0
  117. package/dist/src/theme/chat/composer.styles.js +69 -60
  118. package/dist/src/theme/chat/task.styles.js +5 -6
  119. package/dist/src/theme/components/accordion.styles.d.ts +1 -0
  120. package/dist/src/theme/components/accordion.styles.js +63 -0
  121. package/dist/src/theme/components/action-rail.styles.d.ts +1 -0
  122. package/dist/src/theme/components/action-rail.styles.js +47 -0
  123. package/dist/src/theme/components/alert.styles.js +42 -1
  124. package/dist/src/theme/components/app-bar.styles.d.ts +1 -0
  125. package/dist/src/theme/components/app-bar.styles.js +48 -0
  126. package/dist/src/theme/components/avatar.styles.d.ts +1 -0
  127. package/dist/src/theme/components/avatar.styles.js +52 -0
  128. package/dist/src/theme/components/button.styles.js +9 -0
  129. package/dist/src/theme/components/card.styles.js +2 -0
  130. package/dist/src/theme/components/code-block.styles.js +7 -0
  131. package/dist/src/theme/components/context-menu.styles.d.ts +1 -0
  132. package/dist/src/theme/components/context-menu.styles.js +14 -0
  133. package/dist/src/theme/components/dialog.styles.js +7 -0
  134. package/dist/src/theme/components/link.styles.d.ts +1 -0
  135. package/dist/src/theme/components/link.styles.js +33 -0
  136. package/dist/src/theme/components/list-group.styles.js +1 -0
  137. package/dist/src/theme/components/menu.styles.js +9 -3
  138. package/dist/src/theme/components/meta-row.styles.d.ts +1 -0
  139. package/dist/src/theme/components/meta-row.styles.js +66 -0
  140. package/dist/src/theme/components/number-input.styles.d.ts +1 -0
  141. package/dist/src/theme/components/number-input.styles.js +106 -0
  142. package/dist/src/theme/components/output-block.styles.js +9 -0
  143. package/dist/src/theme/components/page-frame.styles.js +7 -1
  144. package/dist/src/theme/components/page-header.styles.js +7 -0
  145. package/dist/src/theme/components/progress.styles.d.ts +1 -0
  146. package/dist/src/theme/components/progress.styles.js +71 -0
  147. package/dist/src/theme/components/resource-card.styles.js +7 -0
  148. package/dist/src/theme/components/slider.styles.d.ts +1 -0
  149. package/dist/src/theme/components/slider.styles.js +129 -0
  150. package/dist/src/theme/components/table.styles.d.ts +1 -0
  151. package/dist/src/theme/components/table.styles.js +156 -0
  152. package/dist/src/theme/components/tag.styles.js +3 -3
  153. package/dist/src/theme/components/toggle.styles.js +10 -0
  154. package/dist/src/theme/components/toolbar.styles.js +7 -0
  155. package/dist/src/theme/index.d.ts +15 -15
  156. package/dist/src/theme/index.js +24 -0
  157. package/dist/src/theme/palette.d.ts +1 -1
  158. package/dist/src/theme/palette.js +1 -1
  159. package/dist/src/theme/shared/code-highlight.tokens.d.ts +6 -6
  160. package/dist/src/theme/shared/code-highlight.tokens.js +6 -6
  161. package/dist/src/theme/tokens.d.ts +7 -7
  162. package/dist/src/theme/tokens.js +14 -8
  163. package/package.json +9 -4
@@ -1,35 +1,35 @@
1
- # Agent 展示组件与组合
2
-
3
- Meowtail 是组件库,不是 Agent 执行框架。工具调用、委派、消息、权限、网络、持久化与真实执行事实由宿主提供;组件把这些事实组织成可读、可操作的界面。用户口中的 meowface 对应本仓库的 `meowtail`,不另设包名。
4
-
5
- 这轮集中补齐两个高频接合处:扩展既有 `ChatToolCall` 的状态、惰性输入输出和恢复意图;新增 `ChatTask`,把执行、公开答复和有依据的进度分别呈现。消息、活动、问题、附件、来源、代码与输入框继续使用已有组件。没有引入 Agent 专属布局语言、OpenUI runtime、流式协议或另一套设计尺度。
6
-
7
- ## 能力矩阵
8
-
9
- “已有”表示当前仓库已有实现,不表示本轮重做;“补齐”表示本轮新增或扩展;“宿主/后续”说明当前有限边界。
10
-
11
- | 生命周期 / 阅读任务 | 已有能力 | 本轮补齐 | 宿主 / 后续边界 |
12
- | ---------------------------------- | --------------------------------------------------------------------------------------- | --------------------------------------------------------------------- | -------------------------------------------------------------------------- |
13
- | 消息角色、作者、时间、流式文本 | `ChatMessage`、`ChatMessageList`、`ChatConversation`、`AssistantView`;稳定 id 更新消息 | Assistant 默认 part 接入工具与任务 | 宿主归一化事件并更新数据;不解析服务端流式协议 |
14
- | Markdown 与代码 | Assistant 的 `text` 默认安全 Markdown,`code` 复用 `CodeBlock`;未知语言保留纯文本 | 工具输入输出单独按原始文本展示 | 工具字符串不作为 Markdown 或 HTML 执行;不执行代码 |
15
- | 公开执行摘要 | `ChatProcess`、`ProcessGroup/ProcessStep`、Assistant 的 process/activity | `ChatTask` 的 description、executionText | 展示可公开的活动事实;不要求或假定暴露模型私有推理 |
16
- | 工具调用状态 | `ChatToolCall`、`ChatStatus`、`StatusDot` | queued/running/waiting/success/error/cancelled/unknown;complete 兼容 | 状态来自宿主,不从输出存在、超时或未回复推断成功/失败 |
17
- | 输入、输出与长结果 | `ReadBlock`、`TerminalBlock`、`JsonBlock/JsonTree` 等;内部复用 OutputBlock | `ChatToolCall` 的 reactive input/output/outputSummary、折叠及完整复制 | `maxLines` 是显示窗口,不是数据截断;流式 chunk 合并由宿主负责 |
18
- | 多模态工具结果 | `ChatAttachments`、`ImagePreview/ImageLightbox`、媒体与资源组件 | 工具 children 保留普通组合出口 | 宿主给替代说明、来源和受支持资源;不猜测任意二进制格式 |
19
- | 委派、嵌套与并发任务 | Assistant activity/work、`WorkCard`、通用布局与过程分组 | `ChatTask` 及 Assistant 的 task part | 用 children 与 `ChatProcess` 组合树;没有任务调度器或通用树协议 |
20
- | 执行完成与答复送达 | AssistantWork 已分别接 executionText/replyText | `ChatTask` 与 task part 同样明确分开 | success 可以同时显示“公开答复未收到”,不会改成 error |
21
- | plan / todo / 进度 | 原生 ol/li、`ProcessGroup/ProcessStep`、Assistant steps | `ChatTask` 的有标签原生 progress | 数值须有真实依据;未知时省略,不编造百分比或倒计时;计划编辑器留宿主 |
22
- | 等待用户、选项与授权显示 | `ChatQuestion`、`ChoiceGroup`、Assistant questions;必要时 `RiskConfirmation` | 与 waiting task 组合示范 | UI 不定义授权政策;问题未回答、答复提交中与执行失败分别建模 |
23
- | error / retry / cancel / interrupt | `Button variant="stop"`、反馈、Assistant readState 与恢复草稿 | 工具 onRetry/onCancel 意图及禁用状态;Assistant onToolAction | 回调不自动重试或停止任务;取消、打断、重试资格与并发冲突由宿主决定 |
24
- | 引用来源 | `ChatSources`、安全 Markdown 链接、`ResourceLink` | 组合示例中明确来源与产物归属 | 来源由宿主查证;工具与任务不自动搜索或生成引用 |
25
- | 附件、文件产物、代码 diff | `ChatAttachments`、`ResourceLink`、`DiffBlock`、`CodeBlock` | 与任务 footer / Assistant 局部 slot 组合 | 不上传、不应用补丁;受保护资源地址与下载授权留宿主 |
26
- | timing / usage 等元数据 | `DescriptionList/DescriptionItem`、`Inline`、标签 | 复用示范,不增加一套 Agent 元数据 API | 数字与时间由宿主提供,未知值不显示为零;不做计费或用量计算 |
27
- | composer、附件、发送与停止 | `ChatComposer`、完整 Assistant draft/attachments/model/trailing;提交接受与草稿消费分离 | 继续复用;工具取消按钮独立于发送状态 | 流式响应不自动等于发送 pending;停止按钮由宿主放入 trailing 并绑定明确意图 |
28
- | 空态、初次加载、刷新失败 | Assistant readState 的 loading/ready/error、EmptyState | 工具空字符串与缺失结果分开,Task 默认 unknown | refresh error 保留已读正文;没有数据不暗示执行失败 |
29
- | 连接中断、陈旧数据 | Assistant readFeedback/work feedback、显式状态文字 | 示例使用 unknown + 最后已知输出 | 保留上次结果并明确“当前状态未知”;重连与 stale 时间策略由宿主提供 |
30
- | 键盘、焦点与窄容器 | 原生按钮/details、共享布局、Assistant 阅读锚点与窄容器活动对话框 | 新组合覆盖更新时保留展开、长 I/O、320px 局部宽度与嵌套任务 | 不设全局快捷键;reduced motion 沿共享主题;实际验证范围见当次回执 |
31
-
32
- ## 工具调用:数据与执行动作分开
1
+ # Agent display components and composition
2
+
3
+ Meowtail is a component library, not an Agent execution framework. Tool calls, delegation, messages, permissions, networking, persistence, and real execution facts are provided by the host; components organize these facts into a readable, operable interface. What users call meowface corresponds to `meowtail` in this repository; no separate package name exists.
4
+
5
+ This round fills two high-frequency joints: extending the existing `ChatToolCall` state, lazy input/output, and resume intent; and adding `ChatTask` to present execution, public reply, and grounded progress separately. Messages, activity, questions, attachments, sources, code, and the composer continue to use existing components. No Agent-specific layout language, OpenUI runtime, streaming protocol, or other design scale was introduced.
6
+
7
+ ## Capability matrix
8
+
9
+ "Existing" means the current repository already implements it, not that this round reworked it; "Added this round" means new or extended in this round; "Host / later" describes the current finite boundary.
10
+
11
+ | Lifecycle / reading task | Existing capability | Added this round | Host / later boundary |
12
+ | ----------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
13
+ | Message role, author, time, streaming text | `ChatMessage`, `ChatMessageList`, `ChatConversation`, `AssistantView`; stable id updates messages | Assistant default parts connect tools and tasks | The host normalizes events and updates data; it does not parse server streaming protocols |
14
+ | Markdown and code | Assistant `text` is safe Markdown by default, `code` reuses `CodeBlock`; unknown languages stay plain text | Tool input/output are displayed separately as raw text | Tool strings are not executed as Markdown or HTML; code is not executed |
15
+ | Public execution summary | `ChatProcess`, `ProcessGroup/ProcessStep`, Assistant process/activity | `ChatTask` description, executionText | Display publicly shareable activity facts; do not require or assume disclosure of private model reasoning |
16
+ | Tool call state | `ChatToolCall`, `ChatStatus`, `StatusDot` | queued/running/waiting/success/error/cancelled/unknown; complete stays compatible | State comes from the host; success/failure is not inferred from output presence, timeouts, or lack of reply |
17
+ | Input, output, and long results | `ReadBlock`, `TerminalBlock`, `JsonBlock/JsonTree`, etc.; internally reuses OutputBlock | `ChatToolCall` reactive input/output/outputSummary, collapse, and full copy | `maxLines` is a display window, not data truncation; merging streaming chunks is the host's responsibility |
18
+ | Multimodal tool results | `ChatAttachments`, `ImagePreview/ImageLightbox`, media and resource components | Tool children keep an ordinary composition outlet | The host provides alternative descriptions, sources, and supported resources; arbitrary binary formats are not guessed |
19
+ | Delegation, nesting, and concurrent tasks | Assistant activity/work, `WorkCard`, shared layout and process groups | `ChatTask` and the Assistant task part | Compose trees with children and `ChatProcess`; there is no task scheduler or general tree protocol |
20
+ | Execution completion and reply delivery | AssistantWork already wires executionText/replyText separately | `ChatTask` and the task part are equally explicit | success can simultaneously show "public reply not received" without becoming error |
21
+ | plan / todo / progress | native ol/li, `ProcessGroup/ProcessStep`, Assistant steps | `ChatTask` labeled native progress | Values must have a real basis; omit them when unknown, and do not invent percentages or countdowns; the plan editor stays with the host |
22
+ | Waiting for users, options, and authorization display | `ChatQuestion`, `ChoiceGroup`, Assistant questions; `RiskConfirmation` when needed | Composition demos with waiting tasks | The UI does not define authorization policy; unanswered questions, replies being submitted, and execution failures are modeled separately |
23
+ | error / retry / cancel / interrupt | `Button variant="stop"`, feedback, Assistant readState and recovery drafts | Tool onRetry/onCancel intent and disabled states; Assistant onToolAction | Callbacks do not automatically retry or stop tasks; cancel, interrupt, retry eligibility, and concurrency conflicts are decided by the host |
24
+ | Cited sources | `ChatSources`, safe Markdown links, `ResourceLink` | Composition examples make source and artifact ownership explicit | The host verifies sources; tools and tasks do not search or generate citations automatically |
25
+ | Attachments, file artifacts, and code diffs | `ChatAttachments`, `ResourceLink`, `DiffBlock`, `CodeBlock` | Compose with task footer / Assistant local slots | No upload and no patch application; protected resource addresses and download authorization stay with the host |
26
+ | Metadata such as timing / usage | `DescriptionList/DescriptionItem`, `Inline`, tags | Reuse demos without adding another Agent metadata API | Numbers and times come from the host; unknown values are not shown as zero; no billing or usage calculations |
27
+ | composer, attachments, send, and stop | `ChatComposer`, complete Assistant draft/attachments/model/trailing; submission acceptance and draft consumption are separate | Continue reusing them; the tool cancel button is independent of send state | A streaming response does not automatically equal send pending; the host places the stop button in trailing and binds an explicit intent |
28
+ | Empty state, initial load, refresh failure | Assistant readState loading/ready/error, EmptyState | Tool empty strings are separate from missing results; Task defaults to unknown | refresh error keeps the read body; no data does not imply execution failure |
29
+ | Connection interruption and stale data | Assistant readFeedback/work feedback, explicit status text | Examples use unknown + last known output | Keep the last result and make clear "current state unknown"; reconnection and stale-time policies come from the host |
30
+ | Keyboard, focus, and narrow containers | native buttons/details, shared layout, Assistant reading anchors and narrow-container activity dialog | New compositions preserve expansion, long I/O, 320px local width, and nested tasks across updates | No global shortcuts; reduced motion follows the shared theme; see the receipt for the actual verification scope |
31
+
32
+ ## Tool calls: separate data from execution actions
33
33
 
34
34
  ```tsx
35
35
  import { h, signal } from "meowjsx";
@@ -40,12 +40,12 @@ const output = signal<string | undefined>(undefined);
40
40
 
41
41
  const view = (
42
42
  <ChatToolCall
43
- label="读取文件"
43
+ label="Read file"
44
44
  summary="docs/layout.md"
45
45
  state={state}
46
46
  input={'{"path":"docs/layout.md"}'}
47
47
  output={output}
48
- outputSummary="宿主提供的简短结果"
48
+ outputSummary="Short result provided by the host"
49
49
  maxLines={8}
50
50
  collapsible
51
51
  onCancel={() => hostRequestCancel()}
@@ -53,15 +53,15 @@ const view = (
53
53
  );
54
54
  ```
55
55
 
56
- `label` 表示动作,`summary` 是折起时仍可见的简短目标,`statusLabel` 补充具体进展或等待对象。输入输出标题、空内容与 retry/cancel 文字可用 `labels` 局部覆盖。`input/output` 为 `undefined` 时省略该区,空字符串则明确显示空数据;在排队或运行中,缺失输出都不表示错误。`outputSummary` 是宿主给出的展开正文摘要,只在工具 body 展开时可见;折起时需要保留的内容放在 `summary`。组件不删减、推理或改写工具结果。
56
+ `label` names the action, `summary` is the short target still visible when collapsed, and `statusLabel` adds the specific progress or the object being waited for. Input/output titles, empty content, and retry/cancel text can be overridden locally through `labels`. When `input/output` is `undefined`, that section is omitted; an empty string explicitly shows empty data. While queued or running, missing output never means an error. `outputSummary` is the expanded body summary supplied by the host and is visible only while the tool body is expanded; content that must remain visible when collapsed goes in `summary`. The component does not trim, reason about, or rewrite tool results.
57
57
 
58
- `maxLines` 默认沿内部共享的 `OutputBlock`(不新增公共导出);超出时保留开头和结尾,中间用原生 disclosure 展开,复制使用完整原始 payload。文字 I/O 默认换行,代码、终端等专门结构继续用相应组件。工具总 disclosure 与输出中间行 disclosure 分别保留自己的展开状态。
58
+ `maxLines` defaults to the internally shared `OutputBlock` (no new public export); when content exceeds it, the beginning and end are kept, the middle expands through native disclosure, and copying uses the full original payload. Text I/O wraps by default; dedicated structures such as code and terminals continue to use their corresponding components. The tool's overall disclosure and the output's middle-lines disclosure keep their own expansion state separately.
59
59
 
60
- `onRetry`、`onCancel` 只表示用户意图。组件不擅自将 error 改成 running,不自动吞掉既有结果,也不因回调返回就宣称任务成功。Assistant part 的 `canRetry/canCancel` 仅决定入口显隐,不授予执行权限;宿主仍须校验资格。宿主可通过 reactive `retryDisabled/cancelDisabled` 防止重复操作,并明确更新状态。`onActivate` 选择宿主导航动作时,工具行不会同时切换内部 disclosure;不要将整行按钮包在另一个可点击卡片里。
60
+ `onRetry` and `onCancel` express user intent only. The component does not turn error into running on its own, does not silently drop existing results, and does not claim the task succeeded because a callback returned. The Assistant part's `canRetry/canCancel` only decide whether entries are shown and grant no execution permission; the host must still check eligibility. The host can prevent duplicate operations with reactive `retryDisabled/cancelDisabled` and must update state explicitly. When `onActivate` chooses a host navigation action, the tool row does not also toggle its internal disclosure; do not wrap the entire row button in another clickable card.
61
61
 
62
- 为兼容已有调用,单独使用 `ChatToolCall` 省略 state 仍沿 `complete`;新调用建议显式传事实,不知道时用 `unknown`。Assistant 的 tool part 省略 state 使用 unknown,避免缺失事实变成完成。`complete` 与 success 都是执行完成的拼写,不表示公开答复已送达。
62
+ For compatibility with existing calls, using `ChatToolCall` alone and omitting state still follows `complete`; new calls should pass facts explicitly and use `unknown` when they are unknown. The Assistant tool part uses unknown when state is omitted, so a missing fact does not become completion. `complete` and success are both spellings of execution completion and do not mean the public reply was delivered.
63
63
 
64
- ## 任务:执行、推进与等待分别可见
64
+ ## Tasks: execution, progress, and waiting are separately visible
65
65
 
66
66
  ```tsx
67
67
  import { h } from "meowjsx";
@@ -70,48 +70,48 @@ import { Button, Inline } from "meowtail";
70
70
 
71
71
  const view = (
72
72
  <ChatTask
73
- title="独立键盘审查"
73
+ title="Independent keyboard review"
74
74
  state="success"
75
- statusLabel="执行成功 · 等待公开答复"
76
- executionText="执行已返回,5 项检查完成。"
77
- replyText="公开答复尚未收到。"
78
- progress={{ value: 5, max: 5, label: "已检查 5 / 5 项" }}
75
+ statusLabel="Execution succeeded · waiting for public reply"
76
+ executionText="Execution returned; 5 checks completed."
77
+ replyText="Public reply not yet received."
78
+ progress={{ value: 5, max: 5, label: "Checked 5 / 5 items" }}
79
79
  footer={
80
80
  <Inline>
81
- <Button variant="outline">查看审查记录</Button>
81
+ <Button variant="outline">View review record</Button>
82
82
  </Inline>
83
83
  }
84
84
  >
85
- <ChatToolCall label="检查焦点顺序" state="success" summary="5 个交互入口" />
85
+ <ChatToolCall label="Check focus order" state="success" summary="5 interaction entry points" />
86
86
  </ChatTask>
87
87
  );
88
88
  ```
89
89
 
90
- `ChatTask` 是带状态和可选内容的语义 section,默认 state 为 unknown,不是执行容器或整卡按钮。`title/state/statusLabel/description/executionText/replyText/progress` 均可由 Signal 更新。`progress` 只接有限有效的数值,要求 `0 <= value <= max` 且 `max > 0`,否则明确抛出错误;未提供时不显示进度条。
90
+ `ChatTask` is a semantic section with state and optional content; its default state is unknown, and it is not an execution container or a whole-card button. `title/state/statusLabel/description/executionText/replyText/progress` can all be updated by Signals. `progress` accepts only finite valid numbers, requiring `0 <= value <= max` and `max > 0`, and explicitly throws otherwise; when not provided, no progress bar is shown.
91
91
 
92
- waiting 应说明“等谁、等什么”:等待用户选项、等待调度和等待外部结果是不同事实。queued 代表尚未开始;running 应有当前活动事实;unknown 适合连接中断后无法确认的状态。无结果、无新消息和无公开答复都不是自动失败条件。
92
+ waiting should say "who and what it is waiting for": waiting for a user option, waiting for scheduling, and waiting for an external result are different facts. queued means not yet started; running should have a current activity fact; unknown fits a state that cannot be confirmed after a connection interruption. No result, no new message, and no public reply are not automatic failure conditions.
93
93
 
94
- ## 组合规则
94
+ ## Composition rules
95
95
 
96
- - 同一工作区使用 `Stack`、`Inline`、`Grid`、`LayoutItem`。并行任务可用 `Grid columns="auto" minColumnWidth="wide"` 随宿主宽度排列;固定列数则保持明确列数,不偷偷变成移动端模板。
97
- - 父布局分配组间 gap;Task 拥有自身 header/body/footer 的内部节奏;工具拥有自己的展开缩进。Task body 默认用一次低对比起始边线与 `spaceSection` 缩进标明内容归属,子任务 footer 留在该边界内,父任务 footer 回到父级轴线,避免相邻动作混淆。普通任务不额外套 Card,工具组不重复添加一圈 panel padding。嵌套任务通过 `ChatProcess` 折叠低频记录,避免每层都展开成长墙。
98
- - 默认收起低频原始结果,保留动作、目标、状态与简短结果。只展开当前需要阅读的一两个工具;折叠不能藏起失败、等待对象或当前活动状态。长输出的显示窗口与完整复制共用同一份数据。
99
- - footer 放普通 `Button`、`ResourceLink`、`Inline`;正文不靠空格或 `space-between` 对齐动作。工具 retry/cancel 动作位于展开 body;放进可折叠内容的 footer 也随祖先折起而隐藏。需要始终可达的全局 Stop / interrupt 应置于折叠区外的普通操作组或 Assistant `headerActions/composerTrailing`,不要藏在任务详情中。不同长度任务保持自然高度,若宿主需要等高卡片,应由宿主明确分配空间,不用占位文本伪造内容。
100
- - 公开 plan 使用原生 ol/li 或过程组件。Task 可以包含子 Task,但树的 id、排序、父子关系与权限仍由宿主决定;不要把任务标题当程序路径执行。
101
- - 可见状态始终有文字,状态点只是装饰。原生 details、button、progress 保留键盘语义;更新状态不主动移动用户焦点。大段输出可在自身区域用键盘阅读。
102
- - 工具输入输出是惰性字符串。不要把 payload 交给 `innerHTML`、事件属性或脚本解释器。Assistant 默认 text 的安全 Markdown 策略与工具文本策略分别成立;自定义 `renderPart` 的安全性由扩展作者继续负责。
103
- - 文件、URL、回调名称、状态枚举及确认显示本身不授予权限。引用来源用 `ChatSources` 或安全链接,产物用 `ResourceLink` / `ChatAttachments`;下载、读取和授权由宿主接管。
96
+ - Use `Stack`, `Inline`, `Grid`, and `LayoutItem` in one workspace. Parallel tasks can use `Grid columns="auto" minColumnWidth="wide"` to arrange themselves by host width; a fixed column count keeps that explicit count and does not silently become a mobile template.
97
+ - The parent layout allocates gaps between groups; Task owns the internal rhythm of its header/body/footer; tools own their own expanded indentation. By default, the Task body marks content ownership with a single low-contrast start edge and `spaceSection` indentation; child-task footers stay inside that boundary, and the parent-task footer returns to the parent axis, so adjacent actions are not confused. Ordinary tasks do not get an extra Card wrapper, and tool groups do not add another ring of panel padding. Nested tasks collapse low-frequency records through `ChatProcess`, so every level does not expand into a long wall.
98
+ - Collapse low-frequency raw results by default and keep actions, targets, states, and short results. Expand only the one or two tools currently worth reading; collapsing must not hide failures, the object being waited for, or the current activity state. The display window for long output and full copy share the same data.
99
+ - footer holds ordinary `Button`, `ResourceLink`, and `Inline`; the body does not align actions with spaces or `space-between`. Tool retry/cancel actions live in the expanded body; a footer placed inside collapsible content is also hidden when its ancestor collapses. A global Stop / interrupt that must always be reachable belongs outside the collapsible region in an ordinary action group or the Assistant `headerActions/composerTrailing`; do not hide it in task details. Tasks of different lengths keep their natural height; if the host needs equal-height cards, the host should allocate space explicitly rather than faking content with placeholder text.
100
+ - Public plans use native ol/li or process components. A Task can contain child Tasks, but the tree's ids, ordering, parent/child relationships, and permissions are still decided by the host; do not execute a task title as a program path.
101
+ - Visible states always have text; the status dot is only decoration. Native details, button, and progress keep their keyboard semantics; updating state does not move user focus on its own. Large output can be read with the keyboard in its own region.
102
+ - Tool input/output are lazy strings. Do not hand payloads to `innerHTML`, event attributes, or a script interpreter. The safe Markdown policy for Assistant default text and the tool text policy hold separately; the security of a custom `renderPart` remains the extension author's responsibility.
103
+ - Files, URLs, callback names, state enums, and confirmation displays by themselves grant no permissions. Cite sources with `ChatSources` or safe links and artifacts with `ResourceLink` / `ChatAttachments`; download, read, and authorization are handled by the host.
104
104
 
105
- ## 完整 Assistant 与局部出口
105
+ ## Complete Assistant and local outlets
106
106
 
107
- Assistant 消息增加 `kind: "tool"` 和 `kind: "task"` 的 typed parts。工具 part 提供 label/summary/state/input/output/outputSummary/maxLines/defaultOpen、动作入口显隐与禁用字段;`onToolAction(messageId, partId, "retry" | "cancel")` 交由宿主处理。Task part 提供标题、独立执行/答复文字、进度与可选 steps。数组按相同稳定 id 不可变更新;相同 id/kind 保留默认组件实例和原生展开状态,改变 kind 则重建该 part。`defaultOpen` 表示初始化展开,不是每次消息更新的强制控制。
107
+ Assistant messages add typed parts with `kind: "tool"` and `kind: "task"`. The tool part provides label/summary/state/input/output/outputSummary/maxLines/defaultOpen, action entry visibility, and disabled fields; `onToolAction(messageId, partId, "retry" | "cancel")` is handed to the host. The Task part provides a title, separate execution/reply text, progress, and optional steps. Arrays update immutably by the same stable id; the same id/kind preserves the default component instance and native expansion state, while changing kind rebuilds that part. `defaultOpen` means initially expanded, not a forced control on every message update.
108
108
 
109
- 超出默认 part 的局部内容继续使用 `renderPart`;不要为一种产物替换整页 Assistant。完整 Assistant 的草稿、附件接纳、发送快照、活动详情、问题与阅读锚点沿[既有合同](ASSISTANT.md)。本轮同步为已有 `AssistantView` JSON catalog 增加有限的 tool/task 消息分支与 `onToolAction` action schema,继续渲染同一组件;没有新增独立 `ChatTask/ChatToolCall` JSON entry、递归任务树或任意对象解释能力。字段支持集见 [JSON 合同](JSON.md),网络协议与实际执行仍由宿主负责。
109
+ Content beyond the default parts continues to use `renderPart`; do not replace the whole Assistant page for one kind of artifact. The complete Assistant's drafts, attachment acceptance, submission snapshots, activity details, questions, and reading anchors follow the [existing contract](ASSISTANT.md). This round also adds finite tool/task message branches and an `onToolAction` action schema to the existing `AssistantView` JSON catalog, still rendering the same components; it adds no separate `ChatTask/ChatToolCall` JSON entry, recursive task tree, or arbitrary object interpretation capability. See the [JSON contract](JSON.md) for the supported field set; network protocols and actual execution remain the host's responsibility.
110
110
 
111
- Meowbook 场景:
111
+ Meowbook scenes:
112
112
 
113
- - `agent-workflow`:并发运行、排队、用户等待、执行成功而答复未收到;包含嵌套任务、原生计划、可选元数据、产物、附件和 diff。
114
- - `agent-workflow-narrow`:同一组合置于宽视口中的 320px 局部宿主,检查长中英文与无空格路径。
115
- - `agent-workflow-assistant`:默认 tool/task parts 与安全 Markdown、活动、待答问题、附件、来源和 composer 共存;按钮驱动本地输出追加、重试与取消,不执行外部请求。
113
+ - `agent-workflow`: concurrent runs, queuing, waiting for the user, and successful execution without a received reply; includes nested tasks, native plans, optional metadata, artifacts, attachments, and diffs.
114
+ - `agent-workflow-narrow`: the same composition placed in a 320px local host inside a wide viewport, checking long Chinese and English text and paths without spaces.
115
+ - `agent-workflow-assistant`: default tool/task parts coexist with safe Markdown, activity, unanswered questions, attachments, sources, and the composer; buttons drive local output appends, retries, and cancellations without making external requests.
116
116
 
117
- 本页是能力和使用边界说明,实际运行、独立审查、截图与安装态结果以当轮验证回执为准;未运行的浏览器、屏幕阅读器和真实后端适配不因这里列出能力就视为通过。
117
+ This page describes capabilities and usage boundaries; actual run, independent review, screenshots, and installed-state results are governed by the verification receipt for that round. Browsers, screen readers, and real backend adapters that were not run are not considered passing just because the capabilities are listed here.
package/ASSISTANT.md CHANGED
@@ -1,8 +1,8 @@
1
- # 完整 Assistant 组合
1
+ # Complete Assistant composition
2
2
 
3
- 状态:新增组合已实现,作者的局部行为回归与独立源码/页面验收进行中;第一阶段五包 tarball 不含本页新能力,不能用其安装通过代替本组合验收。当前尚未正式发布,也未切换 Rossovia 的消费。
3
+ Status: the new composition is implemented, and the author's local behavior regression plus independent source/page acceptance are in progress; the first-stage five-package tarball does not contain the capabilities on this page, so its installed-state pass cannot stand in for acceptance of this composition. Nothing is officially released yet, and Rossovia's consumption has not been switched.
4
4
 
5
- `meowtail/chat` 的 `AssistantView` 提供消息、安全 Markdown、代码、过程、输入框、附件、模型与思考选项、当前活动、后台工作详情及待答问题。默认结构和视觉都在库中;Meowbook 的 `assistant-complete` 场景只提供本地数据和动作。
5
+ `AssistantView` from `meowtail/chat` provides messages, safe Markdown, code, processes, inputs, attachments, model and thinking options, current activity, background work details, and unanswered questions. The default structure and visuals live in the library; the `assistant-complete` scene in Meowbook only supplies local data and actions.
6
6
 
7
7
  ```tsx
8
8
  import { h, signal } from "meowjsx";
@@ -26,47 +26,47 @@ const view = (
26
26
  );
27
27
  ```
28
28
 
29
- 组件由父容器取得受约束高度;标准安装仍需 `createMeowUI` 与 `standardTheme.cssText`,不依赖 Rossovia 的 CSS 或 controller。消息和 composer 使用同一阅读列,回最新只锚定消息区域。活动在宽容器旁显,在窄容器变为同一个原生模态对话框,不重挂消息和草稿。
30
- 回最新动作在消息视口下方使用正常布局流,显示时独占自然高度,隐藏后归还空间;历史正文不会被按钮覆盖,输入框仍由独立区域承担。
29
+ The component takes a constrained height from its parent container; standard installation still needs `createMeowUI` and `standardTheme.cssText`, and does not depend on Rossovia's CSS or controller. Messages and the composer share one reading column, and the return-to-latest action anchors only to the message region. Activity appears beside the container when wide and becomes a single native modal dialog when narrow, without re-mounting messages and drafts.
30
+ The return-to-latest action uses normal layout flow below the message viewport; while shown it claims its natural height, and when hidden it returns that space. Historical body text is never covered by the button, and the composer still has its own region.
31
31
 
32
- ## 数据与动作的归属
32
+ ## Ownership of data and actions
33
33
 
34
- - 传 `draft` 时,宿主是唯一 owner,必须给 `onDraftChange` 或显式 `readOnly`。组件不直接写传入 Signal;不传 `draft` 时,`defaultDraft` 初始化组件自己的临时草稿。宿主拥有持久化。
35
- - `onSubmit` 必须显式返回 `{accepted: true}` 才消费已提交快照。等待时允许继续编辑;没有新编辑的文本可清空,原快照中的附件单独消费,后来添加或替换的附件保留。拒绝和异常保留草稿并显示反馈。该接纳只代表宿主接纳消息,不代表 Agent 已处理或任务完成。
36
- - 默认选文件只在本地保留 `File` 和预览 URL,不上传、不执行、不持久化。宿主提供 `onAttach` 时可返回归一化附件;也可以直接更新受控草稿并返回空值。不要在同一回调中既追加草稿又返回相同附件。预览 URL 由组件卸载时释放;持久消息附件应由宿主换成自己的资源地址。
37
- - 只支持已有序列化附件的宿主可设 `allowAttachments={false}`,不呈现本地文件选择入口;已有附件仍可显示、移除和随消息提交。JSON catalog 的首片使用这一明确边界,不把 File 混入 JSON 草稿。
38
- - `messages`、`activity`、`work`、`questions`、模型与思考选项支持 `MaybeSignal`。用不可变数组更新驱动视图。同一消息和 part 的稳定 `id` 保留其节点;改变 part 的 `kind` 会重建该 part。
39
- - 工作的 `statusText`、`executionText`、`replyText` 都由宿主提供;UI 不将 pending 解释成 running,不把 returned 当目标完成,也不从执行结果推断公开答复已发布。状态点只辅助对应文字。
40
- - 问题状态由宿主的 `open/submitting/answered/unavailable` 事实决定。`onAnswer` 返回不自动把问题标为 answered;异常保留局部答案。`onDismissQuestion` 只通知宿主,没有隐式业务关闭或重试。
41
- - `readState="error"` 保留已给消息并显示失败;`loading`、真实空消息与刷新失败分别呈现。工作详情 `error` 保留正文;`unavailable` 隐去正文。授权与数据撤回仍是宿主职责。
34
+ - When `draft` is passed, the host is the only owner and must provide `onDraftChange` or an explicit `readOnly`. The component does not write to the passed Signal directly; when `draft` is not passed, `defaultDraft` initializes the component's own temporary draft. The host owns persistence.
35
+ - `onSubmit` must explicitly return `{accepted: true}` to consume the submitted snapshot. Editing can continue while waiting; text with no new edits can be cleared, attachments from the original snapshot are consumed separately, and attachments added or replaced later are kept. Rejection and exceptions keep the draft and show feedback. That acceptance only means the host accepted the message; it does not mean the Agent has processed it or that the task is complete.
36
+ - The default file selection only keeps a `File` and preview URL locally; it does not upload, execute, or persist. When the host provides `onAttach`, it can return normalized attachments; it can also update a controlled draft directly and return null. Do not both append to the draft and return the same attachment in one callback. Preview URLs are released when the component unmounts; persisted message attachments should be replaced by the host with its own resource addresses.
37
+ - Hosts that only support existing serialized attachments can set `allowAttachments={false}` to remove the local file selection entry; existing attachments can still be displayed, removed, and submitted with the message. The first slice of the JSON catalog uses this explicit boundary and does not mix File into JSON drafts.
38
+ - `messages`, `activity`, `work`, `questions`, model and thinking options support `MaybeSignal`. Drive the view with immutable array updates. A stable `id` for the same message and part preserves its node; changing a part's `kind` rebuilds that part.
39
+ - Work's `statusText`, `executionText`, and `replyText` are all provided by the host; the UI does not interpret pending as running, does not treat returned as goal completion, and does not infer from execution results that a public reply has been published. The status dot only supports the corresponding text.
40
+ - Question state is determined by the host's `open/submitting/answered/unavailable` facts. A return from `onAnswer` does not automatically mark the question answered; exceptions keep local answers. `onDismissQuestion` only notifies the host; there is no implicit business close or retry.
41
+ - `readState="error"` keeps the messages already given and shows the failure; `loading`, truly empty messages, and refresh failure render separately. Work details keep the body on `error` and hide the body on `unavailable`. Authorization and data withdrawal remain the host's responsibility.
42
42
 
43
- ## 内容与局部定制
43
+ ## Content and local customization
44
44
 
45
- 消息 `parts` 包含 `text`、`code`、`process`、`attachments`、`tool` 和 `task`。`text` 默认安全 Markdown:原始 HTML 与图片作为文字,只有明确的 HTTP、HTTPS、mailto 链接可导航;代码 part 使用共享 `CodeBlock`。过程使用原生 disclosure,过程步骤只接归一化的标题、说明、状态文字与视觉 tone。
45
+ Message `parts` include `text`, `code`, `process`, `attachments`, `tool`, and `task`. `text` is safe Markdown by default: raw HTML and images are shown as text, and only explicit HTTP, HTTPS, and mailto links navigate; code parts use the shared `CodeBlock`. Processes use native disclosure, and process steps take only normalized titles, descriptions, status text, and visual tone.
46
46
 
47
- `renderPart` 可只替换一个 part,返回 `undefined` 使用默认实现;`renderWorkDetail` 只替换详情正文。`composerTrailing` 和 `headerActions` 放局部控件,无需替换整页。自定义组件仍在原渲染树中消费祖先 Context,不另建 renderer root。
47
+ `renderPart` can replace just one part, and returning `undefined` uses the default implementation; `renderWorkDetail` replaces only the detail body. `composerTrailing` and `headerActions` hold local controls without replacing the whole page. Custom components still consume ancestor Context in the original render tree and do not create another renderer root.
48
48
 
49
- 新增默认文案集中在 `assistantCopy`;宿主可用 `labels={{ latest: "回到最新", send: "发送" }}` 覆盖局部文字,不需要另装国际化运行时。数据中的标题、状态与说明仍由宿主提供。
49
+ New default copy is centralized in `assistantCopy`; hosts can override local text with `labels={{ latest: "Back to latest", send: "Send" }}` without installing a separate internationalization runtime. Titles, statuses, and descriptions in the data are still provided by the host.
50
50
 
51
- 宿主传历史消息时直接前插 `messages`,组件保留可见消息锚点;向上阅读时追加与流式更新不强制跳到底。`onLoadOlder` 只请求宿主加载,UI 不拥有分页、网络或记录权限。列表使用同一 MeowJSX keyed 机制;删除项释放其组件生命周期。
51
+ When the host passes historical messages, prepend them to `messages` directly, and the component keeps the visible message anchor; appending and streaming updates do not force a jump to the bottom while reading upward. `onLoadOlder` only asks the host to load; the UI does not own pagination, networking, or record permissions. The list uses the same keyed mechanism as MeowJSX; removed items release their component lifecycles.
52
52
 
53
- 模型选择、文件、路径、URL、回调名字及 UI 状态都不授予后端权限。连接、上传、执行、停止、发布、授权与恢复由应用 adapter 接入;这里没有 Agent 执行框架。
53
+ Model selection, files, paths, URLs, callback names, and UI state grant no backend permissions. Connection, upload, execution, stop, publish, authorization, and recovery are wired in by the application adapter; there is no Agent execution framework here.
54
54
 
55
- ## 标准 Agent 内容
55
+ ## Standard Agent content
56
56
 
57
- `tool` part 默认复用 `ChatToolCall`:动作与目标、显式执行状态、惰性 input/output、outputSummary、
58
- 长结果窗口和默认展开。outputSummary 只在展开 body 中显示,折起时的摘要使用 summary。
59
- `canRetry/canCancel` 仅决定是否提供对应入口,不授予执行权限,
60
- `retryDisabled/cancelDisabled` 只控制入口禁用;`onToolAction(messageId, partId, action)`
61
- 通知宿主重试或取消意图,不执行工具、不自行切换状态。动作随工具 body 折起而隐藏;
62
- 全局停止/打断应由宿主放在折叠区域外的 headerActions、composerTrailing 或普通操作组。缺省工具 state 使用 unknown,
63
- 没有输出或未收到公开答复都不自动判为失败。
57
+ The `tool` part reuses `ChatToolCall` by default: action and target, explicit execution state, lazy input/output, outputSummary,
58
+ long-result window, and default expansion. outputSummary appears only in the expanded body; the collapsed summary uses summary.
59
+ `canRetry/canCancel` only decide whether the corresponding entry exists and grant no execution permission.
60
+ `retryDisabled/cancelDisabled` only disable entries; `onToolAction(messageId, partId, action)`
61
+ notifies the host of a retry or cancel intent; it does not execute the tool or switch state on its own. Actions are hidden when the tool body collapses;
62
+ global stop/interrupt should be placed by the host outside the collapsible region in headerActions, composerTrailing, or an ordinary action group. A missing tool state uses unknown,
63
+ and neither missing output nor an unanswered public reply is automatically treated as failure.
64
64
 
65
- `task` part 复用 `ChatTask`,执行状态、executionText、replyText 和有标签的 progress 分别由宿主提供,
66
- 可附已有 process steps。执行 success 与“公开答复尚未收到”可以同时存在。
67
- 相同 message/part 的稳定 id 与 kind 保留组件实例、原生展开和焦点;不可变更新数据即可,
68
- 不必重新创建整个会话。defaultOpen 只表示初始化展开,后续输出更新不强迫重新折起。
65
+ The `task` part reuses `ChatTask`; execution state, executionText, replyText, and labeled progress are each provided by the host,
66
+ and existing process steps can be attached. Execution success and "public reply not yet received" can coexist.
67
+ Stable ids and kinds for the same message/part preserve the component instance, native expansion, and focus; immutable data updates are enough,
68
+ and the whole conversation does not need to be recreated. defaultOpen only means initially expanded; later output updates do not force it to collapse again.
69
69
 
70
- 标准组合与完整能力矩阵见 [Agent 组件说明](AGENT-COMPONENTS.md)。本轮同时扩 typed JSX/Assistant parts 与已有 AssistantView JSON catalog 的有限 tool/task schema、onToolAction action。
71
- JSON 仍不提供独立 ChatTask/ChatToolCall entry、递归任务树、任意对象解释、执行协议或私有推理披露要求;
72
- 确切字段见 [JSON 合同](JSON.md)。
70
+ See [Agent components](AGENT-COMPONENTS.md) for the standard composition and the full capability matrix. This round also extends typed JSX/Assistant parts and the finite tool/task schema and onToolAction action of the existing AssistantView JSON catalog.
71
+ JSON still provides no separate ChatTask/ChatToolCall entry, recursive task tree, arbitrary object interpretation, execution protocol, or requirement to disclose private reasoning;
72
+ see the [JSON contract](JSON.md) for the exact fields.
package/JSON.md CHANGED
@@ -1,6 +1,6 @@
1
- # 有限 JSON UI catalog
1
+ # Finite JSON UI catalog
2
2
 
3
- `meowtail/json` 的 `createMeowUICatalog()` 注册原有 `AssistantView`、`Button`、`Input`、`Stack`,由 `meowjsx/json` 构造同一 MeowJSX VNode。它不复制 renderer、主题、组件实现或业务 store,不从 TypeScript 开放 Props 反射任意属性。
3
+ `createMeowUICatalog()` from `meowtail/json` registers the existing `AssistantView`, `Button`, `Input`, and `Stack`, and builds the same MeowJSX VNodes through `meowjsx/json`. It does not copy the renderer, theme, component implementations, or business stores, and does not reflect arbitrary properties from TypeScript's open Props.
4
4
 
5
5
  ```ts
6
6
  import { createJsonView, parseJsonView } from "meowjsx/json";
@@ -41,15 +41,15 @@ const child = createJsonView(view, {
41
41
  });
42
42
  ```
43
43
 
44
- `messages` 是必填项。消息支持 text/code/process/attachments/tool/task 六个明确分支;过程步骤、活动、后台工作、问题、模型选项、读取状态、草稿和发送快照使用有限 schema。`assistantJsonSchemas` 与 catalog 复用相同定义,校验、描述与类型关联不会各维护一份。controlled 草稿必须接 `onDraftChange` 或设只读;发送是否接受仍由宿主显式返回 `{accepted:true}` 决定。
44
+ `messages` is required. Messages support six explicit branches: text/code/process/attachments/tool/task; process steps, activity, background work, questions, model options, read state, drafts, and submission snapshots use finite schemas. `assistantJsonSchemas` and the catalog reuse the same definitions, so validation, descriptions, and type associations are not maintained in separate copies. A controlled draft must be wired to `onDraftChange` or set to read-only; whether a submission is accepted is still decided by the host explicitly returning `{accepted:true}`.
45
45
 
46
- tool 分支有限接收 label/summary/state/statusLabel、惰性 input/output/outputSummary、maxLines/defaultOpen,
47
- 以及 canRetry/canCancel 和 retryDisabled/cancelDisabled。outputSummary 只在展开 body 中可见,折起摘要使用 summary。
48
- canRetry/canCancel 仅控制动作显隐,不授予权限;`onToolAction` action 只传已校验的 messageId、partId 和
49
- `"retry" | "cancel"`,执行资格和结果更新由宿主负责。task 分支接标题、状态、description、独立 executionText/replyText、
50
- 有标签的 progress 和有限 steps,渲染同一 `ChatTask`。这不是独立 ChatTask/ChatToolCall JSON entry,
51
- 不提供递归任务树、children/footer slots 或任意对象解释。
46
+ The tool branch accepts label/summary/state/statusLabel, lazy input/output/outputSummary, maxLines/defaultOpen,
47
+ and canRetry/canCancel plus retryDisabled/cancelDisabled. outputSummary is visible only in the expanded body; the collapsed summary uses summary.
48
+ canRetry/canCancel only control action visibility and grant no permission; the `onToolAction` action passes only the validated messageId, partId, and
49
+ `"retry" | "cancel"`; execution eligibility and result updates are the host's responsibility. The task branch accepts title, state, description, separate executionText/replyText,
50
+ labeled progress, and finite steps, and renders the same `ChatTask`. This is not a separate ChatTask/ChatToolCall JSON entry,
51
+ and it provides no recursive task tree, children/footer slots, or arbitrary object interpretation.
52
52
 
53
- 本片支持序列化附件元数据(id/name/url/mediaType/sizeBytes),不支持 File、本地文件上传、附件回调、renderPart/renderWorkDetail、headerActions/composerTrailing slots。需要这些能力时使用完整 `meowtail/chat` JSX API。JSON 不提供 `onAttach`,并用有限 `allowAttachments: false` 默认值关闭本地文件选择入口,显式 true 会被拒绝;文本编辑、发送和已有附件的显示/移除仍可使用。网络、权限、持久化、数据协议和上传始终属于宿主。
53
+ This slice supports serialized attachment metadata (id/name/url/mediaType/sizeBytes) and does not support File, local file upload, attachment callbacks, renderPart/renderWorkDetail, or headerActions/composerTrailing slots. Use the full `meowtail/chat` JSX API when these capabilities are needed. JSON provides no `onAttach` and turns off the local file selection entry with the finite default `allowAttachments: false`; an explicit true is rejected. Text editing, sending, and displaying/removing existing attachments still work. Networking, permissions, persistence, data protocols, and uploads always belong to the host.
54
54
 
55
- Button 的点击 action 不传原生事件;Input 的 input action 只传经校验的当前字符串值。仅列出的属性可用,开放 JSX native props、HTML 标签名、ref/raw HTML、任意事件对象、任意代码、路径表达式、动态 import 均不在 catalog 内。其他 MeowUI 组件尚未提供 JSON metadata;本片不声称完整 UI 属性自动序列化。
55
+ Button click actions pass no native event; the Input input action passes only the validated current string value. Only the listed properties are available; open JSX native props, HTML tag names, ref/raw HTML, arbitrary event objects, arbitrary code, path expressions, and dynamic import are not in the catalog. Other MeowUI components do not yet provide JSON metadata; this slice does not claim automatic serialization of every UI property.