@agent-native/core 0.99.3 → 0.100.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/corpus/README.md +2 -2
- package/corpus/core/CHANGELOG.md +21 -0
- package/corpus/core/docs/content/agent-surfaces.mdx +43 -0
- package/corpus/core/docs/content/external-agents.mdx +11 -0
- package/corpus/core/docs/content/locales/ar-SA/agent-surfaces.mdx +30 -0
- package/corpus/core/docs/content/locales/ar-SA/external-agents.mdx +9 -0
- package/corpus/core/docs/content/locales/de-DE/agent-surfaces.mdx +34 -0
- package/corpus/core/docs/content/locales/de-DE/external-agents.mdx +10 -0
- package/corpus/core/docs/content/locales/es-ES/agent-surfaces.mdx +34 -0
- package/corpus/core/docs/content/locales/es-ES/external-agents.mdx +10 -0
- package/corpus/core/docs/content/locales/fr-FR/agent-surfaces.mdx +34 -0
- package/corpus/core/docs/content/locales/fr-FR/external-agents.mdx +11 -0
- package/corpus/core/docs/content/locales/hi-IN/agent-surfaces.mdx +31 -0
- package/corpus/core/docs/content/locales/hi-IN/external-agents.mdx +9 -0
- package/corpus/core/docs/content/locales/ja-JP/agent-surfaces.mdx +32 -0
- package/corpus/core/docs/content/locales/ja-JP/external-agents.mdx +10 -0
- package/corpus/core/docs/content/locales/ko-KR/agent-surfaces.mdx +32 -0
- package/corpus/core/docs/content/locales/ko-KR/external-agents.mdx +9 -0
- package/corpus/core/docs/content/locales/pt-BR/agent-surfaces.mdx +33 -0
- package/corpus/core/docs/content/locales/pt-BR/external-agents.mdx +10 -0
- package/corpus/core/docs/content/locales/zh-CN/agent-surfaces.mdx +29 -0
- package/corpus/core/docs/content/locales/zh-CN/external-agents.mdx +8 -0
- package/corpus/core/docs/content/locales/zh-TW/agent-surfaces.mdx +29 -0
- package/corpus/core/docs/content/locales/zh-TW/external-agents.mdx +8 -0
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/agent/context-xray/actions/context-evict.ts +11 -0
- package/corpus/core/src/agent/context-xray/actions/context-pin.ts +11 -0
- package/corpus/core/src/agent/context-xray/actions/context-preview-get.ts +134 -0
- package/corpus/core/src/agent/context-xray/actions/context-restore.ts +11 -0
- package/corpus/core/src/agent/context-xray/actions/errors.ts +20 -0
- package/corpus/core/src/agent/context-xray/manifest.ts +106 -7
- package/corpus/core/src/agent/engine/context-directives-transform.ts +5 -1
- package/corpus/core/src/agent/production-agent.ts +100 -38
- package/corpus/core/src/agent/run-loop-with-resume.ts +7 -2
- package/corpus/core/src/client/AgentPanel.tsx +35 -8
- package/corpus/core/src/client/agent-page/AgentContextTab.tsx +501 -0
- package/corpus/core/src/client/agent-page/AgentJobsTab.tsx +370 -0
- package/corpus/core/src/client/agent-page/AgentTabsPage.tsx +1084 -0
- package/corpus/core/src/client/agent-page/types.ts +18 -0
- package/corpus/core/src/client/agent-page/use-jobs.ts +150 -0
- package/corpus/core/src/client/context-xray/ContextMeter.tsx +22 -5
- package/corpus/core/src/client/context-xray/ContextTreemap.tsx +16 -1
- package/corpus/core/src/client/context-xray/ContextXRayPanel.tsx +168 -3
- package/corpus/core/src/client/context-xray/format.ts +6 -0
- package/corpus/core/src/client/index.ts +6 -0
- package/corpus/core/src/client/resources/ResourcesPanel.tsx +51 -23
- package/corpus/core/src/client/settings/AutomationsSection.tsx +407 -387
- package/corpus/core/src/jobs/actions/list-recurring-jobs.ts +105 -0
- package/corpus/core/src/jobs/actions/manage-recurring-job.ts +85 -0
- package/corpus/core/src/jobs/tools.ts +1 -1
- package/corpus/core/src/localization/default-messages.ts +110 -0
- package/corpus/core/src/mcp/build-server.ts +1 -0
- package/corpus/core/src/mcp/connect-route.ts +62 -65
- package/corpus/core/src/server/action-discovery.ts +23 -0
- package/corpus/core/src/server/agent-chat/prompt-resources.ts +174 -2
- package/corpus/core/src/server/agent-chat-plugin.ts +175 -2
- package/corpus/core/src/server/auth.ts +1 -7
- package/corpus/core/src/server/google-oauth.ts +1 -7
- package/corpus/core/src/server/workspace-oauth.ts +31 -0
- package/corpus/core/src/shared/context-xray.ts +84 -1
- package/corpus/core/src/shared/mcp-connect-content.ts +130 -0
- package/corpus/core/src/templates/default/app/routes/_index.tsx +11 -0
- package/corpus/core/src/templates/default/app/routes/agent.tsx +33 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +6 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/agent-page/SKILL.md +59 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/context-xray/SKILL.md +25 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/external-agents/SKILL.md +7 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/recurring-jobs/SKILL.md +9 -0
- package/corpus/core/src/triggers/actions/list-automations.ts +99 -0
- package/corpus/core/src/triggers/actions/manage-automation.ts +78 -0
- package/corpus/templates/analytics/actions/data-source-status.ts +33 -15
- package/corpus/templates/analytics/actions/query-agent-native-analytics.ts +1 -1
- package/corpus/templates/analytics/app/components/dashboard/SqlChart.tsx +149 -24
- package/corpus/templates/analytics/app/components/layout/CommandPalette.tsx +17 -0
- package/corpus/templates/analytics/app/components/layout/Header.tsx +1 -0
- package/corpus/templates/analytics/app/components/layout/Layout.tsx +1 -0
- package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +8 -0
- package/corpus/templates/analytics/app/i18n/zh-TW.ts +1 -0
- package/corpus/templates/analytics/app/i18n-data.ts +1 -0
- package/corpus/templates/analytics/app/routes/agent.tsx +5 -0
- package/corpus/templates/analytics/changelog/2026-07-13-a-full-agent-page-now-brings-context-files-connections-jobs-.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-13-analytics-answers-can-use-built-in-first-party-event-data.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-13-chart-legends-can-filter-to-one-series-or-hide-a-series-on-h.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-13-gpt-5-6-luna-answers-now-recover-normally-instead-of-showing.md +6 -0
- package/corpus/templates/analytics/server/plugins/agent-chat.ts +11 -2
- package/corpus/templates/assets/app/components/layout/Header.tsx +1 -0
- package/corpus/templates/assets/app/components/layout/Layout.tsx +1 -0
- package/corpus/templates/assets/app/components/layout/Sidebar.tsx +2 -0
- package/corpus/templates/assets/app/routes/agent.tsx +5 -0
- package/corpus/templates/assets/changelog/2026-07-13-a-full-agent-page-now-brings-context-files-connections-jobs-.md +6 -0
- package/corpus/templates/brain/app/components/layout/Layout.tsx +1 -0
- package/corpus/templates/brain/app/components/layout/Sidebar.tsx +4 -1
- package/corpus/templates/brain/app/lib/brain.ts +11 -0
- package/corpus/templates/brain/app/root.tsx +15 -1
- package/corpus/templates/brain/app/routes/agent.tsx +11 -0
- package/corpus/templates/brain/changelog/2026-07-13-a-full-agent-page-now-brings-context-files-connections-jobs-.md +6 -0
- package/corpus/templates/calendar/AGENTS.md +9 -0
- package/corpus/templates/calendar/actions/list-events.ts +659 -44
- package/corpus/templates/calendar/app/components/layout/AppLayout.tsx +1 -0
- package/corpus/templates/calendar/app/components/layout/Sidebar.tsx +2 -0
- package/corpus/templates/calendar/app/root.tsx +17 -1
- package/corpus/templates/calendar/app/routes/_app.agent.tsx +25 -0
- package/corpus/templates/calendar/changelog/2026-07-13-a-full-agent-page-now-brings-context-files-connections-jobs-.md +6 -0
- package/corpus/templates/calendar/changelog/2026-07-13-calendar-inventory-reads-report-source-coverage.md +6 -0
- package/corpus/templates/calendar/server/lib/calendar-connector-catalog.ts +8 -0
- package/corpus/templates/calendar/server/lib/google-calendar.ts +173 -51
- package/corpus/templates/calendar/server/lib/ical-fetcher.ts +13 -2
- package/corpus/templates/calendar/server/plugins/agent-chat.ts +5 -3
- package/corpus/templates/calendar/shared/api.ts +2 -0
- package/corpus/templates/chat/app/components/layout/Header.tsx +1 -0
- package/corpus/templates/chat/app/components/layout/Layout.tsx +1 -0
- package/corpus/templates/chat/app/components/layout/Sidebar.tsx +7 -0
- package/corpus/templates/chat/app/hooks/use-navigation-state.ts +3 -0
- package/corpus/templates/chat/app/root.tsx +24 -2
- package/corpus/templates/chat/app/routes/agent.tsx +15 -0
- package/corpus/templates/chat/changelog/2026-07-13-a-full-agent-page-now-brings-context-files-connections-jobs-.md +6 -0
- package/corpus/templates/clips/app/components/library/library-layout.tsx +8 -0
- package/corpus/templates/clips/app/i18n/ar-SA.ts +2 -0
- package/corpus/templates/clips/app/i18n/de-DE.ts +2 -0
- package/corpus/templates/clips/app/i18n/en-US.ts +2 -0
- package/corpus/templates/clips/app/i18n/es-ES.ts +2 -0
- package/corpus/templates/clips/app/i18n/fr-FR.ts +2 -0
- package/corpus/templates/clips/app/i18n/hi-IN.ts +2 -0
- package/corpus/templates/clips/app/i18n/ja-JP.ts +2 -0
- package/corpus/templates/clips/app/i18n/ko-KR.ts +2 -0
- package/corpus/templates/clips/app/i18n/pt-BR.ts +2 -0
- package/corpus/templates/clips/app/i18n/zh-CN.ts +2 -0
- package/corpus/templates/clips/app/i18n/zh-TW.ts +2 -0
- package/corpus/templates/clips/app/root.tsx +7 -1
- package/corpus/templates/clips/app/routes/_app.agent.tsx +15 -0
- package/corpus/templates/clips/changelog/2026-07-13-new-agent-page-see-and-manage-your-agent-s-context-files-con.md +6 -0
- package/corpus/templates/content/app/components/layout/Layout.tsx +1 -0
- package/corpus/templates/content/app/components/sidebar/DocumentSidebar.tsx +36 -0
- package/corpus/templates/content/app/i18n/zh-TW.ts +2 -0
- package/corpus/templates/content/app/i18n-data.ts +44 -6
- package/corpus/templates/content/app/root.tsx +8 -0
- package/corpus/templates/content/app/routes/_app.agent.tsx +15 -0
- package/corpus/templates/content/changelog/2026-07-13-new-agent-page-see-and-manage-your-agent-s-context-files-con.md +6 -0
- package/corpus/templates/design/app/components/layout/Layout.tsx +1 -0
- package/corpus/templates/design/app/components/layout/Sidebar.tsx +2 -0
- package/corpus/templates/design/app/i18n/zh-TW.ts +2 -0
- package/corpus/templates/design/app/i18n-data.ts +20 -0
- package/corpus/templates/design/app/root.tsx +7 -1
- package/corpus/templates/design/app/routes/agent.tsx +15 -0
- package/corpus/templates/design/changelog/2026-07-13-new-agent-page-see-and-manage-your-agent-s-context-files-con.md +6 -0
- package/corpus/templates/dispatch/app/dispatch-extensions.tsx +10 -1
- package/corpus/templates/dispatch/app/i18n/zh-TW.ts +2 -0
- package/corpus/templates/dispatch/app/i18n-data.ts +20 -0
- package/corpus/templates/dispatch/app/root.tsx +7 -2
- package/corpus/templates/dispatch/app/routes/agent.tsx +18 -0
- package/corpus/templates/dispatch/changelog/2026-07-13-new-agent-page-see-and-manage-your-agent-s-context-files-con.md +6 -0
- package/corpus/templates/forms/app/components/layout/Layout.tsx +1 -0
- package/corpus/templates/forms/app/components/layout/Sidebar.tsx +35 -0
- package/corpus/templates/forms/app/i18n/ar-SA.ts +2 -0
- package/corpus/templates/forms/app/i18n/de-DE.ts +2 -0
- package/corpus/templates/forms/app/i18n/en-US.ts +2 -0
- package/corpus/templates/forms/app/i18n/es-ES.ts +2 -0
- package/corpus/templates/forms/app/i18n/fr-FR.ts +2 -0
- package/corpus/templates/forms/app/i18n/hi-IN.ts +2 -0
- package/corpus/templates/forms/app/i18n/ja-JP.ts +2 -0
- package/corpus/templates/forms/app/i18n/ko-KR.ts +2 -0
- package/corpus/templates/forms/app/i18n/pt-BR.ts +2 -0
- package/corpus/templates/forms/app/i18n/zh-CN.ts +2 -0
- package/corpus/templates/forms/app/i18n/zh-TW.ts +2 -0
- package/corpus/templates/forms/app/root.tsx +6 -1
- package/corpus/templates/forms/app/routes/_app.agent.tsx +15 -0
- package/corpus/templates/forms/changelog/2026-07-13-new-agent-page-see-and-manage-your-agent-s-context-files-con.md +6 -0
- package/corpus/templates/macros/app/components/layout/AppLayout.tsx +14 -2
- package/corpus/templates/macros/app/components/layout/Header.tsx +1 -0
- package/corpus/templates/macros/app/root.tsx +17 -2
- package/corpus/templates/macros/app/routes/agent.tsx +15 -0
- package/corpus/templates/macros/changelog/2026-07-13-new-agent-page-see-and-manage-your-agent-s-context-files-con.md +6 -0
- package/corpus/templates/mail/AGENTS.md +12 -0
- package/corpus/templates/mail/actions/list-emails.ts +486 -4
- package/corpus/templates/mail/app/components/layout/AppLayout.tsx +42 -0
- package/corpus/templates/mail/app/components/layout/CommandPalette.tsx +6 -0
- package/corpus/templates/mail/app/routes/agent.tsx +15 -0
- package/corpus/templates/mail/changelog/2026-07-13-coverage-aware-connected-inbox-inventory.md +6 -0
- package/corpus/templates/mail/changelog/2026-07-13-new-agent-page-see-and-manage-your-agent-s-context-files-con.md +6 -0
- package/corpus/templates/mail/server/db/schema.ts +17 -0
- package/corpus/templates/mail/server/lib/google-auth.ts +33 -5
- package/corpus/templates/mail/server/lib/inventory-cursor.ts +406 -0
- package/corpus/templates/mail/server/lib/list-inbox-emails.ts +21 -2
- package/corpus/templates/mail/server/lib/mail-connector-catalog.ts +8 -0
- package/corpus/templates/mail/server/plugins/agent-chat.ts +4 -9
- package/corpus/templates/mail/server/plugins/db.ts +20 -0
- package/corpus/templates/plan/app/components/layout/Header.tsx +1 -0
- package/corpus/templates/plan/app/components/layout/Layout.tsx +1 -0
- package/corpus/templates/plan/app/components/layout/Sidebar.tsx +2 -0
- package/corpus/templates/plan/app/root.tsx +8 -0
- package/corpus/templates/plan/app/routes/agent.tsx +15 -0
- package/corpus/templates/plan/changelog/2026-07-13-new-agent-page-see-and-manage-your-agent-s-context-files-con.md +6 -0
- package/corpus/templates/slides/app/components/layout/Header.tsx +1 -0
- package/corpus/templates/slides/app/components/layout/Layout.tsx +1 -0
- package/corpus/templates/slides/app/components/layout/Sidebar.tsx +2 -0
- package/corpus/templates/slides/app/root.tsx +10 -1
- package/corpus/templates/slides/app/routes/agent.tsx +15 -0
- package/corpus/templates/slides/changelog/2026-07-13-new-agent-page-see-and-manage-your-agent-s-context-files-con.md +6 -0
- package/dist/agent/context-xray/actions/context-evict.js +5 -2
- package/dist/agent/context-xray/actions/context-evict.js.map +1 -1
- package/dist/agent/context-xray/actions/context-pin.js +5 -2
- package/dist/agent/context-xray/actions/context-pin.js.map +1 -1
- package/dist/agent/context-xray/actions/context-preview-get.d.ts +17 -0
- package/dist/agent/context-xray/actions/context-preview-get.d.ts.map +1 -0
- package/dist/agent/context-xray/actions/context-preview-get.js +94 -0
- package/dist/agent/context-xray/actions/context-preview-get.js.map +1 -0
- package/dist/agent/context-xray/actions/context-restore.js +5 -2
- package/dist/agent/context-xray/actions/context-restore.js.map +1 -1
- package/dist/agent/context-xray/actions/errors.d.ts +3 -0
- package/dist/agent/context-xray/actions/errors.d.ts.map +1 -1
- package/dist/agent/context-xray/actions/errors.js +6 -0
- package/dist/agent/context-xray/actions/errors.js.map +1 -1
- package/dist/agent/context-xray/manifest.d.ts +18 -1
- package/dist/agent/context-xray/manifest.d.ts.map +1 -1
- package/dist/agent/context-xray/manifest.js +68 -6
- package/dist/agent/context-xray/manifest.js.map +1 -1
- package/dist/agent/engine/context-directives-transform.d.ts +2 -0
- package/dist/agent/engine/context-directives-transform.d.ts.map +1 -1
- package/dist/agent/engine/context-directives-transform.js +2 -1
- package/dist/agent/engine/context-directives-transform.js.map +1 -1
- package/dist/agent/production-agent.d.ts +15 -0
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +74 -36
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/agent/run-loop-with-resume.d.ts.map +1 -1
- package/dist/agent/run-loop-with-resume.js +6 -3
- package/dist/agent/run-loop-with-resume.js.map +1 -1
- package/dist/client/AgentPanel.d.ts +5 -1
- package/dist/client/AgentPanel.d.ts.map +1 -1
- package/dist/client/AgentPanel.js +9 -11
- package/dist/client/AgentPanel.js.map +1 -1
- package/dist/client/agent-page/AgentContextTab.d.ts +5 -0
- package/dist/client/agent-page/AgentContextTab.d.ts.map +1 -0
- package/dist/client/agent-page/AgentContextTab.js +202 -0
- package/dist/client/agent-page/AgentContextTab.js.map +1 -0
- package/dist/client/agent-page/AgentJobsTab.d.ts +3 -0
- package/dist/client/agent-page/AgentJobsTab.d.ts.map +1 -0
- package/dist/client/agent-page/AgentJobsTab.js +98 -0
- package/dist/client/agent-page/AgentJobsTab.js.map +1 -0
- package/dist/client/agent-page/AgentTabsPage.d.ts +20 -0
- package/dist/client/agent-page/AgentTabsPage.d.ts.map +1 -0
- package/dist/client/agent-page/AgentTabsPage.js +420 -0
- package/dist/client/agent-page/AgentTabsPage.js.map +1 -0
- package/dist/client/agent-page/types.d.ts +17 -0
- package/dist/client/agent-page/types.d.ts.map +1 -0
- package/dist/client/agent-page/types.js +9 -0
- package/dist/client/agent-page/types.js.map +1 -0
- package/dist/client/agent-page/use-jobs.d.ts +61 -0
- package/dist/client/agent-page/use-jobs.d.ts.map +1 -0
- package/dist/client/agent-page/use-jobs.js +71 -0
- package/dist/client/agent-page/use-jobs.js.map +1 -0
- package/dist/client/context-xray/ContextMeter.d.ts +3 -1
- package/dist/client/context-xray/ContextMeter.d.ts.map +1 -1
- package/dist/client/context-xray/ContextMeter.js +14 -5
- package/dist/client/context-xray/ContextMeter.js.map +1 -1
- package/dist/client/context-xray/ContextTreemap.d.ts +3 -2
- package/dist/client/context-xray/ContextTreemap.d.ts.map +1 -1
- package/dist/client/context-xray/ContextTreemap.js +9 -1
- package/dist/client/context-xray/ContextTreemap.js.map +1 -1
- package/dist/client/context-xray/ContextXRayPanel.d.ts.map +1 -1
- package/dist/client/context-xray/ContextXRayPanel.js +95 -20
- package/dist/client/context-xray/ContextXRayPanel.js.map +1 -1
- package/dist/client/context-xray/format.d.ts.map +1 -1
- package/dist/client/context-xray/format.js +12 -0
- package/dist/client/context-xray/format.js.map +1 -1
- package/dist/client/index.d.ts +3 -0
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +1 -0
- package/dist/client/index.js.map +1 -1
- package/dist/client/resources/ResourcesPanel.d.ts +9 -1
- package/dist/client/resources/ResourcesPanel.d.ts.map +1 -1
- package/dist/client/resources/ResourcesPanel.js +26 -10
- package/dist/client/resources/ResourcesPanel.js.map +1 -1
- package/dist/client/settings/AutomationsSection.d.ts +9 -0
- package/dist/client/settings/AutomationsSection.d.ts.map +1 -1
- package/dist/client/settings/AutomationsSection.js +128 -147
- package/dist/client/settings/AutomationsSection.js.map +1 -1
- package/dist/collab/routes.d.ts +1 -1
- package/dist/collab/struct-routes.d.ts +1 -1
- package/dist/file-upload/actions/upload-image.d.ts +1 -1
- package/dist/jobs/actions/list-recurring-jobs.d.ts +21 -0
- package/dist/jobs/actions/list-recurring-jobs.d.ts.map +1 -0
- package/dist/jobs/actions/list-recurring-jobs.js +74 -0
- package/dist/jobs/actions/list-recurring-jobs.js.map +1 -0
- package/dist/jobs/actions/manage-recurring-job.d.ts +18 -0
- package/dist/jobs/actions/manage-recurring-job.d.ts.map +1 -0
- package/dist/jobs/actions/manage-recurring-job.js +68 -0
- package/dist/jobs/actions/manage-recurring-job.js.map +1 -0
- package/dist/jobs/tools.d.ts +13 -0
- package/dist/jobs/tools.d.ts.map +1 -1
- package/dist/jobs/tools.js +1 -1
- package/dist/jobs/tools.js.map +1 -1
- package/dist/localization/default-messages.d.ts +96 -0
- package/dist/localization/default-messages.d.ts.map +1 -1
- package/dist/localization/default-messages.js +96 -0
- package/dist/localization/default-messages.js.map +1 -1
- package/dist/mcp/build-server.d.ts.map +1 -1
- package/dist/mcp/build-server.js +1 -0
- package/dist/mcp/build-server.js.map +1 -1
- package/dist/mcp/connect-route.d.ts.map +1 -1
- package/dist/mcp/connect-route.js +44 -59
- package/dist/mcp/connect-route.js.map +1 -1
- package/dist/notifications/routes.d.ts +1 -1
- package/dist/observability/routes.d.ts +5 -5
- package/dist/progress/routes.d.ts +1 -1
- package/dist/resources/handlers.d.ts +3 -3
- package/dist/secrets/routes.d.ts +9 -9
- package/dist/server/action-discovery.d.ts.map +1 -1
- package/dist/server/action-discovery.js +23 -0
- package/dist/server/action-discovery.js.map +1 -1
- package/dist/server/agent-chat/prompt-resources.d.ts +14 -0
- package/dist/server/agent-chat/prompt-resources.d.ts.map +1 -1
- package/dist/server/agent-chat/prompt-resources.js +139 -2
- package/dist/server/agent-chat/prompt-resources.js.map +1 -1
- package/dist/server/agent-chat-plugin.d.ts +1 -0
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +136 -3
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/auth.d.ts.map +1 -1
- package/dist/server/auth.js +1 -4
- package/dist/server/auth.js.map +1 -1
- package/dist/server/google-oauth.d.ts.map +1 -1
- package/dist/server/google-oauth.js +1 -4
- package/dist/server/google-oauth.js.map +1 -1
- package/dist/server/workspace-oauth.d.ts +11 -0
- package/dist/server/workspace-oauth.d.ts.map +1 -0
- package/dist/server/workspace-oauth.js +25 -0
- package/dist/server/workspace-oauth.js.map +1 -0
- package/dist/shared/context-xray.d.ts +45 -1
- package/dist/shared/context-xray.d.ts.map +1 -1
- package/dist/shared/context-xray.js +12 -0
- package/dist/shared/context-xray.js.map +1 -1
- package/dist/shared/mcp-connect-content.d.ts +37 -0
- package/dist/shared/mcp-connect-content.d.ts.map +1 -0
- package/dist/shared/mcp-connect-content.js +92 -0
- package/dist/shared/mcp-connect-content.js.map +1 -0
- package/dist/templates/default/app/routes/_index.tsx +11 -0
- package/dist/templates/default/app/routes/agent.tsx +33 -0
- package/dist/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +6 -0
- package/dist/templates/workspace-core/.agents/skills/agent-page/SKILL.md +59 -0
- package/dist/templates/workspace-core/.agents/skills/context-xray/SKILL.md +25 -0
- package/dist/templates/workspace-core/.agents/skills/external-agents/SKILL.md +7 -0
- package/dist/templates/workspace-core/.agents/skills/recurring-jobs/SKILL.md +9 -0
- package/dist/triggers/actions/list-automations.d.ts +24 -0
- package/dist/triggers/actions/list-automations.d.ts.map +1 -0
- package/dist/triggers/actions/list-automations.js +72 -0
- package/dist/triggers/actions/list-automations.js.map +1 -0
- package/dist/triggers/actions/manage-automation.d.ts +18 -0
- package/dist/triggers/actions/manage-automation.d.ts.map +1 -0
- package/dist/triggers/actions/manage-automation.js +60 -0
- package/dist/triggers/actions/manage-automation.js.map +1 -0
- package/docs/content/agent-surfaces.mdx +43 -0
- package/docs/content/external-agents.mdx +11 -0
- package/docs/content/locales/ar-SA/agent-surfaces.mdx +30 -0
- package/docs/content/locales/ar-SA/external-agents.mdx +9 -0
- package/docs/content/locales/de-DE/agent-surfaces.mdx +34 -0
- package/docs/content/locales/de-DE/external-agents.mdx +10 -0
- package/docs/content/locales/es-ES/agent-surfaces.mdx +34 -0
- package/docs/content/locales/es-ES/external-agents.mdx +10 -0
- package/docs/content/locales/fr-FR/agent-surfaces.mdx +34 -0
- package/docs/content/locales/fr-FR/external-agents.mdx +11 -0
- package/docs/content/locales/hi-IN/agent-surfaces.mdx +31 -0
- package/docs/content/locales/hi-IN/external-agents.mdx +9 -0
- package/docs/content/locales/ja-JP/agent-surfaces.mdx +32 -0
- package/docs/content/locales/ja-JP/external-agents.mdx +10 -0
- package/docs/content/locales/ko-KR/agent-surfaces.mdx +32 -0
- package/docs/content/locales/ko-KR/external-agents.mdx +9 -0
- package/docs/content/locales/pt-BR/agent-surfaces.mdx +33 -0
- package/docs/content/locales/pt-BR/external-agents.mdx +10 -0
- package/docs/content/locales/zh-CN/agent-surfaces.mdx +29 -0
- package/docs/content/locales/zh-CN/external-agents.mdx +8 -0
- package/docs/content/locales/zh-TW/agent-surfaces.mdx +29 -0
- package/docs/content/locales/zh-TW/external-agents.mdx +8 -0
- package/package.json +1 -1
- package/src/templates/default/app/routes/_index.tsx +11 -0
- package/src/templates/default/app/routes/agent.tsx +33 -0
- package/src/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +6 -0
- package/src/templates/workspace-core/.agents/skills/agent-page/SKILL.md +59 -0
- package/src/templates/workspace-core/.agents/skills/context-xray/SKILL.md +25 -0
- package/src/templates/workspace-core/.agents/skills/external-agents/SKILL.md +7 -0
- package/src/templates/workspace-core/.agents/skills/recurring-jobs/SKILL.md +9 -0
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared copy and templates for connecting external MCP clients.
|
|
3
|
+
*
|
|
4
|
+
* Keep this module free of React and server-only imports so the server-rendered
|
|
5
|
+
* connect page and the client Agent access tab use the same instructions.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
export type McpConnectGuideId =
|
|
9
|
+
| "claude"
|
|
10
|
+
| "chatgpt"
|
|
11
|
+
| "cursor"
|
|
12
|
+
| "claude-code"
|
|
13
|
+
| "codex"
|
|
14
|
+
| "other";
|
|
15
|
+
|
|
16
|
+
export interface McpConnectTemplateValues {
|
|
17
|
+
appName: string;
|
|
18
|
+
appUrl: string;
|
|
19
|
+
mcpUrl: string;
|
|
20
|
+
serverId: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export interface McpConnectGuide {
|
|
24
|
+
id: McpConnectGuideId;
|
|
25
|
+
label: string;
|
|
26
|
+
steps?: readonly string[];
|
|
27
|
+
intro?: string;
|
|
28
|
+
commandTemplate?: string;
|
|
29
|
+
configTemplate?: string;
|
|
30
|
+
action?: {
|
|
31
|
+
kind: "link" | "copy";
|
|
32
|
+
label: string;
|
|
33
|
+
href?: string;
|
|
34
|
+
};
|
|
35
|
+
note?: string;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export const MCP_CONNECT_MCP_URL_TEMPLATE = "{appUrl}/mcp";
|
|
39
|
+
|
|
40
|
+
export const MCP_CONNECT_GUIDES: readonly McpConnectGuide[] = [
|
|
41
|
+
{
|
|
42
|
+
id: "claude",
|
|
43
|
+
label: "Claude",
|
|
44
|
+
steps: [
|
|
45
|
+
"Open Customize → Connectors in Claude.",
|
|
46
|
+
"Click the + button → Add custom connector.",
|
|
47
|
+
"Paste the MCP URL above, name it {appName}, click Connect.",
|
|
48
|
+
"On the consent page, click Authorize to approve mcp:read, mcp:write, mcp:apps.",
|
|
49
|
+
],
|
|
50
|
+
action: {
|
|
51
|
+
kind: "link",
|
|
52
|
+
label: "Open Claude → Connectors",
|
|
53
|
+
href: "https://claude.ai/customize/connectors",
|
|
54
|
+
},
|
|
55
|
+
note: "Works in Claude web and Claude Desktop. Inline MCP Apps (charts, dashboards, drafts) render automatically inside the chat.",
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
id: "chatgpt",
|
|
59
|
+
label: "ChatGPT",
|
|
60
|
+
steps: [
|
|
61
|
+
"In ChatGPT, open Settings → Apps (Business/Enterprise/Edu workspaces with developer mode enabled).",
|
|
62
|
+
"Scroll to Advanced settings → Create app, paste the MCP URL above, name it {appName}.",
|
|
63
|
+
"Click Connect, sign in with your Agent-Native account, and approve mcp:read, mcp:write, mcp:apps.",
|
|
64
|
+
],
|
|
65
|
+
action: {
|
|
66
|
+
kind: "link",
|
|
67
|
+
label: "Open ChatGPT",
|
|
68
|
+
href: "https://chatgpt.com/",
|
|
69
|
+
},
|
|
70
|
+
note: 'Got "Connector name already exists" but don\'t see it under Enabled apps? ChatGPT saves a hidden draft the moment you click Create — even if you closed the OAuth popup before approving. In Settings → Apps, scroll past Enabled apps to the Drafts section ("Private apps you\'ve created in developer mode"). Click the draft and either press Connect to finish OAuth, or use the ⋯ → Delete menu and re-create. Workspace admins may also need to enable custom connectors under org settings; each member still authorizes their own account.',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
id: "cursor",
|
|
74
|
+
label: "Cursor",
|
|
75
|
+
steps: [
|
|
76
|
+
"Open Cursor → Settings → MCP.",
|
|
77
|
+
"Click Add MCP Server, paste the MCP URL above, save.",
|
|
78
|
+
"When prompted, sign in with your Agent-Native account and approve the MCP scopes.",
|
|
79
|
+
],
|
|
80
|
+
note: "Cursor supports remote-OAuth MCP servers, same paste-URL flow as Claude — no terminal needed.",
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
id: "claude-code",
|
|
84
|
+
label: "Claude Code",
|
|
85
|
+
intro: "In your terminal, run:",
|
|
86
|
+
commandTemplate: "claude mcp add --transport http {serverId} {mcpUrl}",
|
|
87
|
+
action: { kind: "copy", label: "Copy command" },
|
|
88
|
+
note: "Then inside Claude Code type /mcp, choose {serverId}, and click Authenticate. Claude completes the OAuth flow itself — no static token needed.",
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
id: "codex",
|
|
92
|
+
label: "Codex",
|
|
93
|
+
intro: "In your terminal, run:",
|
|
94
|
+
commandTemplate: "npx @agent-native/core@latest connect {appUrl}",
|
|
95
|
+
action: { kind: "copy", label: "Copy command" },
|
|
96
|
+
note: "Opens this page in your browser and writes Codex's ~/.codex/config.toml automatically. The same command works for Claude Cowork and Goose.",
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
id: "other",
|
|
100
|
+
label: "Other",
|
|
101
|
+
intro:
|
|
102
|
+
"Any MCP-compatible client with remote-OAuth support: paste the MCP URL above. For clients without OAuth, paste this .mcp.json snippet and generate a static bearer below:",
|
|
103
|
+
configTemplate: `{
|
|
104
|
+
"mcpServers": {
|
|
105
|
+
"{serverId}": {
|
|
106
|
+
"type": "http",
|
|
107
|
+
"url": "{mcpUrl}"
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}`,
|
|
111
|
+
action: { kind: "copy", label: "Copy config" },
|
|
112
|
+
},
|
|
113
|
+
] as const;
|
|
114
|
+
|
|
115
|
+
export const MCP_STATIC_TOKEN_FALLBACK = {
|
|
116
|
+
title: "Generate a static token",
|
|
117
|
+
state: "Advanced — clients without OAuth",
|
|
118
|
+
resultTitle: "Connection token created",
|
|
119
|
+
resultCopy:
|
|
120
|
+
"Paste this into your agent's MCP config. The token is shown only once.",
|
|
121
|
+
} as const;
|
|
122
|
+
|
|
123
|
+
export function interpolateMcpConnectTemplate(
|
|
124
|
+
template: string,
|
|
125
|
+
values: McpConnectTemplateValues,
|
|
126
|
+
): string {
|
|
127
|
+
return template.replace(/\{(appName|appUrl|mcpUrl|serverId)\}/g, (_, key) => {
|
|
128
|
+
return values[key as keyof McpConnectTemplateValues];
|
|
129
|
+
});
|
|
130
|
+
}
|
|
@@ -74,6 +74,17 @@ export default function IndexPage() {
|
|
|
74
74
|
{t("home.settingsDescription")}
|
|
75
75
|
</p>
|
|
76
76
|
</Link>
|
|
77
|
+
<Link
|
|
78
|
+
to="/agent"
|
|
79
|
+
className="group rounded-lg border border-border/50 px-4 py-3 hover:bg-accent/50 transition-colors"
|
|
80
|
+
>
|
|
81
|
+
<p className="text-[13px] font-medium text-foreground">
|
|
82
|
+
{t("settings.agentTitle")}
|
|
83
|
+
</p>
|
|
84
|
+
<p className="text-[12px] text-muted-foreground mt-0.5">
|
|
85
|
+
{t("settings.agentDescription")}
|
|
86
|
+
</p>
|
|
87
|
+
</Link>
|
|
77
88
|
</div>
|
|
78
89
|
</div>
|
|
79
90
|
</div>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { AgentTabsPage, useT } from "@agent-native/core/client";
|
|
2
|
+
import { Link } from "react-router";
|
|
3
|
+
|
|
4
|
+
export function meta() {
|
|
5
|
+
return [{ title: "Agent - {{APP_TITLE}}" }];
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export default function AgentPage() {
|
|
9
|
+
const t = useT();
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<main className="min-h-screen bg-background px-6 py-10">
|
|
13
|
+
<div className="mx-auto w-full max-w-5xl space-y-6">
|
|
14
|
+
<div className="space-y-2">
|
|
15
|
+
<Link
|
|
16
|
+
to="/settings"
|
|
17
|
+
className="text-[13px] text-muted-foreground hover:text-foreground"
|
|
18
|
+
>
|
|
19
|
+
{t("settings.title")}
|
|
20
|
+
</Link>
|
|
21
|
+
<h1 className="text-2xl font-semibold tracking-tight text-foreground">
|
|
22
|
+
{t("settings.agentTitle")}
|
|
23
|
+
</h1>
|
|
24
|
+
<p className="text-[14px] leading-relaxed text-muted-foreground">
|
|
25
|
+
{t("settings.agentDescription")}
|
|
26
|
+
</p>
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
<AgentTabsPage className="min-h-[640px] rounded-lg border border-border/50" />
|
|
30
|
+
</div>
|
|
31
|
+
</main>
|
|
32
|
+
);
|
|
33
|
+
}
|
package/corpus/core/src/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md
CHANGED
|
@@ -57,6 +57,12 @@ in the moment of agent use.
|
|
|
57
57
|
missing-secret states, OAuth grants, and provider connection health.
|
|
58
58
|
- **Agent UX kit**: sidebar, composer, staged context, mentions, voice, human
|
|
59
59
|
approval, generative UI, progress, and screen-state exposure.
|
|
60
|
+
- **Agent page kit**: the full-page `/agent` surface (`AgentTabsPage` from
|
|
61
|
+
`@agent-native/core/client`) with Context, Files, Connections, Jobs, and
|
|
62
|
+
Access tabs plus a Personal/Organization scope toggle. The canonical home
|
|
63
|
+
for context transparency, MCP servers, A2A remote agents, recurring
|
|
64
|
+
jobs/automations, and external-client connect flows. See the `agent-page`
|
|
65
|
+
skill.
|
|
60
66
|
- **History and recovery kit**: audit log, activity feed, version history,
|
|
61
67
|
checkpoints, undo, redo, restore, and proof-of-done.
|
|
62
68
|
- **Comments and review kit**: anchored comments, pins, mentions, review
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: agent-page
|
|
3
|
+
description: >-
|
|
4
|
+
The full-page Agent surface (/agent) with Context, Files, Connections, Jobs,
|
|
5
|
+
and Access tabs. Use when mounting the Agent page in a template, adding an
|
|
6
|
+
app-specific tab, surfacing context transparency, MCP servers, A2A agents,
|
|
7
|
+
recurring jobs, or external-client connect flows in the UI.
|
|
8
|
+
metadata:
|
|
9
|
+
internal: true
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Agent Page
|
|
13
|
+
|
|
14
|
+
`AgentTabsPage` (from `@agent-native/core/client`, source
|
|
15
|
+
`packages/core/src/client/agent-page/`) is the canonical full-page surface for
|
|
16
|
+
everything that can influence the agent. Design principles:
|
|
17
|
+
|
|
18
|
+
- The page answers "what can influence this agent, and why" — it is not a
|
|
19
|
+
generic admin console.
|
|
20
|
+
- Capability and access stay separate: **Connections** is what this agent can
|
|
21
|
+
reach; **Access** is who can reach this agent.
|
|
22
|
+
- It is a thin shell that re-hosts existing components (ResourcesPanel, MCP
|
|
23
|
+
hooks, AgentsSection, context X-Ray, jobs actions) — do not re-implement
|
|
24
|
+
those surfaces inside it.
|
|
25
|
+
- Context must be inspectable, attributable, and governable — provenance and
|
|
26
|
+
governance tiers, not just a token meter.
|
|
27
|
+
|
|
28
|
+
## Tabs
|
|
29
|
+
|
|
30
|
+
| Tab | Contents |
|
|
31
|
+
| --- | --- |
|
|
32
|
+
| `context` | System-vs-conversation split meter, provenance-grouped system sections (governance tiers: required/inherited/user), live-thread manifest. Backed by `context-preview-get` / `context-manifest-get` (see `context-xray` skill). |
|
|
33
|
+
| `files` | ResourcesPanel (skills, instructions, memory, uploads) with the virtual `mcp-servers/` folder hidden (`showMcpServers={false}`). |
|
|
34
|
+
| `connections` | MCP server management (both scopes, admin-gated org writes) plus A2A remote agents this app can call. |
|
|
35
|
+
| `jobs` | Recurring jobs (personal + org) and automations (personal) with pause/resume/delete (see `recurring-jobs` skill). |
|
|
36
|
+
| `access` | Copyable MCP URL and A2A agent-card URL, per-client connect steps (Claude, ChatGPT, Cursor, Claude Code, Codex, Other) from `packages/core/src/shared/mcp-connect-content.ts` (shared with the `/mcp/connect` route — edit the shared module, never fork copy), static-token fallback link. Grants/scopes/revocation UI is future work. |
|
|
37
|
+
|
|
38
|
+
## Mounting In A Template
|
|
39
|
+
|
|
40
|
+
1. Add an `/agent` route following the template's settings-route pattern
|
|
41
|
+
(`app/routes/agent.tsx` or `_app.agent.tsx`), mounting `AgentTabsPage`.
|
|
42
|
+
CSR is fine; keep the app shell in `root.tsx` so navigation does not
|
|
43
|
+
remount it (`client-side-routing` skill).
|
|
44
|
+
2. Add an "Agent" item to primary navigation and the command palette,
|
|
45
|
+
mirroring the Settings entries. Link-first (`native-navigation` skill).
|
|
46
|
+
3. Pass `agentPageHref="/agent"` to `AgentSidebar` so the sidebar workspace
|
|
47
|
+
and settings modes link out to the full page.
|
|
48
|
+
4. Hash deep-links work out of the box: `/agent#context`, `/agent#files`,
|
|
49
|
+
`/agent#connections`, `/agent#jobs`, `/agent#access`.
|
|
50
|
+
5. App-specific additions go in `extraTabs` (same `SettingsTabItem` shape as
|
|
51
|
+
the settings page); hide built-ins only with `hiddenTabs` when a template
|
|
52
|
+
genuinely lacks the underlying capability.
|
|
53
|
+
|
|
54
|
+
## Scope
|
|
55
|
+
|
|
56
|
+
The page-level Personal/Organization toggle passes `scope` (and
|
|
57
|
+
`canManageOrg`) to every tab via `AgentPageTabProps`. Hide nothing silently:
|
|
58
|
+
if a capability is personal-only today (e.g. automations), the org view says
|
|
59
|
+
so honestly instead of faking an org variant.
|
|
@@ -20,15 +20,40 @@ counts, then lets the user or agent pin, evict, or restore individual segments.
|
|
|
20
20
|
| Action | When to use |
|
|
21
21
|
| --- | --- |
|
|
22
22
|
| `context-manifest-get` | Read the current manifest for a thread. Returns token totals, segment status, source, and whether changes are enforceable. |
|
|
23
|
+
| `context-preview-get` | Compose the would-be system context for the current user/org/app without a live thread. Returns labeled system sections with provenance, governance tier, token counts, and bounded previews. Backs the Agent page Context tab. |
|
|
23
24
|
| `context-pin` | Preserve a segment across future compaction/model calls. Use for task specs, acceptance criteria, user constraints, and other durable context. |
|
|
24
25
|
| `context-evict` | Exclude a stale or irrelevant segment from future model calls. Eviction is reversible and never deletes chat history. |
|
|
25
26
|
| `context-restore` | Undo a pin, evict, or summarize directive for a segment. |
|
|
26
27
|
| `context-report` | External hosts can report their visible context inventory. These manifests are advisory unless Agent-Native owns the emitted content. |
|
|
27
28
|
|
|
29
|
+
## System Sections
|
|
30
|
+
|
|
31
|
+
Manifests now cover the system-prompt half of context, not just conversation
|
|
32
|
+
segments. Each system section carries a `provenance` label (framework-core,
|
|
33
|
+
actions-prompt, template, enterprise-workspace-core, sql-workspace,
|
|
34
|
+
legacy-app-default, organization, personal, memory, db-schema, tools,
|
|
35
|
+
model-overlay, runtime-context) and a `governance` tier:
|
|
36
|
+
|
|
37
|
+
- `required` — framework/enterprise policy; can never be altered by the user.
|
|
38
|
+
- `inherited` — template/org/workspace instructions; managed elsewhere,
|
|
39
|
+
visible here.
|
|
40
|
+
- `user` — personal instructions and memory; editable through Files.
|
|
41
|
+
|
|
42
|
+
System sections are display-only provenance: they cannot be pinned, evicted,
|
|
43
|
+
or summarized. The persisted manifest stores source refs, scope, content
|
|
44
|
+
hashes, token counts, and bounded previews (~200 chars) — never raw prompt
|
|
45
|
+
bodies; full content stays behind the resource/access model. The in-chat
|
|
46
|
+
X-Ray panel groups these under "System", and the Agent page Context tab
|
|
47
|
+
renders the full breakdown (via `context-preview-get`) with a
|
|
48
|
+
system-vs-conversation split meter. Manifests are the latest snapshot per
|
|
49
|
+
thread; there is no per-iteration history.
|
|
50
|
+
|
|
28
51
|
## Rules
|
|
29
52
|
|
|
30
53
|
- Never evict or summarize protected segments. The manifest marks active-turn
|
|
31
54
|
user/tool/thinking context as `protected`.
|
|
55
|
+
- System sections are never evictable; required/inherited tiers are locked by
|
|
56
|
+
design — do not present controls that imply otherwise.
|
|
32
57
|
- Prefer pinning the user's task, requirements, and decisions before evicting
|
|
33
58
|
large stale tool results.
|
|
34
59
|
- Eviction excludes content from future model calls; it does not delete the
|
|
@@ -28,6 +28,13 @@ For a deliberately isolated app, add that app directly at
|
|
|
28
28
|
`https://<app>.agent-native.com/mcp` or
|
|
29
29
|
`https://<your-host>/mcp`.
|
|
30
30
|
|
|
31
|
+
In-app, the Agent page's **Access** tab (`/agent#access`, see the
|
|
32
|
+
`agent-page` skill) is the discoverable home for all of this: it shows the
|
|
33
|
+
app's copyable MCP URL and A2A agent-card URL, per-client setup steps
|
|
34
|
+
(Claude, ChatGPT, Cursor, Claude Code, Codex, Other), and links to the full
|
|
35
|
+
`/mcp/connect` page including the static-token fallback. Point users there
|
|
36
|
+
instead of dictating URLs in chat.
|
|
37
|
+
|
|
31
38
|
OAuth-capable hosts should use the standard remote MCP OAuth flow. Claude
|
|
32
39
|
connectors and Claude Code `/mcp` authentication discover the protected
|
|
33
40
|
resource, open the Agent-Native authorization page, and store their own tokens.
|
|
@@ -29,6 +29,15 @@ Recurring jobs are scheduled tasks the agent executes automatically on a cron sc
|
|
|
29
29
|
| `manage-jobs` | `list` | List all jobs and their status |
|
|
30
30
|
| `manage-jobs` | `update` | Update schedule, instructions, or toggle enabled |
|
|
31
31
|
|
|
32
|
+
## UI Surface
|
|
33
|
+
|
|
34
|
+
Users can see and manage jobs without the agent on the Agent page's Jobs tab
|
|
35
|
+
(`/agent#jobs`, `AgentJobsTab` in `packages/core/src/client/agent-page/`):
|
|
36
|
+
recurring jobs (personal and organization scope) with pause/resume/delete and
|
|
37
|
+
run status, plus automations (personal-only today). Backed by the scoped
|
|
38
|
+
list/manage actions in `packages/core/src/jobs/actions/` — direct users there
|
|
39
|
+
instead of describing job files when they just want to view or toggle jobs.
|
|
40
|
+
|
|
32
41
|
## Key Files
|
|
33
42
|
|
|
34
43
|
| File | Purpose |
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
import { defineAction } from "../../action.js";
|
|
4
|
+
import { describeCron, isValidCron, nextOccurrence } from "../../jobs/cron.js";
|
|
5
|
+
import { resourceGetByPath, resourceList } from "../../resources/store.js";
|
|
6
|
+
import { parseTriggerFrontmatter } from "../dispatcher.js";
|
|
7
|
+
|
|
8
|
+
const scopeSchema = z.enum(["personal", "organization"]);
|
|
9
|
+
|
|
10
|
+
function hasTriggerFrontmatter(content: string): boolean {
|
|
11
|
+
const header = content.match(/^---\n([\s\S]*?)\n---/m)?.[1] ?? "";
|
|
12
|
+
return /^triggerType\s*:/m.test(header);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function nextRun(
|
|
16
|
+
meta: ReturnType<typeof parseTriggerFrontmatter>["meta"],
|
|
17
|
+
): string | null {
|
|
18
|
+
if (!meta.enabled) return null;
|
|
19
|
+
if (meta.nextRun) return meta.nextRun;
|
|
20
|
+
if (
|
|
21
|
+
meta.triggerType === "schedule" &&
|
|
22
|
+
meta.schedule &&
|
|
23
|
+
isValidCron(meta.schedule)
|
|
24
|
+
) {
|
|
25
|
+
return nextOccurrence(meta.schedule).toISOString();
|
|
26
|
+
}
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface AutomationActionItem {
|
|
31
|
+
id: string;
|
|
32
|
+
name: string;
|
|
33
|
+
path: string;
|
|
34
|
+
scope: "personal" | "organization";
|
|
35
|
+
triggerType: "event" | "schedule";
|
|
36
|
+
event: string | null;
|
|
37
|
+
schedule: string | null;
|
|
38
|
+
scheduleDescription: string | null;
|
|
39
|
+
condition: string | null;
|
|
40
|
+
body: string;
|
|
41
|
+
enabled: boolean;
|
|
42
|
+
lastRun: string | null;
|
|
43
|
+
lastStatus: string | null;
|
|
44
|
+
lastError: string | null;
|
|
45
|
+
nextRun: string | null;
|
|
46
|
+
createdBy: string | null;
|
|
47
|
+
canUpdate: boolean;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export default defineAction({
|
|
51
|
+
description:
|
|
52
|
+
"List event-triggered and schedule-triggered automations in the selected scope. Automations are currently personal-only.",
|
|
53
|
+
agentTool: false,
|
|
54
|
+
schema: z.object({
|
|
55
|
+
scope: scopeSchema.default("personal"),
|
|
56
|
+
}),
|
|
57
|
+
http: { method: "GET" },
|
|
58
|
+
readOnly: true,
|
|
59
|
+
parallelSafe: true,
|
|
60
|
+
run: async ({ scope }, ctx): Promise<AutomationActionItem[]> => {
|
|
61
|
+
const userEmail = ctx?.userEmail;
|
|
62
|
+
if (!userEmail) throw new Error("Not authenticated.");
|
|
63
|
+
if (scope === "organization") return [];
|
|
64
|
+
|
|
65
|
+
const owner = userEmail;
|
|
66
|
+
const resources = await resourceList(owner, "jobs/");
|
|
67
|
+
const automations: AutomationActionItem[] = [];
|
|
68
|
+
|
|
69
|
+
for (const resource of resources) {
|
|
70
|
+
if (!resource.path.endsWith(".md") || resource.path.endsWith(".keep")) {
|
|
71
|
+
continue;
|
|
72
|
+
}
|
|
73
|
+
const full = await resourceGetByPath(owner, resource.path);
|
|
74
|
+
if (!full || !hasTriggerFrontmatter(full.content)) continue;
|
|
75
|
+
const { meta, body } = parseTriggerFrontmatter(full.content);
|
|
76
|
+
automations.push({
|
|
77
|
+
id: full.id,
|
|
78
|
+
name: resource.path.replace(/^jobs\//, "").replace(/\.md$/, ""),
|
|
79
|
+
path: resource.path,
|
|
80
|
+
scope,
|
|
81
|
+
triggerType: meta.triggerType,
|
|
82
|
+
event: meta.event ?? null,
|
|
83
|
+
schedule: meta.schedule || null,
|
|
84
|
+
scheduleDescription: meta.schedule ? describeCron(meta.schedule) : null,
|
|
85
|
+
condition: meta.condition ?? null,
|
|
86
|
+
body,
|
|
87
|
+
enabled: meta.enabled,
|
|
88
|
+
lastRun: meta.lastRun ?? null,
|
|
89
|
+
lastStatus: meta.lastStatus ?? null,
|
|
90
|
+
lastError: meta.lastError ?? null,
|
|
91
|
+
nextRun: nextRun(meta),
|
|
92
|
+
createdBy: meta.createdBy ?? null,
|
|
93
|
+
canUpdate: true,
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
return automations;
|
|
98
|
+
},
|
|
99
|
+
});
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
import { defineAction } from "../../action.js";
|
|
4
|
+
import { isValidCron, nextOccurrence } from "../../jobs/cron.js";
|
|
5
|
+
import {
|
|
6
|
+
resourceDelete,
|
|
7
|
+
resourceGetByPath,
|
|
8
|
+
resourcePut,
|
|
9
|
+
} from "../../resources/store.js";
|
|
10
|
+
import {
|
|
11
|
+
buildTriggerContent,
|
|
12
|
+
parseTriggerFrontmatter,
|
|
13
|
+
refreshEventSubscriptions,
|
|
14
|
+
} from "../dispatcher.js";
|
|
15
|
+
|
|
16
|
+
export default defineAction({
|
|
17
|
+
description:
|
|
18
|
+
"Enable, disable, or delete a personal automation from the Agent Jobs page.",
|
|
19
|
+
agentTool: false,
|
|
20
|
+
schema: z.object({
|
|
21
|
+
operation: z.enum(["update", "delete"]),
|
|
22
|
+
name: z.string().min(1),
|
|
23
|
+
scope: z.enum(["personal", "organization"]).default("personal"),
|
|
24
|
+
enabled: z.boolean().optional(),
|
|
25
|
+
}),
|
|
26
|
+
run: async ({ operation, name, scope, enabled }, ctx) => {
|
|
27
|
+
const userEmail = ctx?.userEmail;
|
|
28
|
+
if (!userEmail) throw new Error("Not authenticated.");
|
|
29
|
+
if (scope === "organization") {
|
|
30
|
+
throw Object.assign(new Error("Automations are personal today."), {
|
|
31
|
+
statusCode: 400,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
const path = `jobs/${name}.md`;
|
|
36
|
+
const resource = await resourceGetByPath(userEmail, path);
|
|
37
|
+
if (!resource) {
|
|
38
|
+
throw Object.assign(new Error(`Automation "${name}" not found.`), {
|
|
39
|
+
statusCode: 404,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
const { meta, body } = parseTriggerFrontmatter(resource.content);
|
|
43
|
+
const header = resource.content.match(/^---\n([\s\S]*?)\n---/m)?.[1] ?? "";
|
|
44
|
+
if (!/^triggerType\s*:/m.test(header)) {
|
|
45
|
+
throw Object.assign(new Error(`Automation "${name}" not found.`), {
|
|
46
|
+
statusCode: 404,
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
if (operation === "delete") {
|
|
51
|
+
await resourceDelete(resource.id);
|
|
52
|
+
await refreshEventSubscriptions();
|
|
53
|
+
return { deleted: true, name };
|
|
54
|
+
}
|
|
55
|
+
if (enabled === undefined) {
|
|
56
|
+
throw Object.assign(new Error("enabled is required for update."), {
|
|
57
|
+
statusCode: 400,
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
meta.enabled = enabled;
|
|
62
|
+
if (
|
|
63
|
+
enabled &&
|
|
64
|
+
meta.triggerType === "schedule" &&
|
|
65
|
+
meta.schedule &&
|
|
66
|
+
isValidCron(meta.schedule)
|
|
67
|
+
) {
|
|
68
|
+
meta.nextRun = nextOccurrence(meta.schedule).toISOString();
|
|
69
|
+
}
|
|
70
|
+
await resourcePut(
|
|
71
|
+
resource.owner,
|
|
72
|
+
resource.path,
|
|
73
|
+
buildTriggerContent(meta, body),
|
|
74
|
+
);
|
|
75
|
+
await refreshEventSubscriptions();
|
|
76
|
+
return { name, enabled: meta.enabled, nextRun: meta.nextRun ?? null };
|
|
77
|
+
},
|
|
78
|
+
});
|
|
@@ -23,6 +23,16 @@ import { resolveAnalyticsProviderCredential } from "../server/lib/provider-crede
|
|
|
23
23
|
|
|
24
24
|
const APP_ID = "analytics";
|
|
25
25
|
|
|
26
|
+
const BUILT_IN_FIRST_PARTY_PROVIDER = {
|
|
27
|
+
provider: "first-party",
|
|
28
|
+
label: "First-party Analytics",
|
|
29
|
+
configured: true,
|
|
30
|
+
configuredKeys: [],
|
|
31
|
+
missingRequiredKeys: [],
|
|
32
|
+
optionalKeys: [],
|
|
33
|
+
queryAction: "query-agent-native-analytics",
|
|
34
|
+
} as const;
|
|
35
|
+
|
|
26
36
|
function summarizeWorkspaceConnections(
|
|
27
37
|
providerId: string,
|
|
28
38
|
connections: SerializedWorkspaceConnection[],
|
|
@@ -58,7 +68,7 @@ async function listWorkspaceConnectionsForStatus(): Promise<{
|
|
|
58
68
|
|
|
59
69
|
export default defineAction({
|
|
60
70
|
description:
|
|
61
|
-
"List which analytics data-
|
|
71
|
+
"List which analytics data sources are available without revealing secret values. This always includes the built-in first-party Analytics event store, which is queried with `query-agent-native-analytics`; it also reports configured credentials and granted workspace connections. The `key` arg accepts exact credential names like JIRA_API_TOKEN and provider aliases like jira, pylon, bigquery, github, hubspot, gong, or slack.",
|
|
62
72
|
schema: z.object({
|
|
63
73
|
key: z
|
|
64
74
|
.string()
|
|
@@ -190,19 +200,27 @@ export default defineAction({
|
|
|
190
200
|
workspaceConnection,
|
|
191
201
|
};
|
|
192
202
|
});
|
|
193
|
-
const configuredDataSources =
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
203
|
+
const configuredDataSources = [
|
|
204
|
+
{
|
|
205
|
+
provider: BUILT_IN_FIRST_PARTY_PROVIDER.provider,
|
|
206
|
+
label: BUILT_IN_FIRST_PARTY_PROVIDER.label,
|
|
207
|
+
via: "built-in",
|
|
208
|
+
queryAction: BUILT_IN_FIRST_PARTY_PROVIDER.queryAction,
|
|
209
|
+
},
|
|
210
|
+
...providers
|
|
211
|
+
.filter((provider) => provider.configured)
|
|
212
|
+
.map((provider) => ({
|
|
213
|
+
provider: provider.provider,
|
|
214
|
+
label: provider.label,
|
|
215
|
+
via:
|
|
216
|
+
provider.configuredKeys.length > 0 &&
|
|
217
|
+
provider.workspaceConnection.grantState === "connected"
|
|
218
|
+
? "credentials-and-workspace"
|
|
219
|
+
: provider.workspaceConnection.grantState === "connected"
|
|
220
|
+
? "workspace"
|
|
221
|
+
: "credentials",
|
|
222
|
+
})),
|
|
223
|
+
];
|
|
206
224
|
return {
|
|
207
225
|
// Keep a compact, explicit summary first so models do not infer source
|
|
208
226
|
// availability from the much larger per-credential list below.
|
|
@@ -210,7 +228,7 @@ export default defineAction({
|
|
|
210
228
|
configuredDataSourceCount: configuredDataSources.length,
|
|
211
229
|
configuredDataSources,
|
|
212
230
|
credentials: results,
|
|
213
|
-
providers,
|
|
231
|
+
providers: [BUILT_IN_FIRST_PARTY_PROVIDER, ...providers],
|
|
214
232
|
total: results.length,
|
|
215
233
|
workspaceConnections: {
|
|
216
234
|
appId: APP_ID,
|
|
@@ -15,7 +15,7 @@ function resolveScope() {
|
|
|
15
15
|
|
|
16
16
|
export default defineAction({
|
|
17
17
|
description:
|
|
18
|
-
"Query first-party
|
|
18
|
+
"Query the built-in first-party Analytics source: events recorded through this app's analytics collector endpoint (/track) and session replay summaries recorded through /api/analytics/replay. This source does not require an external provider connection. Use it for questions about app/site traffic, product events, template/app usage, conversions, session recordings, LLM/agent observability, model cost, token volume, latency, and other first-party data collected by this analytics app. Use source-specific actions such as BigQuery, GA4, Mixpanel, PostHog, or Amplitude when the user asks for those sources or the relevant data lives there. SQL may read analytics_events and session_recordings only; session_replay_chunks is intentionally unavailable, and reads are automatically scoped to the current user/org. analytics_events columns include event_name, timestamp, event_date, user_id, anonymous_id, user_key, session_id, app, template, signed_in, url, path, hostname, referrer, properties, and context. LLM observability events use event_name = '$ai_generation'; useful properties include $ai_trace_id/run_id, $ai_session_id/thread_id, $ai_model/model, $ai_provider/provider, $ai_input_tokens/input_tokens, $ai_output_tokens/output_tokens, cache_read_tokens, cache_write_tokens, cost_cents_x100, $ai_total_cost_usd/cost_usd, duration_ms/$ai_latency, status, tool_calls, successful_tools, failed_tools, and error_message/$ai_error. session_recordings columns include id, session_id, user_id, anonymous_id, user_key, started_at, ended_at, duration_ms, chunk_count, event_count, page_count, error_count, rage_click_count, app, template, status, first_url, last_url, path, hostname, referrer, and metadata.",
|
|
19
19
|
schema: z.object({
|
|
20
20
|
sql: z
|
|
21
21
|
.string()
|