@agent-native/core 0.99.2 → 0.100.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 (381) hide show
  1. package/corpus/README.md +2 -2
  2. package/corpus/core/CHANGELOG.md +21 -0
  3. package/corpus/core/docs/content/a2a-protocol.mdx +42 -0
  4. package/corpus/core/docs/content/agent-surfaces.mdx +43 -0
  5. package/corpus/core/docs/content/external-agents.mdx +11 -0
  6. package/corpus/core/docs/content/locales/ar-SA/a2a-protocol.mdx +42 -0
  7. package/corpus/core/docs/content/locales/ar-SA/agent-surfaces.mdx +30 -0
  8. package/corpus/core/docs/content/locales/ar-SA/external-agents.mdx +9 -0
  9. package/corpus/core/docs/content/locales/de-DE/a2a-protocol.mdx +42 -0
  10. package/corpus/core/docs/content/locales/de-DE/agent-surfaces.mdx +34 -0
  11. package/corpus/core/docs/content/locales/de-DE/external-agents.mdx +10 -0
  12. package/corpus/core/docs/content/locales/es-ES/a2a-protocol.mdx +42 -0
  13. package/corpus/core/docs/content/locales/es-ES/agent-surfaces.mdx +34 -0
  14. package/corpus/core/docs/content/locales/es-ES/external-agents.mdx +10 -0
  15. package/corpus/core/docs/content/locales/fr-FR/a2a-protocol.mdx +42 -0
  16. package/corpus/core/docs/content/locales/fr-FR/agent-surfaces.mdx +34 -0
  17. package/corpus/core/docs/content/locales/fr-FR/external-agents.mdx +11 -0
  18. package/corpus/core/docs/content/locales/hi-IN/a2a-protocol.mdx +42 -0
  19. package/corpus/core/docs/content/locales/hi-IN/agent-surfaces.mdx +31 -0
  20. package/corpus/core/docs/content/locales/hi-IN/external-agents.mdx +9 -0
  21. package/corpus/core/docs/content/locales/ja-JP/a2a-protocol.mdx +42 -0
  22. package/corpus/core/docs/content/locales/ja-JP/agent-surfaces.mdx +32 -0
  23. package/corpus/core/docs/content/locales/ja-JP/external-agents.mdx +10 -0
  24. package/corpus/core/docs/content/locales/ko-KR/a2a-protocol.mdx +42 -0
  25. package/corpus/core/docs/content/locales/ko-KR/agent-surfaces.mdx +32 -0
  26. package/corpus/core/docs/content/locales/ko-KR/external-agents.mdx +9 -0
  27. package/corpus/core/docs/content/locales/pt-BR/a2a-protocol.mdx +42 -0
  28. package/corpus/core/docs/content/locales/pt-BR/agent-surfaces.mdx +33 -0
  29. package/corpus/core/docs/content/locales/pt-BR/external-agents.mdx +10 -0
  30. package/corpus/core/docs/content/locales/zh-CN/a2a-protocol.mdx +42 -0
  31. package/corpus/core/docs/content/locales/zh-CN/agent-surfaces.mdx +29 -0
  32. package/corpus/core/docs/content/locales/zh-CN/external-agents.mdx +8 -0
  33. package/corpus/core/docs/content/locales/zh-TW/a2a-protocol.mdx +42 -0
  34. package/corpus/core/docs/content/locales/zh-TW/agent-surfaces.mdx +29 -0
  35. package/corpus/core/docs/content/locales/zh-TW/external-agents.mdx +8 -0
  36. package/corpus/core/package.json +1 -1
  37. package/corpus/core/src/agent/context-xray/actions/context-evict.ts +11 -0
  38. package/corpus/core/src/agent/context-xray/actions/context-pin.ts +11 -0
  39. package/corpus/core/src/agent/context-xray/actions/context-preview-get.ts +134 -0
  40. package/corpus/core/src/agent/context-xray/actions/context-restore.ts +11 -0
  41. package/corpus/core/src/agent/context-xray/actions/errors.ts +20 -0
  42. package/corpus/core/src/agent/context-xray/manifest.ts +106 -7
  43. package/corpus/core/src/agent/engine/context-directives-transform.ts +5 -1
  44. package/corpus/core/src/agent/production-agent.ts +100 -38
  45. package/corpus/core/src/agent/run-loop-with-resume.ts +7 -2
  46. package/corpus/core/src/client/AgentPanel.tsx +35 -8
  47. package/corpus/core/src/client/agent-page/AgentContextTab.tsx +501 -0
  48. package/corpus/core/src/client/agent-page/AgentJobsTab.tsx +370 -0
  49. package/corpus/core/src/client/agent-page/AgentTabsPage.tsx +1084 -0
  50. package/corpus/core/src/client/agent-page/types.ts +18 -0
  51. package/corpus/core/src/client/agent-page/use-jobs.ts +150 -0
  52. package/corpus/core/src/client/context-xray/ContextMeter.tsx +22 -5
  53. package/corpus/core/src/client/context-xray/ContextTreemap.tsx +16 -1
  54. package/corpus/core/src/client/context-xray/ContextXRayPanel.tsx +168 -3
  55. package/corpus/core/src/client/context-xray/format.ts +6 -0
  56. package/corpus/core/src/client/index.ts +6 -0
  57. package/corpus/core/src/client/resources/ResourcesPanel.tsx +51 -23
  58. package/corpus/core/src/client/settings/AutomationsSection.tsx +407 -387
  59. package/corpus/core/src/jobs/actions/list-recurring-jobs.ts +105 -0
  60. package/corpus/core/src/jobs/actions/manage-recurring-job.ts +85 -0
  61. package/corpus/core/src/jobs/tools.ts +1 -1
  62. package/corpus/core/src/localization/default-messages.ts +110 -0
  63. package/corpus/core/src/mcp/build-server.ts +1 -0
  64. package/corpus/core/src/mcp/connect-route.ts +62 -65
  65. package/corpus/core/src/server/action-discovery.ts +23 -0
  66. package/corpus/core/src/server/agent-chat/prompt-resources.ts +174 -2
  67. package/corpus/core/src/server/agent-chat-plugin.ts +175 -2
  68. package/corpus/core/src/server/auth.ts +1 -7
  69. package/corpus/core/src/server/google-oauth.ts +1 -7
  70. package/corpus/core/src/server/workspace-oauth.ts +31 -0
  71. package/corpus/core/src/shared/context-xray.ts +84 -1
  72. package/corpus/core/src/shared/mcp-connect-content.ts +130 -0
  73. package/corpus/core/src/templates/default/app/routes/_index.tsx +11 -0
  74. package/corpus/core/src/templates/default/app/routes/agent.tsx +33 -0
  75. package/corpus/core/src/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +6 -0
  76. package/corpus/core/src/templates/workspace-core/.agents/skills/agent-page/SKILL.md +59 -0
  77. package/corpus/core/src/templates/workspace-core/.agents/skills/context-xray/SKILL.md +25 -0
  78. package/corpus/core/src/templates/workspace-core/.agents/skills/external-agents/SKILL.md +7 -0
  79. package/corpus/core/src/templates/workspace-core/.agents/skills/recurring-jobs/SKILL.md +9 -0
  80. package/corpus/core/src/triggers/actions/list-automations.ts +99 -0
  81. package/corpus/core/src/triggers/actions/manage-automation.ts +78 -0
  82. package/corpus/templates/analytics/actions/data-source-status.ts +33 -15
  83. package/corpus/templates/analytics/actions/query-agent-native-analytics.ts +1 -1
  84. package/corpus/templates/analytics/app/components/dashboard/SqlChart.tsx +149 -24
  85. package/corpus/templates/analytics/app/components/layout/CommandPalette.tsx +17 -0
  86. package/corpus/templates/analytics/app/components/layout/Header.tsx +1 -0
  87. package/corpus/templates/analytics/app/components/layout/Layout.tsx +1 -0
  88. package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +8 -0
  89. package/corpus/templates/analytics/app/i18n/zh-TW.ts +1 -0
  90. package/corpus/templates/analytics/app/i18n-data.ts +1 -0
  91. package/corpus/templates/analytics/app/routes/agent.tsx +5 -0
  92. package/corpus/templates/analytics/changelog/2026-07-13-a-full-agent-page-now-brings-context-files-connections-jobs-.md +6 -0
  93. package/corpus/templates/analytics/changelog/2026-07-13-analytics-answers-can-use-built-in-first-party-event-data.md +6 -0
  94. package/corpus/templates/analytics/changelog/2026-07-13-chart-legends-can-filter-to-one-series-or-hide-a-series-on-h.md +6 -0
  95. package/corpus/templates/analytics/changelog/2026-07-13-gpt-5-6-luna-answers-now-recover-normally-instead-of-showing.md +6 -0
  96. package/corpus/templates/analytics/server/plugins/agent-chat.ts +11 -2
  97. package/corpus/templates/assets/app/components/layout/Header.tsx +1 -0
  98. package/corpus/templates/assets/app/components/layout/Layout.tsx +1 -0
  99. package/corpus/templates/assets/app/components/layout/Sidebar.tsx +2 -0
  100. package/corpus/templates/assets/app/routes/agent.tsx +5 -0
  101. package/corpus/templates/assets/changelog/2026-07-13-a-full-agent-page-now-brings-context-files-connections-jobs-.md +6 -0
  102. package/corpus/templates/brain/app/components/layout/Layout.tsx +1 -0
  103. package/corpus/templates/brain/app/components/layout/Sidebar.tsx +4 -1
  104. package/corpus/templates/brain/app/lib/brain.ts +11 -0
  105. package/corpus/templates/brain/app/root.tsx +15 -1
  106. package/corpus/templates/brain/app/routes/agent.tsx +11 -0
  107. package/corpus/templates/brain/changelog/2026-07-13-a-full-agent-page-now-brings-context-files-connections-jobs-.md +6 -0
  108. package/corpus/templates/calendar/app/components/layout/AppLayout.tsx +1 -0
  109. package/corpus/templates/calendar/app/components/layout/Sidebar.tsx +2 -0
  110. package/corpus/templates/calendar/app/root.tsx +17 -1
  111. package/corpus/templates/calendar/app/routes/_app.agent.tsx +25 -0
  112. package/corpus/templates/calendar/changelog/2026-07-13-a-full-agent-page-now-brings-context-files-connections-jobs-.md +6 -0
  113. package/corpus/templates/chat/app/components/layout/Header.tsx +1 -0
  114. package/corpus/templates/chat/app/components/layout/Layout.tsx +1 -0
  115. package/corpus/templates/chat/app/components/layout/Sidebar.tsx +7 -0
  116. package/corpus/templates/chat/app/hooks/use-navigation-state.ts +3 -0
  117. package/corpus/templates/chat/app/root.tsx +24 -2
  118. package/corpus/templates/chat/app/routes/agent.tsx +15 -0
  119. package/corpus/templates/chat/changelog/2026-07-13-a-full-agent-page-now-brings-context-files-connections-jobs-.md +6 -0
  120. package/corpus/templates/clips/app/components/library/library-layout.tsx +8 -0
  121. package/corpus/templates/clips/app/i18n/ar-SA.ts +2 -0
  122. package/corpus/templates/clips/app/i18n/de-DE.ts +2 -0
  123. package/corpus/templates/clips/app/i18n/en-US.ts +2 -0
  124. package/corpus/templates/clips/app/i18n/es-ES.ts +2 -0
  125. package/corpus/templates/clips/app/i18n/fr-FR.ts +2 -0
  126. package/corpus/templates/clips/app/i18n/hi-IN.ts +2 -0
  127. package/corpus/templates/clips/app/i18n/ja-JP.ts +2 -0
  128. package/corpus/templates/clips/app/i18n/ko-KR.ts +2 -0
  129. package/corpus/templates/clips/app/i18n/pt-BR.ts +2 -0
  130. package/corpus/templates/clips/app/i18n/zh-CN.ts +2 -0
  131. package/corpus/templates/clips/app/i18n/zh-TW.ts +2 -0
  132. package/corpus/templates/clips/app/root.tsx +7 -1
  133. package/corpus/templates/clips/app/routes/_app.agent.tsx +15 -0
  134. package/corpus/templates/clips/changelog/2026-07-13-new-agent-page-see-and-manage-your-agent-s-context-files-con.md +6 -0
  135. package/corpus/templates/content/app/components/layout/Layout.tsx +1 -0
  136. package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +36 -0
  137. package/corpus/templates/content/app/i18n/zh-TW.ts +2 -0
  138. package/corpus/templates/content/app/i18n-data.ts +44 -6
  139. package/corpus/templates/content/app/root.tsx +8 -0
  140. package/corpus/templates/content/app/routes/_app.agent.tsx +15 -0
  141. package/corpus/templates/content/changelog/2026-07-13-new-agent-page-see-and-manage-your-agent-s-context-files-con.md +6 -0
  142. package/corpus/templates/design/app/components/layout/Layout.tsx +1 -0
  143. package/corpus/templates/design/app/components/layout/Sidebar.tsx +2 -0
  144. package/corpus/templates/design/app/i18n/zh-TW.ts +2 -0
  145. package/corpus/templates/design/app/i18n-data.ts +20 -0
  146. package/corpus/templates/design/app/root.tsx +7 -1
  147. package/corpus/templates/design/app/routes/agent.tsx +15 -0
  148. package/corpus/templates/design/changelog/2026-07-13-new-agent-page-see-and-manage-your-agent-s-context-files-con.md +6 -0
  149. package/corpus/templates/dispatch/app/dispatch-extensions.tsx +10 -1
  150. package/corpus/templates/dispatch/app/i18n/zh-TW.ts +2 -0
  151. package/corpus/templates/dispatch/app/i18n-data.ts +20 -0
  152. package/corpus/templates/dispatch/app/root.tsx +7 -2
  153. package/corpus/templates/dispatch/app/routes/agent.tsx +18 -0
  154. package/corpus/templates/dispatch/changelog/2026-07-13-new-agent-page-see-and-manage-your-agent-s-context-files-con.md +6 -0
  155. package/corpus/templates/forms/app/components/layout/Layout.tsx +1 -0
  156. package/corpus/templates/forms/app/components/layout/Sidebar.tsx +35 -0
  157. package/corpus/templates/forms/app/i18n/ar-SA.ts +2 -0
  158. package/corpus/templates/forms/app/i18n/de-DE.ts +2 -0
  159. package/corpus/templates/forms/app/i18n/en-US.ts +2 -0
  160. package/corpus/templates/forms/app/i18n/es-ES.ts +2 -0
  161. package/corpus/templates/forms/app/i18n/fr-FR.ts +2 -0
  162. package/corpus/templates/forms/app/i18n/hi-IN.ts +2 -0
  163. package/corpus/templates/forms/app/i18n/ja-JP.ts +2 -0
  164. package/corpus/templates/forms/app/i18n/ko-KR.ts +2 -0
  165. package/corpus/templates/forms/app/i18n/pt-BR.ts +2 -0
  166. package/corpus/templates/forms/app/i18n/zh-CN.ts +2 -0
  167. package/corpus/templates/forms/app/i18n/zh-TW.ts +2 -0
  168. package/corpus/templates/forms/app/root.tsx +6 -1
  169. package/corpus/templates/forms/app/routes/_app.agent.tsx +15 -0
  170. package/corpus/templates/forms/changelog/2026-07-13-new-agent-page-see-and-manage-your-agent-s-context-files-con.md +6 -0
  171. package/corpus/templates/macros/app/components/layout/AppLayout.tsx +14 -2
  172. package/corpus/templates/macros/app/components/layout/Header.tsx +1 -0
  173. package/corpus/templates/macros/app/root.tsx +17 -2
  174. package/corpus/templates/macros/app/routes/agent.tsx +15 -0
  175. package/corpus/templates/macros/changelog/2026-07-13-new-agent-page-see-and-manage-your-agent-s-context-files-con.md +6 -0
  176. package/corpus/templates/mail/app/components/layout/AppLayout.tsx +42 -0
  177. package/corpus/templates/mail/app/components/layout/CommandPalette.tsx +6 -0
  178. package/corpus/templates/mail/app/routes/agent.tsx +15 -0
  179. package/corpus/templates/mail/changelog/2026-07-13-new-agent-page-see-and-manage-your-agent-s-context-files-con.md +6 -0
  180. package/corpus/templates/plan/app/components/layout/Header.tsx +1 -0
  181. package/corpus/templates/plan/app/components/layout/Layout.tsx +1 -0
  182. package/corpus/templates/plan/app/components/layout/Sidebar.tsx +2 -0
  183. package/corpus/templates/plan/app/root.tsx +8 -0
  184. package/corpus/templates/plan/app/routes/agent.tsx +15 -0
  185. package/corpus/templates/plan/changelog/2026-07-13-new-agent-page-see-and-manage-your-agent-s-context-files-con.md +6 -0
  186. package/corpus/templates/slides/app/components/layout/Header.tsx +1 -0
  187. package/corpus/templates/slides/app/components/layout/Layout.tsx +1 -0
  188. package/corpus/templates/slides/app/components/layout/Sidebar.tsx +2 -0
  189. package/corpus/templates/slides/app/root.tsx +10 -1
  190. package/corpus/templates/slides/app/routes/agent.tsx +15 -0
  191. package/corpus/templates/slides/changelog/2026-07-13-new-agent-page-see-and-manage-your-agent-s-context-files-con.md +6 -0
  192. package/dist/agent/context-xray/actions/context-evict.js +5 -2
  193. package/dist/agent/context-xray/actions/context-evict.js.map +1 -1
  194. package/dist/agent/context-xray/actions/context-pin.js +5 -2
  195. package/dist/agent/context-xray/actions/context-pin.js.map +1 -1
  196. package/dist/agent/context-xray/actions/context-preview-get.d.ts +17 -0
  197. package/dist/agent/context-xray/actions/context-preview-get.d.ts.map +1 -0
  198. package/dist/agent/context-xray/actions/context-preview-get.js +94 -0
  199. package/dist/agent/context-xray/actions/context-preview-get.js.map +1 -0
  200. package/dist/agent/context-xray/actions/context-restore.js +5 -2
  201. package/dist/agent/context-xray/actions/context-restore.js.map +1 -1
  202. package/dist/agent/context-xray/actions/errors.d.ts +3 -0
  203. package/dist/agent/context-xray/actions/errors.d.ts.map +1 -1
  204. package/dist/agent/context-xray/actions/errors.js +6 -0
  205. package/dist/agent/context-xray/actions/errors.js.map +1 -1
  206. package/dist/agent/context-xray/manifest.d.ts +18 -1
  207. package/dist/agent/context-xray/manifest.d.ts.map +1 -1
  208. package/dist/agent/context-xray/manifest.js +68 -6
  209. package/dist/agent/context-xray/manifest.js.map +1 -1
  210. package/dist/agent/engine/context-directives-transform.d.ts +2 -0
  211. package/dist/agent/engine/context-directives-transform.d.ts.map +1 -1
  212. package/dist/agent/engine/context-directives-transform.js +2 -1
  213. package/dist/agent/engine/context-directives-transform.js.map +1 -1
  214. package/dist/agent/production-agent.d.ts +15 -0
  215. package/dist/agent/production-agent.d.ts.map +1 -1
  216. package/dist/agent/production-agent.js +74 -36
  217. package/dist/agent/production-agent.js.map +1 -1
  218. package/dist/agent/run-loop-with-resume.d.ts.map +1 -1
  219. package/dist/agent/run-loop-with-resume.js +6 -3
  220. package/dist/agent/run-loop-with-resume.js.map +1 -1
  221. package/dist/client/AgentPanel.d.ts +5 -1
  222. package/dist/client/AgentPanel.d.ts.map +1 -1
  223. package/dist/client/AgentPanel.js +9 -11
  224. package/dist/client/AgentPanel.js.map +1 -1
  225. package/dist/client/agent-page/AgentContextTab.d.ts +5 -0
  226. package/dist/client/agent-page/AgentContextTab.d.ts.map +1 -0
  227. package/dist/client/agent-page/AgentContextTab.js +202 -0
  228. package/dist/client/agent-page/AgentContextTab.js.map +1 -0
  229. package/dist/client/agent-page/AgentJobsTab.d.ts +3 -0
  230. package/dist/client/agent-page/AgentJobsTab.d.ts.map +1 -0
  231. package/dist/client/agent-page/AgentJobsTab.js +98 -0
  232. package/dist/client/agent-page/AgentJobsTab.js.map +1 -0
  233. package/dist/client/agent-page/AgentTabsPage.d.ts +20 -0
  234. package/dist/client/agent-page/AgentTabsPage.d.ts.map +1 -0
  235. package/dist/client/agent-page/AgentTabsPage.js +420 -0
  236. package/dist/client/agent-page/AgentTabsPage.js.map +1 -0
  237. package/dist/client/agent-page/types.d.ts +17 -0
  238. package/dist/client/agent-page/types.d.ts.map +1 -0
  239. package/dist/client/agent-page/types.js +9 -0
  240. package/dist/client/agent-page/types.js.map +1 -0
  241. package/dist/client/agent-page/use-jobs.d.ts +61 -0
  242. package/dist/client/agent-page/use-jobs.d.ts.map +1 -0
  243. package/dist/client/agent-page/use-jobs.js +71 -0
  244. package/dist/client/agent-page/use-jobs.js.map +1 -0
  245. package/dist/client/context-xray/ContextMeter.d.ts +3 -1
  246. package/dist/client/context-xray/ContextMeter.d.ts.map +1 -1
  247. package/dist/client/context-xray/ContextMeter.js +14 -5
  248. package/dist/client/context-xray/ContextMeter.js.map +1 -1
  249. package/dist/client/context-xray/ContextTreemap.d.ts +3 -2
  250. package/dist/client/context-xray/ContextTreemap.d.ts.map +1 -1
  251. package/dist/client/context-xray/ContextTreemap.js +9 -1
  252. package/dist/client/context-xray/ContextTreemap.js.map +1 -1
  253. package/dist/client/context-xray/ContextXRayPanel.d.ts.map +1 -1
  254. package/dist/client/context-xray/ContextXRayPanel.js +95 -20
  255. package/dist/client/context-xray/ContextXRayPanel.js.map +1 -1
  256. package/dist/client/context-xray/format.d.ts.map +1 -1
  257. package/dist/client/context-xray/format.js +12 -0
  258. package/dist/client/context-xray/format.js.map +1 -1
  259. package/dist/client/index.d.ts +3 -0
  260. package/dist/client/index.d.ts.map +1 -1
  261. package/dist/client/index.js +1 -0
  262. package/dist/client/index.js.map +1 -1
  263. package/dist/client/resources/ResourcesPanel.d.ts +9 -1
  264. package/dist/client/resources/ResourcesPanel.d.ts.map +1 -1
  265. package/dist/client/resources/ResourcesPanel.js +26 -10
  266. package/dist/client/resources/ResourcesPanel.js.map +1 -1
  267. package/dist/client/settings/AutomationsSection.d.ts +9 -0
  268. package/dist/client/settings/AutomationsSection.d.ts.map +1 -1
  269. package/dist/client/settings/AutomationsSection.js +128 -147
  270. package/dist/client/settings/AutomationsSection.js.map +1 -1
  271. package/dist/file-upload/actions/upload-image.d.ts +1 -1
  272. package/dist/jobs/actions/list-recurring-jobs.d.ts +21 -0
  273. package/dist/jobs/actions/list-recurring-jobs.d.ts.map +1 -0
  274. package/dist/jobs/actions/list-recurring-jobs.js +74 -0
  275. package/dist/jobs/actions/list-recurring-jobs.js.map +1 -0
  276. package/dist/jobs/actions/manage-recurring-job.d.ts +18 -0
  277. package/dist/jobs/actions/manage-recurring-job.d.ts.map +1 -0
  278. package/dist/jobs/actions/manage-recurring-job.js +68 -0
  279. package/dist/jobs/actions/manage-recurring-job.js.map +1 -0
  280. package/dist/jobs/tools.d.ts +13 -0
  281. package/dist/jobs/tools.d.ts.map +1 -1
  282. package/dist/jobs/tools.js +1 -1
  283. package/dist/jobs/tools.js.map +1 -1
  284. package/dist/localization/default-messages.d.ts +96 -0
  285. package/dist/localization/default-messages.d.ts.map +1 -1
  286. package/dist/localization/default-messages.js +96 -0
  287. package/dist/localization/default-messages.js.map +1 -1
  288. package/dist/mcp/build-server.d.ts.map +1 -1
  289. package/dist/mcp/build-server.js +1 -0
  290. package/dist/mcp/build-server.js.map +1 -1
  291. package/dist/mcp/connect-route.d.ts.map +1 -1
  292. package/dist/mcp/connect-route.js +44 -59
  293. package/dist/mcp/connect-route.js.map +1 -1
  294. package/dist/notifications/routes.d.ts +2 -2
  295. package/dist/resources/handlers.d.ts +1 -1
  296. package/dist/server/action-discovery.d.ts.map +1 -1
  297. package/dist/server/action-discovery.js +23 -0
  298. package/dist/server/action-discovery.js.map +1 -1
  299. package/dist/server/agent-chat/prompt-resources.d.ts +14 -0
  300. package/dist/server/agent-chat/prompt-resources.d.ts.map +1 -1
  301. package/dist/server/agent-chat/prompt-resources.js +139 -2
  302. package/dist/server/agent-chat/prompt-resources.js.map +1 -1
  303. package/dist/server/agent-chat-plugin.d.ts +1 -0
  304. package/dist/server/agent-chat-plugin.d.ts.map +1 -1
  305. package/dist/server/agent-chat-plugin.js +136 -3
  306. package/dist/server/agent-chat-plugin.js.map +1 -1
  307. package/dist/server/auth.d.ts.map +1 -1
  308. package/dist/server/auth.js +1 -4
  309. package/dist/server/auth.js.map +1 -1
  310. package/dist/server/google-oauth.d.ts.map +1 -1
  311. package/dist/server/google-oauth.js +1 -4
  312. package/dist/server/google-oauth.js.map +1 -1
  313. package/dist/server/transcribe-voice.d.ts +1 -1
  314. package/dist/server/workspace-oauth.d.ts +11 -0
  315. package/dist/server/workspace-oauth.d.ts.map +1 -0
  316. package/dist/server/workspace-oauth.js +25 -0
  317. package/dist/server/workspace-oauth.js.map +1 -0
  318. package/dist/shared/context-xray.d.ts +45 -1
  319. package/dist/shared/context-xray.d.ts.map +1 -1
  320. package/dist/shared/context-xray.js +12 -0
  321. package/dist/shared/context-xray.js.map +1 -1
  322. package/dist/shared/mcp-connect-content.d.ts +37 -0
  323. package/dist/shared/mcp-connect-content.d.ts.map +1 -0
  324. package/dist/shared/mcp-connect-content.js +92 -0
  325. package/dist/shared/mcp-connect-content.js.map +1 -0
  326. package/dist/templates/default/app/routes/_index.tsx +11 -0
  327. package/dist/templates/default/app/routes/agent.tsx +33 -0
  328. package/dist/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +6 -0
  329. package/dist/templates/workspace-core/.agents/skills/agent-page/SKILL.md +59 -0
  330. package/dist/templates/workspace-core/.agents/skills/context-xray/SKILL.md +25 -0
  331. package/dist/templates/workspace-core/.agents/skills/external-agents/SKILL.md +7 -0
  332. package/dist/templates/workspace-core/.agents/skills/recurring-jobs/SKILL.md +9 -0
  333. package/dist/triggers/actions/list-automations.d.ts +24 -0
  334. package/dist/triggers/actions/list-automations.d.ts.map +1 -0
  335. package/dist/triggers/actions/list-automations.js +72 -0
  336. package/dist/triggers/actions/list-automations.js.map +1 -0
  337. package/dist/triggers/actions/manage-automation.d.ts +18 -0
  338. package/dist/triggers/actions/manage-automation.d.ts.map +1 -0
  339. package/dist/triggers/actions/manage-automation.js +60 -0
  340. package/dist/triggers/actions/manage-automation.js.map +1 -0
  341. package/docs/content/a2a-protocol.mdx +42 -0
  342. package/docs/content/agent-surfaces.mdx +43 -0
  343. package/docs/content/external-agents.mdx +11 -0
  344. package/docs/content/locales/ar-SA/a2a-protocol.mdx +42 -0
  345. package/docs/content/locales/ar-SA/agent-surfaces.mdx +30 -0
  346. package/docs/content/locales/ar-SA/external-agents.mdx +9 -0
  347. package/docs/content/locales/de-DE/a2a-protocol.mdx +42 -0
  348. package/docs/content/locales/de-DE/agent-surfaces.mdx +34 -0
  349. package/docs/content/locales/de-DE/external-agents.mdx +10 -0
  350. package/docs/content/locales/es-ES/a2a-protocol.mdx +42 -0
  351. package/docs/content/locales/es-ES/agent-surfaces.mdx +34 -0
  352. package/docs/content/locales/es-ES/external-agents.mdx +10 -0
  353. package/docs/content/locales/fr-FR/a2a-protocol.mdx +42 -0
  354. package/docs/content/locales/fr-FR/agent-surfaces.mdx +34 -0
  355. package/docs/content/locales/fr-FR/external-agents.mdx +11 -0
  356. package/docs/content/locales/hi-IN/a2a-protocol.mdx +42 -0
  357. package/docs/content/locales/hi-IN/agent-surfaces.mdx +31 -0
  358. package/docs/content/locales/hi-IN/external-agents.mdx +9 -0
  359. package/docs/content/locales/ja-JP/a2a-protocol.mdx +42 -0
  360. package/docs/content/locales/ja-JP/agent-surfaces.mdx +32 -0
  361. package/docs/content/locales/ja-JP/external-agents.mdx +10 -0
  362. package/docs/content/locales/ko-KR/a2a-protocol.mdx +42 -0
  363. package/docs/content/locales/ko-KR/agent-surfaces.mdx +32 -0
  364. package/docs/content/locales/ko-KR/external-agents.mdx +9 -0
  365. package/docs/content/locales/pt-BR/a2a-protocol.mdx +42 -0
  366. package/docs/content/locales/pt-BR/agent-surfaces.mdx +33 -0
  367. package/docs/content/locales/pt-BR/external-agents.mdx +10 -0
  368. package/docs/content/locales/zh-CN/a2a-protocol.mdx +42 -0
  369. package/docs/content/locales/zh-CN/agent-surfaces.mdx +29 -0
  370. package/docs/content/locales/zh-CN/external-agents.mdx +8 -0
  371. package/docs/content/locales/zh-TW/a2a-protocol.mdx +42 -0
  372. package/docs/content/locales/zh-TW/agent-surfaces.mdx +29 -0
  373. package/docs/content/locales/zh-TW/external-agents.mdx +8 -0
  374. package/package.json +1 -1
  375. package/src/templates/default/app/routes/_index.tsx +11 -0
  376. package/src/templates/default/app/routes/agent.tsx +33 -0
  377. package/src/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +6 -0
  378. package/src/templates/workspace-core/.agents/skills/agent-page/SKILL.md +59 -0
  379. package/src/templates/workspace-core/.agents/skills/context-xray/SKILL.md +25 -0
  380. package/src/templates/workspace-core/.agents/skills/external-agents/SKILL.md +7 -0
  381. package/src/templates/workspace-core/.agents/skills/recurring-jobs/SKILL.md +9 -0
@@ -117,6 +117,14 @@ https://<your-app>.agent-native.com/mcp
117
117
  `https://&lt;app&gt;/mcp/connect` 與可複製的 URL 和
118
118
  Claude、ChatGPT、游標、Claude 程式碼、Codex 和其他的主機特定分頁。
119
119
 
120
+ ### 應用程式內的 Access 分頁 {#access-tab}
121
+
122
+ 掛載 `AgentTabsPage` 的應用程式也會在 **Access** 分頁提供相同的連線流程。
123
+ 它會顯示 MCP URL、可用時的 A2A 代理卡片,以及 Claude、ChatGPT、Cursor、Claude
124
+ Code、Codex 和其他用戶端的共用設定指南。可將它作為應用程式內的起點,並開啟
125
+ `/mcp/connect` 查看完整流程和權杖備援。這是連線設定介面,不是通用存取控制台;
126
+ 此分頁目前還不管理 grants、範圍編輯或撤銷。
127
+
120
128
  ### Claude 和 ChatGPT OAuth {#oauth}
121
129
 
122
130
  Claude / Claude 桌面:新增自訂連線器,貼上 MCP URL,點選
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-native/core",
3
- "version": "0.99.2",
3
+ "version": "0.100.0",
4
4
  "description": "Framework for agent-native application development — where AI agents and UI share SQL state, actions, and context",
5
5
  "homepage": "https://github.com/BuilderIO/agent-native#readme",
6
6
  "bugs": {
@@ -7,12 +7,15 @@ import {
7
7
  } from "../../../server/request-context.js";
8
8
  import { callerOwnsThread } from "../../run-ownership.js";
9
9
  import {
10
+ readContextManifest,
10
11
  upsertContextDirective,
11
12
  writeContextManifestStatus,
12
13
  } from "../directives-store.js";
13
14
  import {
14
15
  contextXrayAuthError,
16
+ contextXraySystemSegmentError,
15
17
  contextXrayThreadNotFoundError,
18
+ isContextXraySystemSegment,
16
19
  } from "./errors.js";
17
20
 
18
21
  export default defineAction({
@@ -28,6 +31,14 @@ export default defineAction({
28
31
  if (!(await callerOwnsThread(ownerEmail, args.threadId))) {
29
32
  throw contextXrayThreadNotFoundError();
30
33
  }
34
+ if (
35
+ isContextXraySystemSegment(
36
+ await readContextManifest(args.threadId),
37
+ args.segmentId,
38
+ )
39
+ ) {
40
+ throw contextXraySystemSegmentError();
41
+ }
31
42
  const directive = await upsertContextDirective({
32
43
  threadId: args.threadId,
33
44
  segmentId: args.segmentId,
@@ -7,12 +7,15 @@ import {
7
7
  } from "../../../server/request-context.js";
8
8
  import { callerOwnsThread } from "../../run-ownership.js";
9
9
  import {
10
+ readContextManifest,
10
11
  upsertContextDirective,
11
12
  writeContextManifestStatus,
12
13
  } from "../directives-store.js";
13
14
  import {
14
15
  contextXrayAuthError,
16
+ contextXraySystemSegmentError,
15
17
  contextXrayThreadNotFoundError,
18
+ isContextXraySystemSegment,
16
19
  } from "./errors.js";
17
20
 
18
21
  export default defineAction({
@@ -28,6 +31,14 @@ export default defineAction({
28
31
  if (!(await callerOwnsThread(ownerEmail, args.threadId))) {
29
32
  throw contextXrayThreadNotFoundError();
30
33
  }
34
+ if (
35
+ isContextXraySystemSegment(
36
+ await readContextManifest(args.threadId),
37
+ args.segmentId,
38
+ )
39
+ ) {
40
+ throw contextXraySystemSegmentError();
41
+ }
31
42
  const directive = await upsertContextDirective({
32
43
  threadId: args.threadId,
33
44
  segmentId: args.segmentId,
@@ -0,0 +1,134 @@
1
+ import { z } from "zod";
2
+
3
+ import { defineAction } from "../../../action.js";
4
+ import { embedApp } from "../../../mcp/embed-app.js";
5
+ import { SHARED_OWNER } from "../../../resources/store.js";
6
+ import {
7
+ buildFrameworkPrompts,
8
+ buildSchemaBlock,
9
+ } from "../../../server/agent-chat/framework-prompts.js";
10
+ import {
11
+ loadResourcesForPrompt,
12
+ promptResourceManifestSections,
13
+ } from "../../../server/agent-chat/prompt-resources.js";
14
+ import {
15
+ getRequestOrgId,
16
+ getRequestUserEmail,
17
+ } from "../../../server/request-context.js";
18
+ import {
19
+ type ContextPreview,
20
+ type ContextTokenCountMethod,
21
+ } from "../../../shared/context-xray.js";
22
+ import { buildSystemManifestSections } from "../manifest.js";
23
+ import { contextXrayAuthError } from "./errors.js";
24
+
25
+ function combineMethods(
26
+ left: ContextTokenCountMethod,
27
+ right: ContextTokenCountMethod,
28
+ ): ContextTokenCountMethod {
29
+ return left === "estimate" || right === "estimate" ? "estimate" : "exact";
30
+ }
31
+
32
+ export async function buildContextPreview(input: {
33
+ ownerEmail: string;
34
+ orgId?: string | null;
35
+ scope: "user" | "org";
36
+ appId?: string;
37
+ compact?: boolean;
38
+ model?: string;
39
+ }): Promise<ContextPreview> {
40
+ const compact = input.compact ?? false;
41
+ const prompts = buildFrameworkPrompts();
42
+ const resources = await loadResourcesForPrompt(
43
+ input.scope === "org" ? SHARED_OWNER : input.ownerEmail,
44
+ compact,
45
+ input.appId,
46
+ input.orgId ?? null,
47
+ );
48
+ const schemaBlock = compact
49
+ ? ""
50
+ : await buildSchemaBlock(input.ownerEmail, "read");
51
+ const sections = await buildSystemManifestSections([
52
+ {
53
+ label: "Framework core",
54
+ provenance: "framework-core",
55
+ governance: "required",
56
+ content: compact
57
+ ? prompts.PROD_FRAMEWORK_PROMPT_COMPACT
58
+ : prompts.PROD_FRAMEWORK_PROMPT,
59
+ sourceRef: { scope: "framework" },
60
+ },
61
+ ...promptResourceManifestSections(resources),
62
+ ...(schemaBlock
63
+ ? [
64
+ {
65
+ label: "SQL schema",
66
+ provenance: "db-schema" as const,
67
+ governance: "required" as const,
68
+ content: schemaBlock,
69
+ sourceRef: { scope: "sql" },
70
+ },
71
+ ]
72
+ : []),
73
+ ]);
74
+ const systemTokens = sections.reduce(
75
+ (total, section) => total + section.tokenCount,
76
+ 0,
77
+ );
78
+ const tokenCountMethod = sections.reduce(
79
+ (method, section) => combineMethods(method, section.tokenMethod),
80
+ "exact" as ContextTokenCountMethod,
81
+ );
82
+ return {
83
+ computedAt: Date.now(),
84
+ ...(input.model ? { model: input.model } : {}),
85
+ scope: input.scope,
86
+ totalTokens: systemTokens,
87
+ systemTokens,
88
+ tokenCountMethod,
89
+ sections,
90
+ source: "preview",
91
+ };
92
+ }
93
+
94
+ export default defineAction({
95
+ description:
96
+ "Preview the system-prompt context that would be composed for the current user, organization, and app without a live chat thread.",
97
+ schema: z.object({
98
+ scope: z
99
+ .enum(["user", "org"])
100
+ .default("user")
101
+ .describe(
102
+ "Configuration scope to preview: user includes personal context; org includes inherited organization context.",
103
+ ),
104
+ appId: z.string().optional().describe("Current app id, when available."),
105
+ compact: z.boolean().optional().describe("Use the compact startup prompt."),
106
+ model: z.string().optional().describe("Model id for display metadata."),
107
+ }),
108
+ http: { method: "GET" },
109
+ readOnly: true,
110
+ publicAgent: { expose: true, readOnly: true, requiresAuth: true },
111
+ mcpApp: {
112
+ compactCatalog: true,
113
+ resource: embedApp({
114
+ title: "Context preview",
115
+ description:
116
+ "Preview the system-prompt context before starting a thread.",
117
+ iframeTitle: "Context preview",
118
+ openLabel: "Open context preview",
119
+ height: 720,
120
+ }),
121
+ },
122
+ run: async (args): Promise<ContextPreview> => {
123
+ const ownerEmail = getRequestUserEmail();
124
+ if (!ownerEmail) throw contextXrayAuthError();
125
+ return await buildContextPreview({
126
+ ownerEmail,
127
+ orgId: getRequestOrgId() ?? null,
128
+ scope: args.scope,
129
+ ...(args.appId ? { appId: args.appId } : {}),
130
+ ...(args.compact !== undefined ? { compact: args.compact } : {}),
131
+ ...(args.model ? { model: args.model } : {}),
132
+ });
133
+ },
134
+ });
@@ -5,11 +5,14 @@ import { getRequestUserEmail } from "../../../server/request-context.js";
5
5
  import { callerOwnsThread } from "../../run-ownership.js";
6
6
  import {
7
7
  deactivateContextDirective,
8
+ readContextManifest,
8
9
  writeContextManifestStatus,
9
10
  } from "../directives-store.js";
10
11
  import {
11
12
  contextXrayAuthError,
13
+ contextXraySystemSegmentError,
12
14
  contextXrayThreadNotFoundError,
15
+ isContextXraySystemSegment,
13
16
  } from "./errors.js";
14
17
 
15
18
  export default defineAction({
@@ -25,6 +28,14 @@ export default defineAction({
25
28
  if (!(await callerOwnsThread(ownerEmail, args.threadId))) {
26
29
  throw contextXrayThreadNotFoundError();
27
30
  }
31
+ if (
32
+ isContextXraySystemSegment(
33
+ await readContextManifest(args.threadId),
34
+ args.segmentId,
35
+ )
36
+ ) {
37
+ throw contextXraySystemSegmentError();
38
+ }
28
39
  const restored = await deactivateContextDirective({
29
40
  threadId: args.threadId,
30
41
  segmentId: args.segmentId,
@@ -1,3 +1,5 @@
1
+ import type { ContextManifest } from "../../../shared/context-xray.js";
2
+
1
3
  export class ContextXrayActionError extends Error {
2
4
  constructor(
3
5
  message: string,
@@ -18,3 +20,21 @@ export function contextXrayAuthError(): ContextXrayActionError {
18
20
  export function contextXrayThreadNotFoundError(): ContextXrayActionError {
19
21
  return new ContextXrayActionError("Thread not found.", 404);
20
22
  }
23
+
24
+ export function contextXraySystemSegmentError(): ContextXrayActionError {
25
+ return new ContextXrayActionError(
26
+ "System Context X-Ray sections are required and cannot be pinned, evicted, or restored.",
27
+ 400,
28
+ );
29
+ }
30
+
31
+ export function isContextXraySystemSegment(
32
+ manifest: ContextManifest | null,
33
+ segmentId: string,
34
+ ): boolean {
35
+ return (
36
+ manifest?.systemSections?.some(
37
+ (section) => section.segmentId === segmentId,
38
+ ) ?? false
39
+ );
40
+ }
@@ -1,3 +1,5 @@
1
+ import { createHash } from "node:crypto";
2
+
1
3
  import { appStatePut } from "../../application-state/store.js";
2
4
  import { buildDeepLink } from "../../server/deep-link.js";
3
5
  import {
@@ -5,9 +7,13 @@ import {
5
7
  type ContextDirective,
6
8
  type ContextManifest,
7
9
  type ContextManifestSegment,
10
+ type ContextManifestSourceRef,
11
+ type ContextManifestSystemSection,
8
12
  type ContextManifestSource,
9
13
  type ContextSegmentStatus,
10
14
  type ContextTokenCountMethod,
15
+ type ContextGovernanceTier,
16
+ type ContextSystemProvenance,
11
17
  } from "../../shared/context-xray.js";
12
18
  import type { EngineMessage } from "../engine/types.js";
13
19
  import { computeSegments } from "./segments.js";
@@ -19,6 +25,85 @@ import {
19
25
 
20
26
  export { CONTEXT_XRAY_MANIFEST_KEY };
21
27
 
28
+ export const CONTEXT_XRAY_REQUEST_SECTIONS_KEY =
29
+ "__agentNativeContextXraySystemSections";
30
+
31
+ export interface SystemManifestSectionInput {
32
+ label: string;
33
+ provenance: ContextSystemProvenance;
34
+ governance: ContextGovernanceTier;
35
+ content: string;
36
+ group?: string;
37
+ sourceRef?: ContextManifestSourceRef;
38
+ }
39
+
40
+ function sha256(value: string): string {
41
+ return createHash("sha256").update(value).digest("hex");
42
+ }
43
+
44
+ function previewText(value: string): string {
45
+ const normalized = value.replace(/\s+/g, " ").trim();
46
+ if (normalized.length <= 200) return normalized;
47
+ return `${normalized.slice(0, 197)}...`;
48
+ }
49
+
50
+ export async function buildSystemManifestSections(
51
+ inputs: SystemManifestSectionInput[],
52
+ ): Promise<ContextManifestSystemSection[]> {
53
+ const timestamp = Date.now();
54
+ return await Promise.all(
55
+ inputs
56
+ .filter((input) => input.content.trim().length > 0)
57
+ .map(async (input, index) => {
58
+ const content = input.content.trim();
59
+ const count = await countTextTokens(content);
60
+ const identity = [
61
+ input.provenance,
62
+ input.label,
63
+ input.sourceRef?.resourceId ?? "",
64
+ input.sourceRef?.path ?? "",
65
+ content,
66
+ index,
67
+ ].join("\u0000");
68
+ return {
69
+ kind: "system" as const,
70
+ segmentId: `system:${sha256(identity).slice(0, 16)}`,
71
+ group: input.group ?? "System",
72
+ label: input.label,
73
+ provenance: input.provenance,
74
+ governance: input.governance,
75
+ tokenCount: count.tokens,
76
+ tokenMethod: count.method,
77
+ ...(input.sourceRef ? { sourceRef: input.sourceRef } : {}),
78
+ contentHash: sha256(content),
79
+ preview: previewText(content),
80
+ timestamp,
81
+ } satisfies ContextManifestSystemSection;
82
+ }),
83
+ );
84
+ }
85
+
86
+ type ContextXRayEvent = {
87
+ context?: Record<string, unknown>;
88
+ };
89
+
90
+ export function setContextXraySystemSections(
91
+ event: ContextXRayEvent,
92
+ sections: ContextManifestSystemSection[],
93
+ ): void {
94
+ event.context = event.context ?? {};
95
+ event.context[CONTEXT_XRAY_REQUEST_SECTIONS_KEY] = sections;
96
+ }
97
+
98
+ export function readContextXraySystemSections(
99
+ event: ContextXRayEvent,
100
+ ): ContextManifestSystemSection[] {
101
+ const sections = event.context?.[CONTEXT_XRAY_REQUEST_SECTIONS_KEY];
102
+ return Array.isArray(sections)
103
+ ? (sections as ContextManifestSystemSection[])
104
+ : [];
105
+ }
106
+
22
107
  export interface BuildManifestInput {
23
108
  threadId: string;
24
109
  turnId?: string;
@@ -30,6 +115,7 @@ export interface BuildManifestInput {
30
115
  protectedSegmentIds?: Set<string>;
31
116
  source?: ContextManifestSource;
32
117
  enforceable?: boolean;
118
+ systemSections?: ContextManifestSystemSection[];
33
119
  }
34
120
 
35
121
  function combineMethods(
@@ -62,7 +148,7 @@ async function summaryTokenCount(
62
148
  return (await countTextTokens(text)).tokens;
63
149
  }
64
150
 
65
- function contextXrayUrl(threadId: string): string {
151
+ export function contextXrayDeepLink(threadId: string): string {
66
152
  const to = `/?contextXray=1&threadId=${encodeURIComponent(threadId)}`;
67
153
  return buildDeepLink({
68
154
  app: "agent-native",
@@ -119,8 +205,18 @@ export async function buildManifest(
119
205
  });
120
206
  }
121
207
 
122
- const totalTokens = sentTokenTotals.tokens;
123
- const rawTokens = rawTokenTotals.tokens;
208
+ const systemSections = input.systemSections ?? [];
209
+ const systemTokenTotals = systemSections.reduce(
210
+ (acc, section) => ({
211
+ tokens: acc.tokens + section.tokenCount,
212
+ method: combineMethods(acc.method, section.tokenMethod),
213
+ }),
214
+ { tokens: 0, method: "exact" as ContextTokenCountMethod },
215
+ );
216
+ const conversationTokens = sentTokenTotals.tokens;
217
+ const rawConversationTokens = rawTokenTotals.tokens;
218
+ const totalTokens = systemTokenTotals.tokens + conversationTokens;
219
+ const rawTokens = systemTokenTotals.tokens + rawConversationTokens;
124
220
  return {
125
221
  threadId: input.threadId,
126
222
  ...(input.turnId ? { turnId: input.turnId } : {}),
@@ -128,15 +224,18 @@ export async function buildManifest(
128
224
  ...(input.model ? { model: input.model } : {}),
129
225
  totalTokens,
130
226
  rawTokens,
131
- reclaimedTokens: Math.max(0, rawTokens - totalTokens),
227
+ reclaimedTokens: Math.max(0, rawConversationTokens - conversationTokens),
132
228
  tokenCountMethod: combineMethods(
133
- rawTokenTotals.method,
134
- sentTokenTotals.method,
229
+ combineMethods(rawTokenTotals.method, sentTokenTotals.method),
230
+ systemTokenTotals.method,
135
231
  ),
232
+ conversationTokens,
233
+ systemTokens: systemTokenTotals.tokens,
136
234
  source: input.source ?? "structured",
137
235
  enforceable: input.enforceable ?? true,
138
236
  segments,
139
- url: contextXrayUrl(input.threadId),
237
+ ...(systemSections.length > 0 ? { systemSections } : {}),
238
+ url: contextXrayDeepLink(input.threadId),
140
239
  };
141
240
  }
142
241
 
@@ -1,3 +1,4 @@
1
+ import type { ContextManifestSystemSection } from "../../shared/context-xray.js";
1
2
  import { applyContextDirectives } from "../context-xray/apply-directives.js";
2
3
  import { loadContextDirectives } from "../context-xray/directives-store.js";
3
4
  import {
@@ -29,8 +30,10 @@ export async function applyContextXrayTransformForIteration(opts: {
29
30
  turnId?: string;
30
31
  model: string;
31
32
  messages: EngineMessage[];
33
+ systemSections?: ContextManifestSystemSection[];
32
34
  }): Promise<EngineMessage[]> {
33
- const { threadId, ownerEmail, turnId, model, messages } = opts;
35
+ const { threadId, ownerEmail, turnId, model, messages, systemSections } =
36
+ opts;
34
37
  try {
35
38
  const directives = await loadContextDirectives(threadId, {
36
39
  ownerEmail: ownerEmail ?? null,
@@ -49,6 +52,7 @@ export async function applyContextXrayTransformForIteration(opts: {
49
52
  appliedStatus,
50
53
  directives,
51
54
  protectedSegmentIds,
55
+ ...(systemSections ? { systemSections } : {}),
52
56
  source: "structured",
53
57
  enforceable: true,
54
58
  });