@agent-native/core 0.131.5 → 0.131.7
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 +3 -3
- package/corpus/core/CHANGELOG.md +70 -0
- package/corpus/core/docs/content/agent-native-toolkit.mdx +13 -6
- package/corpus/core/docs/content/cloneable-saas.mdx +5 -5
- package/corpus/core/docs/content/creating-templates.mdx +9 -0
- package/corpus/core/docs/content/deployment.mdx +18 -12
- package/corpus/core/docs/content/doctor.mdx +8 -1
- package/corpus/core/docs/content/drop-in-agent.mdx +1 -1
- package/corpus/core/docs/content/extensions.mdx +18 -18
- package/corpus/core/docs/content/faq.mdx +4 -4
- package/corpus/core/docs/content/key-concepts.mdx +30 -21
- package/corpus/core/docs/content/security.mdx +2 -2
- package/corpus/core/docs/content/template-brain-developers.mdx +4 -1
- package/corpus/core/docs/content/template-mail-developers.mdx +4 -1
- package/corpus/core/docs/content/what-is-agent-native.mdx +6 -6
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/a2a/client.ts +449 -66
- package/corpus/core/src/a2a/correlation.ts +31 -0
- package/corpus/core/src/a2a/invoke.ts +4 -2
- package/corpus/core/src/a2a/types.ts +4 -0
- package/corpus/core/src/action.ts +3 -0
- package/corpus/core/src/agent/action-continuation-guidance.ts +2 -1
- package/corpus/core/src/agent/engine/registry.ts +98 -6
- package/corpus/core/src/agent/production-agent.ts +151 -18
- package/corpus/core/src/agent/run-loop-with-resume.ts +190 -3
- package/corpus/core/src/agent/run-manager.ts +117 -41
- package/corpus/core/src/agent/thread-debug-history.ts +86 -0
- package/corpus/core/src/agent/types.ts +3 -1
- package/corpus/core/src/cli/create.ts +11 -1
- package/corpus/core/src/cli/templates-meta.ts +2 -2
- package/corpus/core/src/client/agent-chat-adapter.ts +91 -13
- package/corpus/core/src/client/resources/McpIntegrationDialog.tsx +11 -9
- package/corpus/core/src/client/sse-event-processor.ts +17 -3
- package/corpus/core/src/db/client.ts +57 -17
- package/corpus/core/src/guards/no-env-credentials.ts +2 -0
- package/corpus/core/src/integrations/adapters/slack.ts +8 -3
- package/corpus/core/src/localization/default-messages.ts +44 -0
- package/corpus/core/src/observability/traces.ts +78 -5
- package/corpus/core/src/scripts/call-agent.ts +294 -11
- package/corpus/core/src/scripts/describe-workspace-apps.ts +2 -2
- package/corpus/core/src/secrets/crypto.ts +156 -35
- package/corpus/core/src/secrets/storage.ts +64 -26
- package/corpus/core/src/server/agent-capabilities.ts +1 -1
- package/corpus/core/src/server/agent-chat/action-filters-a2a.ts +113 -7
- package/corpus/core/src/server/agent-chat/context-tools.ts +2 -0
- package/corpus/core/src/server/agent-chat/plugin-options.ts +34 -1
- package/corpus/core/src/server/agent-chat/prompt-resources.ts +1 -1
- package/corpus/core/src/server/agent-chat-plugin.ts +91 -59
- package/corpus/core/src/templates/default/.agents/skills/secrets/SKILL.md +19 -7
- package/corpus/core/src/templates/headless/.agents/skills/secrets/SKILL.md +19 -7
- package/corpus/core/src/templates/workspace-core/.agents/skills/a2a-protocol/SKILL.md +18 -7
- package/corpus/core/src/templates/workspace-core/.agents/skills/composable-mini-apps/SKILL.md +15 -14
- package/corpus/core/src/templates/workspace-core/.agents/skills/secrets/SKILL.md +19 -7
- package/corpus/core/src/vite/client.ts +1 -0
- package/corpus/templates/analytics/.agents/skills/dashboard-ops/SKILL.md +5 -4
- package/corpus/templates/analytics/.agents/skills/gong/SKILL.md +6 -4
- package/corpus/templates/analytics/AGENTS.md +7 -4
- package/corpus/templates/analytics/actions/query-agent-native-analytics.ts +4 -3
- package/corpus/templates/analytics/changelog/2026-07-30-delegated-analytics-questions-now-return-a-useful-current-me.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-30-scheduled-dashboard-emails-complete-every-panel-without-pool.md +6 -0
- package/corpus/templates/analytics/scripts/emit-netlify-dashboard-report-cron.ts +28 -1
- package/corpus/templates/analytics/server/jobs/dashboard-report.ts +18 -11
- package/corpus/templates/analytics/server/lib/analytics-connector-catalog.ts +4 -4
- package/corpus/templates/analytics/server/lib/canonical-first-party-dashboard-repair.ts +9 -5
- package/corpus/templates/analytics/server/lib/dashboard-panel-query.ts +6 -2
- package/corpus/templates/analytics/server/lib/dashboard-panel-source-resolver.ts +11 -4
- package/corpus/templates/analytics/server/lib/dashboard-report-render.ts +49 -31
- package/corpus/templates/analytics/server/lib/first-party-analytics.ts +16 -8
- package/corpus/templates/analytics/server/lib/first-party-metric-catalog.ts +9 -3
- package/corpus/templates/analytics/server/lib/production-serverless-runtime.ts +11 -0
- package/corpus/templates/analytics/server/lib/real-data-actions.ts +10 -0
- package/corpus/templates/analytics/server/plugins/agent-chat.ts +3 -2
- package/corpus/templates/analytics/server/plugins/analytics-alert-jobs.ts +2 -1
- package/corpus/templates/analytics/server/plugins/dashboard-report-jobs.ts +2 -1
- package/corpus/templates/analytics/server/plugins/uptime-monitor-jobs.ts +1 -12
- package/corpus/templates/brain/.agents/skills/brain/RUNBOOK.md +54 -6
- package/corpus/templates/brain/.agents/skills/brain/SKILL.md +20 -9
- package/corpus/templates/brain/.agents/skills/ingestion-and-connectors/SKILL.md +33 -1
- package/corpus/templates/brain/AGENTS.md +3 -1
- package/corpus/templates/brain/README.md +4 -1
- package/corpus/templates/brain/actions/_schemas.ts +30 -8
- package/corpus/templates/brain/actions/ask-brain.ts +124 -14
- package/corpus/templates/brain/actions/create-source.ts +18 -2
- package/corpus/templates/brain/actions/enqueue-captures-distillation.ts +8 -123
- package/corpus/templates/brain/actions/enqueue-distillation.ts +6 -127
- package/corpus/templates/brain/actions/import-capture.ts +17 -5
- package/corpus/templates/brain/actions/import-transcript.ts +17 -5
- package/corpus/templates/brain/actions/update-source.ts +25 -5
- package/corpus/templates/brain/app/components/layout/Sidebar.tsx +1 -1
- package/corpus/templates/brain/changelog/2026-07-30-blessed-resources-can-feed-cited-company-answers.md +6 -0
- package/corpus/templates/brain/changelog/2026-07-30-the-left-sidebar-no-longer-shows-a-blank-organization-placeh.md +6 -0
- package/corpus/templates/brain/server/lib/brain.ts +49 -19
- package/corpus/templates/brain/server/lib/distillation-queue.ts +147 -0
- package/corpus/templates/brain/server/lib/source-policy.ts +264 -0
- package/corpus/templates/brain/server/plugins/agent-chat.ts +3 -2
- package/corpus/templates/brain/server/routes/api/_agent-native/brain/ingest.post.ts +116 -19
- package/corpus/templates/clips/app/components/meetings/google-oauth-identity-notice.tsx +51 -0
- package/corpus/templates/clips/app/i18n/en-US.ts +4 -0
- package/corpus/templates/clips/app/routes/_app.meetings._index.tsx +3 -1
- package/corpus/templates/clips/changelog/2026-07-30-google-calendar-warning.md +6 -0
- package/corpus/templates/content/app/components/editor/VisualEditor.tsx +72 -8
- package/corpus/templates/content/changelog/2026-07-30-the-slash-command-hint-now-stays-on-only-the-active-empty-li.md +6 -0
- package/corpus/templates/design/.generated/bridge/editor-chrome.generated.ts +506 -11
- package/corpus/templates/design/app/components/design/bridge/editor-chrome.bridge.ts +148 -17
- package/corpus/templates/design/app/components/design/canvas-interactions/design-canvas-interactions.ts +357 -0
- package/corpus/templates/design/app/components/design/inspector/ScrubInput.tsx +7 -466
- package/corpus/templates/design/app/components/design/inspector/scrub-input-utils.ts +15 -311
- package/corpus/templates/design/app/components/visual-editor/CanvasCommentPins.tsx +19 -997
- package/corpus/templates/design/app/components/visual-editor/DrawOverlay.tsx +8 -1216
- package/corpus/templates/design/app/hooks/useDesignHotkeys.ts +31 -38
- package/corpus/templates/design/package.json +0 -1
- package/corpus/templates/dispatch/AGENTS.md +8 -0
- package/corpus/templates/dispatch/DEVELOPING.md +29 -0
- package/corpus/templates/dispatch/actions/view-screen.ts +34 -2
- package/corpus/templates/dispatch/app/i18n-data.ts +457 -0
- package/corpus/templates/dispatch/changelog/2026-07-30-delegated-dispatch-work-continues-reliably-in-the-background.md +6 -0
- package/corpus/templates/dispatch/changelog/2026-07-30-find-failed-runs-across-apps.md +6 -0
- package/corpus/templates/dispatch/netlify.toml +3 -0
- package/corpus/templates/plan/actions/get-visual-plan.ts +10 -6
- package/corpus/templates/plan/actions/patch-visual-plan-source.ts +117 -1
- package/corpus/templates/plan/actions/update-visual-plan.ts +56 -14
- package/corpus/templates/plan/app/pages/PlansPage.tsx +1 -1
- package/corpus/templates/plan/changelog/2026-07-30-plan-agents-recover-with-targeted-writes.md +6 -0
- package/corpus/templates/plan/shared/plan-content.ts +35 -0
- package/corpus/templates/slides/.agents/skills/analytics-data-for-decks/SKILL.md +8 -12
- package/corpus/templates/slides/AGENTS.md +4 -4
- package/corpus/templates/slides/actions/create-deck.ts +1 -1
- package/corpus/templates/slides/actions/duplicate-deck.ts +19 -4
- package/corpus/templates/slides/app/components/deck/DeckCard.tsx +2 -10
- package/corpus/templates/slides/app/components/deck/MermaidRenderer.tsx +12 -1
- package/corpus/templates/slides/app/components/deck/SlideRenderer.tsx +30 -13
- package/corpus/templates/slides/app/components/editor/DeckEditorSkeleton.tsx +35 -0
- package/corpus/templates/slides/app/components/editor/EditorSidebar.tsx +63 -56
- package/corpus/templates/slides/app/components/editor/EditorToolbar.tsx +21 -76
- package/corpus/templates/slides/app/components/editor/SlideEditor.tsx +1110 -292
- package/corpus/templates/slides/app/components/editor/SlideOverflowWarning.tsx +53 -0
- package/corpus/templates/slides/app/components/editor/SlideStyleInspector.tsx +235 -18
- package/corpus/templates/slides/app/components/editor/SpeakerNotesPanel.tsx +4 -1
- package/corpus/templates/slides/app/components/editor/canvas-interactions/index.ts +11 -0
- package/corpus/templates/slides/app/components/editor/canvas-interactions/slides-canvas-adapter.ts +129 -0
- package/corpus/templates/slides/app/components/editor/selection-overlay-measurement.ts +70 -0
- package/corpus/templates/slides/app/components/editor/slide-object-interactions.ts +519 -65
- package/corpus/templates/slides/app/components/visual-editor/CanvasCommentPins.tsx +36 -426
- package/corpus/templates/slides/app/components/visual-editor/DrawOverlay.tsx +19 -458
- package/corpus/templates/slides/app/context/DeckContext.tsx +179 -72
- package/corpus/templates/slides/app/global.css +105 -0
- package/corpus/templates/slides/app/i18n/en-US.ts +8 -0
- package/corpus/templates/slides/app/lib/deck-editor-loading.ts +26 -0
- package/corpus/templates/slides/app/lib/mermaid-blocks.ts +27 -0
- package/corpus/templates/slides/app/pages/DeckEditor.tsx +71 -38
- package/corpus/templates/slides/app/pages/Index.tsx +98 -41
- package/corpus/templates/slides/changelog/2026-07-30-deck-loading-no-longer-flashes-an-unavailable-message.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-30-duplicating-a-deck-from-the-deck-list-now-opens-the-copy-imm.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-30-layout-overflow-warning-is-readable-and-dismissible.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-30-new-decks-now-start-with-an-empty-slide-list-when-no-slides-.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-30-shared-canvas-annotations.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-30-slide-objects-can-be-moved-as-a-group-copied-and-pasted-with.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-30-slide-text-editing-and-object-controls-now-match-google-slides.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-30-style-panel-now-scrolls-with-speaker-notes-open-shows-the-sl.md +6 -0
- package/corpus/templates/slides/changelog/2026-07-30-top-toolbar-controls-now-use-consistent-sizing-with-undo-and.md +6 -0
- package/corpus/templates/slides/netlify.toml +3 -1
- package/corpus/templates/slides/package.json +0 -1
- package/corpus/templates/slides/server/lib/chat-attachments.ts +18 -0
- package/corpus/templates/slides/server/plugins/agent-chat.ts +5 -0
- package/corpus/templates/slides/vite.config.ts +0 -1
- package/corpus/toolkit/CHANGELOG.md +13 -0
- package/corpus/toolkit/README.md +19 -0
- package/corpus/toolkit/agent-native.eject.json +38 -0
- package/corpus/toolkit/package.json +29 -1
- package/corpus/toolkit/src/canvas-annotations/CanvasCommentPins.tsx +861 -0
- package/corpus/toolkit/src/canvas-annotations/DrawOverlay.tsx +1233 -0
- package/corpus/toolkit/src/canvas-annotations/index.ts +15 -0
- package/corpus/toolkit/src/canvas-annotations/types.ts +14 -0
- package/corpus/toolkit/src/canvas-interactions/canvas-interactions.ts +933 -0
- package/corpus/toolkit/src/canvas-interactions/index.ts +67 -0
- package/corpus/toolkit/src/design-tweaks/scrub-input-utils.ts +311 -0
- package/corpus/toolkit/src/design-tweaks/scrub-input.tsx +491 -0
- package/corpus/toolkit/src/design-tweaks/visual-style-controls.tsx +26 -171
- package/corpus/toolkit/src/index.ts +1 -0
- package/dist/a2a/client.d.ts +23 -0
- package/dist/a2a/client.d.ts.map +1 -1
- package/dist/a2a/client.js +309 -44
- package/dist/a2a/client.js.map +1 -1
- package/dist/a2a/correlation.d.ts +1 -0
- package/dist/a2a/correlation.d.ts.map +1 -1
- package/dist/a2a/correlation.js +27 -0
- package/dist/a2a/correlation.js.map +1 -1
- package/dist/a2a/invoke.d.ts.map +1 -1
- package/dist/a2a/invoke.js +4 -2
- package/dist/a2a/invoke.js.map +1 -1
- package/dist/a2a/types.d.ts +4 -0
- package/dist/a2a/types.d.ts.map +1 -1
- package/dist/a2a/types.js.map +1 -1
- package/dist/action.d.ts +3 -0
- package/dist/action.d.ts.map +1 -1
- package/dist/action.js.map +1 -1
- package/dist/agent/action-continuation-guidance.d.ts.map +1 -1
- package/dist/agent/action-continuation-guidance.js +2 -1
- package/dist/agent/action-continuation-guidance.js.map +1 -1
- package/dist/agent/engine/registry.d.ts.map +1 -1
- package/dist/agent/engine/registry.js +82 -8
- package/dist/agent/engine/registry.js.map +1 -1
- package/dist/agent/production-agent.d.ts +40 -1
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +113 -15
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/agent/run-loop-with-resume.d.ts +21 -0
- package/dist/agent/run-loop-with-resume.d.ts.map +1 -1
- package/dist/agent/run-loop-with-resume.js +163 -4
- package/dist/agent/run-loop-with-resume.js.map +1 -1
- package/dist/agent/run-manager.d.ts +16 -9
- package/dist/agent/run-manager.d.ts.map +1 -1
- package/dist/agent/run-manager.js +93 -42
- package/dist/agent/run-manager.js.map +1 -1
- package/dist/agent/thread-debug-history.d.ts +10 -0
- package/dist/agent/thread-debug-history.d.ts.map +1 -0
- package/dist/agent/thread-debug-history.js +68 -0
- package/dist/agent/thread-debug-history.js.map +1 -0
- package/dist/agent/types.d.ts +3 -1
- package/dist/agent/types.d.ts.map +1 -1
- package/dist/agent/types.js.map +1 -1
- package/dist/cli/create.d.ts.map +1 -1
- package/dist/cli/create.js +6 -1
- package/dist/cli/create.js.map +1 -1
- package/dist/cli/templates-meta.js +2 -2
- package/dist/cli/templates-meta.js.map +1 -1
- package/dist/client/agent-chat-adapter.d.ts +1 -1
- package/dist/client/agent-chat-adapter.d.ts.map +1 -1
- package/dist/client/agent-chat-adapter.js +76 -13
- package/dist/client/agent-chat-adapter.js.map +1 -1
- package/dist/client/resources/McpIntegrationDialog.d.ts.map +1 -1
- package/dist/client/resources/McpIntegrationDialog.js +1 -1
- package/dist/client/resources/McpIntegrationDialog.js.map +1 -1
- package/dist/client/sse-event-processor.d.ts.map +1 -1
- package/dist/client/sse-event-processor.js +12 -3
- package/dist/client/sse-event-processor.js.map +1 -1
- package/dist/collab/routes.d.ts +1 -1
- package/dist/db/client.d.ts.map +1 -1
- package/dist/db/client.js +48 -17
- package/dist/db/client.js.map +1 -1
- package/dist/guards/no-env-credentials.d.ts.map +1 -1
- package/dist/guards/no-env-credentials.js +2 -0
- package/dist/guards/no-env-credentials.js.map +1 -1
- package/dist/integrations/adapters/slack.js +7 -3
- package/dist/integrations/adapters/slack.js.map +1 -1
- package/dist/localization/default-messages.d.ts +43 -0
- package/dist/localization/default-messages.d.ts.map +1 -1
- package/dist/localization/default-messages.js +43 -0
- package/dist/localization/default-messages.js.map +1 -1
- package/dist/observability/traces.d.ts +3 -1
- package/dist/observability/traces.d.ts.map +1 -1
- package/dist/observability/traces.js +73 -4
- package/dist/observability/traces.js.map +1 -1
- package/dist/progress/routes.d.ts +1 -1
- package/dist/provider-api/actions/custom-provider-registration.d.ts +12 -12
- package/dist/provider-api/actions/provider-api.d.ts +13 -13
- package/dist/provider-api/corpus-jobs.d.ts +2 -2
- package/dist/scripts/call-agent.d.ts.map +1 -1
- package/dist/scripts/call-agent.js +237 -12
- package/dist/scripts/call-agent.js.map +1 -1
- package/dist/scripts/describe-workspace-apps.js +2 -2
- package/dist/scripts/describe-workspace-apps.js.map +1 -1
- package/dist/secrets/crypto.d.ts +36 -21
- package/dist/secrets/crypto.d.ts.map +1 -1
- package/dist/secrets/crypto.js +134 -33
- package/dist/secrets/crypto.js.map +1 -1
- package/dist/secrets/storage.d.ts +6 -6
- package/dist/secrets/storage.d.ts.map +1 -1
- package/dist/secrets/storage.js +43 -26
- package/dist/secrets/storage.js.map +1 -1
- package/dist/server/agent-capabilities.js +1 -1
- package/dist/server/agent-capabilities.js.map +1 -1
- package/dist/server/agent-chat/action-filters-a2a.d.ts +17 -3
- package/dist/server/agent-chat/action-filters-a2a.d.ts.map +1 -1
- package/dist/server/agent-chat/action-filters-a2a.js +94 -3
- package/dist/server/agent-chat/action-filters-a2a.js.map +1 -1
- package/dist/server/agent-chat/context-tools.d.ts.map +1 -1
- package/dist/server/agent-chat/context-tools.js +2 -0
- package/dist/server/agent-chat/context-tools.js.map +1 -1
- package/dist/server/agent-chat/plugin-options.d.ts +23 -0
- package/dist/server/agent-chat/plugin-options.d.ts.map +1 -1
- package/dist/server/agent-chat/plugin-options.js +4 -1
- package/dist/server/agent-chat/plugin-options.js.map +1 -1
- package/dist/server/agent-chat/prompt-resources.js +1 -1
- package/dist/server/agent-chat/prompt-resources.js.map +1 -1
- package/dist/server/agent-chat-plugin.d.ts +2 -1
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +79 -56
- package/dist/server/agent-chat-plugin.js.map +1 -1
- package/dist/server/realtime-token.d.ts +1 -1
- package/dist/templates/default/.agents/skills/secrets/SKILL.md +19 -7
- package/dist/templates/headless/.agents/skills/secrets/SKILL.md +19 -7
- package/dist/templates/workspace-core/.agents/skills/a2a-protocol/SKILL.md +18 -7
- package/dist/templates/workspace-core/.agents/skills/composable-mini-apps/SKILL.md +15 -14
- package/dist/templates/workspace-core/.agents/skills/secrets/SKILL.md +19 -7
- package/dist/vite/client.d.ts.map +1 -1
- package/dist/vite/client.js +1 -0
- package/dist/vite/client.js.map +1 -1
- package/docs/content/agent-native-toolkit.mdx +13 -6
- package/docs/content/cloneable-saas.mdx +5 -5
- package/docs/content/creating-templates.mdx +9 -0
- package/docs/content/deployment.mdx +18 -12
- package/docs/content/doctor.mdx +8 -1
- package/docs/content/drop-in-agent.mdx +1 -1
- package/docs/content/extensions.mdx +18 -18
- package/docs/content/faq.mdx +4 -4
- package/docs/content/key-concepts.mdx +30 -21
- package/docs/content/security.mdx +2 -2
- package/docs/content/template-brain-developers.mdx +4 -1
- package/docs/content/template-mail-developers.mdx +4 -1
- package/docs/content/what-is-agent-native.mdx +6 -6
- package/package.json +3 -3
- package/src/a2a/client.ts +449 -66
- package/src/a2a/correlation.ts +31 -0
- package/src/a2a/invoke.ts +4 -2
- package/src/a2a/types.ts +4 -0
- package/src/action.ts +3 -0
- package/src/agent/action-continuation-guidance.ts +2 -1
- package/src/agent/engine/registry.ts +98 -6
- package/src/agent/production-agent.ts +151 -18
- package/src/agent/run-loop-with-resume.ts +190 -3
- package/src/agent/run-manager.ts +117 -41
- package/src/agent/thread-debug-history.ts +86 -0
- package/src/agent/types.ts +3 -1
- package/src/cli/create.ts +11 -1
- package/src/cli/templates-meta.ts +2 -2
- package/src/client/agent-chat-adapter.ts +91 -13
- package/src/client/resources/McpIntegrationDialog.tsx +11 -9
- package/src/client/sse-event-processor.ts +17 -3
- package/src/db/client.ts +57 -17
- package/src/guards/no-env-credentials.ts +2 -0
- package/src/integrations/adapters/slack.ts +8 -3
- package/src/localization/default-messages.ts +44 -0
- package/src/observability/traces.ts +78 -5
- package/src/scripts/call-agent.ts +294 -11
- package/src/scripts/describe-workspace-apps.ts +2 -2
- package/src/secrets/crypto.ts +156 -35
- package/src/secrets/storage.ts +64 -26
- package/src/server/agent-capabilities.ts +1 -1
- package/src/server/agent-chat/action-filters-a2a.ts +113 -7
- package/src/server/agent-chat/context-tools.ts +2 -0
- package/src/server/agent-chat/plugin-options.ts +34 -1
- package/src/server/agent-chat/prompt-resources.ts +1 -1
- package/src/server/agent-chat-plugin.ts +91 -59
- package/src/templates/default/.agents/skills/secrets/SKILL.md +19 -7
- package/src/templates/headless/.agents/skills/secrets/SKILL.md +19 -7
- package/src/templates/workspace-core/.agents/skills/a2a-protocol/SKILL.md +18 -7
- package/src/templates/workspace-core/.agents/skills/composable-mini-apps/SKILL.md +15 -14
- package/src/templates/workspace-core/.agents/skills/secrets/SKILL.md +19 -7
- package/src/vite/client.ts +1 -0
|
@@ -5,7 +5,6 @@ import { applyA2AAgentActivityEvent, buildA2AAgentActivityPart, createA2AAgentAc
|
|
|
5
5
|
import { appendA2AArtifactLinks, buildA2ARecoverableArtifactMessage, } from "../a2a/artifact-response.js";
|
|
6
6
|
import { hasConfiguredA2ASecret, isLoopbackAddress, isTrustedLocalRuntime, } from "../a2a/auth-policy.js";
|
|
7
7
|
import { sanitizeA2ACorrelationId, sanitizeA2ACorrelationMetadata, } from "../a2a/correlation.js";
|
|
8
|
-
import { applyAgentTextEventToBuffer } from "../a2a/response-text.js";
|
|
9
8
|
import { createA2AApproval, updateTaskStatusMessage, } from "../a2a/task-store.js";
|
|
10
9
|
import { canUpdateAgentAppModelDefaultSettings, normalizeAgentAppModelDefaultAppId, readAgentAppModelDefaultSettings, resetAgentAppModelDefaultSettings, writeAgentAppModelDefaultSettings, } from "../agent/app-model-defaults.js";
|
|
11
10
|
import { DEFAULT_ANTHROPIC_MODEL } from "../agent/default-model.js";
|
|
@@ -17,6 +16,7 @@ import { callerHasRunAccess, callerHasThreadAccess, } from "../agent/run-ownersh
|
|
|
17
16
|
import { markTurnAborted, readBackgroundRunClaim } from "../agent/run-store.js";
|
|
18
17
|
import { buildCurrentTimeUserContext, buildRuntimeContextPrompt, } from "../agent/runtime-context.js";
|
|
19
18
|
import { buildAssistantMessage, buildUserMessage, claimQueuedMessage, extractThreadMeta, foldAssistantTurn, hasClaimedQueuedMessage, mergeThreadDataForClientSave, upsertUserMessage, } from "../agent/thread-data-builder.js";
|
|
19
|
+
import { appendThreadDebugHistory } from "../agent/thread-debug-history.js";
|
|
20
20
|
import { attachToolSearch } from "../agent/tool-search.js";
|
|
21
21
|
import { readAppStateForCurrentTab } from "../application-state/script-helpers.js";
|
|
22
22
|
import { runChatThreadDataMigrations } from "../chat-threads/migrations.js";
|
|
@@ -102,10 +102,11 @@ import { buildSystemManifestSections, setContextXraySystemSections, } from "../a
|
|
|
102
102
|
// the ones that were already part of the public surface) so
|
|
103
103
|
// `createAgentChatPlugin` below stays a thinner orchestrator.
|
|
104
104
|
// ---------------------------------------------------------------------------
|
|
105
|
-
import { createA2AEngineToolSurface, filterAgentTools, filterPublicAgentActions, filterDirectA2AActions, filterReadOnlyActions, resolveInitialToolNames, runA2AAgentLoop, runMCPAgentLoop, assembleA2AFinalResponse, buildPublicAgentA2ASkills, buildAuthenticatedAgentA2ASkills, resolveArtifactBaseUrl, } from "./agent-chat/action-filters-a2a.js";
|
|
105
|
+
import { createA2AEngineToolSurface, DEFAULT_DELEGATED_MAX_ITERATIONS, DEFAULT_DELEGATED_MAX_RUN_INPUT_TOKENS, DEFAULT_DELEGATED_MAX_TOOL_RESULT_CHARS, filterAgentTools, filterPublicAgentActions, filterDirectA2AActions, filterReadOnlyActions, resolveInitialToolNames, runA2AAgentLoop, runMCPAgentLoop, assembleA2AFinalResponse, buildPublicAgentA2ASkills, buildAuthenticatedAgentA2ASkills, resolveArtifactBaseUrl, } from "./agent-chat/action-filters-a2a.js";
|
|
106
106
|
import { createBuilderBrowserTool, createTeamTools, } from "./agent-chat/browser-team-tools.js";
|
|
107
107
|
import { createDataWidgetActionEntries, createFrameworkContextEntry, createRefreshScreenEntry, createUrlTools, } from "./agent-chat/context-tools.js";
|
|
108
108
|
import { _agentChatPromptSectionsForTests, buildFrameworkPrompts, buildSchemaBlock, collectFiles, corpusToolNamesTaughtByPrompt, generateActionsPrompt, generateCorpusToolsPrompt, } from "./agent-chat/framework-prompts.js";
|
|
109
|
+
import { resolveA2AAgentDelegationEnabled, } from "./agent-chat/plugin-options.js";
|
|
109
110
|
import { finalizeClaimedAgentChatProcessRunFailure } from "./agent-chat/process-run-failure.js";
|
|
110
111
|
import { loadResourcesForPrompt, promptResourceManifestSections, resourceScopeForOwner, } from "./agent-chat/prompt-resources.js";
|
|
111
112
|
import { shouldDisableRecurringJobsRuntime } from "./agent-chat/recurring-jobs-runtime.js";
|
|
@@ -120,6 +121,7 @@ export { assembleA2AFinalResponse };
|
|
|
120
121
|
export { runA2AAgentLoop };
|
|
121
122
|
export { runMCPAgentLoop };
|
|
122
123
|
export { createA2AEngineToolSurface };
|
|
124
|
+
export { DEFAULT_DELEGATED_MAX_ITERATIONS, DEFAULT_DELEGATED_MAX_RUN_INPUT_TOKENS, DEFAULT_DELEGATED_MAX_TOOL_RESULT_CHARS, };
|
|
123
125
|
export { shouldBlockInProductCodeEditingSurface };
|
|
124
126
|
export { loadRunCodeToolEntries };
|
|
125
127
|
export { shouldDisableRecurringJobsRuntime };
|
|
@@ -248,6 +250,7 @@ export function createAgentChatPlugin(options) {
|
|
|
248
250
|
const canToggle = (env === "development" || env === "test") &&
|
|
249
251
|
process.env.AGENT_MODE !== "production";
|
|
250
252
|
const routePath = options?.path ?? "/_agent-native/agent-chat";
|
|
253
|
+
const a2aAgentDelegationEnabled = resolveA2AAgentDelegationEnabled(options);
|
|
251
254
|
// Mutable mode flag — persisted to the `settings` table so a user who
|
|
252
255
|
// toggles to "Production" stays in prod mode across server restarts.
|
|
253
256
|
// Hoisted here (before any tool-registry / handler closures are built)
|
|
@@ -1224,34 +1227,41 @@ export function createAgentChatPlugin(options) {
|
|
|
1224
1227
|
// a day rollover (or the resources/extra content changing) only
|
|
1225
1228
|
// invalidates the cached prompt prefix as late as possible.
|
|
1226
1229
|
const runtimeContext = runtimeContextForEvent(context.event);
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
schemaBlock +
|
|
1239
|
-
extra +
|
|
1240
|
-
modelOverlay +
|
|
1241
|
-
runtimeContext;
|
|
1230
|
+
// Delegated turns use native template actions in every environment,
|
|
1231
|
+
// so they must also receive the native-tool prompt. The interactive
|
|
1232
|
+
// dev prompt teaches `pnpm action` and would send this receiver back
|
|
1233
|
+
// into the shell loop the native action surface exists to prevent.
|
|
1234
|
+
const systemPrompt = basePrompt +
|
|
1235
|
+
SYSTEM_PROMPT_CACHE_SPLIT +
|
|
1236
|
+
resources +
|
|
1237
|
+
schemaBlock +
|
|
1238
|
+
extra +
|
|
1239
|
+
modelOverlay +
|
|
1240
|
+
runtimeContext;
|
|
1242
1241
|
if (a2aRunContext)
|
|
1243
1242
|
a2aRunContext.systemPrompt = systemPrompt;
|
|
1244
|
-
// Build tools — same as interactive handler
|
|
1245
|
-
//
|
|
1246
|
-
//
|
|
1247
|
-
//
|
|
1243
|
+
// Build tools — same as interactive handler. Cross-app delegation is
|
|
1244
|
+
// enabled by default; call-agent carries a bounded visited-app path
|
|
1245
|
+
// and rejects cycles/excessive hops before dispatch.
|
|
1246
|
+
// Delegated turns keep template actions as NATIVE tools even in dev,
|
|
1247
|
+
// unlike the interactive surface (see the allScripts comment). Dev
|
|
1248
|
+
// routes template actions through bash there to dodge the degenerate
|
|
1249
|
+
// empty-object tool call some models emit for complex schemas — a
|
|
1250
|
+
// person can just retry. A delegated caller cannot: with no native
|
|
1251
|
+
// action the sibling agent shells out, and an A2A turn that misfires
|
|
1252
|
+
// has no one to correct it, so it retries the same command until the
|
|
1253
|
+
// repetition guard kills the run minutes later. A rejected `{}` call
|
|
1254
|
+
// returns a schema error the model can fix on the next step, which is
|
|
1255
|
+
// strictly better than a shell loop nobody can see.
|
|
1248
1256
|
const a2aActions = attachToolSearch(devActive
|
|
1249
1257
|
? {
|
|
1258
|
+
...templateScripts,
|
|
1250
1259
|
...resourceScripts,
|
|
1251
1260
|
...docsScripts,
|
|
1252
1261
|
...(lazyContext ? frameworkContextTool : {}),
|
|
1253
1262
|
...urlTools,
|
|
1254
1263
|
...chatScripts,
|
|
1264
|
+
...(a2aAgentDelegationEnabled ? callAgentScript : {}),
|
|
1255
1265
|
...fetchTool,
|
|
1256
1266
|
...webSearchTool,
|
|
1257
1267
|
...workspaceFilesTool,
|
|
@@ -1275,6 +1285,7 @@ export function createAgentChatPlugin(options) {
|
|
|
1275
1285
|
...(lazyContext ? frameworkContextTool : {}),
|
|
1276
1286
|
...urlTools,
|
|
1277
1287
|
...chatScripts,
|
|
1288
|
+
...(a2aAgentDelegationEnabled ? callAgentScript : {}),
|
|
1278
1289
|
...fetchTool,
|
|
1279
1290
|
...webSearchTool,
|
|
1280
1291
|
...workspaceFilesTool,
|
|
@@ -1304,6 +1315,7 @@ export function createAgentChatPlugin(options) {
|
|
|
1304
1315
|
// event stream so pre-tool narration never leaks as the A2A result.
|
|
1305
1316
|
const a2aEvents = [];
|
|
1306
1317
|
const a2aToolResults = [];
|
|
1318
|
+
let a2aOutcome;
|
|
1307
1319
|
let lastRecoverableArtifactText = "";
|
|
1308
1320
|
let activityState = createA2AAgentActivityState();
|
|
1309
1321
|
let lastActivityCheckpointAt = 0;
|
|
@@ -1356,8 +1368,15 @@ export function createAgentChatPlugin(options) {
|
|
|
1356
1368
|
runId: context.taskId,
|
|
1357
1369
|
networkProtocol: "a2a",
|
|
1358
1370
|
networkId: context.taskId,
|
|
1371
|
+
networkPeer: correlation.callerApp,
|
|
1372
|
+
delegationDepth: correlation.delegationDepth ?? 1,
|
|
1373
|
+
visitedApps: correlation.visitedApps ??
|
|
1374
|
+
(correlation.callerApp ? [correlation.callerApp] : []),
|
|
1359
1375
|
threadId: context.taskId,
|
|
1360
1376
|
turnId: context.taskId,
|
|
1377
|
+
onOutcome: (outcome) => {
|
|
1378
|
+
a2aOutcome = outcome;
|
|
1379
|
+
},
|
|
1361
1380
|
send: (event) => {
|
|
1362
1381
|
a2aEvents.push(event);
|
|
1363
1382
|
const nextActivityState = applyA2AAgentActivityEvent(activityState, event);
|
|
@@ -1404,6 +1423,7 @@ export function createAgentChatPlugin(options) {
|
|
|
1404
1423
|
},
|
|
1405
1424
|
signal: controller.signal,
|
|
1406
1425
|
}, {
|
|
1426
|
+
delegatedRunPolicy: options?.delegatedRunPolicy,
|
|
1407
1427
|
finalResponseGuard: options?.finalResponseGuard,
|
|
1408
1428
|
runSoftTimeoutMs: options?.runSoftTimeoutMs,
|
|
1409
1429
|
}, {
|
|
@@ -1485,7 +1505,7 @@ export function createAgentChatPlugin(options) {
|
|
|
1485
1505
|
};
|
|
1486
1506
|
return;
|
|
1487
1507
|
}
|
|
1488
|
-
const { responseText, finalText } = assembleA2AFinalResponse(a2aEvents, a2aToolResults, { event: context.event });
|
|
1508
|
+
const { responseText, finalText } = assembleA2AFinalResponse(a2aEvents, a2aToolResults, { event: context.event, outcome: a2aOutcome });
|
|
1489
1509
|
console.log(`[A2A] Loop complete. Text: ${responseText.slice(0, 100)}...`);
|
|
1490
1510
|
// Yield the final accumulated text
|
|
1491
1511
|
yield {
|
|
@@ -1494,7 +1514,7 @@ export function createAgentChatPlugin(options) {
|
|
|
1494
1514
|
buildA2AAgentActivityPart(activityState),
|
|
1495
1515
|
{
|
|
1496
1516
|
type: "text",
|
|
1497
|
-
text: finalText
|
|
1517
|
+
text: finalText,
|
|
1498
1518
|
},
|
|
1499
1519
|
],
|
|
1500
1520
|
};
|
|
@@ -1577,10 +1597,13 @@ export function createAgentChatPlugin(options) {
|
|
|
1577
1597
|
mcpEngine.defaultModel;
|
|
1578
1598
|
const model = normalizeModelForEngine(mcpEngine, mcpModelCandidate);
|
|
1579
1599
|
// Same actions as A2A — without call-agent to prevent loops.
|
|
1580
|
-
//
|
|
1600
|
+
// `ask_app` is delegated too, so template actions stay native in dev
|
|
1601
|
+
// here for the same reason as the A2A surface above: an external
|
|
1602
|
+
// caller cannot nurse a shell command that misfires.
|
|
1581
1603
|
const devActiveMcp = isDevMode();
|
|
1582
1604
|
const mcpActions = attachToolSearch(devActiveMcp
|
|
1583
1605
|
? {
|
|
1606
|
+
...templateScripts,
|
|
1584
1607
|
...resourceScripts,
|
|
1585
1608
|
...docsScripts,
|
|
1586
1609
|
...(lazyContext ? frameworkContextTool : {}),
|
|
@@ -1626,34 +1649,20 @@ export function createAgentChatPlugin(options) {
|
|
|
1626
1649
|
const schemaBlock = lazyContext
|
|
1627
1650
|
? ""
|
|
1628
1651
|
: await buildSchemaBlock(SHARED_OWNER, databaseToolsMode);
|
|
1629
|
-
// Build the MCP handler's own prompt — always use the bash-based
|
|
1630
|
-
// dev prompt in dev mode because mcpActions routes template actions
|
|
1631
|
-
// through bash (`devScriptsForA2A`), regardless of `nativeActionsInDev`.
|
|
1632
|
-
const mcpDevPrompt = (options?.devSystemPrompt
|
|
1633
|
-
? options.devSystemPrompt +
|
|
1634
|
-
(options?.systemPrompt ??
|
|
1635
|
-
(lazyContext
|
|
1636
|
-
? PROD_FRAMEWORK_PROMPT_COMPACT
|
|
1637
|
-
: PROD_FRAMEWORK_PROMPT))
|
|
1638
|
-
: lazyContext
|
|
1639
|
-
? DEV_FRAMEWORK_PROMPT_COMPACT
|
|
1640
|
-
: DEV_FRAMEWORK_PROMPT) + devActionsPrompt;
|
|
1641
1652
|
// Stable-first ordering: runtime-context (which changes daily)
|
|
1642
1653
|
// goes last so the cached prompt prefix survives as long as
|
|
1643
1654
|
// possible — same pattern as the other prompt-assembly sites in
|
|
1644
1655
|
// this plugin (A2A above, prod/anonymous/dev handlers below).
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
buildRuntimeContextPrompt();
|
|
1656
|
-
let accumulatedText = "";
|
|
1656
|
+
// ask_app receives native template actions even in dev, so the
|
|
1657
|
+
// native-tool prompt is required here for the same reason as A2A.
|
|
1658
|
+
const systemPrompt = basePrompt +
|
|
1659
|
+
SYSTEM_PROMPT_CACHE_SPLIT +
|
|
1660
|
+
resources +
|
|
1661
|
+
schemaBlock +
|
|
1662
|
+
buildRuntimeContextPrompt();
|
|
1663
|
+
const mcpEvents = [];
|
|
1664
|
+
const mcpToolResults = [];
|
|
1665
|
+
let mcpOutcome;
|
|
1657
1666
|
const controller = new AbortController();
|
|
1658
1667
|
await runMCPAgentLoop({
|
|
1659
1668
|
engine: mcpEngine,
|
|
@@ -1683,11 +1692,23 @@ export function createAgentChatPlugin(options) {
|
|
|
1683
1692
|
networkId: mcpRunId,
|
|
1684
1693
|
threadId: mcpRunId,
|
|
1685
1694
|
turnId: mcpRunId,
|
|
1695
|
+
onOutcome: (outcome) => {
|
|
1696
|
+
mcpOutcome = outcome;
|
|
1697
|
+
},
|
|
1686
1698
|
send: (event) => {
|
|
1687
|
-
|
|
1699
|
+
mcpEvents.push(event);
|
|
1700
|
+
if (event.type === "tool_done") {
|
|
1701
|
+
mcpToolResults.push({
|
|
1702
|
+
tool: event.tool,
|
|
1703
|
+
result: event.result,
|
|
1704
|
+
isError: event.isError,
|
|
1705
|
+
completedSideEffect: event.completedSideEffect,
|
|
1706
|
+
});
|
|
1707
|
+
}
|
|
1688
1708
|
},
|
|
1689
1709
|
signal: controller.signal,
|
|
1690
1710
|
}, {
|
|
1711
|
+
delegatedRunPolicy: options?.delegatedRunPolicy,
|
|
1691
1712
|
finalResponseGuard: options?.finalResponseGuard,
|
|
1692
1713
|
runSoftTimeoutMs: options?.runSoftTimeoutMs,
|
|
1693
1714
|
}, {
|
|
@@ -1704,7 +1725,9 @@ export function createAgentChatPlugin(options) {
|
|
|
1704
1725
|
delegation: { protocol: "mcp" },
|
|
1705
1726
|
},
|
|
1706
1727
|
});
|
|
1707
|
-
return
|
|
1728
|
+
return assembleA2AFinalResponse(mcpEvents, mcpToolResults, {
|
|
1729
|
+
outcome: mcpOutcome,
|
|
1730
|
+
}).finalText;
|
|
1708
1731
|
},
|
|
1709
1732
|
});
|
|
1710
1733
|
}
|
|
@@ -1837,11 +1860,7 @@ export function createAgentChatPlugin(options) {
|
|
|
1837
1860
|
engine: runCtx?.engine?.name ?? "unknown",
|
|
1838
1861
|
timestamp: Date.now(),
|
|
1839
1862
|
};
|
|
1840
|
-
repo
|
|
1841
|
-
const debugRuns = Array.isArray(repo._debugRuns)
|
|
1842
|
-
? repo._debugRuns
|
|
1843
|
-
: [];
|
|
1844
|
-
repo._debugRuns = [...debugRuns, debug].slice(-50);
|
|
1863
|
+
repo = appendThreadDebugHistory(repo, debug);
|
|
1845
1864
|
const meta = extractThreadMeta(repo);
|
|
1846
1865
|
await updateThreadData(threadId, JSON.stringify(repo), meta.title || thread.title, meta.preview || thread.preview, repo.messages.length);
|
|
1847
1866
|
}
|
|
@@ -3600,13 +3619,17 @@ Non-code requests are still fine on this surface: read data, navigate the UI, su
|
|
|
3600
3619
|
const turnId = decodeURIComponent(turnAbortMatch[1]);
|
|
3601
3620
|
const body = await readBody(event).catch(() => null);
|
|
3602
3621
|
const threadId = typeof body?.threadId === "string" ? body.threadId : "";
|
|
3622
|
+
const reason = typeof body?.reason === "string" &&
|
|
3623
|
+
/^[a-z0-9_-]{1,64}$/i.test(body.reason)
|
|
3624
|
+
? body.reason
|
|
3625
|
+
: "user";
|
|
3603
3626
|
if (!/^[a-zA-Z0-9_-]{1,160}$/.test(turnId) ||
|
|
3604
3627
|
!threadId ||
|
|
3605
3628
|
!(await canEditThread(threadId))) {
|
|
3606
3629
|
setResponseStatus(event, 404);
|
|
3607
3630
|
return { error: "Run not found" };
|
|
3608
3631
|
}
|
|
3609
|
-
await markTurnAborted(threadId, turnId);
|
|
3632
|
+
await markTurnAborted(threadId, turnId, reason);
|
|
3610
3633
|
return { ok: true };
|
|
3611
3634
|
}
|
|
3612
3635
|
// Route: GET /runs/list?goalId=agent-team|agent-harness
|