@agent-native/core 0.94.0 → 0.94.2
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 +2 -2
- package/corpus/core/CHANGELOG.md +12 -0
- package/corpus/core/docs/content/cloneable-saas.mdx +15 -15
- package/corpus/core/docs/content/creating-templates.mdx +1 -1
- package/corpus/core/docs/content/extensions.mdx +1 -1
- package/corpus/core/docs/content/local-file-mode.mdx +6 -6
- package/corpus/core/docs/content/locales/ar-SA/voice-input.mdx +2 -2
- package/corpus/core/docs/content/locales/de-DE/voice-input.mdx +2 -2
- package/corpus/core/docs/content/locales/es-ES/voice-input.mdx +2 -2
- package/corpus/core/docs/content/locales/fr-FR/voice-input.mdx +2 -2
- package/corpus/core/docs/content/locales/hi-IN/voice-input.mdx +2 -2
- package/corpus/core/docs/content/locales/ja-JP/voice-input.mdx +2 -2
- package/corpus/core/docs/content/locales/ko-KR/voice-input.mdx +2 -2
- package/corpus/core/docs/content/locales/pt-BR/voice-input.mdx +2 -2
- package/corpus/core/docs/content/locales/zh-CN/voice-input.mdx +2 -2
- package/corpus/core/docs/content/locales/zh-TW/voice-input.mdx +2 -2
- package/corpus/core/docs/content/sharing.mdx +4 -4
- package/corpus/core/docs/content/template-analytics.mdx +2 -2
- package/corpus/core/docs/content/template-calendar.mdx +4 -4
- package/corpus/core/docs/content/template-clips.mdx +2 -2
- package/corpus/core/docs/content/template-content.mdx +12 -11
- package/corpus/core/docs/content/template-mail.mdx +1 -1
- package/corpus/core/docs/content/template-slides.mdx +2 -2
- package/corpus/core/docs/content/voice-input.mdx +2 -2
- package/corpus/core/docs/content/workspace.mdx +1 -1
- package/corpus/core/package.json +1 -1
- package/corpus/core/src/client/AssistantChat.tsx +75 -1
- package/corpus/core/src/client/MultiTabAssistantChat.tsx +19 -1
- package/corpus/core/src/client/agent-chat.ts +6 -0
- package/corpus/core/src/client/composer/RealtimeVoiceMode.tsx +72 -2
- package/corpus/core/src/client/composer/realtime-voice-audio-level.ts +64 -0
- package/corpus/core/src/client/composer/realtime-voice-transcript.ts +134 -0
- package/corpus/core/src/client/composer/useRealtimeVoiceMode.tsx +220 -6
- package/corpus/core/src/client/use-chat-threads.ts +33 -9
- package/corpus/core/src/templates/workspace-core/.agents/skills/voice-transcription/SKILL.md +11 -5
- package/corpus/templates/clips/app/components/player/comments-panel.tsx +98 -1
- package/corpus/templates/clips/changelog/2026-07-10-comment-urls-open-as-clickable-links.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-10-desktop-recording-uploads-now-show-a-brief-uploaded-state-wi.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-10-desktop-recordings-now-retry-saving-their-locally-captured-t.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-10-desktop-update-prompts-are-more-compact-and-easier-to-dismiss.md +6 -0
- package/corpus/templates/clips/changelog/2026-07-10-quiet-recordings-now-finish-saving-instead-of-getting-stuck.md +6 -0
- package/corpus/templates/clips/desktop/src/components/UpdateBanner.tsx +7 -4
- package/corpus/templates/clips/desktop/src/lib/recorder.ts +284 -85
- package/corpus/templates/clips/desktop/src/overlays/finalizing.tsx +148 -40
- package/corpus/templates/clips/desktop/src/overlays/meeting-notification.tsx +13 -13
- package/corpus/templates/clips/desktop/src/styles.css +83 -13
- package/corpus/templates/clips/desktop/src-tauri/src/clips/mod.rs +43 -28
- package/corpus/templates/clips/desktop/src-tauri/src/native_screen.rs +130 -65
- package/corpus/templates/clips/desktop/src-tauri/src/notifications.rs +10 -4
- package/corpus/templates/clips/server/routes/api/uploads/[recordingId]/chunk.post.ts +82 -1
- package/corpus/templates/clips/server/routes/api/uploads/[recordingId]/reset-chunks.post.ts +82 -1
- package/dist/client/AssistantChat.d.ts +6 -0
- package/dist/client/AssistantChat.d.ts.map +1 -1
- package/dist/client/AssistantChat.js +57 -1
- package/dist/client/AssistantChat.js.map +1 -1
- package/dist/client/MultiTabAssistantChat.d.ts.map +1 -1
- package/dist/client/MultiTabAssistantChat.js +9 -0
- package/dist/client/MultiTabAssistantChat.js.map +1 -1
- package/dist/client/agent-chat.d.ts +6 -0
- package/dist/client/agent-chat.d.ts.map +1 -1
- package/dist/client/agent-chat.js.map +1 -1
- package/dist/client/composer/RealtimeVoiceMode.d.ts +3 -1
- package/dist/client/composer/RealtimeVoiceMode.d.ts.map +1 -1
- package/dist/client/composer/RealtimeVoiceMode.js +32 -3
- package/dist/client/composer/RealtimeVoiceMode.js.map +1 -1
- package/dist/client/composer/realtime-voice-audio-level.d.ts +14 -0
- package/dist/client/composer/realtime-voice-audio-level.d.ts.map +1 -0
- package/dist/client/composer/realtime-voice-audio-level.js +47 -0
- package/dist/client/composer/realtime-voice-audio-level.js.map +1 -0
- package/dist/client/composer/realtime-voice-transcript.d.ts +26 -0
- package/dist/client/composer/realtime-voice-transcript.d.ts.map +1 -0
- package/dist/client/composer/realtime-voice-transcript.js +103 -0
- package/dist/client/composer/realtime-voice-transcript.js.map +1 -0
- package/dist/client/composer/useRealtimeVoiceMode.d.ts +14 -0
- package/dist/client/composer/useRealtimeVoiceMode.d.ts.map +1 -1
- package/dist/client/composer/useRealtimeVoiceMode.js +177 -6
- package/dist/client/composer/useRealtimeVoiceMode.js.map +1 -1
- package/dist/client/use-chat-threads.d.ts.map +1 -1
- package/dist/client/use-chat-threads.js +26 -6
- package/dist/client/use-chat-threads.js.map +1 -1
- package/dist/provider-api/corpus-jobs.d.ts +2 -2
- package/dist/templates/workspace-core/.agents/skills/voice-transcription/SKILL.md +11 -5
- package/docs/content/cloneable-saas.mdx +15 -15
- package/docs/content/creating-templates.mdx +1 -1
- package/docs/content/extensions.mdx +1 -1
- package/docs/content/local-file-mode.mdx +6 -6
- package/docs/content/locales/ar-SA/voice-input.mdx +2 -2
- package/docs/content/locales/de-DE/voice-input.mdx +2 -2
- package/docs/content/locales/es-ES/voice-input.mdx +2 -2
- package/docs/content/locales/fr-FR/voice-input.mdx +2 -2
- package/docs/content/locales/hi-IN/voice-input.mdx +2 -2
- package/docs/content/locales/ja-JP/voice-input.mdx +2 -2
- package/docs/content/locales/ko-KR/voice-input.mdx +2 -2
- package/docs/content/locales/pt-BR/voice-input.mdx +2 -2
- package/docs/content/locales/zh-CN/voice-input.mdx +2 -2
- package/docs/content/locales/zh-TW/voice-input.mdx +2 -2
- package/docs/content/sharing.mdx +4 -4
- package/docs/content/template-analytics.mdx +2 -2
- package/docs/content/template-calendar.mdx +4 -4
- package/docs/content/template-clips.mdx +2 -2
- package/docs/content/template-content.mdx +12 -11
- package/docs/content/template-mail.mdx +1 -1
- package/docs/content/template-slides.mdx +2 -2
- package/docs/content/voice-input.mdx +2 -2
- package/docs/content/workspace.mdx +1 -1
- package/package.json +1 -1
- package/src/templates/workspace-core/.agents/skills/voice-transcription/SKILL.md +11 -5
|
@@ -25,6 +25,7 @@ import { AgentComposerFrame } from "./composer/AgentComposerFrame.js";
|
|
|
25
25
|
import { TextAttachmentAdapter } from "./composer/attachment-accept.js";
|
|
26
26
|
import { isPastedTextAttachmentName } from "./composer/pasted-text.js";
|
|
27
27
|
import { PastedTextChip } from "./composer/PastedTextChip.js";
|
|
28
|
+
import { appendRealtimeVoiceTranscriptToRepository, realtimeVoiceTranscriptRegistry, } from "./composer/realtime-voice-transcript.js";
|
|
28
29
|
import { TiptapComposer, } from "./composer/TiptapComposer.js";
|
|
29
30
|
import { ContextMeter } from "./context-xray/ContextMeter.js";
|
|
30
31
|
import { useAgentDynamicSuggestionsResult, } from "./dynamic-suggestions.js";
|
|
@@ -120,6 +121,20 @@ export function reconnectProgressTimedOut(args) {
|
|
|
120
121
|
function activeRunMatchesThread(state, threadId) {
|
|
121
122
|
return Boolean(threadId && state?.threadId === threadId && state.runId);
|
|
122
123
|
}
|
|
124
|
+
export function assistantMessageRunId(message) {
|
|
125
|
+
const metadata = message?.metadata;
|
|
126
|
+
return typeof metadata?.custom?.runId === "string"
|
|
127
|
+
? metadata.custom.runId
|
|
128
|
+
: typeof metadata?.runId === "string"
|
|
129
|
+
? metadata.runId
|
|
130
|
+
: undefined;
|
|
131
|
+
}
|
|
132
|
+
export function shouldAcceptRunError(args) {
|
|
133
|
+
if (!args.errorRunId)
|
|
134
|
+
return true;
|
|
135
|
+
const expectedRunId = args.activeRunId ?? args.latestAssistantRunId;
|
|
136
|
+
return !expectedRunId || args.errorRunId === expectedRunId;
|
|
137
|
+
}
|
|
123
138
|
function isAssistantUiDuplicateMessageIdError(error) {
|
|
124
139
|
const message = error instanceof Error ? error.message : String(error ?? "");
|
|
125
140
|
return (message.includes("MessageRepository") &&
|
|
@@ -1395,6 +1410,25 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
|
|
|
1395
1410
|
}
|
|
1396
1411
|
}, [apiUrl, importThreadData, loadHistoryRepository, threadId]);
|
|
1397
1412
|
const exportCleanThreadRepo = useCallback(() => ensureMessageMetadata(normalizeThreadRepository(threadRuntime.export())), [threadRuntime]);
|
|
1413
|
+
const appendRealtimeVoiceTranscript = useCallback((transcript) => {
|
|
1414
|
+
if (isRestoring || isRunning)
|
|
1415
|
+
return false;
|
|
1416
|
+
const result = appendRealtimeVoiceTranscriptToRepository(exportCleanThreadRepo(), transcript);
|
|
1417
|
+
if (!result.appended)
|
|
1418
|
+
return true;
|
|
1419
|
+
threadRuntime.import(ensureMessageMetadata(result.repository));
|
|
1420
|
+
return true;
|
|
1421
|
+
}, [exportCleanThreadRepo, isRestoring, isRunning, threadRuntime]);
|
|
1422
|
+
useEffect(() => {
|
|
1423
|
+
const transcriptThreadId = threadId ?? tabId;
|
|
1424
|
+
if (!transcriptThreadId)
|
|
1425
|
+
return;
|
|
1426
|
+
return realtimeVoiceTranscriptRegistry.register({
|
|
1427
|
+
threadId: transcriptThreadId,
|
|
1428
|
+
active: isActiveComposer,
|
|
1429
|
+
append: appendRealtimeVoiceTranscript,
|
|
1430
|
+
});
|
|
1431
|
+
}, [appendRealtimeVoiceTranscript, isActiveComposer, tabId, threadId]);
|
|
1398
1432
|
const appendThreadMessage = useCallback((message) => {
|
|
1399
1433
|
try {
|
|
1400
1434
|
threadRuntime.append(message);
|
|
@@ -2326,6 +2360,17 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
|
|
|
2326
2360
|
window.addEventListener("agent-chat:loop-limit", handler);
|
|
2327
2361
|
return () => window.removeEventListener("agent-chat:loop-limit", handler);
|
|
2328
2362
|
}, [tabId]);
|
|
2363
|
+
const latestAssistantRunId = useMemo(() => {
|
|
2364
|
+
for (let index = messages.length - 1; index >= 0; index -= 1) {
|
|
2365
|
+
const message = messages[index];
|
|
2366
|
+
if (message?.role !== "assistant")
|
|
2367
|
+
continue;
|
|
2368
|
+
const runId = assistantMessageRunId(message);
|
|
2369
|
+
if (runId)
|
|
2370
|
+
return runId;
|
|
2371
|
+
}
|
|
2372
|
+
return undefined;
|
|
2373
|
+
}, [messages]);
|
|
2329
2374
|
useEffect(() => {
|
|
2330
2375
|
const handler = (e) => {
|
|
2331
2376
|
const detail = e.detail;
|
|
@@ -2333,6 +2378,17 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
|
|
|
2333
2378
|
return;
|
|
2334
2379
|
if (!detail?.message)
|
|
2335
2380
|
return;
|
|
2381
|
+
const activeRun = getActiveRun();
|
|
2382
|
+
const activeRunId = activeRunMatchesThread(activeRun, threadId)
|
|
2383
|
+
? activeRun?.runId
|
|
2384
|
+
: undefined;
|
|
2385
|
+
if (!shouldAcceptRunError({
|
|
2386
|
+
errorRunId: detail.runId,
|
|
2387
|
+
activeRunId,
|
|
2388
|
+
latestAssistantRunId,
|
|
2389
|
+
})) {
|
|
2390
|
+
return;
|
|
2391
|
+
}
|
|
2336
2392
|
const stopped = userStoppedRunRef.current;
|
|
2337
2393
|
if (stopped &&
|
|
2338
2394
|
Date.now() - stopped.at < 10_000 &&
|
|
@@ -2350,7 +2406,7 @@ const AssistantChatInner = forwardRef(function AssistantChatInner({ emptyStateTe
|
|
|
2350
2406
|
};
|
|
2351
2407
|
window.addEventListener("agent-chat:run-error", handler);
|
|
2352
2408
|
return () => window.removeEventListener("agent-chat:run-error", handler);
|
|
2353
|
-
}, [tabId]);
|
|
2409
|
+
}, [latestAssistantRunId, tabId, threadId]);
|
|
2354
2410
|
// Real activity means the next chunk has started. Surface longer-lived
|
|
2355
2411
|
// activity such as "Still generating image" so active-run reconnects do not
|
|
2356
2412
|
// look like failures while the server is still making progress.
|