@agent-native/core 0.98.0 → 0.98.1
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 +1 -1
- package/corpus/core/CHANGELOG.md +24 -0
- package/corpus/core/package.json +2 -2
- package/corpus/core/src/action-change-marker.ts +8 -1
- package/corpus/core/src/changelog/parse.ts +8 -3
- package/corpus/core/src/client/AgentPanel.tsx +2 -3
- package/corpus/core/src/client/AssistantChat.tsx +83 -39
- package/corpus/core/src/client/analytics.ts +29 -0
- package/corpus/core/src/client/blocks/library/wireframe-kit.tsx +16 -2
- package/corpus/core/src/client/chat-model-groups.ts +28 -0
- package/corpus/core/src/client/composer/RealtimeVoiceMode.tsx +442 -85
- package/corpus/core/src/client/composer/TiptapComposer.tsx +46 -29
- package/corpus/core/src/client/composer/VoiceButton.tsx +2 -1
- package/corpus/core/src/client/composer/index.ts +5 -0
- package/corpus/core/src/client/composer/useRealtimeVoiceMode.tsx +1206 -67
- package/corpus/core/src/client/index.ts +5 -0
- package/corpus/core/src/client/progress/RunsTray.tsx +13 -1
- package/corpus/core/src/client/settings/SecretsSection.tsx +387 -266
- package/corpus/core/src/client/settings/SettingsPanel.tsx +117 -38
- package/corpus/core/src/client/use-action.ts +12 -0
- package/corpus/core/src/client/use-agent-chat-home-handoff.ts +8 -1
- package/corpus/core/src/client/use-agent-engine-configured.ts +17 -3
- package/corpus/core/src/client/use-db-sync.ts +84 -34
- package/corpus/core/src/client/use-pausing-interval.ts +14 -4
- package/corpus/core/src/integrations/scope-store.ts +1 -1
- package/corpus/core/src/integrations/usage-budget-store.ts +1 -1
- package/corpus/core/src/localization/default-messages.ts +44 -1
- package/corpus/core/src/mcp-client/workspace-servers.ts +4 -4
- package/corpus/core/src/secrets/crypto.ts +28 -8
- package/corpus/core/src/server/action-change.ts +5 -1
- package/corpus/core/src/server/action-routes.ts +8 -0
- package/corpus/core/src/server/poll.ts +1 -0
- package/corpus/core/src/server/realtime-voice.ts +299 -13
- package/corpus/core/src/styles/agent-native.css +2 -2
- package/corpus/core/src/templates/default/.agents/skills/real-time-sync/SKILL.md +2 -2
- package/corpus/core/src/templates/workspace-core/.agents/skills/real-time-sync/SKILL.md +2 -2
- package/corpus/core/src/templates/workspace-core/.agents/skills/secrets/SKILL.md +7 -3
- package/corpus/core/src/templates/workspace-core/.agents/skills/voice-transcription/SKILL.md +39 -9
- package/corpus/core/src/vite/client.ts +9 -1
- package/corpus/templates/analytics/.agents/skills/real-time-sync/SKILL.md +2 -2
- package/corpus/templates/analytics/.agents/skills/session-replay/SKILL.md +10 -5
- package/corpus/templates/analytics/AGENTS.md +9 -13
- package/corpus/templates/analytics/actions/navigate.ts +59 -5
- package/corpus/templates/analytics/actions/view-screen.ts +3 -6
- package/corpus/templates/analytics/app/components/ProviderCorpusJobNotifier.tsx +20 -3
- package/corpus/templates/analytics/app/components/dashboard/SqlChart.tsx +2 -1
- package/corpus/templates/analytics/app/components/layout/Header.tsx +1 -1
- package/corpus/templates/analytics/app/components/layout/Sidebar.tsx +21 -6
- package/corpus/templates/analytics/app/global.css +19 -20
- package/corpus/templates/analytics/app/lib/provider-corpus-job-sync.ts +26 -0
- package/corpus/templates/analytics/app/pages/Settings.tsx +35 -341
- package/corpus/templates/analytics/app/pages/monitoring/ErrorsPanel.tsx +38 -7
- package/corpus/templates/analytics/app/pages/monitoring/MonitoringPage.tsx +1 -1
- package/corpus/templates/analytics/app/pages/monitoring/errors/i18n.ts +3 -0
- package/corpus/templates/analytics/app/pages/sessions/SessionDetailPage.tsx +333 -272
- package/corpus/templates/analytics/app/pages/sessions/SessionDevToolsPanel.tsx +72 -17
- package/corpus/templates/analytics/app/pages/sessions/SessionsPage.tsx +297 -108
- package/corpus/templates/analytics/app/root.tsx +28 -8
- package/corpus/templates/analytics/changelog/2026-06-24-first-party-signup-and-pageview-panels-now-honor-dashboard-filters.md +2 -1
- package/corpus/templates/analytics/changelog/2026-06-25-referrer-dashboard-panels-show-external-domains.md +2 -1
- package/corpus/templates/analytics/changelog/2026-07-06-mobile-chat-header-is-more-compact-and-the-menu-button-opens-navigation.md +1 -0
- package/corpus/templates/analytics/changelog/2026-07-08-dashboard-history-and-chat-context.md +1 -0
- package/corpus/templates/analytics/changelog/2026-07-08-settings-are-cleaner-searchable-and-alerts-have-their-own-tab.md +1 -0
- package/corpus/templates/analytics/changelog/2026-07-08-sidebar-sections-stay-collapsed-until-opened.md +1 -0
- package/corpus/templates/analytics/changelog/2026-07-11-analytics-no-longer-repeatedly-restarts-background-requests-.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-analytics-only-asks-for-replay-storage-when-you-enable-sessi.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-charts-now-show-their-loading-skeleton-while-refreshing.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-realtime-voice-now-shows-a-clear-connection-indicator-comple.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-replay-event-counts-stay-hidden-until-recordings-finish-load.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-replay-storage-key-mismatches-show-actionable-setup-guidance.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-replay-timelines-group-continuous-scrolling-and-dev-tools-co.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-session-filters-now-stay-compact-in-a-settings-menu-at-mediu.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-session-replay-console-errors-now-link-to-matching-issues-or.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-session-replays-load-large-recordings-faster-and-surface-fai.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-session-replays-preserve-recorded-styles-and-viewport-layout.md +6 -0
- package/corpus/templates/analytics/changelog/2026-07-11-session-replays-stay-centered-instead-of-clipping-wide-recor.md +6 -0
- package/corpus/templates/analytics/package.json +1 -1
- package/corpus/templates/analytics/seeds/dashboards/agent-native-templates-first-party.json +1 -303
- package/corpus/templates/analytics/server/handlers/session-replay.ts +57 -0
- package/corpus/templates/analytics/server/lib/dashboard-catalog.ts +1 -1
- package/corpus/templates/analytics/server/lib/demo-dashboards.ts +16 -3
- package/corpus/templates/analytics/server/lib/session-replay-agent-context.ts +12 -0
- package/corpus/templates/analytics/server/lib/session-replay.ts +208 -2
- package/corpus/templates/analytics/server/plugins/onboarding.ts +7 -79
- package/corpus/templates/analytics/server/routes/api/session-replay/recordings/[recordingId]/chunks.get.ts +1 -0
- package/corpus/templates/assets/.agents/skills/real-time-sync/SKILL.md +2 -2
- package/corpus/templates/assets/app/global.css +4 -4
- package/corpus/templates/assets/app/routes/brand-kits.$id.tsx +0 -1
- package/corpus/templates/assets/app/routes/library.tsx +0 -1
- package/corpus/templates/brain/.agents/skills/real-time-sync/SKILL.md +2 -2
- package/corpus/templates/brain/app/global.css +5 -5
- package/corpus/templates/brain/app/root.tsx +0 -3
- package/corpus/templates/calendar/.agents/skills/real-time-sync/SKILL.md +2 -2
- package/corpus/templates/calendar/app/root.tsx +1 -0
- package/corpus/templates/chat/.agents/skills/real-time-sync/SKILL.md +2 -2
- package/corpus/templates/clips/app/hooks/use-auto-title.ts +74 -8
- package/corpus/templates/clips/app/hooks/use-library.ts +12 -25
- package/corpus/templates/clips/app/routes/_app.settings._index.tsx +20 -22
- package/corpus/templates/clips/changelog/2026-07-11-generated-titles-no-longer-cause-continuous-background-refreshes.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-11-s3-storage-setup-stays-collapsed-until-you-choose-it-as-the-.md +6 -0
- package/corpus/templates/content/.agents/skills/real-time-sync/SKILL.md +2 -2
- package/corpus/templates/content/app/hooks/use-comments.ts +0 -1
- package/corpus/templates/content/changelog/2026-07-11-comments-now-update-from-live-collaboration-events-without-c.md +6 -0
- package/corpus/templates/design/app/components/layout/Header.tsx +1 -1
- package/corpus/templates/forms/.agents/skills/real-time-sync/SKILL.md +2 -2
- package/corpus/templates/macros/app/components/layout/AppLayout.tsx +1 -2
- package/corpus/templates/macros/app/root.tsx +0 -3
- package/corpus/templates/mail/.agents/skills/real-time-sync/SKILL.md +2 -2
- package/corpus/templates/mail/app/hooks/use-compose-state.ts +1 -0
- package/corpus/templates/mail/app/root.tsx +1 -12
- package/corpus/templates/plan/.agents/skills/real-time-sync/SKILL.md +2 -2
- package/corpus/templates/plan/app/hooks/use-navigation-state.ts +5 -2
- package/corpus/templates/plan/app/hooks/use-plans.ts +6 -13
- package/corpus/templates/plan/app/pages/PlansPage.tsx +5 -27
- package/corpus/templates/plan/changelog/2026-07-11-plan-refreshes-only-when-content-changes.md +6 -0
- package/corpus/templates/slides/app/components/comments/SlideCommentsPanel.tsx +4 -1
- package/corpus/templates/slides/app/components/editor/EditorToolbar.tsx +1 -1
- package/corpus/templates/slides/app/components/layout/Header.tsx +1 -1
- package/corpus/templates/slides/app/context/DeckContext.tsx +1 -0
- package/corpus/templates/slides/app/hooks/use-slide-comments.ts +7 -31
- package/corpus/templates/slides/changelog/2026-07-11-comments-now-update-from-live-collaboration-events-without-c.md +6 -0
- package/dist/action-change-marker.d.ts +1 -0
- package/dist/action-change-marker.d.ts.map +1 -1
- package/dist/action-change-marker.js +7 -1
- package/dist/action-change-marker.js.map +1 -1
- package/dist/changelog/parse.d.ts +4 -2
- package/dist/changelog/parse.d.ts.map +1 -1
- package/dist/changelog/parse.js +5 -3
- package/dist/changelog/parse.js.map +1 -1
- package/dist/client/AgentPanel.d.ts.map +1 -1
- package/dist/client/AgentPanel.js +2 -3
- package/dist/client/AgentPanel.js.map +1 -1
- package/dist/client/AssistantChat.d.ts +7 -0
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +62 -40
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/analytics.d.ts.map +1 -1
- package/dist/client/analytics.js +26 -0
- package/dist/client/analytics.js.map +1 -1
- package/dist/client/blocks/library/wireframe-kit.d.ts +2 -0
- package/dist/client/blocks/library/wireframe-kit.d.ts.map +1 -1
- package/dist/client/blocks/library/wireframe-kit.js +9 -2
- package/dist/client/blocks/library/wireframe-kit.js.map +1 -1
- package/dist/client/chat-model-groups.d.ts.map +1 -1
- package/dist/client/chat-model-groups.js +24 -0
- package/dist/client/chat-model-groups.js.map +1 -1
- package/dist/client/composer/RealtimeVoiceMode.d.ts +40 -4
- package/dist/client/composer/RealtimeVoiceMode.d.ts.map +1 -1
- package/dist/client/composer/RealtimeVoiceMode.js +172 -42
- package/dist/client/composer/RealtimeVoiceMode.js.map +1 -1
- package/dist/client/composer/TiptapComposer.d.ts +4 -0
- package/dist/client/composer/TiptapComposer.d.ts.map +1 -1
- package/dist/client/composer/TiptapComposer.js +47 -29
- package/dist/client/composer/TiptapComposer.js.map +1 -1
- package/dist/client/composer/VoiceButton.d.ts.map +1 -1
- package/dist/client/composer/VoiceButton.js +2 -2
- package/dist/client/composer/VoiceButton.js.map +1 -1
- package/dist/client/composer/index.d.ts +2 -2
- package/dist/client/composer/index.d.ts.map +1 -1
- package/dist/client/composer/index.js +1 -1
- package/dist/client/composer/index.js.map +1 -1
- package/dist/client/composer/useRealtimeVoiceMode.d.ts +100 -3
- package/dist/client/composer/useRealtimeVoiceMode.d.ts.map +1 -1
- package/dist/client/composer/useRealtimeVoiceMode.js +952 -51
- package/dist/client/composer/useRealtimeVoiceMode.js.map +1 -1
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.d.ts.map +1 -1
- package/dist/client/index.js +1 -1
- package/dist/client/index.js.map +1 -1
- package/dist/client/progress/RunsTray.d.ts.map +1 -1
- package/dist/client/progress/RunsTray.js +10 -1
- package/dist/client/progress/RunsTray.js.map +1 -1
- package/dist/client/settings/SecretsSection.d.ts +2 -3
- package/dist/client/settings/SecretsSection.d.ts.map +1 -1
- package/dist/client/settings/SecretsSection.js +46 -22
- package/dist/client/settings/SecretsSection.js.map +1 -1
- package/dist/client/settings/SettingsPanel.d.ts +9 -0
- package/dist/client/settings/SettingsPanel.d.ts.map +1 -1
- package/dist/client/settings/SettingsPanel.js +46 -12
- package/dist/client/settings/SettingsPanel.js.map +1 -1
- package/dist/client/use-action.d.ts +2 -0
- package/dist/client/use-action.d.ts.map +1 -1
- package/dist/client/use-action.js +10 -0
- package/dist/client/use-action.js.map +1 -1
- package/dist/client/use-agent-chat-home-handoff.d.ts +2 -0
- package/dist/client/use-agent-chat-home-handoff.d.ts.map +1 -1
- package/dist/client/use-agent-chat-home-handoff.js +7 -1
- package/dist/client/use-agent-chat-home-handoff.js.map +1 -1
- package/dist/client/use-agent-engine-configured.d.ts.map +1 -1
- package/dist/client/use-agent-engine-configured.js +17 -3
- package/dist/client/use-agent-engine-configured.js.map +1 -1
- package/dist/client/use-db-sync.d.ts +8 -2
- package/dist/client/use-db-sync.d.ts.map +1 -1
- package/dist/client/use-db-sync.js +57 -32
- package/dist/client/use-db-sync.js.map +1 -1
- package/dist/client/use-pausing-interval.d.ts.map +1 -1
- package/dist/client/use-pausing-interval.js +16 -4
- package/dist/client/use-pausing-interval.js.map +1 -1
- package/dist/integrations/scope-store.js +1 -1
- package/dist/integrations/scope-store.js.map +1 -1
- package/dist/integrations/usage-budget-store.js +1 -1
- package/dist/integrations/usage-budget-store.js.map +1 -1
- package/dist/localization/default-messages.d.ts +41 -1
- package/dist/localization/default-messages.d.ts.map +1 -1
- package/dist/localization/default-messages.js +41 -1
- package/dist/localization/default-messages.js.map +1 -1
- package/dist/mcp-client/workspace-servers.js +4 -4
- package/dist/mcp-client/workspace-servers.js.map +1 -1
- package/dist/observability/routes.d.ts +5 -5
- package/dist/provider-api/corpus-jobs.d.ts +2 -2
- package/dist/secrets/crypto.d.ts +7 -6
- package/dist/secrets/crypto.d.ts.map +1 -1
- package/dist/secrets/crypto.js +30 -11
- package/dist/secrets/crypto.js.map +1 -1
- package/dist/secrets/routes.d.ts +9 -9
- package/dist/server/action-change.d.ts +1 -0
- package/dist/server/action-change.d.ts.map +1 -1
- package/dist/server/action-change.js +4 -1
- package/dist/server/action-change.js.map +1 -1
- package/dist/server/action-routes.d.ts.map +1 -1
- package/dist/server/action-routes.js +5 -0
- package/dist/server/action-routes.js.map +1 -1
- package/dist/server/agent-engine-api-key-route.d.ts +1 -1
- package/dist/server/poll.d.ts.map +1 -1
- package/dist/server/poll.js +1 -0
- package/dist/server/poll.js.map +1 -1
- package/dist/server/realtime-voice.d.ts +7 -0
- package/dist/server/realtime-voice.d.ts.map +1 -1
- package/dist/server/realtime-voice.js +222 -12
- package/dist/server/realtime-voice.js.map +1 -1
- package/dist/styles/agent-native.css +2 -2
- package/dist/templates/default/.agents/skills/real-time-sync/SKILL.md +2 -2
- package/dist/templates/workspace-core/.agents/skills/real-time-sync/SKILL.md +2 -2
- package/dist/templates/workspace-core/.agents/skills/secrets/SKILL.md +7 -3
- package/dist/templates/workspace-core/.agents/skills/voice-transcription/SKILL.md +39 -9
- package/dist/vite/client.d.ts.map +1 -1
- package/dist/vite/client.js +6 -1
- package/dist/vite/client.js.map +1 -1
- package/package.json +2 -2
- package/src/templates/default/.agents/skills/real-time-sync/SKILL.md +2 -2
- package/src/templates/workspace-core/.agents/skills/real-time-sync/SKILL.md +2 -2
- package/src/templates/workspace-core/.agents/skills/secrets/SKILL.md +7 -3
- package/src/templates/workspace-core/.agents/skills/voice-transcription/SKILL.md +39 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TiptapComposer.d.ts","sourceRoot":"","sources":["../../../src/client/composer/TiptapComposer.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAGlD,OAAO,KAON,MAAM,OAAO,CAAC;AAEf,OAAO,EAKL,KAAK,eAAe,EACrB,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EACL,sBAAsB,EAItB,KAAK,oBAAoB,EAI1B,MAAM,kBAAkB,CAAC;AA0B1B,OAAO,KAAK,EAEV,WAAW,EACX,SAAS,EACT,YAAY,EAEZ,0BAA0B,EAC3B,MAAM,YAAY,CAAC;AAMpB,MAAM,WAAW,oBAAoB;IACnC,KAAK,IAAI,IAAI,C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M,4BAA4B;;;CAGV,CAAC;AAoDhC,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAQ9D;AAED,wBAAgB,mCAAmC,CACjD,MAAM,EAAE,eAAe,GACtB,MAAM,CAKR;AA8BD;;;;;;GAMG;AACH,MAAM,WAAW,sBAAsB;IACrC,2DAA2D;IAC3D,KAAK,EAAE,MAAM,CAAC;IACd,oDAAoD;IACpD,OAAO,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACjD,sDAAsD;IACtD,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC,iDAAiD;IACjD,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,iCAAiC,CAC/C,KAAK,EAAE,MAAM,GACZ,eAAe,EAAE,CAInB;AA8WD,wBAAgB,cAAc,CAAC,EAC7B,WAAgC,EAChC,QAAgB,EAChB,QAAQ,EACR,WAAW,EACX,cAAc,EACd,QAAQ,EACR,cAAc,EACd,aAAoB,EACpB,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,UAAU,EACV,YAAY,EACZ,WAAW,EACX,WAAW,EACX,aAAyB,EACzB,aAAkB,EAClB,WAAgB,EAChB,2BAAkC,EAClC,yBAAgC,EAChC,cAAc,EACd,QAAQ,EACR,gBAAgB,EAChB,gBAAwB,EACxB,sBAAsB,EACtB,YAA8C,EAC9C,aAAa,EACb,cAAc,EACd,eAAe,EACf,aAAa,EACb,cAAc,EACd,4BAA4B,EAC5B,iBAAiB,EACjB,cAAc,EACd,UAAU,EACV,YAAiB,EACjB,mBAAmB,EACnB,YAAqB,EACrB,gCAAwC,EACxC,iBAAiB,GAClB,EAAE,mBAAmB,
|
|
1
|
+
{"version":3,"file":"TiptapComposer.d.ts","sourceRoot":"","sources":["../../../src/client/composer/TiptapComposer.tsx"],"names":[],"mappings":"AAgBA,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,aAAoB,EACpB,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,UAAU,EACV,YAAY,EACZ,WAAW,EACX,WAAW,EACX,aAAyB,EACzB,aAAkB,EAClB,WAAgB,EAChB,2BAAkC,EAClC,yBAAgC,EAChC,cAAc,EACd,QAAQ,EACR,gBAAgB,EAChB,gBAAwB,EACxB,sBAAsB,EACtB,YAA8C,EAC9C,aAAa,EACb,cAAc,EACd,eAAe,EACf,aAAa,EACb,cAAc,EACd,4BAA4B,EAC5B,iBAAiB,EACjB,cAAc,EACd,UAAU,EACV,YAAiB,EACjB,mBAAmB,EACnB,YAAqB,EACrB,gCAAwC,EACxC,iBAAiB,GAClB,EAAE,mBAAmB,qBAy6CrB"}
|
|
@@ -357,6 +357,10 @@ function plainTextToDoc(text) {
|
|
|
357
357
|
})),
|
|
358
358
|
};
|
|
359
359
|
}
|
|
360
|
+
/** Tiptap keeps the Editor object truthy after destroy but clears commandManager. */
|
|
361
|
+
export function isComposerEditorUsable(editor) {
|
|
362
|
+
return Boolean(editor && editor.isDestroyed !== true);
|
|
363
|
+
}
|
|
360
364
|
export function createTiptapComposerExtensions(getPlaceholder) {
|
|
361
365
|
return [
|
|
362
366
|
StarterKit.configure({
|
|
@@ -1028,14 +1032,14 @@ export function TiptapComposer({ placeholder = "Message agent...", disabled = fa
|
|
|
1028
1032
|
// its existing draft when the host starts observing it so contextual UI is
|
|
1029
1033
|
// correct immediately after a tab switch, not only after the next keystroke.
|
|
1030
1034
|
useEffect(() => {
|
|
1031
|
-
if (!editor || !onTextChange)
|
|
1035
|
+
if (!isComposerEditorUsable(editor) || !onTextChange)
|
|
1032
1036
|
return;
|
|
1033
1037
|
onTextChange(editor.state.doc.textContent.trim());
|
|
1034
1038
|
}, [editor, onTextChange]);
|
|
1035
1039
|
const insertReference = useCallback((ref) => {
|
|
1036
1040
|
const normalized = normalizeAgentComposerReference(ref);
|
|
1037
1041
|
const ed = editor;
|
|
1038
|
-
if (!normalized || !ed)
|
|
1042
|
+
if (!normalized || !isComposerEditorUsable(ed))
|
|
1039
1043
|
return;
|
|
1040
1044
|
if (normalized.slotKey) {
|
|
1041
1045
|
setSlotReferences((current) => applySlotReferenceChanges(current, [normalized]));
|
|
@@ -1065,7 +1069,7 @@ export function TiptapComposer({ placeholder = "Message agent...", disabled = fa
|
|
|
1065
1069
|
seenReferenceInsertIdsRef.current.add(insertMessageId);
|
|
1066
1070
|
}
|
|
1067
1071
|
const ed = editor;
|
|
1068
|
-
if (!ed || disabled || composerModeRef.current)
|
|
1072
|
+
if (!isComposerEditorUsable(ed) || disabled || composerModeRef.current)
|
|
1069
1073
|
return;
|
|
1070
1074
|
const normalized = normalizeAgentComposerReference(payload);
|
|
1071
1075
|
if (normalized?.slotKey) {
|
|
@@ -1120,10 +1124,11 @@ export function TiptapComposer({ placeholder = "Message agent...", disabled = fa
|
|
|
1120
1124
|
}, [insertReferenceIfEmpty]);
|
|
1121
1125
|
useImperativeHandle(focusRef, () => ({
|
|
1122
1126
|
focus() {
|
|
1123
|
-
editor
|
|
1127
|
+
if (isComposerEditorUsable(editor))
|
|
1128
|
+
editor.commands.focus("end");
|
|
1124
1129
|
},
|
|
1125
1130
|
setText(text) {
|
|
1126
|
-
if (!editor)
|
|
1131
|
+
if (!isComposerEditorUsable(editor))
|
|
1127
1132
|
return;
|
|
1128
1133
|
editor.commands.setContent(plainTextToDoc(text));
|
|
1129
1134
|
editor.commands.focus("end");
|
|
@@ -1147,14 +1152,17 @@ export function TiptapComposer({ placeholder = "Message agent...", disabled = fa
|
|
|
1147
1152
|
const handleSelectMode = useCallback((mode) => {
|
|
1148
1153
|
setComposerMode(mode);
|
|
1149
1154
|
composerModeRef.current = mode;
|
|
1150
|
-
setTimeout(() =>
|
|
1155
|
+
setTimeout(() => {
|
|
1156
|
+
if (isComposerEditorUsable(editor))
|
|
1157
|
+
editor.commands.focus("end");
|
|
1158
|
+
}, 50);
|
|
1151
1159
|
}, [editor]);
|
|
1152
1160
|
// --- Live voice transcription: text appears in the editor as the user speaks ---
|
|
1153
1161
|
const voiceAnchorRef = useRef(null);
|
|
1154
1162
|
const prevVoiceInsertRef = useRef("");
|
|
1155
1163
|
const handleLiveUpdate = useCallback((finalText, interimText) => {
|
|
1156
1164
|
const ed = editor;
|
|
1157
|
-
if (!ed)
|
|
1165
|
+
if (!isComposerEditorUsable(ed))
|
|
1158
1166
|
return;
|
|
1159
1167
|
if (voiceAnchorRef.current == null) {
|
|
1160
1168
|
const { from } = ed.state.selection;
|
|
@@ -1178,7 +1186,7 @@ export function TiptapComposer({ placeholder = "Message agent...", disabled = fa
|
|
|
1178
1186
|
}, [editor]);
|
|
1179
1187
|
const insertTranscript = useCallback((text) => {
|
|
1180
1188
|
const ed = editor;
|
|
1181
|
-
if (!ed)
|
|
1189
|
+
if (!isComposerEditorUsable(ed))
|
|
1182
1190
|
return;
|
|
1183
1191
|
const anchor = voiceAnchorRef.current;
|
|
1184
1192
|
if (anchor != null) {
|
|
@@ -1221,7 +1229,7 @@ export function TiptapComposer({ placeholder = "Message agent...", disabled = fa
|
|
|
1221
1229
|
value: selectedReferences,
|
|
1222
1230
|
});
|
|
1223
1231
|
}
|
|
1224
|
-
const draft = editor
|
|
1232
|
+
const draft = isComposerEditorUsable(editor)
|
|
1225
1233
|
? trimVoiceContextValue(editor.state.doc.textContent, 1200)
|
|
1226
1234
|
: null;
|
|
1227
1235
|
if (draft)
|
|
@@ -1254,7 +1262,7 @@ export function TiptapComposer({ placeholder = "Message agent...", disabled = fa
|
|
|
1254
1262
|
if (voice.state === "idle" && voiceAnchorRef.current != null) {
|
|
1255
1263
|
const anchor = voiceAnchorRef.current;
|
|
1256
1264
|
const prevLen = prevVoiceInsertRef.current.length;
|
|
1257
|
-
if (editor && prevLen > 0) {
|
|
1265
|
+
if (isComposerEditorUsable(editor) && prevLen > 0) {
|
|
1258
1266
|
editor
|
|
1259
1267
|
.chain()
|
|
1260
1268
|
.deleteRange({ from: anchor, to: anchor + prevLen })
|
|
@@ -1298,7 +1306,7 @@ export function TiptapComposer({ placeholder = "Message agent...", disabled = fa
|
|
|
1298
1306
|
}, [voiceEnabled, voice]);
|
|
1299
1307
|
const extractComposerPayload = useCallback(() => {
|
|
1300
1308
|
const ed = editor;
|
|
1301
|
-
if (!ed) {
|
|
1309
|
+
if (!isComposerEditorUsable(ed)) {
|
|
1302
1310
|
return {
|
|
1303
1311
|
text: slotReferences.map((ref) => slotReferenceTitle(ref)).join(", "),
|
|
1304
1312
|
references: slotReferences.map(referenceFromComposerReference),
|
|
@@ -1412,7 +1420,7 @@ export function TiptapComposer({ placeholder = "Message agent...", disabled = fa
|
|
|
1412
1420
|
}, [extractComposerPayload, syncComposerRuntimeState]);
|
|
1413
1421
|
const clearEditorAfterSubmit = useCallback(() => {
|
|
1414
1422
|
const ed = editor;
|
|
1415
|
-
if (!ed)
|
|
1423
|
+
if (!isComposerEditorUsable(ed))
|
|
1416
1424
|
return;
|
|
1417
1425
|
ed.commands.clearContent();
|
|
1418
1426
|
setEditorHasText(false);
|
|
@@ -1426,7 +1434,7 @@ export function TiptapComposer({ placeholder = "Message agent...", disabled = fa
|
|
|
1426
1434
|
}, [closePopover, draftKey, editor, resetComposerRuntimeState]);
|
|
1427
1435
|
const submitComposer = useCallback(async (intent = "immediate") => {
|
|
1428
1436
|
const ed = editor;
|
|
1429
|
-
if (!ed)
|
|
1437
|
+
if (!isComposerEditorUsable(ed))
|
|
1430
1438
|
return;
|
|
1431
1439
|
if (submitInFlightRef.current)
|
|
1432
1440
|
return;
|
|
@@ -1481,6 +1489,8 @@ export function TiptapComposer({ placeholder = "Message agent...", disabled = fa
|
|
|
1481
1489
|
submitInFlightRef.current = false;
|
|
1482
1490
|
}
|
|
1483
1491
|
}
|
|
1492
|
+
if (!isComposerEditorUsable(ed))
|
|
1493
|
+
return;
|
|
1484
1494
|
// Composer mode: send with context via agent chat bridge
|
|
1485
1495
|
if (composerMode) {
|
|
1486
1496
|
const config = COMPOSER_MODE_CONFIGS[composerMode];
|
|
@@ -1509,7 +1519,8 @@ export function TiptapComposer({ placeholder = "Message agent...", disabled = fa
|
|
|
1509
1519
|
});
|
|
1510
1520
|
}
|
|
1511
1521
|
cancelActiveVoice();
|
|
1512
|
-
ed
|
|
1522
|
+
if (isComposerEditorUsable(ed))
|
|
1523
|
+
ed.commands.clearContent();
|
|
1513
1524
|
setEditorHasText(false);
|
|
1514
1525
|
setSlotReferences([]);
|
|
1515
1526
|
setComposerMode(null);
|
|
@@ -1537,7 +1548,8 @@ export function TiptapComposer({ placeholder = "Message agent...", disabled = fa
|
|
|
1537
1548
|
composerRuntime.send();
|
|
1538
1549
|
}
|
|
1539
1550
|
cancelActiveVoice();
|
|
1540
|
-
ed
|
|
1551
|
+
if (isComposerEditorUsable(ed))
|
|
1552
|
+
ed.commands.clearContent();
|
|
1541
1553
|
setEditorHasText(false);
|
|
1542
1554
|
setSlotReferences([]);
|
|
1543
1555
|
try {
|
|
@@ -1564,7 +1576,7 @@ export function TiptapComposer({ placeholder = "Message agent...", disabled = fa
|
|
|
1564
1576
|
// These are called from handleKeyDown which can't use React state
|
|
1565
1577
|
function selectMention(_view, pop, item) {
|
|
1566
1578
|
const ed = editor;
|
|
1567
|
-
if (!ed)
|
|
1579
|
+
if (!isComposerEditorUsable(ed))
|
|
1568
1580
|
return;
|
|
1569
1581
|
const currentPos = ed.state.selection.from;
|
|
1570
1582
|
// startPos is after the trigger char, so -1 to include the @ or /
|
|
@@ -1576,7 +1588,7 @@ export function TiptapComposer({ placeholder = "Message agent...", disabled = fa
|
|
|
1576
1588
|
}
|
|
1577
1589
|
function executeCommand(_view, pop, command) {
|
|
1578
1590
|
const ed = editor;
|
|
1579
|
-
if (!ed)
|
|
1591
|
+
if (!isComposerEditorUsable(ed))
|
|
1580
1592
|
return;
|
|
1581
1593
|
const currentPos = ed.state.selection.from;
|
|
1582
1594
|
const deleteFrom = Math.max(0, pop.startPos - 1);
|
|
@@ -1587,7 +1599,7 @@ export function TiptapComposer({ placeholder = "Message agent...", disabled = fa
|
|
|
1587
1599
|
}
|
|
1588
1600
|
function selectSkill(_view, pop, skill) {
|
|
1589
1601
|
const ed = editor;
|
|
1590
|
-
if (!ed)
|
|
1602
|
+
if (!isComposerEditorUsable(ed))
|
|
1591
1603
|
return;
|
|
1592
1604
|
const currentPos = ed.state.selection.from;
|
|
1593
1605
|
const deleteFrom = Math.max(0, pop.startPos - 1);
|
|
@@ -1605,7 +1617,7 @@ export function TiptapComposer({ placeholder = "Message agent...", disabled = fa
|
|
|
1605
1617
|
}
|
|
1606
1618
|
// Popover select handlers for click-based selection (from MentionPopover)
|
|
1607
1619
|
const handleSelectMention = useCallback((item) => {
|
|
1608
|
-
if (!editor || !popover)
|
|
1620
|
+
if (!isComposerEditorUsable(editor) || !popover)
|
|
1609
1621
|
return;
|
|
1610
1622
|
const currentPos = editor.state.selection.from;
|
|
1611
1623
|
const deleteFrom = Math.max(0, popover.startPos - 1);
|
|
@@ -1618,7 +1630,7 @@ export function TiptapComposer({ placeholder = "Message agent...", disabled = fa
|
|
|
1618
1630
|
closePopover();
|
|
1619
1631
|
}, [editor, popover, closePopover, insertReference]);
|
|
1620
1632
|
const handleSelectCommand = useCallback((command) => {
|
|
1621
|
-
if (!editor || !popover)
|
|
1633
|
+
if (!isComposerEditorUsable(editor) || !popover)
|
|
1622
1634
|
return;
|
|
1623
1635
|
const currentPos = editor.state.selection.from;
|
|
1624
1636
|
const deleteFrom = Math.max(0, popover.startPos - 1);
|
|
@@ -1631,7 +1643,7 @@ export function TiptapComposer({ placeholder = "Message agent...", disabled = fa
|
|
|
1631
1643
|
onSlashCommand?.(command.name);
|
|
1632
1644
|
}, [editor, popover, closePopover, onSlashCommand]);
|
|
1633
1645
|
const handleSelectSkill = useCallback((skill) => {
|
|
1634
|
-
if (!editor || !popover)
|
|
1646
|
+
if (!isComposerEditorUsable(editor) || !popover)
|
|
1635
1647
|
return;
|
|
1636
1648
|
const currentPos = editor.state.selection.from;
|
|
1637
1649
|
const deleteFrom = Math.max(0, popover.startPos - 1);
|
|
@@ -1649,7 +1661,7 @@ export function TiptapComposer({ placeholder = "Message agent...", disabled = fa
|
|
|
1649
1661
|
}, [editor, popover, closePopover]);
|
|
1650
1662
|
// Track query text as user types after trigger
|
|
1651
1663
|
useEffect(() => {
|
|
1652
|
-
if (!editor || !popover)
|
|
1664
|
+
if (!isComposerEditorUsable(editor) || !popover)
|
|
1653
1665
|
return;
|
|
1654
1666
|
const updateHandler = () => {
|
|
1655
1667
|
const pop = popoverStateRef.current;
|
|
@@ -1680,12 +1692,14 @@ export function TiptapComposer({ placeholder = "Message agent...", disabled = fa
|
|
|
1680
1692
|
editor.on("update", updateHandler);
|
|
1681
1693
|
editor.on("selectionUpdate", updateHandler);
|
|
1682
1694
|
return () => {
|
|
1683
|
-
editor
|
|
1684
|
-
|
|
1695
|
+
if (isComposerEditorUsable(editor)) {
|
|
1696
|
+
editor.off("update", updateHandler);
|
|
1697
|
+
editor.off("selectionUpdate", updateHandler);
|
|
1698
|
+
}
|
|
1685
1699
|
};
|
|
1686
1700
|
}, [editor, popover, closePopover]);
|
|
1687
1701
|
useEffect(() => {
|
|
1688
|
-
if (!editor)
|
|
1702
|
+
if (!isComposerEditorUsable(editor))
|
|
1689
1703
|
return;
|
|
1690
1704
|
if (composerText !== "")
|
|
1691
1705
|
return;
|
|
@@ -1694,7 +1708,7 @@ export function TiptapComposer({ placeholder = "Message agent...", disabled = fa
|
|
|
1694
1708
|
editor.commands.clearContent();
|
|
1695
1709
|
}, [composerText, editor]);
|
|
1696
1710
|
useEffect(() => {
|
|
1697
|
-
if (!editor || initialText === undefined)
|
|
1711
|
+
if (!isComposerEditorUsable(editor) || initialText === undefined)
|
|
1698
1712
|
return;
|
|
1699
1713
|
const key = initialTextKey ?? initialText;
|
|
1700
1714
|
if (initialTextKeyRef.current === key)
|
|
@@ -1718,7 +1732,7 @@ export function TiptapComposer({ placeholder = "Message agent...", disabled = fa
|
|
|
1718
1732
|
}, [composerRuntime, draftKey, editor, initialText, initialTextKey]);
|
|
1719
1733
|
// Tiptap only reads `editable` at init; prop changes need setEditable.
|
|
1720
1734
|
useEffect(() => {
|
|
1721
|
-
if (!editor)
|
|
1735
|
+
if (!isComposerEditorUsable(editor))
|
|
1722
1736
|
return;
|
|
1723
1737
|
editor.setEditable(!disabled);
|
|
1724
1738
|
if (disabled)
|
|
@@ -1736,10 +1750,14 @@ export function TiptapComposer({ placeholder = "Message agent...", disabled = fa
|
|
|
1736
1750
|
` }), composerMode && (_jsx("div", { "data-agent-composer-variant": layoutVariant, "data-agent-composer-slot": "mode-row", className: "agent-composer-mode-row px-2.5 pt-2 pb-0", children: _jsx(ComposerModeChip, { mode: composerMode, onRemove: () => {
|
|
1737
1751
|
setComposerMode(null);
|
|
1738
1752
|
composerModeRef.current = null;
|
|
1739
|
-
editor
|
|
1753
|
+
if (isComposerEditorUsable(editor)) {
|
|
1754
|
+
editor.commands.focus("end");
|
|
1755
|
+
}
|
|
1740
1756
|
} }) })), hasContextRows && (_jsxs("div", { "data-agent-composer-variant": layoutVariant, "data-agent-composer-slot": "context-row", className: "agent-composer-context-row flex flex-wrap gap-1.5 px-2.5 pt-2 pb-0", children: [slotReferences.map((ref) => (_jsxs("span", { className: "inline-flex max-w-full items-center gap-1.5 rounded-md border border-border bg-background px-2 py-1 text-[11px] font-medium text-foreground shadow-sm", children: [_jsx(IconClipboardList, { className: "h-3 w-3 shrink-0 text-muted-foreground" }), ref.slotLabel && (_jsx("span", { className: "shrink-0 text-muted-foreground", children: ref.slotLabel })), _jsx("span", { className: "min-w-0 truncate", children: ref.label }), _jsx("button", { type: "button", onClick: () => {
|
|
1741
1757
|
setSlotReferences((current) => removeSlotReference(current, ref));
|
|
1742
|
-
editor
|
|
1758
|
+
if (isComposerEditorUsable(editor)) {
|
|
1759
|
+
editor.commands.focus("end");
|
|
1760
|
+
}
|
|
1743
1761
|
}, "aria-label": `Remove ${slotReferenceTitle(ref)} reference`, className: "ms-0.5 flex h-4 w-4 shrink-0 items-center justify-center rounded text-muted-foreground hover:bg-accent hover:text-foreground", children: _jsx(IconX, { className: "h-3 w-3" }) })] }, ref.slotKey))), contextItems.map((item) => (_jsxs("span", { "data-state": selectedContextItemKey === item.key ? "selected" : undefined, className: `inline-flex max-w-full items-center gap-1.5 rounded-md border px-2 py-1 text-[11px] font-medium text-foreground ${selectedContextItemKey === item.key
|
|
1744
1762
|
? "border-ring bg-accent ring-2 ring-ring/40"
|
|
1745
1763
|
: "border-border bg-muted/50"}`, children: [_jsx(IconClipboardList, { className: "h-3 w-3 shrink-0 text-muted-foreground" }), _jsx("span", { className: "min-w-0 truncate", children: item.title }), _jsx("button", { type: "button", onClick: () => {
|