@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
|
@@ -0,0 +1,412 @@
|
|
|
1
|
+
import {
|
|
2
|
+
IconFile,
|
|
3
|
+
IconFolder,
|
|
4
|
+
IconStack2,
|
|
5
|
+
IconFileText,
|
|
6
|
+
IconCheckbox,
|
|
7
|
+
IconMail,
|
|
8
|
+
IconUser,
|
|
9
|
+
IconPresentation,
|
|
10
|
+
IconMessageChatbot,
|
|
11
|
+
IconTrash,
|
|
12
|
+
IconPlus,
|
|
13
|
+
IconHelp,
|
|
14
|
+
IconHistory,
|
|
15
|
+
IconTerminal2,
|
|
16
|
+
IconClipboardList,
|
|
17
|
+
IconPencil,
|
|
18
|
+
} from "@tabler/icons-react";
|
|
19
|
+
import React, {
|
|
20
|
+
useState,
|
|
21
|
+
useEffect,
|
|
22
|
+
useRef,
|
|
23
|
+
useImperativeHandle,
|
|
24
|
+
forwardRef,
|
|
25
|
+
} from "react";
|
|
26
|
+
import { createPortal } from "react-dom";
|
|
27
|
+
|
|
28
|
+
import type { MentionItem, SkillResult, SlashCommand } from "./types.js";
|
|
29
|
+
|
|
30
|
+
export interface MentionPopoverRef {
|
|
31
|
+
moveUp: () => void;
|
|
32
|
+
moveDown: () => void;
|
|
33
|
+
getSelectedIndex: () => number;
|
|
34
|
+
getSelectedMention: () => MentionItem | null;
|
|
35
|
+
getSelectedCommand: () => SlashCommand | null;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
interface MentionPopoverProps {
|
|
39
|
+
type: "@" | "/";
|
|
40
|
+
position: { top: number; left: number } | null;
|
|
41
|
+
mentionItems: MentionItem[];
|
|
42
|
+
skills: SkillResult[];
|
|
43
|
+
commands?: SlashCommand[];
|
|
44
|
+
hint?: string;
|
|
45
|
+
isLoading: boolean;
|
|
46
|
+
query: string;
|
|
47
|
+
onSelectMention: (item: MentionItem) => void;
|
|
48
|
+
onSelectSkill: (skill: SkillResult) => void;
|
|
49
|
+
onSelectCommand?: (command: SlashCommand) => void;
|
|
50
|
+
onClose: () => void;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
const iconProps = { size: 14, className: "shrink-0 text-muted-foreground" };
|
|
54
|
+
|
|
55
|
+
function MentionItemIcon({ icon }: { icon?: string }) {
|
|
56
|
+
switch (icon) {
|
|
57
|
+
case "folder":
|
|
58
|
+
return <IconFolder {...iconProps} />;
|
|
59
|
+
case "document":
|
|
60
|
+
return <IconFileText {...iconProps} />;
|
|
61
|
+
case "form":
|
|
62
|
+
return <IconCheckbox {...iconProps} />;
|
|
63
|
+
case "email":
|
|
64
|
+
return <IconMail {...iconProps} />;
|
|
65
|
+
case "user":
|
|
66
|
+
return <IconUser {...iconProps} />;
|
|
67
|
+
case "deck":
|
|
68
|
+
return <IconPresentation {...iconProps} />;
|
|
69
|
+
case "agent":
|
|
70
|
+
return <IconMessageChatbot {...iconProps} />;
|
|
71
|
+
case "file":
|
|
72
|
+
return <IconFile {...iconProps} />;
|
|
73
|
+
default:
|
|
74
|
+
return <IconFile {...iconProps} />;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function CommandIcon({ icon }: { icon?: string }) {
|
|
79
|
+
switch (icon) {
|
|
80
|
+
case "clear":
|
|
81
|
+
return <IconTrash {...iconProps} />;
|
|
82
|
+
case "new":
|
|
83
|
+
return <IconPlus {...iconProps} />;
|
|
84
|
+
case "help":
|
|
85
|
+
return <IconHelp {...iconProps} />;
|
|
86
|
+
case "history":
|
|
87
|
+
return <IconHistory {...iconProps} />;
|
|
88
|
+
case "plan":
|
|
89
|
+
return <IconClipboardList {...iconProps} />;
|
|
90
|
+
case "act":
|
|
91
|
+
return <IconPencil {...iconProps} />;
|
|
92
|
+
default:
|
|
93
|
+
return <IconTerminal2 {...iconProps} />;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
function HintWithLink({ hint }: { hint: string }) {
|
|
98
|
+
// If hint contains a URL, split it and render the URL as a link
|
|
99
|
+
const urlMatch = hint.match(/(https?:\/\/\S+)/);
|
|
100
|
+
if (!urlMatch) return <>{hint}</>;
|
|
101
|
+
const before = hint.slice(0, urlMatch.index);
|
|
102
|
+
const url = urlMatch[1];
|
|
103
|
+
return (
|
|
104
|
+
<>
|
|
105
|
+
{before}
|
|
106
|
+
<a
|
|
107
|
+
href={url}
|
|
108
|
+
target="_blank"
|
|
109
|
+
rel="noopener noreferrer"
|
|
110
|
+
className="underline hover:text-foreground"
|
|
111
|
+
>
|
|
112
|
+
Learn more
|
|
113
|
+
</a>
|
|
114
|
+
</>
|
|
115
|
+
);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function LoadingSkeleton() {
|
|
119
|
+
return (
|
|
120
|
+
<div className="space-y-1 p-1">
|
|
121
|
+
{[1, 2, 3].map((i) => (
|
|
122
|
+
<div key={i} className="flex items-center gap-2 rounded px-2 py-1.5">
|
|
123
|
+
<div className="h-3.5 w-3.5 rounded bg-muted animate-pulse" />
|
|
124
|
+
<div
|
|
125
|
+
className="h-3 rounded bg-muted animate-pulse"
|
|
126
|
+
style={{ width: `${60 + i * 20}px` }}
|
|
127
|
+
/>
|
|
128
|
+
</div>
|
|
129
|
+
))}
|
|
130
|
+
</div>
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function LoadingSkeletonRow() {
|
|
135
|
+
return (
|
|
136
|
+
<div className="flex items-center gap-2 rounded px-2 py-1.5">
|
|
137
|
+
<div className="h-3.5 w-3.5 rounded bg-muted animate-pulse" />
|
|
138
|
+
<div className="h-3 w-24 rounded bg-muted animate-pulse" />
|
|
139
|
+
</div>
|
|
140
|
+
);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export const MentionPopover = forwardRef<
|
|
144
|
+
MentionPopoverRef,
|
|
145
|
+
MentionPopoverProps
|
|
146
|
+
>(function MentionPopover(props, ref) {
|
|
147
|
+
const {
|
|
148
|
+
type,
|
|
149
|
+
position,
|
|
150
|
+
mentionItems,
|
|
151
|
+
skills,
|
|
152
|
+
commands = [],
|
|
153
|
+
hint,
|
|
154
|
+
isLoading,
|
|
155
|
+
query,
|
|
156
|
+
onSelectMention,
|
|
157
|
+
onSelectSkill,
|
|
158
|
+
onSelectCommand,
|
|
159
|
+
onClose,
|
|
160
|
+
} = props;
|
|
161
|
+
|
|
162
|
+
const [selectedIndex, setSelectedIndex] = useState(0);
|
|
163
|
+
const listRef = useRef<HTMLDivElement>(null);
|
|
164
|
+
|
|
165
|
+
const itemCount =
|
|
166
|
+
type === "@" ? mentionItems.length : commands.length + skills.length;
|
|
167
|
+
|
|
168
|
+
// Group mention items by section for @ popover
|
|
169
|
+
const groupedMentions = React.useMemo(() => {
|
|
170
|
+
if (type !== "@") return [];
|
|
171
|
+
const groups = new Map<string, MentionItem[]>();
|
|
172
|
+
for (const item of mentionItems) {
|
|
173
|
+
const section = item.section || "Other";
|
|
174
|
+
if (!groups.has(section)) groups.set(section, []);
|
|
175
|
+
groups.get(section)!.push(item);
|
|
176
|
+
}
|
|
177
|
+
// Sort: Agents first, then Connected Agents, then template-specific,
|
|
178
|
+
// then Files, then Other
|
|
179
|
+
const sorted: { section: string; items: MentionItem[] }[] = [];
|
|
180
|
+
const knownSections = new Set([
|
|
181
|
+
"Agents",
|
|
182
|
+
"Connected Agents",
|
|
183
|
+
"Files",
|
|
184
|
+
"Other",
|
|
185
|
+
]);
|
|
186
|
+
// Agents first
|
|
187
|
+
if (groups.has("Agents")) {
|
|
188
|
+
sorted.push({ section: "Agents", items: groups.get("Agents")! });
|
|
189
|
+
groups.delete("Agents");
|
|
190
|
+
}
|
|
191
|
+
if (groups.has("Connected Agents")) {
|
|
192
|
+
sorted.push({
|
|
193
|
+
section: "Connected Agents",
|
|
194
|
+
items: groups.get("Connected Agents")!,
|
|
195
|
+
});
|
|
196
|
+
groups.delete("Connected Agents");
|
|
197
|
+
}
|
|
198
|
+
// Template-specific sections (anything not in knownSections)
|
|
199
|
+
for (const [section, items] of groups) {
|
|
200
|
+
if (!knownSections.has(section)) {
|
|
201
|
+
sorted.push({ section, items });
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
// Files
|
|
205
|
+
if (groups.has("Files")) {
|
|
206
|
+
sorted.push({ section: "Files", items: groups.get("Files")! });
|
|
207
|
+
}
|
|
208
|
+
// Other
|
|
209
|
+
if (groups.has("Other")) {
|
|
210
|
+
sorted.push({ section: "Other", items: groups.get("Other")! });
|
|
211
|
+
}
|
|
212
|
+
return sorted;
|
|
213
|
+
}, [type, mentionItems]);
|
|
214
|
+
|
|
215
|
+
// Flat list of mention items in section order for keyboard index tracking
|
|
216
|
+
const flatMentionItems = React.useMemo(() => {
|
|
217
|
+
return groupedMentions.flatMap((g) => g.items);
|
|
218
|
+
}, [groupedMentions]);
|
|
219
|
+
|
|
220
|
+
// Reset selection when items change
|
|
221
|
+
useEffect(() => {
|
|
222
|
+
setSelectedIndex(0);
|
|
223
|
+
}, [commands, mentionItems, skills, query]);
|
|
224
|
+
|
|
225
|
+
// Scroll selected item into view
|
|
226
|
+
useEffect(() => {
|
|
227
|
+
const container = listRef.current;
|
|
228
|
+
if (!container) return;
|
|
229
|
+
// Find the actual item element by data attribute
|
|
230
|
+
const selected = container.querySelector(
|
|
231
|
+
`[data-mention-index="${selectedIndex}"]`,
|
|
232
|
+
) as HTMLElement | undefined;
|
|
233
|
+
if (selected) {
|
|
234
|
+
selected.scrollIntoView({ block: "nearest" });
|
|
235
|
+
}
|
|
236
|
+
}, [selectedIndex]);
|
|
237
|
+
|
|
238
|
+
useImperativeHandle(ref, () => ({
|
|
239
|
+
moveUp: () => {
|
|
240
|
+
setSelectedIndex((prev) =>
|
|
241
|
+
prev <= 0 ? Math.max(0, itemCount - 1) : prev - 1,
|
|
242
|
+
);
|
|
243
|
+
},
|
|
244
|
+
moveDown: () => {
|
|
245
|
+
setSelectedIndex((prev) => (prev >= itemCount - 1 ? 0 : prev + 1));
|
|
246
|
+
},
|
|
247
|
+
getSelectedIndex: () => selectedIndex,
|
|
248
|
+
getSelectedMention: () => flatMentionItems[selectedIndex] ?? null,
|
|
249
|
+
getSelectedCommand: () => {
|
|
250
|
+
if (type !== "/" || selectedIndex >= commands.length) return null;
|
|
251
|
+
return commands[selectedIndex] ?? null;
|
|
252
|
+
},
|
|
253
|
+
}));
|
|
254
|
+
|
|
255
|
+
if (!position) return null;
|
|
256
|
+
|
|
257
|
+
const content = (
|
|
258
|
+
<>
|
|
259
|
+
{/* Backdrop to capture outside clicks */}
|
|
260
|
+
<div className="fixed inset-0 z-[9998]" onClick={onClose} />
|
|
261
|
+
<div
|
|
262
|
+
data-agent-native-composer-popover="true"
|
|
263
|
+
className="fixed z-[9999] w-[320px] overflow-y-auto rounded-lg border border-border bg-popover shadow-lg"
|
|
264
|
+
style={{
|
|
265
|
+
bottom: `calc(100vh - ${position.top}px + 4px)`,
|
|
266
|
+
left: Math.max(8, Math.min(position.left, window.innerWidth - 336)),
|
|
267
|
+
maxHeight: Math.min(320, position.top - 8),
|
|
268
|
+
}}
|
|
269
|
+
>
|
|
270
|
+
{isLoading && itemCount === 0 ? (
|
|
271
|
+
<LoadingSkeleton />
|
|
272
|
+
) : itemCount === 0 ? (
|
|
273
|
+
<div className="px-3 py-4 text-center text-xs text-muted-foreground">
|
|
274
|
+
{type === "@" ? (
|
|
275
|
+
query ? (
|
|
276
|
+
"No results found"
|
|
277
|
+
) : (
|
|
278
|
+
"Type to search..."
|
|
279
|
+
)
|
|
280
|
+
) : hint ? (
|
|
281
|
+
<HintWithLink hint={hint} />
|
|
282
|
+
) : (
|
|
283
|
+
"No skills available"
|
|
284
|
+
)}
|
|
285
|
+
</div>
|
|
286
|
+
) : (
|
|
287
|
+
<div ref={listRef} className="p-1">
|
|
288
|
+
{isLoading && <LoadingSkeletonRow />}
|
|
289
|
+
{type === "@"
|
|
290
|
+
? (() => {
|
|
291
|
+
let flatIndex = 0;
|
|
292
|
+
return groupedMentions.map((group) => (
|
|
293
|
+
<div key={group.section}>
|
|
294
|
+
<div className="px-2 pt-2 pb-1 text-[10px] font-medium text-muted-foreground/70 uppercase tracking-wider">
|
|
295
|
+
{group.section}
|
|
296
|
+
</div>
|
|
297
|
+
{group.items.map((item) => {
|
|
298
|
+
const idx = flatIndex++;
|
|
299
|
+
return (
|
|
300
|
+
<button
|
|
301
|
+
key={item.id}
|
|
302
|
+
data-mention-index={idx}
|
|
303
|
+
className={`flex w-full items-center gap-2 rounded px-2 py-1.5 text-start text-sm ${
|
|
304
|
+
idx === selectedIndex
|
|
305
|
+
? "bg-accent text-accent-foreground"
|
|
306
|
+
: "hover:bg-accent/50"
|
|
307
|
+
}`}
|
|
308
|
+
onMouseEnter={() => setSelectedIndex(idx)}
|
|
309
|
+
onClick={() => onSelectMention(item)}
|
|
310
|
+
>
|
|
311
|
+
<MentionItemIcon icon={item.icon} />
|
|
312
|
+
<span className="truncate text-sm">
|
|
313
|
+
{item.label}
|
|
314
|
+
</span>
|
|
315
|
+
{item.description && (
|
|
316
|
+
<span className="ms-auto shrink-0 truncate max-w-[160px] text-xs text-muted-foreground">
|
|
317
|
+
{item.description}
|
|
318
|
+
</span>
|
|
319
|
+
)}
|
|
320
|
+
</button>
|
|
321
|
+
);
|
|
322
|
+
})}
|
|
323
|
+
</div>
|
|
324
|
+
));
|
|
325
|
+
})()
|
|
326
|
+
: (() => {
|
|
327
|
+
let idx = 0;
|
|
328
|
+
return (
|
|
329
|
+
<>
|
|
330
|
+
{commands.length > 0 && (
|
|
331
|
+
<div>
|
|
332
|
+
<div className="px-2 pt-2 pb-1 text-[10px] font-medium text-muted-foreground/70 uppercase tracking-wider">
|
|
333
|
+
Commands
|
|
334
|
+
</div>
|
|
335
|
+
{commands.map((cmd) => {
|
|
336
|
+
const i = idx++;
|
|
337
|
+
return (
|
|
338
|
+
<button
|
|
339
|
+
key={cmd.name}
|
|
340
|
+
data-mention-index={i}
|
|
341
|
+
className={`flex w-full items-center gap-2 rounded px-2 py-1.5 text-start text-sm ${
|
|
342
|
+
i === selectedIndex
|
|
343
|
+
? "bg-accent text-accent-foreground"
|
|
344
|
+
: "hover:bg-accent/50"
|
|
345
|
+
}`}
|
|
346
|
+
onMouseEnter={() => setSelectedIndex(i)}
|
|
347
|
+
onClick={() => onSelectCommand?.(cmd)}
|
|
348
|
+
>
|
|
349
|
+
<CommandIcon icon={cmd.icon} />
|
|
350
|
+
<span className="min-w-0 flex-1">
|
|
351
|
+
<span className="block truncate text-sm">
|
|
352
|
+
/{cmd.name}
|
|
353
|
+
</span>
|
|
354
|
+
{cmd.description && (
|
|
355
|
+
<span className="block truncate text-xs text-muted-foreground">
|
|
356
|
+
{cmd.description}
|
|
357
|
+
</span>
|
|
358
|
+
)}
|
|
359
|
+
</span>
|
|
360
|
+
</button>
|
|
361
|
+
);
|
|
362
|
+
})}
|
|
363
|
+
</div>
|
|
364
|
+
)}
|
|
365
|
+
{skills.length > 0 && (
|
|
366
|
+
<div>
|
|
367
|
+
{commands.length > 0 && (
|
|
368
|
+
<div className="px-2 pt-2 pb-1 text-[10px] font-medium text-muted-foreground/70 uppercase tracking-wider">
|
|
369
|
+
Skills
|
|
370
|
+
</div>
|
|
371
|
+
)}
|
|
372
|
+
{(skills as SkillResult[]).map((skill) => {
|
|
373
|
+
const i = idx++;
|
|
374
|
+
return (
|
|
375
|
+
<button
|
|
376
|
+
key={skill.path}
|
|
377
|
+
data-mention-index={i}
|
|
378
|
+
className={`flex w-full items-center gap-2 rounded px-2 py-1.5 text-start text-sm ${
|
|
379
|
+
i === selectedIndex
|
|
380
|
+
? "bg-accent text-accent-foreground"
|
|
381
|
+
: "hover:bg-accent/50"
|
|
382
|
+
}`}
|
|
383
|
+
onMouseEnter={() => setSelectedIndex(i)}
|
|
384
|
+
onClick={() => onSelectSkill(skill)}
|
|
385
|
+
>
|
|
386
|
+
<IconStack2 {...iconProps} />
|
|
387
|
+
<span className="min-w-0 flex-1">
|
|
388
|
+
<span className="block truncate text-sm">
|
|
389
|
+
{skill.name}
|
|
390
|
+
</span>
|
|
391
|
+
{skill.description && (
|
|
392
|
+
<span className="block truncate text-xs text-muted-foreground">
|
|
393
|
+
{skill.description}
|
|
394
|
+
</span>
|
|
395
|
+
)}
|
|
396
|
+
</span>
|
|
397
|
+
</button>
|
|
398
|
+
);
|
|
399
|
+
})}
|
|
400
|
+
</div>
|
|
401
|
+
)}
|
|
402
|
+
</>
|
|
403
|
+
);
|
|
404
|
+
})()}
|
|
405
|
+
</div>
|
|
406
|
+
)}
|
|
407
|
+
</div>
|
|
408
|
+
</>
|
|
409
|
+
);
|
|
410
|
+
|
|
411
|
+
return createPortal(content, document.body);
|
|
412
|
+
});
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import type { Attachment } from "@assistant-ui/react";
|
|
2
|
+
import * as PopoverPrimitive from "@radix-ui/react-popover";
|
|
3
|
+
import { IconClipboardText, IconX } from "@tabler/icons-react";
|
|
4
|
+
import { useCallback, useEffect, useState } from "react";
|
|
5
|
+
|
|
6
|
+
import { cn } from "../utils.js";
|
|
7
|
+
import { countLines, unwrapAttachmentEnvelope } from "./pasted-text.js";
|
|
8
|
+
|
|
9
|
+
function readAttachmentText(attachment: Attachment): Promise<string> | string {
|
|
10
|
+
if ("file" in attachment && attachment.file instanceof File) {
|
|
11
|
+
return attachment.file.text();
|
|
12
|
+
}
|
|
13
|
+
const textPart = attachment.content?.find(
|
|
14
|
+
(p): p is { type: "text"; text: string } =>
|
|
15
|
+
p.type === "text" && "text" in p && typeof p.text === "string",
|
|
16
|
+
);
|
|
17
|
+
return textPart ? unwrapAttachmentEnvelope(textPart.text) : "";
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
function usePastedAttachmentText(attachment: Attachment): {
|
|
21
|
+
text: string;
|
|
22
|
+
lines: number;
|
|
23
|
+
chars: number;
|
|
24
|
+
} {
|
|
25
|
+
const [text, setText] = useState("");
|
|
26
|
+
|
|
27
|
+
useEffect(() => {
|
|
28
|
+
let cancelled = false;
|
|
29
|
+
const result = readAttachmentText(attachment);
|
|
30
|
+
if (typeof result === "string") {
|
|
31
|
+
setText(result);
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
result
|
|
35
|
+
.then((value) => {
|
|
36
|
+
if (!cancelled) setText(value);
|
|
37
|
+
})
|
|
38
|
+
.catch(() => {});
|
|
39
|
+
return () => {
|
|
40
|
+
cancelled = true;
|
|
41
|
+
};
|
|
42
|
+
}, [attachment]);
|
|
43
|
+
|
|
44
|
+
return { text, lines: countLines(text), chars: text.length };
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export interface PastedTextChipProps {
|
|
48
|
+
attachment: Attachment;
|
|
49
|
+
onRemove?: (id: string) => void;
|
|
50
|
+
/** Compact variant rendered inside sent user messages. */
|
|
51
|
+
compact?: boolean;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export function PastedTextChip({
|
|
55
|
+
attachment,
|
|
56
|
+
onRemove,
|
|
57
|
+
compact = false,
|
|
58
|
+
}: PastedTextChipProps) {
|
|
59
|
+
const [open, setOpen] = useState(false);
|
|
60
|
+
const { text, lines, chars } = usePastedAttachmentText(attachment);
|
|
61
|
+
|
|
62
|
+
const handleRemove = useCallback(
|
|
63
|
+
(event: React.MouseEvent) => {
|
|
64
|
+
event.stopPropagation();
|
|
65
|
+
onRemove?.(attachment.id);
|
|
66
|
+
},
|
|
67
|
+
[attachment.id, onRemove],
|
|
68
|
+
);
|
|
69
|
+
|
|
70
|
+
const summary = lines > 0 ? `${lines} lines` : `${chars} chars`;
|
|
71
|
+
|
|
72
|
+
return (
|
|
73
|
+
<PopoverPrimitive.Root open={open} onOpenChange={setOpen}>
|
|
74
|
+
<PopoverPrimitive.Trigger asChild>
|
|
75
|
+
<button
|
|
76
|
+
type="button"
|
|
77
|
+
className={cn(
|
|
78
|
+
"group relative inline-flex items-center gap-2 rounded-md border border-border/70 bg-muted/50 text-start text-foreground hover:bg-muted/70 cursor-pointer",
|
|
79
|
+
compact
|
|
80
|
+
? "max-w-[220px] px-2 py-1.5 text-xs"
|
|
81
|
+
: "max-w-[260px] px-2.5 py-2 text-xs",
|
|
82
|
+
onRemove && !compact && "pe-7",
|
|
83
|
+
)}
|
|
84
|
+
aria-label="Preview pasted text"
|
|
85
|
+
>
|
|
86
|
+
<span
|
|
87
|
+
className={cn(
|
|
88
|
+
"flex shrink-0 items-center justify-center rounded bg-background text-muted-foreground",
|
|
89
|
+
compact ? "h-6 w-6" : "h-8 w-8",
|
|
90
|
+
)}
|
|
91
|
+
>
|
|
92
|
+
<IconClipboardText
|
|
93
|
+
className={compact ? "h-3.5 w-3.5" : "h-4 w-4"}
|
|
94
|
+
/>
|
|
95
|
+
</span>
|
|
96
|
+
<span className="min-w-0 flex-1">
|
|
97
|
+
<span className="block truncate font-medium">Pasted text</span>
|
|
98
|
+
<span className="block text-[11px] text-muted-foreground">
|
|
99
|
+
{summary}
|
|
100
|
+
</span>
|
|
101
|
+
</span>
|
|
102
|
+
{onRemove && (
|
|
103
|
+
<span
|
|
104
|
+
role="button"
|
|
105
|
+
tabIndex={-1}
|
|
106
|
+
onClick={handleRemove}
|
|
107
|
+
aria-label="Remove pasted text"
|
|
108
|
+
className={cn(
|
|
109
|
+
"flex h-5 w-5 shrink-0 cursor-pointer items-center justify-center rounded text-muted-foreground hover:text-foreground",
|
|
110
|
+
compact ? "" : "absolute end-1.5 top-1.5",
|
|
111
|
+
)}
|
|
112
|
+
>
|
|
113
|
+
<IconX className="h-3 w-3" />
|
|
114
|
+
</span>
|
|
115
|
+
)}
|
|
116
|
+
</button>
|
|
117
|
+
</PopoverPrimitive.Trigger>
|
|
118
|
+
<PopoverPrimitive.Portal>
|
|
119
|
+
<PopoverPrimitive.Content
|
|
120
|
+
side="top"
|
|
121
|
+
align="start"
|
|
122
|
+
sideOffset={6}
|
|
123
|
+
collisionPadding={12}
|
|
124
|
+
className="z-50 w-[min(560px,calc(100vw-32px))] rounded-lg border border-border bg-popover text-popover-foreground shadow-lg origin-[var(--radix-popover-content-transform-origin)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=open]:fade-in-0 data-[state=closed]:fade-out-0 data-[state=open]:zoom-in-95 data-[state=closed]:zoom-out-95"
|
|
125
|
+
>
|
|
126
|
+
<div className="flex items-center justify-between gap-2 border-b border-border px-3 py-2">
|
|
127
|
+
<div className="flex items-center gap-2 min-w-0">
|
|
128
|
+
<IconClipboardText className="h-4 w-4 shrink-0 text-muted-foreground" />
|
|
129
|
+
<span className="text-sm font-medium truncate">Pasted text</span>
|
|
130
|
+
<span className="text-[11px] text-muted-foreground shrink-0">
|
|
131
|
+
{lines} lines · {chars} chars
|
|
132
|
+
</span>
|
|
133
|
+
</div>
|
|
134
|
+
<button
|
|
135
|
+
type="button"
|
|
136
|
+
onClick={() => setOpen(false)}
|
|
137
|
+
aria-label="Close preview"
|
|
138
|
+
className="flex h-6 w-6 shrink-0 cursor-pointer items-center justify-center rounded text-muted-foreground hover:text-foreground"
|
|
139
|
+
>
|
|
140
|
+
<IconX className="h-3.5 w-3.5" />
|
|
141
|
+
</button>
|
|
142
|
+
</div>
|
|
143
|
+
<pre className="max-h-[60vh] overflow-auto px-3 py-2 text-[12px] leading-[1.5] whitespace-pre-wrap break-words font-mono text-foreground">
|
|
144
|
+
{text}
|
|
145
|
+
</pre>
|
|
146
|
+
</PopoverPrimitive.Content>
|
|
147
|
+
</PopoverPrimitive.Portal>
|
|
148
|
+
</PopoverPrimitive.Root>
|
|
149
|
+
);
|
|
150
|
+
}
|