@agent-native/core 0.165.4 → 0.167.1

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 (224) hide show
  1. package/corpus/README.md +1 -1
  2. package/corpus/templates/analytics/.agents/skills/secrets/SKILL.md +5 -1
  3. package/corpus/templates/analytics/.agents/skills/workspace-conventions/SKILL.md +4 -1
  4. package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +93 -56
  5. package/corpus/templates/analytics/app/i18n-data.ts +23 -20
  6. package/corpus/templates/analytics/app/pages/Settings.tsx +0 -1
  7. package/corpus/templates/analytics/app/pages/adhoc/explorer/index.tsx +0 -1
  8. package/corpus/templates/analytics/app/pages/adhoc/explorer-dashboard/index.tsx +1 -1
  9. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/SqlChartCard.tsx +2 -1
  10. package/corpus/templates/analytics/app/pages/sessions/SessionsPage.tsx +0 -1
  11. package/corpus/templates/analytics/server/lib/first-party-analytics-backend.ts +0 -32
  12. package/corpus/templates/analytics/server/lib/session-replay.ts +1 -5
  13. package/corpus/templates/assets/.agents/skills/secrets/SKILL.md +5 -1
  14. package/corpus/templates/assets/.agents/skills/workspace-conventions/SKILL.md +4 -1
  15. package/corpus/templates/assets/actions/navigate.ts +2 -2
  16. package/corpus/templates/assets/actions/save-generated-image.ts +0 -5
  17. package/corpus/templates/assets/app/routes/brand-kits.$id.tsx +2 -262
  18. package/corpus/templates/assets/app/routes/library.tsx +1 -1
  19. package/corpus/templates/assets/app/routes/settings.tsx +0 -3
  20. package/corpus/templates/brain/.agents/skills/secrets/SKILL.md +5 -1
  21. package/corpus/templates/brain/.agents/skills/workspace-conventions/SKILL.md +4 -1
  22. package/corpus/templates/brain/actions/ask-brain.ts +0 -1
  23. package/corpus/templates/brain/actions/navigate.ts +2 -2
  24. package/corpus/templates/brain/app/routes/sources.tsx +0 -4
  25. package/corpus/templates/brain/server/lib/capture-sanitization.ts +0 -11
  26. package/corpus/templates/calendar/.agents/skills/secrets/SKILL.md +5 -1
  27. package/corpus/templates/calendar/.agents/skills/workspace-conventions/SKILL.md +4 -1
  28. package/corpus/templates/calendar/app/components/calendar/EventDetailPopover.tsx +0 -20
  29. package/corpus/templates/calendar/app/pages/CalendarView.tsx +0 -1
  30. package/corpus/templates/chat/.agents/skills/secrets/SKILL.md +5 -1
  31. package/corpus/templates/chat/.agents/skills/workspace-conventions/SKILL.md +4 -1
  32. package/corpus/templates/chat/actions/navigate.ts +2 -2
  33. package/corpus/templates/clips/.agents/skills/secrets/SKILL.md +5 -1
  34. package/corpus/templates/clips/.agents/skills/workspace-conventions/SKILL.md +4 -1
  35. package/corpus/templates/clips/CHANGELOG.md +2 -0
  36. package/corpus/templates/clips/actions/import-loom-recording.ts +16 -4
  37. package/corpus/templates/clips/actions/navigate.ts +2 -2
  38. package/corpus/templates/clips/app/components/editor/stitch-manager.tsx +0 -1
  39. package/corpus/templates/clips/app/components/library/space-dialogs.tsx +0 -1
  40. package/corpus/templates/clips/app/components/meetings/share-meeting-dialog.tsx +0 -1
  41. package/corpus/templates/clips/app/components/player/clips-share-trigger.tsx +17 -0
  42. package/corpus/templates/clips/app/components/player/delete-recording-menu.tsx +3 -3
  43. package/corpus/templates/clips/app/components/player/video-player.tsx +2 -2
  44. package/corpus/templates/clips/app/components/recorder/recorder-engine.ts +0 -1
  45. package/corpus/templates/clips/app/components/settings/ai-setup-section.tsx +0 -1
  46. package/corpus/templates/clips/app/global.css +31 -0
  47. package/corpus/templates/clips/app/hooks/use-playback-position.ts +0 -2
  48. package/corpus/templates/clips/app/lib/download-release-channel.ts +10 -0
  49. package/corpus/templates/clips/app/routes/_app.meetings.$meetingId.tsx +1 -3
  50. package/corpus/templates/clips/app/routes/download.tsx +67 -44
  51. package/corpus/templates/clips/app/routes/r.$recordingId.tsx +7 -12
  52. package/corpus/templates/clips/app/routes/record.tsx +6 -6
  53. package/corpus/templates/clips/app/routes/share.$shareId.tsx +26 -29
  54. package/corpus/templates/clips/changelog/2026-08-20-clip-viewer-share-actions.md +6 -0
  55. package/corpus/templates/clips/changelog/2026-08-20-preparing-recording-countdown-overlay.md +1 -0
  56. package/corpus/templates/clips/chrome-extension/src/background.ts +0 -13
  57. package/corpus/templates/clips/chrome-extension/src/overlay.ts +0 -1
  58. package/corpus/templates/clips/chrome-extension/src/popup.ts +0 -20
  59. package/corpus/templates/clips/desktop/src/app.tsx +6 -18
  60. package/corpus/templates/clips/desktop/src/hooks/useMediaDevices.ts +0 -1
  61. package/corpus/templates/clips/desktop/src/lib/recorder.ts +0 -8
  62. package/corpus/templates/content/.agents/skills/secrets/SKILL.md +5 -1
  63. package/corpus/templates/content/.agents/skills/workspace-conventions/SKILL.md +4 -1
  64. package/corpus/templates/content/actions/_database-source-utils.ts +0 -3
  65. package/corpus/templates/content/actions/attach-content-database-source.ts +1 -4
  66. package/corpus/templates/content/actions/navigate.ts +2 -2
  67. package/corpus/templates/content/actions/prepare-builder-source-execution.ts +1 -1
  68. package/corpus/templates/content/app/components/editor/DocumentProperties.tsx +0 -6
  69. package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +0 -580
  70. package/corpus/templates/content/app/components/editor/database/FormView.tsx +2 -2
  71. package/corpus/templates/content/app/components/editor/database/filter-sort.ts +1 -1
  72. package/corpus/templates/content/app/components/editor/database/settings.tsx +0 -23
  73. package/corpus/templates/content/app/components/editor/database/sidebar.tsx +0 -1
  74. package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +8 -304
  75. package/corpus/templates/content/app/hooks/use-documents.ts +0 -1
  76. package/corpus/templates/content/shared/api.ts +0 -1
  77. package/corpus/templates/content/shared/builder-mdx.ts +0 -1
  78. package/corpus/templates/content/shared/nfm.ts +1 -7
  79. package/corpus/templates/crm/.agents/skills/secrets/SKILL.md +5 -1
  80. package/corpus/templates/crm/.agents/skills/workspace-conventions/SKILL.md +4 -1
  81. package/corpus/templates/crm/actions/merge-crm-records.ts +0 -4
  82. package/corpus/templates/crm/app/components/crm/record/RecordLists.tsx +0 -1
  83. package/corpus/templates/crm/server/crm/hubspot-adapter.ts +0 -1
  84. package/corpus/templates/crm/server/crm/salesforce-adapter.ts +0 -1
  85. package/corpus/templates/crm/server/db/crm-store.ts +1 -1
  86. package/corpus/templates/design/.agents/skills/secrets/SKILL.md +5 -1
  87. package/corpus/templates/design/.agents/skills/workspace-conventions/SKILL.md +4 -1
  88. package/corpus/templates/design/.generated/bridge/editor-chrome.generated.ts +1 -14
  89. package/corpus/templates/design/AGENTS.md +2 -1
  90. package/corpus/templates/design/actions/apply-component-prop-edit.ts +1 -5
  91. package/corpus/templates/design/actions/generate-design.ts +0 -1
  92. package/corpus/templates/design/actions/generate-screens.ts +5 -2
  93. package/corpus/templates/design/actions/go-to-main-component.ts +2 -2
  94. package/corpus/templates/design/actions/list-design-systems.ts +10 -0
  95. package/corpus/templates/design/actions/navigate.ts +2 -2
  96. package/corpus/templates/design/actions/open-component-source.ts +4 -4
  97. package/corpus/templates/design/actions/present-design-variants.ts +1 -2
  98. package/corpus/templates/design/actions/run-design-audit.ts +0 -22
  99. package/corpus/templates/design/actions/show-design-questions.ts +5 -2
  100. package/corpus/templates/design/app/components/design/DesignCanvas.tsx +19 -8
  101. package/corpus/templates/design/app/components/design/EditPanel.tsx +11 -183
  102. package/corpus/templates/design/app/components/design/MultiScreenCanvas.tsx +21 -4
  103. package/corpus/templates/design/app/components/design/QuestionFlow.tsx +1 -5
  104. package/corpus/templates/design/app/components/design/bridge/codegen.ts +1 -1
  105. package/corpus/templates/design/app/components/design/bridge/editor-chrome.bridge.ts +10 -19
  106. package/corpus/templates/design/app/components/design/edit-panel/appearance-properties.tsx +1 -1
  107. package/corpus/templates/design/app/components/design/edit-panel/layout-properties.tsx +13 -3
  108. package/corpus/templates/design/app/components/design/edit-panel/panel-primitives.tsx +38 -32
  109. package/corpus/templates/design/app/components/design/edit-panel/position-layout-properties.tsx +1 -4
  110. package/corpus/templates/design/app/components/design/inspector/AlignmentMatrix.tsx +0 -4
  111. package/corpus/templates/design/app/components/design/inspector/AutoLayoutMatrix.tsx +15 -6
  112. package/corpus/templates/design/app/components/design/inspector/DesignColorPicker.tsx +2 -2
  113. package/corpus/templates/design/app/components/visual-editor/NodeRewriteProposal.tsx +0 -1
  114. package/corpus/templates/design/app/components/visual-editor/ReviewCanvasPins.tsx +1 -1
  115. package/corpus/templates/design/app/i18n-data.ts +122 -0
  116. package/corpus/templates/design/app/lib/clipboard-content-lineage.ts +11 -1
  117. package/corpus/templates/design/app/pages/DesignEditor.tsx +50 -254
  118. package/corpus/templates/design/app/pages/DesignSystemSetup.tsx +163 -8
  119. package/corpus/templates/design/app/pages/Index.tsx +17 -0
  120. package/corpus/templates/design/app/pages/design-editor/canvas-primitive-insert.ts +44 -32
  121. package/corpus/templates/design/app/pages/design-editor/canvas-primitives.ts +10 -0
  122. package/corpus/templates/design/app/pages/design-editor/clone-and-pen-edit.ts +49 -3
  123. package/corpus/templates/design/app/pages/design-editor/clone-idrefs.ts +31 -0
  124. package/corpus/templates/design/app/pages/design-editor/code-layer-state.ts +28 -0
  125. package/corpus/templates/design/app/pages/design-editor/commands/add-auto-layout.ts +3 -3
  126. package/corpus/templates/design/app/pages/design-editor/commands/align-selection.ts +44 -14
  127. package/corpus/templates/design/app/pages/design-editor/commands/apply-local-content-update.ts +16 -5
  128. package/corpus/templates/design/app/pages/design-editor/commands/change-selected-z-index.ts +1 -1
  129. package/corpus/templates/design/app/pages/design-editor/commands/frame-selection.ts +1 -1
  130. package/corpus/templates/design/app/pages/design-editor/commands/group-selection.ts +1 -1
  131. package/corpus/templates/design/app/pages/design-editor/commands/nudge-selection.ts +1 -1
  132. package/corpus/templates/design/app/pages/design-editor/commands/paste-selection.ts +142 -17
  133. package/corpus/templates/design/app/pages/design-editor/commands/screen-visual-duplicate-change.ts +1 -0
  134. package/corpus/templates/design/app/pages/design-editor/commands/ungroup-selection.ts +1 -1
  135. package/corpus/templates/design/app/pages/design-editor/commands/visual-duplicate-change.ts +1 -0
  136. package/corpus/templates/design/app/pages/design-editor/cross-screen-text-color.ts +25 -9
  137. package/corpus/templates/design/app/pages/design-editor/editor-state.ts +1 -0
  138. package/corpus/templates/design/app/pages/design-editor/measure-child-rects.ts +83 -0
  139. package/corpus/templates/design/app/pages/design-editor/paste-placement.ts +66 -0
  140. package/corpus/templates/design/server/routes/[...page].get.ts +0 -1
  141. package/corpus/templates/design/shared/code-layer.ts +120 -70
  142. package/corpus/templates/design/shared/design-surface-index.ts +0 -1
  143. package/corpus/templates/design/shared/pen-path.ts +0 -4
  144. package/corpus/templates/dispatch/.agents/skills/secrets/SKILL.md +5 -1
  145. package/corpus/templates/dispatch/.agents/skills/workspace-conventions/SKILL.md +4 -1
  146. package/corpus/templates/dispatch/app/routes/integrations.tsx +0 -109
  147. package/corpus/templates/factory/.agents/skills/secrets/SKILL.md +5 -1
  148. package/corpus/templates/factory/.agents/skills/workspace-conventions/SKILL.md +4 -1
  149. package/corpus/templates/factory/actions/navigate.ts +2 -2
  150. package/corpus/templates/factory/app/components/factory/FactoryAuditView.tsx +0 -13
  151. package/corpus/templates/factory/app/routes/factory.tsx +0 -1
  152. package/corpus/templates/factory/server/factory-graph/store.ts +0 -1
  153. package/corpus/templates/forms/.agents/skills/secrets/SKILL.md +5 -1
  154. package/corpus/templates/forms/.agents/skills/workspace-conventions/SKILL.md +4 -1
  155. package/corpus/templates/macros/.agents/skills/secrets/SKILL.md +5 -1
  156. package/corpus/templates/macros/.agents/skills/workspace-conventions/SKILL.md +4 -1
  157. package/corpus/templates/macros/app/components/layout/AppLayout.tsx +0 -1
  158. package/corpus/templates/mail/.agents/skills/secrets/SKILL.md +5 -1
  159. package/corpus/templates/mail/.agents/skills/workspace-conventions/SKILL.md +4 -1
  160. package/corpus/templates/mail/app/components/email/EmailList.tsx +0 -1
  161. package/corpus/templates/mail/app/components/layout/AppLayout.tsx +2 -2
  162. package/corpus/templates/mail/shared/markdown.ts +3 -0
  163. package/corpus/templates/plan/.agents/skills/secrets/SKILL.md +5 -1
  164. package/corpus/templates/plan/.agents/skills/workspace-conventions/SKILL.md +4 -1
  165. package/corpus/templates/slides/.agents/skills/secrets/SKILL.md +5 -1
  166. package/corpus/templates/slides/.agents/skills/workspace-conventions/SKILL.md +4 -1
  167. package/corpus/templates/slides/actions/add-slide.ts +0 -1
  168. package/corpus/templates/slides/actions/list-decks.ts +1 -1
  169. package/corpus/templates/slides/app/components/editor/EditorSidebar.tsx +1 -4
  170. package/corpus/templates/slides/app/components/editor/SlideContextToolbar.tsx +0 -1
  171. package/corpus/templates/slides/app/components/editor/SlideEditor.tsx +1 -1
  172. package/corpus/templates/slides/app/pages/DeckEditor.tsx +1 -6
  173. package/corpus/templates/tasks/.agents/skills/secrets/SKILL.md +5 -1
  174. package/corpus/templates/tasks/.agents/skills/workspace-conventions/SKILL.md +4 -1
  175. package/corpus/templates/tasks/app/components/layout/Layout.tsx +0 -1
  176. package/corpus/templates/tasks/app/hooks/use-visible-task-fields.ts +1 -4
  177. package/corpus/templates/tasks/server/custom-fields/store.ts +1 -6
  178. package/corpus/templates/tasks/shared/list-screen-snapshot.ts +2 -2
  179. package/dist/agent/engine/registry.js +27 -14
  180. package/dist/agent/index.d.ts +1 -1
  181. package/dist/agent/production-agent.d.ts +19 -6
  182. package/dist/agent/production-agent.js +57 -16
  183. package/dist/agent/types.d.ts +3 -0
  184. package/dist/changelog/parse.js +219 -8
  185. package/dist/client/EnvironmentBadge.d.ts +1 -0
  186. package/dist/client/EnvironmentBadge.js +7 -0
  187. package/dist/collab/routes.d.ts +1 -1
  188. package/dist/collab/struct-routes.d.ts +1 -1
  189. package/dist/config.d.ts +11 -0
  190. package/dist/config.js +248 -0
  191. package/dist/deploy/build.js +12 -1
  192. package/dist/index.d.ts +1 -1
  193. package/dist/observability/routes.d.ts +3 -3
  194. package/dist/progress/routes.d.ts +1 -1
  195. package/dist/resources/handlers.d.ts +2 -2
  196. package/dist/secrets/routes.d.ts +9 -9
  197. package/dist/server/agent-chat/plugin-options.d.ts +3 -2
  198. package/dist/server/agent-chat-plugin.js +5 -2
  199. package/dist/server/index.d.ts +1 -1
  200. package/dist/templates/chat/.agents/skills/secrets/SKILL.md +5 -1
  201. package/dist/templates/chat/.agents/skills/workspace-conventions/SKILL.md +4 -1
  202. package/dist/templates/chat/actions/navigate.ts +2 -2
  203. package/dist/templates/default/.agents/skills/secrets/SKILL.md +5 -1
  204. package/dist/templates/default/.agents/skills/workspace-conventions/SKILL.md +4 -1
  205. package/dist/templates/headless/.agents/skills/secrets/SKILL.md +5 -1
  206. package/dist/templates/workspace-core/.agents/skills/secrets/SKILL.md +5 -1
  207. package/dist/templates/workspace-core/.agents/skills/workspace-conventions/SKILL.md +4 -1
  208. package/dist/vite/agent-native-config-loader.d.ts +1 -0
  209. package/dist/vite/agent-native-config-loader.js +3 -3
  210. package/dist/vite/agents-bundle-plugin.d.ts +1 -1
  211. package/dist/vite/agents-bundle-plugin.js +13 -1
  212. package/dist/vite/client.js +14 -14
  213. package/docs/content/agent-native-config.mdx +62 -11
  214. package/docs/content/agent-surfaces.mdx +6 -0
  215. package/docs/content/environment-variables.mdx +5 -2
  216. package/package.json +3 -3
  217. package/src/templates/chat/.agents/skills/secrets/SKILL.md +5 -1
  218. package/src/templates/chat/.agents/skills/workspace-conventions/SKILL.md +4 -1
  219. package/src/templates/chat/actions/navigate.ts +2 -2
  220. package/src/templates/default/.agents/skills/secrets/SKILL.md +5 -1
  221. package/src/templates/default/.agents/skills/workspace-conventions/SKILL.md +4 -1
  222. package/src/templates/headless/.agents/skills/secrets/SKILL.md +5 -1
  223. package/src/templates/workspace-core/.agents/skills/secrets/SKILL.md +5 -1
  224. package/src/templates/workspace-core/.agents/skills/workspace-conventions/SKILL.md +4 -1
@@ -2337,7 +2337,6 @@ export const editorChromeBridgeScript: string = `"use strict";
2337
2337
  var pendingShieldDrag = null;
2338
2338
  var suppressNextShieldClick = false;
2339
2339
  var suppressNextShieldClickTimer = null;
2340
- var selectedSpacingHovered = false;
2341
2340
  var hoveredSpacingHandleKey = "";
2342
2341
  var spacingHoverClearTimer = null;
2343
2342
  var lastSpacingPointerPoint = null;
@@ -2358,7 +2357,6 @@ export const editorChromeBridgeScript: string = `"use strict";
2358
2357
  clearHoverGate();
2359
2358
  setPassiveSelectionElements([]);
2360
2359
  clearSpacingHoverTimer();
2361
- selectedSpacingHovered = false;
2362
2360
  hoveredSpacingHandleKey = "";
2363
2361
  lastSpacingPointerPoint = null;
2364
2362
  spacingDrag = null;
@@ -2576,7 +2574,7 @@ export const editorChromeBridgeScript: string = `"use strict";
2576
2574
  lastSourceHeadHtml = nextHeadHtml;
2577
2575
  }
2578
2576
  var currentHeadHtml = lastSourceHeadHtml;
2579
- if (nextHeadHtml === currentHeadHtml && activeCandidates.length > 0) {
2577
+ if (!forceFullDocument && nextHeadHtml === currentHeadHtml && activeCandidates.length > 0) {
2580
2578
  var currentMatch = null;
2581
2579
  var nextMatch = null;
2582
2580
  var matchedSelector = "";
@@ -3229,7 +3227,6 @@ export const editorChromeBridgeScript: string = `"use strict";
3229
3227
  function activateSpacingHandle(spacingKey) {
3230
3228
  if (!spacingKey) return;
3231
3229
  clearSpacingHoverTimer();
3232
- selectedSpacingHovered = true;
3233
3230
  setHoverToSelectedElementFromSpacingSurface();
3234
3231
  if (hoveredSpacingHandleKey !== spacingKey || spacingOverlay.style.display !== "block") {
3235
3232
  hoveredSpacingHandleKey = spacingKey;
@@ -3287,7 +3284,6 @@ export const editorChromeBridgeScript: string = `"use strict";
3287
3284
  }
3288
3285
  var hit = elementFromEditorPoint(clientX, clientY);
3289
3286
  if (hit && (hit === selectedEl || selectedEl.contains && selectedEl.contains(hit))) {
3290
- selectedSpacingHovered = true;
3291
3287
  return true;
3292
3288
  }
3293
3289
  return false;
@@ -3305,7 +3301,6 @@ export const editorChromeBridgeScript: string = `"use strict";
3305
3301
  updateSpacingOverlay(selectedEl);
3306
3302
  return;
3307
3303
  }
3308
- selectedSpacingHovered = false;
3309
3304
  hoveredSpacingHandleKey = "";
3310
3305
  updateSpacingOverlay(selectedEl);
3311
3306
  }, 80);
@@ -4135,7 +4130,6 @@ export const editorChromeBridgeScript: string = `"use strict";
4135
4130
  window.parent.postMessage({ type: "clear-selection" }, "*");
4136
4131
  return;
4137
4132
  }
4138
- selectedSpacingHovered = false;
4139
4133
  hoveredSpacingHandleKey = "";
4140
4134
  var previousSelectedEl = selectedEl;
4141
4135
  selectedEl = selectionTargetForHit(target);
@@ -4363,7 +4357,6 @@ export const editorChromeBridgeScript: string = `"use strict";
4363
4357
  var target = candidateElements[0] || null;
4364
4358
  var info = null;
4365
4359
  if (target) {
4366
- selectedSpacingHovered = false;
4367
4360
  hoveredSpacingHandleKey = "";
4368
4361
  selectedEl = selectionTargetForHit(target);
4369
4362
  if (selectedEl && !isLayerInteractionBlocked(selectedEl)) {
@@ -5064,7 +5057,6 @@ export const editorChromeBridgeScript: string = `"use strict";
5064
5057
  var startY = e.clientY;
5065
5058
  lastSpacingPointerPoint = { x: startX, y: startY };
5066
5059
  hoveredSpacingHandleKey = key;
5067
- selectedSpacingHovered = true;
5068
5060
  spacingDrag = {
5069
5061
  handle,
5070
5062
  currentValue: originValue,
@@ -6763,7 +6755,6 @@ export const editorChromeBridgeScript: string = `"use strict";
6763
6755
  var dx = cx - reorderPointerStart.clientX;
6764
6756
  var dy = cy - reorderPointerStart.clientY;
6765
6757
  var outside = cx < 0 || cy < 0 || cx > vw || cy > vh;
6766
- pointerOutsideIframe = outside;
6767
6758
  if (!isGroupDrag) {
6768
6759
  window.parent.postMessage(
6769
6760
  {
@@ -6986,7 +6977,6 @@ export const editorChromeBridgeScript: string = `"use strict";
6986
6977
  ctrl: Boolean(e.ctrlKey),
6987
6978
  target: dndTarget(currentTarget)
6988
6979
  });
6989
- var pointerOutsideIframe = false;
6990
6980
  var reorderSelector = getSelector(reorderEl);
6991
6981
  var reorderSourceId = getSourceId(reorderEl);
6992
6982
  var reorderStyleSnapshot = collectPortableStyleSnapshot(reorderEl);
@@ -7033,7 +7023,6 @@ export const editorChromeBridgeScript: string = `"use strict";
7033
7023
  return snapshot;
7034
7024
  });
7035
7025
  var gestureState = memberStates[groupEls.indexOf(gestureEl)] || memberStates[0];
7036
- var originalInlineOpacity = gestureState.originalOpacity;
7037
7026
  var originLeft = gestureState.originLeft;
7038
7027
  var originTop = gestureState.originTop;
7039
7028
  function setMembersOpacity(value) {
@@ -8507,7 +8496,6 @@ export const editorChromeBridgeScript: string = `"use strict";
8507
8496
  );
8508
8497
  if (hoveringSelectedSpacingSurface) {
8509
8498
  clearSpacingHoverTimer();
8510
- selectedSpacingHovered = true;
8511
8499
  lastSpacingPointerPoint = { x: e.clientX, y: e.clientY };
8512
8500
  updateSpacingOverlay(selectedEl);
8513
8501
  var pointSpacingKey = spacingHandleKeyAtPoint(e.clientX, e.clientY);
@@ -8904,7 +8892,6 @@ export const editorChromeBridgeScript: string = `"use strict";
8904
8892
  if (!target) return;
8905
8893
  var selectionChangedByHost = target !== selectedEl;
8906
8894
  if (selectionChangedByHost) {
8907
- selectedSpacingHovered = false;
8908
8895
  hoveredSpacingHandleKey = "";
8909
8896
  }
8910
8897
  selectedEl = target;
@@ -85,7 +85,8 @@ Read the relevant skill before deeper work in that area.
85
85
  ## Application State
86
86
 
87
87
  - `navigation` — current view, design id, file id, and related UI state.
88
- - `navigate` — moves the UI; auto-deleted after the client consumes it.
88
+ - `navigate` — moves the UI in the tab that asked; auto-deleted after the
89
+ client consumes it.
89
90
  - `design-selection` — active screen, selected element, overview mode,
90
91
  inspector tab, zoom, and screen list for the current tab.
91
92
  - `design-generation-session:<designId>`, `show-questions`, `guided-questions` —
@@ -48,11 +48,7 @@ import {
48
48
  applyVisualEdit,
49
49
  buildCodeLayerProjection,
50
50
  } from "../shared/code-layer.js";
51
- import type {
52
- CodeLayerSource,
53
- ClassEditIntent,
54
- StyleEditIntent,
55
- } from "../shared/code-layer.js";
51
+ import type { CodeLayerSource, ClassEditIntent } from "../shared/code-layer.js";
56
52
  import { agentSelectionDescriptor } from "../shared/collab-selection.js";
57
53
  import {
58
54
  componentNameFor,
@@ -13,7 +13,6 @@ import { buildDeepLink } from "@agent-native/core/server";
13
13
  import { assertAccess } from "@agent-native/core/sharing";
14
14
  import {
15
15
  getGenerationCreativeContext,
16
- mergeCreativeContextReuseLabels,
17
16
  recordGenerationCreativeContext,
18
17
  replaceCreativeContextElementProvenance,
19
18
  resolveGenerationCreativeContext,
@@ -1,5 +1,8 @@
1
1
  import { defineAction, embedApp } from "@agent-native/core";
2
- import { writeAppState } from "@agent-native/core/application-state";
2
+ import {
3
+ writeAppState,
4
+ writeAppStateForCurrentTab,
5
+ } from "@agent-native/core/application-state";
3
6
  import { buildDeepLink } from "@agent-native/core/server";
4
7
  import { assertAccess } from "@agent-native/core/sharing";
5
8
  import {
@@ -430,7 +433,7 @@ export default defineAction({
430
433
  designGenerationSessionKey(designId),
431
434
  session as unknown as Record<string, unknown>,
432
435
  );
433
- await writeAppState("navigate", {
436
+ await writeAppStateForCurrentTab("navigate", {
434
437
  view: "editor",
435
438
  designId,
436
439
  editorView: "overview",
@@ -28,7 +28,7 @@
28
28
  */
29
29
 
30
30
  import { defineAction } from "@agent-native/core/action";
31
- import { writeAppState } from "@agent-native/core/application-state";
31
+ import { writeAppStateForCurrentTab } from "@agent-native/core/application-state";
32
32
  import { getText, hasCollabState } from "@agent-native/core/collab";
33
33
  import { accessFilter, resolveAccess } from "@agent-native/core/sharing";
34
34
  import { and, eq } from "drizzle-orm";
@@ -223,7 +223,7 @@ export default defineAction({
223
223
  };
224
224
  }
225
225
 
226
- await writeAppState("navigate", {
226
+ await writeAppStateForCurrentTab("navigate", {
227
227
  view: "editor",
228
228
  designId,
229
229
  editorView: "single",
@@ -44,6 +44,16 @@ export default defineAction({
44
44
  await Promise.all(
45
45
  rows.map(async (row) => {
46
46
  const access = await resolveAccess("design-system", row.id);
47
+ if (!access) {
48
+ // accessFilter admitted this row but resolveAccess cannot name a
49
+ // role, so create-design's assertAccess will reject the same id the
50
+ // picker just offered.
51
+ console.warn(
52
+ `[design] list-design-systems: no resolvable access for ` +
53
+ `design-system ${row.id} ("${row.title}") that accessFilter ` +
54
+ `admitted; create-design will reject it.`,
55
+ );
56
+ }
47
57
  const role = access?.role ?? "viewer";
48
58
  accessById.set(row.id, { role, canManage: canManageRole(role) });
49
59
  }),
@@ -29,7 +29,7 @@
29
29
  */
30
30
 
31
31
  import { defineAction } from "@agent-native/core";
32
- import { writeAppState } from "@agent-native/core/application-state";
32
+ import { writeAppStateForCurrentTab } from "@agent-native/core/application-state";
33
33
  import { z } from "zod";
34
34
 
35
35
  const designEditorToolSchema = z.enum([
@@ -176,7 +176,7 @@ export default defineAction({
176
176
  if (args.designSystemId) nav.designSystemId = args.designSystemId;
177
177
  if (args.templateId) nav.templateId = args.templateId;
178
178
  if (args.path) nav.path = args.path;
179
- await writeAppState("navigate", nav);
179
+ await writeAppStateForCurrentTab("navigate", nav);
180
180
  return `Navigating to ${args.view || args.path}${
181
181
  args.designId ? ` (design: ${args.designId})` : ""
182
182
  }${editorView ? ` (${editorView} view)` : ""}${
@@ -17,15 +17,15 @@
17
17
  * gate is checked and the response includes the external file path for the IDE
18
18
  * to open.
19
19
  *
20
- * Navigation is written via `writeAppState("navigate", ...)` — the same
21
- * mechanism used by the `navigate` action. Because this writes transient
20
+ * Navigation is written via `writeAppStateForCurrentTab("navigate", ...)` —
21
+ * the same mechanism as the `navigate` action. Because this writes transient
22
22
  * application state, the action uses the default POST mutation transport.
23
23
  *
24
24
  * See DESIGN-STUDIO-PLAN.md §6.1 (jump-to-source) and §7 (action surface).
25
25
  */
26
26
 
27
27
  import { defineAction } from "@agent-native/core";
28
- import { writeAppState } from "@agent-native/core/application-state";
28
+ import { writeAppStateForCurrentTab } from "@agent-native/core/application-state";
29
29
  import { getText, hasCollabState } from "@agent-native/core/collab";
30
30
  import { accessFilter, resolveAccess } from "@agent-native/core/sharing";
31
31
  import { and, eq } from "drizzle-orm";
@@ -190,7 +190,7 @@ export default defineAction({
190
190
  // ── Emit navigation command ──────────────────────────────────────────────
191
191
  // Use the same application state key as the `navigate` action so the UI
192
192
  // client picks it up and selects the element in the editor.
193
- await writeAppState("navigate", {
193
+ await writeAppStateForCurrentTab("navigate", {
194
194
  view: "editor",
195
195
  designId,
196
196
  editorView: "single",
@@ -1,7 +1,6 @@
1
1
  import { defineAction, embedApp } from "@agent-native/core";
2
2
  import {
3
3
  deleteAppState,
4
- writeAppState,
5
4
  writeAppStateForCurrentTab,
6
5
  } from "@agent-native/core/application-state";
7
6
  import { seedFromText } from "@agent-native/core/collab";
@@ -1169,7 +1168,7 @@ export default defineAction({
1169
1168
  },
1170
1169
  });
1171
1170
 
1172
- await writeAppState("navigate", {
1171
+ await writeAppStateForCurrentTab("navigate", {
1173
1172
  view: "editor",
1174
1173
  designId,
1175
1174
  editorView: "overview",
@@ -34,28 +34,6 @@ import {
34
34
  // HTML helpers (static analysis — no DOM runtime available server-side)
35
35
  // ---------------------------------------------------------------------------
36
36
 
37
- /** Extract all attribute values matching a simple regex over raw HTML. */
38
- function extractAttrs(
39
- html: string,
40
- tagPattern: RegExp,
41
- attrName: string,
42
- ): string[] {
43
- const attrRegex = new RegExp(
44
- `${attrName}\\s*=\\s*(?:"([^"]*?)"|'([^']*?)')`,
45
- "gi",
46
- );
47
- const results: string[] = [];
48
- let match: RegExpExecArray | null;
49
- const tagMatches = [...html.matchAll(tagPattern)];
50
- for (const tm of tagMatches) {
51
- attrRegex.lastIndex = 0;
52
- while ((match = attrRegex.exec(tm[0])) !== null) {
53
- results.push(match[1] ?? match[2] ?? "");
54
- }
55
- }
56
- return results;
57
- }
58
-
59
37
  /** Pull a node id from a raw tag string (data-agent-native-node-id attr). */
60
38
  function extractNodeId(tagHtml: string): string | undefined {
61
39
  const m = tagHtml.match(
@@ -1,5 +1,8 @@
1
1
  import { defineAction, embedApp } from "@agent-native/core";
2
- import { writeAppState } from "@agent-native/core/application-state";
2
+ import {
3
+ writeAppState,
4
+ writeAppStateForCurrentTab,
5
+ } from "@agent-native/core/application-state";
3
6
  import { buildDeepLink } from "@agent-native/core/server";
4
7
  import { assertAccess } from "@agent-native/core/sharing";
5
8
  import { z } from "zod";
@@ -131,7 +134,7 @@ export default defineAction({
131
134
  submitLabel: submitLabel ?? "Continue",
132
135
  questions: normalizedQuestions,
133
136
  });
134
- await writeAppState("navigate", {
137
+ await writeAppStateForCurrentTab("navigate", {
135
138
  view: "editor",
136
139
  designId,
137
140
  editorView: "overview",
@@ -1312,7 +1312,7 @@ export function DesignCanvas({
1312
1312
  // twice from the same drawing.
1313
1313
  const [annotationCaptureBusy, setAnnotationCaptureBusy] = useState(false);
1314
1314
  const annotationCaptureBusyRef = useRef(false);
1315
- const [fetchedExternalSnapshot, setFetchedExternalSnapshot] = useState<{
1315
+ const [, setFetchedExternalSnapshot] = useState<{
1316
1316
  url: string;
1317
1317
  html: string;
1318
1318
  } | null>(null);
@@ -1433,11 +1433,7 @@ export function DesignCanvas({
1433
1433
  (sourceType === "localhost" || sourceType === "fusion") &&
1434
1434
  Boolean(rawExternalPreviewUrl) &&
1435
1435
  Boolean(onRuntimeLayerSnapshot);
1436
- const activeExternalSnapshotHtml =
1437
- externalSnapshotHtml ??
1438
- (fetchedExternalSnapshot?.url === rawExternalPreviewUrl
1439
- ? fetchedExternalSnapshot.html
1440
- : undefined);
1436
+
1441
1437
  // Bake a neutral scale of 1 here (not the zoom-folded scale): this script is
1442
1438
  // registered with the localhost bridge via a large POST, so folding live zoom
1443
1439
  // in would re-fire the registration effect on every zoom tick. Live scale is
@@ -4076,8 +4072,17 @@ export function DesignCanvas({
4076
4072
  preserveTextEditingSession?: boolean;
4077
4073
  },
4078
4074
  ) => {
4075
+ // Raw content here drops the injected offset/background styles, moving a
4076
+ // frame authored at a negative offset off screen. Both channels push the
4077
+ // same shape.
4079
4078
  const replaced = replacePreviewContent(
4080
- nextContent,
4079
+ getEmbeddedFrameDocumentContent({
4080
+ content: withLocalRuntimes(nextContent),
4081
+ embeddedFrameBackground,
4082
+ transparentBackground,
4083
+ contentOffsetX: embeddedFrame?.contentOffsetX ?? 0,
4084
+ contentOffsetY: embeddedFrame?.contentOffsetY ?? 0,
4085
+ }),
4081
4086
  selector,
4082
4087
  candidates,
4083
4088
  options,
@@ -4091,7 +4096,13 @@ export function DesignCanvas({
4091
4096
  }
4092
4097
  return replaced;
4093
4098
  },
4094
- [replacePreviewContent],
4099
+ [
4100
+ embeddedFrame?.contentOffsetX,
4101
+ embeddedFrame?.contentOffsetY,
4102
+ embeddedFrameBackground,
4103
+ replacePreviewContent,
4104
+ transparentBackground,
4105
+ ],
4095
4106
  );
4096
4107
 
4097
4108
  const replaceRuntimeContentInPlace = useCallback(