clay-server 5.1.1-beta.1 → 5.2.0-beta.10

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 (588) hide show
  1. package/lib/account-auth-policy.js +21 -0
  2. package/lib/account-auth-socket.js +30 -0
  3. package/lib/account-auth-throttle.js +44 -0
  4. package/lib/account-auth-transport.js +48 -0
  5. package/lib/account-login-page.js +28 -0
  6. package/lib/account-passkey-challenges.js +31 -0
  7. package/lib/account-passkey-page.js +89 -0
  8. package/lib/account-passkey-policy.js +39 -0
  9. package/lib/account-password-page.js +69 -0
  10. package/lib/account-passwords.js +36 -0
  11. package/lib/account-remembered.js +77 -0
  12. package/lib/account-session-page.js +51 -0
  13. package/lib/account-session-store.js +82 -0
  14. package/lib/builtin-mates.js +19 -16
  15. package/lib/bundled-skills/clay-agent-browser/SKILL.md +6 -2
  16. package/lib/canonical-clay-record-authority.js +15 -0
  17. package/lib/canonical-clay-scheduling-authority.js +19 -0
  18. package/lib/claude-hook-installer.js +1 -239
  19. package/lib/claude-jsonl-watcher.js +1 -204
  20. package/lib/clay-control-presentation-binding.js +96 -0
  21. package/lib/clay-control-presentation.js +128 -0
  22. package/lib/clay-control-target-projection.js +26 -0
  23. package/lib/clay-mate-chat-receipts.js +26 -0
  24. package/lib/clay-mate-chat.js +88 -0
  25. package/lib/clay-mate-knowledge-input.js +26 -0
  26. package/lib/clay-mate-knowledge.js +95 -0
  27. package/lib/clay-mate-lifecycle.js +95 -0
  28. package/lib/clay-product-control-input.js +33 -0
  29. package/lib/clay-product-control-tools.js +51 -0
  30. package/lib/clay-product-control.js +247 -0
  31. package/lib/clay-project-lifecycle.js +154 -0
  32. package/lib/clay-project-record-input.js +44 -0
  33. package/lib/clay-project-records.js +84 -0
  34. package/lib/clay-scheduling-input.js +21 -0
  35. package/lib/clay-scheduling-receipts.js +26 -0
  36. package/lib/clay-scheduling.js +119 -0
  37. package/lib/clay-screen-controls.js +104 -0
  38. package/lib/clay-skill-install.js +1 -33
  39. package/lib/clay-workspace-controls.js +84 -0
  40. package/lib/clay-workspace-input.js +17 -0
  41. package/lib/clay-workspace-receipts.js +26 -0
  42. package/lib/cli-sessions.js +1 -300
  43. package/lib/codex-defaults.js +1 -28
  44. package/lib/context-usage.js +3 -2
  45. package/lib/contextual-screen-snapshot.js +38 -0
  46. package/lib/daemon-project-access.js +11 -0
  47. package/lib/daemon-project-lifecycle-callbacks.js +15 -0
  48. package/lib/daemon-project-lifecycle.js +262 -0
  49. package/lib/daemon-projects.js +1 -1
  50. package/lib/daemon.js +80 -276
  51. package/lib/default-ai-runtime.js +4 -8
  52. package/lib/dm-digest-cursor.js +120 -0
  53. package/lib/email-mcp-server.js +1 -1
  54. package/lib/issues-service.js +29 -15
  55. package/lib/kiro-defaults.js +1 -22
  56. package/lib/knowledge-db-import-validation.js +46 -0
  57. package/lib/knowledge-db-import.js +99 -0
  58. package/lib/knowledge-db-service.js +24 -33
  59. package/lib/knowledge-db-storage-nedb-maintenance.js +99 -0
  60. package/lib/knowledge-db-storage-nedb.js +66 -0
  61. package/lib/knowledge-db-storage.js +72 -0
  62. package/lib/knowledge-db-validation.js +0 -0
  63. package/lib/knowledge-document-index.js +2 -1
  64. package/lib/knowledge-file-store.js +7 -1
  65. package/lib/knowledge-product-operations.js +46 -0
  66. package/lib/mate-avatar-catalog.js +12 -0
  67. package/lib/mate-avatar-migration.js +41 -0
  68. package/lib/mate-context-service.js +138 -0
  69. package/lib/mate-context-tools.js +21 -0
  70. package/lib/mate-creation-mcp-server.js +2 -0
  71. package/lib/mate-knowledge-canonical-access.js +10 -0
  72. package/lib/mate-knowledge-mate-bound.js +53 -0
  73. package/lib/mate-knowledge-mcp-server.js +55 -8
  74. package/lib/mate-knowledge-service.js +16 -34
  75. package/lib/mate-knowledge-text-tools.js +106 -0
  76. package/lib/mate-lifecycle-service.js +94 -0
  77. package/lib/mate-message-delivery.js +43 -0
  78. package/lib/mate-ready-creation.js +9 -1
  79. package/lib/mate-schedule-input.js +29 -0
  80. package/lib/mate-schedule-lifecycle.js +151 -0
  81. package/lib/mate-scheduling.js +103 -0
  82. package/lib/mates.js +18 -6
  83. package/lib/mcp-agent-tools.js +117 -0
  84. package/lib/mcp-connection-store.js +119 -15
  85. package/lib/mcp-import-credentials.js +31 -0
  86. package/lib/mcp-local-transport.js +13 -0
  87. package/lib/mcp-oauth.js +8 -6
  88. package/lib/mcp-proxy.js +2 -32
  89. package/lib/mcp-query-bridge.js +30 -0
  90. package/lib/mcp-remote-connections.js +74 -20
  91. package/lib/mcp-source-adapters.js +1 -0
  92. package/lib/mcp-source-context.js +1 -0
  93. package/lib/mcp-source-discovery.js +1 -0
  94. package/lib/mcp-source-plugins.js +1 -0
  95. package/lib/mcp-source-restrictions.js +1 -0
  96. package/lib/mcp-tool-policy.js +9 -0
  97. package/lib/migrate-single-user.js +3 -23
  98. package/lib/notes-checklist.js +50 -0
  99. package/lib/notes.js +49 -3
  100. package/lib/os-user-diagnostics.js +2 -4
  101. package/lib/os-users.js +24 -70
  102. package/lib/pane-pending-interactions.js +20 -0
  103. package/lib/pane-session-activation.js +114 -0
  104. package/lib/pane-session-transport.js +26 -0
  105. package/lib/project-admin-overview.js +51 -0
  106. package/lib/project-ask-user.js +8 -4
  107. package/lib/project-connection.js +14 -10
  108. package/lib/project-control-git-view.js +12 -0
  109. package/lib/project-debate.js +1 -0
  110. package/lib/project-delegated-follow-up.js +2 -1
  111. package/lib/project-directory-claim.js +65 -0
  112. package/lib/project-file-operations.js +61 -0
  113. package/lib/project-filesystem.js +15 -85
  114. package/lib/project-full-access.js +23 -2
  115. package/lib/project-http.js +7 -4
  116. package/lib/project-knowledge.js +32 -18
  117. package/lib/project-lifecycle-operations.js +98 -0
  118. package/lib/project-lifecycle-process-witness.js +32 -0
  119. package/lib/project-lifecycle-runtime.js +50 -0
  120. package/lib/project-linux-access.js +22 -0
  121. package/lib/project-logs-canonical-clay.js +27 -0
  122. package/lib/project-logs-clay-query.js +16 -0
  123. package/lib/project-logs-schema.js +4 -2
  124. package/lib/project-logs-service.js +8 -7
  125. package/lib/project-logs.js +1 -0
  126. package/lib/project-loop.js +1 -0
  127. package/lib/project-mate-chat-control.js +55 -0
  128. package/lib/project-mate-creation-proposal.js +18 -3
  129. package/lib/project-mate-interaction.js +40 -62
  130. package/lib/project-mcp.js +54 -16
  131. package/lib/project-models.js +14 -31
  132. package/lib/project-notifications.js +76 -17
  133. package/lib/project-ownership.js +77 -0
  134. package/lib/project-pair-result-delivery.js +14 -3
  135. package/lib/project-pair-usage.js +12 -13
  136. package/lib/project-pending-message-queue.js +4 -1
  137. package/lib/project-product-control.js +89 -0
  138. package/lib/project-product-session-queue.js +46 -0
  139. package/lib/project-push-access.js +28 -0
  140. package/lib/project-scheduled-message-queue.js +30 -0
  141. package/lib/project-scheduled-messages.js +67 -68
  142. package/lib/project-scheduled-task-control.js +83 -0
  143. package/lib/project-scheduled-tasks.js +13 -2
  144. package/lib/project-scheduling-access.js +10 -0
  145. package/lib/project-server-settings.js +1 -0
  146. package/lib/project-session-actions.js +65 -0
  147. package/lib/project-session-delete.js +8 -1
  148. package/lib/project-session-document.js +27 -7
  149. package/lib/project-session-github.js +63 -19
  150. package/lib/project-session-history-actions.js +167 -0
  151. package/lib/project-session-linear.js +14 -6
  152. package/lib/project-session-notes.js +7 -3
  153. package/lib/project-session-pair.js +1 -1
  154. package/lib/project-session-runtime-actions.js +64 -0
  155. package/lib/project-session-spawn.js +2 -3
  156. package/lib/project-session-vendor.js +55 -0
  157. package/lib/project-sessions.js +103 -272
  158. package/lib/project-shared-browser.js +78 -17
  159. package/lib/project-studio-presentation.js +58 -0
  160. package/lib/project-user-knowledge.js +2 -1
  161. package/lib/project-user-message.js +67 -1
  162. package/lib/project-vendor-login.js +6 -36
  163. package/lib/project-workspace-operations.js +126 -0
  164. package/lib/project-workspace-query.js +19 -2
  165. package/lib/project.js +178 -45
  166. package/lib/public/app.js +46 -0
  167. package/lib/public/appearance-bootstrap.js +16 -0
  168. package/lib/public/auth/account-login.css +98 -0
  169. package/lib/public/auth/account-login.js +104 -0
  170. package/lib/public/css/clay-tool-activity.css +51 -0
  171. package/lib/public/css/clay-workspace.css +29 -0
  172. package/lib/public/css/command-palette.css +12 -33
  173. package/lib/public/css/contextual-clay.css +240 -0
  174. package/lib/public/css/home-debate-planning.css +2 -0
  175. package/lib/public/css/home-mate-creation.css +5 -0
  176. package/lib/public/css/input.css +6 -0
  177. package/lib/public/css/mate-avatar-gallery.css +12 -0
  178. package/lib/public/css/mate-conversation.css +10 -5
  179. package/lib/public/css/messages.css +6 -2
  180. package/lib/public/css/overlays.css +4 -2
  181. package/lib/public/css/project-admin-overview.css +13 -0
  182. package/lib/public/css/session-folders.css +11 -0
  183. package/lib/public/css/session-github.css +46 -1
  184. package/lib/public/css/shared-browser.css +35 -1
  185. package/lib/public/css/sticky-notes.css +87 -1
  186. package/lib/public/css/user-settings-sessions.css +42 -0
  187. package/lib/public/index.html +28 -10
  188. package/lib/public/mate-avatars/B01.png +0 -0
  189. package/lib/public/mate-avatars/B02.png +0 -0
  190. package/lib/public/mate-avatars/B03.png +0 -0
  191. package/lib/public/mate-avatars/B04.png +0 -0
  192. package/lib/public/mate-avatars/B05.png +0 -0
  193. package/lib/public/mate-avatars/B06.png +0 -0
  194. package/lib/public/mate-avatars/B07.png +0 -0
  195. package/lib/public/mate-avatars/B08.png +0 -0
  196. package/lib/public/mate-avatars/B09.png +0 -0
  197. package/lib/public/mate-avatars/B10.png +0 -0
  198. package/lib/public/mate-avatars/B11.png +0 -0
  199. package/lib/public/mate-avatars/B12.png +0 -0
  200. package/lib/public/mate-avatars/B13.png +0 -0
  201. package/lib/public/mate-avatars/B14.png +0 -0
  202. package/lib/public/mate-avatars/B15.png +0 -0
  203. package/lib/public/mate-avatars/B16.png +0 -0
  204. package/lib/public/mate-avatars/B17.png +0 -0
  205. package/lib/public/mate-avatars/B18.png +0 -0
  206. package/lib/public/mate-avatars/B19.png +0 -0
  207. package/lib/public/mate-avatars/B20.png +0 -0
  208. package/lib/public/mate-avatars/B21.png +0 -0
  209. package/lib/public/mate-avatars/B22.png +0 -0
  210. package/lib/public/mate-avatars/B23.png +0 -0
  211. package/lib/public/mate-avatars/B24.png +0 -0
  212. package/lib/public/mate-avatars/B25.png +0 -0
  213. package/lib/public/mate-avatars/B26.png +0 -0
  214. package/lib/public/mate-avatars/B27.png +0 -0
  215. package/lib/public/mate-avatars/B28.png +0 -0
  216. package/lib/public/mate-avatars/B29.png +0 -0
  217. package/lib/public/mate-avatars/B30.png +0 -0
  218. package/lib/public/mate-avatars/B31.png +0 -0
  219. package/lib/public/mate-avatars/B32.png +0 -0
  220. package/lib/public/mate-avatars/B33.png +0 -0
  221. package/lib/public/mate-avatars/B34.png +0 -0
  222. package/lib/public/mate-avatars/B35.png +0 -0
  223. package/lib/public/mate-avatars/B36.png +0 -0
  224. package/lib/public/mate-avatars/B37.png +0 -0
  225. package/lib/public/mate-avatars/B38.png +0 -0
  226. package/lib/public/mate-avatars/B39.png +0 -0
  227. package/lib/public/mate-avatars/B40.png +0 -0
  228. package/lib/public/mate-avatars/B41.png +0 -0
  229. package/lib/public/mate-avatars/B42.png +0 -0
  230. package/lib/public/mate-avatars/B43.png +0 -0
  231. package/lib/public/mate-avatars/B44.png +0 -0
  232. package/lib/public/mate-avatars/B45.png +0 -0
  233. package/lib/public/mate-avatars/B46.png +0 -0
  234. package/lib/public/mate-avatars/B47.png +0 -0
  235. package/lib/public/mate-avatars/B48.png +0 -0
  236. package/lib/public/mate-avatars/C01.png +0 -0
  237. package/lib/public/mate-avatars/C02.png +0 -0
  238. package/lib/public/mate-avatars/C03.png +0 -0
  239. package/lib/public/mate-avatars/C04.png +0 -0
  240. package/lib/public/mate-avatars/C05.png +0 -0
  241. package/lib/public/mate-avatars/C06.png +0 -0
  242. package/lib/public/mate-avatars/C07.png +0 -0
  243. package/lib/public/mate-avatars/C08.png +0 -0
  244. package/lib/public/mate-avatars/C09.png +0 -0
  245. package/lib/public/mate-avatars/C10.png +0 -0
  246. package/lib/public/mate-avatars/C11.png +0 -0
  247. package/lib/public/mate-avatars/C12.png +0 -0
  248. package/lib/public/mate-avatars/C13.png +0 -0
  249. package/lib/public/mate-avatars/C14.png +0 -0
  250. package/lib/public/mate-avatars/C15.png +0 -0
  251. package/lib/public/mate-avatars/C16.png +0 -0
  252. package/lib/public/mate-avatars/C17.png +0 -0
  253. package/lib/public/mate-avatars/C18.png +0 -0
  254. package/lib/public/mate-avatars/C19.png +0 -0
  255. package/lib/public/mate-avatars/C20.png +0 -0
  256. package/lib/public/mate-avatars/C21.png +0 -0
  257. package/lib/public/mate-avatars/C22.png +0 -0
  258. package/lib/public/mate-avatars/C23.png +0 -0
  259. package/lib/public/mate-avatars/C24.png +0 -0
  260. package/lib/public/mate-avatars/C25.png +0 -0
  261. package/lib/public/mate-avatars/C26.png +0 -0
  262. package/lib/public/mate-avatars/C27.png +0 -0
  263. package/lib/public/mate-avatars/C28.png +0 -0
  264. package/lib/public/mate-avatars/C29.png +0 -0
  265. package/lib/public/mate-avatars/C30.png +0 -0
  266. package/lib/public/mate-avatars/C31.png +0 -0
  267. package/lib/public/mate-avatars/C32.png +0 -0
  268. package/lib/public/mate-avatars/C33.png +0 -0
  269. package/lib/public/mate-avatars/C34.png +0 -0
  270. package/lib/public/mate-avatars/C35.png +0 -0
  271. package/lib/public/mate-avatars/C36.png +0 -0
  272. package/lib/public/mate-avatars/C37.png +0 -0
  273. package/lib/public/mate-avatars/C38.png +0 -0
  274. package/lib/public/mate-avatars/C39.png +0 -0
  275. package/lib/public/mate-avatars/C40.png +0 -0
  276. package/lib/public/mate-avatars/C41.png +0 -0
  277. package/lib/public/mate-avatars/C42.png +0 -0
  278. package/lib/public/mate-avatars/C43.png +0 -0
  279. package/lib/public/mate-avatars/C44.png +0 -0
  280. package/lib/public/mate-avatars/C45.png +0 -0
  281. package/lib/public/mate-avatars/C46.png +0 -0
  282. package/lib/public/mate-avatars/C47.png +0 -0
  283. package/lib/public/mate-avatars/C48.png +0 -0
  284. package/lib/public/mate-avatars/catalog.json +482 -0
  285. package/lib/public/mate-avatars/lead-clay.png +0 -0
  286. package/lib/public/modules/account-auth-settings.js +71 -0
  287. package/lib/public/modules/account-transport-settings.js +51 -0
  288. package/lib/public/modules/admin-settings-projects.js +6 -2
  289. package/lib/public/modules/app-connection.js +11 -1
  290. package/lib/public/modules/app-favicon.js +18 -9
  291. package/lib/public/modules/app-header.js +7 -4
  292. package/lib/public/modules/app-loop-ui.js +2 -0
  293. package/lib/public/modules/app-message-router.js +22 -1
  294. package/lib/public/modules/app-messages.js +119 -17
  295. package/lib/public/modules/app-misc.js +3 -1
  296. package/lib/public/modules/app-notifications.js +11 -5
  297. package/lib/public/modules/app-panels.js +61 -123
  298. package/lib/public/modules/app-projects.js +13 -0
  299. package/lib/public/modules/app-rate-limit.js +7 -27
  300. package/lib/public/modules/app-rendering.js +4 -3
  301. package/lib/public/modules/avatar.js +15 -41
  302. package/lib/public/modules/chat-render-runtime.js +20 -0
  303. package/lib/public/modules/clay-browser-links.js +47 -0
  304. package/lib/public/modules/clay-control-activity.js +214 -0
  305. package/lib/public/modules/clay-control-copy.js +36 -0
  306. package/lib/public/modules/clay-control-detail-targets.js +44 -0
  307. package/lib/public/modules/clay-control-object-targets.js +52 -0
  308. package/lib/public/modules/clay-control-target-visibility.js +12 -0
  309. package/lib/public/modules/clay-control-targets.js +44 -0
  310. package/lib/public/modules/clay-log-links.js +23 -0
  311. package/lib/public/modules/clay-navigation-render.js +52 -0
  312. package/lib/public/modules/clay-owner-navigation.js +33 -0
  313. package/lib/public/modules/clay-session-links.js +31 -0
  314. package/lib/public/modules/clay-studio-bridge.js +20 -0
  315. package/lib/public/modules/clay-studio-document.js +67 -0
  316. package/lib/public/modules/clay-studio-render.js +146 -0
  317. package/lib/public/modules/clay-tool-activity.js +140 -0
  318. package/lib/public/modules/clay-tool-presentation.js +342 -0
  319. package/lib/public/modules/command-palette.js +162 -40
  320. package/lib/public/modules/contextual-ask-session.js +26 -0
  321. package/lib/public/modules/contextual-clay-geometry.js +155 -0
  322. package/lib/public/modules/contextual-clay-session.js +130 -0
  323. package/lib/public/modules/contextual-clay-workspace.js +169 -0
  324. package/lib/public/modules/contextual-clay.js +250 -0
  325. package/lib/public/modules/contextual-composer.js +91 -0
  326. package/lib/public/modules/contextual-mate-context.js +117 -0
  327. package/lib/public/modules/contextual-mate-hint.js +40 -0
  328. package/lib/public/modules/contextual-mate-identity.js +23 -0
  329. package/lib/public/modules/contextual-mate-sessions.js +134 -0
  330. package/lib/public/modules/contextual-search.js +137 -0
  331. package/lib/public/modules/contextual-session-citations.js +58 -0
  332. package/lib/public/modules/debate.js +1 -0
  333. package/lib/public/modules/default-ai.js +11 -3
  334. package/lib/public/modules/elicitation-form.js +5 -0
  335. package/lib/public/modules/filebrowser.js +20 -1
  336. package/lib/public/modules/generation-stop.js +8 -5
  337. package/lib/public/modules/git-panel.js +3 -1
  338. package/lib/public/modules/history-replay-batch.js +13 -1
  339. package/lib/public/modules/home-debate-live.js +2 -0
  340. package/lib/public/modules/home-debate-planning.js +7 -7
  341. package/lib/public/modules/home-mate-avatar-editor.js +127 -208
  342. package/lib/public/modules/home-mate-chat.js +8 -6
  343. package/lib/public/modules/home-mate-creation.js +73 -1
  344. package/lib/public/modules/home-mate-settings.js +19 -12
  345. package/lib/public/modules/icon-strip-tooltip.js +2 -1
  346. package/lib/public/modules/input.js +88 -10
  347. package/lib/public/modules/issues-render.js +3 -2
  348. package/lib/public/modules/knowledge-db-workbench.js +4 -4
  349. package/lib/public/modules/markdown.js +6 -34
  350. package/lib/public/modules/mate-avatar-catalog.js +97 -0
  351. package/lib/public/modules/mate-knowledge-workbench.js +1 -1
  352. package/lib/public/modules/mate-management.js +40 -7
  353. package/lib/public/modules/mcp-connection-view.js +31 -13
  354. package/lib/public/modules/mcp-discovery-view.js +31 -0
  355. package/lib/public/modules/mcp-ui.js +23 -4
  356. package/lib/public/modules/mention.js +3 -0
  357. package/lib/public/modules/message-delivery.js +20 -2
  358. package/lib/public/modules/model-picker.js +2 -0
  359. package/lib/public/modules/pane-activation.js +214 -0
  360. package/lib/public/modules/pane-binding.js +82 -0
  361. package/lib/public/modules/pane-bridge.js +7 -4
  362. package/lib/public/modules/pane-browser-bridge.js +22 -0
  363. package/lib/public/modules/pane-file-bridge.js +4 -0
  364. package/lib/public/modules/pane-issue-bridge.js +4 -1
  365. package/lib/public/modules/passkey-browser.js +69 -0
  366. package/lib/public/modules/passkey-server-settings.js +57 -0
  367. package/lib/public/modules/pending-message-queue.js +1 -0
  368. package/lib/public/modules/permission-control.js +5 -4
  369. package/lib/public/modules/personal-settings-dialog.js +7 -1
  370. package/lib/public/modules/product-review.js +26 -0
  371. package/lib/public/modules/profile.js +1 -238
  372. package/lib/public/modules/project-access-recovery.js +17 -0
  373. package/lib/public/modules/project-admin-overview.js +21 -0
  374. package/lib/public/modules/project-chat-identity.js +13 -4
  375. package/lib/public/modules/project-logs-render.js +6 -2
  376. package/lib/public/modules/project-mate-navigation.js +144 -22
  377. package/lib/public/modules/rewind.js +5 -0
  378. package/lib/public/modules/scheduled-tasks.js +2 -0
  379. package/lib/public/modules/scheduler.js +2 -0
  380. package/lib/public/modules/search-clay-chat.js +5 -440
  381. package/lib/public/modules/server-settings-controls.js +10 -0
  382. package/lib/public/modules/server-settings.js +7 -2
  383. package/lib/public/modules/session-actions.js +5 -2
  384. package/lib/public/modules/session-context-menu.js +5 -0
  385. package/lib/public/modules/session-create-form.js +10 -10
  386. package/lib/public/modules/session-folder-layout.js +1 -1
  387. package/lib/public/modules/session-folder-view-menu.js +9 -0
  388. package/lib/public/modules/session-github.js +85 -14
  389. package/lib/public/modules/session-rich-drafts.js +21 -0
  390. package/lib/public/modules/session-switch-defer.js +67 -0
  391. package/lib/public/modules/session-work-primary.js +51 -0
  392. package/lib/public/modules/settings-defaults.js +27 -28
  393. package/lib/public/modules/shared-browser-settings.js +112 -0
  394. package/lib/public/modules/shared-browser-tabs.js +13 -3
  395. package/lib/public/modules/shared-browser.js +29 -6
  396. package/lib/public/modules/sidebar-mobile.js +4 -3
  397. package/lib/public/modules/sidebar-projects.js +1 -0
  398. package/lib/public/modules/sidebar-session-folders-ui.js +1 -1
  399. package/lib/public/modules/sidebar-sessions.js +1 -0
  400. package/lib/public/modules/split-group-restore.js +68 -0
  401. package/lib/public/modules/split-pair-ui.js +1 -0
  402. package/lib/public/modules/split-pane-reconciler.js +15 -0
  403. package/lib/public/modules/split-pane-renderer.js +87 -6
  404. package/lib/public/modules/split-session-boundary.js +1 -1
  405. package/lib/public/modules/split-view.js +60 -68
  406. package/lib/public/modules/sticky-note-markdown.js +72 -6
  407. package/lib/public/modules/sticky-notes-actions.js +30 -0
  408. package/lib/public/modules/sticky-notes-browser.js +9 -2
  409. package/lib/public/modules/sticky-notes-card.js +23 -7
  410. package/lib/public/modules/sticky-notes-checklist.js +116 -0
  411. package/lib/public/modules/sticky-notes-editor.js +108 -44
  412. package/lib/public/modules/sticky-notes-shared.js +50 -2
  413. package/lib/public/modules/sticky-notes-state.js +66 -0
  414. package/lib/public/modules/sticky-notes.js +34 -51
  415. package/lib/public/modules/stt-controller.js +4 -1
  416. package/lib/public/modules/stt-recording.js +1 -1
  417. package/lib/public/modules/stt.js +7 -2
  418. package/lib/public/modules/terminal.js +9 -0
  419. package/lib/public/modules/theme.js +8 -1
  420. package/lib/public/modules/thinking-lifecycle.js +33 -3
  421. package/lib/public/modules/thinking-view.js +23 -1
  422. package/lib/public/modules/tools.js +60 -11
  423. package/lib/public/modules/tui-grab.js +1 -2
  424. package/lib/public/modules/user-settings-account.js +14 -1
  425. package/lib/public/modules/user-settings-appearance.js +10 -3
  426. package/lib/public/modules/user-settings-editors.js +1 -1
  427. package/lib/public/modules/user-settings-layout.js +11 -2
  428. package/lib/public/modules/user-settings-preferences.js +6 -2
  429. package/lib/public/modules/user-settings-profile.js +12 -2
  430. package/lib/public/modules/user-settings-sessions.js +120 -0
  431. package/lib/public/modules/user-settings.js +6 -2
  432. package/lib/public/modules/vendor-login-browser.js +5 -3
  433. package/lib/public/modules/vendor-login.js +2 -2
  434. package/lib/public/modules/vendor-priority.js +15 -1
  435. package/lib/public/modules/wireframe-workbench.js +5 -2
  436. package/lib/public/modules/you-activity.js +3 -1
  437. package/lib/public/modules/you.js +91 -6
  438. package/lib/public/muse-avatar.svg +4 -0
  439. package/lib/public/style.css +6 -0
  440. package/lib/public/sw.js +3 -1
  441. package/lib/safe-bash-commands.js +3 -45
  442. package/lib/scheduled-task-records.js +3 -1
  443. package/lib/scheduler.js +2 -0
  444. package/lib/sdk-bridge.js +342 -401
  445. package/lib/sdk-foreground-admission.js +16 -0
  446. package/lib/sdk-mcp-descriptors.js +2 -37
  447. package/lib/sdk-message-processor.js +52 -17
  448. package/lib/sdk-quota-snapshot.js +1 -1
  449. package/lib/sdk-response-recovery.js +1 -0
  450. package/lib/sdk-worker.js +2 -677
  451. package/lib/server-account-passkeys.js +186 -0
  452. package/lib/server-account-passwords.js +127 -0
  453. package/lib/server-account-security.js +53 -0
  454. package/lib/server-admin.js +63 -16
  455. package/lib/server-appearance-settings.js +13 -1
  456. package/lib/server-auth.js +107 -79
  457. package/lib/server-contextual-clay-settings.js +40 -0
  458. package/lib/server-contextual-mate-sessions.js +70 -0
  459. package/lib/server-dm.js +2 -1
  460. package/lib/server-global-ws.js +10 -20
  461. package/lib/server-home-chat-events.js +18 -4
  462. package/lib/server-home-chat.js +22 -20
  463. package/lib/server-home-clay-entry.js +23 -4
  464. package/lib/server-home-clay-session-links.js +29 -9
  465. package/lib/server-home-mate-creation.js +1 -0
  466. package/lib/server-home-mcp-consent.js +14 -0
  467. package/lib/server-mates.js +25 -62
  468. package/lib/server-owner-ui.js +118 -0
  469. package/lib/server-path-access.js +38 -0
  470. package/lib/server-project-removal.js +22 -0
  471. package/lib/server-settings.js +8 -2
  472. package/lib/server.js +165 -43
  473. package/lib/session-config-transition.js +45 -0
  474. package/lib/session-folders.js +7 -2
  475. package/lib/session-fork-history.js +21 -0
  476. package/lib/session-github.js +9 -2
  477. package/lib/session-hygiene.js +3 -35
  478. package/lib/session-permission-mode.js +4 -3
  479. package/lib/session-skill-scope.js +11 -0
  480. package/lib/session-visibility.js +5 -2
  481. package/lib/session-work-primary.js +50 -0
  482. package/lib/sessions.js +64 -99
  483. package/lib/shared-browser-cookie-sync.js +32 -0
  484. package/lib/shared-browser-cookies.js +79 -0
  485. package/lib/shared-browser-runtime.js +25 -9
  486. package/lib/shared-browser-storage-sync.js +43 -0
  487. package/lib/shared-browser-storage.js +101 -0
  488. package/lib/shared-browser-tools.js +2 -1
  489. package/lib/shared-browser-worker.js +46 -10
  490. package/lib/terminal-manager.js +65 -6
  491. package/lib/tool-llm.js +1 -1
  492. package/lib/tui-transcript-index.js +1 -132
  493. package/lib/user-knowledge-service.js +23 -1
  494. package/lib/users-auth.js +38 -3
  495. package/lib/users-contextual-clay-preferences.js +31 -0
  496. package/lib/users-create.js +97 -0
  497. package/lib/users-permissions.js +2 -8
  498. package/lib/users-server-pin.js +37 -0
  499. package/lib/users.js +18 -84
  500. package/lib/vendor-login-browser.js +1 -11
  501. package/lib/workspace-assignment-service.js +25 -0
  502. package/lib/workspace-query-access.js +4 -1
  503. package/lib/workspace-query-mcp-server.js +1 -1
  504. package/lib/workspace-query-service.js +13 -2
  505. package/lib/ws-request.js +1 -0
  506. package/lib/ws-schema.js +18 -2
  507. package/lib/yoke/acp-agent-profiles.js +7 -5
  508. package/lib/yoke/adapters/antigravity.js +3 -14
  509. package/lib/yoke/adapters/claude-query-contract.js +9 -0
  510. package/lib/yoke/adapters/claude.js +54 -50
  511. package/lib/yoke/adapters/codex-query-contract.js +24 -0
  512. package/lib/yoke/adapters/codex.js +53 -111
  513. package/lib/yoke/adapters/kiro.js +3 -1
  514. package/lib/yoke/adapters/muse-query-contract.js +7 -0
  515. package/lib/yoke/adapters/muse.js +122 -0
  516. package/lib/yoke/auth-events.js +17 -0
  517. package/lib/yoke/claude-hook-installer.js +271 -0
  518. package/lib/yoke/claude-jsonl-watcher.js +204 -0
  519. package/lib/yoke/claude-maintenance.js +55 -0
  520. package/lib/yoke/claude-permission-patterns.js +53 -0
  521. package/lib/yoke/claude-response-recovery.js +155 -0
  522. package/lib/yoke/claude-transcript-hygiene.js +34 -0
  523. package/lib/yoke/claude-worker-startup.js +28 -0
  524. package/lib/yoke/clay-skill-install.js +33 -0
  525. package/lib/yoke/cli-sessions.js +300 -0
  526. package/lib/yoke/codex-app-server.js +7 -12
  527. package/lib/yoke/codex-idle-recovery.js +81 -1
  528. package/lib/yoke/codex-recovery-admission.js +164 -0
  529. package/lib/yoke/configuration.js +13 -0
  530. package/lib/yoke/discovery.js +70 -0
  531. package/lib/yoke/errors.js +8 -0
  532. package/lib/yoke/host-environment.js +7 -0
  533. package/lib/yoke/index.js +9 -51
  534. package/lib/yoke/interface.js +116 -0
  535. package/lib/yoke/kiro-acp-server.js +5 -5
  536. package/lib/yoke/legacy-sessions.js +89 -0
  537. package/lib/yoke/login-protocol.js +25 -0
  538. package/lib/yoke/maintenance.js +12 -0
  539. package/lib/yoke/mcp-proxy.js +32 -0
  540. package/lib/yoke/mcp-source-adapters.js +91 -0
  541. package/lib/yoke/mcp-source-context.js +42 -0
  542. package/lib/yoke/mcp-source-discovery.js +169 -0
  543. package/lib/yoke/mcp-source-plugins.js +68 -0
  544. package/lib/yoke/mcp-source-restrictions.js +47 -0
  545. package/lib/yoke/mcp-tool-policy-normalize.js +28 -0
  546. package/lib/yoke/model-preferences.js +6 -0
  547. package/lib/yoke/muse-artifacts.js +36 -0
  548. package/lib/yoke/muse-controls.js +50 -0
  549. package/lib/yoke/muse-input.js +64 -0
  550. package/lib/yoke/muse-items.js +157 -0
  551. package/lib/yoke/muse-policy.js +52 -0
  552. package/lib/yoke/muse-query.js +428 -0
  553. package/lib/yoke/muse-runtime.js +211 -0
  554. package/lib/yoke/muse-services.js +79 -0
  555. package/lib/yoke/muse-skills.js +79 -0
  556. package/lib/yoke/muse-turns.js +71 -0
  557. package/lib/yoke/options/acp.js +2 -0
  558. package/lib/yoke/options/antigravity.js +2 -0
  559. package/lib/yoke/options/claude.js +21 -0
  560. package/lib/yoke/options/codex-defaults.js +29 -0
  561. package/lib/yoke/options/codex-settings.js +21 -0
  562. package/lib/yoke/options/codex.js +6 -0
  563. package/lib/yoke/options/kiro-defaults.js +22 -0
  564. package/lib/yoke/options/kiro.js +5 -0
  565. package/lib/yoke/options/muse.js +5 -0
  566. package/lib/yoke/provider-contract.js +5 -0
  567. package/lib/yoke/providers/antigravity-executable.js +8 -0
  568. package/lib/yoke/providers/claude-executable.js +40 -0
  569. package/lib/yoke/providers/claude-model-descriptions.js +14 -0
  570. package/lib/yoke/providers/claude-process.js +97 -0
  571. package/lib/yoke/providers/claude-provision.js +75 -0
  572. package/lib/yoke/providers/codex-errors.js +8 -0
  573. package/lib/yoke/providers/muse-executable.js +17 -0
  574. package/lib/yoke/provisioning.js +6 -0
  575. package/lib/yoke/query-options.js +10 -0
  576. package/lib/yoke/response-recovery.js +41 -0
  577. package/lib/yoke/sdk-mcp-descriptors.js +37 -0
  578. package/lib/yoke/sdk-server-factory.js +7 -0
  579. package/lib/yoke/session-history.js +8 -0
  580. package/lib/yoke/session-tool-transport.js +34 -13
  581. package/lib/yoke/settings.js +23 -0
  582. package/lib/yoke/source-locations.js +4 -0
  583. package/lib/yoke/title-query.js +18 -7
  584. package/lib/yoke/tui-transcript-index.js +132 -0
  585. package/lib/yoke/usage.js +48 -0
  586. package/lib/yoke/user-input.js +13 -0
  587. package/lib/yoke/vendor-registry.js +81 -1
  588. package/package.json +11 -4
@@ -0,0 +1,342 @@
1
+ // Exact Clay catalogs: project-user-knowledge, session-notes/project-logs/issues-mcp-server,
2
+ // session-pair-mcp-server, mate-scheduling and the query-bound SDK bridge catalogs.
3
+ var definitions = Object.create(null);
4
+ var aliases = Object.create(null);
5
+
6
+ function register(server, name, running, completed, noun, subject, rule) {
7
+ definitions[name] = { name: name, running: running, completed: completed, noun: noun, subject: subject, rule: rule };
8
+ [name, server + '__' + name, 'mcp__' + server + '__' + name,
9
+ 'mcp__clay-session-tools__' + server + '__' + name].forEach(function (alias) { aliases[alias] = name; });
10
+ }
11
+ function rows(server, entries) {
12
+ entries.forEach(function (entry) { register.apply(null, [server].concat(entry)); });
13
+ }
14
+ rows('clay-you', [
15
+ ['search_user_knowledge', 'Checking your preferences', 'Preferences checked', 'Preference search', 'query'],
16
+ ['read_user_knowledge', 'Reading your preference', 'Preference read', 'Preference'],
17
+ ['report_user_observation', 'Submitting preference for review', 'Preference submitted for review', 'Preference submission', null, 'observation'],
18
+ ['list_user_observations', 'Checking preferences awaiting review', 'Pending preferences checked', 'Preference review'],
19
+ ['curate_user_knowledge', 'Reviewing preference', 'Preference review returned', 'Preference review', 'title', 'curation']
20
+ ]);
21
+ rows('clay-notes', [
22
+ ['list_notes', 'Checking sticky notes', 'Sticky notes checked', 'Sticky notes'],
23
+ ['write_note', 'Adding sticky note', 'Sticky note added', 'Sticky note', 'note', 'note'],
24
+ ['close_note', 'Closing sticky note', 'Sticky note closed', 'Sticky note'],
25
+ ['remove_note', 'Closing sticky note', 'Sticky note closed', 'Sticky note'],
26
+ ['reopen_note', 'Reopening sticky note', 'Sticky note reopened', 'Sticky note']
27
+ ]);
28
+ rows('clay-logs', [
29
+ ['list_logs', 'Checking project logs', 'Project logs checked', 'Project logs'],
30
+ ['search_logs', 'Searching project logs', 'Project logs searched', 'Log search', 'query'],
31
+ ['read_log', 'Reading project log', 'Project log read', 'Project log'],
32
+ ['log_history', 'Reading log history', 'Log history read', 'Log history'],
33
+ ['read_log_revision', 'Reading log revision', 'Log revision read', 'Log revision'],
34
+ ['create_log', 'Adding project log', 'Project log added', 'Project log', 'title'],
35
+ ['update_log', 'Updating project log', 'Project log updated', 'Project log', 'title'],
36
+ ['link_log', 'Linking project log', 'Project log linked', 'Project log'],
37
+ ['revert_log', 'Restoring log revision', 'Log revision restored', 'Log revision'],
38
+ ['list_log_feedback', 'Checking log comments', 'Log comments checked', 'Log comments'],
39
+ ['review_log_comment', 'Reviewing log comment', 'Log comment reviewed', 'Log comment'],
40
+ ['list_project_logs', 'Checking project logs', 'Project logs checked', 'Project logs'],
41
+ ['search_project_logs', 'Searching project logs', 'Project logs searched', 'Log search', 'query'],
42
+ ['read_project_log', 'Reading project log', 'Project log read', 'Project log'],
43
+ ['read_project_log_revision', 'Reading log revision', 'Log revision read', 'Log revision'],
44
+ ['project_log_history', 'Reading log history', 'Log history read', 'Log history']
45
+ ]);
46
+ rows('clay-issues', [
47
+ ['list_issues', 'Checking project issues', 'Project issues checked', 'Project issues'],
48
+ ['search_issues', 'Searching project issues', 'Project issues searched', 'Issue search', 'query'],
49
+ ['read_issue', 'Reading project issue', 'Project issue read', 'Project issue'],
50
+ ['create_issue', 'Adding project issue', 'Project issue added', 'Project issue', 'title'],
51
+ ['update_issue', 'Updating project issue', 'Project issue updated', 'Project issue', 'title'],
52
+ ['issue_history', 'Reading issue history', 'Issue history read', 'Issue history'],
53
+ ['read_issue_revision', 'Reading issue revision', 'Issue revision read', 'Issue revision'],
54
+ ['list_issue_feedback', 'Checking issue comments', 'Issue comments checked', 'Issue comments'],
55
+ ['review_issue_comment', 'Reviewing issue comment', 'Issue comment reviewed', 'Issue comment']
56
+ ]);
57
+ rows('clay-sessions', [
58
+ ['send_to_partner', 'Sending task to Worker', 'Worker task request returned', 'Worker task', 'worker', 'worker'],
59
+ ['message_partner', 'Sending message to Worker', 'Worker message request returned', 'Worker message', 'worker', 'message'],
60
+ ['read_partner', 'Checking Worker conversation', 'Worker conversation checked', 'Worker conversation', 'worker'],
61
+ ['partner_status', 'Checking Worker status', 'Worker status checked', 'Worker status', 'worker'],
62
+ ['interrupt_partner', 'Requesting Worker stop', 'Worker stop requested', 'Worker stop', 'worker'],
63
+ ['close_partner', 'Closing Worker pane', 'Worker pane closed', 'Worker pane', 'worker'],
64
+ ['propose_worker', 'Proposing Worker', 'Worker proposal returned', 'Worker proposal', null, 'proposal'],
65
+ ['replace_partner', 'Proposing Worker replacement', 'Worker replacement proposal returned', 'Worker replacement', 'worker', 'proposal'],
66
+ ['inspect_worker_proposal', 'Checking Worker proposal', 'Worker proposal checked', 'Worker proposal'],
67
+ ['cancel_worker_proposal', 'Cancelling Worker proposal', 'Worker proposal cancelled', 'Worker proposal'],
68
+ ['worker_runtime_catalog', 'Checking Worker runtimes', 'Worker runtimes checked', 'Worker runtimes'],
69
+ ['queue_partner_followup', 'Queuing Worker follow-up', 'Worker follow-up request returned', 'Worker follow-up', 'worker', 'message'],
70
+ ['inspect_partner_followups', 'Checking Worker follow-ups', 'Worker follow-ups checked', 'Worker follow-ups', 'worker'],
71
+ ['cancel_partner_followup', 'Cancelling Worker follow-up', 'Worker follow-up cancellation returned', 'Worker follow-up', 'worker'],
72
+ ['replace_partner_task', 'Replacing Worker task', 'Worker task replacement returned', 'Worker task', 'worker'],
73
+ ['resume_partner_task', 'Resuming Worker task', 'Worker task resume returned', 'Worker task', 'worker'],
74
+ ['report_partner_outcome', 'Reporting Worker result', 'Worker result reported', 'Worker result'],
75
+ ['record_partner_evaluation', 'Recording Worker assessment', 'Worker assessment recorded', 'Worker assessment', 'worker'],
76
+ ['respond_to_worker_permission', 'Responding to Worker permission', 'Worker permission response returned', 'Worker permission', 'worker'],
77
+ ['respond_to_worker_question', 'Responding to Worker question', 'Worker question response returned', 'Worker question', 'worker']
78
+ ]);
79
+ rows('clay-shared-browser', [['shared_browser', 'Using browser', 'Browser action returned', 'Browser action', 'site', 'browser']]);
80
+ ['github', 'linear'].forEach(function (provider) {
81
+ var title = provider === 'github' ? 'GitHub work' : 'Linear issue';
82
+ rows('clay-' + provider, [
83
+ ['get_session_' + provider, 'Checking linked ' + title, 'Linked ' + title + ' checked', title],
84
+ ['link_session_' + provider, 'Linking ' + title, title + ' linked', title],
85
+ ['unlink_session_' + provider, 'Unlinking ' + title, title + ' unlinked', title]
86
+ ]);
87
+ });
88
+ rows('clay-linear', [['search_linear_issues', 'Searching Linear issues', 'Linear issues searched', 'Linear search', 'query'], ['read_linear_issue', 'Reading Linear issue', 'Linear issue read', 'Linear issue']]);
89
+ ['mate', 'scheduled_task'].forEach(function (kind) {
90
+ var mate = kind === 'mate';
91
+ var server = mate ? 'clay-mate-schedules' : 'clay-scheduled-tasks';
92
+ var suffix = mate ? 'mate_schedule' : 'scheduled_task';
93
+ rows(server, [
94
+ ['begin_' + suffix + '_interview', 'Preparing schedule review', 'Schedule interview started', 'Schedule review'],
95
+ ['propose_' + suffix, 'Proposing schedule for approval', 'Schedule proposal returned', 'Schedule proposal', mate ? null : 'name', 'schedule'],
96
+ ['list_' + suffix + 's', 'Checking schedules', 'Schedules checked', 'Schedules'],
97
+ ['read_' + suffix, 'Reading schedule', 'Schedule read', 'Schedule'],
98
+ ['update_' + suffix, 'Proposing schedule changes', 'Schedule change proposal returned', 'Schedule changes', mate ? null : 'name', 'schedule']
99
+ ]);
100
+ });
101
+ rows('clay-mate-schedules', [['cancel_mate_schedule', 'Requesting schedule cancellation', 'Schedule cancellation returned', 'Schedule cancellation', null, 'schedule']]);
102
+ rows('clay-scheduled-tasks', [['report_scheduled_task_outcome', 'Reporting scheduled task result', 'Scheduled task result reported', 'Scheduled task result']]);
103
+ rows('clay-knowledge', [
104
+ ['list_knowledge', 'Checking Mate Knowledge', 'Mate Knowledge checked', 'Mate Knowledge'],
105
+ ['search_knowledge', 'Searching Mate Knowledge', 'Mate Knowledge searched', 'Knowledge search', 'query'],
106
+ ['read_knowledge', 'Reading Mate Knowledge', 'Mate Knowledge read', 'Mate Knowledge'],
107
+ ['list_mate_knowledge', 'Checking Mate Knowledge', 'Mate Knowledge checked', 'Mate Knowledge'],
108
+ ['search_mate_knowledge', 'Searching Mate Knowledge', 'Mate Knowledge searched', 'Knowledge search', 'query'],
109
+ ['read_mate_knowledge', 'Reading Mate Knowledge', 'Mate Knowledge read', 'Mate Knowledge'],
110
+ ['read_knowledge_document', 'Reading knowledge document', 'Knowledge document read', 'Knowledge document', 'name'],
111
+ ['create_knowledge_document', 'Adding knowledge document', 'Knowledge document added', 'Knowledge document', 'name'],
112
+ ['update_knowledge_document', 'Updating knowledge document', 'Knowledge document updated', 'Knowledge document', 'name'],
113
+ ['list_knowledge_document_history', 'Reading knowledge history', 'Knowledge history read', 'Knowledge history', 'name'],
114
+ ['restore_knowledge_document', 'Restoring knowledge document', 'Knowledge document restored', 'Knowledge document', 'name']
115
+ ]);
116
+ rows('clay-knowledge', [
117
+ ['list_databases', 'Checking knowledge databases', 'Knowledge databases checked', 'Knowledge databases'],
118
+ ['create_database', 'Adding knowledge database', 'Knowledge database added', 'Knowledge database', 'name'],
119
+ ['read_database', 'Reading knowledge database', 'Knowledge database read', 'Knowledge database'],
120
+ ['update_database_schema', 'Updating database fields', 'Database fields updated', 'Database fields'],
121
+ ['archive_database', 'Archiving knowledge database', 'Knowledge database archived', 'Knowledge database'],
122
+ ['recover_database', 'Recovering knowledge database', 'Knowledge database recovered', 'Knowledge database'],
123
+ ['save_table_view', 'Saving database view', 'Database view saved', 'Database view'],
124
+ ['query_database', 'Searching database records', 'Database records searched', 'Database records'],
125
+ ['create_database_record', 'Adding database record', 'Database record added', 'Database record'],
126
+ ['read_database_record', 'Reading database record', 'Database record read', 'Database record'],
127
+ ['update_database_record', 'Updating database record', 'Database record updated', 'Database record'],
128
+ ['archive_database_record', 'Archiving database record', 'Database record archived', 'Database record'],
129
+ ['recover_database_record', 'Recovering database record', 'Database record recovered', 'Database record'],
130
+ ['retry_database_sync', 'Retrying knowledge sync', 'Knowledge sync retry returned', 'Knowledge sync'],
131
+ ['import_database_records', 'Importing database records', 'Database record import returned', 'Database import'],
132
+ ['read_database_import_progress', 'Checking database import', 'Database import checked', 'Database import']
133
+ ]);
134
+ rows('clay-tools', [
135
+ ['clay_tool_list', 'Checking Capsules', 'Capsules checked', 'Capsules'],
136
+ ['clay_tool_snapshot', 'Reading Capsule state', 'Capsule state read', 'Capsule'],
137
+ ['clay_tool_act', 'Requesting Capsule action', 'Capsule action returned', 'Capsule action'],
138
+ ['clay_tool_set', 'Updating Capsule state', 'Capsule state update returned', 'Capsule'],
139
+ ['clay_tool_source', 'Reading Capsule source', 'Capsule source read', 'Capsule'],
140
+ ['clay_tool_install', 'Installing Capsule', 'Capsule installation returned', 'Capsule', 'name'],
141
+ ['clay_tool_update', 'Updating Capsule', 'Capsule update returned', 'Capsule', 'name'],
142
+ ['clay_tool_uninstall', 'Removing Capsule', 'Capsule removal returned', 'Capsule']
143
+ ]);
144
+ rows('clay-email', [
145
+ ['clay_send_email', 'Sending email', 'Email request returned', 'Email', null, 'email'],
146
+ ['clay_reply_email', 'Replying to email', 'Email reply returned', 'Email reply', null, 'email'],
147
+ ['clay_read_email', 'Checking email', 'Email checked', 'Email'],
148
+ ['clay_read_email_body', 'Reading email', 'Email read', 'Email'],
149
+ ['clay_search_email', 'Searching email', 'Email searched', 'Email search'],
150
+ ['clay_list_labels', 'Checking email labels', 'Email labels checked', 'Email labels'],
151
+ ['clay_mark_read', 'Updating email read status', 'Email read status updated', 'Email'],
152
+ ['clay_move_email', 'Moving email', 'Email move returned', 'Email']
153
+ ]);
154
+ rows('clay-history', [['search_clay_history', 'Searching conversations', 'Conversations searched', 'Conversation search', 'query'], ['read_session', 'Reading conversation', 'Conversation read', 'Conversation'], ['list_recent_decisions', 'Checking recent decisions', 'Recent decisions checked', 'Recent decisions']]);
155
+ rows('clay-workspace', [
156
+ ['read_current_context', 'Checking shared context', 'Shared context checked', 'Shared context'],
157
+ ['read_selected_context', 'Reading selected conversation', 'Selected conversation read', 'Selected conversation'],
158
+ ['open_context_conversation', 'Requesting conversation navigation', 'Navigation request returned', 'Conversation navigation', 'why'],
159
+ ['read_context_navigation_receipt', 'Checking navigation receipt', 'Navigation receipt checked', 'Navigation receipt'],
160
+ ['read_owner_screen', 'Checking your screen context', 'Screen context request returned', 'Screen context'],
161
+ ['inspect_owner_screen_change', 'Inspecting screen change', 'Screen change inspected', 'Screen control'],
162
+ ['control_owner_screen', 'Requesting screen change', 'Screen change request returned', 'Screen control', 'why'],
163
+ ['list_project_session_pull_requests', 'Checking conversation pull requests', 'Conversation pull requests checked', 'Conversation pull requests', 'projectSlug'],
164
+ ['begin_schedule_control_interview', 'Preparing schedule interview', 'Schedule interview prepared', 'Scheduling'],
165
+ ['read_schedule_controls', 'Reading schedules', 'Schedules read', 'Scheduling'],
166
+ ['inspect_schedule_change', 'Inspecting schedule change', 'Schedule change inspected', 'Scheduling'],
167
+ ['read_project_workspace', 'Reading selected project workspace', 'Selected project workspace read', 'Project workspace'],
168
+ ['read_workspace_receipt', 'Checking workspace request receipt', 'Workspace receipt checked', 'Workspace receipt'],
169
+ ['inspect_workspace_change', 'Inspecting project workspace change', 'Project workspace change inspected', 'Project workspace'],
170
+ ['control_project_workspace', 'Requesting project workspace change', 'Workspace change request returned', 'Project workspace', 'why', 'workspace-control'],
171
+ ['read_mate_chat_control', 'Checking Mate conversation', 'Mate conversation checked', 'Mate conversation'],
172
+ ['inspect_mate_chat_change', 'Inspecting Mate conversation change', 'Mate conversation change inspected', 'Mate conversation'],
173
+ ['control_mate_chat', 'Requesting Mate conversation change', 'Mate conversation request returned', 'Mate conversation', 'why', 'mate-chat'],
174
+ ['control_schedules', 'Requesting schedule change', 'Schedule change request returned', 'Scheduling', 'why', 'schedule-control'],
175
+ ['read_project_records', 'Reading project records', 'Project records read', 'Project records', 'projectSlug'],
176
+ ['inspect_project_record_change', 'Inspecting record change', 'Record change inspected', 'Project records', 'projectSlug'],
177
+ ['control_project_records', 'Requesting record change', 'Record change request returned', 'Project records', 'why'],
178
+ ['read_mate_knowledge_control', 'Reading Mate Knowledge', 'Mate Knowledge read', 'Mate Knowledge', 'mateId'],
179
+ ['inspect_mate_knowledge_change', 'Inspecting Knowledge change', 'Knowledge change inspected', 'Mate Knowledge', 'mateId'],
180
+ ['control_mate_knowledge', 'Requesting Knowledge change', 'Knowledge change request returned', 'Mate Knowledge', 'why'],
181
+ ['list_owned_mates', 'Checking your Mates', 'Your Mates checked', 'Mates'],
182
+ ['inspect_mate_control', 'Inspecting Mate controls', 'Mate controls inspected', 'Mate controls', 'mateId'],
183
+ ['control_mate_lifecycle', 'Requesting Mate change', 'Mate change request returned', 'Mate change', 'why'],
184
+ ['discover_product_controls', 'Checking product controls', 'Product controls checked', 'Product controls'],
185
+ ['inspect_project_control', 'Inspecting project change', 'Project change inspected', 'Project inspection', 'projectSlug'],
186
+ ['control_project_lifecycle', 'Requesting project change', 'Project change request returned', 'Project change', 'why', 'project-lifecycle'],
187
+ ['inspect_session_control', 'Inspecting conversation controls', 'Conversation controls inspected', 'Conversation controls'],
188
+ ['control_project_session', 'Requesting conversation change', 'Conversation change request returned', 'Conversation change', 'why', 'product-control'],
189
+ ['list_projects', 'Checking projects', 'Projects checked', 'Projects'],
190
+ ['list_project_sessions', 'Checking project conversations', 'Project conversations checked', 'Project conversations'],
191
+ ['search_project_history', 'Searching project conversations', 'Project conversations searched', 'Conversation search', 'query'],
192
+ ['read_project_session', 'Reading project conversation', 'Project conversation read', 'Project conversation'],
193
+ ['search_workspace_history', 'Searching conversations', 'Conversations searched', 'Conversation search', 'query'],
194
+ ['list_workspace_activity', 'Checking workspace activity', 'Workspace activity checked', 'Workspace activity'],
195
+ ['propose_project_assignment', 'Proposing project assignment', 'Project assignment proposal returned', 'Project assignment', 'title', 'proposal'],
196
+ ['propose_project_follow_up', 'Proposing project follow-up', 'Project follow-up proposal returned', 'Project follow-up', 'title', 'proposal'],
197
+ ['get_assignment_status', 'Checking assignment status', 'Assignment status checked', 'Assignment status']
198
+ ]);
199
+ rows('clay-debate', [['propose_debate', 'Proposing debate', 'Debate proposal returned', 'Debate proposal', 'topic', 'proposal']]);
200
+ rows('clay-mate-creation', [['propose_mate', 'Proposing Mate', 'Mate proposal returned', 'Mate proposal', 'name', 'proposal']]);
201
+ rows('clay-documents', [['present_markdown_edit', 'Opening document', 'Document opened', 'Document'], ['present_wireframe', 'Showing wireframe', 'Wireframe shown', 'Wireframe', 'title']]);
202
+ rows('clay-handoff', [['read_handoff_source', 'Reading handoff context', 'Handoff context read', 'Handoff context'], ['list_other_driver_sessions', 'Checking other Driver sessions', 'Driver sessions checked', 'Driver sessions'], ['search_other_driver_sessions', 'Searching Driver sessions', 'Driver sessions searched', 'Driver search', 'query'], ['read_other_driver_session', 'Reading Driver conversation', 'Driver conversation read', 'Driver conversation']]);
203
+
204
+ export function clayToolDefinition(name) {
205
+ return typeof name === 'string' && aliases[name] ? definitions[aliases[name]] : null;
206
+ }
207
+
208
+ function safeSubject(value) {
209
+ if (typeof value !== 'string') return '';
210
+ value = value.slice(0, 200).replace(/[\u0000-\u001f\u007f]/g, ' ').replace(/\s+/g, ' ').trim();
211
+ // Subjects come only from declared display fields, never bodies, evidence or tool output.
212
+ if (/secret|password|token|api[ _-]?key|bearer|https?:\/\/|@|[A-Za-z0-9_/-]{32,}/i.test(value)) return '';
213
+ return value.length > 72 ? value.slice(0, 71).trimEnd() + '…' : value;
214
+ }
215
+ function subjectFor(def, input) {
216
+ input = input || {};
217
+ if (def.subject === 'note') return safeSubject(typeof input.text === 'string' ? input.text.split('\n', 1)[0] : '');
218
+ if (def.subject === 'worker') return Number.isSafeInteger(input.workerId) ? 'Worker ' + input.workerId : '';
219
+ if (def.subject === 'site') {
220
+ try { return safeSubject(new URL(input.url).hostname); } catch (error) { return ''; }
221
+ }
222
+ return safeSubject(input[def.subject]);
223
+ }
224
+
225
+ // Called once per terminal result, never per streaming delta. Large results stay opaque.
226
+ export function clayToolOutcome(content, isError, level) {
227
+ level = level || 0;
228
+ if (level >= 3) return { phase: 'returned' };
229
+ if (isError) return { phase: 'error' };
230
+ var value = content;
231
+ if (typeof value === 'string') {
232
+ if (/^\s*(?:Error:|Error\b|Rejected\b|Cancelled\b|Canceled\b)/i.test(value)) return { phase: /^\s*Cancel/i.test(value) ? 'cancelled' : 'error' };
233
+ if (value.length > 65536) return { phase: 'returned' };
234
+ try { value = JSON.parse(value); } catch (error) { return { phase: 'returned' }; }
235
+ }
236
+ for (var depth = 0; depth < 3 && value && typeof value === 'object'; depth++) {
237
+ if (value.isError || value.is_error || value.error || value.rejected === true || (Array.isArray(value.errors) && value.errors.length > 0)) return { phase: 'error' };
238
+ var status = typeof value.status === 'string' ? value.status.toLowerCase() : '';
239
+ if (['error', 'failed', 'rejected', 'declined', 'denied', 'blocked', 'expired', 'unavailable'].indexOf(status) !== -1) return { phase: 'error', status: status };
240
+ if (value.cancelled === true || value.canceled === true || ['cancelled', 'canceled', 'interrupted', 'stopped', 'killed', 'abandoned'].indexOf(status) !== -1) return { phase: 'cancelled', status: status, value: value };
241
+ if (value.ok === false || value.success === false) return { phase: 'error' };
242
+ if (Array.isArray(value.content)) {
243
+ var text = value.content.filter(function (block) { return block && block.type === 'text'; });
244
+ if (text.length !== 1) return { phase: 'returned' };
245
+ return clayToolOutcome(text[0].text, false, level + 1);
246
+ }
247
+ if (value.result && typeof value.result === 'object') { value = value.result; continue; }
248
+ return { phase: 'done', status: status, value: value };
249
+ }
250
+ return { phase: 'returned' };
251
+ }
252
+
253
+ export function clayToolPresentation(name, input, outcome) {
254
+ var def = clayToolDefinition(name);
255
+ if (!def) return null;
256
+ input = input || {};
257
+ var phase = outcome ? outcome.phase : 'running';
258
+ var label = outcome ? def.completed : def.running;
259
+ if (name && def.name === 'update_scheduled_task') label = outcome ? 'Scheduled task update returned' : 'Updating scheduled task';
260
+ var noun = def.noun;
261
+ if (def.rule === 'browser') {
262
+ var browserActions = {
263
+ open: ['Opening browser page', 'Browser page opened'], navigate: ['Opening browser page', 'Browser page opened'],
264
+ inspect: ['Checking browser page', 'Browser page checked'], status: ['Checking browser tabs', 'Browser tabs checked'],
265
+ click: ['Clicking browser control', 'Browser control clicked'], text: ['Entering browser text', 'Browser text entered'],
266
+ select: ['Selecting browser option', 'Browser option selected'], key: ['Pressing browser key', 'Browser key pressed'],
267
+ wheel: ['Scrolling browser page', 'Browser page scrolled'], resize: ['Resizing browser viewport', 'Browser viewport resized'],
268
+ reload: ['Refreshing browser page', 'Browser page refreshed'], back: ['Going to previous browser page', 'Previous browser page opened'],
269
+ forward: ['Going to next browser page', 'Next browser page opened'], finish: ['Finishing browser activity', 'Browser activity finished']
270
+ };
271
+ var browserAction = browserActions[input.action];
272
+ if (browserAction) label = browserAction[outcome ? 1 : 0];
273
+ }
274
+ if (def.rule === 'note' && input.id) label = outcome ? 'Sticky note updated' : 'Updating sticky note';
275
+ if (phase === 'error') label = noun + (outcome.status === 'rejected' || outcome.status === 'declined' || outcome.status === 'denied' ? ' rejected' : ' failed');
276
+ else if (phase === 'cancelled') label = noun + ' cancelled';
277
+ else if (phase === 'returned') label = noun + (outcome.status === 'result_unavailable' ? ' result unavailable' : ' request returned');
278
+ else if (outcome) {
279
+ var status = outcome.status;
280
+ if (def.rule === 'workspace-control') {
281
+ if (status === 'completed') label = outcome.value.runtimeEffect === 'closed' ? 'Terminal exit confirmed' : 'Project workspace change completed';
282
+ } else if (def.rule === 'mate-chat') {
283
+ if (status === 'queued') { phase = 'pending'; label = outcome.value.action === 'stop' ? 'Mate Stop requested · runtime pending' : 'Mate message queued'; }
284
+ else if (status === 'started') { phase = 'pending'; label = 'Mate message admitted · completion pending'; }
285
+ else if (status === 'completed') label = 'Mate conversation change completed';
286
+ } else if (def.rule === 'schedule-control') {
287
+ if (status === 'proposed') { phase = 'pending'; label = 'Task draft awaiting Create task'; }
288
+ else if (status === 'queued') { phase = 'pending'; label = 'Scheduled run queued'; }
289
+ else if (status === 'completed') label = 'Schedule change saved';
290
+ else { phase = 'returned'; label = 'Schedule change request returned'; }
291
+ } else if (def.rule === 'project-lifecycle') {
292
+ if (status === 'completed') label = 'Project change completed';
293
+ else { phase = 'returned'; label = 'Project change request returned'; }
294
+ } else if (def.rule === 'product-control') {
295
+ if (status === 'queued') { phase = 'pending'; label = input.action === 'stop' ? 'Stop requested · runtime pending' : input.action === 'queue_add' ? 'Message queued for project Driver' : 'Conversation change queued'; }
296
+ else if (status === 'completed') label = input.action === 'queue_add' ? 'Message delivered to project Driver' : input.action === 'queue_edit' ? 'Queued message updated' : input.action === 'queue_cancel' ? 'Queued message cancelled' : input.action === 'queue_reorder' ? 'Message queue reordered' : input.action === 'vendor' ? 'Driver provider selected' : 'Conversation change completed';
297
+ else { phase = 'returned'; label = 'Conversation change request returned'; }
298
+ } else if (def.rule === 'observation') {
299
+ if (status !== 'pending') { label = 'Preference submission returned'; phase = 'returned'; }
300
+ } else if (def.rule === 'email') {
301
+ if (status === 'sent') label = 'Email sent';
302
+ else phase = 'returned';
303
+ } else if (def.rule === 'worker' || def.rule === 'message') {
304
+ if (status === 'queued') label = def.rule === 'worker' ? 'Task queued for Worker' : 'Message queued for Worker';
305
+ else if (status === 'running') label = 'Task sent to Worker';
306
+ else if (status === 'complete' || status === 'completed') label = 'Worker task completed';
307
+ else phase = 'returned';
308
+ } else if (def.rule === 'proposal' || def.rule === 'schedule') {
309
+ phase = 'returned'; label = noun + ' returned';
310
+ if (['pending', 'proposed', 'awaiting_approval', 'approval_required'].indexOf(status) !== -1) { phase = 'pending'; label = noun + ' awaiting approval'; }
311
+ if (status === 'created' && def.rule === 'schedule') { phase = 'done'; label = 'Schedule created'; }
312
+ else if (status === 'updated' && def.rule === 'schedule') { phase = 'done'; label = 'Schedule updated'; }
313
+ else if (status === 'unchanged') { phase = 'returned'; label = 'Schedule unchanged'; }
314
+ else if (status && ['pending', 'proposed', 'awaiting_approval', 'approval_required'].indexOf(status) === -1) { phase = 'returned'; label = noun + ' returned'; }
315
+ } else if (status && ['pending', 'queued', 'submitted', 'capture_pending'].indexOf(status) !== -1) { phase = 'pending'; label = noun + ' pending'; }
316
+ if (outcome.value && (outcome.value.indexSyncPending || outcome.value.projectionPending)) label += ' · sync pending';
317
+ }
318
+ if (def.name === 'cancel_mate_schedule' && phase === 'cancelled' && outcome.value && outcome.value.schedule) { phase = 'done'; label = 'Schedule cancelled'; }
319
+ if (def.name === 'update_scheduled_task' && outcome && outcome.phase === 'done' && outcome.value && outcome.value.ok === true) { phase = 'done'; label = 'Scheduled task updated'; }
320
+ return { label: label, subject: subjectFor(def, input), phase: phase, name: def.name };
321
+ }
322
+
323
+ export function clayToolGroupSummary(group, tools) {
324
+ if (!group.toolNames.some(function (name) { return !!clayToolDefinition(name); })) { group.clayActivityPhase = null; return null; }
325
+ var items = (group.toolIds || []).map(function (id) { return group.toolRecords ? group.toolRecords[id] : tools[id]; }).filter(function (tool) { return tool && tool.groupId === group.id && !tool.hidden; });
326
+ if (!items.some(function (tool) { return !!tool.clayActivity; })) return null;
327
+ if (items.length === 1 && items[0].clayActivity) {
328
+ var one = items[0].clayActivity;
329
+ group.clayActivityPhase = one.phase;
330
+ return one.label + (one.subject ? ' · ' + one.subject : '');
331
+ }
332
+ var failed = 0, pending = 0, running = 0, returned = 0;
333
+ items.forEach(function (tool) {
334
+ var phase = tool.clayActivity ? tool.clayActivity.phase : (tool.done ? (tool.el && tool.el.classList.contains('error') ? 'error' : 'done') : 'running');
335
+ if (phase === 'error' || phase === 'cancelled') failed++;
336
+ if (phase === 'pending') pending++;
337
+ if (phase === 'running') running++;
338
+ if (phase === 'returned') returned++;
339
+ });
340
+ group.clayActivityPhase = failed ? 'error' : pending ? 'pending' : running ? 'running' : returned ? 'returned' : 'done';
341
+ return items.length + ' activities' + (running ? ' · ' + running + ' running' : '') + (failed ? ' · ' + failed + ' failed or cancelled' : '') + (pending ? ' · ' + pending + ' awaiting review' : '');
342
+ }