@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
@@ -0,0 +1,5 @@
1
+ import { type ChatThreadSummary } from "../use-chat-threads.js";
2
+ import type { AgentPageTabProps } from "./types.js";
3
+ export declare function mostRecentlyUpdatedThread(threads: ChatThreadSummary[]): ChatThreadSummary | undefined;
4
+ export declare function AgentContextTab({ scope }: AgentPageTabProps): import("react").JSX.Element;
5
+ //# sourceMappingURL=AgentContextTab.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AgentContextTab.d.ts","sourceRoot":"","sources":["../../../src/client/agent-page/AgentContextTab.tsx"],"names":[],"mappings":"AAmBA,OAAO,EAAkB,KAAK,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAEhF,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AASpD,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,iBAAiB,EAAE,GAC3B,iBAAiB,GAAG,SAAS,CAM/B;AAkRD,wBAAgB,eAAe,CAAC,EAAE,KAAK,EAAE,EAAE,iBAAiB,+BA4L3D"}
@@ -0,0 +1,202 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { IconChartTreemap, IconInfoCircle, IconList, IconLock, } from "@tabler/icons-react";
3
+ import { useMemo, useState } from "react";
4
+ import { manifestConversationTokens } from "../../shared/context-xray.js";
5
+ import { ContextMeter } from "../context-xray/ContextMeter.js";
6
+ import { ContextTreemap } from "../context-xray/ContextTreemap.js";
7
+ import { formatTokens, resolveContextWindow } from "../context-xray/format.js";
8
+ import { useT } from "../i18n.js";
9
+ import { useActionQuery } from "../use-action.js";
10
+ import { useChatThreads } from "../use-chat-threads.js";
11
+ import { cn } from "../utils.js";
12
+ export function mostRecentlyUpdatedThread(threads) {
13
+ return threads.reduce((latest, thread) => !latest || thread.updatedAt > latest.updatedAt ? thread : latest, undefined);
14
+ }
15
+ const PROVENANCE_ORDER = [
16
+ "framework-core",
17
+ "actions-prompt",
18
+ "enterprise-workspace-core",
19
+ "template",
20
+ "sql-workspace",
21
+ "legacy-app-default",
22
+ "organization",
23
+ "personal",
24
+ "memory",
25
+ "db-schema",
26
+ "tools",
27
+ "model-overlay",
28
+ "runtime-context",
29
+ ];
30
+ function provenanceLabel(provenance, t) {
31
+ switch (provenance) {
32
+ case "framework-core":
33
+ return t("contextXray.provenance.frameworkCore", {
34
+ defaultValue: "Framework",
35
+ });
36
+ case "actions-prompt":
37
+ return t("contextXray.provenance.actionsPrompt", {
38
+ defaultValue: "Actions",
39
+ });
40
+ case "template":
41
+ return t("contextXray.provenance.template", {
42
+ defaultValue: "Template",
43
+ });
44
+ case "enterprise-workspace-core":
45
+ return t("contextXray.provenance.enterpriseWorkspaceCore", {
46
+ defaultValue: "Enterprise workspace core",
47
+ });
48
+ case "sql-workspace":
49
+ return t("contextXray.provenance.sqlWorkspace", {
50
+ defaultValue: "Workspace",
51
+ });
52
+ case "legacy-app-default":
53
+ return t("contextXray.provenance.legacyAppDefault", {
54
+ defaultValue: "App defaults",
55
+ });
56
+ case "organization":
57
+ return t("contextXray.provenance.organization", {
58
+ defaultValue: "Organization",
59
+ });
60
+ case "personal":
61
+ return t("contextXray.provenance.personal", {
62
+ defaultValue: "Personal",
63
+ });
64
+ case "memory":
65
+ return t("contextXray.provenance.memory", {
66
+ defaultValue: "Memory",
67
+ });
68
+ case "db-schema":
69
+ return t("contextXray.provenance.dbSchema", {
70
+ defaultValue: "SQL schema",
71
+ });
72
+ case "tools":
73
+ return t("contextXray.provenance.tools", { defaultValue: "Tools" });
74
+ case "model-overlay":
75
+ return t("contextXray.provenance.modelOverlay", {
76
+ defaultValue: "Model overlay",
77
+ });
78
+ case "runtime-context":
79
+ return t("contextXray.provenance.runtimeContext", {
80
+ defaultValue: "Runtime context",
81
+ });
82
+ }
83
+ }
84
+ function governanceLabel(governance, t) {
85
+ switch (governance) {
86
+ case "required":
87
+ return t("contextXray.governance.required", {
88
+ defaultValue: "Required",
89
+ });
90
+ case "inherited":
91
+ return t("contextXray.governance.inherited", {
92
+ defaultValue: "Inherited",
93
+ });
94
+ case "user":
95
+ return t("contextXray.governance.user", {
96
+ defaultValue: "Your context",
97
+ });
98
+ }
99
+ }
100
+ function sourceLabel(section) {
101
+ return (section.sourceRef?.path ??
102
+ section.sourceRef?.resourceId ??
103
+ section.sourceRef?.scope ??
104
+ "framework");
105
+ }
106
+ function previewAsManifest(preview) {
107
+ return {
108
+ threadId: "context-preview",
109
+ computedAt: preview.computedAt,
110
+ ...(preview.model ? { model: preview.model } : {}),
111
+ totalTokens: preview.totalTokens,
112
+ rawTokens: preview.totalTokens,
113
+ reclaimedTokens: 0,
114
+ tokenCountMethod: preview.tokenCountMethod,
115
+ conversationTokens: 0,
116
+ systemTokens: preview.systemTokens,
117
+ source: "preview",
118
+ enforceable: false,
119
+ segments: [],
120
+ systemSections: preview.sections,
121
+ };
122
+ }
123
+ function ContextSplitMeter({ manifest, budget, }) {
124
+ const t = useT();
125
+ const systemTokens = manifest.systemTokens ?? 0;
126
+ const conversationTokens = manifestConversationTokens(manifest);
127
+ const total = Math.max(1, systemTokens + conversationTokens);
128
+ return (_jsxs("div", { className: "space-y-2", children: [_jsxs("div", { className: "flex h-2 overflow-hidden rounded-full bg-muted", children: [_jsx("div", { className: "bg-slate-700 dark:bg-slate-400", style: { width: `${(systemTokens / total) * 100}%` } }), _jsx("div", { className: "bg-sky-500", style: { width: `${(conversationTokens / total) * 100}%` } })] }), _jsxs("div", { className: "flex flex-wrap gap-x-4 gap-y-1 text-xs text-muted-foreground", children: [_jsxs("span", { children: [_jsx("span", { className: "mr-1.5 inline-block size-2 rounded-full bg-slate-700 dark:bg-slate-400" }), t("contextXray.system", { defaultValue: "System" }), " ", formatTokens(systemTokens)] }), _jsxs("span", { children: [_jsx("span", { className: "mr-1.5 inline-block size-2 rounded-full bg-sky-500" }), t("contextXray.conversation", { defaultValue: "Conversation" }), " ", formatTokens(conversationTokens)] }), _jsxs("span", { children: [formatTokens(Math.max(0, budget - manifest.totalTokens)), " ", t("contextXray.free", { defaultValue: "free" })] })] })] }));
129
+ }
130
+ function SystemSectionList({ sections, totalTokens, }) {
131
+ const t = useT();
132
+ const grouped = useMemo(() => {
133
+ const map = new Map();
134
+ for (const section of sections) {
135
+ const items = map.get(section.provenance) ?? [];
136
+ items.push(section);
137
+ map.set(section.provenance, items);
138
+ }
139
+ return PROVENANCE_ORDER.flatMap((provenance) => {
140
+ const items = map.get(provenance);
141
+ return items && items.length > 0 ? [{ provenance, items }] : [];
142
+ });
143
+ }, [sections]);
144
+ return (_jsxs("div", { className: "space-y-4", children: [grouped.map((group) => {
145
+ const tokens = group.items.reduce((sum, item) => sum + item.tokenCount, 0);
146
+ return (_jsxs("section", { children: [_jsxs("div", { className: "mb-1 flex items-center justify-between gap-3", children: [_jsxs("div", { className: "flex min-w-0 items-center gap-2", children: [_jsx("span", { className: "size-2 rounded-full bg-indigo-500" }), _jsx("h3", { className: "truncate text-sm font-medium", children: provenanceLabel(group.provenance, t) }), _jsx("span", { className: "text-[11px] text-muted-foreground", children: governanceLabel(group.items[0]?.governance ?? "inherited", t) })] }), _jsxs("span", { className: "shrink-0 text-xs tabular-nums text-muted-foreground", children: [formatTokens(tokens), " \u00B7", " ", totalTokens > 0 ? Math.round((tokens / totalTokens) * 100) : 0, "%"] })] }), _jsx("div", { className: "divide-y divide-border/60 rounded-md border border-border/60", children: group.items
147
+ .slice()
148
+ .sort((a, b) => b.tokenCount - a.tokenCount)
149
+ .map((section) => (_jsxs("div", { className: "flex gap-3 px-3 py-2.5", children: [_jsx(IconLock, { className: "mt-0.5 size-4 shrink-0 text-muted-foreground" }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsxs("div", { className: "flex items-baseline justify-between gap-3", children: [_jsx("div", { className: "truncate text-sm font-medium", children: section.label }), _jsxs("div", { className: "shrink-0 text-xs tabular-nums text-muted-foreground", children: [formatTokens(section.tokenCount), " \u00B7", " ", totalTokens > 0
150
+ ? Math.round((section.tokenCount / totalTokens) * 100)
151
+ : 0, "%"] })] }), _jsxs("div", { className: "truncate text-xs text-muted-foreground", children: [sourceLabel(section), section.tokenMethod === "estimate"
152
+ ? " · estimated"
153
+ : ""] }), section.preview ? (_jsx("div", { className: "mt-1 line-clamp-2 text-xs text-muted-foreground/80", children: section.preview })) : null] })] }, section.segmentId))) })] }, group.provenance));
154
+ }), grouped.length === 0 ? (_jsx("div", { className: "rounded-md border border-dashed border-border p-6 text-center text-sm text-muted-foreground", children: t("contextXray.noSystemContext", {
155
+ defaultValue: "No system context is available for this scope yet.",
156
+ }) })) : null] }));
157
+ }
158
+ export function AgentContextTab({ scope }) {
159
+ const t = useT();
160
+ const [view, setView] = useState("list");
161
+ const previewQuery = useActionQuery("context-preview-get", { scope }, { staleTime: 5_000 });
162
+ const threads = useChatThreads(undefined, "agent-context-page", null, {
163
+ autoCreate: false,
164
+ restoreActiveThread: false,
165
+ });
166
+ const latestThread = mostRecentlyUpdatedThread(threads.threads);
167
+ const liveManifestQuery = useActionQuery("context-manifest-get", latestThread ? { threadId: latestThread.id } : undefined, { enabled: Boolean(latestThread), staleTime: 1_000 });
168
+ const preview = previewQuery.data;
169
+ const previewManifest = preview ? previewAsManifest(preview) : null;
170
+ const budget = resolveContextWindow(preview?.model);
171
+ const title = t("contextXray.pageTitle", { defaultValue: "Context" });
172
+ return (_jsxs("div", { className: "mx-auto flex w-full max-w-5xl flex-col gap-8 p-6 lg:p-10", children: [_jsxs("header", { className: "space-y-3", children: [_jsxs("div", { className: "flex flex-wrap items-start justify-between gap-4", children: [_jsxs("div", { children: [_jsx("p", { className: "text-xs font-medium uppercase tracking-[0.16em] text-muted-foreground", children: t("contextXray.agent", { defaultValue: "Agent" }) }), _jsx("h1", { className: "text-2xl font-semibold tracking-tight", children: title }), _jsx("p", { className: "mt-1 max-w-2xl text-sm text-muted-foreground", children: t("contextXray.headerDescription", {
173
+ defaultValue: "See the system instructions and conversation tokens that shape the agent.",
174
+ }) })] }), previewManifest ? (_jsx(ContextMeter, { manifest: previewManifest, enabled: true })) : null] }), previewManifest ? (_jsx(ContextSplitMeter, { manifest: previewManifest, budget: budget })) : null] }), _jsxs("section", { className: "space-y-4", children: [_jsxs("div", { className: "flex flex-wrap items-end justify-between gap-3", children: [_jsxs("div", { children: [_jsx("h2", { className: "text-lg font-semibold", children: t("contextXray.whatAgentKnows", {
175
+ defaultValue: "What the agent knows",
176
+ }) }), _jsx("p", { className: "text-sm text-muted-foreground", children: t("contextXray.orderedSystemDescription", {
177
+ defaultValue: "Ordered system context is grouped by where it comes from. System sections are visible here but cannot be evicted from a thread.",
178
+ }) })] }), _jsxs("div", { className: "inline-flex rounded-md bg-muted/50 p-0.5", children: [_jsxs("button", { type: "button", onClick: () => setView("list"), className: cn("flex cursor-pointer items-center gap-1.5 rounded px-2.5 py-1.5 text-xs", view === "list"
179
+ ? "bg-background text-foreground shadow-sm"
180
+ : "text-muted-foreground"), children: [_jsx(IconList, { className: "size-3.5" }), t("contextXray.list", { defaultValue: "List" })] }), _jsxs("button", { type: "button", onClick: () => setView("map"), className: cn("flex cursor-pointer items-center gap-1.5 rounded px-2.5 py-1.5 text-xs", view === "map"
181
+ ? "bg-background text-foreground shadow-sm"
182
+ : "text-muted-foreground"), children: [_jsx(IconChartTreemap, { className: "size-3.5" }), t("contextXray.treemap", { defaultValue: "Treemap" })] })] })] }), previewQuery.isLoading ? (_jsx("div", { className: "rounded-md border border-border/60 p-8 text-center text-sm text-muted-foreground", children: t("contextXray.loadingPreview", {
183
+ defaultValue: "Loading context preview…",
184
+ }) })) : previewQuery.error ? (_jsx("div", { className: "rounded-md border border-dashed border-border p-8 text-center text-sm text-muted-foreground", children: t("contextXray.previewUnavailable", {
185
+ defaultValue: "Context preview is not available yet.",
186
+ }) })) : previewManifest ? (view === "map" ? (_jsx(ContextTreemap, { segments: [], systemSections: previewManifest.systemSections })) : (_jsx(SystemSectionList, { sections: previewManifest.systemSections ?? [], totalTokens: previewManifest.totalTokens }))) : (_jsx("div", { className: "rounded-md border border-dashed border-border p-8 text-center text-sm text-muted-foreground", children: t("contextXray.noPreview", {
187
+ defaultValue: "No context preview is available for this scope yet.",
188
+ }) }))] }), _jsxs("section", { className: "space-y-3", children: [_jsxs("div", { children: [_jsx("h2", { className: "text-lg font-semibold", children: t("contextXray.liveThread", { defaultValue: "Live thread" }) }), _jsx("p", { className: "text-sm text-muted-foreground", children: t("contextXray.liveThreadDescription", {
189
+ defaultValue: "The latest thread snapshot, when one exists. This is a single current snapshot, not an append-only history.",
190
+ }) })] }), latestThread && liveManifestQuery.data ? (_jsxs("div", { className: "space-y-3 rounded-md border border-border/60 p-4", children: [_jsxs("div", { className: "flex flex-wrap items-center justify-between gap-2", children: [_jsxs("div", { className: "min-w-0", children: [_jsx("div", { className: "truncate text-sm font-medium", children: latestThread.title ||
191
+ latestThread.preview ||
192
+ t("contextXray.latestThread", {
193
+ defaultValue: "Latest thread",
194
+ }) }), _jsxs("div", { className: "text-xs text-muted-foreground", children: [formatTokens(liveManifestQuery.data.totalTokens), " tokens \u00B7", " ", latestThread.id] })] }), _jsx(ContextMeter, { threadId: latestThread.id })] }), _jsx(ContextTreemap, { segments: liveManifestQuery.data.segments, systemSections: liveManifestQuery.data.systemSections })] })) : (_jsx("div", { className: "rounded-md border border-dashed border-border p-8 text-center text-sm text-muted-foreground", children: t("contextXray.noLiveThread", {
195
+ defaultValue: "No live thread snapshot is available yet.",
196
+ }) }))] }), _jsxs("section", { className: "flex gap-3 rounded-md border border-border/60 bg-muted/20 p-4", children: [_jsx(IconInfoCircle, { className: "mt-0.5 size-4 shrink-0 text-muted-foreground" }), _jsxs("div", { className: "space-y-1 text-sm text-muted-foreground", children: [_jsx("p", { className: "font-medium text-foreground", children: t("contextXray.orderedTokensTitle", {
197
+ defaultValue: "Context is ordered tokens, not weighted tokens.",
198
+ }) }), _jsx("p", { children: t("contextXray.orderedTokensDescription", {
199
+ defaultValue: "Required framework and enterprise policy come first, followed by inherited template, workspace, and organization instructions. Personal instructions and memory arrive later and can narrow or override earlier guidance where the prompt permits. These system sections are not evictable; only run-local conversation segments support pin, evict, and restore.",
200
+ }) })] })] })] }));
201
+ }
202
+ //# sourceMappingURL=AgentContextTab.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AgentContextTab.js","sourceRoot":"","sources":["../../../src/client/agent-page/AgentContextTab.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,gBAAgB,EAChB,cAAc,EACd,QAAQ,EACR,QAAQ,GAC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,aAChF,KAAC,cAAc,IAAC,SAAS,EAAC,8CAA8C,GAAG,EAC3E,eAAK,SAAS,EAAC,yCAAyC,aACtD,YAAG,SAAS,EAAC,6BAA6B,YACvC,CAAC,CAAC,gCAAgC,EAAE;oCACnC,YAAY,EAAE,iDAAiD;iCAChE,CAAC,GACA,EACJ,sBACG,CAAC,CAAC,sCAAsC,EAAE;oCACzC,YAAY,EACV,mWAAmW;iCACtW,CAAC,GACA,IACA,IACE,IACN,CACP,CAAC;AACJ,CAAC","sourcesContent":["import {\n IconChartTreemap,\n IconInfoCircle,\n IconList,\n IconLock,\n} from \"@tabler/icons-react\";\nimport { useMemo, useState } from \"react\";\n\nimport type {\n ContextManifest,\n ContextManifestSystemSection,\n ContextPreview,\n} from \"../../shared/context-xray.js\";\nimport { manifestConversationTokens } from \"../../shared/context-xray.js\";\nimport { ContextMeter } from \"../context-xray/ContextMeter.js\";\nimport { ContextTreemap } from \"../context-xray/ContextTreemap.js\";\nimport { formatTokens, resolveContextWindow } from \"../context-xray/format.js\";\nimport { useT } from \"../i18n.js\";\nimport { useActionQuery } from \"../use-action.js\";\nimport { useChatThreads, type ChatThreadSummary } from \"../use-chat-threads.js\";\nimport { cn } from \"../utils.js\";\nimport type { AgentPageTabProps } from \"./types.js\";\n\ntype PreviewQuery = {\n data?: ContextPreview;\n isLoading?: boolean;\n error?: unknown;\n};\ntype ManifestQuery = { data?: ContextManifest; isLoading?: boolean };\n\nexport function mostRecentlyUpdatedThread(\n threads: ChatThreadSummary[],\n): ChatThreadSummary | undefined {\n return threads.reduce<ChatThreadSummary | undefined>(\n (latest, thread) =>\n !latest || thread.updatedAt > latest.updatedAt ? thread : latest,\n undefined,\n );\n}\n\nconst PROVENANCE_ORDER = [\n \"framework-core\",\n \"actions-prompt\",\n \"enterprise-workspace-core\",\n \"template\",\n \"sql-workspace\",\n \"legacy-app-default\",\n \"organization\",\n \"personal\",\n \"memory\",\n \"db-schema\",\n \"tools\",\n \"model-overlay\",\n \"runtime-context\",\n] as const;\n\ntype Translate = (key: string, options?: Record<string, unknown>) => string;\n\nfunction provenanceLabel(\n provenance: ContextManifestSystemSection[\"provenance\"],\n t: Translate,\n): string {\n switch (provenance) {\n case \"framework-core\":\n return t(\"contextXray.provenance.frameworkCore\", {\n defaultValue: \"Framework\",\n });\n case \"actions-prompt\":\n return t(\"contextXray.provenance.actionsPrompt\", {\n defaultValue: \"Actions\",\n });\n case \"template\":\n return t(\"contextXray.provenance.template\", {\n defaultValue: \"Template\",\n });\n case \"enterprise-workspace-core\":\n return t(\"contextXray.provenance.enterpriseWorkspaceCore\", {\n defaultValue: \"Enterprise workspace core\",\n });\n case \"sql-workspace\":\n return t(\"contextXray.provenance.sqlWorkspace\", {\n defaultValue: \"Workspace\",\n });\n case \"legacy-app-default\":\n return t(\"contextXray.provenance.legacyAppDefault\", {\n defaultValue: \"App defaults\",\n });\n case \"organization\":\n return t(\"contextXray.provenance.organization\", {\n defaultValue: \"Organization\",\n });\n case \"personal\":\n return t(\"contextXray.provenance.personal\", {\n defaultValue: \"Personal\",\n });\n case \"memory\":\n return t(\"contextXray.provenance.memory\", {\n defaultValue: \"Memory\",\n });\n case \"db-schema\":\n return t(\"contextXray.provenance.dbSchema\", {\n defaultValue: \"SQL schema\",\n });\n case \"tools\":\n return t(\"contextXray.provenance.tools\", { defaultValue: \"Tools\" });\n case \"model-overlay\":\n return t(\"contextXray.provenance.modelOverlay\", {\n defaultValue: \"Model overlay\",\n });\n case \"runtime-context\":\n return t(\"contextXray.provenance.runtimeContext\", {\n defaultValue: \"Runtime context\",\n });\n }\n}\n\nfunction governanceLabel(\n governance: ContextManifestSystemSection[\"governance\"],\n t: Translate,\n): string {\n switch (governance) {\n case \"required\":\n return t(\"contextXray.governance.required\", {\n defaultValue: \"Required\",\n });\n case \"inherited\":\n return t(\"contextXray.governance.inherited\", {\n defaultValue: \"Inherited\",\n });\n case \"user\":\n return t(\"contextXray.governance.user\", {\n defaultValue: \"Your context\",\n });\n }\n}\n\nfunction sourceLabel(section: ContextManifestSystemSection): string {\n return (\n section.sourceRef?.path ??\n section.sourceRef?.resourceId ??\n section.sourceRef?.scope ??\n \"framework\"\n );\n}\n\nfunction previewAsManifest(preview: ContextPreview): ContextManifest {\n return {\n threadId: \"context-preview\",\n computedAt: preview.computedAt,\n ...(preview.model ? { model: preview.model } : {}),\n totalTokens: preview.totalTokens,\n rawTokens: preview.totalTokens,\n reclaimedTokens: 0,\n tokenCountMethod: preview.tokenCountMethod,\n conversationTokens: 0,\n systemTokens: preview.systemTokens,\n source: \"preview\",\n enforceable: false,\n segments: [],\n systemSections: preview.sections,\n };\n}\n\nfunction ContextSplitMeter({\n manifest,\n budget,\n}: {\n manifest: ContextManifest;\n budget: number;\n}) {\n const t = useT();\n const systemTokens = manifest.systemTokens ?? 0;\n const conversationTokens = manifestConversationTokens(manifest);\n const total = Math.max(1, systemTokens + conversationTokens);\n return (\n <div className=\"space-y-2\">\n <div className=\"flex h-2 overflow-hidden rounded-full bg-muted\">\n <div\n className=\"bg-slate-700 dark:bg-slate-400\"\n style={{ width: `${(systemTokens / total) * 100}%` }}\n />\n <div\n className=\"bg-sky-500\"\n style={{ width: `${(conversationTokens / total) * 100}%` }}\n />\n </div>\n <div className=\"flex flex-wrap gap-x-4 gap-y-1 text-xs text-muted-foreground\">\n <span>\n <span className=\"mr-1.5 inline-block size-2 rounded-full bg-slate-700 dark:bg-slate-400\" />\n {t(\"contextXray.system\", { defaultValue: \"System\" })}{\" \"}\n {formatTokens(systemTokens)}\n </span>\n <span>\n <span className=\"mr-1.5 inline-block size-2 rounded-full bg-sky-500\" />\n {t(\"contextXray.conversation\", { defaultValue: \"Conversation\" })}{\" \"}\n {formatTokens(conversationTokens)}\n </span>\n <span>\n {formatTokens(Math.max(0, budget - manifest.totalTokens))}{\" \"}\n {t(\"contextXray.free\", { defaultValue: \"free\" })}\n </span>\n </div>\n </div>\n );\n}\n\nfunction SystemSectionList({\n sections,\n totalTokens,\n}: {\n sections: ContextManifestSystemSection[];\n totalTokens: number;\n}) {\n const t = useT();\n const grouped = useMemo(() => {\n const map = new Map<\n ContextManifestSystemSection[\"provenance\"],\n ContextManifestSystemSection[]\n >();\n for (const section of sections) {\n const items = map.get(section.provenance) ?? [];\n items.push(section);\n map.set(section.provenance, items);\n }\n return PROVENANCE_ORDER.flatMap((provenance) => {\n const items = map.get(provenance);\n return items && items.length > 0 ? [{ provenance, items }] : [];\n });\n }, [sections]);\n\n return (\n <div className=\"space-y-4\">\n {grouped.map((group) => {\n const tokens = group.items.reduce(\n (sum, item) => sum + item.tokenCount,\n 0,\n );\n return (\n <section key={group.provenance}>\n <div className=\"mb-1 flex items-center justify-between gap-3\">\n <div className=\"flex min-w-0 items-center gap-2\">\n <span className=\"size-2 rounded-full bg-indigo-500\" />\n <h3 className=\"truncate text-sm font-medium\">\n {provenanceLabel(group.provenance, t)}\n </h3>\n <span className=\"text-[11px] text-muted-foreground\">\n {governanceLabel(\n group.items[0]?.governance ?? \"inherited\",\n t,\n )}\n </span>\n </div>\n <span className=\"shrink-0 text-xs tabular-nums text-muted-foreground\">\n {formatTokens(tokens)} ·{\" \"}\n {totalTokens > 0 ? Math.round((tokens / totalTokens) * 100) : 0}\n %\n </span>\n </div>\n <div className=\"divide-y divide-border/60 rounded-md border border-border/60\">\n {group.items\n .slice()\n .sort((a, b) => b.tokenCount - a.tokenCount)\n .map((section) => (\n <div\n key={section.segmentId}\n className=\"flex gap-3 px-3 py-2.5\"\n >\n <IconLock className=\"mt-0.5 size-4 shrink-0 text-muted-foreground\" />\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex items-baseline justify-between gap-3\">\n <div className=\"truncate text-sm font-medium\">\n {section.label}\n </div>\n <div className=\"shrink-0 text-xs tabular-nums text-muted-foreground\">\n {formatTokens(section.tokenCount)} ·{\" \"}\n {totalTokens > 0\n ? Math.round(\n (section.tokenCount / totalTokens) * 100,\n )\n : 0}\n %\n </div>\n </div>\n <div className=\"truncate text-xs text-muted-foreground\">\n {sourceLabel(section)}\n {section.tokenMethod === \"estimate\"\n ? \" · estimated\"\n : \"\"}\n </div>\n {section.preview ? (\n <div className=\"mt-1 line-clamp-2 text-xs text-muted-foreground/80\">\n {section.preview}\n </div>\n ) : null}\n </div>\n </div>\n ))}\n </div>\n </section>\n );\n })}\n {grouped.length === 0 ? (\n <div className=\"rounded-md border border-dashed border-border p-6 text-center text-sm text-muted-foreground\">\n {t(\"contextXray.noSystemContext\", {\n defaultValue: \"No system context is available for this scope yet.\",\n })}\n </div>\n ) : null}\n </div>\n );\n}\n\nexport function AgentContextTab({ scope }: AgentPageTabProps) {\n const t = useT();\n const [view, setView] = useState<\"list\" | \"map\">(\"list\");\n const previewQuery = useActionQuery(\n \"context-preview-get\",\n { scope },\n { staleTime: 5_000 },\n ) as PreviewQuery;\n const threads = useChatThreads(undefined, \"agent-context-page\", null, {\n autoCreate: false,\n restoreActiveThread: false,\n });\n const latestThread = mostRecentlyUpdatedThread(threads.threads);\n const liveManifestQuery = useActionQuery(\n \"context-manifest-get\",\n latestThread ? { threadId: latestThread.id } : undefined,\n { enabled: Boolean(latestThread), staleTime: 1_000 },\n ) as ManifestQuery;\n const preview = previewQuery.data;\n const previewManifest = preview ? previewAsManifest(preview) : null;\n const budget = resolveContextWindow(preview?.model);\n const title = t(\"contextXray.pageTitle\", { defaultValue: \"Context\" });\n\n return (\n <div className=\"mx-auto flex w-full max-w-5xl flex-col gap-8 p-6 lg:p-10\">\n <header className=\"space-y-3\">\n <div className=\"flex flex-wrap items-start justify-between gap-4\">\n <div>\n <p className=\"text-xs font-medium uppercase tracking-[0.16em] text-muted-foreground\">\n {t(\"contextXray.agent\", { defaultValue: \"Agent\" })}\n </p>\n <h1 className=\"text-2xl font-semibold tracking-tight\">{title}</h1>\n <p className=\"mt-1 max-w-2xl text-sm text-muted-foreground\">\n {t(\"contextXray.headerDescription\", {\n defaultValue:\n \"See the system instructions and conversation tokens that shape the agent.\",\n })}\n </p>\n </div>\n {previewManifest ? (\n <ContextMeter manifest={previewManifest} enabled />\n ) : null}\n </div>\n {previewManifest ? (\n <ContextSplitMeter manifest={previewManifest} budget={budget} />\n ) : null}\n </header>\n\n <section className=\"space-y-4\">\n <div className=\"flex flex-wrap items-end justify-between gap-3\">\n <div>\n <h2 className=\"text-lg font-semibold\">\n {t(\"contextXray.whatAgentKnows\", {\n defaultValue: \"What the agent knows\",\n })}\n </h2>\n <p className=\"text-sm text-muted-foreground\">\n {t(\"contextXray.orderedSystemDescription\", {\n defaultValue:\n \"Ordered system context is grouped by where it comes from. System sections are visible here but cannot be evicted from a thread.\",\n })}\n </p>\n </div>\n <div className=\"inline-flex rounded-md bg-muted/50 p-0.5\">\n <button\n type=\"button\"\n onClick={() => setView(\"list\")}\n className={cn(\n \"flex cursor-pointer items-center gap-1.5 rounded px-2.5 py-1.5 text-xs\",\n view === \"list\"\n ? \"bg-background text-foreground shadow-sm\"\n : \"text-muted-foreground\",\n )}\n >\n <IconList className=\"size-3.5\" />\n {t(\"contextXray.list\", { defaultValue: \"List\" })}\n </button>\n <button\n type=\"button\"\n onClick={() => setView(\"map\")}\n className={cn(\n \"flex cursor-pointer items-center gap-1.5 rounded px-2.5 py-1.5 text-xs\",\n view === \"map\"\n ? \"bg-background text-foreground shadow-sm\"\n : \"text-muted-foreground\",\n )}\n >\n <IconChartTreemap className=\"size-3.5\" />\n {t(\"contextXray.treemap\", { defaultValue: \"Treemap\" })}\n </button>\n </div>\n </div>\n {previewQuery.isLoading ? (\n <div className=\"rounded-md border border-border/60 p-8 text-center text-sm text-muted-foreground\">\n {t(\"contextXray.loadingPreview\", {\n defaultValue: \"Loading context preview…\",\n })}\n </div>\n ) : previewQuery.error ? (\n <div className=\"rounded-md border border-dashed border-border p-8 text-center text-sm text-muted-foreground\">\n {t(\"contextXray.previewUnavailable\", {\n defaultValue: \"Context preview is not available yet.\",\n })}\n </div>\n ) : previewManifest ? (\n view === \"map\" ? (\n <ContextTreemap\n segments={[]}\n systemSections={previewManifest.systemSections}\n />\n ) : (\n <SystemSectionList\n sections={previewManifest.systemSections ?? []}\n totalTokens={previewManifest.totalTokens}\n />\n )\n ) : (\n <div className=\"rounded-md border border-dashed border-border p-8 text-center text-sm text-muted-foreground\">\n {t(\"contextXray.noPreview\", {\n defaultValue:\n \"No context preview is available for this scope yet.\",\n })}\n </div>\n )}\n </section>\n\n <section className=\"space-y-3\">\n <div>\n <h2 className=\"text-lg font-semibold\">\n {t(\"contextXray.liveThread\", { defaultValue: \"Live thread\" })}\n </h2>\n <p className=\"text-sm text-muted-foreground\">\n {t(\"contextXray.liveThreadDescription\", {\n defaultValue:\n \"The latest thread snapshot, when one exists. This is a single current snapshot, not an append-only history.\",\n })}\n </p>\n </div>\n {latestThread && liveManifestQuery.data ? (\n <div className=\"space-y-3 rounded-md border border-border/60 p-4\">\n <div className=\"flex flex-wrap items-center justify-between gap-2\">\n <div className=\"min-w-0\">\n <div className=\"truncate text-sm font-medium\">\n {latestThread.title ||\n latestThread.preview ||\n t(\"contextXray.latestThread\", {\n defaultValue: \"Latest thread\",\n })}\n </div>\n <div className=\"text-xs text-muted-foreground\">\n {formatTokens(liveManifestQuery.data.totalTokens)} tokens ·{\" \"}\n {latestThread.id}\n </div>\n </div>\n <ContextMeter threadId={latestThread.id} />\n </div>\n <ContextTreemap\n segments={liveManifestQuery.data.segments}\n systemSections={liveManifestQuery.data.systemSections}\n />\n </div>\n ) : (\n <div className=\"rounded-md border border-dashed border-border p-8 text-center text-sm text-muted-foreground\">\n {t(\"contextXray.noLiveThread\", {\n defaultValue: \"No live thread snapshot is available yet.\",\n })}\n </div>\n )}\n </section>\n\n <section className=\"flex gap-3 rounded-md border border-border/60 bg-muted/20 p-4\">\n <IconInfoCircle className=\"mt-0.5 size-4 shrink-0 text-muted-foreground\" />\n <div className=\"space-y-1 text-sm text-muted-foreground\">\n <p className=\"font-medium text-foreground\">\n {t(\"contextXray.orderedTokensTitle\", {\n defaultValue: \"Context is ordered tokens, not weighted tokens.\",\n })}\n </p>\n <p>\n {t(\"contextXray.orderedTokensDescription\", {\n defaultValue:\n \"Required framework and enterprise policy come first, followed by inherited template, workspace, and organization instructions. Personal instructions and memory arrive later and can narrow or override earlier guidance where the prompt permits. These system sections are not evictable; only run-local conversation segments support pin, evict, and restore.\",\n })}\n </p>\n </div>\n </section>\n </div>\n );\n}\n"]}
@@ -0,0 +1,3 @@
1
+ import type { AgentPageTabProps } from "./types.js";
2
+ export declare function AgentJobsTab({ scope, canManageOrg, }: AgentPageTabProps): import("react").JSX.Element;
3
+ //# sourceMappingURL=AgentJobsTab.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AgentJobsTab.d.ts","sourceRoot":"","sources":["../../../src/client/agent-page/AgentJobsTab.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AAOpD,wBAAgB,YAAY,CAAC,EAC3B,KAAK,EACL,YAAoB,GACrB,EAAE,iBAAiB,+BAkVnB"}
@@ -0,0 +1,98 @@
1
+ import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Button } from "@agent-native/toolkit/ui/button";
3
+ import { IconClock, IconEye, IconLoader2, IconPlayerPause, IconPlayerPlay, IconTrash, } from "@tabler/icons-react";
4
+ import { useState } from "react";
5
+ import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, } from "../components/ui/dialog.js";
6
+ import { useFormatters, useT } from "../i18n.js";
7
+ import { AutomationsList } from "../settings/AutomationsSection.js";
8
+ import { useManageRecurringJob, useRecurringJobs, } from "./use-jobs.js";
9
+ export function AgentJobsTab({ scope, canManageOrg = false, }) {
10
+ const t = useT();
11
+ const { formatDate } = useFormatters();
12
+ const query = useRecurringJobs(scope);
13
+ const mutation = useManageRecurringJob(scope);
14
+ const [deleteTarget, setDeleteTarget] = useState(null);
15
+ const [detailsTarget, setDetailsTarget] = useState(null);
16
+ const formatDateTime = (value) => {
17
+ if (!value || Number.isNaN(new Date(value).getTime()))
18
+ return null;
19
+ return formatDate(value, {
20
+ month: "short",
21
+ day: "numeric",
22
+ hour: "numeric",
23
+ minute: "2-digit",
24
+ });
25
+ };
26
+ const jobs = query.data ?? [];
27
+ return (_jsxs("div", { className: "mx-auto flex w-full max-w-5xl flex-col gap-8 p-6 lg:p-10", children: [_jsxs("header", { className: "space-y-3", children: [_jsx("p", { className: "text-xs font-medium uppercase tracking-[0.16em] text-muted-foreground", children: t("jobs.agent", { defaultValue: "Agent" }) }), _jsxs("div", { children: [_jsx("h1", { className: "text-2xl font-semibold tracking-tight", children: t("jobs.pageTitle", { defaultValue: "Jobs" }) }), _jsx("p", { className: "mt-1 max-w-2xl text-sm leading-relaxed text-muted-foreground", children: t("jobs.pageDescription", {
28
+ defaultValue: "See recurring jobs and automations that run work for you.",
29
+ }) })] })] }), _jsxs("section", { className: "space-y-4", children: [_jsxs("div", { className: "flex flex-wrap items-end justify-between gap-3", children: [_jsxs("div", { children: [_jsx("h2", { className: "text-lg font-semibold", children: t("jobs.recurringTitle", { defaultValue: "Recurring jobs" }) }), _jsx("p", { className: "mt-1 text-sm text-muted-foreground", children: scope === "org"
30
+ ? t("jobs.organizationRecurringDescription", {
31
+ defaultValue: "Cron jobs shared with this organization. Members can view them; creators and admins can manage them.",
32
+ })
33
+ : t("jobs.recurringDescription", {
34
+ defaultValue: "Scheduled prompts that ask the agent to do work automatically.",
35
+ }) })] }), scope === "org" && !canManageOrg ? (_jsx("span", { className: "text-xs text-muted-foreground", children: t("jobs.organizationMemberNote", {
36
+ defaultValue: "You can manage jobs you created.",
37
+ }) })) : null] }), query.isLoading ? (_jsxs("div", { className: "flex items-center gap-2 text-sm text-muted-foreground", "aria-busy": "true", children: [_jsx(IconLoader2, { className: "size-4 animate-spin" }), t("jobs.loading", { defaultValue: "Loading…" })] })) : query.error ? (_jsx("p", { className: "text-sm text-destructive", children: t("jobs.recurringLoadError", {
38
+ defaultValue: "Could not load recurring jobs.",
39
+ }) })) : jobs.length === 0 ? (_jsxs("div", { className: "rounded-lg border border-dashed border-border p-6 text-center", children: [_jsx(IconClock, { className: "mx-auto size-5 text-muted-foreground" }), _jsx("p", { className: "mt-2 text-sm text-muted-foreground", children: scope === "org"
40
+ ? t("jobs.organizationEmpty", {
41
+ defaultValue: "No organization jobs yet.",
42
+ })
43
+ : t("jobs.recurringEmpty", {
44
+ defaultValue: "No recurring jobs yet. Ask the agent: “every morning, summarize my inbox”.",
45
+ }) })] })) : (_jsx("div", { className: "space-y-3", children: jobs.map((job) => {
46
+ const lastRun = formatDateTime(job.lastRun);
47
+ const nextRun = formatDateTime(job.nextRun);
48
+ return (_jsx("article", { className: "rounded-lg border border-border bg-card p-4", children: _jsxs("div", { className: "flex items-start gap-3", children: [_jsx("div", { className: "mt-0.5 text-muted-foreground", children: _jsx(IconClock, { className: "size-4" }) }), _jsxs("div", { className: "min-w-0 flex-1", children: [_jsxs("div", { className: "flex flex-wrap items-center gap-2", children: [_jsx("h3", { className: "truncate text-sm font-medium", children: job.name.replace(/-/g, " ") }), _jsx("span", { className: job.enabled
49
+ ? "rounded-full bg-emerald-500/15 px-2 py-0.5 text-[10px] font-medium text-emerald-600 dark:text-emerald-400"
50
+ : "rounded-full bg-muted px-2 py-0.5 text-[10px] font-medium text-muted-foreground", children: job.enabled
51
+ ? t("jobs.enabled", { defaultValue: "Enabled" })
52
+ : t("jobs.paused", { defaultValue: "Paused" }) }), job.lastStatus ? (_jsx("span", { className: "rounded-full bg-muted px-2 py-0.5 text-[10px] font-medium text-muted-foreground", children: job.lastStatus })) : null] }), _jsx("p", { className: "mt-1 text-sm text-muted-foreground", children: job.scheduleDescription || job.schedule }), _jsx("p", { className: "mt-1 line-clamp-2 text-xs text-muted-foreground/80", children: job.instructions }), lastRun || nextRun ? (_jsxs("div", { className: "mt-2 flex flex-wrap gap-x-4 gap-y-1 text-[11px] text-muted-foreground", children: [nextRun ? (_jsxs("span", { children: [t("jobs.nextRun", { defaultValue: "Next run" }), ":", " ", nextRun] })) : null, lastRun ? (_jsxs("span", { children: [t("jobs.lastRun", { defaultValue: "Last run" }), ":", " ", lastRun] })) : null] })) : null] }), _jsxs("div", { className: "flex shrink-0 items-center gap-1", children: [_jsxs(Button, { type: "button", variant: "ghost", size: "sm", className: "cursor-pointer px-2 text-xs", onClick: () => setDetailsTarget(job), children: [_jsx(IconEye, { className: "size-3.5" }), t("jobs.details", { defaultValue: "Details" })] }), job.canUpdate ? (_jsxs(_Fragment, { children: [_jsxs(Button, { type: "button", variant: "ghost", size: "sm", className: "cursor-pointer px-2 text-xs", disabled: mutation.isPending, onClick: () => mutation.mutate({
53
+ operation: "update",
54
+ name: job.name,
55
+ scope: job.scope,
56
+ enabled: !job.enabled,
57
+ }), children: [job.enabled ? (_jsx(IconPlayerPause, { className: "size-3.5" })) : (_jsx(IconPlayerPlay, { className: "size-3.5" })), job.enabled
58
+ ? t("jobs.pause", { defaultValue: "Pause" })
59
+ : t("jobs.resume", { defaultValue: "Resume" })] }), _jsx(Button, { type: "button", variant: "ghost", size: "icon", className: "size-8 cursor-pointer text-muted-foreground hover:text-destructive", "aria-label": t("jobs.delete", {
60
+ defaultValue: "Delete",
61
+ }), onClick: () => setDeleteTarget(job), children: _jsx(IconTrash, { className: "size-3.5" }) })] })) : null] })] }) }, job.id));
62
+ }) })), mutation.error ? (_jsx("p", { className: "text-sm text-destructive", children: mutation.error.message ||
63
+ t("jobs.recurringUpdateError", {
64
+ defaultValue: "Could not update recurring job.",
65
+ }) })) : null] }), _jsxs("section", { className: "space-y-4", children: [_jsxs("div", { children: [_jsx("h2", { className: "text-lg font-semibold", children: t("jobs.automationsTitle", { defaultValue: "Automations" }) }), _jsx("p", { className: "mt-1 text-sm text-muted-foreground", children: scope === "org"
66
+ ? t("jobs.organizationAutomationsDescription", {
67
+ defaultValue: "Automations are personal today, so none are shown in the organization view.",
68
+ })
69
+ : t("jobs.automationsDescription", {
70
+ defaultValue: "Event-triggered and scheduled agent tasks managed from one place.",
71
+ }) })] }), _jsx(AutomationsList, { scope: scope, emptyMessage: scope === "org"
72
+ ? t("jobs.automationsPersonalOnly", {
73
+ defaultValue: "Automations are personal today.",
74
+ })
75
+ : undefined })] }), _jsx(Dialog, { open: deleteTarget !== null, onOpenChange: (open) => {
76
+ if (!open && !mutation.isPending)
77
+ setDeleteTarget(null);
78
+ }, children: _jsxs(DialogContent, { children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { children: t("jobs.deleteRecurringTitle", {
79
+ defaultValue: "Delete recurring job?",
80
+ }) }), _jsx(DialogDescription, { children: t("jobs.deleteRecurringDescription", {
81
+ defaultValue: "This permanently removes the job and cannot be undone.",
82
+ }) })] }), _jsxs(DialogFooter, { children: [_jsx(Button, { type: "button", variant: "outline", className: "cursor-pointer", disabled: mutation.isPending, onClick: () => setDeleteTarget(null), children: t("jobs.cancel", { defaultValue: "Cancel" }) }), _jsxs(Button, { type: "button", variant: "destructive", className: "cursor-pointer", disabled: mutation.isPending, onClick: () => {
83
+ if (!deleteTarget)
84
+ return;
85
+ mutation.mutate({
86
+ operation: "delete",
87
+ name: deleteTarget.name,
88
+ scope: deleteTarget.scope,
89
+ }, { onSuccess: () => setDeleteTarget(null) });
90
+ }, children: [mutation.isPending ? (_jsx(IconLoader2, { className: "size-4 animate-spin" })) : null, t("jobs.delete", { defaultValue: "Delete" })] })] })] }) }), _jsx(Dialog, { open: detailsTarget !== null, onOpenChange: (open) => {
91
+ if (!open)
92
+ setDetailsTarget(null);
93
+ }, children: _jsxs(DialogContent, { className: "max-w-2xl", children: [_jsxs(DialogHeader, { children: [_jsx(DialogTitle, { children: detailsTarget?.name.replace(/-/g, " ") ??
94
+ t("jobs.recurringDetails", {
95
+ defaultValue: "Recurring job details",
96
+ }) }), _jsx(DialogDescription, { children: detailsTarget?.scheduleDescription || detailsTarget?.schedule })] }), detailsTarget ? (_jsxs("div", { children: [_jsx("p", { className: "text-xs font-medium text-foreground", children: t("jobs.instructions", { defaultValue: "Instructions" }) }), _jsx("p", { className: "mt-1 whitespace-pre-wrap text-sm text-muted-foreground", children: detailsTarget.instructions })] })) : null] }) })] }));
97
+ }
98
+ //# sourceMappingURL=AgentJobsTab.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AgentJobsTab.js","sourceRoot":"","sources":["../../../src/client/agent-page/AgentJobsTab.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iCAAiC,CAAC;AACzD,OAAO,EACL,SAAS,EACT,OAAO,EACP,WAAW,EACX,eAAe,EACf,cAAc,EACd,SAAS,GACV,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EACL,MAAM,EACN,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,WAAW,GACZ,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,mCAAmC,CAAC;AAEpE,OAAO,EACL,qBAAqB,EACrB,gBAAgB,GAEjB,MAAM,eAAe,CAAC;AAEvB,MAAM,UAAU,YAAY,CAAC,EAC3B,KAAK,EACL,YAAY,GAAG,KAAK,GACF;IAClB,MAAM,CAAC,GAAG,IAAI,EAAE,CAAC;IACjB,MAAM,EAAE,UAAU,EAAE,GAAG,aAAa,EAAE,CAAC;IACvC,MAAM,KAAK,GAAG,gBAAgB,CAAC,KAAK,CAAC,CAAC;IACtC,MAAM,QAAQ,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAC;IAC9C,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAsB,IAAI,CAAC,CAAC;IAC5E,MAAM,CAAC,aAAa,EAAE,gBAAgB,CAAC,GAAG,QAAQ,CAAsB,IAAI,CAAC,CAAC;IAE9E,MAAM,cAAc,GAAG,CAAC,KAAoB,EAAE,EAAE;QAC9C,IAAI,CAAC,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E,YAAY,EAAE,QAAQ,EAAE,CAAC,IACtC,IACI,IACD,GACT,EAET,KAAC,MAAM,IACL,IAAI,EAAE,aAAa,KAAK,IAAI,EAC5B,YAAY,EAAE,CAAC,IAAI,EAAE,EAAE;oBACrB,IAAI,CAAC,IAAI;wBAAE,gBAAgB,CAAC,IAAI,CAAC,CAAC;gBACpC,CAAC,YAED,MAAC,aAAa,IAAC,SAAS,EAAC,WAAW,aAClC,MAAC,YAAY,eACX,KAAC,WAAW,cACT,aAAa,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC;wCACrC,CAAC,CAAC,uBAAuB,EAAE;4CACzB,YAAY,EAAE,uBAAuB;yCACtC,CAAC,GACQ,EACd,KAAC,iBAAiB,cACf,aAAa,EAAE,mBAAmB,IAAI,aAAa,EAAE,QAAQ,GAC5C,IACP,EACd,aAAa,CAAC,CAAC,CAAC,CACf,0BACE,YAAG,SAAS,EAAC,qCAAqC,YAC/C,CAAC,CAAC,mBAAmB,EAAE,EAAE,YAAY,EAAE,cAAc,EAAE,CAAC,GACvD,EACJ,YAAG,SAAS,EAAC,wDAAwD,YAClE,aAAa,CAAC,YAAY,GACzB,IACA,CACP,CAAC,CAAC,CAAC,IAAI,IACM,GACT,IACL,CACP,CAAC;AACJ,CAAC","sourcesContent":["import { Button } from \"@agent-native/toolkit/ui/button\";\nimport {\n IconClock,\n IconEye,\n IconLoader2,\n IconPlayerPause,\n IconPlayerPlay,\n IconTrash,\n} from \"@tabler/icons-react\";\nimport { useState } from \"react\";\n\nimport {\n Dialog,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogTitle,\n} from \"../components/ui/dialog.js\";\nimport { useFormatters, useT } from \"../i18n.js\";\nimport { AutomationsList } from \"../settings/AutomationsSection.js\";\nimport type { AgentPageTabProps } from \"./types.js\";\nimport {\n useManageRecurringJob,\n useRecurringJobs,\n type RecurringJob,\n} from \"./use-jobs.js\";\n\nexport function AgentJobsTab({\n scope,\n canManageOrg = false,\n}: AgentPageTabProps) {\n const t = useT();\n const { formatDate } = useFormatters();\n const query = useRecurringJobs(scope);\n const mutation = useManageRecurringJob(scope);\n const [deleteTarget, setDeleteTarget] = useState<RecurringJob | null>(null);\n const [detailsTarget, setDetailsTarget] = useState<RecurringJob | null>(null);\n\n const formatDateTime = (value: string | null) => {\n if (!value || Number.isNaN(new Date(value).getTime())) return null;\n return formatDate(value, {\n month: \"short\",\n day: \"numeric\",\n hour: \"numeric\",\n minute: \"2-digit\",\n });\n };\n\n const jobs = query.data ?? [];\n\n return (\n <div className=\"mx-auto flex w-full max-w-5xl flex-col gap-8 p-6 lg:p-10\">\n <header className=\"space-y-3\">\n <p className=\"text-xs font-medium uppercase tracking-[0.16em] text-muted-foreground\">\n {t(\"jobs.agent\", { defaultValue: \"Agent\" })}\n </p>\n <div>\n <h1 className=\"text-2xl font-semibold tracking-tight\">\n {t(\"jobs.pageTitle\", { defaultValue: \"Jobs\" })}\n </h1>\n <p className=\"mt-1 max-w-2xl text-sm leading-relaxed text-muted-foreground\">\n {t(\"jobs.pageDescription\", {\n defaultValue:\n \"See recurring jobs and automations that run work for you.\",\n })}\n </p>\n </div>\n </header>\n\n <section className=\"space-y-4\">\n <div className=\"flex flex-wrap items-end justify-between gap-3\">\n <div>\n <h2 className=\"text-lg font-semibold\">\n {t(\"jobs.recurringTitle\", { defaultValue: \"Recurring jobs\" })}\n </h2>\n <p className=\"mt-1 text-sm text-muted-foreground\">\n {scope === \"org\"\n ? t(\"jobs.organizationRecurringDescription\", {\n defaultValue:\n \"Cron jobs shared with this organization. Members can view them; creators and admins can manage them.\",\n })\n : t(\"jobs.recurringDescription\", {\n defaultValue:\n \"Scheduled prompts that ask the agent to do work automatically.\",\n })}\n </p>\n </div>\n {scope === \"org\" && !canManageOrg ? (\n <span className=\"text-xs text-muted-foreground\">\n {t(\"jobs.organizationMemberNote\", {\n defaultValue: \"You can manage jobs you created.\",\n })}\n </span>\n ) : null}\n </div>\n\n {query.isLoading ? (\n <div\n className=\"flex items-center gap-2 text-sm text-muted-foreground\"\n aria-busy=\"true\"\n >\n <IconLoader2 className=\"size-4 animate-spin\" />\n {t(\"jobs.loading\", { defaultValue: \"Loading…\" })}\n </div>\n ) : query.error ? (\n <p className=\"text-sm text-destructive\">\n {t(\"jobs.recurringLoadError\", {\n defaultValue: \"Could not load recurring jobs.\",\n })}\n </p>\n ) : jobs.length === 0 ? (\n <div className=\"rounded-lg border border-dashed border-border p-6 text-center\">\n <IconClock className=\"mx-auto size-5 text-muted-foreground\" />\n <p className=\"mt-2 text-sm text-muted-foreground\">\n {scope === \"org\"\n ? t(\"jobs.organizationEmpty\", {\n defaultValue: \"No organization jobs yet.\",\n })\n : t(\"jobs.recurringEmpty\", {\n defaultValue:\n \"No recurring jobs yet. Ask the agent: “every morning, summarize my inbox”.\",\n })}\n </p>\n </div>\n ) : (\n <div className=\"space-y-3\">\n {jobs.map((job) => {\n const lastRun = formatDateTime(job.lastRun);\n const nextRun = formatDateTime(job.nextRun);\n return (\n <article\n key={job.id}\n className=\"rounded-lg border border-border bg-card p-4\"\n >\n <div className=\"flex items-start gap-3\">\n <div className=\"mt-0.5 text-muted-foreground\">\n <IconClock className=\"size-4\" />\n </div>\n <div className=\"min-w-0 flex-1\">\n <div className=\"flex flex-wrap items-center gap-2\">\n <h3 className=\"truncate text-sm font-medium\">\n {job.name.replace(/-/g, \" \")}\n </h3>\n <span\n className={\n job.enabled\n ? \"rounded-full bg-emerald-500/15 px-2 py-0.5 text-[10px] font-medium text-emerald-600 dark:text-emerald-400\"\n : \"rounded-full bg-muted px-2 py-0.5 text-[10px] font-medium text-muted-foreground\"\n }\n >\n {job.enabled\n ? t(\"jobs.enabled\", { defaultValue: \"Enabled\" })\n : t(\"jobs.paused\", { defaultValue: \"Paused\" })}\n </span>\n {job.lastStatus ? (\n <span className=\"rounded-full bg-muted px-2 py-0.5 text-[10px] font-medium text-muted-foreground\">\n {job.lastStatus}\n </span>\n ) : null}\n </div>\n <p className=\"mt-1 text-sm text-muted-foreground\">\n {job.scheduleDescription || job.schedule}\n </p>\n <p className=\"mt-1 line-clamp-2 text-xs text-muted-foreground/80\">\n {job.instructions}\n </p>\n {lastRun || nextRun ? (\n <div className=\"mt-2 flex flex-wrap gap-x-4 gap-y-1 text-[11px] text-muted-foreground\">\n {nextRun ? (\n <span>\n {t(\"jobs.nextRun\", { defaultValue: \"Next run\" })}:{\" \"}\n {nextRun}\n </span>\n ) : null}\n {lastRun ? (\n <span>\n {t(\"jobs.lastRun\", { defaultValue: \"Last run\" })}:{\" \"}\n {lastRun}\n </span>\n ) : null}\n </div>\n ) : null}\n </div>\n <div className=\"flex shrink-0 items-center gap-1\">\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n className=\"cursor-pointer px-2 text-xs\"\n onClick={() => setDetailsTarget(job)}\n >\n <IconEye className=\"size-3.5\" />\n {t(\"jobs.details\", { defaultValue: \"Details\" })}\n </Button>\n {job.canUpdate ? (\n <>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"sm\"\n className=\"cursor-pointer px-2 text-xs\"\n disabled={mutation.isPending}\n onClick={() =>\n mutation.mutate({\n operation: \"update\",\n name: job.name,\n scope: job.scope,\n enabled: !job.enabled,\n })\n }\n >\n {job.enabled ? (\n <IconPlayerPause className=\"size-3.5\" />\n ) : (\n <IconPlayerPlay className=\"size-3.5\" />\n )}\n {job.enabled\n ? t(\"jobs.pause\", { defaultValue: \"Pause\" })\n : t(\"jobs.resume\", { defaultValue: \"Resume\" })}\n </Button>\n <Button\n type=\"button\"\n variant=\"ghost\"\n size=\"icon\"\n className=\"size-8 cursor-pointer text-muted-foreground hover:text-destructive\"\n aria-label={t(\"jobs.delete\", {\n defaultValue: \"Delete\",\n })}\n onClick={() => setDeleteTarget(job)}\n >\n <IconTrash className=\"size-3.5\" />\n </Button>\n </>\n ) : null}\n </div>\n </div>\n </article>\n );\n })}\n </div>\n )}\n {mutation.error ? (\n <p className=\"text-sm text-destructive\">\n {mutation.error.message ||\n t(\"jobs.recurringUpdateError\", {\n defaultValue: \"Could not update recurring job.\",\n })}\n </p>\n ) : null}\n </section>\n\n <section className=\"space-y-4\">\n <div>\n <h2 className=\"text-lg font-semibold\">\n {t(\"jobs.automationsTitle\", { defaultValue: \"Automations\" })}\n </h2>\n <p className=\"mt-1 text-sm text-muted-foreground\">\n {scope === \"org\"\n ? t(\"jobs.organizationAutomationsDescription\", {\n defaultValue:\n \"Automations are personal today, so none are shown in the organization view.\",\n })\n : t(\"jobs.automationsDescription\", {\n defaultValue:\n \"Event-triggered and scheduled agent tasks managed from one place.\",\n })}\n </p>\n </div>\n <AutomationsList\n scope={scope}\n emptyMessage={\n scope === \"org\"\n ? t(\"jobs.automationsPersonalOnly\", {\n defaultValue: \"Automations are personal today.\",\n })\n : undefined\n }\n />\n </section>\n\n <Dialog\n open={deleteTarget !== null}\n onOpenChange={(open) => {\n if (!open && !mutation.isPending) setDeleteTarget(null);\n }}\n >\n <DialogContent>\n <DialogHeader>\n <DialogTitle>\n {t(\"jobs.deleteRecurringTitle\", {\n defaultValue: \"Delete recurring job?\",\n })}\n </DialogTitle>\n <DialogDescription>\n {t(\"jobs.deleteRecurringDescription\", {\n defaultValue:\n \"This permanently removes the job and cannot be undone.\",\n })}\n </DialogDescription>\n </DialogHeader>\n <DialogFooter>\n <Button\n type=\"button\"\n variant=\"outline\"\n className=\"cursor-pointer\"\n disabled={mutation.isPending}\n onClick={() => setDeleteTarget(null)}\n >\n {t(\"jobs.cancel\", { defaultValue: \"Cancel\" })}\n </Button>\n <Button\n type=\"button\"\n variant=\"destructive\"\n className=\"cursor-pointer\"\n disabled={mutation.isPending}\n onClick={() => {\n if (!deleteTarget) return;\n mutation.mutate(\n {\n operation: \"delete\",\n name: deleteTarget.name,\n scope: deleteTarget.scope,\n },\n { onSuccess: () => setDeleteTarget(null) },\n );\n }}\n >\n {mutation.isPending ? (\n <IconLoader2 className=\"size-4 animate-spin\" />\n ) : null}\n {t(\"jobs.delete\", { defaultValue: \"Delete\" })}\n </Button>\n </DialogFooter>\n </DialogContent>\n </Dialog>\n\n <Dialog\n open={detailsTarget !== null}\n onOpenChange={(open) => {\n if (!open) setDetailsTarget(null);\n }}\n >\n <DialogContent className=\"max-w-2xl\">\n <DialogHeader>\n <DialogTitle>\n {detailsTarget?.name.replace(/-/g, \" \") ??\n t(\"jobs.recurringDetails\", {\n defaultValue: \"Recurring job details\",\n })}\n </DialogTitle>\n <DialogDescription>\n {detailsTarget?.scheduleDescription || detailsTarget?.schedule}\n </DialogDescription>\n </DialogHeader>\n {detailsTarget ? (\n <div>\n <p className=\"text-xs font-medium text-foreground\">\n {t(\"jobs.instructions\", { defaultValue: \"Instructions\" })}\n </p>\n <p className=\"mt-1 whitespace-pre-wrap text-sm text-muted-foreground\">\n {detailsTarget.instructions}\n </p>\n </div>\n ) : null}\n </DialogContent>\n </Dialog>\n </div>\n );\n}\n"]}
@@ -0,0 +1,20 @@
1
+ import type { SettingsTabItem } from "../settings/SettingsTabsPage.js";
2
+ export interface AgentTabsPageProps {
3
+ /**
4
+ * Human-readable app name used in the Access tab's connect instructions
5
+ * (e.g. "name it Mail"). Falls back to the `og:site_name` meta tag, then a
6
+ * hostname-derived guess — never `document.title`, which this page owns.
7
+ */
8
+ appName?: string;
9
+ extraTabs?: SettingsTabItem[];
10
+ defaultTab?: string;
11
+ className?: string;
12
+ /** Whether to render the Agent page search box. Defaults to true. */
13
+ enableSearch?: boolean;
14
+ searchPlaceholder?: string;
15
+ hiddenTabs?: string[];
16
+ value?: string;
17
+ onValueChange?: (tabId: string) => void;
18
+ }
19
+ export declare function AgentTabsPage({ appName, extraTabs, defaultTab, className, enableSearch, searchPlaceholder, hiddenTabs, value, onValueChange, }: AgentTabsPageProps): import("react").JSX.Element;
20
+ //# sourceMappingURL=AgentTabsPage.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AgentTabsPage.d.ts","sourceRoot":"","sources":["../../../src/client/agent-page/AgentTabsPage.tsx"],"names":[],"mappings":"AAkDA,OAAO,KAAK,EAEV,eAAe,EAChB,MAAM,iCAAiC,CAAC;AAmjBzC,MAAM,WAAW,kBAAkB;IACjC;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,SAAS,CAAC,EAAE,eAAe,EAAE,CAAC;IAC9B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,qEAAqE;IACrE,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACzC;AAED,wBAAgB,aAAa,CAAC,EAC5B,OAAO,EACP,SAAc,EACd,UAAsB,EACtB,SAAS,EACT,YAAmB,EACnB,iBAA2C,EAC3C,UAAe,EACf,KAAK,EACL,aAAa,GACd,EAAE,kBAAkB,+BAubpB"}