@agent-native/core 0.111.4 → 0.113.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 +4 -2
- package/corpus/core/CHANGELOG.md +34 -0
- package/corpus/core/docs/AGENTS.md +7 -0
- package/corpus/core/docs/content/integrations.mdx +63 -2
- package/corpus/core/docs/design/provider-integration-authority.md +117 -0
- package/corpus/core/package.json +8 -1
- package/corpus/core/scripts/materialize-source-corpus.mjs +9 -2
- package/corpus/core/src/cli/atomic-json-file.ts +324 -0
- package/corpus/core/src/cli/claude-code-participant.ts +515 -0
- package/corpus/core/src/cli/code-agent-executor.ts +35 -15
- package/corpus/core/src/cli/code-agent-runs.concurrent-worker.ts +33 -0
- package/corpus/core/src/cli/code-agent-runs.ts +70 -36
- package/corpus/core/src/cli/codex-cli-participant.ts +496 -0
- package/corpus/core/src/cli/multi-frontier-runs.ts +1952 -0
- package/corpus/core/src/client/chat/ChatHistoryList.tsx +7 -404
- package/corpus/core/src/coding-tools/index.ts +27 -8
- package/corpus/core/src/embeddings/index.ts +233 -0
- package/corpus/core/src/index.ts +2 -0
- package/corpus/core/src/integrations/index.ts +10 -0
- package/corpus/core/src/integrations/slack-oauth.ts +1 -0
- package/corpus/core/src/integrations/webhook-delivery.ts +55 -0
- package/corpus/core/src/notifications/channels.ts +4 -10
- package/corpus/core/src/provider-api/actions/custom-provider-registration.ts +197 -0
- package/corpus/core/src/provider-api/actions/delete-staged-dataset.ts +3 -42
- package/corpus/core/src/provider-api/actions/list-staged-datasets.ts +3 -45
- package/corpus/core/src/provider-api/actions/provider-api-audit.ts +88 -0
- package/corpus/core/src/provider-api/actions/provider-api.ts +460 -0
- package/corpus/core/src/provider-api/actions/query-staged-dataset.ts +3 -140
- package/corpus/core/src/provider-api/actions/staged-datasets.ts +359 -0
- package/corpus/core/src/provider-api/gong.ts +108 -0
- package/corpus/core/src/scripts/docs/source-search.ts +2 -1
- package/corpus/core/src/search/index.ts +413 -0
- package/corpus/core/src/server/google-oauth-credentials.ts +80 -3
- package/corpus/core/src/server/index.ts +6 -0
- package/corpus/core/src/styles/chat-history-list.css +1 -313
- package/corpus/core/src/templates/default/.agents/skills/actions/SKILL.md +32 -12
- package/corpus/core/src/templates/default/.agents/skills/agent-native-docs/SKILL.md +10 -0
- package/corpus/core/src/templates/default/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/corpus/core/src/templates/default/.agents/skills/integration-webhooks/SKILL.md +323 -0
- package/corpus/core/src/templates/default/.agents/skills/onboarding/SKILL.md +56 -0
- package/corpus/core/src/templates/default/.agents/skills/secrets/SKILL.md +273 -0
- package/corpus/core/src/templates/default/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/corpus/core/src/templates/default/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/corpus/core/src/templates/default/AGENTS.md +25 -18
- package/corpus/core/src/templates/headless/.agents/skills/actions/SKILL.md +512 -0
- package/corpus/core/src/templates/headless/.agents/skills/agent-native-docs/SKILL.md +10 -0
- package/corpus/core/src/templates/headless/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/corpus/core/src/templates/headless/.agents/skills/integration-webhooks/SKILL.md +323 -0
- package/corpus/core/src/templates/headless/.agents/skills/secrets/SKILL.md +273 -0
- package/corpus/core/src/templates/headless/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/corpus/core/src/templates/headless/AGENTS.md +7 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/actions/SKILL.md +32 -12
- package/corpus/core/src/templates/workspace-core/.agents/skills/agent-native-docs/SKILL.md +10 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +6 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/corpus/core/src/templates/workspace-core/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/corpus/core/src/templates/workspace-core/AGENTS.md +4 -0
- package/corpus/core/src/templates/workspace-root/AGENTS.md +4 -0
- package/corpus/templates/analytics/.agents/skills/actions/SKILL.md +32 -12
- package/corpus/templates/analytics/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/corpus/templates/analytics/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/corpus/templates/analytics/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/corpus/templates/analytics/actions/delete-staged-dataset.ts +3 -23
- package/corpus/templates/analytics/actions/list-staged-datasets.ts +3 -27
- package/corpus/templates/analytics/actions/provider-api-catalog.ts +16 -19
- package/corpus/templates/analytics/actions/provider-api-docs.ts +3 -5
- package/corpus/templates/analytics/actions/provider-api-request.ts +162 -185
- package/corpus/templates/analytics/actions/query-staged-dataset.ts +3 -47
- package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +52 -161
- package/corpus/templates/assets/.agents/skills/actions/SKILL.md +32 -12
- package/corpus/templates/assets/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/corpus/templates/assets/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/corpus/templates/assets/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/corpus/templates/assets/app/components/layout/Sidebar.tsx +63 -160
- package/corpus/templates/brain/.agents/skills/actions/SKILL.md +32 -12
- package/corpus/templates/brain/.agents/skills/brain/RUNBOOK.md +48 -5
- package/corpus/templates/brain/.agents/skills/brain/SKILL.md +46 -14
- package/corpus/templates/brain/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/corpus/templates/brain/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/corpus/templates/brain/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/corpus/templates/brain/README.md +34 -3
- package/corpus/templates/brain/actions/_schemas.ts +13 -7
- package/corpus/templates/brain/actions/approve-proposal.ts +2 -0
- package/corpus/templates/brain/actions/claim-distillation.ts +24 -27
- package/corpus/templates/brain/actions/create-source.ts +1 -1
- package/corpus/templates/brain/actions/delete-staged-dataset.ts +3 -24
- package/corpus/templates/brain/actions/get-knowledge.ts +6 -2
- package/corpus/templates/brain/actions/get-pilot-report.ts +44 -8
- package/corpus/templates/brain/actions/import-capture.ts +21 -9
- package/corpus/templates/brain/actions/import-transcript.ts +42 -14
- package/corpus/templates/brain/actions/list-captures.ts +10 -1
- package/corpus/templates/brain/actions/list-distillation-queue.ts +39 -14
- package/corpus/templates/brain/actions/list-projects.ts +51 -0
- package/corpus/templates/brain/actions/list-proposals.ts +80 -4
- package/corpus/templates/brain/actions/list-sources.ts +17 -3
- package/corpus/templates/brain/actions/list-staged-datasets.ts +3 -28
- package/corpus/templates/brain/actions/manage-project.ts +118 -0
- package/corpus/templates/brain/actions/mark-capture-distilled.ts +68 -20
- package/corpus/templates/brain/actions/navigate.ts +1 -0
- package/corpus/templates/brain/actions/provider-api-catalog.ts +5 -11
- package/corpus/templates/brain/actions/provider-api-docs.ts +3 -5
- package/corpus/templates/brain/actions/provider-api-request.ts +3 -37
- package/corpus/templates/brain/actions/query-staged-dataset.ts +3 -48
- package/corpus/templates/brain/actions/reject-proposal.ts +6 -1
- package/corpus/templates/brain/actions/resanitize-captures.ts +159 -33
- package/corpus/templates/brain/actions/review-proposal.ts +2 -0
- package/corpus/templates/brain/actions/search-everything.ts +10 -1
- package/corpus/templates/brain/actions/search-knowledge.ts +1 -1
- package/corpus/templates/brain/actions/set-settings.ts +36 -1
- package/corpus/templates/brain/actions/update-proposal.ts +2 -0
- package/corpus/templates/brain/actions/update-source.ts +5 -1
- package/corpus/templates/brain/app/components/layout/Sidebar.tsx +48 -154
- package/corpus/templates/brain/app/hooks/use-distillation-bridge.ts +18 -9
- package/corpus/templates/brain/app/hooks/use-navigation-state.ts +3 -0
- package/corpus/templates/brain/app/i18n-data.ts +731 -2
- package/corpus/templates/brain/app/lib/brain.ts +88 -1
- package/corpus/templates/brain/app/lib/ingest-handoff.ts +35 -0
- package/corpus/templates/brain/app/routes/ops.tsx +47 -0
- package/corpus/templates/brain/app/routes/review.tsx +41 -2
- package/corpus/templates/brain/app/routes/search.tsx +33 -2
- package/corpus/templates/brain/app/routes/settings.tsx +158 -0
- package/corpus/templates/brain/app/routes/sources.tsx +31 -0
- package/corpus/templates/brain/changelog/2026-07-19-added-private-source-safe-semantic-search.md +6 -0
- package/corpus/templates/brain/changelog/2026-07-19-slack-backfills-can-now-join-configured-public-channels-befo.md +6 -0
- package/corpus/templates/brain/changelog/2026-07-19-slack-backfills-now-continue-across-the-configured-number-of.md +6 -0
- package/corpus/templates/brain/changelog/2026-07-19-slack-backfills-now-start-with-a-safe-four-week-window-and-r.md +6 -0
- package/corpus/templates/brain/jobs/process-ingest-queue.ts +270 -36
- package/corpus/templates/brain/package.json +1 -0
- package/corpus/templates/brain/server/db/index.ts +18 -0
- package/corpus/templates/brain/server/db/schema.ts +197 -1
- package/corpus/templates/brain/server/jobs/distillation-queue.ts +12 -5
- package/corpus/templates/brain/server/lib/audiences.ts +708 -0
- package/corpus/templates/brain/server/lib/brain-health.ts +251 -38
- package/corpus/templates/brain/server/lib/brain.ts +877 -50
- package/corpus/templates/brain/server/lib/capture-sanitization.ts +217 -53
- package/corpus/templates/brain/server/lib/connectors.ts +609 -72
- package/corpus/templates/brain/server/lib/demo.ts +17 -4
- package/corpus/templates/brain/server/lib/hybrid-search.ts +363 -0
- package/corpus/templates/brain/server/lib/ingest-queue.ts +104 -0
- package/corpus/templates/brain/server/lib/privacy-readiness.ts +24 -0
- package/corpus/templates/brain/server/lib/search-index-contracts.ts +72 -0
- package/corpus/templates/brain/server/lib/search-index.ts +714 -0
- package/corpus/templates/brain/server/lib/search.ts +120 -4
- package/corpus/templates/brain/server/lib/sensitivity-policy.ts +174 -0
- package/corpus/templates/brain/server/lib/slack-channel-membership.ts +44 -0
- package/corpus/templates/brain/server/lib/slack-events.ts +281 -0
- package/corpus/templates/brain/server/onboarding.ts +29 -0
- package/corpus/templates/brain/server/plugins/db.ts +204 -0
- package/corpus/templates/brain/server/register-secrets.ts +46 -0
- package/corpus/templates/brain/server/routes/api/_agent-native/brain/ingest.post.ts +36 -16
- package/corpus/templates/brain/server/routes/api/_agent-native/brain/slack-events.post.ts +28 -0
- package/corpus/templates/brain/shared/slack-source-config.ts +60 -0
- package/corpus/templates/brain/shared/types.ts +10 -0
- package/corpus/templates/calendar/.agents/skills/actions/SKILL.md +32 -12
- package/corpus/templates/calendar/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/corpus/templates/calendar/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/corpus/templates/calendar/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/corpus/templates/calendar/actions/delete-staged-dataset.ts +3 -24
- package/corpus/templates/calendar/actions/list-staged-datasets.ts +3 -28
- package/corpus/templates/calendar/actions/provider-api-catalog.ts +5 -11
- package/corpus/templates/calendar/actions/provider-api-docs.ts +3 -5
- package/corpus/templates/calendar/actions/provider-api-request.ts +3 -37
- package/corpus/templates/calendar/actions/query-staged-dataset.ts +3 -48
- package/corpus/templates/calendar/server/handlers/gong.ts +6 -61
- package/corpus/templates/calendar/server/handlers/google-auth.ts +10 -8
- package/corpus/templates/calendar/server/lib/google-calendar.ts +7 -45
- package/corpus/templates/chat/.agents/skills/actions/SKILL.md +32 -12
- package/corpus/templates/chat/.agents/skills/agent-native-docs/SKILL.md +10 -0
- package/corpus/templates/chat/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/corpus/templates/chat/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/corpus/templates/chat/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/corpus/templates/chat/AGENTS.md +5 -2
- package/corpus/templates/chat/app/components/layout/Sidebar.tsx +51 -157
- package/corpus/templates/clips/.agents/skills/actions/SKILL.md +32 -12
- package/corpus/templates/clips/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/corpus/templates/clips/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/corpus/templates/clips/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/corpus/templates/clips/AGENTS.md +11 -0
- package/corpus/templates/clips/actions/export-to-brain.ts +505 -171
- package/corpus/templates/clips/changelog/2026-07-19-ready-clips-transcripts-can-be-backfilled-to-brain-for-a-bou.md +6 -0
- package/corpus/templates/clips/server/lib/calendar-event-meetings.ts +1 -1
- package/corpus/templates/clips/server/lib/google-calendar-client.ts +12 -22
- package/corpus/templates/clips/server/lib/google-calendar-oauth.ts +9 -6
- package/corpus/templates/clips/server/lib/slack-oauth.ts +12 -47
- package/corpus/templates/clips/server/routes/_agent-native/google/auth-url.get.ts +2 -6
- package/corpus/templates/clips/server/routes/api/auth/google-calendar.get.ts +4 -4
- package/corpus/templates/content/.agents/skills/actions/SKILL.md +32 -12
- package/corpus/templates/content/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/corpus/templates/content/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/corpus/templates/content/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/corpus/templates/content/actions/delete-staged-dataset.ts +3 -24
- package/corpus/templates/content/actions/list-staged-datasets.ts +3 -28
- package/corpus/templates/content/actions/provider-api-catalog.ts +5 -11
- package/corpus/templates/content/actions/provider-api-docs.ts +3 -5
- package/corpus/templates/content/actions/provider-api-request.ts +3 -37
- package/corpus/templates/content/actions/query-staged-dataset.ts +3 -48
- package/corpus/templates/design/.agents/skills/actions/SKILL.md +32 -12
- package/corpus/templates/design/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/corpus/templates/design/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/corpus/templates/design/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/corpus/templates/design/actions/delete-staged-dataset.ts +4 -23
- package/corpus/templates/design/actions/list-staged-datasets.ts +4 -27
- package/corpus/templates/design/actions/provider-api-catalog.ts +15 -18
- package/corpus/templates/design/actions/provider-api-docs.ts +57 -48
- package/corpus/templates/design/actions/provider-api-request.ts +140 -164
- package/corpus/templates/design/actions/query-staged-dataset.ts +4 -47
- package/corpus/templates/dispatch/.agents/skills/actions/SKILL.md +32 -12
- package/corpus/templates/dispatch/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/corpus/templates/dispatch/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/corpus/templates/dispatch/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/corpus/templates/dispatch/actions/delete-staged-dataset.ts +4 -23
- package/corpus/templates/dispatch/actions/list-staged-datasets.ts +4 -30
- package/corpus/templates/dispatch/actions/provider-api-catalog.ts +15 -18
- package/corpus/templates/dispatch/actions/provider-api-docs.ts +57 -48
- package/corpus/templates/dispatch/actions/provider-api-request.ts +138 -163
- package/corpus/templates/dispatch/actions/query-staged-dataset.ts +4 -47
- package/corpus/templates/forms/.agents/skills/actions/SKILL.md +32 -12
- package/corpus/templates/forms/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/corpus/templates/forms/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/corpus/templates/forms/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/corpus/templates/forms/server/lib/integrations.ts +23 -22
- package/corpus/templates/macros/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/corpus/templates/macros/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/corpus/templates/mail/.agents/skills/actions/SKILL.md +32 -12
- package/corpus/templates/mail/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/corpus/templates/mail/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/corpus/templates/mail/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/corpus/templates/mail/actions/delete-staged-dataset.ts +4 -23
- package/corpus/templates/mail/actions/list-staged-datasets.ts +4 -27
- package/corpus/templates/mail/actions/provider-api-catalog.ts +15 -18
- package/corpus/templates/mail/actions/provider-api-docs.ts +57 -48
- package/corpus/templates/mail/actions/provider-api-request.ts +146 -173
- package/corpus/templates/mail/actions/query-staged-dataset.ts +4 -47
- package/corpus/templates/mail/server/handlers/gong.ts +6 -61
- package/corpus/templates/mail/server/lib/google-auth.ts +10 -13
- package/corpus/templates/plan/.agents/skills/actions/SKILL.md +32 -12
- package/corpus/templates/plan/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/corpus/templates/plan/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/corpus/templates/plan/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/corpus/templates/plan/app/components/layout/Sidebar.tsx +47 -156
- package/corpus/templates/slides/.agents/skills/actions/SKILL.md +32 -12
- package/corpus/templates/slides/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/corpus/templates/slides/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/corpus/templates/slides/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/corpus/templates/slides/actions/delete-staged-dataset.ts +4 -23
- package/corpus/templates/slides/actions/list-staged-datasets.ts +4 -27
- package/corpus/templates/slides/actions/provider-api-catalog.ts +15 -18
- package/corpus/templates/slides/actions/provider-api-docs.ts +57 -48
- package/corpus/templates/slides/actions/provider-api-request.ts +145 -172
- package/corpus/templates/slides/actions/query-staged-dataset.ts +4 -47
- package/corpus/templates/slides/server/lib/google-docs-oauth.ts +11 -36
- package/corpus/templates/tasks/.agents/skills/actions/SKILL.md +32 -12
- package/corpus/templates/tasks/.agents/skills/agent-native-docs/SKILL.md +10 -0
- package/corpus/templates/tasks/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/corpus/templates/tasks/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/corpus/templates/tasks/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/corpus/toolkit/CHANGELOG.md +125 -0
- package/corpus/toolkit/README.md +60 -0
- package/corpus/toolkit/export-snapshot.json +35 -0
- package/corpus/toolkit/migration-manifest.json +4 -0
- package/corpus/toolkit/package.json +281 -0
- package/corpus/toolkit/scripts/finalize-build.mjs +55 -0
- package/corpus/toolkit/src/app-shell/header-actions.tsx +84 -0
- package/corpus/toolkit/src/app-shell/index.ts +1 -0
- package/corpus/toolkit/src/chat-history/ChatHistoryList.tsx +469 -0
- package/corpus/toolkit/src/chat-history/index.ts +7 -0
- package/corpus/toolkit/src/chat-history.css +314 -0
- package/corpus/toolkit/src/collab-ui/AgentPresenceChip.tsx +69 -0
- package/corpus/toolkit/src/collab-ui/LiveCursorOverlay.tsx +241 -0
- package/corpus/toolkit/src/collab-ui/PresenceBar.tsx +346 -0
- package/corpus/toolkit/src/collab-ui/RecentEditHighlights.tsx +225 -0
- package/corpus/toolkit/src/collab-ui/RemoteSelectionRings.tsx +227 -0
- package/corpus/toolkit/src/collab-ui/agent-identity.ts +16 -0
- package/corpus/toolkit/src/collab-ui/index.ts +39 -0
- package/corpus/toolkit/src/collab-ui/lead-client.ts +32 -0
- package/corpus/toolkit/src/collab-ui/types.ts +96 -0
- package/corpus/toolkit/src/composer/AgentComposerFrame.tsx +59 -0
- package/corpus/toolkit/src/composer/ComposerPlusMenu.tsx +983 -0
- package/corpus/toolkit/src/composer/MentionPopover.tsx +412 -0
- package/corpus/toolkit/src/composer/PastedTextChip.tsx +150 -0
- package/corpus/toolkit/src/composer/PromptComposer.tsx +718 -0
- package/corpus/toolkit/src/composer/RealtimeVoiceMode.tsx +856 -0
- package/corpus/toolkit/src/composer/TiptapComposer.tsx +2936 -0
- package/corpus/toolkit/src/composer/VoiceButton.tsx +255 -0
- package/corpus/toolkit/src/composer/asset-picker-url.ts +80 -0
- package/corpus/toolkit/src/composer/attachment-accept.ts +71 -0
- package/corpus/toolkit/src/composer/draft-key.ts +7 -0
- package/corpus/toolkit/src/composer/extensions/FileReference.tsx +55 -0
- package/corpus/toolkit/src/composer/extensions/MentionReference.tsx +93 -0
- package/corpus/toolkit/src/composer/extensions/SkillReference.tsx +56 -0
- package/corpus/toolkit/src/composer/index.ts +79 -0
- package/corpus/toolkit/src/composer/pasted-text.ts +160 -0
- package/corpus/toolkit/src/composer/prompt-attachments.ts +93 -0
- package/corpus/toolkit/src/composer/realtime-voice-audio-level.ts +64 -0
- package/corpus/toolkit/src/composer/realtime-voice-transcript.ts +134 -0
- package/corpus/toolkit/src/composer/runtime-adapters.tsx +343 -0
- package/corpus/toolkit/src/composer/types.ts +66 -0
- package/corpus/toolkit/src/composer/use-file-search.ts +64 -0
- package/corpus/toolkit/src/composer/use-mention-search.ts +90 -0
- package/corpus/toolkit/src/composer/use-skills.ts +45 -0
- package/corpus/toolkit/src/composer/useRealtimeVoiceMode.tsx +2117 -0
- package/corpus/toolkit/src/composer/useVoiceDictation.ts +1191 -0
- package/corpus/toolkit/src/context-ui/ContextMeter.tsx +101 -0
- package/corpus/toolkit/src/context-ui/ContextSegmentRow.tsx +184 -0
- package/corpus/toolkit/src/context-ui/ContextTreemap.tsx +125 -0
- package/corpus/toolkit/src/context-ui/ContextXRayPanel.tsx +377 -0
- package/corpus/toolkit/src/context-ui/format.ts +42 -0
- package/corpus/toolkit/src/context-ui/index.ts +15 -0
- package/corpus/toolkit/src/context-ui/types.ts +43 -0
- package/corpus/toolkit/src/design-tweaks/index.ts +1 -0
- package/corpus/toolkit/src/design-tweaks/visual-style-controls.tsx +1084 -0
- package/corpus/toolkit/src/editor/BubbleToolbar.tsx +253 -0
- package/corpus/toolkit/src/editor/CodeBlockNode.tsx +254 -0
- package/corpus/toolkit/src/editor/DragHandle.ts +1437 -0
- package/corpus/toolkit/src/editor/ImageExtension.ts +306 -0
- package/corpus/toolkit/src/editor/RegistryBlockContext.tsx +107 -0
- package/corpus/toolkit/src/editor/RegistryBlockNode.tsx +652 -0
- package/corpus/toolkit/src/editor/RichMarkdownEditor.tsx +81 -0
- package/corpus/toolkit/src/editor/RunId.ts +61 -0
- package/corpus/toolkit/src/editor/SharedRichEditor.tsx +321 -0
- package/corpus/toolkit/src/editor/SlashCommandMenu.tsx +310 -0
- package/corpus/toolkit/src/editor/extensions.ts +402 -0
- package/corpus/toolkit/src/editor/gfmDoc.ts +92 -0
- package/corpus/toolkit/src/editor/index.ts +93 -0
- package/corpus/toolkit/src/editor/registrySlashCommands.ts +131 -0
- package/corpus/toolkit/src/editor/surgical-apply.ts +192 -0
- package/corpus/toolkit/src/editor/useCollabReconcile.ts +589 -0
- package/corpus/toolkit/src/editor.css +510 -0
- package/corpus/toolkit/src/hooks/index.ts +2 -0
- package/corpus/toolkit/src/hooks/use-mobile.tsx +21 -0
- package/corpus/toolkit/src/hooks/use-toast.ts +188 -0
- package/corpus/toolkit/src/index.ts +8 -0
- package/corpus/toolkit/src/onboarding/index.ts +1 -0
- package/corpus/toolkit/src/provider.tsx +47 -0
- package/corpus/toolkit/src/sharing/VisibilityBadge.tsx +37 -0
- package/corpus/toolkit/src/sharing/index.ts +4 -0
- package/corpus/toolkit/src/styles.css +21 -0
- package/corpus/toolkit/src/ui/accordion.tsx +56 -0
- package/corpus/toolkit/src/ui/alert-dialog.tsx +141 -0
- package/corpus/toolkit/src/ui/alert.tsx +59 -0
- package/corpus/toolkit/src/ui/aspect-ratio.tsx +5 -0
- package/corpus/toolkit/src/ui/avatar.tsx +48 -0
- package/corpus/toolkit/src/ui/badge.tsx +37 -0
- package/corpus/toolkit/src/ui/breadcrumb.tsx +115 -0
- package/corpus/toolkit/src/ui/button.tsx +78 -0
- package/corpus/toolkit/src/ui/calendar.tsx +214 -0
- package/corpus/toolkit/src/ui/card.tsx +86 -0
- package/corpus/toolkit/src/ui/carousel.tsx +260 -0
- package/corpus/toolkit/src/ui/chart.tsx +375 -0
- package/corpus/toolkit/src/ui/checkbox.tsx +28 -0
- package/corpus/toolkit/src/ui/collapsible.tsx +9 -0
- package/corpus/toolkit/src/ui/command.tsx +174 -0
- package/corpus/toolkit/src/ui/context-menu.tsx +202 -0
- package/corpus/toolkit/src/ui/date-picker.tsx +64 -0
- package/corpus/toolkit/src/ui/dialog.tsx +146 -0
- package/corpus/toolkit/src/ui/drawer.tsx +126 -0
- package/corpus/toolkit/src/ui/dropdown-menu.tsx +218 -0
- package/corpus/toolkit/src/ui/form.tsx +177 -0
- package/corpus/toolkit/src/ui/hover-card.tsx +27 -0
- package/corpus/toolkit/src/ui/index.ts +52 -0
- package/corpus/toolkit/src/ui/input-otp.tsx +69 -0
- package/corpus/toolkit/src/ui/input.tsx +22 -0
- package/corpus/toolkit/src/ui/label.tsx +24 -0
- package/corpus/toolkit/src/ui/logo.tsx +36 -0
- package/corpus/toolkit/src/ui/menubar.tsx +235 -0
- package/corpus/toolkit/src/ui/navigation-menu.tsx +128 -0
- package/corpus/toolkit/src/ui/pagination.tsx +121 -0
- package/corpus/toolkit/src/ui/popover.tsx +44 -0
- package/corpus/toolkit/src/ui/progress.tsx +26 -0
- package/corpus/toolkit/src/ui/radio-group.tsx +42 -0
- package/corpus/toolkit/src/ui/resizable.tsx +43 -0
- package/corpus/toolkit/src/ui/scroll-area.tsx +46 -0
- package/corpus/toolkit/src/ui/select.tsx +158 -0
- package/corpus/toolkit/src/ui/separator.tsx +29 -0
- package/corpus/toolkit/src/ui/sheet.tsx +160 -0
- package/corpus/toolkit/src/ui/sidebar.tsx +777 -0
- package/corpus/toolkit/src/ui/skeleton.tsx +18 -0
- package/corpus/toolkit/src/ui/slider.tsx +26 -0
- package/corpus/toolkit/src/ui/sonner.tsx +58 -0
- package/corpus/toolkit/src/ui/spinner.tsx +17 -0
- package/corpus/toolkit/src/ui/switch.tsx +27 -0
- package/corpus/toolkit/src/ui/table.tsx +117 -0
- package/corpus/toolkit/src/ui/tabs.tsx +53 -0
- package/corpus/toolkit/src/ui/textarea.tsx +23 -0
- package/corpus/toolkit/src/ui/toast.tsx +127 -0
- package/corpus/toolkit/src/ui/toaster.tsx +33 -0
- package/corpus/toolkit/src/ui/toggle-group.tsx +59 -0
- package/corpus/toolkit/src/ui/toggle.tsx +43 -0
- package/corpus/toolkit/src/ui/tooltip.tsx +53 -0
- package/corpus/toolkit/src/ui/use-toast.ts +3 -0
- package/corpus/toolkit/src/utils.ts +8 -0
- package/corpus/toolkit/tsconfig.json +23 -0
- package/dist/cli/atomic-json-file.d.ts +30 -0
- package/dist/cli/atomic-json-file.d.ts.map +1 -0
- package/dist/cli/atomic-json-file.js +240 -0
- package/dist/cli/atomic-json-file.js.map +1 -0
- package/dist/cli/claude-code-participant.d.ts +77 -0
- package/dist/cli/claude-code-participant.d.ts.map +1 -0
- package/dist/cli/claude-code-participant.js +355 -0
- package/dist/cli/claude-code-participant.js.map +1 -0
- package/dist/cli/code-agent-executor.d.ts +8 -9
- package/dist/cli/code-agent-executor.d.ts.map +1 -1
- package/dist/cli/code-agent-executor.js +27 -13
- package/dist/cli/code-agent-executor.js.map +1 -1
- package/dist/cli/code-agent-runs.concurrent-worker.d.ts +2 -0
- package/dist/cli/code-agent-runs.concurrent-worker.d.ts.map +1 -0
- package/dist/cli/code-agent-runs.concurrent-worker.js +32 -0
- package/dist/cli/code-agent-runs.concurrent-worker.js.map +1 -0
- package/dist/cli/code-agent-runs.d.ts +5 -0
- package/dist/cli/code-agent-runs.d.ts.map +1 -1
- package/dist/cli/code-agent-runs.js +51 -33
- package/dist/cli/code-agent-runs.js.map +1 -1
- package/dist/cli/codex-cli-participant.d.ts +77 -0
- package/dist/cli/codex-cli-participant.d.ts.map +1 -0
- package/dist/cli/codex-cli-participant.js +354 -0
- package/dist/cli/codex-cli-participant.js.map +1 -0
- package/dist/cli/multi-frontier-runs.d.ts +246 -0
- package/dist/cli/multi-frontier-runs.d.ts.map +1 -0
- package/dist/cli/multi-frontier-runs.js +1247 -0
- package/dist/cli/multi-frontier-runs.js.map +1 -0
- package/dist/client/chat/ChatHistoryList.d.ts +1 -87
- package/dist/client/chat/ChatHistoryList.d.ts.map +1 -1
- package/dist/client/chat/ChatHistoryList.js +1 -82
- package/dist/client/chat/ChatHistoryList.js.map +1 -1
- package/dist/coding-tools/index.d.ts +1 -0
- package/dist/coding-tools/index.d.ts.map +1 -1
- package/dist/coding-tools/index.js +25 -7
- package/dist/coding-tools/index.js.map +1 -1
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/collab/awareness.d.ts.map +1 -1
- package/dist/embeddings/index.d.ts +24 -0
- package/dist/embeddings/index.d.ts.map +1 -0
- package/dist/embeddings/index.js +172 -0
- package/dist/embeddings/index.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/integrations/index.d.ts +2 -1
- package/dist/integrations/index.d.ts.map +1 -1
- package/dist/integrations/index.js +2 -1
- package/dist/integrations/index.js.map +1 -1
- package/dist/integrations/slack-manifest.d.ts +1 -1
- package/dist/integrations/slack-oauth.d.ts +1 -1
- package/dist/integrations/slack-oauth.d.ts.map +1 -1
- package/dist/integrations/slack-oauth.js +1 -0
- package/dist/integrations/slack-oauth.js.map +1 -1
- package/dist/integrations/webhook-delivery.d.ts +23 -0
- package/dist/integrations/webhook-delivery.d.ts.map +1 -0
- package/dist/integrations/webhook-delivery.js +32 -0
- package/dist/integrations/webhook-delivery.js.map +1 -0
- package/dist/notifications/channels.d.ts.map +1 -1
- package/dist/notifications/channels.js +4 -9
- package/dist/notifications/channels.js.map +1 -1
- package/dist/notifications/routes.d.ts +3 -3
- package/dist/progress/routes.d.ts +1 -1
- package/dist/provider-api/actions/custom-provider-registration.d.ts +136 -0
- package/dist/provider-api/actions/custom-provider-registration.d.ts.map +1 -0
- package/dist/provider-api/actions/custom-provider-registration.js +154 -0
- package/dist/provider-api/actions/custom-provider-registration.js.map +1 -0
- package/dist/provider-api/actions/delete-staged-dataset.d.ts +1 -1
- package/dist/provider-api/actions/delete-staged-dataset.d.ts.map +1 -1
- package/dist/provider-api/actions/delete-staged-dataset.js +3 -34
- package/dist/provider-api/actions/delete-staged-dataset.js.map +1 -1
- package/dist/provider-api/actions/list-staged-datasets.d.ts +2 -3
- package/dist/provider-api/actions/list-staged-datasets.d.ts.map +1 -1
- package/dist/provider-api/actions/list-staged-datasets.js +3 -40
- package/dist/provider-api/actions/list-staged-datasets.js.map +1 -1
- package/dist/provider-api/actions/provider-api-audit.d.ts +7 -0
- package/dist/provider-api/actions/provider-api-audit.d.ts.map +1 -0
- package/dist/provider-api/actions/provider-api-audit.js +74 -0
- package/dist/provider-api/actions/provider-api-audit.js.map +1 -0
- package/dist/provider-api/actions/provider-api.d.ts +370 -0
- package/dist/provider-api/actions/provider-api.d.ts.map +1 -0
- package/dist/provider-api/actions/provider-api.js +280 -0
- package/dist/provider-api/actions/provider-api.js.map +1 -0
- package/dist/provider-api/actions/query-staged-dataset.d.ts +1 -1
- package/dist/provider-api/actions/query-staged-dataset.d.ts.map +1 -1
- package/dist/provider-api/actions/query-staged-dataset.js +3 -116
- package/dist/provider-api/actions/query-staged-dataset.js.map +1 -1
- package/dist/provider-api/actions/staged-datasets.d.ts +190 -0
- package/dist/provider-api/actions/staged-datasets.d.ts.map +1 -0
- package/dist/provider-api/actions/staged-datasets.js +210 -0
- package/dist/provider-api/actions/staged-datasets.js.map +1 -0
- package/dist/provider-api/gong.d.ts +44 -0
- package/dist/provider-api/gong.d.ts.map +1 -0
- package/dist/provider-api/gong.js +56 -0
- package/dist/provider-api/gong.js.map +1 -0
- package/dist/resources/handlers.d.ts +1 -1
- package/dist/scripts/docs/source-search.d.ts +2 -1
- package/dist/scripts/docs/source-search.d.ts.map +1 -1
- package/dist/scripts/docs/source-search.js +2 -1
- package/dist/scripts/docs/source-search.js.map +1 -1
- package/dist/search/index.d.ts +88 -0
- package/dist/search/index.d.ts.map +1 -0
- package/dist/search/index.js +267 -0
- package/dist/search/index.js.map +1 -0
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/google-oauth-credentials.d.ts +35 -0
- package/dist/server/google-oauth-credentials.d.ts.map +1 -1
- package/dist/server/google-oauth-credentials.js +48 -2
- package/dist/server/google-oauth-credentials.js.map +1 -1
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +1 -1
- package/dist/server/index.js.map +1 -1
- package/dist/styles/chat-history-list.css +1 -313
- package/dist/templates/chat/.agents/skills/actions/SKILL.md +32 -12
- package/dist/templates/chat/.agents/skills/agent-native-docs/SKILL.md +10 -0
- package/dist/templates/chat/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/dist/templates/chat/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/dist/templates/chat/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/dist/templates/chat/AGENTS.md +5 -2
- package/dist/templates/chat/app/components/layout/Sidebar.tsx +51 -157
- package/dist/templates/default/.agents/skills/actions/SKILL.md +32 -12
- package/dist/templates/default/.agents/skills/agent-native-docs/SKILL.md +10 -0
- package/dist/templates/default/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/dist/templates/default/.agents/skills/integration-webhooks/SKILL.md +323 -0
- package/dist/templates/default/.agents/skills/onboarding/SKILL.md +56 -0
- package/dist/templates/default/.agents/skills/secrets/SKILL.md +273 -0
- package/dist/templates/default/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/dist/templates/default/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/dist/templates/default/AGENTS.md +25 -18
- package/dist/templates/headless/.agents/skills/actions/SKILL.md +512 -0
- package/dist/templates/headless/.agents/skills/agent-native-docs/SKILL.md +10 -0
- package/dist/templates/headless/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/dist/templates/headless/.agents/skills/integration-webhooks/SKILL.md +323 -0
- package/dist/templates/headless/.agents/skills/secrets/SKILL.md +273 -0
- package/dist/templates/headless/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/dist/templates/headless/AGENTS.md +7 -0
- package/dist/templates/workspace-core/.agents/skills/actions/SKILL.md +32 -12
- package/dist/templates/workspace-core/.agents/skills/agent-native-docs/SKILL.md +10 -0
- package/dist/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +6 -0
- package/dist/templates/workspace-core/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/dist/templates/workspace-core/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/dist/templates/workspace-core/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/dist/templates/workspace-core/AGENTS.md +4 -0
- package/dist/templates/workspace-root/AGENTS.md +4 -0
- package/docs/AGENTS.md +7 -0
- package/docs/content/integrations.mdx +63 -2
- package/docs/design/provider-integration-authority.md +117 -0
- package/package.json +9 -2
- package/src/templates/chat/.agents/skills/actions/SKILL.md +32 -12
- package/src/templates/chat/.agents/skills/agent-native-docs/SKILL.md +10 -0
- package/src/templates/chat/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/src/templates/chat/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/src/templates/chat/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/src/templates/chat/AGENTS.md +5 -2
- package/src/templates/chat/app/components/layout/Sidebar.tsx +51 -157
- package/src/templates/default/.agents/skills/actions/SKILL.md +32 -12
- package/src/templates/default/.agents/skills/agent-native-docs/SKILL.md +10 -0
- package/src/templates/default/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/src/templates/default/.agents/skills/integration-webhooks/SKILL.md +323 -0
- package/src/templates/default/.agents/skills/onboarding/SKILL.md +56 -0
- package/src/templates/default/.agents/skills/secrets/SKILL.md +273 -0
- package/src/templates/default/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/src/templates/default/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/src/templates/default/AGENTS.md +25 -18
- package/src/templates/headless/.agents/skills/actions/SKILL.md +512 -0
- package/src/templates/headless/.agents/skills/agent-native-docs/SKILL.md +10 -0
- package/src/templates/headless/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/src/templates/headless/.agents/skills/integration-webhooks/SKILL.md +323 -0
- package/src/templates/headless/.agents/skills/secrets/SKILL.md +273 -0
- package/src/templates/headless/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/src/templates/headless/AGENTS.md +7 -0
- package/src/templates/workspace-core/.agents/skills/actions/SKILL.md +32 -12
- package/src/templates/workspace-core/.agents/skills/agent-native-docs/SKILL.md +10 -0
- package/src/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +6 -0
- package/src/templates/workspace-core/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/src/templates/workspace-core/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/src/templates/workspace-core/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/src/templates/workspace-core/AGENTS.md +4 -0
- package/src/templates/workspace-root/AGENTS.md +4 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { registerOnboardingStep } from "@agent-native/core/onboarding";
|
|
2
|
+
|
|
3
|
+
import { readBrainSettings } from "./lib/brain.js";
|
|
4
|
+
import { brainPrivacyReadiness } from "./lib/privacy-readiness.js";
|
|
5
|
+
|
|
6
|
+
registerOnboardingStep({
|
|
7
|
+
id: "brain-privacy-classifier",
|
|
8
|
+
order: 16,
|
|
9
|
+
required: false,
|
|
10
|
+
title: "Configure Brain privacy classification",
|
|
11
|
+
description:
|
|
12
|
+
"Choose the approved model and engine that review captures before storage. Until configured, deterministic-clean content can be stored but uncertain content is quarantined and unavailable to search or agents.",
|
|
13
|
+
methods: [
|
|
14
|
+
{
|
|
15
|
+
id: "settings",
|
|
16
|
+
kind: "link",
|
|
17
|
+
primary: true,
|
|
18
|
+
label: "Open Brain privacy settings",
|
|
19
|
+
payload: { url: "/settings", external: false },
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
isComplete: async () => {
|
|
23
|
+
try {
|
|
24
|
+
return brainPrivacyReadiness(await readBrainSettings()).configured;
|
|
25
|
+
} catch {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
});
|
|
@@ -183,6 +183,7 @@ const runBrainMigrations = runMigrations(
|
|
|
183
183
|
priority INTEGER NOT NULL DEFAULT 0,
|
|
184
184
|
attempts INTEGER NOT NULL DEFAULT 0,
|
|
185
185
|
payload_json TEXT NOT NULL DEFAULT '{}',
|
|
186
|
+
lease_token TEXT,
|
|
186
187
|
error TEXT,
|
|
187
188
|
run_after TEXT,
|
|
188
189
|
created_at TEXT NOT NULL DEFAULT (datetime('now')),
|
|
@@ -270,6 +271,209 @@ const runBrainMigrations = runMigrations(
|
|
|
270
271
|
`CREATE INDEX IF NOT EXISTS brain_ingest_queue_capture_operation_idx ON brain_ingest_queue (capture_id, operation)`,
|
|
271
272
|
].join(";\n"),
|
|
272
273
|
},
|
|
274
|
+
{
|
|
275
|
+
version: 21,
|
|
276
|
+
name: "brain-privacy-semantic-search-contracts",
|
|
277
|
+
sql: [
|
|
278
|
+
`ALTER TABLE brain_raw_captures ADD COLUMN IF NOT EXISTS sensitivity_disposition TEXT NOT NULL DEFAULT 'pending'`,
|
|
279
|
+
`ALTER TABLE brain_raw_captures ADD COLUMN IF NOT EXISTS sensitivity_policy_version TEXT`,
|
|
280
|
+
`ALTER TABLE brain_raw_captures ADD COLUMN IF NOT EXISTS audience_acl_hash TEXT`,
|
|
281
|
+
`ALTER TABLE brain_knowledge ADD COLUMN IF NOT EXISTS audience_id TEXT`,
|
|
282
|
+
`ALTER TABLE brain_knowledge ADD COLUMN IF NOT EXISTS audience_acl_hash TEXT`,
|
|
283
|
+
`ALTER TABLE brain_proposals ADD COLUMN IF NOT EXISTS audience_id TEXT`,
|
|
284
|
+
`ALTER TABLE brain_proposals ADD COLUMN IF NOT EXISTS audience_acl_hash TEXT`,
|
|
285
|
+
`ALTER TABLE brain_ingest_queue ADD COLUMN IF NOT EXISTS dedupe_key TEXT`,
|
|
286
|
+
`ALTER TABLE brain_ingest_queue ADD COLUMN IF NOT EXISTS lease_expires_at TEXT`,
|
|
287
|
+
`CREATE UNIQUE INDEX IF NOT EXISTS brain_ingest_queue_dedupe_idx ON brain_ingest_queue (dedupe_key)`,
|
|
288
|
+
`CREATE TABLE IF NOT EXISTS brain_audiences (
|
|
289
|
+
id TEXT PRIMARY KEY,
|
|
290
|
+
source_id TEXT NOT NULL,
|
|
291
|
+
kind TEXT NOT NULL,
|
|
292
|
+
upstream_ref_hash TEXT,
|
|
293
|
+
acl_hash TEXT NOT NULL,
|
|
294
|
+
membership_state TEXT NOT NULL DEFAULT 'stale',
|
|
295
|
+
last_synced_at TEXT,
|
|
296
|
+
created_at TEXT NOT NULL,
|
|
297
|
+
updated_at TEXT NOT NULL
|
|
298
|
+
)`,
|
|
299
|
+
`CREATE TABLE IF NOT EXISTS brain_audience_members (
|
|
300
|
+
id TEXT PRIMARY KEY,
|
|
301
|
+
audience_id TEXT NOT NULL,
|
|
302
|
+
principal_type TEXT NOT NULL,
|
|
303
|
+
principal_id TEXT NOT NULL,
|
|
304
|
+
upstream_principal_hash TEXT,
|
|
305
|
+
status TEXT NOT NULL DEFAULT 'active',
|
|
306
|
+
synced_at TEXT NOT NULL,
|
|
307
|
+
created_at TEXT NOT NULL,
|
|
308
|
+
updated_at TEXT NOT NULL
|
|
309
|
+
)`,
|
|
310
|
+
`CREATE UNIQUE INDEX IF NOT EXISTS brain_audience_member_principal_idx ON brain_audience_members (audience_id, principal_type, principal_id)`,
|
|
311
|
+
`CREATE INDEX IF NOT EXISTS brain_audience_member_lookup_idx ON brain_audience_members (principal_type, principal_id, status)`,
|
|
312
|
+
`CREATE TABLE IF NOT EXISTS brain_capture_audiences (
|
|
313
|
+
id TEXT PRIMARY KEY,
|
|
314
|
+
capture_id TEXT NOT NULL,
|
|
315
|
+
audience_id TEXT NOT NULL,
|
|
316
|
+
acl_hash TEXT NOT NULL,
|
|
317
|
+
created_at TEXT NOT NULL
|
|
318
|
+
)`,
|
|
319
|
+
`CREATE UNIQUE INDEX IF NOT EXISTS brain_capture_audience_unique_idx ON brain_capture_audiences (capture_id, audience_id)`,
|
|
320
|
+
`CREATE INDEX IF NOT EXISTS brain_knowledge_audience_status_idx ON brain_knowledge (audience_id, status, updated_at)`,
|
|
321
|
+
`CREATE INDEX IF NOT EXISTS brain_proposal_audience_status_idx ON brain_proposals (audience_id, status, updated_at)`,
|
|
322
|
+
`CREATE TABLE IF NOT EXISTS brain_sensitivity_events (
|
|
323
|
+
id TEXT PRIMARY KEY,
|
|
324
|
+
source_id TEXT NOT NULL,
|
|
325
|
+
capture_id TEXT,
|
|
326
|
+
locator_hmac TEXT NOT NULL,
|
|
327
|
+
disposition TEXT NOT NULL,
|
|
328
|
+
categories_json TEXT NOT NULL DEFAULT '[]',
|
|
329
|
+
confidence_band TEXT NOT NULL,
|
|
330
|
+
policy_version TEXT NOT NULL,
|
|
331
|
+
upstream_provider TEXT NOT NULL,
|
|
332
|
+
quarantine_blob_handle TEXT,
|
|
333
|
+
expires_at TEXT,
|
|
334
|
+
reviewed_by TEXT,
|
|
335
|
+
reviewed_at TEXT,
|
|
336
|
+
created_at TEXT NOT NULL,
|
|
337
|
+
updated_at TEXT NOT NULL
|
|
338
|
+
)`,
|
|
339
|
+
`CREATE UNIQUE INDEX IF NOT EXISTS brain_sensitivity_locator_policy_idx ON brain_sensitivity_events (locator_hmac, policy_version)`,
|
|
340
|
+
`CREATE INDEX IF NOT EXISTS brain_sensitivity_source_created_idx ON brain_sensitivity_events (source_id, created_at)`,
|
|
341
|
+
`CREATE TABLE IF NOT EXISTS brain_search_artifacts (
|
|
342
|
+
id TEXT PRIMARY KEY,
|
|
343
|
+
capture_id TEXT NOT NULL,
|
|
344
|
+
source_id TEXT NOT NULL,
|
|
345
|
+
audience_id TEXT NOT NULL,
|
|
346
|
+
acl_hash TEXT NOT NULL,
|
|
347
|
+
title TEXT NOT NULL,
|
|
348
|
+
question TEXT NOT NULL DEFAULT '',
|
|
349
|
+
summary TEXT NOT NULL DEFAULT '',
|
|
350
|
+
resolution TEXT NOT NULL DEFAULT '',
|
|
351
|
+
systems_json TEXT NOT NULL DEFAULT '[]',
|
|
352
|
+
code_refs_json TEXT NOT NULL DEFAULT '[]',
|
|
353
|
+
content_hash TEXT NOT NULL,
|
|
354
|
+
sensitivity_policy_version TEXT NOT NULL,
|
|
355
|
+
index_version TEXT NOT NULL,
|
|
356
|
+
status TEXT NOT NULL DEFAULT 'active',
|
|
357
|
+
captured_at TEXT NOT NULL,
|
|
358
|
+
created_at TEXT NOT NULL,
|
|
359
|
+
updated_at TEXT NOT NULL
|
|
360
|
+
)`,
|
|
361
|
+
`CREATE UNIQUE INDEX IF NOT EXISTS brain_search_artifact_version_idx ON brain_search_artifacts (capture_id, content_hash, index_version)`,
|
|
362
|
+
`CREATE INDEX IF NOT EXISTS brain_search_artifact_audience_idx ON brain_search_artifacts (audience_id, status, updated_at)`,
|
|
363
|
+
`CREATE TABLE IF NOT EXISTS brain_search_bursts (
|
|
364
|
+
id TEXT PRIMARY KEY,
|
|
365
|
+
artifact_id TEXT NOT NULL,
|
|
366
|
+
capture_id TEXT NOT NULL,
|
|
367
|
+
source_id TEXT NOT NULL,
|
|
368
|
+
audience_id TEXT NOT NULL,
|
|
369
|
+
acl_hash TEXT NOT NULL,
|
|
370
|
+
ordinal INTEGER NOT NULL,
|
|
371
|
+
start_offset INTEGER NOT NULL,
|
|
372
|
+
end_offset INTEGER NOT NULL,
|
|
373
|
+
content TEXT NOT NULL,
|
|
374
|
+
contextual_text TEXT NOT NULL,
|
|
375
|
+
char_count INTEGER NOT NULL,
|
|
376
|
+
rare_term_score INTEGER NOT NULL DEFAULT 0,
|
|
377
|
+
reaction_count INTEGER NOT NULL DEFAULT 0,
|
|
378
|
+
indexed INTEGER NOT NULL DEFAULT 0,
|
|
379
|
+
content_hash TEXT NOT NULL,
|
|
380
|
+
index_version TEXT NOT NULL,
|
|
381
|
+
created_at TEXT NOT NULL,
|
|
382
|
+
updated_at TEXT NOT NULL
|
|
383
|
+
)`,
|
|
384
|
+
`CREATE UNIQUE INDEX IF NOT EXISTS brain_search_burst_version_idx ON brain_search_bursts (capture_id, content_hash, index_version, ordinal)`,
|
|
385
|
+
`CREATE INDEX IF NOT EXISTS brain_search_burst_audience_idx ON brain_search_bursts (audience_id, indexed, updated_at)`,
|
|
386
|
+
`CREATE TABLE IF NOT EXISTS brain_search_embeddings (
|
|
387
|
+
id TEXT PRIMARY KEY,
|
|
388
|
+
target_type TEXT NOT NULL,
|
|
389
|
+
target_id TEXT NOT NULL,
|
|
390
|
+
vector_key TEXT NOT NULL,
|
|
391
|
+
source_id TEXT NOT NULL,
|
|
392
|
+
audience_id TEXT NOT NULL,
|
|
393
|
+
acl_hash TEXT NOT NULL,
|
|
394
|
+
embedding_set_id TEXT NOT NULL,
|
|
395
|
+
dimensions INTEGER NOT NULL,
|
|
396
|
+
content_hash TEXT NOT NULL,
|
|
397
|
+
sensitivity_policy_version TEXT NOT NULL,
|
|
398
|
+
index_version TEXT NOT NULL,
|
|
399
|
+
status TEXT NOT NULL DEFAULT 'active',
|
|
400
|
+
created_at TEXT NOT NULL,
|
|
401
|
+
updated_at TEXT NOT NULL
|
|
402
|
+
)`,
|
|
403
|
+
`CREATE UNIQUE INDEX IF NOT EXISTS brain_search_embedding_target_idx ON brain_search_embeddings (embedding_set_id, target_type, target_id)`,
|
|
404
|
+
`CREATE INDEX IF NOT EXISTS brain_search_embedding_audience_idx ON brain_search_embeddings (audience_id, status, updated_at)`,
|
|
405
|
+
`CREATE TABLE IF NOT EXISTS brain_term_stats (
|
|
406
|
+
term TEXT PRIMARY KEY,
|
|
407
|
+
document_count INTEGER NOT NULL DEFAULT 0,
|
|
408
|
+
updated_at TEXT NOT NULL
|
|
409
|
+
)`,
|
|
410
|
+
`CREATE TABLE IF NOT EXISTS brain_search_corpus_stats (
|
|
411
|
+
id TEXT PRIMARY KEY,
|
|
412
|
+
document_count INTEGER NOT NULL DEFAULT 0,
|
|
413
|
+
updated_at TEXT NOT NULL
|
|
414
|
+
)`,
|
|
415
|
+
`CREATE TABLE IF NOT EXISTS brain_projects (
|
|
416
|
+
id TEXT PRIMARY KEY,
|
|
417
|
+
title TEXT NOT NULL,
|
|
418
|
+
description TEXT NOT NULL DEFAULT '',
|
|
419
|
+
created_at TEXT NOT NULL,
|
|
420
|
+
updated_at TEXT NOT NULL,
|
|
421
|
+
owner_email TEXT NOT NULL DEFAULT 'local@localhost',
|
|
422
|
+
org_id TEXT,
|
|
423
|
+
visibility TEXT NOT NULL DEFAULT 'private'
|
|
424
|
+
)`,
|
|
425
|
+
`CREATE TABLE IF NOT EXISTS brain_project_shares (
|
|
426
|
+
id TEXT PRIMARY KEY,
|
|
427
|
+
resource_id TEXT NOT NULL,
|
|
428
|
+
principal_type TEXT NOT NULL,
|
|
429
|
+
principal_id TEXT NOT NULL,
|
|
430
|
+
role TEXT NOT NULL DEFAULT 'viewer',
|
|
431
|
+
created_by TEXT NOT NULL,
|
|
432
|
+
created_at TEXT NOT NULL
|
|
433
|
+
)`,
|
|
434
|
+
`CREATE TABLE IF NOT EXISTS brain_project_sources (
|
|
435
|
+
id TEXT PRIMARY KEY,
|
|
436
|
+
project_id TEXT NOT NULL,
|
|
437
|
+
source_id TEXT NOT NULL,
|
|
438
|
+
created_at TEXT NOT NULL
|
|
439
|
+
)`,
|
|
440
|
+
`CREATE UNIQUE INDEX IF NOT EXISTS brain_project_source_unique_idx ON brain_project_sources (project_id, source_id)`,
|
|
441
|
+
`CREATE INDEX IF NOT EXISTS brain_project_shares_principal_idx ON brain_project_shares (resource_id, principal_type, principal_id)`,
|
|
442
|
+
].join(";\n"),
|
|
443
|
+
},
|
|
444
|
+
{
|
|
445
|
+
version: 22,
|
|
446
|
+
name: "brain-ingest-queue-lease-token",
|
|
447
|
+
sql: `ALTER TABLE brain_ingest_queue ADD COLUMN IF NOT EXISTS lease_token TEXT`,
|
|
448
|
+
},
|
|
449
|
+
{
|
|
450
|
+
version: 23,
|
|
451
|
+
name: "brain-audience-dependencies",
|
|
452
|
+
sql: [
|
|
453
|
+
`CREATE TABLE IF NOT EXISTS brain_audience_dependencies (
|
|
454
|
+
id TEXT PRIMARY KEY,
|
|
455
|
+
audience_id TEXT NOT NULL,
|
|
456
|
+
depends_on_audience_id TEXT NOT NULL,
|
|
457
|
+
created_at TEXT NOT NULL
|
|
458
|
+
)`,
|
|
459
|
+
`CREATE UNIQUE INDEX IF NOT EXISTS brain_audience_dependency_unique_idx ON brain_audience_dependencies (audience_id, depends_on_audience_id)`,
|
|
460
|
+
`CREATE INDEX IF NOT EXISTS brain_audience_dependency_upstream_idx ON brain_audience_dependencies (depends_on_audience_id, audience_id)`,
|
|
461
|
+
].join(";\n"),
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
version: 24,
|
|
465
|
+
name: "brain-audience-source-dependencies",
|
|
466
|
+
sql: [
|
|
467
|
+
`CREATE TABLE IF NOT EXISTS brain_audience_source_dependencies (
|
|
468
|
+
id TEXT PRIMARY KEY,
|
|
469
|
+
audience_id TEXT NOT NULL,
|
|
470
|
+
source_id TEXT NOT NULL,
|
|
471
|
+
created_at TEXT NOT NULL
|
|
472
|
+
)`,
|
|
473
|
+
`CREATE UNIQUE INDEX IF NOT EXISTS brain_audience_source_dependency_unique_idx ON brain_audience_source_dependencies (audience_id, source_id)`,
|
|
474
|
+
`CREATE INDEX IF NOT EXISTS brain_audience_source_dependency_source_idx ON brain_audience_source_dependencies (source_id, audience_id)`,
|
|
475
|
+
].join(";\n"),
|
|
476
|
+
},
|
|
273
477
|
],
|
|
274
478
|
{ table: "brain_migrations" },
|
|
275
479
|
);
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { registerRequiredSecret } from "@agent-native/core/secrets";
|
|
2
2
|
|
|
3
|
+
import "./onboarding.js";
|
|
4
|
+
|
|
3
5
|
registerRequiredSecret({
|
|
4
6
|
key: "SLACK_BOT_TOKEN",
|
|
5
7
|
label: "Slack Bot Token (local fallback)",
|
|
@@ -11,6 +13,17 @@ registerRequiredSecret({
|
|
|
11
13
|
required: false,
|
|
12
14
|
});
|
|
13
15
|
|
|
16
|
+
registerRequiredSecret({
|
|
17
|
+
key: "SLACK_SIGNING_SECRET",
|
|
18
|
+
label: "Slack Signing Secret",
|
|
19
|
+
description:
|
|
20
|
+
"Optional for Slack Events API delivery. Brain verifies signed events before refreshing an allow-listed channel thread.",
|
|
21
|
+
docsUrl: "https://api.slack.com/authentication/verifying-requests-from-slack",
|
|
22
|
+
scope: "workspace",
|
|
23
|
+
kind: "api-key",
|
|
24
|
+
required: false,
|
|
25
|
+
});
|
|
26
|
+
|
|
14
27
|
registerRequiredSecret({
|
|
15
28
|
key: "GRANOLA_API_KEY",
|
|
16
29
|
label: "Granola Enterprise API Key",
|
|
@@ -34,3 +47,36 @@ registerRequiredSecret({
|
|
|
34
47
|
kind: "api-key",
|
|
35
48
|
required: false,
|
|
36
49
|
});
|
|
50
|
+
|
|
51
|
+
registerRequiredSecret({
|
|
52
|
+
key: "GEMINI_API_KEY",
|
|
53
|
+
label: "Gemini API Key",
|
|
54
|
+
description:
|
|
55
|
+
"Optional shared embedding provider for Brain semantic retrieval. Lexical search remains available without it.",
|
|
56
|
+
docsUrl: "https://aistudio.google.com/apikey",
|
|
57
|
+
scope: "workspace",
|
|
58
|
+
kind: "api-key",
|
|
59
|
+
required: false,
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
registerRequiredSecret({
|
|
63
|
+
key: "COHERE_API_KEY",
|
|
64
|
+
label: "Cohere API Key",
|
|
65
|
+
description:
|
|
66
|
+
"Optional shared embedding provider for Brain semantic retrieval. Lexical search remains available without it.",
|
|
67
|
+
docsUrl: "https://dashboard.cohere.com/api-keys",
|
|
68
|
+
scope: "workspace",
|
|
69
|
+
kind: "api-key",
|
|
70
|
+
required: false,
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
registerRequiredSecret({
|
|
74
|
+
key: "VOYAGE_API_KEY",
|
|
75
|
+
label: "Voyage API Key",
|
|
76
|
+
description:
|
|
77
|
+
"Optional shared embedding provider for Brain semantic retrieval. Lexical search remains available without it.",
|
|
78
|
+
docsUrl: "https://dashboard.voyageai.com/api-keys",
|
|
79
|
+
scope: "workspace",
|
|
80
|
+
kind: "api-key",
|
|
81
|
+
required: false,
|
|
82
|
+
});
|
|
@@ -8,6 +8,7 @@ import { z } from "zod";
|
|
|
8
8
|
|
|
9
9
|
import { getDb, schema } from "../../../../db/index.js";
|
|
10
10
|
import {
|
|
11
|
+
BrainCaptureBlockedError,
|
|
11
12
|
createCapture,
|
|
12
13
|
parseJson,
|
|
13
14
|
serializeCapture,
|
|
@@ -110,22 +111,41 @@ export default defineEventHandler(async (event) => {
|
|
|
110
111
|
orgId: source.orgId ?? undefined,
|
|
111
112
|
},
|
|
112
113
|
async () => {
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
114
|
+
let capture;
|
|
115
|
+
try {
|
|
116
|
+
capture = await createCapture({
|
|
117
|
+
sourceId: source.id,
|
|
118
|
+
externalId: payload.externalId,
|
|
119
|
+
title: payload.title,
|
|
120
|
+
kind: "transcript",
|
|
121
|
+
content: textFromPayload(payload),
|
|
122
|
+
capturedAt: payload.occurredAt,
|
|
123
|
+
metadata: {
|
|
124
|
+
sourceKey: payload.sourceKey,
|
|
125
|
+
participants: payload.participants,
|
|
126
|
+
segments: payload.segments ?? [],
|
|
127
|
+
sourceUrl: payload.sourceUrl,
|
|
128
|
+
tags: payload.tags,
|
|
129
|
+
raw: payload.raw,
|
|
130
|
+
},
|
|
131
|
+
audience: {
|
|
132
|
+
kind: "meeting",
|
|
133
|
+
memberEmails: payload.participants.filter(
|
|
134
|
+
(participant): participant is string =>
|
|
135
|
+
typeof participant === "string",
|
|
136
|
+
),
|
|
137
|
+
upstreamRefHash: payload.externalId,
|
|
138
|
+
},
|
|
139
|
+
});
|
|
140
|
+
} catch (error) {
|
|
141
|
+
if (!(error instanceof BrainCaptureBlockedError)) throw error;
|
|
142
|
+
return {
|
|
143
|
+
ok: true,
|
|
144
|
+
sourceId: source.id,
|
|
145
|
+
capture: null,
|
|
146
|
+
sensitivityReceipt: error.receipt,
|
|
147
|
+
};
|
|
148
|
+
}
|
|
129
149
|
|
|
130
150
|
return {
|
|
131
151
|
ok: true,
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {
|
|
2
|
+
defineEventHandler,
|
|
3
|
+
getHeader,
|
|
4
|
+
readRawBody,
|
|
5
|
+
setResponseStatus,
|
|
6
|
+
} from "h3";
|
|
7
|
+
|
|
8
|
+
import { enqueueSlackThreadRefreshFromEvent } from "../../../../lib/slack-events.js";
|
|
9
|
+
|
|
10
|
+
export default defineEventHandler(async (event) => {
|
|
11
|
+
const rawBody = (await readRawBody(event)) ?? "";
|
|
12
|
+
const result = await enqueueSlackThreadRefreshFromEvent({
|
|
13
|
+
rawBody,
|
|
14
|
+
timestamp: getHeader(event, "x-slack-request-timestamp"),
|
|
15
|
+
signature: getHeader(event, "x-slack-signature"),
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
if (result.status === "invalid") {
|
|
19
|
+
setResponseStatus(event, 401);
|
|
20
|
+
return { ok: false, error: "invalid Slack signature or payload" };
|
|
21
|
+
}
|
|
22
|
+
if (result.status === "missing-signing-secret") {
|
|
23
|
+
setResponseStatus(event, 503);
|
|
24
|
+
return { ok: false, error: "Slack signing secret is not configured" };
|
|
25
|
+
}
|
|
26
|
+
if (result.challenge) return result.challenge;
|
|
27
|
+
return { ok: true };
|
|
28
|
+
});
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
export const SLACK_CHANNEL_CONFIG_KEYS = [
|
|
2
|
+
"channelIds",
|
|
3
|
+
"channels",
|
|
4
|
+
"allowedChannels",
|
|
5
|
+
"allowlistedChannels",
|
|
6
|
+
"allowList",
|
|
7
|
+
] as const;
|
|
8
|
+
|
|
9
|
+
function objectValue(value: unknown): Record<string, unknown> {
|
|
10
|
+
return value && typeof value === "object" && !Array.isArray(value)
|
|
11
|
+
? { ...(value as Record<string, unknown>) }
|
|
12
|
+
: {};
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function hasSlackChannelPatch(config: Record<string, unknown>) {
|
|
16
|
+
const nested = objectValue(config.slack);
|
|
17
|
+
return SLACK_CHANNEL_CONFIG_KEYS.some(
|
|
18
|
+
(key) =>
|
|
19
|
+
Object.prototype.hasOwnProperty.call(config, key) ||
|
|
20
|
+
Object.prototype.hasOwnProperty.call(nested, key),
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function slackChannelRefsFromConfig(config: Record<string, unknown>) {
|
|
25
|
+
const nested = objectValue(config.slack);
|
|
26
|
+
const values: string[] = [];
|
|
27
|
+
for (const itemConfig of [config, nested]) {
|
|
28
|
+
for (const key of SLACK_CHANNEL_CONFIG_KEYS) {
|
|
29
|
+
const value = itemConfig[key];
|
|
30
|
+
if (typeof value === "string") values.push(...value.split(","));
|
|
31
|
+
if (Array.isArray(value)) {
|
|
32
|
+
for (const item of value) {
|
|
33
|
+
if (typeof item === "string") values.push(item);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
return Array.from(
|
|
39
|
+
new Set(
|
|
40
|
+
values.map((value) => value.trim().replace(/^#/, "")).filter(Boolean),
|
|
41
|
+
),
|
|
42
|
+
);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function normalizeSlackChannelConfig(
|
|
46
|
+
merged: Record<string, unknown>,
|
|
47
|
+
patch: Record<string, unknown>,
|
|
48
|
+
) {
|
|
49
|
+
if (!hasSlackChannelPatch(patch)) return merged;
|
|
50
|
+
const normalized = { ...merged };
|
|
51
|
+
const nested = objectValue(normalized.slack);
|
|
52
|
+
for (const key of SLACK_CHANNEL_CONFIG_KEYS) {
|
|
53
|
+
delete normalized[key];
|
|
54
|
+
delete nested[key];
|
|
55
|
+
}
|
|
56
|
+
normalized.channelIds = slackChannelRefsFromConfig(patch);
|
|
57
|
+
if (Object.keys(nested).length) normalized.slack = nested;
|
|
58
|
+
else delete normalized.slack;
|
|
59
|
+
return normalized;
|
|
60
|
+
}
|
|
@@ -62,6 +62,11 @@ export interface BrainSettings {
|
|
|
62
62
|
captureSanitizationEnabled?: boolean;
|
|
63
63
|
captureSanitizationModel?: string;
|
|
64
64
|
captureSanitizationInstructions?: string;
|
|
65
|
+
privacyClassifierModel?: string;
|
|
66
|
+
privacyClassifierEngine?: string;
|
|
67
|
+
sensitivityCustomInstructions?: string;
|
|
68
|
+
publicChannelExclusionPatterns?: string[];
|
|
69
|
+
quarantineRetentionHours?: number;
|
|
65
70
|
connectorPollMinutes: number;
|
|
66
71
|
requireCitations?: boolean;
|
|
67
72
|
autoArchiveResolved?: boolean;
|
|
@@ -82,6 +87,11 @@ export const DEFAULT_BRAIN_SETTINGS: BrainSettings = {
|
|
|
82
87
|
captureSanitizationModel: "",
|
|
83
88
|
captureSanitizationInstructions:
|
|
84
89
|
"Keep durable company-relevant information and remove personal, recruiting, hiring, candidate-evaluation, sensitive, or casual content before storage.",
|
|
90
|
+
privacyClassifierModel: "",
|
|
91
|
+
privacyClassifierEngine: "",
|
|
92
|
+
sensitivityCustomInstructions: "",
|
|
93
|
+
publicChannelExclusionPatterns: [],
|
|
94
|
+
quarantineRetentionHours: 72,
|
|
85
95
|
connectorPollMinutes: 60,
|
|
86
96
|
requireCitations: true,
|
|
87
97
|
autoArchiveResolved: true,
|
|
@@ -121,18 +121,38 @@ action trio instead:
|
|
|
121
121
|
provider host, injects configured credentials, blocks private/internal URLs,
|
|
122
122
|
and redacts secrets.
|
|
123
123
|
|
|
124
|
-
Use `@agent-native/core/provider-api` as the shared substrate
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
124
|
+
Use `@agent-native/core/provider-api` as the shared substrate, and build these
|
|
125
|
+
actions as thin factory imports rather than copying `defineAction` schemas and
|
|
126
|
+
handlers into each template:
|
|
127
|
+
|
|
128
|
+
```ts
|
|
129
|
+
import {
|
|
130
|
+
createProviderApiCatalogAction,
|
|
131
|
+
createProviderApiDocsAction,
|
|
132
|
+
createProviderApiRequestAction,
|
|
133
|
+
} from "@agent-native/core/provider-api/actions/provider-api";
|
|
134
|
+
import {
|
|
135
|
+
createDeleteStagedDatasetAction,
|
|
136
|
+
createListStagedDatasetsAction,
|
|
137
|
+
createQueryStagedDatasetAction,
|
|
138
|
+
} from "@agent-native/core/provider-api/actions/staged-datasets";
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Pass the app's existing provider runtime to the provider factories, and pass
|
|
142
|
+
its app id to the staged-dataset factories. Keep app-specific descriptions,
|
|
143
|
+
provider allow-lists, HTTP/tool-callability settings, and credential adapters
|
|
144
|
+
as factory options. Only add a thin credential adapter when the app has
|
|
145
|
+
app-specific credential lookup rules. If the app stores a built-in provider's
|
|
146
|
+
OAuth grant under a narrower local provider id, use the runtime's
|
|
147
|
+
`oauthProviderOverrides` instead of duplicating provider config. If credentials
|
|
148
|
+
are stored on shareable/resource rows rather than in the shared credential or
|
|
149
|
+
OAuth-token stores, build a resolver that enforces those access checks before
|
|
150
|
+
exposing raw provider requests. Keep `provider-api-request` `http: false`
|
|
151
|
+
unless a separate UI permission model authorizes arbitrary provider writes.
|
|
152
|
+
Specific actions such as `search-records`, `search-emails`, or `sync-source`
|
|
153
|
+
are convenience shortcuts, not capability limits; agents should fall back to
|
|
154
|
+
the provider API trio when a question requires an endpoint or filter that the
|
|
155
|
+
shortcut does not model.
|
|
136
156
|
|
|
137
157
|
This is a framework tenet. The safety boundary should be provider host
|
|
138
158
|
allow-listing, credential scoping, auth injection, private-network blocking,
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: customizing-agent-native
|
|
3
|
+
description: >-
|
|
4
|
+
How to adopt, compose, or selectively copy Agent Native UI into app-owned
|
|
5
|
+
code. Use when overriding shared components, customizing a template, adding
|
|
6
|
+
UI to chat or headless apps, or inspecting installed framework source.
|
|
7
|
+
scope: dev
|
|
8
|
+
metadata:
|
|
9
|
+
internal: true
|
|
10
|
+
---
|
|
11
|
+
|
|
12
|
+
# Customizing Agent Native
|
|
13
|
+
|
|
14
|
+
## Rule
|
|
15
|
+
|
|
16
|
+
Start with the public component and its props, slots, callbacks, and stable
|
|
17
|
+
class names. If those seams are not enough, copy the smallest useful reference
|
|
18
|
+
implementation into the app and make that copy app-owned. Never edit
|
|
19
|
+
`node_modules`, deep-import a private source file at runtime, or patch an
|
|
20
|
+
`@agent-native/*` package.
|
|
21
|
+
|
|
22
|
+
Use this order:
|
|
23
|
+
|
|
24
|
+
1. Configure the public component.
|
|
25
|
+
2. Compose public primitives behind a local app component.
|
|
26
|
+
3. Copy one component or helper into app source and change the app import.
|
|
27
|
+
4. Propose a new Toolkit seam when the same override is useful in two apps.
|
|
28
|
+
|
|
29
|
+
Copying is for intentional product customization, not for hiding an upgrade
|
|
30
|
+
failure or replacing Core runtime behavior.
|
|
31
|
+
|
|
32
|
+
## Find The Installed Implementation
|
|
33
|
+
|
|
34
|
+
Use the source that matches the installed package version:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
pnpm action docs-search --query "<component or feature>"
|
|
38
|
+
pnpm action source-search --query "<component or symbol>"
|
|
39
|
+
rg -n "<component or symbol>" node_modules/@agent-native/toolkit/src
|
|
40
|
+
rg -n "<component or symbol>" node_modules/@agent-native/core/corpus
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
- Toolkit publishes readable TypeScript under
|
|
44
|
+
`node_modules/@agent-native/toolkit/src/` for selective UI adoption.
|
|
45
|
+
- Core and first-party template source lives under
|
|
46
|
+
`node_modules/@agent-native/core/corpus/core/` and
|
|
47
|
+
`node_modules/@agent-native/core/corpus/templates/`.
|
|
48
|
+
- Treat those trees as read-only references. Copy files into an app directory
|
|
49
|
+
such as `app/components/`, then import the local copy.
|
|
50
|
+
|
|
51
|
+
When a copied component imports sibling helpers, copy only the required
|
|
52
|
+
siblings or replace them with public package imports. Do not copy an entire
|
|
53
|
+
package or template to change one surface.
|
|
54
|
+
|
|
55
|
+
## Preserve The Agent-Native Contract
|
|
56
|
+
|
|
57
|
+
UI ownership may change; product contracts should not:
|
|
58
|
+
|
|
59
|
+
- Keep app operations in `defineAction` actions and call them through
|
|
60
|
+
`useActionQuery`, `useActionMutation`, or another named client helper.
|
|
61
|
+
- Keep navigation, selection, and focused-object state visible through the
|
|
62
|
+
existing application-state keys.
|
|
63
|
+
- Keep AI work in the shared agent chat instead of adding direct LLM calls.
|
|
64
|
+
- Keep auth, access checks, persistence, chat transport, and agent execution in
|
|
65
|
+
Core. Do not copy those runtimes into the app.
|
|
66
|
+
- Keep local adapters narrow so package upgrades still improve every surface
|
|
67
|
+
the app has not intentionally taken ownership of.
|
|
68
|
+
|
|
69
|
+
## App Shapes
|
|
70
|
+
|
|
71
|
+
- **Template app:** begin with its existing local adapters and domain UI. Use
|
|
72
|
+
Toolkit for repeated workspace UI; copy only the piece being customized.
|
|
73
|
+
- **Chat app:** keep `AgentChatSurface`, thread state, and chat transport in
|
|
74
|
+
Core. Compose or copy Toolkit presentation such as chat-history UI around it.
|
|
75
|
+
- **Headless app:** stay action-first while no UI is needed. When adding a UI,
|
|
76
|
+
use the Chat template as the on-ramp or add Toolkit components without
|
|
77
|
+
replacing the existing actions.
|
|
78
|
+
- **Workspace:** put one-app overrides in that app. Promote a local component
|
|
79
|
+
to `packages/shared` only when multiple workspace apps use it.
|
|
80
|
+
|
|
81
|
+
## After Copying
|
|
82
|
+
|
|
83
|
+
- Remove unused dependencies and imports from the copied file.
|
|
84
|
+
- Keep visible text in the app's localization catalogs.
|
|
85
|
+
- Run the app's formatter, typecheck, and focused tests.
|
|
86
|
+
- Re-check the installed source during future package upgrades; the app-owned
|
|
87
|
+
copy does not receive upstream fixes automatically.
|
|
88
|
+
|
|
89
|
+
## Don't
|
|
90
|
+
|
|
91
|
+
- Don't edit or import from `node_modules/@agent-native/*/src` at runtime.
|
|
92
|
+
- Don't add `pnpm.overrides`, patches, or resolutions for Agent Native packages.
|
|
93
|
+
- Don't copy Core auth, DB, action, agent-loop, or transport internals.
|
|
94
|
+
- Don't fork a full template when a prop, slot, wrapper, or one-file copy works.
|
|
95
|
+
|
|
96
|
+
## Related Skills
|
|
97
|
+
|
|
98
|
+
- `agent-native-docs` — version-matched docs and source lookup
|
|
99
|
+
- `agent-native-toolkit` — shared-vs-app-owned architecture boundary
|
|
100
|
+
- `self-modifying-code` — safe app source edits
|
|
101
|
+
- `upgrade-agent-native` — supported package upgrade path
|
|
102
|
+
- `adding-a-feature` — UI/action/instructions/application-state parity
|
|
@@ -35,8 +35,14 @@ Tier 4 includes **all** of the following — not only editing package source:
|
|
|
35
35
|
- Files under `node_modules/@agent-native/*` (core, dispatch, scheduling, …)
|
|
36
36
|
- `pnpm.overrides`, `overrides`, `resolutions`, or `patchedDependencies` that
|
|
37
37
|
target any `@agent-native/*` package
|
|
38
|
-
- Local patches
|
|
39
|
-
|
|
38
|
+
- Local package patches or invented "dispatch/core behavior" shims meant to
|
|
39
|
+
paper over a version skew or failed upgrade
|
|
40
|
+
|
|
41
|
+
This does not prohibit intentional app-owned UI customization. When public
|
|
42
|
+
props and composition are insufficient, the `customizing-agent-native` skill
|
|
43
|
+
allows copying the smallest reference UI component from the installed source
|
|
44
|
+
into the app. The copy must use public runtime contracts and must not replace
|
|
45
|
+
Core auth, DB, actions, agent execution, or transport behavior.
|
|
40
46
|
|
|
41
47
|
When an older branch needs current packages, use **`agent-native upgrade`**
|
|
42
48
|
(see the `upgrade-agent-native` skill). If upgrade or typecheck fails, fix
|
|
@@ -88,6 +94,8 @@ inline strings in components.
|
|
|
88
94
|
- Don't modify `.env` files or files containing secrets
|
|
89
95
|
- Don't modify `@agent-native/core`, `@agent-native/dispatch`, or other
|
|
90
96
|
`@agent-native/*` package internals (including under `node_modules`)
|
|
97
|
+
- Don't confuse a read-only reference copy with editing package internals: use
|
|
98
|
+
`customizing-agent-native` for selective app-owned UI adoption
|
|
91
99
|
- Don't add `pnpm.overrides` / `patchedDependencies` / `resolutions` for
|
|
92
100
|
`@agent-native/*` to "make the app run" after a version bump
|
|
93
101
|
- Don't invent local dispatch/core behavior overrides when upgrade fails —
|
|
@@ -99,6 +107,7 @@ inline strings in components.
|
|
|
99
107
|
## Related Skills
|
|
100
108
|
|
|
101
109
|
- **upgrade-agent-native** — supported path to bring an older app/workspace current
|
|
110
|
+
- **customizing-agent-native** — safe selective adoption of installed reference UI
|
|
102
111
|
- **storing-data** — Tier 1 modifications (data files) are the safest and most common
|
|
103
112
|
- **actions** — The agent can create or modify actions to add new capabilities
|
|
104
113
|
- **delegate-to-agent** — Self-modification requests come through the agent chat
|