@agent-native/core 0.127.3 → 0.128.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 (457) hide show
  1. package/corpus/README.md +2 -2
  2. package/corpus/core/CHANGELOG.md +101 -0
  3. package/corpus/core/README.md +5 -26
  4. package/corpus/core/docs/content/actions.mdx +47 -4
  5. package/corpus/core/docs/content/native-chat-ui.mdx +7 -0
  6. package/corpus/core/docs/content/organizations-teams-permissions.mdx +109 -3
  7. package/corpus/core/docs/content/template-design-collaboration-and-full-apps.mdx +15 -0
  8. package/corpus/core/docs/content/toolkit-org-team.mdx +72 -12
  9. package/corpus/core/package.json +2 -1
  10. package/corpus/core/src/a2a/artifact-response.ts +36 -29
  11. package/corpus/core/src/action.ts +83 -2
  12. package/corpus/core/src/chat-threads/store.ts +48 -43
  13. package/corpus/core/src/cli/skills-content/design-visual-edit-skill.ts +46 -3
  14. package/corpus/core/src/client/AgentPanel.tsx +26 -6
  15. package/corpus/core/src/client/AssistantChat.tsx +63 -7
  16. package/corpus/core/src/client/DefaultSpinner.tsx +29 -0
  17. package/corpus/core/src/client/org/TeamPage.tsx +161 -6
  18. package/corpus/core/src/client/org/hooks.ts +67 -0
  19. package/corpus/core/src/client/org/index.ts +9 -0
  20. package/corpus/core/src/client/transcription/use-live-transcription.ts +62 -10
  21. package/corpus/core/src/db/client.ts +42 -3
  22. package/corpus/core/src/db/ensure-additive-columns.ts +60 -33
  23. package/corpus/core/src/deploy/build.ts +31 -2
  24. package/corpus/core/src/mcp-client/routes.ts +10 -1
  25. package/corpus/core/src/org/app-roles-handlers.ts +152 -0
  26. package/corpus/core/src/org/app-roles.ts +355 -0
  27. package/corpus/core/src/org/index.ts +27 -1
  28. package/corpus/core/src/org/migrations.ts +22 -0
  29. package/corpus/core/src/org/plugin.ts +27 -0
  30. package/corpus/core/src/org/schema.ts +15 -0
  31. package/corpus/core/src/scripts/docs/search.ts +17 -0
  32. package/corpus/core/src/scripts/docs/source-search.ts +10 -0
  33. package/corpus/core/src/server/agent-chat/script-entries.ts +3 -0
  34. package/corpus/core/src/server/agent-chat-plugin.ts +53 -52
  35. package/corpus/core/src/server/builder-design-systems.ts +299 -82
  36. package/corpus/core/src/server/core-routes-plugin.ts +6 -1
  37. package/corpus/core/src/server/framework-request-handler.ts +44 -6
  38. package/corpus/core/src/server/index.ts +8 -0
  39. package/corpus/core/src/templates/default/.agents/skills/actions/SKILL.md +32 -0
  40. package/corpus/core/src/templates/default/.agents/skills/adding-a-feature/SKILL.md +7 -0
  41. package/corpus/core/src/templates/default/.agents/skills/security/SKILL.md +31 -0
  42. package/corpus/core/src/templates/headless/.agents/skills/actions/SKILL.md +32 -0
  43. package/corpus/core/src/templates/workspace-core/.agents/skills/actions/SKILL.md +32 -0
  44. package/corpus/core/src/templates/workspace-core/.agents/skills/adding-a-feature/SKILL.md +7 -0
  45. package/corpus/core/src/templates/workspace-core/.agents/skills/authentication/SKILL.md +40 -0
  46. package/corpus/core/src/templates/workspace-core/.agents/skills/security/SKILL.md +31 -0
  47. package/corpus/core/src/templates/workspace-core/.agents/skills/sharing/SKILL.md +4 -0
  48. package/corpus/templates/analytics/.agents/skills/actions/SKILL.md +32 -0
  49. package/corpus/templates/analytics/.agents/skills/security/SKILL.md +31 -0
  50. package/corpus/templates/analytics/.agents/skills/sharing/SKILL.md +4 -0
  51. package/corpus/templates/analytics/_gitignore +2 -0
  52. package/corpus/templates/analytics/actions/data-source-status.ts +21 -12
  53. package/corpus/templates/analytics/app/global.css +7 -7
  54. package/corpus/templates/analytics/app/i18n-data.ts +30 -0
  55. package/corpus/templates/analytics/app/lib/data-source-status.ts +2 -1
  56. package/corpus/templates/analytics/app/pages/DataSources.tsx +54 -10
  57. package/corpus/templates/analytics/changelog/2026-07-28-analytics-pages-load-reliably-with-large-dashboard-workspaces.md +6 -0
  58. package/corpus/templates/analytics/changelog/2026-07-28-dashboard-loading-shimmer-now-flows-smoothly-in-one-directi.md +6 -0
  59. package/corpus/templates/analytics/server/lib/first-party-dashboard-repair.ts +5 -4
  60. package/corpus/templates/analytics/server/plugins/agent-chat.ts +54 -42
  61. package/corpus/templates/analytics/server/plugins/db.ts +1 -18
  62. package/corpus/templates/assets/.agents/skills/actions/SKILL.md +32 -0
  63. package/corpus/templates/assets/.agents/skills/security/SKILL.md +31 -0
  64. package/corpus/templates/assets/.agents/skills/sharing/SKILL.md +4 -0
  65. package/corpus/templates/assets/_gitignore +2 -0
  66. package/corpus/templates/brain/.agents/skills/actions/SKILL.md +32 -0
  67. package/corpus/templates/brain/.agents/skills/adding-a-feature/SKILL.md +7 -0
  68. package/corpus/templates/brain/.agents/skills/security/SKILL.md +31 -0
  69. package/corpus/templates/brain/.agents/skills/sharing/SKILL.md +4 -0
  70. package/corpus/templates/calendar/.agents/skills/actions/SKILL.md +32 -0
  71. package/corpus/templates/calendar/.agents/skills/security/SKILL.md +31 -0
  72. package/corpus/templates/calendar/.agents/skills/sharing/SKILL.md +4 -0
  73. package/corpus/templates/calendar/_gitignore +2 -0
  74. package/corpus/templates/chat/.agents/skills/actions/SKILL.md +32 -0
  75. package/corpus/templates/chat/.agents/skills/adding-a-feature/SKILL.md +7 -0
  76. package/corpus/templates/chat/.agents/skills/security/SKILL.md +31 -0
  77. package/corpus/templates/chat/.agents/skills/sharing/SKILL.md +4 -0
  78. package/corpus/templates/clips/.agents/skills/actions/SKILL.md +32 -0
  79. package/corpus/templates/clips/.agents/skills/security/SKILL.md +31 -0
  80. package/corpus/templates/clips/_gitignore +2 -0
  81. package/corpus/templates/clips/actions/request-transcript.ts +77 -11
  82. package/corpus/templates/clips/actions/save-browser-transcript.ts +28 -7
  83. package/corpus/templates/clips/app/routes/record.tsx +11 -3
  84. package/corpus/templates/clips/changelog/2026-07-28-browser-recordings-no-longer-save-a-truncated-transcript-as-.md +6 -0
  85. package/corpus/templates/clips/changelog/2026-07-28-browser-recordings-no-longer-stop-transcribing-partway-throu.md +6 -0
  86. package/corpus/templates/clips/changelog/2026-07-28-desktop-full-screen-clips-now-get-an-instant-local-transcrip.md +6 -0
  87. package/corpus/templates/clips/changelog/2026-07-28-long-transcriptions-no-longer-show-a-false-transcription-sto.md +6 -0
  88. package/corpus/templates/clips/changelog/2026-07-28-restarting-for-an-update-now-installs-the-newest-release-ins.md +6 -0
  89. package/corpus/templates/clips/changelog/2026-07-28-the-meeting-recording-pill-now-anchors-to-the-right-edge-of-.md +6 -0
  90. package/corpus/templates/clips/desktop/src/lib/audio-meter.ts +31 -2
  91. package/corpus/templates/clips/desktop/src/lib/recorder.ts +114 -13
  92. package/corpus/templates/clips/desktop/src/lib/updater.ts +12 -4
  93. package/corpus/templates/clips/desktop/src/overlays/live-audio-bars.tsx +40 -15
  94. package/corpus/templates/clips/desktop/src/styles.css +10 -7
  95. package/corpus/templates/clips/desktop/src-tauri/src/recording_indicator.rs +21 -14
  96. package/corpus/templates/clips/shared/transcript-status.ts +10 -0
  97. package/corpus/templates/content/.agents/skills/actions/SKILL.md +32 -0
  98. package/corpus/templates/content/.agents/skills/security/SKILL.md +31 -0
  99. package/corpus/templates/content/.agents/skills/sharing/SKILL.md +4 -0
  100. package/corpus/templates/content/_gitignore +2 -0
  101. package/corpus/templates/crm/.agents/skills/sharing/SKILL.md +4 -0
  102. package/corpus/templates/design/.agents/skills/actions/SKILL.md +32 -0
  103. package/corpus/templates/design/.agents/skills/security/SKILL.md +31 -0
  104. package/corpus/templates/design/.agents/skills/sharing/SKILL.md +4 -0
  105. package/corpus/templates/design/.agents/skills/visual-edit/SKILL.md +46 -3
  106. package/corpus/templates/design/.generated/bridge/editor-chrome.generated.ts +7 -5
  107. package/corpus/templates/design/_gitignore +2 -0
  108. package/corpus/templates/design/app/components/design/CanvasContextMenu.tsx +2 -2
  109. package/corpus/templates/design/app/components/design/bridge/editor-chrome.bridge.ts +7 -4
  110. package/corpus/templates/design/app/components/design/keyboard-shortcuts.ts +1 -1
  111. package/corpus/templates/design/app/hooks/useDesignHotkeys.ts +10 -4
  112. package/corpus/templates/design/app/i18n-data.ts +10 -0
  113. package/corpus/templates/design/app/lib/builder-design-system-upload.ts +280 -0
  114. package/corpus/templates/design/app/lib/design-ui-events.ts +5 -0
  115. package/corpus/templates/design/app/pages/DesignSystemSetup.tsx +90 -54
  116. package/corpus/templates/design/app/root.tsx +18 -1
  117. package/corpus/templates/design/changelog/2026-07-28-figma-fig-uploads-now-show-indexing-progress-and-an-open-in-.md +6 -0
  118. package/corpus/templates/design/changelog/2026-07-28-show-or-hide-design-editing-chrome-with-cmd-on-apple-devices.md +6 -0
  119. package/corpus/templates/design/server/handlers/design-system-decode-job-status.ts +49 -0
  120. package/corpus/templates/design/server/handlers/design-system-upload-start.ts +87 -0
  121. package/corpus/templates/design/server/handlers/index-design-system-sources.ts +82 -0
  122. package/corpus/templates/design/server/routes/api/design-system-decode-job-status.get.ts +1 -0
  123. package/corpus/templates/design/server/routes/api/design-system-upload-start.post.ts +1 -0
  124. package/corpus/templates/design/server/routes/api/index-design-system-sources.post.ts +1 -0
  125. package/corpus/templates/dispatch/.agents/skills/actions/SKILL.md +32 -0
  126. package/corpus/templates/dispatch/.agents/skills/security/SKILL.md +31 -0
  127. package/corpus/templates/dispatch/.agents/skills/sharing/SKILL.md +4 -0
  128. package/corpus/templates/dispatch/_gitignore +2 -0
  129. package/corpus/templates/forms/.agents/skills/actions/SKILL.md +32 -0
  130. package/corpus/templates/forms/.agents/skills/security/SKILL.md +31 -0
  131. package/corpus/templates/forms/.agents/skills/sharing/SKILL.md +4 -0
  132. package/corpus/templates/forms/_gitignore +2 -0
  133. package/corpus/templates/macros/.agents/skills/security/SKILL.md +31 -0
  134. package/corpus/templates/macros/.agents/skills/sharing/SKILL.md +4 -0
  135. package/corpus/templates/macros/_gitignore +2 -0
  136. package/corpus/templates/mail/.agents/skills/actions/SKILL.md +32 -0
  137. package/corpus/templates/mail/.agents/skills/security/SKILL.md +31 -0
  138. package/corpus/templates/mail/.agents/skills/sharing/SKILL.md +4 -0
  139. package/corpus/templates/mail/_gitignore +2 -0
  140. package/corpus/templates/plan/.agents/skills/actions/SKILL.md +32 -0
  141. package/corpus/templates/plan/.agents/skills/adding-a-feature/SKILL.md +7 -0
  142. package/corpus/templates/plan/.agents/skills/security/SKILL.md +31 -0
  143. package/corpus/templates/plan/.agents/skills/sharing/SKILL.md +4 -0
  144. package/corpus/templates/plan/_gitignore +2 -0
  145. package/corpus/templates/slides/.agents/skills/actions/SKILL.md +32 -0
  146. package/corpus/templates/slides/.agents/skills/security/SKILL.md +31 -0
  147. package/corpus/templates/slides/.agents/skills/sharing/SKILL.md +4 -0
  148. package/corpus/templates/slides/_gitignore +2 -0
  149. package/corpus/templates/slides/app/components/design-system/DesignSystemSetup.tsx +126 -53
  150. package/corpus/templates/slides/app/components/design-system/builder-design-system-upload.ts +271 -0
  151. package/corpus/templates/slides/app/components/design-system/builder-index-response.ts +1 -1
  152. package/corpus/templates/slides/app/i18n/en-US.ts +1 -0
  153. package/corpus/templates/slides/server/handlers/design-system-decode-job-status.ts +49 -0
  154. package/corpus/templates/slides/server/handlers/design-system-upload-start.ts +87 -0
  155. package/corpus/templates/slides/server/handlers/index-design-system-sources.ts +79 -0
  156. package/corpus/templates/slides/server/routes/api/design-system-decode-job-status.get.ts +1 -0
  157. package/corpus/templates/slides/server/routes/api/design-system-upload-start.post.ts +1 -0
  158. package/corpus/templates/slides/server/routes/api/index-design-system-sources.post.ts +1 -0
  159. package/corpus/templates/tasks/.agents/skills/actions/SKILL.md +32 -0
  160. package/corpus/templates/tasks/.agents/skills/adding-a-feature/SKILL.md +7 -0
  161. package/corpus/templates/tasks/.agents/skills/security/SKILL.md +31 -0
  162. package/corpus/templates/tasks/.agents/skills/sharing/SKILL.md +4 -0
  163. package/corpus/templates/tasks/_gitignore +2 -0
  164. package/dist/a2a/artifact-response.d.ts.map +1 -1
  165. package/dist/a2a/artifact-response.js +30 -29
  166. package/dist/a2a/artifact-response.js.map +1 -1
  167. package/dist/action.d.ts +36 -0
  168. package/dist/action.d.ts.map +1 -1
  169. package/dist/action.js +37 -2
  170. package/dist/action.js.map +1 -1
  171. package/dist/chat-threads/store.d.ts +12 -0
  172. package/dist/chat-threads/store.d.ts.map +1 -1
  173. package/dist/chat-threads/store.js +48 -42
  174. package/dist/chat-threads/store.js.map +1 -1
  175. package/dist/cli/skills-content/design-visual-edit-skill.d.ts +1 -1
  176. package/dist/cli/skills-content/design-visual-edit-skill.d.ts.map +1 -1
  177. package/dist/cli/skills-content/design-visual-edit-skill.js +46 -3
  178. package/dist/cli/skills-content/design-visual-edit-skill.js.map +1 -1
  179. package/dist/client/AgentPanel.d.ts +3 -1
  180. package/dist/client/AgentPanel.d.ts.map +1 -1
  181. package/dist/client/AgentPanel.js +11 -9
  182. package/dist/client/AgentPanel.js.map +1 -1
  183. package/dist/client/AssistantChat.d.ts.map +1 -1
  184. package/dist/client/AssistantChat.js +57 -6
  185. package/dist/client/AssistantChat.js.map +1 -1
  186. package/dist/client/DefaultSpinner.d.ts +7 -0
  187. package/dist/client/DefaultSpinner.d.ts.map +1 -1
  188. package/dist/client/DefaultSpinner.js +25 -1
  189. package/dist/client/DefaultSpinner.js.map +1 -1
  190. package/dist/client/org/TeamPage.d.ts +13 -1
  191. package/dist/client/org/TeamPage.d.ts.map +1 -1
  192. package/dist/client/org/TeamPage.js +41 -11
  193. package/dist/client/org/TeamPage.js.map +1 -1
  194. package/dist/client/org/hooks.d.ts +37 -0
  195. package/dist/client/org/hooks.d.ts.map +1 -1
  196. package/dist/client/org/hooks.js +37 -0
  197. package/dist/client/org/hooks.js.map +1 -1
  198. package/dist/client/org/index.d.ts +3 -2
  199. package/dist/client/org/index.d.ts.map +1 -1
  200. package/dist/client/org/index.js +1 -1
  201. package/dist/client/org/index.js.map +1 -1
  202. package/dist/client/transcription/use-live-transcription.d.ts +8 -0
  203. package/dist/client/transcription/use-live-transcription.d.ts.map +1 -1
  204. package/dist/client/transcription/use-live-transcription.js +38 -11
  205. package/dist/client/transcription/use-live-transcription.js.map +1 -1
  206. package/dist/collab/routes.d.ts +1 -1
  207. package/dist/db/client.d.ts +12 -0
  208. package/dist/db/client.d.ts.map +1 -1
  209. package/dist/db/client.js +40 -3
  210. package/dist/db/client.js.map +1 -1
  211. package/dist/db/ensure-additive-columns.d.ts.map +1 -1
  212. package/dist/db/ensure-additive-columns.js +54 -32
  213. package/dist/db/ensure-additive-columns.js.map +1 -1
  214. package/dist/deploy/build.d.ts +1 -0
  215. package/dist/deploy/build.d.ts.map +1 -1
  216. package/dist/deploy/build.js +23 -2
  217. package/dist/deploy/build.js.map +1 -1
  218. package/dist/file-upload/actions/upload-image.d.ts +1 -1
  219. package/dist/mcp-client/routes.d.ts +3 -1
  220. package/dist/mcp-client/routes.d.ts.map +1 -1
  221. package/dist/mcp-client/routes.js +8 -2
  222. package/dist/mcp-client/routes.js.map +1 -1
  223. package/dist/notifications/routes.d.ts +1 -1
  224. package/dist/org/app-roles-handlers.d.ts +27 -0
  225. package/dist/org/app-roles-handlers.d.ts.map +1 -0
  226. package/dist/org/app-roles-handlers.js +125 -0
  227. package/dist/org/app-roles-handlers.js.map +1 -0
  228. package/dist/org/app-roles.d.ts +136 -0
  229. package/dist/org/app-roles.d.ts.map +1 -0
  230. package/dist/org/app-roles.js +216 -0
  231. package/dist/org/app-roles.js.map +1 -0
  232. package/dist/org/index.d.ts +4 -1
  233. package/dist/org/index.d.ts.map +1 -1
  234. package/dist/org/index.js +3 -1
  235. package/dist/org/index.js.map +1 -1
  236. package/dist/org/migrations.d.ts.map +1 -1
  237. package/dist/org/migrations.js +22 -0
  238. package/dist/org/migrations.js.map +1 -1
  239. package/dist/org/plugin.d.ts +2 -0
  240. package/dist/org/plugin.d.ts.map +1 -1
  241. package/dist/org/plugin.js +20 -0
  242. package/dist/org/plugin.js.map +1 -1
  243. package/dist/org/schema.d.ts +143 -0
  244. package/dist/org/schema.d.ts.map +1 -1
  245. package/dist/org/schema.js +14 -0
  246. package/dist/org/schema.js.map +1 -1
  247. package/dist/provider-api/actions/custom-provider-registration.d.ts +8 -8
  248. package/dist/provider-api/actions/provider-api.d.ts +4 -4
  249. package/dist/scripts/docs/search.d.ts.map +1 -1
  250. package/dist/scripts/docs/search.js +15 -0
  251. package/dist/scripts/docs/search.js.map +1 -1
  252. package/dist/scripts/docs/source-search.d.ts +7 -0
  253. package/dist/scripts/docs/source-search.d.ts.map +1 -1
  254. package/dist/scripts/docs/source-search.js +9 -0
  255. package/dist/scripts/docs/source-search.js.map +1 -1
  256. package/dist/secrets/routes.d.ts +9 -9
  257. package/dist/server/agent-chat/script-entries.d.ts.map +1 -1
  258. package/dist/server/agent-chat/script-entries.js +3 -0
  259. package/dist/server/agent-chat/script-entries.js.map +1 -1
  260. package/dist/server/agent-chat-plugin.d.ts.map +1 -1
  261. package/dist/server/agent-chat-plugin.js +46 -48
  262. package/dist/server/agent-chat-plugin.js.map +1 -1
  263. package/dist/server/builder-design-systems.d.ts +49 -0
  264. package/dist/server/builder-design-systems.d.ts.map +1 -1
  265. package/dist/server/builder-design-systems.js +221 -69
  266. package/dist/server/builder-design-systems.js.map +1 -1
  267. package/dist/server/core-routes-plugin.d.ts.map +1 -1
  268. package/dist/server/core-routes-plugin.js +6 -1
  269. package/dist/server/core-routes-plugin.js.map +1 -1
  270. package/dist/server/framework-request-handler.d.ts.map +1 -1
  271. package/dist/server/framework-request-handler.js +42 -6
  272. package/dist/server/framework-request-handler.js.map +1 -1
  273. package/dist/server/index.d.ts +1 -1
  274. package/dist/server/index.d.ts.map +1 -1
  275. package/dist/server/index.js +1 -1
  276. package/dist/server/index.js.map +1 -1
  277. package/dist/server/realtime-token.d.ts +1 -1
  278. package/dist/templates/chat/.agents/skills/actions/SKILL.md +32 -0
  279. package/dist/templates/chat/.agents/skills/adding-a-feature/SKILL.md +7 -0
  280. package/dist/templates/chat/.agents/skills/security/SKILL.md +31 -0
  281. package/dist/templates/chat/.agents/skills/sharing/SKILL.md +4 -0
  282. package/dist/templates/default/.agents/skills/actions/SKILL.md +32 -0
  283. package/dist/templates/default/.agents/skills/adding-a-feature/SKILL.md +7 -0
  284. package/dist/templates/default/.agents/skills/security/SKILL.md +31 -0
  285. package/dist/templates/headless/.agents/skills/actions/SKILL.md +32 -0
  286. package/dist/templates/workspace-core/.agents/skills/actions/SKILL.md +32 -0
  287. package/dist/templates/workspace-core/.agents/skills/adding-a-feature/SKILL.md +7 -0
  288. package/dist/templates/workspace-core/.agents/skills/authentication/SKILL.md +40 -0
  289. package/dist/templates/workspace-core/.agents/skills/security/SKILL.md +31 -0
  290. package/dist/templates/workspace-core/.agents/skills/sharing/SKILL.md +4 -0
  291. package/docs/content/actions.mdx +47 -4
  292. package/docs/content/native-chat-ui.mdx +7 -0
  293. package/docs/content/organizations-teams-permissions.mdx +109 -3
  294. package/docs/content/template-design-collaboration-and-full-apps.mdx +15 -0
  295. package/docs/content/toolkit-org-team.mdx +72 -12
  296. package/package.json +2 -1
  297. package/src/a2a/artifact-response.ts +36 -29
  298. package/src/action.ts +83 -2
  299. package/src/chat-threads/store.ts +48 -43
  300. package/src/cli/skills-content/design-visual-edit-skill.ts +46 -3
  301. package/src/client/AgentPanel.tsx +26 -6
  302. package/src/client/AssistantChat.tsx +63 -7
  303. package/src/client/DefaultSpinner.tsx +29 -0
  304. package/src/client/org/TeamPage.tsx +161 -6
  305. package/src/client/org/hooks.ts +67 -0
  306. package/src/client/org/index.ts +9 -0
  307. package/src/client/transcription/use-live-transcription.ts +62 -10
  308. package/src/db/client.ts +42 -3
  309. package/src/db/ensure-additive-columns.ts +60 -33
  310. package/src/deploy/build.ts +31 -2
  311. package/src/mcp-client/routes.ts +10 -1
  312. package/src/org/app-roles-handlers.ts +152 -0
  313. package/src/org/app-roles.ts +355 -0
  314. package/src/org/index.ts +27 -1
  315. package/src/org/migrations.ts +22 -0
  316. package/src/org/plugin.ts +27 -0
  317. package/src/org/schema.ts +15 -0
  318. package/src/scripts/docs/search.ts +17 -0
  319. package/src/scripts/docs/source-search.ts +10 -0
  320. package/src/server/agent-chat/script-entries.ts +3 -0
  321. package/src/server/agent-chat-plugin.ts +53 -52
  322. package/src/server/builder-design-systems.ts +299 -82
  323. package/src/server/core-routes-plugin.ts +6 -1
  324. package/src/server/framework-request-handler.ts +44 -6
  325. package/src/server/index.ts +8 -0
  326. package/src/templates/chat/.agents/skills/actions/SKILL.md +32 -0
  327. package/src/templates/chat/.agents/skills/adding-a-feature/SKILL.md +7 -0
  328. package/src/templates/chat/.agents/skills/security/SKILL.md +31 -0
  329. package/src/templates/chat/.agents/skills/sharing/SKILL.md +4 -0
  330. package/src/templates/default/.agents/skills/actions/SKILL.md +32 -0
  331. package/src/templates/default/.agents/skills/adding-a-feature/SKILL.md +7 -0
  332. package/src/templates/default/.agents/skills/security/SKILL.md +31 -0
  333. package/src/templates/headless/.agents/skills/actions/SKILL.md +32 -0
  334. package/src/templates/workspace-core/.agents/skills/actions/SKILL.md +32 -0
  335. package/src/templates/workspace-core/.agents/skills/adding-a-feature/SKILL.md +7 -0
  336. package/src/templates/workspace-core/.agents/skills/authentication/SKILL.md +40 -0
  337. package/src/templates/workspace-core/.agents/skills/security/SKILL.md +31 -0
  338. package/src/templates/workspace-core/.agents/skills/sharing/SKILL.md +4 -0
  339. package/corpus/core/src/templates/chat/.agents/skills/actions/SKILL.md +0 -530
  340. package/corpus/core/src/templates/chat/.agents/skills/adding-a-feature/SKILL.md +0 -191
  341. package/corpus/core/src/templates/chat/.agents/skills/agent-native-docs/SKILL.md +0 -115
  342. package/corpus/core/src/templates/chat/.agents/skills/agent-native-toolkit/SKILL.md +0 -177
  343. package/corpus/core/src/templates/chat/.agents/skills/capture-learnings/SKILL.md +0 -89
  344. package/corpus/core/src/templates/chat/.agents/skills/create-skill/SKILL.md +0 -221
  345. package/corpus/core/src/templates/chat/.agents/skills/customizing-agent-native/SKILL.md +0 -220
  346. package/corpus/core/src/templates/chat/.agents/skills/delegate-to-agent/SKILL.md +0 -263
  347. package/corpus/core/src/templates/chat/.agents/skills/feature-flags/SKILL.md +0 -169
  348. package/corpus/core/src/templates/chat/.agents/skills/frontend-design/SKILL.md +0 -174
  349. package/corpus/core/src/templates/chat/.agents/skills/real-time-sync/SKILL.md +0 -232
  350. package/corpus/core/src/templates/chat/.agents/skills/security/SKILL.md +0 -282
  351. package/corpus/core/src/templates/chat/.agents/skills/self-modifying-code/SKILL.md +0 -119
  352. package/corpus/core/src/templates/chat/.agents/skills/shadcn-ui/SKILL.md +0 -123
  353. package/corpus/core/src/templates/chat/.agents/skills/upgrade-agent-native/SKILL.md +0 -122
  354. package/corpus/core/src/templates/chat/.env.example +0 -5
  355. package/corpus/core/src/templates/chat/.ignore +0 -0
  356. package/corpus/core/src/templates/chat/.oxfmtrc.json +0 -8
  357. package/corpus/core/src/templates/chat/AGENTS.md +0 -77
  358. package/corpus/core/src/templates/chat/CHANGELOG.md +0 -10
  359. package/corpus/core/src/templates/chat/DEVELOPING.md +0 -185
  360. package/corpus/core/src/templates/chat/README.md +0 -32
  361. package/corpus/core/src/templates/chat/_gitignore +0 -46
  362. package/corpus/core/src/templates/chat/actions/hello.ts +0 -13
  363. package/corpus/core/src/templates/chat/actions/navigate.ts +0 -41
  364. package/corpus/core/src/templates/chat/actions/run.ts +0 -2
  365. package/corpus/core/src/templates/chat/actions/view-screen.ts +0 -31
  366. package/corpus/core/src/templates/chat/app/components/layout/Header.tsx +0 -60
  367. package/corpus/core/src/templates/chat/app/components/layout/Layout.tsx +0 -188
  368. package/corpus/core/src/templates/chat/app/components/layout/Sidebar.tsx +0 -505
  369. package/corpus/core/src/templates/chat/app/components/ui/button.tsx +0 -1
  370. package/corpus/core/src/templates/chat/app/components/ui/card.tsx +0 -1
  371. package/corpus/core/src/templates/chat/app/components/ui/dropdown-menu.tsx +0 -1
  372. package/corpus/core/src/templates/chat/app/components/ui/input.tsx +0 -1
  373. package/corpus/core/src/templates/chat/app/components/ui/label.tsx +0 -1
  374. package/corpus/core/src/templates/chat/app/components/ui/sheet.tsx +0 -1
  375. package/corpus/core/src/templates/chat/app/components/ui/toolkit-provider.tsx +0 -17
  376. package/corpus/core/src/templates/chat/app/components/ui/tooltip.tsx +0 -1
  377. package/corpus/core/src/templates/chat/app/design-system.ts +0 -3
  378. package/corpus/core/src/templates/chat/app/entry.client.tsx +0 -22
  379. package/corpus/core/src/templates/chat/app/entry.server.tsx +0 -10
  380. package/corpus/core/src/templates/chat/app/global.css +0 -93
  381. package/corpus/core/src/templates/chat/app/hooks/use-navigation-state.ts +0 -93
  382. package/corpus/core/src/templates/chat/app/i18n/ar-SA.ts +0 -68
  383. package/corpus/core/src/templates/chat/app/i18n/de-DE.ts +0 -71
  384. package/corpus/core/src/templates/chat/app/i18n/en-US.ts +0 -70
  385. package/corpus/core/src/templates/chat/app/i18n/es-ES.ts +0 -71
  386. package/corpus/core/src/templates/chat/app/i18n/fr-FR.ts +0 -71
  387. package/corpus/core/src/templates/chat/app/i18n/hi-IN.ts +0 -69
  388. package/corpus/core/src/templates/chat/app/i18n/index.ts +0 -34
  389. package/corpus/core/src/templates/chat/app/i18n/ja-JP.ts +0 -70
  390. package/corpus/core/src/templates/chat/app/i18n/ko-KR.ts +0 -70
  391. package/corpus/core/src/templates/chat/app/i18n/pt-BR.ts +0 -71
  392. package/corpus/core/src/templates/chat/app/i18n/zh-CN.ts +0 -66
  393. package/corpus/core/src/templates/chat/app/i18n/zh-TW.ts +0 -66
  394. package/corpus/core/src/templates/chat/app/i18n-data.ts +0 -556
  395. package/corpus/core/src/templates/chat/app/lib/agent-page.tsx +0 -49
  396. package/corpus/core/src/templates/chat/app/lib/app-config.ts +0 -11
  397. package/corpus/core/src/templates/chat/app/lib/tab-id.ts +0 -1
  398. package/corpus/core/src/templates/chat/app/lib/utils.ts +0 -1
  399. package/corpus/core/src/templates/chat/app/root.tsx +0 -173
  400. package/corpus/core/src/templates/chat/app/routes/_index.tsx +0 -94
  401. package/corpus/core/src/templates/chat/app/routes/agent.tsx +0 -24
  402. package/corpus/core/src/templates/chat/app/routes/chat.$threadId.tsx +0 -1
  403. package/corpus/core/src/templates/chat/app/routes/database.tsx +0 -17
  404. package/corpus/core/src/templates/chat/app/routes/extensions.$id.$slug.tsx +0 -2
  405. package/corpus/core/src/templates/chat/app/routes/extensions.$id.tsx +0 -11
  406. package/corpus/core/src/templates/chat/app/routes/extensions._index.tsx +0 -11
  407. package/corpus/core/src/templates/chat/app/routes/extensions.tsx +0 -5
  408. package/corpus/core/src/templates/chat/app/routes/observability.tsx +0 -19
  409. package/corpus/core/src/templates/chat/app/routes/settings.tsx +0 -89
  410. package/corpus/core/src/templates/chat/app/routes/team.tsx +0 -11
  411. package/corpus/core/src/templates/chat/app/routes.ts +0 -4
  412. package/corpus/core/src/templates/chat/app/vite-env.d.ts +0 -6
  413. package/corpus/core/src/templates/chat/changelog/2026-06-24-a-new-settings-page-gives-quick-access-to-language-workspace.md +0 -6
  414. package/corpus/core/src/templates/chat/changelog/2026-06-24-added-a-language-picker-and-localized-app-chrome-for-support.md +0 -6
  415. package/corpus/core/src/templates/chat/changelog/2026-06-27-traditional-chinese-copy-uses-taiwan-terminology.md +0 -6
  416. package/corpus/core/src/templates/chat/changelog/2026-06-28-left-sidebar-collapse-motion-and-footer-chrome-are-quieter.md +0 -6
  417. package/corpus/core/src/templates/chat/changelog/2026-06-29-chat-layouts-adapt-when-the-agent-sidebar-is-open.md +0 -6
  418. package/corpus/core/src/templates/chat/changelog/2026-07-08-settings-are-cleaner-and-searchable.md +0 -5
  419. package/corpus/core/src/templates/chat/changelog/2026-07-10-chat-now-makes-ai-connection-setup-clear-without-shifting-th.md +0 -6
  420. package/corpus/core/src/templates/chat/changelog/2026-07-13-a-full-agent-page-now-brings-context-files-connections-jobs-.md +0 -6
  421. package/corpus/core/src/templates/chat/changelog/2026-07-14-chat-opens-reliably-on-hosted-deployments-instead-of-failing.md +0 -6
  422. package/corpus/core/src/templates/chat/changelog/2026-07-14-fixed-chat-template-startup-with-older-core-versions.md +0 -6
  423. package/corpus/core/src/templates/chat/changelog/2026-07-15-chat-navigation-focuses-on-chat-and-agent.md +0 -6
  424. package/corpus/core/src/templates/chat/changelog/2026-07-17-the-agent-chat-sidebar-stays-closed-until-you-open-it-or-sta.md +0 -6
  425. package/corpus/core/src/templates/chat/changelog/2026-07-22-compact-sidebar-footer.md +0 -6
  426. package/corpus/core/src/templates/chat/changelog/2026-07-22-full-page-chat-keeps-the-active-conversation-when-moving-to-.md +0 -6
  427. package/corpus/core/src/templates/chat/changelog/2026-07-22-manage-agent-navigation-now-uses-the-connected-nodes-icon.md +0 -6
  428. package/corpus/core/src/templates/chat/changelog/2026-07-22-recent-chats-are-easier-to-scan-and-expand.md +0 -6
  429. package/corpus/core/src/templates/chat/changelog/2026-07-23-full-page-chat-is-better-centered-with-quieter-chat-history-.md +0 -6
  430. package/corpus/core/src/templates/chat/changelog/2026-07-24-borderless-secondary-surfaces.md +0 -6
  431. package/corpus/core/src/templates/chat/changelog/2026-07-24-sidebar-footer-controls-follow-a-consistent-order.md +0 -6
  432. package/corpus/core/src/templates/chat/changelog/2026-07-25-settings-navigation-now-keeps-manage-agent-as-a-dedicated-li.md +0 -6
  433. package/corpus/core/src/templates/chat/components.json +0 -20
  434. package/corpus/core/src/templates/chat/learnings.defaults.md +0 -5
  435. package/corpus/core/src/templates/chat/netlify.toml +0 -11
  436. package/corpus/core/src/templates/chat/package.json +0 -92
  437. package/corpus/core/src/templates/chat/public/agent-native-icon-dark.svg +0 -10
  438. package/corpus/core/src/templates/chat/public/agent-native-icon-light.svg +0 -10
  439. package/corpus/core/src/templates/chat/public/agent-native-logo-dark.svg +0 -21
  440. package/corpus/core/src/templates/chat/public/agent-native-logo-light.svg +0 -21
  441. package/corpus/core/src/templates/chat/public/favicon.svg +0 -1
  442. package/corpus/core/src/templates/chat/public/icon-180.svg +0 -1
  443. package/corpus/core/src/templates/chat/public/icon-192.svg +0 -1
  444. package/corpus/core/src/templates/chat/public/icon-512.svg +0 -1
  445. package/corpus/core/src/templates/chat/public/manifest.json +0 -21
  446. package/corpus/core/src/templates/chat/react-router.config.ts +0 -7
  447. package/corpus/core/src/templates/chat/server/middleware/auth.ts +0 -15
  448. package/corpus/core/src/templates/chat/server/plugins/agent-chat.ts +0 -21
  449. package/corpus/core/src/templates/chat/server/plugins/auth.ts +0 -17
  450. package/corpus/core/src/templates/chat/server/routes/[...page].get.ts +0 -5
  451. package/corpus/core/src/templates/chat/ssr-entry.ts +0 -15
  452. package/corpus/core/src/templates/chat/tsconfig.json +0 -21
  453. package/corpus/core/src/templates/chat/vite.config.ts +0 -19
  454. package/corpus/templates/design/server/handlers/index-design-system-with-builder.ts +0 -151
  455. package/corpus/templates/design/server/routes/api/index-design-system-with-builder.post.ts +0 -1
  456. package/corpus/templates/slides/server/handlers/index-design-system-with-builder.ts +0 -119
  457. package/corpus/templates/slides/server/routes/api/index-design-system-with-builder.post.ts +0 -1
@@ -1,221 +0,0 @@
1
- ---
2
- name: create-skill
3
- description: >-
4
- How to create new skills for an agent-native app. Use when adding a new
5
- skill, documenting a pattern the agent should follow, or creating reusable
6
- guidance for the agent.
7
- scope: dev
8
- metadata:
9
- internal: true
10
- ---
11
-
12
- # Create a Skill
13
-
14
- ## When to Use
15
-
16
- Create a new skill when:
17
-
18
- - There's a pattern the agent should follow repeatedly.
19
- - A multi-step workflow needs reliable, step-by-step guidance.
20
- - You want to scaffold files from a template.
21
-
22
- Don't create a skill when:
23
-
24
- - The guidance already exists in another skill — extend it instead.
25
- - You're documenting something the agent already knows (e.g., how to write
26
- TypeScript).
27
- - It's a one-off — put it in `AGENTS.md` (for everyone) or `memory/MEMORY.md`
28
- (personal, per-user). See **capture-learnings**.
29
-
30
- ## Interview
31
-
32
- Before writing the skill, answer these:
33
-
34
- 1. **What should this skill enable?** — The core purpose in one sentence.
35
- 2. **Which of the four areas does it serve?** — UI, actions, skills/instructions,
36
- or application state (see the **adding-a-feature** skill). Most skills are
37
- about how to touch one or more of these correctly.
38
- 3. **When should it trigger?** — Describe the situations in natural language.
39
- Be slightly pushy — over-triggering is better than under-triggering.
40
- 4. **Does it involve context awareness?** — Does the agent need to know what the
41
- user is looking at? If so, reference the `navigation` application-state key and
42
- the `view-screen` action pattern. See the **context-awareness** skill.
43
- 5. **What type of skill?** — Pattern, Workflow, or Generator (see below).
44
- 6. **Does it need supporting files?** — References (read-only context) or none.
45
- Keep it minimal; push depth into `references/`.
46
-
47
- ## Skill Types and Templates
48
-
49
- ### Pattern (architectural rule)
50
-
51
- For documenting how things should be done:
52
-
53
- ```markdown
54
- ---
55
- name: my-pattern
56
- description: >-
57
- [Under 40 words. What it covers AND when it should trigger.]
58
- ---
59
-
60
- # [Pattern Name]
61
-
62
- ## Rule
63
-
64
- [One sentence: what must be true]
65
-
66
- ## Why
67
-
68
- [Why this rule exists]
69
-
70
- ## How
71
-
72
- [How to follow it, with code examples]
73
-
74
- ## Don't
75
-
76
- [Common violations]
77
-
78
- ## Related Skills
79
-
80
- [Which skills compose with this one]
81
- ```
82
-
83
- ### Workflow (step-by-step)
84
-
85
- For multi-step implementation tasks:
86
-
87
- ```markdown
88
- ---
89
- name: my-workflow
90
- description: >-
91
- [Under 40 words. What it covers AND when it should trigger.]
92
- ---
93
-
94
- # [Workflow Name]
95
-
96
- ## Prerequisites
97
-
98
- [What must be in place first]
99
-
100
- ## Steps
101
-
102
- [Numbered steps with code examples]
103
-
104
- ## Verification
105
-
106
- [How to confirm it worked]
107
-
108
- ## Troubleshooting
109
-
110
- [Common issues and fixes]
111
-
112
- ## Related Skills
113
- ```
114
-
115
- ### Generator (scaffolding)
116
-
117
- For creating files from templates:
118
-
119
- ```markdown
120
- ---
121
- name: my-generator
122
- description: >-
123
- [Under 40 words. What it covers AND when it should trigger.]
124
- ---
125
-
126
- # [Generator Name]
127
-
128
- ## Usage
129
-
130
- [How to invoke — what args/inputs are needed]
131
-
132
- ## What Gets Created
133
-
134
- [List of files and their purpose]
135
-
136
- ## Template
137
-
138
- [The template content with placeholders]
139
-
140
- ## After Generation
141
-
142
- [What to do next — wire up sync, add routes, register the action, etc.]
143
-
144
- ## Related Skills
145
- ```
146
-
147
- ## Naming Conventions
148
-
149
- - Hyphen-case only: `[a-z0-9-]`, max 64 characters.
150
- - Pattern skills: descriptive names (`storing-data`, `delegate-to-agent`).
151
- - Workflow/generator skills: verb-noun (`create-skill`, `capture-learnings`).
152
- - The directory name must match the `name` in frontmatter.
153
-
154
- ## Skill Scope (runtime vs dev)
155
-
156
- An optional `scope` frontmatter field controls which agent loads the skill:
157
-
158
- - `both` (default when omitted) — loaded by connected repo agents and the
159
- in-app runtime agent. Use for any skill both audiences should follow.
160
- - `runtime` — loaded only by the in-app runtime agent.
161
- - `dev` — meant for the human's coding agent (e.g. Claude Code) only. **Excluded
162
- from the runtime agent everywhere**: not in the system-prompt skills block and
163
- not in `docs-search` results.
164
-
165
- Use `scope: dev` for internal-only skills that should guide connected repo
166
- agents such as Codex or Claude Code, but should not affect the deployed
167
- production agent. Do not use `metadata.internal` for runtime visibility; that
168
- field is catalog/package metadata and is intentionally not treated as
169
- production exclusion.
170
-
171
- ```markdown
172
- ---
173
- name: release-checklist
174
- description: >-
175
- Steps for cutting a release. Use when preparing or publishing a new version.
176
- scope: dev
177
- ---
178
- ```
179
-
180
- Leave `scope` off for normal skills — the default (`both`) keeps them loading at
181
- runtime, so this is fully backward compatible. To make a dev-only skill visible
182
- to your coding agent but hidden from the runtime agent, mark it `scope: dev` and
183
- optionally mirror it under `.claude/skills/<name>/SKILL.md` (Claude Code reads
184
- `.claude/skills/` independently of the runtime's `.agents/skills/`).
185
-
186
- ## Tips
187
-
188
- - **Keep descriptions under 40 words** — they load into context on every
189
- conversation. State what the skill does AND when to trigger it.
190
- - **Keep SKILL.md lean (under ~500 lines)** — move detailed content to
191
- `references/` files (progressive disclosure).
192
- - **Use standard markdown headings** — no XML tags or custom formats.
193
-
194
- ## Anti-Patterns
195
-
196
- - **Inline LLM calls** — skills must not call LLMs directly. All AI work goes
197
- through the agent chat (see **delegate-to-agent**).
198
- - **Introducing databases** — data lives in SQL via Drizzle (see **storing-data**).
199
- - **Ignoring sync** — if a skill creates data, mention wiring `useDbSync` /
200
- `useActionQuery` so the UI updates (see **real-time-sync**).
201
- - **Vague descriptions** — "Helps with development" won't trigger. Be specific
202
- about _when_.
203
- - **Pure documentation** — skills should guide action, not just explain concepts.
204
-
205
- ## File Structure
206
-
207
- ```
208
- .agents/skills/my-skill/
209
- ├── SKILL.md # Main skill (required)
210
- └── references/ # Optional supporting context
211
- └── detailed-guide.md
212
- ```
213
-
214
- ## Related Skills
215
-
216
- - **adding-a-feature** — The four-area model every skill ultimately serves.
217
- - **writing-agent-instructions** — How to write AGENTS.md and skills well for
218
- apps and templates you ship to others.
219
- - **capture-learnings** — When a learning graduates to reusable guidance, create
220
- a skill; one-offs go to `AGENTS.md` or `memory/MEMORY.md`.
221
- - **self-modifying-code** — The agent can create new skills (Tier 2 modification).
@@ -1,220 +0,0 @@
1
- ---
2
- name: customizing-agent-native
3
- description: >-
4
- How to configure, compose, or eject Agent Native features into app-owned
5
- code. Use when overriding shared components or integrations, customizing a
6
- template, adding UI to chat or headless apps, or inspecting package source.
7
- scope: dev
8
- metadata:
9
- internal: true
10
- ---
11
-
12
- # Customizing Agent Native
13
-
14
- ## Rule
15
-
16
- Start with the app's registered design system and local UI adapters, then use
17
- the public feature's props, semantic components, controller, product slots,
18
- and callbacks. If those seams are not enough, use the eject CLI to transfer
19
- the smallest supported feature into the app and make that copy app-owned.
20
- Never edit `node_modules`, deep-import a private source file at runtime, or
21
- patch an `@agent-native/*` package.
22
-
23
- Use this order:
24
-
25
- 1. Set brand tokens with the build-time theme configuration when tokens are
26
- enough.
27
- 2. Register company components in `app/design-system.ts` with
28
- `defineDesignSystem`, then pass that definition to `ToolkitProvider`.
29
- 3. Configure a public feature through its semantic components, headless
30
- controller, and product-level render slots.
31
- 4. Compose app primitives behind the app's local UI adapter layer.
32
- 5. Eject the smallest feature into app-owned source.
33
- 6. Propose a new Toolkit seam when the same override is useful in two apps.
34
-
35
- Ejection is for intentional product customization, not for hiding an upgrade
36
- failure or replacing Core runtime behavior.
37
-
38
- ## Use A Company Design System
39
-
40
- Keep the explicit, typed registration seam in `app/design-system.ts`:
41
-
42
- ```tsx
43
- import { defineDesignSystem } from "@agent-native/toolkit/design-system";
44
- import {
45
- AcmeActionButtonAdapter,
46
- AcmeDialogAdapter,
47
- } from "./design-system/acme-adapter";
48
-
49
- export const designSystem = defineDesignSystem({
50
- name: "Acme",
51
- components: {
52
- ActionButton: AcmeActionButtonAdapter,
53
- Dialog: AcmeDialogAdapter,
54
- },
55
- });
56
- ```
57
-
58
- Adapters translate the semantic Toolkit contract into company component props.
59
- They are ordinary React components and may use MUI-style providers, React Aria,
60
- CSS modules, CSS-in-JS, or another styling runtime. `className` and `style` are
61
- optional interoperability hooks, not Tailwind or CVA requirements.
62
-
63
- The contract has nine leaf components (`ActionButton`, `IconButton`,
64
- `TextField`, `TextArea`, `Spinner`, `Skeleton`, `Status`, `Surface`, `Avatar`)
65
- and eight behavior components (`Tooltip`, `Menu`, `Popover`, `Dialog`,
66
- `Picker`, `Checkbox`, `Switch`, `Tabs`). `Picker` covers select and combobox
67
- behavior, not date picking. Behavior adapters own their portal, focus,
68
- keyboard, dismissal, and stacking implementation while honoring the semantic
69
- props and `portalContainer` interop contract.
70
-
71
- App product code imports standard controls from its local adapter path, usually
72
- `@/components/ui/*`. Do not import `@agent-native/toolkit/ui/*` directly from
73
- pages, routes, or domain components. That bypasses the app seam and makes a
74
- future design-system replacement incomplete. Toolkit feature packages remain
75
- valid imports; configure their presentation through the registered semantic
76
- components, controller, and product slots.
77
-
78
- Run the published conformance kit against a complete adapter in its own CI:
79
-
80
- ```tsx
81
- import { assertDesignSystemConformance } from "@agent-native/toolkit/conformance";
82
- import { DESIGN_SYSTEM_CONTRACT_VERSION } from "@agent-native/toolkit/design-system";
83
-
84
- await assertDesignSystemConformance({
85
- adapterName: "Acme",
86
- components,
87
- contractVersion: DESIGN_SYSTEM_CONTRACT_VERSION,
88
- });
89
- ```
90
-
91
- New components and optional props are minor contract changes. Required props,
92
- removed APIs, or behavioral changes require a new contract major.
93
-
94
- ## Customize A Shared Feature
95
-
96
- Prefer feature-level headless controllers over rebuilding individual widgets.
97
- One controller must power both the Toolkit default view and every custom render
98
- path so behavior, actions, analytics, accessibility state, and error handling
99
- cannot drift. Use a product-level render slot to replace the view while keeping
100
- that controller. Eject only when the controller and slots cannot express the
101
- required product behavior.
102
-
103
- ## Eject A Feature
104
-
105
- Discover and inspect the ejection units published by installed first-party
106
- packages before changing source:
107
-
108
- ```bash
109
- agent-native eject --list
110
- agent-native eject inspect <unit>
111
- agent-native eject <unit> --app <app>
112
- agent-native eject <unit> --app <app> --apply
113
- ```
114
-
115
- The command is dry-run by default. It prints the file closure, consumer import
116
- rewrites, protected package contracts, and verification commands before
117
- writing. `--apply` copies the package-version-matched source into the app and
118
- rewrites only imports covered by the unit manifest.
119
-
120
- Every first-party public ejection unit must have a complete manifest. If one is
121
- missing, treat that as a framework coverage bug instead of inventing a copy
122
- recipe. For an unknown third-party package, use the emitted add-style blueprint
123
- as a starting point. Protected runtime behavior is never copied; follow the
124
- reported configuration, adapter, or extension seam instead.
125
-
126
- Applied ejections are recorded in the committed
127
- `agent-native.ejections.json`, including package version, manifest digest,
128
- target hashes, and import rewrites. Use the recorded state to review drift or
129
- undo an unchanged ejection:
130
-
131
- ```bash
132
- agent-native eject diff <unit> --app <app>
133
- agent-native eject restore <unit> --app <app>
134
- agent-native eject restore <unit> --app <app> --apply
135
- ```
136
-
137
- Restore is hash-gated. It refuses to remove locally edited files or reverse
138
- changed imports and prints their diff instead. Keep an edited ejection as
139
- app-owned code, or reconcile those edits before restoring it.
140
-
141
- ## Find The Installed Implementation
142
-
143
- Use the source that matches the installed package version:
144
-
145
- ```bash
146
- pnpm action docs-search --query "<component or feature>"
147
- pnpm action source-search --query "<component or symbol>"
148
- rg -n "<component or symbol>" node_modules/@agent-native/toolkit/src
149
- rg -n "<component or symbol>" node_modules/@agent-native/core/corpus
150
- ```
151
-
152
- - Toolkit publishes readable TypeScript under
153
- `node_modules/@agent-native/toolkit/src/` for selective UI adoption.
154
- - Core and first-party template source lives under
155
- `node_modules/@agent-native/core/corpus/core/` and
156
- `node_modules/@agent-native/core/corpus/templates/`.
157
- - Treat those trees as read-only references. Prefer `agent-native eject` so the
158
- package manifest selects the complete source closure and rewrites imports.
159
- Manual inspection is still useful for deciding whether to configure,
160
- compose, eject, or propose a shared seam.
161
-
162
- Do not manually guess at sibling dependencies. The ejection manifest owns the
163
- required file closure and keeps protected contracts on public package imports.
164
-
165
- ## Preserve The Agent-Native Contract
166
-
167
- UI ownership may change; product contracts should not:
168
-
169
- - Keep app operations in `defineAction` actions and call them through
170
- `useActionQuery`, `useActionMutation`, or another named client helper.
171
- - Keep navigation, selection, and focused-object state visible through the
172
- existing application-state keys.
173
- - Keep AI work in the shared agent chat instead of adding direct LLM calls.
174
- - Keep auth, access checks, persistence, chat transport, and agent execution in
175
- Core. Do not copy those runtimes into the app.
176
- - Keep local adapters narrow so package upgrades still improve every surface
177
- the app has not intentionally taken ownership of.
178
- - Keep page, route, and domain code on local UI adapter imports. Never reach
179
- around the registered design system with direct Toolkit UI primitive imports.
180
-
181
- ## App Shapes
182
-
183
- - **Template app:** begin with `app/design-system.ts`, its local UI adapters,
184
- and domain UI. Use Toolkit features for repeated workspace behavior; eject
185
- only the unit being customized.
186
- - **Chat app:** keep `AgentChatSurface`, thread state, and chat transport in
187
- Core. Compose or eject Toolkit presentation such as chat-history UI around it.
188
- - **Headless app:** stay action-first while no UI is needed. When adding a UI,
189
- use the Chat template as the on-ramp or add Toolkit components without
190
- replacing the existing actions.
191
- - **Workspace:** put one-app overrides in that app. Promote a local component
192
- to `packages/shared` only when multiple workspace apps use it.
193
-
194
- ## After Ejecting
195
-
196
- - Commit `agent-native.ejections.json` with the app-owned files and rewrites.
197
- - Remove unused dependencies and imports from the ejected files.
198
- - Keep visible text in the app's localization catalogs.
199
- - Run the manifest verification commands plus the app's formatter, typecheck,
200
- and focused tests.
201
- - Re-check the installed source during future package upgrades; the app-owned
202
- ejection does not receive upstream fixes automatically. Use `eject diff` to
203
- distinguish recorded output from subsequent local edits.
204
-
205
- ## Don't
206
-
207
- - Don't edit or import from `node_modules/@agent-native/*/src` at runtime.
208
- - Don't add `pnpm.overrides`, patches, or resolutions for Agent Native packages.
209
- - Don't copy Core auth, DB, action, agent-loop, or transport internals.
210
- - Don't manually copy a first-party unit with a missing recipe; fix its manifest.
211
- - Don't eject a full package when a prop, slot, wrapper, or smaller unit works.
212
- - Don't fork feature state into a custom view; consume the feature's controller.
213
-
214
- ## Related Skills
215
-
216
- - `agent-native-docs` — version-matched docs and source lookup
217
- - `agent-native-toolkit` — shared-vs-app-owned architecture boundary
218
- - `self-modifying-code` — safe app source edits
219
- - `upgrade-agent-native` — supported package upgrade path
220
- - `adding-a-feature` — UI/action/instructions/application-state parity
@@ -1,263 +0,0 @@
1
- ---
2
- name: delegate-to-agent
3
- description: >-
4
- How to delegate all AI work to the agent chat. Use when delegating AI work
5
- from UI or scripts to the agent, when a user asks for agent behavior or
6
- LLM-powered features, when tempted to add inline LLM calls, or when sending
7
- messages to the agent from application code.
8
- scope: dev
9
- metadata:
10
- internal: true
11
- ---
12
-
13
- # Delegate All AI to the Agent
14
-
15
- ## Rule
16
-
17
- The UI never calls an LLM directly. Product workflows are delegated to the
18
- agent through the chat bridge so users can see, steer, and audit the work.
19
- Server-side one-shot model calls are an explicit escape hatch for narrow text
20
- transforms only; use `completeText()` from `@agent-native/core/server` when the
21
- work intentionally does not need tools, chat history, or run state.
22
-
23
- ## Why
24
-
25
- The agent is the single AI interface. It has context about the full project, can read/write any file, and can run scripts. Inline LLM calls bypass this — they create a shadow AI that doesn't know what the agent knows and can't coordinate with it.
26
-
27
- ## How
28
-
29
- **From the UI (client):**
30
-
31
- ```ts
32
- import { sendToAgentChat } from "@agent-native/core/client/agent-chat";
33
-
34
- sendToAgentChat({
35
- message: "Generate a summary of this document",
36
- context: documentContent, // optional hidden context (not shown in chat UI)
37
- submit: true, // auto-submit to the agent
38
- });
39
- ```
40
-
41
- **From the UI, in the background:**
42
-
43
- ```ts
44
- import { sendToAgentChat } from "@agent-native/core/client/agent-chat";
45
-
46
- sendToAgentChat({
47
- message: "Analyze this import and create any missing records",
48
- context: `Import batch id: ${batchId}`,
49
- submit: true,
50
- newTab: true,
51
- background: true,
52
- openSidebar: false,
53
- });
54
- ```
55
-
56
- This is still a full agent run: tools, actions, thread state, and run tracking
57
- all remain active. It simply does not focus or open the sidebar.
58
-
59
- **From scripts (Node):**
60
-
61
- ```ts
62
- import { agentChat } from "@agent-native/core";
63
-
64
- agentChat.submit("Process the uploaded images and create thumbnails");
65
- ```
66
-
67
- **For narrow server-side text transforms:**
68
-
69
- ```ts
70
- import { completeText } from "@agent-native/core/server";
71
-
72
- const result = await completeText({
73
- systemPrompt: "Return exactly one sentiment label.",
74
- input: messageBody,
75
- maxOutputTokens: 12,
76
- temperature: 0,
77
- });
78
- ```
79
-
80
- Wrap user-facing uses in actions so the UI and agent share the same operation.
81
- Do not call provider SDKs directly.
82
-
83
- **From the UI, detecting when agent is done:**
84
-
85
- ```ts
86
- import { useAgentChatGenerating } from "@agent-native/core/client/agent-chat";
87
-
88
- function MyComponent() {
89
- const isGenerating = useAgentChatGenerating();
90
- // Show loading state while agent is working
91
- }
92
- ```
93
-
94
- ## `submit` vs Prefill
95
-
96
- The `submit` option controls whether the message is sent automatically or placed in the chat input for user review:
97
-
98
- | `submit` value | Behavior | Use when |
99
- | -------------- | --------------------------------------- | ----------------------------------------------------------------------------------- |
100
- | `true` | Auto-submits to the agent immediately | Routine operations the user has already approved |
101
- | `false` | Prefills the chat input for user review | High-stakes operations (deleting data, modifying code, API calls with side effects) |
102
- | omitted | Uses the project's default setting | General-purpose delegation |
103
-
104
- ```ts
105
- // Auto-submit: routine operation
106
- sendToAgentChat({ message: "Update the project summary", submit: true });
107
-
108
- // Prefill: let user review before sending
109
- sendToAgentChat({
110
- message: "Delete all projects older than 30 days",
111
- submit: false,
112
- });
113
- ```
114
-
115
- ## Capture user input first when generating from a prompt
116
-
117
- Buttons that produce new content ("New Design", "Create Dashboard", "Make Deck", "Generate Form") need the user's prompt as input. **Never hardcode a generic message** — the result will be a generic generation the user didn't actually ask for.
118
-
119
- **Bad** — auto-submits a placeholder message; the user never said what they wanted:
120
-
121
- ```tsx
122
- <Button
123
- onClick={() =>
124
- sendToAgentChat({ message: "make a design", submit: true })
125
- }
126
- >
127
- New Design
128
- </Button>
129
- ```
130
-
131
- **Good** — Popover anchored to the button captures the prompt, then submits it:
132
-
133
- ```tsx
134
- <Popover open={open} onOpenChange={setOpen}>
135
- <PopoverTrigger asChild>
136
- <Button>New Design</Button>
137
- </PopoverTrigger>
138
- <PopoverContent className="w-96">
139
- <Textarea
140
- autoFocus
141
- value={prompt}
142
- onChange={(e) => setPrompt(e.target.value)}
143
- placeholder="What do you want to design?"
144
- />
145
- <Button
146
- onClick={() => {
147
- sendToAgentChat({ message: prompt, submit: true });
148
- setOpen(false);
149
- setPrompt("");
150
- }}
151
- >
152
- Create
153
- </Button>
154
- </PopoverContent>
155
- </Popover>
156
- ```
157
-
158
- **Always ask for input first when** the output depends on a prompt the user must provide — "design what?", "deck about what?", "dashboard for which metric?", "form for which use case?".
159
-
160
- **Auto-submit without input is fine when intent is unambiguous:**
161
-
162
- - "Try to fix" on a tool error — submits the error details with a clear fix instruction
163
- - "Retry the last operation" after a transient failure
164
- - Single-purpose buttons where there is nothing meaningful for the user to add
165
-
166
- If you find yourself writing `submit: true` with a hardcoded creative verb (`"design a..."`, `"write a..."`, `"build a..."`), stop and add a Popover.
167
-
168
- ## Delegating to a Sub-Agent (Agent Teams)
169
-
170
- `sendToAgentChat()` delegates from app code _to_ the agent. The other axis of
171
- delegation is the agent handing work _to a sub-agent_ through the Agent Teams
172
- run-manager. The main chat stays the orchestrator: it spawns sub-agents, then
173
- reads and integrates their results.
174
-
175
- ### When to spawn a sub-agent vs do it yourself
176
-
177
- - **Do it yourself** when the work is small, on the critical path, or tightly
178
- coupled to what you're already doing. Sub-agent overhead and coordination risk
179
- outweigh the benefit.
180
- - **Spawn a sub-agent** for a self-contained unit of work that can run
181
- independently — a disjoint investigation, an isolated implementation slice, a
182
- long-running search — especially when it frees the main thread to keep
183
- orchestrating.
184
-
185
- ### Briefing contract
186
-
187
- Every sub-agent brief must specify four things, or the sub-agent will guess:
188
-
189
- - **Objective** — the one concrete outcome it owns, in a sentence.
190
- - **Context** — the facts it needs (paths, prior findings, constraints) so it
191
- doesn't re-derive them.
192
- - **Output** — the exact shape you want back (a summary, a file edited, a list
193
- of paths, a yes/no with rationale).
194
- - **Boundaries** — what it must NOT touch (files, branches, side effects) and
195
- when to stop and report rather than push forward.
196
-
197
- ### Fan-out discipline
198
-
199
- - **Default to a single sub-agent.** Most delegation is one focused task.
200
- - **Spawn multiple only for genuinely independent units** that don't share state
201
- or files. Never parallelize coupled work — if B needs A's output, run them in
202
- sequence.
203
- - **Cap parallel fan-out at ~3.** More sub-agents means more synthesis cost and
204
- more chance of conflicting edits to the same area.
205
-
206
- ### Synthesis discipline
207
-
208
- - **Read every result** before concluding — don't act on the first one back.
209
- - **Reconcile conflicts** between sub-agent findings explicitly; decide which is
210
- right rather than averaging or ignoring.
211
- - **Integrate into one answer.** The main thread produces the single coherent
212
- result; it never just forwards raw sub-agent transcripts to the user.
213
-
214
- Background sub-agents must use the core run-manager / Agent Teams infrastructure
215
- rather than ad-hoc LLM calls.
216
-
217
- ## Don't
218
-
219
- - Don't `import Anthropic from "@anthropic-ai/sdk"` in client or server code
220
- - Don't `import OpenAI from "openai"` in client or server code
221
- - Don't make direct API calls to any LLM provider
222
- - Don't use AI SDK functions like `generateText()`, `streamText()`, etc.
223
- - Don't build "AI features" that bypass the agent chat
224
- - Don't auto-submit a hardcoded prompt for generative actions — capture user input first (see above)
225
- - Don't use `completeText()` for workflows that need tools, database writes,
226
- auditability, user steering, or multi-step reasoning. Use the agent chat
227
- instead, optionally with `background: true`.
228
-
229
- ## Exception
230
-
231
- Scripts may call external APIs (image generation, search, etc.) — but the AI
232
- reasoning and orchestration still goes through the agent. A script is a tool
233
- the agent uses, not a replacement for the agent.
234
-
235
- `completeText()` is allowed for small server-side transforms such as
236
- classification, extraction, rewriting a short string, or normalizing messy
237
- provider text. It deliberately runs with `tools: []` and does not create chat
238
- thread state.
239
-
240
- ## When to Use A2A Instead
241
-
242
- `sendToAgentChat()` delegates work to the **local** agent — the one running alongside your app. When the work should go to a **different** agent entirely (e.g., asking an analytics agent for data, or a calendar agent for availability), use the A2A (agent-to-agent) protocol instead.
243
-
244
- ```ts
245
- import { callAgent } from "@agent-native/core/a2a";
246
-
247
- // Call a different agent — not the local agent chat
248
- const stats = await callAgent(
249
- "https://analytics.example.com",
250
- "What were last week's signups?",
251
- { apiKey: process.env.ANALYTICS_A2A_KEY },
252
- );
253
- ```
254
-
255
- See the **a2a-protocol** skill for the full pattern.
256
-
257
- ## Related Skills
258
-
259
- - **a2a-protocol** — When the work goes to a different agent, not the local one
260
- - **actions** — The agent invokes actions via `pnpm action <name>` to perform complex operations
261
- - **self-modifying-code** — The agent operates through the chat bridge to make code changes
262
- - **storing-data** — The agent writes results to the database after processing requests
263
- - **real-time-sync** — The UI updates automatically when the agent writes data