@agent-native/core 0.80.10 → 0.81.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (267) hide show
  1. package/corpus/README.md +1 -1
  2. package/corpus/core/CHANGELOG.md +53 -0
  3. package/corpus/core/package.json +1 -1
  4. package/corpus/core/src/agent/production-agent.ts +108 -15
  5. package/corpus/core/src/cli/design-connect.ts +419 -19
  6. package/corpus/core/src/client/AssistantChat.tsx +123 -26
  7. package/corpus/core/src/client/ConnectBuilderCard.tsx +1 -0
  8. package/corpus/core/src/client/chat/index.ts +1 -0
  9. package/corpus/core/src/client/chat/run-recovery.tsx +9 -7
  10. package/corpus/core/src/client/chat-view-transition.ts +33 -2
  11. package/corpus/core/src/client/composer/PromptComposer.tsx +21 -2
  12. package/corpus/core/src/client/index.ts +1 -0
  13. package/corpus/core/src/client/org/OrgSwitcher.tsx +26 -4
  14. package/corpus/core/src/client/sharing/ShareButton.tsx +3 -3
  15. package/corpus/core/src/client/sse-event-processor.ts +9 -0
  16. package/corpus/core/src/client/use-agent-chat-home-handoff.ts +31 -3
  17. package/corpus/core/src/db/client.ts +29 -2
  18. package/corpus/core/src/provider-api/index.ts +29 -0
  19. package/corpus/core/src/server/core-routes-plugin.ts +58 -20
  20. package/corpus/core/src/styles/agent-native.css +54 -0
  21. package/corpus/core/src/usage/store.ts +2 -2
  22. package/corpus/templates/analytics/app/components/layout/Layout.tsx +118 -10
  23. package/corpus/templates/analytics/app/components/layout/layout-route-policy.ts +7 -0
  24. package/corpus/templates/analytics/app/global.css +8 -0
  25. package/corpus/templates/analytics/app/hooks/use-navigation-state.ts +7 -1
  26. package/corpus/templates/analytics/app/lib/chat-handoff.ts +34 -0
  27. package/corpus/templates/analytics/app/pages/Ask.tsx +9 -18
  28. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/index.tsx +2 -2
  29. package/corpus/templates/analytics/app/pages/sessions/SessionDetailPage.tsx +109 -21
  30. package/corpus/templates/analytics/app/pages/sessions/SessionsPage.tsx +4 -6
  31. package/corpus/templates/analytics/changelog/2026-06-30-ask-opens-a-fresh-chat-unless-you-were-just-chatting-and-das.md +6 -0
  32. package/corpus/templates/analytics/changelog/2026-06-30-dashboard-email-reports-are-more-reliable-and-use-cleaner.md +6 -0
  33. package/corpus/templates/analytics/changelog/2026-06-30-dashboard-toolbar-controls-use-a-quieter-share-button-and-ve.md +6 -0
  34. package/corpus/templates/analytics/changelog/2026-06-30-session-replay-rows-show-whole-minute-durations-in-the-playl.md +6 -0
  35. package/corpus/templates/analytics/changelog/2026-06-30-session-replays-now-render-captured-styling-and-keep-the-eve.md +6 -0
  36. package/corpus/templates/analytics/server/jobs/dashboard-report.ts +16 -3
  37. package/corpus/templates/analytics/server/lib/dashboard-report.ts +31 -14
  38. package/corpus/templates/assets/.agents/skills/image-generation/SKILL.md +9 -2
  39. package/corpus/templates/assets/AGENTS.md +4 -0
  40. package/corpus/templates/assets/actions/_tool-activity.ts +46 -0
  41. package/corpus/templates/assets/actions/generate-image-batch.ts +26 -5
  42. package/corpus/templates/assets/actions/generate-image.ts +118 -67
  43. package/corpus/templates/assets/actions/list-draft-assets.ts +50 -0
  44. package/corpus/templates/assets/actions/open-asset-picker.ts +9 -0
  45. package/corpus/templates/assets/actions/rerun-generation-run.ts +52 -31
  46. package/corpus/templates/assets/app/components/create/RecentDraftsSection.tsx +100 -0
  47. package/corpus/templates/assets/app/global.css +15 -0
  48. package/corpus/templates/assets/app/hooks/use-navigation-state.ts +4 -0
  49. package/corpus/templates/assets/app/i18n/zh-TW.ts +7 -0
  50. package/corpus/templates/assets/app/i18n-data.ts +61 -0
  51. package/corpus/templates/assets/app/routes/_index.tsx +4 -0
  52. package/corpus/templates/assets/app/routes/library.tsx +233 -52
  53. package/corpus/templates/assets/changelog/2026-06-29-image-generation-can-now-render-requested-text-and-respect-b.md +6 -0
  54. package/corpus/templates/assets/changelog/2026-06-30-image-generation-no-longer-looks-stuck-while-the-provider-is-still-working.md +6 -0
  55. package/corpus/templates/assets/changelog/2026-06-30-tagged-presets-now-control-the-image-aspect-ratio.md +6 -0
  56. package/corpus/templates/assets/changelog/2026-06-30-the-assets-picker-now-supports-a-vertical-embedded-layout-fo.md +6 -0
  57. package/corpus/templates/assets/server/lib/generation.ts +135 -11
  58. package/corpus/templates/assets/shared/api.ts +4 -0
  59. package/corpus/templates/clips/actions/finalize-recording.ts +1 -12
  60. package/corpus/templates/clips/actions/list-ai-requests.ts +60 -0
  61. package/corpus/templates/clips/app/hooks/use-auto-title.ts +24 -25
  62. package/corpus/templates/clips/app/routes/r.$recordingId.tsx +10 -5
  63. package/corpus/templates/clips/app/routes/share.$shareId.tsx +6 -8
  64. package/corpus/templates/clips/changelog/2026-06-30-extension-save-recovery-avoids-false-upload-failures.md +6 -0
  65. package/corpus/templates/clips/changelog/2026-06-30-longer-chrome-extension-recordings-now-keep-saving-reliably-.md +6 -0
  66. package/corpus/templates/clips/chrome-extension/public/manifest.json +1 -1
  67. package/corpus/templates/clips/chrome-extension/src/background.ts +19 -10
  68. package/corpus/templates/clips/chrome-extension/src/content-script.ts +38 -12
  69. package/corpus/templates/clips/chrome-extension/src/finalize-recovery.ts +224 -0
  70. package/corpus/templates/clips/chrome-extension/src/offscreen.ts +119 -16
  71. package/corpus/templates/clips/chrome-extension/src/overlay.ts +16 -0
  72. package/corpus/templates/clips/server/lib/recording-upload-state.ts +48 -0
  73. package/corpus/templates/clips/server/routes/api/uploads/[recordingId]/abort.post.ts +9 -1
  74. package/corpus/templates/clips/server/routes/api/uploads/[recordingId]/chunk.post.ts +63 -13
  75. package/corpus/templates/clips/server/routes/api/uploads/[recordingId]/status.get.ts +74 -0
  76. package/corpus/templates/design/.agents/skills/design-systems/SKILL.md +32 -0
  77. package/corpus/templates/design/AGENTS.md +27 -0
  78. package/corpus/templates/design/CODE_NATIVE_DESIGN_STUDIO_IMPLEMENTATION_PLAN.md +1 -1
  79. package/corpus/templates/design/DESIGN-STUDIO-PLAN.md +5 -5
  80. package/corpus/templates/design/actions/apply-component-prop-edit.ts +76 -25
  81. package/corpus/templates/design/actions/apply-design-state.ts +17 -4
  82. package/corpus/templates/design/actions/apply-motion-edit.ts +76 -115
  83. package/corpus/templates/design/actions/apply-shader-fill.ts +148 -56
  84. package/corpus/templates/design/actions/capture-design-state.ts +27 -4
  85. package/corpus/templates/design/actions/connect-localhost.ts +59 -22
  86. package/corpus/templates/design/actions/delete-design.ts +20 -0
  87. package/corpus/templates/design/actions/export-zip.ts +23 -8
  88. package/corpus/templates/design/actions/generate-design.ts +53 -1
  89. package/corpus/templates/design/actions/get-component-details.ts +21 -26
  90. package/corpus/templates/design/actions/get-motion-timeline.ts +135 -10
  91. package/corpus/templates/design/actions/grant-localhost-write-consent.ts +116 -0
  92. package/corpus/templates/design/actions/import-design-tokens.ts +521 -0
  93. package/corpus/templates/design/actions/index-design-tokens.ts +18 -5
  94. package/corpus/templates/design/actions/insert-design-native-asset.ts +268 -0
  95. package/corpus/templates/design/actions/insert-figma-library-asset.ts +233 -0
  96. package/corpus/templates/design/actions/list-design-extensions.ts +32 -10
  97. package/corpus/templates/design/actions/list-design-native-assets.ts +105 -0
  98. package/corpus/templates/design/actions/list-design-states.ts +19 -1
  99. package/corpus/templates/design/actions/list-figma-library-assets.ts +292 -0
  100. package/corpus/templates/design/actions/migrate-board-objects-to-file.ts +238 -0
  101. package/corpus/templates/design/actions/navigate.ts +18 -3
  102. package/corpus/templates/design/actions/open-component-source.ts +7 -2
  103. package/corpus/templates/design/actions/preview-component-prop-edit.ts +32 -26
  104. package/corpus/templates/design/actions/preview-shader-fill.ts +9 -11
  105. package/corpus/templates/design/actions/provider-api-catalog.ts +2 -2
  106. package/corpus/templates/design/actions/provider-api-docs.ts +1 -1
  107. package/corpus/templates/design/actions/provider-api-request.ts +3 -3
  108. package/corpus/templates/design/actions/revoke-localhost-write-consent.ts +48 -0
  109. package/corpus/templates/design/actions/run-design-audit.ts +74 -10
  110. package/corpus/templates/design/actions/run-design-extension-action.ts +1 -1
  111. package/corpus/templates/design/actions/view-screen.ts +1 -1
  112. package/corpus/templates/design/actions/write-local-file.ts +213 -0
  113. package/corpus/templates/design/app/components/design/DesignCanvas.tsx +244 -3197
  114. package/corpus/templates/design/app/components/design/DesignEditorSkeleton.tsx +30 -20
  115. package/corpus/templates/design/app/components/design/DesignExtensionsPanel.tsx +795 -289
  116. package/corpus/templates/design/app/components/design/EditPanel.tsx +635 -234
  117. package/corpus/templates/design/app/components/design/LayersPanel.tsx +124 -32
  118. package/corpus/templates/design/app/components/design/LocalhostWriteConsentDialog.tsx +161 -0
  119. package/corpus/templates/design/app/components/design/MotionDock.tsx +244 -266
  120. package/corpus/templates/design/app/components/design/MultiScreenCanvas.tsx +491 -56
  121. package/corpus/templates/design/app/components/design/ReviewPanel.tsx +55 -67
  122. package/corpus/templates/design/app/components/design/StatesPanel.tsx +38 -63
  123. package/corpus/templates/design/app/components/design/TokensPanel.tsx +264 -8
  124. package/corpus/templates/design/app/components/design/bridge/codegen.ts +125 -0
  125. package/corpus/templates/design/app/components/design/bridge/editor-chrome.bridge.ts +4037 -0
  126. package/corpus/templates/design/app/components/design/bridge/embedded-wheel.bridge.ts +62 -0
  127. package/corpus/templates/design/app/components/design/bridge/hit-test.bridge.ts +272 -0
  128. package/corpus/templates/design/app/components/design/bridge/nav.bridge.ts +116 -0
  129. package/corpus/templates/design/app/components/design/bridge/sample.bridge.ts +24 -0
  130. package/corpus/templates/design/app/components/design/bridge/shader-fill-preview.bridge.ts +78 -0
  131. package/corpus/templates/design/app/components/design/bridge/tsconfig.json +17 -0
  132. package/corpus/templates/design/app/components/design/bridge/tweak.bridge.ts +28 -0
  133. package/corpus/templates/design/app/components/design/bridge/zoom.bridge.ts +43 -0
  134. package/corpus/templates/design/app/components/design/inspector/DesignColorPicker.tsx +45 -16
  135. package/corpus/templates/design/app/components/design/inspector/ImageFillControls.tsx +88 -9
  136. package/corpus/templates/design/app/components/editor/PromptDialog.tsx +94 -9
  137. package/corpus/templates/design/app/components/layout/Layout.tsx +19 -3
  138. package/corpus/templates/design/app/components/layout/Sidebar.tsx +1 -1
  139. package/corpus/templates/design/app/global.css +7 -0
  140. package/corpus/templates/design/app/hooks/use-navigation-state.ts +23 -0
  141. package/corpus/templates/design/app/i18n/zh-TW.ts +22 -0
  142. package/corpus/templates/design/app/i18n-data.ts +369 -0
  143. package/corpus/templates/design/app/lib/pending-generation.ts +1 -0
  144. package/corpus/templates/design/app/pages/DesignEditor.tsx +3024 -616
  145. package/corpus/templates/design/app/pages/Index.tsx +5 -1
  146. package/corpus/templates/design/changelog/2026-06-30-applying-the-one-click-fix-for-a-small-tap-target-accessibil.md +6 -0
  147. package/corpus/templates/design/changelog/2026-06-30-canvas-creation-screen-dragging-undo-redo-and-image-fill-edi.md +6 -0
  148. package/corpus/templates/design/changelog/2026-06-30-component-prop-edits-and-shader-fills-now-preserve-rapid-sam.md +6 -0
  149. package/corpus/templates/design/changelog/2026-06-30-design-can-browse-figma-library-components-and-insert-them-i.md +6 -0
  150. package/corpus/templates/design/changelog/2026-06-30-design-now-has-a-figma-style-left-rail-for-file-agent-assets.md +6 -0
  151. package/corpus/templates/design/changelog/2026-06-30-design-now-has-native-components-embedded-media-and-figma-im.md +6 -0
  152. package/corpus/templates/design/changelog/2026-06-30-design-preview-now-includes-a-publish-app-waitlist-option-fr.md +6 -0
  153. package/corpus/templates/design/changelog/2026-06-30-design-s-left-rail-now-matches-the-sidebar-chrome-and-uses-t.md +6 -0
  154. package/corpus/templates/design/changelog/2026-06-30-design-s-tools-create-menu-now-stays-compact-instead-of-rend.md +6 -0
  155. package/corpus/templates/design/changelog/2026-06-30-design-starter-prompts-now-begin-generating-immediately-and-.md +6 -0
  156. package/corpus/templates/design/changelog/2026-06-30-design-token-edits-now-stay-visible-in-previews-and-token-li.md +6 -0
  157. package/corpus/templates/design/changelog/2026-06-30-design-tools-now-use-a-quieter-figma-style-list-layout.md +6 -0
  158. package/corpus/templates/design/changelog/2026-06-30-drawing-rectangles-on-the-all-screens-canvas-no-longer-flash.md +6 -0
  159. package/corpus/templates/design/changelog/2026-06-30-fixed-code-native-design-studio-edits-so-component-props-mot.md +6 -0
  160. package/corpus/templates/design/changelog/2026-06-30-fixed-visual-editing-hover-overlays-and-spacing-handles-so-s.md +6 -0
  161. package/corpus/templates/design/changelog/2026-06-30-motion-edits-now-save-automatically-without-a-separate-css-a.md +6 -0
  162. package/corpus/templates/design/changelog/2026-06-30-motion-timelines-now-reopen-as-editable-tracks-after-writing.md +6 -0
  163. package/corpus/templates/design/changelog/2026-06-30-new-design-prompts-with-uploaded-screenshots-work-reliably-o.md +6 -0
  164. package/corpus/templates/design/changelog/2026-06-30-screen-previews-in-all-screens-view-now-keep-rounded-outline.md +6 -0
  165. package/corpus/templates/design/changelog/2026-06-30-selection-outlines-now-sit-flush-on-rectangles-drawn-directl.md +6 -0
  166. package/corpus/templates/design/changelog/2026-06-30-share-options-use-a-tighter-design-editor-popover-with-compa.md +6 -0
  167. package/corpus/templates/design/changelog/2026-06-30-the-collapsed-motion-panel-now-stays-tucked-under-the-left-s.md +6 -0
  168. package/corpus/templates/design/changelog/2026-06-30-the-design-inspector-now-shows-states-and-review-in-a-tighte.md +6 -0
  169. package/corpus/templates/design/changelog/2026-06-30-the-sidebar-keeps-the-organization-picker-space-stable-while.md +6 -0
  170. package/corpus/templates/design/changelog/2026-06-30-tokens-can-now-be-imported-from-pasted-notes-code-files-fold.md +6 -0
  171. package/corpus/templates/design/e2e/global-setup.ts +94 -2
  172. package/corpus/templates/design/e2e/helpers.ts +168 -65
  173. package/corpus/templates/design/package.json +3 -1
  174. package/corpus/templates/design/server/db/schema.ts +23 -0
  175. package/corpus/templates/design/server/handlers/uploads.ts +22 -1
  176. package/corpus/templates/design/server/lib/provider-api.ts +7 -4
  177. package/corpus/templates/design/server/lib/verify-write-grant.ts +108 -0
  178. package/corpus/templates/design/server/plugins/db.ts +39 -0
  179. package/corpus/templates/design/server/register-secrets.ts +38 -0
  180. package/corpus/templates/design/shared/board-file.ts +228 -0
  181. package/corpus/templates/design/shared/board-objects.ts +288 -0
  182. package/corpus/templates/design/shared/code-layer.ts +52 -0
  183. package/corpus/templates/design/shared/component-model.ts +35 -0
  184. package/corpus/templates/design/shared/motion-compiler.ts +137 -15
  185. package/corpus/templates/design/shared/motion-timeline.ts +2 -2
  186. package/corpus/templates/design/shared/resolve-tweaks.ts +32 -9
  187. package/corpus/templates/design/tsconfig.json +2 -1
  188. package/corpus/templates/slides/AGENTS.md +9 -0
  189. package/corpus/templates/slides/app/components/editor/EditorToolbar.tsx +4 -0
  190. package/corpus/templates/slides/app/components/editor/ExportMenu.tsx +4 -24
  191. package/corpus/templates/slides/app/lib/export-pdf-client.ts +29 -20
  192. package/corpus/templates/slides/app/lib/export-pptx-client.ts +365 -0
  193. package/corpus/templates/slides/app/pages/DeckEditor.tsx +12 -9
  194. package/corpus/templates/slides/app/vite-env.d.ts +18 -0
  195. package/corpus/templates/slides/changelog/2026-06-30-powerpoint-downloads-now-preserve-the-rendered-slide-layout-.md +6 -0
  196. package/corpus/templates/slides/changelog/2026-06-30-unavailable-decks-open-in-a-cleaner-full-height-centered-sta.md +6 -0
  197. package/corpus/templates/slides/package.json +1 -0
  198. package/corpus/templates/slides/vite.config.ts +1 -0
  199. package/dist/agent/production-agent.d.ts.map +1 -1
  200. package/dist/agent/production-agent.js +94 -10
  201. package/dist/agent/production-agent.js.map +1 -1
  202. package/dist/cli/design-connect.d.ts +25 -0
  203. package/dist/cli/design-connect.d.ts.map +1 -1
  204. package/dist/cli/design-connect.js +357 -18
  205. package/dist/cli/design-connect.js.map +1 -1
  206. package/dist/client/AssistantChat.d.ts +14 -0
  207. package/dist/client/AssistantChat.d.ts.map +1 -1
  208. package/dist/client/AssistantChat.js +115 -22
  209. package/dist/client/AssistantChat.js.map +1 -1
  210. package/dist/client/ConnectBuilderCard.d.ts.map +1 -1
  211. package/dist/client/ConnectBuilderCard.js +1 -0
  212. package/dist/client/ConnectBuilderCard.js.map +1 -1
  213. package/dist/client/chat/index.d.ts +1 -1
  214. package/dist/client/chat/index.d.ts.map +1 -1
  215. package/dist/client/chat/index.js +1 -1
  216. package/dist/client/chat/index.js.map +1 -1
  217. package/dist/client/chat/run-recovery.d.ts.map +1 -1
  218. package/dist/client/chat/run-recovery.js +5 -5
  219. package/dist/client/chat/run-recovery.js.map +1 -1
  220. package/dist/client/chat-view-transition.d.ts +6 -0
  221. package/dist/client/chat-view-transition.d.ts.map +1 -1
  222. package/dist/client/chat-view-transition.js +23 -2
  223. package/dist/client/chat-view-transition.js.map +1 -1
  224. package/dist/client/composer/PromptComposer.d.ts.map +1 -1
  225. package/dist/client/composer/PromptComposer.js +3 -2
  226. package/dist/client/composer/PromptComposer.js.map +1 -1
  227. package/dist/client/index.d.ts +1 -1
  228. package/dist/client/index.d.ts.map +1 -1
  229. package/dist/client/index.js +1 -1
  230. package/dist/client/index.js.map +1 -1
  231. package/dist/client/org/OrgSwitcher.d.ts.map +1 -1
  232. package/dist/client/org/OrgSwitcher.js +11 -4
  233. package/dist/client/org/OrgSwitcher.js.map +1 -1
  234. package/dist/client/sharing/ShareButton.js +3 -3
  235. package/dist/client/sharing/ShareButton.js.map +1 -1
  236. package/dist/client/sse-event-processor.d.ts.map +1 -1
  237. package/dist/client/sse-event-processor.js +10 -0
  238. package/dist/client/sse-event-processor.js.map +1 -1
  239. package/dist/client/use-agent-chat-home-handoff.d.ts +8 -2
  240. package/dist/client/use-agent-chat-home-handoff.d.ts.map +1 -1
  241. package/dist/client/use-agent-chat-home-handoff.js +20 -6
  242. package/dist/client/use-agent-chat-home-handoff.js.map +1 -1
  243. package/dist/collab/awareness.d.ts +2 -2
  244. package/dist/collab/awareness.d.ts.map +1 -1
  245. package/dist/collab/routes.d.ts +2 -2
  246. package/dist/db/client.d.ts +1 -0
  247. package/dist/db/client.d.ts.map +1 -1
  248. package/dist/db/client.js +28 -2
  249. package/dist/db/client.js.map +1 -1
  250. package/dist/notifications/routes.d.ts +3 -3
  251. package/dist/observability/routes.d.ts +3 -3
  252. package/dist/progress/routes.d.ts +1 -1
  253. package/dist/provider-api/index.d.ts +5 -4
  254. package/dist/provider-api/index.d.ts.map +1 -1
  255. package/dist/provider-api/index.js +28 -0
  256. package/dist/provider-api/index.js.map +1 -1
  257. package/dist/resources/handlers.d.ts +3 -3
  258. package/dist/server/agent-engine-api-key-route.d.ts +1 -1
  259. package/dist/server/core-routes-plugin.d.ts +25 -0
  260. package/dist/server/core-routes-plugin.d.ts.map +1 -1
  261. package/dist/server/core-routes-plugin.js +43 -18
  262. package/dist/server/core-routes-plugin.js.map +1 -1
  263. package/dist/server/transcribe-voice.d.ts +1 -1
  264. package/dist/styles/agent-native.css +54 -0
  265. package/dist/usage/store.js +2 -2
  266. package/dist/usage/store.js.map +1 -1
  267. package/package.json +1 -1
package/corpus/README.md CHANGED
@@ -28,4 +28,4 @@ rg -n "defineAction|useActionQuery" node_modules/@agent-native/core/corpus
28
28
  ## Generated Counts
29
29
 
30
30
  - core files: 2043
31
- - template files: 4719
31
+ - template files: 4801
@@ -1,5 +1,58 @@
1
1
  # @agent-native/core
2
2
 
3
+ ## 0.81.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 3164729: Add secure localhost bridge write endpoints to the design connect bridge.
8
+
9
+ `startDesignConnectBridge` now mints a cryptographically random per-session
10
+ `bridgeToken` (exposed on the returned `DesignConnectBridge` object) and
11
+ serves three new token-gated POST endpoints on the same localhost-only server:
12
+ - `POST /read-file` — reads any file within the root (no extension restriction)
13
+ - `POST /write-file` — writes `.html`, `.htm`, or `.css` files within the root
14
+ - `POST /apply-edit` — patches an existing file via `{search, replace}` or
15
+ replaces it entirely via `{content}`
16
+
17
+ All three endpoints require the `X-Bridge-Token` header to match the minted
18
+ token (constant-time comparison). Path confinement is enforced via
19
+ `fs.realpath` on both the root and the target parent directory, blocking
20
+ directory traversal and symlink escape attacks. The token is never serialised
21
+ into the public `/manifest.json` response.
22
+
23
+ The `DesignConnectManifest` capabilities array now marks `readFile`,
24
+ `applyEdit`, and `writeFile` as `"available"` (previously `"planned"`).
25
+
26
+ ### Patch Changes
27
+
28
+ - 3164729: Builder waitlist submissions now include a use-case field so Forms and Slack routing can distinguish background coding requests from Design publish requests.
29
+ - 3164729: Fix bridge token registration so design localhost write-back works end-to-end.
30
+
31
+ `registerConnectionWithServer` is a new exported function that POSTs the
32
+ bridge's real `bridgeToken` (minted by `startDesignConnectBridge`) to the
33
+ design app's `connect-localhost` action endpoint on startup. This stores the
34
+ token on the `designLocalhostConnections` row so `grant-localhost-write-consent`
35
+ can read it instead of minting an unrelated token, which previously caused every
36
+ bridge write to return 401.
37
+
38
+ `DesignConnectArgs` gains an optional `appUrl` field (populated by the new
39
+ `--app-url <url>` CLI flag or the `AGENT_NATIVE_URL` / `DESIGN_APP_URL` env
40
+ vars) that controls where self-registration is sent. Registration is
41
+ best-effort: if no app URL is configured or the request fails, the bridge
42
+ continues running normally.
43
+
44
+ - 3164729: Register Figma as a Design provider API so Design actions can browse and render Figma library components through scoped `FIGMA_ACCESS_TOKEN` credentials.
45
+ - 3164729: Make the Connect AI setup card adapt to narrow chat sidebars with container queries.
46
+ - 3164729: Keep reserved organization switcher slots stable with a disabled loading placeholder.
47
+ - 3164729: Redirect relative PGlite data directories to writable `/tmp` paths on serverless runtimes.
48
+ - 3164729: Make the default shared share button outline trigger transparent at rest.
49
+
50
+ ## 0.80.11
51
+
52
+ ### Patch Changes
53
+
54
+ - abf0681: Stop chat reconnect from falsely reporting "stopped before finishing" on long but healthy runs. The active-run reconnect now treats the stuck threshold as an idle deadline that resets on every streamed event, instead of a one-shot cap on total reconnect duration — so a long-running tool (e.g. image generation) that keeps emitting activity heartbeats is never aborted with a no-progress error just for running longer than the threshold. Also surfaces active tool progress while reconnecting, and waits for interrupted write-tool results before re-running them so long-running tools do not appear stopped or duplicate work.
55
+
3
56
  ## 0.80.10
4
57
 
5
58
  ### Patch Changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-native/core",
3
- "version": "0.80.10",
3
+ "version": "0.81.0",
4
4
  "description": "Framework for agent-native application development — where AI agents and UI share SQL state, actions, and context",
5
5
  "homepage": "https://github.com/BuilderIO/agent-native#readme",
6
6
  "bugs": {
@@ -2171,6 +2171,63 @@ function toolCallCacheKey(toolName: string, input: unknown): string {
2171
2171
  return `${toolName}:${stableStringify(normalizeToolCallInputForHistory(input))}`;
2172
2172
  }
2173
2173
 
2174
+ const INTERRUPTED_TOOL_LEDGER_POLL_MS =
2175
+ process.env.NODE_ENV === "test" ? 0 : 2_000;
2176
+
2177
+ async function waitForInterruptedToolLedgerEntry(opts: {
2178
+ threadId: string;
2179
+ toolKey: string;
2180
+ toolName: string;
2181
+ timeoutMs: number;
2182
+ signal: AbortSignal;
2183
+ send: (event: AgentChatEvent) => void;
2184
+ }): Promise<string | null> {
2185
+ const pollMs = INTERRUPTED_TOOL_LEDGER_POLL_MS;
2186
+ // Wait up to the tool's OWN declared timeout — the abandoned zombie can keep
2187
+ // running that long (e.g. a 12-minute image generation, whose provider keeps
2188
+ // generating after the run aborts), and giving up early re-runs the same
2189
+ // write tool while the original is still in flight, duplicating work and
2190
+ // double-charging. A flat sub-tool-timeout cap (previously 5 min) silently
2191
+ // truncated long tools. The run's AbortSignal still bounds this to the run's
2192
+ // remaining budget: when the run is cut off, the poll returns null and the
2193
+ // re-dispatch hits the already-aborted signal instead of launching a real
2194
+ // second call, so the wait never outlives the run.
2195
+ const maxWaitMs =
2196
+ process.env.NODE_ENV === "test" ? 1 : Math.max(0, opts.timeoutMs);
2197
+ const maxPolls =
2198
+ process.env.NODE_ENV === "test"
2199
+ ? 3
2200
+ : Math.max(1, Math.ceil(maxWaitMs / Math.max(1, pollMs)) + 1);
2201
+
2202
+ for (let attempt = 0; attempt < maxPolls; attempt++) {
2203
+ if (opts.signal.aborted) return null;
2204
+ const ledgerResult = await readLedgerEntry(opts.threadId, opts.toolKey);
2205
+ if (ledgerResult !== null) return ledgerResult;
2206
+
2207
+ if (attempt >= maxPolls - 1) break;
2208
+ opts.send({
2209
+ type: "activity",
2210
+ tool: opts.toolName,
2211
+ label: `Waiting for previous ${opts.toolName} result.`,
2212
+ });
2213
+ if (pollMs <= 0) continue;
2214
+ await new Promise<void>((resolve) => {
2215
+ let settled = false;
2216
+ const done = () => {
2217
+ if (settled) return;
2218
+ settled = true;
2219
+ clearTimeout(timer);
2220
+ opts.signal.removeEventListener("abort", done);
2221
+ resolve();
2222
+ };
2223
+ const timer = setTimeout(done, pollMs);
2224
+ opts.signal.addEventListener("abort", done, { once: true });
2225
+ });
2226
+ }
2227
+
2228
+ return null;
2229
+ }
2230
+
2174
2231
  function normalizeToolErrorForBreaker(error: string): string {
2175
2232
  return error.replace(/\s+/g, " ").trim();
2176
2233
  }
@@ -3241,6 +3298,17 @@ export async function runAgentLoop(opts: {
3241
3298
  };
3242
3299
  }
3243
3300
 
3301
+ const DEFAULT_TOOL_RESULT_CHARS = 50_000;
3302
+ const DEFAULT_TOOL_TIMEOUT_MS = 60_000;
3303
+ const toolTimeoutMs =
3304
+ actionEntry.timeoutMs ??
3305
+ opts.toolLimits?.timeoutMs ??
3306
+ DEFAULT_TOOL_TIMEOUT_MS;
3307
+ const toolMaxResultChars =
3308
+ actionEntry.maxResultChars ??
3309
+ opts.toolLimits?.maxResultChars ??
3310
+ DEFAULT_TOOL_RESULT_CHARS;
3311
+
3244
3312
  // TOOL-CALL JOURNAL HARD-BLOCK (resume safety, tool-layer enforcement).
3245
3313
  // The prompt-level resume journal already TELLS a resuming model not to
3246
3314
  // re-run completed tool calls; this enforces it at the tool layer so a
@@ -3291,17 +3359,23 @@ export async function runAgentLoop(opts: {
3291
3359
  // previous invocation's zombie actually completed and wrote its result to
3292
3360
  // the durable ledger. If so, return the ledger result without re-executing
3293
3361
  // (prevents the duplicate side effect) and skip counting it toward the
3294
- // interruption budget.
3362
+ // interruption budget. A just-abandoned long tool may need a short grace
3363
+ // period before its detached promise writes the ledger, so wait while the
3364
+ // current run still has budget instead of immediately re-running it.
3295
3365
  if (!actionEntry.readOnly) {
3296
3366
  const writeCacheKey = toolCallCacheKey(toolCall.name, toolCall.input);
3297
3367
  const priorInterruptions =
3298
3368
  writeToolInterruptions.get(writeCacheKey) ?? 0;
3299
3369
 
3300
3370
  if (priorInterruptions > 0 && opts.threadId) {
3301
- const ledgerResult = await readLedgerEntry(
3302
- opts.threadId,
3303
- writeCacheKey,
3304
- );
3371
+ const ledgerResult = await waitForInterruptedToolLedgerEntry({
3372
+ threadId: opts.threadId,
3373
+ toolKey: writeCacheKey,
3374
+ toolName: toolCall.name,
3375
+ timeoutMs: toolTimeoutMs,
3376
+ signal,
3377
+ send,
3378
+ });
3305
3379
  if (ledgerResult !== null) {
3306
3380
  // Zombie completed — recover the real result without re-executing.
3307
3381
  const result =
@@ -3359,6 +3433,25 @@ export async function runAgentLoop(opts: {
3359
3433
  }
3360
3434
  }
3361
3435
 
3436
+ // Stop BEFORE emitting tool_start if the run was already aborted —
3437
+ // typically because the ledger wait above polled for minutes and the soft
3438
+ // timeout fired meanwhile. Emitting tool_start/tool_done here would leave a
3439
+ // bogus interrupted pair in the transcript for a tool that never re-ran,
3440
+ // and re-invoking would spawn a duplicate zombie. Return the interrupted
3441
+ // marker (no events) so the next continuation recovers via the ledger.
3442
+ // (A second guard inside the try below still covers an abort that lands in
3443
+ // the tiny sync window between here and the action invocation.)
3444
+ if (signal.aborted) {
3445
+ recordToolResult(INTERRUPTED_TOOL_RESULT_MARKER, false);
3446
+ return {
3447
+ type: "tool-result" as const,
3448
+ toolCallId: toolCall.id,
3449
+ toolName: toolCall.name,
3450
+ toolInput: wireToolInput,
3451
+ content: INTERRUPTED_TOOL_RESULT_MARKER,
3452
+ };
3453
+ }
3454
+
3362
3455
  send({
3363
3456
  type: "tool_start",
3364
3457
  tool: toolCall.name,
@@ -3427,22 +3520,22 @@ export async function runAgentLoop(opts: {
3427
3520
  };
3428
3521
  }
3429
3522
 
3430
- const DEFAULT_TOOL_RESULT_CHARS = 50_000;
3431
- const DEFAULT_TOOL_TIMEOUT_MS = 60_000;
3432
- const toolTimeoutMs =
3433
- actionEntry.timeoutMs ??
3434
- opts.toolLimits?.timeoutMs ??
3435
- DEFAULT_TOOL_TIMEOUT_MS;
3436
- const toolMaxResultChars =
3437
- actionEntry.maxResultChars ??
3438
- opts.toolLimits?.maxResultChars ??
3439
- DEFAULT_TOOL_RESULT_CHARS;
3440
3523
  let result: string;
3441
3524
  let isError = false;
3442
3525
  let mcpApp:
3443
3526
  | import("../mcp-client/app-result.js").AgentMcpAppPayload
3444
3527
  | undefined;
3445
3528
  try {
3529
+ // The run may have been aborted while we waited above for an
3530
+ // interrupted tool's ledger result (the wait can poll for minutes).
3531
+ // Re-check before invoking the action: starting it now would spawn a
3532
+ // fresh zombie execution — a duplicate side effect / double charge —
3533
+ // which the ledger-recovery path exists to prevent. The Promise.race
3534
+ // "Run aborted" leg below only rejects AFTER the action is invoked, so
3535
+ // it cannot guard this. Throw here instead, handled like any abort.
3536
+ if (signal.aborted) {
3537
+ throw new Error("Run aborted");
3538
+ }
3446
3539
  const timeoutSignal = AbortSignal.timeout(toolTimeoutMs);
3447
3540
  const actionUserEmail = opts.ownerEmail ?? getRequestUserEmail();
3448
3541
  const actionOrgId = opts.orgId ?? getRequestOrgId() ?? null;