@agent-native/core 0.90.3 → 0.90.5

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 (256) hide show
  1. package/bin/agent-native.js +25 -3
  2. package/corpus/README.md +1 -1
  3. package/corpus/core/CHANGELOG.md +17 -0
  4. package/corpus/core/bin/agent-native.js +25 -3
  5. package/corpus/core/package.json +1 -1
  6. package/corpus/core/src/agent/durable-background.ts +18 -18
  7. package/corpus/core/src/agent/engine/ai-sdk-engine.ts +8 -2
  8. package/corpus/core/src/agent/engine/anthropic-engine.ts +11 -1
  9. package/corpus/core/src/agent/engine/index.ts +1 -0
  10. package/corpus/core/src/agent/engine/registry.ts +63 -2
  11. package/corpus/core/src/agent/production-agent.ts +22 -11
  12. package/corpus/core/src/agent/run-manager.ts +17 -6
  13. package/corpus/core/src/agent/run-store.ts +16 -11
  14. package/corpus/core/src/cli/create.ts +35 -0
  15. package/corpus/core/src/cli/design-connect.ts +263 -1
  16. package/corpus/core/src/cli/index.ts +84 -7
  17. package/corpus/core/src/cli/workspacify.ts +34 -0
  18. package/corpus/core/src/client/KeepTabOpenNotice.tsx +20 -15
  19. package/corpus/core/src/client/RunStuckBanner.tsx +14 -13
  20. package/corpus/core/src/client/agent-chat-adapter.ts +28 -17
  21. package/corpus/core/src/client/history/VersionHistoryPanel.tsx +77 -47
  22. package/corpus/core/src/client/history/index.ts +3 -0
  23. package/corpus/core/src/client/history/use-history.ts +28 -0
  24. package/corpus/core/src/client/index.ts +8 -0
  25. package/corpus/core/src/client/review/index.ts +5 -0
  26. package/corpus/core/src/client/review/use-review.ts +40 -2
  27. package/corpus/core/src/client/use-run-stuck-detection.ts +8 -5
  28. package/corpus/core/src/history/actions/create-resource-version.ts +11 -8
  29. package/corpus/core/src/history/index.ts +0 -1
  30. package/corpus/core/src/history/registry.ts +24 -12
  31. package/corpus/core/src/history/store.ts +84 -53
  32. package/corpus/core/src/review/actions/consume-review-feedback.ts +15 -5
  33. package/corpus/core/src/review/actions/delete-review-comment.ts +15 -3
  34. package/corpus/core/src/review/actions/resolve-review-thread.ts +12 -5
  35. package/corpus/core/src/review/index.ts +0 -5
  36. package/corpus/core/src/review/registry.ts +24 -12
  37. package/corpus/core/src/review/store.ts +10 -7
  38. package/corpus/core/src/server/agent-chat-plugin.ts +6 -0
  39. package/corpus/core/src/server/credential-provider.ts +13 -3
  40. package/corpus/templates/assets/actions/_preset-skeleton-validation.ts +11 -11
  41. package/corpus/templates/assets/actions/generate-image.ts +64 -28
  42. package/corpus/templates/assets/app/components/generation/GenerationResults.tsx +1 -1
  43. package/corpus/templates/assets/app/routes/brand-kits.$id_.presets.$presetId.tsx +91 -74
  44. package/corpus/templates/assets/server/lib/generation.ts +29 -4
  45. package/corpus/templates/assets/server/lib/image-processing.ts +131 -0
  46. package/corpus/templates/calendar/.agents/skills/event-management/SKILL.md +24 -2
  47. package/corpus/templates/calendar/AGENTS.md +3 -0
  48. package/corpus/templates/calendar/actions/create-event.ts +8 -34
  49. package/corpus/templates/calendar/actions/event-action-helpers.ts +52 -0
  50. package/corpus/templates/calendar/actions/manage-event-draft.ts +7 -34
  51. package/corpus/templates/calendar/actions/update-event.ts +10 -23
  52. package/corpus/templates/calendar/app/components/calendar/AttendeeAutocomplete.tsx +47 -0
  53. package/corpus/templates/calendar/app/components/calendar/CreateEventDialog.tsx +23 -0
  54. package/corpus/templates/calendar/app/components/calendar/EventAttendeesSection.tsx +59 -2
  55. package/corpus/templates/calendar/app/components/calendar/EventDetailPanel.tsx +40 -1
  56. package/corpus/templates/calendar/app/components/calendar/EventDetailPopover.tsx +34 -1
  57. package/corpus/templates/calendar/app/hooks/use-events.ts +6 -0
  58. package/corpus/templates/calendar/app/i18n/zh-TW.ts +4 -0
  59. package/corpus/templates/calendar/app/i18n-data.ts +40 -0
  60. package/corpus/templates/calendar/changelog/2026-07-07-you-can-mark-event-guests-as-optional-while-inviting-them-or.md +6 -0
  61. package/corpus/templates/calendar/server/handlers/events.ts +1 -0
  62. package/corpus/templates/calendar/server/lib/google-calendar.ts +4 -0
  63. package/corpus/templates/calendar/server/plugins/agent-chat.ts +1 -1
  64. package/corpus/templates/calendar/shared/api.ts +2 -0
  65. package/corpus/templates/clips/.agents/skills/ai-video-tools/SKILL.md +29 -3
  66. package/corpus/templates/clips/actions/generate-workflow.ts +19 -8
  67. package/corpus/templates/clips/actions/get-clips-ai-prefs.ts +36 -0
  68. package/corpus/templates/clips/actions/lib/clips-ai-prefs.ts +28 -0
  69. package/corpus/templates/clips/actions/regenerate-chapters.ts +21 -7
  70. package/corpus/templates/clips/actions/regenerate-summary.ts +26 -8
  71. package/corpus/templates/clips/actions/regenerate-title.ts +44 -7
  72. package/corpus/templates/clips/actions/update-clips-ai-prefs.ts +50 -0
  73. package/corpus/templates/clips/app/components/meetings/meeting-card.tsx +7 -2
  74. package/corpus/templates/clips/app/hooks/use-auto-title.ts +25 -10
  75. package/corpus/templates/clips/app/i18n/ar-SA.ts +28 -6
  76. package/corpus/templates/clips/app/i18n/de-DE.ts +28 -6
  77. package/corpus/templates/clips/app/i18n/en-US.ts +29 -6
  78. package/corpus/templates/clips/app/i18n/es-ES.ts +29 -6
  79. package/corpus/templates/clips/app/i18n/fr-FR.ts +30 -6
  80. package/corpus/templates/clips/app/i18n/hi-IN.ts +26 -6
  81. package/corpus/templates/clips/app/i18n/ja-JP.ts +27 -6
  82. package/corpus/templates/clips/app/i18n/ko-KR.ts +28 -6
  83. package/corpus/templates/clips/app/i18n/pt-BR.ts +28 -6
  84. package/corpus/templates/clips/app/i18n/zh-CN.ts +26 -6
  85. package/corpus/templates/clips/app/i18n/zh-TW.ts +25 -6
  86. package/corpus/templates/clips/app/routes/_app.meetings._index.tsx +73 -0
  87. package/corpus/templates/clips/app/routes/_app.settings._index.tsx +1 -0
  88. package/corpus/templates/clips/app/routes/r.$recordingId.tsx +70 -2
  89. package/corpus/templates/clips/changelog/2026-07-07-ai-tools-can-include-the-full-video-not-just-the-transcript-.md +6 -0
  90. package/corpus/templates/clips/changelog/2026-07-07-clips-desktop-now-surfaces-meetings-and-dictate-directly-in-.md +6 -0
  91. package/corpus/templates/clips/changelog/2026-07-07-meeting-notes-now-explain-exactly-how-to-start-granola-style.md +6 -0
  92. package/corpus/templates/clips/changelog/2026-07-07-meeting-start-alerts-now-include-separate-start-notes-and-jo.md +6 -0
  93. package/corpus/templates/clips/changelog/2026-07-07-recordings-start-more-predictably-and-newly-saved-clips-refr.md +6 -0
  94. package/corpus/templates/clips/chrome-extension/public/manifest.json +1 -1
  95. package/corpus/templates/clips/desktop/src/app.tsx +435 -105
  96. package/corpus/templates/clips/desktop/src/lib/recorder.ts +27 -21
  97. package/corpus/templates/clips/desktop/src/overlays/meeting-notification.tsx +23 -22
  98. package/corpus/templates/clips/desktop/src/styles.css +167 -2
  99. package/corpus/templates/clips/desktop/src-tauri/src/native_screen.rs +1 -1
  100. package/corpus/templates/clips/desktop/src-tauri/src/notifications.rs +3 -7
  101. package/corpus/templates/clips/desktop/src-tauri/src/tray_meetings.rs +5 -4
  102. package/corpus/templates/clips/server/routes/_agent-native/clips/user-prefs.put.ts +16 -8
  103. package/corpus/templates/clips/shared/clips-ai-prefs.ts +81 -0
  104. package/corpus/templates/content/AGENTS.md +1 -0
  105. package/corpus/templates/content/actions/_database-source-utils.ts +73 -8
  106. package/corpus/templates/content/actions/_database-utils.ts +2 -1
  107. package/corpus/templates/content/actions/prepare-builder-source-review.ts +20 -1
  108. package/corpus/templates/content/actions/stage-builder-source-bulk-update.ts +663 -0
  109. package/corpus/templates/content/app/components/editor/DocumentProperties.tsx +33 -7
  110. package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +53 -4
  111. package/corpus/templates/content/app/components/editor/database/settings.tsx +24 -0
  112. package/corpus/templates/content/app/hooks/use-content-database.ts +70 -1
  113. package/corpus/templates/content/app/hooks/use-document-properties.ts +63 -5
  114. package/corpus/templates/content/app/i18n/zh-TW.ts +3 -0
  115. package/corpus/templates/content/app/i18n-data.ts +31 -0
  116. package/corpus/templates/content/changelog/2026-07-01-builder-source-rows-can-be-staged-in-bulk-with-a-reviewable.md +6 -0
  117. package/corpus/templates/content/changelog/2026-07-07-builder-backed-database-fields-now-edit-like-normal-content-fields.md +6 -0
  118. package/corpus/templates/content/parity/matrix.md +24 -24
  119. package/corpus/templates/content/parity/matrix.ts +2 -0
  120. package/corpus/templates/content/shared/api.ts +59 -4
  121. package/corpus/templates/design/.agents/skills/visual-edit/SKILL.md +16 -1
  122. package/corpus/templates/design/actions/add-localhost-screens.ts +1 -0
  123. package/corpus/templates/design/actions/connect-localhost.ts +26 -3
  124. package/corpus/templates/design/actions/open-visual-edit.ts +4 -37
  125. package/corpus/templates/design/app/components/design/DesignCanvas.tsx +362 -12
  126. package/corpus/templates/design/app/components/design/bridge/editor-chrome.bridge.ts +89 -14
  127. package/corpus/templates/design/app/components/design/bridge-security.ts +7 -1
  128. package/corpus/templates/design/app/components/design/multi-screen/types.ts +1 -1
  129. package/corpus/templates/design/app/i18n/zh-TW.ts +3 -0
  130. package/corpus/templates/design/app/i18n-data.ts +41 -0
  131. package/corpus/templates/design/changelog/2026-07-07-local-visual-edit-keeps-bridge-access-when-opening-previousl.md +6 -0
  132. package/corpus/templates/design/changelog/2026-07-07-local-visual-edit-now-keeps-the-live-app-connection-authenti.md +6 -0
  133. package/corpus/templates/design/changelog/2026-07-07-local-visual-edit-uses-live-app-iframes-for-click-to-edit-pr.md +6 -0
  134. package/dist/agent/durable-background.d.ts +12 -12
  135. package/dist/agent/durable-background.js +18 -18
  136. package/dist/agent/durable-background.js.map +1 -1
  137. package/dist/agent/engine/ai-sdk-engine.d.ts.map +1 -1
  138. package/dist/agent/engine/ai-sdk-engine.js +8 -2
  139. package/dist/agent/engine/ai-sdk-engine.js.map +1 -1
  140. package/dist/agent/engine/anthropic-engine.d.ts.map +1 -1
  141. package/dist/agent/engine/anthropic-engine.js +11 -1
  142. package/dist/agent/engine/anthropic-engine.js.map +1 -1
  143. package/dist/agent/engine/index.d.ts +1 -1
  144. package/dist/agent/engine/index.d.ts.map +1 -1
  145. package/dist/agent/engine/index.js +1 -1
  146. package/dist/agent/engine/index.js.map +1 -1
  147. package/dist/agent/engine/registry.d.ts +14 -0
  148. package/dist/agent/engine/registry.d.ts.map +1 -1
  149. package/dist/agent/engine/registry.js +56 -2
  150. package/dist/agent/engine/registry.js.map +1 -1
  151. package/dist/agent/production-agent.d.ts +2 -2
  152. package/dist/agent/production-agent.d.ts.map +1 -1
  153. package/dist/agent/production-agent.js +18 -11
  154. package/dist/agent/production-agent.js.map +1 -1
  155. package/dist/agent/run-manager.d.ts +7 -1
  156. package/dist/agent/run-manager.d.ts.map +1 -1
  157. package/dist/agent/run-manager.js +6 -1
  158. package/dist/agent/run-manager.js.map +1 -1
  159. package/dist/agent/run-store.d.ts +1 -1
  160. package/dist/agent/run-store.d.ts.map +1 -1
  161. package/dist/agent/run-store.js +15 -10
  162. package/dist/agent/run-store.js.map +1 -1
  163. package/dist/cli/create.d.ts.map +1 -1
  164. package/dist/cli/create.js +31 -0
  165. package/dist/cli/create.js.map +1 -1
  166. package/dist/cli/design-connect.d.ts.map +1 -1
  167. package/dist/cli/design-connect.js +197 -1
  168. package/dist/cli/design-connect.js.map +1 -1
  169. package/dist/cli/index.js +76 -9
  170. package/dist/cli/index.js.map +1 -1
  171. package/dist/cli/workspacify.d.ts.map +1 -1
  172. package/dist/cli/workspacify.js +30 -0
  173. package/dist/cli/workspacify.js.map +1 -1
  174. package/dist/client/KeepTabOpenNotice.d.ts +9 -10
  175. package/dist/client/KeepTabOpenNotice.d.ts.map +1 -1
  176. package/dist/client/KeepTabOpenNotice.js +8 -4
  177. package/dist/client/KeepTabOpenNotice.js.map +1 -1
  178. package/dist/client/RunStuckBanner.d.ts.map +1 -1
  179. package/dist/client/RunStuckBanner.js +14 -13
  180. package/dist/client/RunStuckBanner.js.map +1 -1
  181. package/dist/client/agent-chat-adapter.d.ts.map +1 -1
  182. package/dist/client/agent-chat-adapter.js +25 -17
  183. package/dist/client/agent-chat-adapter.js.map +1 -1
  184. package/dist/client/history/VersionHistoryPanel.d.ts +1 -1
  185. package/dist/client/history/VersionHistoryPanel.d.ts.map +1 -1
  186. package/dist/client/history/VersionHistoryPanel.js +12 -5
  187. package/dist/client/history/VersionHistoryPanel.js.map +1 -1
  188. package/dist/client/history/index.d.ts +1 -1
  189. package/dist/client/history/index.d.ts.map +1 -1
  190. package/dist/client/history/index.js +1 -1
  191. package/dist/client/history/index.js.map +1 -1
  192. package/dist/client/history/use-history.d.ts +12 -0
  193. package/dist/client/history/use-history.d.ts.map +1 -1
  194. package/dist/client/history/use-history.js +6 -0
  195. package/dist/client/history/use-history.js.map +1 -1
  196. package/dist/client/index.d.ts +2 -2
  197. package/dist/client/index.d.ts.map +1 -1
  198. package/dist/client/index.js +2 -2
  199. package/dist/client/index.js.map +1 -1
  200. package/dist/client/review/index.d.ts +1 -1
  201. package/dist/client/review/index.d.ts.map +1 -1
  202. package/dist/client/review/index.js +1 -1
  203. package/dist/client/review/index.js.map +1 -1
  204. package/dist/client/review/use-review.d.ts +23 -0
  205. package/dist/client/review/use-review.d.ts.map +1 -1
  206. package/dist/client/review/use-review.js +8 -0
  207. package/dist/client/review/use-review.js.map +1 -1
  208. package/dist/client/use-run-stuck-detection.d.ts +1 -1
  209. package/dist/client/use-run-stuck-detection.d.ts.map +1 -1
  210. package/dist/client/use-run-stuck-detection.js +6 -4
  211. package/dist/client/use-run-stuck-detection.js.map +1 -1
  212. package/dist/collab/struct-routes.d.ts +1 -1
  213. package/dist/file-upload/actions/upload-image.d.ts +1 -1
  214. package/dist/history/actions/create-resource-version.js +7 -4
  215. package/dist/history/actions/create-resource-version.js.map +1 -1
  216. package/dist/history/index.d.ts +1 -1
  217. package/dist/history/index.d.ts.map +1 -1
  218. package/dist/history/index.js +1 -1
  219. package/dist/history/index.js.map +1 -1
  220. package/dist/history/registry.d.ts.map +1 -1
  221. package/dist/history/registry.js +14 -12
  222. package/dist/history/registry.js.map +1 -1
  223. package/dist/history/store.d.ts.map +1 -1
  224. package/dist/history/store.js +74 -49
  225. package/dist/history/store.js.map +1 -1
  226. package/dist/notifications/routes.d.ts +1 -1
  227. package/dist/resources/handlers.d.ts +3 -3
  228. package/dist/review/actions/consume-review-feedback.d.ts +1 -0
  229. package/dist/review/actions/consume-review-feedback.js +8 -2
  230. package/dist/review/actions/consume-review-feedback.js.map +1 -1
  231. package/dist/review/actions/delete-review-comment.d.ts +2 -1
  232. package/dist/review/actions/delete-review-comment.js +11 -3
  233. package/dist/review/actions/delete-review-comment.js.map +1 -1
  234. package/dist/review/actions/resolve-review-thread.d.ts +2 -1
  235. package/dist/review/actions/resolve-review-thread.js +5 -2
  236. package/dist/review/actions/resolve-review-thread.js.map +1 -1
  237. package/dist/review/index.d.ts +1 -1
  238. package/dist/review/index.d.ts.map +1 -1
  239. package/dist/review/index.js +1 -1
  240. package/dist/review/index.js.map +1 -1
  241. package/dist/review/registry.d.ts.map +1 -1
  242. package/dist/review/registry.js +14 -12
  243. package/dist/review/registry.js.map +1 -1
  244. package/dist/review/store.d.ts +3 -3
  245. package/dist/review/store.d.ts.map +1 -1
  246. package/dist/review/store.js +7 -4
  247. package/dist/review/store.js.map +1 -1
  248. package/dist/server/agent-chat-plugin.d.ts.map +1 -1
  249. package/dist/server/agent-chat-plugin.js +5 -0
  250. package/dist/server/agent-chat-plugin.js.map +1 -1
  251. package/dist/server/agent-engine-api-key-route.d.ts +1 -1
  252. package/dist/server/credential-provider.d.ts +2 -0
  253. package/dist/server/credential-provider.d.ts.map +1 -1
  254. package/dist/server/credential-provider.js +13 -3
  255. package/dist/server/credential-provider.js.map +1 -1
  256. package/package.json +1 -1
@@ -604,6 +604,32 @@ declare var __DESIGN_CANVAS_BOARD_SURFACE__: boolean;
604
604
  return styles;
605
605
  }
606
606
 
607
+ var liveVisualEditOriginalInlineStyles =
608
+ typeof WeakMap !== "undefined"
609
+ ? new WeakMap<Element, Record<string, string>>()
610
+ : null;
611
+
612
+ function rememberLiveVisualEditOriginalStyles(el: Element | null): void {
613
+ if (!el || !liveVisualEditOriginalInlineStyles) return;
614
+ if (liveVisualEditOriginalInlineStyles.has(el)) return;
615
+ liveVisualEditOriginalInlineStyles.set(el, collectInlineStyles(el));
616
+ }
617
+
618
+ function originalInlineStylesForPatch(
619
+ el: Element | null,
620
+ styles: Record<string, string>,
621
+ ): Record<string, string> {
622
+ if (!el || !liveVisualEditOriginalInlineStyles) return {};
623
+ rememberLiveVisualEditOriginalStyles(el);
624
+ var original = liveVisualEditOriginalInlineStyles.get(el) || {};
625
+ var patch: Record<string, string> = {};
626
+ Object.keys(styles).forEach(function (property) {
627
+ patch[property] =
628
+ typeof original[property] === "string" ? original[property] : "";
629
+ });
630
+ return patch;
631
+ }
632
+
607
633
  function chromeColorForElement(el: Element | null): string {
608
634
  return elementLooksLikeComponent(el)
609
635
  ? "var(--design-editor-component-color)"
@@ -946,6 +972,7 @@ declare var __DESIGN_CANVAS_BOARD_SURFACE__: boolean;
946
972
  }
947
973
 
948
974
  function postElementSelect(el: Element, e?: MouseEvent): void {
975
+ rememberLiveVisualEditOriginalStyles(el);
949
976
  var message: {
950
977
  type: string;
951
978
  payload: unknown;
@@ -4455,6 +4482,7 @@ declare var __DESIGN_CANVAS_BOARD_SURFACE__: boolean;
4455
4482
  type: "visual-style-change",
4456
4483
  selector: getSelector(selectedEl),
4457
4484
  styles: styles,
4485
+ originalStyles: originalInlineStylesForPatch(selectedEl, styles),
4458
4486
  payload: getElementInfo(selectedEl),
4459
4487
  },
4460
4488
  "*",
@@ -4647,13 +4675,17 @@ declare var __DESIGN_CANVAS_BOARD_SURFACE__: boolean;
4647
4675
  setActiveDragCancel(cancelSpacingDrag);
4648
4676
  }
4649
4677
 
4650
- function postTextContentChange(el, value, html) {
4678
+ function postTextContentChange(el, value, html, originalValue, originalHtml) {
4651
4679
  (window.parent as Window).postMessage(
4652
4680
  {
4653
4681
  type: "text-content-change",
4654
4682
  selector: getSelector(el),
4655
4683
  value: value,
4656
4684
  html: html,
4685
+ originalValue:
4686
+ typeof originalValue === "string" ? originalValue : undefined,
4687
+ originalHtml:
4688
+ typeof originalHtml === "string" ? originalHtml : undefined,
4657
4689
  payload: getElementInfo(el),
4658
4690
  },
4659
4691
  "*",
@@ -5126,15 +5158,17 @@ declare var __DESIGN_CANVAS_BOARD_SURFACE__: boolean;
5126
5158
  el.style.display = "flex";
5127
5159
  el.style.flexDirection = inferred.direction;
5128
5160
  el.style.gap = inferred.gap + "px";
5161
+ var styles = {
5162
+ display: "flex",
5163
+ "flex-direction": inferred.direction,
5164
+ gap: inferred.gap + "px",
5165
+ };
5129
5166
  (window.parent as Window).postMessage(
5130
5167
  {
5131
5168
  type: "visual-style-change",
5132
5169
  selector: getSelector(container),
5133
- styles: {
5134
- display: "flex",
5135
- "flex-direction": inferred.direction,
5136
- gap: inferred.gap + "px",
5137
- },
5170
+ styles: styles,
5171
+ originalStyles: originalInlineStylesForPatch(container, styles),
5138
5172
  payload: getElementInfo(container),
5139
5173
  },
5140
5174
  "*",
@@ -5223,11 +5257,13 @@ declare var __DESIGN_CANVAS_BOARD_SURFACE__: boolean;
5223
5257
  if (!containerBackgroundIsLight(container)) return;
5224
5258
  }
5225
5259
  el.style.color = "inherit";
5260
+ var styles = { color: "inherit" };
5226
5261
  (window.parent as Window).postMessage(
5227
5262
  {
5228
5263
  type: "visual-style-change",
5229
5264
  selector: getSelector(member),
5230
- styles: { color: "inherit" },
5265
+ styles: styles,
5266
+ originalStyles: originalInlineStylesForPatch(member, styles),
5231
5267
  payload: getElementInfo(member),
5232
5268
  },
5233
5269
  "*",
@@ -6590,15 +6626,17 @@ declare var __DESIGN_CANVAS_BOARD_SURFACE__: boolean;
6590
6626
  // order — the host composes them against its synchronous same-tick
6591
6627
  // content refs exactly like multi-property style commits.
6592
6628
  memberStates.forEach(function (state) {
6629
+ var styles = {
6630
+ position: state.el.style.position,
6631
+ left: state.el.style.left,
6632
+ top: state.el.style.top,
6633
+ };
6593
6634
  (window.parent as Window).postMessage(
6594
6635
  {
6595
6636
  type: "visual-style-change",
6596
6637
  selector: getSelector(state.el),
6597
- styles: {
6598
- position: state.el.style.position,
6599
- left: state.el.style.left,
6600
- top: state.el.style.top,
6601
- },
6638
+ styles: styles,
6639
+ originalStyles: originalInlineStylesForPatch(state.el, styles),
6602
6640
  payload: getElementInfo(state.el),
6603
6641
  },
6604
6642
  "*",
@@ -6832,6 +6870,7 @@ declare var __DESIGN_CANVAS_BOARD_SURFACE__: boolean;
6832
6870
  type: "visual-style-change",
6833
6871
  selector: getSelector(resizeEl),
6834
6872
  styles: styles,
6873
+ originalStyles: originalInlineStylesForPatch(resizeEl, styles),
6835
6874
  payload: getElementInfo(resizeEl),
6836
6875
  },
6837
6876
  "*",
@@ -6902,11 +6941,13 @@ declare var __DESIGN_CANVAS_BOARD_SURFACE__: boolean;
6902
6941
  cleanupRotateDrag();
6903
6942
  hideTransformBadge();
6904
6943
  if (!rotateEl) return;
6944
+ var styles = { transform: rotateEl.style.transform };
6905
6945
  (window.parent as Window).postMessage(
6906
6946
  {
6907
6947
  type: "visual-style-change",
6908
6948
  selector: getSelector(rotateEl),
6909
- styles: { transform: rotateEl.style.transform },
6949
+ styles: styles,
6950
+ originalStyles: originalInlineStylesForPatch(rotateEl, styles),
6910
6951
  payload: getElementInfo(rotateEl),
6911
6952
  },
6912
6953
  "*",
@@ -7461,7 +7502,13 @@ declare var __DESIGN_CANVAS_BOARD_SURFACE__: boolean;
7461
7502
  var nextHtml = target.innerHTML || "";
7462
7503
  refreshOverlays();
7463
7504
  if (next !== originalText || nextHtml !== originalHtml) {
7464
- postTextContentChange(target, next, nextHtml);
7505
+ postTextContentChange(
7506
+ target,
7507
+ next,
7508
+ nextHtml,
7509
+ originalText,
7510
+ originalHtml,
7511
+ );
7465
7512
  }
7466
7513
  // T13: replay the latest runtime-content update that arrived (and was
7467
7514
  // buffered) while this edit session was active, so the canvas isn't
@@ -7905,6 +7952,15 @@ declare var __DESIGN_CANVAS_BOARD_SURFACE__: boolean;
7905
7952
  cancelActiveBridgeDrag();
7906
7953
  return;
7907
7954
  }
7955
+ if (e.data.type === "agent-native:reset-live-visual-edit-baselines") {
7956
+ if (liveVisualEditOriginalInlineStyles) {
7957
+ liveVisualEditOriginalInlineStyles = new WeakMap<
7958
+ Element,
7959
+ Record<string, string>
7960
+ >();
7961
+ }
7962
+ return;
7963
+ }
7908
7964
  if (e.data.type === "clear-selection") {
7909
7965
  // During marquee drag, empty hit sets are replayed back from the host as a
7910
7966
  // clear-selection state. Keep the drag-owned rectangle alive until pointer-up.
@@ -8168,6 +8224,23 @@ declare var __DESIGN_CANVAS_BOARD_SURFACE__: boolean;
8168
8224
  removeRuntimeTarget(e.data.selector, e.data.selectorCandidates);
8169
8225
  return;
8170
8226
  }
8227
+ if (e.data.type === "set-text-content") {
8228
+ var textTarget = findRuntimeTarget(
8229
+ String(e.data.selector || ""),
8230
+ Array.isArray(e.data.selectorCandidates)
8231
+ ? e.data.selectorCandidates
8232
+ : [],
8233
+ ) as HTMLElement | null;
8234
+ if (!textTarget) return;
8235
+ if (typeof e.data.html === "string") {
8236
+ textTarget.innerHTML = e.data.html;
8237
+ } else {
8238
+ textTarget.textContent =
8239
+ typeof e.data.value === "string" ? e.data.value : "";
8240
+ }
8241
+ refreshOverlays();
8242
+ return;
8243
+ }
8171
8244
  if (e.data.type !== "style-change") return;
8172
8245
  var sel = e.data.selector;
8173
8246
  var prop = e.data.property;
@@ -8211,6 +8284,8 @@ declare var __DESIGN_CANVAS_BOARD_SURFACE__: boolean;
8211
8284
  activeTextEditEl,
8212
8285
  activeTextEditEl!.textContent || "",
8213
8286
  activeTextEditEl!.innerHTML || "",
8287
+ undefined,
8288
+ undefined,
8214
8289
  );
8215
8290
  refreshOverlays();
8216
8291
  return;
@@ -3,12 +3,18 @@ export function isTrustedCanvasBridgeMessage({
3
3
  origin,
4
4
  iframeWindow,
5
5
  parentOrigin,
6
+ allowedOrigins = [],
6
7
  }: {
7
8
  source: MessageEventSource | null;
8
9
  origin: string;
9
10
  iframeWindow: Window | null | undefined;
10
11
  parentOrigin: string;
12
+ allowedOrigins?: string[];
11
13
  }): boolean {
12
14
  if (!iframeWindow || source !== iframeWindow) return false;
13
- return origin === parentOrigin || origin === "null";
15
+ return (
16
+ origin === parentOrigin ||
17
+ origin === "null" ||
18
+ allowedOrigins.includes(origin)
19
+ );
14
20
  }
@@ -334,7 +334,7 @@ export interface MultiScreenCanvasProps {
334
334
  sourceRect?: { x: number; y: number; width: number; height: number };
335
335
  anchorRect?: { x: number; y: number; width: number; height: number };
336
336
  },
337
- ) => boolean | void;
337
+ ) => boolean | "pending" | void;
338
338
  /**
339
339
  * Called when a style property changes on a board element.
340
340
  * Target file is boardFileId.
@@ -600,9 +600,12 @@ const messages = {
600
600
  previewLabel: "待處理的視覺預覽",
601
601
  applyWithAgent: "用 Design 代理套用",
602
602
  copyPrompt: "將提示複製給您的代理",
603
+ abortPreview: "放棄預覽並進入互動",
603
604
  agentMessage: "將待處理的視覺樣式編輯套用到來源。",
604
605
  sentToast: "樣式編輯已傳送給 Design 代理",
605
606
  copiedToast: "樣式提示已複製",
607
+ abortedToast: "已捨棄待處理的預覽",
608
+ interactBlocked: "切換到互動前,請先套用或放棄待處理的即時編輯。",
606
609
  leaveTitle: "離開前要套用樣式嗎?",
607
610
  leaveDescriptionOne:
608
611
  "即時預覽中有 {{count}} 個待處理的視覺樣式編輯。現在離開會捨棄該未套用的樣式變更。",
@@ -618,9 +618,13 @@ const enUS = {
618
618
  previewLabel: "Pending visual preview",
619
619
  applyWithAgent: "Apply with Design agent",
620
620
  copyPrompt: "Copy prompt to your agent",
621
+ abortPreview: "Abort preview and interact",
621
622
  agentMessage: "Apply the pending visual style edits to the source.",
622
623
  sentToast: "Style edits sent to the Design agent",
623
624
  copiedToast: "Style prompt copied",
625
+ abortedToast: "Pending preview discarded",
626
+ interactBlocked:
627
+ "Apply or abort pending live edits before switching to Interact.",
624
628
  leaveTitle: "Apply styles before leaving?",
625
629
  leaveDescriptionOne:
626
630
  "You have {{count}} pending visual style edit in the live preview. Leaving now will discard that unapplied style change.",
@@ -9786,9 +9790,12 @@ const designPendingVisualStyleOverrides = {
9786
9790
  previewLabel: "待處理的視覺預覽",
9787
9791
  applyWithAgent: "用 Design 代理套用",
9788
9792
  copyPrompt: "將提示複製給您的代理",
9793
+ abortPreview: "中止預覽並互動",
9789
9794
  agentMessage: "將待處理的視覺樣式編輯套用到來源。",
9790
9795
  sentToast: "樣式編輯已傳送給 Design 代理",
9791
9796
  copiedToast: "樣式提示已複製",
9797
+ abortedToast: "待處理的預覽已捨棄",
9798
+ interactBlocked: "請先套用或中止待處理的即時編輯,再切換到互動模式。",
9792
9799
  leaveTitle: "離開前要套用樣式嗎?",
9793
9800
  leaveDescriptionOne:
9794
9801
  "即時預覽中有 {{count}} 個待處理的視覺樣式編輯。現在離開會捨棄該未套用的樣式變更。",
@@ -9807,9 +9814,12 @@ const designPendingVisualStyleOverrides = {
9807
9814
  previewLabel: "待处理的视觉预览",
9808
9815
  applyWithAgent: "用 Design 代理应用",
9809
9816
  copyPrompt: "将提示复制给你的代理",
9817
+ abortPreview: "中止预览并互动",
9810
9818
  agentMessage: "将待处理的视觉样式编辑应用到源文件。",
9811
9819
  sentToast: "样式编辑已发送给 Design 代理",
9812
9820
  copiedToast: "样式提示已复制",
9821
+ abortedToast: "待处理的预览已丢弃",
9822
+ interactBlocked: "请先应用或中止待处理的实时编辑,再切换到互动模式。",
9813
9823
  leaveTitle: "离开前应用样式?",
9814
9824
  leaveDescriptionOne:
9815
9825
  "实时预览中有 {{count}} 个待处理的视觉样式编辑。现在离开会丢弃这个未应用的样式更改。",
@@ -9828,10 +9838,14 @@ const designPendingVisualStyleOverrides = {
9828
9838
  previewLabel: "Vista previa visual pendiente",
9829
9839
  applyWithAgent: "Aplicar con el agente de Design",
9830
9840
  copyPrompt: "Copiar prompt a tu agente",
9841
+ abortPreview: "Cancelar vista previa e interactuar",
9831
9842
  agentMessage:
9832
9843
  "Aplica las ediciones visuales de estilo pendientes al código fuente.",
9833
9844
  sentToast: "Ediciones de estilo enviadas al agente de Design",
9834
9845
  copiedToast: "Prompt de estilo copiado",
9846
+ abortedToast: "Vista previa pendiente descartada",
9847
+ interactBlocked:
9848
+ "Aplica o cancela las ediciones en vivo pendientes antes de cambiar a Interactuar.",
9835
9849
  leaveTitle: "¿Aplicar estilos antes de salir?",
9836
9850
  leaveDescriptionOne:
9837
9851
  "Tienes {{count}} edición visual de estilo pendiente en la vista previa en vivo. Si sales ahora, se descartará ese cambio de estilo sin aplicar.",
@@ -9850,10 +9864,14 @@ const designPendingVisualStyleOverrides = {
9850
9864
  previewLabel: "Aperçu visuel en attente",
9851
9865
  applyWithAgent: "Appliquer avec l’agent Design",
9852
9866
  copyPrompt: "Copier le prompt vers votre agent",
9867
+ abortPreview: "Annuler l’aperçu et interagir",
9853
9868
  agentMessage:
9854
9869
  "Appliquez les modifications visuelles de style en attente à la source.",
9855
9870
  sentToast: "Modifications de style envoyées à l’agent Design",
9856
9871
  copiedToast: "Prompt de style copié",
9872
+ abortedToast: "Aperçu en attente supprimé",
9873
+ interactBlocked:
9874
+ "Appliquez ou annulez les modifications en direct en attente avant de passer à Interagir.",
9857
9875
  leaveTitle: "Appliquer les styles avant de quitter ?",
9858
9876
  leaveDescriptionOne:
9859
9877
  "Vous avez {{count}} modification visuelle de style en attente dans l’aperçu en direct. Quitter maintenant supprimera cette modification non appliquée.",
@@ -9872,10 +9890,14 @@ const designPendingVisualStyleOverrides = {
9872
9890
  previewLabel: "Ausstehende visuelle Vorschau",
9873
9891
  applyWithAgent: "Mit Design-Agent anwenden",
9874
9892
  copyPrompt: "Prompt an deinen Agent kopieren",
9893
+ abortPreview: "Vorschau abbrechen und interagieren",
9875
9894
  agentMessage:
9876
9895
  "Wende die ausstehenden visuellen Stiländerungen auf die Quelle an.",
9877
9896
  sentToast: "Stiländerungen an den Design-Agent gesendet",
9878
9897
  copiedToast: "Stil-Prompt kopiert",
9898
+ abortedToast: "Ausstehende Vorschau verworfen",
9899
+ interactBlocked:
9900
+ "Wende ausstehende Live-Änderungen an oder brich sie ab, bevor du zu Interagieren wechselst.",
9879
9901
  leaveTitle: "Stile vor dem Verlassen anwenden?",
9880
9902
  leaveDescriptionOne:
9881
9903
  "In der Live-Vorschau gibt es {{count}} ausstehende visuelle Stiländerung. Wenn du jetzt gehst, wird diese nicht angewendete Stiländerung verworfen.",
@@ -9894,10 +9916,14 @@ const designPendingVisualStyleOverrides = {
9894
9916
  previewLabel: "保留中のビジュアルプレビュー",
9895
9917
  applyWithAgent: "Design エージェントで適用",
9896
9918
  copyPrompt: "エージェントにプロンプトをコピー",
9919
+ abortPreview: "プレビューを中止して操作",
9897
9920
  agentMessage:
9898
9921
  "保留中のビジュアルスタイル編集をソースに適用してください。",
9899
9922
  sentToast: "スタイル編集を Design エージェントに送信しました",
9900
9923
  copiedToast: "スタイルプロンプトをコピーしました",
9924
+ abortedToast: "保留中のプレビューを破棄しました",
9925
+ interactBlocked:
9926
+ "操作モードに切り替える前に、保留中のライブ編集を適用するか中止してください。",
9901
9927
  leaveTitle: "離れる前にスタイルを適用しますか?",
9902
9928
  leaveDescriptionOne:
9903
9929
  "ライブプレビューに {{count}} 件の保留中のビジュアルスタイル編集があります。今離れると、未適用のスタイル変更は破棄されます。",
@@ -9916,9 +9942,13 @@ const designPendingVisualStyleOverrides = {
9916
9942
  previewLabel: "보류 중인 시각 미리보기",
9917
9943
  applyWithAgent: "Design 에이전트로 적용",
9918
9944
  copyPrompt: "에이전트에 프롬프트 복사",
9945
+ abortPreview: "미리보기를 중단하고 상호작용",
9919
9946
  agentMessage: "보류 중인 시각 스타일 편집을 소스에 적용하세요.",
9920
9947
  sentToast: "스타일 편집을 Design 에이전트로 보냈습니다",
9921
9948
  copiedToast: "스타일 프롬프트가 복사되었습니다",
9949
+ abortedToast: "보류 중인 미리보기를 버렸습니다",
9950
+ interactBlocked:
9951
+ "상호작용 모드로 전환하기 전에 보류 중인 라이브 편집을 적용하거나 중단하세요.",
9922
9952
  leaveTitle: "나가기 전에 스타일을 적용할까요?",
9923
9953
  leaveDescriptionOne:
9924
9954
  "라이브 미리보기에 보류 중인 시각 스타일 편집이 {{count}}개 있습니다. 지금 나가면 적용되지 않은 스타일 변경이 삭제됩니다.",
@@ -9937,10 +9967,14 @@ const designPendingVisualStyleOverrides = {
9937
9967
  previewLabel: "Prévia visual pendente",
9938
9968
  applyWithAgent: "Aplicar com o agente Design",
9939
9969
  copyPrompt: "Copiar prompt para seu agente",
9970
+ abortPreview: "Cancelar prévia e interagir",
9940
9971
  agentMessage:
9941
9972
  "Aplique as edições visuais de estilo pendentes à origem.",
9942
9973
  sentToast: "Edições de estilo enviadas ao agente Design",
9943
9974
  copiedToast: "Prompt de estilo copiado",
9975
+ abortedToast: "Prévia pendente descartada",
9976
+ interactBlocked:
9977
+ "Aplique ou cancele as edições ao vivo pendentes antes de mudar para Interagir.",
9944
9978
  leaveTitle: "Aplicar estilos antes de sair?",
9945
9979
  leaveDescriptionOne:
9946
9980
  "Você tem {{count}} edição visual de estilo pendente na prévia ao vivo. Sair agora descartará essa alteração de estilo não aplicada.",
@@ -9959,9 +9993,12 @@ const designPendingVisualStyleOverrides = {
9959
9993
  previewLabel: "लंबित visual preview",
9960
9994
  applyWithAgent: "Design agent से लागू करें",
9961
9995
  copyPrompt: "Prompt अपने agent को कॉपी करें",
9996
+ abortPreview: "Preview रोकें और interact करें",
9962
9997
  agentMessage: "लंबित visual style edits को source पर लागू करें।",
9963
9998
  sentToast: "Style edits Design agent को भेजे गए",
9964
9999
  copiedToast: "Style prompt कॉपी हुआ",
10000
+ abortedToast: "लंबित preview हटा दिया गया",
10001
+ interactBlocked: "Interact पर जाने से पहले लंबित live edits लागू करें या रोकें।",
9965
10002
  leaveTitle: "छोड़ने से पहले styles लागू करें?",
9966
10003
  leaveDescriptionOne:
9967
10004
  "Live preview में {{count}} लंबित visual style edit है। अभी छोड़ने पर वह unapplied style change हट जाएगा।",
@@ -9980,9 +10017,13 @@ const designPendingVisualStyleOverrides = {
9980
10017
  previewLabel: "معاينة مرئية معلقة",
9981
10018
  applyWithAgent: "تطبيق عبر وكيل Design",
9982
10019
  copyPrompt: "نسخ الموجه إلى وكيلك",
10020
+ abortPreview: "إلغاء المعاينة والتفاعل",
9983
10021
  agentMessage: "طبّق تعديلات النمط المرئية المعلقة على المصدر.",
9984
10022
  sentToast: "تم إرسال تعديلات النمط إلى وكيل Design",
9985
10023
  copiedToast: "تم نسخ موجه النمط",
10024
+ abortedToast: "تم تجاهل المعاينة المعلقة",
10025
+ interactBlocked:
10026
+ "طبّق التعديلات المباشرة المعلقة أو ألغها قبل الانتقال إلى التفاعل.",
9986
10027
  leaveTitle: "تطبيق الأنماط قبل المغادرة؟",
9987
10028
  leaveDescriptionOne:
9988
10029
  "لديك {{count}} تعديل نمط مرئي معلق في المعاينة المباشرة. ستؤدي المغادرة الآن إلى تجاهل تغيير النمط غير المطبق.",
@@ -0,0 +1,6 @@
1
+ ---
2
+ type: fixed
3
+ date: 2026-07-07
4
+ ---
5
+
6
+ Local visual edit keeps bridge access when opening previously connected localhost apps
@@ -0,0 +1,6 @@
1
+ ---
2
+ type: fixed
3
+ date: 2026-07-07
4
+ ---
5
+
6
+ Local visual edit now keeps the live app connection authenticated when applying or discarding style previews.
@@ -0,0 +1,6 @@
1
+ ---
2
+ type: improved
3
+ date: 2026-07-07
4
+ ---
5
+
6
+ Local visual edit uses live app iframes for click-to-edit previews before applying changes.
@@ -117,27 +117,27 @@ export declare function isAgentChatDurableBackgroundEnabled(options?: {
117
117
  appOptIn?: boolean;
118
118
  }): boolean;
119
119
  /**
120
- * Env flag for the FOREGROUND server-driven self-chain. DEFAULT-OFF (opt-in):
121
- * unset means disabled; an app opts IN with an explicit truthy value
122
- * (`true`/`1`/`yes`/`on`) — same parsing convention as
123
- * `AGENT_CHAT_DURABLE_BACKGROUND`, deliberately kept as a separate flag so
124
- * this narrower capability can be enabled/disabled independently of the full
125
- * durable-background worker path.
120
+ * Env flag for the FOREGROUND server-driven self-chain. DEFAULT-ON for hosted
121
+ * deployments with `A2A_SECRET`: unset/empty/unknown means enabled, and an app
122
+ * opts OUT with an explicit falsy value (`false`/`0`/`no`/`off`). Deliberately
123
+ * kept separate from `AGENT_CHAT_DURABLE_BACKGROUND` so this narrower
124
+ * capability can be disabled independently of the full durable-background
125
+ * worker path.
126
126
  */
127
127
  export declare const AGENT_CHAT_FOREGROUND_SELF_CHAIN_ENV = "AGENT_CHAT_FOREGROUND_SELF_CHAIN";
128
128
  /**
129
- * Gate for the OPT-IN foreground self-chain: a normal (non-durable-background)
129
+ * Gate for the foreground self-chain: a normal (non-durable-background)
130
130
  * agent-chat turn that hits its soft-timeout chunk boundary continues via a
131
131
  * server-side self-dispatch on the REGULAR function (not a Netlify
132
132
  * `-background` function) instead of depending on the client to re-POST
133
133
  * `auto_continue`. Composes exactly like `isAgentChatDurableBackgroundEnabled`:
134
- * true only when the env flag is explicitly truthy AND the runtime is hosted
135
- * AND `A2A_SECRET` is configured (the HMAC handoff authenticates the
136
- * self-dispatch). False otherwise — and false means the existing
137
- * client-driven `auto_continue` re-POST path is used unchanged, byte-for-byte.
134
+ * true when the runtime is hosted AND `A2A_SECRET` is configured (the HMAC
135
+ * handoff authenticates the self-dispatch), unless the env flag is explicitly
136
+ * falsy. False otherwise — and false means the existing client-driven
137
+ * `auto_continue` re-POST path is used unchanged, byte-for-byte.
138
138
  *
139
139
  * Deliberately independent of `isAgentChatDurableBackgroundEnabled`: an app can
140
- * enable this narrower capability without opting into the full 15-min
140
+ * use this narrower capability without opting into the full 15-min
141
141
  * background-function worker path, and the two gates never need to agree.
142
142
  * When BOTH would be true for a given run, the durable-background dispatch
143
143
  * decision in `production-agent.ts` is evaluated first and takes precedence —
@@ -290,15 +290,15 @@ export function isAgentChatDurableBackgroundEnabled(options) {
290
290
  hasConfiguredA2ASecret());
291
291
  }
292
292
  /**
293
- * Env flag for the FOREGROUND server-driven self-chain. DEFAULT-OFF (opt-in):
294
- * unset means disabled; an app opts IN with an explicit truthy value
295
- * (`true`/`1`/`yes`/`on`) — same parsing convention as
296
- * `AGENT_CHAT_DURABLE_BACKGROUND`, deliberately kept as a separate flag so
297
- * this narrower capability can be enabled/disabled independently of the full
298
- * durable-background worker path.
293
+ * Env flag for the FOREGROUND server-driven self-chain. DEFAULT-ON for hosted
294
+ * deployments with `A2A_SECRET`: unset/empty/unknown means enabled, and an app
295
+ * opts OUT with an explicit falsy value (`false`/`0`/`no`/`off`). Deliberately
296
+ * kept separate from `AGENT_CHAT_DURABLE_BACKGROUND` so this narrower
297
+ * capability can be disabled independently of the full durable-background
298
+ * worker path.
299
299
  */
300
300
  export const AGENT_CHAT_FOREGROUND_SELF_CHAIN_ENV = "AGENT_CHAT_FOREGROUND_SELF_CHAIN";
301
- function isForegroundSelfChainFlagEnabled() {
301
+ function isForegroundSelfChainExplicitlyDisabled() {
302
302
  // Read the literal key (not `process.env[CONST]`) so guard:no-env-credentials
303
303
  // can statically verify it against the allowlisted `AGENT_*` prefix. Keep this
304
304
  // in sync with AGENT_CHAT_FOREGROUND_SELF_CHAIN_ENV.
@@ -306,24 +306,24 @@ function isForegroundSelfChainFlagEnabled() {
306
306
  if (raw == null)
307
307
  return false;
308
308
  const normalized = raw.trim().toLowerCase();
309
- return (normalized === "1" ||
310
- normalized === "true" ||
311
- normalized === "yes" ||
312
- normalized === "on");
309
+ return (normalized === "0" ||
310
+ normalized === "false" ||
311
+ normalized === "no" ||
312
+ normalized === "off");
313
313
  }
314
314
  /**
315
- * Gate for the OPT-IN foreground self-chain: a normal (non-durable-background)
315
+ * Gate for the foreground self-chain: a normal (non-durable-background)
316
316
  * agent-chat turn that hits its soft-timeout chunk boundary continues via a
317
317
  * server-side self-dispatch on the REGULAR function (not a Netlify
318
318
  * `-background` function) instead of depending on the client to re-POST
319
319
  * `auto_continue`. Composes exactly like `isAgentChatDurableBackgroundEnabled`:
320
- * true only when the env flag is explicitly truthy AND the runtime is hosted
321
- * AND `A2A_SECRET` is configured (the HMAC handoff authenticates the
322
- * self-dispatch). False otherwise — and false means the existing
323
- * client-driven `auto_continue` re-POST path is used unchanged, byte-for-byte.
320
+ * true when the runtime is hosted AND `A2A_SECRET` is configured (the HMAC
321
+ * handoff authenticates the self-dispatch), unless the env flag is explicitly
322
+ * falsy. False otherwise — and false means the existing client-driven
323
+ * `auto_continue` re-POST path is used unchanged, byte-for-byte.
324
324
  *
325
325
  * Deliberately independent of `isAgentChatDurableBackgroundEnabled`: an app can
326
- * enable this narrower capability without opting into the full 15-min
326
+ * use this narrower capability without opting into the full 15-min
327
327
  * background-function worker path, and the two gates never need to agree.
328
328
  * When BOTH would be true for a given run, the durable-background dispatch
329
329
  * decision in `production-agent.ts` is evaluated first and takes precedence —
@@ -331,7 +331,7 @@ function isForegroundSelfChainFlagEnabled() {
331
331
  * existing `isBackgroundWorker` path, not this one.
332
332
  */
333
333
  export function isAgentChatForegroundSelfChainEnabled() {
334
- return (isForegroundSelfChainFlagEnabled() &&
334
+ return (!isForegroundSelfChainExplicitlyDisabled() &&
335
335
  isHostedRuntimeForDurableBackground() &&
336
336
  hasConfiguredA2ASecret());
337
337
  }