@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,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,GACT,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAO1C,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC1E,OAAO,EAAE,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAC/E,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,cAAc,EAA0B,MAAM,wBAAwB,CAAC;AAChF,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AAUjC,MAAM,UAAU,yBAAyB,CACvC,OAA4B;IAE5B,OAAO,OAAO,CAAC,MAAM,CACnB,CAAC,MAAM,EAAE,MAAM,EAAE,EAAE,CACjB,CAAC,MAAM,IAAI,MAAM,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,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A,EACN,eAAK,SAAS,EAAC,+BAA+B,aAC3C,YAAY,CAAC,iBAAiB,CAAC,IAAI,CAAC,WAAW,CAAC,oBAAW,GAAG,EAC9D,YAAY,CAAC,EAAE,IACZ,IACF,EACN,KAAC,YAAY,IAAC,QAAQ,EAAE,YAAY,CAAC,EAAE,GAAI,IACvC,EACN,KAAC,cAAc,IACb,QAAQ,EAAE,iBAAiB,CAAC,IAAI,CAAC,QAAQ,EACzC,cAAc,EAAE,iBAAiB,CAAC,IAAI,CAAC,cAAc,GACrD,IACE,CACP,CAAC,CAAC,CAAC,CACF,cAAK,SAAS,EAAC,6FAA6F,YACzG,CAAC,CAAC,0BAA0B,EAAE;4BAC7B,YAAY,EAAE,2CAA2C;yBAC1D,CAAC,GACE,CACP,IACO,EAEV,mBAAS,SAAS,EAAC,+DAA+D,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 @@
|
|
|
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
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AAI,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"}
|