@agent-native/core 0.121.2 → 0.122.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 (588) hide show
  1. package/README.md +4 -12
  2. package/corpus/README.md +2 -2
  3. package/corpus/core/CHANGELOG.md +148 -0
  4. package/corpus/core/docs/content/actions.mdx +2 -2
  5. package/corpus/core/docs/content/agent-surfaces.mdx +1 -1
  6. package/corpus/core/docs/content/authentication.mdx +2 -0
  7. package/corpus/core/docs/content/deployment.mdx +36 -0
  8. package/corpus/core/docs/content/http-api.mdx +266 -0
  9. package/corpus/core/docs/content/syncing-template-changes.mdx +159 -0
  10. package/corpus/core/package.json +2 -1
  11. package/corpus/core/src/a2a/activity.ts +38 -27
  12. package/corpus/core/src/a2a/client.ts +57 -4
  13. package/corpus/core/src/agent/engine/builder-engine.ts +35 -4
  14. package/corpus/core/src/agent/run-manager.ts +20 -1
  15. package/corpus/core/src/agent/run-store.ts +4 -1
  16. package/corpus/core/src/agent/types.ts +28 -8
  17. package/corpus/core/src/chat-threads/store.ts +45 -0
  18. package/corpus/core/src/checkpoints/index.ts +2 -0
  19. package/corpus/core/src/checkpoints/route-match.ts +13 -0
  20. package/corpus/core/src/cli/create.ts +105 -17
  21. package/corpus/core/src/cli/index.ts +20 -0
  22. package/corpus/core/src/cli/template-baseline.ts +410 -0
  23. package/corpus/core/src/cli/template-sync.ts +1004 -0
  24. package/corpus/core/src/cli/templates-meta.ts +1 -0
  25. package/corpus/core/src/client/AssistantChat.tsx +38 -12
  26. package/corpus/core/src/client/NewWorkspaceAppFlow.tsx +75 -10
  27. package/corpus/core/src/client/chat/message-components.tsx +127 -66
  28. package/corpus/core/src/client/chat/tool-call-display.tsx +29 -5
  29. package/corpus/core/src/client/error-format.ts +18 -0
  30. package/corpus/core/src/client/org/OrgSwitcher.tsx +30 -8
  31. package/corpus/core/src/client/org/TeamPage.tsx +7 -6
  32. package/corpus/core/src/client/settings/SettingsPanel.tsx +9 -9
  33. package/corpus/core/src/client/settings/SettingsTabsPage.tsx +12 -2
  34. package/corpus/core/src/client/sse-event-processor.ts +3 -0
  35. package/corpus/core/src/data-widgets/index.ts +41 -0
  36. package/corpus/core/src/deploy/build.ts +11 -9
  37. package/corpus/core/src/extensions/url-safety.ts +67 -4
  38. package/corpus/core/src/integrations/webhook-handler.ts +63 -9
  39. package/corpus/core/src/org/auto-join-domain.ts +4 -3
  40. package/corpus/core/src/org/context.ts +108 -39
  41. package/corpus/core/src/org/index.ts +5 -0
  42. package/corpus/core/src/org/service-identity.ts +60 -0
  43. package/corpus/core/src/provider-api/index.ts +22 -1
  44. package/corpus/core/src/scripts/docs/search.ts +12 -1
  45. package/corpus/core/src/server/agent-chat/context-tools.ts +9 -4
  46. package/corpus/core/src/server/agent-chat/framework-prompts.ts +38 -66
  47. package/corpus/core/src/server/agent-chat-plugin.ts +17 -10
  48. package/corpus/core/src/server/agents-bundle.ts +84 -5
  49. package/corpus/core/src/server/auth.ts +4 -3
  50. package/corpus/core/src/server/builder-browser.ts +47 -19
  51. package/corpus/core/src/server/core-routes-plugin.ts +2 -2
  52. package/corpus/core/src/server/credential-provider.ts +209 -68
  53. package/corpus/core/src/server/index.ts +3 -0
  54. package/corpus/core/src/server/prompts/framework-core-compact.ts +6 -13
  55. package/corpus/core/src/server/prompts/framework-core.ts +9 -21
  56. package/corpus/core/src/server/prompts/index.ts +0 -1
  57. package/corpus/core/src/server/prompts/shared-rules.ts +19 -11
  58. package/corpus/core/src/server/ssr-handler.ts +13 -2
  59. package/corpus/core/src/settings/user-settings.ts +13 -1
  60. package/corpus/core/src/shared/cache-control.ts +141 -0
  61. package/corpus/core/src/templates/chat/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  62. package/corpus/core/src/templates/chat/_gitignore +1 -0
  63. package/corpus/core/src/templates/chat/app/components/layout/Sidebar.tsx +0 -7
  64. package/corpus/core/src/templates/default/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  65. package/corpus/core/src/templates/default/app/root.tsx +1 -1
  66. package/corpus/core/src/templates/default/public/manifest.json +2 -2
  67. package/corpus/core/src/templates/headless/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  68. package/corpus/core/src/templates/workspace-core/.agents/skills/performance/SKILL.md +19 -0
  69. package/corpus/core/src/templates/workspace-core/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  70. package/corpus/core/src/templates/workspace-core/.agents/skills/visual-answer/SKILL.md +1 -0
  71. package/corpus/core/src/vite/agents-bundle-plugin.ts +7 -6
  72. package/corpus/core/src/vite/client.ts +69 -3
  73. package/corpus/templates/analytics/.agents/skills/adhoc-analysis/SKILL.md +4 -5
  74. package/corpus/templates/analytics/.agents/skills/admin-surfaces/SKILL.md +55 -0
  75. package/corpus/templates/analytics/.agents/skills/dashboard-management/SKILL.md +10 -0
  76. package/corpus/templates/analytics/.agents/skills/dashboard-management/references/template-catalog-and-demo.md +62 -0
  77. package/corpus/templates/analytics/.agents/skills/dashboard-ops/SKILL.md +85 -0
  78. package/corpus/templates/analytics/.agents/skills/data-querying/SKILL.md +27 -2
  79. package/corpus/templates/analytics/.agents/skills/data-querying/references/inline-chart-embeds.md +139 -0
  80. package/corpus/templates/analytics/.agents/skills/monitoring/SKILL.md +77 -0
  81. package/corpus/templates/analytics/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  82. package/corpus/templates/analytics/AGENTS.md +91 -563
  83. package/corpus/templates/analytics/_gitignore +1 -0
  84. package/corpus/templates/analytics/actions/bigquery.ts +12 -4
  85. package/corpus/templates/analytics/actions/generate-chart.ts +5 -5
  86. package/corpus/templates/analytics/app/components/dashboard/SqlChart.tsx +30 -1
  87. package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +1 -23
  88. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/DashboardFilterBar.tsx +3 -0
  89. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/SqlChartCard.tsx +1 -1
  90. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/index.tsx +1 -0
  91. package/corpus/templates/analytics/app/routes/_index.tsx +1 -1
  92. package/corpus/templates/analytics/changelog/2026-07-24-analytics-finds-saved-dashboards-and-queries-far-more-reliab.md +6 -0
  93. package/corpus/templates/analytics/changelog/2026-07-24-notion-access-errors-now-explain-that-a-page-needs-sharing-w.md +6 -0
  94. package/corpus/templates/analytics/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
  95. package/corpus/templates/analytics/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
  96. package/corpus/templates/analytics/package.json +1 -1
  97. package/corpus/templates/analytics/public/manifest.json +1 -1
  98. package/corpus/templates/analytics/server/lib/agent-chat-plan-mode.ts +7 -0
  99. package/corpus/templates/analytics/server/lib/analytics-query-catalog.ts +191 -30
  100. package/corpus/templates/analytics/server/lib/bigquery.ts +11 -1
  101. package/corpus/templates/analytics/server/lib/notion.ts +15 -4
  102. package/corpus/templates/analytics/server/plugins/agent-chat.ts +10 -0
  103. package/corpus/templates/analytics/server/plugins/auth.ts +1 -1
  104. package/corpus/templates/assets/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  105. package/corpus/templates/assets/app/components/layout/Sidebar.tsx +0 -2
  106. package/corpus/templates/assets/app/routes/_index.tsx +1 -1
  107. package/corpus/templates/assets/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
  108. package/corpus/templates/assets/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
  109. package/corpus/templates/assets/server/plugins/auth.ts +1 -1
  110. package/corpus/templates/brain/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  111. package/corpus/templates/brain/_gitignore +1 -0
  112. package/corpus/templates/brain/app/lib/brain.ts +0 -7
  113. package/corpus/templates/brain/app/routes/_index.tsx +1 -2
  114. package/corpus/templates/brain/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
  115. package/corpus/templates/brain/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
  116. package/corpus/templates/brain/package.json +1 -1
  117. package/corpus/templates/brain/public/manifest.json +1 -1
  118. package/corpus/templates/brain/server/plugins/auth.ts +1 -1
  119. package/corpus/templates/calendar/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  120. package/corpus/templates/calendar/_gitignore +1 -0
  121. package/corpus/templates/calendar/app/components/layout/Sidebar.tsx +0 -6
  122. package/corpus/templates/calendar/app/routes/_app._index.tsx +1 -1
  123. package/corpus/templates/calendar/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
  124. package/corpus/templates/calendar/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
  125. package/corpus/templates/calendar/package.json +1 -1
  126. package/corpus/templates/calendar/public/manifest.json +1 -1
  127. package/corpus/templates/calendar/server/plugins/auth.ts +1 -1
  128. package/corpus/templates/chat/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  129. package/corpus/templates/chat/_gitignore +1 -0
  130. package/corpus/templates/chat/app/components/layout/Sidebar.tsx +0 -7
  131. package/corpus/templates/chat/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
  132. package/corpus/templates/clips/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  133. package/corpus/templates/clips/.agents/skills/video-sharing/SKILL.md +34 -0
  134. package/corpus/templates/clips/AGENTS.md +5 -4
  135. package/corpus/templates/clips/_gitignore +1 -0
  136. package/corpus/templates/clips/actions/cleanup-transcript.ts +5 -0
  137. package/corpus/templates/clips/actions/get-recording-insights.ts +44 -8
  138. package/corpus/templates/clips/actions/get-recording-player-data.ts +39 -70
  139. package/corpus/templates/clips/actions/import-loom-recording.ts +53 -98
  140. package/corpus/templates/clips/actions/lib/loom-import-job.ts +260 -0
  141. package/corpus/templates/clips/actions/list-clip-views.ts +2 -4
  142. package/corpus/templates/clips/actions/list-recordings.ts +69 -19
  143. package/corpus/templates/clips/actions/list-viewers.ts +5 -2
  144. package/corpus/templates/clips/actions/regenerate-summary.ts +5 -1
  145. package/corpus/templates/clips/actions/request-transcript.ts +28 -1
  146. package/corpus/templates/clips/app/components/editor/stitch-manager.tsx +21 -1
  147. package/corpus/templates/clips/app/components/library/library-layout.tsx +0 -7
  148. package/corpus/templates/clips/app/components/meetings/quick-ask-sidebar.tsx +14 -1
  149. package/corpus/templates/clips/app/components/player/insights-panel.tsx +8 -20
  150. package/corpus/templates/clips/app/components/player/recording-views-badge.tsx +335 -0
  151. package/corpus/templates/clips/app/components/player/video-player.tsx +13 -8
  152. package/corpus/templates/clips/app/components/sharing/share-ui.tsx +2 -1
  153. package/corpus/templates/clips/app/i18n/en-US.ts +13 -2
  154. package/corpus/templates/clips/app/lib/capture-permissions.ts +110 -0
  155. package/corpus/templates/clips/app/lib/recording-link.ts +32 -0
  156. package/corpus/templates/clips/app/routes/_app.library._index.tsx +1 -1
  157. package/corpus/templates/clips/app/routes/_app.meetings.$meetingId.tsx +27 -0
  158. package/corpus/templates/clips/app/routes/_index.tsx +1 -1
  159. package/corpus/templates/clips/app/routes/r.$recordingId.tsx +52 -15
  160. package/corpus/templates/clips/app/routes/record.tsx +82 -31
  161. package/corpus/templates/clips/app/routes/share.$shareId.tsx +42 -31
  162. package/corpus/templates/clips/changelog/2026-07-24-clip-pages-now-show-a-view-count-with-viewer-avatars-next-to.md +6 -0
  163. package/corpus/templates/clips/changelog/2026-07-24-clip-summaries-read-like-a-description-you-d-write-yourself-.md +6 -0
  164. package/corpus/templates/clips/changelog/2026-07-24-clip-view-counts-now-separate-human-views-from-agent-views-s.md +6 -0
  165. package/corpus/templates/clips/changelog/2026-07-24-clips-actions-can-now-be-called-by-org-service-tokens-so-ext.md +6 -0
  166. package/corpus/templates/clips/changelog/2026-07-24-clips-no-longer-briefly-shows-a-dock-icon-while-launching.md +6 -0
  167. package/corpus/templates/clips/changelog/2026-07-24-fixed-owner-and-editor-share-links-redirecting-to-the-record.md +6 -0
  168. package/corpus/templates/clips/changelog/2026-07-24-meeting-and-note-recordings-now-start-as-a-compact-pill-on-t.md +6 -0
  169. package/corpus/templates/clips/changelog/2026-07-24-new-clips-now-copy-a-shareable-link-instead-of-the-owner-onl.md +6 -0
  170. package/corpus/templates/clips/changelog/2026-07-24-opening-a-share-link-as-the-clip-s-owner-now-goes-straight-t.md +6 -0
  171. package/corpus/templates/clips/changelog/2026-07-24-permissions-and-rewind-controls-now-use-compact-consistent-h.md +6 -0
  172. package/corpus/templates/clips/changelog/2026-07-24-quitting-the-desktop-app-no-longer-shows-a-false-macos-crash.md +6 -0
  173. package/corpus/templates/clips/changelog/2026-07-24-screen-recording-permission-errors-now-name-the-exact-app-to.md +6 -0
  174. package/corpus/templates/clips/changelog/2026-07-24-the-desktop-app-now-copies-a-new-clip-s-share-link-to-your-c.md +6 -0
  175. package/corpus/templates/clips/changelog/2026-07-24-the-recording-toolbar-now-stays-above-other-apps-including-o.md +6 -0
  176. package/corpus/templates/clips/changelog/2026-07-24-transcript-captions-now-use-real-speech-timings-instead-of-a.md +6 -0
  177. package/corpus/templates/clips/changelog/2026-07-24-video-playback-no-longer-stutters-and-replays-the-last-momen.md +6 -0
  178. package/corpus/templates/clips/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
  179. package/corpus/templates/clips/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
  180. package/corpus/templates/clips/chrome-extension/src/background.ts +17 -1
  181. package/corpus/templates/clips/desktop/package.json +2 -0
  182. package/corpus/templates/clips/desktop/src/app.tsx +89 -0
  183. package/corpus/templates/clips/desktop/src/hooks/useMeetingTranscription.ts +9 -3
  184. package/corpus/templates/clips/desktop/src/lib/audio-meter.ts +51 -0
  185. package/corpus/templates/clips/desktop/src/lib/native-notification.ts +44 -0
  186. package/corpus/templates/clips/desktop/src/lib/recording-link.ts +67 -0
  187. package/corpus/templates/clips/desktop/src/overlays/live-audio-bars.tsx +35 -35
  188. package/corpus/templates/clips/desktop/src/overlays/live-transcript.tsx +3 -2
  189. package/corpus/templates/clips/desktop/src/overlays/recording-pill.tsx +47 -46
  190. package/corpus/templates/clips/desktop/src/styles.css +127 -78
  191. package/corpus/templates/clips/desktop/src-tauri/Cargo.toml +7 -0
  192. package/corpus/templates/clips/desktop/src-tauri/Info.plist +6 -0
  193. package/corpus/templates/clips/desktop/src-tauri/capabilities/default.json +1 -0
  194. package/corpus/templates/clips/desktop/src-tauri/src/clips/mod.rs +7 -3
  195. package/corpus/templates/clips/desktop/src-tauri/src/lib.rs +4 -1
  196. package/corpus/templates/clips/desktop/src-tauri/src/main.rs +8 -0
  197. package/corpus/templates/clips/desktop/src-tauri/src/recording_indicator.rs +21 -10
  198. package/corpus/templates/clips/desktop/src-tauri/src/util.rs +40 -0
  199. package/corpus/templates/clips/server/db/schema.ts +27 -0
  200. package/corpus/templates/clips/server/lib/agent-views.ts +145 -0
  201. package/corpus/templates/clips/server/lib/post-finalize-dispatch.ts +2 -1
  202. package/corpus/templates/clips/server/lib/public-agent-context.ts +7 -0
  203. package/corpus/templates/clips/server/lib/recording-share-grant.ts +79 -0
  204. package/corpus/templates/clips/server/lib/recordings.ts +51 -3
  205. package/corpus/templates/clips/server/plugins/auth.ts +1 -1
  206. package/corpus/templates/clips/server/plugins/db.ts +31 -0
  207. package/corpus/templates/clips/server/routes/api/_agent-native-background/post-finalize-worker.post.ts +56 -3
  208. package/corpus/templates/clips/server/routes/api/public-recording.get.ts +49 -17
  209. package/corpus/templates/clips/shared/recording-link.ts +43 -0
  210. package/corpus/templates/clips/shared/share-attribution.ts +4 -0
  211. package/corpus/templates/clips/shared/share-dashboard-redirect.ts +42 -0
  212. package/corpus/templates/clips/shared/view-analytics.ts +26 -0
  213. package/corpus/templates/content/.agents/skills/content/SKILL.md +5 -0
  214. package/corpus/templates/content/.agents/skills/content/references/local-file-mode.md +135 -0
  215. package/corpus/templates/content/.agents/skills/document-editing/SKILL.md +12 -0
  216. package/corpus/templates/content/.agents/skills/document-editing/references/databases.md +238 -0
  217. package/corpus/templates/content/.agents/skills/document-editing/references/document-behavior.md +91 -0
  218. package/corpus/templates/content/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  219. package/corpus/templates/content/AGENTS.md +62 -583
  220. package/corpus/templates/content/_gitignore +1 -0
  221. package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +1 -39
  222. package/corpus/templates/content/app/routes/_app._index.tsx +1 -2
  223. package/corpus/templates/content/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
  224. package/corpus/templates/content/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
  225. package/corpus/templates/content/package.json +1 -1
  226. package/corpus/templates/content/public/manifest.json +1 -1
  227. package/corpus/templates/content/server/plugins/auth.ts +1 -1
  228. package/corpus/templates/design/.agents/skills/creative-context/SKILL.md +11 -0
  229. package/corpus/templates/design/.agents/skills/design-generation/SKILL.md +50 -8
  230. package/corpus/templates/design/.agents/skills/design-generation/references/code-layers.md +81 -0
  231. package/corpus/templates/design/.agents/skills/design-generation/references/code-workspace.md +42 -0
  232. package/corpus/templates/design/.agents/skills/design-generation/references/editor-extensions.md +34 -0
  233. package/corpus/templates/design/.agents/skills/responsive-breakpoints/SKILL.md +4 -1
  234. package/corpus/templates/design/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  235. package/corpus/templates/design/.agents/skills/visual-edit/SKILL.md +17 -0
  236. package/corpus/templates/design/.generated/bridge/editor-chrome.generated.ts +8196 -0
  237. package/corpus/templates/design/.generated/bridge/embedded-wheel.generated.ts +265 -0
  238. package/corpus/templates/design/.generated/bridge/hit-test.generated.ts +642 -0
  239. package/corpus/templates/design/.generated/bridge/motion-preview.generated.ts +571 -0
  240. package/corpus/templates/design/.generated/bridge/nav.generated.ts +91 -0
  241. package/corpus/templates/design/.generated/bridge/sample.generated.ts +23 -0
  242. package/corpus/templates/design/.generated/bridge/shader-fill-preview.generated.ts +263 -0
  243. package/corpus/templates/design/.generated/bridge/shader-runtime.generated.ts +518 -0
  244. package/corpus/templates/design/.generated/bridge/tweak.generated.ts +20 -0
  245. package/corpus/templates/design/.generated/bridge/zoom.generated.ts +32 -0
  246. package/corpus/templates/design/AGENTS.md +88 -503
  247. package/corpus/templates/design/_gitignore +1 -0
  248. package/corpus/templates/design/app/components/layout/Sidebar.tsx +0 -2
  249. package/corpus/templates/design/app/routes/_index.tsx +1 -1
  250. package/corpus/templates/design/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
  251. package/corpus/templates/design/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
  252. package/corpus/templates/design/server/plugins/auth.ts +1 -1
  253. package/corpus/templates/dispatch/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  254. package/corpus/templates/dispatch/_gitignore +1 -0
  255. package/corpus/templates/dispatch/app/dispatch-extensions.tsx +1 -10
  256. package/corpus/templates/dispatch/app/routes/overview.tsx +1 -1
  257. package/corpus/templates/dispatch/changelog/2026-07-24-signing-in-now-puts-you-in-your-companys-workspace.md +6 -0
  258. package/corpus/templates/dispatch/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
  259. package/corpus/templates/dispatch/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
  260. package/corpus/templates/dispatch/package.json +1 -1
  261. package/corpus/templates/dispatch/public/manifest.json +1 -1
  262. package/corpus/templates/forms/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  263. package/corpus/templates/forms/_gitignore +1 -0
  264. package/corpus/templates/forms/app/components/layout/Sidebar.tsx +0 -35
  265. package/corpus/templates/forms/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
  266. package/corpus/templates/forms/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
  267. package/corpus/templates/forms/package.json +1 -1
  268. package/corpus/templates/forms/public/manifest.json +1 -1
  269. package/corpus/templates/forms/server/lib/public-form-ssr.ts +2 -2
  270. package/corpus/templates/forms/server/plugins/auth.ts +1 -1
  271. package/corpus/templates/macros/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  272. package/corpus/templates/macros/_gitignore +1 -0
  273. package/corpus/templates/macros/app/components/layout/AppLayout.tsx +0 -2
  274. package/corpus/templates/macros/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
  275. package/corpus/templates/macros/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
  276. package/corpus/templates/macros/package.json +1 -1
  277. package/corpus/templates/macros/server/plugins/auth.ts +2 -2
  278. package/corpus/templates/mail/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  279. package/corpus/templates/mail/_gitignore +1 -0
  280. package/corpus/templates/mail/app/components/layout/AppLayout.tsx +0 -39
  281. package/corpus/templates/mail/app/routes/$view.$threadId.tsx +1 -1
  282. package/corpus/templates/mail/app/routes/$view.tsx +1 -1
  283. package/corpus/templates/mail/app/routes/_index.tsx +1 -1
  284. package/corpus/templates/mail/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
  285. package/corpus/templates/mail/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
  286. package/corpus/templates/mail/package.json +1 -1
  287. package/corpus/templates/mail/public/manifest.json +1 -1
  288. package/corpus/templates/mail/server/plugins/auth.ts +1 -1
  289. package/corpus/templates/plan/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  290. package/corpus/templates/plan/_gitignore +1 -0
  291. package/corpus/templates/plan/agent-native.app-skill.json +1 -1
  292. package/corpus/templates/plan/app/components/layout/Sidebar.tsx +4 -9
  293. package/corpus/templates/plan/app/lib/app-config.ts +1 -1
  294. package/corpus/templates/plan/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
  295. package/corpus/templates/plan/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
  296. package/corpus/templates/plan/package.json +1 -1
  297. package/corpus/templates/plan/public/manifest.json +1 -1
  298. package/corpus/templates/plan/server/plugins/auth.ts +1 -1
  299. package/corpus/templates/slides/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  300. package/corpus/templates/slides/_gitignore +1 -0
  301. package/corpus/templates/slides/app/components/layout/Sidebar.tsx +0 -2
  302. package/corpus/templates/slides/app/routes/_index.tsx +1 -1
  303. package/corpus/templates/slides/changelog/2026-07-25-app-branding-now-uses-the-product-name-without-the-agent-nat.md +6 -0
  304. package/corpus/templates/slides/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
  305. package/corpus/templates/slides/package.json +1 -1
  306. package/corpus/templates/slides/public/manifest.json +1 -1
  307. package/corpus/templates/slides/server/plugins/auth.ts +1 -1
  308. package/corpus/templates/slides/server/plugins/db.ts +4 -0
  309. package/corpus/templates/tasks/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  310. package/corpus/templates/tasks/AGENTS.md +1 -1
  311. package/corpus/templates/tasks/_gitignore +1 -0
  312. package/dist/a2a/activity.d.ts +4 -1
  313. package/dist/a2a/activity.d.ts.map +1 -1
  314. package/dist/a2a/activity.js +27 -16
  315. package/dist/a2a/activity.js.map +1 -1
  316. package/dist/a2a/client.d.ts.map +1 -1
  317. package/dist/a2a/client.js +58 -4
  318. package/dist/a2a/client.js.map +1 -1
  319. package/dist/agent/engine/builder-engine.d.ts +1 -0
  320. package/dist/agent/engine/builder-engine.d.ts.map +1 -1
  321. package/dist/agent/engine/builder-engine.js +31 -4
  322. package/dist/agent/engine/builder-engine.js.map +1 -1
  323. package/dist/agent/run-manager.d.ts.map +1 -1
  324. package/dist/agent/run-manager.js +18 -1
  325. package/dist/agent/run-manager.js.map +1 -1
  326. package/dist/agent/run-store.d.ts +1 -0
  327. package/dist/agent/run-store.d.ts.map +1 -1
  328. package/dist/agent/run-store.js +2 -1
  329. package/dist/agent/run-store.js.map +1 -1
  330. package/dist/agent/types.d.ts +12 -1
  331. package/dist/agent/types.d.ts.map +1 -1
  332. package/dist/agent/types.js +21 -1
  333. package/dist/agent/types.js.map +1 -1
  334. package/dist/chat-threads/store.d.ts +10 -0
  335. package/dist/chat-threads/store.d.ts.map +1 -1
  336. package/dist/chat-threads/store.js +41 -0
  337. package/dist/chat-threads/store.js.map +1 -1
  338. package/dist/checkpoints/index.d.ts +1 -0
  339. package/dist/checkpoints/index.d.ts.map +1 -1
  340. package/dist/checkpoints/index.js +1 -0
  341. package/dist/checkpoints/index.js.map +1 -1
  342. package/dist/checkpoints/route-match.d.ts +8 -0
  343. package/dist/checkpoints/route-match.d.ts.map +1 -0
  344. package/dist/checkpoints/route-match.js +13 -0
  345. package/dist/checkpoints/route-match.js.map +1 -0
  346. package/dist/cli/create.d.ts +35 -4
  347. package/dist/cli/create.d.ts.map +1 -1
  348. package/dist/cli/create.js +69 -19
  349. package/dist/cli/create.js.map +1 -1
  350. package/dist/cli/index.js +19 -0
  351. package/dist/cli/index.js.map +1 -1
  352. package/dist/cli/template-baseline.d.ts +54 -0
  353. package/dist/cli/template-baseline.d.ts.map +1 -0
  354. package/dist/cli/template-baseline.js +334 -0
  355. package/dist/cli/template-baseline.js.map +1 -0
  356. package/dist/cli/template-sync.d.ts +57 -0
  357. package/dist/cli/template-sync.d.ts.map +1 -0
  358. package/dist/cli/template-sync.js +787 -0
  359. package/dist/cli/template-sync.js.map +1 -0
  360. package/dist/cli/templates-meta.d.ts.map +1 -1
  361. package/dist/cli/templates-meta.js +1 -0
  362. package/dist/cli/templates-meta.js.map +1 -1
  363. package/dist/client/AssistantChat.d.ts +2 -1
  364. package/dist/client/AssistantChat.d.ts.map +1 -1
  365. package/dist/client/AssistantChat.js +38 -10
  366. package/dist/client/AssistantChat.js.map +1 -1
  367. package/dist/client/NewWorkspaceAppFlow.d.ts.map +1 -1
  368. package/dist/client/NewWorkspaceAppFlow.js +32 -2
  369. package/dist/client/NewWorkspaceAppFlow.js.map +1 -1
  370. package/dist/client/chat/message-components.d.ts +20 -0
  371. package/dist/client/chat/message-components.d.ts.map +1 -1
  372. package/dist/client/chat/message-components.js +81 -46
  373. package/dist/client/chat/message-components.js.map +1 -1
  374. package/dist/client/chat/tool-call-display.d.ts.map +1 -1
  375. package/dist/client/chat/tool-call-display.js +14 -6
  376. package/dist/client/chat/tool-call-display.js.map +1 -1
  377. package/dist/client/error-format.d.ts.map +1 -1
  378. package/dist/client/error-format.js +13 -0
  379. package/dist/client/error-format.js.map +1 -1
  380. package/dist/client/org/OrgSwitcher.d.ts +8 -1
  381. package/dist/client/org/OrgSwitcher.d.ts.map +1 -1
  382. package/dist/client/org/OrgSwitcher.js +3 -2
  383. package/dist/client/org/OrgSwitcher.js.map +1 -1
  384. package/dist/client/org/TeamPage.d.ts.map +1 -1
  385. package/dist/client/org/TeamPage.js +1 -1
  386. package/dist/client/org/TeamPage.js.map +1 -1
  387. package/dist/client/settings/SettingsPanel.js +9 -9
  388. package/dist/client/settings/SettingsPanel.js.map +1 -1
  389. package/dist/client/settings/SettingsTabsPage.d.ts.map +1 -1
  390. package/dist/client/settings/SettingsTabsPage.js +7 -4
  391. package/dist/client/settings/SettingsTabsPage.js.map +1 -1
  392. package/dist/client/sse-event-processor.d.ts.map +1 -1
  393. package/dist/client/sse-event-processor.js +3 -0
  394. package/dist/client/sse-event-processor.js.map +1 -1
  395. package/dist/collab/awareness.d.ts +2 -2
  396. package/dist/collab/awareness.d.ts.map +1 -1
  397. package/dist/collab/struct-routes.d.ts +1 -1
  398. package/dist/data-widgets/index.d.ts +3 -0
  399. package/dist/data-widgets/index.d.ts.map +1 -1
  400. package/dist/data-widgets/index.js +33 -0
  401. package/dist/data-widgets/index.js.map +1 -1
  402. package/dist/deploy/build.d.ts.map +1 -1
  403. package/dist/deploy/build.js +11 -7
  404. package/dist/deploy/build.js.map +1 -1
  405. package/dist/eject/provider-api-definitions.d.ts +1 -0
  406. package/dist/eject/provider-api-definitions.d.ts.map +1 -1
  407. package/dist/extensions/url-safety.d.ts +9 -16
  408. package/dist/extensions/url-safety.d.ts.map +1 -1
  409. package/dist/extensions/url-safety.js +48 -4
  410. package/dist/extensions/url-safety.js.map +1 -1
  411. package/dist/file-upload/actions/upload-image.d.ts +1 -1
  412. package/dist/integrations/webhook-handler.d.ts.map +1 -1
  413. package/dist/integrations/webhook-handler.js +46 -9
  414. package/dist/integrations/webhook-handler.js.map +1 -1
  415. package/dist/notifications/routes.d.ts +2 -2
  416. package/dist/observability/routes.d.ts +3 -3
  417. package/dist/org/auto-join-domain.d.ts +3 -2
  418. package/dist/org/auto-join-domain.d.ts.map +1 -1
  419. package/dist/org/auto-join-domain.js +1 -1
  420. package/dist/org/auto-join-domain.js.map +1 -1
  421. package/dist/org/context.d.ts.map +1 -1
  422. package/dist/org/context.js +84 -28
  423. package/dist/org/context.js.map +1 -1
  424. package/dist/org/index.d.ts +1 -0
  425. package/dist/org/index.d.ts.map +1 -1
  426. package/dist/org/index.js +1 -0
  427. package/dist/org/index.js.map +1 -1
  428. package/dist/org/service-identity.d.ts +43 -0
  429. package/dist/org/service-identity.d.ts.map +1 -0
  430. package/dist/org/service-identity.js +34 -0
  431. package/dist/org/service-identity.js.map +1 -0
  432. package/dist/provider-api/actions/custom-provider-registration.d.ts +14 -14
  433. package/dist/provider-api/actions/provider-api.d.ts +13 -11
  434. package/dist/provider-api/actions/provider-api.d.ts.map +1 -1
  435. package/dist/provider-api/index.d.ts +4 -0
  436. package/dist/provider-api/index.d.ts.map +1 -1
  437. package/dist/provider-api/index.js +17 -1
  438. package/dist/provider-api/index.js.map +1 -1
  439. package/dist/scripts/docs/search.d.ts.map +1 -1
  440. package/dist/scripts/docs/search.js +12 -1
  441. package/dist/scripts/docs/search.js.map +1 -1
  442. package/dist/server/agent-chat/context-tools.d.ts.map +1 -1
  443. package/dist/server/agent-chat/context-tools.js +3 -3
  444. package/dist/server/agent-chat/context-tools.js.map +1 -1
  445. package/dist/server/agent-chat/framework-prompts.d.ts +8 -3
  446. package/dist/server/agent-chat/framework-prompts.d.ts.map +1 -1
  447. package/dist/server/agent-chat/framework-prompts.js +33 -62
  448. package/dist/server/agent-chat/framework-prompts.js.map +1 -1
  449. package/dist/server/agent-chat-plugin.d.ts.map +1 -1
  450. package/dist/server/agent-chat-plugin.js +16 -10
  451. package/dist/server/agent-chat-plugin.js.map +1 -1
  452. package/dist/server/agent-engine-api-key-route.d.ts +1 -1
  453. package/dist/server/agents-bundle.d.ts +18 -0
  454. package/dist/server/agents-bundle.d.ts.map +1 -1
  455. package/dist/server/agents-bundle.js +70 -4
  456. package/dist/server/agents-bundle.js.map +1 -1
  457. package/dist/server/auth.d.ts.map +1 -1
  458. package/dist/server/auth.js +4 -3
  459. package/dist/server/auth.js.map +1 -1
  460. package/dist/server/builder-browser.d.ts.map +1 -1
  461. package/dist/server/builder-browser.js +43 -19
  462. package/dist/server/builder-browser.js.map +1 -1
  463. package/dist/server/core-routes-plugin.js +2 -2
  464. package/dist/server/core-routes-plugin.js.map +1 -1
  465. package/dist/server/credential-provider.d.ts +38 -2
  466. package/dist/server/credential-provider.d.ts.map +1 -1
  467. package/dist/server/credential-provider.js +142 -64
  468. package/dist/server/credential-provider.js.map +1 -1
  469. package/dist/server/index.d.ts +1 -1
  470. package/dist/server/index.d.ts.map +1 -1
  471. package/dist/server/index.js +1 -1
  472. package/dist/server/index.js.map +1 -1
  473. package/dist/server/prompts/framework-core-compact.d.ts +1 -1
  474. package/dist/server/prompts/framework-core-compact.d.ts.map +1 -1
  475. package/dist/server/prompts/framework-core-compact.js +7 -13
  476. package/dist/server/prompts/framework-core-compact.js.map +1 -1
  477. package/dist/server/prompts/framework-core.d.ts +1 -1
  478. package/dist/server/prompts/framework-core.d.ts.map +1 -1
  479. package/dist/server/prompts/framework-core.js +10 -21
  480. package/dist/server/prompts/framework-core.js.map +1 -1
  481. package/dist/server/prompts/index.d.ts +1 -1
  482. package/dist/server/prompts/index.d.ts.map +1 -1
  483. package/dist/server/prompts/index.js +1 -1
  484. package/dist/server/prompts/index.js.map +1 -1
  485. package/dist/server/prompts/shared-rules.d.ts +16 -10
  486. package/dist/server/prompts/shared-rules.d.ts.map +1 -1
  487. package/dist/server/prompts/shared-rules.js +19 -10
  488. package/dist/server/prompts/shared-rules.js.map +1 -1
  489. package/dist/server/ssr-handler.d.ts +1 -1
  490. package/dist/server/ssr-handler.d.ts.map +1 -1
  491. package/dist/server/ssr-handler.js +10 -3
  492. package/dist/server/ssr-handler.js.map +1 -1
  493. package/dist/server/transcribe-voice.d.ts +1 -1
  494. package/dist/settings/user-settings.d.ts.map +1 -1
  495. package/dist/settings/user-settings.js +13 -1
  496. package/dist/settings/user-settings.js.map +1 -1
  497. package/dist/shared/cache-control.d.ts +52 -0
  498. package/dist/shared/cache-control.d.ts.map +1 -1
  499. package/dist/shared/cache-control.js +107 -0
  500. package/dist/shared/cache-control.js.map +1 -1
  501. package/dist/templates/chat/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  502. package/dist/templates/chat/_gitignore +1 -0
  503. package/dist/templates/chat/app/components/layout/Sidebar.tsx +0 -7
  504. package/dist/templates/chat/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
  505. package/dist/templates/default/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  506. package/dist/templates/default/app/root.tsx +1 -1
  507. package/dist/templates/default/public/manifest.json +2 -2
  508. package/dist/templates/headless/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  509. package/dist/templates/workspace-core/.agents/skills/performance/SKILL.md +19 -0
  510. package/dist/templates/workspace-core/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  511. package/dist/templates/workspace-core/.agents/skills/visual-answer/SKILL.md +1 -0
  512. package/dist/vite/agents-bundle-plugin.d.ts.map +1 -1
  513. package/dist/vite/agents-bundle-plugin.js +8 -7
  514. package/dist/vite/agents-bundle-plugin.js.map +1 -1
  515. package/dist/vite/client.d.ts.map +1 -1
  516. package/dist/vite/client.js +66 -1
  517. package/dist/vite/client.js.map +1 -1
  518. package/docs/content/actions.mdx +2 -2
  519. package/docs/content/agent-surfaces.mdx +1 -1
  520. package/docs/content/authentication.mdx +2 -0
  521. package/docs/content/deployment.mdx +36 -0
  522. package/docs/content/http-api.mdx +266 -0
  523. package/docs/content/syncing-template-changes.mdx +159 -0
  524. package/package.json +4 -3
  525. package/src/a2a/activity.ts +38 -27
  526. package/src/a2a/client.ts +57 -4
  527. package/src/agent/engine/builder-engine.ts +35 -4
  528. package/src/agent/run-manager.ts +20 -1
  529. package/src/agent/run-store.ts +4 -1
  530. package/src/agent/types.ts +28 -8
  531. package/src/chat-threads/store.ts +45 -0
  532. package/src/checkpoints/index.ts +2 -0
  533. package/src/checkpoints/route-match.ts +13 -0
  534. package/src/cli/create.ts +105 -17
  535. package/src/cli/index.ts +20 -0
  536. package/src/cli/template-baseline.ts +410 -0
  537. package/src/cli/template-sync.ts +1004 -0
  538. package/src/cli/templates-meta.ts +1 -0
  539. package/src/client/AssistantChat.tsx +38 -12
  540. package/src/client/NewWorkspaceAppFlow.tsx +75 -10
  541. package/src/client/chat/message-components.tsx +127 -66
  542. package/src/client/chat/tool-call-display.tsx +29 -5
  543. package/src/client/error-format.ts +18 -0
  544. package/src/client/org/OrgSwitcher.tsx +30 -8
  545. package/src/client/org/TeamPage.tsx +7 -6
  546. package/src/client/settings/SettingsPanel.tsx +9 -9
  547. package/src/client/settings/SettingsTabsPage.tsx +12 -2
  548. package/src/client/sse-event-processor.ts +3 -0
  549. package/src/data-widgets/index.ts +41 -0
  550. package/src/deploy/build.ts +11 -9
  551. package/src/extensions/url-safety.ts +67 -4
  552. package/src/integrations/webhook-handler.ts +63 -9
  553. package/src/org/auto-join-domain.ts +4 -3
  554. package/src/org/context.ts +108 -39
  555. package/src/org/index.ts +5 -0
  556. package/src/org/service-identity.ts +60 -0
  557. package/src/provider-api/index.ts +22 -1
  558. package/src/scripts/docs/search.ts +12 -1
  559. package/src/server/__snapshots__/agent-chat-plugin.surface.spec.ts.snap +25 -36
  560. package/src/server/agent-chat/context-tools.ts +9 -4
  561. package/src/server/agent-chat/framework-prompts.ts +38 -66
  562. package/src/server/agent-chat-plugin.ts +17 -10
  563. package/src/server/agents-bundle.ts +84 -5
  564. package/src/server/auth.ts +4 -3
  565. package/src/server/builder-browser.ts +47 -19
  566. package/src/server/core-routes-plugin.ts +2 -2
  567. package/src/server/credential-provider.ts +209 -68
  568. package/src/server/index.ts +3 -0
  569. package/src/server/prompts/framework-core-compact.ts +6 -13
  570. package/src/server/prompts/framework-core.ts +9 -21
  571. package/src/server/prompts/index.ts +0 -1
  572. package/src/server/prompts/shared-rules.ts +19 -11
  573. package/src/server/ssr-handler.ts +13 -2
  574. package/src/settings/user-settings.ts +13 -1
  575. package/src/shared/cache-control.ts +141 -0
  576. package/src/templates/chat/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  577. package/src/templates/chat/_gitignore +1 -0
  578. package/src/templates/chat/app/components/layout/Sidebar.tsx +0 -7
  579. package/src/templates/chat/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +6 -0
  580. package/src/templates/default/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  581. package/src/templates/default/app/root.tsx +1 -1
  582. package/src/templates/default/public/manifest.json +2 -2
  583. package/src/templates/headless/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  584. package/src/templates/workspace-core/.agents/skills/performance/SKILL.md +19 -0
  585. package/src/templates/workspace-core/.agents/skills/upgrade-agent-native/SKILL.md +24 -2
  586. package/src/templates/workspace-core/.agents/skills/visual-answer/SKILL.md +1 -0
  587. package/src/vite/agents-bundle-plugin.ts +7 -6
  588. package/src/vite/client.ts +69 -3
@@ -27,11 +27,11 @@ export declare function resolveAgentEngineApiKeyWriteTarget(event: H3Event, scop
27
27
  export declare function createAgentEngineApiKeyHandler(): import("h3").EventHandlerWithFetch<import("h3").EventHandlerRequest, Promise<{
28
28
  error: any;
29
29
  } | {
30
- error?: undefined;
31
30
  ok: boolean;
32
31
  key: string;
33
32
  baseUrlKey?: string;
34
33
  scope: AgentEngineApiKeyScope;
34
+ error?: undefined;
35
35
  }>>;
36
36
  export {};
37
37
  //# sourceMappingURL=agent-engine-api-key-route.d.ts.map
@@ -56,6 +56,16 @@ export interface Skill {
56
56
  * `ls` call. Empty array if the skill is single-file.
57
57
  */
58
58
  extraFiles: string[];
59
+ /**
60
+ * Text content of eligible sub-files (progressive-disclosure references),
61
+ * keyed by the same skill-dir-relative path used in `extraFiles`. Only
62
+ * populated for text extensions under the per-file/per-skill caps in
63
+ * `readSkillsDir` — files that exist but were skipped for size still show
64
+ * up in `extraFiles`, just not here. This is what makes reference content
65
+ * actually readable by the runtime agent (via docs-search); it is never
66
+ * injected into a prompt.
67
+ */
68
+ files: Record<string, string>;
59
69
  }
60
70
  export interface AgentsBundle {
61
71
  /** Contents of the template's AGENTS.md (empty string if missing). */
@@ -142,6 +152,14 @@ export declare function getRuntimeSkills(bundle: AgentsBundle): Skill[];
142
152
  * skills that are intended only for the deployed in-app agent.
143
153
  */
144
154
  export declare function getDevelopmentSkills(bundle: AgentsBundle): Skill[];
155
+ export declare function skillDocsSlug(name: string): string;
156
+ /**
157
+ * Slug docs-search resolves a skill sub-file (reference) content by. Kept in
158
+ * sync with the `skill-<name>--<subpath-slug>` docs it emits in
159
+ * `scripts/docs/search.ts` so the prompt hint always points at something the
160
+ * agent can actually read.
161
+ */
162
+ export declare function skillSubfileDocsSlug(skillName: string, relPath: string): string;
145
163
  export declare function generateSkillsPromptBlock(bundle: AgentsBundle): string;
146
164
  export declare function generateDevelopmentSkillsPromptBlock(bundle: AgentsBundle): string;
147
165
  /** For tests — reset the module cache. */
@@ -1 +1 @@
1
- {"version":3,"file":"agents-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R;AAED,0CAA0C;AAC1C,wBAAgB,wBAAwB,IAAI,IAAI,CAE/C"}
@@ -109,6 +109,22 @@ const TEMPLATE_SKILLS_DIRS = [
109
109
  path.join(".agents", "skills"),
110
110
  path.join(".agent", "skills"),
111
111
  ];
112
+ /**
113
+ * Extensions eligible to have their content inlined into `Skill.files`.
114
+ * Binary/asset sub-files (images, scripts, etc.) are always listed in
115
+ * `extraFiles` but never read into memory.
116
+ */
117
+ const READABLE_SUBFILE_EXTENSIONS = new Set([".md", ".txt", ".json"]);
118
+ /**
119
+ * Per-file and per-skill caps on inlined reference content. This content is
120
+ * bundled into the virtual module (and therefore the server bundle) for
121
+ * every deployment target, so it must stay small even though it's never
122
+ * added to a prompt — only fetched on demand via docs-search. Measured
123
+ * against this repo's skills (largest single sub-file ~20KB, largest
124
+ * per-skill sub-file total ~83KB), these caps have generous headroom.
125
+ */
126
+ const MAX_SUBFILE_BYTES = 64 * 1024;
127
+ const MAX_SKILL_FILES_BYTES = 256 * 1024;
112
128
  /**
113
129
  * Read one skills directory into a `Record<string, Skill>`. Extracted so
114
130
  * both the template and workspace-core paths can reuse it. `dirPrefix` is
@@ -135,6 +151,8 @@ function readSkillsDir(skillsDir, rootForRelative, out, skipExistingNames) {
135
151
  if (skipExistingNames && out[name])
136
152
  continue; // Template wins
137
153
  const extraFiles = [];
154
+ const files = {};
155
+ let skillFilesBytes = 0;
138
156
  try {
139
157
  const walk = (subdir, prefix) => {
140
158
  for (const e of fs.readdirSync(subdir, { withFileTypes: true })) {
@@ -150,6 +168,20 @@ function readSkillsDir(skillsDir, rootForRelative, out, skipExistingNames) {
150
168
  }
151
169
  else if (e.isFile() && e.name !== "SKILL.md") {
152
170
  extraFiles.push(rel);
171
+ const ext = path.extname(e.name).toLowerCase();
172
+ if (!READABLE_SUBFILE_EXTENSIONS.has(ext))
173
+ continue;
174
+ try {
175
+ const stat = fs.statSync(abs);
176
+ if (stat.size > MAX_SUBFILE_BYTES)
177
+ continue;
178
+ if (skillFilesBytes + stat.size > MAX_SKILL_FILES_BYTES) {
179
+ continue;
180
+ }
181
+ files[rel] = fs.readFileSync(abs, "utf-8");
182
+ skillFilesBytes += stat.size;
183
+ }
184
+ catch { }
153
185
  }
154
186
  }
155
187
  };
@@ -166,6 +198,7 @@ function readSkillsDir(skillsDir, rootForRelative, out, skipExistingNames) {
166
198
  content,
167
199
  dir: path.relative(rootForRelative, skillDirAbs).replace(/\\/g, "/"),
168
200
  extraFiles,
201
+ files,
169
202
  };
170
203
  }
171
204
  catch {
@@ -300,20 +333,53 @@ export function getRuntimeSkills(bundle) {
300
333
  export function getDevelopmentSkills(bundle) {
301
334
  return Object.values(bundle.skills).filter((skill) => skill.meta.scope !== "runtime");
302
335
  }
303
- function skillDocsSlug(name) {
336
+ export function skillDocsSlug(name) {
304
337
  return `skill-${name
305
338
  .trim()
306
339
  .toLowerCase()
307
340
  .replace(/[^a-z0-9]+/g, "-")
308
341
  .replace(/^-+|-+$/g, "")}`;
309
342
  }
343
+ function subfileSlugSuffix(relPath) {
344
+ return relPath
345
+ .replace(/\.[^./]+$/, "")
346
+ .trim()
347
+ .toLowerCase()
348
+ .replace(/[^a-z0-9]+/g, "-")
349
+ .replace(/^-+|-+$/g, "");
350
+ }
351
+ /**
352
+ * Slug docs-search resolves a skill sub-file (reference) content by. Kept in
353
+ * sync with the `skill-<name>--<subpath-slug>` docs it emits in
354
+ * `scripts/docs/search.ts` so the prompt hint always points at something the
355
+ * agent can actually read.
356
+ */
357
+ export function skillSubfileDocsSlug(skillName, relPath) {
358
+ return `${skillDocsSlug(skillName)}--${subfileSlugSuffix(relPath)}`;
359
+ }
310
360
  function generateSkillsPromptBlockForEntries(entries, mode) {
311
361
  if (entries.length === 0)
312
362
  return "";
313
363
  const lines = entries.map((s) => {
314
- const extras = s.extraFiles.length > 0
315
- ? ` (also contains: ${s.extraFiles.join(", ")})`
316
- : "";
364
+ let extras = "";
365
+ if (s.extraFiles.length > 0) {
366
+ if (mode === "runtime") {
367
+ const readable = s.extraFiles.filter((f) => f in s.files);
368
+ const unreadable = s.extraFiles.filter((f) => !(f in s.files));
369
+ const parts = [];
370
+ if (readable.length > 0) {
371
+ const refIds = readable.map((f) => subfileSlugSuffix(f)).join(", ");
372
+ parts.push(`refs via docs-search --slug "${skillDocsSlug(s.meta.name)}--<ref>": ${refIds}`);
373
+ }
374
+ if (unreadable.length > 0) {
375
+ parts.push(`also contains: ${unreadable.join(", ")}`);
376
+ }
377
+ extras = ` (${parts.join("; ")})`;
378
+ }
379
+ else {
380
+ extras = ` (also contains: ${s.extraFiles.join(", ")})`;
381
+ }
382
+ }
317
383
  const runtimeHint = mode === "runtime"
318
384
  ? ` Read with \`docs-search --slug "${skillDocsSlug(s.meta.name)}"\` before starting a task it applies to.`
319
385
  : "";
@@ -1 +1 @@
1
- {"version":3,"file":"agents-bundle.js","sourceRoot":"","sources":["../../src/server/agents-bundle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAYH,MAAM,CAAC,MAAM,mBAAmB,GAAe,MAAM,CAAC;AAoDtD,MAAM,KAAK,GAAiB,EAAE,QAAQ,EAAE,EAAE,EAAE,iBAAiB,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;AAEhF,IAAI,MAAM,GAAwB,IAAI,CAAC;AAEvC;;;;;GAKG;AACH,MAAM,eAAe,GAAG,IAAI,GAAG,EAAU,CAAC;AAC1C,MAAM,UAAU,mBAAmB,CAAC,GAAuB;IACzD,IAAI,CAAC,GAAG;QAAE,OAAO,mBAAmB,CAAC;IACrC,MAAM,KAAK,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACvC,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,KAAK,IAAI,KAAK,KAAK,MAAM,EAAE,CAAC;QAC/D,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IAAI,KAAK,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,KAAK,CA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AAC,MAAM,GAAG,CAAC;YACrB,CAAC,CAAC,oBAAoB,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG;YAChD,CAAC,CAAC,EAAE,CAAC;QACT,MAAM,WAAW,GACf,IAAI,KAAK,SAAS;YAChB,CAAC,CAAC,oCAAoC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,2CAA2C;YAC3G,CAAC,CAAC,EAAE,CAAC;QACT,OAAO,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,WAAW,CAAC,CAAC,GAAG,SAAS,CAAC,CAAC,IAAI,CAAC,WAAW,IAAI,kBAAkB,GAAG,MAAM,GAAG,WAAW,EAAE,CAAC;IACtH,CAAC,CAAC,CAAC;IAEH,MAAM,QAAQ,GACZ,IAAI,KAAK,SAAS;QAChB,CAAC,CAAC;;qEAE6D;QAC/D,CAAC,CAAC;;qEAE6D,CAAC;IAEpE,OAAO;;;EAGP,QAAQ;;;EAGR,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;UACR,CAAC;AACX,CAAC;AAED,MAAM,UAAU,yBAAyB,CAAC,MAAoB;IAC5D,OAAO,mCAAmC,CACxC,gBAAgB,CAAC,MAAM,CAAC,EACxB,SAAS,CACV,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,oCAAoC,CAClD,MAAoB;IAEpB,OAAO,mCAAmC,CACxC,oBAAoB,CAAC,MAAM,CAAC,EAC5B,aAAa,CACd,CAAC;AACJ,CAAC;AAED,0CAA0C;AAC1C,MAAM,UAAU,wBAAwB;IACtC,MAAM,GAAG,IAAI,CAAC;AAChB,CAAC","sourcesContent":["/**\n * Agents bundle — loads AGENTS.md and .agents/skills/ from the template.\n * The legacy singular .agent/skills/ directory is also accepted as an alias.\n *\n * This is the single source of truth the framework's agent uses to mirror what\n * Claude Code / Codex / any other agent would see when running locally in the\n * repo. The filesystem is the canonical source; this module is just a loader\n * that works both in dev (direct fs read) and production (content bundled at\n * build time via the `virtual:agents-bundle` Vite plugin).\n *\n * Resolution order inside `loadAgentsBundle()`:\n * 1. Virtual module (`virtual:agents-bundle`) — inlined at build time by the\n * framework's Vite plugin. This is the ONLY path that works on edge\n * runtimes (Cloudflare Workers) where `readFileSync` doesn't exist.\n * 2. Filesystem fallback — `process.cwd()/AGENTS.md` +\n * `process.cwd()/.agents/skills/` (or legacy `.agent/skills/`). Only reliable in local dev and Node\n * production (`agent-native start`); not on Netlify/Vercel/CF at runtime.\n * 3. Empty bundle — everything silently returns empty strings.\n *\n * Result is cached in module scope so it's only computed once per cold start.\n */\n\n/**\n * Where a skill is meant to be used:\n * - `runtime` — only the in-app agent at runtime (not the human's coding agent).\n * - `dev` — only the human's development/coding agent (e.g. Claude Code).\n * EXCLUDED from the runtime agent's prompt block and docs-search.\n * - `both` — loaded everywhere. This is the default when `scope` is absent\n * or set to an unrecognized value (fully backward compatible).\n */\nexport type SkillScope = \"runtime\" | \"dev\" | \"both\";\n\nexport const DEFAULT_SKILL_SCOPE: SkillScope = \"both\";\n\nexport interface SkillMeta {\n name: string;\n description: string;\n /**\n * Audience for the skill. Defaults to `both` when the SKILL.md frontmatter\n * omits `scope` or specifies an unknown value. `dev`-scoped skills are hidden\n * from the runtime agent everywhere (prompt block + docs-search).\n */\n scope: SkillScope;\n}\n\nexport interface Skill {\n meta: SkillMeta;\n /** Contents of SKILL.md (the entry file of the skill). */\n content: string;\n /**\n * Filesystem path to the skill directory, relative to the template root\n * (e.g. `.agents/skills/create-deck`). The agent can read any file here via\n * bash in dev — skills are folders, not single files, and may contain\n * supporting assets, scripts, or additional markdown.\n */\n dir: string;\n /**\n * Files inside the skill directory (relative to the skill dir), excluding\n * `SKILL.md`. Lets the agent know what else is available without a separate\n * `ls` call. Empty array if the skill is single-file.\n */\n extraFiles: string[];\n}\n\nexport interface AgentsBundle {\n /** Contents of the template's AGENTS.md (empty string if missing). */\n agentsMd: string;\n /**\n * Contents of the workspace core's AGENTS.md, if the app is inside an\n * enterprise monorepo with a `workspaceCore` configured. Empty string\n * otherwise. Sits between the framework system prompt and the template's\n * AGENTS.md in the instruction stack.\n */\n workspaceAgentsMd?: string;\n /**\n * Map from skill name → skill content. Contains skills merged from the\n * workspace core layer (if present) and the template layer. On name\n * collision, the template's version wins so apps can override a shared\n * enterprise skill by dropping a same-named file under\n * `.agents/skills/<name>/`.\n */\n skills: Record<string, Skill>;\n}\n\nconst EMPTY: AgentsBundle = { agentsMd: \"\", workspaceAgentsMd: \"\", skills: {} };\n\nlet cached: AgentsBundle | null = null;\n\n/**\n * Coerce a raw frontmatter `scope` value into a known `SkillScope`. Unknown,\n * empty, or malformed values fall back to the default (`both`) so a typo never\n * silently hides a skill from the runtime agent. Optionally warns once per\n * distinct bad value to aid debugging without spamming logs.\n */\nconst warnedBadScopes = new Set<string>();\nexport function normalizeSkillScope(raw: string | undefined): SkillScope {\n if (!raw) return DEFAULT_SKILL_SCOPE;\n const value = raw.trim().toLowerCase();\n if (value === \"runtime\" || value === \"dev\" || value === \"both\") {\n return value;\n }\n if (value && !warnedBadScopes.has(value)) {\n warnedBadScopes.add(value);\n console.warn(\n `[agents-bundle] Unknown skill scope \"${raw}\" — treating as \"${DEFAULT_SKILL_SCOPE}\". Valid values: runtime, dev, both.`,\n );\n }\n return DEFAULT_SKILL_SCOPE;\n}\n\n/**\n * Parse the YAML frontmatter at the top of a skill file.\n * Only pulls out `name`, `description`, and `scope` — deliberately simple, no\n * YAML lib.\n * Handles:\n * - Inline: `description: Some text`\n * - Folded scalar: `description: >-\\n multi\\n line` → \"multi line\"\n * - Literal scalar: `description: |\\n multi\\n line` → \"multi\\nline\"\n */\nexport function parseSkillFrontmatter(content: string): Partial<SkillMeta> {\n const match = content.match(/^---\\r?\\n([\\s\\S]+?)\\r?\\n---/);\n if (!match) return {};\n const lines = match[1].split(/\\r?\\n/);\n const result: Partial<SkillMeta> = {};\n\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i];\n const keyMatch = line.match(/^([a-zA-Z_][a-zA-Z0-9_-]*):\\s*(.*)$/);\n if (!keyMatch) continue;\n const [, key, valueRaw] = keyMatch;\n const trimmed = valueRaw.trim();\n\n const isFolded = trimmed === \">\" || trimmed === \">-\";\n const isLiteral = trimmed === \"|\" || trimmed === \"|-\";\n\n let value: string;\n if (isFolded || isLiteral) {\n // Collect subsequent indented lines (at least one leading space).\n const block: string[] = [];\n let j = i + 1;\n while (j < lines.length) {\n const next = lines[j];\n if (next.length === 0) {\n block.push(\"\");\n j++;\n continue;\n }\n if (!/^\\s/.test(next)) break;\n block.push(next.replace(/^\\s+/, \"\"));\n j++;\n }\n // Trim trailing blank lines\n while (block.length > 0 && block[block.length - 1] === \"\") block.pop();\n value = isFolded\n ? block.filter((l) => l !== \"\").join(\" \")\n : block.join(\"\\n\");\n i = j - 1;\n } else {\n value = trimmed;\n }\n\n if (key === \"name\" && value) result.name = value;\n else if (key === \"description\" && value) result.description = value;\n else if (key === \"scope\" && value)\n result.scope = normalizeSkillScope(value);\n }\n\n return result;\n}\n\nimport fs from \"node:fs\";\nimport path from \"node:path\";\n\nconst TEMPLATE_SKILLS_DIRS = [\n path.join(\".agents\", \"skills\"),\n path.join(\".agent\", \"skills\"),\n] as const;\n\n/**\n * Paths to a workspace-core's agent resources, for merging into a template's\n * bundle. All fields optional — pass null for any missing piece.\n */\nexport interface WorkspaceAgentsSource {\n /** Absolute path to the workspace core's skills/ directory. */\n skillsDir: string | null;\n /** Absolute path to the workspace core's AGENTS.md. */\n agentsMdPath: string | null;\n /** Root dir (used to compute `dir` paths for workspace-core skills). */\n rootDir: string;\n}\n\n/**\n * Read one skills directory into a `Record<string, Skill>`. Extracted so\n * both the template and workspace-core paths can reuse it. `dirPrefix` is\n * the display path that will be reported to the agent (e.g.\n * `.agents/skills/<name>` for templates, or\n * `<workspace-shared-package>/.agents/skills/<name>` for the workspace layer).\n */\nfunction readSkillsDir(\n skillsDir: string,\n rootForRelative: string,\n out: Record<string, Skill>,\n skipExistingNames: boolean,\n): void {\n if (!fs.existsSync(skillsDir)) return;\n const entries = fs.readdirSync(skillsDir, { withFileTypes: true });\n for (const entry of entries) {\n if (!entry.isDirectory() && !entry.isSymbolicLink()) continue;\n const skillDirAbs = path.join(skillsDir, entry.name);\n const skillFile = path.join(skillDirAbs, \"SKILL.md\");\n try {\n const realSkillFile = fs.realpathSync(skillFile);\n if (!fs.existsSync(realSkillFile)) continue;\n const content = fs.readFileSync(realSkillFile, \"utf-8\");\n const meta = parseSkillFrontmatter(content);\n const name = meta.name ?? entry.name;\n if (skipExistingNames && out[name]) continue; // Template wins\n\n const extraFiles: string[] = [];\n try {\n const walk = (subdir: string, prefix: string) => {\n for (const e of fs.readdirSync(subdir, { withFileTypes: true })) {\n const abs = path.join(subdir, e.name);\n const rel = prefix ? `${prefix}/${e.name}` : e.name;\n if (e.isDirectory() || e.isSymbolicLink()) {\n try {\n const stat = fs.statSync(abs);\n if (stat.isDirectory()) walk(abs, rel);\n } catch {}\n } else if (e.isFile() && e.name !== \"SKILL.md\") {\n extraFiles.push(rel);\n }\n }\n };\n walk(skillDirAbs, \"\");\n } catch {}\n extraFiles.sort();\n\n out[name] = {\n meta: {\n name,\n description: meta.description ?? \"\",\n scope: meta.scope ?? DEFAULT_SKILL_SCOPE,\n },\n content,\n dir: path.relative(rootForRelative, skillDirAbs).replace(/\\\\/g, \"/\"),\n extraFiles,\n };\n } catch {\n // Skip unreadable skills\n }\n }\n}\n\n/**\n * Read AGENTS.md + all skills directly from the filesystem rooted at `cwd`.\n * Optionally also reads a workspace-core's AGENTS.md and skills directory\n * and merges them in (template wins on name collisions). Used by both the\n * Vite plugin (at build time) and the runtime fallback (in dev / Node prod).\n *\n * Synchronous — the Vite plugin's load hook calls it inline during the build.\n */\nexport function readAgentsBundleFromFs(\n cwd: string,\n workspaceSource: WorkspaceAgentsSource | null = null,\n): AgentsBundle {\n let agentsMd = \"\";\n try {\n const agentsMdPath = path.join(cwd, \"AGENTS.md\");\n if (fs.existsSync(agentsMdPath)) {\n agentsMd = fs.readFileSync(agentsMdPath, \"utf-8\");\n }\n } catch {}\n\n let workspaceAgentsMd = \"\";\n if (workspaceSource?.agentsMdPath) {\n try {\n if (fs.existsSync(workspaceSource.agentsMdPath)) {\n workspaceAgentsMd = fs.readFileSync(\n workspaceSource.agentsMdPath,\n \"utf-8\",\n );\n }\n } catch {}\n }\n\n // Merge skills: template first (so its entries are authoritative), then\n // workspace-core with skipExistingNames=true so same-named skills don't\n // overwrite the template's. `.agents/skills` is canonical; `.agent/skills`\n // is accepted as a legacy alias and does not override canonical skills.\n const skills: Record<string, Skill> = {};\n for (const [index, relSkillsDir] of TEMPLATE_SKILLS_DIRS.entries()) {\n try {\n readSkillsDir(path.join(cwd, relSkillsDir), cwd, skills, index > 0);\n } catch {}\n }\n\n if (workspaceSource?.skillsDir) {\n try {\n readSkillsDir(\n workspaceSource.skillsDir,\n workspaceSource.rootDir,\n skills,\n true,\n );\n } catch {}\n }\n\n return { agentsMd, workspaceAgentsMd, skills };\n}\n\n/**\n * Load the agents bundle. Returns a cached result on subsequent calls.\n * Tries the virtual module first (works everywhere, including edge), then\n * falls back to filesystem reads from `process.cwd()` — which, when a\n * workspace core is present, also merges in the workspace core's skills\n * and AGENTS.md.\n */\nexport async function loadAgentsBundle(): Promise<AgentsBundle> {\n if (cached) return cached;\n\n // 1. Try the Vite-emitted virtual module. This is the path that works on\n // every deployment target because the content is inlined at build time.\n // The Vite plugin itself is responsible for merging workspace-core\n // content into the bundle it emits.\n try {\n // @ts-expect-error — virtual module is resolved at build time by our\n // Vite plugin; nothing exists at this path on disk.\n const mod = await import(\"virtual:agents-bundle\");\n if (mod && mod.default) {\n cached = mod.default as AgentsBundle;\n return cached;\n }\n } catch {\n // Virtual module not available — fall through to filesystem.\n }\n\n // 2. Filesystem fallback — works in dev / Node prod. If a workspace core\n // is present in the ancestor chain, merge its skills + AGENTS.md in.\n try {\n let workspaceSource: WorkspaceAgentsSource | null = null;\n try {\n const { getWorkspaceCoreExports } =\n await import(\"../deploy/workspace-core.js\");\n const ws = await getWorkspaceCoreExports(process.cwd());\n if (ws) {\n workspaceSource = {\n skillsDir: ws.skillsDir,\n agentsMdPath: ws.agentsMdPath,\n rootDir: ws.packageDir,\n };\n }\n } catch {\n // workspace-core discovery isn't available (e.g. edge runtime).\n }\n cached = readAgentsBundleFromFs(process.cwd(), workspaceSource);\n return cached;\n } catch {\n cached = EMPTY;\n return cached;\n }\n}\n\n/**\n * Generate the `<skills>` block to inject into the system prompt.\n *\n * Skills are folders at `.agents/skills/<name>/` (or legacy\n * `.agent/skills/<name>/`) containing a `SKILL.md` entry file plus any number\n * of supporting files (additional markdown, examples, images, scripts). This\n * block lists what's available and how to read them.\n *\n * In dev mode the agent has bash access and reads skills via `cat` — exactly\n * like running `claude` locally in the repo. In production mode the agent has\n * no bash; templates that need skill content at runtime should inline the\n * critical parts directly in `AGENTS.md`.\n */\n/**\n * Skills visible to the agent-native RUNTIME agent. Excludes `scope: dev`\n * skills (those are for the human's coding agent only). Skills with no scope,\n * `scope: runtime`, or `scope: both` are all included. Use this anywhere the\n * runtime agent's view of skills is built (prompt block + docs-search) so a\n * dev-scoped skill is invisible to the runtime agent everywhere.\n */\nexport function getRuntimeSkills(bundle: AgentsBundle): Skill[] {\n return Object.values(bundle.skills).filter(\n (skill) => skill.meta.scope !== \"dev\",\n );\n}\n\n/**\n * Skills visible to development/coding agents. Excludes `scope: runtime`\n * skills that are intended only for the deployed in-app agent.\n */\nexport function getDevelopmentSkills(bundle: AgentsBundle): Skill[] {\n return Object.values(bundle.skills).filter(\n (skill) => skill.meta.scope !== \"runtime\",\n );\n}\n\nfunction skillDocsSlug(name: string): string {\n return `skill-${name\n .trim()\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, \"-\")\n .replace(/^-+|-+$/g, \"\")}`;\n}\n\nfunction generateSkillsPromptBlockForEntries(\n entries: Skill[],\n mode: \"runtime\" | \"development\",\n): string {\n if (entries.length === 0) return \"\";\n\n const lines = entries.map((s) => {\n const extras =\n s.extraFiles.length > 0\n ? ` (also contains: ${s.extraFiles.join(\", \")})`\n : \"\";\n const runtimeHint =\n mode === \"runtime\"\n ? ` Read with \\`docs-search --slug \"${skillDocsSlug(s.meta.name)}\"\\` before starting a task it applies to.`\n : \"\";\n return `- \\`${s.meta.name}\\` at \\`${s.dir}/\\` — ${s.meta.description || \"(no description)\"}${extras}${runtimeHint}`;\n });\n\n const readHint =\n mode === \"runtime\"\n ? `To read a skill in the in-app runtime agent:\n \\`docs-search --slug \"skill-<skill-name>\"\\`\n \\`docs-search --query \"<topic>\"\\` to discover matching docs/skills`\n : `To read a skill in dev mode (when you have bash access):\n \\`bash(command=\"cat <skill-dir>/SKILL.md\")\\`\n \\`bash(command=\"ls <skill-dir>/\")\\` to see all files in the folder`;\n\n return `<skills>\nThe following skills live in the repo, usually at \\`.agents/skills/<name>/\\` (legacy \\`.agent/skills/<name>/\\` is also supported). Each skill is a folder containing a \\`SKILL.md\\` entry file and sometimes supporting files. Read a skill BEFORE starting a task it applies to.\n\n${readHint}\n\nAvailable skills:\n${lines.join(\"\\n\")}\n</skills>`;\n}\n\nexport function generateSkillsPromptBlock(bundle: AgentsBundle): string {\n return generateSkillsPromptBlockForEntries(\n getRuntimeSkills(bundle),\n \"runtime\",\n );\n}\n\nexport function generateDevelopmentSkillsPromptBlock(\n bundle: AgentsBundle,\n): string {\n return generateSkillsPromptBlockForEntries(\n getDevelopmentSkills(bundle),\n \"development\",\n );\n}\n\n/** For tests — reset the module cache. */\nexport function __resetAgentsBundleCache(): void {\n cached = null;\n}\n"]}
1
+ {"version":3,"file":"agents-bundle.js","sourceRoot":"","sources":["../../src/server/agents-bundle.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAYH,MAAM,CAAC,MAAM,mBAAmB,GAAe,MAAM,CAAC;AA8DtD,MAAM,KAAK,GAAiB,EAAE,QAAQ,EAAE,EAAE,EAAE,iBAAiB,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAA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,CAAC;AAED,0CAA0C;AAC1C,MAAM,UAAU,wBAAwB;IACtC,MAAM,GAAG,IAAI,CAAC;AAChB,CAAC","sourcesContent":["/**\n * Agents bundle — loads AGENTS.md and .agents/skills/ from the template.\n * The legacy singular .agent/skills/ directory is also accepted as an alias.\n *\n * This is the single source of truth the framework's agent uses to mirror what\n * Claude Code / Codex / any other agent would see when running locally in the\n * repo. The filesystem is the canonical source; this module is just a loader\n * that works both in dev (direct fs read) and production (content bundled at\n * build time via the `virtual:agents-bundle` Vite plugin).\n *\n * Resolution order inside `loadAgentsBundle()`:\n * 1. Virtual module (`virtual:agents-bundle`) — inlined at build time by the\n * framework's Vite plugin. This is the ONLY path that works on edge\n * runtimes (Cloudflare Workers) where `readFileSync` doesn't exist.\n * 2. Filesystem fallback — `process.cwd()/AGENTS.md` +\n * `process.cwd()/.agents/skills/` (or legacy `.agent/skills/`). Only reliable in local dev and Node\n * production (`agent-native start`); not on Netlify/Vercel/CF at runtime.\n * 3. Empty bundle — everything silently returns empty strings.\n *\n * Result is cached in module scope so it's only computed once per cold start.\n */\n\n/**\n * Where a skill is meant to be used:\n * - `runtime` — only the in-app agent at runtime (not the human's coding agent).\n * - `dev` — only the human's development/coding agent (e.g. Claude Code).\n * EXCLUDED from the runtime agent's prompt block and docs-search.\n * - `both` — loaded everywhere. This is the default when `scope` is absent\n * or set to an unrecognized value (fully backward compatible).\n */\nexport type SkillScope = \"runtime\" | \"dev\" | \"both\";\n\nexport const DEFAULT_SKILL_SCOPE: SkillScope = \"both\";\n\nexport interface SkillMeta {\n name: string;\n description: string;\n /**\n * Audience for the skill. Defaults to `both` when the SKILL.md frontmatter\n * omits `scope` or specifies an unknown value. `dev`-scoped skills are hidden\n * from the runtime agent everywhere (prompt block + docs-search).\n */\n scope: SkillScope;\n}\n\nexport interface Skill {\n meta: SkillMeta;\n /** Contents of SKILL.md (the entry file of the skill). */\n content: string;\n /**\n * Filesystem path to the skill directory, relative to the template root\n * (e.g. `.agents/skills/create-deck`). The agent can read any file here via\n * bash in dev — skills are folders, not single files, and may contain\n * supporting assets, scripts, or additional markdown.\n */\n dir: string;\n /**\n * Files inside the skill directory (relative to the skill dir), excluding\n * `SKILL.md`. Lets the agent know what else is available without a separate\n * `ls` call. Empty array if the skill is single-file.\n */\n extraFiles: string[];\n /**\n * Text content of eligible sub-files (progressive-disclosure references),\n * keyed by the same skill-dir-relative path used in `extraFiles`. Only\n * populated for text extensions under the per-file/per-skill caps in\n * `readSkillsDir` — files that exist but were skipped for size still show\n * up in `extraFiles`, just not here. This is what makes reference content\n * actually readable by the runtime agent (via docs-search); it is never\n * injected into a prompt.\n */\n files: Record<string, string>;\n}\n\nexport interface AgentsBundle {\n /** Contents of the template's AGENTS.md (empty string if missing). */\n agentsMd: string;\n /**\n * Contents of the workspace core's AGENTS.md, if the app is inside an\n * enterprise monorepo with a `workspaceCore` configured. Empty string\n * otherwise. Sits between the framework system prompt and the template's\n * AGENTS.md in the instruction stack.\n */\n workspaceAgentsMd?: string;\n /**\n * Map from skill name → skill content. Contains skills merged from the\n * workspace core layer (if present) and the template layer. On name\n * collision, the template's version wins so apps can override a shared\n * enterprise skill by dropping a same-named file under\n * `.agents/skills/<name>/`.\n */\n skills: Record<string, Skill>;\n}\n\nconst EMPTY: AgentsBundle = { agentsMd: \"\", workspaceAgentsMd: \"\", skills: {} };\n\nlet cached: AgentsBundle | null = null;\n\n/**\n * Coerce a raw frontmatter `scope` value into a known `SkillScope`. Unknown,\n * empty, or malformed values fall back to the default (`both`) so a typo never\n * silently hides a skill from the runtime agent. Optionally warns once per\n * distinct bad value to aid debugging without spamming logs.\n */\nconst warnedBadScopes = new Set<string>();\nexport function normalizeSkillScope(raw: string | undefined): SkillScope {\n if (!raw) return DEFAULT_SKILL_SCOPE;\n const value = raw.trim().toLowerCase();\n if (value === \"runtime\" || value === \"dev\" || value === \"both\") {\n return value;\n }\n if (value && !warnedBadScopes.has(value)) {\n warnedBadScopes.add(value);\n console.warn(\n `[agents-bundle] Unknown skill scope \"${raw}\" — treating as \"${DEFAULT_SKILL_SCOPE}\". Valid values: runtime, dev, both.`,\n );\n }\n return DEFAULT_SKILL_SCOPE;\n}\n\n/**\n * Parse the YAML frontmatter at the top of a skill file.\n * Only pulls out `name`, `description`, and `scope` — deliberately simple, no\n * YAML lib.\n * Handles:\n * - Inline: `description: Some text`\n * - Folded scalar: `description: >-\\n multi\\n line` → \"multi line\"\n * - Literal scalar: `description: |\\n multi\\n line` → \"multi\\nline\"\n */\nexport function parseSkillFrontmatter(content: string): Partial<SkillMeta> {\n const match = content.match(/^---\\r?\\n([\\s\\S]+?)\\r?\\n---/);\n if (!match) return {};\n const lines = match[1].split(/\\r?\\n/);\n const result: Partial<SkillMeta> = {};\n\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i];\n const keyMatch = line.match(/^([a-zA-Z_][a-zA-Z0-9_-]*):\\s*(.*)$/);\n if (!keyMatch) continue;\n const [, key, valueRaw] = keyMatch;\n const trimmed = valueRaw.trim();\n\n const isFolded = trimmed === \">\" || trimmed === \">-\";\n const isLiteral = trimmed === \"|\" || trimmed === \"|-\";\n\n let value: string;\n if (isFolded || isLiteral) {\n // Collect subsequent indented lines (at least one leading space).\n const block: string[] = [];\n let j = i + 1;\n while (j < lines.length) {\n const next = lines[j];\n if (next.length === 0) {\n block.push(\"\");\n j++;\n continue;\n }\n if (!/^\\s/.test(next)) break;\n block.push(next.replace(/^\\s+/, \"\"));\n j++;\n }\n // Trim trailing blank lines\n while (block.length > 0 && block[block.length - 1] === \"\") block.pop();\n value = isFolded\n ? block.filter((l) => l !== \"\").join(\" \")\n : block.join(\"\\n\");\n i = j - 1;\n } else {\n value = trimmed;\n }\n\n if (key === \"name\" && value) result.name = value;\n else if (key === \"description\" && value) result.description = value;\n else if (key === \"scope\" && value)\n result.scope = normalizeSkillScope(value);\n }\n\n return result;\n}\n\nimport fs from \"node:fs\";\nimport path from \"node:path\";\n\nconst TEMPLATE_SKILLS_DIRS = [\n path.join(\".agents\", \"skills\"),\n path.join(\".agent\", \"skills\"),\n] as const;\n\n/**\n * Extensions eligible to have their content inlined into `Skill.files`.\n * Binary/asset sub-files (images, scripts, etc.) are always listed in\n * `extraFiles` but never read into memory.\n */\nconst READABLE_SUBFILE_EXTENSIONS = new Set([\".md\", \".txt\", \".json\"]);\n/**\n * Per-file and per-skill caps on inlined reference content. This content is\n * bundled into the virtual module (and therefore the server bundle) for\n * every deployment target, so it must stay small even though it's never\n * added to a prompt — only fetched on demand via docs-search. Measured\n * against this repo's skills (largest single sub-file ~20KB, largest\n * per-skill sub-file total ~83KB), these caps have generous headroom.\n */\nconst MAX_SUBFILE_BYTES = 64 * 1024;\nconst MAX_SKILL_FILES_BYTES = 256 * 1024;\n\n/**\n * Paths to a workspace-core's agent resources, for merging into a template's\n * bundle. All fields optional — pass null for any missing piece.\n */\nexport interface WorkspaceAgentsSource {\n /** Absolute path to the workspace core's skills/ directory. */\n skillsDir: string | null;\n /** Absolute path to the workspace core's AGENTS.md. */\n agentsMdPath: string | null;\n /** Root dir (used to compute `dir` paths for workspace-core skills). */\n rootDir: string;\n}\n\n/**\n * Read one skills directory into a `Record<string, Skill>`. Extracted so\n * both the template and workspace-core paths can reuse it. `dirPrefix` is\n * the display path that will be reported to the agent (e.g.\n * `.agents/skills/<name>` for templates, or\n * `<workspace-shared-package>/.agents/skills/<name>` for the workspace layer).\n */\nfunction readSkillsDir(\n skillsDir: string,\n rootForRelative: string,\n out: Record<string, Skill>,\n skipExistingNames: boolean,\n): void {\n if (!fs.existsSync(skillsDir)) return;\n const entries = fs.readdirSync(skillsDir, { withFileTypes: true });\n for (const entry of entries) {\n if (!entry.isDirectory() && !entry.isSymbolicLink()) continue;\n const skillDirAbs = path.join(skillsDir, entry.name);\n const skillFile = path.join(skillDirAbs, \"SKILL.md\");\n try {\n const realSkillFile = fs.realpathSync(skillFile);\n if (!fs.existsSync(realSkillFile)) continue;\n const content = fs.readFileSync(realSkillFile, \"utf-8\");\n const meta = parseSkillFrontmatter(content);\n const name = meta.name ?? entry.name;\n if (skipExistingNames && out[name]) continue; // Template wins\n\n const extraFiles: string[] = [];\n const files: Record<string, string> = {};\n let skillFilesBytes = 0;\n try {\n const walk = (subdir: string, prefix: string) => {\n for (const e of fs.readdirSync(subdir, { withFileTypes: true })) {\n const abs = path.join(subdir, e.name);\n const rel = prefix ? `${prefix}/${e.name}` : e.name;\n if (e.isDirectory() || e.isSymbolicLink()) {\n try {\n const stat = fs.statSync(abs);\n if (stat.isDirectory()) walk(abs, rel);\n } catch {}\n } else if (e.isFile() && e.name !== \"SKILL.md\") {\n extraFiles.push(rel);\n const ext = path.extname(e.name).toLowerCase();\n if (!READABLE_SUBFILE_EXTENSIONS.has(ext)) continue;\n try {\n const stat = fs.statSync(abs);\n if (stat.size > MAX_SUBFILE_BYTES) continue;\n if (skillFilesBytes + stat.size > MAX_SKILL_FILES_BYTES) {\n continue;\n }\n files[rel] = fs.readFileSync(abs, \"utf-8\");\n skillFilesBytes += stat.size;\n } catch {}\n }\n }\n };\n walk(skillDirAbs, \"\");\n } catch {}\n extraFiles.sort();\n\n out[name] = {\n meta: {\n name,\n description: meta.description ?? \"\",\n scope: meta.scope ?? DEFAULT_SKILL_SCOPE,\n },\n content,\n dir: path.relative(rootForRelative, skillDirAbs).replace(/\\\\/g, \"/\"),\n extraFiles,\n files,\n };\n } catch {\n // Skip unreadable skills\n }\n }\n}\n\n/**\n * Read AGENTS.md + all skills directly from the filesystem rooted at `cwd`.\n * Optionally also reads a workspace-core's AGENTS.md and skills directory\n * and merges them in (template wins on name collisions). Used by both the\n * Vite plugin (at build time) and the runtime fallback (in dev / Node prod).\n *\n * Synchronous — the Vite plugin's load hook calls it inline during the build.\n */\nexport function readAgentsBundleFromFs(\n cwd: string,\n workspaceSource: WorkspaceAgentsSource | null = null,\n): AgentsBundle {\n let agentsMd = \"\";\n try {\n const agentsMdPath = path.join(cwd, \"AGENTS.md\");\n if (fs.existsSync(agentsMdPath)) {\n agentsMd = fs.readFileSync(agentsMdPath, \"utf-8\");\n }\n } catch {}\n\n let workspaceAgentsMd = \"\";\n if (workspaceSource?.agentsMdPath) {\n try {\n if (fs.existsSync(workspaceSource.agentsMdPath)) {\n workspaceAgentsMd = fs.readFileSync(\n workspaceSource.agentsMdPath,\n \"utf-8\",\n );\n }\n } catch {}\n }\n\n // Merge skills: template first (so its entries are authoritative), then\n // workspace-core with skipExistingNames=true so same-named skills don't\n // overwrite the template's. `.agents/skills` is canonical; `.agent/skills`\n // is accepted as a legacy alias and does not override canonical skills.\n const skills: Record<string, Skill> = {};\n for (const [index, relSkillsDir] of TEMPLATE_SKILLS_DIRS.entries()) {\n try {\n readSkillsDir(path.join(cwd, relSkillsDir), cwd, skills, index > 0);\n } catch {}\n }\n\n if (workspaceSource?.skillsDir) {\n try {\n readSkillsDir(\n workspaceSource.skillsDir,\n workspaceSource.rootDir,\n skills,\n true,\n );\n } catch {}\n }\n\n return { agentsMd, workspaceAgentsMd, skills };\n}\n\n/**\n * Load the agents bundle. Returns a cached result on subsequent calls.\n * Tries the virtual module first (works everywhere, including edge), then\n * falls back to filesystem reads from `process.cwd()` — which, when a\n * workspace core is present, also merges in the workspace core's skills\n * and AGENTS.md.\n */\nexport async function loadAgentsBundle(): Promise<AgentsBundle> {\n if (cached) return cached;\n\n // 1. Try the Vite-emitted virtual module. This is the path that works on\n // every deployment target because the content is inlined at build time.\n // The Vite plugin itself is responsible for merging workspace-core\n // content into the bundle it emits.\n try {\n // @ts-expect-error — virtual module is resolved at build time by our\n // Vite plugin; nothing exists at this path on disk.\n const mod = await import(\"virtual:agents-bundle\");\n if (mod && mod.default) {\n cached = mod.default as AgentsBundle;\n return cached;\n }\n } catch {\n // Virtual module not available — fall through to filesystem.\n }\n\n // 2. Filesystem fallback — works in dev / Node prod. If a workspace core\n // is present in the ancestor chain, merge its skills + AGENTS.md in.\n try {\n let workspaceSource: WorkspaceAgentsSource | null = null;\n try {\n const { getWorkspaceCoreExports } =\n await import(\"../deploy/workspace-core.js\");\n const ws = await getWorkspaceCoreExports(process.cwd());\n if (ws) {\n workspaceSource = {\n skillsDir: ws.skillsDir,\n agentsMdPath: ws.agentsMdPath,\n rootDir: ws.packageDir,\n };\n }\n } catch {\n // workspace-core discovery isn't available (e.g. edge runtime).\n }\n cached = readAgentsBundleFromFs(process.cwd(), workspaceSource);\n return cached;\n } catch {\n cached = EMPTY;\n return cached;\n }\n}\n\n/**\n * Generate the `<skills>` block to inject into the system prompt.\n *\n * Skills are folders at `.agents/skills/<name>/` (or legacy\n * `.agent/skills/<name>/`) containing a `SKILL.md` entry file plus any number\n * of supporting files (additional markdown, examples, images, scripts). This\n * block lists what's available and how to read them.\n *\n * In dev mode the agent has bash access and reads skills via `cat` — exactly\n * like running `claude` locally in the repo. In production mode the agent has\n * no bash; templates that need skill content at runtime should inline the\n * critical parts directly in `AGENTS.md`.\n */\n/**\n * Skills visible to the agent-native RUNTIME agent. Excludes `scope: dev`\n * skills (those are for the human's coding agent only). Skills with no scope,\n * `scope: runtime`, or `scope: both` are all included. Use this anywhere the\n * runtime agent's view of skills is built (prompt block + docs-search) so a\n * dev-scoped skill is invisible to the runtime agent everywhere.\n */\nexport function getRuntimeSkills(bundle: AgentsBundle): Skill[] {\n return Object.values(bundle.skills).filter(\n (skill) => skill.meta.scope !== \"dev\",\n );\n}\n\n/**\n * Skills visible to development/coding agents. Excludes `scope: runtime`\n * skills that are intended only for the deployed in-app agent.\n */\nexport function getDevelopmentSkills(bundle: AgentsBundle): Skill[] {\n return Object.values(bundle.skills).filter(\n (skill) => skill.meta.scope !== \"runtime\",\n );\n}\n\nexport function skillDocsSlug(name: string): string {\n return `skill-${name\n .trim()\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, \"-\")\n .replace(/^-+|-+$/g, \"\")}`;\n}\n\nfunction subfileSlugSuffix(relPath: string): string {\n return relPath\n .replace(/\\.[^./]+$/, \"\")\n .trim()\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, \"-\")\n .replace(/^-+|-+$/g, \"\");\n}\n\n/**\n * Slug docs-search resolves a skill sub-file (reference) content by. Kept in\n * sync with the `skill-<name>--<subpath-slug>` docs it emits in\n * `scripts/docs/search.ts` so the prompt hint always points at something the\n * agent can actually read.\n */\nexport function skillSubfileDocsSlug(\n skillName: string,\n relPath: string,\n): string {\n return `${skillDocsSlug(skillName)}--${subfileSlugSuffix(relPath)}`;\n}\n\nfunction generateSkillsPromptBlockForEntries(\n entries: Skill[],\n mode: \"runtime\" | \"development\",\n): string {\n if (entries.length === 0) return \"\";\n\n const lines = entries.map((s) => {\n let extras = \"\";\n if (s.extraFiles.length > 0) {\n if (mode === \"runtime\") {\n const readable = s.extraFiles.filter((f) => f in s.files);\n const unreadable = s.extraFiles.filter((f) => !(f in s.files));\n const parts: string[] = [];\n if (readable.length > 0) {\n const refIds = readable.map((f) => subfileSlugSuffix(f)).join(\", \");\n parts.push(\n `refs via docs-search --slug \"${skillDocsSlug(s.meta.name)}--<ref>\": ${refIds}`,\n );\n }\n if (unreadable.length > 0) {\n parts.push(`also contains: ${unreadable.join(\", \")}`);\n }\n extras = ` (${parts.join(\"; \")})`;\n } else {\n extras = ` (also contains: ${s.extraFiles.join(\", \")})`;\n }\n }\n const runtimeHint =\n mode === \"runtime\"\n ? ` Read with \\`docs-search --slug \"${skillDocsSlug(s.meta.name)}\"\\` before starting a task it applies to.`\n : \"\";\n return `- \\`${s.meta.name}\\` at \\`${s.dir}/\\` — ${s.meta.description || \"(no description)\"}${extras}${runtimeHint}`;\n });\n\n const readHint =\n mode === \"runtime\"\n ? `To read a skill in the in-app runtime agent:\n \\`docs-search --slug \"skill-<skill-name>\"\\`\n \\`docs-search --query \"<topic>\"\\` to discover matching docs/skills`\n : `To read a skill in dev mode (when you have bash access):\n \\`bash(command=\"cat <skill-dir>/SKILL.md\")\\`\n \\`bash(command=\"ls <skill-dir>/\")\\` to see all files in the folder`;\n\n return `<skills>\nThe following skills live in the repo, usually at \\`.agents/skills/<name>/\\` (legacy \\`.agent/skills/<name>/\\` is also supported). Each skill is a folder containing a \\`SKILL.md\\` entry file and sometimes supporting files. Read a skill BEFORE starting a task it applies to.\n\n${readHint}\n\nAvailable skills:\n${lines.join(\"\\n\")}\n</skills>`;\n}\n\nexport function generateSkillsPromptBlock(bundle: AgentsBundle): string {\n return generateSkillsPromptBlockForEntries(\n getRuntimeSkills(bundle),\n \"runtime\",\n );\n}\n\nexport function generateDevelopmentSkillsPromptBlock(\n bundle: AgentsBundle,\n): string {\n return generateSkillsPromptBlockForEntries(\n getDevelopmentSkills(bundle),\n \"development\",\n );\n}\n\n/** For tests — reset the module cache. */\nexport function __resetAgentsBundleCache(): void {\n cached = null;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../src/server/auth.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAclC,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAsChE,KAAK,KAAK,GAAG,SAAS,CAAC;AA2BvB,OAAO,EAIL,KAAK,oBAAoB,EAC1B,MAAM,qCAAqC,CAAC;AAK7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAqBlE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAoB5D,OAAO,EAGL,KAAK,qBAAqB,EAC3B,MAAM,sBAAsB,CAAC;AAI9B;;;GAGG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC;AAMD,MAAM,WAAW,WAAW;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mFAAmF;IACnF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,4DAA4D;IAC5D,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,mNAAmN;IACnN,KAAK,CAAC,EAAE,MAAM,CAAC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AqBD,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,MAAM,EACb,KAAK,EAAE,MAAM,QAWd;AAED,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,2BAA2B,QAOnC;AAmGD;;;;;;GAMG;AACH,wBAAsB,YAAY,CAChC,KAAK,EAAE,OAAO,GACb,OAAO,CAAC,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC,CAG5C;AAiKD,wBAAgB,iCAAiC,CAC/C,KAAK,EAAE,OAAO,EACd,CAAC,EAAE,MAAM,GACR,OAAO,CAoDT;AA2qBD;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,WAAW,GAAG,IAAI,CAAC,CAY5E;AA4ID,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAS7E;AAmpCD;;;;;;;;;;;;;GAaG;AACH,wBAAsB,aAAa,CACjC,GAAG,EAAE,KAAK,EACV,OAAO,GAAE,WAAgB,GACxB,OAAO,CAAC,OAAO,CAAC,CAqKlB;AAMD;;GAEG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,GAAG,IAAI,CAMzE"}
@@ -44,7 +44,7 @@ import { widenIntColumnsToBigInt } from "../db/widen-columns.js";
44
44
  import { MCP_LEGACY_ROUTE_PREFIX, MCP_PUBLIC_ROUTE_PREFIX, isMcpProtocolPath, } from "../mcp/route-paths.js";
45
45
  import { readBody } from "../server/h3-helpers.js";
46
46
  import { putSetting } from "../settings/store.js";
47
- import { DEFAULT_SSR_CACHE_HEADERS } from "../shared/cache-control.js";
47
+ import { resolveSsrCacheHeaders } from "../shared/cache-control.js";
48
48
  import { extractOAuthStateAppId } from "../shared/oauth-state.js";
49
49
  import { AGENT_NATIVE_SOCIAL_IMAGE_ALT, AGENT_NATIVE_SOCIAL_IMAGE_HEIGHT, AGENT_NATIVE_SOCIAL_IMAGE_PATH, AGENT_NATIVE_SOCIAL_IMAGE_TYPE, AGENT_NATIVE_SOCIAL_IMAGE_WIDTH, withAgentNativeSocialImageCacheBuster, } from "../shared/social-meta.js";
50
50
  import { normalizeWorkspaceAppAudience, workspaceAppAudienceFromEnv, workspaceAppRouteAccessFromEnv, } from "../shared/workspace-app-audience.js";
@@ -1176,8 +1176,9 @@ function loginHtmlResponse(loginHtml, event) {
1176
1176
  // template roots do not invoke origin just to render anonymous login UI.
1177
1177
  // The login markup is env-INDEPENDENT (a Google-only app always renders
1178
1178
  // a working button); the analytics script is public build configuration,
1179
- // not user/session state. Never downgrade this to private/no-store.
1180
- ...DEFAULT_SSR_CACHE_HEADERS,
1179
+ // not user/session state. Never vary this per request — the
1180
+ // deployment-wide override inside the resolver is the only knob.
1181
+ ...resolveSsrCacheHeaders(),
1181
1182
  "X-Robots-Tag": "noindex, nofollow",
1182
1183
  },
1183
1184
  });