@agent-native/core 0.118.0 → 0.119.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/corpus/README.md +2 -2
- package/corpus/core/CHANGELOG.md +32 -0
- package/corpus/core/docs/content/a2a-protocol.mdx +15 -0
- package/corpus/core/docs/content/template-chat.mdx +1 -1
- package/corpus/core/docs/content/template-plan.mdx +3 -3
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/a2a/activity.ts +371 -0
- package/corpus/core/src/a2a/client.ts +35 -11
- package/corpus/core/src/a2a/index.ts +21 -0
- package/corpus/core/src/a2a/types.ts +8 -0
- package/corpus/core/src/agent/model-config.ts +19 -23
- package/corpus/core/src/agent/production-agent.ts +167 -100
- package/corpus/core/src/agent/types.ts +16 -1
- package/corpus/core/src/cli/index.ts +18 -10
- package/corpus/core/src/cli/multi-frontier-runs.ts +5 -3
- package/corpus/core/src/cli/templates-meta.ts +0 -12
- package/corpus/core/src/cli/workspace-dev.ts +1 -1
- package/corpus/core/src/client/AgentPanel.tsx +9 -1
- package/corpus/core/src/client/RunStuckBanner.tsx +39 -47
- package/corpus/core/src/client/chat/action-chat-ui-surface.tsx +32 -0
- package/corpus/core/src/client/chat/message-components.tsx +53 -8
- package/corpus/core/src/client/chat/tool-call-display.tsx +214 -44
- package/corpus/core/src/client/chat/widgets/InlineExtensionWidget.tsx +0 -1
- package/corpus/core/src/client/chat/widgets/builtin-tool-renderers.tsx +7 -3
- package/corpus/core/src/client/chat-model-groups.ts +67 -27
- package/corpus/core/src/client/conversation/AgentConversation.tsx +12 -1
- package/corpus/core/src/client/error-capture.ts +2 -6
- package/corpus/core/src/client/resources/McpConnectionSuggestion.tsx +20 -14
- package/corpus/core/src/client/resources/ResourcesPanel.tsx +5 -1
- package/corpus/core/src/client/resources/mcp-integration-catalog.ts +7 -17
- package/corpus/core/src/client/resources/mcp-integration-logos.ts +2 -2
- package/corpus/core/src/client/route-chunk-recovery.ts +5 -3
- package/corpus/core/src/client/session-replay.ts +3 -3
- package/corpus/core/src/client/settings/SettingsPanel.tsx +15 -6
- package/corpus/core/src/client/sharing/ShareButton.tsx +1 -27
- package/corpus/core/src/client/sharing/ShareDialog.tsx +0 -16
- package/corpus/core/src/client/sharing/useShareButtonController.ts +0 -7
- package/corpus/core/src/client/sharing/useShareDialogController.ts +0 -2
- package/corpus/core/src/client/sse-event-processor.ts +85 -1
- package/corpus/core/src/client/transcription/use-live-transcription.ts +64 -45
- package/corpus/core/src/deploy/build.ts +2 -1
- package/corpus/core/src/guards/db-tool-scoping.ts +1 -1
- package/corpus/core/src/integrations/adapters/slack.ts +84 -5
- package/corpus/core/src/integrations/index.ts +5 -1
- package/corpus/core/src/localization/default-messages.ts +7 -1
- package/corpus/core/src/mcp-client/oauth-routes.ts +45 -12
- package/corpus/core/src/scripts/agent-engines/list-agent-engines.ts +1 -18
- package/corpus/core/src/scripts/call-agent.ts +49 -6
- package/corpus/core/src/server/agent-chat-plugin.ts +50 -10
- package/corpus/core/src/server/realtime-voice.ts +4 -1
- package/corpus/core/src/templates/workspace-core/.agents/skills/a2a-protocol/SKILL.md +16 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/voice-transcription/SKILL.md +7 -5
- package/corpus/core/src/terminal/cli-registry.ts +1 -1
- package/corpus/core/src/vite/client.ts +166 -1
- package/corpus/templates/analytics/app/hooks/use-dashboard-views.ts +13 -1
- package/corpus/templates/analytics/app/pages/adhoc/sql-dashboard/ViewsMenu.tsx +10 -0
- package/corpus/templates/analytics/changelog/2026-07-22-show-a-useful-error-when-saving-a-dashboard-view-fails.md +6 -0
- package/corpus/templates/brain/app/routes/sources.tsx +181 -114
- package/corpus/templates/clips/AGENTS.md +8 -6
- package/corpus/templates/clips/actions/request-transcript.ts +90 -420
- package/corpus/templates/clips/actions/save-browser-transcript.ts +11 -28
- package/corpus/templates/clips/app/components/capture-install-options.tsx +5 -3
- package/corpus/templates/clips/app/components/player/transcript-panel.tsx +3 -136
- package/corpus/templates/clips/app/lib/capture-install-options.ts +15 -4
- package/corpus/templates/clips/app/routes/download.tsx +3 -2
- package/corpus/templates/clips/changelog/2026-07-22-fixed-an-intermittent-hydration-error-on-the-download-page.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-22-fixed-transcript-generation-when-native-speech-capture-retur.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-22-transcript-generation-now-retries-with-backup-speech-recogni.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-23-fixed-recordings-failing-to-save-with-a-cancelled-or-cleanup.md +6 -0
- package/corpus/templates/clips/server/lib/public-agent-context.ts +2 -2
- package/corpus/templates/clips/server/plugins/db.ts +9 -1
- package/corpus/templates/clips/server/register-secrets.ts +7 -6
- package/corpus/templates/content/app/components/editor/SlashCommandMenu.tsx +16 -84
- package/corpus/templates/content/app/components/editor/VisualEditor.tsx +13 -7
- package/corpus/templates/content/app/components/editor/extensions/ImageBlock.tsx +2 -2
- package/corpus/templates/content/app/i18n-data.ts +10 -0
- package/corpus/templates/design/server/lib/fig-file-decoder.ts +1 -0
- package/corpus/templates/plan/app/entry.client.tsx +3 -0
- package/corpus/templates/plan/changelog/2026-07-22-recover-stale-pages-after-a-deployment-refresh-automatically.md +6 -0
- package/corpus/templates/slides/app/hooks/use-agent-generating.ts +10 -3
- package/corpus/templates/slides/app/pages/Index.tsx +1 -0
- package/corpus/templates/slides/changelog/2026-07-22-new-deck-prompts-now-open-in-their-own-visible-chat-thread.md +6 -0
- package/corpus/toolkit/CHANGELOG.md +9 -0
- package/corpus/toolkit/package.json +1 -1
- package/corpus/toolkit/src/composer/PromptComposer.tsx +5 -1
- package/corpus/toolkit/src/composer/RealtimeVoiceMode.tsx +119 -31
- package/corpus/toolkit/src/composer/useRealtimeVoiceMode.tsx +30 -0
- package/corpus/toolkit/src/conformance/runner.tsx +153 -1
- package/corpus/toolkit/src/editor/SharedRichEditor.tsx +13 -2
- package/corpus/toolkit/src/editor/SlashCommandMenu.tsx +20 -0
- package/corpus/toolkit/src/editor/index.ts +2 -0
- package/corpus/toolkit/src/styles.css +52 -23
- package/dist/a2a/activity.d.ts +50 -0
- package/dist/a2a/activity.d.ts.map +1 -0
- package/dist/a2a/activity.js +236 -0
- package/dist/a2a/activity.js.map +1 -0
- package/dist/a2a/client.d.ts +5 -1
- package/dist/a2a/client.d.ts.map +1 -1
- package/dist/a2a/client.js +18 -13
- package/dist/a2a/client.js.map +1 -1
- package/dist/a2a/index.d.ts +2 -1
- package/dist/a2a/index.d.ts.map +1 -1
- package/dist/a2a/index.js +1 -0
- package/dist/a2a/index.js.map +1 -1
- package/dist/a2a/types.d.ts +1 -0
- package/dist/a2a/types.d.ts.map +1 -1
- package/dist/a2a/types.js.map +1 -1
- package/dist/agent/engine/anthropic-engine.d.ts +1 -1
- package/dist/agent/engine/builder-engine.d.ts +2 -2
- package/dist/agent/engine/builder-engine.d.ts.map +1 -1
- package/dist/agent/model-config.d.ts +16 -16
- package/dist/agent/model-config.d.ts.map +1 -1
- package/dist/agent/model-config.js +19 -23
- package/dist/agent/model-config.js.map +1 -1
- package/dist/agent/production-agent.d.ts +26 -0
- package/dist/agent/production-agent.d.ts.map +1 -1
- package/dist/agent/production-agent.js +137 -80
- package/dist/agent/production-agent.js.map +1 -1
- package/dist/agent/types.d.ts +10 -0
- package/dist/agent/types.d.ts.map +1 -1
- package/dist/agent/types.js.map +1 -1
- package/dist/cli/index.js +18 -8
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/multi-frontier-runs.js +3 -3
- package/dist/cli/multi-frontier-runs.js.map +1 -1
- package/dist/cli/templates-meta.d.ts.map +1 -1
- package/dist/cli/templates-meta.js +0 -12
- package/dist/cli/templates-meta.js.map +1 -1
- package/dist/cli/workspace-dev.js +1 -1
- package/dist/cli/workspace-dev.js.map +1 -1
- package/dist/client/AgentPanel.d.ts.map +1 -1
- package/dist/client/AgentPanel.js +4 -1
- package/dist/client/AgentPanel.js.map +1 -1
- package/dist/client/RunStuckBanner.d.ts +3 -5
- package/dist/client/RunStuckBanner.d.ts.map +1 -1
- package/dist/client/RunStuckBanner.js +17 -18
- package/dist/client/RunStuckBanner.js.map +1 -1
- package/dist/client/chat/action-chat-ui-surface.d.ts +8 -0
- package/dist/client/chat/action-chat-ui-surface.d.ts.map +1 -0
- package/dist/client/chat/action-chat-ui-surface.js +10 -0
- package/dist/client/chat/action-chat-ui-surface.js.map +1 -0
- package/dist/client/chat/message-components.d.ts +3 -0
- package/dist/client/chat/message-components.d.ts.map +1 -1
- package/dist/client/chat/message-components.js +40 -7
- package/dist/client/chat/message-components.js.map +1 -1
- package/dist/client/chat/tool-call-display.d.ts +3 -1
- package/dist/client/chat/tool-call-display.d.ts.map +1 -1
- package/dist/client/chat/tool-call-display.js +76 -23
- package/dist/client/chat/tool-call-display.js.map +1 -1
- package/dist/client/chat/widgets/InlineExtensionWidget.d.ts.map +1 -1
- package/dist/client/chat/widgets/InlineExtensionWidget.js +1 -1
- package/dist/client/chat/widgets/InlineExtensionWidget.js.map +1 -1
- package/dist/client/chat/widgets/builtin-tool-renderers.d.ts.map +1 -1
- package/dist/client/chat/widgets/builtin-tool-renderers.js +5 -3
- package/dist/client/chat/widgets/builtin-tool-renderers.js.map +1 -1
- package/dist/client/chat-model-groups.d.ts.map +1 -1
- package/dist/client/chat-model-groups.js +44 -21
- package/dist/client/chat-model-groups.js.map +1 -1
- package/dist/client/conversation/AgentConversation.d.ts.map +1 -1
- package/dist/client/conversation/AgentConversation.js +3 -2
- package/dist/client/conversation/AgentConversation.js.map +1 -1
- package/dist/client/error-capture.d.ts.map +1 -1
- package/dist/client/error-capture.js +2 -2
- package/dist/client/error-capture.js.map +1 -1
- package/dist/client/resources/McpConnectionSuggestion.d.ts +1 -0
- package/dist/client/resources/McpConnectionSuggestion.d.ts.map +1 -1
- package/dist/client/resources/McpConnectionSuggestion.js +9 -8
- package/dist/client/resources/McpConnectionSuggestion.js.map +1 -1
- package/dist/client/resources/ResourcesPanel.d.ts.map +1 -1
- package/dist/client/resources/ResourcesPanel.js +3 -1
- package/dist/client/resources/ResourcesPanel.js.map +1 -1
- package/dist/client/resources/mcp-integration-catalog.d.ts +1 -0
- package/dist/client/resources/mcp-integration-catalog.d.ts.map +1 -1
- package/dist/client/resources/mcp-integration-catalog.js +4 -17
- package/dist/client/resources/mcp-integration-catalog.js.map +1 -1
- package/dist/client/resources/mcp-integration-logos.js +2 -2
- package/dist/client/resources/mcp-integration-logos.js.map +1 -1
- package/dist/client/route-chunk-recovery.d.ts.map +1 -1
- package/dist/client/route-chunk-recovery.js +5 -3
- package/dist/client/route-chunk-recovery.js.map +1 -1
- package/dist/client/session-replay.js +3 -3
- package/dist/client/session-replay.js.map +1 -1
- package/dist/client/settings/SettingsPanel.d.ts.map +1 -1
- package/dist/client/settings/SettingsPanel.js +2 -2
- package/dist/client/settings/SettingsPanel.js.map +1 -1
- package/dist/client/sharing/ShareButton.d.ts +1 -1
- package/dist/client/sharing/ShareButton.d.ts.map +1 -1
- package/dist/client/sharing/ShareButton.js +3 -4
- package/dist/client/sharing/ShareButton.js.map +1 -1
- package/dist/client/sharing/ShareDialog.d.ts.map +1 -1
- package/dist/client/sharing/ShareDialog.js +1 -2
- package/dist/client/sharing/ShareDialog.js.map +1 -1
- package/dist/client/sharing/useShareButtonController.d.ts +0 -1
- package/dist/client/sharing/useShareButtonController.d.ts.map +1 -1
- package/dist/client/sharing/useShareButtonController.js +0 -6
- package/dist/client/sharing/useShareButtonController.js.map +1 -1
- package/dist/client/sharing/useShareDialogController.d.ts +0 -1
- package/dist/client/sharing/useShareDialogController.d.ts.map +1 -1
- package/dist/client/sharing/useShareDialogController.js +0 -1
- package/dist/client/sharing/useShareDialogController.js.map +1 -1
- package/dist/client/sse-event-processor.d.ts +12 -0
- package/dist/client/sse-event-processor.d.ts.map +1 -1
- package/dist/client/sse-event-processor.js +63 -1
- package/dist/client/sse-event-processor.js.map +1 -1
- package/dist/client/transcription/use-live-transcription.d.ts +3 -3
- package/dist/client/transcription/use-live-transcription.d.ts.map +1 -1
- package/dist/client/transcription/use-live-transcription.js +22 -11
- package/dist/client/transcription/use-live-transcription.js.map +1 -1
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/collab/awareness.d.ts.map +1 -1
- package/dist/deploy/build.d.ts.map +1 -1
- package/dist/deploy/build.js +1 -1
- package/dist/deploy/build.js.map +1 -1
- package/dist/guards/db-tool-scoping.js +1 -1
- package/dist/guards/db-tool-scoping.js.map +1 -1
- package/dist/integrations/adapters/slack.d.ts +1 -0
- package/dist/integrations/adapters/slack.d.ts.map +1 -1
- package/dist/integrations/adapters/slack.js +61 -5
- package/dist/integrations/adapters/slack.js.map +1 -1
- package/dist/integrations/index.d.ts +1 -1
- package/dist/integrations/index.d.ts.map +1 -1
- package/dist/integrations/index.js +1 -1
- package/dist/integrations/index.js.map +1 -1
- package/dist/localization/default-messages.d.ts +6 -0
- package/dist/localization/default-messages.d.ts.map +1 -1
- package/dist/localization/default-messages.js +7 -1
- package/dist/localization/default-messages.js.map +1 -1
- package/dist/mcp-client/oauth-routes.d.ts +3 -0
- package/dist/mcp-client/oauth-routes.d.ts.map +1 -1
- package/dist/mcp-client/oauth-routes.js +41 -12
- package/dist/mcp-client/oauth-routes.js.map +1 -1
- package/dist/observability/routes.d.ts +3 -3
- package/dist/provider-api/actions/custom-provider-registration.d.ts +8 -8
- package/dist/provider-api/actions/provider-api.d.ts +11 -11
- package/dist/scripts/agent-engines/list-agent-engines.d.ts.map +1 -1
- package/dist/scripts/agent-engines/list-agent-engines.js +1 -18
- package/dist/scripts/agent-engines/list-agent-engines.js.map +1 -1
- package/dist/scripts/call-agent.d.ts.map +1 -1
- package/dist/scripts/call-agent.js +49 -6
- package/dist/scripts/call-agent.js.map +1 -1
- package/dist/secrets/routes.d.ts +6 -6
- package/dist/server/agent-chat-plugin.d.ts.map +1 -1
- package/dist/server/agent-chat-plugin.js +38 -10
- 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/realtime-voice.d.ts.map +1 -1
- package/dist/server/realtime-voice.js +1 -1
- package/dist/server/realtime-voice.js.map +1 -1
- package/dist/server/transcribe-voice.d.ts +1 -1
- package/dist/templates/workspace-core/.agents/skills/a2a-protocol/SKILL.md +16 -0
- package/dist/templates/workspace-core/.agents/skills/voice-transcription/SKILL.md +7 -5
- package/dist/terminal/cli-registry.js +1 -1
- package/dist/terminal/cli-registry.js.map +1 -1
- package/dist/vite/client.d.ts +8 -1
- package/dist/vite/client.d.ts.map +1 -1
- package/dist/vite/client.js +113 -2
- package/dist/vite/client.js.map +1 -1
- package/docs/content/a2a-protocol.mdx +15 -0
- package/docs/content/template-chat.mdx +1 -1
- package/docs/content/template-plan.mdx +3 -3
- package/package.json +2 -2
- package/src/a2a/activity.ts +371 -0
- package/src/a2a/client.ts +35 -11
- package/src/a2a/index.ts +21 -0
- package/src/a2a/types.ts +8 -0
- package/src/agent/model-config.ts +19 -23
- package/src/agent/production-agent.ts +167 -100
- package/src/agent/types.ts +16 -1
- package/src/cli/index.ts +18 -10
- package/src/cli/multi-frontier-runs.ts +5 -3
- package/src/cli/templates-meta.ts +0 -12
- package/src/cli/workspace-dev.ts +1 -1
- package/src/client/AgentPanel.tsx +9 -1
- package/src/client/RunStuckBanner.tsx +39 -47
- package/src/client/chat/action-chat-ui-surface.tsx +32 -0
- package/src/client/chat/message-components.tsx +53 -8
- package/src/client/chat/tool-call-display.tsx +214 -44
- package/src/client/chat/widgets/InlineExtensionWidget.tsx +0 -1
- package/src/client/chat/widgets/builtin-tool-renderers.tsx +7 -3
- package/src/client/chat-model-groups.ts +67 -27
- package/src/client/conversation/AgentConversation.tsx +12 -1
- package/src/client/error-capture.ts +2 -6
- package/src/client/resources/McpConnectionSuggestion.tsx +20 -14
- package/src/client/resources/ResourcesPanel.tsx +5 -1
- package/src/client/resources/mcp-integration-catalog.ts +7 -17
- package/src/client/resources/mcp-integration-logos.ts +2 -2
- package/src/client/route-chunk-recovery.ts +5 -3
- package/src/client/session-replay.ts +3 -3
- package/src/client/settings/SettingsPanel.tsx +15 -6
- package/src/client/sharing/ShareButton.tsx +1 -27
- package/src/client/sharing/ShareDialog.tsx +0 -16
- package/src/client/sharing/useShareButtonController.ts +0 -7
- package/src/client/sharing/useShareDialogController.ts +0 -2
- package/src/client/sse-event-processor.ts +85 -1
- package/src/client/transcription/use-live-transcription.ts +64 -45
- package/src/deploy/build.ts +2 -1
- package/src/guards/db-tool-scoping.ts +1 -1
- package/src/integrations/adapters/slack.ts +84 -5
- package/src/integrations/index.ts +5 -1
- package/src/localization/default-messages.ts +7 -1
- package/src/mcp-client/oauth-routes.ts +45 -12
- package/src/scripts/agent-engines/list-agent-engines.ts +1 -18
- package/src/scripts/call-agent.ts +49 -6
- package/src/server/agent-chat-plugin.ts +50 -10
- package/src/server/realtime-voice.ts +4 -1
- package/src/templates/workspace-core/.agents/skills/a2a-protocol/SKILL.md +16 -0
- package/src/templates/workspace-core/.agents/skills/voice-transcription/SKILL.md +7 -5
- package/src/terminal/cli-registry.ts +1 -1
- package/src/vite/client.ts +166 -1
- package/corpus/core/src/observability/hosted-model-experiment.ts +0 -118
- package/corpus/templates/crm/.agents/skills/agent-native-docs/SKILL.md +0 -115
- package/corpus/templates/crm/.agents/skills/agent-native-toolkit/SKILL.md +0 -177
- package/corpus/templates/crm/.agents/skills/crm/SKILL.md +0 -128
- package/corpus/templates/crm/.agents/skills/customizing-agent-native/SKILL.md +0 -220
- package/corpus/templates/crm/.agents/skills/feature-flags/SKILL.md +0 -169
- package/corpus/templates/crm/.agents/skills/upgrade-agent-native/SKILL.md +0 -100
- package/corpus/templates/crm/.env.example +0 -5
- package/corpus/templates/crm/AGENTS.md +0 -120
- package/corpus/templates/crm/CHANGELOG.md +0 -1
- package/corpus/templates/crm/DEVELOPING.md +0 -66
- package/corpus/templates/crm/README.md +0 -106
- package/corpus/templates/crm/_gitignore +0 -12
- package/corpus/templates/crm/actions/_crm-action-utils.ts +0 -87
- package/corpus/templates/crm/actions/_crm-dashboard.ts +0 -69
- package/corpus/templates/crm/actions/_crm-data-program-actions.ts +0 -15
- package/corpus/templates/crm/actions/_crm-signal-utils.ts +0 -79
- package/corpus/templates/crm/actions/apply-crm-proposals.ts +0 -203
- package/corpus/templates/crm/actions/attach-call-evidence.ts +0 -170
- package/corpus/templates/crm/actions/configure-crm-connection.ts +0 -126
- package/corpus/templates/crm/actions/configure-native-crm.ts +0 -44
- package/corpus/templates/crm/actions/create-crm-record.ts +0 -148
- package/corpus/templates/crm/actions/create-crm-signal-tracker.ts +0 -58
- package/corpus/templates/crm/actions/delete-staged-dataset.ts +0 -14
- package/corpus/templates/crm/actions/get-crm-automation-recipe.ts +0 -36
- package/corpus/templates/crm/actions/get-crm-dashboard-panel.ts +0 -35
- package/corpus/templates/crm/actions/get-crm-dashboard.ts +0 -14
- package/corpus/templates/crm/actions/get-crm-overview.ts +0 -13
- package/corpus/templates/crm/actions/get-crm-pipeline-data.ts +0 -61
- package/corpus/templates/crm/actions/get-crm-record.ts +0 -75
- package/corpus/templates/crm/actions/install-crm-pipeline-dashboard.ts +0 -81
- package/corpus/templates/crm/actions/list-crm-dashboard-revisions.ts +0 -15
- package/corpus/templates/crm/actions/list-crm-dashboards.ts +0 -15
- package/corpus/templates/crm/actions/list-crm-proposals.ts +0 -31
- package/corpus/templates/crm/actions/list-crm-records.ts +0 -79
- package/corpus/templates/crm/actions/list-crm-saved-views.ts +0 -15
- package/corpus/templates/crm/actions/list-crm-signal-hits.ts +0 -43
- package/corpus/templates/crm/actions/list-crm-signal-trackers.ts +0 -32
- package/corpus/templates/crm/actions/list-crm-tasks.ts +0 -22
- package/corpus/templates/crm/actions/list-staged-datasets.ts +0 -14
- package/corpus/templates/crm/actions/list-workspace-connections.ts +0 -47
- package/corpus/templates/crm/actions/manage-crm-signal-tracker.ts +0 -87
- package/corpus/templates/crm/actions/manage-crm-task.ts +0 -132
- package/corpus/templates/crm/actions/navigate.ts +0 -63
- package/corpus/templates/crm/actions/provider-api-catalog.ts +0 -22
- package/corpus/templates/crm/actions/provider-api-docs.ts +0 -54
- package/corpus/templates/crm/actions/provider-api-request.ts +0 -92
- package/corpus/templates/crm/actions/query-staged-dataset.ts +0 -44
- package/corpus/templates/crm/actions/record-crm-call-insight.ts +0 -160
- package/corpus/templates/crm/actions/record-crm-smart-signal.ts +0 -150
- package/corpus/templates/crm/actions/restore-crm-dashboard-revision.ts +0 -23
- package/corpus/templates/crm/actions/review-crm-signal.ts +0 -31
- package/corpus/templates/crm/actions/run-crm-saved-view-program.ts +0 -103
- package/corpus/templates/crm/actions/run-crm-signal-trackers.ts +0 -275
- package/corpus/templates/crm/actions/run.ts +0 -7
- package/corpus/templates/crm/actions/save-crm-dashboard.ts +0 -51
- package/corpus/templates/crm/actions/save-crm-saved-view.ts +0 -119
- package/corpus/templates/crm/actions/sync-crm.ts +0 -146
- package/corpus/templates/crm/actions/update-crm-record.ts +0 -510
- package/corpus/templates/crm/actions/view-screen.ts +0 -218
- package/corpus/templates/crm/agent-native.app-skill.json +0 -58
- package/corpus/templates/crm/app/components/crm/CreateCrmRecordDialog.tsx +0 -158
- package/corpus/templates/crm/app/components/crm/CrmDashboardPanel.tsx +0 -78
- package/corpus/templates/crm/app/components/crm/CrmSignalsPanel.tsx +0 -226
- package/corpus/templates/crm/app/components/crm/IntelligenceSettings.tsx +0 -414
- package/corpus/templates/crm/app/components/crm/RecordActions.tsx +0 -510
- package/corpus/templates/crm/app/components/crm/RecordGrid.tsx +0 -134
- package/corpus/templates/crm/app/components/crm/RecordWorkspace.tsx +0 -362
- package/corpus/templates/crm/app/components/crm/SavedViewDataProgram.tsx +0 -93
- package/corpus/templates/crm/app/components/crm/Surface.tsx +0 -97
- package/corpus/templates/crm/app/components/crm/WorkOverview.tsx +0 -180
- package/corpus/templates/crm/app/components/layout/CrmLayout.tsx +0 -112
- package/corpus/templates/crm/app/components/layout/CrmSidebar.tsx +0 -84
- package/corpus/templates/crm/app/components/ui/alert-dialog.tsx +0 -1
- package/corpus/templates/crm/app/components/ui/badge.tsx +0 -1
- package/corpus/templates/crm/app/components/ui/button.tsx +0 -1
- package/corpus/templates/crm/app/components/ui/card.tsx +0 -1
- package/corpus/templates/crm/app/components/ui/dialog.tsx +0 -1
- package/corpus/templates/crm/app/components/ui/input.tsx +0 -1
- package/corpus/templates/crm/app/components/ui/label.tsx +0 -1
- package/corpus/templates/crm/app/components/ui/select.tsx +0 -1
- package/corpus/templates/crm/app/components/ui/sheet.tsx +0 -1
- package/corpus/templates/crm/app/components/ui/skeleton.tsx +0 -1
- package/corpus/templates/crm/app/components/ui/switch.tsx +0 -1
- package/corpus/templates/crm/app/components/ui/table.tsx +0 -1
- package/corpus/templates/crm/app/components/ui/tabs.tsx +0 -1
- package/corpus/templates/crm/app/components/ui/textarea.tsx +0 -1
- package/corpus/templates/crm/app/components/ui/toolkit-provider.tsx +0 -17
- package/corpus/templates/crm/app/design-system.ts +0 -3
- package/corpus/templates/crm/app/entry.client.tsx +0 -16
- package/corpus/templates/crm/app/entry.server.tsx +0 -10
- package/corpus/templates/crm/app/global.css +0 -167
- package/corpus/templates/crm/app/hooks/use-navigation-state.ts +0 -60
- package/corpus/templates/crm/app/i18n/en-US.ts +0 -89
- package/corpus/templates/crm/app/i18n/index.ts +0 -34
- package/corpus/templates/crm/app/lib/dashboard.ts +0 -13
- package/corpus/templates/crm/app/lib/navigation.ts +0 -54
- package/corpus/templates/crm/app/lib/tab-id.ts +0 -1
- package/corpus/templates/crm/app/lib/types.ts +0 -172
- package/corpus/templates/crm/app/lib/utils.ts +0 -1
- package/corpus/templates/crm/app/root.tsx +0 -91
- package/corpus/templates/crm/app/routes/_index.tsx +0 -26
- package/corpus/templates/crm/app/routes/accounts.tsx +0 -41
- package/corpus/templates/crm/app/routes/agent.tsx +0 -5
- package/corpus/templates/crm/app/routes/ask.tsx +0 -53
- package/corpus/templates/crm/app/routes/dashboard.tsx +0 -118
- package/corpus/templates/crm/app/routes/opportunities.tsx +0 -41
- package/corpus/templates/crm/app/routes/people.tsx +0 -41
- package/corpus/templates/crm/app/routes/proposals.tsx +0 -266
- package/corpus/templates/crm/app/routes/records.$recordId.tsx +0 -35
- package/corpus/templates/crm/app/routes/settings.tsx +0 -63
- package/corpus/templates/crm/app/routes/setup.tsx +0 -308
- package/corpus/templates/crm/app/routes/tasks.tsx +0 -252
- package/corpus/templates/crm/app/routes/views.tsx +0 -333
- package/corpus/templates/crm/app/routes.ts +0 -17
- package/corpus/templates/crm/app/vite-env.d.ts +0 -6
- package/corpus/templates/crm/changelog/2026-07-21-agent-native-crm.md +0 -6
- package/corpus/templates/crm/changelog/2026-07-21-clips-call-evidence-review-recipe.md +0 -6
- package/corpus/templates/crm/changelog/2026-07-21-crm-can-now-find-and-review-evidence-grounded-call-signals-w.md +0 -6
- package/corpus/templates/crm/changelog/2026-07-21-crm-can-now-manage-keyword-and-smart-call-signal-trackers-fr.md +0 -6
- package/corpus/templates/crm/changelog/2026-07-21-delegated-local-crm-automation.md +0 -6
- package/corpus/templates/crm/changelog/2026-07-21-native-sql.md +0 -6
- package/corpus/templates/crm/changelog/2026-07-21-pipeline-dashboard.md +0 -6
- package/corpus/templates/crm/changelog/2026-07-21-pipeline-dashboards-now-install-correctly-from-the-crm-actio.md +0 -6
- package/corpus/templates/crm/changelog/2026-07-21-salesforce-connection.md +0 -6
- package/corpus/templates/crm/changelog/2026-07-22-crm-field-validation-now-explains-which-fields-cannot-be-edi.md +0 -6
- package/corpus/templates/crm/changelog/2026-07-22-fixed-hubspot-contact-syncs-missing-records-updated-after-th.md +0 -6
- package/corpus/templates/crm/changelog/2026-07-22-fixed-pipeline-dashboard-panels-so-their-opportunity-data-lo.md +0 -6
- package/corpus/templates/crm/changelog/2026-07-22-full-page-chat-keeps-the-active-conversation-when-moving-to-.md +0 -6
- package/corpus/templates/crm/components.json +0 -20
- package/corpus/templates/crm/docs/architecture/crm-contract.md +0 -180
- package/corpus/templates/crm/learnings.defaults.md +0 -5
- package/corpus/templates/crm/package.json +0 -59
- package/corpus/templates/crm/public/favicon.svg +0 -1
- package/corpus/templates/crm/public/icon-180.svg +0 -1
- package/corpus/templates/crm/public/manifest.json +0 -11
- package/corpus/templates/crm/react-router.config.ts +0 -7
- package/corpus/templates/crm/server/crm/adapter.ts +0 -32
- package/corpus/templates/crm/server/crm/crm-field-firewall.ts +0 -64
- package/corpus/templates/crm/server/crm/crm-mirror.ts +0 -711
- package/corpus/templates/crm/server/crm/hubspot-adapter.ts +0 -1146
- package/corpus/templates/crm/server/crm/native-adapter.ts +0 -1715
- package/corpus/templates/crm/server/crm/read-through.ts +0 -207
- package/corpus/templates/crm/server/crm/salesforce-adapter.ts +0 -1255
- package/corpus/templates/crm/server/db/crm-store.ts +0 -1170
- package/corpus/templates/crm/server/db/index.ts +0 -169
- package/corpus/templates/crm/server/db/schema.ts +0 -441
- package/corpus/templates/crm/server/lib/intelligence/default-detectors.ts +0 -65
- package/corpus/templates/crm/server/lib/intelligence/evidence.ts +0 -105
- package/corpus/templates/crm/server/lib/intelligence/keyword-detector.ts +0 -100
- package/corpus/templates/crm/server/lib/intelligence/smart-detector.ts +0 -144
- package/corpus/templates/crm/server/lib/intelligence/summary.ts +0 -141
- package/corpus/templates/crm/server/lib/provider-api.ts +0 -64
- package/corpus/templates/crm/server/middleware/auth.ts +0 -4
- package/corpus/templates/crm/server/plugins/agent-chat.ts +0 -68
- package/corpus/templates/crm/server/plugins/auth.ts +0 -14
- package/corpus/templates/crm/server/plugins/core-routes.ts +0 -17
- package/corpus/templates/crm/server/plugins/db.ts +0 -454
- package/corpus/templates/crm/server/routes/[...page].get.ts +0 -5
- package/corpus/templates/crm/shared/crm-automation-recipes.ts +0 -132
- package/corpus/templates/crm/shared/crm-contract.ts +0 -254
- package/corpus/templates/crm/shared/crm-sales-config.ts +0 -63
- package/corpus/templates/crm/ssr-entry.ts +0 -11
- package/corpus/templates/crm/tsconfig.json +0 -24
- package/corpus/templates/crm/vite.config.ts +0 -15
- package/corpus/templates/crm/vitest.config.ts +0 -5
- package/dist/observability/hosted-model-experiment.d.ts +0 -39
- package/dist/observability/hosted-model-experiment.d.ts.map +0 -1
- package/dist/observability/hosted-model-experiment.js +0 -90
- package/dist/observability/hosted-model-experiment.js.map +0 -1
- package/src/observability/hosted-model-experiment.ts +0 -118
|
@@ -1,454 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ensureAdditiveColumns,
|
|
3
|
-
getDbExec,
|
|
4
|
-
runMigrations,
|
|
5
|
-
} from "@agent-native/core/db";
|
|
6
|
-
|
|
7
|
-
import * as schema from "../db/schema.js";
|
|
8
|
-
|
|
9
|
-
function ownableTable(name: string, columns: string): string {
|
|
10
|
-
return `CREATE TABLE IF NOT EXISTS ${name} (
|
|
11
|
-
${columns},
|
|
12
|
-
owner_email TEXT NOT NULL DEFAULT 'local@localhost',
|
|
13
|
-
org_id TEXT,
|
|
14
|
-
visibility TEXT NOT NULL DEFAULT 'private'
|
|
15
|
-
)`;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function sharesTable(name: string): string {
|
|
19
|
-
return `CREATE TABLE IF NOT EXISTS ${name} (
|
|
20
|
-
id TEXT PRIMARY KEY,
|
|
21
|
-
resource_id TEXT NOT NULL,
|
|
22
|
-
principal_type TEXT NOT NULL,
|
|
23
|
-
principal_id TEXT NOT NULL,
|
|
24
|
-
role TEXT NOT NULL DEFAULT 'viewer',
|
|
25
|
-
created_by TEXT NOT NULL,
|
|
26
|
-
created_at TEXT NOT NULL DEFAULT (datetime('now'))
|
|
27
|
-
)`;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
const initialSchema = [
|
|
31
|
-
ownableTable(
|
|
32
|
-
"crm_connections",
|
|
33
|
-
` id TEXT PRIMARY KEY,
|
|
34
|
-
provider TEXT NOT NULL,
|
|
35
|
-
workspace_connection_id TEXT,
|
|
36
|
-
label TEXT NOT NULL,
|
|
37
|
-
account_id TEXT,
|
|
38
|
-
mode TEXT NOT NULL DEFAULT 'connected',
|
|
39
|
-
status TEXT NOT NULL DEFAULT 'connected',
|
|
40
|
-
selected_pipelines_json TEXT NOT NULL DEFAULT '[]',
|
|
41
|
-
selected_object_types_json TEXT NOT NULL DEFAULT '[]',
|
|
42
|
-
access_scope_key TEXT NOT NULL,
|
|
43
|
-
access_scope_json TEXT NOT NULL DEFAULT '{}',
|
|
44
|
-
last_synced_at TEXT,
|
|
45
|
-
last_error TEXT,
|
|
46
|
-
created_at TEXT NOT NULL DEFAULT (datetime('now')),
|
|
47
|
-
updated_at TEXT NOT NULL DEFAULT (datetime('now'))`,
|
|
48
|
-
),
|
|
49
|
-
sharesTable("crm_connection_shares"),
|
|
50
|
-
ownableTable(
|
|
51
|
-
"crm_objects",
|
|
52
|
-
` id TEXT PRIMARY KEY,
|
|
53
|
-
connection_id TEXT NOT NULL,
|
|
54
|
-
provider TEXT NOT NULL,
|
|
55
|
-
object_type TEXT NOT NULL,
|
|
56
|
-
kind TEXT NOT NULL,
|
|
57
|
-
label TEXT NOT NULL,
|
|
58
|
-
plural_label TEXT NOT NULL,
|
|
59
|
-
custom INTEGER NOT NULL DEFAULT 0,
|
|
60
|
-
queryable INTEGER NOT NULL DEFAULT 1,
|
|
61
|
-
searchable INTEGER NOT NULL DEFAULT 1,
|
|
62
|
-
createable INTEGER NOT NULL DEFAULT 0,
|
|
63
|
-
updateable INTEGER NOT NULL DEFAULT 0,
|
|
64
|
-
deleteable INTEGER NOT NULL DEFAULT 0,
|
|
65
|
-
capabilities_json TEXT NOT NULL DEFAULT '{}',
|
|
66
|
-
created_at TEXT NOT NULL DEFAULT (datetime('now')),
|
|
67
|
-
updated_at TEXT NOT NULL DEFAULT (datetime('now'))`,
|
|
68
|
-
),
|
|
69
|
-
sharesTable("crm_object_shares"),
|
|
70
|
-
ownableTable(
|
|
71
|
-
"crm_field_policies",
|
|
72
|
-
` id TEXT PRIMARY KEY,
|
|
73
|
-
connection_id TEXT NOT NULL,
|
|
74
|
-
object_type TEXT NOT NULL,
|
|
75
|
-
field_name TEXT NOT NULL,
|
|
76
|
-
label TEXT NOT NULL,
|
|
77
|
-
value_type TEXT NOT NULL,
|
|
78
|
-
storage_policy TEXT NOT NULL DEFAULT 'remote-only',
|
|
79
|
-
sensitive INTEGER NOT NULL DEFAULT 0,
|
|
80
|
-
readable INTEGER NOT NULL DEFAULT 1,
|
|
81
|
-
createable INTEGER NOT NULL DEFAULT 0,
|
|
82
|
-
updateable INTEGER NOT NULL DEFAULT 0,
|
|
83
|
-
required INTEGER NOT NULL DEFAULT 0,
|
|
84
|
-
metadata_json TEXT NOT NULL DEFAULT '{}',
|
|
85
|
-
created_at TEXT NOT NULL DEFAULT (datetime('now')),
|
|
86
|
-
updated_at TEXT NOT NULL DEFAULT (datetime('now'))`,
|
|
87
|
-
),
|
|
88
|
-
sharesTable("crm_field_policy_shares"),
|
|
89
|
-
ownableTable(
|
|
90
|
-
"crm_records",
|
|
91
|
-
` id TEXT PRIMARY KEY,
|
|
92
|
-
connection_id TEXT NOT NULL,
|
|
93
|
-
provider TEXT NOT NULL,
|
|
94
|
-
object_type TEXT NOT NULL,
|
|
95
|
-
kind TEXT NOT NULL,
|
|
96
|
-
remote_id TEXT NOT NULL,
|
|
97
|
-
display_name TEXT NOT NULL,
|
|
98
|
-
primary_email TEXT,
|
|
99
|
-
domain TEXT,
|
|
100
|
-
stage TEXT,
|
|
101
|
-
pipeline_id TEXT,
|
|
102
|
-
pipeline_name TEXT,
|
|
103
|
-
owner_remote_id TEXT,
|
|
104
|
-
owner_name TEXT,
|
|
105
|
-
amount REAL,
|
|
106
|
-
currency_code TEXT,
|
|
107
|
-
close_date TEXT,
|
|
108
|
-
desired_cadence_days INTEGER,
|
|
109
|
-
last_meaningful_interaction_at TEXT,
|
|
110
|
-
next_contact_at TEXT,
|
|
111
|
-
remote_revision TEXT,
|
|
112
|
-
remote_updated_at TEXT,
|
|
113
|
-
last_synced_at TEXT,
|
|
114
|
-
access_scope_key TEXT NOT NULL,
|
|
115
|
-
access_scope_json TEXT NOT NULL DEFAULT '{}',
|
|
116
|
-
tombstone INTEGER NOT NULL DEFAULT 0,
|
|
117
|
-
created_at TEXT NOT NULL DEFAULT (datetime('now')),
|
|
118
|
-
updated_at TEXT NOT NULL DEFAULT (datetime('now'))`,
|
|
119
|
-
),
|
|
120
|
-
sharesTable("crm_record_shares"),
|
|
121
|
-
ownableTable(
|
|
122
|
-
"crm_record_fields",
|
|
123
|
-
` id TEXT PRIMARY KEY,
|
|
124
|
-
record_id TEXT NOT NULL,
|
|
125
|
-
field_policy_id TEXT,
|
|
126
|
-
field_name TEXT NOT NULL,
|
|
127
|
-
value_type TEXT NOT NULL,
|
|
128
|
-
storage_policy TEXT NOT NULL,
|
|
129
|
-
string_value TEXT,
|
|
130
|
-
number_value REAL,
|
|
131
|
-
boolean_value INTEGER,
|
|
132
|
-
json_value TEXT,
|
|
133
|
-
provenance_json TEXT NOT NULL DEFAULT '[]',
|
|
134
|
-
access_scope_key TEXT NOT NULL DEFAULT 'unverified',
|
|
135
|
-
access_scope_json TEXT NOT NULL DEFAULT '{}',
|
|
136
|
-
remote_revision TEXT,
|
|
137
|
-
created_at TEXT NOT NULL DEFAULT (datetime('now')),
|
|
138
|
-
updated_at TEXT NOT NULL DEFAULT (datetime('now'))`,
|
|
139
|
-
),
|
|
140
|
-
sharesTable("crm_record_field_shares"),
|
|
141
|
-
ownableTable(
|
|
142
|
-
"crm_relationships",
|
|
143
|
-
` id TEXT PRIMARY KEY,
|
|
144
|
-
connection_id TEXT NOT NULL,
|
|
145
|
-
from_record_id TEXT NOT NULL,
|
|
146
|
-
to_record_id TEXT NOT NULL,
|
|
147
|
-
relationship_type TEXT NOT NULL,
|
|
148
|
-
label TEXT,
|
|
149
|
-
inverse_label TEXT,
|
|
150
|
-
source_field TEXT,
|
|
151
|
-
remote_relationship_id TEXT,
|
|
152
|
-
remote_revision TEXT,
|
|
153
|
-
tombstone INTEGER NOT NULL DEFAULT 0,
|
|
154
|
-
last_synced_at TEXT,
|
|
155
|
-
created_at TEXT NOT NULL DEFAULT (datetime('now')),
|
|
156
|
-
updated_at TEXT NOT NULL DEFAULT (datetime('now'))`,
|
|
157
|
-
),
|
|
158
|
-
sharesTable("crm_relationship_shares"),
|
|
159
|
-
ownableTable(
|
|
160
|
-
"crm_interactions",
|
|
161
|
-
` id TEXT PRIMARY KEY,
|
|
162
|
-
record_id TEXT NOT NULL,
|
|
163
|
-
connection_id TEXT,
|
|
164
|
-
kind TEXT NOT NULL,
|
|
165
|
-
direction TEXT NOT NULL DEFAULT 'unknown',
|
|
166
|
-
title TEXT NOT NULL,
|
|
167
|
-
summary TEXT NOT NULL DEFAULT '',
|
|
168
|
-
occurred_at TEXT NOT NULL,
|
|
169
|
-
meaningful INTEGER NOT NULL DEFAULT 1,
|
|
170
|
-
provider_object_type TEXT,
|
|
171
|
-
provider_remote_id TEXT,
|
|
172
|
-
source_app TEXT,
|
|
173
|
-
source_url TEXT,
|
|
174
|
-
participants_json TEXT NOT NULL DEFAULT '[]',
|
|
175
|
-
created_at TEXT NOT NULL DEFAULT (datetime('now')),
|
|
176
|
-
updated_at TEXT NOT NULL DEFAULT (datetime('now'))`,
|
|
177
|
-
),
|
|
178
|
-
sharesTable("crm_interaction_shares"),
|
|
179
|
-
ownableTable(
|
|
180
|
-
"crm_call_evidence",
|
|
181
|
-
` id TEXT PRIMARY KEY,
|
|
182
|
-
interaction_id TEXT,
|
|
183
|
-
record_id TEXT NOT NULL,
|
|
184
|
-
source_app TEXT NOT NULL DEFAULT 'clips',
|
|
185
|
-
artifact_type TEXT NOT NULL DEFAULT 'call-evidence',
|
|
186
|
-
artifact_id TEXT NOT NULL,
|
|
187
|
-
source_url TEXT NOT NULL,
|
|
188
|
-
quote TEXT NOT NULL DEFAULT '',
|
|
189
|
-
speaker TEXT,
|
|
190
|
-
start_seconds REAL,
|
|
191
|
-
end_seconds REAL,
|
|
192
|
-
summary TEXT NOT NULL DEFAULT '',
|
|
193
|
-
captured_at TEXT NOT NULL,
|
|
194
|
-
created_at TEXT NOT NULL DEFAULT (datetime('now')),
|
|
195
|
-
updated_at TEXT NOT NULL DEFAULT (datetime('now'))`,
|
|
196
|
-
),
|
|
197
|
-
sharesTable("crm_call_evidence_shares"),
|
|
198
|
-
ownableTable(
|
|
199
|
-
"crm_tasks",
|
|
200
|
-
` id TEXT PRIMARY KEY,
|
|
201
|
-
record_id TEXT,
|
|
202
|
-
title TEXT NOT NULL,
|
|
203
|
-
description TEXT NOT NULL DEFAULT '',
|
|
204
|
-
status TEXT NOT NULL DEFAULT 'open',
|
|
205
|
-
due_at TEXT,
|
|
206
|
-
assigned_to TEXT,
|
|
207
|
-
authority TEXT NOT NULL DEFAULT 'local',
|
|
208
|
-
connection_id TEXT,
|
|
209
|
-
provider_object_type TEXT,
|
|
210
|
-
provider_remote_id TEXT,
|
|
211
|
-
remote_revision TEXT,
|
|
212
|
-
completed_at TEXT,
|
|
213
|
-
created_at TEXT NOT NULL DEFAULT (datetime('now')),
|
|
214
|
-
updated_at TEXT NOT NULL DEFAULT (datetime('now'))`,
|
|
215
|
-
),
|
|
216
|
-
sharesTable("crm_task_shares"),
|
|
217
|
-
ownableTable(
|
|
218
|
-
"crm_saved_views",
|
|
219
|
-
` id TEXT PRIMARY KEY,
|
|
220
|
-
name TEXT NOT NULL,
|
|
221
|
-
description TEXT NOT NULL DEFAULT '',
|
|
222
|
-
kind TEXT,
|
|
223
|
-
filters_json TEXT NOT NULL DEFAULT '{}',
|
|
224
|
-
columns_json TEXT NOT NULL DEFAULT '[]',
|
|
225
|
-
sort_json TEXT NOT NULL DEFAULT '[]',
|
|
226
|
-
data_program_id TEXT,
|
|
227
|
-
pinned INTEGER NOT NULL DEFAULT 0,
|
|
228
|
-
created_at TEXT NOT NULL DEFAULT (datetime('now')),
|
|
229
|
-
updated_at TEXT NOT NULL DEFAULT (datetime('now'))`,
|
|
230
|
-
),
|
|
231
|
-
sharesTable("crm_saved_view_shares"),
|
|
232
|
-
ownableTable(
|
|
233
|
-
"crm_mutations",
|
|
234
|
-
` id TEXT PRIMARY KEY,
|
|
235
|
-
record_id TEXT,
|
|
236
|
-
connection_id TEXT,
|
|
237
|
-
operation TEXT NOT NULL,
|
|
238
|
-
initiated_by TEXT NOT NULL,
|
|
239
|
-
target TEXT NOT NULL,
|
|
240
|
-
policy_decision TEXT NOT NULL,
|
|
241
|
-
risk TEXT NOT NULL DEFAULT 'routine',
|
|
242
|
-
status TEXT NOT NULL DEFAULT 'pending',
|
|
243
|
-
patch_json TEXT NOT NULL DEFAULT '{}',
|
|
244
|
-
before_json TEXT NOT NULL DEFAULT '{}',
|
|
245
|
-
after_json TEXT NOT NULL DEFAULT '{}',
|
|
246
|
-
idempotency_key TEXT NOT NULL,
|
|
247
|
-
expected_remote_revision TEXT,
|
|
248
|
-
provider_remote_revision TEXT,
|
|
249
|
-
approved_by TEXT,
|
|
250
|
-
approved_at TEXT,
|
|
251
|
-
applied_at TEXT,
|
|
252
|
-
error TEXT,
|
|
253
|
-
created_at TEXT NOT NULL DEFAULT (datetime('now')),
|
|
254
|
-
updated_at TEXT NOT NULL DEFAULT (datetime('now'))`,
|
|
255
|
-
),
|
|
256
|
-
sharesTable("crm_mutation_shares"),
|
|
257
|
-
ownableTable(
|
|
258
|
-
"crm_sync_runs",
|
|
259
|
-
` id TEXT PRIMARY KEY,
|
|
260
|
-
connection_id TEXT NOT NULL,
|
|
261
|
-
status TEXT NOT NULL DEFAULT 'running',
|
|
262
|
-
scope_json TEXT NOT NULL DEFAULT '{}',
|
|
263
|
-
cursor TEXT,
|
|
264
|
-
records_upserted INTEGER NOT NULL DEFAULT 0,
|
|
265
|
-
tombstones_applied INTEGER NOT NULL DEFAULT 0,
|
|
266
|
-
relationships_upserted INTEGER NOT NULL DEFAULT 0,
|
|
267
|
-
error TEXT,
|
|
268
|
-
started_at TEXT NOT NULL,
|
|
269
|
-
completed_at TEXT,
|
|
270
|
-
created_at TEXT NOT NULL DEFAULT (datetime('now')),
|
|
271
|
-
updated_at TEXT NOT NULL DEFAULT (datetime('now'))`,
|
|
272
|
-
),
|
|
273
|
-
sharesTable("crm_sync_run_shares"),
|
|
274
|
-
`CREATE UNIQUE INDEX IF NOT EXISTS crm_connections_workspace_idx ON crm_connections (workspace_connection_id)`,
|
|
275
|
-
`CREATE UNIQUE INDEX IF NOT EXISTS crm_objects_connection_type_idx ON crm_objects (connection_id, object_type)`,
|
|
276
|
-
`CREATE UNIQUE INDEX IF NOT EXISTS crm_field_policies_connection_field_idx ON crm_field_policies (connection_id, object_type, field_name)`,
|
|
277
|
-
`CREATE UNIQUE INDEX IF NOT EXISTS crm_records_remote_identity_idx ON crm_records (connection_id, object_type, remote_id)`,
|
|
278
|
-
`CREATE INDEX IF NOT EXISTS crm_records_owner_updated_idx ON crm_records (owner_email, org_id, updated_at)`,
|
|
279
|
-
`CREATE INDEX IF NOT EXISTS crm_records_kind_scope_idx ON crm_records (connection_id, kind, tombstone)`,
|
|
280
|
-
`CREATE INDEX IF NOT EXISTS crm_records_email_idx ON crm_records (primary_email)`,
|
|
281
|
-
`CREATE INDEX IF NOT EXISTS crm_records_domain_idx ON crm_records (domain)`,
|
|
282
|
-
`CREATE UNIQUE INDEX IF NOT EXISTS crm_record_fields_record_name_idx ON crm_record_fields (record_id, field_name)`,
|
|
283
|
-
`CREATE INDEX IF NOT EXISTS crm_relationships_from_idx ON crm_relationships (from_record_id, tombstone)`,
|
|
284
|
-
`CREATE INDEX IF NOT EXISTS crm_relationships_to_idx ON crm_relationships (to_record_id, tombstone)`,
|
|
285
|
-
`CREATE INDEX IF NOT EXISTS crm_interactions_record_occurred_idx ON crm_interactions (record_id, occurred_at)`,
|
|
286
|
-
`CREATE UNIQUE INDEX IF NOT EXISTS crm_call_evidence_artifact_idx ON crm_call_evidence (source_app, artifact_id, record_id)`,
|
|
287
|
-
`CREATE INDEX IF NOT EXISTS crm_call_evidence_record_idx ON crm_call_evidence (record_id, captured_at)`,
|
|
288
|
-
`CREATE INDEX IF NOT EXISTS crm_tasks_owner_status_idx ON crm_tasks (owner_email, org_id, status, due_at)`,
|
|
289
|
-
`CREATE INDEX IF NOT EXISTS crm_tasks_record_status_idx ON crm_tasks (record_id, status)`,
|
|
290
|
-
`CREATE INDEX IF NOT EXISTS crm_saved_views_owner_pinned_idx ON crm_saved_views (owner_email, org_id, pinned, updated_at)`,
|
|
291
|
-
`CREATE UNIQUE INDEX IF NOT EXISTS crm_mutations_idempotency_idx ON crm_mutations (idempotency_key)`,
|
|
292
|
-
`CREATE INDEX IF NOT EXISTS crm_mutations_owner_status_idx ON crm_mutations (owner_email, org_id, status, created_at)`,
|
|
293
|
-
`CREATE INDEX IF NOT EXISTS crm_sync_runs_connection_started_idx ON crm_sync_runs (connection_id, started_at)`,
|
|
294
|
-
...[
|
|
295
|
-
"crm_connection_shares",
|
|
296
|
-
"crm_object_shares",
|
|
297
|
-
"crm_field_policy_shares",
|
|
298
|
-
"crm_record_shares",
|
|
299
|
-
"crm_record_field_shares",
|
|
300
|
-
"crm_relationship_shares",
|
|
301
|
-
"crm_interaction_shares",
|
|
302
|
-
"crm_call_evidence_shares",
|
|
303
|
-
"crm_task_shares",
|
|
304
|
-
"crm_saved_view_shares",
|
|
305
|
-
"crm_mutation_shares",
|
|
306
|
-
"crm_sync_run_shares",
|
|
307
|
-
].map(
|
|
308
|
-
(name) =>
|
|
309
|
-
`CREATE INDEX IF NOT EXISTS ${name}_principal_idx ON ${name} (resource_id, principal_type, principal_id)`,
|
|
310
|
-
),
|
|
311
|
-
].join(";\n");
|
|
312
|
-
|
|
313
|
-
const signalsSchema = [
|
|
314
|
-
ownableTable(
|
|
315
|
-
"crm_signal_trackers",
|
|
316
|
-
` id TEXT PRIMARY KEY,
|
|
317
|
-
name TEXT NOT NULL,
|
|
318
|
-
description TEXT NOT NULL DEFAULT '',
|
|
319
|
-
kind TEXT NOT NULL,
|
|
320
|
-
keywords_json TEXT NOT NULL DEFAULT '[]',
|
|
321
|
-
classifier_prompt TEXT NOT NULL DEFAULT '',
|
|
322
|
-
enabled INTEGER NOT NULL DEFAULT 1,
|
|
323
|
-
is_default INTEGER NOT NULL DEFAULT 0,
|
|
324
|
-
created_at TEXT NOT NULL DEFAULT (datetime('now')),
|
|
325
|
-
updated_at TEXT NOT NULL DEFAULT (datetime('now'))`,
|
|
326
|
-
),
|
|
327
|
-
sharesTable("crm_signal_tracker_shares"),
|
|
328
|
-
ownableTable(
|
|
329
|
-
"crm_signal_runs",
|
|
330
|
-
` id TEXT PRIMARY KEY,
|
|
331
|
-
tracker_id TEXT,
|
|
332
|
-
record_id TEXT NOT NULL,
|
|
333
|
-
kind TEXT NOT NULL,
|
|
334
|
-
status TEXT NOT NULL DEFAULT 'queued',
|
|
335
|
-
evidence_count INTEGER NOT NULL DEFAULT 0,
|
|
336
|
-
model TEXT,
|
|
337
|
-
model_version TEXT,
|
|
338
|
-
idempotency_key TEXT NOT NULL,
|
|
339
|
-
error TEXT,
|
|
340
|
-
created_at TEXT NOT NULL DEFAULT (datetime('now')),
|
|
341
|
-
updated_at TEXT NOT NULL DEFAULT (datetime('now')),
|
|
342
|
-
completed_at TEXT`,
|
|
343
|
-
),
|
|
344
|
-
sharesTable("crm_signal_run_shares"),
|
|
345
|
-
ownableTable(
|
|
346
|
-
"crm_signals",
|
|
347
|
-
` id TEXT PRIMARY KEY,
|
|
348
|
-
run_id TEXT,
|
|
349
|
-
tracker_id TEXT,
|
|
350
|
-
record_id TEXT NOT NULL,
|
|
351
|
-
evidence_id TEXT NOT NULL,
|
|
352
|
-
kind TEXT NOT NULL,
|
|
353
|
-
label TEXT NOT NULL,
|
|
354
|
-
quote TEXT NOT NULL DEFAULT '',
|
|
355
|
-
speaker TEXT,
|
|
356
|
-
start_seconds REAL,
|
|
357
|
-
end_seconds REAL,
|
|
358
|
-
summary TEXT NOT NULL DEFAULT '',
|
|
359
|
-
confidence REAL NOT NULL DEFAULT 0,
|
|
360
|
-
detector TEXT NOT NULL,
|
|
361
|
-
model TEXT,
|
|
362
|
-
model_version TEXT,
|
|
363
|
-
review_status TEXT NOT NULL DEFAULT 'unreviewed',
|
|
364
|
-
idempotency_key TEXT NOT NULL,
|
|
365
|
-
created_at TEXT NOT NULL DEFAULT (datetime('now')),
|
|
366
|
-
updated_at TEXT NOT NULL DEFAULT (datetime('now'))`,
|
|
367
|
-
),
|
|
368
|
-
sharesTable("crm_signal_shares"),
|
|
369
|
-
`CREATE INDEX IF NOT EXISTS crm_signal_trackers_scope_idx ON crm_signal_trackers (owner_email, org_id, enabled)`,
|
|
370
|
-
`CREATE UNIQUE INDEX IF NOT EXISTS crm_signal_runs_idempotency_idx ON crm_signal_runs (idempotency_key)`,
|
|
371
|
-
`CREATE INDEX IF NOT EXISTS crm_signal_runs_record_created_idx ON crm_signal_runs (record_id, created_at)`,
|
|
372
|
-
`CREATE UNIQUE INDEX IF NOT EXISTS crm_signals_idempotency_idx ON crm_signals (idempotency_key)`,
|
|
373
|
-
`CREATE INDEX IF NOT EXISTS crm_signals_record_created_idx ON crm_signals (record_id, created_at)`,
|
|
374
|
-
`CREATE INDEX IF NOT EXISTS crm_signals_evidence_created_idx ON crm_signals (evidence_id, created_at)`,
|
|
375
|
-
`CREATE INDEX IF NOT EXISTS crm_signals_tracker_review_idx ON crm_signals (tracker_id, review_status)`,
|
|
376
|
-
...[
|
|
377
|
-
"crm_signal_tracker_shares",
|
|
378
|
-
"crm_signal_run_shares",
|
|
379
|
-
"crm_signal_shares",
|
|
380
|
-
].map(
|
|
381
|
-
(name) =>
|
|
382
|
-
`CREATE INDEX IF NOT EXISTS ${name}_principal_idx ON ${name} (resource_id, principal_type, principal_id)`,
|
|
383
|
-
),
|
|
384
|
-
].join(";\n");
|
|
385
|
-
|
|
386
|
-
const dashboardsSchema = [
|
|
387
|
-
ownableTable(
|
|
388
|
-
"crm_dashboards",
|
|
389
|
-
` id TEXT PRIMARY KEY,
|
|
390
|
-
kind TEXT NOT NULL,
|
|
391
|
-
title TEXT NOT NULL DEFAULT 'Untitled',
|
|
392
|
-
config TEXT NOT NULL,
|
|
393
|
-
created_at TEXT NOT NULL DEFAULT (datetime('now')),
|
|
394
|
-
updated_at TEXT NOT NULL DEFAULT (datetime('now')),
|
|
395
|
-
updated_by TEXT,
|
|
396
|
-
archived_at TEXT`,
|
|
397
|
-
),
|
|
398
|
-
ownableTable(
|
|
399
|
-
"crm_dashboard_revisions",
|
|
400
|
-
` id TEXT PRIMARY KEY,
|
|
401
|
-
dashboard_id TEXT NOT NULL,
|
|
402
|
-
kind TEXT NOT NULL,
|
|
403
|
-
title TEXT NOT NULL,
|
|
404
|
-
config TEXT NOT NULL,
|
|
405
|
-
created_at TEXT NOT NULL DEFAULT (datetime('now')),
|
|
406
|
-
created_by TEXT`,
|
|
407
|
-
),
|
|
408
|
-
sharesTable("crm_dashboard_shares"),
|
|
409
|
-
`CREATE INDEX IF NOT EXISTS crm_dashboards_owner_updated_idx ON crm_dashboards (owner_email, org_id, updated_at)`,
|
|
410
|
-
`CREATE INDEX IF NOT EXISTS crm_dashboard_revisions_dashboard_created_idx ON crm_dashboard_revisions (dashboard_id, created_at)`,
|
|
411
|
-
`CREATE INDEX IF NOT EXISTS crm_dashboard_shares_principal_idx ON crm_dashboard_shares (resource_id, principal_type, principal_id)`,
|
|
412
|
-
].join(";\n");
|
|
413
|
-
|
|
414
|
-
const runCrmMigrations = runMigrations(
|
|
415
|
-
[
|
|
416
|
-
{ version: 1, name: "crm-initial-thin-mirror-schema", sql: initialSchema },
|
|
417
|
-
{ version: 2, name: "crm-signals-engine-schema", sql: signalsSchema },
|
|
418
|
-
{ version: 3, name: "crm-dashboard-storage-schema", sql: dashboardsSchema },
|
|
419
|
-
],
|
|
420
|
-
{ table: "crm_migrations" },
|
|
421
|
-
);
|
|
422
|
-
|
|
423
|
-
function isDrizzleTable(value: unknown): value is object {
|
|
424
|
-
return (
|
|
425
|
-
!!value &&
|
|
426
|
-
typeof value === "object" &&
|
|
427
|
-
Object.getOwnPropertySymbols(value).some((symbol) =>
|
|
428
|
-
symbol.toString().includes("drizzle"),
|
|
429
|
-
)
|
|
430
|
-
);
|
|
431
|
-
}
|
|
432
|
-
|
|
433
|
-
const schemaTables = Object.values(schema).filter(isDrizzleTable);
|
|
434
|
-
|
|
435
|
-
export default async (nitroApp: unknown): Promise<void> => {
|
|
436
|
-
await runCrmMigrations(nitroApp);
|
|
437
|
-
try {
|
|
438
|
-
const result = await ensureAdditiveColumns({
|
|
439
|
-
db: getDbExec(),
|
|
440
|
-
tables: schemaTables,
|
|
441
|
-
});
|
|
442
|
-
if (result.errors.length > 0) {
|
|
443
|
-
console.warn(
|
|
444
|
-
"[crm/db] additive schema check reported errors",
|
|
445
|
-
result.errors,
|
|
446
|
-
);
|
|
447
|
-
}
|
|
448
|
-
} catch (error) {
|
|
449
|
-
console.warn(
|
|
450
|
-
"[crm/db] additive schema check failed",
|
|
451
|
-
error instanceof Error ? error.message : error,
|
|
452
|
-
);
|
|
453
|
-
}
|
|
454
|
-
};
|
|
@@ -1,132 +0,0 @@
|
|
|
1
|
-
export const CLIPS_CALL_EVIDENCE_RECIPE_ID = "clips-call-evidence-review";
|
|
2
|
-
|
|
3
|
-
const CLIPS_PAGE_PATH = /\/(?:share|r)\/[^/]+\/?$/i;
|
|
4
|
-
const UNSAFE_CLIPS_QUERY_KEY =
|
|
5
|
-
/^(?:access|expires|password|signature|sig|token)$/i;
|
|
6
|
-
const MEDIA_PATH =
|
|
7
|
-
/\/(?:api\/video|api\/agent-transcript|api\/public-recording)\b|\.(?:m4a|mov|mp3|mp4|wav|webm)(?:\/)?$/i;
|
|
8
|
-
|
|
9
|
-
export interface CrmAutomationRecipe {
|
|
10
|
-
id: typeof CLIPS_CALL_EVIDENCE_RECIPE_ID;
|
|
11
|
-
title: string;
|
|
12
|
-
description: string;
|
|
13
|
-
enabledByDefault: false;
|
|
14
|
-
triggerEvent: "clip.created";
|
|
15
|
-
automationName: string;
|
|
16
|
-
recordId: string;
|
|
17
|
-
handoff: {
|
|
18
|
-
sourceApp: "clips";
|
|
19
|
-
artifactType: "call-evidence";
|
|
20
|
-
requiresExplicitRecordSelection: true;
|
|
21
|
-
requiresDurablePageUrl: true;
|
|
22
|
-
excludes: readonly ["event url", "media", "transcript"];
|
|
23
|
-
};
|
|
24
|
-
agentContext: string;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export function isDurableClipsEvidenceUrl(value: string): boolean {
|
|
28
|
-
try {
|
|
29
|
-
const url = new URL(value);
|
|
30
|
-
if (
|
|
31
|
-
url.protocol !== "https:" ||
|
|
32
|
-
url.username ||
|
|
33
|
-
url.password ||
|
|
34
|
-
url.hash ||
|
|
35
|
-
MEDIA_PATH.test(url.pathname) ||
|
|
36
|
-
!CLIPS_PAGE_PATH.test(url.pathname)
|
|
37
|
-
) {
|
|
38
|
-
return false;
|
|
39
|
-
}
|
|
40
|
-
return ![...url.searchParams.keys()].some((key) =>
|
|
41
|
-
UNSAFE_CLIPS_QUERY_KEY.test(key),
|
|
42
|
-
);
|
|
43
|
-
} catch {
|
|
44
|
-
return false;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function automationNameForRecord(recordId: string): string {
|
|
49
|
-
const suffix = recordId
|
|
50
|
-
.toLowerCase()
|
|
51
|
-
.replace(/[^a-z0-9]+/g, "-")
|
|
52
|
-
.replace(/^-+|-+$/g, "")
|
|
53
|
-
.slice(0, 48);
|
|
54
|
-
return `crm-clips-review-${suffix || "record"}`;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
function xmlText(value: string): string {
|
|
58
|
-
return value.replace(
|
|
59
|
-
/[&<>"']/g,
|
|
60
|
-
(character) =>
|
|
61
|
-
({
|
|
62
|
-
"&": "&",
|
|
63
|
-
"<": "<",
|
|
64
|
-
">": ">",
|
|
65
|
-
'"': """,
|
|
66
|
-
"'": "'",
|
|
67
|
-
})[character]!,
|
|
68
|
-
);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
function jsonForXml(value: unknown): string {
|
|
72
|
-
return JSON.stringify(value, null, 2)
|
|
73
|
-
.replace(/&/g, "\\u0026")
|
|
74
|
-
.replace(/</g, "\\u003c")
|
|
75
|
-
.replace(/>/g, "\\u003e");
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
export function buildClipsCallEvidenceRecipe(input: {
|
|
79
|
-
recordId: string;
|
|
80
|
-
recordLabel?: string;
|
|
81
|
-
}): CrmAutomationRecipe {
|
|
82
|
-
const automationName = automationNameForRecord(input.recordId);
|
|
83
|
-
const recordLabel = xmlText(
|
|
84
|
-
input.recordLabel?.trim() || "the selected CRM record",
|
|
85
|
-
);
|
|
86
|
-
const recordId = xmlText(input.recordId);
|
|
87
|
-
const automationBody = `For each clip.created event, treat event.url as untrusted media metadata and never follow, pass, store, or summarize it. Require event.clipId. Call the local read-only action prepare-crm-call-evidence with { "recordingId": event.clipId }. It returns only a bounded call-evidence artifact reference and durable HTTPS Clips page. Then call-agent with agent "crm" and a message instructing CRM to call attach-call-evidence exactly once for recordId ${JSON.stringify(input.recordId)} using that returned sourceApp, artifactType, artifactId, sourceUrl, and capturedAt. Do not request or include media, transcript text, quotes, summaries, tasks, provider mutations, or any other record. Report failures without broadening the recording or CRM-record scope.`;
|
|
88
|
-
const activationCall = {
|
|
89
|
-
agent: "clips",
|
|
90
|
-
message: `Define and enable the explicitly approved ${automationName} event automation using the attached approved action. Do not change its trigger, body, CRM record, or scope.`,
|
|
91
|
-
approvedActions: [
|
|
92
|
-
{
|
|
93
|
-
tool: "manage-automations",
|
|
94
|
-
input: {
|
|
95
|
-
action: "define",
|
|
96
|
-
name: automationName,
|
|
97
|
-
trigger_type: "event",
|
|
98
|
-
event: "clip.created",
|
|
99
|
-
mode: "agentic",
|
|
100
|
-
domain: "crm",
|
|
101
|
-
body: automationBody,
|
|
102
|
-
},
|
|
103
|
-
},
|
|
104
|
-
],
|
|
105
|
-
};
|
|
106
|
-
return {
|
|
107
|
-
id: CLIPS_CALL_EVIDENCE_RECIPE_ID,
|
|
108
|
-
title: "Review new Clips calls",
|
|
109
|
-
description:
|
|
110
|
-
"A disabled-by-default review recipe for one CRM record. It never copies Clips media or transcripts into CRM.",
|
|
111
|
-
enabledByDefault: false,
|
|
112
|
-
triggerEvent: "clip.created",
|
|
113
|
-
automationName,
|
|
114
|
-
recordId: input.recordId,
|
|
115
|
-
handoff: {
|
|
116
|
-
sourceApp: "clips",
|
|
117
|
-
artifactType: "call-evidence",
|
|
118
|
-
requiresExplicitRecordSelection: true,
|
|
119
|
-
requiresDurablePageUrl: true,
|
|
120
|
-
excludes: ["event url", "media", "transcript"],
|
|
121
|
-
},
|
|
122
|
-
agentContext: `<crm-automation-recipe id="${CLIPS_CALL_EVIDENCE_RECIPE_ID}">
|
|
123
|
-
The user selected ${recordLabel} (CRM record ID: ${recordId}) for a Clips call-evidence review recipe.
|
|
124
|
-
|
|
125
|
-
This is a default-off configuration. Do not create or enable an automation merely because this recipe was opened. Explain that activation creates a Clips-owned clip.created trigger and allows one bounded local CRM evidence-reference write to this selected record per event. It never authorizes provider writes, transcript or media access, inference of another record, tasks, or field updates.
|
|
126
|
-
|
|
127
|
-
If the user explicitly approves activation, call call-agent with the following exact input. The approvedActions grant is content-addressed to this one Clips automation definition; do not alter it or call manage-automations in CRM:
|
|
128
|
-
|
|
129
|
-
${jsonForXml(activationCall)}
|
|
130
|
-
</crm-automation-recipe>`,
|
|
131
|
-
};
|
|
132
|
-
}
|