@agent-native/core 0.109.4 → 0.110.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1526) hide show
  1. package/corpus/README.md +1 -1
  2. package/corpus/core/CHANGELOG.md +17 -0
  3. package/corpus/core/docs/content/actions.mdx +2 -4
  4. package/corpus/core/docs/content/agent-surfaces.mdx +2 -4
  5. package/corpus/core/docs/content/audit-log.mdx +1 -2
  6. package/corpus/core/docs/content/authentication.mdx +3 -2
  7. package/corpus/core/docs/content/client.mdx +19 -18
  8. package/corpus/core/docs/content/components.mdx +1 -1
  9. package/corpus/core/docs/content/context-awareness.mdx +4 -7
  10. package/corpus/core/docs/content/creating-templates.mdx +7 -5
  11. package/corpus/core/docs/content/doctor.mdx +27 -6
  12. package/corpus/core/docs/content/drop-in-agent.mdx +6 -11
  13. package/corpus/core/docs/content/embedding-sdk.mdx +8 -10
  14. package/corpus/core/docs/content/getting-started.mdx +4 -2
  15. package/corpus/core/docs/content/internationalization.mdx +9 -6
  16. package/corpus/core/docs/content/key-concepts.mdx +2 -4
  17. package/corpus/core/docs/content/locales/ar-SA/actions.mdx +2 -4
  18. package/corpus/core/docs/content/locales/ar-SA/agent-surfaces.mdx +2 -4
  19. package/corpus/core/docs/content/locales/ar-SA/audit-log.mdx +1 -2
  20. package/corpus/core/docs/content/locales/ar-SA/authentication.mdx +3 -2
  21. package/corpus/core/docs/content/locales/ar-SA/client.mdx +19 -18
  22. package/corpus/core/docs/content/locales/ar-SA/components.mdx +1 -1
  23. package/corpus/core/docs/content/locales/ar-SA/context-awareness.mdx +4 -7
  24. package/corpus/core/docs/content/locales/ar-SA/creating-templates.mdx +7 -5
  25. package/corpus/core/docs/content/locales/ar-SA/doctor.mdx +10 -0
  26. package/corpus/core/docs/content/locales/ar-SA/drop-in-agent.mdx +6 -11
  27. package/corpus/core/docs/content/locales/ar-SA/embedding-sdk.mdx +8 -10
  28. package/corpus/core/docs/content/locales/ar-SA/internationalization.mdx +9 -6
  29. package/corpus/core/docs/content/locales/ar-SA/key-concepts.mdx +2 -4
  30. package/corpus/core/docs/content/locales/ar-SA/observability.mdx +1 -2
  31. package/corpus/core/docs/content/locales/ar-SA/package-lifecycle.mdx +6 -0
  32. package/corpus/core/docs/content/locales/ar-SA/real-time-collaboration.mdx +4 -7
  33. package/corpus/core/docs/content/locales/ar-SA/sharing.mdx +1 -2
  34. package/corpus/core/docs/content/locales/ar-SA/template-chat.mdx +1 -2
  35. package/corpus/core/docs/content/locales/ar-SA/tracking.mdx +2 -4
  36. package/corpus/core/docs/content/locales/ar-SA/what-is-agent-native.mdx +1 -2
  37. package/corpus/core/docs/content/locales/de-DE/actions.mdx +2 -4
  38. package/corpus/core/docs/content/locales/de-DE/agent-surfaces.mdx +2 -4
  39. package/corpus/core/docs/content/locales/de-DE/audit-log.mdx +1 -2
  40. package/corpus/core/docs/content/locales/de-DE/authentication.mdx +3 -2
  41. package/corpus/core/docs/content/locales/de-DE/client.mdx +19 -18
  42. package/corpus/core/docs/content/locales/de-DE/components.mdx +1 -1
  43. package/corpus/core/docs/content/locales/de-DE/context-awareness.mdx +4 -7
  44. package/corpus/core/docs/content/locales/de-DE/creating-templates.mdx +7 -5
  45. package/corpus/core/docs/content/locales/de-DE/doctor.mdx +10 -0
  46. package/corpus/core/docs/content/locales/de-DE/drop-in-agent.mdx +6 -11
  47. package/corpus/core/docs/content/locales/de-DE/embedding-sdk.mdx +8 -10
  48. package/corpus/core/docs/content/locales/de-DE/internationalization.mdx +9 -6
  49. package/corpus/core/docs/content/locales/de-DE/key-concepts.mdx +2 -4
  50. package/corpus/core/docs/content/locales/de-DE/observability.mdx +1 -2
  51. package/corpus/core/docs/content/locales/de-DE/package-lifecycle.mdx +6 -0
  52. package/corpus/core/docs/content/locales/de-DE/real-time-collaboration.mdx +4 -7
  53. package/corpus/core/docs/content/locales/de-DE/sharing.mdx +1 -2
  54. package/corpus/core/docs/content/locales/de-DE/template-chat.mdx +1 -2
  55. package/corpus/core/docs/content/locales/de-DE/tracking.mdx +2 -4
  56. package/corpus/core/docs/content/locales/de-DE/what-is-agent-native.mdx +1 -2
  57. package/corpus/core/docs/content/locales/es-ES/actions.mdx +2 -4
  58. package/corpus/core/docs/content/locales/es-ES/agent-surfaces.mdx +2 -4
  59. package/corpus/core/docs/content/locales/es-ES/audit-log.mdx +1 -2
  60. package/corpus/core/docs/content/locales/es-ES/authentication.mdx +3 -2
  61. package/corpus/core/docs/content/locales/es-ES/client.mdx +19 -18
  62. package/corpus/core/docs/content/locales/es-ES/components.mdx +1 -1
  63. package/corpus/core/docs/content/locales/es-ES/context-awareness.mdx +4 -7
  64. package/corpus/core/docs/content/locales/es-ES/creating-templates.mdx +7 -5
  65. package/corpus/core/docs/content/locales/es-ES/doctor.mdx +10 -0
  66. package/corpus/core/docs/content/locales/es-ES/drop-in-agent.mdx +6 -11
  67. package/corpus/core/docs/content/locales/es-ES/embedding-sdk.mdx +8 -10
  68. package/corpus/core/docs/content/locales/es-ES/internationalization.mdx +9 -6
  69. package/corpus/core/docs/content/locales/es-ES/key-concepts.mdx +2 -4
  70. package/corpus/core/docs/content/locales/es-ES/observability.mdx +1 -2
  71. package/corpus/core/docs/content/locales/es-ES/package-lifecycle.mdx +6 -0
  72. package/corpus/core/docs/content/locales/es-ES/real-time-collaboration.mdx +4 -7
  73. package/corpus/core/docs/content/locales/es-ES/sharing.mdx +1 -2
  74. package/corpus/core/docs/content/locales/es-ES/template-chat.mdx +1 -2
  75. package/corpus/core/docs/content/locales/es-ES/tracking.mdx +2 -4
  76. package/corpus/core/docs/content/locales/es-ES/what-is-agent-native.mdx +1 -2
  77. package/corpus/core/docs/content/locales/fr-FR/actions.mdx +2 -4
  78. package/corpus/core/docs/content/locales/fr-FR/agent-surfaces.mdx +2 -4
  79. package/corpus/core/docs/content/locales/fr-FR/audit-log.mdx +1 -2
  80. package/corpus/core/docs/content/locales/fr-FR/authentication.mdx +3 -2
  81. package/corpus/core/docs/content/locales/fr-FR/client.mdx +19 -18
  82. package/corpus/core/docs/content/locales/fr-FR/components.mdx +1 -1
  83. package/corpus/core/docs/content/locales/fr-FR/context-awareness.mdx +4 -7
  84. package/corpus/core/docs/content/locales/fr-FR/creating-templates.mdx +7 -5
  85. package/corpus/core/docs/content/locales/fr-FR/doctor.mdx +10 -0
  86. package/corpus/core/docs/content/locales/fr-FR/drop-in-agent.mdx +6 -11
  87. package/corpus/core/docs/content/locales/fr-FR/embedding-sdk.mdx +8 -10
  88. package/corpus/core/docs/content/locales/fr-FR/internationalization.mdx +9 -6
  89. package/corpus/core/docs/content/locales/fr-FR/key-concepts.mdx +2 -4
  90. package/corpus/core/docs/content/locales/fr-FR/observability.mdx +1 -2
  91. package/corpus/core/docs/content/locales/fr-FR/package-lifecycle.mdx +6 -0
  92. package/corpus/core/docs/content/locales/fr-FR/real-time-collaboration.mdx +4 -7
  93. package/corpus/core/docs/content/locales/fr-FR/sharing.mdx +1 -2
  94. package/corpus/core/docs/content/locales/fr-FR/template-chat.mdx +1 -2
  95. package/corpus/core/docs/content/locales/fr-FR/tracking.mdx +2 -4
  96. package/corpus/core/docs/content/locales/fr-FR/what-is-agent-native.mdx +1 -2
  97. package/corpus/core/docs/content/locales/hi-IN/actions.mdx +2 -4
  98. package/corpus/core/docs/content/locales/hi-IN/agent-surfaces.mdx +2 -4
  99. package/corpus/core/docs/content/locales/hi-IN/audit-log.mdx +1 -2
  100. package/corpus/core/docs/content/locales/hi-IN/authentication.mdx +3 -2
  101. package/corpus/core/docs/content/locales/hi-IN/client.mdx +19 -18
  102. package/corpus/core/docs/content/locales/hi-IN/components.mdx +1 -1
  103. package/corpus/core/docs/content/locales/hi-IN/context-awareness.mdx +4 -7
  104. package/corpus/core/docs/content/locales/hi-IN/creating-templates.mdx +7 -5
  105. package/corpus/core/docs/content/locales/hi-IN/doctor.mdx +10 -0
  106. package/corpus/core/docs/content/locales/hi-IN/drop-in-agent.mdx +6 -11
  107. package/corpus/core/docs/content/locales/hi-IN/embedding-sdk.mdx +8 -10
  108. package/corpus/core/docs/content/locales/hi-IN/internationalization.mdx +9 -6
  109. package/corpus/core/docs/content/locales/hi-IN/key-concepts.mdx +2 -4
  110. package/corpus/core/docs/content/locales/hi-IN/observability.mdx +1 -2
  111. package/corpus/core/docs/content/locales/hi-IN/package-lifecycle.mdx +6 -0
  112. package/corpus/core/docs/content/locales/hi-IN/real-time-collaboration.mdx +4 -7
  113. package/corpus/core/docs/content/locales/hi-IN/sharing.mdx +1 -2
  114. package/corpus/core/docs/content/locales/hi-IN/template-chat.mdx +1 -2
  115. package/corpus/core/docs/content/locales/hi-IN/tracking.mdx +2 -4
  116. package/corpus/core/docs/content/locales/hi-IN/what-is-agent-native.mdx +1 -2
  117. package/corpus/core/docs/content/locales/ja-JP/actions.mdx +2 -4
  118. package/corpus/core/docs/content/locales/ja-JP/agent-surfaces.mdx +2 -4
  119. package/corpus/core/docs/content/locales/ja-JP/audit-log.mdx +1 -2
  120. package/corpus/core/docs/content/locales/ja-JP/authentication.mdx +3 -2
  121. package/corpus/core/docs/content/locales/ja-JP/client.mdx +19 -18
  122. package/corpus/core/docs/content/locales/ja-JP/components.mdx +1 -1
  123. package/corpus/core/docs/content/locales/ja-JP/context-awareness.mdx +4 -7
  124. package/corpus/core/docs/content/locales/ja-JP/creating-templates.mdx +7 -5
  125. package/corpus/core/docs/content/locales/ja-JP/doctor.mdx +10 -0
  126. package/corpus/core/docs/content/locales/ja-JP/drop-in-agent.mdx +6 -11
  127. package/corpus/core/docs/content/locales/ja-JP/embedding-sdk.mdx +8 -10
  128. package/corpus/core/docs/content/locales/ja-JP/internationalization.mdx +9 -6
  129. package/corpus/core/docs/content/locales/ja-JP/key-concepts.mdx +2 -4
  130. package/corpus/core/docs/content/locales/ja-JP/observability.mdx +1 -2
  131. package/corpus/core/docs/content/locales/ja-JP/package-lifecycle.mdx +6 -0
  132. package/corpus/core/docs/content/locales/ja-JP/real-time-collaboration.mdx +4 -7
  133. package/corpus/core/docs/content/locales/ja-JP/sharing.mdx +1 -2
  134. package/corpus/core/docs/content/locales/ja-JP/template-chat.mdx +1 -2
  135. package/corpus/core/docs/content/locales/ja-JP/tracking.mdx +2 -4
  136. package/corpus/core/docs/content/locales/ja-JP/what-is-agent-native.mdx +1 -2
  137. package/corpus/core/docs/content/locales/ko-KR/actions.mdx +2 -4
  138. package/corpus/core/docs/content/locales/ko-KR/agent-surfaces.mdx +2 -4
  139. package/corpus/core/docs/content/locales/ko-KR/audit-log.mdx +1 -2
  140. package/corpus/core/docs/content/locales/ko-KR/authentication.mdx +3 -2
  141. package/corpus/core/docs/content/locales/ko-KR/client.mdx +19 -18
  142. package/corpus/core/docs/content/locales/ko-KR/components.mdx +1 -1
  143. package/corpus/core/docs/content/locales/ko-KR/context-awareness.mdx +4 -7
  144. package/corpus/core/docs/content/locales/ko-KR/creating-templates.mdx +7 -5
  145. package/corpus/core/docs/content/locales/ko-KR/doctor.mdx +10 -0
  146. package/corpus/core/docs/content/locales/ko-KR/drop-in-agent.mdx +6 -11
  147. package/corpus/core/docs/content/locales/ko-KR/embedding-sdk.mdx +8 -10
  148. package/corpus/core/docs/content/locales/ko-KR/internationalization.mdx +9 -6
  149. package/corpus/core/docs/content/locales/ko-KR/key-concepts.mdx +2 -4
  150. package/corpus/core/docs/content/locales/ko-KR/observability.mdx +1 -2
  151. package/corpus/core/docs/content/locales/ko-KR/package-lifecycle.mdx +6 -0
  152. package/corpus/core/docs/content/locales/ko-KR/real-time-collaboration.mdx +4 -7
  153. package/corpus/core/docs/content/locales/ko-KR/sharing.mdx +1 -2
  154. package/corpus/core/docs/content/locales/ko-KR/template-chat.mdx +1 -2
  155. package/corpus/core/docs/content/locales/ko-KR/tracking.mdx +2 -4
  156. package/corpus/core/docs/content/locales/ko-KR/what-is-agent-native.mdx +1 -2
  157. package/corpus/core/docs/content/locales/pt-BR/actions.mdx +2 -4
  158. package/corpus/core/docs/content/locales/pt-BR/agent-surfaces.mdx +2 -4
  159. package/corpus/core/docs/content/locales/pt-BR/audit-log.mdx +1 -2
  160. package/corpus/core/docs/content/locales/pt-BR/authentication.mdx +3 -2
  161. package/corpus/core/docs/content/locales/pt-BR/client.mdx +19 -18
  162. package/corpus/core/docs/content/locales/pt-BR/components.mdx +1 -1
  163. package/corpus/core/docs/content/locales/pt-BR/context-awareness.mdx +4 -7
  164. package/corpus/core/docs/content/locales/pt-BR/creating-templates.mdx +7 -5
  165. package/corpus/core/docs/content/locales/pt-BR/doctor.mdx +10 -0
  166. package/corpus/core/docs/content/locales/pt-BR/drop-in-agent.mdx +6 -11
  167. package/corpus/core/docs/content/locales/pt-BR/embedding-sdk.mdx +8 -10
  168. package/corpus/core/docs/content/locales/pt-BR/internationalization.mdx +9 -6
  169. package/corpus/core/docs/content/locales/pt-BR/key-concepts.mdx +2 -4
  170. package/corpus/core/docs/content/locales/pt-BR/observability.mdx +1 -2
  171. package/corpus/core/docs/content/locales/pt-BR/package-lifecycle.mdx +6 -0
  172. package/corpus/core/docs/content/locales/pt-BR/real-time-collaboration.mdx +4 -7
  173. package/corpus/core/docs/content/locales/pt-BR/sharing.mdx +1 -2
  174. package/corpus/core/docs/content/locales/pt-BR/template-chat.mdx +1 -2
  175. package/corpus/core/docs/content/locales/pt-BR/tracking.mdx +2 -4
  176. package/corpus/core/docs/content/locales/pt-BR/what-is-agent-native.mdx +1 -2
  177. package/corpus/core/docs/content/locales/zh-CN/actions.mdx +2 -4
  178. package/corpus/core/docs/content/locales/zh-CN/agent-surfaces.mdx +2 -4
  179. package/corpus/core/docs/content/locales/zh-CN/audit-log.mdx +1 -2
  180. package/corpus/core/docs/content/locales/zh-CN/authentication.mdx +3 -2
  181. package/corpus/core/docs/content/locales/zh-CN/client.mdx +19 -18
  182. package/corpus/core/docs/content/locales/zh-CN/components.mdx +1 -1
  183. package/corpus/core/docs/content/locales/zh-CN/context-awareness.mdx +4 -7
  184. package/corpus/core/docs/content/locales/zh-CN/creating-templates.mdx +7 -5
  185. package/corpus/core/docs/content/locales/zh-CN/doctor.mdx +10 -0
  186. package/corpus/core/docs/content/locales/zh-CN/drop-in-agent.mdx +6 -11
  187. package/corpus/core/docs/content/locales/zh-CN/embedding-sdk.mdx +8 -10
  188. package/corpus/core/docs/content/locales/zh-CN/internationalization.mdx +9 -6
  189. package/corpus/core/docs/content/locales/zh-CN/key-concepts.mdx +2 -4
  190. package/corpus/core/docs/content/locales/zh-CN/observability.mdx +1 -2
  191. package/corpus/core/docs/content/locales/zh-CN/package-lifecycle.mdx +6 -0
  192. package/corpus/core/docs/content/locales/zh-CN/real-time-collaboration.mdx +4 -7
  193. package/corpus/core/docs/content/locales/zh-CN/sharing.mdx +1 -2
  194. package/corpus/core/docs/content/locales/zh-CN/template-chat.mdx +1 -2
  195. package/corpus/core/docs/content/locales/zh-CN/tracking.mdx +2 -4
  196. package/corpus/core/docs/content/locales/zh-CN/what-is-agent-native.mdx +1 -2
  197. package/corpus/core/docs/content/locales/zh-TW/actions.mdx +2 -4
  198. package/corpus/core/docs/content/locales/zh-TW/agent-surfaces.mdx +2 -4
  199. package/corpus/core/docs/content/locales/zh-TW/audit-log.mdx +1 -2
  200. package/corpus/core/docs/content/locales/zh-TW/authentication.mdx +3 -2
  201. package/corpus/core/docs/content/locales/zh-TW/client.mdx +19 -18
  202. package/corpus/core/docs/content/locales/zh-TW/components.mdx +1 -1
  203. package/corpus/core/docs/content/locales/zh-TW/context-awareness.mdx +4 -7
  204. package/corpus/core/docs/content/locales/zh-TW/creating-templates.mdx +7 -5
  205. package/corpus/core/docs/content/locales/zh-TW/doctor.mdx +10 -0
  206. package/corpus/core/docs/content/locales/zh-TW/drop-in-agent.mdx +6 -11
  207. package/corpus/core/docs/content/locales/zh-TW/embedding-sdk.mdx +8 -10
  208. package/corpus/core/docs/content/locales/zh-TW/internationalization.mdx +9 -6
  209. package/corpus/core/docs/content/locales/zh-TW/key-concepts.mdx +2 -4
  210. package/corpus/core/docs/content/locales/zh-TW/observability.mdx +1 -2
  211. package/corpus/core/docs/content/locales/zh-TW/package-lifecycle.mdx +6 -0
  212. package/corpus/core/docs/content/locales/zh-TW/real-time-collaboration.mdx +4 -7
  213. package/corpus/core/docs/content/locales/zh-TW/sharing.mdx +1 -2
  214. package/corpus/core/docs/content/locales/zh-TW/template-chat.mdx +1 -2
  215. package/corpus/core/docs/content/locales/zh-TW/tracking.mdx +2 -4
  216. package/corpus/core/docs/content/locales/zh-TW/what-is-agent-native.mdx +1 -2
  217. package/corpus/core/docs/content/observability.mdx +1 -2
  218. package/corpus/core/docs/content/package-lifecycle.mdx +29 -0
  219. package/corpus/core/docs/content/real-time-collaboration.mdx +8 -7
  220. package/corpus/core/docs/content/sharing.mdx +1 -2
  221. package/corpus/core/docs/content/template-chat.mdx +1 -2
  222. package/corpus/core/docs/content/toolkit-agent-ux.mdx +3 -2
  223. package/corpus/core/docs/content/toolkit-observability.mdx +1 -2
  224. package/corpus/core/docs/content/toolkit-settings.mdx +2 -2
  225. package/corpus/core/docs/content/toolkit-sharing.mdx +5 -2
  226. package/corpus/core/docs/content/tracking.mdx +2 -4
  227. package/corpus/core/docs/content/what-is-agent-native.mdx +1 -2
  228. package/corpus/core/export-snapshot.json +324 -0
  229. package/corpus/core/migration-manifest.json +1492 -0
  230. package/corpus/core/package.json +21 -3
  231. package/corpus/core/src/cli/doctor.ts +77 -7
  232. package/corpus/core/src/cli/migration-codemod.ts +569 -0
  233. package/corpus/core/src/cli/upgrade.ts +63 -7
  234. package/corpus/core/src/client/agent-chat/index.ts +279 -0
  235. package/corpus/core/src/client/agent-page/AgentContextTab.tsx +3 -1
  236. package/corpus/core/src/client/analytics/index.ts +40 -0
  237. package/corpus/core/src/client/api-path.ts +2 -2
  238. package/corpus/core/src/client/automation/index.ts +4 -0
  239. package/corpus/core/src/client/changelog/index.ts +1 -0
  240. package/corpus/core/src/client/chat/widgets/InlineExtensionWidget.tsx +5 -84
  241. package/corpus/core/src/client/chat/widgets/builtin-tool-renderers.tsx +52 -14
  242. package/corpus/core/src/client/chat/widgets/inline-extension-result.ts +86 -0
  243. package/corpus/core/src/client/client-bootstrap.ts +7 -0
  244. package/corpus/core/src/client/context-xray/ContextXRayPanel.tsx +1 -1
  245. package/corpus/core/src/client/hooks/index.ts +46 -0
  246. package/corpus/core/src/client/host/index.ts +170 -0
  247. package/corpus/core/src/client/index.ts +20 -664
  248. package/corpus/core/src/client/navigation/index.ts +54 -0
  249. package/corpus/core/src/client/resources/ResourcesPanel.tsx +1 -1
  250. package/corpus/core/src/client/resources/index.ts +2 -1
  251. package/corpus/core/src/client/resources/use-resources.ts +0 -20
  252. package/corpus/core/src/client/route-chunk-recovery/index.ts +1 -0
  253. package/corpus/core/src/client/ui/index.ts +55 -0
  254. package/corpus/core/src/client/uploads/index.ts +1 -0
  255. package/corpus/core/src/client/uploads/use-upload-resource.ts +24 -0
  256. package/corpus/core/src/client/widgets/index.ts +41 -0
  257. package/corpus/core/src/localization/default-messages.ts +2 -1
  258. package/corpus/core/src/package-lifecycle/deprecated-imports.ts +179 -0
  259. package/corpus/core/src/package-lifecycle/index.ts +5 -0
  260. package/corpus/core/src/package-lifecycle/migration-manifest.ts +159 -0
  261. package/corpus/core/src/package-lifecycle/migration-message.ts +6 -0
  262. package/corpus/core/src/package-lifecycle/tombstone.ts +44 -0
  263. package/corpus/core/src/package-lifecycle/upgrade-error.ts +19 -0
  264. package/corpus/core/src/templates/default/.agents/skills/actions/SKILL.md +3 -3
  265. package/corpus/core/src/templates/default/.agents/skills/adding-a-feature/SKILL.md +1 -1
  266. package/corpus/core/src/templates/default/.agents/skills/delegate-to-agent/SKILL.md +3 -3
  267. package/corpus/core/src/templates/default/.agents/skills/feature-flags/SKILL.md +1 -1
  268. package/corpus/core/src/templates/default/.agents/skills/real-time-collab/SKILL.md +4 -4
  269. package/corpus/core/src/templates/default/.agents/skills/real-time-sync/SKILL.md +4 -4
  270. package/corpus/core/src/templates/default/.agents/skills/storing-data/SKILL.md +1 -1
  271. package/corpus/core/src/templates/default/.agents/skills/upgrade-agent-native/SKILL.md +12 -5
  272. package/corpus/core/src/templates/default/app/hooks/use-navigation-state.ts +2 -5
  273. package/corpus/core/src/templates/default/app/i18n/index.ts +1 -1
  274. package/corpus/core/src/templates/default/app/lib/utils.ts +1 -1
  275. package/corpus/core/src/templates/default/app/root.tsx +8 -6
  276. package/corpus/core/src/templates/default/app/routes/_index.tsx +2 -1
  277. package/corpus/core/src/templates/default/app/routes/agent.tsx +2 -1
  278. package/corpus/core/src/templates/default/app/routes/settings.tsx +2 -3
  279. package/corpus/core/src/templates/headless/.agents/skills/feature-flags/SKILL.md +1 -1
  280. package/corpus/core/src/templates/headless/.agents/skills/upgrade-agent-native/SKILL.md +12 -5
  281. package/corpus/core/src/templates/workspace-core/.agents/skills/actions/SKILL.md +3 -3
  282. package/corpus/core/src/templates/workspace-core/.agents/skills/adding-a-feature/SKILL.md +1 -1
  283. package/corpus/core/src/templates/workspace-core/.agents/skills/authentication/SKILL.md +1 -1
  284. package/corpus/core/src/templates/workspace-core/.agents/skills/changelog/SKILL.md +1 -1
  285. package/corpus/core/src/templates/workspace-core/.agents/skills/client-methods/SKILL.md +10 -10
  286. package/corpus/core/src/templates/workspace-core/.agents/skills/context-awareness/SKILL.md +1 -1
  287. package/corpus/core/src/templates/workspace-core/.agents/skills/delegate-to-agent/SKILL.md +3 -3
  288. package/corpus/core/src/templates/workspace-core/.agents/skills/feature-flags/SKILL.md +1 -1
  289. package/corpus/core/src/templates/workspace-core/.agents/skills/observability/SKILL.md +1 -1
  290. package/corpus/core/src/templates/workspace-core/.agents/skills/real-time-collab/SKILL.md +4 -4
  291. package/corpus/core/src/templates/workspace-core/.agents/skills/real-time-sync/SKILL.md +4 -4
  292. package/corpus/core/src/templates/workspace-core/.agents/skills/sharing/SKILL.md +1 -1
  293. package/corpus/core/src/templates/workspace-core/.agents/skills/storing-data/SKILL.md +1 -1
  294. package/corpus/core/src/templates/workspace-core/.agents/skills/upgrade-agent-native/SKILL.md +12 -5
  295. package/corpus/core/src/vite/action-types-plugin.ts +4 -0
  296. package/corpus/core/src/vite/client.ts +80 -65
  297. package/corpus/templates/analytics/.agents/skills/actions/SKILL.md +3 -3
  298. package/corpus/templates/analytics/.agents/skills/delegate-to-agent/SKILL.md +3 -3
  299. package/corpus/templates/analytics/.agents/skills/feature-flags/SKILL.md +1 -1
  300. package/corpus/templates/analytics/.agents/skills/real-time-sync/SKILL.md +4 -4
  301. package/corpus/templates/analytics/.agents/skills/storing-data/SKILL.md +1 -1
  302. package/corpus/templates/analytics/.agents/skills/upgrade-agent-native/SKILL.md +12 -5
  303. package/corpus/templates/analytics/app/components/Markdown.tsx +1 -1
  304. package/corpus/templates/analytics/app/components/ProviderCorpusJobNotifier.tsx +2 -1
  305. package/corpus/templates/analytics/app/components/agents/FeatureFlagsFleetPanel.tsx +6 -4
  306. package/corpus/templates/analytics/app/components/analysis/AnalysisHistoryPanel.tsx +1 -1
  307. package/corpus/templates/analytics/app/components/auth/AuthProvider.tsx +2 -2
  308. package/corpus/templates/analytics/app/components/dashboard/CumulativeNetChart.tsx +1 -1
  309. package/corpus/templates/analytics/app/components/dashboard/DashboardHistoryPanel.tsx +1 -1
  310. package/corpus/templates/analytics/app/components/dashboard/DataTable.tsx +1 -1
  311. package/corpus/templates/analytics/app/components/dashboard/RecentActivity.tsx +1 -1
  312. package/corpus/templates/analytics/app/components/dashboard/RevenueChart.tsx +1 -1
  313. package/corpus/templates/analytics/app/components/dashboard/RevenueComparisonChart.tsx +1 -1
  314. package/corpus/templates/analytics/app/components/dashboard/SqlChart.tsx +2 -1
  315. package/corpus/templates/analytics/app/components/dashboard/TimeSeriesChart.tsx +1 -1
  316. package/corpus/templates/analytics/app/components/layout/CommandPalette.tsx +4 -6
  317. package/corpus/templates/analytics/app/components/layout/DashboardHeader.tsx +1 -1
  318. package/corpus/templates/analytics/app/components/layout/Header.tsx +2 -2
  319. package/corpus/templates/analytics/app/components/layout/HeaderActions.tsx +1 -1
  320. package/corpus/templates/analytics/app/components/layout/Layout.tsx +3 -3
  321. package/corpus/templates/analytics/app/components/layout/MobileNav.tsx +1 -1
  322. package/corpus/templates/analytics/app/components/layout/NewAnalysisDialog.tsx +4 -6
  323. package/corpus/templates/analytics/app/components/layout/NewDashboardDialog.tsx +3 -5
  324. package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +10 -10
  325. package/corpus/templates/analytics/app/entry.client.tsx +2 -4
  326. package/corpus/templates/analytics/app/hooks/use-analysis-revisions.ts +4 -1
  327. package/corpus/templates/analytics/app/hooks/use-dashboard-chat-context.ts +6 -4
  328. package/corpus/templates/analytics/app/hooks/use-dashboard-revisions.ts +4 -1
  329. package/corpus/templates/analytics/app/hooks/use-dashboard-views.ts +1 -1
  330. package/corpus/templates/analytics/app/hooks/use-navigation-state.ts +2 -4
  331. package/corpus/templates/analytics/app/hooks/use-replay-storage-status.ts +1 -1
  332. package/corpus/templates/analytics/app/hooks/use-user-pref.ts +1 -1
  333. package/corpus/templates/analytics/app/i18n/index.ts +1 -1
  334. package/corpus/templates/analytics/app/i18n-data.ts +1 -1
  335. package/corpus/templates/analytics/app/lib/api-hooks.ts +1 -1
  336. package/corpus/templates/analytics/app/lib/item-popularity.ts +1 -1
  337. package/corpus/templates/analytics/app/lib/query-metrics.ts +1 -1
  338. package/corpus/templates/analytics/app/lib/sql-query.ts +1 -1
  339. package/corpus/templates/analytics/app/lib/tab-id.ts +1 -1
  340. package/corpus/templates/analytics/app/lib/track-metric.ts +1 -1
  341. package/corpus/templates/analytics/app/lib/user-info.ts +1 -1
  342. package/corpus/templates/analytics/app/lib/utils.ts +1 -1
  343. package/corpus/templates/analytics/app/pages/Agents.tsx +5 -6
  344. package/corpus/templates/analytics/app/pages/Ask.tsx +2 -2
  345. package/corpus/templates/analytics/app/pages/DataDictionary.tsx +3 -3
  346. package/corpus/templates/analytics/app/pages/DataSources.tsx +7 -5
  347. package/corpus/templates/analytics/app/pages/NotFound.tsx +1 -1
  348. package/corpus/templates/analytics/app/pages/Placeholder.tsx +1 -1
  349. package/corpus/templates/analytics/app/pages/Settings.tsx +5 -6
  350. package/corpus/templates/analytics/app/pages/adhoc/BlankDashboard.tsx +1 -1
  351. package/corpus/templates/analytics/app/pages/adhoc/_shared/KpiChart.tsx +1 -1
  352. package/corpus/templates/analytics/app/pages/adhoc/explorer/components/EventCombobox.tsx +1 -1
  353. package/corpus/templates/analytics/app/pages/adhoc/explorer/components/EventPanel.tsx +1 -1
  354. package/corpus/templates/analytics/app/pages/adhoc/explorer/components/ExplorerChart.tsx +1 -1
  355. package/corpus/templates/analytics/app/pages/adhoc/explorer/components/FilterBuilder.tsx +1 -1
  356. package/corpus/templates/analytics/app/pages/adhoc/explorer/components/GroupByPicker.tsx +1 -1
  357. package/corpus/templates/analytics/app/pages/adhoc/explorer/components/PropertyCombobox.tsx +1 -1
  358. package/corpus/templates/analytics/app/pages/adhoc/explorer/components/PropertyValueCombobox.tsx +1 -1
  359. package/corpus/templates/analytics/app/pages/adhoc/explorer/components/SqlPreview.tsx +1 -1
  360. package/corpus/templates/analytics/app/pages/adhoc/explorer/index.tsx +1 -1
  361. package/corpus/templates/analytics/app/pages/adhoc/explorer/use-explorer-config.ts +2 -1
  362. package/corpus/templates/analytics/app/pages/adhoc/explorer-dashboard/ChartCard.tsx +2 -1
  363. package/corpus/templates/analytics/app/pages/adhoc/explorer-dashboard/index.tsx +8 -6
  364. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/DashboardFilterBar.tsx +1 -1
  365. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/EmailReportDialog.tsx +2 -2
  366. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/PanelEditorDialog.tsx +4 -6
  367. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/SqlChartCard.tsx +1 -1
  368. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/ViewSqlPopover.tsx +2 -1
  369. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/ViewsMenu.tsx +1 -1
  370. package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/index.tsx +9 -7
  371. package/corpus/templates/analytics/app/pages/analyses/AnalysesList.tsx +3 -6
  372. package/corpus/templates/analytics/app/pages/analyses/AnalysisDetail.tsx +4 -4
  373. package/corpus/templates/analytics/app/pages/analyses/LegacyFusionAnalysis.tsx +2 -1
  374. package/corpus/templates/analytics/app/pages/monitoring/ErrorsPanel.tsx +1 -11
  375. package/corpus/templates/analytics/app/pages/monitoring/MonitoringPage.tsx +2 -1
  376. package/corpus/templates/analytics/app/pages/monitoring/UptimePanel.tsx +1 -14
  377. package/corpus/templates/analytics/app/pages/monitoring/errors/IssueDetail.tsx +1 -1
  378. package/corpus/templates/analytics/app/pages/monitoring/errors/IssueList.tsx +1 -1
  379. package/corpus/templates/analytics/app/pages/monitoring/errors/i18n.ts +1 -6
  380. package/corpus/templates/analytics/app/pages/monitoring/uptime/MonitorDetail.tsx +1 -8
  381. package/corpus/templates/analytics/app/pages/monitoring/uptime/MonitorFormPage.tsx +4 -10
  382. package/corpus/templates/analytics/app/pages/monitoring/uptime/i18n.ts +1 -6
  383. package/corpus/templates/analytics/app/pages/monitoring/uptime/status-pages/StatusPageEditor.tsx +4 -8
  384. package/corpus/templates/analytics/app/pages/monitoring/uptime/status-pages/StatusPagesView.tsx +4 -10
  385. package/corpus/templates/analytics/app/pages/monitoring/uptime/status-pages/i18n.ts +1 -6
  386. package/corpus/templates/analytics/app/pages/sessions/SessionDetailPage.tsx +5 -6
  387. package/corpus/templates/analytics/app/pages/sessions/SessionDevToolsPanel.tsx +1 -1
  388. package/corpus/templates/analytics/app/pages/sessions/SessionsPage.tsx +5 -5
  389. package/corpus/templates/analytics/app/pages/settings/AlertRulesSettingsCard.tsx +2 -2
  390. package/corpus/templates/analytics/app/pages/settings/settings-search.ts +1 -1
  391. package/corpus/templates/analytics/app/root.tsx +6 -6
  392. package/corpus/templates/analytics/app/routes/agent.tsx +1 -1
  393. package/corpus/templates/analytics/app/routes/catalog.tsx +2 -2
  394. package/corpus/templates/analytics/app/routes/chart.tsx +1 -1
  395. package/corpus/templates/analytics/app/routes/status.$slug.tsx +1 -13
  396. package/corpus/templates/assets/.agents/skills/actions/SKILL.md +3 -3
  397. package/corpus/templates/assets/.agents/skills/delegate-to-agent/SKILL.md +3 -3
  398. package/corpus/templates/assets/.agents/skills/feature-flags/SKILL.md +1 -1
  399. package/corpus/templates/assets/.agents/skills/real-time-collab/SKILL.md +4 -4
  400. package/corpus/templates/assets/.agents/skills/real-time-sync/SKILL.md +4 -4
  401. package/corpus/templates/assets/.agents/skills/storing-data/SKILL.md +1 -1
  402. package/corpus/templates/assets/.agents/skills/upgrade-agent-native/SKILL.md +12 -5
  403. package/corpus/templates/assets/app/components/create/RecentDraftsSection.tsx +2 -1
  404. package/corpus/templates/assets/app/components/generation/GenerationResults.tsx +3 -3
  405. package/corpus/templates/assets/app/components/layout/Header.tsx +3 -5
  406. package/corpus/templates/assets/app/components/layout/Layout.tsx +4 -4
  407. package/corpus/templates/assets/app/components/layout/Sidebar.tsx +6 -6
  408. package/corpus/templates/assets/app/components/library/CreateLibraryDialog.tsx +2 -2
  409. package/corpus/templates/assets/app/components/library/GenerationPresetsPanel.tsx +2 -1
  410. package/corpus/templates/assets/app/components/library/LibraryCard.tsx +1 -1
  411. package/corpus/templates/assets/app/components/library/LibraryPresetGrid.tsx +1 -1
  412. package/corpus/templates/assets/app/hooks/use-image-model-menu.ts +2 -2
  413. package/corpus/templates/assets/app/hooks/use-navigation-state.ts +3 -3
  414. package/corpus/templates/assets/app/i18n/index.ts +1 -1
  415. package/corpus/templates/assets/app/i18n-data.ts +1 -1
  416. package/corpus/templates/assets/app/lib/asset-urls.ts +1 -1
  417. package/corpus/templates/assets/app/lib/utils.ts +1 -1
  418. package/corpus/templates/assets/app/root.tsx +10 -9
  419. package/corpus/templates/assets/app/routes/_index.tsx +3 -3
  420. package/corpus/templates/assets/app/routes/agent.tsx +1 -1
  421. package/corpus/templates/assets/app/routes/asset.$id.tsx +3 -3
  422. package/corpus/templates/assets/app/routes/asset.$id_.embed.tsx +1 -1
  423. package/corpus/templates/assets/app/routes/audit.tsx +2 -2
  424. package/corpus/templates/assets/app/routes/brand-kits.$id.tsx +6 -4
  425. package/corpus/templates/assets/app/routes/brand-kits.$id_.presets.$presetId.tsx +4 -4
  426. package/corpus/templates/assets/app/routes/brand-kits.$id_.settings.tsx +3 -3
  427. package/corpus/templates/assets/app/routes/library.tsx +13 -9
  428. package/corpus/templates/assets/app/routes/run.$id_.embed.tsx +1 -1
  429. package/corpus/templates/assets/app/routes/settings.tsx +11 -12
  430. package/corpus/templates/brain/.agents/skills/actions/SKILL.md +3 -3
  431. package/corpus/templates/brain/.agents/skills/adding-a-feature/SKILL.md +1 -1
  432. package/corpus/templates/brain/.agents/skills/delegate-to-agent/SKILL.md +3 -3
  433. package/corpus/templates/brain/.agents/skills/feature-flags/SKILL.md +1 -1
  434. package/corpus/templates/brain/.agents/skills/real-time-sync/SKILL.md +4 -4
  435. package/corpus/templates/brain/.agents/skills/upgrade-agent-native/SKILL.md +12 -5
  436. package/corpus/templates/brain/app/components/brain/CanonicalPreviewSheet.tsx +1 -1
  437. package/corpus/templates/brain/app/components/layout/Layout.tsx +2 -2
  438. package/corpus/templates/brain/app/components/layout/Sidebar.tsx +5 -5
  439. package/corpus/templates/brain/app/hooks/use-distillation-bridge.ts +3 -6
  440. package/corpus/templates/brain/app/hooks/use-navigation-state.ts +3 -4
  441. package/corpus/templates/brain/app/i18n/index.ts +1 -1
  442. package/corpus/templates/brain/app/i18n-data.ts +1 -1
  443. package/corpus/templates/brain/app/lib/utils.ts +1 -1
  444. package/corpus/templates/brain/app/root.tsx +10 -9
  445. package/corpus/templates/brain/app/routes/_index.tsx +2 -2
  446. package/corpus/templates/brain/app/routes/agent.tsx +1 -1
  447. package/corpus/templates/brain/app/routes/knowledge.tsx +2 -2
  448. package/corpus/templates/brain/app/routes/ops.tsx +2 -2
  449. package/corpus/templates/brain/app/routes/review.tsx +2 -2
  450. package/corpus/templates/brain/app/routes/search.tsx +2 -1
  451. package/corpus/templates/brain/app/routes/settings.tsx +8 -7
  452. package/corpus/templates/brain/app/routes/sources.tsx +2 -2
  453. package/corpus/templates/calendar/.agents/skills/actions/SKILL.md +3 -3
  454. package/corpus/templates/calendar/.agents/skills/delegate-to-agent/SKILL.md +3 -3
  455. package/corpus/templates/calendar/.agents/skills/feature-flags/SKILL.md +1 -1
  456. package/corpus/templates/calendar/.agents/skills/real-time-sync/SKILL.md +4 -4
  457. package/corpus/templates/calendar/.agents/skills/storing-data/SKILL.md +1 -1
  458. package/corpus/templates/calendar/.agents/skills/upgrade-agent-native/SKILL.md +12 -5
  459. package/corpus/templates/calendar/app/components/CloudUpgrade.tsx +1 -1
  460. package/corpus/templates/calendar/app/components/ThemeToggle.tsx +1 -1
  461. package/corpus/templates/calendar/app/components/TimezoneCombobox.tsx +1 -1
  462. package/corpus/templates/calendar/app/components/booking/BookingConfirmation.tsx +1 -1
  463. package/corpus/templates/calendar/app/components/booking/BookingForm.tsx +2 -1
  464. package/corpus/templates/calendar/app/components/booking/TimeSlotPicker.tsx +1 -1
  465. package/corpus/templates/calendar/app/components/calendar/AddCalendarDialog.tsx +2 -1
  466. package/corpus/templates/calendar/app/components/calendar/ApolloPanel.tsx +2 -1
  467. package/corpus/templates/calendar/app/components/calendar/AttendeeAutocomplete.tsx +1 -1
  468. package/corpus/templates/calendar/app/components/calendar/CommandPalette.tsx +2 -1
  469. package/corpus/templates/calendar/app/components/calendar/CreateEventDialog.tsx +3 -5
  470. package/corpus/templates/calendar/app/components/calendar/DayView.tsx +1 -1
  471. package/corpus/templates/calendar/app/components/calendar/DeleteEventDialog.tsx +1 -1
  472. package/corpus/templates/calendar/app/components/calendar/EventAttendeesSection.tsx +1 -1
  473. package/corpus/templates/calendar/app/components/calendar/EventCard.tsx +1 -1
  474. package/corpus/templates/calendar/app/components/calendar/EventDescription.tsx +1 -1
  475. package/corpus/templates/calendar/app/components/calendar/EventDetailPanel.tsx +1 -1
  476. package/corpus/templates/calendar/app/components/calendar/EventDetailPopover.tsx +2 -1
  477. package/corpus/templates/calendar/app/components/calendar/EventDialog.tsx +1 -1
  478. package/corpus/templates/calendar/app/components/calendar/EventOptionControls.tsx +2 -1
  479. package/corpus/templates/calendar/app/components/calendar/FindTimePanel.tsx +2 -1
  480. package/corpus/templates/calendar/app/components/calendar/GoogleConnectBanner.tsx +3 -3
  481. package/corpus/templates/calendar/app/components/calendar/GoogleSetupWizard.tsx +3 -5
  482. package/corpus/templates/calendar/app/components/calendar/GoogleSyncButton.tsx +1 -1
  483. package/corpus/templates/calendar/app/components/calendar/GuestNotificationDialog.tsx +1 -1
  484. package/corpus/templates/calendar/app/components/calendar/IntegrationsSidebar.tsx +2 -1
  485. package/corpus/templates/calendar/app/components/calendar/KeyboardShortcutsHelp.tsx +1 -1
  486. package/corpus/templates/calendar/app/components/calendar/PeopleSearchDialog.tsx +2 -1
  487. package/corpus/templates/calendar/app/components/calendar/WeekView.tsx +1 -1
  488. package/corpus/templates/calendar/app/components/calendar/WorkingLocationEditor.tsx +1 -1
  489. package/corpus/templates/calendar/app/components/layout/AppLayout.tsx +3 -3
  490. package/corpus/templates/calendar/app/components/layout/Sidebar.tsx +4 -6
  491. package/corpus/templates/calendar/app/hooks/use-apollo.ts +1 -1
  492. package/corpus/templates/calendar/app/hooks/use-attendee-timezones.ts +4 -1
  493. package/corpus/templates/calendar/app/hooks/use-availability.ts +4 -1
  494. package/corpus/templates/calendar/app/hooks/use-booking-links.ts +4 -1
  495. package/corpus/templates/calendar/app/hooks/use-bookings.ts +1 -1
  496. package/corpus/templates/calendar/app/hooks/use-db-status.ts +1 -1
  497. package/corpus/templates/calendar/app/hooks/use-events.ts +1 -1
  498. package/corpus/templates/calendar/app/hooks/use-external-calendars.ts +1 -1
  499. package/corpus/templates/calendar/app/hooks/use-google-auth.ts +2 -2
  500. package/corpus/templates/calendar/app/hooks/use-integrations.ts +1 -1
  501. package/corpus/templates/calendar/app/hooks/use-navigation-state.ts +3 -2
  502. package/corpus/templates/calendar/app/hooks/use-overlay-people.ts +1 -1
  503. package/corpus/templates/calendar/app/hooks/use-people.ts +1 -1
  504. package/corpus/templates/calendar/app/hooks/use-settings.ts +4 -1
  505. package/corpus/templates/calendar/app/hooks/use-view-preferences.ts +2 -1
  506. package/corpus/templates/calendar/app/hooks/use-zoom-auth.ts +2 -1
  507. package/corpus/templates/calendar/app/i18n/index.ts +1 -1
  508. package/corpus/templates/calendar/app/i18n-data.ts +1 -1
  509. package/corpus/templates/calendar/app/lib/api-path.ts +1 -1
  510. package/corpus/templates/calendar/app/lib/utils.ts +1 -1
  511. package/corpus/templates/calendar/app/pages/AvailabilitySettings.tsx +1 -1
  512. package/corpus/templates/calendar/app/pages/BookingLinksPage.tsx +3 -1
  513. package/corpus/templates/calendar/app/pages/BookingPage.tsx +2 -3
  514. package/corpus/templates/calendar/app/pages/BookingsList.tsx +1 -1
  515. package/corpus/templates/calendar/app/pages/CalendarView.tsx +3 -5
  516. package/corpus/templates/calendar/app/pages/ManageBookingPage.tsx +1 -1
  517. package/corpus/templates/calendar/app/pages/NotFound.tsx +1 -1
  518. package/corpus/templates/calendar/app/pages/Settings.tsx +9 -8
  519. package/corpus/templates/calendar/app/root.tsx +15 -9
  520. package/corpus/templates/calendar/app/routes/_app.agent.tsx +2 -1
  521. package/corpus/templates/calendar/app/routes/_app.settings.tsx +1 -1
  522. package/corpus/templates/calendar/app/routes/event.tsx +3 -3
  523. package/corpus/templates/chat/.agents/skills/actions/SKILL.md +3 -3
  524. package/corpus/templates/chat/.agents/skills/adding-a-feature/SKILL.md +1 -1
  525. package/corpus/templates/chat/.agents/skills/delegate-to-agent/SKILL.md +3 -3
  526. package/corpus/templates/chat/.agents/skills/feature-flags/SKILL.md +1 -1
  527. package/corpus/templates/chat/.agents/skills/real-time-sync/SKILL.md +4 -4
  528. package/corpus/templates/chat/.agents/skills/upgrade-agent-native/SKILL.md +12 -5
  529. package/corpus/templates/chat/app/components/layout/Header.tsx +2 -1
  530. package/corpus/templates/chat/app/components/layout/Layout.tsx +2 -2
  531. package/corpus/templates/chat/app/components/layout/Sidebar.tsx +4 -4
  532. package/corpus/templates/chat/app/hooks/use-navigation-state.ts +3 -4
  533. package/corpus/templates/chat/app/i18n/index.ts +1 -1
  534. package/corpus/templates/chat/app/i18n-data.ts +1 -1
  535. package/corpus/templates/chat/app/lib/utils.ts +1 -1
  536. package/corpus/templates/chat/app/root.tsx +10 -9
  537. package/corpus/templates/chat/app/routes/_index.tsx +2 -2
  538. package/corpus/templates/chat/app/routes/agent.tsx +10 -3
  539. package/corpus/templates/chat/app/routes/database.tsx +1 -1
  540. package/corpus/templates/chat/app/routes/observability.tsx +2 -1
  541. package/corpus/templates/chat/app/routes/settings.tsx +4 -5
  542. package/corpus/templates/clips/.agents/skills/actions/SKILL.md +3 -3
  543. package/corpus/templates/clips/.agents/skills/delegate-to-agent/SKILL.md +3 -3
  544. package/corpus/templates/clips/.agents/skills/feature-flags/SKILL.md +1 -1
  545. package/corpus/templates/clips/.agents/skills/upgrade-agent-native/SKILL.md +12 -5
  546. package/corpus/templates/clips/app/components/capture-install-options.tsx +2 -1
  547. package/corpus/templates/clips/app/components/dictate/vocabulary-section.tsx +2 -2
  548. package/corpus/templates/clips/app/components/editable-recording-title.tsx +2 -1
  549. package/corpus/templates/clips/app/components/editor/chapters-editor.tsx +2 -1
  550. package/corpus/templates/clips/app/components/editor/editor-layout.tsx +4 -14
  551. package/corpus/templates/clips/app/components/editor/editor-toolbar.tsx +2 -1
  552. package/corpus/templates/clips/app/components/editor/split-button.tsx +2 -1
  553. package/corpus/templates/clips/app/components/editor/stitch-manager.tsx +3 -3
  554. package/corpus/templates/clips/app/components/editor/thumbnail-picker.tsx +2 -1
  555. package/corpus/templates/clips/app/components/editor/transcript-editor.tsx +1 -1
  556. package/corpus/templates/clips/app/components/layout/Header.tsx +2 -1
  557. package/corpus/templates/clips/app/components/library/bulk-action-toolbar.tsx +1 -1
  558. package/corpus/templates/clips/app/components/library/create-folder-dialog.tsx +1 -1
  559. package/corpus/templates/clips/app/components/library/create-space-dialog.tsx +1 -1
  560. package/corpus/templates/clips/app/components/library/empty-state.tsx +1 -1
  561. package/corpus/templates/clips/app/components/library/folder-tree.tsx +1 -1
  562. package/corpus/templates/clips/app/components/library/library-grid.tsx +2 -2
  563. package/corpus/templates/clips/app/components/library/library-layout.tsx +6 -6
  564. package/corpus/templates/clips/app/components/library/organization-switcher.tsx +1 -1
  565. package/corpus/templates/clips/app/components/library/recording-card.tsx +1 -1
  566. package/corpus/templates/clips/app/components/library/search-bar.tsx +1 -1
  567. package/corpus/templates/clips/app/components/meetings/auto-record-prompt.tsx +1 -17
  568. package/corpus/templates/clips/app/components/meetings/canvas-editor.tsx +1 -1
  569. package/corpus/templates/clips/app/components/meetings/meeting-card.tsx +1 -1
  570. package/corpus/templates/clips/app/components/meetings/quick-ask-sidebar.tsx +2 -20
  571. package/corpus/templates/clips/app/components/meetings/share-meeting-dialog.tsx +3 -1
  572. package/corpus/templates/clips/app/components/meetings/transcript-bubbles.tsx +1 -1
  573. package/corpus/templates/clips/app/components/player/access-password-prompt.tsx +1 -1
  574. package/corpus/templates/clips/app/components/player/captions-overlay.tsx +1 -1
  575. package/corpus/templates/clips/app/components/player/comments-panel.tsx +2 -1
  576. package/corpus/templates/clips/app/components/player/delete-recording-menu.tsx +2 -1
  577. package/corpus/templates/clips/app/components/player/insights-panel.tsx +2 -1
  578. package/corpus/templates/clips/app/components/player/player-controls.tsx +1 -1
  579. package/corpus/templates/clips/app/components/player/settings-panel.tsx +2 -2
  580. package/corpus/templates/clips/app/components/player/share-dialog.tsx +3 -3
  581. package/corpus/templates/clips/app/components/player/sign-in-prompt-dialog.tsx +1 -1
  582. package/corpus/templates/clips/app/components/player/timestamped-comment-button.tsx +2 -1
  583. package/corpus/templates/clips/app/components/player/transcript-panel.tsx +3 -6
  584. package/corpus/templates/clips/app/components/player/video-player.tsx +3 -5
  585. package/corpus/templates/clips/app/components/recorder/camera-visualizer.tsx +1 -1
  586. package/corpus/templates/clips/app/components/recorder/countdown-overlay.tsx +1 -1
  587. package/corpus/templates/clips/app/components/recorder/microphone-visualizer.tsx +1 -1
  588. package/corpus/templates/clips/app/components/recorder/pre-record-panel.tsx +2 -1
  589. package/corpus/templates/clips/app/components/recorder/recorder-engine.ts +3 -13
  590. package/corpus/templates/clips/app/components/recorder/recording-toolbar.tsx +1 -1
  591. package/corpus/templates/clips/app/components/recorder/storage-setup-card.tsx +3 -6
  592. package/corpus/templates/clips/app/components/sharing/share-ui.tsx +2 -2
  593. package/corpus/templates/clips/app/components/sharing/viewed-by-popover.tsx +2 -1
  594. package/corpus/templates/clips/app/components/workspace/branding-editor.tsx +3 -5
  595. package/corpus/templates/clips/app/components/workspace/engagement-chart.tsx +1 -1
  596. package/corpus/templates/clips/app/components/workspace/insights-hub.tsx +3 -1
  597. package/corpus/templates/clips/app/components/workspace/invite-dialog.tsx +2 -1
  598. package/corpus/templates/clips/app/components/workspace/members-list.tsx +2 -1
  599. package/corpus/templates/clips/app/components/workspace/notifications-list.tsx +1 -1
  600. package/corpus/templates/clips/app/components/workspace/top-creators-table.tsx +1 -1
  601. package/corpus/templates/clips/app/entry.client.tsx +2 -4
  602. package/corpus/templates/clips/app/hooks/use-auto-title.ts +3 -17
  603. package/corpus/templates/clips/app/hooks/use-library.ts +4 -1
  604. package/corpus/templates/clips/app/hooks/use-navigation-state.ts +2 -1
  605. package/corpus/templates/clips/app/hooks/use-video-storage-status.ts +1 -1
  606. package/corpus/templates/clips/app/hooks/use-view-tracking.ts +1 -1
  607. package/corpus/templates/clips/app/i18n/index.ts +5 -5
  608. package/corpus/templates/clips/app/lib/camera-blur.ts +1 -1
  609. package/corpus/templates/clips/app/lib/capture-install-options.ts +1 -1
  610. package/corpus/templates/clips/app/lib/thumbnail-capture.ts +1 -1
  611. package/corpus/templates/clips/app/lib/utils.ts +1 -1
  612. package/corpus/templates/clips/app/root.tsx +13 -9
  613. package/corpus/templates/clips/app/routes/_app.agent.tsx +2 -1
  614. package/corpus/templates/clips/app/routes/_app.archive.tsx +1 -1
  615. package/corpus/templates/clips/app/routes/_app.dictate.tsx +2 -2
  616. package/corpus/templates/clips/app/routes/_app.extensions.$id.tsx +1 -1
  617. package/corpus/templates/clips/app/routes/_app.extensions._index.tsx +1 -1
  618. package/corpus/templates/clips/app/routes/_app.library._index.tsx +1 -1
  619. package/corpus/templates/clips/app/routes/_app.library.folder.$folderId.tsx +1 -1
  620. package/corpus/templates/clips/app/routes/_app.meetings.$meetingId.tsx +2 -2
  621. package/corpus/templates/clips/app/routes/_app.meetings._index.tsx +3 -5
  622. package/corpus/templates/clips/app/routes/_app.notifications.tsx +2 -2
  623. package/corpus/templates/clips/app/routes/_app.settings._index.tsx +7 -7
  624. package/corpus/templates/clips/app/routes/_app.settings.organization.tsx +2 -1
  625. package/corpus/templates/clips/app/routes/_app.shared.tsx +1 -1
  626. package/corpus/templates/clips/app/routes/_app.spaces.$spaceId.folder.$folderId.tsx +1 -1
  627. package/corpus/templates/clips/app/routes/_app.spaces.$spaceId.tsx +1 -1
  628. package/corpus/templates/clips/app/routes/_app.spaces._index.tsx +1 -1
  629. package/corpus/templates/clips/app/routes/_app.trash.tsx +2 -1
  630. package/corpus/templates/clips/app/routes/_index.tsx +1 -1
  631. package/corpus/templates/clips/app/routes/bug-report.done.tsx +2 -1
  632. package/corpus/templates/clips/app/routes/bug-report.tsx +2 -1
  633. package/corpus/templates/clips/app/routes/download.tsx +2 -1
  634. package/corpus/templates/clips/app/routes/embed.$shareId.tsx +2 -1
  635. package/corpus/templates/clips/app/routes/invite.$token.tsx +2 -1
  636. package/corpus/templates/clips/app/routes/r.$recordingId.tsx +4 -5
  637. package/corpus/templates/clips/app/routes/record.tsx +4 -4
  638. package/corpus/templates/clips/app/routes/share.$shareId.tsx +5 -6
  639. package/corpus/templates/clips/app/routes/share.meeting.$meetingId.tsx +3 -1
  640. package/corpus/templates/content/.agents/skills/actions/SKILL.md +3 -3
  641. package/corpus/templates/content/.agents/skills/delegate-to-agent/SKILL.md +3 -3
  642. package/corpus/templates/content/.agents/skills/feature-flags/SKILL.md +1 -1
  643. package/corpus/templates/content/.agents/skills/real-time-sync/SKILL.md +4 -4
  644. package/corpus/templates/content/.agents/skills/storing-data/SKILL.md +1 -1
  645. package/corpus/templates/content/.agents/skills/upgrade-agent-native/SKILL.md +12 -5
  646. package/corpus/templates/content/app/blocks/SourceComponentBlock.tsx +1 -1
  647. package/corpus/templates/content/app/blocks/contentBlockRegistry.tsx +1 -1
  648. package/corpus/templates/content/app/components/EmptyState.tsx +1 -1
  649. package/corpus/templates/content/app/components/QueryErrorState.tsx +1 -1
  650. package/corpus/templates/content/app/components/ThemeToggle.tsx +1 -1
  651. package/corpus/templates/content/app/components/editor/BubbleToolbar.tsx +1 -1
  652. package/corpus/templates/content/app/components/editor/CommentsSidebar.tsx +3 -1
  653. package/corpus/templates/content/app/components/editor/ContentReferencePreview.tsx +1 -1
  654. package/corpus/templates/content/app/components/editor/DocumentBlockFields.tsx +1 -1
  655. package/corpus/templates/content/app/components/editor/DocumentEditor.tsx +7 -5
  656. package/corpus/templates/content/app/components/editor/DocumentProperties.tsx +3 -6
  657. package/corpus/templates/content/app/components/editor/DocumentToolbar.tsx +7 -9
  658. package/corpus/templates/content/app/components/editor/EmojiPicker.tsx +1 -1
  659. package/corpus/templates/content/app/components/editor/LinkHoverPreview.tsx +1 -1
  660. package/corpus/templates/content/app/components/editor/NotionConflictBanner.tsx +1 -1
  661. package/corpus/templates/content/app/components/editor/NotionSyncBar.tsx +1 -1
  662. package/corpus/templates/content/app/components/editor/SlashCommandMenu.tsx +2 -1
  663. package/corpus/templates/content/app/components/editor/TableHoverControls.tsx +1 -1
  664. package/corpus/templates/content/app/components/editor/VersionHistoryPanel.tsx +2 -1
  665. package/corpus/templates/content/app/components/editor/VisualEditor.tsx +6 -4
  666. package/corpus/templates/content/app/components/editor/database/DatabaseView.tsx +5 -6
  667. package/corpus/templates/content/app/components/editor/database/FormView.tsx +1 -1
  668. package/corpus/templates/content/app/components/editor/database/settings.tsx +2 -2
  669. package/corpus/templates/content/app/components/editor/database-sources/BuilderSourceReviewDialog.tsx +1 -1
  670. package/corpus/templates/content/app/components/editor/extensions/AudioBlock.tsx +2 -1
  671. package/corpus/templates/content/app/components/editor/extensions/CodeBlockNode.tsx +1 -1
  672. package/corpus/templates/content/app/components/editor/extensions/ImageBlock.tsx +2 -1
  673. package/corpus/templates/content/app/components/editor/extensions/LocalMdxComponentNode.tsx +1 -1
  674. package/corpus/templates/content/app/components/editor/extensions/VideoBlock.tsx +2 -1
  675. package/corpus/templates/content/app/components/editor/extensions/registryBlocks.ts +1 -1
  676. package/corpus/templates/content/app/components/editor/image-upload.ts +1 -1
  677. package/corpus/templates/content/app/components/editor/registrySlashItems.ts +1 -1
  678. package/corpus/templates/content/app/components/layout/Header.tsx +1 -1
  679. package/corpus/templates/content/app/components/layout/Layout.tsx +3 -1
  680. package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +9 -9
  681. package/corpus/templates/content/app/components/sidebar/DocumentTreeItem.tsx +1 -1
  682. package/corpus/templates/content/app/components/sidebar/NotionButton.tsx +5 -1
  683. package/corpus/templates/content/app/entry.client.tsx +2 -4
  684. package/corpus/templates/content/app/hooks/use-comments.ts +4 -1
  685. package/corpus/templates/content/app/hooks/use-content-database.ts +4 -1
  686. package/corpus/templates/content/app/hooks/use-content-spaces.ts +4 -1
  687. package/corpus/templates/content/app/hooks/use-db-sync.ts +1 -1
  688. package/corpus/templates/content/app/hooks/use-document-properties.ts +4 -1
  689. package/corpus/templates/content/app/hooks/use-document-versions.ts +4 -1
  690. package/corpus/templates/content/app/hooks/use-documents.ts +4 -1
  691. package/corpus/templates/content/app/hooks/use-mention-members.ts +1 -1
  692. package/corpus/templates/content/app/hooks/use-navigation-state.ts +2 -1
  693. package/corpus/templates/content/app/hooks/use-notion.ts +2 -2
  694. package/corpus/templates/content/app/i18n/index.ts +1 -1
  695. package/corpus/templates/content/app/i18n-data.ts +1 -1
  696. package/corpus/templates/content/app/lib/local-control-resources.ts +1 -1
  697. package/corpus/templates/content/app/lib/utils.ts +1 -1
  698. package/corpus/templates/content/app/root.tsx +15 -9
  699. package/corpus/templates/content/app/routes/_app.agent.tsx +2 -1
  700. package/corpus/templates/content/app/routes/_app.local-files.tsx +2 -1
  701. package/corpus/templates/content/app/routes/_app.page.$id.tsx +1 -1
  702. package/corpus/templates/content/app/routes/_app.settings.tsx +4 -5
  703. package/corpus/templates/content/app/routes/p.$id.tsx +2 -1
  704. package/corpus/templates/design/.agents/skills/actions/SKILL.md +3 -3
  705. package/corpus/templates/design/.agents/skills/delegate-to-agent/SKILL.md +3 -3
  706. package/corpus/templates/design/.agents/skills/feature-flags/SKILL.md +1 -1
  707. package/corpus/templates/design/.agents/skills/upgrade-agent-native/SKILL.md +12 -5
  708. package/corpus/templates/design/app/components/QueryErrorState.tsx +1 -1
  709. package/corpus/templates/design/app/components/ThemeToggle.tsx +1 -1
  710. package/corpus/templates/design/app/components/design/AutoLayoutSuggestionDialog.tsx +1 -1
  711. package/corpus/templates/design/app/components/design/BreakpointBar.tsx +1 -30
  712. package/corpus/templates/design/app/components/design/DesignCanvas.tsx +4 -3
  713. package/corpus/templates/design/app/components/design/DesignExtensionsPanel.tsx +4 -4
  714. package/corpus/templates/design/app/components/design/DesignImportPanel.tsx +2 -5
  715. package/corpus/templates/design/app/components/design/DrawOverlay.tsx +1 -1
  716. package/corpus/templates/design/app/components/design/EditPanel.tsx +2 -2
  717. package/corpus/templates/design/app/components/design/FusionAppBanner.tsx +4 -1
  718. package/corpus/templates/design/app/components/design/KeyboardShortcutsPanel.tsx +1 -1
  719. package/corpus/templates/design/app/components/design/LayersPanel.tsx +1 -1
  720. package/corpus/templates/design/app/components/design/LocalhostWriteConsentDialog.tsx +1 -1
  721. package/corpus/templates/design/app/components/design/MotionDock.tsx +1 -19
  722. package/corpus/templates/design/app/components/design/MultiScreenCanvas.tsx +2 -2
  723. package/corpus/templates/design/app/components/design/QuestionFlow.tsx +2 -2
  724. package/corpus/templates/design/app/components/design/ReadOnlyDesignBanner.tsx +1 -1
  725. package/corpus/templates/design/app/components/design/ReviewCommentsPanel.tsx +2 -2
  726. package/corpus/templates/design/app/components/design/ReviewPanel.tsx +1 -22
  727. package/corpus/templates/design/app/components/design/ReviewStatusControl.tsx +2 -2
  728. package/corpus/templates/design/app/components/design/StatesPanel.tsx +4 -14
  729. package/corpus/templates/design/app/components/design/TokensPanel.tsx +2 -17
  730. package/corpus/templates/design/app/components/design/TweaksPanel.tsx +1 -1
  731. package/corpus/templates/design/app/components/design/code-workbench/CodeWorkbench.tsx +1 -1
  732. package/corpus/templates/design/app/components/design/code-workbench/editor/BufferSync.tsx +1 -1
  733. package/corpus/templates/design/app/components/design/code-workbench/explorer/ExplorerView.tsx +1 -1
  734. package/corpus/templates/design/app/components/design/code-workbench/workspace/inline-provider.ts +1 -1
  735. package/corpus/templates/design/app/components/design/code-workbench/workspace/localhost-provider.ts +1 -1
  736. package/corpus/templates/design/app/components/design/design-canvas/annotation-snapshot.ts +1 -1
  737. package/corpus/templates/design/app/components/design/edit-panel/appearance-properties.tsx +1 -1
  738. package/corpus/templates/design/app/components/design/edit-panel/component-section.tsx +2 -2
  739. package/corpus/templates/design/app/components/design/edit-panel/effects-properties.tsx +1 -1
  740. package/corpus/templates/design/app/components/design/edit-panel/field-primitives.tsx +1 -1
  741. package/corpus/templates/design/app/components/design/edit-panel/fill-properties.tsx +1 -1
  742. package/corpus/templates/design/app/components/design/edit-panel/frame-presets-panel.tsx +1 -1
  743. package/corpus/templates/design/app/components/design/edit-panel/layout-properties.tsx +1 -1
  744. package/corpus/templates/design/app/components/design/edit-panel/position-layout-properties.tsx +1 -1
  745. package/corpus/templates/design/app/components/design/edit-panel/stroke-properties.tsx +1 -1
  746. package/corpus/templates/design/app/components/design/edit-panel/typography-properties.tsx +1 -1
  747. package/corpus/templates/design/app/components/design/inspector/BreakpointOverrideIndicator.tsx +1 -16
  748. package/corpus/templates/design/app/components/design/inspector/GlslShaderPanel.tsx +2 -34
  749. package/corpus/templates/design/app/components/design/inspector/ImageFillControls.tsx +2 -1
  750. package/corpus/templates/design/app/components/design/inspector/InteractionStatePanel.tsx +1 -25
  751. package/corpus/templates/design/app/components/design/inspector/MotionKeyframeDiamond.tsx +1 -30
  752. package/corpus/templates/design/app/components/design/inspector/ShaderFillsPanel.tsx +1 -1
  753. package/corpus/templates/design/app/components/design-system/ProductionDesignSystemShowcase.tsx +1 -1
  754. package/corpus/templates/design/app/components/editor/FigmaLinkComposerBubble.tsx +1 -1
  755. package/corpus/templates/design/app/components/editor/PromptDialog.tsx +3 -3
  756. package/corpus/templates/design/app/components/layout/Header.tsx +4 -4
  757. package/corpus/templates/design/app/components/layout/Layout.tsx +4 -5
  758. package/corpus/templates/design/app/components/layout/Sidebar.tsx +4 -6
  759. package/corpus/templates/design/app/components/visual-editor/CanvasCommentPins.tsx +1 -1
  760. package/corpus/templates/design/app/components/visual-editor/DrawOverlay.tsx +1 -1
  761. package/corpus/templates/design/app/components/visual-editor/NodeRewriteProposal.tsx +2 -2
  762. package/corpus/templates/design/app/components/visual-editor/ReviewCanvasPins.tsx +3 -4
  763. package/corpus/templates/design/app/components/visual-editor/SaveStatusIndicator.tsx +1 -1
  764. package/corpus/templates/design/app/hooks/use-agent-generating.ts +1 -1
  765. package/corpus/templates/design/app/hooks/use-design-system.ts +1 -1
  766. package/corpus/templates/design/app/hooks/use-design-systems.ts +1 -1
  767. package/corpus/templates/design/app/hooks/use-navigation-state.ts +2 -2
  768. package/corpus/templates/design/app/hooks/use-question-flow.ts +1 -1
  769. package/corpus/templates/design/app/i18n/index.ts +1 -1
  770. package/corpus/templates/design/app/i18n-data.ts +1 -1
  771. package/corpus/templates/design/app/i18n-keyboard-shortcuts.ts +1 -1
  772. package/corpus/templates/design/app/lib/agent-chat.ts +1 -1
  773. package/corpus/templates/design/app/lib/design-save-outbox.ts +1 -1
  774. package/corpus/templates/design/app/lib/desktop-design-preview.ts +1 -1
  775. package/corpus/templates/design/app/lib/figma-connection.ts +2 -1
  776. package/corpus/templates/design/app/lib/figma-svg-copy.ts +1 -1
  777. package/corpus/templates/design/app/lib/pending-generation.ts +1 -1
  778. package/corpus/templates/design/app/lib/utils.ts +1 -1
  779. package/corpus/templates/design/app/pages/DesignSystemSetup.tsx +4 -6
  780. package/corpus/templates/design/app/pages/DesignSystems.tsx +4 -4
  781. package/corpus/templates/design/app/pages/Index.tsx +5 -5
  782. package/corpus/templates/design/app/pages/NotFound.tsx +3 -5
  783. package/corpus/templates/design/app/pages/Present.tsx +7 -6
  784. package/corpus/templates/design/app/pages/Templates.tsx +4 -4
  785. package/corpus/templates/design/app/pages/VisualEdit.tsx +3 -1
  786. package/corpus/templates/design/app/pages/design-editor/editor-session.ts +1 -1
  787. package/corpus/templates/design/app/pages/design-editor/generation-prompt-directives.ts +1 -1
  788. package/corpus/templates/design/app/root.tsx +10 -9
  789. package/corpus/templates/design/app/routes/agent.tsx +2 -1
  790. package/corpus/templates/design/app/routes/observability.tsx +1 -1
  791. package/corpus/templates/design/app/routes/settings.tsx +4 -5
  792. package/corpus/templates/dispatch/.agents/skills/actions/SKILL.md +3 -3
  793. package/corpus/templates/dispatch/.agents/skills/delegate-to-agent/SKILL.md +3 -3
  794. package/corpus/templates/dispatch/.agents/skills/feature-flags/SKILL.md +1 -1
  795. package/corpus/templates/dispatch/.agents/skills/upgrade-agent-native/SKILL.md +12 -5
  796. package/corpus/templates/dispatch/app/hooks/use-navigation-state.ts +3 -4
  797. package/corpus/templates/dispatch/app/i18n/index.ts +1 -1
  798. package/corpus/templates/dispatch/app/i18n-data.ts +1 -1
  799. package/corpus/templates/dispatch/app/root.tsx +10 -9
  800. package/corpus/templates/dispatch/app/routes/agent.tsx +2 -1
  801. package/corpus/templates/dispatch/app/routes/integrations.tsx +3 -3
  802. package/corpus/templates/dispatch/app/routes/settings.tsx +4 -5
  803. package/corpus/templates/forms/.agents/skills/actions/SKILL.md +3 -3
  804. package/corpus/templates/forms/.agents/skills/delegate-to-agent/SKILL.md +3 -3
  805. package/corpus/templates/forms/.agents/skills/feature-flags/SKILL.md +1 -1
  806. package/corpus/templates/forms/.agents/skills/real-time-sync/SKILL.md +4 -4
  807. package/corpus/templates/forms/.agents/skills/storing-data/SKILL.md +1 -1
  808. package/corpus/templates/forms/.agents/skills/upgrade-agent-native/SKILL.md +12 -5
  809. package/corpus/templates/forms/app/components/CloudUpgrade.tsx +1 -1
  810. package/corpus/templates/forms/app/components/ThemeToggle.tsx +1 -1
  811. package/corpus/templates/forms/app/components/builder/FieldPropertiesPanel.tsx +1 -1
  812. package/corpus/templates/forms/app/components/layout/Header.tsx +2 -1
  813. package/corpus/templates/forms/app/components/layout/Layout.tsx +2 -2
  814. package/corpus/templates/forms/app/components/layout/Sidebar.tsx +5 -5
  815. package/corpus/templates/forms/app/hooks/use-db-status.ts +1 -1
  816. package/corpus/templates/forms/app/hooks/use-forms.ts +2 -2
  817. package/corpus/templates/forms/app/hooks/use-navigation-state.ts +3 -3
  818. package/corpus/templates/forms/app/hooks/use-responses.ts +1 -1
  819. package/corpus/templates/forms/app/i18n/index.ts +1 -1
  820. package/corpus/templates/forms/app/lib/utils.ts +1 -1
  821. package/corpus/templates/forms/app/pages/AskPage.tsx +2 -2
  822. package/corpus/templates/forms/app/pages/FormBuilderPage.tsx +5 -6
  823. package/corpus/templates/forms/app/pages/FormFillPage.tsx +2 -1
  824. package/corpus/templates/forms/app/pages/FormsListPage.tsx +3 -6
  825. package/corpus/templates/forms/app/pages/ResponseInsightsPage.tsx +1 -1
  826. package/corpus/templates/forms/app/pages/ResponsesPage.tsx +1 -1
  827. package/corpus/templates/forms/app/root.tsx +15 -12
  828. package/corpus/templates/forms/app/routes/_app.agent.tsx +2 -1
  829. package/corpus/templates/forms/app/routes/_app.settings.tsx +4 -5
  830. package/corpus/templates/forms/app/routes/_index.tsx +1 -1
  831. package/corpus/templates/forms/app/routes/form-preview.tsx +5 -1
  832. package/corpus/templates/macros/.agents/skills/feature-flags/SKILL.md +1 -1
  833. package/corpus/templates/macros/.agents/skills/upgrade-agent-native/SKILL.md +12 -5
  834. package/corpus/templates/macros/app/components/AddExerciseDialog.tsx +2 -1
  835. package/corpus/templates/macros/app/components/AddMealDialog.tsx +2 -1
  836. package/corpus/templates/macros/app/components/AddWeightDialog.tsx +2 -1
  837. package/corpus/templates/macros/app/components/DailyProgress.tsx +2 -1
  838. package/corpus/templates/macros/app/components/ExerciseCard.tsx +1 -1
  839. package/corpus/templates/macros/app/components/MealCard.tsx +1 -1
  840. package/corpus/templates/macros/app/components/QueryErrorState.tsx +1 -1
  841. package/corpus/templates/macros/app/components/VoiceDictation.tsx +2 -1
  842. package/corpus/templates/macros/app/components/WeeklyCaloriesChart.tsx +1 -1
  843. package/corpus/templates/macros/app/components/WeightCard.tsx +1 -1
  844. package/corpus/templates/macros/app/components/WeightTracker.tsx +2 -2
  845. package/corpus/templates/macros/app/components/layout/AppLayout.tsx +5 -8
  846. package/corpus/templates/macros/app/components/layout/Header.tsx +2 -1
  847. package/corpus/templates/macros/app/i18n/index.ts +1 -1
  848. package/corpus/templates/macros/app/lib/api.ts +1 -1
  849. package/corpus/templates/macros/app/lib/utils.ts +1 -1
  850. package/corpus/templates/macros/app/root.tsx +10 -9
  851. package/corpus/templates/macros/app/routes/_index.tsx +2 -2
  852. package/corpus/templates/macros/app/routes/agent.tsx +2 -1
  853. package/corpus/templates/macros/app/routes/analytics.tsx +2 -1
  854. package/corpus/templates/macros/app/routes/settings.tsx +4 -5
  855. package/corpus/templates/mail/.agents/skills/actions/SKILL.md +3 -3
  856. package/corpus/templates/mail/.agents/skills/delegate-to-agent/SKILL.md +3 -3
  857. package/corpus/templates/mail/.agents/skills/feature-flags/SKILL.md +1 -1
  858. package/corpus/templates/mail/.agents/skills/real-time-sync/SKILL.md +4 -4
  859. package/corpus/templates/mail/.agents/skills/storing-data/SKILL.md +1 -1
  860. package/corpus/templates/mail/.agents/skills/upgrade-agent-native/SKILL.md +12 -5
  861. package/corpus/templates/mail/app/components/GoogleConnectBanner.tsx +3 -3
  862. package/corpus/templates/mail/app/components/ThemeToggle.tsx +1 -1
  863. package/corpus/templates/mail/app/components/agent-engine-picker.tsx +2 -1
  864. package/corpus/templates/mail/app/components/email/AttachmentStrip.tsx +1 -1
  865. package/corpus/templates/mail/app/components/email/CodeBlockLangPicker.tsx +1 -1
  866. package/corpus/templates/mail/app/components/email/ComposeBubbleToolbar.tsx +1 -1
  867. package/corpus/templates/mail/app/components/email/ComposeEditor.tsx +1 -1
  868. package/corpus/templates/mail/app/components/email/ComposeModal.tsx +2 -1
  869. package/corpus/templates/mail/app/components/email/ComposeSlashMenu.tsx +1 -1
  870. package/corpus/templates/mail/app/components/email/EmailList.tsx +1 -1
  871. package/corpus/templates/mail/app/components/email/EmailListItem.tsx +1 -1
  872. package/corpus/templates/mail/app/components/email/EmailThread.tsx +2 -1
  873. package/corpus/templates/mail/app/components/email/InlineReplyComposer.tsx +2 -1
  874. package/corpus/templates/mail/app/components/email/IntegrationsSidebar.tsx +2 -1
  875. package/corpus/templates/mail/app/components/email/MobileActionBar.tsx +1 -1
  876. package/corpus/templates/mail/app/components/email/RecipientInput.tsx +1 -1
  877. package/corpus/templates/mail/app/components/email/SendLaterButton.tsx +1 -1
  878. package/corpus/templates/mail/app/components/email/SnoozeModal.tsx +1 -1
  879. package/corpus/templates/mail/app/components/email/SnoozePopover.tsx +1 -1
  880. package/corpus/templates/mail/app/components/email/extensions/ComposeImageBlock.tsx +1 -1
  881. package/corpus/templates/mail/app/components/layout/AppLayout.tsx +6 -6
  882. package/corpus/templates/mail/app/components/layout/CommandPalette.tsx +2 -1
  883. package/corpus/templates/mail/app/components/layout/SearchBar.tsx +1 -1
  884. package/corpus/templates/mail/app/components/settings/GmailFiltersSection.tsx +1 -1
  885. package/corpus/templates/mail/app/components/settings/SnippetsSection.tsx +1 -1
  886. package/corpus/templates/mail/app/entry.client.tsx +1 -6
  887. package/corpus/templates/mail/app/hooks/use-aliases.ts +1 -1
  888. package/corpus/templates/mail/app/hooks/use-apollo.ts +1 -1
  889. package/corpus/templates/mail/app/hooks/use-automations.ts +1 -1
  890. package/corpus/templates/mail/app/hooks/use-compose-state.ts +2 -2
  891. package/corpus/templates/mail/app/hooks/use-draft-queue.ts +4 -1
  892. package/corpus/templates/mail/app/hooks/use-emails.ts +3 -1
  893. package/corpus/templates/mail/app/hooks/use-gmail-filters.ts +1 -1
  894. package/corpus/templates/mail/app/hooks/use-google-auth.ts +2 -1
  895. package/corpus/templates/mail/app/hooks/use-integrations.ts +2 -2
  896. package/corpus/templates/mail/app/hooks/use-navigation-state.ts +1 -1
  897. package/corpus/templates/mail/app/hooks/use-scheduled-jobs.ts +2 -2
  898. package/corpus/templates/mail/app/hooks/use-snippets.ts +1 -1
  899. package/corpus/templates/mail/app/i18n/index.ts +1 -1
  900. package/corpus/templates/mail/app/lib/agent-generate.ts +1 -1
  901. package/corpus/templates/mail/app/lib/gmail-mutation-queue.ts +1 -10
  902. package/corpus/templates/mail/app/lib/mcp-chat-bridge.ts +1 -1
  903. package/corpus/templates/mail/app/lib/thread-cache.ts +1 -1
  904. package/corpus/templates/mail/app/lib/upload.ts +1 -1
  905. package/corpus/templates/mail/app/lib/utils.ts +1 -1
  906. package/corpus/templates/mail/app/pages/DraftQueuePage.tsx +1 -1
  907. package/corpus/templates/mail/app/pages/InboxPage.tsx +1 -1
  908. package/corpus/templates/mail/app/pages/NotFound.tsx +1 -1
  909. package/corpus/templates/mail/app/pages/SettingsPage.tsx +9 -8
  910. package/corpus/templates/mail/app/root.tsx +11 -8
  911. package/corpus/templates/mail/app/routes/agent.tsx +2 -1
  912. package/corpus/templates/mail/app/routes/email.tsx +5 -1
  913. package/corpus/templates/plan/.agents/skills/actions/SKILL.md +3 -3
  914. package/corpus/templates/plan/.agents/skills/adding-a-feature/SKILL.md +1 -1
  915. package/corpus/templates/plan/.agents/skills/delegate-to-agent/SKILL.md +3 -3
  916. package/corpus/templates/plan/.agents/skills/feature-flags/SKILL.md +1 -1
  917. package/corpus/templates/plan/.agents/skills/real-time-sync/SKILL.md +4 -4
  918. package/corpus/templates/plan/.agents/skills/upgrade-agent-native/SKILL.md +12 -5
  919. package/corpus/templates/plan/app/components/editor/PlanBlockNode.tsx +2 -2
  920. package/corpus/templates/plan/app/components/editor/PlanDocumentEditor.tsx +3 -3
  921. package/corpus/templates/plan/app/components/editor/planSlashCommands.ts +1 -1
  922. package/corpus/templates/plan/app/components/layout/Header.tsx +2 -1
  923. package/corpus/templates/plan/app/components/layout/Layout.tsx +2 -2
  924. package/corpus/templates/plan/app/components/layout/Sidebar.tsx +8 -9
  925. package/corpus/templates/plan/app/components/plan/CanvasArea.tsx +1 -1
  926. package/corpus/templates/plan/app/components/plan/DocumentArea.tsx +3 -5
  927. package/corpus/templates/plan/app/components/plan/GuestModeBanner.tsx +1 -1
  928. package/corpus/templates/plan/app/components/plan/LocalCodebasePicker.tsx +2 -1
  929. package/corpus/templates/plan/app/components/plan/PlanContentRenderer.tsx +7 -5
  930. package/corpus/templates/plan/app/components/plan/PlanImageNode.tsx +2 -1
  931. package/corpus/templates/plan/app/components/plan/PlanImageViewer.tsx +1 -1
  932. package/corpus/templates/plan/app/components/plan/PlanMarkdownEditor.tsx +3 -3
  933. package/corpus/templates/plan/app/components/plan/PlanMarkdownReader.tsx +1 -1
  934. package/corpus/templates/plan/app/components/plan/PlanTableOfContents.tsx +1 -1
  935. package/corpus/templates/plan/app/components/plan/PlanVisualSurface.tsx +1 -1
  936. package/corpus/templates/plan/app/components/plan/PrototypeViewer.tsx +1 -1
  937. package/corpus/templates/plan/app/components/plan/VisualAnswerInline.tsx +1 -1
  938. package/corpus/templates/plan/app/components/plan/planBlocks.tsx +3 -5
  939. package/corpus/templates/plan/app/components/plan/wireframe/LegacyRegionWireframe.tsx +1 -1
  940. package/corpus/templates/plan/app/components/plan/wireframe/Wireframe.tsx +1 -1
  941. package/corpus/templates/plan/app/hooks/use-navigation-state.ts +5 -3
  942. package/corpus/templates/plan/app/hooks/use-plan-presence.ts +2 -2
  943. package/corpus/templates/plan/app/hooks/use-plans.ts +4 -1
  944. package/corpus/templates/plan/app/i18n/ar-SA.ts +4 -0
  945. package/corpus/templates/plan/app/i18n/de-DE.ts +4 -0
  946. package/corpus/templates/plan/app/i18n/en-US.ts +4 -0
  947. package/corpus/templates/plan/app/i18n/es-ES.ts +4 -0
  948. package/corpus/templates/plan/app/i18n/fr-FR.ts +4 -0
  949. package/corpus/templates/plan/app/i18n/hi-IN.ts +4 -0
  950. package/corpus/templates/plan/app/i18n/index.ts +1 -1
  951. package/corpus/templates/plan/app/i18n/ja-JP.ts +4 -0
  952. package/corpus/templates/plan/app/i18n/ko-KR.ts +4 -0
  953. package/corpus/templates/plan/app/i18n/pt-BR.ts +4 -0
  954. package/corpus/templates/plan/app/i18n/zh-CN.ts +4 -0
  955. package/corpus/templates/plan/app/i18n/zh-TW.ts +4 -0
  956. package/corpus/templates/plan/app/lib/local-codebase-context.ts +1 -1
  957. package/corpus/templates/plan/app/lib/local-control-resources.ts +1 -1
  958. package/corpus/templates/plan/app/lib/plan-comment-editor-helpers.ts +1 -1
  959. package/corpus/templates/plan/app/lib/plan-local-bridge.ts +1 -1
  960. package/corpus/templates/plan/app/lib/register-chat-renderers.tsx +1 -1
  961. package/corpus/templates/plan/app/lib/utils.ts +1 -1
  962. package/corpus/templates/plan/app/pages/PlanChatPage.tsx +2 -2
  963. package/corpus/templates/plan/app/pages/PlansPage.tsx +13 -14
  964. package/corpus/templates/plan/app/root.tsx +11 -10
  965. package/corpus/templates/plan/app/routes/agent.tsx +2 -1
  966. package/corpus/templates/plan/app/routes/settings.tsx +4 -5
  967. package/corpus/templates/plan/shared/plan-doc.ts +2 -47
  968. package/corpus/templates/slides/.agents/skills/actions/SKILL.md +3 -3
  969. package/corpus/templates/slides/.agents/skills/delegate-to-agent/SKILL.md +3 -3
  970. package/corpus/templates/slides/.agents/skills/feature-flags/SKILL.md +1 -1
  971. package/corpus/templates/slides/.agents/skills/upgrade-agent-native/SKILL.md +12 -5
  972. package/corpus/templates/slides/app/components/CloudUpgrade.tsx +1 -1
  973. package/corpus/templates/slides/app/components/ThemeToggle.tsx +1 -1
  974. package/corpus/templates/slides/app/components/comments/SlideCommentsPanel.tsx +1 -1
  975. package/corpus/templates/slides/app/components/deck/DeckCard.tsx +2 -1
  976. package/corpus/templates/slides/app/components/deck/SlideRenderer.tsx +1 -1
  977. package/corpus/templates/slides/app/components/design-system/DesignSystemCard.tsx +2 -1
  978. package/corpus/templates/slides/app/components/design-system/DesignSystemPreview.tsx +1 -1
  979. package/corpus/templates/slides/app/components/design-system/DesignSystemSetup.tsx +5 -5
  980. package/corpus/templates/slides/app/components/editor/AnimationsPanel.tsx +1 -1
  981. package/corpus/templates/slides/app/components/editor/AssetLibraryPanel.tsx +2 -1
  982. package/corpus/templates/slides/app/components/editor/BlockBubbleMenu.tsx +1 -1
  983. package/corpus/templates/slides/app/components/editor/EditorSidebar.tsx +6 -6
  984. package/corpus/templates/slides/app/components/editor/EditorToolbar.tsx +6 -8
  985. package/corpus/templates/slides/app/components/editor/ExportMenu.tsx +2 -1
  986. package/corpus/templates/slides/app/components/editor/GenerateSlidesDialog.tsx +2 -1
  987. package/corpus/templates/slides/app/components/editor/GeneratingOverlay.tsx +1 -1
  988. package/corpus/templates/slides/app/components/editor/GoogleDocImportHint.tsx +3 -5
  989. package/corpus/templates/slides/app/components/editor/HistoryPanel.tsx +1 -1
  990. package/corpus/templates/slides/app/components/editor/ImageDropPromptPopover.tsx +3 -1
  991. package/corpus/templates/slides/app/components/editor/ImageGenPanel.tsx +1 -1
  992. package/corpus/templates/slides/app/components/editor/ImageOverlay.tsx +1 -1
  993. package/corpus/templates/slides/app/components/editor/ImageSearchPanel.tsx +2 -1
  994. package/corpus/templates/slides/app/components/editor/ImportButton.tsx +5 -1
  995. package/corpus/templates/slides/app/components/editor/LogoSearchPanel.tsx +2 -1
  996. package/corpus/templates/slides/app/components/editor/MermaidToExcalidrawPanel.tsx +1 -1
  997. package/corpus/templates/slides/app/components/editor/PromptDialog.tsx +3 -1
  998. package/corpus/templates/slides/app/components/editor/QuestionFlow.tsx +1 -1
  999. package/corpus/templates/slides/app/components/editor/ShareDialog.tsx +2 -1
  1000. package/corpus/templates/slides/app/components/editor/SlideBubbleMenu.tsx +1 -1
  1001. package/corpus/templates/slides/app/components/editor/SlideEditor.tsx +12 -8
  1002. package/corpus/templates/slides/app/components/editor/SlideInlineEditor.tsx +2 -1
  1003. package/corpus/templates/slides/app/components/editor/SlideSlashMenu.tsx +1 -1
  1004. package/corpus/templates/slides/app/components/editor/SlideStyleInspector.tsx +1 -1
  1005. package/corpus/templates/slides/app/components/editor/SpeakerNotesPanel.tsx +1 -1
  1006. package/corpus/templates/slides/app/components/editor/TweaksPanel.tsx +1 -1
  1007. package/corpus/templates/slides/app/components/layout/AgentWorkIndicator.tsx +2 -1
  1008. package/corpus/templates/slides/app/components/layout/Header.tsx +2 -1
  1009. package/corpus/templates/slides/app/components/layout/Layout.tsx +2 -1
  1010. package/corpus/templates/slides/app/components/layout/Sidebar.tsx +4 -6
  1011. package/corpus/templates/slides/app/components/presentation/PresentationView.tsx +1 -1
  1012. package/corpus/templates/slides/app/components/visual-editor/CanvasCommentPins.tsx +2 -1
  1013. package/corpus/templates/slides/app/components/visual-editor/DrawOverlay.tsx +1 -1
  1014. package/corpus/templates/slides/app/components/visual-editor/MultiSelectChip.tsx +1 -1
  1015. package/corpus/templates/slides/app/components/visual-editor/SaveStatusIndicator.tsx +1 -1
  1016. package/corpus/templates/slides/app/context/DeckContext.tsx +5 -3
  1017. package/corpus/templates/slides/app/entry.client.tsx +2 -4
  1018. package/corpus/templates/slides/app/hooks/use-agent-generating.ts +1 -1
  1019. package/corpus/templates/slides/app/hooks/use-db-status.ts +1 -1
  1020. package/corpus/templates/slides/app/hooks/use-deck-design-system.ts +1 -1
  1021. package/corpus/templates/slides/app/hooks/use-deck-presence.ts +1 -1
  1022. package/corpus/templates/slides/app/hooks/use-deck-role.ts +1 -1
  1023. package/corpus/templates/slides/app/hooks/use-deck-versions.ts +4 -1
  1024. package/corpus/templates/slides/app/hooks/use-design-systems.ts +1 -1
  1025. package/corpus/templates/slides/app/hooks/use-navigation-state.ts +1 -1
  1026. package/corpus/templates/slides/app/hooks/use-slide-comments.ts +2 -2
  1027. package/corpus/templates/slides/app/i18n/index.ts +1 -1
  1028. package/corpus/templates/slides/app/lib/utils.ts +1 -1
  1029. package/corpus/templates/slides/app/pages/DeckEditor.tsx +5 -6
  1030. package/corpus/templates/slides/app/pages/DesignSystems.tsx +2 -1
  1031. package/corpus/templates/slides/app/pages/Index.tsx +4 -7
  1032. package/corpus/templates/slides/app/pages/NotFound.tsx +1 -1
  1033. package/corpus/templates/slides/app/pages/Presentation.tsx +1 -1
  1034. package/corpus/templates/slides/app/pages/SharedPresentation.tsx +2 -1
  1035. package/corpus/templates/slides/app/root.tsx +13 -11
  1036. package/corpus/templates/slides/app/routes/agent.tsx +2 -1
  1037. package/corpus/templates/slides/app/routes/settings.tsx +4 -5
  1038. package/corpus/templates/slides/app/routes/slide.tsx +3 -3
  1039. package/corpus/templates/tasks/.agents/skills/actions/SKILL.md +3 -3
  1040. package/corpus/templates/tasks/.agents/skills/adding-a-feature/SKILL.md +1 -1
  1041. package/corpus/templates/tasks/.agents/skills/delegate-to-agent/SKILL.md +3 -3
  1042. package/corpus/templates/tasks/.agents/skills/feature-flags/SKILL.md +1 -1
  1043. package/corpus/templates/tasks/.agents/skills/real-time-sync/SKILL.md +4 -4
  1044. package/corpus/templates/tasks/.agents/skills/upgrade-agent-native/SKILL.md +12 -5
  1045. package/corpus/templates/tasks/app/components/custom-fields/FieldsList.tsx +1 -1
  1046. package/corpus/templates/tasks/app/components/layout/Header.tsx +1 -1
  1047. package/corpus/templates/tasks/app/components/layout/Layout.tsx +4 -1
  1048. package/corpus/templates/tasks/app/components/layout/Sidebar.tsx +2 -1
  1049. package/corpus/templates/tasks/app/components/shared/ListViewHeader.tsx +1 -1
  1050. package/corpus/templates/tasks/app/components/tasks/TaskList.tsx +1 -1
  1051. package/corpus/templates/tasks/app/hooks/use-custom-fields.ts +4 -1
  1052. package/corpus/templates/tasks/app/hooks/use-inbox-items.ts +4 -1
  1053. package/corpus/templates/tasks/app/hooks/use-navigation-state.ts +2 -1
  1054. package/corpus/templates/tasks/app/hooks/use-tasks.ts +4 -1
  1055. package/corpus/templates/tasks/app/hooks/use-visible-task-fields.ts +4 -1
  1056. package/corpus/templates/tasks/app/lib/utils.ts +1 -1
  1057. package/corpus/templates/tasks/app/root.tsx +9 -7
  1058. package/dist/cli/doctor.d.ts +4 -1
  1059. package/dist/cli/doctor.d.ts.map +1 -1
  1060. package/dist/cli/doctor.js +57 -5
  1061. package/dist/cli/doctor.js.map +1 -1
  1062. package/dist/cli/migration-codemod.d.ts +21 -0
  1063. package/dist/cli/migration-codemod.d.ts.map +1 -0
  1064. package/dist/cli/migration-codemod.js +363 -0
  1065. package/dist/cli/migration-codemod.js.map +1 -0
  1066. package/dist/cli/upgrade.d.ts +7 -0
  1067. package/dist/cli/upgrade.d.ts.map +1 -1
  1068. package/dist/cli/upgrade.js +52 -7
  1069. package/dist/cli/upgrade.js.map +1 -1
  1070. package/dist/client/agent-chat/index.d.ts +40 -0
  1071. package/dist/client/agent-chat/index.d.ts.map +1 -0
  1072. package/dist/client/agent-chat/index.js +39 -0
  1073. package/dist/client/agent-chat/index.js.map +1 -0
  1074. package/dist/client/agent-page/AgentContextTab.d.ts.map +1 -1
  1075. package/dist/client/agent-page/AgentContextTab.js +3 -1
  1076. package/dist/client/agent-page/AgentContextTab.js.map +1 -1
  1077. package/dist/client/analytics/index.d.ts +3 -0
  1078. package/dist/client/analytics/index.d.ts.map +1 -0
  1079. package/dist/client/analytics/index.js +3 -0
  1080. package/dist/client/analytics/index.js.map +1 -0
  1081. package/dist/client/api-path.js +2 -2
  1082. package/dist/client/api-path.js.map +1 -1
  1083. package/dist/client/automation/index.d.ts +2 -0
  1084. package/dist/client/automation/index.d.ts.map +1 -0
  1085. package/dist/client/automation/index.js +2 -0
  1086. package/dist/client/automation/index.js.map +1 -0
  1087. package/dist/client/changelog/index.d.ts +2 -0
  1088. package/dist/client/changelog/index.d.ts.map +1 -0
  1089. package/dist/client/changelog/index.js +2 -0
  1090. package/dist/client/changelog/index.js.map +1 -0
  1091. package/dist/client/chat/widgets/InlineExtensionWidget.d.ts +1 -12
  1092. package/dist/client/chat/widgets/InlineExtensionWidget.d.ts.map +1 -1
  1093. package/dist/client/chat/widgets/InlineExtensionWidget.js +2 -66
  1094. package/dist/client/chat/widgets/InlineExtensionWidget.js.map +1 -1
  1095. package/dist/client/chat/widgets/builtin-tool-renderers.d.ts.map +1 -1
  1096. package/dist/client/chat/widgets/builtin-tool-renderers.js +21 -8
  1097. package/dist/client/chat/widgets/builtin-tool-renderers.js.map +1 -1
  1098. package/dist/client/chat/widgets/inline-extension-result.d.ts +14 -0
  1099. package/dist/client/chat/widgets/inline-extension-result.d.ts.map +1 -0
  1100. package/dist/client/chat/widgets/inline-extension-result.js +67 -0
  1101. package/dist/client/chat/widgets/inline-extension-result.js.map +1 -0
  1102. package/dist/client/client-bootstrap.d.ts +2 -0
  1103. package/dist/client/client-bootstrap.d.ts.map +1 -0
  1104. package/dist/client/client-bootstrap.js +7 -0
  1105. package/dist/client/client-bootstrap.js.map +1 -0
  1106. package/dist/client/context-xray/ContextXRayPanel.js +1 -1
  1107. package/dist/client/context-xray/ContextXRayPanel.js.map +1 -1
  1108. package/dist/client/hooks/index.d.ts +13 -0
  1109. package/dist/client/hooks/index.d.ts.map +1 -0
  1110. package/dist/client/hooks/index.js +13 -0
  1111. package/dist/client/hooks/index.js.map +1 -0
  1112. package/dist/client/host/index.d.ts +20 -0
  1113. package/dist/client/host/index.d.ts.map +1 -0
  1114. package/dist/client/host/index.js +18 -0
  1115. package/dist/client/host/index.js.map +1 -0
  1116. package/dist/client/index.d.ts +19 -100
  1117. package/dist/client/index.d.ts.map +1 -1
  1118. package/dist/client/index.js +19 -106
  1119. package/dist/client/index.js.map +1 -1
  1120. package/dist/client/navigation/index.d.ts +6 -0
  1121. package/dist/client/navigation/index.d.ts.map +1 -0
  1122. package/dist/client/navigation/index.js +6 -0
  1123. package/dist/client/navigation/index.js.map +1 -0
  1124. package/dist/client/resources/ResourcesPanel.d.ts.map +1 -1
  1125. package/dist/client/resources/ResourcesPanel.js +2 -1
  1126. package/dist/client/resources/ResourcesPanel.js.map +1 -1
  1127. package/dist/client/resources/index.d.ts +2 -1
  1128. package/dist/client/resources/index.d.ts.map +1 -1
  1129. package/dist/client/resources/index.js +1 -0
  1130. package/dist/client/resources/index.js.map +1 -1
  1131. package/dist/client/resources/use-resources.d.ts +0 -1
  1132. package/dist/client/resources/use-resources.d.ts.map +1 -1
  1133. package/dist/client/resources/use-resources.js +0 -17
  1134. package/dist/client/resources/use-resources.js.map +1 -1
  1135. package/dist/client/route-chunk-recovery/index.d.ts +2 -0
  1136. package/dist/client/route-chunk-recovery/index.d.ts.map +1 -0
  1137. package/dist/client/route-chunk-recovery/index.js +2 -0
  1138. package/dist/client/route-chunk-recovery/index.js.map +1 -0
  1139. package/dist/client/ui/index.d.ts +18 -0
  1140. package/dist/client/ui/index.d.ts.map +1 -0
  1141. package/dist/client/ui/index.js +18 -0
  1142. package/dist/client/ui/index.js.map +1 -0
  1143. package/dist/client/uploads/index.d.ts +2 -0
  1144. package/dist/client/uploads/index.d.ts.map +1 -0
  1145. package/dist/client/uploads/index.js +2 -0
  1146. package/dist/client/uploads/index.js.map +1 -0
  1147. package/dist/client/uploads/use-upload-resource.d.ts +3 -0
  1148. package/dist/client/uploads/use-upload-resource.d.ts.map +1 -0
  1149. package/dist/client/uploads/use-upload-resource.js +20 -0
  1150. package/dist/client/uploads/use-upload-resource.js.map +1 -0
  1151. package/dist/client/widgets/index.d.ts +3 -0
  1152. package/dist/client/widgets/index.d.ts.map +1 -0
  1153. package/dist/client/widgets/index.js +3 -0
  1154. package/dist/client/widgets/index.js.map +1 -0
  1155. package/dist/collab/awareness.d.ts +2 -2
  1156. package/dist/collab/awareness.d.ts.map +1 -1
  1157. package/dist/collab/routes.d.ts +1 -1
  1158. package/dist/collab/struct-routes.d.ts +1 -1
  1159. package/dist/localization/default-messages.d.ts +2 -1
  1160. package/dist/localization/default-messages.d.ts.map +1 -1
  1161. package/dist/localization/default-messages.js +2 -1
  1162. package/dist/localization/default-messages.js.map +1 -1
  1163. package/dist/notifications/routes.d.ts +3 -3
  1164. package/dist/observability/routes.d.ts +1 -1
  1165. package/dist/package-lifecycle/deprecated-imports.d.ts +15 -0
  1166. package/dist/package-lifecycle/deprecated-imports.d.ts.map +1 -0
  1167. package/dist/package-lifecycle/deprecated-imports.js +141 -0
  1168. package/dist/package-lifecycle/deprecated-imports.js.map +1 -0
  1169. package/dist/package-lifecycle/index.d.ts +5 -0
  1170. package/dist/package-lifecycle/index.d.ts.map +1 -1
  1171. package/dist/package-lifecycle/index.js +5 -0
  1172. package/dist/package-lifecycle/index.js.map +1 -1
  1173. package/dist/package-lifecycle/migration-manifest.d.ts +28 -0
  1174. package/dist/package-lifecycle/migration-manifest.d.ts.map +1 -0
  1175. package/dist/package-lifecycle/migration-manifest.js +102 -0
  1176. package/dist/package-lifecycle/migration-manifest.js.map +1 -0
  1177. package/dist/package-lifecycle/migration-message.d.ts +3 -0
  1178. package/dist/package-lifecycle/migration-message.d.ts.map +1 -0
  1179. package/dist/package-lifecycle/migration-message.js +5 -0
  1180. package/dist/package-lifecycle/migration-message.js.map +1 -0
  1181. package/dist/package-lifecycle/tombstone.d.ts +10 -0
  1182. package/dist/package-lifecycle/tombstone.d.ts.map +1 -0
  1183. package/dist/package-lifecycle/tombstone.js +23 -0
  1184. package/dist/package-lifecycle/tombstone.js.map +1 -0
  1185. package/dist/package-lifecycle/upgrade-error.d.ts +11 -0
  1186. package/dist/package-lifecycle/upgrade-error.d.ts.map +1 -0
  1187. package/dist/package-lifecycle/upgrade-error.js +11 -0
  1188. package/dist/package-lifecycle/upgrade-error.js.map +1 -0
  1189. package/dist/progress/routes.d.ts +1 -1
  1190. package/dist/resources/handlers.d.ts +1 -1
  1191. package/dist/secrets/routes.d.ts +9 -9
  1192. package/dist/server/agent-engine-api-key-route.d.ts +1 -1
  1193. package/dist/server/transcribe-voice.d.ts +1 -1
  1194. package/dist/templates/chat/.agents/skills/actions/SKILL.md +3 -3
  1195. package/dist/templates/chat/.agents/skills/adding-a-feature/SKILL.md +1 -1
  1196. package/dist/templates/chat/.agents/skills/delegate-to-agent/SKILL.md +3 -3
  1197. package/dist/templates/chat/.agents/skills/feature-flags/SKILL.md +1 -1
  1198. package/dist/templates/chat/.agents/skills/real-time-sync/SKILL.md +4 -4
  1199. package/dist/templates/chat/.agents/skills/upgrade-agent-native/SKILL.md +12 -5
  1200. package/dist/templates/chat/app/components/layout/Header.tsx +2 -1
  1201. package/dist/templates/chat/app/components/layout/Layout.tsx +2 -2
  1202. package/dist/templates/chat/app/components/layout/Sidebar.tsx +4 -4
  1203. package/dist/templates/chat/app/hooks/use-navigation-state.ts +3 -4
  1204. package/dist/templates/chat/app/i18n/index.ts +1 -1
  1205. package/dist/templates/chat/app/i18n-data.ts +1 -1
  1206. package/dist/templates/chat/app/lib/utils.ts +1 -1
  1207. package/dist/templates/chat/app/root.tsx +10 -9
  1208. package/dist/templates/chat/app/routes/_index.tsx +2 -2
  1209. package/dist/templates/chat/app/routes/agent.tsx +10 -3
  1210. package/dist/templates/chat/app/routes/database.tsx +1 -1
  1211. package/dist/templates/chat/app/routes/observability.tsx +2 -1
  1212. package/dist/templates/chat/app/routes/settings.tsx +4 -5
  1213. package/dist/templates/default/.agents/skills/actions/SKILL.md +3 -3
  1214. package/dist/templates/default/.agents/skills/adding-a-feature/SKILL.md +1 -1
  1215. package/dist/templates/default/.agents/skills/delegate-to-agent/SKILL.md +3 -3
  1216. package/dist/templates/default/.agents/skills/feature-flags/SKILL.md +1 -1
  1217. package/dist/templates/default/.agents/skills/real-time-collab/SKILL.md +4 -4
  1218. package/dist/templates/default/.agents/skills/real-time-sync/SKILL.md +4 -4
  1219. package/dist/templates/default/.agents/skills/storing-data/SKILL.md +1 -1
  1220. package/dist/templates/default/.agents/skills/upgrade-agent-native/SKILL.md +12 -5
  1221. package/dist/templates/default/app/hooks/use-navigation-state.ts +2 -5
  1222. package/dist/templates/default/app/i18n/index.ts +1 -1
  1223. package/dist/templates/default/app/lib/utils.ts +1 -1
  1224. package/dist/templates/default/app/root.tsx +8 -6
  1225. package/dist/templates/default/app/routes/_index.tsx +2 -1
  1226. package/dist/templates/default/app/routes/agent.tsx +2 -1
  1227. package/dist/templates/default/app/routes/settings.tsx +2 -3
  1228. package/dist/templates/headless/.agents/skills/feature-flags/SKILL.md +1 -1
  1229. package/dist/templates/headless/.agents/skills/upgrade-agent-native/SKILL.md +12 -5
  1230. package/dist/templates/workspace-core/.agents/skills/actions/SKILL.md +3 -3
  1231. package/dist/templates/workspace-core/.agents/skills/adding-a-feature/SKILL.md +1 -1
  1232. package/dist/templates/workspace-core/.agents/skills/authentication/SKILL.md +1 -1
  1233. package/dist/templates/workspace-core/.agents/skills/changelog/SKILL.md +1 -1
  1234. package/dist/templates/workspace-core/.agents/skills/client-methods/SKILL.md +10 -10
  1235. package/dist/templates/workspace-core/.agents/skills/context-awareness/SKILL.md +1 -1
  1236. package/dist/templates/workspace-core/.agents/skills/delegate-to-agent/SKILL.md +3 -3
  1237. package/dist/templates/workspace-core/.agents/skills/feature-flags/SKILL.md +1 -1
  1238. package/dist/templates/workspace-core/.agents/skills/observability/SKILL.md +1 -1
  1239. package/dist/templates/workspace-core/.agents/skills/real-time-collab/SKILL.md +4 -4
  1240. package/dist/templates/workspace-core/.agents/skills/real-time-sync/SKILL.md +4 -4
  1241. package/dist/templates/workspace-core/.agents/skills/sharing/SKILL.md +1 -1
  1242. package/dist/templates/workspace-core/.agents/skills/storing-data/SKILL.md +1 -1
  1243. package/dist/templates/workspace-core/.agents/skills/upgrade-agent-native/SKILL.md +12 -5
  1244. package/dist/vite/action-types-plugin.d.ts.map +1 -1
  1245. package/dist/vite/action-types-plugin.js +4 -0
  1246. package/dist/vite/action-types-plugin.js.map +1 -1
  1247. package/dist/vite/client.d.ts.map +1 -1
  1248. package/dist/vite/client.js +35 -64
  1249. package/dist/vite/client.js.map +1 -1
  1250. package/docs/content/actions.mdx +2 -4
  1251. package/docs/content/agent-surfaces.mdx +2 -4
  1252. package/docs/content/audit-log.mdx +1 -2
  1253. package/docs/content/authentication.mdx +3 -2
  1254. package/docs/content/client.mdx +19 -18
  1255. package/docs/content/components.mdx +1 -1
  1256. package/docs/content/context-awareness.mdx +4 -7
  1257. package/docs/content/creating-templates.mdx +7 -5
  1258. package/docs/content/doctor.mdx +27 -6
  1259. package/docs/content/drop-in-agent.mdx +6 -11
  1260. package/docs/content/embedding-sdk.mdx +8 -10
  1261. package/docs/content/getting-started.mdx +4 -2
  1262. package/docs/content/internationalization.mdx +9 -6
  1263. package/docs/content/key-concepts.mdx +2 -4
  1264. package/docs/content/locales/ar-SA/actions.mdx +2 -4
  1265. package/docs/content/locales/ar-SA/agent-surfaces.mdx +2 -4
  1266. package/docs/content/locales/ar-SA/audit-log.mdx +1 -2
  1267. package/docs/content/locales/ar-SA/authentication.mdx +3 -2
  1268. package/docs/content/locales/ar-SA/client.mdx +19 -18
  1269. package/docs/content/locales/ar-SA/components.mdx +1 -1
  1270. package/docs/content/locales/ar-SA/context-awareness.mdx +4 -7
  1271. package/docs/content/locales/ar-SA/creating-templates.mdx +7 -5
  1272. package/docs/content/locales/ar-SA/doctor.mdx +10 -0
  1273. package/docs/content/locales/ar-SA/drop-in-agent.mdx +6 -11
  1274. package/docs/content/locales/ar-SA/embedding-sdk.mdx +8 -10
  1275. package/docs/content/locales/ar-SA/internationalization.mdx +9 -6
  1276. package/docs/content/locales/ar-SA/key-concepts.mdx +2 -4
  1277. package/docs/content/locales/ar-SA/observability.mdx +1 -2
  1278. package/docs/content/locales/ar-SA/package-lifecycle.mdx +6 -0
  1279. package/docs/content/locales/ar-SA/real-time-collaboration.mdx +4 -7
  1280. package/docs/content/locales/ar-SA/sharing.mdx +1 -2
  1281. package/docs/content/locales/ar-SA/template-chat.mdx +1 -2
  1282. package/docs/content/locales/ar-SA/tracking.mdx +2 -4
  1283. package/docs/content/locales/ar-SA/what-is-agent-native.mdx +1 -2
  1284. package/docs/content/locales/de-DE/actions.mdx +2 -4
  1285. package/docs/content/locales/de-DE/agent-surfaces.mdx +2 -4
  1286. package/docs/content/locales/de-DE/audit-log.mdx +1 -2
  1287. package/docs/content/locales/de-DE/authentication.mdx +3 -2
  1288. package/docs/content/locales/de-DE/client.mdx +19 -18
  1289. package/docs/content/locales/de-DE/components.mdx +1 -1
  1290. package/docs/content/locales/de-DE/context-awareness.mdx +4 -7
  1291. package/docs/content/locales/de-DE/creating-templates.mdx +7 -5
  1292. package/docs/content/locales/de-DE/doctor.mdx +10 -0
  1293. package/docs/content/locales/de-DE/drop-in-agent.mdx +6 -11
  1294. package/docs/content/locales/de-DE/embedding-sdk.mdx +8 -10
  1295. package/docs/content/locales/de-DE/internationalization.mdx +9 -6
  1296. package/docs/content/locales/de-DE/key-concepts.mdx +2 -4
  1297. package/docs/content/locales/de-DE/observability.mdx +1 -2
  1298. package/docs/content/locales/de-DE/package-lifecycle.mdx +6 -0
  1299. package/docs/content/locales/de-DE/real-time-collaboration.mdx +4 -7
  1300. package/docs/content/locales/de-DE/sharing.mdx +1 -2
  1301. package/docs/content/locales/de-DE/template-chat.mdx +1 -2
  1302. package/docs/content/locales/de-DE/tracking.mdx +2 -4
  1303. package/docs/content/locales/de-DE/what-is-agent-native.mdx +1 -2
  1304. package/docs/content/locales/es-ES/actions.mdx +2 -4
  1305. package/docs/content/locales/es-ES/agent-surfaces.mdx +2 -4
  1306. package/docs/content/locales/es-ES/audit-log.mdx +1 -2
  1307. package/docs/content/locales/es-ES/authentication.mdx +3 -2
  1308. package/docs/content/locales/es-ES/client.mdx +19 -18
  1309. package/docs/content/locales/es-ES/components.mdx +1 -1
  1310. package/docs/content/locales/es-ES/context-awareness.mdx +4 -7
  1311. package/docs/content/locales/es-ES/creating-templates.mdx +7 -5
  1312. package/docs/content/locales/es-ES/doctor.mdx +10 -0
  1313. package/docs/content/locales/es-ES/drop-in-agent.mdx +6 -11
  1314. package/docs/content/locales/es-ES/embedding-sdk.mdx +8 -10
  1315. package/docs/content/locales/es-ES/internationalization.mdx +9 -6
  1316. package/docs/content/locales/es-ES/key-concepts.mdx +2 -4
  1317. package/docs/content/locales/es-ES/observability.mdx +1 -2
  1318. package/docs/content/locales/es-ES/package-lifecycle.mdx +6 -0
  1319. package/docs/content/locales/es-ES/real-time-collaboration.mdx +4 -7
  1320. package/docs/content/locales/es-ES/sharing.mdx +1 -2
  1321. package/docs/content/locales/es-ES/template-chat.mdx +1 -2
  1322. package/docs/content/locales/es-ES/tracking.mdx +2 -4
  1323. package/docs/content/locales/es-ES/what-is-agent-native.mdx +1 -2
  1324. package/docs/content/locales/fr-FR/actions.mdx +2 -4
  1325. package/docs/content/locales/fr-FR/agent-surfaces.mdx +2 -4
  1326. package/docs/content/locales/fr-FR/audit-log.mdx +1 -2
  1327. package/docs/content/locales/fr-FR/authentication.mdx +3 -2
  1328. package/docs/content/locales/fr-FR/client.mdx +19 -18
  1329. package/docs/content/locales/fr-FR/components.mdx +1 -1
  1330. package/docs/content/locales/fr-FR/context-awareness.mdx +4 -7
  1331. package/docs/content/locales/fr-FR/creating-templates.mdx +7 -5
  1332. package/docs/content/locales/fr-FR/doctor.mdx +10 -0
  1333. package/docs/content/locales/fr-FR/drop-in-agent.mdx +6 -11
  1334. package/docs/content/locales/fr-FR/embedding-sdk.mdx +8 -10
  1335. package/docs/content/locales/fr-FR/internationalization.mdx +9 -6
  1336. package/docs/content/locales/fr-FR/key-concepts.mdx +2 -4
  1337. package/docs/content/locales/fr-FR/observability.mdx +1 -2
  1338. package/docs/content/locales/fr-FR/package-lifecycle.mdx +6 -0
  1339. package/docs/content/locales/fr-FR/real-time-collaboration.mdx +4 -7
  1340. package/docs/content/locales/fr-FR/sharing.mdx +1 -2
  1341. package/docs/content/locales/fr-FR/template-chat.mdx +1 -2
  1342. package/docs/content/locales/fr-FR/tracking.mdx +2 -4
  1343. package/docs/content/locales/fr-FR/what-is-agent-native.mdx +1 -2
  1344. package/docs/content/locales/hi-IN/actions.mdx +2 -4
  1345. package/docs/content/locales/hi-IN/agent-surfaces.mdx +2 -4
  1346. package/docs/content/locales/hi-IN/audit-log.mdx +1 -2
  1347. package/docs/content/locales/hi-IN/authentication.mdx +3 -2
  1348. package/docs/content/locales/hi-IN/client.mdx +19 -18
  1349. package/docs/content/locales/hi-IN/components.mdx +1 -1
  1350. package/docs/content/locales/hi-IN/context-awareness.mdx +4 -7
  1351. package/docs/content/locales/hi-IN/creating-templates.mdx +7 -5
  1352. package/docs/content/locales/hi-IN/doctor.mdx +10 -0
  1353. package/docs/content/locales/hi-IN/drop-in-agent.mdx +6 -11
  1354. package/docs/content/locales/hi-IN/embedding-sdk.mdx +8 -10
  1355. package/docs/content/locales/hi-IN/internationalization.mdx +9 -6
  1356. package/docs/content/locales/hi-IN/key-concepts.mdx +2 -4
  1357. package/docs/content/locales/hi-IN/observability.mdx +1 -2
  1358. package/docs/content/locales/hi-IN/package-lifecycle.mdx +6 -0
  1359. package/docs/content/locales/hi-IN/real-time-collaboration.mdx +4 -7
  1360. package/docs/content/locales/hi-IN/sharing.mdx +1 -2
  1361. package/docs/content/locales/hi-IN/template-chat.mdx +1 -2
  1362. package/docs/content/locales/hi-IN/tracking.mdx +2 -4
  1363. package/docs/content/locales/hi-IN/what-is-agent-native.mdx +1 -2
  1364. package/docs/content/locales/ja-JP/actions.mdx +2 -4
  1365. package/docs/content/locales/ja-JP/agent-surfaces.mdx +2 -4
  1366. package/docs/content/locales/ja-JP/audit-log.mdx +1 -2
  1367. package/docs/content/locales/ja-JP/authentication.mdx +3 -2
  1368. package/docs/content/locales/ja-JP/client.mdx +19 -18
  1369. package/docs/content/locales/ja-JP/components.mdx +1 -1
  1370. package/docs/content/locales/ja-JP/context-awareness.mdx +4 -7
  1371. package/docs/content/locales/ja-JP/creating-templates.mdx +7 -5
  1372. package/docs/content/locales/ja-JP/doctor.mdx +10 -0
  1373. package/docs/content/locales/ja-JP/drop-in-agent.mdx +6 -11
  1374. package/docs/content/locales/ja-JP/embedding-sdk.mdx +8 -10
  1375. package/docs/content/locales/ja-JP/internationalization.mdx +9 -6
  1376. package/docs/content/locales/ja-JP/key-concepts.mdx +2 -4
  1377. package/docs/content/locales/ja-JP/observability.mdx +1 -2
  1378. package/docs/content/locales/ja-JP/package-lifecycle.mdx +6 -0
  1379. package/docs/content/locales/ja-JP/real-time-collaboration.mdx +4 -7
  1380. package/docs/content/locales/ja-JP/sharing.mdx +1 -2
  1381. package/docs/content/locales/ja-JP/template-chat.mdx +1 -2
  1382. package/docs/content/locales/ja-JP/tracking.mdx +2 -4
  1383. package/docs/content/locales/ja-JP/what-is-agent-native.mdx +1 -2
  1384. package/docs/content/locales/ko-KR/actions.mdx +2 -4
  1385. package/docs/content/locales/ko-KR/agent-surfaces.mdx +2 -4
  1386. package/docs/content/locales/ko-KR/audit-log.mdx +1 -2
  1387. package/docs/content/locales/ko-KR/authentication.mdx +3 -2
  1388. package/docs/content/locales/ko-KR/client.mdx +19 -18
  1389. package/docs/content/locales/ko-KR/components.mdx +1 -1
  1390. package/docs/content/locales/ko-KR/context-awareness.mdx +4 -7
  1391. package/docs/content/locales/ko-KR/creating-templates.mdx +7 -5
  1392. package/docs/content/locales/ko-KR/doctor.mdx +10 -0
  1393. package/docs/content/locales/ko-KR/drop-in-agent.mdx +6 -11
  1394. package/docs/content/locales/ko-KR/embedding-sdk.mdx +8 -10
  1395. package/docs/content/locales/ko-KR/internationalization.mdx +9 -6
  1396. package/docs/content/locales/ko-KR/key-concepts.mdx +2 -4
  1397. package/docs/content/locales/ko-KR/observability.mdx +1 -2
  1398. package/docs/content/locales/ko-KR/package-lifecycle.mdx +6 -0
  1399. package/docs/content/locales/ko-KR/real-time-collaboration.mdx +4 -7
  1400. package/docs/content/locales/ko-KR/sharing.mdx +1 -2
  1401. package/docs/content/locales/ko-KR/template-chat.mdx +1 -2
  1402. package/docs/content/locales/ko-KR/tracking.mdx +2 -4
  1403. package/docs/content/locales/ko-KR/what-is-agent-native.mdx +1 -2
  1404. package/docs/content/locales/pt-BR/actions.mdx +2 -4
  1405. package/docs/content/locales/pt-BR/agent-surfaces.mdx +2 -4
  1406. package/docs/content/locales/pt-BR/audit-log.mdx +1 -2
  1407. package/docs/content/locales/pt-BR/authentication.mdx +3 -2
  1408. package/docs/content/locales/pt-BR/client.mdx +19 -18
  1409. package/docs/content/locales/pt-BR/components.mdx +1 -1
  1410. package/docs/content/locales/pt-BR/context-awareness.mdx +4 -7
  1411. package/docs/content/locales/pt-BR/creating-templates.mdx +7 -5
  1412. package/docs/content/locales/pt-BR/doctor.mdx +10 -0
  1413. package/docs/content/locales/pt-BR/drop-in-agent.mdx +6 -11
  1414. package/docs/content/locales/pt-BR/embedding-sdk.mdx +8 -10
  1415. package/docs/content/locales/pt-BR/internationalization.mdx +9 -6
  1416. package/docs/content/locales/pt-BR/key-concepts.mdx +2 -4
  1417. package/docs/content/locales/pt-BR/observability.mdx +1 -2
  1418. package/docs/content/locales/pt-BR/package-lifecycle.mdx +6 -0
  1419. package/docs/content/locales/pt-BR/real-time-collaboration.mdx +4 -7
  1420. package/docs/content/locales/pt-BR/sharing.mdx +1 -2
  1421. package/docs/content/locales/pt-BR/template-chat.mdx +1 -2
  1422. package/docs/content/locales/pt-BR/tracking.mdx +2 -4
  1423. package/docs/content/locales/pt-BR/what-is-agent-native.mdx +1 -2
  1424. package/docs/content/locales/zh-CN/actions.mdx +2 -4
  1425. package/docs/content/locales/zh-CN/agent-surfaces.mdx +2 -4
  1426. package/docs/content/locales/zh-CN/audit-log.mdx +1 -2
  1427. package/docs/content/locales/zh-CN/authentication.mdx +3 -2
  1428. package/docs/content/locales/zh-CN/client.mdx +19 -18
  1429. package/docs/content/locales/zh-CN/components.mdx +1 -1
  1430. package/docs/content/locales/zh-CN/context-awareness.mdx +4 -7
  1431. package/docs/content/locales/zh-CN/creating-templates.mdx +7 -5
  1432. package/docs/content/locales/zh-CN/doctor.mdx +10 -0
  1433. package/docs/content/locales/zh-CN/drop-in-agent.mdx +6 -11
  1434. package/docs/content/locales/zh-CN/embedding-sdk.mdx +8 -10
  1435. package/docs/content/locales/zh-CN/internationalization.mdx +9 -6
  1436. package/docs/content/locales/zh-CN/key-concepts.mdx +2 -4
  1437. package/docs/content/locales/zh-CN/observability.mdx +1 -2
  1438. package/docs/content/locales/zh-CN/package-lifecycle.mdx +6 -0
  1439. package/docs/content/locales/zh-CN/real-time-collaboration.mdx +4 -7
  1440. package/docs/content/locales/zh-CN/sharing.mdx +1 -2
  1441. package/docs/content/locales/zh-CN/template-chat.mdx +1 -2
  1442. package/docs/content/locales/zh-CN/tracking.mdx +2 -4
  1443. package/docs/content/locales/zh-CN/what-is-agent-native.mdx +1 -2
  1444. package/docs/content/locales/zh-TW/actions.mdx +2 -4
  1445. package/docs/content/locales/zh-TW/agent-surfaces.mdx +2 -4
  1446. package/docs/content/locales/zh-TW/audit-log.mdx +1 -2
  1447. package/docs/content/locales/zh-TW/authentication.mdx +3 -2
  1448. package/docs/content/locales/zh-TW/client.mdx +19 -18
  1449. package/docs/content/locales/zh-TW/components.mdx +1 -1
  1450. package/docs/content/locales/zh-TW/context-awareness.mdx +4 -7
  1451. package/docs/content/locales/zh-TW/creating-templates.mdx +7 -5
  1452. package/docs/content/locales/zh-TW/doctor.mdx +10 -0
  1453. package/docs/content/locales/zh-TW/drop-in-agent.mdx +6 -11
  1454. package/docs/content/locales/zh-TW/embedding-sdk.mdx +8 -10
  1455. package/docs/content/locales/zh-TW/internationalization.mdx +9 -6
  1456. package/docs/content/locales/zh-TW/key-concepts.mdx +2 -4
  1457. package/docs/content/locales/zh-TW/observability.mdx +1 -2
  1458. package/docs/content/locales/zh-TW/package-lifecycle.mdx +6 -0
  1459. package/docs/content/locales/zh-TW/real-time-collaboration.mdx +4 -7
  1460. package/docs/content/locales/zh-TW/sharing.mdx +1 -2
  1461. package/docs/content/locales/zh-TW/template-chat.mdx +1 -2
  1462. package/docs/content/locales/zh-TW/tracking.mdx +2 -4
  1463. package/docs/content/locales/zh-TW/what-is-agent-native.mdx +1 -2
  1464. package/docs/content/observability.mdx +1 -2
  1465. package/docs/content/package-lifecycle.mdx +29 -0
  1466. package/docs/content/real-time-collaboration.mdx +8 -7
  1467. package/docs/content/sharing.mdx +1 -2
  1468. package/docs/content/template-chat.mdx +1 -2
  1469. package/docs/content/toolkit-agent-ux.mdx +3 -2
  1470. package/docs/content/toolkit-observability.mdx +1 -2
  1471. package/docs/content/toolkit-settings.mdx +2 -2
  1472. package/docs/content/toolkit-sharing.mdx +5 -2
  1473. package/docs/content/tracking.mdx +2 -4
  1474. package/docs/content/what-is-agent-native.mdx +1 -2
  1475. package/migration-manifest.json +1492 -0
  1476. package/package.json +23 -5
  1477. package/src/templates/chat/.agents/skills/actions/SKILL.md +3 -3
  1478. package/src/templates/chat/.agents/skills/adding-a-feature/SKILL.md +1 -1
  1479. package/src/templates/chat/.agents/skills/delegate-to-agent/SKILL.md +3 -3
  1480. package/src/templates/chat/.agents/skills/feature-flags/SKILL.md +1 -1
  1481. package/src/templates/chat/.agents/skills/real-time-sync/SKILL.md +4 -4
  1482. package/src/templates/chat/.agents/skills/upgrade-agent-native/SKILL.md +12 -5
  1483. package/src/templates/chat/app/components/layout/Header.tsx +2 -1
  1484. package/src/templates/chat/app/components/layout/Layout.tsx +2 -2
  1485. package/src/templates/chat/app/components/layout/Sidebar.tsx +4 -4
  1486. package/src/templates/chat/app/hooks/use-navigation-state.ts +3 -4
  1487. package/src/templates/chat/app/i18n/index.ts +1 -1
  1488. package/src/templates/chat/app/i18n-data.ts +1 -1
  1489. package/src/templates/chat/app/lib/utils.ts +1 -1
  1490. package/src/templates/chat/app/root.tsx +10 -9
  1491. package/src/templates/chat/app/routes/_index.tsx +2 -2
  1492. package/src/templates/chat/app/routes/agent.tsx +10 -3
  1493. package/src/templates/chat/app/routes/database.tsx +1 -1
  1494. package/src/templates/chat/app/routes/observability.tsx +2 -1
  1495. package/src/templates/chat/app/routes/settings.tsx +4 -5
  1496. package/src/templates/default/.agents/skills/actions/SKILL.md +3 -3
  1497. package/src/templates/default/.agents/skills/adding-a-feature/SKILL.md +1 -1
  1498. package/src/templates/default/.agents/skills/delegate-to-agent/SKILL.md +3 -3
  1499. package/src/templates/default/.agents/skills/feature-flags/SKILL.md +1 -1
  1500. package/src/templates/default/.agents/skills/real-time-collab/SKILL.md +4 -4
  1501. package/src/templates/default/.agents/skills/real-time-sync/SKILL.md +4 -4
  1502. package/src/templates/default/.agents/skills/storing-data/SKILL.md +1 -1
  1503. package/src/templates/default/.agents/skills/upgrade-agent-native/SKILL.md +12 -5
  1504. package/src/templates/default/app/hooks/use-navigation-state.ts +2 -5
  1505. package/src/templates/default/app/i18n/index.ts +1 -1
  1506. package/src/templates/default/app/lib/utils.ts +1 -1
  1507. package/src/templates/default/app/root.tsx +8 -6
  1508. package/src/templates/default/app/routes/_index.tsx +2 -1
  1509. package/src/templates/default/app/routes/agent.tsx +2 -1
  1510. package/src/templates/default/app/routes/settings.tsx +2 -3
  1511. package/src/templates/headless/.agents/skills/feature-flags/SKILL.md +1 -1
  1512. package/src/templates/headless/.agents/skills/upgrade-agent-native/SKILL.md +12 -5
  1513. package/src/templates/workspace-core/.agents/skills/actions/SKILL.md +3 -3
  1514. package/src/templates/workspace-core/.agents/skills/adding-a-feature/SKILL.md +1 -1
  1515. package/src/templates/workspace-core/.agents/skills/authentication/SKILL.md +1 -1
  1516. package/src/templates/workspace-core/.agents/skills/changelog/SKILL.md +1 -1
  1517. package/src/templates/workspace-core/.agents/skills/client-methods/SKILL.md +10 -10
  1518. package/src/templates/workspace-core/.agents/skills/context-awareness/SKILL.md +1 -1
  1519. package/src/templates/workspace-core/.agents/skills/delegate-to-agent/SKILL.md +3 -3
  1520. package/src/templates/workspace-core/.agents/skills/feature-flags/SKILL.md +1 -1
  1521. package/src/templates/workspace-core/.agents/skills/observability/SKILL.md +1 -1
  1522. package/src/templates/workspace-core/.agents/skills/real-time-collab/SKILL.md +4 -4
  1523. package/src/templates/workspace-core/.agents/skills/real-time-sync/SKILL.md +4 -4
  1524. package/src/templates/workspace-core/.agents/skills/sharing/SKILL.md +1 -1
  1525. package/src/templates/workspace-core/.agents/skills/storing-data/SKILL.md +1 -1
  1526. package/src/templates/workspace-core/.agents/skills/upgrade-agent-native/SKILL.md +12 -5
@@ -4,7 +4,7 @@
4
4
  * itself via `scripts/guard-*.mjs` (see
5
5
  * `advisor-plans/reports/005-doctor-design.md` for the full design and
6
6
  * `advisor-plans/015-doctor-v1-implementation.md` for the implementation
7
- * plan). v1 ships 7 of those guards, ported to work against a single
7
+ * plan). v1 ships 8 of those guards, ported to work against a single
8
8
  * generated app root instead of this monorepo's multi-template layout —
9
9
  * see `../guards/index.ts`.
10
10
  *
@@ -23,6 +23,7 @@
23
23
  import fs from "node:fs";
24
24
  import path from "node:path";
25
25
  import { scanDbToolScoping, scanDrizzlePush, scanEnvCredentials, scanEnvMutation, scanLocalhostFallback, scanUnscopedCredentials, scanUnscopedQueries, } from "../guards/index.js";
26
+ import { AGENT_NATIVE_UPGRADE_CODEMOD_COMMAND, scanDeprecatedImports, } from "../package-lifecycle/index.js";
26
27
  export const ALL_GUARD_NAMES = [
27
28
  "no-drizzle-push",
28
29
  "no-unscoped-credentials",
@@ -31,6 +32,7 @@ export const ALL_GUARD_NAMES = [
31
32
  "db-tool-scoping",
32
33
  "no-env-mutation",
33
34
  "no-localhost-fallback",
35
+ "migration-manifest",
34
36
  ];
35
37
  const DEFAULT_DOCTOR_CONFIG = {
36
38
  disabledGuards: [],
@@ -65,7 +67,7 @@ export function readDoctorConfig(root) {
65
67
  return { ...DEFAULT_DOCTOR_CONFIG, dbToolScopingDenylist: {} };
66
68
  }
67
69
  }
68
- function runGuard(name, root, config) {
70
+ function runGuard(name, root, config, migrationManifests) {
69
71
  switch (name) {
70
72
  case "no-drizzle-push":
71
73
  return scanDrizzlePush({ root });
@@ -84,6 +86,29 @@ function runGuard(name, root, config) {
84
86
  return scanEnvMutation({ root });
85
87
  case "no-localhost-fallback":
86
88
  return scanLocalhostFallback({ root, extraExemptPaths: [] });
89
+ case "migration-manifest": {
90
+ const imports = scanDeprecatedImports({
91
+ root,
92
+ manifests: migrationManifests,
93
+ });
94
+ return {
95
+ name,
96
+ findings: imports
97
+ .filter((finding) => finding.status === "active")
98
+ .map((finding) => ({
99
+ file: path.relative(root, finding.file),
100
+ line: finding.line,
101
+ message: `${finding.from} moves to ${finding.to.join(", ")}. Run: ${AGENT_NATIVE_UPGRADE_CODEMOD_COMMAND}`,
102
+ })),
103
+ warnings: imports
104
+ .filter((finding) => finding.status === "planned")
105
+ .map((finding) => ({
106
+ file: path.relative(root, finding.file),
107
+ line: finding.line,
108
+ message: `${finding.from} is planned to move to ${finding.to.join(", ")} in a future release. No rewrite is available yet.`,
109
+ })),
110
+ };
111
+ }
87
112
  }
88
113
  }
89
114
  /** Pure scan orchestrator: runs the selected guards against `root` and
@@ -101,8 +126,9 @@ export function runDoctorScan(options) {
101
126
  names = ALL_GUARD_NAMES.filter((n) => !config.disabledGuards.includes(n));
102
127
  }
103
128
  const findings = [];
129
+ const warnings = [];
104
130
  for (const name of names) {
105
- const result = runGuard(name, root, config);
131
+ const result = runGuard(name, root, config, options.migrationManifests);
106
132
  for (const f of result.findings) {
107
133
  findings.push({
108
134
  guard: name,
@@ -111,8 +137,21 @@ export function runDoctorScan(options) {
111
137
  message: f.message,
112
138
  });
113
139
  }
140
+ for (const warning of result.warnings ?? []) {
141
+ warnings.push({
142
+ guard: name,
143
+ file: warning.file,
144
+ line: warning.line,
145
+ message: warning.message,
146
+ });
147
+ }
114
148
  }
115
- return { ok: findings.length === 0, findings, guardsRun: names };
149
+ return {
150
+ ok: findings.length === 0,
151
+ findings,
152
+ warnings,
153
+ guardsRun: names,
154
+ };
116
155
  }
117
156
  /** Pure escalation rule shared by the CLI (`--strict`) and the `build`
118
157
  * pre-step (`--strict` / `agent-native.json` `doctor.failOnBuild`). Doctor
@@ -138,6 +177,12 @@ function formatDoctorHuman(report, root) {
138
177
  lines.push(` [${f.guard}] ${f.file}:${f.line} — ${f.message}`);
139
178
  }
140
179
  }
180
+ if (report.warnings.length > 0) {
181
+ lines.push(`${report.warnings.length} warning(s):`);
182
+ for (const warning of report.warnings) {
183
+ lines.push(` [${warning.guard}] ${warning.file}:${warning.line} — ${warning.message}`);
184
+ }
185
+ }
141
186
  return lines.join("\n");
142
187
  }
143
188
  export function parseDoctorArgs(argv) {
@@ -181,7 +226,7 @@ export function printDoctorHelp(io = defaultIo) {
181
226
  io.log([
182
227
  "Usage:",
183
228
  " agent-native doctor Scan app source for security-critical guard violations",
184
- " agent-native doctor --json Machine-readable report: { ok, findings, guardsRun, strict }",
229
+ " agent-native doctor --json Machine-readable report: { ok, findings, warnings, guardsRun, strict }",
185
230
  " agent-native doctor --only <guard,guard> Run only the named guard(s)",
186
231
  " agent-native doctor --strict Escalate findings to a hard failure when used by `agent-native build --strict`",
187
232
  " agent-native doctor --cwd <dir> Run against a project root other than the current directory",
@@ -198,6 +243,7 @@ export function printDoctorHelp(io = defaultIo) {
198
243
  "",
199
244
  "For dependency-pin health (framework overrides/patches, stale",
200
245
  "@agent-native/* pins), run `agent-native upgrade check` instead.",
246
+ `For import migrations, run \`${AGENT_NATIVE_UPGRADE_CODEMOD_COMMAND}\`.`,
201
247
  ].join("\n"));
202
248
  }
203
249
  /** `agent-native doctor` CLI entrypoint. Returns the process exit code —
@@ -269,6 +315,12 @@ export async function runDoctorBuildHook(options, io = defaultIo) {
269
315
  io.err(` [${f.guard}] ${f.file}:${f.line} — ${f.message}`);
270
316
  }
271
317
  }
318
+ if (report.warnings.length > 0) {
319
+ io.err(`\n[doctor] ${report.warnings.length} planned migration warning(s) — no rewrite is available yet.`);
320
+ for (const warning of report.warnings) {
321
+ io.err(` [${warning.guard}] ${warning.file}:${warning.line} — ${warning.message}`);
322
+ }
323
+ }
272
324
  const fail = shouldFailBuild(report.findings.length > 0, {
273
325
  strict: options.strict,
274
326
  failOnBuild: config.failOnBuild,
@@ -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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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
+ {"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;AAE5B,OAAO,EACL,oCAAoC,EACpC,qBAAqB,GAEtB,MAAM,+BAA+B,CAAC;AAYvC,MAAM,CAAC,MAAM,eAAe,GAAgB;IAC1C,iBAAiB;IACjB,yBAAyB;IACzB,qBAAqB;IACrB,oBAAoB;IACpB,iBAAiB;IACjB,iBAAiB;IACjB,uBAAuB;IACvB,oBAAoB;CACrB,CAAC;AAQF,MAAM,qBAAqB,GAA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oL,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;IACD,IAAI,MAAM,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC/B,EAAE,CAAC,GAAG,CACJ,cAAc,MAAM,CAAC,QAAQ,CAAC,MAAM,8DAA8D,CACnG,CAAC;QACF,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;YACtC,EAAE,CAAC,GAAG,CACJ,MAAM,OAAO,CAAC,KAAK,KAAK,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,MAAM,OAAO,CAAC,OAAO,EAAE,CAC5E,CAAC;QACJ,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 8 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 { GuardFinding, GuardResult } from \"../guards/index.js\";\nimport {\n AGENT_NATIVE_UPGRADE_CODEMOD_COMMAND,\n scanDeprecatedImports,\n type MigrationManifest,\n} from \"../package-lifecycle/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 | \"migration-manifest\";\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 \"migration-manifest\",\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 warnings: DoctorFinding[];\n guardsRun: string[];\n}\n\ninterface DoctorGuardResult extends GuardResult {\n warnings?: GuardFinding[];\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 migrationManifests?: MigrationManifest[],\n): DoctorGuardResult {\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 case \"migration-manifest\": {\n const imports = scanDeprecatedImports({\n root,\n manifests: migrationManifests,\n });\n return {\n name,\n findings: imports\n .filter((finding) => finding.status === \"active\")\n .map((finding) => ({\n file: path.relative(root, finding.file),\n line: finding.line,\n message: `${finding.from} moves to ${finding.to.join(\", \")}. Run: ${AGENT_NATIVE_UPGRADE_CODEMOD_COMMAND}`,\n })),\n warnings: imports\n .filter((finding) => finding.status === \"planned\")\n .map((finding) => ({\n file: path.relative(root, finding.file),\n line: finding.line,\n message: `${finding.from} is planned to move to ${finding.to.join(\", \")} in a future release. No rewrite is available yet.`,\n })),\n };\n }\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 migrationManifests?: MigrationManifest[];\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 const warnings: DoctorFinding[] = [];\n for (const name of names) {\n const result = runGuard(name, root, config, options.migrationManifests);\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 for (const warning of result.warnings ?? []) {\n warnings.push({\n guard: name,\n file: warning.file,\n line: warning.line,\n message: warning.message,\n });\n }\n }\n\n return {\n ok: findings.length === 0,\n findings,\n warnings,\n guardsRun: names,\n };\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 if (report.warnings.length > 0) {\n lines.push(`${report.warnings.length} warning(s):`);\n for (const warning of report.warnings) {\n lines.push(\n ` [${warning.guard}] ${warning.file}:${warning.line} — ${warning.message}`,\n );\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, warnings, 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 `For import migrations, run \\`${AGENT_NATIVE_UPGRADE_CODEMOD_COMMAND}\\`.`,\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 if (report.warnings.length > 0) {\n io.err(\n `\\n[doctor] ${report.warnings.length} planned migration warning(s) — no rewrite is available yet.`,\n );\n for (const warning of report.warnings) {\n io.err(\n ` [${warning.guard}] ${warning.file}:${warning.line} — ${warning.message}`,\n );\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"]}
@@ -0,0 +1,21 @@
1
+ import { type MigrationManifest } from "../package-lifecycle/migration-manifest.js";
2
+ export interface MigrationCodemodFileChange {
3
+ file: string;
4
+ before: string;
5
+ after: string;
6
+ }
7
+ export interface MigrationCodemodResult {
8
+ changes: MigrationCodemodFileChange[];
9
+ dependencyFiles: string[];
10
+ warnings: string[];
11
+ }
12
+ export interface RunMigrationCodemodsOptions {
13
+ root: string;
14
+ manifests?: MigrationManifest[];
15
+ apply?: boolean;
16
+ targetExists?: (specifier: string) => boolean;
17
+ }
18
+ export declare function loadMigrationManifests(projectRoot: string): MigrationManifest[];
19
+ export declare function runMigrationCodemods(options: RunMigrationCodemodsOptions): MigrationCodemodResult;
20
+ export declare function formatMigrationCodemodDiff(result: MigrationCodemodResult, root: string): string;
21
+ //# sourceMappingURL=migration-codemod.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"migration-codemod.d.ts","sourceRoot":"","sources":["../../src/cli/migration-codemod.ts"],"names":[],"mappings":"AAYA,OAAO,EAML,KAAK,iBAAiB,EAEvB,MAAM,4CAA4C,CAAC;AAcpD,MAAM,WAAW,0BAA0B;IACzC,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,sBAAsB;IACrC,OAAO,EAAE,0BAA0B,EAAE,CAAC;IACtC,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,QAAQ,EAAE,MAAM,EAAE,CAAC;CACpB;AAED,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,iBAAiB,EAAE,CAAC;IAChC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,YAAY,CAAC,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC;CAC/C;AAqCD,wBAAgB,sBAAsB,CACpC,WAAW,EAAE,MAAM,GAClB,iBAAiB,EAAE,CAKrB;AAkXD,wBAAgB,oBAAoB,CAClC,OAAO,EAAE,2BAA2B,GACnC,sBAAsB,CA6DxB;AAiCD,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,sBAAsB,EAC9B,IAAI,EAAE,MAAM,GACX,MAAM,CAIR"}
@@ -0,0 +1,363 @@
1
+ import fs from "node:fs";
2
+ import { createRequire } from "node:module";
3
+ import path from "node:path";
4
+ import { Project, QuoteKind, } from "ts-morph";
5
+ import { bundledCorePackageVersion, isMigrationManifestActive, loadMigrationManifestsForProject, migrationMoveStatus, resolveMigrationSymbolMove, } from "../package-lifecycle/migration-manifest.js";
6
+ const SOURCE_EXTENSIONS = new Set([".ts", ".tsx"]);
7
+ const SKIP_DIRECTORIES = new Set([
8
+ ".git",
9
+ ".next",
10
+ ".output",
11
+ ".turbo",
12
+ "build",
13
+ "coverage",
14
+ "dist",
15
+ "node_modules",
16
+ ]);
17
+ function collectSourceFiles(root) {
18
+ const files = [];
19
+ const visit = (directory) => {
20
+ for (const entry of fs.readdirSync(directory, { withFileTypes: true })) {
21
+ if (entry.isDirectory() && SKIP_DIRECTORIES.has(entry.name))
22
+ continue;
23
+ const entryPath = path.join(directory, entry.name);
24
+ if (entry.isDirectory()) {
25
+ visit(entryPath);
26
+ }
27
+ else if (SOURCE_EXTENSIONS.has(path.extname(entry.name)) &&
28
+ !entry.name.endsWith(".d.ts")) {
29
+ files.push(entryPath);
30
+ }
31
+ }
32
+ };
33
+ visit(root);
34
+ return files.sort();
35
+ }
36
+ function mergeManifestMoves(manifests) {
37
+ const moves = {};
38
+ for (const manifest of manifests) {
39
+ Object.assign(moves, manifest.moves);
40
+ }
41
+ return moves;
42
+ }
43
+ export function loadMigrationManifests(projectRoot) {
44
+ const packageVersion = bundledCorePackageVersion();
45
+ return loadMigrationManifestsForProject(projectRoot).filter((manifest) => isMigrationManifestActive(manifest, packageVersion));
46
+ }
47
+ function packageNameFromSpecifier(specifier) {
48
+ if (specifier.startsWith("@")) {
49
+ const [scope, name] = specifier.split("/");
50
+ return scope && name ? `${scope}/${name}` : null;
51
+ }
52
+ const [name] = specifier.split("/");
53
+ return name && !name.startsWith(".") ? name : null;
54
+ }
55
+ function nearestPackageFile(file, root) {
56
+ let directory = path.dirname(file);
57
+ const boundary = path.resolve(root);
58
+ while (directory.startsWith(boundary)) {
59
+ const packageFile = path.join(directory, "package.json");
60
+ if (fs.existsSync(packageFile))
61
+ return packageFile;
62
+ if (directory === boundary)
63
+ break;
64
+ directory = path.dirname(directory);
65
+ }
66
+ return null;
67
+ }
68
+ function recordIntroducedDependency(pending, sourceFile, root, from, to) {
69
+ const fromPackage = packageNameFromSpecifier(from);
70
+ const toPackage = packageNameFromSpecifier(to);
71
+ if (!toPackage || toPackage === fromPackage)
72
+ return;
73
+ const packageFile = nearestPackageFile(sourceFile, root);
74
+ if (!packageFile)
75
+ return;
76
+ if (!pending.some((entry) => entry.packageFile === packageFile && entry.packageName === toPackage)) {
77
+ pending.push({ packageFile, packageName: toPackage });
78
+ }
79
+ }
80
+ function importedNameStructure(importedName, localName, nextName, typeOnly) {
81
+ return {
82
+ name: nextName,
83
+ alias: localName !== nextName
84
+ ? localName
85
+ : importedName !== nextName
86
+ ? importedName
87
+ : undefined,
88
+ isTypeOnly: typeOnly,
89
+ };
90
+ }
91
+ function warnSkippedTarget(warnings, sourceFile, target, reason) {
92
+ const message = reason === "planned"
93
+ ? `${sourceFile}: migration to ${target} is planned but not active; no rewrite was applied`
94
+ : `${sourceFile}: migration target ${target} is not exported by an installed package; no rewrite was applied`;
95
+ if (!warnings.includes(message))
96
+ warnings.push(message);
97
+ }
98
+ function rewriteImportDeclaration(declaration, move, root, pendingDependencies, warnings, targetExists) {
99
+ const originalSpecifier = declaration.getModuleSpecifierValue();
100
+ const sourceFile = declaration.getSourceFile();
101
+ const namedImports = declaration.getNamedImports();
102
+ if (!move.symbols) {
103
+ if (migrationMoveStatus(move) === "planned") {
104
+ warnSkippedTarget(warnings, sourceFile.getFilePath(), move.to, "planned");
105
+ return false;
106
+ }
107
+ if (!targetExists(move.to)) {
108
+ warnSkippedTarget(warnings, sourceFile.getFilePath(), move.to, "unresolved");
109
+ return false;
110
+ }
111
+ declaration.setModuleSpecifier(move.to);
112
+ recordIntroducedDependency(pendingDependencies, sourceFile.getFilePath(), root, originalSpecifier, move.to);
113
+ return originalSpecifier !== move.to;
114
+ }
115
+ if (namedImports.length === 0) {
116
+ warnings.push(`${sourceFile.getFilePath()}: cannot split default, namespace, or side-effect import from ${originalSpecifier}`);
117
+ return false;
118
+ }
119
+ const groups = new Map();
120
+ const movedImports = new Set();
121
+ for (const namedImport of namedImports) {
122
+ const importedName = namedImport.getName();
123
+ const resolved = resolveMigrationSymbolMove(move, importedName);
124
+ if (!resolved || resolved.to === originalSpecifier)
125
+ continue;
126
+ if (resolved.status === "planned") {
127
+ warnSkippedTarget(warnings, sourceFile.getFilePath(), resolved.to, "planned");
128
+ continue;
129
+ }
130
+ if (!targetExists(resolved.to)) {
131
+ warnSkippedTarget(warnings, sourceFile.getFilePath(), resolved.to, "unresolved");
132
+ continue;
133
+ }
134
+ const localName = namedImport.getAliasNode()?.getText() ?? importedName;
135
+ const group = groups.get(resolved.to) ?? [];
136
+ group.push(importedNameStructure(importedName, localName, resolved.name, !declaration.isTypeOnly() && namedImport.isTypeOnly()));
137
+ groups.set(resolved.to, group);
138
+ movedImports.add(namedImport);
139
+ recordIntroducedDependency(pendingDependencies, sourceFile.getFilePath(), root, originalSpecifier, resolved.to);
140
+ }
141
+ if (groups.size === 0)
142
+ return false;
143
+ const declarationIndex = declaration.getChildIndex();
144
+ for (const namedImport of movedImports)
145
+ namedImport.remove();
146
+ let offset = 1;
147
+ for (const [target, imports] of groups) {
148
+ sourceFile.insertImportDeclaration(declarationIndex + offset, {
149
+ moduleSpecifier: target,
150
+ isTypeOnly: declaration.isTypeOnly(),
151
+ namedImports: imports,
152
+ });
153
+ offset += 1;
154
+ }
155
+ if (declaration.getNamedImports().length === 0 &&
156
+ !declaration.getDefaultImport() &&
157
+ !declaration.getNamespaceImport()) {
158
+ declaration.remove();
159
+ }
160
+ return true;
161
+ }
162
+ function rewriteExportDeclarations(sourceFile, moves, root, pendingDependencies, warnings, targetExists) {
163
+ for (const declaration of [...sourceFile.getExportDeclarations()]) {
164
+ const originalSpecifier = declaration.getModuleSpecifierValue();
165
+ if (!originalSpecifier)
166
+ continue;
167
+ const move = moves[originalSpecifier];
168
+ if (!move)
169
+ continue;
170
+ const namedExports = declaration.getNamedExports();
171
+ if (!move.symbols) {
172
+ if (migrationMoveStatus(move) === "planned") {
173
+ warnSkippedTarget(warnings, sourceFile.getFilePath(), move.to, "planned");
174
+ continue;
175
+ }
176
+ if (!targetExists(move.to)) {
177
+ warnSkippedTarget(warnings, sourceFile.getFilePath(), move.to, "unresolved");
178
+ continue;
179
+ }
180
+ declaration.setModuleSpecifier(move.to);
181
+ recordIntroducedDependency(pendingDependencies, sourceFile.getFilePath(), root, originalSpecifier, move.to);
182
+ continue;
183
+ }
184
+ if (namedExports.length === 0) {
185
+ warnings.push(`${sourceFile.getFilePath()}: cannot split export star from ${originalSpecifier}`);
186
+ continue;
187
+ }
188
+ const groups = new Map();
189
+ const movedExports = new Set();
190
+ for (const namedExport of namedExports) {
191
+ const exportedFromName = namedExport.getName();
192
+ const resolved = resolveMigrationSymbolMove(move, exportedFromName);
193
+ if (!resolved || resolved.to === originalSpecifier)
194
+ continue;
195
+ if (resolved.status === "planned") {
196
+ warnSkippedTarget(warnings, sourceFile.getFilePath(), resolved.to, "planned");
197
+ continue;
198
+ }
199
+ if (!targetExists(resolved.to)) {
200
+ warnSkippedTarget(warnings, sourceFile.getFilePath(), resolved.to, "unresolved");
201
+ continue;
202
+ }
203
+ const publicName = namedExport.getAliasNode()?.getText() ?? exportedFromName;
204
+ const group = groups.get(resolved.to) ?? [];
205
+ group.push({
206
+ name: resolved.name,
207
+ alias: publicName !== resolved.name
208
+ ? publicName
209
+ : exportedFromName !== resolved.name
210
+ ? exportedFromName
211
+ : undefined,
212
+ isTypeOnly: !declaration.isTypeOnly() && namedExport.isTypeOnly()
213
+ ? true
214
+ : undefined,
215
+ });
216
+ groups.set(resolved.to, group);
217
+ movedExports.add(namedExport);
218
+ recordIntroducedDependency(pendingDependencies, sourceFile.getFilePath(), root, originalSpecifier, resolved.to);
219
+ }
220
+ if (groups.size === 0)
221
+ continue;
222
+ const declarationIndex = declaration.getChildIndex();
223
+ for (const namedExport of movedExports)
224
+ namedExport.remove();
225
+ let offset = 1;
226
+ for (const [target, exports] of groups) {
227
+ sourceFile.insertExportDeclaration(declarationIndex + offset, {
228
+ moduleSpecifier: target,
229
+ isTypeOnly: declaration.isTypeOnly(),
230
+ namedExports: exports,
231
+ });
232
+ offset += 1;
233
+ }
234
+ if (declaration.getNamedExports().length === 0)
235
+ declaration.remove();
236
+ }
237
+ }
238
+ function readPackageJson(packageFile) {
239
+ try {
240
+ return JSON.parse(fs.readFileSync(packageFile, "utf-8"));
241
+ }
242
+ catch {
243
+ return null;
244
+ }
245
+ }
246
+ function addDependencies(pending, apply) {
247
+ const changes = [];
248
+ const byFile = new Map();
249
+ for (const entry of pending) {
250
+ const packages = byFile.get(entry.packageFile) ?? new Set();
251
+ packages.add(entry.packageName);
252
+ byFile.set(entry.packageFile, packages);
253
+ }
254
+ for (const [packageFile, packageNames] of byFile) {
255
+ const packageJson = readPackageJson(packageFile);
256
+ if (!packageJson)
257
+ continue;
258
+ const allDependencySections = [
259
+ "dependencies",
260
+ "devDependencies",
261
+ "optionalDependencies",
262
+ "peerDependencies",
263
+ ];
264
+ const missing = [...packageNames].filter((packageName) => !allDependencySections.some((section) => {
265
+ const dependencies = packageJson[section];
266
+ return (dependencies &&
267
+ typeof dependencies === "object" &&
268
+ packageName in dependencies);
269
+ }));
270
+ if (missing.length === 0)
271
+ continue;
272
+ const before = `${JSON.stringify(packageJson, null, 2)}\n`;
273
+ const dependencies = packageJson.dependencies && typeof packageJson.dependencies === "object"
274
+ ? packageJson.dependencies
275
+ : {};
276
+ for (const packageName of missing.sort())
277
+ dependencies[packageName] = "latest";
278
+ packageJson.dependencies = Object.fromEntries(Object.entries(dependencies).sort(([left], [right]) => left.localeCompare(right)));
279
+ const after = `${JSON.stringify(packageJson, null, 2)}\n`;
280
+ changes.push({ file: packageFile, before, after });
281
+ if (apply)
282
+ fs.writeFileSync(packageFile, after);
283
+ }
284
+ return changes;
285
+ }
286
+ export function runMigrationCodemods(options) {
287
+ const root = path.resolve(options.root);
288
+ const manifests = options.manifests ?? loadMigrationManifests(root);
289
+ const moves = mergeManifestMoves(manifests);
290
+ const requireFromProject = createRequire(path.join(root, "package.json"));
291
+ const targetExists = options.targetExists ??
292
+ ((specifier) => {
293
+ try {
294
+ requireFromProject.resolve(specifier);
295
+ return true;
296
+ }
297
+ catch {
298
+ return false;
299
+ }
300
+ });
301
+ const project = new Project({
302
+ skipAddingFilesFromTsConfig: true,
303
+ manipulationSettings: { quoteKind: QuoteKind.Double },
304
+ });
305
+ const sourceFiles = project.addSourceFilesAtPaths(collectSourceFiles(root));
306
+ const pendingDependencies = [];
307
+ const warnings = [];
308
+ const changes = [];
309
+ for (const sourceFile of sourceFiles) {
310
+ const before = sourceFile.getFullText();
311
+ for (const declaration of [...sourceFile.getImportDeclarations()]) {
312
+ const move = moves[declaration.getModuleSpecifierValue()];
313
+ if (!move)
314
+ continue;
315
+ rewriteImportDeclaration(declaration, move, root, pendingDependencies, warnings, targetExists);
316
+ }
317
+ rewriteExportDeclarations(sourceFile, moves, root, pendingDependencies, warnings, targetExists);
318
+ const after = sourceFile.getFullText();
319
+ if (before === after)
320
+ continue;
321
+ changes.push({ file: sourceFile.getFilePath(), before, after });
322
+ if (options.apply)
323
+ sourceFile.saveSync();
324
+ }
325
+ const dependencyChanges = addDependencies(pendingDependencies, Boolean(options.apply));
326
+ return {
327
+ changes: [...changes, ...dependencyChanges],
328
+ dependencyFiles: dependencyChanges.map((change) => change.file),
329
+ warnings,
330
+ };
331
+ }
332
+ function focusedDiff(change, root) {
333
+ const beforeLines = change.before.split("\n");
334
+ const afterLines = change.after.split("\n");
335
+ let prefix = 0;
336
+ while (prefix < beforeLines.length &&
337
+ prefix < afterLines.length &&
338
+ beforeLines[prefix] === afterLines[prefix]) {
339
+ prefix += 1;
340
+ }
341
+ let suffix = 0;
342
+ while (suffix < beforeLines.length - prefix &&
343
+ suffix < afterLines.length - prefix &&
344
+ beforeLines[beforeLines.length - 1 - suffix] ===
345
+ afterLines[afterLines.length - 1 - suffix]) {
346
+ suffix += 1;
347
+ }
348
+ const beforeChanged = beforeLines.slice(prefix, beforeLines.length - suffix);
349
+ const afterChanged = afterLines.slice(prefix, afterLines.length - suffix);
350
+ return [
351
+ `--- ${path.relative(root, change.file)}`,
352
+ `+++ ${path.relative(root, change.file)}`,
353
+ `@@ -${prefix + 1} +${prefix + 1} @@`,
354
+ ...beforeChanged.map((line) => `-${line}`),
355
+ ...afterChanged.map((line) => `+${line}`),
356
+ ].join("\n");
357
+ }
358
+ export function formatMigrationCodemodDiff(result, root) {
359
+ return result.changes
360
+ .map((change) => focusedDiff(change, path.resolve(root)))
361
+ .join("\n");
362
+ }
363
+ //# sourceMappingURL=migration-codemod.js.map