@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
|
@@ -675,6 +675,13 @@ function plainTextToDoc(text: string) {
|
|
|
675
675
|
};
|
|
676
676
|
}
|
|
677
677
|
|
|
678
|
+
/** Tiptap keeps the Editor object truthy after destroy but clears commandManager. */
|
|
679
|
+
export function isComposerEditorUsable<T extends { isDestroyed?: boolean }>(
|
|
680
|
+
editor: T | null | undefined,
|
|
681
|
+
): editor is T {
|
|
682
|
+
return Boolean(editor && editor.isDestroyed !== true);
|
|
683
|
+
}
|
|
684
|
+
|
|
678
685
|
export function createTiptapComposerExtensions(
|
|
679
686
|
getPlaceholder: () => string | undefined,
|
|
680
687
|
) {
|
|
@@ -1804,7 +1811,7 @@ export function TiptapComposer({
|
|
|
1804
1811
|
// its existing draft when the host starts observing it so contextual UI is
|
|
1805
1812
|
// correct immediately after a tab switch, not only after the next keystroke.
|
|
1806
1813
|
useEffect(() => {
|
|
1807
|
-
if (!editor || !onTextChange) return;
|
|
1814
|
+
if (!isComposerEditorUsable(editor) || !onTextChange) return;
|
|
1808
1815
|
onTextChange(editor.state.doc.textContent.trim());
|
|
1809
1816
|
}, [editor, onTextChange]);
|
|
1810
1817
|
|
|
@@ -1812,7 +1819,7 @@ export function TiptapComposer({
|
|
|
1812
1819
|
(ref: AgentComposerReference) => {
|
|
1813
1820
|
const normalized = normalizeAgentComposerReference(ref);
|
|
1814
1821
|
const ed = editor;
|
|
1815
|
-
if (!normalized || !ed) return;
|
|
1822
|
+
if (!normalized || !isComposerEditorUsable(ed)) return;
|
|
1816
1823
|
if (normalized.slotKey) {
|
|
1817
1824
|
setSlotReferences((current) =>
|
|
1818
1825
|
applySlotReferenceChanges(current, [normalized]),
|
|
@@ -1852,7 +1859,8 @@ export function TiptapComposer({
|
|
|
1852
1859
|
seenReferenceInsertIdsRef.current.add(insertMessageId);
|
|
1853
1860
|
}
|
|
1854
1861
|
const ed = editor;
|
|
1855
|
-
if (!ed || disabled || composerModeRef.current)
|
|
1862
|
+
if (!isComposerEditorUsable(ed) || disabled || composerModeRef.current)
|
|
1863
|
+
return;
|
|
1856
1864
|
const normalized = normalizeAgentComposerReference(payload);
|
|
1857
1865
|
if (normalized?.slotKey) {
|
|
1858
1866
|
insertReference(normalized);
|
|
@@ -1910,10 +1918,10 @@ export function TiptapComposer({
|
|
|
1910
1918
|
|
|
1911
1919
|
useImperativeHandle(focusRef, () => ({
|
|
1912
1920
|
focus() {
|
|
1913
|
-
editor
|
|
1921
|
+
if (isComposerEditorUsable(editor)) editor.commands.focus("end");
|
|
1914
1922
|
},
|
|
1915
1923
|
setText(text: string) {
|
|
1916
|
-
if (!editor) return;
|
|
1924
|
+
if (!isComposerEditorUsable(editor)) return;
|
|
1917
1925
|
editor.commands.setContent(plainTextToDoc(text));
|
|
1918
1926
|
editor.commands.focus("end");
|
|
1919
1927
|
const trimmed = editor.state.doc.textContent.trim();
|
|
@@ -1936,7 +1944,9 @@ export function TiptapComposer({
|
|
|
1936
1944
|
(mode: ComposerMode) => {
|
|
1937
1945
|
setComposerMode(mode);
|
|
1938
1946
|
composerModeRef.current = mode;
|
|
1939
|
-
setTimeout(() =>
|
|
1947
|
+
setTimeout(() => {
|
|
1948
|
+
if (isComposerEditorUsable(editor)) editor.commands.focus("end");
|
|
1949
|
+
}, 50);
|
|
1940
1950
|
},
|
|
1941
1951
|
[editor],
|
|
1942
1952
|
);
|
|
@@ -1948,7 +1958,7 @@ export function TiptapComposer({
|
|
|
1948
1958
|
const handleLiveUpdate = useCallback(
|
|
1949
1959
|
(finalText: string, interimText: string) => {
|
|
1950
1960
|
const ed = editor;
|
|
1951
|
-
if (!ed) return;
|
|
1961
|
+
if (!isComposerEditorUsable(ed)) return;
|
|
1952
1962
|
|
|
1953
1963
|
if (voiceAnchorRef.current == null) {
|
|
1954
1964
|
const { from } = ed.state.selection;
|
|
@@ -1980,7 +1990,7 @@ export function TiptapComposer({
|
|
|
1980
1990
|
const insertTranscript = useCallback(
|
|
1981
1991
|
(text: string) => {
|
|
1982
1992
|
const ed = editor;
|
|
1983
|
-
if (!ed) return;
|
|
1993
|
+
if (!isComposerEditorUsable(ed)) return;
|
|
1984
1994
|
|
|
1985
1995
|
const anchor = voiceAnchorRef.current;
|
|
1986
1996
|
if (anchor != null) {
|
|
@@ -2036,7 +2046,7 @@ export function TiptapComposer({
|
|
|
2036
2046
|
});
|
|
2037
2047
|
}
|
|
2038
2048
|
|
|
2039
|
-
const draft = editor
|
|
2049
|
+
const draft = isComposerEditorUsable(editor)
|
|
2040
2050
|
? trimVoiceContextValue(editor.state.doc.textContent, 1200)
|
|
2041
2051
|
: null;
|
|
2042
2052
|
if (draft) snippets.push({ label: "Current draft", value: draft });
|
|
@@ -2070,7 +2080,7 @@ export function TiptapComposer({
|
|
|
2070
2080
|
if (voice.state === "idle" && voiceAnchorRef.current != null) {
|
|
2071
2081
|
const anchor = voiceAnchorRef.current;
|
|
2072
2082
|
const prevLen = prevVoiceInsertRef.current.length;
|
|
2073
|
-
if (editor && prevLen > 0) {
|
|
2083
|
+
if (isComposerEditorUsable(editor) && prevLen > 0) {
|
|
2074
2084
|
editor
|
|
2075
2085
|
.chain()
|
|
2076
2086
|
.deleteRange({ from: anchor, to: anchor + prevLen })
|
|
@@ -2117,7 +2127,7 @@ export function TiptapComposer({
|
|
|
2117
2127
|
|
|
2118
2128
|
const extractComposerPayload = useCallback(() => {
|
|
2119
2129
|
const ed = editor;
|
|
2120
|
-
if (!ed) {
|
|
2130
|
+
if (!isComposerEditorUsable(ed)) {
|
|
2121
2131
|
return {
|
|
2122
2132
|
text: slotReferences.map((ref) => slotReferenceTitle(ref)).join(", "),
|
|
2123
2133
|
references: slotReferences.map(referenceFromComposerReference),
|
|
@@ -2247,7 +2257,7 @@ export function TiptapComposer({
|
|
|
2247
2257
|
|
|
2248
2258
|
const clearEditorAfterSubmit = useCallback(() => {
|
|
2249
2259
|
const ed = editor;
|
|
2250
|
-
if (!ed) return;
|
|
2260
|
+
if (!isComposerEditorUsable(ed)) return;
|
|
2251
2261
|
ed.commands.clearContent();
|
|
2252
2262
|
setEditorHasText(false);
|
|
2253
2263
|
setSlotReferences([]);
|
|
@@ -2261,7 +2271,7 @@ export function TiptapComposer({
|
|
|
2261
2271
|
const submitComposer = useCallback(
|
|
2262
2272
|
async (intent: ComposerSubmitIntent = "immediate") => {
|
|
2263
2273
|
const ed = editor;
|
|
2264
|
-
if (!ed) return;
|
|
2274
|
+
if (!isComposerEditorUsable(ed)) return;
|
|
2265
2275
|
if (submitInFlightRef.current) return;
|
|
2266
2276
|
|
|
2267
2277
|
const { text, references } = syncComposerState();
|
|
@@ -2321,6 +2331,7 @@ export function TiptapComposer({
|
|
|
2321
2331
|
submitInFlightRef.current = false;
|
|
2322
2332
|
}
|
|
2323
2333
|
}
|
|
2334
|
+
if (!isComposerEditorUsable(ed)) return;
|
|
2324
2335
|
|
|
2325
2336
|
// Composer mode: send with context via agent chat bridge
|
|
2326
2337
|
if (composerMode) {
|
|
@@ -2353,7 +2364,7 @@ export function TiptapComposer({
|
|
|
2353
2364
|
});
|
|
2354
2365
|
}
|
|
2355
2366
|
cancelActiveVoice();
|
|
2356
|
-
ed.commands.clearContent();
|
|
2367
|
+
if (isComposerEditorUsable(ed)) ed.commands.clearContent();
|
|
2357
2368
|
setEditorHasText(false);
|
|
2358
2369
|
setSlotReferences([]);
|
|
2359
2370
|
setComposerMode(null);
|
|
@@ -2380,7 +2391,7 @@ export function TiptapComposer({
|
|
|
2380
2391
|
composerRuntime.send();
|
|
2381
2392
|
}
|
|
2382
2393
|
cancelActiveVoice();
|
|
2383
|
-
ed.commands.clearContent();
|
|
2394
|
+
if (isComposerEditorUsable(ed)) ed.commands.clearContent();
|
|
2384
2395
|
setEditorHasText(false);
|
|
2385
2396
|
setSlotReferences([]);
|
|
2386
2397
|
try {
|
|
@@ -2413,7 +2424,7 @@ export function TiptapComposer({
|
|
|
2413
2424
|
item: MentionItem,
|
|
2414
2425
|
) {
|
|
2415
2426
|
const ed = editor;
|
|
2416
|
-
if (!ed) return;
|
|
2427
|
+
if (!isComposerEditorUsable(ed)) return;
|
|
2417
2428
|
const currentPos = ed.state.selection.from;
|
|
2418
2429
|
// startPos is after the trigger char, so -1 to include the @ or /
|
|
2419
2430
|
const deleteFrom = Math.max(0, pop.startPos - 1);
|
|
@@ -2429,7 +2440,7 @@ export function TiptapComposer({
|
|
|
2429
2440
|
command: SlashCommand,
|
|
2430
2441
|
) {
|
|
2431
2442
|
const ed = editor;
|
|
2432
|
-
if (!ed) return;
|
|
2443
|
+
if (!isComposerEditorUsable(ed)) return;
|
|
2433
2444
|
const currentPos = ed.state.selection.from;
|
|
2434
2445
|
const deleteFrom = Math.max(0, pop.startPos - 1);
|
|
2435
2446
|
ed.chain().focus().deleteRange({ from: deleteFrom, to: currentPos }).run();
|
|
@@ -2444,7 +2455,7 @@ export function TiptapComposer({
|
|
|
2444
2455
|
skill: SkillResult,
|
|
2445
2456
|
) {
|
|
2446
2457
|
const ed = editor;
|
|
2447
|
-
if (!ed) return;
|
|
2458
|
+
if (!isComposerEditorUsable(ed)) return;
|
|
2448
2459
|
const currentPos = ed.state.selection.from;
|
|
2449
2460
|
const deleteFrom = Math.max(0, pop.startPos - 1);
|
|
2450
2461
|
ed.chain()
|
|
@@ -2463,7 +2474,7 @@ export function TiptapComposer({
|
|
|
2463
2474
|
// Popover select handlers for click-based selection (from MentionPopover)
|
|
2464
2475
|
const handleSelectMention = useCallback(
|
|
2465
2476
|
(item: MentionItem) => {
|
|
2466
|
-
if (!editor || !popover) return;
|
|
2477
|
+
if (!isComposerEditorUsable(editor) || !popover) return;
|
|
2467
2478
|
const currentPos = editor.state.selection.from;
|
|
2468
2479
|
const deleteFrom = Math.max(0, popover.startPos - 1);
|
|
2469
2480
|
editor
|
|
@@ -2479,7 +2490,7 @@ export function TiptapComposer({
|
|
|
2479
2490
|
|
|
2480
2491
|
const handleSelectCommand = useCallback(
|
|
2481
2492
|
(command: SlashCommand) => {
|
|
2482
|
-
if (!editor || !popover) return;
|
|
2493
|
+
if (!isComposerEditorUsable(editor) || !popover) return;
|
|
2483
2494
|
const currentPos = editor.state.selection.from;
|
|
2484
2495
|
const deleteFrom = Math.max(0, popover.startPos - 1);
|
|
2485
2496
|
editor
|
|
@@ -2495,7 +2506,7 @@ export function TiptapComposer({
|
|
|
2495
2506
|
|
|
2496
2507
|
const handleSelectSkill = useCallback(
|
|
2497
2508
|
(skill: SkillResult) => {
|
|
2498
|
-
if (!editor || !popover) return;
|
|
2509
|
+
if (!isComposerEditorUsable(editor) || !popover) return;
|
|
2499
2510
|
const currentPos = editor.state.selection.from;
|
|
2500
2511
|
const deleteFrom = Math.max(0, popover.startPos - 1);
|
|
2501
2512
|
editor
|
|
@@ -2515,7 +2526,7 @@ export function TiptapComposer({
|
|
|
2515
2526
|
|
|
2516
2527
|
// Track query text as user types after trigger
|
|
2517
2528
|
useEffect(() => {
|
|
2518
|
-
if (!editor || !popover) return;
|
|
2529
|
+
if (!isComposerEditorUsable(editor) || !popover) return;
|
|
2519
2530
|
|
|
2520
2531
|
const updateHandler = () => {
|
|
2521
2532
|
const pop = popoverStateRef.current;
|
|
@@ -2554,20 +2565,22 @@ export function TiptapComposer({
|
|
|
2554
2565
|
editor.on("update", updateHandler);
|
|
2555
2566
|
editor.on("selectionUpdate", updateHandler);
|
|
2556
2567
|
return () => {
|
|
2557
|
-
editor
|
|
2558
|
-
|
|
2568
|
+
if (isComposerEditorUsable(editor)) {
|
|
2569
|
+
editor.off("update", updateHandler);
|
|
2570
|
+
editor.off("selectionUpdate", updateHandler);
|
|
2571
|
+
}
|
|
2559
2572
|
};
|
|
2560
2573
|
}, [editor, popover, closePopover]);
|
|
2561
2574
|
|
|
2562
2575
|
useEffect(() => {
|
|
2563
|
-
if (!editor) return;
|
|
2576
|
+
if (!isComposerEditorUsable(editor)) return;
|
|
2564
2577
|
if (composerText !== "") return;
|
|
2565
2578
|
if (editor.isEmpty) return;
|
|
2566
2579
|
editor.commands.clearContent();
|
|
2567
2580
|
}, [composerText, editor]);
|
|
2568
2581
|
|
|
2569
2582
|
useEffect(() => {
|
|
2570
|
-
if (!editor || initialText === undefined) return;
|
|
2583
|
+
if (!isComposerEditorUsable(editor) || initialText === undefined) return;
|
|
2571
2584
|
const key = initialTextKey ?? initialText;
|
|
2572
2585
|
if (initialTextKeyRef.current === key) return;
|
|
2573
2586
|
initialTextKeyRef.current = key;
|
|
@@ -2588,7 +2601,7 @@ export function TiptapComposer({
|
|
|
2588
2601
|
|
|
2589
2602
|
// Tiptap only reads `editable` at init; prop changes need setEditable.
|
|
2590
2603
|
useEffect(() => {
|
|
2591
|
-
if (!editor) return;
|
|
2604
|
+
if (!isComposerEditorUsable(editor)) return;
|
|
2592
2605
|
editor.setEditable(!disabled);
|
|
2593
2606
|
if (disabled) editor.commands.blur();
|
|
2594
2607
|
}, [editor, disabled]);
|
|
@@ -2616,7 +2629,9 @@ export function TiptapComposer({
|
|
|
2616
2629
|
onRemove={() => {
|
|
2617
2630
|
setComposerMode(null);
|
|
2618
2631
|
composerModeRef.current = null;
|
|
2619
|
-
editor
|
|
2632
|
+
if (isComposerEditorUsable(editor)) {
|
|
2633
|
+
editor.commands.focus("end");
|
|
2634
|
+
}
|
|
2620
2635
|
}}
|
|
2621
2636
|
/>
|
|
2622
2637
|
</div>
|
|
@@ -2645,7 +2660,9 @@ export function TiptapComposer({
|
|
|
2645
2660
|
setSlotReferences((current) =>
|
|
2646
2661
|
removeSlotReference(current, ref),
|
|
2647
2662
|
);
|
|
2648
|
-
editor
|
|
2663
|
+
if (isComposerEditorUsable(editor)) {
|
|
2664
|
+
editor.commands.focus("end");
|
|
2665
|
+
}
|
|
2649
2666
|
}}
|
|
2650
2667
|
aria-label={`Remove ${slotReferenceTitle(ref)} reference`}
|
|
2651
2668
|
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"
|
|
@@ -56,7 +56,7 @@ export function isRealtimeVoiceSetupRequired(
|
|
|
56
56
|
status !== null &&
|
|
57
57
|
!status.builder &&
|
|
58
58
|
!status.openai &&
|
|
59
|
-
builderConfigured
|
|
59
|
+
builderConfigured !== true
|
|
60
60
|
);
|
|
61
61
|
}
|
|
62
62
|
|
|
@@ -83,6 +83,7 @@ export function VoiceButton({ voice, isMac, disabled }: VoiceButtonProps) {
|
|
|
83
83
|
<RealtimeVoiceModeEntry
|
|
84
84
|
copy={realtimeCopy}
|
|
85
85
|
disabled={disabled}
|
|
86
|
+
providerStatusPending={voiceProviders.status === null}
|
|
86
87
|
setupRequired={isRealtimeVoiceSetupRequired(
|
|
87
88
|
voiceProviders.status,
|
|
88
89
|
builderConnect.statusResolved ? builderConnect.configured : null,
|
|
@@ -29,10 +29,14 @@ export {
|
|
|
29
29
|
type RealtimeVoiceModeCopy,
|
|
30
30
|
type RealtimeVoiceModeDockProps,
|
|
31
31
|
type RealtimeVoiceModeEntryProps,
|
|
32
|
+
type RealtimeVoiceModeInlineSettings,
|
|
33
|
+
type RealtimeVoiceModeSelectSetting,
|
|
34
|
+
type RealtimeVoiceModeSettingOption,
|
|
32
35
|
type RealtimeVoiceModeState,
|
|
33
36
|
} from "./RealtimeVoiceMode.js";
|
|
34
37
|
export {
|
|
35
38
|
createRealtimeVoiceSession,
|
|
39
|
+
createRealtimeVoiceSessionWithCapability,
|
|
36
40
|
executeRealtimeVoiceTool,
|
|
37
41
|
extractRealtimeVoiceFunctionCalls,
|
|
38
42
|
readRealtimeVoiceContext,
|
|
@@ -43,6 +47,7 @@ export {
|
|
|
43
47
|
useRealtimeVoiceModeOptional,
|
|
44
48
|
type RealtimeVoiceModeApi,
|
|
45
49
|
type RealtimeVoiceModeProviderProps,
|
|
50
|
+
type RealtimeVoiceSessionAnswer,
|
|
46
51
|
type RealtimeVoiceToolResult,
|
|
47
52
|
} from "./useRealtimeVoiceMode.js";
|
|
48
53
|
export {
|