@agent-native/core 0.111.4 → 0.113.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/corpus/README.md +4 -2
- package/corpus/core/CHANGELOG.md +34 -0
- package/corpus/core/docs/AGENTS.md +7 -0
- package/corpus/core/docs/content/integrations.mdx +63 -2
- package/corpus/core/docs/design/provider-integration-authority.md +117 -0
- package/corpus/core/package.json +8 -1
- package/corpus/core/scripts/materialize-source-corpus.mjs +9 -2
- package/corpus/core/src/cli/atomic-json-file.ts +324 -0
- package/corpus/core/src/cli/claude-code-participant.ts +515 -0
- package/corpus/core/src/cli/code-agent-executor.ts +35 -15
- package/corpus/core/src/cli/code-agent-runs.concurrent-worker.ts +33 -0
- package/corpus/core/src/cli/code-agent-runs.ts +70 -36
- package/corpus/core/src/cli/codex-cli-participant.ts +496 -0
- package/corpus/core/src/cli/multi-frontier-runs.ts +1952 -0
- package/corpus/core/src/client/chat/ChatHistoryList.tsx +7 -404
- package/corpus/core/src/coding-tools/index.ts +27 -8
- package/corpus/core/src/embeddings/index.ts +233 -0
- package/corpus/core/src/index.ts +2 -0
- package/corpus/core/src/integrations/index.ts +10 -0
- package/corpus/core/src/integrations/slack-oauth.ts +1 -0
- package/corpus/core/src/integrations/webhook-delivery.ts +55 -0
- package/corpus/core/src/notifications/channels.ts +4 -10
- package/corpus/core/src/provider-api/actions/custom-provider-registration.ts +197 -0
- package/corpus/core/src/provider-api/actions/delete-staged-dataset.ts +3 -42
- package/corpus/core/src/provider-api/actions/list-staged-datasets.ts +3 -45
- package/corpus/core/src/provider-api/actions/provider-api-audit.ts +88 -0
- package/corpus/core/src/provider-api/actions/provider-api.ts +460 -0
- package/corpus/core/src/provider-api/actions/query-staged-dataset.ts +3 -140
- package/corpus/core/src/provider-api/actions/staged-datasets.ts +359 -0
- package/corpus/core/src/provider-api/gong.ts +108 -0
- package/corpus/core/src/scripts/docs/source-search.ts +2 -1
- package/corpus/core/src/search/index.ts +413 -0
- package/corpus/core/src/server/google-oauth-credentials.ts +80 -3
- package/corpus/core/src/server/index.ts +6 -0
- package/corpus/core/src/styles/chat-history-list.css +1 -313
- package/corpus/core/src/templates/default/.agents/skills/actions/SKILL.md +32 -12
- package/corpus/core/src/templates/default/.agents/skills/agent-native-docs/SKILL.md +10 -0
- package/corpus/core/src/templates/default/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/corpus/core/src/templates/default/.agents/skills/integration-webhooks/SKILL.md +323 -0
- package/corpus/core/src/templates/default/.agents/skills/onboarding/SKILL.md +56 -0
- package/corpus/core/src/templates/default/.agents/skills/secrets/SKILL.md +273 -0
- package/corpus/core/src/templates/default/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/corpus/core/src/templates/default/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/corpus/core/src/templates/default/AGENTS.md +25 -18
- package/corpus/core/src/templates/headless/.agents/skills/actions/SKILL.md +512 -0
- package/corpus/core/src/templates/headless/.agents/skills/agent-native-docs/SKILL.md +10 -0
- package/corpus/core/src/templates/headless/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/corpus/core/src/templates/headless/.agents/skills/integration-webhooks/SKILL.md +323 -0
- package/corpus/core/src/templates/headless/.agents/skills/secrets/SKILL.md +273 -0
- package/corpus/core/src/templates/headless/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/corpus/core/src/templates/headless/AGENTS.md +7 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/actions/SKILL.md +32 -12
- package/corpus/core/src/templates/workspace-core/.agents/skills/agent-native-docs/SKILL.md +10 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +6 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/corpus/core/src/templates/workspace-core/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/corpus/core/src/templates/workspace-core/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/corpus/core/src/templates/workspace-core/AGENTS.md +4 -0
- package/corpus/core/src/templates/workspace-root/AGENTS.md +4 -0
- package/corpus/templates/analytics/.agents/skills/actions/SKILL.md +32 -12
- package/corpus/templates/analytics/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/corpus/templates/analytics/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/corpus/templates/analytics/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/corpus/templates/analytics/actions/delete-staged-dataset.ts +3 -23
- package/corpus/templates/analytics/actions/list-staged-datasets.ts +3 -27
- package/corpus/templates/analytics/actions/provider-api-catalog.ts +16 -19
- package/corpus/templates/analytics/actions/provider-api-docs.ts +3 -5
- package/corpus/templates/analytics/actions/provider-api-request.ts +162 -185
- package/corpus/templates/analytics/actions/query-staged-dataset.ts +3 -47
- package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +52 -161
- package/corpus/templates/assets/.agents/skills/actions/SKILL.md +32 -12
- package/corpus/templates/assets/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/corpus/templates/assets/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/corpus/templates/assets/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/corpus/templates/assets/app/components/layout/Sidebar.tsx +63 -160
- package/corpus/templates/brain/.agents/skills/actions/SKILL.md +32 -12
- package/corpus/templates/brain/.agents/skills/brain/RUNBOOK.md +48 -5
- package/corpus/templates/brain/.agents/skills/brain/SKILL.md +46 -14
- package/corpus/templates/brain/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/corpus/templates/brain/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/corpus/templates/brain/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/corpus/templates/brain/README.md +34 -3
- package/corpus/templates/brain/actions/_schemas.ts +13 -7
- package/corpus/templates/brain/actions/approve-proposal.ts +2 -0
- package/corpus/templates/brain/actions/claim-distillation.ts +24 -27
- package/corpus/templates/brain/actions/create-source.ts +1 -1
- package/corpus/templates/brain/actions/delete-staged-dataset.ts +3 -24
- package/corpus/templates/brain/actions/get-knowledge.ts +6 -2
- package/corpus/templates/brain/actions/get-pilot-report.ts +44 -8
- package/corpus/templates/brain/actions/import-capture.ts +21 -9
- package/corpus/templates/brain/actions/import-transcript.ts +42 -14
- package/corpus/templates/brain/actions/list-captures.ts +10 -1
- package/corpus/templates/brain/actions/list-distillation-queue.ts +39 -14
- package/corpus/templates/brain/actions/list-projects.ts +51 -0
- package/corpus/templates/brain/actions/list-proposals.ts +80 -4
- package/corpus/templates/brain/actions/list-sources.ts +17 -3
- package/corpus/templates/brain/actions/list-staged-datasets.ts +3 -28
- package/corpus/templates/brain/actions/manage-project.ts +118 -0
- package/corpus/templates/brain/actions/mark-capture-distilled.ts +68 -20
- package/corpus/templates/brain/actions/navigate.ts +1 -0
- package/corpus/templates/brain/actions/provider-api-catalog.ts +5 -11
- package/corpus/templates/brain/actions/provider-api-docs.ts +3 -5
- package/corpus/templates/brain/actions/provider-api-request.ts +3 -37
- package/corpus/templates/brain/actions/query-staged-dataset.ts +3 -48
- package/corpus/templates/brain/actions/reject-proposal.ts +6 -1
- package/corpus/templates/brain/actions/resanitize-captures.ts +159 -33
- package/corpus/templates/brain/actions/review-proposal.ts +2 -0
- package/corpus/templates/brain/actions/search-everything.ts +10 -1
- package/corpus/templates/brain/actions/search-knowledge.ts +1 -1
- package/corpus/templates/brain/actions/set-settings.ts +36 -1
- package/corpus/templates/brain/actions/update-proposal.ts +2 -0
- package/corpus/templates/brain/actions/update-source.ts +5 -1
- package/corpus/templates/brain/app/components/layout/Sidebar.tsx +48 -154
- package/corpus/templates/brain/app/hooks/use-distillation-bridge.ts +18 -9
- package/corpus/templates/brain/app/hooks/use-navigation-state.ts +3 -0
- package/corpus/templates/brain/app/i18n-data.ts +731 -2
- package/corpus/templates/brain/app/lib/brain.ts +88 -1
- package/corpus/templates/brain/app/lib/ingest-handoff.ts +35 -0
- package/corpus/templates/brain/app/routes/ops.tsx +47 -0
- package/corpus/templates/brain/app/routes/review.tsx +41 -2
- package/corpus/templates/brain/app/routes/search.tsx +33 -2
- package/corpus/templates/brain/app/routes/settings.tsx +158 -0
- package/corpus/templates/brain/app/routes/sources.tsx +31 -0
- package/corpus/templates/brain/changelog/2026-07-19-added-private-source-safe-semantic-search.md +6 -0
- package/corpus/templates/brain/changelog/2026-07-19-slack-backfills-can-now-join-configured-public-channels-befo.md +6 -0
- package/corpus/templates/brain/changelog/2026-07-19-slack-backfills-now-continue-across-the-configured-number-of.md +6 -0
- package/corpus/templates/brain/changelog/2026-07-19-slack-backfills-now-start-with-a-safe-four-week-window-and-r.md +6 -0
- package/corpus/templates/brain/jobs/process-ingest-queue.ts +270 -36
- package/corpus/templates/brain/package.json +1 -0
- package/corpus/templates/brain/server/db/index.ts +18 -0
- package/corpus/templates/brain/server/db/schema.ts +197 -1
- package/corpus/templates/brain/server/jobs/distillation-queue.ts +12 -5
- package/corpus/templates/brain/server/lib/audiences.ts +708 -0
- package/corpus/templates/brain/server/lib/brain-health.ts +251 -38
- package/corpus/templates/brain/server/lib/brain.ts +877 -50
- package/corpus/templates/brain/server/lib/capture-sanitization.ts +217 -53
- package/corpus/templates/brain/server/lib/connectors.ts +609 -72
- package/corpus/templates/brain/server/lib/demo.ts +17 -4
- package/corpus/templates/brain/server/lib/hybrid-search.ts +363 -0
- package/corpus/templates/brain/server/lib/ingest-queue.ts +104 -0
- package/corpus/templates/brain/server/lib/privacy-readiness.ts +24 -0
- package/corpus/templates/brain/server/lib/search-index-contracts.ts +72 -0
- package/corpus/templates/brain/server/lib/search-index.ts +714 -0
- package/corpus/templates/brain/server/lib/search.ts +120 -4
- package/corpus/templates/brain/server/lib/sensitivity-policy.ts +174 -0
- package/corpus/templates/brain/server/lib/slack-channel-membership.ts +44 -0
- package/corpus/templates/brain/server/lib/slack-events.ts +281 -0
- package/corpus/templates/brain/server/onboarding.ts +29 -0
- package/corpus/templates/brain/server/plugins/db.ts +204 -0
- package/corpus/templates/brain/server/register-secrets.ts +46 -0
- package/corpus/templates/brain/server/routes/api/_agent-native/brain/ingest.post.ts +36 -16
- package/corpus/templates/brain/server/routes/api/_agent-native/brain/slack-events.post.ts +28 -0
- package/corpus/templates/brain/shared/slack-source-config.ts +60 -0
- package/corpus/templates/brain/shared/types.ts +10 -0
- package/corpus/templates/calendar/.agents/skills/actions/SKILL.md +32 -12
- package/corpus/templates/calendar/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/corpus/templates/calendar/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/corpus/templates/calendar/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/corpus/templates/calendar/actions/delete-staged-dataset.ts +3 -24
- package/corpus/templates/calendar/actions/list-staged-datasets.ts +3 -28
- package/corpus/templates/calendar/actions/provider-api-catalog.ts +5 -11
- package/corpus/templates/calendar/actions/provider-api-docs.ts +3 -5
- package/corpus/templates/calendar/actions/provider-api-request.ts +3 -37
- package/corpus/templates/calendar/actions/query-staged-dataset.ts +3 -48
- package/corpus/templates/calendar/server/handlers/gong.ts +6 -61
- package/corpus/templates/calendar/server/handlers/google-auth.ts +10 -8
- package/corpus/templates/calendar/server/lib/google-calendar.ts +7 -45
- package/corpus/templates/chat/.agents/skills/actions/SKILL.md +32 -12
- package/corpus/templates/chat/.agents/skills/agent-native-docs/SKILL.md +10 -0
- package/corpus/templates/chat/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/corpus/templates/chat/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/corpus/templates/chat/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/corpus/templates/chat/AGENTS.md +5 -2
- package/corpus/templates/chat/app/components/layout/Sidebar.tsx +51 -157
- package/corpus/templates/clips/.agents/skills/actions/SKILL.md +32 -12
- package/corpus/templates/clips/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/corpus/templates/clips/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/corpus/templates/clips/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/corpus/templates/clips/AGENTS.md +11 -0
- package/corpus/templates/clips/actions/export-to-brain.ts +505 -171
- package/corpus/templates/clips/changelog/2026-07-19-ready-clips-transcripts-can-be-backfilled-to-brain-for-a-bou.md +6 -0
- package/corpus/templates/clips/server/lib/calendar-event-meetings.ts +1 -1
- package/corpus/templates/clips/server/lib/google-calendar-client.ts +12 -22
- package/corpus/templates/clips/server/lib/google-calendar-oauth.ts +9 -6
- package/corpus/templates/clips/server/lib/slack-oauth.ts +12 -47
- package/corpus/templates/clips/server/routes/_agent-native/google/auth-url.get.ts +2 -6
- package/corpus/templates/clips/server/routes/api/auth/google-calendar.get.ts +4 -4
- package/corpus/templates/content/.agents/skills/actions/SKILL.md +32 -12
- package/corpus/templates/content/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/corpus/templates/content/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/corpus/templates/content/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/corpus/templates/content/actions/delete-staged-dataset.ts +3 -24
- package/corpus/templates/content/actions/list-staged-datasets.ts +3 -28
- package/corpus/templates/content/actions/provider-api-catalog.ts +5 -11
- package/corpus/templates/content/actions/provider-api-docs.ts +3 -5
- package/corpus/templates/content/actions/provider-api-request.ts +3 -37
- package/corpus/templates/content/actions/query-staged-dataset.ts +3 -48
- package/corpus/templates/design/.agents/skills/actions/SKILL.md +32 -12
- package/corpus/templates/design/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/corpus/templates/design/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/corpus/templates/design/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/corpus/templates/design/actions/delete-staged-dataset.ts +4 -23
- package/corpus/templates/design/actions/list-staged-datasets.ts +4 -27
- package/corpus/templates/design/actions/provider-api-catalog.ts +15 -18
- package/corpus/templates/design/actions/provider-api-docs.ts +57 -48
- package/corpus/templates/design/actions/provider-api-request.ts +140 -164
- package/corpus/templates/design/actions/query-staged-dataset.ts +4 -47
- package/corpus/templates/dispatch/.agents/skills/actions/SKILL.md +32 -12
- package/corpus/templates/dispatch/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/corpus/templates/dispatch/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/corpus/templates/dispatch/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/corpus/templates/dispatch/actions/delete-staged-dataset.ts +4 -23
- package/corpus/templates/dispatch/actions/list-staged-datasets.ts +4 -30
- package/corpus/templates/dispatch/actions/provider-api-catalog.ts +15 -18
- package/corpus/templates/dispatch/actions/provider-api-docs.ts +57 -48
- package/corpus/templates/dispatch/actions/provider-api-request.ts +138 -163
- package/corpus/templates/dispatch/actions/query-staged-dataset.ts +4 -47
- package/corpus/templates/forms/.agents/skills/actions/SKILL.md +32 -12
- package/corpus/templates/forms/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/corpus/templates/forms/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/corpus/templates/forms/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/corpus/templates/forms/server/lib/integrations.ts +23 -22
- package/corpus/templates/macros/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/corpus/templates/macros/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/corpus/templates/mail/.agents/skills/actions/SKILL.md +32 -12
- package/corpus/templates/mail/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/corpus/templates/mail/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/corpus/templates/mail/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/corpus/templates/mail/actions/delete-staged-dataset.ts +4 -23
- package/corpus/templates/mail/actions/list-staged-datasets.ts +4 -27
- package/corpus/templates/mail/actions/provider-api-catalog.ts +15 -18
- package/corpus/templates/mail/actions/provider-api-docs.ts +57 -48
- package/corpus/templates/mail/actions/provider-api-request.ts +146 -173
- package/corpus/templates/mail/actions/query-staged-dataset.ts +4 -47
- package/corpus/templates/mail/server/handlers/gong.ts +6 -61
- package/corpus/templates/mail/server/lib/google-auth.ts +10 -13
- package/corpus/templates/plan/.agents/skills/actions/SKILL.md +32 -12
- package/corpus/templates/plan/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/corpus/templates/plan/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/corpus/templates/plan/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/corpus/templates/plan/app/components/layout/Sidebar.tsx +47 -156
- package/corpus/templates/slides/.agents/skills/actions/SKILL.md +32 -12
- package/corpus/templates/slides/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/corpus/templates/slides/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/corpus/templates/slides/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/corpus/templates/slides/actions/delete-staged-dataset.ts +4 -23
- package/corpus/templates/slides/actions/list-staged-datasets.ts +4 -27
- package/corpus/templates/slides/actions/provider-api-catalog.ts +15 -18
- package/corpus/templates/slides/actions/provider-api-docs.ts +57 -48
- package/corpus/templates/slides/actions/provider-api-request.ts +145 -172
- package/corpus/templates/slides/actions/query-staged-dataset.ts +4 -47
- package/corpus/templates/slides/server/lib/google-docs-oauth.ts +11 -36
- package/corpus/templates/tasks/.agents/skills/actions/SKILL.md +32 -12
- package/corpus/templates/tasks/.agents/skills/agent-native-docs/SKILL.md +10 -0
- package/corpus/templates/tasks/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/corpus/templates/tasks/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/corpus/templates/tasks/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/corpus/toolkit/CHANGELOG.md +125 -0
- package/corpus/toolkit/README.md +60 -0
- package/corpus/toolkit/export-snapshot.json +35 -0
- package/corpus/toolkit/migration-manifest.json +4 -0
- package/corpus/toolkit/package.json +281 -0
- package/corpus/toolkit/scripts/finalize-build.mjs +55 -0
- package/corpus/toolkit/src/app-shell/header-actions.tsx +84 -0
- package/corpus/toolkit/src/app-shell/index.ts +1 -0
- package/corpus/toolkit/src/chat-history/ChatHistoryList.tsx +469 -0
- package/corpus/toolkit/src/chat-history/index.ts +7 -0
- package/corpus/toolkit/src/chat-history.css +314 -0
- package/corpus/toolkit/src/collab-ui/AgentPresenceChip.tsx +69 -0
- package/corpus/toolkit/src/collab-ui/LiveCursorOverlay.tsx +241 -0
- package/corpus/toolkit/src/collab-ui/PresenceBar.tsx +346 -0
- package/corpus/toolkit/src/collab-ui/RecentEditHighlights.tsx +225 -0
- package/corpus/toolkit/src/collab-ui/RemoteSelectionRings.tsx +227 -0
- package/corpus/toolkit/src/collab-ui/agent-identity.ts +16 -0
- package/corpus/toolkit/src/collab-ui/index.ts +39 -0
- package/corpus/toolkit/src/collab-ui/lead-client.ts +32 -0
- package/corpus/toolkit/src/collab-ui/types.ts +96 -0
- package/corpus/toolkit/src/composer/AgentComposerFrame.tsx +59 -0
- package/corpus/toolkit/src/composer/ComposerPlusMenu.tsx +983 -0
- package/corpus/toolkit/src/composer/MentionPopover.tsx +412 -0
- package/corpus/toolkit/src/composer/PastedTextChip.tsx +150 -0
- package/corpus/toolkit/src/composer/PromptComposer.tsx +718 -0
- package/corpus/toolkit/src/composer/RealtimeVoiceMode.tsx +856 -0
- package/corpus/toolkit/src/composer/TiptapComposer.tsx +2936 -0
- package/corpus/toolkit/src/composer/VoiceButton.tsx +255 -0
- package/corpus/toolkit/src/composer/asset-picker-url.ts +80 -0
- package/corpus/toolkit/src/composer/attachment-accept.ts +71 -0
- package/corpus/toolkit/src/composer/draft-key.ts +7 -0
- package/corpus/toolkit/src/composer/extensions/FileReference.tsx +55 -0
- package/corpus/toolkit/src/composer/extensions/MentionReference.tsx +93 -0
- package/corpus/toolkit/src/composer/extensions/SkillReference.tsx +56 -0
- package/corpus/toolkit/src/composer/index.ts +79 -0
- package/corpus/toolkit/src/composer/pasted-text.ts +160 -0
- package/corpus/toolkit/src/composer/prompt-attachments.ts +93 -0
- package/corpus/toolkit/src/composer/realtime-voice-audio-level.ts +64 -0
- package/corpus/toolkit/src/composer/realtime-voice-transcript.ts +134 -0
- package/corpus/toolkit/src/composer/runtime-adapters.tsx +343 -0
- package/corpus/toolkit/src/composer/types.ts +66 -0
- package/corpus/toolkit/src/composer/use-file-search.ts +64 -0
- package/corpus/toolkit/src/composer/use-mention-search.ts +90 -0
- package/corpus/toolkit/src/composer/use-skills.ts +45 -0
- package/corpus/toolkit/src/composer/useRealtimeVoiceMode.tsx +2117 -0
- package/corpus/toolkit/src/composer/useVoiceDictation.ts +1191 -0
- package/corpus/toolkit/src/context-ui/ContextMeter.tsx +101 -0
- package/corpus/toolkit/src/context-ui/ContextSegmentRow.tsx +184 -0
- package/corpus/toolkit/src/context-ui/ContextTreemap.tsx +125 -0
- package/corpus/toolkit/src/context-ui/ContextXRayPanel.tsx +377 -0
- package/corpus/toolkit/src/context-ui/format.ts +42 -0
- package/corpus/toolkit/src/context-ui/index.ts +15 -0
- package/corpus/toolkit/src/context-ui/types.ts +43 -0
- package/corpus/toolkit/src/design-tweaks/index.ts +1 -0
- package/corpus/toolkit/src/design-tweaks/visual-style-controls.tsx +1084 -0
- package/corpus/toolkit/src/editor/BubbleToolbar.tsx +253 -0
- package/corpus/toolkit/src/editor/CodeBlockNode.tsx +254 -0
- package/corpus/toolkit/src/editor/DragHandle.ts +1437 -0
- package/corpus/toolkit/src/editor/ImageExtension.ts +306 -0
- package/corpus/toolkit/src/editor/RegistryBlockContext.tsx +107 -0
- package/corpus/toolkit/src/editor/RegistryBlockNode.tsx +652 -0
- package/corpus/toolkit/src/editor/RichMarkdownEditor.tsx +81 -0
- package/corpus/toolkit/src/editor/RunId.ts +61 -0
- package/corpus/toolkit/src/editor/SharedRichEditor.tsx +321 -0
- package/corpus/toolkit/src/editor/SlashCommandMenu.tsx +310 -0
- package/corpus/toolkit/src/editor/extensions.ts +402 -0
- package/corpus/toolkit/src/editor/gfmDoc.ts +92 -0
- package/corpus/toolkit/src/editor/index.ts +93 -0
- package/corpus/toolkit/src/editor/registrySlashCommands.ts +131 -0
- package/corpus/toolkit/src/editor/surgical-apply.ts +192 -0
- package/corpus/toolkit/src/editor/useCollabReconcile.ts +589 -0
- package/corpus/toolkit/src/editor.css +510 -0
- package/corpus/toolkit/src/hooks/index.ts +2 -0
- package/corpus/toolkit/src/hooks/use-mobile.tsx +21 -0
- package/corpus/toolkit/src/hooks/use-toast.ts +188 -0
- package/corpus/toolkit/src/index.ts +8 -0
- package/corpus/toolkit/src/onboarding/index.ts +1 -0
- package/corpus/toolkit/src/provider.tsx +47 -0
- package/corpus/toolkit/src/sharing/VisibilityBadge.tsx +37 -0
- package/corpus/toolkit/src/sharing/index.ts +4 -0
- package/corpus/toolkit/src/styles.css +21 -0
- package/corpus/toolkit/src/ui/accordion.tsx +56 -0
- package/corpus/toolkit/src/ui/alert-dialog.tsx +141 -0
- package/corpus/toolkit/src/ui/alert.tsx +59 -0
- package/corpus/toolkit/src/ui/aspect-ratio.tsx +5 -0
- package/corpus/toolkit/src/ui/avatar.tsx +48 -0
- package/corpus/toolkit/src/ui/badge.tsx +37 -0
- package/corpus/toolkit/src/ui/breadcrumb.tsx +115 -0
- package/corpus/toolkit/src/ui/button.tsx +78 -0
- package/corpus/toolkit/src/ui/calendar.tsx +214 -0
- package/corpus/toolkit/src/ui/card.tsx +86 -0
- package/corpus/toolkit/src/ui/carousel.tsx +260 -0
- package/corpus/toolkit/src/ui/chart.tsx +375 -0
- package/corpus/toolkit/src/ui/checkbox.tsx +28 -0
- package/corpus/toolkit/src/ui/collapsible.tsx +9 -0
- package/corpus/toolkit/src/ui/command.tsx +174 -0
- package/corpus/toolkit/src/ui/context-menu.tsx +202 -0
- package/corpus/toolkit/src/ui/date-picker.tsx +64 -0
- package/corpus/toolkit/src/ui/dialog.tsx +146 -0
- package/corpus/toolkit/src/ui/drawer.tsx +126 -0
- package/corpus/toolkit/src/ui/dropdown-menu.tsx +218 -0
- package/corpus/toolkit/src/ui/form.tsx +177 -0
- package/corpus/toolkit/src/ui/hover-card.tsx +27 -0
- package/corpus/toolkit/src/ui/index.ts +52 -0
- package/corpus/toolkit/src/ui/input-otp.tsx +69 -0
- package/corpus/toolkit/src/ui/input.tsx +22 -0
- package/corpus/toolkit/src/ui/label.tsx +24 -0
- package/corpus/toolkit/src/ui/logo.tsx +36 -0
- package/corpus/toolkit/src/ui/menubar.tsx +235 -0
- package/corpus/toolkit/src/ui/navigation-menu.tsx +128 -0
- package/corpus/toolkit/src/ui/pagination.tsx +121 -0
- package/corpus/toolkit/src/ui/popover.tsx +44 -0
- package/corpus/toolkit/src/ui/progress.tsx +26 -0
- package/corpus/toolkit/src/ui/radio-group.tsx +42 -0
- package/corpus/toolkit/src/ui/resizable.tsx +43 -0
- package/corpus/toolkit/src/ui/scroll-area.tsx +46 -0
- package/corpus/toolkit/src/ui/select.tsx +158 -0
- package/corpus/toolkit/src/ui/separator.tsx +29 -0
- package/corpus/toolkit/src/ui/sheet.tsx +160 -0
- package/corpus/toolkit/src/ui/sidebar.tsx +777 -0
- package/corpus/toolkit/src/ui/skeleton.tsx +18 -0
- package/corpus/toolkit/src/ui/slider.tsx +26 -0
- package/corpus/toolkit/src/ui/sonner.tsx +58 -0
- package/corpus/toolkit/src/ui/spinner.tsx +17 -0
- package/corpus/toolkit/src/ui/switch.tsx +27 -0
- package/corpus/toolkit/src/ui/table.tsx +117 -0
- package/corpus/toolkit/src/ui/tabs.tsx +53 -0
- package/corpus/toolkit/src/ui/textarea.tsx +23 -0
- package/corpus/toolkit/src/ui/toast.tsx +127 -0
- package/corpus/toolkit/src/ui/toaster.tsx +33 -0
- package/corpus/toolkit/src/ui/toggle-group.tsx +59 -0
- package/corpus/toolkit/src/ui/toggle.tsx +43 -0
- package/corpus/toolkit/src/ui/tooltip.tsx +53 -0
- package/corpus/toolkit/src/ui/use-toast.ts +3 -0
- package/corpus/toolkit/src/utils.ts +8 -0
- package/corpus/toolkit/tsconfig.json +23 -0
- package/dist/cli/atomic-json-file.d.ts +30 -0
- package/dist/cli/atomic-json-file.d.ts.map +1 -0
- package/dist/cli/atomic-json-file.js +240 -0
- package/dist/cli/atomic-json-file.js.map +1 -0
- package/dist/cli/claude-code-participant.d.ts +77 -0
- package/dist/cli/claude-code-participant.d.ts.map +1 -0
- package/dist/cli/claude-code-participant.js +355 -0
- package/dist/cli/claude-code-participant.js.map +1 -0
- package/dist/cli/code-agent-executor.d.ts +8 -9
- package/dist/cli/code-agent-executor.d.ts.map +1 -1
- package/dist/cli/code-agent-executor.js +27 -13
- package/dist/cli/code-agent-executor.js.map +1 -1
- package/dist/cli/code-agent-runs.concurrent-worker.d.ts +2 -0
- package/dist/cli/code-agent-runs.concurrent-worker.d.ts.map +1 -0
- package/dist/cli/code-agent-runs.concurrent-worker.js +32 -0
- package/dist/cli/code-agent-runs.concurrent-worker.js.map +1 -0
- package/dist/cli/code-agent-runs.d.ts +5 -0
- package/dist/cli/code-agent-runs.d.ts.map +1 -1
- package/dist/cli/code-agent-runs.js +51 -33
- package/dist/cli/code-agent-runs.js.map +1 -1
- package/dist/cli/codex-cli-participant.d.ts +77 -0
- package/dist/cli/codex-cli-participant.d.ts.map +1 -0
- package/dist/cli/codex-cli-participant.js +354 -0
- package/dist/cli/codex-cli-participant.js.map +1 -0
- package/dist/cli/multi-frontier-runs.d.ts +246 -0
- package/dist/cli/multi-frontier-runs.d.ts.map +1 -0
- package/dist/cli/multi-frontier-runs.js +1247 -0
- package/dist/cli/multi-frontier-runs.js.map +1 -0
- package/dist/client/chat/ChatHistoryList.d.ts +1 -87
- package/dist/client/chat/ChatHistoryList.d.ts.map +1 -1
- package/dist/client/chat/ChatHistoryList.js +1 -82
- package/dist/client/chat/ChatHistoryList.js.map +1 -1
- package/dist/coding-tools/index.d.ts +1 -0
- package/dist/coding-tools/index.d.ts.map +1 -1
- package/dist/coding-tools/index.js +25 -7
- package/dist/coding-tools/index.js.map +1 -1
- package/dist/collab/awareness.d.ts +2 -2
- package/dist/collab/awareness.d.ts.map +1 -1
- package/dist/embeddings/index.d.ts +24 -0
- package/dist/embeddings/index.d.ts.map +1 -0
- package/dist/embeddings/index.js +172 -0
- package/dist/embeddings/index.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/integrations/index.d.ts +2 -1
- package/dist/integrations/index.d.ts.map +1 -1
- package/dist/integrations/index.js +2 -1
- package/dist/integrations/index.js.map +1 -1
- package/dist/integrations/slack-manifest.d.ts +1 -1
- package/dist/integrations/slack-oauth.d.ts +1 -1
- package/dist/integrations/slack-oauth.d.ts.map +1 -1
- package/dist/integrations/slack-oauth.js +1 -0
- package/dist/integrations/slack-oauth.js.map +1 -1
- package/dist/integrations/webhook-delivery.d.ts +23 -0
- package/dist/integrations/webhook-delivery.d.ts.map +1 -0
- package/dist/integrations/webhook-delivery.js +32 -0
- package/dist/integrations/webhook-delivery.js.map +1 -0
- package/dist/notifications/channels.d.ts.map +1 -1
- package/dist/notifications/channels.js +4 -9
- package/dist/notifications/channels.js.map +1 -1
- package/dist/notifications/routes.d.ts +3 -3
- package/dist/progress/routes.d.ts +1 -1
- package/dist/provider-api/actions/custom-provider-registration.d.ts +136 -0
- package/dist/provider-api/actions/custom-provider-registration.d.ts.map +1 -0
- package/dist/provider-api/actions/custom-provider-registration.js +154 -0
- package/dist/provider-api/actions/custom-provider-registration.js.map +1 -0
- package/dist/provider-api/actions/delete-staged-dataset.d.ts +1 -1
- package/dist/provider-api/actions/delete-staged-dataset.d.ts.map +1 -1
- package/dist/provider-api/actions/delete-staged-dataset.js +3 -34
- package/dist/provider-api/actions/delete-staged-dataset.js.map +1 -1
- package/dist/provider-api/actions/list-staged-datasets.d.ts +2 -3
- package/dist/provider-api/actions/list-staged-datasets.d.ts.map +1 -1
- package/dist/provider-api/actions/list-staged-datasets.js +3 -40
- package/dist/provider-api/actions/list-staged-datasets.js.map +1 -1
- package/dist/provider-api/actions/provider-api-audit.d.ts +7 -0
- package/dist/provider-api/actions/provider-api-audit.d.ts.map +1 -0
- package/dist/provider-api/actions/provider-api-audit.js +74 -0
- package/dist/provider-api/actions/provider-api-audit.js.map +1 -0
- package/dist/provider-api/actions/provider-api.d.ts +370 -0
- package/dist/provider-api/actions/provider-api.d.ts.map +1 -0
- package/dist/provider-api/actions/provider-api.js +280 -0
- package/dist/provider-api/actions/provider-api.js.map +1 -0
- package/dist/provider-api/actions/query-staged-dataset.d.ts +1 -1
- package/dist/provider-api/actions/query-staged-dataset.d.ts.map +1 -1
- package/dist/provider-api/actions/query-staged-dataset.js +3 -116
- package/dist/provider-api/actions/query-staged-dataset.js.map +1 -1
- package/dist/provider-api/actions/staged-datasets.d.ts +190 -0
- package/dist/provider-api/actions/staged-datasets.d.ts.map +1 -0
- package/dist/provider-api/actions/staged-datasets.js +210 -0
- package/dist/provider-api/actions/staged-datasets.js.map +1 -0
- package/dist/provider-api/gong.d.ts +44 -0
- package/dist/provider-api/gong.d.ts.map +1 -0
- package/dist/provider-api/gong.js +56 -0
- package/dist/provider-api/gong.js.map +1 -0
- package/dist/resources/handlers.d.ts +1 -1
- package/dist/scripts/docs/source-search.d.ts +2 -1
- package/dist/scripts/docs/source-search.d.ts.map +1 -1
- package/dist/scripts/docs/source-search.js +2 -1
- package/dist/scripts/docs/source-search.js.map +1 -1
- package/dist/search/index.d.ts +88 -0
- package/dist/search/index.d.ts.map +1 -0
- package/dist/search/index.js +267 -0
- package/dist/search/index.js.map +1 -0
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/google-oauth-credentials.d.ts +35 -0
- package/dist/server/google-oauth-credentials.d.ts.map +1 -1
- package/dist/server/google-oauth-credentials.js +48 -2
- package/dist/server/google-oauth-credentials.js.map +1 -1
- package/dist/server/index.d.ts +1 -1
- package/dist/server/index.d.ts.map +1 -1
- package/dist/server/index.js +1 -1
- package/dist/server/index.js.map +1 -1
- package/dist/styles/chat-history-list.css +1 -313
- package/dist/templates/chat/.agents/skills/actions/SKILL.md +32 -12
- package/dist/templates/chat/.agents/skills/agent-native-docs/SKILL.md +10 -0
- package/dist/templates/chat/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/dist/templates/chat/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/dist/templates/chat/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/dist/templates/chat/AGENTS.md +5 -2
- package/dist/templates/chat/app/components/layout/Sidebar.tsx +51 -157
- package/dist/templates/default/.agents/skills/actions/SKILL.md +32 -12
- package/dist/templates/default/.agents/skills/agent-native-docs/SKILL.md +10 -0
- package/dist/templates/default/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/dist/templates/default/.agents/skills/integration-webhooks/SKILL.md +323 -0
- package/dist/templates/default/.agents/skills/onboarding/SKILL.md +56 -0
- package/dist/templates/default/.agents/skills/secrets/SKILL.md +273 -0
- package/dist/templates/default/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/dist/templates/default/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/dist/templates/default/AGENTS.md +25 -18
- package/dist/templates/headless/.agents/skills/actions/SKILL.md +512 -0
- package/dist/templates/headless/.agents/skills/agent-native-docs/SKILL.md +10 -0
- package/dist/templates/headless/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/dist/templates/headless/.agents/skills/integration-webhooks/SKILL.md +323 -0
- package/dist/templates/headless/.agents/skills/secrets/SKILL.md +273 -0
- package/dist/templates/headless/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/dist/templates/headless/AGENTS.md +7 -0
- package/dist/templates/workspace-core/.agents/skills/actions/SKILL.md +32 -12
- package/dist/templates/workspace-core/.agents/skills/agent-native-docs/SKILL.md +10 -0
- package/dist/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +6 -0
- package/dist/templates/workspace-core/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/dist/templates/workspace-core/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/dist/templates/workspace-core/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/dist/templates/workspace-core/AGENTS.md +4 -0
- package/dist/templates/workspace-root/AGENTS.md +4 -0
- package/docs/AGENTS.md +7 -0
- package/docs/content/integrations.mdx +63 -2
- package/docs/design/provider-integration-authority.md +117 -0
- package/package.json +9 -2
- package/src/templates/chat/.agents/skills/actions/SKILL.md +32 -12
- package/src/templates/chat/.agents/skills/agent-native-docs/SKILL.md +10 -0
- package/src/templates/chat/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/src/templates/chat/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/src/templates/chat/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/src/templates/chat/AGENTS.md +5 -2
- package/src/templates/chat/app/components/layout/Sidebar.tsx +51 -157
- package/src/templates/default/.agents/skills/actions/SKILL.md +32 -12
- package/src/templates/default/.agents/skills/agent-native-docs/SKILL.md +10 -0
- package/src/templates/default/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/src/templates/default/.agents/skills/integration-webhooks/SKILL.md +323 -0
- package/src/templates/default/.agents/skills/onboarding/SKILL.md +56 -0
- package/src/templates/default/.agents/skills/secrets/SKILL.md +273 -0
- package/src/templates/default/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/src/templates/default/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/src/templates/default/AGENTS.md +25 -18
- package/src/templates/headless/.agents/skills/actions/SKILL.md +512 -0
- package/src/templates/headless/.agents/skills/agent-native-docs/SKILL.md +10 -0
- package/src/templates/headless/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/src/templates/headless/.agents/skills/integration-webhooks/SKILL.md +323 -0
- package/src/templates/headless/.agents/skills/secrets/SKILL.md +273 -0
- package/src/templates/headless/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/src/templates/headless/AGENTS.md +7 -0
- package/src/templates/workspace-core/.agents/skills/actions/SKILL.md +32 -12
- package/src/templates/workspace-core/.agents/skills/agent-native-docs/SKILL.md +10 -0
- package/src/templates/workspace-core/.agents/skills/agent-native-toolkit/SKILL.md +6 -0
- package/src/templates/workspace-core/.agents/skills/customizing-agent-native/SKILL.md +102 -0
- package/src/templates/workspace-core/.agents/skills/self-modifying-code/SKILL.md +11 -2
- package/src/templates/workspace-core/.agents/skills/upgrade-agent-native/SKILL.md +6 -0
- package/src/templates/workspace-core/AGENTS.md +4 -0
- package/src/templates/workspace-root/AGENTS.md +4 -0
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Voice dictation button + recording overlay for the agent composer.
|
|
3
|
+
*
|
|
4
|
+
* UX mirrors Lovable: click-to-toggle record, a live amplitude bar and
|
|
5
|
+
* MM:SS timer replace the editor area while recording, and a cancel X
|
|
6
|
+
* discards without transcribing. The mic is always visible alongside the
|
|
7
|
+
* send button (Cursor replaces send with mic; their users complain — we
|
|
8
|
+
* don't copy that).
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import {
|
|
12
|
+
IconMicrophone,
|
|
13
|
+
IconPlayerStopFilled,
|
|
14
|
+
IconLoader2,
|
|
15
|
+
IconX,
|
|
16
|
+
} from "@tabler/icons-react";
|
|
17
|
+
|
|
18
|
+
import { Tooltip, TooltipContent, TooltipTrigger } from "../ui/tooltip.js";
|
|
19
|
+
import { RealtimeVoiceModeEntry } from "./RealtimeVoiceMode.js";
|
|
20
|
+
import { useComposerRuntimeAdapters } from "./runtime-adapters.js";
|
|
21
|
+
import {
|
|
22
|
+
useRealtimeVoiceModeCopy,
|
|
23
|
+
useRealtimeVoiceModeOptional,
|
|
24
|
+
} from "./useRealtimeVoiceMode.js";
|
|
25
|
+
import type { VoiceDictationApi } from "./useVoiceDictation.js";
|
|
26
|
+
|
|
27
|
+
function openOpenAiKeySettings(): void {
|
|
28
|
+
window.location.hash = "#secrets:OPENAI_API_KEY";
|
|
29
|
+
window.dispatchEvent(new Event("agent-panel:open"));
|
|
30
|
+
window.dispatchEvent(
|
|
31
|
+
new CustomEvent("agent-panel:open-settings", {
|
|
32
|
+
detail: { section: "secrets" },
|
|
33
|
+
}),
|
|
34
|
+
);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export interface VoiceButtonProps {
|
|
38
|
+
voice: VoiceDictationApi;
|
|
39
|
+
isMac: boolean;
|
|
40
|
+
disabled?: boolean;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export function isRealtimeVoiceSetupRequired(
|
|
44
|
+
status: { builder?: boolean; openai?: boolean } | null,
|
|
45
|
+
builderConfigured: boolean | null,
|
|
46
|
+
): boolean {
|
|
47
|
+
return (
|
|
48
|
+
status !== null &&
|
|
49
|
+
!status.builder &&
|
|
50
|
+
!status.openai &&
|
|
51
|
+
builderConfigured !== true
|
|
52
|
+
);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export function VoiceButton({ voice, isMac, disabled }: VoiceButtonProps) {
|
|
56
|
+
const adapters = useComposerRuntimeAdapters();
|
|
57
|
+
const { state, start, stop, supported } = voice;
|
|
58
|
+
const realtimeVoice = useRealtimeVoiceModeOptional();
|
|
59
|
+
const realtimeCopy = useRealtimeVoiceModeCopy();
|
|
60
|
+
const voiceProviders = adapters.voice!.useProviderStatus!();
|
|
61
|
+
const builderConnect = adapters.builder!.useConnectFlow!({
|
|
62
|
+
trackingSource: "realtime_voice",
|
|
63
|
+
trackingFlow: "voice_transcription",
|
|
64
|
+
onConnected: () => voiceProviders.refresh(),
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
if (!supported) return null;
|
|
68
|
+
|
|
69
|
+
const recording = state === "recording" || state === "starting";
|
|
70
|
+
const transcribing = state === "transcribing";
|
|
71
|
+
|
|
72
|
+
if (realtimeVoice?.active && !recording && !transcribing) return null;
|
|
73
|
+
|
|
74
|
+
if (realtimeVoice && !recording && !transcribing) {
|
|
75
|
+
return (
|
|
76
|
+
<RealtimeVoiceModeEntry
|
|
77
|
+
copy={realtimeCopy}
|
|
78
|
+
disabled={disabled}
|
|
79
|
+
providerStatusPending={voiceProviders.status === null}
|
|
80
|
+
setupRequired={isRealtimeVoiceSetupRequired(
|
|
81
|
+
voiceProviders.status,
|
|
82
|
+
builderConnect.statusResolved ? builderConnect.configured : null,
|
|
83
|
+
)}
|
|
84
|
+
openAiConfigured={voiceProviders.status?.openai === true}
|
|
85
|
+
connectingBuilder={builderConnect.connecting}
|
|
86
|
+
onConnectBuilder={builderConnect.start}
|
|
87
|
+
onUseOpenAiKey={() => {
|
|
88
|
+
if (voiceProviders.status?.openai) void realtimeVoice.start();
|
|
89
|
+
else openOpenAiKeySettings();
|
|
90
|
+
}}
|
|
91
|
+
onStartVoiceMode={() => void realtimeVoice.start()}
|
|
92
|
+
onKeepDictating={() => void start()}
|
|
93
|
+
/>
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
const label = recording
|
|
98
|
+
? "Stop recording"
|
|
99
|
+
: transcribing
|
|
100
|
+
? "Transcribing…"
|
|
101
|
+
: `Dictate (${isMac ? "⌘⇧M" : "Ctrl+Shift+M"})`;
|
|
102
|
+
|
|
103
|
+
const onClick = () => {
|
|
104
|
+
if (recording) stop();
|
|
105
|
+
else if (!transcribing) void start();
|
|
106
|
+
};
|
|
107
|
+
|
|
108
|
+
return (
|
|
109
|
+
<Tooltip>
|
|
110
|
+
<TooltipTrigger asChild>
|
|
111
|
+
<button
|
|
112
|
+
type="button"
|
|
113
|
+
onClick={onClick}
|
|
114
|
+
disabled={disabled || transcribing}
|
|
115
|
+
aria-label={label}
|
|
116
|
+
aria-pressed={recording}
|
|
117
|
+
className={`shrink-0 flex h-7 w-7 items-center justify-center rounded-md transition-colors duration-150 disabled:opacity-30 disabled:cursor-not-allowed ${
|
|
118
|
+
recording
|
|
119
|
+
? "text-[#00B5FF] bg-[#00B5FF]/10 hover:bg-[#00B5FF]/20"
|
|
120
|
+
: "text-muted-foreground hover:text-foreground hover:bg-accent/50"
|
|
121
|
+
}`}
|
|
122
|
+
>
|
|
123
|
+
{transcribing ? (
|
|
124
|
+
<IconLoader2 className="h-4 w-4 animate-spin" />
|
|
125
|
+
) : recording ? (
|
|
126
|
+
<IconPlayerStopFilled className="h-3.5 w-3.5" />
|
|
127
|
+
) : (
|
|
128
|
+
<IconMicrophone className="h-4 w-4" />
|
|
129
|
+
)}
|
|
130
|
+
</button>
|
|
131
|
+
</TooltipTrigger>
|
|
132
|
+
<TooltipContent>{label}</TooltipContent>
|
|
133
|
+
</Tooltip>
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
export interface VoiceRecordingOverlayProps {
|
|
138
|
+
voice: VoiceDictationApi;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export function VoiceRecordingOverlay({ voice }: VoiceRecordingOverlayProps) {
|
|
142
|
+
const { state, amplitude, durationMs, errorMessage, cancel } = voice;
|
|
143
|
+
const { dismissError, start } = voice;
|
|
144
|
+
|
|
145
|
+
if (state === "error" && errorMessage) {
|
|
146
|
+
return (
|
|
147
|
+
<div
|
|
148
|
+
role="alert"
|
|
149
|
+
className="mx-2 mt-1 flex items-start gap-2 rounded-md border border-red-500/40 bg-red-500/10 px-2 py-1.5 text-[11px] text-red-500"
|
|
150
|
+
>
|
|
151
|
+
<span className="flex-1 min-w-0">{errorMessage}</span>
|
|
152
|
+
<Tooltip>
|
|
153
|
+
<TooltipTrigger asChild>
|
|
154
|
+
<button
|
|
155
|
+
type="button"
|
|
156
|
+
onClick={() => {
|
|
157
|
+
dismissError();
|
|
158
|
+
void start();
|
|
159
|
+
}}
|
|
160
|
+
className="shrink-0 cursor-pointer rounded px-1.5 py-0.5 text-[11px] font-medium text-red-500 hover:bg-red-500/20"
|
|
161
|
+
aria-label="Try again"
|
|
162
|
+
>
|
|
163
|
+
Try again
|
|
164
|
+
</button>
|
|
165
|
+
</TooltipTrigger>
|
|
166
|
+
<TooltipContent>Try again</TooltipContent>
|
|
167
|
+
</Tooltip>
|
|
168
|
+
<Tooltip>
|
|
169
|
+
<TooltipTrigger asChild>
|
|
170
|
+
<button
|
|
171
|
+
type="button"
|
|
172
|
+
onClick={dismissError}
|
|
173
|
+
className="shrink-0 flex h-4 w-4 cursor-pointer items-center justify-center rounded text-red-500 hover:bg-red-500/20"
|
|
174
|
+
aria-label="Dismiss"
|
|
175
|
+
>
|
|
176
|
+
<IconX className="h-3 w-3" />
|
|
177
|
+
</button>
|
|
178
|
+
</TooltipTrigger>
|
|
179
|
+
<TooltipContent>Dismiss</TooltipContent>
|
|
180
|
+
</Tooltip>
|
|
181
|
+
</div>
|
|
182
|
+
);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
if (state !== "recording" && state !== "starting" && state !== "transcribing")
|
|
186
|
+
return null;
|
|
187
|
+
|
|
188
|
+
return (
|
|
189
|
+
<div
|
|
190
|
+
className="flex items-center gap-2 mx-2 mt-2 mb-1 h-[2rem] rounded-md border border-[#00B5FF]/40 bg-[#00B5FF]/10 px-2"
|
|
191
|
+
aria-live="polite"
|
|
192
|
+
>
|
|
193
|
+
<Tooltip>
|
|
194
|
+
<TooltipTrigger asChild>
|
|
195
|
+
<button
|
|
196
|
+
type="button"
|
|
197
|
+
onClick={cancel}
|
|
198
|
+
className="shrink-0 flex h-5 w-5 items-center justify-center rounded text-muted-foreground hover:text-foreground hover:bg-accent/40"
|
|
199
|
+
aria-label="Cancel recording"
|
|
200
|
+
>
|
|
201
|
+
<IconX className="h-3 w-3" />
|
|
202
|
+
</button>
|
|
203
|
+
</TooltipTrigger>
|
|
204
|
+
<TooltipContent>Cancel (Esc)</TooltipContent>
|
|
205
|
+
</Tooltip>
|
|
206
|
+
|
|
207
|
+
<div className="flex-1 flex items-center gap-[2px] min-w-0 h-4">
|
|
208
|
+
{state === "transcribing" ? (
|
|
209
|
+
<span className="text-[11px] text-muted-foreground">
|
|
210
|
+
Transcribing…
|
|
211
|
+
</span>
|
|
212
|
+
) : (
|
|
213
|
+
<AmplitudeBars amplitude={amplitude} />
|
|
214
|
+
)}
|
|
215
|
+
</div>
|
|
216
|
+
|
|
217
|
+
<span className="shrink-0 text-[11px] font-medium tabular-nums text-muted-foreground">
|
|
218
|
+
{state === "transcribing" ? (
|
|
219
|
+
<IconLoader2 className="h-3 w-3 animate-spin" />
|
|
220
|
+
) : (
|
|
221
|
+
formatDuration(durationMs)
|
|
222
|
+
)}
|
|
223
|
+
</span>
|
|
224
|
+
</div>
|
|
225
|
+
);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
const BAR_COUNT = 24;
|
|
229
|
+
|
|
230
|
+
function AmplitudeBars({ amplitude }: { amplitude: number }) {
|
|
231
|
+
// Render a symmetric meter — the middle bars peak first so the visual
|
|
232
|
+
// matches what voice input looks like in Lovable / iOS dictation.
|
|
233
|
+
const bars = [];
|
|
234
|
+
for (let i = 0; i < BAR_COUNT; i++) {
|
|
235
|
+
const centerDistance =
|
|
236
|
+
Math.abs(i - (BAR_COUNT - 1) / 2) / ((BAR_COUNT - 1) / 2);
|
|
237
|
+
const heightPct =
|
|
238
|
+
Math.max(0.1, amplitude * (1 - centerDistance * 0.6)) * 100;
|
|
239
|
+
bars.push(
|
|
240
|
+
<span
|
|
241
|
+
key={i}
|
|
242
|
+
className="flex-1 rounded-full bg-[#00B5FF]"
|
|
243
|
+
style={{ height: `${heightPct}%`, minHeight: 2 }}
|
|
244
|
+
/>,
|
|
245
|
+
);
|
|
246
|
+
}
|
|
247
|
+
return <>{bars}</>;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
function formatDuration(ms: number): string {
|
|
251
|
+
const total = Math.floor(ms / 1000);
|
|
252
|
+
const m = Math.floor(total / 60);
|
|
253
|
+
const s = total % 60;
|
|
254
|
+
return `${m}:${s.toString().padStart(2, "0")}`;
|
|
255
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
const FALLBACK_BASE_URL = "http://agent-native.invalid";
|
|
2
|
+
|
|
3
|
+
export const ASSET_PICKER_HANDOFF_PARAM = "__an_asset_picker_handoff";
|
|
4
|
+
export const ASSET_PICKER_RETURN_ORIGIN_PARAM =
|
|
5
|
+
"__an_asset_picker_return_origin";
|
|
6
|
+
|
|
7
|
+
export interface StandaloneAssetPickerOptions {
|
|
8
|
+
handoffId?: string;
|
|
9
|
+
returnOrigin?: string;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function createAssetPickerHandoffId(): string {
|
|
13
|
+
if (typeof crypto !== "undefined" && crypto.randomUUID) {
|
|
14
|
+
return crypto.randomUUID();
|
|
15
|
+
}
|
|
16
|
+
if (typeof crypto !== "undefined" && crypto.getRandomValues) {
|
|
17
|
+
const bytes = crypto.getRandomValues(new Uint8Array(16));
|
|
18
|
+
return Array.from(bytes, (byte) => byte.toString(16).padStart(2, "0")).join(
|
|
19
|
+
"",
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
return `${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Cross-origin Assets pages cannot inherit the host app's authenticated
|
|
27
|
+
* session inside an iframe. Treat those URLs as link-out targets so provider
|
|
28
|
+
* sign-in runs in a normal top-level browser context.
|
|
29
|
+
*/
|
|
30
|
+
export function isExternalAssetPickerUrl(
|
|
31
|
+
value: string,
|
|
32
|
+
currentOrigin: string,
|
|
33
|
+
): boolean {
|
|
34
|
+
try {
|
|
35
|
+
return new URL(value, currentOrigin).origin !== currentOrigin;
|
|
36
|
+
} catch {
|
|
37
|
+
// A malformed configured URL should fail closed instead of being loaded in
|
|
38
|
+
// an iframe with an unknown auth boundary.
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** Build a top-level picker URL without iframe-only auth flags. */
|
|
44
|
+
export function standaloneAssetPickerUrl(
|
|
45
|
+
value: string,
|
|
46
|
+
baseUrl = FALLBACK_BASE_URL,
|
|
47
|
+
options: StandaloneAssetPickerOptions = {},
|
|
48
|
+
): string {
|
|
49
|
+
try {
|
|
50
|
+
const parsed = new URL(value, baseUrl);
|
|
51
|
+
parsed.searchParams.delete("embedded");
|
|
52
|
+
parsed.searchParams.delete("__an_embed_token");
|
|
53
|
+
parsed.searchParams.set("mediaType", "image");
|
|
54
|
+
let returnOrigin: string | null = null;
|
|
55
|
+
if (options.returnOrigin) {
|
|
56
|
+
try {
|
|
57
|
+
const parsedOrigin = new URL(options.returnOrigin);
|
|
58
|
+
if (
|
|
59
|
+
parsedOrigin.protocol === "http:" ||
|
|
60
|
+
parsedOrigin.protocol === "https:"
|
|
61
|
+
) {
|
|
62
|
+
returnOrigin = parsedOrigin.origin;
|
|
63
|
+
}
|
|
64
|
+
} catch {
|
|
65
|
+
// Omit an invalid return target rather than emitting an unverified
|
|
66
|
+
// cross-origin callback URL.
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
if (options.handoffId && returnOrigin) {
|
|
70
|
+
parsed.searchParams.set(ASSET_PICKER_HANDOFF_PARAM, options.handoffId);
|
|
71
|
+
parsed.searchParams.set(ASSET_PICKER_RETURN_ORIGIN_PARAM, returnOrigin);
|
|
72
|
+
} else {
|
|
73
|
+
parsed.searchParams.delete(ASSET_PICKER_HANDOFF_PARAM);
|
|
74
|
+
parsed.searchParams.delete(ASSET_PICKER_RETURN_ORIGIN_PARAM);
|
|
75
|
+
}
|
|
76
|
+
return parsed.toString();
|
|
77
|
+
} catch {
|
|
78
|
+
return value;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { SimpleTextAttachmentAdapter } from "@assistant-ui/react";
|
|
2
|
+
|
|
3
|
+
const BASE_DOCUMENT_ATTACHMENT_ACCEPT = [
|
|
4
|
+
"application/pdf",
|
|
5
|
+
"application/vnd.openxmlformats-officedocument.presentationml.presentation",
|
|
6
|
+
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
|
|
7
|
+
".pdf",
|
|
8
|
+
".pptx",
|
|
9
|
+
".docx",
|
|
10
|
+
];
|
|
11
|
+
|
|
12
|
+
export const PROMPT_DOCUMENT_ATTACHMENT_ACCEPT =
|
|
13
|
+
BASE_DOCUMENT_ATTACHMENT_ACCEPT.join(",");
|
|
14
|
+
|
|
15
|
+
export const CHAT_DOCUMENT_ATTACHMENT_ACCEPT = [
|
|
16
|
+
...BASE_DOCUMENT_ATTACHMENT_ACCEPT,
|
|
17
|
+
"image/svg+xml",
|
|
18
|
+
".svg",
|
|
19
|
+
].join(",");
|
|
20
|
+
|
|
21
|
+
export const IMAGE_ATTACHMENT_ACCEPT = [
|
|
22
|
+
"image/jpeg",
|
|
23
|
+
"image/jpg",
|
|
24
|
+
"image/png",
|
|
25
|
+
"image/gif",
|
|
26
|
+
"image/webp",
|
|
27
|
+
"image/heic",
|
|
28
|
+
"image/heif",
|
|
29
|
+
"image/avif",
|
|
30
|
+
"image/bmp",
|
|
31
|
+
"image/tiff",
|
|
32
|
+
".jpg",
|
|
33
|
+
".jpeg",
|
|
34
|
+
".png",
|
|
35
|
+
".gif",
|
|
36
|
+
".webp",
|
|
37
|
+
".heic",
|
|
38
|
+
".heif",
|
|
39
|
+
".avif",
|
|
40
|
+
".bmp",
|
|
41
|
+
".tif",
|
|
42
|
+
".tiff",
|
|
43
|
+
].join(",");
|
|
44
|
+
|
|
45
|
+
export const TEXT_ATTACHMENT_ACCEPT = [
|
|
46
|
+
"text/plain",
|
|
47
|
+
"text/html",
|
|
48
|
+
"text/markdown",
|
|
49
|
+
"text/csv",
|
|
50
|
+
"text/xml",
|
|
51
|
+
"text/json",
|
|
52
|
+
"text/css",
|
|
53
|
+
"text/yaml",
|
|
54
|
+
"application/json",
|
|
55
|
+
"application/x-yaml",
|
|
56
|
+
".txt",
|
|
57
|
+
".md",
|
|
58
|
+
".markdown",
|
|
59
|
+
".csv",
|
|
60
|
+
".json",
|
|
61
|
+
".html",
|
|
62
|
+
".htm",
|
|
63
|
+
".css",
|
|
64
|
+
".xml",
|
|
65
|
+
".yaml",
|
|
66
|
+
".yml",
|
|
67
|
+
].join(",");
|
|
68
|
+
|
|
69
|
+
export class TextAttachmentAdapter extends SimpleTextAttachmentAdapter {
|
|
70
|
+
public accept = TEXT_ATTACHMENT_ACCEPT;
|
|
71
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
const BASE_COMPOSER_DRAFT_KEY = "an-composer-draft";
|
|
2
|
+
|
|
3
|
+
export function getComposerDraftKey(scope?: string | null): string {
|
|
4
|
+
const trimmed = scope?.trim();
|
|
5
|
+
if (!trimmed) return BASE_COMPOSER_DRAFT_KEY;
|
|
6
|
+
return `${BASE_COMPOSER_DRAFT_KEY}:${encodeURIComponent(trimmed)}`;
|
|
7
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { IconFile, IconFolder } from "@tabler/icons-react";
|
|
2
|
+
import { mergeAttributes, Node } from "@tiptap/core";
|
|
3
|
+
import { NodeViewWrapper, ReactNodeViewRenderer } from "@tiptap/react";
|
|
4
|
+
|
|
5
|
+
const FileReferenceComponent = ({ node }: { node: any }) => {
|
|
6
|
+
const isFolder = node.attrs.path?.endsWith("/");
|
|
7
|
+
const cleanPath = isFolder ? node.attrs.path.slice(0, -1) : node.attrs.path;
|
|
8
|
+
const displayName = cleanPath.split("/").pop() || cleanPath;
|
|
9
|
+
|
|
10
|
+
return (
|
|
11
|
+
<NodeViewWrapper as="span" className="inline">
|
|
12
|
+
<span
|
|
13
|
+
className="inline-flex items-center gap-1 rounded-md border border-input bg-muted/50 px-1.5 py-0.5 text-xs font-medium text-foreground align-middle mx-0.5 max-w-[200px] select-none"
|
|
14
|
+
title={node.attrs.path}
|
|
15
|
+
>
|
|
16
|
+
{isFolder ? (
|
|
17
|
+
<IconFolder size={14} className="shrink-0 text-muted-foreground" />
|
|
18
|
+
) : (
|
|
19
|
+
<IconFile size={14} className="shrink-0 text-muted-foreground" />
|
|
20
|
+
)}
|
|
21
|
+
<span className="truncate">{displayName}</span>
|
|
22
|
+
</span>
|
|
23
|
+
</NodeViewWrapper>
|
|
24
|
+
);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const FileReference = Node.create({
|
|
28
|
+
name: "fileReference",
|
|
29
|
+
group: "inline",
|
|
30
|
+
inline: true,
|
|
31
|
+
selectable: true,
|
|
32
|
+
atom: true,
|
|
33
|
+
|
|
34
|
+
addAttributes() {
|
|
35
|
+
return {
|
|
36
|
+
path: { default: null },
|
|
37
|
+
source: { default: "codebase" },
|
|
38
|
+
};
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
parseHTML() {
|
|
42
|
+
return [{ tag: 'span[data-type="file-reference"]' }];
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
renderHTML({ HTMLAttributes }) {
|
|
46
|
+
return [
|
|
47
|
+
"span",
|
|
48
|
+
mergeAttributes({ "data-type": "file-reference" }, HTMLAttributes),
|
|
49
|
+
];
|
|
50
|
+
},
|
|
51
|
+
|
|
52
|
+
addNodeView() {
|
|
53
|
+
return ReactNodeViewRenderer(FileReferenceComponent);
|
|
54
|
+
},
|
|
55
|
+
});
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import {
|
|
2
|
+
IconFile,
|
|
3
|
+
IconFolder,
|
|
4
|
+
IconFileText,
|
|
5
|
+
IconCheckbox,
|
|
6
|
+
IconMail,
|
|
7
|
+
IconUser,
|
|
8
|
+
IconPresentation,
|
|
9
|
+
IconStack2,
|
|
10
|
+
IconMessageChatbot,
|
|
11
|
+
} from "@tabler/icons-react";
|
|
12
|
+
import { mergeAttributes, Node } from "@tiptap/core";
|
|
13
|
+
import { NodeViewWrapper, ReactNodeViewRenderer } from "@tiptap/react";
|
|
14
|
+
|
|
15
|
+
const iconProps = { size: 14, className: "shrink-0 text-muted-foreground" };
|
|
16
|
+
|
|
17
|
+
function MentionIcon({ icon }: { icon?: string }) {
|
|
18
|
+
switch (icon) {
|
|
19
|
+
case "folder":
|
|
20
|
+
return <IconFolder {...iconProps} />;
|
|
21
|
+
case "document":
|
|
22
|
+
return <IconFileText {...iconProps} />;
|
|
23
|
+
case "form":
|
|
24
|
+
return <IconCheckbox {...iconProps} />;
|
|
25
|
+
case "email":
|
|
26
|
+
return <IconMail {...iconProps} />;
|
|
27
|
+
case "user":
|
|
28
|
+
return <IconUser {...iconProps} />;
|
|
29
|
+
case "deck":
|
|
30
|
+
return <IconPresentation {...iconProps} />;
|
|
31
|
+
case "agent":
|
|
32
|
+
return <IconMessageChatbot {...iconProps} />;
|
|
33
|
+
case "file":
|
|
34
|
+
return <IconFile {...iconProps} />;
|
|
35
|
+
default:
|
|
36
|
+
return <IconStack2 {...iconProps} />;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const MentionReferenceComponent = ({ node }: { node: any }) => {
|
|
41
|
+
return (
|
|
42
|
+
<NodeViewWrapper as="span" className="inline">
|
|
43
|
+
<span
|
|
44
|
+
className="inline-flex items-center gap-1 rounded-md border border-input bg-muted/50 px-1.5 py-0.5 text-xs font-medium text-foreground align-middle mx-0.5 max-w-[200px] select-none"
|
|
45
|
+
title={node.attrs.refPath || node.attrs.refId || node.attrs.label}
|
|
46
|
+
>
|
|
47
|
+
<MentionIcon icon={node.attrs.icon} />
|
|
48
|
+
<span className="truncate">{node.attrs.label}</span>
|
|
49
|
+
</span>
|
|
50
|
+
</NodeViewWrapper>
|
|
51
|
+
);
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
export const MentionReference = Node.create({
|
|
55
|
+
name: "mentionReference",
|
|
56
|
+
group: "inline",
|
|
57
|
+
inline: true,
|
|
58
|
+
selectable: true,
|
|
59
|
+
atom: true,
|
|
60
|
+
|
|
61
|
+
addAttributes() {
|
|
62
|
+
return {
|
|
63
|
+
label: { default: null },
|
|
64
|
+
icon: { default: "file" },
|
|
65
|
+
source: { default: "" },
|
|
66
|
+
refType: { default: "file" },
|
|
67
|
+
refId: { default: null },
|
|
68
|
+
refPath: { default: null },
|
|
69
|
+
slotKey: { default: null },
|
|
70
|
+
slotLabel: { default: null },
|
|
71
|
+
metadata: { default: null },
|
|
72
|
+
};
|
|
73
|
+
},
|
|
74
|
+
|
|
75
|
+
parseHTML() {
|
|
76
|
+
return [{ tag: 'span[data-type="mention-reference"]' }];
|
|
77
|
+
},
|
|
78
|
+
|
|
79
|
+
renderHTML({ HTMLAttributes }) {
|
|
80
|
+
return [
|
|
81
|
+
"span",
|
|
82
|
+
mergeAttributes({ "data-type": "mention-reference" }, HTMLAttributes),
|
|
83
|
+
];
|
|
84
|
+
},
|
|
85
|
+
|
|
86
|
+
renderText({ node }) {
|
|
87
|
+
return `@${node.attrs.label}`;
|
|
88
|
+
},
|
|
89
|
+
|
|
90
|
+
addNodeView() {
|
|
91
|
+
return ReactNodeViewRenderer(MentionReferenceComponent);
|
|
92
|
+
},
|
|
93
|
+
});
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { IconStack2 } from "@tabler/icons-react";
|
|
2
|
+
import { mergeAttributes, Node } from "@tiptap/core";
|
|
3
|
+
import { NodeViewWrapper, ReactNodeViewRenderer } from "@tiptap/react";
|
|
4
|
+
|
|
5
|
+
const SkillReferenceComponent = ({ node }: { node: any }) => {
|
|
6
|
+
const displayName =
|
|
7
|
+
(node.attrs.name || node.attrs.path || "")
|
|
8
|
+
.replace(/^(\.agents?\/)?skills\//, "")
|
|
9
|
+
.replace(/\/SKILL\.md$/i, "")
|
|
10
|
+
.replace(/\.md$/i, "")
|
|
11
|
+
.split("/")
|
|
12
|
+
.pop() || "skill";
|
|
13
|
+
|
|
14
|
+
return (
|
|
15
|
+
<NodeViewWrapper as="span" className="inline">
|
|
16
|
+
<span
|
|
17
|
+
className="inline-flex items-center gap-1 rounded-md border border-input bg-muted/50 px-1.5 py-0.5 text-xs font-medium text-foreground align-middle mx-0.5 max-w-[160px] select-none"
|
|
18
|
+
title={node.attrs.path}
|
|
19
|
+
>
|
|
20
|
+
<IconStack2 size={14} className="shrink-0 text-muted-foreground" />
|
|
21
|
+
<span className="truncate">{displayName}</span>
|
|
22
|
+
</span>
|
|
23
|
+
</NodeViewWrapper>
|
|
24
|
+
);
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const SkillReference = Node.create({
|
|
28
|
+
name: "skillReference",
|
|
29
|
+
group: "inline",
|
|
30
|
+
inline: true,
|
|
31
|
+
selectable: true,
|
|
32
|
+
atom: true,
|
|
33
|
+
|
|
34
|
+
addAttributes() {
|
|
35
|
+
return {
|
|
36
|
+
name: { default: null },
|
|
37
|
+
path: { default: null },
|
|
38
|
+
source: { default: "codebase" },
|
|
39
|
+
};
|
|
40
|
+
},
|
|
41
|
+
|
|
42
|
+
parseHTML() {
|
|
43
|
+
return [{ tag: 'span[data-type="skill-reference"]' }];
|
|
44
|
+
},
|
|
45
|
+
|
|
46
|
+
renderHTML({ HTMLAttributes }) {
|
|
47
|
+
return [
|
|
48
|
+
"span",
|
|
49
|
+
mergeAttributes({ "data-type": "skill-reference" }, HTMLAttributes),
|
|
50
|
+
];
|
|
51
|
+
},
|
|
52
|
+
|
|
53
|
+
addNodeView() {
|
|
54
|
+
return ReactNodeViewRenderer(SkillReferenceComponent);
|
|
55
|
+
},
|
|
56
|
+
});
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
export { FileReference } from "./extensions/FileReference.js";
|
|
2
|
+
export { SkillReference } from "./extensions/SkillReference.js";
|
|
3
|
+
export { MentionReference } from "./extensions/MentionReference.js";
|
|
4
|
+
export {
|
|
5
|
+
AgentComposerFrame,
|
|
6
|
+
type AgentComposerFrameProps,
|
|
7
|
+
} from "./AgentComposerFrame.js";
|
|
8
|
+
export {
|
|
9
|
+
TiptapComposer,
|
|
10
|
+
canSubmitComposerContent,
|
|
11
|
+
displayableComposerModeMessage,
|
|
12
|
+
getComposerSubmitIntentForEnterKey,
|
|
13
|
+
handleComposerFileDrop,
|
|
14
|
+
insertComposerHardBreakAndScrollIntoView,
|
|
15
|
+
type ComposerSubmitIntent,
|
|
16
|
+
type TiptapComposerHandle,
|
|
17
|
+
type TiptapComposerProps,
|
|
18
|
+
type TiptapComposerSubmitOptions,
|
|
19
|
+
} from "./TiptapComposer.js";
|
|
20
|
+
export {
|
|
21
|
+
PromptComposer,
|
|
22
|
+
type PromptComposerProps,
|
|
23
|
+
type PromptComposerFile,
|
|
24
|
+
type PromptComposerSubmitOptions,
|
|
25
|
+
} from "./PromptComposer.js";
|
|
26
|
+
export {
|
|
27
|
+
RealtimeVoiceModeDock,
|
|
28
|
+
RealtimeVoiceModeEntry,
|
|
29
|
+
type RealtimeVoiceModeCopy,
|
|
30
|
+
type RealtimeVoiceModeDockProps,
|
|
31
|
+
type RealtimeVoiceModeEntryProps,
|
|
32
|
+
type RealtimeVoiceModeInlineSettings,
|
|
33
|
+
type RealtimeVoiceModeSelectSetting,
|
|
34
|
+
type RealtimeVoiceModeSettingOption,
|
|
35
|
+
type RealtimeVoiceModeState,
|
|
36
|
+
} from "./RealtimeVoiceMode.js";
|
|
37
|
+
export {
|
|
38
|
+
createRealtimeVoiceSession,
|
|
39
|
+
createRealtimeVoiceSessionWithCapability,
|
|
40
|
+
executeRealtimeVoiceTool,
|
|
41
|
+
extractRealtimeVoiceFunctionCalls,
|
|
42
|
+
readRealtimeVoiceContext,
|
|
43
|
+
readRealtimeVoiceContextWith,
|
|
44
|
+
RealtimeVoiceModeBoundary,
|
|
45
|
+
RealtimeVoiceModeProvider,
|
|
46
|
+
useRealtimeVoiceMode,
|
|
47
|
+
useRealtimeVoiceModeCopy,
|
|
48
|
+
useRealtimeVoiceModeOptional,
|
|
49
|
+
type RealtimeVoiceModeApi,
|
|
50
|
+
type RealtimeVoiceModeProviderProps,
|
|
51
|
+
type RealtimeVoiceSessionAnswer,
|
|
52
|
+
type RealtimeVoiceToolResult,
|
|
53
|
+
} from "./useRealtimeVoiceMode.js";
|
|
54
|
+
export {
|
|
55
|
+
AGENT_PROMPT_MAX_INLINE_IMAGE_BYTES,
|
|
56
|
+
AGENT_PROMPT_MAX_INLINE_TEXT_CHARS,
|
|
57
|
+
escapePromptAttachmentAttribute,
|
|
58
|
+
formatPromptWithAttachments,
|
|
59
|
+
isInlineableAgentPromptFile,
|
|
60
|
+
readAgentPromptAttachment,
|
|
61
|
+
type AgentPromptAttachment,
|
|
62
|
+
type ReadAgentPromptAttachmentOptions,
|
|
63
|
+
} from "./prompt-attachments.js";
|
|
64
|
+
export { MentionPopover } from "./MentionPopover.js";
|
|
65
|
+
export { useMentionSearch } from "./use-mention-search.js";
|
|
66
|
+
export {
|
|
67
|
+
ComposerRuntimeAdaptersProvider,
|
|
68
|
+
useComposerRuntimeAdapters,
|
|
69
|
+
type ComposerRuntimeAdapters,
|
|
70
|
+
type ComposerTranslate,
|
|
71
|
+
} from "./runtime-adapters.js";
|
|
72
|
+
export type {
|
|
73
|
+
AgentComposerLayoutVariant,
|
|
74
|
+
FileResult,
|
|
75
|
+
SkillResult,
|
|
76
|
+
MentionItem,
|
|
77
|
+
Reference,
|
|
78
|
+
SlashCommand,
|
|
79
|
+
} from "./types.js";
|