@celljs/ta 4.9.0 → 4.10.0

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 (300) hide show
  1. package/dist/cli.mjs +69 -15
  2. package/dist/gateway.mjs +170 -28
  3. package/dist/pi/CHANGELOG.md +11 -0
  4. package/dist/pi/dist/bundle/chunks/anthropic-messages-CA3HHOL3.js +6 -0
  5. package/dist/pi/dist/bundle/chunks/{azure-openai-responses-FSC6BAW3.js → azure-openai-responses-76TWS6DT.js} +1 -1
  6. package/dist/pi/dist/bundle/chunks/bedrock-converse-stream.js +3 -3
  7. package/dist/pi/dist/bundle/chunks/chunk-4KSTFUIK.js +19 -0
  8. package/dist/pi/dist/bundle/chunks/chunk-4UNPP53I.js +55 -0
  9. package/dist/pi/dist/bundle/chunks/chunk-AUUCDC7R.js +4 -0
  10. package/dist/pi/dist/bundle/chunks/{chunk-V6KH5QG4.js → chunk-BAC3QPNW.js} +1 -1
  11. package/dist/pi/dist/bundle/chunks/{chunk-4EYXVSA5.js → chunk-FF6XOTWB.js} +9 -9
  12. package/dist/pi/dist/bundle/chunks/chunk-FMPAMX2W.js +82 -0
  13. package/dist/pi/dist/bundle/chunks/chunk-GFUN2N5K.js +2 -0
  14. package/dist/pi/dist/bundle/chunks/chunk-IEBK4HQA.js +2 -0
  15. package/dist/pi/dist/bundle/chunks/{chunk-C2WU32PX.js → chunk-IQUU5XIT.js} +1 -1
  16. package/dist/pi/dist/bundle/chunks/{chunk-EBFHJFEE.js → chunk-LQLJ7CDW.js} +1 -1
  17. package/dist/pi/dist/bundle/chunks/chunk-MMDXLZVS.js +30 -0
  18. package/dist/pi/dist/bundle/chunks/{chunk-GN3QYODH.js → chunk-QN4TOIZN.js} +1 -1
  19. package/dist/pi/dist/bundle/chunks/chunk-RKNK4Y6L.js +2 -0
  20. package/dist/pi/dist/bundle/chunks/{chunk-B46VJEHW.js → chunk-V7SLUK6A.js} +1 -1
  21. package/dist/pi/dist/bundle/chunks/chunk-VEJDBY3O.js +1237 -0
  22. package/dist/pi/dist/bundle/chunks/chunk-VKJQ6CME.js +8 -0
  23. package/dist/pi/dist/bundle/chunks/{chunk-3TGLJEWK.js → chunk-WL4TUXY7.js} +1 -1
  24. package/dist/pi/dist/bundle/chunks/{chunk-YZKQS34S.js → chunk-Y55SJART.js} +5 -1
  25. package/dist/pi/dist/bundle/chunks/{chunk-EOO47QGR.js → chunk-ZBIZYD6W.js} +1 -1
  26. package/dist/pi/dist/bundle/chunks/chunk-ZG74NES2.js +2 -0
  27. package/dist/pi/dist/bundle/chunks/chunk-ZGYS4UTC.js +2 -0
  28. package/dist/pi/dist/bundle/chunks/{cli-MCOUW5WS.js → cli-7RHMDOHL.js} +7 -7
  29. package/dist/pi/dist/bundle/chunks/{cloudflare-workers-ai-system-one-WLAFJSP6.js → cloudflare-workers-ai-system-one-U4J7D646.js} +1 -1
  30. package/dist/pi/dist/bundle/chunks/codemode-worker.js +2 -0
  31. package/dist/pi/dist/bundle/chunks/{easter-egg-3d-WMBNSJ4M.js → easter-egg-3d-GEVPKQF6.js} +1 -1
  32. package/dist/pi/dist/bundle/chunks/{execute-4CEBORGZ.js → execute-L2EEDV3L.js} +5 -3
  33. package/dist/pi/dist/bundle/chunks/github-copilot.js +1 -1
  34. package/dist/pi/dist/bundle/chunks/{google-generative-ai-INGKNW72.js → google-generative-ai-D5B6W47J.js} +1 -1
  35. package/dist/pi/dist/bundle/chunks/{google-vertex-IBTX6MBF.js → google-vertex-U4H5YDEW.js} +1 -1
  36. package/dist/pi/dist/bundle/chunks/{llama-cpp-classify-V5U3QKXI.js → llama-cpp-classify-EJXCQRUQ.js} +1 -1
  37. package/dist/pi/dist/bundle/chunks/{mistral-conversations-S4OWXIXQ.js → mistral-conversations-S277EKLB.js} +1 -1
  38. package/dist/pi/dist/bundle/chunks/openai-codex-responses-TEQRB65N.js +10 -0
  39. package/dist/pi/dist/bundle/chunks/{openai-completions-EJNYB6IX.js → openai-completions-HRZOSLBO.js} +3 -3
  40. package/dist/pi/dist/bundle/chunks/{openai-decisions-IXI34BYG.js → openai-decisions-F66BDLOM.js} +1 -1
  41. package/dist/pi/dist/bundle/chunks/openai-responses-BAKFWTGE.js +4 -0
  42. package/dist/pi/dist/bundle/chunks/{openrouter-images-PISKSFMS.js → openrouter-images-VXF5TVIK.js} +1 -1
  43. package/dist/pi/dist/bundle/chunks/{pi-messages-NORUKF4E.js → pi-messages-UBJKNDRN.js} +1 -1
  44. package/dist/pi/dist/bundle/chunks/{runtime-FQB7RU7U.js → runtime-J5ZSBGTX.js} +1 -1
  45. package/dist/pi/dist/bundle/chunks/{typesafe-system-one-CHVC2UUI.js → typesafe-system-one-56TEMIHL.js} +1 -1
  46. package/dist/pi/dist/bundle/chunks/virtual-modules-KITQRTYM.js +2 -0
  47. package/dist/pi/dist/bundle/cli-runtime.js +1 -1
  48. package/dist/pi/dist/bundle/index.js +1 -1
  49. package/dist/pi/dist/bundle/rpc-entry.js +1 -1
  50. package/dist/pi/docs/cli.md +14 -1
  51. package/dist/pi/docs/extensions.md +27 -7
  52. package/dist/pi/docs/keybindings.md +1 -1
  53. package/dist/pi/docs/llama-cpp.md +5 -8
  54. package/dist/pi/docs/models-configuration.md +6 -1
  55. package/dist/pi/docs/models.md +2 -1
  56. package/dist/pi/docs/prompt-templates.md +1 -1
  57. package/dist/pi/docs/providers.md +1 -1
  58. package/dist/pi/docs/rpc.md +4 -2
  59. package/dist/pi/docs/sessions.md +7 -1
  60. package/dist/pi/docs/settings.md +1 -1
  61. package/dist/pi/docs/tui.md +1 -1
  62. package/dist/pi/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  63. package/dist/pi/examples/extensions/custom-provider-anthropic/package.json +1 -1
  64. package/dist/pi/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  65. package/dist/pi/examples/extensions/gondolin/package-lock.json +2 -2
  66. package/dist/pi/examples/extensions/gondolin/package.json +1 -1
  67. package/dist/pi/examples/extensions/plan-mode/index.ts +23 -13
  68. package/dist/pi/examples/extensions/plan-mode/utils.ts +42 -16
  69. package/dist/pi/examples/extensions/subagent/README.md +14 -11
  70. package/dist/pi/examples/extensions/subagent/index.ts +392 -171
  71. package/dist/pi/examples/extensions/with-deps/package-lock.json +2 -2
  72. package/dist/pi/examples/extensions/with-deps/package.json +1 -1
  73. package/dist/pi/examples/tsconfig.json +63 -35
  74. package/dist/pi/package.json +1 -1
  75. package/dist/pi/packages/ta-agents/README.en.md +2 -2
  76. package/dist/pi/packages/ta-agents/README.md +2 -2
  77. package/dist/pi/packages/ta-agents/extension/index.mjs +69 -13
  78. package/dist/pi/packages/ta-agents/lib/agent-bindings.d.ts +19 -4
  79. package/dist/pi/packages/ta-agents/lib/agent-bindings.js +43 -9
  80. package/dist/pi/packages/ta-agents/lib/agent-catalog.d.ts +2 -0
  81. package/dist/pi/packages/ta-agents/lib/agent-catalog.js +3 -0
  82. package/dist/pi/packages/ta-agents/lib/extension.d.ts +2 -1
  83. package/dist/pi/packages/ta-agents/lib/extension.js +26 -4
  84. package/dist/pi/packages/ta-agents/lib/json-rpc.js +7 -1
  85. package/dist/pi/packages/ta-agents/lib/texts.d.ts +4 -0
  86. package/dist/pi/packages/ta-agents/lib/texts.js +4 -0
  87. package/dist/pi/packages/ta-agents/package.json +3 -3
  88. package/dist/pi/packages/ta-bots/extension/index.mjs +46 -0
  89. package/dist/pi/packages/ta-bots/host/index.mjs +46 -0
  90. package/dist/pi/packages/ta-bots/package.json +1 -1
  91. package/dist/pi/packages/ta-changes/package.json +1 -1
  92. package/dist/pi/packages/ta-channels/README.en.md +2 -2
  93. package/dist/pi/packages/ta-channels/README.md +2 -2
  94. package/dist/pi/packages/ta-channels/host/index.mjs +50 -0
  95. package/dist/pi/packages/ta-channels/lib/create.js +11 -3
  96. package/dist/pi/packages/ta-channels/lib/faces.js +1 -1
  97. package/dist/pi/packages/ta-channels/lib/i18n.d.ts +6 -9
  98. package/dist/pi/packages/ta-channels/lib/i18n.js +12 -18
  99. package/dist/pi/packages/ta-channels/lib/more-menu.d.ts +3 -2
  100. package/dist/pi/packages/ta-channels/lib/more-menu.js +21 -29
  101. package/dist/pi/packages/ta-channels/lib/room.js +13 -8
  102. package/dist/pi/packages/ta-channels/lib/sidebar.js +241 -79
  103. package/dist/pi/packages/ta-channels/lib/style.d.ts +1 -1
  104. package/dist/pi/packages/ta-channels/lib/style.js +83 -37
  105. package/dist/pi/packages/ta-channels/lib/tasks.d.ts +2 -0
  106. package/dist/pi/packages/ta-channels/lib/tasks.js +22 -12
  107. package/dist/pi/packages/ta-channels/lib/views.d.ts +49 -1
  108. package/dist/pi/packages/ta-channels/lib/views.js +100 -1
  109. package/dist/pi/packages/ta-channels/package.json +1 -1
  110. package/dist/pi/packages/ta-channels/web/index.js +482 -259
  111. package/dist/pi/packages/ta-computer-use/package.json +2 -2
  112. package/dist/pi/packages/ta-cron/README.en.md +2 -2
  113. package/dist/pi/packages/ta-cron/README.md +2 -2
  114. package/dist/pi/packages/ta-cron/host/index.mjs +6 -0
  115. package/dist/pi/packages/ta-cron/lib/editor.js +60 -27
  116. package/dist/pi/packages/ta-cron/lib/i18n.d.ts +12 -1
  117. package/dist/pi/packages/ta-cron/lib/i18n.js +24 -2
  118. package/dist/pi/packages/ta-cron/lib/page.d.ts +33 -3
  119. package/dist/pi/packages/ta-cron/lib/page.js +119 -4
  120. package/dist/pi/packages/ta-cron/lib/style.d.ts +1 -1
  121. package/dist/pi/packages/ta-cron/lib/style.js +166 -46
  122. package/dist/pi/packages/ta-cron/lib/task-extension.d.ts +15 -0
  123. package/dist/pi/packages/ta-cron/lib/task-extension.js +56 -0
  124. package/dist/pi/packages/ta-cron/lib/task-util.d.ts +2 -0
  125. package/dist/pi/packages/ta-cron/lib/task-util.js +11 -0
  126. package/dist/pi/packages/ta-cron/lib/tasks-view.d.ts +4 -1
  127. package/dist/pi/packages/ta-cron/lib/tasks-view.js +102 -66
  128. package/dist/pi/packages/ta-cron/package.json +1 -1
  129. package/dist/pi/packages/ta-cron/web/index.js +928 -404
  130. package/dist/pi/packages/ta-extensions/README.en.md +3 -1
  131. package/dist/pi/packages/ta-extensions/README.md +3 -1
  132. package/dist/pi/packages/ta-extensions/lib/actions.js +3 -1
  133. package/dist/pi/packages/ta-extensions/lib/composer.d.ts +17 -0
  134. package/dist/pi/packages/ta-extensions/lib/composer.js +84 -0
  135. package/dist/pi/packages/ta-extensions/lib/i18n.d.ts +9 -0
  136. package/dist/pi/packages/ta-extensions/lib/i18n.js +18 -0
  137. package/dist/pi/packages/ta-extensions/lib/index.js +4 -0
  138. package/dist/pi/packages/ta-extensions/lib/make-model.d.ts +20 -0
  139. package/dist/pi/packages/ta-extensions/lib/make-model.js +43 -0
  140. package/dist/pi/packages/ta-extensions/lib/page.js +42 -18
  141. package/dist/pi/packages/ta-extensions/lib/settings.d.ts +4 -0
  142. package/dist/pi/packages/ta-extensions/lib/settings.js +44 -0
  143. package/dist/pi/packages/ta-extensions/lib/style.d.ts +1 -1
  144. package/dist/pi/packages/ta-extensions/lib/style.js +10 -4
  145. package/dist/pi/packages/ta-extensions/package.json +1 -1
  146. package/dist/pi/packages/ta-extensions/skills/ta-package/SKILL.md +7 -3
  147. package/dist/pi/packages/ta-extensions/web/index.js +269 -26
  148. package/dist/pi/packages/ta-launcher/package.json +1 -1
  149. package/dist/pi/packages/ta-workspace/README.md +1 -1
  150. package/dist/pi/packages/ta-workspace/README.zh-cn.md +1 -1
  151. package/dist/pi/packages/ta-workspace/lib/bytes.d.ts +11 -0
  152. package/dist/pi/packages/ta-workspace/lib/bytes.js +40 -0
  153. package/dist/pi/packages/ta-workspace/lib/common.d.ts +2 -1
  154. package/dist/pi/packages/ta-workspace/lib/common.js +15 -37
  155. package/dist/pi/packages/ta-workspace/lib/editors.js +12 -3
  156. package/dist/pi/packages/ta-workspace/lib/i18n.d.ts +1 -2
  157. package/dist/pi/packages/ta-workspace/lib/i18n.js +2 -4
  158. package/dist/pi/packages/ta-workspace/lib/index.js +17 -1
  159. package/dist/pi/packages/ta-workspace/lib/launcher.d.ts +9 -0
  160. package/dist/pi/packages/ta-workspace/lib/launcher.js +39 -0
  161. package/dist/pi/packages/ta-workspace/lib/preview.d.ts +13 -3
  162. package/dist/pi/packages/ta-workspace/lib/preview.js +17 -14
  163. package/dist/pi/packages/ta-workspace/lib/style.d.ts +1 -1
  164. package/dist/pi/packages/ta-workspace/lib/style.js +20 -7
  165. package/dist/pi/packages/ta-workspace/lib/terminal-sessions.d.ts +51 -0
  166. package/dist/pi/packages/ta-workspace/lib/terminal-sessions.js +226 -0
  167. package/dist/pi/packages/ta-workspace/lib/terminal.d.ts +0 -39
  168. package/dist/pi/packages/ta-workspace/lib/terminal.js +28 -240
  169. package/dist/pi/packages/ta-workspace/lib/util/keys.d.ts +18 -0
  170. package/dist/pi/packages/ta-workspace/lib/util/keys.js +23 -0
  171. package/dist/pi/packages/ta-workspace/lib/util/preview.d.ts +19 -0
  172. package/dist/pi/packages/ta-workspace/lib/util/preview.js +32 -1
  173. package/dist/pi/packages/ta-workspace/package.json +1 -1
  174. package/dist/pi/packages/ta-workspace/web/index.js +238 -68
  175. package/dist/public/assets/{abnfDiagram-S7VZAUFO-C1tb6dM5.js → abnfDiagram-S7VZAUFO-BmIko5tV.js} +1 -1
  176. package/dist/public/assets/{architecture-WOLXFQ4H-DN1Va8BF.js → architecture-WOLXFQ4H-XgsdQ7ul.js} +1 -1
  177. package/dist/public/assets/{architectureDiagram-YGSQEFNW-BmK2SYtQ.js → architectureDiagram-YGSQEFNW--sVhMS03.js} +1 -1
  178. package/dist/public/assets/{blockDiagram-APKKGZFW-DvLrLzTm.js → blockDiagram-APKKGZFW-8f9b-9k2.js} +1 -1
  179. package/dist/public/assets/browser-DOHZ0JCf.js +12 -0
  180. package/dist/public/assets/{c4Diagram-KJ2TOQU5-CrQlWwrG.js → c4Diagram-KJ2TOQU5-CwYQ0Jfy.js} +1 -1
  181. package/dist/public/assets/{chunk-6MUBBAK2-CHKMsuY_.js → chunk-6MUBBAK2-7Y9ezehi.js} +1 -1
  182. package/dist/public/assets/{chunk-AXFCVDMN-CWJ7Np6s.js → chunk-AXFCVDMN-CZIH4pWz.js} +1 -1
  183. package/dist/public/assets/{chunk-BG4553SI-3v5XbQGM.js → chunk-BG4553SI-DsNATY2m.js} +1 -1
  184. package/dist/public/assets/{chunk-DQASFODM-2CC-yiCz.js → chunk-DQASFODM-CoXkfYE-.js} +1 -1
  185. package/dist/public/assets/{chunk-HFQBQIA3-D2hzQPAy.js → chunk-HFQBQIA3-C5OLqki8.js} +1 -1
  186. package/dist/public/assets/{chunk-KQLB2F66-SifAZs2r.js → chunk-KQLB2F66-DMHuYGEF.js} +1 -1
  187. package/dist/public/assets/{chunk-KS47KZWR-BP0C0VCC.js → chunk-KS47KZWR-BKeOttO1.js} +1 -1
  188. package/dist/public/assets/{chunk-LEVMRMFU-B1f5vw5b.js → chunk-LEVMRMFU-D6zCwkk7.js} +1 -1
  189. package/dist/public/assets/{chunk-M57EVK23-B2MCJt7Y.js → chunk-M57EVK23-B5-QqcZg.js} +1 -1
  190. package/dist/public/assets/{chunk-OY52VR5R-cDpZJMk4.js → chunk-OY52VR5R-DQrq3n0T.js} +1 -1
  191. package/dist/public/assets/{chunk-QB3YPZ4I-BE0we2xc.js → chunk-QB3YPZ4I-j6ZT7EDR.js} +1 -1
  192. package/dist/public/assets/{chunk-R3KSYZAL-D9wOfqqH.js → chunk-R3KSYZAL-D5MXUO36.js} +1 -1
  193. package/dist/public/assets/{chunk-STOXU5M4-BIaVsc0K.js → chunk-STOXU5M4-DaBkw4dD.js} +1 -1
  194. package/dist/public/assets/{chunk-TU62E6Q5-BZc0OZEM.js → chunk-TU62E6Q5-vXcRfGci.js} +1 -1
  195. package/dist/public/assets/{chunk-X4PVCEUW-Bngfwwzm.js → chunk-X4PVCEUW-CIh6H4Y2.js} +1 -1
  196. package/dist/public/assets/{chunk-XXDRQBXY-C5FQ6XHK.js → chunk-XXDRQBXY-C_Vwv1FM.js} +1 -1
  197. package/dist/public/assets/{classDiagram-v2-L25IHNXF-_om54nmt.js → classDiagram-v2-L25IHNXF-DccDWEJn.js} +1 -1
  198. package/dist/public/assets/{cose-bilkent-JH36ORCC-Dwpeee_6.js → cose-bilkent-JH36ORCC-BX47lumZ.js} +1 -1
  199. package/dist/public/assets/cynefin-EF2NZ3EQ-MaI-3dMQ.js +1 -0
  200. package/dist/public/assets/{cynefinDiagram-L36ESFBY-DP5_y9Dq.js → cynefinDiagram-L36ESFBY-BE6WOGxW.js} +1 -1
  201. package/dist/public/assets/{d3-selection-DFiMlEmn.js → d3-selection-ZcE6yRN5.js} +1 -1
  202. package/dist/public/assets/{dagre-SPEB5RXH-DYwsk6gk.js → dagre-SPEB5RXH-CE6SOOcN.js} +1 -1
  203. package/dist/public/assets/{diagram-3B7GL73J-Dq_nT3AZ.js → diagram-3B7GL73J-xC8VtiYL.js} +1 -1
  204. package/dist/public/assets/{diagram-DNEMPZML-ChURW6y9.js → diagram-DNEMPZML-4dmcBbjL.js} +1 -1
  205. package/dist/public/assets/{diagram-L3MUGCDN-CgVp4Rto.js → diagram-L3MUGCDN-D14Yn3sQ.js} +1 -1
  206. package/dist/public/assets/{diagram-LA4NIPWU-vrqLMDby.js → diagram-LA4NIPWU-GxSXIhsK.js} +1 -1
  207. package/dist/public/assets/{diagram-MHCOC4E2-lvfOr5ij.js → diagram-MHCOC4E2-Cm7Prlpc.js} +1 -1
  208. package/dist/public/assets/{diagram-XPFHEONP-oQ18TeVp.js → diagram-XPFHEONP-mkUnnKFu.js} +1 -1
  209. package/dist/public/assets/{dist-BOxxmveI.js → dist-acJS-BlA.js} +1 -1
  210. package/dist/public/assets/{ebnfDiagram-UZSYDL2S-C7_tlZCS.js → ebnfDiagram-UZSYDL2S-m77ua3UQ.js} +1 -1
  211. package/dist/public/assets/{editor.api-CoZ8MEuz.js → editor.api-CljTm-EQ.js} +1 -1
  212. package/dist/public/assets/{elk-XV6XMXQE-Dkt5-ikg.js → elk-XV6XMXQE-DsQY1hw9.js} +1 -1
  213. package/dist/public/assets/{erDiagram-EYBAPDEH-27kh3zlx.js → erDiagram-EYBAPDEH-CV8gJM0P.js} +1 -1
  214. package/dist/public/assets/{eventmodeling-K75KTNOO-CxVEejjN.js → eventmodeling-K75KTNOO-C1pymbUr.js} +1 -1
  215. package/dist/public/assets/flowDiagram-MALGAFMO-shBnAQFk.js +1 -0
  216. package/dist/public/assets/{freemarker2-D6CwPIXh.js → freemarker2-DYJXaMHN.js} +1 -1
  217. package/dist/public/assets/{ganttDiagram-23REXITY-C-amlwpX.js → ganttDiagram-23REXITY-CppxOWRh.js} +1 -1
  218. package/dist/public/assets/gitGraph-VSP46ZUC-BtQWboBz.js +1 -0
  219. package/dist/public/assets/{gitGraphDiagram-STJD7YCW-DKhzI0Xz.js → gitGraphDiagram-STJD7YCW-CrQrZhcP.js} +1 -1
  220. package/dist/public/assets/{handlebars-mxNr68Gm.js → handlebars-DZCnH9e2.js} +1 -1
  221. package/dist/public/assets/{html-Bze6s9R9.js → html-DuzouNES.js} +1 -1
  222. package/dist/public/assets/{index-BhQUc9PU.js → index-B7OYKvCE.js} +2 -2
  223. package/dist/public/assets/info-OHQRW6UA-CDSLjba_.js +1 -0
  224. package/dist/public/assets/{infoDiagram-KBXO4MBG-WHuWjEDO.js → infoDiagram-KBXO4MBG-6pby19tQ.js} +1 -1
  225. package/dist/public/assets/{ishikawaDiagram-M35NCXHK-DFHUwD0J.js → ishikawaDiagram-M35NCXHK-Duf8c8rQ.js} +1 -1
  226. package/dist/public/assets/{javascript-4NMPu7y1.js → javascript-2d_L6cVd.js} +1 -1
  227. package/dist/public/assets/{journeyDiagram-OPLOXDXO-C7gV6zEr.js → journeyDiagram-OPLOXDXO-Dvv-xzNo.js} +1 -1
  228. package/dist/public/assets/{jsonMode-B1JEHPMp.js → jsonMode-CFadYXyI.js} +1 -1
  229. package/dist/public/assets/{kanban-definition-BZKZHSQY-DlRu_d2Q.js → kanban-definition-BZKZHSQY-Dsk6F-TT.js} +1 -1
  230. package/dist/public/assets/{liquid-B7sIf4NX.js → liquid-Din4CF34.js} +1 -1
  231. package/dist/public/assets/{mdx-CAN0qez6.js → mdx-DivDuCWI.js} +1 -1
  232. package/dist/public/assets/{mermaid-parser.core-BGmotBhf.js → mermaid-parser.core-BfCv4CYZ.js} +3 -3
  233. package/dist/public/assets/{mermaid.core-Cl6SS3cM.js → mermaid.core-DC20ZwJj.js} +4 -4
  234. package/dist/public/assets/{mindmap-definition-I2QAS2VK-DiQ8Feqr.js → mindmap-definition-I2QAS2VK-DRZRrJU_.js} +1 -1
  235. package/dist/public/assets/module-BAQaY56j.js +1 -0
  236. package/dist/public/assets/module-DxRGg3ED.js +1947 -0
  237. package/dist/public/assets/{monaco-CwCjTWAO.js → monaco-D1d6MOPe.js} +3 -3
  238. package/dist/public/assets/packet-JDAUHWVQ-dYb4P9eU.js +1 -0
  239. package/dist/public/assets/{pegDiagram-FD4XPPHP-XhCpv6BX.js → pegDiagram-FD4XPPHP-DcGr3Tbk.js} +1 -1
  240. package/dist/public/assets/pie-XZMESJXO-CIompBnc.js +1 -0
  241. package/dist/public/assets/{pieDiagram-J4AKIIQI-DUVzuXUd.js → pieDiagram-J4AKIIQI-GF7pu6ch.js} +1 -1
  242. package/dist/public/assets/{python-DsoF66Sp.js → python-BQbTTTT5.js} +1 -1
  243. package/dist/public/assets/{quadrantDiagram-XTYBLID2-Ddobf0z0.js → quadrantDiagram-XTYBLID2-D-bcu7Ey.js} +1 -1
  244. package/dist/public/assets/radar-ABXABTNO-DiJl7BtK.js +1 -0
  245. package/dist/public/assets/railroad-I3PHUGI6-B5cRBukM.js +1 -0
  246. package/dist/public/assets/{railroad-abnf-LNEFI6M7-DkrNo-Gf.js → railroad-abnf-LNEFI6M7-BiBHsI-K.js} +1 -1
  247. package/dist/public/assets/{railroad-ebnf-DWYD2UWJ-DaB7gY8P.js → railroad-ebnf-DWYD2UWJ-zKjrfkHs.js} +1 -1
  248. package/dist/public/assets/{railroad-peg-JR7BVNR7-D_QG87QV.js → railroad-peg-JR7BVNR7-DKuVn0GT.js} +1 -1
  249. package/dist/public/assets/{railroadDiagram-MRQ6NCDL-x-nUoBjv.js → railroadDiagram-MRQ6NCDL-Cyn-16mJ.js} +1 -1
  250. package/dist/public/assets/{razor-DSrcJyQe.js → razor-DiLk54O0.js} +1 -1
  251. package/dist/public/assets/{requirementDiagram-Y7LWUY3S-kNNcbsty.js → requirementDiagram-Y7LWUY3S-CwU2EBkW.js} +1 -1
  252. package/dist/public/assets/{sankeyDiagram-WGJFYUXA-ClC12Odk.js → sankeyDiagram-WGJFYUXA-ajf00HyW.js} +1 -1
  253. package/dist/public/assets/{sequenceDiagram-5NDRBG5M-DDQITP2g.js → sequenceDiagram-5NDRBG5M-DiX_OIAw.js} +1 -1
  254. package/dist/public/assets/{stateDiagram-v2-FJ4FJNEA-N1t_36oh.js → stateDiagram-v2-FJ4FJNEA-CV5bRqB7.js} +1 -1
  255. package/dist/public/assets/{swimlanes-UMQ2AFYF-DSt9fFYE.js → swimlanes-UMQ2AFYF-BGQKSlj7.js} +1 -1
  256. package/dist/public/assets/swimlanesDiagram-OMPLPG4O-DxXlavVT.js +8 -0
  257. package/dist/public/assets/{timeline-definition-SEUHKTQE-CfymOw_s.js → timeline-definition-SEUHKTQE-DhQoApff.js} +1 -1
  258. package/dist/public/assets/treeView-D4JQ5SDB-BOP6mkZC.js +1 -0
  259. package/dist/public/assets/treemap-SAJKECNS-BJxuPMz3.js +1 -0
  260. package/dist/public/assets/{typescript-J7rF-zX8.js → typescript-COQ1g-up.js} +1 -1
  261. package/dist/public/assets/{usecaseDiagram-AFA6YXN4-CK_mRc2_.js → usecaseDiagram-AFA6YXN4-CmLFzjie.js} +1 -1
  262. package/dist/public/assets/{vennDiagram-NNMJR3RB-DW8xR6IJ.js → vennDiagram-NNMJR3RB-DOa6JR5K.js} +1 -1
  263. package/dist/public/assets/wardley-7MLQ67FV-jqlowjVL.js +1 -0
  264. package/dist/public/assets/{wardleyDiagram-S7YFUSEH-Css55Zq5.js → wardleyDiagram-S7YFUSEH-BV7EEShp.js} +1 -1
  265. package/dist/public/assets/{xml-CJeviG_a.js → xml-BbvtjuaG.js} +1 -1
  266. package/dist/public/assets/{xychartDiagram-GGNKY7IX-BnhK9cFS.js → xychartDiagram-GGNKY7IX-DtMpPbsq.js} +1 -1
  267. package/dist/public/assets/{yaml-Gw3uo6rF.js → yaml-Bw8NFga9.js} +1 -1
  268. package/dist/public/index.html +1 -1
  269. package/dist/public/launch.svg +46 -42
  270. package/dist/serve/index.mjs +1367 -560
  271. package/package.json +25 -25
  272. package/dist/pi/dist/bundle/chunks/anthropic-messages-BWGCKOF4.js +0 -6
  273. package/dist/pi/dist/bundle/chunks/chunk-44DLKSKE.js +0 -1232
  274. package/dist/pi/dist/bundle/chunks/chunk-62VOPMLK.js +0 -65
  275. package/dist/pi/dist/bundle/chunks/chunk-7O7QKK6A.js +0 -2
  276. package/dist/pi/dist/bundle/chunks/chunk-CHWNPHIS.js +0 -82
  277. package/dist/pi/dist/bundle/chunks/chunk-NL4X6LBY.js +0 -4
  278. package/dist/pi/dist/bundle/chunks/chunk-NZY7EIPA.js +0 -4
  279. package/dist/pi/dist/bundle/chunks/chunk-R2EGYMOO.js +0 -7
  280. package/dist/pi/dist/bundle/chunks/chunk-UKVNB6C4.js +0 -2
  281. package/dist/pi/dist/bundle/chunks/chunk-USJZMAIR.js +0 -2
  282. package/dist/pi/dist/bundle/chunks/chunk-VOLAXWGI.js +0 -2
  283. package/dist/pi/dist/bundle/chunks/openai-codex-responses-QAWLOQSN.js +0 -10
  284. package/dist/pi/dist/bundle/chunks/openai-responses-MD3562FB.js +0 -4
  285. package/dist/pi/dist/bundle/chunks/virtual-modules-O76XM3OB.js +0 -2
  286. package/dist/public/assets/browser-DAv3ly6M.js +0 -12
  287. package/dist/public/assets/cynefin-EF2NZ3EQ-CW_93VVD.js +0 -1
  288. package/dist/public/assets/flowDiagram-MALGAFMO-BRowRdve.js +0 -1
  289. package/dist/public/assets/gitGraph-VSP46ZUC-BGmojXlx.js +0 -1
  290. package/dist/public/assets/info-OHQRW6UA-CRRVgGj2.js +0 -1
  291. package/dist/public/assets/module-1nDbf1AK.js +0 -1761
  292. package/dist/public/assets/module-BkKfSTDV.js +0 -1
  293. package/dist/public/assets/packet-JDAUHWVQ-DUlqTCWQ.js +0 -1
  294. package/dist/public/assets/pie-XZMESJXO-2RgP4ScO.js +0 -1
  295. package/dist/public/assets/radar-ABXABTNO-Dap8k-yH.js +0 -1
  296. package/dist/public/assets/railroad-I3PHUGI6-Ds10NBze.js +0 -1
  297. package/dist/public/assets/swimlanesDiagram-OMPLPG4O-BHAN4SQO.js +0 -8
  298. package/dist/public/assets/treeView-D4JQ5SDB-f1hLUBjI.js +0 -1
  299. package/dist/public/assets/treemap-SAJKECNS-_NPRpuUC.js +0 -1
  300. package/dist/public/assets/wardley-7MLQ67FV-CLBqtefx.js +0 -1
@@ -124,7 +124,13 @@ class JsonRpcConnection {
124
124
  }
125
125
  }
126
126
  else if (message.id === undefined || message.id === null) {
127
- this.onNotification(message.method, message.params);
127
+ try {
128
+ this.onNotification(message.method, message.params);
129
+ }
130
+ catch (error) {
131
+ // One update that fails to apply leaves the rest of the stream, and the process of pi, as they are.
132
+ console.error(error);
133
+ }
128
134
  }
129
135
  else {
130
136
  void this.answer(message.id, message.method, message.params);
@@ -20,6 +20,10 @@ declare const TEXTS: {
20
20
  readonly en: (agent: string, command: string) => string;
21
21
  readonly zh: (agent: string, command: string) => string;
22
22
  };
23
+ readonly starting: {
24
+ readonly en: (agent: string) => string;
25
+ readonly zh: (agent: string) => string;
26
+ };
23
27
  readonly unfinished: {
24
28
  readonly en: (agent: string) => string;
25
29
  readonly zh: (agent: string) => string;
@@ -24,6 +24,10 @@ const TEXTS = {
24
24
  en: (agent, command) => `${agent} ran \`${command}\` and said nothing back; it may only show in ${agent}'s own interface.`,
25
25
  zh: (agent, command) => `${agent} 已执行 \`${command}\`,没有返回内容(这个命令可能只在 ${agent} 自己的界面里有显示)。`,
26
26
  },
27
+ starting: {
28
+ en: (agent) => `Starting ${agent}…`,
29
+ zh: (agent) => `正在启动 ${agent}…`,
30
+ },
27
31
  unfinished: {
28
32
  en: (agent) => `${agent} ended its turn before this call finished.`,
29
33
  zh: (agent) => `${agent} 在这次调用完成前结束了这一轮。`,
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@celljs/ta-agents",
3
- "version": "4.9.0",
3
+ "version": "4.10.0",
4
4
  "description": "A pi package for Ta: other coding agents (CodeBuddy Code, Claude Code, Codex and any agent that speaks ACP) as models to pick, each running a conversation on its own harness",
5
5
  "keywords": [
6
6
  "pi-package"
@@ -26,8 +26,8 @@
26
26
  "watch": "tsc -b -w --preserveWatchOutput"
27
27
  },
28
28
  "devDependencies": {
29
- "@earendil-works/pi-ai": "^1.5.0",
30
- "@earendil-works/pi-coding-agent": "^1.5.0"
29
+ "@earendil-works/pi-ai": "^1.5.2",
30
+ "@earendil-works/pi-coding-agent": "^1.5.2"
31
31
  },
32
32
  "publishConfig": {
33
33
  "access": "public"
@@ -135,6 +135,21 @@ var TaLocation;
135
135
  return name || (remote === null || remote === undefined ? undefined : remote.host) || location;
136
136
  }
137
137
  TaLocation2.basename = basename;
138
+ function homeRelative(location) {
139
+ var _a;
140
+ const remote = parse(location);
141
+ const path2 = remote ? remote.path ? remote.path.slice(1) : "~" : location;
142
+ const match = /^~(?:[\\/]+(.*))?$/.exec(path2);
143
+ return match ? ((_a = match[1]) !== null && _a !== undefined ? _a : "").replace(/[\\/]+$/, "") : undefined;
144
+ }
145
+ TaLocation2.homeRelative = homeRelative;
146
+ function isAbsolute(location) {
147
+ if (homeRelative(location) !== undefined) {
148
+ return false;
149
+ }
150
+ return isRemote(location) || /^([\\/]|[A-Za-z]:)/.test(location);
151
+ }
152
+ TaLocation2.isAbsolute = isAbsolute;
138
153
  function parentPath(path2) {
139
154
  const trimmed = path2.replace(/[\\/]+$/, "");
140
155
  const at = Math.max(trimmed.lastIndexOf("/"), trimmed.lastIndexOf("\\"));
@@ -203,6 +218,37 @@ ${message}`;
203
218
  }
204
219
  TaMessageContext2.strip = strip;
205
220
  })(TaMessageContext || (TaMessageContext = {}));
221
+ var TaImageNote;
222
+ (function(TaImageNote2) {
223
+ const NOTE = /^\[Image: original \d+x\d+, displayed at \d+x\d+\. Multiply coordinates by [\d.]+ to map to original image\.\]$|^\[Image converted from [^\]]+ to [^\]]+\.\]$/;
224
+ function strip(text) {
225
+ const lines = text.split(`
226
+ `);
227
+ const kept = lines.filter((line) => !NOTE.test(line.trim()));
228
+ if (kept.length === lines.length) {
229
+ return text;
230
+ }
231
+ return kept.join(`
232
+ `).replace(/\n+$/, "").replace(/^\n+/, "");
233
+ }
234
+ TaImageNote2.strip = strip;
235
+ })(TaImageNote || (TaImageNote = {}));
236
+ var TaAgentSummary;
237
+ (function(TaAgentSummary2) {
238
+ const START = /^\s*<conversation_history_summary>/;
239
+ const BLOCK = /^\s*<conversation_history_summary>[\s\S]*?(?:<\/conversation_history_summary>\s*|$)/;
240
+ function read(text) {
241
+ if (!START.test(text)) {
242
+ return;
243
+ }
244
+ return text.replace(/<\/?(?:conversation_history_summary|summary)>/g, "").replace(/<\/?\w*$/, "").trim();
245
+ }
246
+ TaAgentSummary2.read = read;
247
+ function strip(text) {
248
+ return text.replace(BLOCK, "");
249
+ }
250
+ TaAgentSummary2.strip = strip;
251
+ })(TaAgentSummary || (TaAgentSummary = {}));
206
252
  var TaSkillUse;
207
253
  (function(TaSkillUse2) {
208
254
  const BLOCK = /^<skill name="([^"]+)" location="([^"]+)">\n([\s\S]*?)\n<\/skill>(?:\n\n([\s\S]+))?$/;
@@ -335,6 +335,21 @@ var TaLocation;
335
335
  return name || (remote === null || remote === undefined ? undefined : remote.host) || location;
336
336
  }
337
337
  TaLocation2.basename = basename;
338
+ function homeRelative(location) {
339
+ var _a;
340
+ const remote = parse(location);
341
+ const path2 = remote ? remote.path ? remote.path.slice(1) : "~" : location;
342
+ const match = /^~(?:[\\/]+(.*))?$/.exec(path2);
343
+ return match ? ((_a = match[1]) !== null && _a !== undefined ? _a : "").replace(/[\\/]+$/, "") : undefined;
344
+ }
345
+ TaLocation2.homeRelative = homeRelative;
346
+ function isAbsolute(location) {
347
+ if (homeRelative(location) !== undefined) {
348
+ return false;
349
+ }
350
+ return isRemote(location) || /^([\\/]|[A-Za-z]:)/.test(location);
351
+ }
352
+ TaLocation2.isAbsolute = isAbsolute;
338
353
  function parentPath(path2) {
339
354
  const trimmed = path2.replace(/[\\/]+$/, "");
340
355
  const at = Math.max(trimmed.lastIndexOf("/"), trimmed.lastIndexOf("\\"));
@@ -403,6 +418,37 @@ ${message}`;
403
418
  }
404
419
  TaMessageContext2.strip = strip;
405
420
  })(TaMessageContext || (TaMessageContext = {}));
421
+ var TaImageNote;
422
+ (function(TaImageNote2) {
423
+ const NOTE = /^\[Image: original \d+x\d+, displayed at \d+x\d+\. Multiply coordinates by [\d.]+ to map to original image\.\]$|^\[Image converted from [^\]]+ to [^\]]+\.\]$/;
424
+ function strip(text) {
425
+ const lines = text.split(`
426
+ `);
427
+ const kept = lines.filter((line) => !NOTE.test(line.trim()));
428
+ if (kept.length === lines.length) {
429
+ return text;
430
+ }
431
+ return kept.join(`
432
+ `).replace(/\n+$/, "").replace(/^\n+/, "");
433
+ }
434
+ TaImageNote2.strip = strip;
435
+ })(TaImageNote || (TaImageNote = {}));
436
+ var TaAgentSummary;
437
+ (function(TaAgentSummary2) {
438
+ const START = /^\s*<conversation_history_summary>/;
439
+ const BLOCK = /^\s*<conversation_history_summary>[\s\S]*?(?:<\/conversation_history_summary>\s*|$)/;
440
+ function read(text) {
441
+ if (!START.test(text)) {
442
+ return;
443
+ }
444
+ return text.replace(/<\/?(?:conversation_history_summary|summary)>/g, "").replace(/<\/?\w*$/, "").trim();
445
+ }
446
+ TaAgentSummary2.read = read;
447
+ function strip(text) {
448
+ return text.replace(BLOCK, "");
449
+ }
450
+ TaAgentSummary2.strip = strip;
451
+ })(TaAgentSummary || (TaAgentSummary = {}));
406
452
  var TaSkillUse;
407
453
  (function(TaSkillUse2) {
408
454
  const BLOCK = /^<skill name="([^"]+)" location="([^"]+)">\n([\s\S]*?)\n<\/skill>(?:\n\n([\s\S]+))?$/;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@celljs/ta-bots",
3
- "version": "4.9.0",
3
+ "version": "4.10.0",
4
4
  "description": "A pi package for Ta: bots of WeChat (ClawBot) and WeCom connected to the double, an agent or a conversation, messages and files both ways",
5
5
  "keywords": [
6
6
  "pi-package"
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@celljs/ta-changes",
3
- "version": "4.9.0",
3
+ "version": "4.10.0",
4
4
  "description": "A pi package for Ta: the files each reply changed, with their diffs, and a button that takes the changes of a reply back",
5
5
  "keywords": [
6
6
  "pi-package"
@@ -12,8 +12,8 @@ A built-in Ta package (enabled by default but can be toggled in the Web client's
12
12
  - **Channel**: members (agents, with the first being the lead) and messages. Messages are sent to members `@`-mentioned; agents' answers are posted back to the channel, and if they `@` someone in their answer, it is passed on to them. Each agent processes one message at a time. Users can mute members in a channel (`muted`): they do not answer anything in this channel, even if `@`-mentioned; when the lead is muted, messages with no one `@`-mentioned go to the next unmuted member.
13
13
  - **Loop prevention** (`ChannelsUtil.limit`): relaying between agents is at most 3 hops; one message yields at most 8 answers, with at most 2 per agent. When cut off, after this round a light-colored note is appended to the channel ("reached relay limit, waiting for you to continue"), only once per round; the return from `post_to_channel` includes this note too.
14
14
  - **Tools**: each session in Ta (web pages and other clients connected to ta serve) has `create_agent`, `create_channel`, `add_to_channel`, `post_to_channel`, and `list_channels`. When a user specifies a goal ("assemble a team to do the landing page"), Ta creates agents and channels, posts the goal, and waits for answers from each member before replying to the user. When a role is missing from a channel, Ta uses `add_to_channel` to add an existing agent (added after existing members; lead unchanged). The open page marks this channel with a green dot in the sidebar, which disappears when opened. Pausing Ta just stops waiting; agents continue to answer in the channel.
15
- - **Tasks of the double** (see `docs/design/ta-double.md`): a channel Ta builds with its tools has `by: 'ta'` and the session that built it (`origin`), and is listed as a task of the double (`registerTasks`), not among the user's own channels; the agents it makes are `temporary`, shown with their team until the user keeps them in the members panel or the agent's menu, and one in no channel is listed among the members. This list of the navigation is called "Double": the double's card, the tasks waiting for you / in progress / ended, the members by directory, the channels, each section folding (kept in the browser). A team opened from its task shows in the workbench on the right, with "Open in the main area" in its bar. While the double asks first, the team tools ask with `ctx.ui.confirm` before they build a team and before work goes to a channel the user did not let them use. Below, the channels and agents once listed flat are now under "Channels" and "Members".
16
- - **UI**: "Agents" at the top of the navigation bar (above "Conversations"; the first bottom tab on a phone) puts the double, channels, and agents together (the double is a built-in page from ta-web, and once enabled is listed at the top, no longer appears separately in the navigation bar); the search box and + are at the top of the sidebar. + → create agent opens a draft page in the main area: first assigns an unused name and avatar, clicking the name in the top bar can rename or pick from 16 avatars, the sidebar has one more line "not started"; the agent is truly created when the first message is sent from the input box (responsibility is generic, what to do is written in this message), then switches to its session and sends the message. + → create channel is a dialog: name, search and check agents (1–12, first checked is lead), create; channel row has lead first, next member in overlapping avatars, lead is labeled beside the name, second line is the most recent message or who's answering; agents are grouped by working directory, second line is "idle" or which channel they're answering in, right side is time of most recent message. Click agent to open its session: it is in front at once, under the agent's name, showing that it opens (`pi.switchSession` takes the promise of the `openAgent` request), and shows as the current conversation once the server opens or finds the session. Hovering over agent row (long-press on touch) shows …, menu has: stop (abort its current answer), restart (open new session), rename, responsibility (edit the role in the system prompt, takes effect in next session), move to… (switch working directory, open new session in that directory), copy working directory, export conversation (Markdown, strip channel context blocks), add to channel, delete (leave all channels it's in, delete channels that only have it, keep the session file); when near the bottom the menu expands upward. Channel is a page in the main area (not in the right workbench), displayed as a group chat: others' messages on the left with avatar and name, user's on the righ... [truncated]
15
+ - **Tasks of the double** (see `docs/design/ta-double.md`): a channel Ta builds with its tools has `by: 'ta'` and the session that built it (`origin`), and is listed as a task of the double (`registerTasks`), not among the user's own channels; the agents it makes are `temporary`, shown with their team until the user keeps them in the members panel or the agent's menu, and one in no channel is listed among the members. This list of the navigation is called "Double": the double's card, the tasks in one list (what waits for you first, then what goes on, then what ended), the members (as contacts, by directory if the user wants), the channels, each section folding (kept in the browser). A team opened from its task shows in the workbench on the right, with "Open in the main area" in its bar. While the double asks first, the team tools ask with `ctx.ui.confirm` before they build a team and before work goes to a channel the user did not let them use. Below, the channels and agents once listed flat are now under "Channels" and "Members".
16
+ - **UI**: "Agents" at the top of the navigation bar (above "Conversations"; the first bottom tab on a phone) puts the double, channels, and agents together (the double is a built-in page from ta-web, and once enabled is listed at the top, no longer appears separately in the navigation bar); the search box and + are at the top of the sidebar. + → create agent opens a draft page in the main area: first assigns an unused name and avatar, clicking the name in the top bar can rename or pick from 16 avatars, the sidebar has one more line "not started"; the agent is truly created when the first message is sent from the input box (responsibility is generic, what to do is written in this message), then switches to its session and sends the message. + → create channel is a dialog: name, search and check agents (1–12, first checked is lead), create; channel row has lead first, next member in overlapping avatars, lead is labeled beside the name, second line is the most recent message or who's answering; agents are grouped by working directory, second line is "idle" or which channel they're answering in, right side is time of most recent message. Click agent to open its session: it is in front at once, under the agent's name, showing that it opens (`pi.switchSession` takes the promise of the `openAgent` request), and shows as the current conversation once the server opens or finds the session. Hovering over agent row (long-press on touch) shows …, menu has: stop (abort its current answer), restart (open new session), rename, responsibility (edit the role in the system prompt, takes effect in next session), move to… (switch working directory, open new session in that directory), copy working directory, export conversation (Markdown, strip channel context blocks), add to channel, delete (leave all channels it's in, delete channels that only have it, keep the session file); when near the bottom the menu expands upward. Channel is a page in the main area (not in the right workbench), displayed as a group chat: others' messages on the left with avatar and name, user's on the right, consecutive messages are grouped, after a long pause insert a time line; top bar is channel name and member avatars, click avatar to open "Channel Members" (`members`, `location: 'panel'` view, follows the current channel) in the right workbench: lists members, lead has a marker, answering ones are marked green; each row opens that agent's session, hovering (long-press on touch) shows set as lead, mute, restart session (forget earlier conversation, open new session next time it answers, old session stays in conversation list), and remove from channel (at least one left); top has "Add Members" as a searchable agent list, check to add, bottom of list has "New Agent" to open the draft page for creating a new agent; bottom has delete channel (confirm once more, messages deleted too, ongoing answers no longer posted). Input box is the conversation input box (`pi.ui.Composer`), `@` lists members, + allows naming members or adding members (opens the member list for adding); messages use the conversation's Markdown rendering (`pi.ui.Markdown`), `@`-mentioned members are bold.
17
17
 
18
18
  ## Data and Forwarding
19
19
 
@@ -12,8 +12,8 @@ Ta 自带的 pi 包(默认开启,可在 Web 客户端的 设置 → 包 关
12
12
  - **频道**:成员(智能体,第一个是负责人)和消息。消息发给其中 `@` 到的成员;智能体的回答贴回频道,它在回答里 `@` 谁就再交给谁。每个智能体一次只处理一条消息。用户可以把成员设为免打扰(`muted`):它在这个频道里什么都不回答,被 `@` 也不回答;负责人免打扰时,没人被 `@` 的消息交给下一位没有免打扰的成员。
13
13
  - **防循环**(`ChannelsUtil.limit`):智能体之间接力最多 3 跳,一条消息引出的回答最多 8 条、每个智能体最多 2 条;被截断时,等这一轮结束后在频道里追加一行淡色说明("已到交接上限,等你继续"),每轮只追加一次,`post_to_channel` 的返回里也带上这句。
14
14
  - **工具**:ta serve 里 Ta 的每个会话(Web 页面里的对话,以及连到 ta serve 的其他客户端)都有 `create_agent`、`create_channel`、`add_to_channel`、`post_to_channel`、`list_channels`。用户说一个目标("组个团队做落地页")时,Ta 建好智能体和频道、把目标贴进去,等各成员回答完再回复用户;频道缺某个角色时,Ta 用 `add_to_channel` 把已有的智能体加进来(加在已有成员之后,负责人不变);开着的页面在侧栏给这个频道标一个绿点,打开后消失。中途停止 Ta 只是不再等待,智能体会在频道里接着回答。
15
- - **分身的任务**(见 `docs/design/ta-double.md`):Ta 用工具建的频道带 `by: 'ta'` 和建它的会话 `origin`,作为分身的任务(`registerTasks`)列出,不进用户自己的"频道"分组;它建的智能体带 `temporary`,只在团队里出现,在成员面板或智能体菜单里"留下"后才成为常驻成员,不在任何频道里的临时智能体也列在成员里。导航栏里这个列表叫"分身":分身卡片、"待你处理 / 进行中 / 已结束"的任务、"成员"(按目录分组)、"频道",各组可折叠(折叠状态存在浏览器本地)。从任务打开的团队显示在右侧工作台,顶栏可"在主区打开"。分身开启"开始任务前先问我"时,建团队前、以及第一次往用户放行过以外的频道派活前,用 `ctx.ui.confirm` 询问。下文的列表描述里,原先平铺的频道和智能体现在分别在"频道"和"成员"分组。
16
- - **界面**:导航栏最上面的"智能体"(在"对话"上面,手机上是第一个底部标签)把分身、频道和智能体放在一起(分身是 ta-web 内置的页面,开启后列在最上面,导航栏里不再单独出现):侧栏顶部是搜索框和 +。+ → 新建智能体在主区域打开一个草稿页:先给一个没人用的名字和头像,顶栏点名字可以改名、从 16 个头像里挑,侧栏顶部多一行"还没开工";输入框发出第一条消息时才真正建好智能体(职责是通用的,具体做什么写在这条消息里),随即切到它的会话并发出这条消息。+ → 新建频道是一个弹窗:名称、搜索并勾选智能体(1–12 个,先勾的是负责人)、创建;频道行是负责人在前、下一位成员在后的叠放头像,名称旁标出负责人,第二行是最近一条消息或谁正在回答;智能体按工作目录分组,第二行是"空闲"或正在哪个频道回答,右侧是最近一次发言的时间。点智能体打开它的会话:立即切过去,以智能体的名字显示"正在打开"(`pi.switchSession` 接收 `openAgent` 请求的 Promise),服务端打开或找到会话后显示为当前对话。智能体行悬停(触屏上常显)出现 …,菜单里是:停止(中止它正在进行的回答)、重新开始(开新会话)、重命名、职责(编辑系统提示词里的角色,下一个会话生效)、移至…(换工作目录,在新目录开新会话)、复制工作目录、导出对话(Markdown,去掉频道的上下文块)、加入频道、删除(退出所在频道,只剩它的频道一并删除,会话文件保留);靠近底部时菜单向上展开。频道是主区域的一个页面(不进右侧工作台),以群聊显示:别人的消息在左边带头像和名字,用户的在右边,连续发言合成一组,停顿久了插一行时间;顶栏是频道名和成员头像,点头像在右侧工作台打开"频道成员"(`members`,`location: 'panel'` 的视图,跟着当前频道):列出成员,负责人带标记,正在回答的标绿;每行点开是智能体的会话,悬停(触屏上常显)出现设为负责人、免打扰、重开会话(忘掉之前的对话,下次回答时开新会话,旧会话仍在对话列表里)和移出频道(至少留一位);顶部"添加成员"换成可搜索的智能体列表,勾选后添加,列表底部的"新建智能体"打开新建智能体的草稿页;底部是删除频道(再确认一次,消息一并删除,正在进行的回答不再贴出)。输入框就是对话的输入框(`pi.ui.Composer`),`@` 列出成员,+ 里可以点名成员或添加成员(打开频道成员的添加列表);消息用对话的 Markdown 渲染(`pi.ui.Markdown`),点名的成员加粗。
15
+ - **分身的任务**(见 `docs/design/ta-double.md`):Ta 用工具建的频道带 `by: 'ta'` 和建它的会话 `origin`,作为分身的任务(`registerTasks`)列出,不进用户自己的"频道"分组;它建的智能体带 `temporary`,只在团队里出现,在成员面板或智能体菜单里"留下"后才成为常驻成员,不在任何频道里的临时智能体也列在成员里。导航栏里这个列表叫"分身":分身卡片、"任务"(一个列表,待你处理的在前,然后进行中、已结束)、"成员"(像通讯录,可选按目录分组)、"频道",各组可折叠(折叠状态存在浏览器本地)。从任务打开的团队显示在右侧工作台,顶栏可"在主区打开"。分身开启"开始任务前先问我"时,建团队前、以及第一次往用户放行过以外的频道派活前,用 `ctx.ui.confirm` 询问。下文的列表描述里,原先平铺的频道和智能体现在分别在"频道"和"成员"分组。
16
+ - **界面**:导航栏最上面的"智能体"(在"对话"上面,手机上是第一个底部标签)把分身、频道和智能体放在一起(分身是 ta-web 内置的页面,开启后列在最上面,导航栏里不再单独出现):侧栏顶部是搜索框和 +。+ → 新建智能体在主区域打开一个草稿页:先给一个没人用的名字和头像,顶栏点名字可以改名、从 16 个头像里挑,侧栏顶部多一行"还没开工";输入框发出第一条消息时才真正建好智能体(职责是通用的,具体做什么写在这条消息里),随即切到它的会话并发出这条消息。+ → 新建频道是一个弹窗:名称、搜索并勾选智能体(1–12 个,先勾的是负责人)、创建;频道行是负责人在前、下一位成员在后的叠放头像,名称旁标出负责人,第二行是最近一条消息或谁正在回答;智能体按工作目录分组,第二行是"空闲"或正在哪个频道回答,右侧是最近一次发言的时间。点智能体打开它的会话:立即切过去,以智能体的名字显示"正在打开"(`pi.switchSession` 接收 `openAgent` 请求的 Promise),服务端打开或找到会话后显示为当前对话。智能体行悬停(触屏上常显)出现 …,菜单里是:停止(中止它正在进行的回答)、重新开始(开新会话)、重命名、职责(编辑系统提示词里的角色,下一个会话生效)、移至…(换工作目录,在新目录开新会话)、复制工作目录、导出对话(Markdown,去掉频道的上下文块)、加入频道、删除(退出所在频道,只剩它的频道一并删除,会话文件保留);靠近底部时菜单向上展开。频道是主区域的一个页面(不进右侧工作台),以群聊显示:别人的消息在左边带头像和名字,用户的在右边,连续发言合成一组,停顿久了插一行时间;顶栏是频道名和成员头像,点头像在右侧工作台打开"频道成员"(`members`,`location: 'panel'` 的视图,跟着当前频道):列出成员,负责人带标记,正在回答的标绿;每行点开是智能体的会话,悬停(触屏上常显)出现设为负责人、免打扰、重开会话(忘掉之前的对话,下次回答时开新会话,旧会话仍在对话列表里)和移出频道(至少留一位);顶部"添加成员"换成可搜索的智能体列表,勾选后添加,列表底部的"新建智能体"打开新建智能体的草稿页;底部是删除频道(再确认一次,消息一并删除,正在进行的回答不再贴出)。输入框就是对话的输入框(`pi.ui.Composer`),`@` 列出成员,+ 里可以点名成员、添加成员(打开频道成员的添加列表),或"做成扩展"(在频道里请负责人用 ta-package 技能把这里商量和做成的事做成扩展);消息用对话的 Markdown 渲染(`pi.ui.Markdown`),点名的成员加粗。
17
17
 
18
18
  ## 数据与转发
19
19
 
@@ -135,6 +135,21 @@ var TaLocation;
135
135
  return name || (remote === null || remote === undefined ? undefined : remote.host) || location;
136
136
  }
137
137
  TaLocation2.basename = basename;
138
+ function homeRelative(location) {
139
+ var _a;
140
+ const remote = parse(location);
141
+ const path2 = remote ? remote.path ? remote.path.slice(1) : "~" : location;
142
+ const match = /^~(?:[\\/]+(.*))?$/.exec(path2);
143
+ return match ? ((_a = match[1]) !== null && _a !== undefined ? _a : "").replace(/[\\/]+$/, "") : undefined;
144
+ }
145
+ TaLocation2.homeRelative = homeRelative;
146
+ function isAbsolute(location) {
147
+ if (homeRelative(location) !== undefined) {
148
+ return false;
149
+ }
150
+ return isRemote(location) || /^([\\/]|[A-Za-z]:)/.test(location);
151
+ }
152
+ TaLocation2.isAbsolute = isAbsolute;
138
153
  function parentPath(path2) {
139
154
  const trimmed = path2.replace(/[\\/]+$/, "");
140
155
  const at = Math.max(trimmed.lastIndexOf("/"), trimmed.lastIndexOf("\\"));
@@ -183,6 +198,10 @@ var TaErrorCode = {
183
198
  MODEL_NOT_FOUND: "CELL_TA_MODEL_NOT_FOUND",
184
199
  INVALID_ARGUMENT: "CELL_TA_INVALID_ARGUMENT",
185
200
  COMMAND_FAILED: "CELL_TA_COMMAND_FAILED",
201
+ NOTHING_TO_COMPACT: "CELL_TA_NOTHING_TO_COMPACT",
202
+ ALREADY_COMPACTED: "CELL_TA_ALREADY_COMPACTED",
203
+ SESSION_BUSY: "CELL_TA_SESSION_BUSY",
204
+ CANCELLED: "CELL_TA_CANCELLED",
186
205
  NOT_SIGNED_IN: "CELL_TA_NOT_SIGNED_IN",
187
206
  ENVIRONMENT_FAILED: "CELL_TA_ENVIRONMENT_FAILED",
188
207
  CONNECTION_LOST: "CELL_TA_CONNECTION_LOST"
@@ -213,6 +232,37 @@ ${message}`;
213
232
  }
214
233
  TaMessageContext2.strip = strip;
215
234
  })(TaMessageContext || (TaMessageContext = {}));
235
+ var TaImageNote;
236
+ (function(TaImageNote2) {
237
+ const NOTE = /^\[Image: original \d+x\d+, displayed at \d+x\d+\. Multiply coordinates by [\d.]+ to map to original image\.\]$|^\[Image converted from [^\]]+ to [^\]]+\.\]$/;
238
+ function strip(text) {
239
+ const lines = text.split(`
240
+ `);
241
+ const kept = lines.filter((line) => !NOTE.test(line.trim()));
242
+ if (kept.length === lines.length) {
243
+ return text;
244
+ }
245
+ return kept.join(`
246
+ `).replace(/\n+$/, "").replace(/^\n+/, "");
247
+ }
248
+ TaImageNote2.strip = strip;
249
+ })(TaImageNote || (TaImageNote = {}));
250
+ var TaAgentSummary;
251
+ (function(TaAgentSummary2) {
252
+ const START = /^\s*<conversation_history_summary>/;
253
+ const BLOCK = /^\s*<conversation_history_summary>[\s\S]*?(?:<\/conversation_history_summary>\s*|$)/;
254
+ function read(text) {
255
+ if (!START.test(text)) {
256
+ return;
257
+ }
258
+ return text.replace(/<\/?(?:conversation_history_summary|summary)>/g, "").replace(/<\/?\w*$/, "").trim();
259
+ }
260
+ TaAgentSummary2.read = read;
261
+ function strip(text) {
262
+ return text.replace(BLOCK, "");
263
+ }
264
+ TaAgentSummary2.strip = strip;
265
+ })(TaAgentSummary || (TaAgentSummary = {}));
216
266
  var TaSkillUse;
217
267
  (function(TaSkillUse2) {
218
268
  const BLOCK = /^<skill name="([^"]+)" location="([^"]+)">\n([\s\S]*?)\n<\/skill>(?:\n\n([\s\S]+))?$/;
@@ -82,15 +82,23 @@ function NewAgentHead({ context }) {
82
82
  function NewAgentPage({ context }) {
83
83
  const { pi, service, ui } = context;
84
84
  const { draft } = (0, views_1.useUi)(ui);
85
+ const { loaded } = (0, views_1.useChannels)(service);
85
86
  const w = views_1.ChannelViews.words(pi);
86
87
  const Pencil = views_1.ChannelViews.icon(pi, 'Pencil');
87
88
  const Composer = pi.ui.Composer;
88
- // Shown again after a reload, when what was being made is gone: a new one.
89
+ // Shown again after a reload, when what was being made is gone: a new one, once the team is read so that its name
90
+ // is free. Only the first time: the draft goes the moment its first message makes the agent, while the page is
91
+ // still in front, and no other is wanted then.
92
+ const first = react_1.React.useRef(true);
89
93
  react_1.React.useEffect(() => {
90
- if (!draft) {
94
+ if (!loaded || !first.current) {
95
+ return;
96
+ }
97
+ first.current = false;
98
+ if (!ui.state.draft) {
91
99
  newAgent(context);
92
100
  }
93
- }, [draft, context]);
101
+ }, [loaded, ui, context]);
94
102
  if (!draft) {
95
103
  return null;
96
104
  }
@@ -159,7 +159,7 @@ function RoomFace({ members, faces, size, working }) {
159
159
  if (!next) {
160
160
  return react_1.React.createElement(Face, { face: (_a = faces.get(lead.id)) !== null && _a !== void 0 ? _a : 0, size: size, working: working.includes(lead.id) });
161
161
  }
162
- const small = Math.round(size * 0.72);
162
+ const small = Math.round(size * 0.76);
163
163
  return (react_1.React.createElement("span", { className: "tac-room", style: { width: size, height: size }, "aria-hidden": "true" },
164
164
  react_1.React.createElement("span", { className: "tac-room-back" },
165
165
  react_1.React.createElement(Face, { face: (_b = faces.get(next.id)) !== null && _b !== void 0 ? _b : 0, size: small, working: working.includes(next.id) })),
@@ -10,6 +10,9 @@ declare const EN: {
10
10
  readonly topic: 'Topic';
11
11
  readonly members: 'Members';
12
12
  readonly addMembers: 'Add members';
13
+ readonly makeExtension: 'Make an extension';
14
+ readonly makeExtensionDetail: 'Of what was worked out here';
15
+ readonly makeExtensionAsk: 'Make what this channel worked out an extension, with the ta-package skill, to do it again in a click';
13
16
  readonly add: 'Add';
14
17
  readonly allMembers: 'Every agent is in this channel already';
15
18
  readonly membersHint: 'The first one you pick leads: it answers what names nobody.';
@@ -34,12 +37,10 @@ declare const EN: {
34
37
  readonly search: 'Search';
35
38
  readonly clear: 'Clear';
36
39
  readonly new: 'New';
37
- readonly idle: 'Idle';
38
40
  readonly answeringIn: 'Answering in #{channel}';
39
41
  readonly answeringNow: '{name} is answering…';
40
42
  readonly noMatch: 'No matching agents or channels';
41
43
  readonly noMessages: 'No messages yet';
42
- readonly leadOf: 'Lead: {name}';
43
44
  readonly noAgentsYet: 'No agents yet';
44
45
  readonly noAgentsYetHint: 'Create one with +, or ask Ta for a team';
45
46
  readonly myDouble: 'My double';
@@ -118,20 +119,16 @@ declare const EN: {
118
119
  readonly membersSection: 'Members';
119
120
  readonly byDirectory: 'Group by directory';
120
121
  readonly channelsSection: 'Channels';
121
- readonly waitingSection: 'Waiting for you';
122
- readonly runningSection: 'In progress';
123
- readonly endedSection: 'Ended';
124
122
  readonly showAll: 'Show all {count}';
125
123
  readonly showFewer: 'Show fewer';
126
- readonly noTasksYet: 'Nothing handed out yet';
127
124
  readonly waitingCount: '{count} need you';
128
125
  readonly runningCount: '{count} running';
126
+ readonly freshCount: '{count} new';
129
127
  readonly standingBy: 'Standing by';
130
- readonly noTasksYetHint: 'Tell the double what you want done';
131
128
  readonly noTasksHere: 'What the double hands out, tasks and teams, is listed here';
132
- readonly tellDouble: 'Talk to the double';
133
129
  readonly deleteTask: 'Delete the team';
134
- readonly confirmDeleteTask: 'Delete #{channel} and its messages? Its agents stay, among your members.';
130
+ readonly deleteTaskHint: 'The messages of #{channel} go with it. Its agents stay, among your members.';
131
+ readonly selectTasks: 'Select';
135
132
  };
136
133
  export type Words = {
137
134
  readonly [K in keyof typeof EN]: string;
@@ -13,6 +13,9 @@ const EN = {
13
13
  topic: 'Topic',
14
14
  members: 'Members',
15
15
  addMembers: 'Add members',
16
+ makeExtension: 'Make an extension',
17
+ makeExtensionDetail: 'Of what was worked out here',
18
+ makeExtensionAsk: 'Make what this channel worked out an extension, with the ta-package skill, to do it again in a click',
16
19
  add: 'Add',
17
20
  allMembers: 'Every agent is in this channel already',
18
21
  membersHint: 'The first one you pick leads: it answers what names nobody.',
@@ -37,12 +40,10 @@ const EN = {
37
40
  search: 'Search',
38
41
  clear: 'Clear',
39
42
  new: 'New',
40
- idle: 'Idle',
41
43
  answeringIn: 'Answering in #{channel}',
42
44
  answeringNow: '{name} is answering…',
43
45
  noMatch: 'No matching agents or channels',
44
46
  noMessages: 'No messages yet',
45
- leadOf: 'Lead: {name}',
46
47
  noAgentsYet: 'No agents yet',
47
48
  noAgentsYetHint: 'Create one with +, or ask Ta for a team',
48
49
  myDouble: 'My double',
@@ -121,20 +122,16 @@ const EN = {
121
122
  membersSection: 'Members',
122
123
  byDirectory: 'Group by directory',
123
124
  channelsSection: 'Channels',
124
- waitingSection: 'Waiting for you',
125
- runningSection: 'In progress',
126
- endedSection: 'Ended',
127
125
  showAll: 'Show all {count}',
128
126
  showFewer: 'Show fewer',
129
- noTasksYet: 'Nothing handed out yet',
130
127
  waitingCount: '{count} need you',
131
128
  runningCount: '{count} running',
129
+ freshCount: '{count} new',
132
130
  standingBy: 'Standing by',
133
- noTasksYetHint: 'Tell the double what you want done',
134
131
  noTasksHere: 'What the double hands out, tasks and teams, is listed here',
135
- tellDouble: 'Talk to the double',
136
132
  deleteTask: 'Delete the team',
137
- confirmDeleteTask: 'Delete #{channel} and its messages? Its agents stay, among your members.',
133
+ deleteTaskHint: 'The messages of #{channel} go with it. Its agents stay, among your members.',
134
+ selectTasks: 'Select',
138
135
  };
139
136
  const ZH = {
140
137
  title: '分身',
@@ -148,6 +145,9 @@ const ZH = {
148
145
  topic: '主题',
149
146
  members: '成员',
150
147
  addMembers: '添加成员',
148
+ makeExtension: '做成扩展',
149
+ makeExtensionDetail: '把这里商量出的事做成工具',
150
+ makeExtensionAsk: '把这个频道里商量和做成的事做成扩展(用 ta-package 技能),以后一键就能再用',
151
151
  add: '添加',
152
152
  allMembers: '所有智能体都已在这个频道里',
153
153
  membersHint: '先选的成员是负责人:没人被 @ 的消息由它回答。',
@@ -172,12 +172,10 @@ const ZH = {
172
172
  search: '搜索',
173
173
  clear: '清除',
174
174
  new: '新建',
175
- idle: '空闲',
176
175
  answeringIn: '正在 #{channel} 回答',
177
176
  answeringNow: '{name} 正在回答…',
178
177
  noMatch: '没有匹配的智能体或频道',
179
178
  noMessages: '还没有消息',
180
- leadOf: '负责人:{name}',
181
179
  noAgentsYet: '还没有智能体',
182
180
  noAgentsYetHint: '点 + 新建,或让 Ta 组个团队',
183
181
  myDouble: '我的分身',
@@ -256,20 +254,16 @@ const ZH = {
256
254
  membersSection: '成员',
257
255
  byDirectory: '按目录分组',
258
256
  channelsSection: '频道',
259
- waitingSection: '待你处理',
260
- runningSection: '进行中',
261
- endedSection: '已结束',
262
257
  showAll: '显示全部 {count} 个',
263
258
  showFewer: '收起',
264
- noTasksYet: '还没有交出的事',
265
259
  waitingCount: '{count} 个待你处理',
266
260
  runningCount: '{count} 个进行中',
261
+ freshCount: '{count} 个新结果',
267
262
  standingBy: '待命',
268
- noTasksYetHint: '告诉分身你想做什么',
269
263
  noTasksHere: '分身交出去的任务和团队会列在这里',
270
- tellDouble: '和分身说',
271
264
  deleteTask: '删除这个团队',
272
- confirmDeleteTask: '删除 #{channel} 及其消息?团队成员会留在你的成员里。',
265
+ deleteTaskHint: '#{channel} 的消息会一起删除,团队成员会留在你的成员里。',
266
+ selectTasks: '多选',
273
267
  };
274
268
  var ChannelWords;
275
269
  (function (ChannelWords) {
@@ -12,8 +12,9 @@ export interface MoreItem {
12
12
  * row it is in (its parent) opens it too, as a long press does on a phone (where the … is not shown): at the
13
13
  * height of the pointer then. An entry closes the menu and runs; a click outside or Escape closes it. The menu
14
14
  * is fixed to the screen, below where it opened or above when there is no room, so that the list it is in does
15
- * not cut it. Opened by a finger (the page's data-touch), it is centred above the finger as the menus of a phone
16
- * (below when there is no room), out of the notch and the home indicator, and the row stays marked while it is open.
15
+ * not cut it. Opened by a finger (the page's data-touch), it goes and takes the finger as the menus of the page do
16
+ * (ui.attachMenu: out from under the finger and the row, slide onto an entry to choose it), and the row stays marked
17
+ * while it is open.
17
18
  */
18
19
  export declare function MoreMenu({ pi, label, items }: {
19
20
  pi: WebExtensionAPI;
@@ -5,40 +5,40 @@ const react_1 = require("./react");
5
5
  const views_1 = require("./views");
6
6
  /** Between the menu and the edges of the screen. */
7
7
  const MARGIN = 8;
8
- /** Between a finger and the menu it opened: the finger does not cover it. */
9
- const FINGER_GAP = 14;
10
- /** The insets of the notch and of the home indicator, which a menu on a phone keeps out of. */
11
- function safeArea() {
12
- const probe = document.createElement('div');
13
- probe.style.cssText =
14
- 'position:fixed;visibility:hidden;pointer-events:none;padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom)';
15
- document.body.appendChild(probe);
16
- const style = getComputedStyle(probe);
17
- const area = { top: Number.parseFloat(style.paddingTop) || 0, bottom: Number.parseFloat(style.paddingBottom) || 0 };
18
- probe.remove();
19
- return area;
20
- }
21
8
  /**
22
9
  * A … that shows on hover and opens a menu: sections of entries set apart by a line. A right click on the
23
10
  * row it is in (its parent) opens it too, as a long press does on a phone (where the … is not shown): at the
24
11
  * height of the pointer then. An entry closes the menu and runs; a click outside or Escape closes it. The menu
25
12
  * is fixed to the screen, below where it opened or above when there is no room, so that the list it is in does
26
- * not cut it. Opened by a finger (the page's data-touch), it is centred above the finger as the menus of a phone
27
- * (below when there is no room), out of the notch and the home indicator, and the row stays marked while it is open.
13
+ * not cut it. Opened by a finger (the page's data-touch), it goes and takes the finger as the menus of the page do
14
+ * (ui.attachMenu: out from under the finger and the row, slide onto an entry to choose it), and the row stays marked
15
+ * while it is open.
28
16
  */
29
17
  function MoreMenu({ pi, label, items }) {
30
18
  const w = views_1.ChannelViews.words(pi);
31
19
  const [open, setOpen] = react_1.React.useState(false);
32
20
  /** Where it opened: the right of the button, and the height of the pointer or the bottom and top of the button. */
33
- const anchor = react_1.React.useRef({ right: 0, below: 0, above: 0, finger: undefined });
21
+ const anchor = react_1.React.useRef({
22
+ right: 0,
23
+ below: 0,
24
+ above: 0,
25
+ finger: undefined,
26
+ });
34
27
  const root = react_1.React.useRef(null);
35
28
  const menu = react_1.React.useRef(null);
36
29
  const Ellipsis = views_1.ChannelViews.icon(pi, 'Ellipsis');
37
30
  const show = react_1.React.useCallback((button, at) => {
38
31
  var _a, _b;
32
+ var _c, _d, _e;
39
33
  const box = button.getBoundingClientRect();
40
34
  const touch = document.documentElement.hasAttribute('data-touch');
41
- anchor.current = { right: box.right, below: (_a = at === null || at === void 0 ? void 0 : at.y) !== null && _a !== void 0 ? _a : box.bottom, above: (_b = at === null || at === void 0 ? void 0 : at.y) !== null && _b !== void 0 ? _b : box.top, finger: touch ? at : undefined };
35
+ const row = (_c = (_b = (_a = root.current) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect()) !== null && _c !== void 0 ? _c : box;
36
+ anchor.current = {
37
+ right: box.right,
38
+ below: (_d = at === null || at === void 0 ? void 0 : at.y) !== null && _d !== void 0 ? _d : box.bottom,
39
+ above: (_e = at === null || at === void 0 ? void 0 : at.y) !== null && _e !== void 0 ? _e : box.top,
40
+ finger: touch && at ? { ...at, around: { top: row.top, bottom: row.bottom } } : undefined,
41
+ };
42
42
  setOpen(true);
43
43
  }, []);
44
44
  react_1.React.useLayoutEffect(() => {
@@ -47,23 +47,15 @@ function MoreMenu({ pi, label, items }) {
47
47
  return;
48
48
  }
49
49
  const { right, below, above, finger } = anchor.current;
50
- const width = element.offsetWidth;
51
- const height = element.offsetHeight;
52
50
  if (finger) {
53
- const safe = safeArea();
54
- const highest = safe.top + MARGIN;
55
- const lowest = window.innerHeight - safe.bottom - MARGIN - height;
56
- const over = finger.y - FINGER_GAP - height;
57
- const top = over >= highest ? over : Math.max(highest, Math.min(finger.y + FINGER_GAP, lowest));
58
- element.style.top = `${top}px`;
59
- element.style.left = `${Math.max(MARGIN, Math.min(finger.x - width / 2, window.innerWidth - MARGIN - width))}px`;
60
- element.style.transformOrigin = top < finger.y ? 'center bottom' : 'center top';
61
- return;
51
+ return pi.ui.attachMenu(element, finger, () => setOpen(false));
62
52
  }
53
+ const width = element.offsetWidth;
54
+ const height = element.offsetHeight;
63
55
  const top = below + 4 + height <= window.innerHeight - MARGIN ? below + 4 : Math.max(MARGIN, above - 4 - height);
64
56
  element.style.top = `${top}px`;
65
57
  element.style.left = `${Math.max(MARGIN, right - width)}px`;
66
- }, [open]);
58
+ }, [open, pi]);
67
59
  react_1.React.useEffect(() => {
68
60
  var _a, _b;
69
61
  const row = (_a = root.current) === null || _a === void 0 ? void 0 : _a.parentElement;