@agent-native/core 0.101.12 → 0.101.14

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 (307) hide show
  1. package/corpus/README.md +1 -1
  2. package/corpus/core/CHANGELOG.md +15 -0
  3. package/corpus/core/package.json +4 -2
  4. package/corpus/core/src/cli/create.ts +76 -17
  5. package/corpus/core/src/client/AgentPanel.tsx +61 -48
  6. package/corpus/core/src/client/assistant-ui-recovery.tsx +9 -3
  7. package/corpus/core/src/client/chat/message-components.tsx +26 -2
  8. package/corpus/core/src/client/chat/tool-call-display.tsx +18 -11
  9. package/corpus/core/src/mcp/server.ts +10 -1
  10. package/corpus/core/src/server/agent-chat/framework-prompts.ts +0 -3
  11. package/corpus/core/src/server/agent-chat-plugin.ts +2 -58
  12. package/corpus/core/src/server/prompts/framework-core-compact.ts +0 -1
  13. package/corpus/core/src/server/prompts/framework-core.ts +0 -30
  14. package/corpus/core/src/server/prompts/index.ts +1 -4
  15. package/corpus/templates/chat/app/components/layout/Sidebar.tsx +0 -14
  16. package/corpus/templates/chat/changelog/2026-07-15-chat-navigation-focuses-on-chat-and-agent.md +6 -0
  17. package/corpus/templates/clips/app/components/player/share-dialog.tsx +1 -1
  18. package/corpus/templates/clips/app/i18n/ar-SA.ts +1 -0
  19. package/corpus/templates/clips/app/i18n/de-DE.ts +1 -0
  20. package/corpus/templates/clips/app/i18n/en-US.ts +1 -0
  21. package/corpus/templates/clips/app/i18n/es-ES.ts +1 -0
  22. package/corpus/templates/clips/app/i18n/fr-FR.ts +1 -0
  23. package/corpus/templates/clips/app/i18n/hi-IN.ts +1 -0
  24. package/corpus/templates/clips/app/i18n/ja-JP.ts +1 -0
  25. package/corpus/templates/clips/app/i18n/ko-KR.ts +1 -0
  26. package/corpus/templates/clips/app/i18n/pt-BR.ts +1 -0
  27. package/corpus/templates/clips/app/i18n/zh-CN.ts +1 -0
  28. package/corpus/templates/clips/app/i18n/zh-TW.ts +1 -0
  29. package/corpus/templates/clips/changelog/2026-07-15-public-clip-links-are-labeled-share-with-humans-for-clarity.md +6 -0
  30. package/corpus/templates/forms/actions/delete-form.ts +4 -0
  31. package/corpus/templates/forms/actions/patch-form-fields.ts +3 -0
  32. package/corpus/templates/forms/actions/restore-form.ts +3 -0
  33. package/corpus/templates/forms/actions/update-form.ts +3 -0
  34. package/corpus/templates/forms/app/pages/FormBuilderPage.tsx +2 -2
  35. package/corpus/templates/forms/app/pages/ResponsesPage.tsx +2 -2
  36. package/corpus/templates/forms/changelog/2026-07-15-published-forms-now-reflect-field-updates-immediately-at-the.md +6 -0
  37. package/corpus/templates/forms/changelog/2026-07-15-response-rows-now-keep-every-column-aligned-to-the-top-for-c.md +6 -0
  38. package/corpus/templates/forms/server/handlers/forms.ts +1 -0
  39. package/corpus/templates/forms/server/lib/public-form-ssr.ts +47 -4
  40. package/corpus/templates/slides/app/components/editor/SlideEditor.tsx +189 -82
  41. package/corpus/templates/slides/app/pages/DeckEditor.tsx +1 -1
  42. package/dist/cli/create.d.ts +5 -2
  43. package/dist/cli/create.d.ts.map +1 -1
  44. package/dist/cli/create.js +52 -17
  45. package/dist/cli/create.js.map +1 -1
  46. package/dist/client/AgentPanel.d.ts +2 -0
  47. package/dist/client/AgentPanel.d.ts.map +1 -1
  48. package/dist/client/AgentPanel.js +24 -13
  49. package/dist/client/AgentPanel.js.map +1 -1
  50. package/dist/client/assistant-ui-recovery.d.ts +2 -0
  51. package/dist/client/assistant-ui-recovery.d.ts.map +1 -1
  52. package/dist/client/assistant-ui-recovery.js +5 -2
  53. package/dist/client/assistant-ui-recovery.js.map +1 -1
  54. package/dist/client/chat/message-components.d.ts +6 -0
  55. package/dist/client/chat/message-components.d.ts.map +1 -1
  56. package/dist/client/chat/message-components.js +15 -2
  57. package/dist/client/chat/message-components.js.map +1 -1
  58. package/dist/client/chat/tool-call-display.d.ts +4 -2
  59. package/dist/client/chat/tool-call-display.d.ts.map +1 -1
  60. package/dist/client/chat/tool-call-display.js +11 -13
  61. package/dist/client/chat/tool-call-display.js.map +1 -1
  62. package/dist/collab/awareness.d.ts +2 -2
  63. package/dist/collab/awareness.d.ts.map +1 -1
  64. package/dist/collab/struct-routes.d.ts +1 -1
  65. package/dist/mcp/server.d.ts.map +1 -1
  66. package/dist/mcp/server.js +10 -1
  67. package/dist/mcp/server.js.map +1 -1
  68. package/dist/notifications/routes.d.ts +2 -2
  69. package/dist/resources/handlers.d.ts +3 -3
  70. package/dist/server/agent-chat/framework-prompts.d.ts.map +1 -1
  71. package/dist/server/agent-chat/framework-prompts.js +0 -3
  72. package/dist/server/agent-chat/framework-prompts.js.map +1 -1
  73. package/dist/server/agent-chat-plugin.d.ts +0 -22
  74. package/dist/server/agent-chat-plugin.d.ts.map +1 -1
  75. package/dist/server/agent-chat-plugin.js +2 -51
  76. package/dist/server/agent-chat-plugin.js.map +1 -1
  77. package/dist/server/agent-engine-api-key-route.d.ts +1 -1
  78. package/dist/server/prompts/framework-core-compact.d.ts +0 -1
  79. package/dist/server/prompts/framework-core-compact.d.ts.map +1 -1
  80. package/dist/server/prompts/framework-core-compact.js +0 -1
  81. package/dist/server/prompts/framework-core-compact.js.map +1 -1
  82. package/dist/server/prompts/framework-core.d.ts +0 -9
  83. package/dist/server/prompts/framework-core.d.ts.map +1 -1
  84. package/dist/server/prompts/framework-core.js +0 -29
  85. package/dist/server/prompts/framework-core.js.map +1 -1
  86. package/dist/server/prompts/index.d.ts +1 -1
  87. package/dist/server/prompts/index.d.ts.map +1 -1
  88. package/dist/server/prompts/index.js +1 -1
  89. package/dist/server/prompts/index.js.map +1 -1
  90. package/dist/server/transcribe-voice.d.ts +1 -1
  91. package/dist/templates/chat/.agents/skills/actions/SKILL.md +492 -0
  92. package/dist/templates/chat/.agents/skills/adding-a-feature/SKILL.md +189 -0
  93. package/dist/templates/chat/.agents/skills/agent-native-docs/SKILL.md +76 -0
  94. package/dist/templates/chat/.agents/skills/capture-learnings/SKILL.md +89 -0
  95. package/dist/templates/chat/.agents/skills/create-skill/SKILL.md +221 -0
  96. package/dist/templates/chat/.agents/skills/delegate-to-agent/SKILL.md +263 -0
  97. package/dist/templates/chat/.agents/skills/frontend-design/SKILL.md +112 -0
  98. package/dist/templates/chat/.agents/skills/real-time-sync/SKILL.md +232 -0
  99. package/dist/templates/chat/.agents/skills/security/SKILL.md +280 -0
  100. package/dist/templates/chat/.agents/skills/self-modifying-code/SKILL.md +106 -0
  101. package/dist/templates/chat/.agents/skills/shadcn-ui/SKILL.md +95 -0
  102. package/dist/templates/chat/.agents/skills/upgrade-agent-native/SKILL.md +87 -0
  103. package/dist/templates/chat/.env.example +5 -0
  104. package/dist/templates/chat/.ignore +0 -0
  105. package/dist/templates/chat/.oxfmtrc.json +8 -0
  106. package/dist/templates/chat/.react-router/types/+server-build.d.ts +18 -0
  107. package/dist/templates/chat/.react-router/types/app/+types/root.ts +68 -0
  108. package/dist/templates/chat/AGENTS.md +62 -0
  109. package/dist/templates/chat/CHANGELOG.md +10 -0
  110. package/dist/templates/chat/DEVELOPING.md +185 -0
  111. package/dist/templates/chat/README.md +32 -0
  112. package/dist/templates/chat/_gitignore +43 -0
  113. package/dist/templates/chat/actions/hello.ts +13 -0
  114. package/dist/templates/chat/actions/navigate.ts +41 -0
  115. package/dist/templates/chat/actions/run.ts +2 -0
  116. package/dist/templates/chat/actions/view-screen.ts +31 -0
  117. package/dist/templates/chat/app/components/layout/Header.tsx +59 -0
  118. package/dist/templates/chat/app/components/layout/Layout.tsx +184 -0
  119. package/dist/templates/chat/app/components/layout/Sidebar.tsx +580 -0
  120. package/dist/templates/chat/app/components/ui/button.tsx +1 -0
  121. package/dist/templates/chat/app/components/ui/card.tsx +1 -0
  122. package/dist/templates/chat/app/components/ui/dropdown-menu.tsx +1 -0
  123. package/dist/templates/chat/app/components/ui/input.tsx +1 -0
  124. package/dist/templates/chat/app/components/ui/label.tsx +1 -0
  125. package/dist/templates/chat/app/components/ui/sheet.tsx +1 -0
  126. package/dist/templates/chat/app/components/ui/toolkit-provider.tsx +12 -0
  127. package/dist/templates/chat/app/components/ui/tooltip.tsx +1 -0
  128. package/dist/templates/chat/app/entry.client.tsx +19 -0
  129. package/dist/templates/chat/app/entry.server.tsx +10 -0
  130. package/dist/templates/chat/app/global.css +93 -0
  131. package/dist/templates/chat/app/hooks/use-navigation-state.ts +111 -0
  132. package/dist/templates/chat/app/i18n/ar-SA.ts +68 -0
  133. package/dist/templates/chat/app/i18n/de-DE.ts +71 -0
  134. package/dist/templates/chat/app/i18n/en-US.ts +70 -0
  135. package/dist/templates/chat/app/i18n/es-ES.ts +71 -0
  136. package/dist/templates/chat/app/i18n/fr-FR.ts +71 -0
  137. package/dist/templates/chat/app/i18n/hi-IN.ts +69 -0
  138. package/dist/templates/chat/app/i18n/index.ts +34 -0
  139. package/dist/templates/chat/app/i18n/ja-JP.ts +70 -0
  140. package/dist/templates/chat/app/i18n/ko-KR.ts +70 -0
  141. package/dist/templates/chat/app/i18n/pt-BR.ts +71 -0
  142. package/dist/templates/chat/app/i18n/zh-CN.ts +67 -0
  143. package/dist/templates/chat/app/i18n/zh-TW.ts +67 -0
  144. package/dist/templates/chat/app/i18n-data.ts +556 -0
  145. package/dist/templates/chat/app/lib/agent-page.tsx +40 -0
  146. package/dist/templates/chat/app/lib/app-config.ts +11 -0
  147. package/dist/templates/chat/app/lib/tab-id.ts +1 -0
  148. package/dist/templates/chat/app/lib/utils.ts +1 -0
  149. package/dist/templates/chat/app/root.tsx +172 -0
  150. package/dist/templates/chat/app/routes/_index.tsx +91 -0
  151. package/dist/templates/chat/app/routes/agent.tsx +17 -0
  152. package/dist/templates/chat/app/routes/chat.$threadId.tsx +1 -0
  153. package/dist/templates/chat/app/routes/database.tsx +17 -0
  154. package/dist/templates/chat/app/routes/extensions.$id.$slug.tsx +2 -0
  155. package/dist/templates/chat/app/routes/extensions.$id.tsx +11 -0
  156. package/dist/templates/chat/app/routes/extensions._index.tsx +11 -0
  157. package/dist/templates/chat/app/routes/extensions.tsx +5 -0
  158. package/dist/templates/chat/app/routes/observability.tsx +18 -0
  159. package/dist/templates/chat/app/routes/settings.tsx +88 -0
  160. package/dist/templates/chat/app/routes/team.tsx +11 -0
  161. package/dist/templates/chat/app/routes.ts +4 -0
  162. package/dist/templates/chat/app/vite-env.d.ts +6 -0
  163. package/dist/templates/chat/changelog/2026-06-24-a-new-settings-page-gives-quick-access-to-language-workspace.md +6 -0
  164. package/dist/templates/chat/changelog/2026-06-24-added-a-language-picker-and-localized-app-chrome-for-support.md +6 -0
  165. package/dist/templates/chat/changelog/2026-06-27-traditional-chinese-copy-uses-taiwan-terminology.md +6 -0
  166. package/dist/templates/chat/changelog/2026-06-28-left-sidebar-collapse-motion-and-footer-chrome-are-quieter.md +6 -0
  167. package/dist/templates/chat/changelog/2026-06-29-chat-layouts-adapt-when-the-agent-sidebar-is-open.md +6 -0
  168. package/dist/templates/chat/changelog/2026-07-08-settings-are-cleaner-and-searchable.md +5 -0
  169. package/dist/templates/chat/changelog/2026-07-10-chat-now-makes-ai-connection-setup-clear-without-shifting-th.md +6 -0
  170. package/dist/templates/chat/changelog/2026-07-13-a-full-agent-page-now-brings-context-files-connections-jobs-.md +6 -0
  171. package/dist/templates/chat/changelog/2026-07-14-chat-opens-reliably-on-hosted-deployments-instead-of-failing.md +6 -0
  172. package/dist/templates/chat/changelog/2026-07-14-fixed-chat-template-startup-with-older-core-versions.md +6 -0
  173. package/dist/templates/chat/changelog/2026-07-15-chat-navigation-focuses-on-chat-and-agent.md +6 -0
  174. package/dist/templates/chat/components.json +20 -0
  175. package/dist/templates/chat/data/.gitkeep +0 -0
  176. package/dist/templates/chat/data/sync-config.json +1 -0
  177. package/dist/templates/chat/learnings.defaults.md +5 -0
  178. package/dist/templates/chat/netlify.toml +10 -0
  179. package/dist/templates/chat/package.json +92 -0
  180. package/dist/templates/chat/public/agent-native-icon-dark.svg +10 -0
  181. package/dist/templates/chat/public/agent-native-icon-light.svg +10 -0
  182. package/dist/templates/chat/public/agent-native-logo-dark.svg +21 -0
  183. package/dist/templates/chat/public/agent-native-logo-light.svg +21 -0
  184. package/dist/templates/chat/public/favicon.svg +1 -0
  185. package/dist/templates/chat/public/icon-180.svg +1 -0
  186. package/dist/templates/chat/public/icon-192.svg +1 -0
  187. package/dist/templates/chat/public/icon-512.svg +1 -0
  188. package/dist/templates/chat/public/manifest.json +21 -0
  189. package/dist/templates/chat/react-router.config.ts +7 -0
  190. package/dist/templates/chat/server/middleware/auth.ts +15 -0
  191. package/dist/templates/chat/server/plugins/agent-chat.ts +21 -0
  192. package/dist/templates/chat/server/plugins/auth.ts +17 -0
  193. package/dist/templates/chat/server/routes/[...page].get.ts +5 -0
  194. package/dist/templates/chat/ssr-entry.ts +15 -0
  195. package/dist/templates/chat/tsconfig.json +21 -0
  196. package/dist/templates/chat/vite.config.ts +19 -0
  197. package/package.json +2 -1
  198. package/src/templates/chat/.agents/skills/actions/SKILL.md +492 -0
  199. package/src/templates/chat/.agents/skills/adding-a-feature/SKILL.md +189 -0
  200. package/src/templates/chat/.agents/skills/agent-native-docs/SKILL.md +76 -0
  201. package/src/templates/chat/.agents/skills/capture-learnings/SKILL.md +89 -0
  202. package/src/templates/chat/.agents/skills/create-skill/SKILL.md +221 -0
  203. package/src/templates/chat/.agents/skills/delegate-to-agent/SKILL.md +263 -0
  204. package/src/templates/chat/.agents/skills/frontend-design/SKILL.md +112 -0
  205. package/src/templates/chat/.agents/skills/real-time-sync/SKILL.md +232 -0
  206. package/src/templates/chat/.agents/skills/security/SKILL.md +280 -0
  207. package/src/templates/chat/.agents/skills/self-modifying-code/SKILL.md +106 -0
  208. package/src/templates/chat/.agents/skills/shadcn-ui/SKILL.md +95 -0
  209. package/src/templates/chat/.agents/skills/upgrade-agent-native/SKILL.md +87 -0
  210. package/src/templates/chat/.env.example +5 -0
  211. package/src/templates/chat/.ignore +0 -0
  212. package/src/templates/chat/.oxfmtrc.json +8 -0
  213. package/src/templates/chat/.react-router/types/+server-build.d.ts +18 -0
  214. package/src/templates/chat/.react-router/types/app/+types/root.ts +68 -0
  215. package/src/templates/chat/AGENTS.md +62 -0
  216. package/src/templates/chat/CHANGELOG.md +10 -0
  217. package/src/templates/chat/DEVELOPING.md +185 -0
  218. package/src/templates/chat/README.md +32 -0
  219. package/src/templates/chat/_gitignore +43 -0
  220. package/src/templates/chat/actions/hello.spec.ts +23 -0
  221. package/src/templates/chat/actions/hello.ts +13 -0
  222. package/src/templates/chat/actions/navigate.spec.ts +68 -0
  223. package/src/templates/chat/actions/navigate.ts +41 -0
  224. package/src/templates/chat/actions/run.ts +2 -0
  225. package/src/templates/chat/actions/view-screen.spec.ts +40 -0
  226. package/src/templates/chat/actions/view-screen.ts +31 -0
  227. package/src/templates/chat/app/components/layout/Header.tsx +59 -0
  228. package/src/templates/chat/app/components/layout/Layout.tsx +184 -0
  229. package/src/templates/chat/app/components/layout/Sidebar.tsx +580 -0
  230. package/src/templates/chat/app/components/ui/button.tsx +1 -0
  231. package/src/templates/chat/app/components/ui/card.tsx +1 -0
  232. package/src/templates/chat/app/components/ui/dropdown-menu.tsx +1 -0
  233. package/src/templates/chat/app/components/ui/input.tsx +1 -0
  234. package/src/templates/chat/app/components/ui/label.tsx +1 -0
  235. package/src/templates/chat/app/components/ui/sheet.tsx +1 -0
  236. package/src/templates/chat/app/components/ui/toolkit-provider.tsx +12 -0
  237. package/src/templates/chat/app/components/ui/tooltip.tsx +1 -0
  238. package/src/templates/chat/app/entry.client.tsx +19 -0
  239. package/src/templates/chat/app/entry.server.tsx +10 -0
  240. package/src/templates/chat/app/global.css +93 -0
  241. package/src/templates/chat/app/hooks/use-navigation-state.ts +111 -0
  242. package/src/templates/chat/app/i18n/ar-SA.ts +68 -0
  243. package/src/templates/chat/app/i18n/de-DE.ts +71 -0
  244. package/src/templates/chat/app/i18n/en-US.ts +70 -0
  245. package/src/templates/chat/app/i18n/es-ES.ts +71 -0
  246. package/src/templates/chat/app/i18n/fr-FR.ts +71 -0
  247. package/src/templates/chat/app/i18n/hi-IN.ts +69 -0
  248. package/src/templates/chat/app/i18n/index.ts +34 -0
  249. package/src/templates/chat/app/i18n/ja-JP.ts +70 -0
  250. package/src/templates/chat/app/i18n/ko-KR.ts +70 -0
  251. package/src/templates/chat/app/i18n/pt-BR.ts +71 -0
  252. package/src/templates/chat/app/i18n/zh-CN.ts +67 -0
  253. package/src/templates/chat/app/i18n/zh-TW.ts +67 -0
  254. package/src/templates/chat/app/i18n-data.ts +556 -0
  255. package/src/templates/chat/app/lib/agent-page.spec.tsx +52 -0
  256. package/src/templates/chat/app/lib/agent-page.tsx +40 -0
  257. package/src/templates/chat/app/lib/app-config.ts +11 -0
  258. package/src/templates/chat/app/lib/tab-id.ts +1 -0
  259. package/src/templates/chat/app/lib/utils.ts +1 -0
  260. package/src/templates/chat/app/root.tsx +172 -0
  261. package/src/templates/chat/app/routes/_index.tsx +91 -0
  262. package/src/templates/chat/app/routes/agent.tsx +17 -0
  263. package/src/templates/chat/app/routes/chat.$threadId.tsx +1 -0
  264. package/src/templates/chat/app/routes/database.tsx +17 -0
  265. package/src/templates/chat/app/routes/extensions.$id.$slug.tsx +2 -0
  266. package/src/templates/chat/app/routes/extensions.$id.tsx +11 -0
  267. package/src/templates/chat/app/routes/extensions._index.tsx +11 -0
  268. package/src/templates/chat/app/routes/extensions.tsx +5 -0
  269. package/src/templates/chat/app/routes/observability.tsx +18 -0
  270. package/src/templates/chat/app/routes/settings.tsx +88 -0
  271. package/src/templates/chat/app/routes/team.tsx +11 -0
  272. package/src/templates/chat/app/routes.ts +4 -0
  273. package/src/templates/chat/app/vite-env.d.ts +6 -0
  274. package/src/templates/chat/changelog/2026-06-24-a-new-settings-page-gives-quick-access-to-language-workspace.md +6 -0
  275. package/src/templates/chat/changelog/2026-06-24-added-a-language-picker-and-localized-app-chrome-for-support.md +6 -0
  276. package/src/templates/chat/changelog/2026-06-27-traditional-chinese-copy-uses-taiwan-terminology.md +6 -0
  277. package/src/templates/chat/changelog/2026-06-28-left-sidebar-collapse-motion-and-footer-chrome-are-quieter.md +6 -0
  278. package/src/templates/chat/changelog/2026-06-29-chat-layouts-adapt-when-the-agent-sidebar-is-open.md +6 -0
  279. package/src/templates/chat/changelog/2026-07-08-settings-are-cleaner-and-searchable.md +5 -0
  280. package/src/templates/chat/changelog/2026-07-10-chat-now-makes-ai-connection-setup-clear-without-shifting-th.md +6 -0
  281. package/src/templates/chat/changelog/2026-07-13-a-full-agent-page-now-brings-context-files-connections-jobs-.md +6 -0
  282. package/src/templates/chat/changelog/2026-07-14-chat-opens-reliably-on-hosted-deployments-instead-of-failing.md +6 -0
  283. package/src/templates/chat/changelog/2026-07-14-fixed-chat-template-startup-with-older-core-versions.md +6 -0
  284. package/src/templates/chat/changelog/2026-07-15-chat-navigation-focuses-on-chat-and-agent.md +6 -0
  285. package/src/templates/chat/components.json +20 -0
  286. package/src/templates/chat/data/.gitkeep +0 -0
  287. package/src/templates/chat/data/sync-config.json +1 -0
  288. package/src/templates/chat/learnings.defaults.md +5 -0
  289. package/src/templates/chat/netlify.toml +10 -0
  290. package/src/templates/chat/package.json +92 -0
  291. package/src/templates/chat/public/agent-native-icon-dark.svg +10 -0
  292. package/src/templates/chat/public/agent-native-icon-light.svg +10 -0
  293. package/src/templates/chat/public/agent-native-logo-dark.svg +21 -0
  294. package/src/templates/chat/public/agent-native-logo-light.svg +21 -0
  295. package/src/templates/chat/public/favicon.svg +1 -0
  296. package/src/templates/chat/public/icon-180.svg +1 -0
  297. package/src/templates/chat/public/icon-192.svg +1 -0
  298. package/src/templates/chat/public/icon-512.svg +1 -0
  299. package/src/templates/chat/public/manifest.json +21 -0
  300. package/src/templates/chat/react-router.config.ts +7 -0
  301. package/src/templates/chat/server/middleware/auth.ts +15 -0
  302. package/src/templates/chat/server/plugins/agent-chat.ts +21 -0
  303. package/src/templates/chat/server/plugins/auth.ts +17 -0
  304. package/src/templates/chat/server/routes/[...page].get.ts +5 -0
  305. package/src/templates/chat/ssr-entry.ts +15 -0
  306. package/src/templates/chat/tsconfig.json +21 -0
  307. package/src/templates/chat/vite.config.ts +19 -0
package/corpus/README.md CHANGED
@@ -28,4 +28,4 @@ rg -n "defineAction|useActionQuery" node_modules/@agent-native/core/corpus
28
28
  ## Generated Counts
29
29
 
30
30
  - core files: 2258
31
- - template files: 5674
31
+ - template files: 5678
@@ -1,5 +1,20 @@
1
1
  # @agent-native/core
2
2
 
3
+ ## 0.101.14
4
+
5
+ ### Patch Changes
6
+
7
+ - 866d8f0: Bundle the Chat template in the CLI package and download GitHub fallbacks directly from codeload for faster, more reliable scaffolding.
8
+ - 866d8f0: Polish the chat sidebar header by hiding mode tabs and moving full-view navigation into the icon row.
9
+
10
+ ## 0.101.13
11
+
12
+ ### Patch Changes
13
+
14
+ - e503433: Keep CLI repository downloads asynchronous and challenge bare loopback MCP URLs for OAuth clients.
15
+ - e503433: Keep completed chat work disclosures collapsed and stable when submitting a later message.
16
+ - e503433: Remove the automatic first-session personalization questions from agent chat so new requests are handled directly.
17
+
3
18
  ## 0.101.12
4
19
 
5
20
  ### Patch Changes
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-native/core",
3
- "version": "0.101.12",
3
+ "version": "0.101.14",
4
4
  "description": "Framework for agent-native application development — where AI agents and UI share SQL state, actions, and context",
5
5
  "homepage": "https://github.com/BuilderIO/agent-native#readme",
6
6
  "bugs": {
@@ -24,6 +24,7 @@
24
24
  "tsconfig.base.json",
25
25
  "src/templates/default",
26
26
  "src/templates/headless",
27
+ "src/templates/chat",
27
28
  "src/templates/workspace-core",
28
29
  "src/templates/workspace-root"
29
30
  ],
@@ -249,7 +250,8 @@
249
250
  "dev": "tsc --watch",
250
251
  "typecheck": "tsc --noEmit",
251
252
  "test": "vitest --run src --maxWorkers=25%",
252
- "prepack": "tsx ../../scripts/sync-workspace-core-skills.ts --check && npm run build && cp ../../README.md ./README.md",
253
+ "prepack": "tsx ../../scripts/sync-core-first-party-templates.ts && tsx ../../scripts/sync-workspace-core-skills.ts --check && npm run build && cp ../../README.md ./README.md",
254
+ "postpack": "tsx ../../scripts/sync-core-first-party-templates.ts --clean",
253
255
  "prepublishOnly": "npm run build"
254
256
  },
255
257
  "dependencies": {
@@ -1,4 +1,4 @@
1
- import { execFileSync } from "child_process";
1
+ import { execFile, execFileSync } from "child_process";
2
2
  import fs from "fs";
3
3
  import path from "path";
4
4
  import { fileURLToPath, pathToFileURL } from "url";
@@ -785,7 +785,8 @@ function cleanupOnFailure(targetDir: string): void {
785
785
  * Scaffold a single app template into `targetDir`. Resolves:
786
786
  * - "headless" / legacy "blank" → bundled action-first template
787
787
  * - "github:user/repo" → download the whole repo
788
- * - first-party template name → download that subdir from BuilderIO/agent-native
788
+ * - first-party template name → use a bundled copy or download its subdir
789
+ * from BuilderIO/agent-native
789
790
  */
790
791
  async function scaffoldAppTemplate(
791
792
  targetDir: string,
@@ -842,15 +843,26 @@ function templateSourceName(name: string): string {
842
843
  }
843
844
 
844
845
  /**
845
- * When developing the framework itself, prefer the sibling templates/<name>
846
- * directory. Returns undefined when running as a published package.
846
+ * Prefer a nearby templates/<name> or src/templates/<name> directory. This
847
+ * covers the framework checkout, the dist/templates copy bundled into
848
+ * published CLI packages, and source templates included in package files;
849
+ * packages that do not bundle a template fall back to GitHub.
847
850
  */
848
851
  function findLocalTemplate(name: string): string | undefined {
849
- let dir = path.resolve(__dirname);
852
+ return findLocalTemplateFrom(path.resolve(__dirname), name);
853
+ }
854
+
855
+ function findLocalTemplateFrom(
856
+ startDir: string,
857
+ name: string,
858
+ ): string | undefined {
859
+ let dir = path.resolve(startDir);
850
860
  for (let i = 0; i < 10; i++) {
851
- const candidate = path.join(dir, "templates", name);
852
- if (fs.existsSync(path.join(candidate, "package.json"))) {
853
- return candidate;
861
+ for (const templatesDir of ["templates", "src/templates"]) {
862
+ const candidate = path.join(dir, templatesDir, name);
863
+ if (fs.existsSync(path.join(candidate, "package.json"))) {
864
+ return candidate;
865
+ }
854
866
  }
855
867
  const parent = path.dirname(dir);
856
868
  if (parent === dir) break;
@@ -1332,6 +1344,8 @@ export {
1332
1344
  getToolkitDependencyVersion as _getToolkitDependencyVersion,
1333
1345
  getGitHubTemplateRef as _getGitHubTemplateRef,
1334
1346
  getGitHubTemplateRefCandidates as _getGitHubTemplateRefCandidates,
1347
+ githubTarballUrl as _githubTarballUrl,
1348
+ findLocalTemplateFrom as _findLocalTemplateFrom,
1335
1349
  workspaceAppNameForTemplateSelection as _workspaceAppNameForTemplateSelection,
1336
1350
  shouldSkipScaffoldEntry as _shouldSkipScaffoldEntry,
1337
1351
  tarExtractArgs as _tarExtractArgs,
@@ -1363,18 +1377,53 @@ function tarExtractArgs(
1363
1377
  return ["xzf", tarPath, "--strip-components=1", ...excludes, "-C", destDir];
1364
1378
  }
1365
1379
 
1366
- function downloadAndExtract(
1380
+ function execFileBuffer(
1381
+ command: string,
1382
+ args: string[],
1383
+ options: { maxBuffer: number },
1384
+ ): Promise<Buffer> {
1385
+ return new Promise((resolve, reject) => {
1386
+ execFile(
1387
+ command,
1388
+ args,
1389
+ { ...options, encoding: "buffer" },
1390
+ (error, stdout, stderr) => {
1391
+ if (error) {
1392
+ const detail = stderr?.toString().trim();
1393
+ if (detail) error.message = `${error.message}: ${detail}`;
1394
+ reject(error);
1395
+ return;
1396
+ }
1397
+ resolve(Buffer.isBuffer(stdout) ? stdout : Buffer.from(stdout));
1398
+ },
1399
+ );
1400
+ });
1401
+ }
1402
+
1403
+ async function downloadAndExtract(
1367
1404
  url: string,
1368
1405
  destDir: string,
1369
1406
  options: { skipAgentSymlinks?: boolean } = {},
1370
- ): void {
1407
+ ): Promise<void> {
1371
1408
  fs.mkdirSync(destDir, { recursive: true });
1372
1409
  // --fail-with-body so curl exits non-zero on HTTP 4xx/5xx instead of writing
1373
1410
  // the error body (HTML/JSON) to disk where tar then fails with the opaque
1374
1411
  // "Unrecognized archive format" message.
1375
- const tarball = execFileSync("curl", ["--fail-with-body", "-sL", url], {
1376
- maxBuffer: 100 * 1024 * 1024,
1377
- });
1412
+ // Keep this asynchronous: a synchronous curl blocks the event loop, which
1413
+ // makes the create command's spinner look frozen during the GitHub fetch.
1414
+ const tarball = await execFileBuffer(
1415
+ "curl",
1416
+ [
1417
+ "--fail-with-body",
1418
+ "--connect-timeout",
1419
+ "10",
1420
+ "--max-time",
1421
+ "120",
1422
+ "-sSL",
1423
+ url,
1424
+ ],
1425
+ { maxBuffer: 100 * 1024 * 1024 },
1426
+ );
1378
1427
  const tarPath = path.join(destDir, ".download.tar.gz");
1379
1428
  fs.writeFileSync(tarPath, tarball);
1380
1429
  try {
@@ -1400,14 +1449,16 @@ async function downloadGitHubSubdir(
1400
1449
  }
1401
1450
  const errors: string[] = [];
1402
1451
  for (const ref of refs) {
1403
- const tarUrl = `https://api.github.com/repos/${repo}/tarball/${encodeURIComponent(ref)}`;
1452
+ const tarUrl = githubTarballUrl(repo, ref, "tag");
1404
1453
  const tmpDir = path.join(
1405
1454
  targetDir,
1406
1455
  "..",
1407
1456
  `.agent-native-tmp-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`,
1408
1457
  );
1409
1458
  try {
1410
- downloadAndExtract(tarUrl, tmpDir, { skipAgentSymlinks: repo === REPO });
1459
+ await downloadAndExtract(tarUrl, tmpDir, {
1460
+ skipAgentSymlinks: repo === REPO,
1461
+ });
1411
1462
  const srcDir = path.join(tmpDir, subdir);
1412
1463
  if (!fs.existsSync(srcDir)) {
1413
1464
  throw new Error(
@@ -1434,8 +1485,16 @@ async function downloadGitHubRepo(
1434
1485
  targetDir: string,
1435
1486
  ): Promise<void> {
1436
1487
  validateRepoName(repo);
1437
- const tarUrl = `https://api.github.com/repos/${repo}/tarball/main`;
1438
- downloadAndExtract(tarUrl, targetDir);
1488
+ const tarUrl = githubTarballUrl(repo, "main", "branch");
1489
+ await downloadAndExtract(tarUrl, targetDir);
1490
+ }
1491
+
1492
+ function githubTarballUrl(
1493
+ repo: string,
1494
+ ref: string,
1495
+ kind: "branch" | "tag",
1496
+ ): string {
1497
+ return `https://codeload.github.com/${repo}/tar.gz/refs/${kind === "tag" ? "tags" : "heads"}/${encodeURIComponent(ref)}`;
1439
1498
  }
1440
1499
 
1441
1500
  /* ─────────────────────────────────────────────────────────────────────────
@@ -437,6 +437,19 @@ export function shouldShowAgentPanelCliTabBar(cliTabs: string[]) {
437
437
  return cliTabs.length > 1;
438
438
  }
439
439
 
440
+ export function shouldShowAgentPanelModeButtons(isSidebar: boolean) {
441
+ return !isSidebar;
442
+ }
443
+
444
+ export function shouldShowAgentPanelFullViewAction(
445
+ agentPageHref: string | undefined,
446
+ mode: PanelMode,
447
+ ) {
448
+ return (
449
+ Boolean(agentPageHref) && (mode === "resources" || mode === "settings")
450
+ );
451
+ }
452
+
440
453
  // ─── AgentPanel ─────────────────────────────────────────────────────────────
441
454
 
442
455
  export interface AgentPanelCodeAccess {
@@ -1171,33 +1184,34 @@ function AgentPanelInner({
1171
1184
  | "toggleHistory"
1172
1185
  > & { activeChatSessionId?: string }) => (
1173
1186
  <div className="relative flex shrink-0 items-center gap-0.5">
1174
- {SHOW_ONBOARDING && (
1187
+ {!onCollapse && SHOW_ONBOARDING && (
1175
1188
  <Suspense fallback={null}>
1176
1189
  <SetupButton />
1177
1190
  </Suspense>
1178
1191
  )}
1179
- {(() => {
1180
- const activeTab =
1181
- mode === "chat" && activeChatSessionId
1182
- ? tabs.find((tab) => tab.id === activeChatSessionId)
1183
- : undefined;
1184
- if (
1185
- !activeTab ||
1186
- (activeTabMessageCount <= 0 && activeTab.status === "idle")
1187
- ) {
1188
- return null;
1189
- }
1190
- return (
1191
- <ShareButton
1192
- resourceType="chat_thread"
1193
- resourceId={activeTab.id}
1194
- resourceTitle={activeTab.label || "Chat"}
1195
- shareUrl={getChatThreadShareUrl(activeTab.id)}
1196
- trigger="icon"
1197
- triggerClassName="h-7 w-7"
1198
- />
1199
- );
1200
- })()}
1192
+ {!onCollapse &&
1193
+ (() => {
1194
+ const activeTab =
1195
+ mode === "chat" && activeChatSessionId
1196
+ ? tabs.find((tab) => tab.id === activeChatSessionId)
1197
+ : undefined;
1198
+ if (
1199
+ !activeTab ||
1200
+ (activeTabMessageCount <= 0 && activeTab.status === "idle")
1201
+ ) {
1202
+ return null;
1203
+ }
1204
+ return (
1205
+ <ShareButton
1206
+ resourceType="chat_thread"
1207
+ resourceId={activeTab.id}
1208
+ resourceTitle={activeTab.label || "Chat"}
1209
+ shareUrl={getChatThreadShareUrl(activeTab.id)}
1210
+ trigger="icon"
1211
+ triggerClassName="h-7 w-7"
1212
+ />
1213
+ );
1214
+ })()}
1201
1215
  <FeedbackButton
1202
1216
  variant="icon"
1203
1217
  side="bottom"
@@ -1215,7 +1229,7 @@ function AgentPanelInner({
1215
1229
  />
1216
1230
  }
1217
1231
  />
1218
- {mode === "chat" && (
1232
+ {!onCollapse && mode === "chat" && (
1219
1233
  <IconTooltip content={t("agentPanel.newChat")}>
1220
1234
  <button
1221
1235
  onClick={addTab}
@@ -1226,7 +1240,7 @@ function AgentPanelInner({
1226
1240
  </button>
1227
1241
  </IconTooltip>
1228
1242
  )}
1229
- {mode === "cli" && canUseCodeTools && (
1243
+ {!onCollapse && mode === "cli" && canUseCodeTools && (
1230
1244
  <IconTooltip content={t("agentPanel.newTerminal")}>
1231
1245
  <button
1232
1246
  onClick={addCliTab}
@@ -1237,6 +1251,18 @@ function AgentPanelInner({
1237
1251
  </button>
1238
1252
  </IconTooltip>
1239
1253
  )}
1254
+ {agentPageHref &&
1255
+ shouldShowAgentPanelFullViewAction(agentPageHref, mode) && (
1256
+ <IconTooltip content={t("agentPanel.openFullView")}>
1257
+ <Link
1258
+ to={agentPageHref}
1259
+ aria-label={t("agentPanel.openFullView")}
1260
+ className="flex h-6 w-6 items-center justify-center rounded text-muted-foreground hover:bg-accent/50 hover:text-foreground"
1261
+ >
1262
+ <IconArrowsMaximize size={14} />
1263
+ </Link>
1264
+ </IconTooltip>
1265
+ )}
1240
1266
  <DropdownMenu open={headerMenuOpen} onOpenChange={setHeaderMenuOpen}>
1241
1267
  <DropdownMenuTrigger asChild>
1242
1268
  <button
@@ -1266,6 +1292,12 @@ function AgentPanelInner({
1266
1292
  <DropdownMenuSeparator />
1267
1293
  </>
1268
1294
  )}
1295
+ {onCollapse && mode === "chat" && (
1296
+ <DropdownMenuItem onSelect={addTab}>
1297
+ <IconPlus size={14} className="shrink-0" />
1298
+ {t("agentPanel.newChat")}
1299
+ </DropdownMenuItem>
1300
+ )}
1269
1301
  {mode === "chat" && toggleHistory && (
1270
1302
  <DropdownMenuItem onSelect={toggleHistory}>
1271
1303
  <IconHistory size={14} className="shrink-0" />
@@ -1430,6 +1462,7 @@ function AgentPanelInner({
1430
1462
  headerMenuOpen,
1431
1463
  isFullscreen,
1432
1464
  mode,
1465
+ agentPageHref,
1433
1466
  onCollapse,
1434
1467
  onToggleFullscreen,
1435
1468
  openRunThread,
@@ -1547,7 +1580,9 @@ function AgentPanelInner({
1547
1580
  style={AGENT_PANEL_HEADER_STYLE}
1548
1581
  >
1549
1582
  <div className="flex min-w-0 flex-1 items-center gap-1 overflow-hidden">
1550
- {renderModeButtons(mode)}
1583
+ {shouldShowAgentPanelModeButtons(Boolean(onCollapse))
1584
+ ? renderModeButtons(mode)
1585
+ : null}
1551
1586
  </div>
1552
1587
  <div className="flex items-center gap-0.5">
1553
1588
  {renderHeaderActions({
@@ -1939,17 +1974,6 @@ function AgentPanelInner({
1939
1974
  {/* Resources view */}
1940
1975
  {mode === "resources" && (
1941
1976
  <div className="flex flex-1 flex-col min-h-0">
1942
- {agentPageHref && (
1943
- <div className="flex shrink-0 justify-end border-b border-border px-3 py-1.5">
1944
- <Link
1945
- to={agentPageHref}
1946
- className="inline-flex cursor-pointer items-center gap-1 text-[11px] font-medium text-muted-foreground hover:text-foreground"
1947
- >
1948
- {t("agentPanel.openFullView")}
1949
- <IconExternalLink className="h-3 w-3" />
1950
- </Link>
1951
- </div>
1952
- )}
1953
1977
  <Suspense
1954
1978
  fallback={
1955
1979
  <div className="flex h-full flex-col min-h-0">
@@ -1970,17 +1994,6 @@ function AgentPanelInner({
1970
1994
  {/* Settings / Setup view */}
1971
1995
  {mode === "settings" && (
1972
1996
  <div className="flex flex-col flex-1 min-h-0">
1973
- {agentPageHref && (
1974
- <div className="flex shrink-0 justify-end border-b border-border px-3 py-1.5">
1975
- <Link
1976
- to={agentPageHref}
1977
- className="inline-flex cursor-pointer items-center gap-1 text-[11px] font-medium text-muted-foreground hover:text-foreground"
1978
- >
1979
- {t("agentPanel.openFullView")}
1980
- <IconExternalLink className="h-3 w-3" />
1981
- </Link>
1982
- </div>
1983
- )}
1984
1997
  <Suspense
1985
1998
  fallback={
1986
1999
  <div className="p-3 space-y-2">
@@ -38,6 +38,8 @@ export function isAssistantUiRecoverableRenderError(error: unknown): boolean {
38
38
 
39
39
  type AssistantUiStaleIndexErrorBoundaryProps = {
40
40
  resetKey: string;
41
+ /** Remount children when the recovery scope changes. */
42
+ remountOnResetKey?: boolean;
41
43
  componentName?: string;
42
44
  children: React.ReactNode;
43
45
  };
@@ -173,10 +175,13 @@ export class AssistantUiStaleIndexErrorBoundary extends React.Component<
173
175
  return null;
174
176
  }
175
177
 
178
+ const fragmentKey =
179
+ this.props.remountOnResetKey === false
180
+ ? String(this.state.retryToken)
181
+ : `${this.props.resetKey}:${this.state.retryToken}`;
182
+
176
183
  return (
177
- <React.Fragment key={`${this.props.resetKey}:${this.state.retryToken}`}>
178
- {this.props.children}
179
- </React.Fragment>
184
+ <React.Fragment key={fragmentKey}>{this.props.children}</React.Fragment>
180
185
  );
181
186
  }
182
187
  }
@@ -191,6 +196,7 @@ export function AssistantMessageListErrorBoundary({
191
196
  return (
192
197
  <AssistantUiStaleIndexErrorBoundary
193
198
  resetKey={resetKey}
199
+ remountOnResetKey={false}
194
200
  componentName="AssistantMessageList"
195
201
  >
196
202
  {children}
@@ -848,6 +848,25 @@ export function shouldShowAssistantMessageFooter({
848
848
  return !chatRunning && statusIsTerminal;
849
849
  }
850
850
 
851
+ export function shouldShowAssistantWorkSummary({
852
+ isLast,
853
+ isComplete,
854
+ hasCollapsibleWork,
855
+ hasUnresolvedTool,
856
+ }: {
857
+ isLast: boolean;
858
+ isComplete: boolean;
859
+ hasCollapsibleWork: boolean;
860
+ hasUnresolvedTool: boolean;
861
+ }): boolean {
862
+ if (!hasCollapsibleWork || hasUnresolvedTool) return false;
863
+
864
+ // Keep completed historical work wrapped while a later turn is running.
865
+ // Removing the wrapper exposes/remounts ReasoningCell and resets its
866
+ // disclosure state to the default-open value on every new submission.
867
+ return isComplete || !isLast;
868
+ }
869
+
851
870
  function ReasoningMessagePart() {
852
871
  const part = useMessagePartReasoning();
853
872
  const partRuntime = useMessagePartRuntime();
@@ -882,6 +901,7 @@ function ReasoningMessagePart() {
882
901
  <ReasoningCell
883
902
  text={part.text}
884
903
  isStreaming={isStreaming}
904
+ resetKey={`message-reasoning-${partIndex}`}
885
905
  durationMs={durationMs}
886
906
  defaultOpen={partIndex === latestReasoningPartIndex}
887
907
  collapseWhenReplaced={partIndex < latestReasoningPartIndex}
@@ -1040,8 +1060,12 @@ export function AssistantMessage() {
1040
1060
  {({ part, children }) => {
1041
1061
  switch (part.type) {
1042
1062
  case "group-work": {
1043
- const showSummary =
1044
- isComplete && !chatRunning && hasCollapsibleWork;
1063
+ const showSummary = shouldShowAssistantWorkSummary({
1064
+ isLast,
1065
+ isComplete,
1066
+ hasCollapsibleWork,
1067
+ hasUnresolvedTool,
1068
+ });
1045
1069
  if (!showSummary) return <>{children}</>;
1046
1070
  return (
1047
1071
  <WorkedForSummary
@@ -52,6 +52,7 @@ import {
52
52
  markdownModule,
53
53
  remarkGfmFn,
54
54
  markdownUrlTransform,
55
+ useSmoothStreamingText,
55
56
  } from "./markdown-renderer.js";
56
57
  import { resolveToolRenderer } from "./tool-render-registry.js";
57
58
  import {
@@ -929,6 +930,7 @@ export function ReconnectStreamMessage({
929
930
  key={`reconnect-reasoning-${i}`}
930
931
  text={part.text}
931
932
  isStreaming={chatRunning && i === streamingReasoningPartIndex}
933
+ resetKey={`reconnect-reasoning-${i}`}
932
934
  defaultOpen={i === latestReasoningPartIndex}
933
935
  collapseWhenReplaced={i < latestReasoningPartIndex}
934
936
  />
@@ -973,6 +975,7 @@ const WorkSummaryContentContext = React.createContext(false);
973
975
  export function ReasoningCell({
974
976
  text,
975
977
  isStreaming = false,
978
+ resetKey,
976
979
  defaultOpen,
977
980
  autoCollapse = false,
978
981
  collapseWhenReplaced = false,
@@ -980,6 +983,8 @@ export function ReasoningCell({
980
983
  }: {
981
984
  text: string;
982
985
  isStreaming?: boolean;
986
+ /** Stable identity used to restart the reveal when a new reasoning part mounts. */
987
+ resetKey?: string;
983
988
  defaultOpen?: boolean;
984
989
  /** Animate closed when a live reasoning segment finishes during a run. */
985
990
  autoCollapse?: boolean;
@@ -998,6 +1003,11 @@ export function ReasoningCell({
998
1003
  const wasStreamingRef = useRef(isStreaming);
999
1004
  const wasReplacedRef = useRef(collapseWhenReplaced);
1000
1005
  const trimmed = text.trim();
1006
+ const visibleText = useSmoothStreamingText(
1007
+ trimmed,
1008
+ isStreaming,
1009
+ resetKey ?? "reasoning",
1010
+ );
1001
1011
 
1002
1012
  useEffect(() => {
1003
1013
  if (autoCollapse && wasStreamingRef.current && !isStreaming) {
@@ -1018,7 +1028,7 @@ export function ReasoningCell({
1018
1028
  if (embeddedInWorkSummary) {
1019
1029
  return (
1020
1030
  <div className="pb-1 pl-5 text-[13px] leading-relaxed text-muted-foreground whitespace-pre-wrap">
1021
- {trimmed || (isStreaming ? "…" : "")}
1031
+ {visibleText || (isStreaming ? "…" : "")}
1022
1032
  </div>
1023
1033
  );
1024
1034
  }
@@ -1055,7 +1065,7 @@ export function ReasoningCell({
1055
1065
  <AnimatedCollapse open={open}>
1056
1066
  <div className={cn("pl-5 pb-1", showTail && "reasoning-cell-tail")}>
1057
1067
  <div className="text-[13px] leading-relaxed text-muted-foreground whitespace-pre-wrap">
1058
- {trimmed || (isStreaming ? "…" : "")}
1068
+ {visibleText || (isStreaming ? "…" : "")}
1059
1069
  </div>
1060
1070
  </div>
1061
1071
  </AnimatedCollapse>
@@ -1088,20 +1098,17 @@ export function WorkedForSummary({
1088
1098
  children,
1089
1099
  }: {
1090
1100
  durationMs?: number | null;
1091
- /** When true, start open then animate closed (post-run collapse). */
1101
+ /** When true, close the summary after a run has completed. */
1092
1102
  autoCollapse?: boolean;
1093
1103
  children: React.ReactNode;
1094
1104
  }) {
1095
- const [open, setOpen] = useState(autoCollapse);
1096
- const didAutoCollapseRef = useRef(false);
1105
+ // Start closed so a remounted completed message never flashes its work
1106
+ // details open while auto-collapse settles. If the summary was already
1107
+ // open when autoCollapse changes, AnimatedCollapse still animates it shut.
1108
+ const [open, setOpen] = useState(false);
1097
1109
 
1098
1110
  useEffect(() => {
1099
- if (!autoCollapse || didAutoCollapseRef.current) return;
1100
- didAutoCollapseRef.current = true;
1101
- const frame = requestAnimationFrame(() => {
1102
- setOpen(false);
1103
- });
1104
- return () => cancelAnimationFrame(frame);
1111
+ if (autoCollapse) setOpen(false);
1105
1112
  }, [autoCollapse]);
1106
1113
 
1107
1114
  const label =
@@ -310,9 +310,18 @@ export async function handleMcpRequest(
310
310
  // must fail closed rather than trust a spoofable owner-email header that
311
311
  // `fullSurface` would otherwise escalate to the full mutating surface.
312
312
  const requestMeta = deriveRequestMeta(event);
313
+ const hasLocalOwnerHint = Boolean(ownerEmailHeader?.trim());
313
314
  const authResult = await verifyAuth(authHeader, ownerEmailHeader, {
315
+ // A bare localhost URL is still a protected MCP resource. This lets
316
+ // OAuth-native hosts (Kiro, Claude Code, etc.) receive the standard 401
317
+ // challenge and open browser approval instead of silently getting the
318
+ // sparse anonymous dev surface. The stdio proxy remains zero-config for
319
+ // local installs because it forwards an owner hint; an explicit opt-in is
320
+ // available for local diagnostics.
314
321
  allowDevOpen:
315
- isLoopbackRequest(event) && isLoopbackOrigin(requestMeta.origin),
322
+ isLoopbackRequest(event) &&
323
+ isLoopbackOrigin(requestMeta.origin) &&
324
+ (hasLocalOwnerHint || process.env.AGENT_NATIVE_MCP_DEV_OPEN === "1"),
316
325
  resourceUrl: getMcpOAuthAudiences(event),
317
326
  });
318
327
  if (!authResult.authed) {
@@ -45,9 +45,6 @@ export function buildFrameworkPrompts(
45
45
  PROD_FRAMEWORK_PROMPT_COMPACT: string;
46
46
  DEV_FRAMEWORK_PROMPT_COMPACT: string;
47
47
  } {
48
- // Note: FIRST_SESSION_PERSONALIZATION is NOT appended here — it is injected
49
- // at per-request prompt-assembly time only for new threads (no prior messages).
50
- // This prevents the ~1.5KB block from appearing on every request forever.
51
48
  const FRAMEWORK_CORE = buildFrameworkCore(examples, options);
52
49
  const FRAMEWORK_CORE_COMPACT = buildFrameworkCoreCompact(examples, options);
53
50
  const extensionToolsEnabled = options?.extensionTools !== false;