@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"no-env-credentials.js","sourceRoot":"","sources":["../../src/guards/no-env-credentials.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,EACL,gBAAgB,EAChB,YAAY,EACZ,QAAQ,EACR,IAAI,GACL,MAAM,iBAAiB,CAAC;AAGzB,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC;IAC9B,cAAc;IACd,qBAAqB;IACrB,UAAU;IACV,IAAI;IACJ,OAAO;IACP,SAAS;IACT,QAAQ;IACR,QAAQ;IACR,cAAc;IACd,WAAW;IACX,0BAA0B;IAC1B,oBAAoB;IACpB,iBAAiB;IACjB,kBAAkB;IAClB,sBAAsB;IACtB,qBAAqB;IACrB,0BAA0B;IAC1B,8BAA8B;IAC9B,aAAa;IACb,YAAY;IACZ,cAAc;IACd,MAAM;IACN,MAAM;IACN,wBAAwB;CACzB,CAAC,CAAC;AAEH,MAAM,gBAAgB,GAAG;IACvB,MAAM;IACN,eAAe;IACf,QAAQ;IACR,UAAU;IACV,SAAS;IACT,KAAK;CACN,CAAC;AAEF;;;oDAGoD;AACpD,MAAM,sBAAsB,GAAG;IAC7B,kBAAkB;IACl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O,EAAE,iFAAiF;aAC3F,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,OAAO,EAAE,IAAI,EAAE,oBAAoB,EAAE,QAAQ,EAAE,CAAC;AAClD,CAAC","sourcesContent":["/**\n * scanEnvCredentials — ported from `scripts/guard-no-env-credentials.mjs`.\n *\n * User credentials are per-user (or per-org) data. They MUST live in SQL,\n * scoped by `userEmail` / `orgId`, never in `process.env` — a deployment's\n * env vars are shared by every signed-in user. This guard flags any\n * `process.env.<KEY>` / `process.env[\"KEY\"]` read whose key is not on the\n * deploy-level allowlist (`DATABASE_URL`, `BETTER_AUTH_SECRET`, etc.), plus\n * any dynamic `process.env[key]` read (the key is only known at runtime, so\n * it can never be allowlisted safely).\n *\n * Conditional guard — per report 005's V1 guard set table, this is \"the big\n * one\": the original only scans a curated set of monorepo subtrees\n * (`packages/core/src/{credentials,secrets,vault,agent}/`, template\n * credential libs/routes) via `FORBIDDEN_PATH_PREDICATES` — none of which\n * exist in a generated app, so nothing would ever be scanned. This port\n * replaces that default-allow-outside-a-curated-subtree behavior with\n * default-deny across the whole app source tree: every `process.env.<KEY>`\n * read anywhere in app source must be on the deploy-var allowlist (kept\n * verbatim) or carry the opt-out marker. `HIGH_RISK_ENV_KEY_ALLOWLIST`,\n * `HIGH_RISK_PROCESS_ENV_ALLOWLIST`, and `HIGH_RISK_ENV_VARS_WRITE_ALLOWLIST`\n * — the three monorepo-file-keyed exception maps for specific template\n * platform-adapter files — are dropped entirely per the report; with\n * default-deny scanning already covering every `process.env` read\n * everywhere, the narrower `env-config.ts`/`core-routes.ts`-specific\n * registration checks those maps supported become redundant (any\n * high-risk key would already be caught by the general scan) and are\n * dropped along with them. The per-line `// guard:allow-env-credential`\n * marker remains the only escape hatch.\n *\n * Opt-out (same line, or the line immediately above):\n * process.env.SOMETHING // guard:allow-env-credential — short reason\n */\n\nimport {\n lineColForOffset,\n readFileSafe,\n relPosix,\n walk,\n} from \"./scan-utils.js\";\nimport type { GuardFinding, GuardResult, GuardScanOptions } from \"./types.js\";\n\nconst ALLOWLIST_EXACT = new Set([\n \"DATABASE_URL\",\n \"DATABASE_AUTH_TOKEN\",\n \"NODE_ENV\",\n \"CI\",\n \"DEBUG\",\n \"NETLIFY\",\n \"VERCEL\",\n \"RENDER\",\n \"FLY_APP_NAME\",\n \"K_SERVICE\",\n \"AWS_LAMBDA_FUNCTION_NAME\",\n \"BETTER_AUTH_SECRET\",\n \"BETTER_AUTH_URL\",\n \"NOTION_CLIENT_ID\",\n \"NOTION_CLIENT_SECRET\",\n \"NOTION_STATE_SECRET\",\n \"GOOGLE_SIGN_IN_CLIENT_ID\",\n \"GOOGLE_SIGN_IN_CLIENT_SECRET\",\n \"AUTH_SECRET\",\n \"A2A_SECRET\",\n \"ACCESS_TOKEN\",\n \"PORT\",\n \"HOST\",\n \"SECRETS_ENCRYPTION_KEY\",\n]);\n\nconst ALLOWLIST_PREFIX = [\n \"npm_\",\n \"AGENT_NATIVE_\",\n \"AGENT_\",\n \"NETLIFY_\",\n \"VERCEL_\",\n \"CF_\",\n];\n\n/** Dev-only paths where ANTHROPIC_API_KEY etc. may legitimately be read\n * from env (local dev tooling, scripts, tests). Portable subset of the\n * original — the monorepo-only `packages/core/src/dev` predicate is\n * dropped (see report 005's V1 guard set table). */\nconst DEV_ONLY_PATH_PATTERNS = [\n /\\.spec\\.[tj]sx?$/,\n /\\.test\\.[tj]sx?$/,\n /^scripts\\//,\n];\n\nconst DEV_ONLY_KEYS = new Set([\"ANTHROPIC_API_KEY\"]);\n\nconst OPT_OUT_MARKER = /\\/\\/\\s*guard:allow-env-credential\\b[^\\n]*/;\nconst OPT_OUT_REQUIRES_REASON = /\\/\\/\\s*guard:allow-env-credential\\s*[—-]\\s*\\S/;\n\nconst ENV_READ_REGEX =\n /process\\.env(?:\\.([A-Z][A-Z0-9_]*)|\\[\\s*[\"']([A-Z][A-Z0-9_]*)[\"']\\s*\\])/g;\n\nconst ENV_DYNAMIC_READ_REGEX =\n /process\\.env(?:\\?\\.)?\\s*\\[\\s*(?![\"'])([^\\]\\n]+?)\\s*\\]/g;\n\nfunction isAllowlistedKey(key: string): boolean {\n if (ALLOWLIST_EXACT.has(key)) return true;\n return ALLOWLIST_PREFIX.some((prefix) => key.startsWith(prefix));\n}\n\nfunction isDevOnlyPath(rel: string): boolean {\n return DEV_ONLY_PATH_PATTERNS.some((re) => re.test(rel));\n}\n\nfunction hasOptOutOnLine(lines: string[], lineIdx: number): boolean {\n const cur = lines[lineIdx] ?? \"\";\n if (OPT_OUT_MARKER.test(cur)) return true;\n const prev = lines[lineIdx - 1] ?? \"\";\n if (/^\\s*\\/\\//.test(prev) && OPT_OUT_MARKER.test(prev)) return true;\n return false;\n}\n\nfunction optOutOnLineIsValid(\n lines: string[],\n lineIdx: number,\n key: string,\n rel: string,\n): { ok: boolean; why?: string } {\n const cur = lines[lineIdx] ?? \"\";\n const prev = lines[lineIdx - 1] ?? \"\";\n const candidate = OPT_OUT_REQUIRES_REASON.test(cur)\n ? cur\n : OPT_OUT_REQUIRES_REASON.test(prev)\n ? prev\n : null;\n if (!candidate) return { ok: false, why: \"missing or empty reason\" };\n\n if (/dev-only\\b/i.test(candidate)) {\n if (!DEV_ONLY_KEYS.has(key)) {\n return {\n ok: false,\n why: `key \"${key}\" is not in the dev-only credential allowlist`,\n };\n }\n if (!isDevOnlyPath(rel)) {\n return {\n ok: false,\n why: \"dev-only opt-out used outside dev / scripts / test paths\",\n };\n }\n }\n return { ok: true };\n}\n\nexport function scanEnvCredentials(options: GuardScanOptions): GuardResult {\n const { root } = options;\n const findings: GuardFinding[] = [];\n\n for (const file of walk(root)) {\n if (!/\\.(ts|tsx|mts|cts|js|mjs|cjs)$/.test(file)) continue;\n if (file.endsWith(\".d.ts\")) continue;\n const rel = relPosix(root, file);\n\n const contents = readFileSafe(file);\n if (contents === null || !contents.includes(\"process.env\")) continue;\n\n const lines = contents.split(\"\\n\");\n\n ENV_READ_REGEX.lastIndex = 0;\n let m: RegExpExecArray | null;\n while ((m = ENV_READ_REGEX.exec(contents)) !== null) {\n const key = m[1] ?? m[2];\n if (!key) continue;\n const { line } = lineColForOffset(contents, m.index);\n const lineIdx = line - 1;\n const lineText = lines[lineIdx] ?? \"\";\n const trimmed = lineText.trimStart();\n if (\n trimmed.startsWith(\"*\") ||\n trimmed.startsWith(\"//\") ||\n trimmed.startsWith(\"/*\")\n ) {\n continue;\n }\n if (isAllowlistedKey(key)) continue;\n if (hasOptOutOnLine(lines, lineIdx)) {\n const verdict = optOutOnLineIsValid(lines, lineIdx, key, rel);\n if (verdict.ok) continue;\n findings.push({\n file: rel,\n line,\n message: `process.env.${key} opt-out invalid: ${verdict.why}`,\n });\n continue;\n }\n findings.push({\n file: rel,\n line,\n message: `process.env.${key} read — not a deploy-level allowlisted key. User credentials must be read via resolveCredential(key, { userEmail, orgId }), never process.env.`,\n });\n }\n\n ENV_DYNAMIC_READ_REGEX.lastIndex = 0;\n while ((m = ENV_DYNAMIC_READ_REGEX.exec(contents)) !== null) {\n const { line } = lineColForOffset(contents, m.index);\n const lineIdx = line - 1;\n const lineText = lines[lineIdx] ?? \"\";\n const trimmed = lineText.trimStart();\n if (\n trimmed.startsWith(\"*\") ||\n trimmed.startsWith(\"//\") ||\n trimmed.startsWith(\"/*\")\n ) {\n continue;\n }\n if (hasOptOutOnLine(lines, lineIdx)) {\n const verdict = optOutOnLineIsValid(lines, lineIdx, \"<dynamic>\", rel);\n if (verdict.ok) continue;\n findings.push({\n file: rel,\n line,\n message: `process.env[<dynamic>] opt-out invalid: ${verdict.why}`,\n });\n continue;\n }\n findings.push({\n file: rel,\n line,\n message: `process.env[<dynamic key>] read — dynamic keys can never be allowlisted safely.`,\n });\n }\n }\n\n return { name: \"no-env-credentials\", findings };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"no-env-credentials.js","sourceRoot":"","sources":["../../src/guards/no-env-credentials.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH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,GAAG,QAAQ,CAAC,SAAS,EAAE,CAAC;YACrC,IACE,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC;gBACvB,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC;gBACxB,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,EACxB,CAAC;gBACD,SAAS;YACX,CAAC;YACD,IAAI,eAAe,CAAC,KAAK,EAAE,OAAO,CAAC,EAAE,CAAC;gBACpC,MAAM,OAAO,GAAG,mBAAmB,CAAC,KAAK,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,CAAC,CAAC;gBACtE,IAAI,OAAO,CAAC,EAAE;oBAAE,SAAS;gBACzB,QAAQ,CAAC,IAAI,CAAC;oBACZ,IAAI,EAAE,GAAG;oBACT,IAAI;oBACJ,OAAO,EAAE,2CAA2C,OAAO,CAAC,GAAG,EAAE;iBAClE,CAAC,CAAC;gBACH,SAAS;YACX,CAAC;YACD,QAAQ,CAAC,IAAI,CAAC;gBACZ,IAAI,EAAE,GAAG;gBACT,IAAI;gBACJ,OAAO,EAAE,iFAAiF;aAC3F,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,OAAO,EAAE,IAAI,EAAE,oBAAoB,EAAE,QAAQ,EAAE,CAAC;AAClD,CAAC","sourcesContent":["/**\n * scanEnvCredentials — ported from `scripts/guard-no-env-credentials.mjs`.\n *\n * User credentials are per-user (or per-org) data. They MUST live in SQL,\n * scoped by `userEmail` / `orgId`, never in `process.env` — a deployment's\n * env vars are shared by every signed-in user. This guard flags any\n * `process.env.<KEY>` / `process.env[\"KEY\"]` read whose key is not on the\n * deploy-level allowlist (`DATABASE_URL`, `BETTER_AUTH_SECRET`, etc.), plus\n * any dynamic `process.env[key]` read (the key is only known at runtime, so\n * it can never be allowlisted safely).\n *\n * Conditional guard — per report 005's V1 guard set table, this is \"the big\n * one\": the original only scans a curated set of monorepo subtrees\n * (`packages/core/src/{credentials,secrets,vault,agent}/`, template\n * credential libs/routes) via `FORBIDDEN_PATH_PREDICATES` — none of which\n * exist in a generated app, so nothing would ever be scanned. This port\n * replaces that default-allow-outside-a-curated-subtree behavior with\n * default-deny across the whole app source tree: every `process.env.<KEY>`\n * read anywhere in app source must be on the deploy-var allowlist (kept\n * verbatim) or carry the opt-out marker. `HIGH_RISK_ENV_KEY_ALLOWLIST`,\n * `HIGH_RISK_PROCESS_ENV_ALLOWLIST`, and `HIGH_RISK_ENV_VARS_WRITE_ALLOWLIST`\n * — the three monorepo-file-keyed exception maps for specific template\n * platform-adapter files — are dropped entirely per the report; with\n * default-deny scanning already covering every `process.env` read\n * everywhere, the narrower `env-config.ts`/`core-routes.ts`-specific\n * registration checks those maps supported become redundant (any\n * high-risk key would already be caught by the general scan) and are\n * dropped along with them. The per-line `// guard:allow-env-credential`\n * marker remains the only escape hatch.\n *\n * Opt-out (same line, or the line immediately above):\n * process.env.SOMETHING // guard:allow-env-credential — short reason\n */\n\nimport {\n lineColForOffset,\n readFileSafe,\n relPosix,\n walk,\n} from \"./scan-utils.js\";\nimport type { GuardFinding, GuardResult, GuardScanOptions } from \"./types.js\";\n\nconst ALLOWLIST_EXACT = new Set([\n \"DATABASE_URL\",\n \"DATABASE_AUTH_TOKEN\",\n \"NODE_ENV\",\n \"CI\",\n \"DEBUG\",\n \"NETLIFY\",\n \"VERCEL\",\n \"RENDER\",\n \"FLY_APP_NAME\",\n \"K_SERVICE\",\n \"AWS_LAMBDA_FUNCTION_NAME\",\n \"BETTER_AUTH_SECRET\",\n \"BETTER_AUTH_URL\",\n \"NOTION_CLIENT_ID\",\n \"NOTION_CLIENT_SECRET\",\n \"NOTION_STATE_SECRET\",\n \"GOOGLE_SIGN_IN_CLIENT_ID\",\n \"GOOGLE_SIGN_IN_CLIENT_SECRET\",\n \"AUTH_SECRET\",\n \"A2A_SECRET\",\n \"ACCESS_TOKEN\",\n \"PORT\",\n \"HOST\",\n \"SECRETS_ENCRYPTION_KEY\",\n \"WORKSPACE_SECRETS_ENCRYPTION_KEY\",\n \"WORKSPACE_SECRETS_ENCRYPTION_KEY_PREVIOUS\",\n]);\n\nconst ALLOWLIST_PREFIX = [\n \"npm_\",\n \"AGENT_NATIVE_\",\n \"AGENT_\",\n \"NETLIFY_\",\n \"VERCEL_\",\n \"CF_\",\n];\n\n/** Dev-only paths where ANTHROPIC_API_KEY etc. may legitimately be read\n * from env (local dev tooling, scripts, tests). Portable subset of the\n * original — the monorepo-only `packages/core/src/dev` predicate is\n * dropped (see report 005's V1 guard set table). */\nconst DEV_ONLY_PATH_PATTERNS = [\n /\\.spec\\.[tj]sx?$/,\n /\\.test\\.[tj]sx?$/,\n /^scripts\\//,\n];\n\nconst DEV_ONLY_KEYS = new Set([\"ANTHROPIC_API_KEY\"]);\n\nconst OPT_OUT_MARKER = /\\/\\/\\s*guard:allow-env-credential\\b[^\\n]*/;\nconst OPT_OUT_REQUIRES_REASON = /\\/\\/\\s*guard:allow-env-credential\\s*[—-]\\s*\\S/;\n\nconst ENV_READ_REGEX =\n /process\\.env(?:\\.([A-Z][A-Z0-9_]*)|\\[\\s*[\"']([A-Z][A-Z0-9_]*)[\"']\\s*\\])/g;\n\nconst ENV_DYNAMIC_READ_REGEX =\n /process\\.env(?:\\?\\.)?\\s*\\[\\s*(?![\"'])([^\\]\\n]+?)\\s*\\]/g;\n\nfunction isAllowlistedKey(key: string): boolean {\n if (ALLOWLIST_EXACT.has(key)) return true;\n return ALLOWLIST_PREFIX.some((prefix) => key.startsWith(prefix));\n}\n\nfunction isDevOnlyPath(rel: string): boolean {\n return DEV_ONLY_PATH_PATTERNS.some((re) => re.test(rel));\n}\n\nfunction hasOptOutOnLine(lines: string[], lineIdx: number): boolean {\n const cur = lines[lineIdx] ?? \"\";\n if (OPT_OUT_MARKER.test(cur)) return true;\n const prev = lines[lineIdx - 1] ?? \"\";\n if (/^\\s*\\/\\//.test(prev) && OPT_OUT_MARKER.test(prev)) return true;\n return false;\n}\n\nfunction optOutOnLineIsValid(\n lines: string[],\n lineIdx: number,\n key: string,\n rel: string,\n): { ok: boolean; why?: string } {\n const cur = lines[lineIdx] ?? \"\";\n const prev = lines[lineIdx - 1] ?? \"\";\n const candidate = OPT_OUT_REQUIRES_REASON.test(cur)\n ? cur\n : OPT_OUT_REQUIRES_REASON.test(prev)\n ? prev\n : null;\n if (!candidate) return { ok: false, why: \"missing or empty reason\" };\n\n if (/dev-only\\b/i.test(candidate)) {\n if (!DEV_ONLY_KEYS.has(key)) {\n return {\n ok: false,\n why: `key \"${key}\" is not in the dev-only credential allowlist`,\n };\n }\n if (!isDevOnlyPath(rel)) {\n return {\n ok: false,\n why: \"dev-only opt-out used outside dev / scripts / test paths\",\n };\n }\n }\n return { ok: true };\n}\n\nexport function scanEnvCredentials(options: GuardScanOptions): GuardResult {\n const { root } = options;\n const findings: GuardFinding[] = [];\n\n for (const file of walk(root)) {\n if (!/\\.(ts|tsx|mts|cts|js|mjs|cjs)$/.test(file)) continue;\n if (file.endsWith(\".d.ts\")) continue;\n const rel = relPosix(root, file);\n\n const contents = readFileSafe(file);\n if (contents === null || !contents.includes(\"process.env\")) continue;\n\n const lines = contents.split(\"\\n\");\n\n ENV_READ_REGEX.lastIndex = 0;\n let m: RegExpExecArray | null;\n while ((m = ENV_READ_REGEX.exec(contents)) !== null) {\n const key = m[1] ?? m[2];\n if (!key) continue;\n const { line } = lineColForOffset(contents, m.index);\n const lineIdx = line - 1;\n const lineText = lines[lineIdx] ?? \"\";\n const trimmed = lineText.trimStart();\n if (\n trimmed.startsWith(\"*\") ||\n trimmed.startsWith(\"//\") ||\n trimmed.startsWith(\"/*\")\n ) {\n continue;\n }\n if (isAllowlistedKey(key)) continue;\n if (hasOptOutOnLine(lines, lineIdx)) {\n const verdict = optOutOnLineIsValid(lines, lineIdx, key, rel);\n if (verdict.ok) continue;\n findings.push({\n file: rel,\n line,\n message: `process.env.${key} opt-out invalid: ${verdict.why}`,\n });\n continue;\n }\n findings.push({\n file: rel,\n line,\n message: `process.env.${key} read — not a deploy-level allowlisted key. User credentials must be read via resolveCredential(key, { userEmail, orgId }), never process.env.`,\n });\n }\n\n ENV_DYNAMIC_READ_REGEX.lastIndex = 0;\n while ((m = ENV_DYNAMIC_READ_REGEX.exec(contents)) !== null) {\n const { line } = lineColForOffset(contents, m.index);\n const lineIdx = line - 1;\n const lineText = lines[lineIdx] ?? \"\";\n const trimmed = lineText.trimStart();\n if (\n trimmed.startsWith(\"*\") ||\n trimmed.startsWith(\"//\") ||\n trimmed.startsWith(\"/*\")\n ) {\n continue;\n }\n if (hasOptOutOnLine(lines, lineIdx)) {\n const verdict = optOutOnLineIsValid(lines, lineIdx, \"<dynamic>\", rel);\n if (verdict.ok) continue;\n findings.push({\n file: rel,\n line,\n message: `process.env[<dynamic>] opt-out invalid: ${verdict.why}`,\n });\n continue;\n }\n findings.push({\n file: rel,\n line,\n message: `process.env[<dynamic key>] read — dynamic keys can never be allowlisted safely.`,\n });\n }\n }\n\n return { name: \"no-env-credentials\", findings };\n}\n"]}
|
|
@@ -1671,7 +1671,9 @@ function createSlackRunProgress(token, incoming, channel, threadTs, streamTs) {
|
|
|
1671
1671
|
? "in_progress"
|
|
1672
1672
|
: event.status === "done"
|
|
1673
1673
|
? "complete"
|
|
1674
|
-
: "
|
|
1674
|
+
: event.status === "pending"
|
|
1675
|
+
? "in_progress"
|
|
1676
|
+
: "error";
|
|
1675
1677
|
const title = delegatedTaskTitle(event.agent);
|
|
1676
1678
|
tasks.set(id, { title, status });
|
|
1677
1679
|
await append({
|
|
@@ -1679,9 +1681,11 @@ function createSlackRunProgress(token, incoming, channel, threadTs, streamTs) {
|
|
|
1679
1681
|
id,
|
|
1680
1682
|
title,
|
|
1681
1683
|
status,
|
|
1682
|
-
...(event.status === "start"
|
|
1684
|
+
...(event.status === "start" || event.status === "pending"
|
|
1683
1685
|
? {
|
|
1684
|
-
details:
|
|
1686
|
+
details: event.status === "pending"
|
|
1687
|
+
? `${shortTaskTitle(event.agent)} is still working and will need another status check.`
|
|
1688
|
+
: `I’m contacting ${shortTaskTitle(event.agent)} for an answer.`,
|
|
1685
1689
|
}
|
|
1686
1690
|
: {}),
|
|
1687
1691
|
});
|