@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
@@ -1 +1 @@
1
- {"version":3,"file":"design-connect.d.ts","sourceRoot":"","sources":["../../src/cli/design-connect.ts"],"names":[],"mappings":"AAIA,OAAa,EAEX,KAAK,MAAM,EAEZ,MAAM,WAAW,CAAC;AAcnB,QAAA,MAAM,iBAAiB,YACrB,QAAQ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ED,MAAM,WAAW,eAAe;IAC9B,KAAK,EAAE,gBAAgB,EAAE,CAAC;IAC1B,SAAS,EAAE,OAAO,CAAC;CACpB;AAuGD,wBAAsB,wBAAwB,CAC5C,QAAQ,EAAE,qBAAqB,GAC9B,OAAO,CAAC,mBAAmB,CAAC,CAgc9B;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAmBnE;AAiBD;;;;;;;;;GASG;AACH,wBAAsB,4BAA4B,CAChD,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,mBAAmB,EAC3B,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,IAAI,CAAC,CAwDf;AAuHD,wBAAsB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,mBAwD7C"}
@@ -24,6 +24,15 @@ const BRIDGE_OPERATIONS = [
24
24
  "captureState",
25
25
  "listFiles",
26
26
  ];
27
+ const SERVER_REGISTRATION_BRIDGE_OPERATIONS = new Set([
28
+ "select",
29
+ "resolveNodeToFile",
30
+ "readFile",
31
+ "applyEdit",
32
+ "writeFile",
33
+ "captureSnapshot",
34
+ "captureState",
35
+ ]);
27
36
  /** Additive manifest capability flags advertised alongside the operation list. */
28
37
  const MANIFEST_CAPABILITIES = {
29
38
  listFiles: true,
@@ -414,6 +423,36 @@ function sendJson(res, statusCode, body) {
414
423
  });
415
424
  res.end(`${JSON.stringify(body, null, 2)}\n`);
416
425
  }
426
+ function sendText(res, statusCode, body, contentType) {
427
+ res.writeHead(statusCode, {
428
+ "content-type": contentType,
429
+ "access-control-allow-origin": "*",
430
+ "access-control-allow-methods": "GET, POST, OPTIONS",
431
+ "access-control-allow-headers": "content-type, x-bridge-token",
432
+ "access-control-allow-private-network": "true",
433
+ });
434
+ res.end(body);
435
+ }
436
+ function sendBytes(res, statusCode, body, headers) {
437
+ const responseHeaders = {
438
+ "access-control-allow-origin": "*",
439
+ "access-control-allow-methods": "GET, HEAD, POST, OPTIONS",
440
+ "access-control-allow-headers": "content-type, x-bridge-token",
441
+ "access-control-allow-private-network": "true",
442
+ };
443
+ for (const name of [
444
+ "content-type",
445
+ "cache-control",
446
+ "etag",
447
+ "last-modified",
448
+ ]) {
449
+ const value = headers.get(name);
450
+ if (value)
451
+ responseHeaders[name] = value;
452
+ }
453
+ res.writeHead(statusCode, responseHeaders);
454
+ res.end(body);
455
+ }
417
456
  function sameOrigin(a, b) {
418
457
  try {
419
458
  return new URL(a).origin === new URL(b).origin;
@@ -434,6 +473,16 @@ function resolvePreviewSnapshotUrl(devServerUrl, rawUrl) {
434
473
  }
435
474
  return parsed.toString();
436
475
  }
476
+ function resolvePreviewProxyUrl(devServerUrl, requestUrl) {
477
+ const base = normalizeHttpUrl(devServerUrl);
478
+ const parsedRequest = new URL(requestUrl ?? "/", base);
479
+ const parsed = new URL(`${parsedRequest.pathname}${parsedRequest.search}`, `${base}/`);
480
+ parsed.hash = "";
481
+ if (!sameOrigin(parsed.toString(), base)) {
482
+ throw new Error("Proxy URL must stay on the connected dev server.");
483
+ }
484
+ return parsed.toString();
485
+ }
437
486
  async function fetchPreviewSnapshot(devServerUrl, targetUrl, redirects = 0) {
438
487
  if (redirects > 5) {
439
488
  throw new Error("Too many redirects while fetching preview snapshot.");
@@ -469,6 +518,63 @@ async function fetchPreviewSnapshot(devServerUrl, targetUrl, redirects = 0) {
469
518
  clearTimeout(timeout);
470
519
  }
471
520
  }
521
+ async function fetchPreviewProxyResource(devServerUrl, targetUrl, redirects = 0) {
522
+ if (redirects > 5) {
523
+ throw new Error("Too many redirects while proxying preview resource.");
524
+ }
525
+ const controller = new AbortController();
526
+ const timeout = setTimeout(() => controller.abort(), 10_000);
527
+ try {
528
+ const response = await fetch(targetUrl, {
529
+ method: "GET",
530
+ redirect: "manual",
531
+ signal: controller.signal,
532
+ });
533
+ const location = response.headers.get("location");
534
+ if (location && response.status >= 300 && response.status < 400) {
535
+ const redirected = new URL(location, targetUrl);
536
+ redirected.hash = "";
537
+ if (!sameOrigin(redirected.toString(), devServerUrl)) {
538
+ throw new Error("Proxy redirect left the connected dev server.");
539
+ }
540
+ return fetchPreviewProxyResource(devServerUrl, redirected.toString(), redirects + 1);
541
+ }
542
+ return {
543
+ url: response.url || targetUrl,
544
+ status: response.status,
545
+ headers: response.headers,
546
+ body: Buffer.from(await response.arrayBuffer()),
547
+ };
548
+ }
549
+ finally {
550
+ clearTimeout(timeout);
551
+ }
552
+ }
553
+ function addLiveEditBaseHref(html, href) {
554
+ const escapedHref = href.replace(/&/g, "&amp;").replace(/"/g, "&quot;");
555
+ const baseTag = `<base href="${escapedHref}">`;
556
+ if (/<base\b/i.test(html))
557
+ return html;
558
+ if (/<head\b[^>]*>/i.test(html)) {
559
+ return html.replace(/<head\b[^>]*>/i, (match) => `${match}${baseTag}`);
560
+ }
561
+ if (/<html\b[^>]*>/i.test(html)) {
562
+ return html.replace(/<html\b[^>]*>/i, (match) => `${match}<head>${baseTag}</head>`);
563
+ }
564
+ return `<!DOCTYPE html><html><head>${baseTag}<meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"></head><body>${html}</body></html>`;
565
+ }
566
+ function injectLiveEditBridge(html, targetUrl, script) {
567
+ const withBase = addLiveEditBaseHref(html, targetUrl);
568
+ if (!script)
569
+ return withBase;
570
+ if (withBase.includes("</body>")) {
571
+ return withBase.replace("</body>", `${script}</body>`);
572
+ }
573
+ if (withBase.includes("</html>")) {
574
+ return withBase.replace("</html>", `${script}</html>`);
575
+ }
576
+ return `${withBase}${script}`;
577
+ }
472
578
  /** Read the full request body as a UTF-8 string. */
473
579
  async function readRequestBody(req) {
474
580
  return new Promise((resolve, reject) => {
@@ -881,6 +987,7 @@ export async function startDesignConnectBridge(manifest) {
881
987
  // an unauthenticated caller cannot read it. The server-side grant action
882
988
  // obtains it out-of-band (via the exported bridge reference).
883
989
  const bridgeToken = crypto.randomBytes(32).toString("hex");
990
+ let liveEditBridgeScript = "";
884
991
  const server = http.createServer((req, res) => {
885
992
  if (req.method === "OPTIONS") {
886
993
  sendJson(res, 204, {});
@@ -907,6 +1014,79 @@ export async function startDesignConnectBridge(manifest) {
907
1014
  sendJson(res, 200, { ok: true, source: manifest.source });
908
1015
  return;
909
1016
  }
1017
+ if (pathname === "/live-edit-bridge") {
1018
+ if (req.method !== "POST") {
1019
+ sendJson(res, 405, { ok: false, error: "method not allowed" });
1020
+ return;
1021
+ }
1022
+ const tokenHeader = req.headers["x-bridge-token"];
1023
+ const providedToken = typeof tokenHeader === "string" ? tokenHeader : "";
1024
+ let tokenValid = false;
1025
+ try {
1026
+ tokenValid =
1027
+ providedToken.length === bridgeToken.length &&
1028
+ crypto.timingSafeEqual(Buffer.from(providedToken, "utf8"), Buffer.from(bridgeToken, "utf8"));
1029
+ }
1030
+ catch {
1031
+ tokenValid = false;
1032
+ }
1033
+ if (!tokenValid) {
1034
+ sendJson(res, 401, {
1035
+ ok: false,
1036
+ error: "invalid or missing bridge token",
1037
+ });
1038
+ return;
1039
+ }
1040
+ void (async () => {
1041
+ try {
1042
+ const raw = await readRequestBody(req);
1043
+ const body = JSON.parse(raw);
1044
+ const script = typeof body["script"] === "string" ? body["script"] : "";
1045
+ if (!script.includes("agent-native:editor-chrome-ready")) {
1046
+ sendJson(res, 400, {
1047
+ ok: false,
1048
+ error: "script must install the Agent Native editor bridge",
1049
+ });
1050
+ return;
1051
+ }
1052
+ liveEditBridgeScript = script;
1053
+ sendJson(res, 200, { ok: true });
1054
+ }
1055
+ catch (err) {
1056
+ sendJson(res, 400, {
1057
+ ok: false,
1058
+ error: err instanceof Error ? err.message : String(err),
1059
+ });
1060
+ }
1061
+ })();
1062
+ return;
1063
+ }
1064
+ if (pathname === "/live-edit") {
1065
+ if (req.method !== "GET") {
1066
+ sendJson(res, 405, { ok: false, error: "method not allowed" });
1067
+ return;
1068
+ }
1069
+ void (async () => {
1070
+ try {
1071
+ const requestUrl = new URL(req.url ?? "/", manifest.bridgeUrl);
1072
+ const targetUrl = resolvePreviewSnapshotUrl(manifest.devServerUrl, requestUrl.searchParams.get("url") ??
1073
+ requestUrl.searchParams.get("path"));
1074
+ const snapshot = await fetchPreviewSnapshot(manifest.devServerUrl, targetUrl);
1075
+ const includeEditorBridge = requestUrl.searchParams.get("bridge") !== "0";
1076
+ const html = injectLiveEditBridge(snapshot.html, new URL("/", manifest.bridgeUrl).toString(), includeEditorBridge ? liveEditBridgeScript : "");
1077
+ sendText(res, snapshot.status >= 400 ? snapshot.status : 200, html, snapshot.contentType.includes("html")
1078
+ ? snapshot.contentType
1079
+ : "text/html; charset=utf-8");
1080
+ }
1081
+ catch (err) {
1082
+ sendJson(res, 400, {
1083
+ ok: false,
1084
+ error: err instanceof Error ? err.message : String(err),
1085
+ });
1086
+ }
1087
+ })();
1088
+ return;
1089
+ }
910
1090
  if (pathname === "/snapshot") {
911
1091
  if (req.method !== "GET") {
912
1092
  sendJson(res, 405, { ok: false, error: "method not allowed" });
@@ -1148,6 +1328,22 @@ export async function startDesignConnectBridge(manifest) {
1148
1328
  })();
1149
1329
  return;
1150
1330
  }
1331
+ if (req.method === "GET" || req.method === "HEAD") {
1332
+ void (async () => {
1333
+ try {
1334
+ const targetUrl = resolvePreviewProxyUrl(manifest.devServerUrl, req.url);
1335
+ const proxied = await fetchPreviewProxyResource(manifest.devServerUrl, targetUrl);
1336
+ sendBytes(res, proxied.status >= 400 ? proxied.status : 200, req.method === "HEAD" ? Buffer.alloc(0) : proxied.body, proxied.headers);
1337
+ }
1338
+ catch (err) {
1339
+ sendJson(res, 400, {
1340
+ ok: false,
1341
+ error: err instanceof Error ? err.message : String(err),
1342
+ });
1343
+ }
1344
+ })();
1345
+ return;
1346
+ }
1151
1347
  sendJson(res, 404, { ok: false, error: "not found" });
1152
1348
  });
1153
1349
  await new Promise((resolve, reject) => {
@@ -1213,7 +1409,7 @@ export async function registerConnectionWithServer(appUrl, bridge, authToken) {
1213
1409
  devServerUrl: manifest.devServerUrl,
1214
1410
  bridgeUrl: manifest.bridgeUrl,
1215
1411
  rootPath: manifest.rootPath,
1216
- capabilities: manifest.capabilities,
1412
+ capabilities: manifest.capabilities.filter((capability) => SERVER_REGISTRATION_BRIDGE_OPERATIONS.has(capability.operation)),
1217
1413
  routeManifest: {
1218
1414
  version: 1,
1219
1415
  sourceType: "localhost",