@agent-native/core 0.109.2 → 0.109.4

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 (334) hide show
  1. package/corpus/README.md +2 -2
  2. package/corpus/core/CHANGELOG.md +16 -0
  3. package/corpus/core/docs/content/agent-native-toolkit.mdx +46 -13
  4. package/corpus/core/docs/content/locales/ar-SA/agent-native-toolkit.mdx +79 -55
  5. package/corpus/core/docs/content/locales/ar-SA/toolkit-capability-packages.mdx +21 -0
  6. package/corpus/core/docs/content/locales/ar-SA/toolkit-context-knowledge.mdx +12 -0
  7. package/corpus/core/docs/content/locales/ar-SA/toolkit-editors-canvases.mdx +17 -0
  8. package/corpus/core/docs/content/locales/de-DE/agent-native-toolkit.mdx +82 -54
  9. package/corpus/core/docs/content/locales/de-DE/toolkit-capability-packages.mdx +21 -0
  10. package/corpus/core/docs/content/locales/de-DE/toolkit-context-knowledge.mdx +12 -0
  11. package/corpus/core/docs/content/locales/de-DE/toolkit-editors-canvases.mdx +17 -0
  12. package/corpus/core/docs/content/locales/es-ES/agent-native-toolkit.mdx +81 -52
  13. package/corpus/core/docs/content/locales/es-ES/toolkit-capability-packages.mdx +21 -0
  14. package/corpus/core/docs/content/locales/es-ES/toolkit-context-knowledge.mdx +12 -0
  15. package/corpus/core/docs/content/locales/es-ES/toolkit-editors-canvases.mdx +21 -0
  16. package/corpus/core/docs/content/locales/fr-FR/agent-native-toolkit.mdx +84 -54
  17. package/corpus/core/docs/content/locales/fr-FR/toolkit-capability-packages.mdx +21 -0
  18. package/corpus/core/docs/content/locales/fr-FR/toolkit-context-knowledge.mdx +12 -0
  19. package/corpus/core/docs/content/locales/fr-FR/toolkit-editors-canvases.mdx +21 -0
  20. package/corpus/core/docs/content/locales/hi-IN/agent-native-toolkit.mdx +69 -62
  21. package/corpus/core/docs/content/locales/hi-IN/toolkit-capability-packages.mdx +21 -0
  22. package/corpus/core/docs/content/locales/hi-IN/toolkit-context-knowledge.mdx +12 -0
  23. package/corpus/core/docs/content/locales/hi-IN/toolkit-editors-canvases.mdx +17 -0
  24. package/corpus/core/docs/content/locales/ja-JP/agent-native-toolkit.mdx +69 -62
  25. package/corpus/core/docs/content/locales/ja-JP/toolkit-capability-packages.mdx +21 -0
  26. package/corpus/core/docs/content/locales/ja-JP/toolkit-context-knowledge.mdx +12 -0
  27. package/corpus/core/docs/content/locales/ja-JP/toolkit-editors-canvases.mdx +17 -0
  28. package/corpus/core/docs/content/locales/ko-KR/agent-native-toolkit.mdx +69 -62
  29. package/corpus/core/docs/content/locales/ko-KR/toolkit-capability-packages.mdx +21 -0
  30. package/corpus/core/docs/content/locales/ko-KR/toolkit-context-knowledge.mdx +12 -0
  31. package/corpus/core/docs/content/locales/ko-KR/toolkit-editors-canvases.mdx +17 -0
  32. package/corpus/core/docs/content/locales/pt-BR/agent-native-toolkit.mdx +82 -54
  33. package/corpus/core/docs/content/locales/pt-BR/toolkit-capability-packages.mdx +21 -0
  34. package/corpus/core/docs/content/locales/pt-BR/toolkit-context-knowledge.mdx +12 -0
  35. package/corpus/core/docs/content/locales/pt-BR/toolkit-editors-canvases.mdx +17 -0
  36. package/corpus/core/docs/content/locales/zh-CN/agent-native-toolkit.mdx +69 -62
  37. package/corpus/core/docs/content/locales/zh-CN/toolkit-capability-packages.mdx +21 -0
  38. package/corpus/core/docs/content/locales/zh-CN/toolkit-context-knowledge.mdx +12 -0
  39. package/corpus/core/docs/content/locales/zh-CN/toolkit-editors-canvases.mdx +17 -0
  40. package/corpus/core/docs/content/locales/zh-TW/agent-native-toolkit.mdx +69 -62
  41. package/corpus/core/docs/content/locales/zh-TW/toolkit-capability-packages.mdx +21 -0
  42. package/corpus/core/docs/content/locales/zh-TW/toolkit-context-knowledge.mdx +12 -0
  43. package/corpus/core/docs/content/locales/zh-TW/toolkit-editors-canvases.mdx +17 -0
  44. package/corpus/core/docs/content/toolkit-capability-packages.mdx +52 -0
  45. package/corpus/core/docs/content/toolkit-context-knowledge.mdx +46 -0
  46. package/corpus/core/docs/content/toolkit-editors-canvases.mdx +55 -0
  47. package/corpus/core/package.json +35 -34
  48. package/corpus/core/src/cli/create.ts +57 -15
  49. package/corpus/core/src/cli/package-lifecycle.ts +2 -0
  50. package/corpus/core/src/cli/skills-content/visual-plan-skill.ts +2 -0
  51. package/corpus/core/src/client/context-xray/ContextMeter.tsx +31 -111
  52. package/corpus/core/src/client/context-xray/ContextSegmentRow.tsx +8 -111
  53. package/corpus/core/src/client/context-xray/ContextTreemap.tsx +6 -111
  54. package/corpus/core/src/client/context-xray/ContextXRayPanel.tsx +31 -391
  55. package/corpus/core/src/client/context-xray/SegmentProvenancePopover.tsx +4 -52
  56. package/corpus/core/src/client/context-xray/format.ts +0 -33
  57. package/corpus/core/src/client/require-session.tsx +19 -3
  58. package/corpus/core/src/client/rich-markdown-editor/index.ts +42 -57
  59. package/corpus/core/src/client/rich-markdown-editor/uploadEditorImage.ts +2 -1
  60. package/corpus/core/src/client/use-action.ts +145 -2
  61. package/corpus/core/src/client/use-session.ts +79 -48
  62. package/corpus/core/src/client/visual-style-controls.tsx +1 -1088
  63. package/corpus/core/src/collab/agent-identity.ts +5 -22
  64. package/corpus/core/src/collab/client.ts +1 -53
  65. package/corpus/core/src/db/client.ts +13 -7
  66. package/corpus/core/src/db/create-get-db.ts +20 -13
  67. package/corpus/core/src/db/request-telemetry.ts +154 -0
  68. package/corpus/core/src/integrations/index.ts +1 -0
  69. package/corpus/core/src/integrations/plugin.ts +9 -3
  70. package/corpus/core/src/integrations/remote-push-delivery-job.ts +48 -0
  71. package/corpus/core/src/integrations/remote-push-delivery.ts +370 -0
  72. package/corpus/core/src/integrations/remote-push-store.ts +275 -26
  73. package/corpus/core/src/server/better-auth-instance.ts +11 -3
  74. package/corpus/core/src/server/core-routes-plugin.ts +36 -14
  75. package/corpus/core/src/server/framework-request-handler.ts +11 -1
  76. package/corpus/core/src/server/http-response-telemetry.ts +233 -31
  77. package/corpus/core/src/styles/rich-markdown-editor.css +1 -510
  78. package/corpus/core/src/templates/workspace-core/.agents/skills/tracking/SKILL.md +19 -0
  79. package/corpus/core/src/testing.ts +1 -1
  80. package/corpus/core/src/vite/client.ts +3 -0
  81. package/corpus/templates/clips/actions/finalize-recording.ts +3 -1
  82. package/corpus/templates/clips/actions/set-mobile-capture-state.ts +4 -1
  83. package/corpus/templates/clips/app/components/library/library-layout.tsx +1 -6
  84. package/corpus/templates/clips/changelog/2026-07-18-new-recording-is-now-emphasized-as-the-primary-action-in-the.md +6 -0
  85. package/corpus/templates/clips/changelog/2026-07-18-recordings-now-remain-safely-recoverable-until-the-stored-me.md +6 -0
  86. package/corpus/templates/content/app/components/editor/VisualEditor.tsx +5 -3
  87. package/corpus/templates/content/app/components/editor/extensions/DragHandle.tsx +4 -4
  88. package/corpus/templates/content/package.json +25 -25
  89. package/corpus/templates/design/app/components/design/TweaksPanel.tsx +2 -1
  90. package/corpus/templates/design/package.json +1 -1
  91. package/corpus/templates/mail/package.json +9 -9
  92. package/corpus/templates/plan/.agents/skills/visual-plan/SKILL.md +2 -0
  93. package/corpus/templates/plan/app/components/editor/PlanDocumentEditor.tsx +8 -8
  94. package/corpus/templates/plan/app/components/editor/planSlashCommands.ts +6 -6
  95. package/corpus/templates/plan/app/components/plan/PlanImageNode.tsx +4 -7
  96. package/corpus/templates/plan/app/components/plan/PlanMarkdownEditor.tsx +6 -4
  97. package/corpus/templates/plan/app/components/plan/PlanVisualSurface.tsx +1 -1
  98. package/corpus/templates/plan/changelog/2026-07-18-visual-plans-now-open-on-wireframes-by-default-when-a-protot.md +6 -0
  99. package/corpus/templates/plan/package.json +3 -3
  100. package/corpus/templates/slides/app/components/editor/SlideStyleInspector.tsx +2 -2
  101. package/corpus/templates/slides/app/components/editor/TweaksPanel.tsx +2 -2
  102. package/corpus/templates/slides/package.json +13 -13
  103. package/corpus/templates/tasks/AGENTS.md +3 -0
  104. package/corpus/templates/tasks/actions/render-task-list-inline.ts +202 -0
  105. package/corpus/templates/tasks/changelog/2026-07-18-task-lists-can-now-appear-as-interactive-widgets-inline-in-c.md +6 -0
  106. package/corpus/templates/tasks/docs/features/f8-chat.mdx +2 -0
  107. package/corpus/templates/tasks/server/plugins/agent-chat.ts +2 -0
  108. package/dist/catalog.json +39 -1
  109. package/dist/cli/create.d.ts +10 -1
  110. package/dist/cli/create.d.ts.map +1 -1
  111. package/dist/cli/create.js +49 -16
  112. package/dist/cli/create.js.map +1 -1
  113. package/dist/cli/package-lifecycle.d.ts.map +1 -1
  114. package/dist/cli/package-lifecycle.js +2 -0
  115. package/dist/cli/package-lifecycle.js.map +1 -1
  116. package/dist/cli/skills-content/visual-plan-skill.d.ts +1 -1
  117. package/dist/cli/skills-content/visual-plan-skill.d.ts.map +1 -1
  118. package/dist/cli/skills-content/visual-plan-skill.js +2 -0
  119. package/dist/cli/skills-content/visual-plan-skill.js.map +1 -1
  120. package/dist/client/context-xray/ContextMeter.d.ts.map +1 -1
  121. package/dist/client/context-xray/ContextMeter.js +8 -23
  122. package/dist/client/context-xray/ContextMeter.js.map +1 -1
  123. package/dist/client/context-xray/ContextSegmentRow.d.ts.map +1 -1
  124. package/dist/client/context-xray/ContextSegmentRow.js +3 -19
  125. package/dist/client/context-xray/ContextSegmentRow.js.map +1 -1
  126. package/dist/client/context-xray/ContextTreemap.d.ts.map +1 -1
  127. package/dist/client/context-xray/ContextTreemap.js +3 -54
  128. package/dist/client/context-xray/ContextTreemap.js.map +1 -1
  129. package/dist/client/context-xray/ContextXRayPanel.d.ts.map +1 -1
  130. package/dist/client/context-xray/ContextXRayPanel.js +21 -163
  131. package/dist/client/context-xray/ContextXRayPanel.js.map +1 -1
  132. package/dist/client/context-xray/SegmentProvenancePopover.d.ts.map +1 -1
  133. package/dist/client/context-xray/SegmentProvenancePopover.js +3 -4
  134. package/dist/client/context-xray/SegmentProvenancePopover.js.map +1 -1
  135. package/dist/client/context-xray/format.d.ts +0 -4
  136. package/dist/client/context-xray/format.d.ts.map +1 -1
  137. package/dist/client/context-xray/format.js +0 -49
  138. package/dist/client/context-xray/format.js.map +1 -1
  139. package/dist/client/require-session.d.ts.map +1 -1
  140. package/dist/client/require-session.js +6 -3
  141. package/dist/client/require-session.js.map +1 -1
  142. package/dist/client/rich-markdown-editor/index.d.ts +1 -12
  143. package/dist/client/rich-markdown-editor/index.d.ts.map +1 -1
  144. package/dist/client/rich-markdown-editor/index.js +1 -12
  145. package/dist/client/rich-markdown-editor/index.js.map +1 -1
  146. package/dist/client/rich-markdown-editor/uploadEditorImage.d.ts +1 -1
  147. package/dist/client/rich-markdown-editor/uploadEditorImage.d.ts.map +1 -1
  148. package/dist/client/rich-markdown-editor/uploadEditorImage.js.map +1 -1
  149. package/dist/client/use-action.d.ts.map +1 -1
  150. package/dist/client/use-action.js +117 -1
  151. package/dist/client/use-action.js.map +1 -1
  152. package/dist/client/use-session.d.ts.map +1 -1
  153. package/dist/client/use-session.js +72 -50
  154. package/dist/client/use-session.js.map +1 -1
  155. package/dist/client/visual-style-controls.d.ts +1 -89
  156. package/dist/client/visual-style-controls.d.ts.map +1 -1
  157. package/dist/client/visual-style-controls.js +1 -498
  158. package/dist/client/visual-style-controls.js.map +1 -1
  159. package/dist/collab/agent-identity.d.ts +1 -14
  160. package/dist/collab/agent-identity.d.ts.map +1 -1
  161. package/dist/collab/agent-identity.js +1 -13
  162. package/dist/collab/agent-identity.js.map +1 -1
  163. package/dist/collab/awareness.d.ts +2 -2
  164. package/dist/collab/awareness.d.ts.map +1 -1
  165. package/dist/collab/client.d.ts +1 -19
  166. package/dist/collab/client.d.ts.map +1 -1
  167. package/dist/collab/client.js +1 -53
  168. package/dist/collab/client.js.map +1 -1
  169. package/dist/collab/struct-routes.d.ts +1 -1
  170. package/dist/db/client.d.ts.map +1 -1
  171. package/dist/db/client.js +7 -1
  172. package/dist/db/client.js.map +1 -1
  173. package/dist/db/create-get-db.d.ts +3 -6
  174. package/dist/db/create-get-db.d.ts.map +1 -1
  175. package/dist/db/create-get-db.js +9 -2
  176. package/dist/db/create-get-db.js.map +1 -1
  177. package/dist/db/request-telemetry.d.ts +23 -0
  178. package/dist/db/request-telemetry.d.ts.map +1 -0
  179. package/dist/db/request-telemetry.js +95 -0
  180. package/dist/db/request-telemetry.js.map +1 -0
  181. package/dist/integrations/index.d.ts +1 -0
  182. package/dist/integrations/index.d.ts.map +1 -1
  183. package/dist/integrations/index.js +1 -0
  184. package/dist/integrations/index.js.map +1 -1
  185. package/dist/integrations/plugin.d.ts.map +1 -1
  186. package/dist/integrations/plugin.js +8 -3
  187. package/dist/integrations/plugin.js.map +1 -1
  188. package/dist/integrations/remote-push-delivery-job.d.ts +4 -0
  189. package/dist/integrations/remote-push-delivery-job.d.ts.map +1 -0
  190. package/dist/integrations/remote-push-delivery-job.js +44 -0
  191. package/dist/integrations/remote-push-delivery-job.js.map +1 -0
  192. package/dist/integrations/remote-push-delivery.d.ts +11 -0
  193. package/dist/integrations/remote-push-delivery.d.ts.map +1 -0
  194. package/dist/integrations/remote-push-delivery.js +265 -0
  195. package/dist/integrations/remote-push-delivery.js.map +1 -0
  196. package/dist/integrations/remote-push-store.d.ts +33 -0
  197. package/dist/integrations/remote-push-store.d.ts.map +1 -1
  198. package/dist/integrations/remote-push-store.js +195 -26
  199. package/dist/integrations/remote-push-store.js.map +1 -1
  200. package/dist/notifications/routes.d.ts +3 -3
  201. package/dist/progress/routes.d.ts +1 -1
  202. package/dist/provider-api/corpus-jobs.d.ts +2 -2
  203. package/dist/resources/handlers.d.ts +3 -3
  204. package/dist/secrets/routes.d.ts +9 -9
  205. package/dist/server/agent-engine-api-key-route.d.ts +1 -1
  206. package/dist/server/better-auth-instance.js +7 -3
  207. package/dist/server/better-auth-instance.js.map +1 -1
  208. package/dist/server/core-routes-plugin.d.ts +8 -0
  209. package/dist/server/core-routes-plugin.d.ts.map +1 -1
  210. package/dist/server/core-routes-plugin.js +23 -8
  211. package/dist/server/core-routes-plugin.js.map +1 -1
  212. package/dist/server/framework-request-handler.d.ts.map +1 -1
  213. package/dist/server/framework-request-handler.js +9 -1
  214. package/dist/server/framework-request-handler.js.map +1 -1
  215. package/dist/server/http-response-telemetry.d.ts +3 -2
  216. package/dist/server/http-response-telemetry.d.ts.map +1 -1
  217. package/dist/server/http-response-telemetry.js +160 -27
  218. package/dist/server/http-response-telemetry.js.map +1 -1
  219. package/dist/server/transcribe-voice.d.ts +1 -1
  220. package/dist/styles/rich-markdown-editor.css +1 -510
  221. package/dist/templates/workspace-core/.agents/skills/tracking/SKILL.md +19 -0
  222. package/dist/testing.d.ts +1 -1
  223. package/dist/testing.d.ts.map +1 -1
  224. package/dist/testing.js +1 -1
  225. package/dist/testing.js.map +1 -1
  226. package/dist/vite/client.d.ts.map +1 -1
  227. package/dist/vite/client.js +3 -0
  228. package/dist/vite/client.js.map +1 -1
  229. package/docs/content/agent-native-toolkit.mdx +46 -13
  230. package/docs/content/locales/ar-SA/agent-native-toolkit.mdx +79 -55
  231. package/docs/content/locales/ar-SA/toolkit-capability-packages.mdx +21 -0
  232. package/docs/content/locales/ar-SA/toolkit-context-knowledge.mdx +12 -0
  233. package/docs/content/locales/ar-SA/toolkit-editors-canvases.mdx +17 -0
  234. package/docs/content/locales/de-DE/agent-native-toolkit.mdx +82 -54
  235. package/docs/content/locales/de-DE/toolkit-capability-packages.mdx +21 -0
  236. package/docs/content/locales/de-DE/toolkit-context-knowledge.mdx +12 -0
  237. package/docs/content/locales/de-DE/toolkit-editors-canvases.mdx +17 -0
  238. package/docs/content/locales/es-ES/agent-native-toolkit.mdx +81 -52
  239. package/docs/content/locales/es-ES/toolkit-capability-packages.mdx +21 -0
  240. package/docs/content/locales/es-ES/toolkit-context-knowledge.mdx +12 -0
  241. package/docs/content/locales/es-ES/toolkit-editors-canvases.mdx +21 -0
  242. package/docs/content/locales/fr-FR/agent-native-toolkit.mdx +84 -54
  243. package/docs/content/locales/fr-FR/toolkit-capability-packages.mdx +21 -0
  244. package/docs/content/locales/fr-FR/toolkit-context-knowledge.mdx +12 -0
  245. package/docs/content/locales/fr-FR/toolkit-editors-canvases.mdx +21 -0
  246. package/docs/content/locales/hi-IN/agent-native-toolkit.mdx +69 -62
  247. package/docs/content/locales/hi-IN/toolkit-capability-packages.mdx +21 -0
  248. package/docs/content/locales/hi-IN/toolkit-context-knowledge.mdx +12 -0
  249. package/docs/content/locales/hi-IN/toolkit-editors-canvases.mdx +17 -0
  250. package/docs/content/locales/ja-JP/agent-native-toolkit.mdx +69 -62
  251. package/docs/content/locales/ja-JP/toolkit-capability-packages.mdx +21 -0
  252. package/docs/content/locales/ja-JP/toolkit-context-knowledge.mdx +12 -0
  253. package/docs/content/locales/ja-JP/toolkit-editors-canvases.mdx +17 -0
  254. package/docs/content/locales/ko-KR/agent-native-toolkit.mdx +69 -62
  255. package/docs/content/locales/ko-KR/toolkit-capability-packages.mdx +21 -0
  256. package/docs/content/locales/ko-KR/toolkit-context-knowledge.mdx +12 -0
  257. package/docs/content/locales/ko-KR/toolkit-editors-canvases.mdx +17 -0
  258. package/docs/content/locales/pt-BR/agent-native-toolkit.mdx +82 -54
  259. package/docs/content/locales/pt-BR/toolkit-capability-packages.mdx +21 -0
  260. package/docs/content/locales/pt-BR/toolkit-context-knowledge.mdx +12 -0
  261. package/docs/content/locales/pt-BR/toolkit-editors-canvases.mdx +17 -0
  262. package/docs/content/locales/zh-CN/agent-native-toolkit.mdx +69 -62
  263. package/docs/content/locales/zh-CN/toolkit-capability-packages.mdx +21 -0
  264. package/docs/content/locales/zh-CN/toolkit-context-knowledge.mdx +12 -0
  265. package/docs/content/locales/zh-CN/toolkit-editors-canvases.mdx +17 -0
  266. package/docs/content/locales/zh-TW/agent-native-toolkit.mdx +69 -62
  267. package/docs/content/locales/zh-TW/toolkit-capability-packages.mdx +21 -0
  268. package/docs/content/locales/zh-TW/toolkit-context-knowledge.mdx +12 -0
  269. package/docs/content/locales/zh-TW/toolkit-editors-canvases.mdx +17 -0
  270. package/docs/content/toolkit-capability-packages.mdx +52 -0
  271. package/docs/content/toolkit-context-knowledge.mdx +46 -0
  272. package/docs/content/toolkit-editors-canvases.mdx +55 -0
  273. package/package.json +27 -26
  274. package/src/templates/workspace-core/.agents/skills/tracking/SKILL.md +19 -0
  275. package/corpus/core/src/client/rich-markdown-editor/BubbleToolbar.tsx +0 -253
  276. package/corpus/core/src/client/rich-markdown-editor/CodeBlockNode.tsx +0 -258
  277. package/corpus/core/src/client/rich-markdown-editor/DragHandle.ts +0 -1437
  278. package/corpus/core/src/client/rich-markdown-editor/ImageExtension.ts +0 -306
  279. package/corpus/core/src/client/rich-markdown-editor/RichMarkdownEditor.tsx +0 -80
  280. package/corpus/core/src/client/rich-markdown-editor/RunId.ts +0 -61
  281. package/corpus/core/src/client/rich-markdown-editor/SharedRichEditor.tsx +0 -321
  282. package/corpus/core/src/client/rich-markdown-editor/SlashCommandMenu.tsx +0 -310
  283. package/corpus/core/src/client/rich-markdown-editor/extensions.ts +0 -402
  284. package/corpus/core/src/client/rich-markdown-editor/gfmDoc.ts +0 -92
  285. package/corpus/core/src/client/rich-markdown-editor/surgical-apply.ts +0 -192
  286. package/corpus/core/src/client/rich-markdown-editor/useCollabReconcile.ts +0 -590
  287. package/dist/client/rich-markdown-editor/BubbleToolbar.d.ts +0 -37
  288. package/dist/client/rich-markdown-editor/BubbleToolbar.d.ts.map +0 -1
  289. package/dist/client/rich-markdown-editor/BubbleToolbar.js +0 -171
  290. package/dist/client/rich-markdown-editor/BubbleToolbar.js.map +0 -1
  291. package/dist/client/rich-markdown-editor/CodeBlockNode.d.ts +0 -49
  292. package/dist/client/rich-markdown-editor/CodeBlockNode.d.ts.map +0 -1
  293. package/dist/client/rich-markdown-editor/CodeBlockNode.js +0 -127
  294. package/dist/client/rich-markdown-editor/CodeBlockNode.js.map +0 -1
  295. package/dist/client/rich-markdown-editor/DragHandle.d.ts +0 -97
  296. package/dist/client/rich-markdown-editor/DragHandle.d.ts.map +0 -1
  297. package/dist/client/rich-markdown-editor/DragHandle.js +0 -1066
  298. package/dist/client/rich-markdown-editor/DragHandle.js.map +0 -1
  299. package/dist/client/rich-markdown-editor/ImageExtension.d.ts +0 -63
  300. package/dist/client/rich-markdown-editor/ImageExtension.d.ts.map +0 -1
  301. package/dist/client/rich-markdown-editor/ImageExtension.js +0 -243
  302. package/dist/client/rich-markdown-editor/ImageExtension.js.map +0 -1
  303. package/dist/client/rich-markdown-editor/RichMarkdownEditor.d.ts +0 -51
  304. package/dist/client/rich-markdown-editor/RichMarkdownEditor.d.ts.map +0 -1
  305. package/dist/client/rich-markdown-editor/RichMarkdownEditor.js +0 -37
  306. package/dist/client/rich-markdown-editor/RichMarkdownEditor.js.map +0 -1
  307. package/dist/client/rich-markdown-editor/RunId.d.ts +0 -28
  308. package/dist/client/rich-markdown-editor/RunId.d.ts.map +0 -1
  309. package/dist/client/rich-markdown-editor/RunId.js +0 -60
  310. package/dist/client/rich-markdown-editor/RunId.js.map +0 -1
  311. package/dist/client/rich-markdown-editor/SharedRichEditor.d.ts +0 -110
  312. package/dist/client/rich-markdown-editor/SharedRichEditor.d.ts.map +0 -1
  313. package/dist/client/rich-markdown-editor/SharedRichEditor.js +0 -144
  314. package/dist/client/rich-markdown-editor/SharedRichEditor.js.map +0 -1
  315. package/dist/client/rich-markdown-editor/SlashCommandMenu.d.ts +0 -41
  316. package/dist/client/rich-markdown-editor/SlashCommandMenu.d.ts.map +0 -1
  317. package/dist/client/rich-markdown-editor/SlashCommandMenu.js +0 -221
  318. package/dist/client/rich-markdown-editor/SlashCommandMenu.js.map +0 -1
  319. package/dist/client/rich-markdown-editor/extensions.d.ts +0 -178
  320. package/dist/client/rich-markdown-editor/extensions.d.ts.map +0 -1
  321. package/dist/client/rich-markdown-editor/extensions.js +0 -224
  322. package/dist/client/rich-markdown-editor/extensions.js.map +0 -1
  323. package/dist/client/rich-markdown-editor/gfmDoc.d.ts +0 -24
  324. package/dist/client/rich-markdown-editor/gfmDoc.d.ts.map +0 -1
  325. package/dist/client/rich-markdown-editor/gfmDoc.js +0 -83
  326. package/dist/client/rich-markdown-editor/gfmDoc.js.map +0 -1
  327. package/dist/client/rich-markdown-editor/surgical-apply.d.ts +0 -66
  328. package/dist/client/rich-markdown-editor/surgical-apply.d.ts.map +0 -1
  329. package/dist/client/rich-markdown-editor/surgical-apply.js +0 -147
  330. package/dist/client/rich-markdown-editor/surgical-apply.js.map +0 -1
  331. package/dist/client/rich-markdown-editor/useCollabReconcile.d.ts +0 -110
  332. package/dist/client/rich-markdown-editor/useCollabReconcile.d.ts.map +0 -1
  333. package/dist/client/rich-markdown-editor/useCollabReconcile.js +0 -441
  334. package/dist/client/rich-markdown-editor/useCollabReconcile.js.map +0 -1
@@ -1,22 +1,5 @@
1
- /**
2
- * Canonical agent identity constants for collaborative editing.
3
- *
4
- * Centralizes the agent's client ID, name, email, and cursor color
5
- * so templates don't hardcode these values.
6
- */
7
-
8
- export const AGENT_CLIENT_ID = 2147483647; // Max 32-bit signed int, reserved for agent
9
-
10
- export interface AgentIdentity {
11
- clientId: number;
12
- name: string;
13
- email: string;
14
- color: string;
15
- }
16
-
17
- export const DEFAULT_AGENT_IDENTITY: AgentIdentity = {
18
- clientId: AGENT_CLIENT_ID,
19
- name: "AI Assistant",
20
- email: "agent@system",
21
- color: "#00B5FF", // agent-native blue
22
- };
1
+ export {
2
+ AGENT_CLIENT_ID,
3
+ DEFAULT_AGENT_IDENTITY,
4
+ type AgentIdentity,
5
+ } from "@agent-native/toolkit/collab-ui";
@@ -45,12 +45,11 @@ import * as Y from "yjs";
45
45
 
46
46
  import { agentNativePath } from "../client/api-path.js";
47
47
  import { subscribeSyncEvents, type SyncEvent } from "../client/use-db-sync.js";
48
- import { AGENT_CLIENT_ID } from "./agent-identity.js";
49
-
50
48
  export {
51
49
  dedupeCollabUsersByEmail,
52
50
  emailToColor,
53
51
  emailToName,
52
+ isReconcileLeadClient,
54
53
  type CollabUser,
55
54
  } from "@agent-native/toolkit/collab-ui";
56
55
 
@@ -119,57 +118,6 @@ function collabUsersEqual(a: CollabUser[], b: CollabUser[]): boolean {
119
118
  return true;
120
119
  }
121
120
 
122
- /**
123
- * Leader election for applying authoritative external snapshots into a shared
124
- * collaborative document.
125
- *
126
- * When the agent (or a Notion pull, or any full-document rewrite) writes new
127
- * content to SQL, the open editor reconciles it into the live Y.Doc with
128
- * `setContent`. If EVERY connected client did that independently, each would
129
- * diff the same snapshot into the CRDT and the changed region would be inserted
130
- * N times (concurrent inserts at the same position → duplicated text). So only
131
- * ONE client — the "lead" — applies the snapshot; every other client receives
132
- * the result through normal Yjs sync.
133
- *
134
- * The lead is the present client with the lowest Yjs `clientID`. The agent's
135
- * awareness entry uses `AGENT_CLIENT_ID` (max int) so it can never be the lead,
136
- * and a client editing alone is always the lead. This is deterministic across
137
- * clients with no coordination round-trip.
138
- */
139
- export function isReconcileLeadClient(
140
- awareness: Awareness | null | undefined,
141
- localClientId: number | null | undefined,
142
- ): boolean {
143
- if (localClientId == null) return false;
144
- if (!awareness) return true; // standalone / tests — act alone
145
-
146
- let hasPeer = false;
147
- let minVisible = localClientId;
148
- awareness.getStates().forEach((state, clientId) => {
149
- if (clientId === AGENT_CLIENT_ID) return; // agent never leads
150
- if (clientId === localClientId) return;
151
- const s = state as { user?: unknown; visible?: boolean };
152
- if (!s || !s.user) return; // skip empty/stale entries
153
- hasPeer = true;
154
- // Only VISIBLE peers can act; a peer published `visible: false` (backgrounded)
155
- // is skipped. A peer that hasn't published the field is treated as visible.
156
- if (s.visible !== false && clientId < minVisible) minVisible = clientId;
157
- });
158
-
159
- // Sole client: always the applier — no other client can duplicate the edit,
160
- // so single-user agent edits apply even if this tab reports hidden.
161
- if (!hasPeer) return true;
162
-
163
- // With peers present, exactly one VISIBLE client applies (the lowest clientId
164
- // among visible ones). A backgrounded tab pauses its poll and can't reliably
165
- // act, so it yields — otherwise an agent edit would never reach the tab the
166
- // user is actually looking at. The caller re-elects on visibility change.
167
- const localHidden =
168
- typeof document !== "undefined" && document.visibilityState === "hidden";
169
- if (localHidden) return false;
170
- return localClientId <= minVisible;
171
- }
172
-
173
121
  export interface RemoteAwarenessSnapshot {
174
122
  clientId: number;
175
123
  state: unknown;
@@ -10,6 +10,11 @@
10
10
  */
11
11
  import path from "path";
12
12
 
13
+ import {
14
+ beginDatabaseOperation,
15
+ recordDatabaseRetry,
16
+ } from "./request-telemetry.js";
17
+
13
18
  const recyclingPostgresPools = new WeakSet<object>();
14
19
  const loggedNeonPools = new WeakSet<object>();
15
20
 
@@ -735,6 +740,7 @@ export async function retryOnConnectionError<T>(
735
740
  } catch (e) {
736
741
  last = e;
737
742
  if (!isConnectionError(e) || attempt === maxAttempts - 1) throw e;
743
+ recordDatabaseRetry();
738
744
  await new Promise((r) => setTimeout(r, 100 * (attempt + 1)));
739
745
  }
740
746
  }
@@ -790,6 +796,9 @@ export async function withDbTimeout<T>(
790
796
  ): Promise<T> {
791
797
  let timer: ReturnType<typeof setTimeout> | undefined;
792
798
  let settled = false;
799
+ const finishTelemetry = beginDatabaseOperation(
800
+ op === "connect" ? "connect" : "query",
801
+ );
793
802
 
794
803
  const runCleanup = async () => {
795
804
  if (!onTimeout) return;
@@ -811,12 +820,14 @@ export async function withDbTimeout<T>(
811
820
  if (settled) return;
812
821
  settled = true;
813
822
  if (timer) clearTimeout(timer);
823
+ finishTelemetry("success");
814
824
  complete(value);
815
825
  };
816
826
  const fail = (err: unknown) => {
817
827
  if (settled) return;
818
828
  settled = true;
819
829
  if (timer) clearTimeout(timer);
830
+ finishTelemetry("error");
820
831
  reject(err);
821
832
  };
822
833
 
@@ -825,6 +836,7 @@ export async function withDbTimeout<T>(
825
836
  settled = true;
826
837
  void (async () => {
827
838
  await runCleanup();
839
+ finishTelemetry("timeout");
828
840
  reject(new DbTimeoutError(op, ms));
829
841
  })();
830
842
  }, ms);
@@ -1171,13 +1183,7 @@ async function createDbExecInternal(
1171
1183
  return retryOnConnectionError<{
1172
1184
  rows: unknown[];
1173
1185
  rowsAffected: number;
1174
- }>(() =>
1175
- withDbTimeout(
1176
- "http-query",
1177
- () => queryNeonClient(pool, sql),
1178
- dbOpTimeoutMs(),
1179
- ),
1180
- );
1186
+ }>(() => queryNeonClient(pool, sql));
1181
1187
  }
1182
1188
  const result = await retryOnConnectionError<{
1183
1189
  rows: unknown[];
@@ -84,23 +84,28 @@ export function isSqlRead(sql: string): boolean {
84
84
  * connection the transaction needs. The pool-level error logger still fires
85
85
  * on idle-client drops inside transactions.
86
86
  */
87
- export function buildResilientNeonPool(pool: {
88
- connect(): Promise<any>;
89
- query(
90
- sql: string,
91
- args?: any[],
92
- ): Promise<{ rows: unknown[]; rowCount?: number }>;
93
- end(): Promise<void>;
94
- on(event: string, listener: (...args: any[]) => void): unknown;
95
- }): typeof pool {
87
+ export function buildResilientNeonPool<
88
+ T extends {
89
+ connect(): Promise<any>;
90
+ query(...args: any[]): Promise<any>;
91
+ end(): Promise<void>;
92
+ on(event: string, listener: (...args: any[]) => void): unknown;
93
+ },
94
+ >(pool: T): T {
96
95
  // Preserve all original pool methods and properties; only override `connect`
97
96
  // and `query` at the Pool level (used by drizzle's neon-serverless adapter
98
97
  // when it calls pool.query() directly, e.g. outside a transaction).
99
98
  const resilientQuery = async (
100
- sql: string,
99
+ sql: string | { text?: unknown },
101
100
  args?: any[],
102
101
  ): Promise<{ rows: unknown[]; rowCount?: number }> => {
103
- const isRead = isSqlRead(sql);
102
+ const sqlText =
103
+ typeof sql === "string"
104
+ ? sql
105
+ : typeof sql?.text === "string"
106
+ ? sql.text
107
+ : "";
108
+ const isRead = isSqlRead(sqlText);
104
109
 
105
110
  const runAttempt = async (): Promise<{
106
111
  rows: unknown[];
@@ -135,7 +140,9 @@ export function buildResilientNeonPool(pool: {
135
140
  const result = await withDbTimeout(
136
141
  "query",
137
142
  () =>
138
- client.query(sql, args ?? []) as Promise<{
143
+ (args === undefined
144
+ ? client.query(sql)
145
+ : client.query(sql, args)) as Promise<{
139
146
  rows: unknown[];
140
147
  rowCount?: number;
141
148
  }>,
@@ -180,7 +187,7 @@ export function buildResilientNeonPool(pool: {
180
187
  const val = (target as any)[prop];
181
188
  return typeof val === "function" ? val.bind(target) : val;
182
189
  },
183
- });
190
+ }) as T;
184
191
  }
185
192
 
186
193
  /**
@@ -0,0 +1,154 @@
1
+ import { AsyncLocalStorage } from "node:async_hooks";
2
+
3
+ export type DatabaseOperationKind = "connect" | "query";
4
+
5
+ export interface DatabaseRequestTelemetry {
6
+ operationCount: number;
7
+ queryCount: number;
8
+ connectCount: number;
9
+ retryCount: number;
10
+ errorCount: number;
11
+ timeoutCount: number;
12
+ operationTotalMs: number;
13
+ operationWallMs: number;
14
+ queryTotalMs: number;
15
+ connectTotalMs: number;
16
+ slowestOperationMs: number;
17
+ activeOperationCount: number;
18
+ activeWindowStartedAt?: number;
19
+ }
20
+
21
+ const STORAGE_KEY = Symbol.for(
22
+ "@agent-native/core/db.request-telemetry-storage",
23
+ );
24
+ const STARTUP_STATE_KEY = Symbol.for(
25
+ "@agent-native/core/db.startup-telemetry-state",
26
+ );
27
+ const STARTUP_CAPTURE_WINDOW_MS = 120_000;
28
+ interface StartupDatabaseTelemetryState {
29
+ captureUntil: number;
30
+ claimed: boolean;
31
+ telemetry: DatabaseRequestTelemetry;
32
+ }
33
+ type GlobalWithDatabaseTelemetry = typeof globalThis & {
34
+ [STORAGE_KEY]?: AsyncLocalStorage<DatabaseRequestTelemetry>;
35
+ [STARTUP_STATE_KEY]?: StartupDatabaseTelemetryState;
36
+ };
37
+
38
+ const globalRef = globalThis as GlobalWithDatabaseTelemetry;
39
+ const storage =
40
+ globalRef[STORAGE_KEY] ??
41
+ (globalRef[STORAGE_KEY] = new AsyncLocalStorage<DatabaseRequestTelemetry>());
42
+
43
+ export function createDatabaseRequestTelemetry(): DatabaseRequestTelemetry {
44
+ return {
45
+ operationCount: 0,
46
+ queryCount: 0,
47
+ connectCount: 0,
48
+ retryCount: 0,
49
+ errorCount: 0,
50
+ timeoutCount: 0,
51
+ operationTotalMs: 0,
52
+ operationWallMs: 0,
53
+ queryTotalMs: 0,
54
+ connectTotalMs: 0,
55
+ slowestOperationMs: 0,
56
+ activeOperationCount: 0,
57
+ };
58
+ }
59
+
60
+ const startupState =
61
+ globalRef[STARTUP_STATE_KEY] ??
62
+ (globalRef[STARTUP_STATE_KEY] = {
63
+ captureUntil: Date.now() + STARTUP_CAPTURE_WINDOW_MS,
64
+ claimed: false,
65
+ telemetry: createDatabaseRequestTelemetry(),
66
+ });
67
+
68
+ function currentDatabaseTelemetry(): DatabaseRequestTelemetry | undefined {
69
+ const requestTelemetry = storage.getStore();
70
+ if (requestTelemetry) return requestTelemetry;
71
+ if (!startupState.claimed && Date.now() <= startupState.captureUntil) {
72
+ return startupState.telemetry;
73
+ }
74
+ return undefined;
75
+ }
76
+
77
+ export function claimStartupDatabaseTelemetry():
78
+ | DatabaseRequestTelemetry
79
+ | undefined {
80
+ if (startupState.claimed) return undefined;
81
+ startupState.claimed = true;
82
+ return startupState.telemetry;
83
+ }
84
+
85
+ export function runWithDatabaseRequestTelemetry<T>(
86
+ telemetry: DatabaseRequestTelemetry,
87
+ fn: () => T,
88
+ ): T {
89
+ return storage.run(telemetry, fn);
90
+ }
91
+
92
+ export function enterDatabaseRequestTelemetry(
93
+ telemetry: DatabaseRequestTelemetry,
94
+ ): void {
95
+ storage.enterWith(telemetry);
96
+ }
97
+
98
+ export function beginDatabaseOperation(
99
+ operation: DatabaseOperationKind,
100
+ ): (outcome: "success" | "error" | "timeout") => void {
101
+ const telemetry = currentDatabaseTelemetry();
102
+ if (!telemetry) return () => {};
103
+
104
+ const startedAt = Date.now();
105
+ if (telemetry.activeOperationCount === 0) {
106
+ telemetry.activeWindowStartedAt = startedAt;
107
+ }
108
+ telemetry.activeOperationCount += 1;
109
+ let completed = false;
110
+
111
+ return (outcome) => {
112
+ if (completed) return;
113
+ completed = true;
114
+ const completedAt = Date.now();
115
+ const duration = Math.max(0, completedAt - startedAt);
116
+ telemetry.operationCount += 1;
117
+ telemetry.operationTotalMs += duration;
118
+ telemetry.slowestOperationMs = Math.max(
119
+ telemetry.slowestOperationMs,
120
+ duration,
121
+ );
122
+
123
+ if (operation === "connect") {
124
+ telemetry.connectCount += 1;
125
+ telemetry.connectTotalMs += duration;
126
+ } else {
127
+ telemetry.queryCount += 1;
128
+ telemetry.queryTotalMs += duration;
129
+ }
130
+
131
+ if (outcome !== "success") telemetry.errorCount += 1;
132
+ if (outcome === "timeout") telemetry.timeoutCount += 1;
133
+
134
+ telemetry.activeOperationCount = Math.max(
135
+ 0,
136
+ telemetry.activeOperationCount - 1,
137
+ );
138
+ if (
139
+ telemetry.activeOperationCount === 0 &&
140
+ telemetry.activeWindowStartedAt !== undefined
141
+ ) {
142
+ telemetry.operationWallMs += Math.max(
143
+ 0,
144
+ completedAt - telemetry.activeWindowStartedAt,
145
+ );
146
+ telemetry.activeWindowStartedAt = undefined;
147
+ }
148
+ };
149
+ }
150
+
151
+ export function recordDatabaseRetry(): void {
152
+ const telemetry = currentDatabaseTelemetry();
153
+ if (telemetry) telemetry.retryCount += 1;
154
+ }
@@ -84,6 +84,7 @@ export {
84
84
  unregisterRemotePushRegistrationForOwner,
85
85
  upsertRemotePushRegistration,
86
86
  } from "./remote-push-store.js";
87
+ export { deliverPendingRemotePushNotifications } from "./remote-push-delivery.js";
87
88
  export type {
88
89
  ComputerApprovalScope,
89
90
  ComputerCommandAction,
@@ -109,6 +109,7 @@ import {
109
109
  unregisterRemoteDevice,
110
110
  updateRemoteDeviceDetails,
111
111
  } from "./remote-devices-store.js";
112
+ import { startRemotePushDeliveryJob } from "./remote-push-delivery-job.js";
112
113
  import {
113
114
  listRemotePushNotificationsForOwner,
114
115
  listRemotePushRegistrationsForOwner,
@@ -579,7 +580,6 @@ function mountedPathParts(event: any, mountSuffix: string): string[] {
579
580
  function remoteCommandPushPayload(
580
581
  command: RemoteCommand,
581
582
  ): Record<string, unknown> {
582
- const result = readObject(command.result);
583
583
  const status = command.status;
584
584
  const title =
585
585
  status === "completed"
@@ -587,14 +587,19 @@ function remoteCommandPushPayload(
587
587
  : status === "failed"
588
588
  ? "Remote run failed"
589
589
  : "Remote run updated";
590
+ const body =
591
+ status === "completed"
592
+ ? "Open Agent Native to review the result."
593
+ : status === "failed"
594
+ ? "Open Agent Native to review the failure."
595
+ : "Open Agent Native to review the latest status.";
590
596
  return {
591
597
  title,
592
- body: command.errorMessage ?? readString(result?.message),
598
+ body,
593
599
  commandId: command.id,
594
600
  hostId: command.deviceId,
595
601
  kind: command.kind,
596
602
  status,
597
- result: command.result,
598
603
  updatedAt: command.updatedAt,
599
604
  };
600
605
  }
@@ -2897,6 +2902,7 @@ export function createIntegrationsPlugin(
2897
2902
  });
2898
2903
  startA2AContinuationRetryJob(adapterMap);
2899
2904
  startRemoteCommandsRetryJob();
2905
+ startRemotePushDeliveryJob();
2900
2906
 
2901
2907
  // ─── Start Google Docs poller/push ────────────────────────────
2902
2908
  if (adapterMap.has("google-docs")) {
@@ -0,0 +1,48 @@
1
+ import { deliverPendingRemotePushNotifications } from "./remote-push-delivery.js";
2
+
3
+ const DELIVERY_INTERVAL_MS = 60_000;
4
+
5
+ let retryInterval: ReturnType<typeof setInterval> | null = null;
6
+ let initialTimer: ReturnType<typeof setTimeout> | null = null;
7
+ let running = false;
8
+
9
+ export async function runRemotePushDelivery(): Promise<void> {
10
+ if (running) return;
11
+ running = true;
12
+ try {
13
+ await deliverPendingRemotePushNotifications();
14
+ } catch (error) {
15
+ console.error("[integrations] Remote push delivery failed", {
16
+ error: error instanceof Error ? error.name : "UnknownError",
17
+ });
18
+ } finally {
19
+ running = false;
20
+ }
21
+ }
22
+
23
+ export function startRemotePushDeliveryJob(): void {
24
+ if (retryInterval) return;
25
+ initialTimer = setTimeout(() => void runRemotePushDelivery(), 10_000);
26
+ unrefTimer(initialTimer);
27
+ retryInterval = setInterval(
28
+ () => void runRemotePushDelivery(),
29
+ DELIVERY_INTERVAL_MS,
30
+ );
31
+ unrefTimer(retryInterval);
32
+ }
33
+
34
+ export function stopRemotePushDeliveryJob(): void {
35
+ if (initialTimer) {
36
+ clearTimeout(initialTimer);
37
+ initialTimer = null;
38
+ }
39
+ if (retryInterval) {
40
+ clearInterval(retryInterval);
41
+ retryInterval = null;
42
+ }
43
+ running = false;
44
+ }
45
+
46
+ function unrefTimer(timer: ReturnType<typeof setInterval>): void {
47
+ (timer as unknown as { unref?: () => void }).unref?.();
48
+ }