@agent-native/core 0.112.0 → 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 +22 -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 +6 -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 +18 -10
- package/corpus/core/src/cli/code-agent-runs.concurrent-worker.ts +33 -0
- package/corpus/core/src/cli/code-agent-runs.ts +55 -62
- package/corpus/core/src/cli/codex-cli-participant.ts +496 -0
- package/corpus/core/src/cli/multi-frontier-runs.ts +1246 -135
- package/corpus/core/src/client/chat/ChatHistoryList.tsx +7 -404
- 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/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/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/actions/_schemas.ts +13 -7
- package/corpus/templates/brain/actions/delete-staged-dataset.ts +3 -24
- package/corpus/templates/brain/actions/list-staged-datasets.ts +3 -28
- 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/update-source.ts +5 -1
- package/corpus/templates/brain/app/components/layout/Sidebar.tsx +48 -154
- package/corpus/templates/brain/app/lib/brain.ts +55 -0
- package/corpus/templates/brain/app/lib/ingest-handoff.ts +35 -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/server/lib/connectors.ts +53 -2
- package/corpus/templates/brain/server/lib/slack-channel-membership.ts +44 -0
- package/corpus/templates/brain/shared/slack-source-config.ts +60 -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.map +1 -1
- package/dist/cli/code-agent-executor.js +18 -10
- 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.map +1 -1
- package/dist/cli/code-agent-runs.js +43 -56
- 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 +115 -0
- package/dist/cli/multi-frontier-runs.d.ts.map +1 -1
- package/dist/cli/multi-frontier-runs.js +831 -113
- package/dist/cli/multi-frontier-runs.js.map +1 -1
- 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/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/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/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/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 +7 -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
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { stagingExecuteRequest } from "@agent-native/core/provider-api/staging";
|
|
3
|
-
import { getCredentialContext } from "@agent-native/core/server/request-context";
|
|
1
|
+
import { createProviderApiRequestAction } from "@agent-native/core/provider-api/actions/provider-api";
|
|
4
2
|
import { z } from "zod";
|
|
5
3
|
|
|
6
4
|
import {
|
|
7
5
|
BRAIN_APP_ID,
|
|
8
6
|
BRAIN_PROVIDER_API_IDS,
|
|
9
|
-
executeProviderApiRequest,
|
|
10
7
|
getBrainProviderApiRuntime,
|
|
11
8
|
} from "../server/lib/provider-api.js";
|
|
12
9
|
|
|
@@ -68,7 +65,7 @@ const PaginationSchema = z
|
|
|
68
65
|
})
|
|
69
66
|
.optional();
|
|
70
67
|
|
|
71
|
-
export default
|
|
68
|
+
export default createProviderApiRequestAction(getBrainProviderApiRuntime(), {
|
|
72
69
|
description:
|
|
73
70
|
"Make an arbitrary authenticated HTTP request to a configured or shared provider API for Brain analysis. Use this as the flexible escape hatch when Brain source readers cannot express the needed endpoint, filters, pagination, payload, or API version. The request is constrained to the provider host, uses configured credentials automatically, blocks private/internal URLs, and redacts secrets from responses.",
|
|
74
71
|
schema: z.object({
|
|
@@ -198,36 +195,5 @@ export default defineAction({
|
|
|
198
195
|
}),
|
|
199
196
|
http: false,
|
|
200
197
|
toolCallable: false,
|
|
201
|
-
|
|
202
|
-
if (args.stageAs) {
|
|
203
|
-
const ctx = getCredentialContext();
|
|
204
|
-
if (!ctx) {
|
|
205
|
-
throw new Error("No authenticated context for provider API staging.");
|
|
206
|
-
}
|
|
207
|
-
const providerRuntime = getBrainProviderApiRuntime();
|
|
208
|
-
return stagingExecuteRequest(
|
|
209
|
-
{
|
|
210
|
-
provider: args.provider,
|
|
211
|
-
method: args.method,
|
|
212
|
-
path: args.path,
|
|
213
|
-
query: args.query,
|
|
214
|
-
headers: args.headers,
|
|
215
|
-
body: args.body,
|
|
216
|
-
auth: args.auth,
|
|
217
|
-
connectionId: args.connectionId,
|
|
218
|
-
accountId: args.accountId,
|
|
219
|
-
timeoutMs: args.timeoutMs,
|
|
220
|
-
maxBytes: args.maxBytes,
|
|
221
|
-
stageAs: args.stageAs,
|
|
222
|
-
itemsPath: args.itemsPath,
|
|
223
|
-
pagination: args.pagination,
|
|
224
|
-
},
|
|
225
|
-
(reqArgs) => providerRuntime.executeRequest(reqArgs),
|
|
226
|
-
{ appId: BRAIN_APP_ID, ownerEmail: ctx.userEmail },
|
|
227
|
-
);
|
|
228
|
-
}
|
|
229
|
-
return executeProviderApiRequest(
|
|
230
|
-
args as unknown as Parameters<typeof executeProviderApiRequest>[0],
|
|
231
|
-
);
|
|
232
|
-
},
|
|
198
|
+
appId: BRAIN_APP_ID,
|
|
233
199
|
});
|
|
@@ -1,13 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Thin Brain re-export of the staged dataset query helper, pre-bound to appId="brain".
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
5
|
-
import { runAggregateQuery } from "@agent-native/core/provider-api/staged-datasets-aggregate";
|
|
6
|
-
import {
|
|
7
|
-
getStagedDatasetMeta,
|
|
8
|
-
getStagedDatasetRows,
|
|
9
|
-
} from "@agent-native/core/provider-api/staged-datasets-store";
|
|
10
|
-
import { getCredentialContext } from "@agent-native/core/server/request-context";
|
|
4
|
+
import { createQueryStagedDatasetAction } from "@agent-native/core/provider-api/actions/staged-datasets";
|
|
11
5
|
import { z } from "zod";
|
|
12
6
|
|
|
13
7
|
import { BRAIN_APP_ID } from "../server/lib/provider-api.js";
|
|
@@ -40,7 +34,7 @@ const AggregateFieldSchema = z.object({
|
|
|
40
34
|
.describe("Output column name. Default: {op}_{column}."),
|
|
41
35
|
});
|
|
42
36
|
|
|
43
|
-
export default
|
|
37
|
+
export default createQueryStagedDatasetAction({
|
|
44
38
|
description:
|
|
45
39
|
"Run a filter/aggregate/project query over a staged dataset previously written by provider-api-request (stageAs). Use after staging provider source records, messages, transcripts, documents, issues, events, or search results to count, group, filter, or project rows without re-fetching provider APIs.",
|
|
46
40
|
schema: z.object({
|
|
@@ -86,44 +80,5 @@ export default defineAction({
|
|
|
86
80
|
.describe("Maximum rows to return (default all, max 10000)."),
|
|
87
81
|
}),
|
|
88
82
|
http: false,
|
|
89
|
-
|
|
90
|
-
run: async (args) => {
|
|
91
|
-
const ctx = getCredentialContext();
|
|
92
|
-
if (!ctx) {
|
|
93
|
-
throw new Error("No authenticated context for query-staged-dataset.");
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
const meta = await getStagedDatasetMeta({
|
|
97
|
-
id: args.datasetId,
|
|
98
|
-
appId: BRAIN_APP_ID,
|
|
99
|
-
ownerEmail: ctx.userEmail,
|
|
100
|
-
});
|
|
101
|
-
if (!meta) {
|
|
102
|
-
throw new Error(
|
|
103
|
-
`Dataset ${args.datasetId} not found (or belongs to a different owner/app).`,
|
|
104
|
-
);
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
const rows = await getStagedDatasetRows({
|
|
108
|
-
id: args.datasetId,
|
|
109
|
-
appId: BRAIN_APP_ID,
|
|
110
|
-
ownerEmail: ctx.userEmail,
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
const result = runAggregateQuery(rows, {
|
|
114
|
-
where: args.where,
|
|
115
|
-
groupBy: args.groupBy,
|
|
116
|
-
aggregate: args.aggregate,
|
|
117
|
-
select: args.select,
|
|
118
|
-
orderBy: args.orderBy,
|
|
119
|
-
orderDir: args.orderDir,
|
|
120
|
-
limit: args.limit,
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
return {
|
|
124
|
-
dataset: { id: meta.id, name: meta.name, totalRows: meta.rowCount },
|
|
125
|
-
rowCount: result.length,
|
|
126
|
-
rows: result,
|
|
127
|
-
};
|
|
128
|
-
},
|
|
83
|
+
appId: BRAIN_APP_ID,
|
|
129
84
|
});
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
stableJson,
|
|
12
12
|
} from "../server/lib/brain.js";
|
|
13
13
|
import { assertSourceWorkspaceConnectionAvailable } from "../server/lib/source-credentials.js";
|
|
14
|
+
import { normalizeSlackChannelConfig } from "../shared/slack-source-config.js";
|
|
14
15
|
import { optionalJsonRecordSchema } from "./_schemas.js";
|
|
15
16
|
|
|
16
17
|
export default defineAction({
|
|
@@ -29,10 +30,13 @@ export default defineAction({
|
|
|
29
30
|
if (args.title !== undefined) updates.title = args.title;
|
|
30
31
|
if (args.status !== undefined) updates.status = args.status;
|
|
31
32
|
if (args.config !== undefined) {
|
|
32
|
-
|
|
33
|
+
let nextConfig: Record<string, unknown> = {
|
|
33
34
|
...parseJson<Record<string, unknown>>(existing.configJson, {}),
|
|
34
35
|
...args.config,
|
|
35
36
|
};
|
|
37
|
+
if (existing.provider === "slack") {
|
|
38
|
+
nextConfig = normalizeSlackChannelConfig(nextConfig, args.config);
|
|
39
|
+
}
|
|
36
40
|
const workspaceConnectionId =
|
|
37
41
|
typeof nextConfig.workspaceConnectionId === "string"
|
|
38
42
|
? nextConfig.workspaceConnectionId.trim()
|
|
@@ -10,25 +10,18 @@ import { useT } from "@agent-native/core/client/i18n";
|
|
|
10
10
|
import { OrgSwitcher } from "@agent-native/core/client/org";
|
|
11
11
|
import { FeedbackButton } from "@agent-native/core/client/ui";
|
|
12
12
|
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
ChatHistoryList,
|
|
14
|
+
type ChatHistoryItem,
|
|
15
|
+
} from "@agent-native/toolkit/chat-history";
|
|
16
|
+
import {
|
|
16
17
|
IconLayoutSidebarLeftCollapse,
|
|
17
18
|
IconLayoutSidebarLeftExpand,
|
|
18
|
-
IconPin,
|
|
19
19
|
IconPlus,
|
|
20
20
|
} from "@tabler/icons-react";
|
|
21
|
-
import { useEffect, useMemo
|
|
21
|
+
import { useEffect, useMemo } from "react";
|
|
22
22
|
import { Link, NavLink, useLocation, useNavigate } from "react-router";
|
|
23
23
|
import { toast } from "sonner";
|
|
24
24
|
|
|
25
|
-
import {
|
|
26
|
-
DropdownMenu,
|
|
27
|
-
DropdownMenuContent,
|
|
28
|
-
DropdownMenuItem,
|
|
29
|
-
DropdownMenuTrigger,
|
|
30
|
-
} from "@/components/ui/dropdown-menu";
|
|
31
|
-
import { Input } from "@/components/ui/input";
|
|
32
25
|
import {
|
|
33
26
|
Tooltip,
|
|
34
27
|
TooltipContent,
|
|
@@ -104,10 +97,6 @@ function BrainChatsSection() {
|
|
|
104
97
|
autoCreate: false,
|
|
105
98
|
restoreActiveThread: false,
|
|
106
99
|
});
|
|
107
|
-
const [renamingThreadId, setRenamingThreadId] = useState<string | null>(null);
|
|
108
|
-
const [renameDraft, setRenameDraft] = useState("");
|
|
109
|
-
const renameInputRef = useRef<HTMLInputElement | null>(null);
|
|
110
|
-
const committingRenameRef = useRef(false);
|
|
111
100
|
|
|
112
101
|
const visibleThreads = useMemo(
|
|
113
102
|
() =>
|
|
@@ -117,6 +106,20 @@ function BrainChatsSection() {
|
|
|
117
106
|
.slice(0, 8),
|
|
118
107
|
[threads],
|
|
119
108
|
);
|
|
109
|
+
const chatItems = useMemo<ChatHistoryItem[]>(
|
|
110
|
+
() =>
|
|
111
|
+
visibleThreads.map((thread) => ({
|
|
112
|
+
id: thread.id,
|
|
113
|
+
title: threadTitle(thread),
|
|
114
|
+
titleText: threadTitle(thread),
|
|
115
|
+
timestamp:
|
|
116
|
+
thread.id === activeThreadId
|
|
117
|
+
? undefined
|
|
118
|
+
: formatThreadAge(threadUpdatedAt(thread)),
|
|
119
|
+
pinned: Boolean(thread.pinnedAt),
|
|
120
|
+
})),
|
|
121
|
+
[activeThreadId, visibleThreads],
|
|
122
|
+
);
|
|
120
123
|
|
|
121
124
|
useEffect(() => {
|
|
122
125
|
const refresh = () => refreshThreads();
|
|
@@ -137,14 +140,6 @@ function BrainChatsSection() {
|
|
|
137
140
|
};
|
|
138
141
|
}, [refreshThreads]);
|
|
139
142
|
|
|
140
|
-
useEffect(() => {
|
|
141
|
-
if (!renamingThreadId) return;
|
|
142
|
-
requestAnimationFrame(() => {
|
|
143
|
-
renameInputRef.current?.focus();
|
|
144
|
-
renameInputRef.current?.select();
|
|
145
|
-
});
|
|
146
|
-
}, [renamingThreadId]);
|
|
147
|
-
|
|
148
143
|
function openThread(threadId: string, options?: { isNew?: boolean }) {
|
|
149
144
|
switchThread(threadId);
|
|
150
145
|
navigateWithAgentChatViewTransition(navigate, "/");
|
|
@@ -175,36 +170,10 @@ function BrainChatsSection() {
|
|
|
175
170
|
}
|
|
176
171
|
}
|
|
177
172
|
|
|
178
|
-
function
|
|
179
|
-
|
|
180
|
-
setRenameDraft(threadTitle(thread));
|
|
181
|
-
setRenamingThreadId(thread.id);
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
function cancelRenameThread() {
|
|
185
|
-
committingRenameRef.current = true;
|
|
186
|
-
setRenamingThreadId(null);
|
|
187
|
-
setRenameDraft("");
|
|
188
|
-
}
|
|
189
|
-
|
|
190
|
-
async function commitRenameThread() {
|
|
191
|
-
if (committingRenameRef.current) return;
|
|
192
|
-
const threadId = renamingThreadId;
|
|
193
|
-
const title = renameDraft.trim();
|
|
194
|
-
if (!threadId) return;
|
|
195
|
-
committingRenameRef.current = true;
|
|
196
|
-
setRenamingThreadId(null);
|
|
197
|
-
setRenameDraft("");
|
|
198
|
-
if (title) {
|
|
199
|
-
const renamed = await renameThread(threadId, title);
|
|
173
|
+
function handleRenameThread(threadId: string, title: string) {
|
|
174
|
+
void renameThread(threadId, title).then((renamed) => {
|
|
200
175
|
if (!renamed) toast.error(t("chat.renameFailed"));
|
|
201
|
-
}
|
|
202
|
-
committingRenameRef.current = false;
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
function handleRenameSubmit(event: FormEvent<HTMLFormElement>) {
|
|
206
|
-
event.preventDefault();
|
|
207
|
-
void commitRenameThread();
|
|
176
|
+
});
|
|
208
177
|
}
|
|
209
178
|
|
|
210
179
|
return (
|
|
@@ -227,107 +196,32 @@ function BrainChatsSection() {
|
|
|
227
196
|
<TooltipContent>{t("chat.newChat")}</TooltipContent>
|
|
228
197
|
</Tooltip>
|
|
229
198
|
</div>
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
{
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
event.preventDefault();
|
|
257
|
-
cancelRenameThread();
|
|
258
|
-
}
|
|
259
|
-
}}
|
|
260
|
-
maxLength={160}
|
|
261
|
-
aria-label={t("chat.renameThread", {
|
|
262
|
-
title: threadTitle(thread),
|
|
263
|
-
})}
|
|
264
|
-
className="h-6 min-w-0 rounded-sm border-sidebar-border bg-background px-1.5 text-xs"
|
|
265
|
-
/>
|
|
266
|
-
</form>
|
|
267
|
-
) : (
|
|
268
|
-
<>
|
|
269
|
-
<button
|
|
270
|
-
type="button"
|
|
271
|
-
onClick={() => openThread(thread.id)}
|
|
272
|
-
className="flex h-full min-w-0 flex-1 items-center px-2 text-start outline-none focus-visible:ring-2 focus-visible:ring-ring"
|
|
273
|
-
>
|
|
274
|
-
<span className="min-w-0 flex-1 truncate">
|
|
275
|
-
{threadTitle(thread)}
|
|
276
|
-
</span>
|
|
277
|
-
</button>
|
|
278
|
-
<div className="relative flex size-7 shrink-0 items-center justify-end pe-1">
|
|
279
|
-
<span className="text-[11px] text-sidebar-foreground/50 transition-opacity group-hover:opacity-0 group-focus-within:opacity-0">
|
|
280
|
-
{isActive ? "" : formatThreadAge(threadUpdatedAt(thread))}
|
|
281
|
-
</span>
|
|
282
|
-
<DropdownMenu>
|
|
283
|
-
<DropdownMenuTrigger asChild>
|
|
284
|
-
<button
|
|
285
|
-
type="button"
|
|
286
|
-
aria-label={t("chat.optionsFor", {
|
|
287
|
-
title: threadTitle(thread),
|
|
288
|
-
})}
|
|
289
|
-
className="absolute end-1 flex size-6 items-center justify-center rounded-md text-sidebar-foreground/65 opacity-0 transition-opacity hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring group-hover:opacity-100 group-focus-within:opacity-100 data-[state=open]:opacity-100"
|
|
290
|
-
>
|
|
291
|
-
<IconDots className="size-4" />
|
|
292
|
-
</button>
|
|
293
|
-
</DropdownMenuTrigger>
|
|
294
|
-
<DropdownMenuContent
|
|
295
|
-
align="end"
|
|
296
|
-
side="right"
|
|
297
|
-
sideOffset={6}
|
|
298
|
-
>
|
|
299
|
-
<DropdownMenuItem
|
|
300
|
-
onSelect={() => startRenameThread(thread)}
|
|
301
|
-
>
|
|
302
|
-
<IconEdit className="size-4" />
|
|
303
|
-
{t("chat.renameChat")}
|
|
304
|
-
</DropdownMenuItem>
|
|
305
|
-
<DropdownMenuItem
|
|
306
|
-
onSelect={() =>
|
|
307
|
-
void pinThread(thread.id, !thread.pinnedAt)
|
|
308
|
-
}
|
|
309
|
-
>
|
|
310
|
-
<IconPin className="size-4" />
|
|
311
|
-
{thread.pinnedAt
|
|
312
|
-
? t("chat.unpinChat")
|
|
313
|
-
: t("chat.pinChat")}
|
|
314
|
-
</DropdownMenuItem>
|
|
315
|
-
<DropdownMenuItem
|
|
316
|
-
variant="destructive"
|
|
317
|
-
onSelect={() => void handleArchiveThread(thread.id)}
|
|
318
|
-
>
|
|
319
|
-
<IconArchive className="size-4" />
|
|
320
|
-
{t("chat.archiveChat")}
|
|
321
|
-
</DropdownMenuItem>
|
|
322
|
-
</DropdownMenuContent>
|
|
323
|
-
</DropdownMenu>
|
|
324
|
-
</div>
|
|
325
|
-
</>
|
|
326
|
-
)}
|
|
327
|
-
</div>
|
|
328
|
-
);
|
|
329
|
-
})}
|
|
330
|
-
</div>
|
|
199
|
+
{visibleThreads.length > 0 && (
|
|
200
|
+
<ChatHistoryList
|
|
201
|
+
items={chatItems}
|
|
202
|
+
activeId={activeThreadId}
|
|
203
|
+
onSelect={openThread}
|
|
204
|
+
onTogglePin={(threadId) => {
|
|
205
|
+
const thread = visibleThreads.find((item) => item.id === threadId);
|
|
206
|
+
if (thread) void pinThread(threadId, !thread.pinnedAt);
|
|
207
|
+
}}
|
|
208
|
+
onRename={handleRenameThread}
|
|
209
|
+
renameMaxLength={160}
|
|
210
|
+
onDelete={(threadId) => void handleArchiveThread(threadId)}
|
|
211
|
+
labels={{
|
|
212
|
+
options: (item) =>
|
|
213
|
+
t("chat.optionsFor", { title: item.titleText ?? "" }),
|
|
214
|
+
renameInput: (item) =>
|
|
215
|
+
t("chat.renameThread", { title: item.titleText ?? "" }),
|
|
216
|
+
rename: t("chat.renameChat"),
|
|
217
|
+
pin: t("chat.pinChat"),
|
|
218
|
+
unpin: t("chat.unpinChat"),
|
|
219
|
+
delete: t("chat.archiveChat"),
|
|
220
|
+
}}
|
|
221
|
+
variant="rail"
|
|
222
|
+
className="min-w-0"
|
|
223
|
+
/>
|
|
224
|
+
)}
|
|
331
225
|
</div>
|
|
332
226
|
);
|
|
333
227
|
}
|
|
@@ -142,6 +142,11 @@ export interface BrainSource {
|
|
|
142
142
|
} | null;
|
|
143
143
|
}
|
|
144
144
|
|
|
145
|
+
export interface CreateSourceResponse {
|
|
146
|
+
source: BrainSource;
|
|
147
|
+
ingestToken?: string;
|
|
148
|
+
}
|
|
149
|
+
|
|
145
150
|
export interface BrainOverviewResponse {
|
|
146
151
|
metrics?: BrainMetric[];
|
|
147
152
|
reviewQueue?: ReviewItem[];
|
|
@@ -304,6 +309,25 @@ export interface BrainHealthResponse {
|
|
|
304
309
|
lastCapturedAt?: string | null;
|
|
305
310
|
counts?: Record<string, number>;
|
|
306
311
|
};
|
|
312
|
+
privacy: {
|
|
313
|
+
classifier: {
|
|
314
|
+
configured: boolean;
|
|
315
|
+
model: string | null;
|
|
316
|
+
engine: string | null;
|
|
317
|
+
warning: string | null;
|
|
318
|
+
};
|
|
319
|
+
events: {
|
|
320
|
+
total: number;
|
|
321
|
+
suppressed: number;
|
|
322
|
+
quarantined: number;
|
|
323
|
+
released: number;
|
|
324
|
+
discarded: number;
|
|
325
|
+
expired: number;
|
|
326
|
+
counts?: Record<string, number>;
|
|
327
|
+
confidenceCounts?: Record<string, number>;
|
|
328
|
+
};
|
|
329
|
+
policyVersion: string;
|
|
330
|
+
};
|
|
307
331
|
proposals: {
|
|
308
332
|
pending: number;
|
|
309
333
|
approved: number;
|
|
@@ -326,6 +350,37 @@ export interface BrainHealthResponse {
|
|
|
326
350
|
total: number;
|
|
327
351
|
counts?: Record<string, number>;
|
|
328
352
|
};
|
|
353
|
+
searchIndex: {
|
|
354
|
+
indexVersion: string;
|
|
355
|
+
coverage: {
|
|
356
|
+
eligibleCaptures: number;
|
|
357
|
+
activeArtifacts: number;
|
|
358
|
+
indexedCaptures: number;
|
|
359
|
+
missingCaptures: number;
|
|
360
|
+
percent: number;
|
|
361
|
+
};
|
|
362
|
+
artifacts: {
|
|
363
|
+
total: number;
|
|
364
|
+
active: number;
|
|
365
|
+
stale: number;
|
|
366
|
+
deleted: number;
|
|
367
|
+
counts?: Record<string, number>;
|
|
368
|
+
};
|
|
369
|
+
embeddings: {
|
|
370
|
+
total: number;
|
|
371
|
+
active: number;
|
|
372
|
+
stale: number;
|
|
373
|
+
deleted: number;
|
|
374
|
+
counts?: Record<string, number>;
|
|
375
|
+
};
|
|
376
|
+
queue: {
|
|
377
|
+
pending: number;
|
|
378
|
+
failed: number;
|
|
379
|
+
stale: number;
|
|
380
|
+
total: number;
|
|
381
|
+
counts?: Record<string, number>;
|
|
382
|
+
};
|
|
383
|
+
};
|
|
329
384
|
retrieval: {
|
|
330
385
|
lastEval?: {
|
|
331
386
|
mode: "product-demo" | "retrieval" | string;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { BrainSource, CreateSourceResponse } from "./brain";
|
|
2
|
+
|
|
3
|
+
export const BRAIN_INGEST_PATH = "/api/_agent-native/brain/ingest";
|
|
4
|
+
|
|
5
|
+
export interface OneTimeIngestHandoff {
|
|
6
|
+
endpoint: string;
|
|
7
|
+
ingestToken: string;
|
|
8
|
+
provider: "clips" | "generic";
|
|
9
|
+
source: BrainSource;
|
|
10
|
+
sourceKey: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function createOneTimeIngestHandoff({
|
|
14
|
+
origin,
|
|
15
|
+
provider,
|
|
16
|
+
result,
|
|
17
|
+
sourceKey,
|
|
18
|
+
}: {
|
|
19
|
+
origin: string;
|
|
20
|
+
provider: string;
|
|
21
|
+
result: CreateSourceResponse;
|
|
22
|
+
sourceKey: string;
|
|
23
|
+
}): OneTimeIngestHandoff | null {
|
|
24
|
+
if (provider !== "clips" && provider !== "generic") return null;
|
|
25
|
+
const ingestToken = result.ingestToken?.trim();
|
|
26
|
+
const normalizedSourceKey = sourceKey.trim();
|
|
27
|
+
if (!ingestToken || !normalizedSourceKey) return null;
|
|
28
|
+
return {
|
|
29
|
+
endpoint: new URL(BRAIN_INGEST_PATH, origin).toString(),
|
|
30
|
+
ingestToken,
|
|
31
|
+
provider,
|
|
32
|
+
source: result.source,
|
|
33
|
+
sourceKey: normalizedSourceKey,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
@@ -18,6 +18,10 @@ import {
|
|
|
18
18
|
serializeCapture,
|
|
19
19
|
stableJson,
|
|
20
20
|
} from "./brain.js";
|
|
21
|
+
import {
|
|
22
|
+
ensureSlackPublicChannelMembership,
|
|
23
|
+
type SlackChannelJoinResponse,
|
|
24
|
+
} from "./slack-channel-membership.js";
|
|
21
25
|
import {
|
|
22
26
|
inspectSourceCredentialAvailability,
|
|
23
27
|
resolveSourceCredential,
|
|
@@ -182,6 +186,7 @@ interface SlackChannel {
|
|
|
182
186
|
is_group?: boolean;
|
|
183
187
|
is_archived?: boolean;
|
|
184
188
|
is_private?: boolean;
|
|
189
|
+
is_member?: boolean;
|
|
185
190
|
}
|
|
186
191
|
|
|
187
192
|
interface SlackMessage {
|
|
@@ -847,10 +852,31 @@ async function slackApi<T>(
|
|
|
847
852
|
token: string,
|
|
848
853
|
method: string,
|
|
849
854
|
params: Record<string, string | number | boolean | null | undefined> = {},
|
|
855
|
+
options: {
|
|
856
|
+
httpMethod?: "GET" | "POST";
|
|
857
|
+
toleratedErrors?: readonly string[];
|
|
858
|
+
} = {},
|
|
850
859
|
): Promise<T> {
|
|
851
|
-
const
|
|
860
|
+
const httpMethod = options.httpMethod ?? "GET";
|
|
861
|
+
const url = buildUrl(
|
|
862
|
+
`https://slack.com/api/${method}`,
|
|
863
|
+
httpMethod === "GET" ? params : {},
|
|
864
|
+
);
|
|
865
|
+
const body = new URLSearchParams();
|
|
866
|
+
if (httpMethod === "POST") {
|
|
867
|
+
for (const [key, value] of Object.entries(params)) {
|
|
868
|
+
if (value !== null && value !== undefined) body.set(key, String(value));
|
|
869
|
+
}
|
|
870
|
+
}
|
|
852
871
|
const response = await fetch(url.toString(), {
|
|
853
|
-
|
|
872
|
+
method: httpMethod,
|
|
873
|
+
headers: {
|
|
874
|
+
Authorization: `Bearer ${token}`,
|
|
875
|
+
...(httpMethod === "POST"
|
|
876
|
+
? { "Content-Type": "application/x-www-form-urlencoded" }
|
|
877
|
+
: {}),
|
|
878
|
+
},
|
|
879
|
+
...(httpMethod === "POST" ? { body } : {}),
|
|
854
880
|
});
|
|
855
881
|
if (response.status === 429) {
|
|
856
882
|
throw new ConnectorRateLimitError(
|
|
@@ -872,6 +898,9 @@ async function slackApi<T>(
|
|
|
872
898
|
if (data.error === "ratelimited") {
|
|
873
899
|
throw new ConnectorRateLimitError("slack", method, 60);
|
|
874
900
|
}
|
|
901
|
+
if (data.error && options.toleratedErrors?.includes(data.error)) {
|
|
902
|
+
return data as T;
|
|
903
|
+
}
|
|
875
904
|
const details = [
|
|
876
905
|
data.needed ? `needed: ${data.needed}` : null,
|
|
877
906
|
data.provided ? `provided: ${data.provided}` : null,
|
|
@@ -2188,6 +2217,8 @@ async function syncSlack(source: SourceRow): Promise<ConnectorSyncResult> {
|
|
|
2188
2217
|
capturesCreated: 0,
|
|
2189
2218
|
threadsFetched: 0,
|
|
2190
2219
|
sensitivityBlocked: 0,
|
|
2220
|
+
publicChannelsJoined: 0,
|
|
2221
|
+
publicChannelsAlreadyJoined: 0,
|
|
2191
2222
|
rateLimited: false,
|
|
2192
2223
|
};
|
|
2193
2224
|
|
|
@@ -2269,6 +2300,25 @@ async function syncSlack(source: SourceRow): Promise<ConnectorSyncResult> {
|
|
|
2269
2300
|
let permalinkCalls = 0;
|
|
2270
2301
|
|
|
2271
2302
|
for (const channel of channelsToScan) {
|
|
2303
|
+
const membership = await ensureSlackPublicChannelMembership(
|
|
2304
|
+
channel,
|
|
2305
|
+
(channelId) =>
|
|
2306
|
+
slackApi<SlackChannelJoinResponse>(
|
|
2307
|
+
token,
|
|
2308
|
+
"conversations.join",
|
|
2309
|
+
{ channel: channelId },
|
|
2310
|
+
{
|
|
2311
|
+
httpMethod: "POST",
|
|
2312
|
+
toleratedErrors: ["already_in_channel"],
|
|
2313
|
+
},
|
|
2314
|
+
),
|
|
2315
|
+
);
|
|
2316
|
+
if (membership === "joined") {
|
|
2317
|
+
stats.publicChannelsJoined = Number(stats.publicChannelsJoined) + 1;
|
|
2318
|
+
} else if (membership === "already_member") {
|
|
2319
|
+
stats.publicChannelsAlreadyJoined =
|
|
2320
|
+
Number(stats.publicChannelsAlreadyJoined) + 1;
|
|
2321
|
+
}
|
|
2272
2322
|
const privateMemberEmails = channel.is_private
|
|
2273
2323
|
? await slackPrivateChannelMemberEmails(
|
|
2274
2324
|
token,
|
|
@@ -2352,6 +2402,7 @@ async function syncSlack(source: SourceRow): Promise<ConnectorSyncResult> {
|
|
|
2352
2402
|
if (data.has_more && nextPage) {
|
|
2353
2403
|
channelCursor.pageCursor = nextPage;
|
|
2354
2404
|
nextCursor.channels![channel.id] = channelCursor;
|
|
2405
|
+
if (page + 1 < pagesPerChannel) continue;
|
|
2355
2406
|
break;
|
|
2356
2407
|
}
|
|
2357
2408
|
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export interface SlackChannelMembershipTarget {
|
|
2
|
+
id: string;
|
|
3
|
+
is_im?: boolean;
|
|
4
|
+
is_mpim?: boolean;
|
|
5
|
+
is_channel?: boolean;
|
|
6
|
+
is_group?: boolean;
|
|
7
|
+
is_private?: boolean;
|
|
8
|
+
is_member?: boolean;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface SlackChannelJoinResponse {
|
|
12
|
+
ok?: boolean;
|
|
13
|
+
error?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export type SlackChannelMembershipResult =
|
|
17
|
+
| "not_public"
|
|
18
|
+
| "membership_unknown"
|
|
19
|
+
| "already_member"
|
|
20
|
+
| "joined";
|
|
21
|
+
|
|
22
|
+
export async function ensureSlackPublicChannelMembership(
|
|
23
|
+
channel: SlackChannelMembershipTarget,
|
|
24
|
+
joinChannel: (channelId: string) => Promise<SlackChannelJoinResponse>,
|
|
25
|
+
): Promise<SlackChannelMembershipResult> {
|
|
26
|
+
if (
|
|
27
|
+
channel.is_private === true ||
|
|
28
|
+
channel.is_group === true ||
|
|
29
|
+
channel.is_im === true ||
|
|
30
|
+
channel.is_mpim === true ||
|
|
31
|
+
channel.is_channel === false
|
|
32
|
+
) {
|
|
33
|
+
return "not_public";
|
|
34
|
+
}
|
|
35
|
+
if (channel.is_member === true) return "already_member";
|
|
36
|
+
if (channel.is_member !== false) return "membership_unknown";
|
|
37
|
+
|
|
38
|
+
const result = await joinChannel(channel.id);
|
|
39
|
+
if (result.ok !== false) return "joined";
|
|
40
|
+
if (result.error === "already_in_channel") return "already_member";
|
|
41
|
+
throw new Error(
|
|
42
|
+
`Slack conversations.join failed: ${result.error ?? "unknown"}`,
|
|
43
|
+
);
|
|
44
|
+
}
|