@voicethere/agent 0.30.0 → 0.31.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/README.md +2 -0
- package/dist/agent.js +15 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/protocol.d.ts +20 -0
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js.map +1 -1
- package/dist/runtime.d.ts +26 -1
- package/dist/runtime.d.ts.map +1 -1
- package/dist/runtime.js +28 -0
- package/dist/runtime.js.map +1 -1
- package/dist/templates/echo/agent.js +15 -1
- package/dist/templates/echo-dc/agent.js +15 -1
- package/dist/templates/flow-agent/agent.js +15 -1
- package/dist/templates/game-sync/agent.js +15 -1
- package/dist/templates/language-switch/agent.js +15 -1
- package/dist/templates/llm-agent/agent.js +15 -1
- package/dist/templates/llm-board/agent.js +69 -30
- package/dist/templates/llm-docs-rag/agent.js +15 -1
- package/dist/templates/llm-language-tutor/agent.js +16 -2
- package/dist/templates/llm-mcp-service/agent.js +15 -1
- package/dist/templates/llm-support-sticky-user/agent.js +15 -1
- package/dist/templates/positional-tts/agent.js +15 -1
- package/dist/templates/recording-consent/agent.js +15 -1
- package/dist/templates/registry.d.ts.map +1 -1
- package/dist/templates/registry.js +1 -0
- package/dist/templates/registry.js.map +1 -1
- package/dist/templates/spatial-showcase/agent.js +15 -1
- package/dist/templates/speaker-gate/agent.js +15 -1
- package/dist/templates/voice-showcase/agent.js +15 -1
- package/dist/templates/voice-starter/agent.js +15 -1
- package/dist/templates/webhooks/agent.js +15 -1
- package/dist/templates/webhooks-redis/agent.js +15 -1
- package/dist/templates/world-sync/agent.js +15 -1
- package/dist/templates/world-sync-binary/agent.js +15 -1
- package/eject/llm/loop.ts +1 -1
- package/package.json +1 -1
- package/templates/llm-board/README.md +1 -1
- package/templates/llm-board/agent.ts +4 -29
- package/templates/llm-board/prompt.md +10 -2
- package/templates/llm-board/tool-specs.ts +43 -0
- package/templates/llm-board/voicethere.llm.json +1 -1
- package/templates/llm-language-tutor/prompt.md +1 -1
|
@@ -31489,7 +31489,8 @@ function speakerFieldsOf(event) {
|
|
|
31489
31489
|
...typeof e.speaker === "string" && SPEAKER_VERDICTS.includes(e.speaker) ? { speaker: e.speaker } : {},
|
|
31490
31490
|
...typeof e.speakerUnknownReason === "string" ? { speakerUnknownReason: e.speakerUnknownReason } : {},
|
|
31491
31491
|
...typeof e.speakerCheckWindows === "number" ? { speakerCheckWindows: e.speakerCheckWindows } : {},
|
|
31492
|
-
...typeof e.speakerRechecked === "boolean" ? { speakerRechecked: e.speakerRechecked } : {}
|
|
31492
|
+
...typeof e.speakerRechecked === "boolean" ? { speakerRechecked: e.speakerRechecked } : {},
|
|
31493
|
+
...e.reason === "speaker_split" || e.reason === "speaker_split_redecode_timeout" ? { reason: e.reason } : {}
|
|
31493
31494
|
};
|
|
31494
31495
|
}
|
|
31495
31496
|
function resolveUserLanguageCode(event) {
|
|
@@ -31598,6 +31599,19 @@ async function handleParentMessage(message, handlers) {
|
|
|
31598
31599
|
});
|
|
31599
31600
|
}
|
|
31600
31601
|
}
|
|
31602
|
+
if (message.event.type === "user_utterance_split") {
|
|
31603
|
+
const split = message.event;
|
|
31604
|
+
if (typeof split.fromUtteranceId === "string" && split.fromUtteranceId && typeof split.toUtteranceId === "string" && split.toUtteranceId) {
|
|
31605
|
+
await handlers.onUserUtteranceSplit?.({
|
|
31606
|
+
sessionId: message.sessionId,
|
|
31607
|
+
fromUtteranceId: split.fromUtteranceId,
|
|
31608
|
+
toUtteranceId: split.toUtteranceId,
|
|
31609
|
+
...typeof split.splitAtMs === "number" ? { splitAtMs: split.splitAtMs } : {},
|
|
31610
|
+
...typeof split.from === "string" && SPEAKER_VERDICTS.includes(split.from) ? { from: split.from } : {},
|
|
31611
|
+
...typeof split.to === "string" && SPEAKER_VERDICTS.includes(split.to) ? { to: split.to } : {}
|
|
31612
|
+
});
|
|
31613
|
+
}
|
|
31614
|
+
}
|
|
31601
31615
|
if (message.event.type === "user_language") {
|
|
31602
31616
|
const language = resolveUserLanguageCode(message.event);
|
|
31603
31617
|
if (language) {
|
|
@@ -60364,7 +60378,7 @@ var voicethere_llm_default = {
|
|
|
60364
60378
|
$schema: "./node_modules/@voicethere/agent/schema/voicethere.llm.schema.json",
|
|
60365
60379
|
version: 1,
|
|
60366
60380
|
provider: "openrouter",
|
|
60367
|
-
model: "
|
|
60381
|
+
model: "anthropic/claude-haiku-5.5",
|
|
60368
60382
|
apiKeySecret: "AGENT_OPENROUTER_API_KEY",
|
|
60369
60383
|
maxOutputTokens: 512,
|
|
60370
60384
|
greeting: {
|
|
@@ -60411,13 +60425,21 @@ var voicethere_llm_default = {
|
|
|
60411
60425
|
};
|
|
60412
60426
|
|
|
60413
60427
|
// templates/llm-board/prompt.md
|
|
60414
|
-
var prompt_default = `You are the facilitator of a shared brainstorming board. The people in the room put sticky notes on it, and you can read, add and change notes with your tools. People talk to you by voice, so everything you say is read aloud.
|
|
60428
|
+
var prompt_default = `You are the facilitator of a shared brainstorming board. The people in the room put sticky notes on it, and you can read, add and change notes with your tools. People talk to you by voice, so everything you say is read aloud. What they say reaches you as a transcript that can mishear words, for example "node" for "note"; when the board makes the meaning clear, write the word they meant.
|
|
60415
60429
|
|
|
60416
60430
|
Keep spoken replies to one or two short sentences. Do not use markdown, lists, emoji or special characters.
|
|
60417
60431
|
|
|
60432
|
+
A note has only its text, a color and a position. It has no separate title or name, so naming, renaming or rewording a note means changing its text.
|
|
60433
|
+
|
|
60418
60434
|
Call list_notes before you group, compare or summarise notes, and before you change one. Never guess what is on the board.
|
|
60419
60435
|
|
|
60420
|
-
|
|
60436
|
+
To change a note that is already on the board, use update_note with that note's id. That covers new wording, a new name, a fix, a new color or a move. Never use add_note to change a note: it would leave the old note and a second one.
|
|
60437
|
+
|
|
60438
|
+
Use add_note only for a note that is not on the board yet: when someone asks you to add one, or when you summarise. When you summarise, write one short note per theme yourself; do not ask anyone to name or word it.
|
|
60439
|
+
|
|
60440
|
+
If you asked a question about a note that is on the board, such as "What should I call it?", the answer is meant for that note, even in the middle of a summary: put it on that note with update_note and do not add a new note.
|
|
60441
|
+
|
|
60442
|
+
After a change, say briefly what you did, for example "I renamed the note to Basic note." Ask a follow-up question only when you need the answer to finish the request.
|
|
60421
60443
|
|
|
60422
60444
|
If a tool says the board is full or a note does not exist, say so plainly and suggest what to do next.
|
|
60423
60445
|
|
|
@@ -60550,6 +60572,46 @@ function parseBoardMessage(msg) {
|
|
|
60550
60572
|
}
|
|
60551
60573
|
}
|
|
60552
60574
|
|
|
60575
|
+
// templates/llm-board/tool-specs.ts
|
|
60576
|
+
var colorSchema = { type: "string", enum: [...NOTE_COLORS] };
|
|
60577
|
+
var BOARD_TOOL_SPECS = {
|
|
60578
|
+
list_notes: {
|
|
60579
|
+
name: "list_notes",
|
|
60580
|
+
description: "List every note on the shared board.",
|
|
60581
|
+
inputSchema: {
|
|
60582
|
+
type: "object",
|
|
60583
|
+
properties: {},
|
|
60584
|
+
additionalProperties: false
|
|
60585
|
+
}
|
|
60586
|
+
},
|
|
60587
|
+
add_note: {
|
|
60588
|
+
name: "add_note",
|
|
60589
|
+
description: "Add a new note to the shared board. Only for a note that is not on the board yet; to rename, reword, recolor or move an existing note use update_note. Text is 1 to 200 characters.",
|
|
60590
|
+
inputSchema: {
|
|
60591
|
+
type: "object",
|
|
60592
|
+
properties: { text: { type: "string" }, color: colorSchema },
|
|
60593
|
+
required: ["text"],
|
|
60594
|
+
additionalProperties: false
|
|
60595
|
+
}
|
|
60596
|
+
},
|
|
60597
|
+
update_note: {
|
|
60598
|
+
name: "update_note",
|
|
60599
|
+
description: "Change an existing note by id: its text (also to rename or reword it), color or position (x and y between 0 and 1). Get the id from list_notes.",
|
|
60600
|
+
inputSchema: {
|
|
60601
|
+
type: "object",
|
|
60602
|
+
properties: {
|
|
60603
|
+
id: { type: "string" },
|
|
60604
|
+
text: { type: "string" },
|
|
60605
|
+
color: colorSchema,
|
|
60606
|
+
x: { type: "number" },
|
|
60607
|
+
y: { type: "number" }
|
|
60608
|
+
},
|
|
60609
|
+
required: ["id"],
|
|
60610
|
+
additionalProperties: false
|
|
60611
|
+
}
|
|
60612
|
+
}
|
|
60613
|
+
};
|
|
60614
|
+
|
|
60553
60615
|
// templates/llm-board/agent.ts
|
|
60554
60616
|
var boards = /* @__PURE__ */ new Map();
|
|
60555
60617
|
var roomOf = /* @__PURE__ */ new Map();
|
|
@@ -60645,11 +60707,8 @@ function apply(sessionId, m) {
|
|
|
60645
60707
|
}
|
|
60646
60708
|
broadcast(sessionId);
|
|
60647
60709
|
}
|
|
60648
|
-
var colorSchema = { type: "string", enum: [...NOTE_COLORS] };
|
|
60649
60710
|
var listNotes = defineTool({
|
|
60650
|
-
|
|
60651
|
-
description: "List every note on the shared board.",
|
|
60652
|
-
inputSchema: { type: "object", properties: {}, additionalProperties: false },
|
|
60711
|
+
...BOARD_TOOL_SPECS.list_notes,
|
|
60653
60712
|
handler: (_args, ctx) => {
|
|
60654
60713
|
const board = boardFor(ctx.sessionId);
|
|
60655
60714
|
if (!board) return SESSION_ENDED;
|
|
@@ -60659,14 +60718,7 @@ var listNotes = defineTool({
|
|
|
60659
60718
|
}
|
|
60660
60719
|
});
|
|
60661
60720
|
var addNote = defineTool({
|
|
60662
|
-
|
|
60663
|
-
description: "Add a note to the shared board. Text is 1 to 200 characters.",
|
|
60664
|
-
inputSchema: {
|
|
60665
|
-
type: "object",
|
|
60666
|
-
properties: { text: { type: "string" }, color: colorSchema },
|
|
60667
|
-
required: ["text"],
|
|
60668
|
-
additionalProperties: false
|
|
60669
|
-
},
|
|
60721
|
+
...BOARD_TOOL_SPECS.add_note,
|
|
60670
60722
|
handler: ({ text, color: color2 }, ctx) => {
|
|
60671
60723
|
const board = boardFor(ctx.sessionId);
|
|
60672
60724
|
if (!board) return SESSION_ENDED;
|
|
@@ -60677,20 +60729,7 @@ var addNote = defineTool({
|
|
|
60677
60729
|
}
|
|
60678
60730
|
});
|
|
60679
60731
|
var updateNote = defineTool({
|
|
60680
|
-
|
|
60681
|
-
description: "Change a note's text, color or position (x and y between 0 and 1).",
|
|
60682
|
-
inputSchema: {
|
|
60683
|
-
type: "object",
|
|
60684
|
-
properties: {
|
|
60685
|
-
id: { type: "string" },
|
|
60686
|
-
text: { type: "string" },
|
|
60687
|
-
color: colorSchema,
|
|
60688
|
-
x: { type: "number" },
|
|
60689
|
-
y: { type: "number" }
|
|
60690
|
-
},
|
|
60691
|
-
required: ["id"],
|
|
60692
|
-
additionalProperties: false
|
|
60693
|
-
},
|
|
60732
|
+
...BOARD_TOOL_SPECS.update_note,
|
|
60694
60733
|
handler: ({ id, ...patch }, ctx) => {
|
|
60695
60734
|
const board = boardFor(ctx.sessionId);
|
|
60696
60735
|
if (!board) return SESSION_ENDED;
|
|
@@ -31489,7 +31489,8 @@ function speakerFieldsOf(event) {
|
|
|
31489
31489
|
...typeof e.speaker === "string" && SPEAKER_VERDICTS.includes(e.speaker) ? { speaker: e.speaker } : {},
|
|
31490
31490
|
...typeof e.speakerUnknownReason === "string" ? { speakerUnknownReason: e.speakerUnknownReason } : {},
|
|
31491
31491
|
...typeof e.speakerCheckWindows === "number" ? { speakerCheckWindows: e.speakerCheckWindows } : {},
|
|
31492
|
-
...typeof e.speakerRechecked === "boolean" ? { speakerRechecked: e.speakerRechecked } : {}
|
|
31492
|
+
...typeof e.speakerRechecked === "boolean" ? { speakerRechecked: e.speakerRechecked } : {},
|
|
31493
|
+
...e.reason === "speaker_split" || e.reason === "speaker_split_redecode_timeout" ? { reason: e.reason } : {}
|
|
31493
31494
|
};
|
|
31494
31495
|
}
|
|
31495
31496
|
function resolveUserLanguageCode(event) {
|
|
@@ -31598,6 +31599,19 @@ async function handleParentMessage(message, handlers) {
|
|
|
31598
31599
|
});
|
|
31599
31600
|
}
|
|
31600
31601
|
}
|
|
31602
|
+
if (message.event.type === "user_utterance_split") {
|
|
31603
|
+
const split = message.event;
|
|
31604
|
+
if (typeof split.fromUtteranceId === "string" && split.fromUtteranceId && typeof split.toUtteranceId === "string" && split.toUtteranceId) {
|
|
31605
|
+
await handlers.onUserUtteranceSplit?.({
|
|
31606
|
+
sessionId: message.sessionId,
|
|
31607
|
+
fromUtteranceId: split.fromUtteranceId,
|
|
31608
|
+
toUtteranceId: split.toUtteranceId,
|
|
31609
|
+
...typeof split.splitAtMs === "number" ? { splitAtMs: split.splitAtMs } : {},
|
|
31610
|
+
...typeof split.from === "string" && SPEAKER_VERDICTS.includes(split.from) ? { from: split.from } : {},
|
|
31611
|
+
...typeof split.to === "string" && SPEAKER_VERDICTS.includes(split.to) ? { to: split.to } : {}
|
|
31612
|
+
});
|
|
31613
|
+
}
|
|
31614
|
+
}
|
|
31601
31615
|
if (message.event.type === "user_language") {
|
|
31602
31616
|
const language = resolveUserLanguageCode(message.event);
|
|
31603
31617
|
if (language) {
|
|
@@ -31489,7 +31489,8 @@ function speakerFieldsOf(event) {
|
|
|
31489
31489
|
...typeof e.speaker === "string" && SPEAKER_VERDICTS.includes(e.speaker) ? { speaker: e.speaker } : {},
|
|
31490
31490
|
...typeof e.speakerUnknownReason === "string" ? { speakerUnknownReason: e.speakerUnknownReason } : {},
|
|
31491
31491
|
...typeof e.speakerCheckWindows === "number" ? { speakerCheckWindows: e.speakerCheckWindows } : {},
|
|
31492
|
-
...typeof e.speakerRechecked === "boolean" ? { speakerRechecked: e.speakerRechecked } : {}
|
|
31492
|
+
...typeof e.speakerRechecked === "boolean" ? { speakerRechecked: e.speakerRechecked } : {},
|
|
31493
|
+
...e.reason === "speaker_split" || e.reason === "speaker_split_redecode_timeout" ? { reason: e.reason } : {}
|
|
31493
31494
|
};
|
|
31494
31495
|
}
|
|
31495
31496
|
function resolveUserLanguageCode(event) {
|
|
@@ -31598,6 +31599,19 @@ async function handleParentMessage(message, handlers) {
|
|
|
31598
31599
|
});
|
|
31599
31600
|
}
|
|
31600
31601
|
}
|
|
31602
|
+
if (message.event.type === "user_utterance_split") {
|
|
31603
|
+
const split = message.event;
|
|
31604
|
+
if (typeof split.fromUtteranceId === "string" && split.fromUtteranceId && typeof split.toUtteranceId === "string" && split.toUtteranceId) {
|
|
31605
|
+
await handlers.onUserUtteranceSplit?.({
|
|
31606
|
+
sessionId: message.sessionId,
|
|
31607
|
+
fromUtteranceId: split.fromUtteranceId,
|
|
31608
|
+
toUtteranceId: split.toUtteranceId,
|
|
31609
|
+
...typeof split.splitAtMs === "number" ? { splitAtMs: split.splitAtMs } : {},
|
|
31610
|
+
...typeof split.from === "string" && SPEAKER_VERDICTS.includes(split.from) ? { from: split.from } : {},
|
|
31611
|
+
...typeof split.to === "string" && SPEAKER_VERDICTS.includes(split.to) ? { to: split.to } : {}
|
|
31612
|
+
});
|
|
31613
|
+
}
|
|
31614
|
+
}
|
|
31601
31615
|
if (message.event.type === "user_language") {
|
|
31602
31616
|
const language = resolveUserLanguageCode(message.event);
|
|
31603
31617
|
if (language) {
|
|
@@ -60401,7 +60415,7 @@ var voicethere_llm_default = {
|
|
|
60401
60415
|
};
|
|
60402
60416
|
|
|
60403
60417
|
// templates/llm-language-tutor/prompt.md
|
|
60404
|
-
var prompt_default = "You are an English conversation tutor for learners at levels A2 to B2. People talk to you by voice, so everything you say is read aloud.\n\nSpeak English only, even if the learner switches to another language. Keep replies to one to three short sentences, in plain words. Do not use markdown, lists, emoji or special characters.\n\nCorrect at most one mistake per turn. Say the learner's sentence again the correct way, then give the reason in a few words. If there is no mistake, say something encouraging in a few words instead. Then ask one follow-up question that keeps the conversation going.\n\nWhen the learner asks about a phrase, an idiom or a lesson topic, call search_knowledge first and answer from what it returns. Never make up the meaning of an idiom that the search did not return. If the search has nothing, say you are not sure and offer a different phrase to practice.\n\nBe patient and friendly. Let the learner finish their thought before you correct anything.\n";
|
|
60418
|
+
var prompt_default = "You are an English conversation tutor for learners at levels A2 to B2. People talk to you by voice, so everything you say is read aloud.\n\nSpeak English only, even if the learner switches to another language. Keep replies to one to three short sentences, in plain words. Do not use markdown, lists, emoji or special characters.\n\nCorrect at most one mistake per turn. Say the learner's sentence again the correct way, then give the reason in a few words. If there is no mistake, say something encouraging in a few words instead. Then ask one follow-up question that keeps the conversation going.\n\nWhen the learner asks about a phrase, an idiom or a lesson topic, call search_knowledge first and answer from what it returns. Call it before you say anything on such a question: do not give a meaning, a guess or a filler sentence first. Never make up the meaning of an idiom that the search did not return. If the search has nothing, say you are not sure and offer a different phrase to practice.\n\nBe patient and friendly. Let the learner finish their thought before you correct anything.\n";
|
|
60405
60419
|
|
|
60406
60420
|
// templates/llm-language-tutor/knowledge/lessons.md
|
|
60407
60421
|
var lessons_default = `# English practice lessons
|
|
@@ -31489,7 +31489,8 @@ function speakerFieldsOf(event) {
|
|
|
31489
31489
|
...typeof e.speaker === "string" && SPEAKER_VERDICTS.includes(e.speaker) ? { speaker: e.speaker } : {},
|
|
31490
31490
|
...typeof e.speakerUnknownReason === "string" ? { speakerUnknownReason: e.speakerUnknownReason } : {},
|
|
31491
31491
|
...typeof e.speakerCheckWindows === "number" ? { speakerCheckWindows: e.speakerCheckWindows } : {},
|
|
31492
|
-
...typeof e.speakerRechecked === "boolean" ? { speakerRechecked: e.speakerRechecked } : {}
|
|
31492
|
+
...typeof e.speakerRechecked === "boolean" ? { speakerRechecked: e.speakerRechecked } : {},
|
|
31493
|
+
...e.reason === "speaker_split" || e.reason === "speaker_split_redecode_timeout" ? { reason: e.reason } : {}
|
|
31493
31494
|
};
|
|
31494
31495
|
}
|
|
31495
31496
|
function resolveUserLanguageCode(event) {
|
|
@@ -31598,6 +31599,19 @@ async function handleParentMessage(message, handlers) {
|
|
|
31598
31599
|
});
|
|
31599
31600
|
}
|
|
31600
31601
|
}
|
|
31602
|
+
if (message.event.type === "user_utterance_split") {
|
|
31603
|
+
const split = message.event;
|
|
31604
|
+
if (typeof split.fromUtteranceId === "string" && split.fromUtteranceId && typeof split.toUtteranceId === "string" && split.toUtteranceId) {
|
|
31605
|
+
await handlers.onUserUtteranceSplit?.({
|
|
31606
|
+
sessionId: message.sessionId,
|
|
31607
|
+
fromUtteranceId: split.fromUtteranceId,
|
|
31608
|
+
toUtteranceId: split.toUtteranceId,
|
|
31609
|
+
...typeof split.splitAtMs === "number" ? { splitAtMs: split.splitAtMs } : {},
|
|
31610
|
+
...typeof split.from === "string" && SPEAKER_VERDICTS.includes(split.from) ? { from: split.from } : {},
|
|
31611
|
+
...typeof split.to === "string" && SPEAKER_VERDICTS.includes(split.to) ? { to: split.to } : {}
|
|
31612
|
+
});
|
|
31613
|
+
}
|
|
31614
|
+
}
|
|
31601
31615
|
if (message.event.type === "user_language") {
|
|
31602
31616
|
const language = resolveUserLanguageCode(message.event);
|
|
31603
31617
|
if (language) {
|
|
@@ -31489,7 +31489,8 @@ function speakerFieldsOf(event) {
|
|
|
31489
31489
|
...typeof e.speaker === "string" && SPEAKER_VERDICTS.includes(e.speaker) ? { speaker: e.speaker } : {},
|
|
31490
31490
|
...typeof e.speakerUnknownReason === "string" ? { speakerUnknownReason: e.speakerUnknownReason } : {},
|
|
31491
31491
|
...typeof e.speakerCheckWindows === "number" ? { speakerCheckWindows: e.speakerCheckWindows } : {},
|
|
31492
|
-
...typeof e.speakerRechecked === "boolean" ? { speakerRechecked: e.speakerRechecked } : {}
|
|
31492
|
+
...typeof e.speakerRechecked === "boolean" ? { speakerRechecked: e.speakerRechecked } : {},
|
|
31493
|
+
...e.reason === "speaker_split" || e.reason === "speaker_split_redecode_timeout" ? { reason: e.reason } : {}
|
|
31493
31494
|
};
|
|
31494
31495
|
}
|
|
31495
31496
|
function resolveUserLanguageCode(event) {
|
|
@@ -31598,6 +31599,19 @@ async function handleParentMessage(message, handlers) {
|
|
|
31598
31599
|
});
|
|
31599
31600
|
}
|
|
31600
31601
|
}
|
|
31602
|
+
if (message.event.type === "user_utterance_split") {
|
|
31603
|
+
const split = message.event;
|
|
31604
|
+
if (typeof split.fromUtteranceId === "string" && split.fromUtteranceId && typeof split.toUtteranceId === "string" && split.toUtteranceId) {
|
|
31605
|
+
await handlers.onUserUtteranceSplit?.({
|
|
31606
|
+
sessionId: message.sessionId,
|
|
31607
|
+
fromUtteranceId: split.fromUtteranceId,
|
|
31608
|
+
toUtteranceId: split.toUtteranceId,
|
|
31609
|
+
...typeof split.splitAtMs === "number" ? { splitAtMs: split.splitAtMs } : {},
|
|
31610
|
+
...typeof split.from === "string" && SPEAKER_VERDICTS.includes(split.from) ? { from: split.from } : {},
|
|
31611
|
+
...typeof split.to === "string" && SPEAKER_VERDICTS.includes(split.to) ? { to: split.to } : {}
|
|
31612
|
+
});
|
|
31613
|
+
}
|
|
31614
|
+
}
|
|
31601
31615
|
if (message.event.type === "user_language") {
|
|
31602
31616
|
const language = resolveUserLanguageCode(message.event);
|
|
31603
31617
|
if (language) {
|
|
@@ -860,7 +860,8 @@ function speakerFieldsOf(event) {
|
|
|
860
860
|
...typeof e.speaker === "string" && SPEAKER_VERDICTS.includes(e.speaker) ? { speaker: e.speaker } : {},
|
|
861
861
|
...typeof e.speakerUnknownReason === "string" ? { speakerUnknownReason: e.speakerUnknownReason } : {},
|
|
862
862
|
...typeof e.speakerCheckWindows === "number" ? { speakerCheckWindows: e.speakerCheckWindows } : {},
|
|
863
|
-
...typeof e.speakerRechecked === "boolean" ? { speakerRechecked: e.speakerRechecked } : {}
|
|
863
|
+
...typeof e.speakerRechecked === "boolean" ? { speakerRechecked: e.speakerRechecked } : {},
|
|
864
|
+
...e.reason === "speaker_split" || e.reason === "speaker_split_redecode_timeout" ? { reason: e.reason } : {}
|
|
864
865
|
};
|
|
865
866
|
}
|
|
866
867
|
function resolveUserLanguageCode(event) {
|
|
@@ -969,6 +970,19 @@ async function handleParentMessage(message, handlers) {
|
|
|
969
970
|
});
|
|
970
971
|
}
|
|
971
972
|
}
|
|
973
|
+
if (message.event.type === "user_utterance_split") {
|
|
974
|
+
const split = message.event;
|
|
975
|
+
if (typeof split.fromUtteranceId === "string" && split.fromUtteranceId && typeof split.toUtteranceId === "string" && split.toUtteranceId) {
|
|
976
|
+
await handlers.onUserUtteranceSplit?.({
|
|
977
|
+
sessionId: message.sessionId,
|
|
978
|
+
fromUtteranceId: split.fromUtteranceId,
|
|
979
|
+
toUtteranceId: split.toUtteranceId,
|
|
980
|
+
...typeof split.splitAtMs === "number" ? { splitAtMs: split.splitAtMs } : {},
|
|
981
|
+
...typeof split.from === "string" && SPEAKER_VERDICTS.includes(split.from) ? { from: split.from } : {},
|
|
982
|
+
...typeof split.to === "string" && SPEAKER_VERDICTS.includes(split.to) ? { to: split.to } : {}
|
|
983
|
+
});
|
|
984
|
+
}
|
|
985
|
+
}
|
|
972
986
|
if (message.event.type === "user_language") {
|
|
973
987
|
const language = resolveUserLanguageCode(message.event);
|
|
974
988
|
if (language) {
|
|
@@ -845,7 +845,8 @@ function speakerFieldsOf(event) {
|
|
|
845
845
|
...typeof e.speaker === "string" && SPEAKER_VERDICTS.includes(e.speaker) ? { speaker: e.speaker } : {},
|
|
846
846
|
...typeof e.speakerUnknownReason === "string" ? { speakerUnknownReason: e.speakerUnknownReason } : {},
|
|
847
847
|
...typeof e.speakerCheckWindows === "number" ? { speakerCheckWindows: e.speakerCheckWindows } : {},
|
|
848
|
-
...typeof e.speakerRechecked === "boolean" ? { speakerRechecked: e.speakerRechecked } : {}
|
|
848
|
+
...typeof e.speakerRechecked === "boolean" ? { speakerRechecked: e.speakerRechecked } : {},
|
|
849
|
+
...e.reason === "speaker_split" || e.reason === "speaker_split_redecode_timeout" ? { reason: e.reason } : {}
|
|
849
850
|
};
|
|
850
851
|
}
|
|
851
852
|
function resolveUserLanguageCode(event) {
|
|
@@ -954,6 +955,19 @@ async function handleParentMessage(message, handlers) {
|
|
|
954
955
|
});
|
|
955
956
|
}
|
|
956
957
|
}
|
|
958
|
+
if (message.event.type === "user_utterance_split") {
|
|
959
|
+
const split = message.event;
|
|
960
|
+
if (typeof split.fromUtteranceId === "string" && split.fromUtteranceId && typeof split.toUtteranceId === "string" && split.toUtteranceId) {
|
|
961
|
+
await handlers.onUserUtteranceSplit?.({
|
|
962
|
+
sessionId: message.sessionId,
|
|
963
|
+
fromUtteranceId: split.fromUtteranceId,
|
|
964
|
+
toUtteranceId: split.toUtteranceId,
|
|
965
|
+
...typeof split.splitAtMs === "number" ? { splitAtMs: split.splitAtMs } : {},
|
|
966
|
+
...typeof split.from === "string" && SPEAKER_VERDICTS.includes(split.from) ? { from: split.from } : {},
|
|
967
|
+
...typeof split.to === "string" && SPEAKER_VERDICTS.includes(split.to) ? { to: split.to } : {}
|
|
968
|
+
});
|
|
969
|
+
}
|
|
970
|
+
}
|
|
957
971
|
if (message.event.type === "user_language") {
|
|
958
972
|
const language = resolveUserLanguageCode(message.event);
|
|
959
973
|
if (language) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/templates/registry.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,KAAK,CAAC;AAE7C,MAAM,MAAM,gBAAgB,GAC1B,OAAO,GAAG,MAAM,GAAG,YAAY,GAAG,aAAa,GAAG,OAAO,CAAC;AAE5D,MAAM,WAAW,uBAAuB;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,mFAAmF;IACnF,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,YAAY,CAAC;IACnB,mFAAmF;IACnF,YAAY,EAAE,OAAO,CAAC;IACtB,wCAAwC;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,4EAA4E;IAC5E,OAAO,EAAE,MAAM,CAAC;IAChB,uBAAuB;IACvB,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,gGAAgG;IAChG,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,oFAAoF;IACpF,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC1C;AAED,eAAO,MAAM,eAAe,EAAE,SAAS,uBAAuB,
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/templates/registry.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,YAAY,GAAG,SAAS,GAAG,KAAK,CAAC;AAE7C,MAAM,MAAM,gBAAgB,GAC1B,OAAO,GAAG,MAAM,GAAG,YAAY,GAAG,aAAa,GAAG,OAAO,CAAC;AAE5D,MAAM,WAAW,uBAAuB;IACtC,EAAE,EAAE,MAAM,CAAC;IACX,mFAAmF;IACnF,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,YAAY,CAAC;IACnB,mFAAmF;IACnF,YAAY,EAAE,OAAO,CAAC;IACtB,wCAAwC;IACxC,KAAK,EAAE,MAAM,CAAC;IACd,4EAA4E;IAC5E,OAAO,EAAE,MAAM,CAAC;IAChB,uBAAuB;IACvB,QAAQ,EAAE,gBAAgB,CAAC;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,gGAAgG;IAChG,WAAW,EAAE,MAAM,EAAE,CAAC;IACtB,oFAAoF;IACpF,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC1C;AAED,eAAO,MAAM,eAAe,EAAE,SAAS,uBAAuB,EAgdpD,CAAC;AAEX,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC;AAMrE,wBAAgB,iBAAiB,CAAC,EAAE,EAAE,MAAM,GAAG,EAAE,IAAI,eAAe,CAEnE;AAED,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,uBAAuB,CAMnE;AAED,wBAAgB,yBAAyB,IAAI,uBAAuB,EAAE,CAErE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/templates/registry.ts"],"names":[],"mappings":"AAyBA,MAAM,CAAC,MAAM,eAAe,GAAuC;IACjE;QACE,EAAE,EAAE,MAAM;QACV,KAAK,EAAE,eAAe;QAC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string" && SPEAKER_VERDICTS.includes(e.speaker) ? { speaker: e.speaker } : {},
|
|
876
876
|
...typeof e.speakerUnknownReason === "string" ? { speakerUnknownReason: e.speakerUnknownReason } : {},
|
|
877
877
|
...typeof e.speakerCheckWindows === "number" ? { speakerCheckWindows: e.speakerCheckWindows } : {},
|
|
878
|
-
...typeof e.speakerRechecked === "boolean" ? { speakerRechecked: e.speakerRechecked } : {}
|
|
878
|
+
...typeof e.speakerRechecked === "boolean" ? { speakerRechecked: e.speakerRechecked } : {},
|
|
879
|
+
...e.reason === "speaker_split" || e.reason === "speaker_split_redecode_timeout" ? { reason: e.reason } : {}
|
|
879
880
|
};
|
|
880
881
|
}
|
|
881
882
|
function resolveUserLanguageCode(event) {
|
|
@@ -984,6 +985,19 @@ async function handleParentMessage(message, handlers) {
|
|
|
984
985
|
});
|
|
985
986
|
}
|
|
986
987
|
}
|
|
988
|
+
if (message.event.type === "user_utterance_split") {
|
|
989
|
+
const split = message.event;
|
|
990
|
+
if (typeof split.fromUtteranceId === "string" && split.fromUtteranceId && typeof split.toUtteranceId === "string" && split.toUtteranceId) {
|
|
991
|
+
await handlers.onUserUtteranceSplit?.({
|
|
992
|
+
sessionId: message.sessionId,
|
|
993
|
+
fromUtteranceId: split.fromUtteranceId,
|
|
994
|
+
toUtteranceId: split.toUtteranceId,
|
|
995
|
+
...typeof split.splitAtMs === "number" ? { splitAtMs: split.splitAtMs } : {},
|
|
996
|
+
...typeof split.from === "string" && SPEAKER_VERDICTS.includes(split.from) ? { from: split.from } : {},
|
|
997
|
+
...typeof split.to === "string" && SPEAKER_VERDICTS.includes(split.to) ? { to: split.to } : {}
|
|
998
|
+
});
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
987
1001
|
if (message.event.type === "user_language") {
|
|
988
1002
|
const language = resolveUserLanguageCode(message.event);
|
|
989
1003
|
if (language) {
|
|
@@ -845,7 +845,8 @@ function speakerFieldsOf(event) {
|
|
|
845
845
|
...typeof e.speaker === "string" && SPEAKER_VERDICTS.includes(e.speaker) ? { speaker: e.speaker } : {},
|
|
846
846
|
...typeof e.speakerUnknownReason === "string" ? { speakerUnknownReason: e.speakerUnknownReason } : {},
|
|
847
847
|
...typeof e.speakerCheckWindows === "number" ? { speakerCheckWindows: e.speakerCheckWindows } : {},
|
|
848
|
-
...typeof e.speakerRechecked === "boolean" ? { speakerRechecked: e.speakerRechecked } : {}
|
|
848
|
+
...typeof e.speakerRechecked === "boolean" ? { speakerRechecked: e.speakerRechecked } : {},
|
|
849
|
+
...e.reason === "speaker_split" || e.reason === "speaker_split_redecode_timeout" ? { reason: e.reason } : {}
|
|
849
850
|
};
|
|
850
851
|
}
|
|
851
852
|
function resolveUserLanguageCode(event) {
|
|
@@ -954,6 +955,19 @@ async function handleParentMessage(message, handlers) {
|
|
|
954
955
|
});
|
|
955
956
|
}
|
|
956
957
|
}
|
|
958
|
+
if (message.event.type === "user_utterance_split") {
|
|
959
|
+
const split = message.event;
|
|
960
|
+
if (typeof split.fromUtteranceId === "string" && split.fromUtteranceId && typeof split.toUtteranceId === "string" && split.toUtteranceId) {
|
|
961
|
+
await handlers.onUserUtteranceSplit?.({
|
|
962
|
+
sessionId: message.sessionId,
|
|
963
|
+
fromUtteranceId: split.fromUtteranceId,
|
|
964
|
+
toUtteranceId: split.toUtteranceId,
|
|
965
|
+
...typeof split.splitAtMs === "number" ? { splitAtMs: split.splitAtMs } : {},
|
|
966
|
+
...typeof split.from === "string" && SPEAKER_VERDICTS.includes(split.from) ? { from: split.from } : {},
|
|
967
|
+
...typeof split.to === "string" && SPEAKER_VERDICTS.includes(split.to) ? { to: split.to } : {}
|
|
968
|
+
});
|
|
969
|
+
}
|
|
970
|
+
}
|
|
957
971
|
if (message.event.type === "user_language") {
|
|
958
972
|
const language = resolveUserLanguageCode(message.event);
|
|
959
973
|
if (language) {
|
|
@@ -844,7 +844,8 @@ function speakerFieldsOf(event) {
|
|
|
844
844
|
...typeof e.speaker === "string" && SPEAKER_VERDICTS.includes(e.speaker) ? { speaker: e.speaker } : {},
|
|
845
845
|
...typeof e.speakerUnknownReason === "string" ? { speakerUnknownReason: e.speakerUnknownReason } : {},
|
|
846
846
|
...typeof e.speakerCheckWindows === "number" ? { speakerCheckWindows: e.speakerCheckWindows } : {},
|
|
847
|
-
...typeof e.speakerRechecked === "boolean" ? { speakerRechecked: e.speakerRechecked } : {}
|
|
847
|
+
...typeof e.speakerRechecked === "boolean" ? { speakerRechecked: e.speakerRechecked } : {},
|
|
848
|
+
...e.reason === "speaker_split" || e.reason === "speaker_split_redecode_timeout" ? { reason: e.reason } : {}
|
|
848
849
|
};
|
|
849
850
|
}
|
|
850
851
|
function resolveUserLanguageCode(event) {
|
|
@@ -953,6 +954,19 @@ async function handleParentMessage(message, handlers) {
|
|
|
953
954
|
});
|
|
954
955
|
}
|
|
955
956
|
}
|
|
957
|
+
if (message.event.type === "user_utterance_split") {
|
|
958
|
+
const split = message.event;
|
|
959
|
+
if (typeof split.fromUtteranceId === "string" && split.fromUtteranceId && typeof split.toUtteranceId === "string" && split.toUtteranceId) {
|
|
960
|
+
await handlers.onUserUtteranceSplit?.({
|
|
961
|
+
sessionId: message.sessionId,
|
|
962
|
+
fromUtteranceId: split.fromUtteranceId,
|
|
963
|
+
toUtteranceId: split.toUtteranceId,
|
|
964
|
+
...typeof split.splitAtMs === "number" ? { splitAtMs: split.splitAtMs } : {},
|
|
965
|
+
...typeof split.from === "string" && SPEAKER_VERDICTS.includes(split.from) ? { from: split.from } : {},
|
|
966
|
+
...typeof split.to === "string" && SPEAKER_VERDICTS.includes(split.to) ? { to: split.to } : {}
|
|
967
|
+
});
|
|
968
|
+
}
|
|
969
|
+
}
|
|
956
970
|
if (message.event.type === "user_language") {
|
|
957
971
|
const language = resolveUserLanguageCode(message.event);
|
|
958
972
|
if (language) {
|
|
@@ -844,7 +844,8 @@ function speakerFieldsOf(event) {
|
|
|
844
844
|
...typeof e.speaker === "string" && SPEAKER_VERDICTS.includes(e.speaker) ? { speaker: e.speaker } : {},
|
|
845
845
|
...typeof e.speakerUnknownReason === "string" ? { speakerUnknownReason: e.speakerUnknownReason } : {},
|
|
846
846
|
...typeof e.speakerCheckWindows === "number" ? { speakerCheckWindows: e.speakerCheckWindows } : {},
|
|
847
|
-
...typeof e.speakerRechecked === "boolean" ? { speakerRechecked: e.speakerRechecked } : {}
|
|
847
|
+
...typeof e.speakerRechecked === "boolean" ? { speakerRechecked: e.speakerRechecked } : {},
|
|
848
|
+
...e.reason === "speaker_split" || e.reason === "speaker_split_redecode_timeout" ? { reason: e.reason } : {}
|
|
848
849
|
};
|
|
849
850
|
}
|
|
850
851
|
function resolveUserLanguageCode(event) {
|
|
@@ -953,6 +954,19 @@ async function handleParentMessage(message, handlers) {
|
|
|
953
954
|
});
|
|
954
955
|
}
|
|
955
956
|
}
|
|
957
|
+
if (message.event.type === "user_utterance_split") {
|
|
958
|
+
const split = message.event;
|
|
959
|
+
if (typeof split.fromUtteranceId === "string" && split.fromUtteranceId && typeof split.toUtteranceId === "string" && split.toUtteranceId) {
|
|
960
|
+
await handlers.onUserUtteranceSplit?.({
|
|
961
|
+
sessionId: message.sessionId,
|
|
962
|
+
fromUtteranceId: split.fromUtteranceId,
|
|
963
|
+
toUtteranceId: split.toUtteranceId,
|
|
964
|
+
...typeof split.splitAtMs === "number" ? { splitAtMs: split.splitAtMs } : {},
|
|
965
|
+
...typeof split.from === "string" && SPEAKER_VERDICTS.includes(split.from) ? { from: split.from } : {},
|
|
966
|
+
...typeof split.to === "string" && SPEAKER_VERDICTS.includes(split.to) ? { to: split.to } : {}
|
|
967
|
+
});
|
|
968
|
+
}
|
|
969
|
+
}
|
|
956
970
|
if (message.event.type === "user_language") {
|
|
957
971
|
const language = resolveUserLanguageCode(message.event);
|
|
958
972
|
if (language) {
|
|
@@ -847,7 +847,8 @@ function speakerFieldsOf(event) {
|
|
|
847
847
|
...typeof e.speaker === "string" && SPEAKER_VERDICTS.includes(e.speaker) ? { speaker: e.speaker } : {},
|
|
848
848
|
...typeof e.speakerUnknownReason === "string" ? { speakerUnknownReason: e.speakerUnknownReason } : {},
|
|
849
849
|
...typeof e.speakerCheckWindows === "number" ? { speakerCheckWindows: e.speakerCheckWindows } : {},
|
|
850
|
-
...typeof e.speakerRechecked === "boolean" ? { speakerRechecked: e.speakerRechecked } : {}
|
|
850
|
+
...typeof e.speakerRechecked === "boolean" ? { speakerRechecked: e.speakerRechecked } : {},
|
|
851
|
+
...e.reason === "speaker_split" || e.reason === "speaker_split_redecode_timeout" ? { reason: e.reason } : {}
|
|
851
852
|
};
|
|
852
853
|
}
|
|
853
854
|
function resolveUserLanguageCode(event) {
|
|
@@ -956,6 +957,19 @@ async function handleParentMessage(message, handlers) {
|
|
|
956
957
|
});
|
|
957
958
|
}
|
|
958
959
|
}
|
|
960
|
+
if (message.event.type === "user_utterance_split") {
|
|
961
|
+
const split = message.event;
|
|
962
|
+
if (typeof split.fromUtteranceId === "string" && split.fromUtteranceId && typeof split.toUtteranceId === "string" && split.toUtteranceId) {
|
|
963
|
+
await handlers.onUserUtteranceSplit?.({
|
|
964
|
+
sessionId: message.sessionId,
|
|
965
|
+
fromUtteranceId: split.fromUtteranceId,
|
|
966
|
+
toUtteranceId: split.toUtteranceId,
|
|
967
|
+
...typeof split.splitAtMs === "number" ? { splitAtMs: split.splitAtMs } : {},
|
|
968
|
+
...typeof split.from === "string" && SPEAKER_VERDICTS.includes(split.from) ? { from: split.from } : {},
|
|
969
|
+
...typeof split.to === "string" && SPEAKER_VERDICTS.includes(split.to) ? { to: split.to } : {}
|
|
970
|
+
});
|
|
971
|
+
}
|
|
972
|
+
}
|
|
959
973
|
if (message.event.type === "user_language") {
|
|
960
974
|
const language = resolveUserLanguageCode(message.event);
|
|
961
975
|
if (language) {
|
|
@@ -11595,7 +11595,8 @@ function speakerFieldsOf(event) {
|
|
|
11595
11595
|
...typeof e.speaker === "string" && SPEAKER_VERDICTS.includes(e.speaker) ? { speaker: e.speaker } : {},
|
|
11596
11596
|
...typeof e.speakerUnknownReason === "string" ? { speakerUnknownReason: e.speakerUnknownReason } : {},
|
|
11597
11597
|
...typeof e.speakerCheckWindows === "number" ? { speakerCheckWindows: e.speakerCheckWindows } : {},
|
|
11598
|
-
...typeof e.speakerRechecked === "boolean" ? { speakerRechecked: e.speakerRechecked } : {}
|
|
11598
|
+
...typeof e.speakerRechecked === "boolean" ? { speakerRechecked: e.speakerRechecked } : {},
|
|
11599
|
+
...e.reason === "speaker_split" || e.reason === "speaker_split_redecode_timeout" ? { reason: e.reason } : {}
|
|
11599
11600
|
};
|
|
11600
11601
|
}
|
|
11601
11602
|
function resolveUserLanguageCode(event) {
|
|
@@ -11704,6 +11705,19 @@ async function handleParentMessage(message, handlers) {
|
|
|
11704
11705
|
});
|
|
11705
11706
|
}
|
|
11706
11707
|
}
|
|
11708
|
+
if (message.event.type === "user_utterance_split") {
|
|
11709
|
+
const split = message.event;
|
|
11710
|
+
if (typeof split.fromUtteranceId === "string" && split.fromUtteranceId && typeof split.toUtteranceId === "string" && split.toUtteranceId) {
|
|
11711
|
+
await handlers.onUserUtteranceSplit?.({
|
|
11712
|
+
sessionId: message.sessionId,
|
|
11713
|
+
fromUtteranceId: split.fromUtteranceId,
|
|
11714
|
+
toUtteranceId: split.toUtteranceId,
|
|
11715
|
+
...typeof split.splitAtMs === "number" ? { splitAtMs: split.splitAtMs } : {},
|
|
11716
|
+
...typeof split.from === "string" && SPEAKER_VERDICTS.includes(split.from) ? { from: split.from } : {},
|
|
11717
|
+
...typeof split.to === "string" && SPEAKER_VERDICTS.includes(split.to) ? { to: split.to } : {}
|
|
11718
|
+
});
|
|
11719
|
+
}
|
|
11720
|
+
}
|
|
11707
11721
|
if (message.event.type === "user_language") {
|
|
11708
11722
|
const language = resolveUserLanguageCode(message.event);
|
|
11709
11723
|
if (language) {
|
|
@@ -840,7 +840,8 @@ function speakerFieldsOf(event) {
|
|
|
840
840
|
...typeof e.speaker === "string" && SPEAKER_VERDICTS.includes(e.speaker) ? { speaker: e.speaker } : {},
|
|
841
841
|
...typeof e.speakerUnknownReason === "string" ? { speakerUnknownReason: e.speakerUnknownReason } : {},
|
|
842
842
|
...typeof e.speakerCheckWindows === "number" ? { speakerCheckWindows: e.speakerCheckWindows } : {},
|
|
843
|
-
...typeof e.speakerRechecked === "boolean" ? { speakerRechecked: e.speakerRechecked } : {}
|
|
843
|
+
...typeof e.speakerRechecked === "boolean" ? { speakerRechecked: e.speakerRechecked } : {},
|
|
844
|
+
...e.reason === "speaker_split" || e.reason === "speaker_split_redecode_timeout" ? { reason: e.reason } : {}
|
|
844
845
|
};
|
|
845
846
|
}
|
|
846
847
|
function resolveUserLanguageCode(event) {
|
|
@@ -949,6 +950,19 @@ async function handleParentMessage(message, handlers) {
|
|
|
949
950
|
});
|
|
950
951
|
}
|
|
951
952
|
}
|
|
953
|
+
if (message.event.type === "user_utterance_split") {
|
|
954
|
+
const split = message.event;
|
|
955
|
+
if (typeof split.fromUtteranceId === "string" && split.fromUtteranceId && typeof split.toUtteranceId === "string" && split.toUtteranceId) {
|
|
956
|
+
await handlers.onUserUtteranceSplit?.({
|
|
957
|
+
sessionId: message.sessionId,
|
|
958
|
+
fromUtteranceId: split.fromUtteranceId,
|
|
959
|
+
toUtteranceId: split.toUtteranceId,
|
|
960
|
+
...typeof split.splitAtMs === "number" ? { splitAtMs: split.splitAtMs } : {},
|
|
961
|
+
...typeof split.from === "string" && SPEAKER_VERDICTS.includes(split.from) ? { from: split.from } : {},
|
|
962
|
+
...typeof split.to === "string" && SPEAKER_VERDICTS.includes(split.to) ? { to: split.to } : {}
|
|
963
|
+
});
|
|
964
|
+
}
|
|
965
|
+
}
|
|
952
966
|
if (message.event.type === "user_language") {
|
|
953
967
|
const language = resolveUserLanguageCode(message.event);
|
|
954
968
|
if (language) {
|