@agent-native/core 0.97.0 → 0.98.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (844) hide show
  1. package/corpus/README.md +2 -2
  2. package/corpus/core/CHANGELOG.md +32 -0
  3. package/corpus/core/docs/content/authentication.mdx +3 -3
  4. package/corpus/core/docs/content/doctor.mdx +170 -0
  5. package/corpus/core/docs/content/external-agents.mdx +8 -7
  6. package/corpus/core/docs/content/locales/ar-SA/authentication.mdx +2 -2
  7. package/corpus/core/docs/content/locales/ar-SA/external-agents.mdx +8 -7
  8. package/corpus/core/docs/content/locales/ar-SA/mcp-protocol.mdx +1 -1
  9. package/corpus/core/docs/content/locales/ar-SA/security.mdx +2 -0
  10. package/corpus/core/docs/content/locales/de-DE/authentication.mdx +1 -1
  11. package/corpus/core/docs/content/locales/de-DE/external-agents.mdx +8 -7
  12. package/corpus/core/docs/content/locales/de-DE/mcp-protocol.mdx +1 -1
  13. package/corpus/core/docs/content/locales/de-DE/security.mdx +2 -0
  14. package/corpus/core/docs/content/locales/es-ES/authentication.mdx +2 -2
  15. package/corpus/core/docs/content/locales/es-ES/external-agents.mdx +8 -7
  16. package/corpus/core/docs/content/locales/es-ES/mcp-protocol.mdx +1 -1
  17. package/corpus/core/docs/content/locales/es-ES/security.mdx +2 -0
  18. package/corpus/core/docs/content/locales/fr-FR/authentication.mdx +1 -1
  19. package/corpus/core/docs/content/locales/fr-FR/external-agents.mdx +8 -7
  20. package/corpus/core/docs/content/locales/fr-FR/mcp-protocol.mdx +1 -1
  21. package/corpus/core/docs/content/locales/fr-FR/security.mdx +2 -0
  22. package/corpus/core/docs/content/locales/hi-IN/authentication.mdx +2 -2
  23. package/corpus/core/docs/content/locales/hi-IN/external-agents.mdx +8 -7
  24. package/corpus/core/docs/content/locales/hi-IN/mcp-protocol.mdx +1 -1
  25. package/corpus/core/docs/content/locales/hi-IN/security.mdx +2 -0
  26. package/corpus/core/docs/content/locales/ja-JP/authentication.mdx +2 -2
  27. package/corpus/core/docs/content/locales/ja-JP/external-agents.mdx +8 -7
  28. package/corpus/core/docs/content/locales/ja-JP/mcp-protocol.mdx +1 -1
  29. package/corpus/core/docs/content/locales/ja-JP/security.mdx +2 -0
  30. package/corpus/core/docs/content/locales/ko-KR/authentication.mdx +2 -2
  31. package/corpus/core/docs/content/locales/ko-KR/external-agents.mdx +8 -7
  32. package/corpus/core/docs/content/locales/ko-KR/mcp-protocol.mdx +1 -1
  33. package/corpus/core/docs/content/locales/ko-KR/security.mdx +2 -0
  34. package/corpus/core/docs/content/locales/pt-BR/authentication.mdx +2 -2
  35. package/corpus/core/docs/content/locales/pt-BR/external-agents.mdx +8 -7
  36. package/corpus/core/docs/content/locales/pt-BR/mcp-protocol.mdx +1 -1
  37. package/corpus/core/docs/content/locales/pt-BR/security.mdx +2 -0
  38. package/corpus/core/docs/content/locales/zh-CN/authentication.mdx +2 -2
  39. package/corpus/core/docs/content/locales/zh-CN/external-agents.mdx +8 -7
  40. package/corpus/core/docs/content/locales/zh-CN/mcp-protocol.mdx +1 -1
  41. package/corpus/core/docs/content/locales/zh-CN/security.mdx +2 -0
  42. package/corpus/core/docs/content/locales/zh-TW/authentication.mdx +2 -2
  43. package/corpus/core/docs/content/locales/zh-TW/external-agents.mdx +8 -7
  44. package/corpus/core/docs/content/locales/zh-TW/mcp-protocol.mdx +1 -1
  45. package/corpus/core/docs/content/locales/zh-TW/security.mdx +2 -0
  46. package/corpus/core/docs/content/mcp-protocol.mdx +1 -1
  47. package/corpus/core/docs/content/security.mdx +2 -0
  48. package/corpus/core/package.json +5 -1
  49. package/corpus/core/scripts/finalize-build.mjs +63 -3
  50. package/corpus/core/scripts/materialize-source-corpus.mjs +101 -15
  51. package/corpus/core/src/action.ts +42 -0
  52. package/corpus/core/src/agent/engine/builder-engine.ts +3 -0
  53. package/corpus/core/src/agent/engine/context-directives-transform.ts +69 -0
  54. package/corpus/core/src/agent/engine/continuation-dispatch-retry.ts +168 -0
  55. package/corpus/core/src/agent/engine/tool-call-journal-seed.ts +85 -0
  56. package/corpus/core/src/agent/production-agent.ts +129 -244
  57. package/corpus/core/src/cli/doctor.ts +9 -3
  58. package/corpus/core/src/cli/plan-local.ts +10 -2
  59. package/corpus/core/src/cli/skills-content/assets-skill.ts +83 -0
  60. package/corpus/core/src/cli/skills-content/canvas.ts +153 -0
  61. package/corpus/core/src/cli/skills-content/connection.ts +52 -0
  62. package/corpus/core/src/cli/skills-content/content-skill.ts +109 -0
  63. package/corpus/core/src/cli/skills-content/design-exploration-skill.ts +118 -0
  64. package/corpus/core/src/cli/skills-content/design-visual-edit-skill.ts +228 -0
  65. package/corpus/core/src/cli/skills-content/document-quality.ts +196 -0
  66. package/corpus/core/src/cli/skills-content/exemplar.ts +69 -0
  67. package/corpus/core/src/cli/skills-content/help.ts +77 -0
  68. package/corpus/core/src/cli/skills-content/index.ts +22 -0
  69. package/corpus/core/src/cli/skills-content/local-files.ts +95 -0
  70. package/corpus/core/src/cli/skills-content/plan-setup-auth.ts +80 -0
  71. package/corpus/core/src/cli/skills-content/visual-plan-skill.ts +470 -0
  72. package/corpus/core/src/cli/skills-content/visual-recap-skill.ts +547 -0
  73. package/corpus/core/src/cli/skills-content/visualize-repo-skill.ts +93 -0
  74. package/corpus/core/src/cli/skills-content/wireframe.ts +349 -0
  75. package/corpus/core/src/cli/skills.ts +27 -2733
  76. package/corpus/core/src/client/AgentPanel.tsx +6 -5
  77. package/corpus/core/src/client/CommandMenu.tsx +16 -5
  78. package/corpus/core/src/client/FeedbackButton.tsx +2 -2
  79. package/corpus/core/src/client/app-providers.tsx +18 -5
  80. package/corpus/core/src/client/chat/tool-call-display.tsx +3 -3
  81. package/corpus/core/src/client/composer/PastedTextChip.tsx +1 -1
  82. package/corpus/core/src/client/composer/RealtimeVoiceMode.tsx +143 -45
  83. package/corpus/core/src/client/composer/TiptapComposer.tsx +1 -1
  84. package/corpus/core/src/client/composer/VoiceButton.tsx +21 -5
  85. package/corpus/core/src/client/composer/useRealtimeVoiceMode.tsx +107 -10
  86. package/corpus/core/src/client/context-xray/ContextXRayPanel.tsx +5 -2
  87. package/corpus/core/src/client/extensions/ExtensionEditor.tsx +37 -4
  88. package/corpus/core/src/client/extensions/ExtensionQueryErrorState.tsx +47 -0
  89. package/corpus/core/src/client/extensions/ExtensionSlot.tsx +39 -10
  90. package/corpus/core/src/client/extensions/ExtensionViewer.tsx +44 -6
  91. package/corpus/core/src/client/extensions/ExtensionsListPage.tsx +12 -3
  92. package/corpus/core/src/client/extensions/ExtensionsSidebarSection.tsx +49 -11
  93. package/corpus/core/src/client/index.ts +0 -13
  94. package/corpus/core/src/client/progress/RunsTray.tsx +10 -3
  95. package/corpus/core/src/client/settings/SettingsTabsPage.tsx +7 -0
  96. package/corpus/core/src/client/settings/useBuilderStatus.ts +6 -0
  97. package/corpus/core/src/client/tool-cells/EditCell.tsx +19 -16
  98. package/corpus/core/src/client/tool-cells/FilesChangedSummary.tsx +26 -23
  99. package/corpus/core/src/client/tool-cells/WriteCell.tsx +19 -16
  100. package/corpus/core/src/client/visual-style-controls.tsx +1 -1
  101. package/corpus/core/src/deploy/build.ts +36 -14
  102. package/corpus/core/src/integrations/google-docs-poller.ts +23 -2
  103. package/corpus/core/src/integrations/plugin.ts +10 -0
  104. package/corpus/core/src/integrations/webhook-handler.ts +27 -2
  105. package/corpus/core/src/jobs/scheduler.ts +28 -2
  106. package/corpus/core/src/localization/default-messages.ts +8 -1
  107. package/corpus/core/src/mcp/oauth-token.ts +6 -1
  108. package/corpus/core/src/observability/routes.ts +36 -0
  109. package/corpus/core/src/observability/sentiment.ts +261 -0
  110. package/corpus/core/src/observability/store.ts +23 -0
  111. package/corpus/core/src/observability/traces.ts +49 -63
  112. package/corpus/core/src/observability/tracking-identity.ts +55 -0
  113. package/corpus/core/src/observability/types.ts +13 -0
  114. package/corpus/core/src/secrets/storage.ts +67 -3
  115. package/corpus/core/src/server/agent-chat/action-filters-a2a.ts +199 -0
  116. package/corpus/core/src/server/agent-chat/browser-team-tools.ts +510 -0
  117. package/corpus/core/src/server/agent-chat/context-tools.ts +595 -0
  118. package/corpus/core/src/server/agent-chat/framework-prompts.ts +470 -0
  119. package/corpus/core/src/server/agent-chat/lazy-fs.ts +11 -0
  120. package/corpus/core/src/server/agent-chat/mcp-glue.ts +91 -0
  121. package/corpus/core/src/server/agent-chat/plugin-options.ts +350 -0
  122. package/corpus/core/src/server/agent-chat/process-run-failure.ts +62 -0
  123. package/corpus/core/src/server/agent-chat/prompt-resources.ts +688 -0
  124. package/corpus/core/src/server/agent-chat/recurring-jobs-runtime.ts +80 -0
  125. package/corpus/core/src/server/agent-chat/request-surface.ts +71 -0
  126. package/corpus/core/src/server/agent-chat/run-code-tools.ts +67 -0
  127. package/corpus/core/src/server/agent-chat/script-entries.ts +779 -0
  128. package/corpus/core/src/server/agent-chat/shared-thread.ts +301 -0
  129. package/corpus/core/src/server/agent-chat/skill-frontmatter.ts +41 -0
  130. package/corpus/core/src/server/agent-chat-plugin.ts +364 -4182
  131. package/corpus/core/src/server/agent-teams.ts +26 -3
  132. package/corpus/core/src/server/auth.ts +55 -57
  133. package/corpus/core/src/server/credential-provider.ts +22 -25
  134. package/corpus/core/src/server/edge.ts +1 -0
  135. package/corpus/core/src/server/onboarding-html.ts +1 -16
  136. package/corpus/core/src/server/realtime-voice.ts +40 -5
  137. package/corpus/core/src/server/request-origin.ts +6 -2
  138. package/corpus/core/src/server/ssr-handler.ts +55 -2
  139. package/corpus/core/src/sharing/access.ts +155 -11
  140. package/corpus/core/src/sharing/registry.ts +7 -0
  141. package/corpus/core/src/styles/agent-native.css +15 -14
  142. package/corpus/core/src/templates/default/.agents/skills/frontend-design/SKILL.md +1 -1
  143. package/corpus/core/src/templates/default/app/i18n/ar-SA.ts +6 -0
  144. package/corpus/core/src/templates/default/app/i18n/de-DE.ts +6 -0
  145. package/corpus/core/src/templates/default/app/i18n/en-US.ts +6 -0
  146. package/corpus/core/src/templates/default/app/i18n/es-ES.ts +6 -0
  147. package/corpus/core/src/templates/default/app/i18n/fr-FR.ts +6 -0
  148. package/corpus/core/src/templates/default/app/i18n/hi-IN.ts +6 -0
  149. package/corpus/core/src/templates/default/app/i18n/ja-JP.ts +6 -0
  150. package/corpus/core/src/templates/default/app/i18n/ko-KR.ts +6 -0
  151. package/corpus/core/src/templates/default/app/i18n/pt-BR.ts +6 -0
  152. package/corpus/core/src/templates/default/app/i18n/zh-CN.ts +6 -0
  153. package/corpus/core/src/templates/default/app/i18n/zh-TW.ts +6 -0
  154. package/corpus/core/src/templates/workspace-core/.agents/skills/authentication/SKILL.md +27 -29
  155. package/corpus/core/src/templates/workspace-core/.agents/skills/external-agents/SKILL.md +2 -1
  156. package/corpus/core/src/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +1 -1
  157. package/corpus/core/src/templates/workspace-core/.agents/skills/observability/SKILL.md +32 -0
  158. package/corpus/core/src/templates/workspace-core/.agents/skills/writing-agent-instructions/SKILL.md +25 -0
  159. package/corpus/core/src/templates/workspace-core/src/server/index.ts +4 -2
  160. package/corpus/core/src/testing.ts +26 -0
  161. package/corpus/core/src/triggers/dispatcher.ts +23 -2
  162. package/corpus/core/src/vite/client.ts +126 -2
  163. package/corpus/core/tsconfig.cli.json +1 -1
  164. package/corpus/core/tsconfig.json +5 -1
  165. package/corpus/templates/analytics/.agents/skills/bigquery/SKILL.md +2 -2
  166. package/corpus/templates/analytics/.agents/skills/frontend-design/SKILL.md +1 -1
  167. package/corpus/templates/analytics/AGENTS.md +19 -6
  168. package/corpus/templates/analytics/actions/install-dashboard-template.ts +79 -43
  169. package/corpus/templates/analytics/actions/list-explorer-dashboards.ts +3 -3
  170. package/corpus/templates/analytics/actions/list-sql-dashboards.ts +8 -3
  171. package/corpus/templates/analytics/actions/rename-analysis.ts +8 -2
  172. package/corpus/templates/analytics/actions/rename-dashboard.ts +8 -7
  173. package/corpus/templates/analytics/actions/view-screen.ts +4 -23
  174. package/corpus/templates/analytics/app/components/ResourceLoadError.tsx +42 -0
  175. package/corpus/templates/analytics/app/components/layout/CommandPalette.tsx +85 -70
  176. package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +107 -89
  177. package/corpus/templates/analytics/app/components/layout/SidebarLoadError.tsx +24 -0
  178. package/corpus/templates/analytics/app/hooks/use-dashboard-views.ts +15 -5
  179. package/corpus/templates/analytics/app/i18n/zh-TW.ts +4 -0
  180. package/corpus/templates/analytics/app/i18n-data.ts +40 -0
  181. package/corpus/templates/analytics/app/pages/Settings.tsx +6 -2
  182. package/corpus/templates/analytics/app/pages/adhoc/explorer/components/SqlPreview.tsx +36 -20
  183. package/corpus/templates/analytics/app/pages/adhoc/explorer/index.tsx +34 -20
  184. package/corpus/templates/analytics/app/pages/adhoc/explorer/use-explorer-config.ts +42 -41
  185. package/corpus/templates/analytics/app/pages/adhoc/explorer-dashboard/index.tsx +43 -36
  186. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/ViewsMenu.tsx +11 -2
  187. package/corpus/templates/analytics/app/root.tsx +13 -1
  188. package/corpus/templates/analytics/app/routes/_index.tsx +14 -2
  189. package/corpus/templates/analytics/changelog/2026-07-03-agent-llm-observability-dashboard.md +1 -1
  190. package/corpus/templates/analytics/changelog/2026-07-11-agent-feedback-sentiment-dashboard.md +6 -0
  191. package/corpus/templates/analytics/changelog/2026-07-11-analytics-chats-now-start-faster-by-loading-metric-definitio.md +6 -0
  192. package/corpus/templates/analytics/changelog/2026-07-11-command-and-sql-previews-now-respond-without-lag.md +6 -0
  193. package/corpus/templates/analytics/changelog/2026-07-11-command-search-now-reports-loading-failures-and-lets-you-ret.md +6 -0
  194. package/corpus/templates/analytics/changelog/2026-07-11-dashboard-navigation-now-loads-faster-and-reports-request-fa.md +6 -0
  195. package/corpus/templates/analytics/changelog/2026-07-11-inferred-message-sentiment-dashboard.md +6 -0
  196. package/corpus/templates/analytics/changelog/2026-07-11-microphone-settings-from-realtime-voice-mode-now-open-the-vo.md +6 -0
  197. package/corpus/templates/analytics/changelog/2026-07-11-more-dashboard-edit-paths-are-now-safe-against-simultaneous-.md +6 -0
  198. package/corpus/templates/analytics/changelog/2026-07-11-renaming-a-dashboard-is-now-safe-against-simultaneous-agent-.md +6 -0
  199. package/corpus/templates/analytics/changelog/2026-07-11-renaming-an-analysis-is-now-safe-against-simultaneous-edits.md +6 -0
  200. package/corpus/templates/analytics/changelog/2026-07-11-workspace-mounted-analytics-now-opens-ask-reliably-and-route.md +6 -0
  201. package/corpus/templates/analytics/docs/schemas/first-party-analytics.md +37 -3
  202. package/corpus/templates/analytics/seeds/dashboards/agent-native-templates-first-party.json +339 -1
  203. package/corpus/templates/analytics/server/lib/dashboard-catalog.ts +1 -24
  204. package/corpus/templates/analytics/server/lib/dashboard-seeds.ts +0 -5
  205. package/corpus/templates/analytics/server/lib/dashboards-store.ts +289 -20
  206. package/corpus/templates/analytics/server/lib/data-dictionary-context.ts +106 -34
  207. package/corpus/templates/analytics/server/lib/demo-dashboards.ts +4 -1
  208. package/corpus/templates/analytics/server/plugins/agent-chat.ts +11 -39
  209. package/corpus/templates/assets/.agents/skills/frontend-design/SKILL.md +1 -1
  210. package/corpus/templates/assets/app/components/create/RecentDraftsSection.tsx +30 -4
  211. package/corpus/templates/assets/app/routes/library.tsx +49 -5
  212. package/corpus/templates/assets/changelog/2026-07-11-library-load-failures-now-show-a-retry-action.md +6 -0
  213. package/corpus/templates/brain/.agents/skills/frontend-design/SKILL.md +1 -1
  214. package/corpus/templates/calendar/.agents/skills/frontend-design/SKILL.md +1 -1
  215. package/corpus/templates/calendar/.env.example +5 -0
  216. package/corpus/templates/calendar/app/components/calendar/EventCard.tsx +2 -2
  217. package/corpus/templates/calendar/app/i18n/zh-TW.ts +2 -0
  218. package/corpus/templates/calendar/app/i18n-data.ts +20 -0
  219. package/corpus/templates/calendar/app/pages/BookingLinksPage.tsx +37 -1
  220. package/corpus/templates/calendar/app/pages/BookingsList.tsx +20 -3
  221. package/corpus/templates/calendar/changelog/2026-07-11-booking-load-failures-now-show-a-retry-action.md +6 -0
  222. package/corpus/templates/calendar/changelog/2026-07-11-event-cards-give-subtle-press-feedback-and-smoother-hover.md +6 -0
  223. package/corpus/templates/chat/.agents/skills/frontend-design/SKILL.md +1 -1
  224. package/corpus/templates/clips/.agents/skills/frontend-design/SKILL.md +1 -1
  225. package/corpus/templates/clips/actions/decline-invite.ts +8 -0
  226. package/corpus/templates/clips/app/components/library/folder-tree.tsx +209 -187
  227. package/corpus/templates/clips/app/components/meetings/meeting-card.tsx +2 -2
  228. package/corpus/templates/clips/app/components/player/reactions-tray.tsx +17 -5
  229. package/corpus/templates/clips/app/components/player/scrubber.tsx +5 -3
  230. package/corpus/templates/clips/app/components/recorder/pre-record-panel.tsx +2 -2
  231. package/corpus/templates/clips/app/components/workspace/insights-hub.tsx +119 -95
  232. package/corpus/templates/clips/app/global.css +45 -0
  233. package/corpus/templates/clips/app/root.tsx +4 -0
  234. package/corpus/templates/clips/app/routes/_app.notifications.tsx +23 -2
  235. package/corpus/templates/clips/app/routes/_app.trash.tsx +24 -2
  236. package/corpus/templates/clips/changelog/2026-07-11-controls-and-folders-now-move-more-smoothly.md +6 -0
  237. package/corpus/templates/clips/changelog/2026-07-11-declining-an-invitation-now-requires-being-its-recipient.md +6 -0
  238. package/corpus/templates/clips/changelog/2026-07-11-recording-overlays-are-lighter-weight-and-no-longer-cause-pa.md +6 -0
  239. package/corpus/templates/clips/changelog/2026-07-11-workspace-load-failures-now-show-a-retry-action.md +6 -0
  240. package/corpus/templates/clips/chrome-extension/src/overlay.css +34 -5
  241. package/corpus/templates/clips/chrome-extension/src/styles.css +2 -2
  242. package/corpus/templates/clips/desktop/src/styles.css +71 -26
  243. package/corpus/templates/content/.agents/skills/frontend-design/SKILL.md +1 -1
  244. package/corpus/templates/content/actions/move-document.ts +34 -18
  245. package/corpus/templates/content/app/components/QueryErrorState.tsx +39 -0
  246. package/corpus/templates/content/app/components/editor/LinkHoverPreview.tsx +1 -1
  247. package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +225 -1435
  248. package/corpus/templates/content/app/components/editor/database/GalleryView.tsx +368 -0
  249. package/corpus/templates/content/app/components/editor/database/ListView.tsx +353 -0
  250. package/corpus/templates/content/app/components/editor/database/TimelineView.tsx +580 -0
  251. package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +11 -2
  252. package/corpus/templates/content/app/global.css +19 -19
  253. package/corpus/templates/content/app/root.tsx +2 -2
  254. package/corpus/templates/content/app/routes/_app._index.tsx +11 -1
  255. package/corpus/templates/content/changelog/2026-07-11-document-load-failures-now-show-a-retry-action.md +6 -0
  256. package/corpus/templates/content/changelog/2026-07-11-editor-toggle-feedback-now-feels-more-responsive.md +6 -0
  257. package/corpus/templates/content/changelog/2026-07-11-moving-documents-at-the-same-time-no-longer-scrambles-their-.md +6 -0
  258. package/corpus/templates/content/changelog/2026-07-11-public-document-chats-now-start-faster-while-keeping-full-do.md +6 -0
  259. package/corpus/templates/content/changelog/2026-07-11-reopening-a-comment-now-uses-consistent-permissions-everywhe.md +6 -0
  260. package/corpus/templates/content/changelog/2026-07-11-sidebar-resizing-now-tracks-your-cursor-instantly-instead-of.md +6 -0
  261. package/corpus/templates/content/server/lib/public-documents.ts +47 -10
  262. package/corpus/templates/content/server/routes/api/comments/[id].patch.ts +24 -24
  263. package/corpus/templates/design/.agents/skills/frontend-design/SKILL.md +1 -1
  264. package/corpus/templates/design/app/components/QueryErrorState.tsx +24 -0
  265. package/corpus/templates/design/app/components/design/CanvasContextMenu.tsx +1 -1
  266. package/corpus/templates/design/app/components/design/DesignImportPanel.tsx +5 -2
  267. package/corpus/templates/design/app/components/design/EditPanel.tsx +326 -319
  268. package/corpus/templates/design/app/components/design/LayersPanel.tsx +198 -193
  269. package/corpus/templates/design/app/components/design/edit-panel/panel-primitives.tsx +11 -4
  270. package/corpus/templates/design/app/components/design/inspector/DesignColorPicker.tsx +1 -1
  271. package/corpus/templates/design/app/components/layout/Layout.tsx +1 -1
  272. package/corpus/templates/design/app/pages/DesignSystems.tsx +7 -1
  273. package/corpus/templates/design/app/pages/Index.tsx +14 -2
  274. package/corpus/templates/design/app/pages/Present.tsx +16 -3
  275. package/corpus/templates/design/app/pages/Templates.tsx +10 -4
  276. package/corpus/templates/design/app/pages/design-editor/canvas-primitive-insert.ts +484 -0
  277. package/corpus/templates/design/app/pages/design-editor/clone-and-pen-edit.ts +378 -0
  278. package/corpus/templates/design/app/pages/design-editor/design-data-geometry-utils.ts +138 -0
  279. package/corpus/templates/design/app/pages/design-editor/dom-utils.ts +15 -0
  280. package/corpus/templates/design/app/pages/design-editor/generation-prompt-directives.ts +180 -0
  281. package/corpus/templates/design/app/pages/design-editor/html-layer-positioning.ts +226 -0
  282. package/corpus/templates/design/app/pages/design-editor/png-export-render.ts +348 -0
  283. package/corpus/templates/design/app/pages/design-editor/screen-command-utils.ts +160 -0
  284. package/corpus/templates/design/app/pages/design-editor/text-edit-utils.ts +238 -0
  285. package/corpus/templates/design/app/pages/design-editor/tool-state.ts +23 -1
  286. package/corpus/templates/design/app/pages/design-editor/types.ts +25 -0
  287. package/corpus/templates/design/app/root.tsx +10 -1
  288. package/corpus/templates/design/changelog/2026-07-11-canvas-context-menus-now-open-without-motion-jitter.md +6 -0
  289. package/corpus/templates/design/changelog/2026-07-11-design-load-failures-now-show-a-retry-action.md +6 -0
  290. package/corpus/templates/design/changelog/2026-07-11-inspector-tooltips-appear-instantly-as-you-sweep-across-icon.md +6 -0
  291. package/corpus/templates/dispatch/.agents/skills/frontend-design/SKILL.md +1 -1
  292. package/corpus/templates/dispatch/app/i18n/zh-TW.ts +10 -0
  293. package/corpus/templates/dispatch/app/i18n-data.ts +123 -0
  294. package/corpus/templates/dispatch/app/routes/integrations.tsx +163 -144
  295. package/corpus/templates/dispatch/changelog/2026-07-11-dispatch-mcp-connections-now-start-with-safer-app-access-and.md +6 -0
  296. package/corpus/templates/dispatch/changelog/2026-07-11-overview-and-chat-now-share-a-cleaner-more-stable-flow.md +6 -0
  297. package/corpus/templates/dispatch/changelog/2026-07-11-query-errors-now-show-a-retry-option.md +6 -0
  298. package/corpus/templates/forms/.agents/skills/frontend-design/SKILL.md +1 -1
  299. package/corpus/templates/forms/app/components/layout/Sidebar.tsx +3 -3
  300. package/corpus/templates/forms/app/root.tsx +34 -8
  301. package/corpus/templates/macros/.agents/skills/frontend-design/SKILL.md +1 -1
  302. package/corpus/templates/macros/app/components/DailyProgress.tsx +25 -5
  303. package/corpus/templates/macros/app/components/QueryErrorState.tsx +31 -0
  304. package/corpus/templates/macros/app/components/WeightTracker.tsx +5 -1
  305. package/corpus/templates/macros/app/components/ui/button.tsx +1 -1
  306. package/corpus/templates/macros/app/components/ui/progress.tsx +1 -1
  307. package/corpus/templates/macros/app/components/ui/tabs.tsx +1 -1
  308. package/corpus/templates/macros/app/i18n/ar-SA.ts +2 -0
  309. package/corpus/templates/macros/app/i18n/de-DE.ts +2 -0
  310. package/corpus/templates/macros/app/i18n/en-US.ts +2 -0
  311. package/corpus/templates/macros/app/i18n/es-ES.ts +2 -0
  312. package/corpus/templates/macros/app/i18n/fr-FR.ts +2 -0
  313. package/corpus/templates/macros/app/i18n/hi-IN.ts +2 -0
  314. package/corpus/templates/macros/app/i18n/ja-JP.ts +2 -0
  315. package/corpus/templates/macros/app/i18n/ko-KR.ts +2 -0
  316. package/corpus/templates/macros/app/i18n/pt-BR.ts +2 -0
  317. package/corpus/templates/macros/app/i18n/zh-CN.ts +2 -0
  318. package/corpus/templates/macros/app/i18n/zh-TW.ts +2 -0
  319. package/corpus/templates/macros/app/routes/_index.tsx +22 -12
  320. package/corpus/templates/macros/app/routes/analytics.tsx +31 -10
  321. package/corpus/templates/macros/changelog/2026-07-11-daily-tracking-now-loads-and-updates-more-quickly.md +6 -0
  322. package/corpus/templates/macros/changelog/2026-07-11-data-load-failures-now-show-a-clear-error-with-a-retry-actio.md +6 -0
  323. package/corpus/templates/mail/.agents/skills/frontend-design/SKILL.md +1 -1
  324. package/corpus/templates/mail/.env.example +16 -11
  325. package/corpus/templates/mail/actions/list-emails.ts +39 -35
  326. package/corpus/templates/mail/app/components/email/ComposeModal.tsx +58 -6
  327. package/corpus/templates/mail/app/components/email/EmailListItem.tsx +35 -2
  328. package/corpus/templates/mail/app/components/layout/AppLayout.tsx +113 -104
  329. package/corpus/templates/mail/app/root.tsx +8 -10
  330. package/corpus/templates/mail/changelog/2026-07-11-compose-and-navigation-motion-now-feel-faster-and-smoother.md +6 -0
  331. package/corpus/templates/mail/changelog/2026-07-11-swipe-to-archive-or-snooze-now-responds-to-quick-flicks-not-.md +6 -0
  332. package/corpus/templates/mail/changelog/2026-07-11-the-assistant-now-sees-the-same-inbox-you-do-snoozed-mail-st.md +6 -0
  333. package/corpus/templates/mail/server/handlers/emails.ts +25 -69
  334. package/corpus/templates/mail/server/lib/list-inbox-emails.ts +169 -0
  335. package/corpus/templates/plan/.agents/skills/frontend-design/SKILL.md +1 -1
  336. package/corpus/templates/plan/.env.example +4 -0
  337. package/corpus/templates/plan/actions/create-plan-design.ts +89 -81
  338. package/corpus/templates/plan/actions/create-prototype-plan.ts +72 -59
  339. package/corpus/templates/plan/actions/create-ui-plan.ts +70 -55
  340. package/corpus/templates/plan/actions/create-visual-plan.ts +65 -51
  341. package/corpus/templates/plan/actions/update-local-plan-folder.ts +43 -30
  342. package/corpus/templates/plan/actions/update-visual-plan.ts +81 -64
  343. package/corpus/templates/plan/app/components/layout/Sidebar.tsx +17 -0
  344. package/corpus/templates/plan/app/components/ui/tabs.tsx +1 -1
  345. package/corpus/templates/plan/app/i18n/ar-SA.ts +10 -0
  346. package/corpus/templates/plan/app/i18n/de-DE.ts +10 -0
  347. package/corpus/templates/plan/app/i18n/en-US.ts +10 -0
  348. package/corpus/templates/plan/app/i18n/es-ES.ts +10 -0
  349. package/corpus/templates/plan/app/i18n/fr-FR.ts +10 -0
  350. package/corpus/templates/plan/app/i18n/hi-IN.ts +10 -0
  351. package/corpus/templates/plan/app/i18n/ja-JP.ts +10 -0
  352. package/corpus/templates/plan/app/i18n/ko-KR.ts +10 -0
  353. package/corpus/templates/plan/app/i18n/pt-BR.ts +10 -0
  354. package/corpus/templates/plan/app/i18n/zh-CN.ts +10 -0
  355. package/corpus/templates/plan/app/i18n/zh-TW.ts +10 -0
  356. package/corpus/templates/plan/app/lib/plan-local-bridge.ts +80 -1
  357. package/corpus/templates/plan/app/pages/PlansPage.tsx +152 -4
  358. package/corpus/templates/plan/app/root.tsx +11 -0
  359. package/corpus/templates/plan/changelog/2026-07-11-local-plans-now-explain-and-recover-from-browser-permission-.md +6 -0
  360. package/corpus/templates/plan/changelog/2026-07-11-plan-edits-now-save-atomically-and-can-no-longer-partially-a.md +6 -0
  361. package/corpus/templates/plan/changelog/2026-07-11-plan-lists-now-show-a-clear-error-with-a-retry-action-when-t.md +6 -0
  362. package/corpus/templates/plan/shared/plan-content.ts +546 -260
  363. package/corpus/templates/slides/.agents/skills/frontend-design/SKILL.md +1 -1
  364. package/corpus/templates/slides/actions/delete-slide-comment.ts +49 -0
  365. package/corpus/templates/slides/actions/update-slide-comment.ts +93 -0
  366. package/corpus/templates/slides/actions/view-screen.ts +14 -6
  367. package/corpus/templates/slides/app/components/comments/SlideCommentsPanel.tsx +33 -10
  368. package/corpus/templates/slides/app/components/editor/EditorSidebar.tsx +1 -1
  369. package/corpus/templates/slides/app/components/editor/EditorToolbar.tsx +1 -1
  370. package/corpus/templates/slides/app/components/editor/GenerateSlidesDialog.tsx +2 -2
  371. package/corpus/templates/slides/app/components/presentation/PresentationView.tsx +4 -2
  372. package/corpus/templates/slides/app/components/visual-editor/CanvasCommentPins.tsx +4 -3
  373. package/corpus/templates/slides/app/context/DeckContext.tsx +9 -0
  374. package/corpus/templates/slides/app/i18n/ar-SA.ts +6 -0
  375. package/corpus/templates/slides/app/i18n/de-DE.ts +6 -0
  376. package/corpus/templates/slides/app/i18n/en-US.ts +6 -0
  377. package/corpus/templates/slides/app/i18n/es-ES.ts +6 -0
  378. package/corpus/templates/slides/app/i18n/fr-FR.ts +6 -0
  379. package/corpus/templates/slides/app/i18n/hi-IN.ts +6 -0
  380. package/corpus/templates/slides/app/i18n/ja-JP.ts +6 -0
  381. package/corpus/templates/slides/app/i18n/ko-KR.ts +6 -0
  382. package/corpus/templates/slides/app/i18n/pt-BR.ts +6 -0
  383. package/corpus/templates/slides/app/i18n/zh-CN.ts +5 -0
  384. package/corpus/templates/slides/app/i18n/zh-TW.ts +5 -0
  385. package/corpus/templates/slides/app/pages/DesignSystems.tsx +23 -2
  386. package/corpus/templates/slides/app/pages/Index.tsx +29 -1
  387. package/corpus/templates/slides/changelog/2026-07-11-comment-load-failures-now-show-a-retry-action-instead-of-say.md +6 -0
  388. package/corpus/templates/slides/changelog/2026-07-11-comment-pins-now-clear-with-a-faster-smoother-confirmation.md +6 -0
  389. package/corpus/templates/slides/changelog/2026-07-11-deck-and-design-system-load-failures-now-show-a-retry-action.md +6 -0
  390. package/corpus/templates/slides/changelog/2026-07-11-editor-toggles-and-toolbar-menus-now-animate-smoothly.md +6 -0
  391. package/corpus/templates/slides/changelog/2026-07-11-the-assistant-can-now-resolve-reopen-and-delete-slide-commen.md +6 -0
  392. package/corpus/templates/slides/changelog/2026-07-11-viewing-slides-no-longer-loads-every-deck-s-full-contents-in.md +6 -0
  393. package/corpus/templates/slides/server/routes/api/comments/[id].delete.ts +29 -48
  394. package/corpus/templates/slides/server/routes/api/comments/[id].patch.ts +29 -65
  395. package/dist/action.d.ts +23 -0
  396. package/dist/action.d.ts.map +1 -1
  397. package/dist/action.js +13 -0
  398. package/dist/action.js.map +1 -1
  399. package/dist/agent/engine/builder-engine.d.ts.map +1 -1
  400. package/dist/agent/engine/builder-engine.js +3 -0
  401. package/dist/agent/engine/builder-engine.js.map +1 -1
  402. package/dist/agent/engine/context-directives-transform.d.ts +25 -0
  403. package/dist/agent/engine/context-directives-transform.d.ts.map +1 -0
  404. package/dist/agent/engine/context-directives-transform.js +53 -0
  405. package/dist/agent/engine/context-directives-transform.js.map +1 -0
  406. package/dist/agent/engine/continuation-dispatch-retry.d.ts +40 -0
  407. package/dist/agent/engine/continuation-dispatch-retry.d.ts.map +1 -0
  408. package/dist/agent/engine/continuation-dispatch-retry.js +109 -0
  409. package/dist/agent/engine/continuation-dispatch-retry.js.map +1 -0
  410. package/dist/agent/engine/tool-call-journal-seed.d.ts +46 -0
  411. package/dist/agent/engine/tool-call-journal-seed.d.ts.map +1 -0
  412. package/dist/agent/engine/tool-call-journal-seed.js +60 -0
  413. package/dist/agent/engine/tool-call-journal-seed.js.map +1 -0
  414. package/dist/agent/production-agent.d.ts +7 -0
  415. package/dist/agent/production-agent.d.ts.map +1 -1
  416. package/dist/agent/production-agent.js +102 -222
  417. package/dist/agent/production-agent.js.map +1 -1
  418. package/dist/cli/doctor.d.ts.map +1 -1
  419. package/dist/cli/doctor.js +7 -3
  420. package/dist/cli/doctor.js.map +1 -1
  421. package/dist/cli/plan-local.d.ts.map +1 -1
  422. package/dist/cli/plan-local.js +8 -2
  423. package/dist/cli/plan-local.js.map +1 -1
  424. package/dist/cli/skills-content/assets-skill.d.ts +2 -0
  425. package/dist/cli/skills-content/assets-skill.d.ts.map +1 -0
  426. package/dist/cli/skills-content/assets-skill.js +84 -0
  427. package/dist/cli/skills-content/assets-skill.js.map +1 -0
  428. package/dist/cli/skills-content/canvas.d.ts +4 -0
  429. package/dist/cli/skills-content/canvas.d.ts.map +1 -0
  430. package/dist/cli/skills-content/canvas.js +152 -0
  431. package/dist/cli/skills-content/canvas.js.map +1 -0
  432. package/dist/cli/skills-content/connection.d.ts +2 -0
  433. package/dist/cli/skills-content/connection.d.ts.map +1 -0
  434. package/dist/cli/skills-content/connection.js +53 -0
  435. package/dist/cli/skills-content/connection.js.map +1 -0
  436. package/dist/cli/skills-content/content-skill.d.ts +2 -0
  437. package/dist/cli/skills-content/content-skill.d.ts.map +1 -0
  438. package/dist/cli/skills-content/content-skill.js +110 -0
  439. package/dist/cli/skills-content/content-skill.js.map +1 -0
  440. package/dist/cli/skills-content/design-exploration-skill.d.ts +2 -0
  441. package/dist/cli/skills-content/design-exploration-skill.d.ts.map +1 -0
  442. package/dist/cli/skills-content/design-exploration-skill.js +119 -0
  443. package/dist/cli/skills-content/design-exploration-skill.js.map +1 -0
  444. package/dist/cli/skills-content/design-visual-edit-skill.d.ts +2 -0
  445. package/dist/cli/skills-content/design-visual-edit-skill.d.ts.map +1 -0
  446. package/dist/cli/skills-content/design-visual-edit-skill.js +229 -0
  447. package/dist/cli/skills-content/design-visual-edit-skill.js.map +1 -0
  448. package/dist/cli/skills-content/document-quality.d.ts +4 -0
  449. package/dist/cli/skills-content/document-quality.d.ts.map +1 -0
  450. package/dist/cli/skills-content/document-quality.js +195 -0
  451. package/dist/cli/skills-content/document-quality.js.map +1 -0
  452. package/dist/cli/skills-content/exemplar.d.ts +4 -0
  453. package/dist/cli/skills-content/exemplar.d.ts.map +1 -0
  454. package/dist/cli/skills-content/exemplar.js +68 -0
  455. package/dist/cli/skills-content/exemplar.js.map +1 -0
  456. package/dist/cli/skills-content/help.d.ts +2 -0
  457. package/dist/cli/skills-content/help.d.ts.map +1 -0
  458. package/dist/cli/skills-content/help.js +78 -0
  459. package/dist/cli/skills-content/help.js.map +1 -0
  460. package/dist/cli/skills-content/index.d.ts +23 -0
  461. package/dist/cli/skills-content/index.d.ts.map +1 -0
  462. package/dist/cli/skills-content/index.js +23 -0
  463. package/dist/cli/skills-content/index.js.map +1 -0
  464. package/dist/cli/skills-content/local-files.d.ts +2 -0
  465. package/dist/cli/skills-content/local-files.d.ts.map +1 -0
  466. package/dist/cli/skills-content/local-files.js +96 -0
  467. package/dist/cli/skills-content/local-files.js.map +1 -0
  468. package/dist/cli/skills-content/plan-setup-auth.d.ts +9 -0
  469. package/dist/cli/skills-content/plan-setup-auth.d.ts.map +1 -0
  470. package/dist/cli/skills-content/plan-setup-auth.js +81 -0
  471. package/dist/cli/skills-content/plan-setup-auth.js.map +1 -0
  472. package/dist/cli/skills-content/visual-plan-skill.d.ts +2 -0
  473. package/dist/cli/skills-content/visual-plan-skill.d.ts.map +1 -0
  474. package/dist/cli/skills-content/visual-plan-skill.js +471 -0
  475. package/dist/cli/skills-content/visual-plan-skill.js.map +1 -0
  476. package/dist/cli/skills-content/visual-recap-skill.d.ts +2 -0
  477. package/dist/cli/skills-content/visual-recap-skill.d.ts.map +1 -0
  478. package/dist/cli/skills-content/visual-recap-skill.js +548 -0
  479. package/dist/cli/skills-content/visual-recap-skill.js.map +1 -0
  480. package/dist/cli/skills-content/visualize-repo-skill.d.ts +2 -0
  481. package/dist/cli/skills-content/visualize-repo-skill.d.ts.map +1 -0
  482. package/dist/cli/skills-content/visualize-repo-skill.js +94 -0
  483. package/dist/cli/skills-content/visualize-repo-skill.js.map +1 -0
  484. package/dist/cli/skills-content/wireframe.d.ts +4 -0
  485. package/dist/cli/skills-content/wireframe.d.ts.map +1 -0
  486. package/dist/cli/skills-content/wireframe.js +347 -0
  487. package/dist/cli/skills-content/wireframe.js.map +1 -0
  488. package/dist/cli/skills.d.ts +2 -10
  489. package/dist/cli/skills.d.ts.map +1 -1
  490. package/dist/cli/skills.js +2 -2710
  491. package/dist/cli/skills.js.map +1 -1
  492. package/dist/client/AgentPanel.d.ts.map +1 -1
  493. package/dist/client/AgentPanel.js +4 -2
  494. package/dist/client/AgentPanel.js.map +1 -1
  495. package/dist/client/CommandMenu.d.ts.map +1 -1
  496. package/dist/client/CommandMenu.js +15 -3
  497. package/dist/client/CommandMenu.js.map +1 -1
  498. package/dist/client/FeedbackButton.js +2 -2
  499. package/dist/client/FeedbackButton.js.map +1 -1
  500. package/dist/client/app-providers.d.ts +13 -5
  501. package/dist/client/app-providers.d.ts.map +1 -1
  502. package/dist/client/app-providers.js +9 -6
  503. package/dist/client/app-providers.js.map +1 -1
  504. package/dist/client/chat/tool-call-display.d.ts +4 -0
  505. package/dist/client/chat/tool-call-display.d.ts.map +1 -1
  506. package/dist/client/chat/tool-call-display.js +3 -3
  507. package/dist/client/chat/tool-call-display.js.map +1 -1
  508. package/dist/client/composer/PastedTextChip.js +1 -1
  509. package/dist/client/composer/PastedTextChip.js.map +1 -1
  510. package/dist/client/composer/RealtimeVoiceMode.d.ts +3 -1
  511. package/dist/client/composer/RealtimeVoiceMode.d.ts.map +1 -1
  512. package/dist/client/composer/RealtimeVoiceMode.js +35 -14
  513. package/dist/client/composer/RealtimeVoiceMode.js.map +1 -1
  514. package/dist/client/composer/TiptapComposer.js +1 -1
  515. package/dist/client/composer/TiptapComposer.js.map +1 -1
  516. package/dist/client/composer/VoiceButton.d.ts +2 -0
  517. package/dist/client/composer/VoiceButton.d.ts.map +1 -1
  518. package/dist/client/composer/VoiceButton.js +9 -3
  519. package/dist/client/composer/VoiceButton.js.map +1 -1
  520. package/dist/client/composer/useRealtimeVoiceMode.d.ts +5 -0
  521. package/dist/client/composer/useRealtimeVoiceMode.d.ts.map +1 -1
  522. package/dist/client/composer/useRealtimeVoiceMode.js +91 -12
  523. package/dist/client/composer/useRealtimeVoiceMode.js.map +1 -1
  524. package/dist/client/context-xray/ContextXRayPanel.d.ts.map +1 -1
  525. package/dist/client/context-xray/ContextXRayPanel.js +4 -1
  526. package/dist/client/context-xray/ContextXRayPanel.js.map +1 -1
  527. package/dist/client/extensions/ExtensionEditor.d.ts.map +1 -1
  528. package/dist/client/extensions/ExtensionEditor.js +15 -5
  529. package/dist/client/extensions/ExtensionEditor.js.map +1 -1
  530. package/dist/client/extensions/ExtensionQueryErrorState.d.ts +8 -0
  531. package/dist/client/extensions/ExtensionQueryErrorState.d.ts.map +1 -0
  532. package/dist/client/extensions/ExtensionQueryErrorState.js +11 -0
  533. package/dist/client/extensions/ExtensionQueryErrorState.js.map +1 -0
  534. package/dist/client/extensions/ExtensionSlot.d.ts.map +1 -1
  535. package/dist/client/extensions/ExtensionSlot.js +17 -7
  536. package/dist/client/extensions/ExtensionSlot.js.map +1 -1
  537. package/dist/client/extensions/ExtensionViewer.d.ts.map +1 -1
  538. package/dist/client/extensions/ExtensionViewer.js +17 -7
  539. package/dist/client/extensions/ExtensionViewer.js.map +1 -1
  540. package/dist/client/extensions/ExtensionsListPage.d.ts.map +1 -1
  541. package/dist/client/extensions/ExtensionsListPage.js +5 -3
  542. package/dist/client/extensions/ExtensionsListPage.js.map +1 -1
  543. package/dist/client/extensions/ExtensionsSidebarSection.d.ts.map +1 -1
  544. package/dist/client/extensions/ExtensionsSidebarSection.js +21 -8
  545. package/dist/client/extensions/ExtensionsSidebarSection.js.map +1 -1
  546. package/dist/client/index.d.ts +0 -2
  547. package/dist/client/index.d.ts.map +1 -1
  548. package/dist/client/index.js +0 -5
  549. package/dist/client/index.js.map +1 -1
  550. package/dist/client/progress/RunsTray.d.ts.map +1 -1
  551. package/dist/client/progress/RunsTray.js +7 -3
  552. package/dist/client/progress/RunsTray.js.map +1 -1
  553. package/dist/client/settings/SettingsTabsPage.d.ts.map +1 -1
  554. package/dist/client/settings/SettingsTabsPage.js +4 -0
  555. package/dist/client/settings/SettingsTabsPage.js.map +1 -1
  556. package/dist/client/settings/useBuilderStatus.d.ts +2 -0
  557. package/dist/client/settings/useBuilderStatus.d.ts.map +1 -1
  558. package/dist/client/settings/useBuilderStatus.js +4 -0
  559. package/dist/client/settings/useBuilderStatus.js.map +1 -1
  560. package/dist/client/tool-cells/EditCell.d.ts.map +1 -1
  561. package/dist/client/tool-cells/EditCell.js +2 -1
  562. package/dist/client/tool-cells/EditCell.js.map +1 -1
  563. package/dist/client/tool-cells/FilesChangedSummary.d.ts.map +1 -1
  564. package/dist/client/tool-cells/FilesChangedSummary.js +2 -1
  565. package/dist/client/tool-cells/FilesChangedSummary.js.map +1 -1
  566. package/dist/client/tool-cells/WriteCell.d.ts.map +1 -1
  567. package/dist/client/tool-cells/WriteCell.js +2 -1
  568. package/dist/client/tool-cells/WriteCell.js.map +1 -1
  569. package/dist/client/visual-style-controls.js +1 -1
  570. package/dist/client/visual-style-controls.js.map +1 -1
  571. package/dist/collab/routes.d.ts +1 -1
  572. package/dist/deploy/build.d.ts.map +1 -1
  573. package/dist/deploy/build.js +36 -14
  574. package/dist/deploy/build.js.map +1 -1
  575. package/dist/integrations/google-docs-poller.d.ts +7 -0
  576. package/dist/integrations/google-docs-poller.d.ts.map +1 -1
  577. package/dist/integrations/google-docs-poller.js +13 -3
  578. package/dist/integrations/google-docs-poller.js.map +1 -1
  579. package/dist/integrations/plugin.d.ts.map +1 -1
  580. package/dist/integrations/plugin.js +10 -0
  581. package/dist/integrations/plugin.js.map +1 -1
  582. package/dist/integrations/webhook-handler.d.ts +11 -0
  583. package/dist/integrations/webhook-handler.d.ts.map +1 -1
  584. package/dist/integrations/webhook-handler.js +16 -4
  585. package/dist/integrations/webhook-handler.js.map +1 -1
  586. package/dist/jobs/scheduler.d.ts +12 -0
  587. package/dist/jobs/scheduler.d.ts.map +1 -1
  588. package/dist/jobs/scheduler.js +13 -3
  589. package/dist/jobs/scheduler.js.map +1 -1
  590. package/dist/localization/default-messages.d.ts +7 -0
  591. package/dist/localization/default-messages.d.ts.map +1 -1
  592. package/dist/localization/default-messages.js +8 -1
  593. package/dist/localization/default-messages.js.map +1 -1
  594. package/dist/mcp/oauth-token.d.ts +1 -1
  595. package/dist/mcp/oauth-token.d.ts.map +1 -1
  596. package/dist/mcp/oauth-token.js +6 -1
  597. package/dist/mcp/oauth-token.js.map +1 -1
  598. package/dist/notifications/routes.d.ts +2 -2
  599. package/dist/observability/routes.d.ts.map +1 -1
  600. package/dist/observability/routes.js +32 -0
  601. package/dist/observability/routes.js.map +1 -1
  602. package/dist/observability/sentiment.d.ts +42 -0
  603. package/dist/observability/sentiment.d.ts.map +1 -0
  604. package/dist/observability/sentiment.js +196 -0
  605. package/dist/observability/sentiment.js.map +1 -0
  606. package/dist/observability/store.d.ts +5 -0
  607. package/dist/observability/store.d.ts.map +1 -1
  608. package/dist/observability/store.js +17 -0
  609. package/dist/observability/store.js.map +1 -1
  610. package/dist/observability/traces.d.ts +2 -0
  611. package/dist/observability/traces.d.ts.map +1 -1
  612. package/dist/observability/traces.js +42 -57
  613. package/dist/observability/traces.js.map +1 -1
  614. package/dist/observability/tracking-identity.d.ts +3 -0
  615. package/dist/observability/tracking-identity.d.ts.map +1 -0
  616. package/dist/observability/tracking-identity.js +51 -0
  617. package/dist/observability/tracking-identity.js.map +1 -0
  618. package/dist/observability/types.d.ts +10 -0
  619. package/dist/observability/types.d.ts.map +1 -1
  620. package/dist/observability/types.js +3 -0
  621. package/dist/observability/types.js.map +1 -1
  622. package/dist/progress/routes.d.ts +1 -1
  623. package/dist/provider-api/corpus-jobs.d.ts +2 -2
  624. package/dist/resources/handlers.d.ts +1 -1
  625. package/dist/secrets/storage.d.ts +6 -0
  626. package/dist/secrets/storage.d.ts.map +1 -1
  627. package/dist/secrets/storage.js +61 -3
  628. package/dist/secrets/storage.js.map +1 -1
  629. package/dist/server/agent-chat/action-filters-a2a.d.ts +50 -0
  630. package/dist/server/agent-chat/action-filters-a2a.d.ts.map +1 -0
  631. package/dist/server/agent-chat/action-filters-a2a.js +127 -0
  632. package/dist/server/agent-chat/action-filters-a2a.js.map +1 -0
  633. package/dist/server/agent-chat/browser-team-tools.d.ts +21 -0
  634. package/dist/server/agent-chat/browser-team-tools.d.ts.map +1 -0
  635. package/dist/server/agent-chat/browser-team-tools.js +417 -0
  636. package/dist/server/agent-chat/browser-team-tools.js.map +1 -0
  637. package/dist/server/agent-chat/context-tools.d.ts +33 -0
  638. package/dist/server/agent-chat/context-tools.d.ts.map +1 -0
  639. package/dist/server/agent-chat/context-tools.js +520 -0
  640. package/dist/server/agent-chat/context-tools.js.map +1 -0
  641. package/dist/server/agent-chat/framework-prompts.d.ts +65 -0
  642. package/dist/server/agent-chat/framework-prompts.d.ts.map +1 -0
  643. package/dist/server/agent-chat/framework-prompts.js +403 -0
  644. package/dist/server/agent-chat/framework-prompts.js.map +1 -0
  645. package/dist/server/agent-chat/lazy-fs.d.ts +2 -0
  646. package/dist/server/agent-chat/lazy-fs.d.ts.map +1 -0
  647. package/dist/server/agent-chat/lazy-fs.js +11 -0
  648. package/dist/server/agent-chat/lazy-fs.js.map +1 -0
  649. package/dist/server/agent-chat/mcp-glue.d.ts +9 -0
  650. package/dist/server/agent-chat/mcp-glue.d.ts.map +1 -0
  651. package/dist/server/agent-chat/mcp-glue.js +63 -0
  652. package/dist/server/agent-chat/mcp-glue.js.map +1 -0
  653. package/dist/server/agent-chat/plugin-options.d.ts +322 -0
  654. package/dist/server/agent-chat/plugin-options.d.ts.map +1 -0
  655. package/dist/server/agent-chat/plugin-options.js +2 -0
  656. package/dist/server/agent-chat/plugin-options.js.map +1 -0
  657. package/dist/server/agent-chat/process-run-failure.d.ts +12 -0
  658. package/dist/server/agent-chat/process-run-failure.d.ts.map +1 -0
  659. package/dist/server/agent-chat/process-run-failure.js +24 -0
  660. package/dist/server/agent-chat/process-run-failure.js.map +1 -0
  661. package/dist/server/agent-chat/prompt-resources.d.ts +28 -0
  662. package/dist/server/agent-chat/prompt-resources.d.ts.map +1 -0
  663. package/dist/server/agent-chat/prompt-resources.js +514 -0
  664. package/dist/server/agent-chat/prompt-resources.js.map +1 -0
  665. package/dist/server/agent-chat/recurring-jobs-runtime.d.ts +5 -0
  666. package/dist/server/agent-chat/recurring-jobs-runtime.d.ts.map +1 -0
  667. package/dist/server/agent-chat/recurring-jobs-runtime.js +53 -0
  668. package/dist/server/agent-chat/recurring-jobs-runtime.js.map +1 -0
  669. package/dist/server/agent-chat/request-surface.d.ts +8 -0
  670. package/dist/server/agent-chat/request-surface.d.ts.map +1 -0
  671. package/dist/server/agent-chat/request-surface.js +56 -0
  672. package/dist/server/agent-chat/request-surface.js.map +1 -0
  673. package/dist/server/agent-chat/run-code-tools.d.ts +17 -0
  674. package/dist/server/agent-chat/run-code-tools.d.ts.map +1 -0
  675. package/dist/server/agent-chat/run-code-tools.js +55 -0
  676. package/dist/server/agent-chat/run-code-tools.js.map +1 -0
  677. package/dist/server/agent-chat/script-entries.d.ts +47 -0
  678. package/dist/server/agent-chat/script-entries.d.ts.map +1 -0
  679. package/dist/server/agent-chat/script-entries.js +633 -0
  680. package/dist/server/agent-chat/script-entries.js.map +1 -0
  681. package/dist/server/agent-chat/shared-thread.d.ts +33 -0
  682. package/dist/server/agent-chat/shared-thread.d.ts.map +1 -0
  683. package/dist/server/agent-chat/shared-thread.js +242 -0
  684. package/dist/server/agent-chat/shared-thread.js.map +1 -0
  685. package/dist/server/agent-chat/skill-frontmatter.d.ts +7 -0
  686. package/dist/server/agent-chat/skill-frontmatter.d.ts.map +1 -0
  687. package/dist/server/agent-chat/skill-frontmatter.js +26 -0
  688. package/dist/server/agent-chat/skill-frontmatter.js.map +1 -0
  689. package/dist/server/agent-chat-plugin.d.ts +45 -486
  690. package/dist/server/agent-chat-plugin.d.ts.map +1 -1
  691. package/dist/server/agent-chat-plugin.js +173 -3005
  692. package/dist/server/agent-chat-plugin.js.map +1 -1
  693. package/dist/server/agent-engine-api-key-route.d.ts +1 -1
  694. package/dist/server/agent-teams.d.ts +10 -0
  695. package/dist/server/agent-teams.d.ts.map +1 -1
  696. package/dist/server/agent-teams.js +13 -3
  697. package/dist/server/agent-teams.js.map +1 -1
  698. package/dist/server/auth.d.ts.map +1 -1
  699. package/dist/server/auth.js +50 -52
  700. package/dist/server/auth.js.map +1 -1
  701. package/dist/server/credential-provider.d.ts.map +1 -1
  702. package/dist/server/credential-provider.js +22 -21
  703. package/dist/server/credential-provider.js.map +1 -1
  704. package/dist/server/edge.d.ts +1 -0
  705. package/dist/server/edge.d.ts.map +1 -1
  706. package/dist/server/edge.js +1 -0
  707. package/dist/server/edge.js.map +1 -1
  708. package/dist/server/onboarding-html.d.ts.map +1 -1
  709. package/dist/server/onboarding-html.js +1 -16
  710. package/dist/server/onboarding-html.js.map +1 -1
  711. package/dist/server/realtime-voice.d.ts +3 -0
  712. package/dist/server/realtime-voice.d.ts.map +1 -1
  713. package/dist/server/realtime-voice.js +29 -5
  714. package/dist/server/realtime-voice.js.map +1 -1
  715. package/dist/server/request-origin.d.ts.map +1 -1
  716. package/dist/server/request-origin.js +6 -3
  717. package/dist/server/request-origin.js.map +1 -1
  718. package/dist/server/ssr-handler.d.ts.map +1 -1
  719. package/dist/server/ssr-handler.js +47 -2
  720. package/dist/server/ssr-handler.js.map +1 -1
  721. package/dist/sharing/access.d.ts +63 -3
  722. package/dist/sharing/access.d.ts.map +1 -1
  723. package/dist/sharing/access.js +53 -15
  724. package/dist/sharing/access.js.map +1 -1
  725. package/dist/sharing/registry.d.ts +7 -0
  726. package/dist/sharing/registry.d.ts.map +1 -1
  727. package/dist/sharing/registry.js.map +1 -1
  728. package/dist/styles/agent-native.css +15 -14
  729. package/dist/templates/default/.agents/skills/frontend-design/SKILL.md +1 -1
  730. package/dist/templates/default/app/i18n/ar-SA.ts +6 -0
  731. package/dist/templates/default/app/i18n/de-DE.ts +6 -0
  732. package/dist/templates/default/app/i18n/en-US.ts +6 -0
  733. package/dist/templates/default/app/i18n/es-ES.ts +6 -0
  734. package/dist/templates/default/app/i18n/fr-FR.ts +6 -0
  735. package/dist/templates/default/app/i18n/hi-IN.ts +6 -0
  736. package/dist/templates/default/app/i18n/ja-JP.ts +6 -0
  737. package/dist/templates/default/app/i18n/ko-KR.ts +6 -0
  738. package/dist/templates/default/app/i18n/pt-BR.ts +6 -0
  739. package/dist/templates/default/app/i18n/zh-CN.ts +6 -0
  740. package/dist/templates/default/app/i18n/zh-TW.ts +6 -0
  741. package/dist/templates/workspace-core/.agents/skills/authentication/SKILL.md +27 -29
  742. package/dist/templates/workspace-core/.agents/skills/external-agents/SKILL.md +2 -1
  743. package/dist/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +1 -1
  744. package/dist/templates/workspace-core/.agents/skills/observability/SKILL.md +32 -0
  745. package/dist/templates/workspace-core/.agents/skills/writing-agent-instructions/SKILL.md +25 -0
  746. package/dist/templates/workspace-core/src/server/index.ts +4 -2
  747. package/dist/testing.d.ts +16 -0
  748. package/dist/testing.d.ts.map +1 -0
  749. package/dist/testing.js +16 -0
  750. package/dist/testing.js.map +1 -0
  751. package/dist/triggers/dispatcher.d.ts +7 -0
  752. package/dist/triggers/dispatcher.d.ts.map +1 -1
  753. package/dist/triggers/dispatcher.js +13 -3
  754. package/dist/triggers/dispatcher.js.map +1 -1
  755. package/dist/vite/client.d.ts +16 -1
  756. package/dist/vite/client.d.ts.map +1 -1
  757. package/dist/vite/client.js +105 -2
  758. package/dist/vite/client.js.map +1 -1
  759. package/docs/content/authentication.mdx +3 -3
  760. package/docs/content/doctor.mdx +170 -0
  761. package/docs/content/external-agents.mdx +8 -7
  762. package/docs/content/locales/ar-SA/authentication.mdx +2 -2
  763. package/docs/content/locales/ar-SA/external-agents.mdx +8 -7
  764. package/docs/content/locales/ar-SA/mcp-protocol.mdx +1 -1
  765. package/docs/content/locales/ar-SA/security.mdx +2 -0
  766. package/docs/content/locales/de-DE/authentication.mdx +1 -1
  767. package/docs/content/locales/de-DE/external-agents.mdx +8 -7
  768. package/docs/content/locales/de-DE/mcp-protocol.mdx +1 -1
  769. package/docs/content/locales/de-DE/security.mdx +2 -0
  770. package/docs/content/locales/es-ES/authentication.mdx +2 -2
  771. package/docs/content/locales/es-ES/external-agents.mdx +8 -7
  772. package/docs/content/locales/es-ES/mcp-protocol.mdx +1 -1
  773. package/docs/content/locales/es-ES/security.mdx +2 -0
  774. package/docs/content/locales/fr-FR/authentication.mdx +1 -1
  775. package/docs/content/locales/fr-FR/external-agents.mdx +8 -7
  776. package/docs/content/locales/fr-FR/mcp-protocol.mdx +1 -1
  777. package/docs/content/locales/fr-FR/security.mdx +2 -0
  778. package/docs/content/locales/hi-IN/authentication.mdx +2 -2
  779. package/docs/content/locales/hi-IN/external-agents.mdx +8 -7
  780. package/docs/content/locales/hi-IN/mcp-protocol.mdx +1 -1
  781. package/docs/content/locales/hi-IN/security.mdx +2 -0
  782. package/docs/content/locales/ja-JP/authentication.mdx +2 -2
  783. package/docs/content/locales/ja-JP/external-agents.mdx +8 -7
  784. package/docs/content/locales/ja-JP/mcp-protocol.mdx +1 -1
  785. package/docs/content/locales/ja-JP/security.mdx +2 -0
  786. package/docs/content/locales/ko-KR/authentication.mdx +2 -2
  787. package/docs/content/locales/ko-KR/external-agents.mdx +8 -7
  788. package/docs/content/locales/ko-KR/mcp-protocol.mdx +1 -1
  789. package/docs/content/locales/ko-KR/security.mdx +2 -0
  790. package/docs/content/locales/pt-BR/authentication.mdx +2 -2
  791. package/docs/content/locales/pt-BR/external-agents.mdx +8 -7
  792. package/docs/content/locales/pt-BR/mcp-protocol.mdx +1 -1
  793. package/docs/content/locales/pt-BR/security.mdx +2 -0
  794. package/docs/content/locales/zh-CN/authentication.mdx +2 -2
  795. package/docs/content/locales/zh-CN/external-agents.mdx +8 -7
  796. package/docs/content/locales/zh-CN/mcp-protocol.mdx +1 -1
  797. package/docs/content/locales/zh-CN/security.mdx +2 -0
  798. package/docs/content/locales/zh-TW/authentication.mdx +2 -2
  799. package/docs/content/locales/zh-TW/external-agents.mdx +8 -7
  800. package/docs/content/locales/zh-TW/mcp-protocol.mdx +1 -1
  801. package/docs/content/locales/zh-TW/security.mdx +2 -0
  802. package/docs/content/mcp-protocol.mdx +1 -1
  803. package/docs/content/security.mdx +2 -0
  804. package/package.json +6 -2
  805. package/src/templates/default/.agents/skills/frontend-design/SKILL.md +1 -1
  806. package/src/templates/default/app/i18n/ar-SA.ts +6 -0
  807. package/src/templates/default/app/i18n/de-DE.ts +6 -0
  808. package/src/templates/default/app/i18n/en-US.ts +6 -0
  809. package/src/templates/default/app/i18n/es-ES.ts +6 -0
  810. package/src/templates/default/app/i18n/fr-FR.ts +6 -0
  811. package/src/templates/default/app/i18n/hi-IN.ts +6 -0
  812. package/src/templates/default/app/i18n/ja-JP.ts +6 -0
  813. package/src/templates/default/app/i18n/ko-KR.ts +6 -0
  814. package/src/templates/default/app/i18n/pt-BR.ts +6 -0
  815. package/src/templates/default/app/i18n/zh-CN.ts +6 -0
  816. package/src/templates/default/app/i18n/zh-TW.ts +6 -0
  817. package/src/templates/workspace-core/.agents/skills/authentication/SKILL.md +27 -29
  818. package/src/templates/workspace-core/.agents/skills/external-agents/SKILL.md +2 -1
  819. package/src/templates/workspace-core/.agents/skills/frontend-design/SKILL.md +1 -1
  820. package/src/templates/workspace-core/.agents/skills/observability/SKILL.md +32 -0
  821. package/src/templates/workspace-core/.agents/skills/writing-agent-instructions/SKILL.md +25 -0
  822. package/src/templates/workspace-core/src/server/index.ts +4 -2
  823. package/corpus/core/src/client/ProductionAgentPanel.tsx +0 -9
  824. package/corpus/core/src/client/auth-redirect-url.ts +0 -23
  825. package/corpus/core/src/client/useProductionAgent.ts +0 -253
  826. package/corpus/core/src/shared/auth-redirect-url.ts +0 -1
  827. package/corpus/templates/analytics/app/pages/Index.tsx +0 -16
  828. package/corpus/templates/analytics/seeds/dashboards/agent-observability-llm.json +0 -173
  829. package/dist/client/ProductionAgentPanel.d.ts +0 -6
  830. package/dist/client/ProductionAgentPanel.d.ts.map +0 -1
  831. package/dist/client/ProductionAgentPanel.js +0 -6
  832. package/dist/client/ProductionAgentPanel.js.map +0 -1
  833. package/dist/client/auth-redirect-url.d.ts +0 -2
  834. package/dist/client/auth-redirect-url.d.ts.map +0 -1
  835. package/dist/client/auth-redirect-url.js +0 -19
  836. package/dist/client/auth-redirect-url.js.map +0 -1
  837. package/dist/client/useProductionAgent.d.ts +0 -24
  838. package/dist/client/useProductionAgent.d.ts.map +0 -1
  839. package/dist/client/useProductionAgent.js +0 -179
  840. package/dist/client/useProductionAgent.js.map +0 -1
  841. package/dist/shared/auth-redirect-url.d.ts +0 -2
  842. package/dist/shared/auth-redirect-url.d.ts.map +0 -1
  843. package/dist/shared/auth-redirect-url.js +0 -2
  844. package/dist/shared/auth-redirect-url.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"doctor.d.ts","sourceRoot":"","sources":["../../src/cli/doctor.ts"],"names":[],"mappings":"AAoCA,MAAM,MAAM,SAAS,GACjB,iBAAiB,GACjB,yBAAyB,GACzB,qBAAqB,GACrB,oBAAoB,GACpB,iB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AAgB,eAAe,CAAC,EAAE,GAAE,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAa,GAAG,IAAI,CAwB3E;AAED;+DAC+D;AAC/D,wBAAsB,SAAS,CAC7B,IAAI,EAAE,MAAM,EAAE,EACd,EAAE,GAAE,QAAoB,GACvB,OAAO,CAAC,MAAM,CAAC,CAyDjB;AAED,MAAM,WAAW,sBAAsB;IACrC,GAAG,EAAE,MAAM,CAAC;IACZ,gEAAgE;IAChE,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,qBAAqB;IACpC;8DAC0D;IAC1D,EAAE,EAAE,OAAO,CAAC;IACZ,MAAM,EAAE,YAAY,CAAC;CACtB;AAED;;;;;;;;GAQG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,sBAAsB,EAC/B,EAAE,GAAE,QAAoB,GACvB,OAAO,CAAC,qBAAqB,CAAC,CAyBhC"}
@@ -181,7 +181,7 @@ export function printDoctorHelp(io = defaultIo) {
181
181
  io.log([
182
182
  "Usage:",
183
183
  " agent-native doctor Scan app source for security-critical guard violations",
184
- " agent-native doctor --json Machine-readable report: { ok, findings, guardsRun }",
184
+ " agent-native doctor --json Machine-readable report: { ok, findings, guardsRun, strict }",
185
185
  " agent-native doctor --only <guard,guard> Run only the named guard(s)",
186
186
  " agent-native doctor --strict Escalate findings to a hard failure when used by `agent-native build --strict`",
187
187
  " agent-native doctor --cwd <dir> Run against a project root other than the current directory",
@@ -234,8 +234,12 @@ export async function runDoctor(argv, io = defaultIo) {
234
234
  }
235
235
  const report = runDoctorScan({ root, only: opts.only });
236
236
  if (opts.json) {
237
- const sink = report.ok ? io.log : io.err;
238
- sink(JSON.stringify({ ...report, strict: Boolean(opts.strict) }, null, 2));
237
+ // The machine-readable report always goes to stdout (io.log), whether
238
+ // or not findings are present, so `agent-native doctor --json >
239
+ // report.json` in CI always captures the report. Only the usage/
240
+ // execution error payloads above (bad --cwd, unknown --only) go to
241
+ // stderr — those are diagnostics for exit code 2, not the report.
242
+ io.log(JSON.stringify({ ...report, strict: Boolean(opts.strict) }, null, 2));
239
243
  }
240
244
  else {
241
245
  io.log(formatDoctorHuman(report, root));
@@ -1 +1 @@
1
- {"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../src/cli/doctor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,qBAAqB,EACrB,uBAAuB,EACvB,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAY5B,MAAM,CAAC,MAAM,eAAe,GAAgB;IAC1C,iBAAiB;IACjB,yBAAyB;IACzB,qBAAqB;IACrB,oBAAoB;IACpB,iBAAiB;IACjB,iBAAiB;IACjB,uBAAuB;CACxB,CAAC;AAQF,MAAM,qBAAqB,GAAiB;IAC1C,cAAc,EAAE,EAAE;IAClB,qBAAqB,EAAE,EAAE;IACzB,WAAW,EAAE,KAAK;CACnB,CAAC;AAeF;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC3C,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC;IAC1D,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;QACjC,OAAO,EAAE,GAAG,qBAAqB,EAAE,qBAAqB,EAAE,EAAE,EAAE,CAAC;IACjE,CAAC;IACD,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,YAAY,EAAE,OAAO,CAAC,CAAC;QACnD,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,GAAG,CAAyC,CAAC;QACvE,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,IAAI,EAAE,CAAC;QACnC,MAAM,cAAc,GA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AM,GAAG,CAAC,EAAE,CAAC;QAC/B,EAAE,CAAC,GAAG,CACJ,cAAc,MAAM,CAAC,QAAQ,CAAC,MAAM,oLAAoL,CACzN,CAAC;QACF,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YAChC,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;QAC9D,CAAC;IACH,CAAC;IAED,MAAM,IAAI,GAAG,eAAe,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE;QACvD,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,WAAW,EAAE,MAAM,CAAC,WAAW;KAChC,CAAC,CAAC;IACH,IAAI,IAAI,EAAE,CAAC;QACT,EAAE,CAAC,GAAG,CACJ,6BAA6B,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,gDAAgD,GAAG,CAC1H,CAAC;IACJ,CAAC;IAED,OAAO,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC;AAC/B,CAAC","sourcesContent":["/**\n * `agent-native doctor` — scan an app's source tree for the security-\n * critical code-safety invariants this monorepo already enforces on\n * itself via `scripts/guard-*.mjs` (see\n * `advisor-plans/reports/005-doctor-design.md` for the full design and\n * `advisor-plans/015-doctor-v1-implementation.md` for the implementation\n * plan). v1 ships 7 of those guards, ported to work against a single\n * generated app root instead of this monorepo's multi-template layout —\n * see `../guards/index.ts`.\n *\n * This is a NEW top-level command, deliberately kept separate from the two\n * existing \"doctor\" precedents in this CLI:\n * - `agent-native upgrade check` (`upgrade.ts`) — dependency-pin health.\n * - `agent-native recap doctor` (`recap.ts`) — PR Visual Recap config health.\n * Each diagnoses a different domain; none are folded into a shared\n * mega-doctor (see report 005, \"Relationship to upgrade doctor and recap\n * doctor\").\n *\n * `--fix` is reserved, not implemented in v1 — it prints a message and\n * exits 2 rather than silently no-op, so a future implementation doesn't\n * collide with a script already passing the flag.\n */\nimport fs from \"node:fs\";\nimport path from \"node:path\";\n\nimport {\n scanDbToolScoping,\n scanDrizzlePush,\n scanEnvCredentials,\n scanEnvMutation,\n scanLocalhostFallback,\n scanUnscopedCredentials,\n scanUnscopedQueries,\n} from \"../guards/index.js\";\nimport type { GuardResult } from \"../guards/index.js\";\n\nexport type GuardName =\n | \"no-drizzle-push\"\n | \"no-unscoped-credentials\"\n | \"no-unscoped-queries\"\n | \"no-env-credentials\"\n | \"db-tool-scoping\"\n | \"no-env-mutation\"\n | \"no-localhost-fallback\";\n\nexport const ALL_GUARD_NAMES: GuardName[] = [\n \"no-drizzle-push\",\n \"no-unscoped-credentials\",\n \"no-unscoped-queries\",\n \"no-env-credentials\",\n \"db-tool-scoping\",\n \"no-env-mutation\",\n \"no-localhost-fallback\",\n];\n\nexport interface DoctorConfig {\n disabledGuards: string[];\n dbToolScopingDenylist: Record<string, string>;\n failOnBuild: boolean;\n}\n\nconst DEFAULT_DOCTOR_CONFIG: DoctorConfig = {\n disabledGuards: [],\n dbToolScopingDenylist: {},\n failOnBuild: false,\n};\n\nexport interface DoctorFinding {\n guard: string;\n file: string;\n line: number;\n message: string;\n}\n\nexport interface DoctorReport {\n ok: boolean;\n findings: DoctorFinding[];\n guardsRun: string[];\n}\n\n/**\n * Reads the optional `\"doctor\"` key from `<root>/agent-native.json`. All\n * fields are optional with sane empty defaults — an app needs zero config\n * to run `agent-native doctor` with every v1 guard enabled.\n */\nexport function readDoctorConfig(root: string): DoctorConfig {\n const manifestPath = path.join(root, \"agent-native.json\");\n if (!fs.existsSync(manifestPath)) {\n return { ...DEFAULT_DOCTOR_CONFIG, dbToolScopingDenylist: {} };\n }\n try {\n const raw = fs.readFileSync(manifestPath, \"utf-8\");\n const parsed = JSON.parse(raw) as { doctor?: Record<string, unknown> };\n const doctor = parsed.doctor ?? {};\n const disabledGuards = Array.isArray(doctor.disabledGuards)\n ? doctor.disabledGuards.filter((v): v is string => typeof v === \"string\")\n : [];\n const dbToolScopingDenylist =\n doctor.dbToolScopingDenylist &&\n typeof doctor.dbToolScopingDenylist === \"object\"\n ? (Object.fromEntries(\n Object.entries(\n doctor.dbToolScopingDenylist as Record<string, unknown>,\n ).filter(\n (entry): entry is [string, string] =>\n typeof entry[1] === \"string\",\n ),\n ) as Record<string, string>)\n : {};\n const failOnBuild = doctor.failOnBuild === true;\n return { disabledGuards, dbToolScopingDenylist, failOnBuild };\n } catch {\n return { ...DEFAULT_DOCTOR_CONFIG, dbToolScopingDenylist: {} };\n }\n}\n\nfunction runGuard(\n name: GuardName,\n root: string,\n config: DoctorConfig,\n): GuardResult {\n switch (name) {\n case \"no-drizzle-push\":\n return scanDrizzlePush({ root });\n case \"no-unscoped-credentials\":\n return scanUnscopedCredentials({ root });\n case \"no-unscoped-queries\":\n return scanUnscopedQueries({ root, extraExemptPaths: [] });\n case \"no-env-credentials\":\n return scanEnvCredentials({ root });\n case \"db-tool-scoping\":\n return scanDbToolScoping({\n root,\n denylist: config.dbToolScopingDenylist,\n });\n case \"no-env-mutation\":\n return scanEnvMutation({ root });\n case \"no-localhost-fallback\":\n return scanLocalhostFallback({ root, extraExemptPaths: [] });\n }\n}\n\nexport interface RunDoctorScanOptions {\n root: string;\n /** Restrict to these guard names. When omitted, runs every guard not\n * listed in `agent-native.json`'s `doctor.disabledGuards`. Unknown names\n * are silently ignored here — the CLI layer (`runDoctor`) validates\n * `--only` and reports a usage error before calling this. */\n only?: string[];\n}\n\n/** Pure scan orchestrator: runs the selected guards against `root` and\n * returns a flat report. No I/O beyond reading `agent-native.json` and the\n * app source tree — no printing, no process.exit. */\nexport function runDoctorScan(options: RunDoctorScanOptions): DoctorReport {\n const root = options.root;\n const config = readDoctorConfig(root);\n\n let names: GuardName[];\n if (options.only && options.only.length > 0) {\n const knownOnly = options.only.filter((n): n is GuardName =>\n (ALL_GUARD_NAMES as string[]).includes(n),\n );\n names = knownOnly;\n } else {\n names = ALL_GUARD_NAMES.filter((n) => !config.disabledGuards.includes(n));\n }\n\n const findings: DoctorFinding[] = [];\n for (const name of names) {\n const result = runGuard(name, root, config);\n for (const f of result.findings) {\n findings.push({\n guard: name,\n file: f.file,\n line: f.line,\n message: f.message,\n });\n }\n }\n\n return { ok: findings.length === 0, findings, guardsRun: names };\n}\n\n/** Pure escalation rule shared by the CLI (`--strict`) and the `build`\n * pre-step (`--strict` / `agent-native.json` `doctor.failOnBuild`). Doctor\n * findings never fail anything on their own — only `strict` or\n * `failOnBuild` turn findings into a hard failure. */\nexport function shouldFailBuild(\n hasFindings: boolean,\n opts: { strict?: boolean; failOnBuild?: boolean },\n): boolean {\n return hasFindings && Boolean(opts.strict || opts.failOnBuild);\n}\n\nexport interface DoctorIo {\n log: (message: string) => void;\n err: (message: string) => void;\n}\n\nconst defaultIo: DoctorIo = {\n log: (message) => console.log(message),\n err: (message) => console.error(message),\n};\n\nfunction formatDoctorHuman(report: DoctorReport, root: string): string {\n const lines: string[] = [];\n lines.push(`agent-native doctor: ${root}`);\n lines.push(`Guards run: ${report.guardsRun.join(\", \") || \"(none)\"}`);\n if (report.findings.length === 0) {\n lines.push(\"Clean — no findings.\");\n } else {\n lines.push(`${report.findings.length} finding(s):`);\n for (const f of report.findings) {\n lines.push(` [${f.guard}] ${f.file}:${f.line} — ${f.message}`);\n }\n }\n return lines.join(\"\\n\");\n}\n\nexport interface DoctorCliOptions {\n json?: boolean;\n cwd?: string;\n only?: string[];\n strict?: boolean;\n help?: boolean;\n fix?: boolean;\n}\n\nexport function parseDoctorArgs(argv: string[]): DoctorCliOptions {\n const opts: DoctorCliOptions = {};\n for (let i = 0; i < argv.length; i++) {\n const arg = argv[i];\n if (arg === \"--help\" || arg === \"-h\") {\n opts.help = true;\n } else if (arg === \"--json\") {\n opts.json = true;\n } else if (arg === \"--strict\") {\n opts.strict = true;\n } else if (arg === \"--fix\") {\n opts.fix = true;\n } else if (arg === \"--cwd\" && argv[i + 1] !== undefined) {\n opts.cwd = argv[++i];\n } else if (arg.startsWith(\"--cwd=\")) {\n opts.cwd = arg.slice(\"--cwd=\".length);\n } else if (arg === \"--only\" && argv[i + 1] !== undefined) {\n opts.only = splitGuardList(argv[++i]);\n } else if (arg.startsWith(\"--only=\")) {\n opts.only = splitGuardList(arg.slice(\"--only=\".length));\n }\n }\n return opts;\n}\n\nfunction splitGuardList(value: string): string[] {\n return value\n .split(\",\")\n .map((s) => s.trim())\n .filter((s) => s.length > 0);\n}\n\nexport function printDoctorHelp(io: Pick<DoctorIo, \"log\"> = defaultIo): void {\n io.log(\n [\n \"Usage:\",\n \" agent-native doctor Scan app source for security-critical guard violations\",\n \" agent-native doctor --json Machine-readable report: { ok, findings, guardsRun }\",\n \" agent-native doctor --only <guard,guard> Run only the named guard(s)\",\n \" agent-native doctor --strict Escalate findings to a hard failure when used by `agent-native build --strict`\",\n \" agent-native doctor --cwd <dir> Run against a project root other than the current directory\",\n \" agent-native doctor --fix Not implemented in this version\",\n \" agent-native doctor --help Show this help\",\n \"\",\n `Guards: ${ALL_GUARD_NAMES.join(\", \")}`,\n \"\",\n \"Exit codes: 0 clean, 1 findings present, 2 usage/execution error.\",\n \"\",\n \"`agent-native build` runs doctor as a warn-only pre-step by default — it\",\n \"never fails the build unless `agent-native build --strict` is passed or\",\n 'agent-native.json sets { \"doctor\": { \"failOnBuild\": true } }.',\n \"\",\n \"For dependency-pin health (framework overrides/patches, stale\",\n \"@agent-native/* pins), run `agent-native upgrade check` instead.\",\n ].join(\"\\n\"),\n );\n}\n\n/** `agent-native doctor` CLI entrypoint. Returns the process exit code —\n * callers are responsible for calling `process.exit(code)`. */\nexport async function runDoctor(\n argv: string[],\n io: DoctorIo = defaultIo,\n): Promise<number> {\n const opts = parseDoctorArgs(argv);\n\n if (opts.help) {\n printDoctorHelp(io);\n return 0;\n }\n\n if (opts.fix) {\n io.err(\n \"agent-native doctor --fix is not implemented in this version. Fix findings manually and re-run `agent-native doctor`.\",\n );\n return 2;\n }\n\n const root = path.resolve(opts.cwd ?? process.cwd());\n if (!fs.existsSync(root) || !fs.statSync(root).isDirectory()) {\n const message = `--cwd path does not exist or is not a directory: ${root}`;\n if (opts.json) io.err(JSON.stringify({ ok: false, message }, null, 2));\n else io.err(message);\n return 2;\n }\n\n if (opts.only) {\n const unknown = opts.only.filter(\n (n) => !(ALL_GUARD_NAMES as string[]).includes(n),\n );\n if (unknown.length > 0) {\n const message = `Unknown guard name(s) in --only: ${unknown.join(\", \")}. Known guards: ${ALL_GUARD_NAMES.join(\", \")}`;\n if (opts.json) io.err(JSON.stringify({ ok: false, message }, null, 2));\n else io.err(message);\n return 2;\n }\n }\n\n const report = runDoctorScan({ root, only: opts.only });\n\n if (opts.json) {\n const sink = report.ok ? io.log : io.err;\n sink(JSON.stringify({ ...report, strict: Boolean(opts.strict) }, null, 2));\n } else {\n io.log(formatDoctorHuman(report, root));\n if (!report.ok) {\n io.err(\"\");\n io.err(\n \"agent-native doctor found issues above. Fix them, or add a `// guard:allow-<check> — reason` opt-out with reviewer approval.\",\n );\n }\n }\n\n return report.ok ? 0 : 1;\n}\n\nexport interface DoctorBuildHookOptions {\n cwd: string;\n /** Set when the caller passed `agent-native build --strict`. */\n strict?: boolean;\n}\n\nexport interface DoctorBuildHookResult {\n /** False only when findings are present AND (`strict` was requested OR\n * `agent-native.json`'s `doctor.failOnBuild` is true). */\n ok: boolean;\n report: DoctorReport;\n}\n\n/**\n * `agent-native build`'s doctor pre-step. Always runs every enabled guard\n * and always prints findings (as warnings) to `io.err` — never silent.\n * Never causes the build to fail unless `strict` was passed or\n * `agent-native.json` sets `doctor.failOnBuild: true` (see report 005,\n * \"Where it runs\" — the v1 doctor has zero field mileage against arbitrary\n * app layouts, so shipping fail-by-default would risk breaking a first\n * deploy on a false positive).\n */\nexport async function runDoctorBuildHook(\n options: DoctorBuildHookOptions,\n io: DoctorIo = defaultIo,\n): Promise<DoctorBuildHookResult> {\n const root = path.resolve(options.cwd);\n const config = readDoctorConfig(root);\n const report = runDoctorScan({ root });\n\n if (report.findings.length > 0) {\n io.err(\n `\\n[doctor] ${report.findings.length} finding(s) from \\`agent-native doctor\\` — run it directly for details. This does not fail the build unless --strict was passed or agent-native.json's doctor.failOnBuild is true.`,\n );\n for (const f of report.findings) {\n io.err(` [${f.guard}] ${f.file}:${f.line} — ${f.message}`);\n }\n }\n\n const fail = shouldFailBuild(report.findings.length > 0, {\n strict: options.strict,\n failOnBuild: config.failOnBuild,\n });\n if (fail) {\n io.err(\n `\\n[doctor] Failing build: ${options.strict ? \"--strict was passed\" : \"agent-native.json's doctor.failOnBuild is true\"}.`,\n );\n }\n\n return { ok: !fail, report };\n}\n"]}
1
+ {"version":3,"file":"doctor.js","sourceRoot":"","sources":["../../src/cli/doctor.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,OAAO,EAAE,MAAM,SAAS,CAAC;AACzB,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EACL,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,eAAe,EACf,qBAAqB,EACrB,uBAAuB,EACvB,mBAAmB,GACpB,MAAM,oBAAoB,CAAC;AAY5B,MAAM,CAAC,MAAM,eAAe,GAAgB;IAC1C,iBAAiB;IACjB,yBAAyB;IACzB,qBAAqB;IACrB,oBAAoB;IACpB,iBAAiB;IACjB,iBAAiB;IACjB,uBAAuB;CACxB,CAAC;AAQF,MAAM,qBAAqB,GAAiB;IAC1C,cAAc,EAAE,EAAE;IAClB,qBAAqB,EAAE,EAAE;IACzB,WAAW,EAAE,KAAK;CACnB,CAAC;AAeF;;;;GAIG;AACH,MAAM,UAAU,gBAAgB,CAAC,IAAY;IAC3C,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,mBAAmB,CAAC,CAAC;IAC1D,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CA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AU,kBAAkB,CACtC,OAA+B,EAC/B,EAAE,GAAa,SAAS;IAExB,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC;IACvC,MAAM,MAAM,GAAG,gBAAgB,CAAC,IAAI,CAAC,CAAC;IACtC,MAAM,MAAM,GAAG,aAAa,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;IAEvC,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC/B,EAAE,CAAC,GAAG,CACJ,cAAc,MAAM,CAAC,QAAQ,CAAC,MAAM,oLAAoL,CACzN,CAAC;QACF,KAAK,MAAM,CAAC,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YAChC,EAAE,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,MAAM,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;QAC9D,CAAC;IACH,CAAC;IAED,MAAM,IAAI,GAAG,eAAe,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE;QACvD,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,WAAW,EAAE,MAAM,CAAC,WAAW;KAChC,CAAC,CAAC;IACH,IAAI,IAAI,EAAE,CAAC;QACT,EAAE,CAAC,GAAG,CACJ,6BAA6B,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,gDAAgD,GAAG,CAC1H,CAAC;IACJ,CAAC;IAED,OAAO,EAAE,EAAE,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,CAAC;AAC/B,CAAC","sourcesContent":["/**\n * `agent-native doctor` — scan an app's source tree for the security-\n * critical code-safety invariants this monorepo already enforces on\n * itself via `scripts/guard-*.mjs` (see\n * `advisor-plans/reports/005-doctor-design.md` for the full design and\n * `advisor-plans/015-doctor-v1-implementation.md` for the implementation\n * plan). v1 ships 7 of those guards, ported to work against a single\n * generated app root instead of this monorepo's multi-template layout —\n * see `../guards/index.ts`.\n *\n * This is a NEW top-level command, deliberately kept separate from the two\n * existing \"doctor\" precedents in this CLI:\n * - `agent-native upgrade check` (`upgrade.ts`) — dependency-pin health.\n * - `agent-native recap doctor` (`recap.ts`) — PR Visual Recap config health.\n * Each diagnoses a different domain; none are folded into a shared\n * mega-doctor (see report 005, \"Relationship to upgrade doctor and recap\n * doctor\").\n *\n * `--fix` is reserved, not implemented in v1 — it prints a message and\n * exits 2 rather than silently no-op, so a future implementation doesn't\n * collide with a script already passing the flag.\n */\nimport fs from \"node:fs\";\nimport path from \"node:path\";\n\nimport {\n scanDbToolScoping,\n scanDrizzlePush,\n scanEnvCredentials,\n scanEnvMutation,\n scanLocalhostFallback,\n scanUnscopedCredentials,\n scanUnscopedQueries,\n} from \"../guards/index.js\";\nimport type { GuardResult } from \"../guards/index.js\";\n\nexport type GuardName =\n | \"no-drizzle-push\"\n | \"no-unscoped-credentials\"\n | \"no-unscoped-queries\"\n | \"no-env-credentials\"\n | \"db-tool-scoping\"\n | \"no-env-mutation\"\n | \"no-localhost-fallback\";\n\nexport const ALL_GUARD_NAMES: GuardName[] = [\n \"no-drizzle-push\",\n \"no-unscoped-credentials\",\n \"no-unscoped-queries\",\n \"no-env-credentials\",\n \"db-tool-scoping\",\n \"no-env-mutation\",\n \"no-localhost-fallback\",\n];\n\nexport interface DoctorConfig {\n disabledGuards: string[];\n dbToolScopingDenylist: Record<string, string>;\n failOnBuild: boolean;\n}\n\nconst DEFAULT_DOCTOR_CONFIG: DoctorConfig = {\n disabledGuards: [],\n dbToolScopingDenylist: {},\n failOnBuild: false,\n};\n\nexport interface DoctorFinding {\n guard: string;\n file: string;\n line: number;\n message: string;\n}\n\nexport interface DoctorReport {\n ok: boolean;\n findings: DoctorFinding[];\n guardsRun: string[];\n}\n\n/**\n * Reads the optional `\"doctor\"` key from `<root>/agent-native.json`. All\n * fields are optional with sane empty defaults — an app needs zero config\n * to run `agent-native doctor` with every v1 guard enabled.\n */\nexport function readDoctorConfig(root: string): DoctorConfig {\n const manifestPath = path.join(root, \"agent-native.json\");\n if (!fs.existsSync(manifestPath)) {\n return { ...DEFAULT_DOCTOR_CONFIG, dbToolScopingDenylist: {} };\n }\n try {\n const raw = fs.readFileSync(manifestPath, \"utf-8\");\n const parsed = JSON.parse(raw) as { doctor?: Record<string, unknown> };\n const doctor = parsed.doctor ?? {};\n const disabledGuards = Array.isArray(doctor.disabledGuards)\n ? doctor.disabledGuards.filter((v): v is string => typeof v === \"string\")\n : [];\n const dbToolScopingDenylist =\n doctor.dbToolScopingDenylist &&\n typeof doctor.dbToolScopingDenylist === \"object\"\n ? (Object.fromEntries(\n Object.entries(\n doctor.dbToolScopingDenylist as Record<string, unknown>,\n ).filter(\n (entry): entry is [string, string] =>\n typeof entry[1] === \"string\",\n ),\n ) as Record<string, string>)\n : {};\n const failOnBuild = doctor.failOnBuild === true;\n return { disabledGuards, dbToolScopingDenylist, failOnBuild };\n } catch {\n return { ...DEFAULT_DOCTOR_CONFIG, dbToolScopingDenylist: {} };\n }\n}\n\nfunction runGuard(\n name: GuardName,\n root: string,\n config: DoctorConfig,\n): GuardResult {\n switch (name) {\n case \"no-drizzle-push\":\n return scanDrizzlePush({ root });\n case \"no-unscoped-credentials\":\n return scanUnscopedCredentials({ root });\n case \"no-unscoped-queries\":\n return scanUnscopedQueries({ root, extraExemptPaths: [] });\n case \"no-env-credentials\":\n return scanEnvCredentials({ root });\n case \"db-tool-scoping\":\n return scanDbToolScoping({\n root,\n denylist: config.dbToolScopingDenylist,\n });\n case \"no-env-mutation\":\n return scanEnvMutation({ root });\n case \"no-localhost-fallback\":\n return scanLocalhostFallback({ root, extraExemptPaths: [] });\n }\n}\n\nexport interface RunDoctorScanOptions {\n root: string;\n /** Restrict to these guard names. When omitted, runs every guard not\n * listed in `agent-native.json`'s `doctor.disabledGuards`. Unknown names\n * are silently ignored here — the CLI layer (`runDoctor`) validates\n * `--only` and reports a usage error before calling this. */\n only?: string[];\n}\n\n/** Pure scan orchestrator: runs the selected guards against `root` and\n * returns a flat report. No I/O beyond reading `agent-native.json` and the\n * app source tree — no printing, no process.exit. */\nexport function runDoctorScan(options: RunDoctorScanOptions): DoctorReport {\n const root = options.root;\n const config = readDoctorConfig(root);\n\n let names: GuardName[];\n if (options.only && options.only.length > 0) {\n const knownOnly = options.only.filter((n): n is GuardName =>\n (ALL_GUARD_NAMES as string[]).includes(n),\n );\n names = knownOnly;\n } else {\n names = ALL_GUARD_NAMES.filter((n) => !config.disabledGuards.includes(n));\n }\n\n const findings: DoctorFinding[] = [];\n for (const name of names) {\n const result = runGuard(name, root, config);\n for (const f of result.findings) {\n findings.push({\n guard: name,\n file: f.file,\n line: f.line,\n message: f.message,\n });\n }\n }\n\n return { ok: findings.length === 0, findings, guardsRun: names };\n}\n\n/** Pure escalation rule shared by the CLI (`--strict`) and the `build`\n * pre-step (`--strict` / `agent-native.json` `doctor.failOnBuild`). Doctor\n * findings never fail anything on their own — only `strict` or\n * `failOnBuild` turn findings into a hard failure. */\nexport function shouldFailBuild(\n hasFindings: boolean,\n opts: { strict?: boolean; failOnBuild?: boolean },\n): boolean {\n return hasFindings && Boolean(opts.strict || opts.failOnBuild);\n}\n\nexport interface DoctorIo {\n log: (message: string) => void;\n err: (message: string) => void;\n}\n\nconst defaultIo: DoctorIo = {\n log: (message) => console.log(message),\n err: (message) => console.error(message),\n};\n\nfunction formatDoctorHuman(report: DoctorReport, root: string): string {\n const lines: string[] = [];\n lines.push(`agent-native doctor: ${root}`);\n lines.push(`Guards run: ${report.guardsRun.join(\", \") || \"(none)\"}`);\n if (report.findings.length === 0) {\n lines.push(\"Clean — no findings.\");\n } else {\n lines.push(`${report.findings.length} finding(s):`);\n for (const f of report.findings) {\n lines.push(` [${f.guard}] ${f.file}:${f.line} — ${f.message}`);\n }\n }\n return lines.join(\"\\n\");\n}\n\nexport interface DoctorCliOptions {\n json?: boolean;\n cwd?: string;\n only?: string[];\n strict?: boolean;\n help?: boolean;\n fix?: boolean;\n}\n\nexport function parseDoctorArgs(argv: string[]): DoctorCliOptions {\n const opts: DoctorCliOptions = {};\n for (let i = 0; i < argv.length; i++) {\n const arg = argv[i];\n if (arg === \"--help\" || arg === \"-h\") {\n opts.help = true;\n } else if (arg === \"--json\") {\n opts.json = true;\n } else if (arg === \"--strict\") {\n opts.strict = true;\n } else if (arg === \"--fix\") {\n opts.fix = true;\n } else if (arg === \"--cwd\" && argv[i + 1] !== undefined) {\n opts.cwd = argv[++i];\n } else if (arg.startsWith(\"--cwd=\")) {\n opts.cwd = arg.slice(\"--cwd=\".length);\n } else if (arg === \"--only\" && argv[i + 1] !== undefined) {\n opts.only = splitGuardList(argv[++i]);\n } else if (arg.startsWith(\"--only=\")) {\n opts.only = splitGuardList(arg.slice(\"--only=\".length));\n }\n }\n return opts;\n}\n\nfunction splitGuardList(value: string): string[] {\n return value\n .split(\",\")\n .map((s) => s.trim())\n .filter((s) => s.length > 0);\n}\n\nexport function printDoctorHelp(io: Pick<DoctorIo, \"log\"> = defaultIo): void {\n io.log(\n [\n \"Usage:\",\n \" agent-native doctor Scan app source for security-critical guard violations\",\n \" agent-native doctor --json Machine-readable report: { ok, findings, guardsRun, strict }\",\n \" agent-native doctor --only <guard,guard> Run only the named guard(s)\",\n \" agent-native doctor --strict Escalate findings to a hard failure when used by `agent-native build --strict`\",\n \" agent-native doctor --cwd <dir> Run against a project root other than the current directory\",\n \" agent-native doctor --fix Not implemented in this version\",\n \" agent-native doctor --help Show this help\",\n \"\",\n `Guards: ${ALL_GUARD_NAMES.join(\", \")}`,\n \"\",\n \"Exit codes: 0 clean, 1 findings present, 2 usage/execution error.\",\n \"\",\n \"`agent-native build` runs doctor as a warn-only pre-step by default — it\",\n \"never fails the build unless `agent-native build --strict` is passed or\",\n 'agent-native.json sets { \"doctor\": { \"failOnBuild\": true } }.',\n \"\",\n \"For dependency-pin health (framework overrides/patches, stale\",\n \"@agent-native/* pins), run `agent-native upgrade check` instead.\",\n ].join(\"\\n\"),\n );\n}\n\n/** `agent-native doctor` CLI entrypoint. Returns the process exit code —\n * callers are responsible for calling `process.exit(code)`. */\nexport async function runDoctor(\n argv: string[],\n io: DoctorIo = defaultIo,\n): Promise<number> {\n const opts = parseDoctorArgs(argv);\n\n if (opts.help) {\n printDoctorHelp(io);\n return 0;\n }\n\n if (opts.fix) {\n io.err(\n \"agent-native doctor --fix is not implemented in this version. Fix findings manually and re-run `agent-native doctor`.\",\n );\n return 2;\n }\n\n const root = path.resolve(opts.cwd ?? process.cwd());\n if (!fs.existsSync(root) || !fs.statSync(root).isDirectory()) {\n const message = `--cwd path does not exist or is not a directory: ${root}`;\n if (opts.json) io.err(JSON.stringify({ ok: false, message }, null, 2));\n else io.err(message);\n return 2;\n }\n\n if (opts.only) {\n const unknown = opts.only.filter(\n (n) => !(ALL_GUARD_NAMES as string[]).includes(n),\n );\n if (unknown.length > 0) {\n const message = `Unknown guard name(s) in --only: ${unknown.join(\", \")}. Known guards: ${ALL_GUARD_NAMES.join(\", \")}`;\n if (opts.json) io.err(JSON.stringify({ ok: false, message }, null, 2));\n else io.err(message);\n return 2;\n }\n }\n\n const report = runDoctorScan({ root, only: opts.only });\n\n if (opts.json) {\n // The machine-readable report always goes to stdout (io.log), whether\n // or not findings are present, so `agent-native doctor --json >\n // report.json` in CI always captures the report. Only the usage/\n // execution error payloads above (bad --cwd, unknown --only) go to\n // stderr — those are diagnostics for exit code 2, not the report.\n io.log(\n JSON.stringify({ ...report, strict: Boolean(opts.strict) }, null, 2),\n );\n } else {\n io.log(formatDoctorHuman(report, root));\n if (!report.ok) {\n io.err(\"\");\n io.err(\n \"agent-native doctor found issues above. Fix them, or add a `// guard:allow-<check> — reason` opt-out with reviewer approval.\",\n );\n }\n }\n\n return report.ok ? 0 : 1;\n}\n\nexport interface DoctorBuildHookOptions {\n cwd: string;\n /** Set when the caller passed `agent-native build --strict`. */\n strict?: boolean;\n}\n\nexport interface DoctorBuildHookResult {\n /** False only when findings are present AND (`strict` was requested OR\n * `agent-native.json`'s `doctor.failOnBuild` is true). */\n ok: boolean;\n report: DoctorReport;\n}\n\n/**\n * `agent-native build`'s doctor pre-step. Always runs every enabled guard\n * and always prints findings (as warnings) to `io.err` — never silent.\n * Never causes the build to fail unless `strict` was passed or\n * `agent-native.json` sets `doctor.failOnBuild: true` (see report 005,\n * \"Where it runs\" — the v1 doctor has zero field mileage against arbitrary\n * app layouts, so shipping fail-by-default would risk breaking a first\n * deploy on a false positive).\n */\nexport async function runDoctorBuildHook(\n options: DoctorBuildHookOptions,\n io: DoctorIo = defaultIo,\n): Promise<DoctorBuildHookResult> {\n const root = path.resolve(options.cwd);\n const config = readDoctorConfig(root);\n const report = runDoctorScan({ root });\n\n if (report.findings.length > 0) {\n io.err(\n `\\n[doctor] ${report.findings.length} finding(s) from \\`agent-native doctor\\` — run it directly for details. This does not fail the build unless --strict was passed or agent-native.json's doctor.failOnBuild is true.`,\n );\n for (const f of report.findings) {\n io.err(` [${f.guard}] ${f.file}:${f.line} — ${f.message}`);\n }\n }\n\n const fail = shouldFailBuild(report.findings.length > 0, {\n strict: options.strict,\n failOnBuild: config.failOnBuild,\n });\n if (fail) {\n io.err(\n `\\n[doctor] Failing build: ${options.strict ? \"--strict was passed\" : \"agent-native.json's doctor.failOnBuild is true\"}.`,\n );\n }\n\n return { ok: !fail, report };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"plan-local.d.ts","sourceRoot":"","sources":["../../src/cli/plan-local.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,OAAa,EAEX,KAAK,MAAM,EAEZ,MAAM,WAAW,CAAC;AAYnB,KAAK,aAAa,GAAG,MAAM,GAAG,OAAO,CAAC;AAEtC,KAAK,cAAc,GAAG;IACpB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,E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CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC;IACzB,OAAO,CAAC,EAAE,OAAO,KAAK,CAAC;CACxB,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAoGjC;AAgHD,wBAAgB,6BAA6B,CAC3C,UAAU,EAAE,MAAM,GACjB,yBAAyB,CA0B3B;AAED,wBAAsB,yBAAyB,CAC7C,KAAK,EAAE,wBAAwB,GAC9B,OAAO,CAAC;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,CAAC,CAyEjD;AAuQD,wBAAsB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAuE3D"}
@@ -1701,6 +1701,7 @@ function localPlanBridgeWarnings(input) {
1701
1701
  const appUrl = new URL(input.appUrl);
1702
1702
  const bridgeUrl = new URL(input.bridgeUrl);
1703
1703
  if (appUrl.protocol === "https:" && bridgeUrl.protocol === "http:") {
1704
+ warnings.push(`Chrome/Edge will ask for Local Network access so ${appUrl.hostname} can read this loopback bridge. Allow it; if you denied it, re-enable Local Network access in the ${appUrl.hostname} site settings, then retry.`);
1704
1705
  warnings.push("Safari may block the hosted HTTPS Plan UI from reading the HTTP localhost bridge. Use Chrome/Chromium/Edge, or pass --app-url http://localhost:8096 when running a local Plan app.");
1705
1706
  }
1706
1707
  }
@@ -2138,6 +2139,7 @@ async function runServe(args) {
2138
2139
  appUrl: bridge.result.appUrl,
2139
2140
  bridgeUrl: bridge.result.bridgeUrl,
2140
2141
  }),
2142
+ "Keep this bridge command running while the Plan page is open; stopping it makes this URL unreachable.",
2141
2143
  "Press Ctrl+C to stop.",
2142
2144
  ]
2143
2145
  .filter(Boolean)
@@ -2266,8 +2268,12 @@ Common flow:
2266
2268
  against that local-only source. The hosted app fetches the MDX from localhost in
2267
2269
  the browser; it does not write plan content to the hosted database. The served
2268
2270
  URL is written to \`.plan-url\` by default; pass \`--url-file\` to choose a
2269
- different local-only file. On macOS, \`--open\` prefers Chromium browsers because
2270
- Safari may block the hosted HTTPS page from reading the HTTP localhost bridge.
2271
+ different local-only file. On macOS, \`--open\` prefers Chromium browsers.
2272
+ Chrome/Edge will ask for Local Network access to read the loopback bridge; if
2273
+ you deny it, re-enable Local Network access in the plan.agent-native.com site
2274
+ settings and retry. Keep the bridge command running while the page is open.
2275
+ Safari may block the hosted HTTPS page from reading the HTTP localhost bridge;
2276
+ use a Chromium browser or a local Plan app via \`--app-url http://localhost:8096\`.
2271
2277
  Use \`plan local verify\` for headless bridge/CORS diagnostics that exit cleanly.
2272
2278
  Use \`plan local preview\` for a local Plan dev server route. \`preview --out\` is
2273
2279
  a legacy/debug escape hatch that writes a standalone static HTML file.