@agent-native/core 0.112.0 → 0.113.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (490) hide show
  1. package/corpus/README.md +4 -2
  2. package/corpus/core/CHANGELOG.md +22 -0
  3. package/corpus/core/docs/AGENTS.md +7 -0
  4. package/corpus/core/docs/content/integrations.mdx +63 -2
  5. package/corpus/core/docs/design/provider-integration-authority.md +117 -0
  6. package/corpus/core/package.json +6 -1
  7. package/corpus/core/scripts/materialize-source-corpus.mjs +9 -2
  8. package/corpus/core/src/cli/atomic-json-file.ts +324 -0
  9. package/corpus/core/src/cli/claude-code-participant.ts +515 -0
  10. package/corpus/core/src/cli/code-agent-executor.ts +18 -10
  11. package/corpus/core/src/cli/code-agent-runs.concurrent-worker.ts +33 -0
  12. package/corpus/core/src/cli/code-agent-runs.ts +55 -62
  13. package/corpus/core/src/cli/codex-cli-participant.ts +496 -0
  14. package/corpus/core/src/cli/multi-frontier-runs.ts +1246 -135
  15. package/corpus/core/src/client/chat/ChatHistoryList.tsx +7 -404
  16. package/corpus/core/src/integrations/index.ts +10 -0
  17. package/corpus/core/src/integrations/slack-oauth.ts +1 -0
  18. package/corpus/core/src/integrations/webhook-delivery.ts +55 -0
  19. package/corpus/core/src/notifications/channels.ts +4 -10
  20. package/corpus/core/src/provider-api/actions/custom-provider-registration.ts +197 -0
  21. package/corpus/core/src/provider-api/actions/delete-staged-dataset.ts +3 -42
  22. package/corpus/core/src/provider-api/actions/list-staged-datasets.ts +3 -45
  23. package/corpus/core/src/provider-api/actions/provider-api-audit.ts +88 -0
  24. package/corpus/core/src/provider-api/actions/provider-api.ts +460 -0
  25. package/corpus/core/src/provider-api/actions/query-staged-dataset.ts +3 -140
  26. package/corpus/core/src/provider-api/actions/staged-datasets.ts +359 -0
  27. package/corpus/core/src/provider-api/gong.ts +108 -0
  28. package/corpus/core/src/scripts/docs/source-search.ts +2 -1
  29. package/corpus/core/src/server/google-oauth-credentials.ts +80 -3
  30. package/corpus/core/src/server/index.ts +6 -0
  31. package/corpus/core/src/styles/chat-history-list.css +1 -313
  32. package/corpus/core/src/templates/default/.agents/skills/actions/SKILL.md +32 -12
  33. package/corpus/core/src/templates/default/.agents/skills/agent-native-docs/SKILL.md +10 -0
  34. package/corpus/core/src/templates/default/.agents/skills/customizing-agent-native/SKILL.md +102 -0
  35. package/corpus/core/src/templates/default/.agents/skills/integration-webhooks/SKILL.md +323 -0
  36. package/corpus/core/src/templates/default/.agents/skills/onboarding/SKILL.md +56 -0
  37. package/corpus/core/src/templates/default/.agents/skills/secrets/SKILL.md +273 -0
  38. package/corpus/core/src/templates/default/.agents/skills/self-modifying-code/SKILL.md +11 -2
  39. package/corpus/core/src/templates/default/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
  40. package/corpus/core/src/templates/default/AGENTS.md +25 -18
  41. package/corpus/core/src/templates/headless/.agents/skills/actions/SKILL.md +512 -0
  42. package/corpus/core/src/templates/headless/.agents/skills/agent-native-docs/SKILL.md +10 -0
  43. package/corpus/core/src/templates/headless/.agents/skills/customizing-agent-native/SKILL.md +102 -0
  44. package/corpus/core/src/templates/headless/.agents/skills/integration-webhooks/SKILL.md +323 -0
  45. package/corpus/core/src/templates/headless/.agents/skills/secrets/SKILL.md +273 -0
  46. package/corpus/core/src/templates/headless/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
  47. package/corpus/core/src/templates/headless/AGENTS.md +7 -0
  48. package/corpus/core/src/templates/workspace-core/.agents/skills/actions/SKILL.md +32 -12
  49. package/corpus/core/src/templates/workspace-core/.agents/skills/agent-native-docs/SKILL.md +10 -0
  50. package/corpus/core/src/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +6 -0
  51. package/corpus/core/src/templates/workspace-core/.agents/skills/customizing-agent-native/SKILL.md +102 -0
  52. package/corpus/core/src/templates/workspace-core/.agents/skills/self-modifying-code/SKILL.md +11 -2
  53. package/corpus/core/src/templates/workspace-core/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
  54. package/corpus/core/src/templates/workspace-core/AGENTS.md +4 -0
  55. package/corpus/core/src/templates/workspace-root/AGENTS.md +4 -0
  56. package/corpus/templates/analytics/.agents/skills/actions/SKILL.md +32 -12
  57. package/corpus/templates/analytics/.agents/skills/customizing-agent-native/SKILL.md +102 -0
  58. package/corpus/templates/analytics/.agents/skills/self-modifying-code/SKILL.md +11 -2
  59. package/corpus/templates/analytics/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
  60. package/corpus/templates/analytics/actions/delete-staged-dataset.ts +3 -23
  61. package/corpus/templates/analytics/actions/list-staged-datasets.ts +3 -27
  62. package/corpus/templates/analytics/actions/provider-api-catalog.ts +16 -19
  63. package/corpus/templates/analytics/actions/provider-api-docs.ts +3 -5
  64. package/corpus/templates/analytics/actions/provider-api-request.ts +162 -185
  65. package/corpus/templates/analytics/actions/query-staged-dataset.ts +3 -47
  66. package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +52 -161
  67. package/corpus/templates/assets/.agents/skills/actions/SKILL.md +32 -12
  68. package/corpus/templates/assets/.agents/skills/customizing-agent-native/SKILL.md +102 -0
  69. package/corpus/templates/assets/.agents/skills/self-modifying-code/SKILL.md +11 -2
  70. package/corpus/templates/assets/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
  71. package/corpus/templates/assets/app/components/layout/Sidebar.tsx +63 -160
  72. package/corpus/templates/brain/.agents/skills/actions/SKILL.md +32 -12
  73. package/corpus/templates/brain/.agents/skills/customizing-agent-native/SKILL.md +102 -0
  74. package/corpus/templates/brain/.agents/skills/self-modifying-code/SKILL.md +11 -2
  75. package/corpus/templates/brain/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
  76. package/corpus/templates/brain/actions/_schemas.ts +13 -7
  77. package/corpus/templates/brain/actions/delete-staged-dataset.ts +3 -24
  78. package/corpus/templates/brain/actions/list-staged-datasets.ts +3 -28
  79. package/corpus/templates/brain/actions/provider-api-catalog.ts +5 -11
  80. package/corpus/templates/brain/actions/provider-api-docs.ts +3 -5
  81. package/corpus/templates/brain/actions/provider-api-request.ts +3 -37
  82. package/corpus/templates/brain/actions/query-staged-dataset.ts +3 -48
  83. package/corpus/templates/brain/actions/update-source.ts +5 -1
  84. package/corpus/templates/brain/app/components/layout/Sidebar.tsx +48 -154
  85. package/corpus/templates/brain/app/lib/brain.ts +55 -0
  86. package/corpus/templates/brain/app/lib/ingest-handoff.ts +35 -0
  87. package/corpus/templates/brain/changelog/2026-07-19-slack-backfills-can-now-join-configured-public-channels-befo.md +6 -0
  88. package/corpus/templates/brain/changelog/2026-07-19-slack-backfills-now-continue-across-the-configured-number-of.md +6 -0
  89. package/corpus/templates/brain/changelog/2026-07-19-slack-backfills-now-start-with-a-safe-four-week-window-and-r.md +6 -0
  90. package/corpus/templates/brain/server/lib/connectors.ts +53 -2
  91. package/corpus/templates/brain/server/lib/slack-channel-membership.ts +44 -0
  92. package/corpus/templates/brain/shared/slack-source-config.ts +60 -0
  93. package/corpus/templates/calendar/.agents/skills/actions/SKILL.md +32 -12
  94. package/corpus/templates/calendar/.agents/skills/customizing-agent-native/SKILL.md +102 -0
  95. package/corpus/templates/calendar/.agents/skills/self-modifying-code/SKILL.md +11 -2
  96. package/corpus/templates/calendar/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
  97. package/corpus/templates/calendar/actions/delete-staged-dataset.ts +3 -24
  98. package/corpus/templates/calendar/actions/list-staged-datasets.ts +3 -28
  99. package/corpus/templates/calendar/actions/provider-api-catalog.ts +5 -11
  100. package/corpus/templates/calendar/actions/provider-api-docs.ts +3 -5
  101. package/corpus/templates/calendar/actions/provider-api-request.ts +3 -37
  102. package/corpus/templates/calendar/actions/query-staged-dataset.ts +3 -48
  103. package/corpus/templates/calendar/server/handlers/gong.ts +6 -61
  104. package/corpus/templates/calendar/server/handlers/google-auth.ts +10 -8
  105. package/corpus/templates/calendar/server/lib/google-calendar.ts +7 -45
  106. package/corpus/templates/chat/.agents/skills/actions/SKILL.md +32 -12
  107. package/corpus/templates/chat/.agents/skills/agent-native-docs/SKILL.md +10 -0
  108. package/corpus/templates/chat/.agents/skills/customizing-agent-native/SKILL.md +102 -0
  109. package/corpus/templates/chat/.agents/skills/self-modifying-code/SKILL.md +11 -2
  110. package/corpus/templates/chat/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
  111. package/corpus/templates/chat/AGENTS.md +5 -2
  112. package/corpus/templates/chat/app/components/layout/Sidebar.tsx +51 -157
  113. package/corpus/templates/clips/.agents/skills/actions/SKILL.md +32 -12
  114. package/corpus/templates/clips/.agents/skills/customizing-agent-native/SKILL.md +102 -0
  115. package/corpus/templates/clips/.agents/skills/self-modifying-code/SKILL.md +11 -2
  116. package/corpus/templates/clips/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
  117. package/corpus/templates/clips/AGENTS.md +11 -0
  118. package/corpus/templates/clips/actions/export-to-brain.ts +505 -171
  119. package/corpus/templates/clips/changelog/2026-07-19-ready-clips-transcripts-can-be-backfilled-to-brain-for-a-bou.md +6 -0
  120. package/corpus/templates/clips/server/lib/calendar-event-meetings.ts +1 -1
  121. package/corpus/templates/clips/server/lib/google-calendar-client.ts +12 -22
  122. package/corpus/templates/clips/server/lib/google-calendar-oauth.ts +9 -6
  123. package/corpus/templates/clips/server/lib/slack-oauth.ts +12 -47
  124. package/corpus/templates/clips/server/routes/_agent-native/google/auth-url.get.ts +2 -6
  125. package/corpus/templates/clips/server/routes/api/auth/google-calendar.get.ts +4 -4
  126. package/corpus/templates/content/.agents/skills/actions/SKILL.md +32 -12
  127. package/corpus/templates/content/.agents/skills/customizing-agent-native/SKILL.md +102 -0
  128. package/corpus/templates/content/.agents/skills/self-modifying-code/SKILL.md +11 -2
  129. package/corpus/templates/content/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
  130. package/corpus/templates/content/actions/delete-staged-dataset.ts +3 -24
  131. package/corpus/templates/content/actions/list-staged-datasets.ts +3 -28
  132. package/corpus/templates/content/actions/provider-api-catalog.ts +5 -11
  133. package/corpus/templates/content/actions/provider-api-docs.ts +3 -5
  134. package/corpus/templates/content/actions/provider-api-request.ts +3 -37
  135. package/corpus/templates/content/actions/query-staged-dataset.ts +3 -48
  136. package/corpus/templates/design/.agents/skills/actions/SKILL.md +32 -12
  137. package/corpus/templates/design/.agents/skills/customizing-agent-native/SKILL.md +102 -0
  138. package/corpus/templates/design/.agents/skills/self-modifying-code/SKILL.md +11 -2
  139. package/corpus/templates/design/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
  140. package/corpus/templates/design/actions/delete-staged-dataset.ts +4 -23
  141. package/corpus/templates/design/actions/list-staged-datasets.ts +4 -27
  142. package/corpus/templates/design/actions/provider-api-catalog.ts +15 -18
  143. package/corpus/templates/design/actions/provider-api-docs.ts +57 -48
  144. package/corpus/templates/design/actions/provider-api-request.ts +140 -164
  145. package/corpus/templates/design/actions/query-staged-dataset.ts +4 -47
  146. package/corpus/templates/dispatch/.agents/skills/actions/SKILL.md +32 -12
  147. package/corpus/templates/dispatch/.agents/skills/customizing-agent-native/SKILL.md +102 -0
  148. package/corpus/templates/dispatch/.agents/skills/self-modifying-code/SKILL.md +11 -2
  149. package/corpus/templates/dispatch/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
  150. package/corpus/templates/dispatch/actions/delete-staged-dataset.ts +4 -23
  151. package/corpus/templates/dispatch/actions/list-staged-datasets.ts +4 -30
  152. package/corpus/templates/dispatch/actions/provider-api-catalog.ts +15 -18
  153. package/corpus/templates/dispatch/actions/provider-api-docs.ts +57 -48
  154. package/corpus/templates/dispatch/actions/provider-api-request.ts +138 -163
  155. package/corpus/templates/dispatch/actions/query-staged-dataset.ts +4 -47
  156. package/corpus/templates/forms/.agents/skills/actions/SKILL.md +32 -12
  157. package/corpus/templates/forms/.agents/skills/customizing-agent-native/SKILL.md +102 -0
  158. package/corpus/templates/forms/.agents/skills/self-modifying-code/SKILL.md +11 -2
  159. package/corpus/templates/forms/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
  160. package/corpus/templates/forms/server/lib/integrations.ts +23 -22
  161. package/corpus/templates/macros/.agents/skills/customizing-agent-native/SKILL.md +102 -0
  162. package/corpus/templates/macros/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
  163. package/corpus/templates/mail/.agents/skills/actions/SKILL.md +32 -12
  164. package/corpus/templates/mail/.agents/skills/customizing-agent-native/SKILL.md +102 -0
  165. package/corpus/templates/mail/.agents/skills/self-modifying-code/SKILL.md +11 -2
  166. package/corpus/templates/mail/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
  167. package/corpus/templates/mail/actions/delete-staged-dataset.ts +4 -23
  168. package/corpus/templates/mail/actions/list-staged-datasets.ts +4 -27
  169. package/corpus/templates/mail/actions/provider-api-catalog.ts +15 -18
  170. package/corpus/templates/mail/actions/provider-api-docs.ts +57 -48
  171. package/corpus/templates/mail/actions/provider-api-request.ts +146 -173
  172. package/corpus/templates/mail/actions/query-staged-dataset.ts +4 -47
  173. package/corpus/templates/mail/server/handlers/gong.ts +6 -61
  174. package/corpus/templates/mail/server/lib/google-auth.ts +10 -13
  175. package/corpus/templates/plan/.agents/skills/actions/SKILL.md +32 -12
  176. package/corpus/templates/plan/.agents/skills/customizing-agent-native/SKILL.md +102 -0
  177. package/corpus/templates/plan/.agents/skills/self-modifying-code/SKILL.md +11 -2
  178. package/corpus/templates/plan/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
  179. package/corpus/templates/plan/app/components/layout/Sidebar.tsx +47 -156
  180. package/corpus/templates/slides/.agents/skills/actions/SKILL.md +32 -12
  181. package/corpus/templates/slides/.agents/skills/customizing-agent-native/SKILL.md +102 -0
  182. package/corpus/templates/slides/.agents/skills/self-modifying-code/SKILL.md +11 -2
  183. package/corpus/templates/slides/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
  184. package/corpus/templates/slides/actions/delete-staged-dataset.ts +4 -23
  185. package/corpus/templates/slides/actions/list-staged-datasets.ts +4 -27
  186. package/corpus/templates/slides/actions/provider-api-catalog.ts +15 -18
  187. package/corpus/templates/slides/actions/provider-api-docs.ts +57 -48
  188. package/corpus/templates/slides/actions/provider-api-request.ts +145 -172
  189. package/corpus/templates/slides/actions/query-staged-dataset.ts +4 -47
  190. package/corpus/templates/slides/server/lib/google-docs-oauth.ts +11 -36
  191. package/corpus/templates/tasks/.agents/skills/actions/SKILL.md +32 -12
  192. package/corpus/templates/tasks/.agents/skills/agent-native-docs/SKILL.md +10 -0
  193. package/corpus/templates/tasks/.agents/skills/customizing-agent-native/SKILL.md +102 -0
  194. package/corpus/templates/tasks/.agents/skills/self-modifying-code/SKILL.md +11 -2
  195. package/corpus/templates/tasks/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
  196. package/corpus/toolkit/CHANGELOG.md +125 -0
  197. package/corpus/toolkit/README.md +60 -0
  198. package/corpus/toolkit/export-snapshot.json +35 -0
  199. package/corpus/toolkit/migration-manifest.json +4 -0
  200. package/corpus/toolkit/package.json +281 -0
  201. package/corpus/toolkit/scripts/finalize-build.mjs +55 -0
  202. package/corpus/toolkit/src/app-shell/header-actions.tsx +84 -0
  203. package/corpus/toolkit/src/app-shell/index.ts +1 -0
  204. package/corpus/toolkit/src/chat-history/ChatHistoryList.tsx +469 -0
  205. package/corpus/toolkit/src/chat-history/index.ts +7 -0
  206. package/corpus/toolkit/src/chat-history.css +314 -0
  207. package/corpus/toolkit/src/collab-ui/AgentPresenceChip.tsx +69 -0
  208. package/corpus/toolkit/src/collab-ui/LiveCursorOverlay.tsx +241 -0
  209. package/corpus/toolkit/src/collab-ui/PresenceBar.tsx +346 -0
  210. package/corpus/toolkit/src/collab-ui/RecentEditHighlights.tsx +225 -0
  211. package/corpus/toolkit/src/collab-ui/RemoteSelectionRings.tsx +227 -0
  212. package/corpus/toolkit/src/collab-ui/agent-identity.ts +16 -0
  213. package/corpus/toolkit/src/collab-ui/index.ts +39 -0
  214. package/corpus/toolkit/src/collab-ui/lead-client.ts +32 -0
  215. package/corpus/toolkit/src/collab-ui/types.ts +96 -0
  216. package/corpus/toolkit/src/composer/AgentComposerFrame.tsx +59 -0
  217. package/corpus/toolkit/src/composer/ComposerPlusMenu.tsx +983 -0
  218. package/corpus/toolkit/src/composer/MentionPopover.tsx +412 -0
  219. package/corpus/toolkit/src/composer/PastedTextChip.tsx +150 -0
  220. package/corpus/toolkit/src/composer/PromptComposer.tsx +718 -0
  221. package/corpus/toolkit/src/composer/RealtimeVoiceMode.tsx +856 -0
  222. package/corpus/toolkit/src/composer/TiptapComposer.tsx +2936 -0
  223. package/corpus/toolkit/src/composer/VoiceButton.tsx +255 -0
  224. package/corpus/toolkit/src/composer/asset-picker-url.ts +80 -0
  225. package/corpus/toolkit/src/composer/attachment-accept.ts +71 -0
  226. package/corpus/toolkit/src/composer/draft-key.ts +7 -0
  227. package/corpus/toolkit/src/composer/extensions/FileReference.tsx +55 -0
  228. package/corpus/toolkit/src/composer/extensions/MentionReference.tsx +93 -0
  229. package/corpus/toolkit/src/composer/extensions/SkillReference.tsx +56 -0
  230. package/corpus/toolkit/src/composer/index.ts +79 -0
  231. package/corpus/toolkit/src/composer/pasted-text.ts +160 -0
  232. package/corpus/toolkit/src/composer/prompt-attachments.ts +93 -0
  233. package/corpus/toolkit/src/composer/realtime-voice-audio-level.ts +64 -0
  234. package/corpus/toolkit/src/composer/realtime-voice-transcript.ts +134 -0
  235. package/corpus/toolkit/src/composer/runtime-adapters.tsx +343 -0
  236. package/corpus/toolkit/src/composer/types.ts +66 -0
  237. package/corpus/toolkit/src/composer/use-file-search.ts +64 -0
  238. package/corpus/toolkit/src/composer/use-mention-search.ts +90 -0
  239. package/corpus/toolkit/src/composer/use-skills.ts +45 -0
  240. package/corpus/toolkit/src/composer/useRealtimeVoiceMode.tsx +2117 -0
  241. package/corpus/toolkit/src/composer/useVoiceDictation.ts +1191 -0
  242. package/corpus/toolkit/src/context-ui/ContextMeter.tsx +101 -0
  243. package/corpus/toolkit/src/context-ui/ContextSegmentRow.tsx +184 -0
  244. package/corpus/toolkit/src/context-ui/ContextTreemap.tsx +125 -0
  245. package/corpus/toolkit/src/context-ui/ContextXRayPanel.tsx +377 -0
  246. package/corpus/toolkit/src/context-ui/format.ts +42 -0
  247. package/corpus/toolkit/src/context-ui/index.ts +15 -0
  248. package/corpus/toolkit/src/context-ui/types.ts +43 -0
  249. package/corpus/toolkit/src/design-tweaks/index.ts +1 -0
  250. package/corpus/toolkit/src/design-tweaks/visual-style-controls.tsx +1084 -0
  251. package/corpus/toolkit/src/editor/BubbleToolbar.tsx +253 -0
  252. package/corpus/toolkit/src/editor/CodeBlockNode.tsx +254 -0
  253. package/corpus/toolkit/src/editor/DragHandle.ts +1437 -0
  254. package/corpus/toolkit/src/editor/ImageExtension.ts +306 -0
  255. package/corpus/toolkit/src/editor/RegistryBlockContext.tsx +107 -0
  256. package/corpus/toolkit/src/editor/RegistryBlockNode.tsx +652 -0
  257. package/corpus/toolkit/src/editor/RichMarkdownEditor.tsx +81 -0
  258. package/corpus/toolkit/src/editor/RunId.ts +61 -0
  259. package/corpus/toolkit/src/editor/SharedRichEditor.tsx +321 -0
  260. package/corpus/toolkit/src/editor/SlashCommandMenu.tsx +310 -0
  261. package/corpus/toolkit/src/editor/extensions.ts +402 -0
  262. package/corpus/toolkit/src/editor/gfmDoc.ts +92 -0
  263. package/corpus/toolkit/src/editor/index.ts +93 -0
  264. package/corpus/toolkit/src/editor/registrySlashCommands.ts +131 -0
  265. package/corpus/toolkit/src/editor/surgical-apply.ts +192 -0
  266. package/corpus/toolkit/src/editor/useCollabReconcile.ts +589 -0
  267. package/corpus/toolkit/src/editor.css +510 -0
  268. package/corpus/toolkit/src/hooks/index.ts +2 -0
  269. package/corpus/toolkit/src/hooks/use-mobile.tsx +21 -0
  270. package/corpus/toolkit/src/hooks/use-toast.ts +188 -0
  271. package/corpus/toolkit/src/index.ts +8 -0
  272. package/corpus/toolkit/src/onboarding/index.ts +1 -0
  273. package/corpus/toolkit/src/provider.tsx +47 -0
  274. package/corpus/toolkit/src/sharing/VisibilityBadge.tsx +37 -0
  275. package/corpus/toolkit/src/sharing/index.ts +4 -0
  276. package/corpus/toolkit/src/styles.css +21 -0
  277. package/corpus/toolkit/src/ui/accordion.tsx +56 -0
  278. package/corpus/toolkit/src/ui/alert-dialog.tsx +141 -0
  279. package/corpus/toolkit/src/ui/alert.tsx +59 -0
  280. package/corpus/toolkit/src/ui/aspect-ratio.tsx +5 -0
  281. package/corpus/toolkit/src/ui/avatar.tsx +48 -0
  282. package/corpus/toolkit/src/ui/badge.tsx +37 -0
  283. package/corpus/toolkit/src/ui/breadcrumb.tsx +115 -0
  284. package/corpus/toolkit/src/ui/button.tsx +78 -0
  285. package/corpus/toolkit/src/ui/calendar.tsx +214 -0
  286. package/corpus/toolkit/src/ui/card.tsx +86 -0
  287. package/corpus/toolkit/src/ui/carousel.tsx +260 -0
  288. package/corpus/toolkit/src/ui/chart.tsx +375 -0
  289. package/corpus/toolkit/src/ui/checkbox.tsx +28 -0
  290. package/corpus/toolkit/src/ui/collapsible.tsx +9 -0
  291. package/corpus/toolkit/src/ui/command.tsx +174 -0
  292. package/corpus/toolkit/src/ui/context-menu.tsx +202 -0
  293. package/corpus/toolkit/src/ui/date-picker.tsx +64 -0
  294. package/corpus/toolkit/src/ui/dialog.tsx +146 -0
  295. package/corpus/toolkit/src/ui/drawer.tsx +126 -0
  296. package/corpus/toolkit/src/ui/dropdown-menu.tsx +218 -0
  297. package/corpus/toolkit/src/ui/form.tsx +177 -0
  298. package/corpus/toolkit/src/ui/hover-card.tsx +27 -0
  299. package/corpus/toolkit/src/ui/index.ts +52 -0
  300. package/corpus/toolkit/src/ui/input-otp.tsx +69 -0
  301. package/corpus/toolkit/src/ui/input.tsx +22 -0
  302. package/corpus/toolkit/src/ui/label.tsx +24 -0
  303. package/corpus/toolkit/src/ui/logo.tsx +36 -0
  304. package/corpus/toolkit/src/ui/menubar.tsx +235 -0
  305. package/corpus/toolkit/src/ui/navigation-menu.tsx +128 -0
  306. package/corpus/toolkit/src/ui/pagination.tsx +121 -0
  307. package/corpus/toolkit/src/ui/popover.tsx +44 -0
  308. package/corpus/toolkit/src/ui/progress.tsx +26 -0
  309. package/corpus/toolkit/src/ui/radio-group.tsx +42 -0
  310. package/corpus/toolkit/src/ui/resizable.tsx +43 -0
  311. package/corpus/toolkit/src/ui/scroll-area.tsx +46 -0
  312. package/corpus/toolkit/src/ui/select.tsx +158 -0
  313. package/corpus/toolkit/src/ui/separator.tsx +29 -0
  314. package/corpus/toolkit/src/ui/sheet.tsx +160 -0
  315. package/corpus/toolkit/src/ui/sidebar.tsx +777 -0
  316. package/corpus/toolkit/src/ui/skeleton.tsx +18 -0
  317. package/corpus/toolkit/src/ui/slider.tsx +26 -0
  318. package/corpus/toolkit/src/ui/sonner.tsx +58 -0
  319. package/corpus/toolkit/src/ui/spinner.tsx +17 -0
  320. package/corpus/toolkit/src/ui/switch.tsx +27 -0
  321. package/corpus/toolkit/src/ui/table.tsx +117 -0
  322. package/corpus/toolkit/src/ui/tabs.tsx +53 -0
  323. package/corpus/toolkit/src/ui/textarea.tsx +23 -0
  324. package/corpus/toolkit/src/ui/toast.tsx +127 -0
  325. package/corpus/toolkit/src/ui/toaster.tsx +33 -0
  326. package/corpus/toolkit/src/ui/toggle-group.tsx +59 -0
  327. package/corpus/toolkit/src/ui/toggle.tsx +43 -0
  328. package/corpus/toolkit/src/ui/tooltip.tsx +53 -0
  329. package/corpus/toolkit/src/ui/use-toast.ts +3 -0
  330. package/corpus/toolkit/src/utils.ts +8 -0
  331. package/corpus/toolkit/tsconfig.json +23 -0
  332. package/dist/cli/atomic-json-file.d.ts +30 -0
  333. package/dist/cli/atomic-json-file.d.ts.map +1 -0
  334. package/dist/cli/atomic-json-file.js +240 -0
  335. package/dist/cli/atomic-json-file.js.map +1 -0
  336. package/dist/cli/claude-code-participant.d.ts +77 -0
  337. package/dist/cli/claude-code-participant.d.ts.map +1 -0
  338. package/dist/cli/claude-code-participant.js +355 -0
  339. package/dist/cli/claude-code-participant.js.map +1 -0
  340. package/dist/cli/code-agent-executor.d.ts.map +1 -1
  341. package/dist/cli/code-agent-executor.js +18 -10
  342. package/dist/cli/code-agent-executor.js.map +1 -1
  343. package/dist/cli/code-agent-runs.concurrent-worker.d.ts +2 -0
  344. package/dist/cli/code-agent-runs.concurrent-worker.d.ts.map +1 -0
  345. package/dist/cli/code-agent-runs.concurrent-worker.js +32 -0
  346. package/dist/cli/code-agent-runs.concurrent-worker.js.map +1 -0
  347. package/dist/cli/code-agent-runs.d.ts.map +1 -1
  348. package/dist/cli/code-agent-runs.js +43 -56
  349. package/dist/cli/code-agent-runs.js.map +1 -1
  350. package/dist/cli/codex-cli-participant.d.ts +77 -0
  351. package/dist/cli/codex-cli-participant.d.ts.map +1 -0
  352. package/dist/cli/codex-cli-participant.js +354 -0
  353. package/dist/cli/codex-cli-participant.js.map +1 -0
  354. package/dist/cli/multi-frontier-runs.d.ts +115 -0
  355. package/dist/cli/multi-frontier-runs.d.ts.map +1 -1
  356. package/dist/cli/multi-frontier-runs.js +831 -113
  357. package/dist/cli/multi-frontier-runs.js.map +1 -1
  358. package/dist/client/chat/ChatHistoryList.d.ts +1 -87
  359. package/dist/client/chat/ChatHistoryList.d.ts.map +1 -1
  360. package/dist/client/chat/ChatHistoryList.js +1 -82
  361. package/dist/client/chat/ChatHistoryList.js.map +1 -1
  362. package/dist/integrations/index.d.ts +2 -1
  363. package/dist/integrations/index.d.ts.map +1 -1
  364. package/dist/integrations/index.js +2 -1
  365. package/dist/integrations/index.js.map +1 -1
  366. package/dist/integrations/slack-manifest.d.ts +1 -1
  367. package/dist/integrations/slack-oauth.d.ts +1 -1
  368. package/dist/integrations/slack-oauth.d.ts.map +1 -1
  369. package/dist/integrations/slack-oauth.js +1 -0
  370. package/dist/integrations/slack-oauth.js.map +1 -1
  371. package/dist/integrations/webhook-delivery.d.ts +23 -0
  372. package/dist/integrations/webhook-delivery.d.ts.map +1 -0
  373. package/dist/integrations/webhook-delivery.js +32 -0
  374. package/dist/integrations/webhook-delivery.js.map +1 -0
  375. package/dist/notifications/channels.d.ts.map +1 -1
  376. package/dist/notifications/channels.js +4 -9
  377. package/dist/notifications/channels.js.map +1 -1
  378. package/dist/notifications/routes.d.ts +3 -3
  379. package/dist/provider-api/actions/custom-provider-registration.d.ts +136 -0
  380. package/dist/provider-api/actions/custom-provider-registration.d.ts.map +1 -0
  381. package/dist/provider-api/actions/custom-provider-registration.js +154 -0
  382. package/dist/provider-api/actions/custom-provider-registration.js.map +1 -0
  383. package/dist/provider-api/actions/delete-staged-dataset.d.ts +1 -1
  384. package/dist/provider-api/actions/delete-staged-dataset.d.ts.map +1 -1
  385. package/dist/provider-api/actions/delete-staged-dataset.js +3 -34
  386. package/dist/provider-api/actions/delete-staged-dataset.js.map +1 -1
  387. package/dist/provider-api/actions/list-staged-datasets.d.ts +2 -3
  388. package/dist/provider-api/actions/list-staged-datasets.d.ts.map +1 -1
  389. package/dist/provider-api/actions/list-staged-datasets.js +3 -40
  390. package/dist/provider-api/actions/list-staged-datasets.js.map +1 -1
  391. package/dist/provider-api/actions/provider-api-audit.d.ts +7 -0
  392. package/dist/provider-api/actions/provider-api-audit.d.ts.map +1 -0
  393. package/dist/provider-api/actions/provider-api-audit.js +74 -0
  394. package/dist/provider-api/actions/provider-api-audit.js.map +1 -0
  395. package/dist/provider-api/actions/provider-api.d.ts +370 -0
  396. package/dist/provider-api/actions/provider-api.d.ts.map +1 -0
  397. package/dist/provider-api/actions/provider-api.js +280 -0
  398. package/dist/provider-api/actions/provider-api.js.map +1 -0
  399. package/dist/provider-api/actions/query-staged-dataset.d.ts +1 -1
  400. package/dist/provider-api/actions/query-staged-dataset.d.ts.map +1 -1
  401. package/dist/provider-api/actions/query-staged-dataset.js +3 -116
  402. package/dist/provider-api/actions/query-staged-dataset.js.map +1 -1
  403. package/dist/provider-api/actions/staged-datasets.d.ts +190 -0
  404. package/dist/provider-api/actions/staged-datasets.d.ts.map +1 -0
  405. package/dist/provider-api/actions/staged-datasets.js +210 -0
  406. package/dist/provider-api/actions/staged-datasets.js.map +1 -0
  407. package/dist/provider-api/gong.d.ts +44 -0
  408. package/dist/provider-api/gong.d.ts.map +1 -0
  409. package/dist/provider-api/gong.js +56 -0
  410. package/dist/provider-api/gong.js.map +1 -0
  411. package/dist/scripts/docs/source-search.d.ts +2 -1
  412. package/dist/scripts/docs/source-search.d.ts.map +1 -1
  413. package/dist/scripts/docs/source-search.js +2 -1
  414. package/dist/scripts/docs/source-search.js.map +1 -1
  415. package/dist/server/agent-engine-api-key-route.d.ts +1 -1
  416. package/dist/server/google-oauth-credentials.d.ts +35 -0
  417. package/dist/server/google-oauth-credentials.d.ts.map +1 -1
  418. package/dist/server/google-oauth-credentials.js +48 -2
  419. package/dist/server/google-oauth-credentials.js.map +1 -1
  420. package/dist/server/index.d.ts +1 -1
  421. package/dist/server/index.d.ts.map +1 -1
  422. package/dist/server/index.js +1 -1
  423. package/dist/server/index.js.map +1 -1
  424. package/dist/styles/chat-history-list.css +1 -313
  425. package/dist/templates/chat/.agents/skills/actions/SKILL.md +32 -12
  426. package/dist/templates/chat/.agents/skills/agent-native-docs/SKILL.md +10 -0
  427. package/dist/templates/chat/.agents/skills/customizing-agent-native/SKILL.md +102 -0
  428. package/dist/templates/chat/.agents/skills/self-modifying-code/SKILL.md +11 -2
  429. package/dist/templates/chat/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
  430. package/dist/templates/chat/AGENTS.md +5 -2
  431. package/dist/templates/chat/app/components/layout/Sidebar.tsx +51 -157
  432. package/dist/templates/default/.agents/skills/actions/SKILL.md +32 -12
  433. package/dist/templates/default/.agents/skills/agent-native-docs/SKILL.md +10 -0
  434. package/dist/templates/default/.agents/skills/customizing-agent-native/SKILL.md +102 -0
  435. package/dist/templates/default/.agents/skills/integration-webhooks/SKILL.md +323 -0
  436. package/dist/templates/default/.agents/skills/onboarding/SKILL.md +56 -0
  437. package/dist/templates/default/.agents/skills/secrets/SKILL.md +273 -0
  438. package/dist/templates/default/.agents/skills/self-modifying-code/SKILL.md +11 -2
  439. package/dist/templates/default/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
  440. package/dist/templates/default/AGENTS.md +25 -18
  441. package/dist/templates/headless/.agents/skills/actions/SKILL.md +512 -0
  442. package/dist/templates/headless/.agents/skills/agent-native-docs/SKILL.md +10 -0
  443. package/dist/templates/headless/.agents/skills/customizing-agent-native/SKILL.md +102 -0
  444. package/dist/templates/headless/.agents/skills/integration-webhooks/SKILL.md +323 -0
  445. package/dist/templates/headless/.agents/skills/secrets/SKILL.md +273 -0
  446. package/dist/templates/headless/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
  447. package/dist/templates/headless/AGENTS.md +7 -0
  448. package/dist/templates/workspace-core/.agents/skills/actions/SKILL.md +32 -12
  449. package/dist/templates/workspace-core/.agents/skills/agent-native-docs/SKILL.md +10 -0
  450. package/dist/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +6 -0
  451. package/dist/templates/workspace-core/.agents/skills/customizing-agent-native/SKILL.md +102 -0
  452. package/dist/templates/workspace-core/.agents/skills/self-modifying-code/SKILL.md +11 -2
  453. package/dist/templates/workspace-core/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
  454. package/dist/templates/workspace-core/AGENTS.md +4 -0
  455. package/dist/templates/workspace-root/AGENTS.md +4 -0
  456. package/docs/AGENTS.md +7 -0
  457. package/docs/content/integrations.mdx +63 -2
  458. package/docs/design/provider-integration-authority.md +117 -0
  459. package/package.json +7 -2
  460. package/src/templates/chat/.agents/skills/actions/SKILL.md +32 -12
  461. package/src/templates/chat/.agents/skills/agent-native-docs/SKILL.md +10 -0
  462. package/src/templates/chat/.agents/skills/customizing-agent-native/SKILL.md +102 -0
  463. package/src/templates/chat/.agents/skills/self-modifying-code/SKILL.md +11 -2
  464. package/src/templates/chat/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
  465. package/src/templates/chat/AGENTS.md +5 -2
  466. package/src/templates/chat/app/components/layout/Sidebar.tsx +51 -157
  467. package/src/templates/default/.agents/skills/actions/SKILL.md +32 -12
  468. package/src/templates/default/.agents/skills/agent-native-docs/SKILL.md +10 -0
  469. package/src/templates/default/.agents/skills/customizing-agent-native/SKILL.md +102 -0
  470. package/src/templates/default/.agents/skills/integration-webhooks/SKILL.md +323 -0
  471. package/src/templates/default/.agents/skills/onboarding/SKILL.md +56 -0
  472. package/src/templates/default/.agents/skills/secrets/SKILL.md +273 -0
  473. package/src/templates/default/.agents/skills/self-modifying-code/SKILL.md +11 -2
  474. package/src/templates/default/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
  475. package/src/templates/default/AGENTS.md +25 -18
  476. package/src/templates/headless/.agents/skills/actions/SKILL.md +512 -0
  477. package/src/templates/headless/.agents/skills/agent-native-docs/SKILL.md +10 -0
  478. package/src/templates/headless/.agents/skills/customizing-agent-native/SKILL.md +102 -0
  479. package/src/templates/headless/.agents/skills/integration-webhooks/SKILL.md +323 -0
  480. package/src/templates/headless/.agents/skills/secrets/SKILL.md +273 -0
  481. package/src/templates/headless/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
  482. package/src/templates/headless/AGENTS.md +7 -0
  483. package/src/templates/workspace-core/.agents/skills/actions/SKILL.md +32 -12
  484. package/src/templates/workspace-core/.agents/skills/agent-native-docs/SKILL.md +10 -0
  485. package/src/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +6 -0
  486. package/src/templates/workspace-core/.agents/skills/customizing-agent-native/SKILL.md +102 -0
  487. package/src/templates/workspace-core/.agents/skills/self-modifying-code/SKILL.md +11 -2
  488. package/src/templates/workspace-core/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
  489. package/src/templates/workspace-core/AGENTS.md +4 -0
  490. package/src/templates/workspace-root/AGENTS.md +4 -0
@@ -12,31 +12,24 @@ import { useT } from "@agent-native/core/client/i18n";
12
12
  import { OrgSwitcher } from "@agent-native/core/client/org";
13
13
  import { FeedbackButton } from "@agent-native/core/client/ui";
14
14
  import {
15
- IconArchive,
15
+ ChatHistoryList,
16
+ type ChatHistoryItem,
17
+ } from "@agent-native/toolkit/chat-history";
18
+ import {
16
19
  IconBrain,
17
20
  IconClipboardList,
18
- IconDots,
19
- IconEdit,
20
21
  IconLayoutSidebarLeftCollapse,
21
22
  IconLayoutSidebarLeftExpand,
22
23
  IconLayoutGrid,
23
24
  IconPhotoPlus,
24
- IconPin,
25
25
  IconPlus,
26
26
  IconSettings,
27
27
  IconShare3,
28
28
  } from "@tabler/icons-react";
29
- import { useEffect, useMemo, useRef, useState, type FormEvent } from "react";
29
+ import { useEffect, useMemo, useState } from "react";
30
30
  import { Link, useLocation, useNavigate } from "react-router";
31
31
  import { toast } from "sonner";
32
32
 
33
- import {
34
- DropdownMenu,
35
- DropdownMenuContent,
36
- DropdownMenuItem,
37
- DropdownMenuTrigger,
38
- } from "@/components/ui/dropdown-menu";
39
- import { Input } from "@/components/ui/input";
40
33
  import {
41
34
  Tooltip,
42
35
  TooltipContent,
@@ -136,10 +129,6 @@ function AssetsChatsSection() {
136
129
  autoCreate: false,
137
130
  restoreActiveThread: false,
138
131
  });
139
- const [renamingThreadId, setRenamingThreadId] = useState<string | null>(null);
140
- const [renameDraft, setRenameDraft] = useState("");
141
- const renameInputRef = useRef<HTMLInputElement | null>(null);
142
- const committingRenameRef = useRef(false);
143
132
 
144
133
  const visibleThreads = useMemo(
145
134
  () =>
@@ -149,6 +138,23 @@ function AssetsChatsSection() {
149
138
  .slice(0, 10),
150
139
  [threads],
151
140
  );
141
+ const displayedActiveThreadId =
142
+ threadIdFromPath(location.pathname) ??
143
+ (location.pathname === "/" ? null : activeThreadId);
144
+ const chatItems = useMemo<ChatHistoryItem[]>(
145
+ () =>
146
+ visibleThreads.map((thread) => ({
147
+ id: thread.id,
148
+ title: threadTitle(thread),
149
+ titleText: threadTitle(thread),
150
+ timestamp:
151
+ thread.id === displayedActiveThreadId
152
+ ? undefined
153
+ : formatThreadAge(threadUpdatedAt(thread)),
154
+ pinned: Boolean(thread.pinnedAt),
155
+ })),
156
+ [displayedActiveThreadId, visibleThreads],
157
+ );
152
158
 
153
159
  useEffect(() => {
154
160
  const refresh = () => refreshThreads();
@@ -169,14 +175,6 @@ function AssetsChatsSection() {
169
175
  };
170
176
  }, [refreshThreads]);
171
177
 
172
- useEffect(() => {
173
- if (!renamingThreadId) return;
174
- requestAnimationFrame(() => {
175
- renameInputRef.current?.focus();
176
- renameInputRef.current?.select();
177
- });
178
- }, [renamingThreadId]);
179
-
180
178
  function openThread(threadId: string, options?: { isNew?: boolean }) {
181
179
  switchThread(threadId);
182
180
  navigateWithAgentChatViewTransition(
@@ -230,36 +228,10 @@ function AssetsChatsSection() {
230
228
  }
231
229
  }
232
230
 
233
- function startRenameThread(thread: ChatThreadSummary) {
234
- committingRenameRef.current = false;
235
- setRenameDraft(threadTitle(thread));
236
- setRenamingThreadId(thread.id);
237
- }
238
-
239
- function cancelRenameThread() {
240
- committingRenameRef.current = true;
241
- setRenamingThreadId(null);
242
- setRenameDraft("");
243
- }
244
-
245
- async function commitRenameThread() {
246
- if (committingRenameRef.current) return;
247
- const threadId = renamingThreadId;
248
- const title = renameDraft.trim();
249
- if (!threadId) return;
250
- committingRenameRef.current = true;
251
- setRenamingThreadId(null);
252
- setRenameDraft("");
253
- if (title) {
254
- const renamed = await renameThread(threadId, title);
231
+ function handleRenameThread(threadId: string, title: string) {
232
+ void renameThread(threadId, title).then((renamed) => {
255
233
  if (!renamed) toast.error(t("chat.renameFailed"));
256
- }
257
- committingRenameRef.current = false;
258
- }
259
-
260
- function handleRenameSubmit(event: FormEvent<HTMLFormElement>) {
261
- event.preventDefault();
262
- void commitRenameThread();
234
+ });
263
235
  }
264
236
 
265
237
  return (
@@ -282,114 +254,45 @@ function AssetsChatsSection() {
282
254
  <TooltipContent side="right">{t("chat.newChat")}</TooltipContent>
283
255
  </Tooltip>
284
256
  </div>
285
- <div className="grid gap-0.5">
286
- {visibleThreads.map((thread) => {
287
- const isActive =
288
- thread.id ===
289
- (threadIdFromPath(location.pathname) ??
290
- (location.pathname === "/" ? null : activeThreadId));
291
- const isRenaming = thread.id === renamingThreadId;
292
- return (
293
- <div
294
- key={thread.id}
295
- className={cn(
296
- "group flex h-8 min-w-0 items-center rounded-md text-sm transition-colors",
297
- isActive
298
- ? "bg-sidebar-accent text-sidebar-accent-foreground"
299
- : "text-muted-foreground hover:bg-sidebar-accent/65 hover:text-sidebar-accent-foreground",
300
- )}
257
+ {visibleThreads.length > 0 && (
258
+ <ChatHistoryList
259
+ items={chatItems}
260
+ activeId={displayedActiveThreadId}
261
+ onSelect={openThread}
262
+ onTogglePin={(threadId) => {
263
+ const thread = visibleThreads.find((item) => item.id === threadId);
264
+ if (thread) void pinThread(threadId, !thread.pinnedAt);
265
+ }}
266
+ onRename={handleRenameThread}
267
+ renameMaxLength={160}
268
+ onDelete={(threadId) => void handleArchiveThread(threadId)}
269
+ renderAdditionalRowActions={(item, closeMenu) => (
270
+ <button
271
+ type="button"
272
+ role="menuitem"
273
+ className="an-chat-history-row__menu-item"
274
+ onClick={() => {
275
+ closeMenu();
276
+ void handleCopyShareLink(item.id);
277
+ }}
301
278
  >
302
- {isRenaming ? (
303
- <form
304
- onSubmit={handleRenameSubmit}
305
- className="flex h-full min-w-0 flex-1 items-center px-1.5"
306
- >
307
- <Input
308
- ref={renameInputRef}
309
- value={renameDraft}
310
- onChange={(event) => setRenameDraft(event.target.value)}
311
- onBlur={() => void commitRenameThread()}
312
- onKeyDown={(event) => {
313
- if (event.key === "Escape") {
314
- event.preventDefault();
315
- cancelRenameThread();
316
- }
317
- }}
318
- maxLength={160}
319
- aria-label={`Rename ${threadTitle(thread)}`}
320
- className="h-6 min-w-0 rounded-sm border-border bg-background px-1.5 text-xs"
321
- />
322
- </form>
323
- ) : (
324
- <>
325
- <button
326
- type="button"
327
- onClick={() => openThread(thread.id)}
328
- className="flex h-full min-w-0 flex-1 items-center px-2 text-start outline-none focus-visible:ring-2 focus-visible:ring-ring"
329
- >
330
- <span className="min-w-0 flex-1 truncate">
331
- {threadTitle(thread)}
332
- </span>
333
- </button>
334
- <div className="relative flex w-auto min-w-7 shrink-0 items-center justify-end pe-1">
335
- <span className="whitespace-nowrap text-[11px] tabular-nums text-muted-foreground/75 transition-opacity group-hover:opacity-0 group-focus-within:opacity-0">
336
- {isActive ? "" : formatThreadAge(threadUpdatedAt(thread))}
337
- </span>
338
- <DropdownMenu>
339
- <DropdownMenuTrigger asChild>
340
- <button
341
- type="button"
342
- aria-label={t("chat.optionsFor", {
343
- title: threadTitle(thread),
344
- })}
345
- className="absolute end-1 flex size-6 items-center justify-center rounded-md text-muted-foreground opacity-0 transition-opacity hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring group-hover:opacity-100 group-focus-within:opacity-100 data-[state=open]:opacity-100"
346
- >
347
- <IconDots className="size-4" />
348
- </button>
349
- </DropdownMenuTrigger>
350
- <DropdownMenuContent
351
- align="end"
352
- side="right"
353
- sideOffset={6}
354
- >
355
- <DropdownMenuItem
356
- onSelect={() => startRenameThread(thread)}
357
- >
358
- <IconEdit className="me-2 size-4" />
359
- {t("chat.renameChat")}
360
- </DropdownMenuItem>
361
- <DropdownMenuItem
362
- onSelect={() =>
363
- void pinThread(thread.id, !thread.pinnedAt)
364
- }
365
- >
366
- <IconPin className="me-2 size-4" />
367
- {thread.pinnedAt
368
- ? t("chat.unpinChat")
369
- : t("chat.pinChat")}
370
- </DropdownMenuItem>
371
- <DropdownMenuItem
372
- onSelect={() => void handleCopyShareLink(thread.id)}
373
- >
374
- <IconShare3 className="me-2 size-4" />
375
- {t("chat.copyShareLink")}
376
- </DropdownMenuItem>
377
- <DropdownMenuItem
378
- className="text-destructive focus:text-destructive"
379
- onSelect={() => void handleArchiveThread(thread.id)}
380
- >
381
- <IconArchive className="me-2 size-4" />
382
- {t("chat.archiveChat")}
383
- </DropdownMenuItem>
384
- </DropdownMenuContent>
385
- </DropdownMenu>
386
- </div>
387
- </>
388
- )}
389
- </div>
390
- );
391
- })}
392
- </div>
279
+ <IconShare3 size={13} strokeWidth={1.8} />
280
+ <span>{t("chat.copyShareLink")}</span>
281
+ </button>
282
+ )}
283
+ labels={{
284
+ options: (item) =>
285
+ t("chat.optionsFor", { title: item.titleText ?? "" }),
286
+ renameInput: (item) => `Rename ${item.titleText ?? ""}`,
287
+ rename: t("chat.renameChat"),
288
+ pin: t("chat.pinChat"),
289
+ unpin: t("chat.unpinChat"),
290
+ delete: t("chat.archiveChat"),
291
+ }}
292
+ variant="rail"
293
+ className="min-w-0"
294
+ />
295
+ )}
393
296
  </div>
394
297
  );
395
298
  }
@@ -121,18 +121,38 @@ action trio instead:
121
121
  provider host, injects configured credentials, blocks private/internal URLs,
122
122
  and redacts secrets.
123
123
 
124
- Use `@agent-native/core/provider-api` as the shared substrate. A template should
125
- only add a thin credential adapter when it has app-specific credential lookup
126
- rules. If the app stores a built-in provider's OAuth grant under a narrower
127
- local provider id, use the runtime's `oauthProviderOverrides` instead of
128
- duplicating the provider config. If credentials are stored on shareable/resource
129
- rows rather than in the shared credential or OAuth-token stores, build a resolver
130
- that enforces those access checks before exposing raw provider requests. Keep
131
- `provider-api-request` `http: false` unless you have a separate UI permission
132
- model for arbitrary provider writes. Specific actions such as `search-records`,
133
- `search-emails`, or `sync-source` are convenience shortcuts, not capability
134
- limits; agents should fall back to the provider API trio when a question
135
- requires an endpoint or filter that the shortcut does not model.
124
+ Use `@agent-native/core/provider-api` as the shared substrate, and build these
125
+ actions as thin factory imports rather than copying `defineAction` schemas and
126
+ handlers into each template:
127
+
128
+ ```ts
129
+ import {
130
+ createProviderApiCatalogAction,
131
+ createProviderApiDocsAction,
132
+ createProviderApiRequestAction,
133
+ } from "@agent-native/core/provider-api/actions/provider-api";
134
+ import {
135
+ createDeleteStagedDatasetAction,
136
+ createListStagedDatasetsAction,
137
+ createQueryStagedDatasetAction,
138
+ } from "@agent-native/core/provider-api/actions/staged-datasets";
139
+ ```
140
+
141
+ Pass the app's existing provider runtime to the provider factories, and pass
142
+ its app id to the staged-dataset factories. Keep app-specific descriptions,
143
+ provider allow-lists, HTTP/tool-callability settings, and credential adapters
144
+ as factory options. Only add a thin credential adapter when the app has
145
+ app-specific credential lookup rules. If the app stores a built-in provider's
146
+ OAuth grant under a narrower local provider id, use the runtime's
147
+ `oauthProviderOverrides` instead of duplicating provider config. If credentials
148
+ are stored on shareable/resource rows rather than in the shared credential or
149
+ OAuth-token stores, build a resolver that enforces those access checks before
150
+ exposing raw provider requests. Keep `provider-api-request` `http: false`
151
+ unless a separate UI permission model authorizes arbitrary provider writes.
152
+ Specific actions such as `search-records`, `search-emails`, or `sync-source`
153
+ are convenience shortcuts, not capability limits; agents should fall back to
154
+ the provider API trio when a question requires an endpoint or filter that the
155
+ shortcut does not model.
136
156
 
137
157
  This is a framework tenet. The safety boundary should be provider host
138
158
  allow-listing, credential scoping, auth injection, private-network blocking,
@@ -0,0 +1,102 @@
1
+ ---
2
+ name: customizing-agent-native
3
+ description: >-
4
+ How to adopt, compose, or selectively copy Agent Native UI into app-owned
5
+ code. Use when overriding shared components, customizing a template, adding
6
+ UI to chat or headless apps, or inspecting installed framework source.
7
+ scope: dev
8
+ metadata:
9
+ internal: true
10
+ ---
11
+
12
+ # Customizing Agent Native
13
+
14
+ ## Rule
15
+
16
+ Start with the public component and its props, slots, callbacks, and stable
17
+ class names. If those seams are not enough, copy the smallest useful reference
18
+ implementation into the app and make that copy app-owned. Never edit
19
+ `node_modules`, deep-import a private source file at runtime, or patch an
20
+ `@agent-native/*` package.
21
+
22
+ Use this order:
23
+
24
+ 1. Configure the public component.
25
+ 2. Compose public primitives behind a local app component.
26
+ 3. Copy one component or helper into app source and change the app import.
27
+ 4. Propose a new Toolkit seam when the same override is useful in two apps.
28
+
29
+ Copying is for intentional product customization, not for hiding an upgrade
30
+ failure or replacing Core runtime behavior.
31
+
32
+ ## Find The Installed Implementation
33
+
34
+ Use the source that matches the installed package version:
35
+
36
+ ```bash
37
+ pnpm action docs-search --query "<component or feature>"
38
+ pnpm action source-search --query "<component or symbol>"
39
+ rg -n "<component or symbol>" node_modules/@agent-native/toolkit/src
40
+ rg -n "<component or symbol>" node_modules/@agent-native/core/corpus
41
+ ```
42
+
43
+ - Toolkit publishes readable TypeScript under
44
+ `node_modules/@agent-native/toolkit/src/` for selective UI adoption.
45
+ - Core and first-party template source lives under
46
+ `node_modules/@agent-native/core/corpus/core/` and
47
+ `node_modules/@agent-native/core/corpus/templates/`.
48
+ - Treat those trees as read-only references. Copy files into an app directory
49
+ such as `app/components/`, then import the local copy.
50
+
51
+ When a copied component imports sibling helpers, copy only the required
52
+ siblings or replace them with public package imports. Do not copy an entire
53
+ package or template to change one surface.
54
+
55
+ ## Preserve The Agent-Native Contract
56
+
57
+ UI ownership may change; product contracts should not:
58
+
59
+ - Keep app operations in `defineAction` actions and call them through
60
+ `useActionQuery`, `useActionMutation`, or another named client helper.
61
+ - Keep navigation, selection, and focused-object state visible through the
62
+ existing application-state keys.
63
+ - Keep AI work in the shared agent chat instead of adding direct LLM calls.
64
+ - Keep auth, access checks, persistence, chat transport, and agent execution in
65
+ Core. Do not copy those runtimes into the app.
66
+ - Keep local adapters narrow so package upgrades still improve every surface
67
+ the app has not intentionally taken ownership of.
68
+
69
+ ## App Shapes
70
+
71
+ - **Template app:** begin with its existing local adapters and domain UI. Use
72
+ Toolkit for repeated workspace UI; copy only the piece being customized.
73
+ - **Chat app:** keep `AgentChatSurface`, thread state, and chat transport in
74
+ Core. Compose or copy Toolkit presentation such as chat-history UI around it.
75
+ - **Headless app:** stay action-first while no UI is needed. When adding a UI,
76
+ use the Chat template as the on-ramp or add Toolkit components without
77
+ replacing the existing actions.
78
+ - **Workspace:** put one-app overrides in that app. Promote a local component
79
+ to `packages/shared` only when multiple workspace apps use it.
80
+
81
+ ## After Copying
82
+
83
+ - Remove unused dependencies and imports from the copied file.
84
+ - Keep visible text in the app's localization catalogs.
85
+ - Run the app's formatter, typecheck, and focused tests.
86
+ - Re-check the installed source during future package upgrades; the app-owned
87
+ copy does not receive upstream fixes automatically.
88
+
89
+ ## Don't
90
+
91
+ - Don't edit or import from `node_modules/@agent-native/*/src` at runtime.
92
+ - Don't add `pnpm.overrides`, patches, or resolutions for Agent Native packages.
93
+ - Don't copy Core auth, DB, action, agent-loop, or transport internals.
94
+ - Don't fork a full template when a prop, slot, wrapper, or one-file copy works.
95
+
96
+ ## Related Skills
97
+
98
+ - `agent-native-docs` — version-matched docs and source lookup
99
+ - `agent-native-toolkit` — shared-vs-app-owned architecture boundary
100
+ - `self-modifying-code` — safe app source edits
101
+ - `upgrade-agent-native` — supported package upgrade path
102
+ - `adding-a-feature` — UI/action/instructions/application-state parity
@@ -35,8 +35,14 @@ Tier 4 includes **all** of the following — not only editing package source:
35
35
  - Files under `node_modules/@agent-native/*` (core, dispatch, scheduling, …)
36
36
  - `pnpm.overrides`, `overrides`, `resolutions`, or `patchedDependencies` that
37
37
  target any `@agent-native/*` package
38
- - Local patches, vendored copies, or invented "dispatch/core behavior"
39
- shims meant to paper over a version skew or failed upgrade
38
+ - Local package patches or invented "dispatch/core behavior" shims meant to
39
+ paper over a version skew or failed upgrade
40
+
41
+ This does not prohibit intentional app-owned UI customization. When public
42
+ props and composition are insufficient, the `customizing-agent-native` skill
43
+ allows copying the smallest reference UI component from the installed source
44
+ into the app. The copy must use public runtime contracts and must not replace
45
+ Core auth, DB, actions, agent execution, or transport behavior.
40
46
 
41
47
  When an older branch needs current packages, use **`agent-native upgrade`**
42
48
  (see the `upgrade-agent-native` skill). If upgrade or typecheck fails, fix
@@ -88,6 +94,8 @@ inline strings in components.
88
94
  - Don't modify `.env` files or files containing secrets
89
95
  - Don't modify `@agent-native/core`, `@agent-native/dispatch`, or other
90
96
  `@agent-native/*` package internals (including under `node_modules`)
97
+ - Don't confuse a read-only reference copy with editing package internals: use
98
+ `customizing-agent-native` for selective app-owned UI adoption
91
99
  - Don't add `pnpm.overrides` / `patchedDependencies` / `resolutions` for
92
100
  `@agent-native/*` to "make the app run" after a version bump
93
101
  - Don't invent local dispatch/core behavior overrides when upgrade fails —
@@ -99,6 +107,7 @@ inline strings in components.
99
107
  ## Related Skills
100
108
 
101
109
  - **upgrade-agent-native** — supported path to bring an older app/workspace current
110
+ - **customizing-agent-native** — safe selective adoption of installed reference UI
102
111
  - **storing-data** — Tier 1 modifications (data files) are the safest and most common
103
112
  - **actions** — The agent can create or modify actions to add new capabilities
104
113
  - **delegate-to-agent** — Self-modification requests come through the agent chat
@@ -63,6 +63,11 @@ install → refresh scaffold skills → verify, then fix **app** code only.
63
63
  - Re-run `agent-native upgrade` or `pnpm typecheck`
64
64
  - Stop and ask the user if you cannot fix the app-level error
65
65
 
66
+ Intentional app-level UI customization is a separate workflow. Read
67
+ `customizing-agent-native` when the product needs to own a selectively
68
+ copied component; do not use that path to reproduce framework runtime
69
+ behavior or hide version skew.
70
+
66
71
  4. **Dry-run / partial runs**
67
72
 
68
73
  ```bash
@@ -91,4 +96,5 @@ install → refresh scaffold skills → verify, then fix **app** code only.
91
96
 
92
97
  - **self-modifying-code** — Tier 4: framework packages are off limits
93
98
  - **agent-native-docs** — version-matched docs after the bump
99
+ - **customizing-agent-native** — intentional app-owned UI copies, not upgrade patches
94
100
  - **portability** — keep app code provider-agnostic across upgrades
@@ -49,16 +49,22 @@ export const evidenceSchema = z.object({
49
49
  .describe("Optional timestamp for meeting/call citations"),
50
50
  });
51
51
 
52
+ const MAX_JSON_STRING_UNWRAPS = 2;
53
+
52
54
  export function parseJsonCliInput(value: unknown) {
53
55
  if (value === undefined) return undefined;
54
- if (typeof value !== "string") return value;
55
- const trimmed = value.trim();
56
- if (!trimmed) return undefined;
57
- try {
58
- return JSON.parse(trimmed);
59
- } catch {
60
- return value;
56
+ let parsed = value;
57
+ for (let attempt = 0; attempt < MAX_JSON_STRING_UNWRAPS; attempt += 1) {
58
+ if (typeof parsed !== "string") return parsed;
59
+ const trimmed = parsed.trim();
60
+ if (!trimmed) return undefined;
61
+ try {
62
+ parsed = JSON.parse(trimmed);
63
+ } catch {
64
+ return parsed;
65
+ }
61
66
  }
67
+ return parsed;
62
68
  }
63
69
 
64
70
  export const jsonRecordSchema = z.preprocess(
@@ -1,14 +1,12 @@
1
1
  /**
2
2
  * Thin Brain re-export of staged dataset deletion, pre-bound to appId="brain".
3
3
  */
4
- import { defineAction } from "@agent-native/core";
5
- import { deleteStagedDataset } from "@agent-native/core/provider-api/staged-datasets-store";
6
- import { getCredentialContext } from "@agent-native/core/server/request-context";
4
+ import { createDeleteStagedDatasetAction } from "@agent-native/core/provider-api/actions/staged-datasets";
7
5
  import { z } from "zod";
8
6
 
9
7
  import { BRAIN_APP_ID } from "../server/lib/provider-api.js";
10
8
 
11
- export default defineAction({
9
+ export default createDeleteStagedDatasetAction({
12
10
  description:
13
11
  "Delete a staged dataset by id, freeing its scratch storage. Use after analysis is complete or before re-staging under the same name. Only the owner who staged the dataset can delete it.",
14
12
  schema: z.object({
@@ -20,24 +18,5 @@ export default defineAction({
20
18
  ),
21
19
  }),
22
20
  http: false,
23
- run: async (args) => {
24
- const ctx = getCredentialContext();
25
- if (!ctx) {
26
- throw new Error("No authenticated context for delete-staged-dataset.");
27
- }
28
-
29
- const deleted = await deleteStagedDataset({
30
- id: args.datasetId,
31
- appId: BRAIN_APP_ID,
32
- ownerEmail: ctx.userEmail,
33
- });
34
-
35
- if (!deleted) {
36
- throw new Error(
37
- `Dataset ${args.datasetId} not found (or belongs to a different owner/app).`,
38
- );
39
- }
40
-
41
- return { deleted: true, datasetId: args.datasetId };
42
- },
21
+ appId: BRAIN_APP_ID,
43
22
  });
@@ -1,40 +1,15 @@
1
1
  /**
2
2
  * Thin Brain re-export of staged dataset listing, pre-bound to appId="brain".
3
3
  */
4
- import { defineAction } from "@agent-native/core";
5
- import { listStagedDatasets } from "@agent-native/core/provider-api/staged-datasets-store";
6
- import { getCredentialContext } from "@agent-native/core/server/request-context";
4
+ import { createListStagedDatasetsAction } from "@agent-native/core/provider-api/actions/staged-datasets";
7
5
  import { z } from "zod";
8
6
 
9
7
  import { BRAIN_APP_ID } from "../server/lib/provider-api.js";
10
8
 
11
- export default defineAction({
9
+ export default createListStagedDatasetsAction({
12
10
  description:
13
11
  "List staged datasets stored by provider-api-request (stageAs) for the current user. Returns dataset ids, names, row counts, columns, and sizes. Use dataset ids with query-staged-dataset to aggregate, or with delete-staged-dataset to free scratch storage.",
14
12
  schema: z.object({}),
15
13
  http: { method: "GET" },
16
- readOnly: true,
17
- run: async () => {
18
- const ctx = getCredentialContext();
19
- if (!ctx) {
20
- throw new Error("No authenticated context for list-staged-datasets.");
21
- }
22
-
23
- const datasets = await listStagedDatasets({
24
- appId: BRAIN_APP_ID,
25
- ownerEmail: ctx.userEmail,
26
- });
27
-
28
- return {
29
- datasets: datasets.map((d) => ({
30
- id: d.id,
31
- name: d.name,
32
- rowCount: d.rowCount,
33
- columns: d.columns,
34
- byteSize: d.byteSize,
35
- updatedAt: new Date(d.updatedAt).toISOString(),
36
- })),
37
- total: datasets.length,
38
- };
39
- },
14
+ appId: BRAIN_APP_ID,
40
15
  });
@@ -1,14 +1,14 @@
1
- import { defineAction } from "@agent-native/core";
1
+ import { createProviderApiCatalogAction } from "@agent-native/core/provider-api/actions/provider-api";
2
2
  import { z } from "zod";
3
3
 
4
4
  import {
5
5
  BRAIN_PROVIDER_API_IDS,
6
- listProviderApiCatalog,
6
+ getBrainProviderApiRuntime,
7
7
  } from "../server/lib/provider-api.js";
8
8
 
9
9
  const ProviderSchema = z.enum(BRAIN_PROVIDER_API_IDS);
10
10
 
11
- export default defineAction({
11
+ export default createProviderApiCatalogAction(getBrainProviderApiRuntime(), {
12
12
  description:
13
13
  "List raw HTTP API capabilities for configured/shared providers that Brain can use for ad hoc analysis. Use before provider-api-request when source readers or canned actions are too narrow. Returns base URLs, auth style, credential key names, docs/spec URLs, placeholders, and examples; never returns secret values.",
14
14
  schema: z.object({
@@ -17,12 +17,6 @@ export default defineAction({
17
17
  ),
18
18
  }),
19
19
  http: { method: "GET" },
20
- readOnly: true,
21
- run: async ({ provider }) => {
22
- return {
23
- providers: await listProviderApiCatalog(provider),
24
- guidance:
25
- "Brain source sync and retrieval actions are convenience readers, not capability limits. When a question needs an endpoint, object type, filter, pagination mode, or API version that a source action does not model, inspect docs/spec URLs here and call provider-api-request with the exact provider API method/path/query/body. For broad searches, joins, classification, or absence claims, stage or save the full bounded corpus and reduce it with query-staged-dataset or run-code.",
26
- };
27
- },
20
+ guidance:
21
+ "Brain source sync and retrieval actions are convenience readers, not capability limits. When a question needs an endpoint, object type, filter, pagination mode, or API version that a source action does not model, inspect docs/spec URLs here and call provider-api-request with the exact provider API method/path/query/body. For broad searches, joins, classification, or absence claims, stage or save the full bounded corpus and reduce it with query-staged-dataset or run-code.",
28
22
  });
@@ -1,9 +1,9 @@
1
- import { defineAction } from "@agent-native/core";
1
+ import { createProviderApiDocsAction } from "@agent-native/core/provider-api/actions/provider-api";
2
2
  import { z } from "zod";
3
3
 
4
4
  import {
5
5
  BRAIN_PROVIDER_API_IDS,
6
- fetchProviderApiDocs,
6
+ getBrainProviderApiRuntime,
7
7
  } from "../server/lib/provider-api.js";
8
8
 
9
9
  const ProviderSchema = z.enum(BRAIN_PROVIDER_API_IDS);
@@ -23,7 +23,7 @@ const WebContentSearchSchema = z.object({
23
23
  caseSensitive: BooleanFromQuerySchema.optional(),
24
24
  });
25
25
 
26
- export default defineAction({
26
+ export default createProviderApiDocsAction(getBrainProviderApiRuntime(), {
27
27
  description:
28
28
  "Inspect provider API docs/spec metadata, or fetch a public provider docs/spec/changelog URL. Use this before arbitrary provider-api-request calls when the exact endpoint, filter operator, payload shape, pagination, or API version is uncertain.",
29
29
  schema: z.object({
@@ -69,6 +69,4 @@ export default defineAction({
69
69
  ),
70
70
  }),
71
71
  http: { method: "GET" },
72
- readOnly: true,
73
- run: async (args) => fetchProviderApiDocs(args),
74
72
  });