@runtypelabs/persona 4.22.0 → 4.22.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/dist/animations/glyph-cycle.d.cts +1 -1
- package/dist/animations/glyph-cycle.d.ts +1 -1
- package/dist/animations/{types-B_JdVK9o.d.cts → types-9Vxm-PPz.d.cts} +136 -6
- package/dist/animations/{types-B_JdVK9o.d.ts → types-9Vxm-PPz.d.ts} +136 -6
- package/dist/animations/wipe.d.cts +1 -1
- package/dist/animations/wipe.d.ts +1 -1
- package/dist/animations-extra.d.cts +136 -6
- package/dist/animations-extra.d.ts +136 -6
- package/dist/approval-ui.d.cts +148 -14
- package/dist/approval-ui.d.ts +148 -14
- package/dist/artifacts-ui.d.cts +148 -14
- package/dist/artifacts-ui.d.ts +148 -14
- package/dist/codegen.cjs +1 -1
- package/dist/codegen.js +1 -1
- package/dist/context-mentions.d.cts +148 -14
- package/dist/context-mentions.d.ts +148 -14
- package/dist/event-stream-view-GL3ADRY2.js +1 -0
- package/dist/event-stream-view.cjs +1 -1
- package/dist/event-stream-view.d.cts +148 -14
- package/dist/event-stream-view.d.ts +148 -14
- package/dist/event-stream-view.js +1 -1
- package/dist/forms-ui.d.cts +161 -23
- package/dist/forms-ui.d.ts +161 -23
- package/dist/history-view.d.cts +136 -6
- package/dist/history-view.d.ts +136 -6
- package/dist/index.cjs +67 -67
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +166 -27
- package/dist/index.d.ts +166 -27
- package/dist/index.global.js +51 -51
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +67 -67
- package/dist/index.js.map +1 -1
- package/dist/session-reconnect.d.cts +148 -14
- package/dist/session-reconnect.d.ts +148 -14
- package/dist/smart-dom-reader.d.cts +148 -14
- package/dist/smart-dom-reader.d.ts +148 -14
- package/dist/testing.cjs +3 -3
- package/dist/testing.d.cts +3 -4
- package/dist/testing.d.ts +3 -4
- package/dist/testing.js +3 -3
- package/dist/theme-editor-preview.cjs +71 -71
- package/dist/theme-editor-preview.d.cts +148 -14
- package/dist/theme-editor-preview.d.ts +148 -14
- package/dist/theme-editor-preview.js +48 -48
- package/dist/theme-editor.d.cts +148 -14
- package/dist/theme-editor.d.ts +148 -14
- package/dist/voice-runtime.d.cts +6 -2
- package/dist/voice-runtime.d.ts +6 -2
- package/package.json +1 -1
- package/src/ask-user-question-tool.ts +1 -1
- package/src/client-history-rest.test.ts +2 -1
- package/src/client-visitor-history.test.ts +20 -4
- package/src/client.composer-options.test.ts +1 -1
- package/src/client.interrupt.test.ts +2 -2
- package/src/client.test.ts +477 -915
- package/src/client.ts +134 -494
- package/src/client.unified-tools.test.ts +76 -0
- package/src/components/event-stream-badge-theming.test.ts +3 -0
- package/src/components/event-stream-view.test.ts +76 -76
- package/src/components/event-stream-view.ts +5 -0
- package/src/components/tool-bubble.test.ts +12 -0
- package/src/components/tool-bubble.ts +13 -2
- package/src/event-stream-view-bundle.test.ts +2 -2
- package/src/generated/runtype-openapi-contract.ts +129 -1
- package/src/internal/runtype-history-provider.test.ts +2 -2
- package/src/session-history.test.ts +1 -1
- package/src/session.quote.test.ts +1 -1
- package/src/session.resubmit-from.test.ts +1 -1
- package/src/session.test.ts +5 -5
- package/src/session.ts +95 -36
- package/src/suggest-replies-tool.ts +1 -1
- package/src/testing/mock-stream.test.ts +37 -16
- package/src/testing/mock-stream.ts +14 -9
- package/src/types.ts +19 -14
- package/src/ui.ask-user-question-plugin.test.ts +7 -7
- package/src/ui.composer-defer-one.test.ts +6 -34
- package/src/ui.composer-draft-persistence.test.ts +1 -1
- package/src/ui.composer-quote.test.ts +1 -1
- package/src/ui.message-history-actions.test.ts +1 -1
- package/src/ui.streaming-coalescing.test.ts +10 -13
- package/src/ui.ts +67 -32
- package/src/ui.typing-indicator.test.ts +216 -0
- package/src/ui.voice-custom-provider.test.ts +211 -0
- package/src/utils/event-stream-buffer.test.ts +13 -13
- package/src/utils/event-stream-capture.test.ts +20 -20
- package/src/utils/throughput-tracker.test.ts +100 -142
- package/src/utils/throughput-tracker.ts +18 -132
- package/src/utils/voice-support.ts +18 -1
- package/src/voice/voice-turn-tracker.ts +18 -0
- package/src/webmcp-bridge.ts +1 -1
- package/dist/event-stream-view-FKWDY3UB.js +0 -1
- package/src/utils/__fixtures__/unified-translator.oracle.ts +0 -717
package/dist/forms-ui.d.cts
CHANGED
|
@@ -1694,6 +1694,11 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
1694
1694
|
iteration?: number;
|
|
1695
1695
|
role: "user" | "assistant" | "system";
|
|
1696
1696
|
seq: number;
|
|
1697
|
+
subagent?: {
|
|
1698
|
+
agentName?: string;
|
|
1699
|
+
parentToolCallId?: string;
|
|
1700
|
+
toolName: string;
|
|
1701
|
+
};
|
|
1697
1702
|
turnIndex?: number;
|
|
1698
1703
|
type: "turn_start";
|
|
1699
1704
|
}) | ({
|
|
@@ -1728,12 +1733,61 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
1728
1733
|
role: "user" | "assistant" | "system";
|
|
1729
1734
|
seq: number;
|
|
1730
1735
|
stopReason?: "end_turn" | "max_tool_calls" | "length" | "content_filter" | "error" | "unknown";
|
|
1736
|
+
subagent?: {
|
|
1737
|
+
agentName?: string;
|
|
1738
|
+
parentToolCallId?: string;
|
|
1739
|
+
toolName: string;
|
|
1740
|
+
};
|
|
1731
1741
|
tokens?: {
|
|
1732
1742
|
input: number;
|
|
1733
1743
|
output: number;
|
|
1734
1744
|
};
|
|
1735
1745
|
type: "turn_complete";
|
|
1736
1746
|
}) | {
|
|
1747
|
+
executionId: string;
|
|
1748
|
+
id: string;
|
|
1749
|
+
iteration?: number;
|
|
1750
|
+
model?: string;
|
|
1751
|
+
ordinal: number;
|
|
1752
|
+
provider?: string;
|
|
1753
|
+
seq: number;
|
|
1754
|
+
startedAt?: string;
|
|
1755
|
+
stepId?: string;
|
|
1756
|
+
subagent?: {
|
|
1757
|
+
agentName?: string;
|
|
1758
|
+
parentToolCallId?: string;
|
|
1759
|
+
toolName: string;
|
|
1760
|
+
};
|
|
1761
|
+
turnId?: string;
|
|
1762
|
+
type: "model_call_start";
|
|
1763
|
+
} | {
|
|
1764
|
+
completedAt?: string;
|
|
1765
|
+
cost?: number;
|
|
1766
|
+
durationMs?: number;
|
|
1767
|
+
executionId: string;
|
|
1768
|
+
finishReason?: string;
|
|
1769
|
+
id: string;
|
|
1770
|
+
iteration?: number;
|
|
1771
|
+
model?: string;
|
|
1772
|
+
ordinal: number;
|
|
1773
|
+
provider?: string;
|
|
1774
|
+
responseModel?: string;
|
|
1775
|
+
seq: number;
|
|
1776
|
+
subagent?: {
|
|
1777
|
+
agentName?: string;
|
|
1778
|
+
parentToolCallId?: string;
|
|
1779
|
+
toolName: string;
|
|
1780
|
+
};
|
|
1781
|
+
success?: boolean;
|
|
1782
|
+
tokens?: {
|
|
1783
|
+
cacheRead?: number;
|
|
1784
|
+
cacheWrite?: number;
|
|
1785
|
+
input: number;
|
|
1786
|
+
output: number;
|
|
1787
|
+
};
|
|
1788
|
+
turnId?: string;
|
|
1789
|
+
type: "model_call_complete";
|
|
1790
|
+
} | {
|
|
1737
1791
|
executionId: string;
|
|
1738
1792
|
id: string;
|
|
1739
1793
|
index?: number;
|
|
@@ -1742,6 +1796,11 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
1742
1796
|
seq: number;
|
|
1743
1797
|
startedAt?: string;
|
|
1744
1798
|
stepType?: string;
|
|
1799
|
+
subagent?: {
|
|
1800
|
+
agentName?: string;
|
|
1801
|
+
parentToolCallId?: string;
|
|
1802
|
+
toolName: string;
|
|
1803
|
+
};
|
|
1745
1804
|
totalSteps?: number;
|
|
1746
1805
|
type: "step_start";
|
|
1747
1806
|
} | ({
|
|
@@ -1769,6 +1828,11 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
1769
1828
|
seq: number;
|
|
1770
1829
|
stepType?: string;
|
|
1771
1830
|
stopReason?: "end_turn" | "max_tool_calls" | "length" | "content_filter" | "error" | "unknown";
|
|
1831
|
+
subagent?: {
|
|
1832
|
+
agentName?: string;
|
|
1833
|
+
parentToolCallId?: string;
|
|
1834
|
+
toolName: string;
|
|
1835
|
+
};
|
|
1772
1836
|
success?: boolean;
|
|
1773
1837
|
tokensUsed?: number;
|
|
1774
1838
|
type: "step_complete";
|
|
@@ -1791,6 +1855,11 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
1791
1855
|
role?: "user" | "assistant" | "system";
|
|
1792
1856
|
seq: number;
|
|
1793
1857
|
stepId?: string;
|
|
1858
|
+
subagent?: {
|
|
1859
|
+
agentName?: string;
|
|
1860
|
+
parentToolCallId?: string;
|
|
1861
|
+
toolName: string;
|
|
1862
|
+
};
|
|
1794
1863
|
turnId?: string;
|
|
1795
1864
|
type: "text_start";
|
|
1796
1865
|
}) | {
|
|
@@ -1798,11 +1867,21 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
1798
1867
|
executionId: string;
|
|
1799
1868
|
id: string;
|
|
1800
1869
|
seq: number;
|
|
1870
|
+
subagent?: {
|
|
1871
|
+
agentName?: string;
|
|
1872
|
+
parentToolCallId?: string;
|
|
1873
|
+
toolName: string;
|
|
1874
|
+
};
|
|
1801
1875
|
type: "text_delta";
|
|
1802
1876
|
} | {
|
|
1803
1877
|
executionId: string;
|
|
1804
1878
|
id: string;
|
|
1805
1879
|
seq: number;
|
|
1880
|
+
subagent?: {
|
|
1881
|
+
agentName?: string;
|
|
1882
|
+
parentToolCallId?: string;
|
|
1883
|
+
toolName: string;
|
|
1884
|
+
};
|
|
1806
1885
|
text?: string;
|
|
1807
1886
|
type: "text_complete";
|
|
1808
1887
|
} | ({
|
|
@@ -1811,18 +1890,33 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
1811
1890
|
parentToolCallId?: string;
|
|
1812
1891
|
scope?: "turn" | "loop";
|
|
1813
1892
|
seq: number;
|
|
1893
|
+
subagent?: {
|
|
1894
|
+
agentName?: string;
|
|
1895
|
+
parentToolCallId?: string;
|
|
1896
|
+
toolName: string;
|
|
1897
|
+
};
|
|
1814
1898
|
type: "reasoning_start";
|
|
1815
1899
|
}) | {
|
|
1816
1900
|
delta: string;
|
|
1817
1901
|
executionId: string;
|
|
1818
1902
|
id: string;
|
|
1819
1903
|
seq: number;
|
|
1904
|
+
subagent?: {
|
|
1905
|
+
agentName?: string;
|
|
1906
|
+
parentToolCallId?: string;
|
|
1907
|
+
toolName: string;
|
|
1908
|
+
};
|
|
1820
1909
|
type: "reasoning_delta";
|
|
1821
1910
|
} | ({
|
|
1822
1911
|
executionId: string;
|
|
1823
1912
|
id: string;
|
|
1824
1913
|
scope?: "turn" | "loop";
|
|
1825
1914
|
seq: number;
|
|
1915
|
+
subagent?: {
|
|
1916
|
+
agentName?: string;
|
|
1917
|
+
parentToolCallId?: string;
|
|
1918
|
+
toolName: string;
|
|
1919
|
+
};
|
|
1826
1920
|
text?: string;
|
|
1827
1921
|
type: "reasoning_complete";
|
|
1828
1922
|
}) | ({
|
|
@@ -1915,6 +2009,11 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
1915
2009
|
seq: number;
|
|
1916
2010
|
startedAt?: string;
|
|
1917
2011
|
stepId?: string;
|
|
2012
|
+
subagent?: {
|
|
2013
|
+
agentName?: string;
|
|
2014
|
+
parentToolCallId?: string;
|
|
2015
|
+
toolName: string;
|
|
2016
|
+
};
|
|
1918
2017
|
toolCallId: string;
|
|
1919
2018
|
toolName: string;
|
|
1920
2019
|
toolType: string;
|
|
@@ -1923,6 +2022,11 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
1923
2022
|
delta: string;
|
|
1924
2023
|
executionId: string;
|
|
1925
2024
|
seq: number;
|
|
2025
|
+
subagent?: {
|
|
2026
|
+
agentName?: string;
|
|
2027
|
+
parentToolCallId?: string;
|
|
2028
|
+
toolName: string;
|
|
2029
|
+
};
|
|
1926
2030
|
toolCallId: string;
|
|
1927
2031
|
type: "tool_input_delta";
|
|
1928
2032
|
} | {
|
|
@@ -1930,6 +2034,11 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
1930
2034
|
hiddenParameterNames?: Array<string>;
|
|
1931
2035
|
parameters: Record<string, unknown>;
|
|
1932
2036
|
seq: number;
|
|
2037
|
+
subagent?: {
|
|
2038
|
+
agentName?: string;
|
|
2039
|
+
parentToolCallId?: string;
|
|
2040
|
+
toolName: string;
|
|
2041
|
+
};
|
|
1933
2042
|
toolCallId: string;
|
|
1934
2043
|
toolName?: string;
|
|
1935
2044
|
type: "tool_input_complete";
|
|
@@ -1947,6 +2056,11 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
1947
2056
|
result?: unknown;
|
|
1948
2057
|
seq: number;
|
|
1949
2058
|
stepId?: string;
|
|
2059
|
+
subagent?: {
|
|
2060
|
+
agentName?: string;
|
|
2061
|
+
parentToolCallId?: string;
|
|
2062
|
+
toolName: string;
|
|
2063
|
+
};
|
|
1950
2064
|
success: boolean;
|
|
1951
2065
|
toolCallId: string;
|
|
1952
2066
|
toolCost?: number;
|
|
@@ -2026,6 +2140,19 @@ type RuntypeExecutionStreamEvent = ({
|
|
|
2026
2140
|
recoverable?: boolean;
|
|
2027
2141
|
seq: number;
|
|
2028
2142
|
type: "error";
|
|
2143
|
+
}) | ({
|
|
2144
|
+
epoch: number;
|
|
2145
|
+
executionId: string;
|
|
2146
|
+
kind: "compaction";
|
|
2147
|
+
outcome?: "ok" | "failed" | "gap" | "skipped";
|
|
2148
|
+
phase: "start" | "complete";
|
|
2149
|
+
reason: "threshold" | "overflow" | "manual" | "surface_policy" | "provider_mismatch";
|
|
2150
|
+
seq: number;
|
|
2151
|
+
strategy: "provider_native" | "summary";
|
|
2152
|
+
tier: number;
|
|
2153
|
+
tokensAfter?: number;
|
|
2154
|
+
tokensBefore?: number;
|
|
2155
|
+
type: "context_notice";
|
|
2029
2156
|
}) | {
|
|
2030
2157
|
executionId: string;
|
|
2031
2158
|
seq: number;
|
|
@@ -3185,15 +3312,15 @@ type AgentMessageMetadata = {
|
|
|
3185
3312
|
*/
|
|
3186
3313
|
parentStepId?: string;
|
|
3187
3314
|
/**
|
|
3188
|
-
* Set to `true` on a tool-variant message produced from
|
|
3315
|
+
* Set to `true` on a tool-variant message produced from an `await`
|
|
3189
3316
|
* event (`awaitReason: "local_tool_required"`). Signals to UI code that
|
|
3190
3317
|
* the tool call is a LOCAL tool and the server is paused waiting for a
|
|
3191
3318
|
* `POST /v1/dispatch/resume` with the user's answer keyed by tool name.
|
|
3192
3319
|
*/
|
|
3193
3320
|
awaitingLocalTool?: boolean;
|
|
3194
3321
|
/**
|
|
3195
|
-
* The provider per-call id (`toolu_…`) carried on the `
|
|
3196
|
-
*
|
|
3322
|
+
* The provider per-call id (`toolu_…`) carried on the `await`
|
|
3323
|
+
* event for a LOCAL tool (core#3878). Present only when the
|
|
3197
3324
|
* server emits it. Two PARALLEL calls to the same tool in one turn share a
|
|
3198
3325
|
* `toolName` (and a collapsed `toolId`) but get DISTINCT `webMcpToolCallId`s,
|
|
3199
3326
|
* so this is the key the widget batches a single `/resume` on: preferred
|
|
@@ -5343,7 +5470,7 @@ type EventStreamConfig = {
|
|
|
5343
5470
|
/**
|
|
5344
5471
|
* Custom badge color mappings by event type prefix or exact type.
|
|
5345
5472
|
* Keys are matched as exact match first, then prefix match (keys ending with "_").
|
|
5346
|
-
* @example { "
|
|
5473
|
+
* @example { "execution_": { bg: "#dcfce7", text: "#166534" }, "error": { bg: "#fecaca", text: "#991b1b" } }
|
|
5347
5474
|
*/
|
|
5348
5475
|
badgeColors?: Record<string, EventStreamBadgeColor>;
|
|
5349
5476
|
/**
|
|
@@ -6821,9 +6948,13 @@ interface VoiceProvider {
|
|
|
6821
6948
|
* `isFinal=false` is a live interim update (user partials, or assistant deltas
|
|
6822
6949
|
* on providers that stream them); `isFinal=true` finalizes that role's text.
|
|
6823
6950
|
* On the realtime `runtype` path, interim updates fire for the `user` only and
|
|
6824
|
-
* the `assistant` arrives as a single final.
|
|
6951
|
+
* the `assistant` arrives as a single final. Providers with overlapping turns
|
|
6952
|
+
* must include the same turnId on user and assistant finals; without IDs,
|
|
6953
|
+
* providers must discard cancelled output before emitting the next user final.
|
|
6825
6954
|
*/
|
|
6826
|
-
onTranscript?(callback: (role: 'user' | 'assistant', text: string, isFinal: boolean
|
|
6955
|
+
onTranscript?(callback: (role: 'user' | 'assistant', text: string, isFinal: boolean, metadata?: {
|
|
6956
|
+
turnId?: string;
|
|
6957
|
+
}) => void): void;
|
|
6827
6958
|
/** Register a callback for per-turn latency metrics (realtime path). */
|
|
6828
6959
|
onMetrics?(callback: (metrics: VoiceMetrics) => void): void;
|
|
6829
6960
|
/**
|
|
@@ -9234,16 +9365,16 @@ type AgentWidgetConfig = {
|
|
|
9234
9365
|
*
|
|
9235
9366
|
* @example
|
|
9236
9367
|
* ```typescript
|
|
9237
|
-
* // For Runtype
|
|
9368
|
+
* // For a custom backend (Runtype unified events are handled natively)
|
|
9238
9369
|
* config: {
|
|
9239
9370
|
* parseSSEEvent: (data) => {
|
|
9240
|
-
* if (
|
|
9241
|
-
* return { text: data.
|
|
9371
|
+
* if (data.type === 'token' && typeof data.value === 'string') {
|
|
9372
|
+
* return { text: data.value };
|
|
9242
9373
|
* }
|
|
9243
|
-
* if (data.type === '
|
|
9374
|
+
* if (data.type === 'done') {
|
|
9244
9375
|
* return { done: true };
|
|
9245
9376
|
* }
|
|
9246
|
-
* if (data.type === '
|
|
9377
|
+
* if (data.type === 'failure') {
|
|
9247
9378
|
* return { error: data.error };
|
|
9248
9379
|
* }
|
|
9249
9380
|
* return null; // Ignore other events
|
|
@@ -9434,7 +9565,7 @@ type AgentWidgetReasoning = {
|
|
|
9434
9565
|
/**
|
|
9435
9566
|
* Reasoning channel scope (wire spec). `"turn"` is ordinary per-turn
|
|
9436
9567
|
* thinking; `"loop"` is a cross-iteration agent reflection (the fold that
|
|
9437
|
-
* replaced the legacy `agent_reflection` event).
|
|
9568
|
+
* replaced the legacy `agent_reflection` event). Optional when the stream does not specify a scope.
|
|
9438
9569
|
*/
|
|
9439
9570
|
scope?: "turn" | "loop";
|
|
9440
9571
|
startedAt?: number;
|
|
@@ -9448,6 +9579,9 @@ type AgentWidgetToolCall = {
|
|
|
9448
9579
|
args?: unknown;
|
|
9449
9580
|
chunks?: string[];
|
|
9450
9581
|
result?: unknown;
|
|
9582
|
+
/** Whether the tool succeeded; failure does not necessarily end the execution. */
|
|
9583
|
+
success?: boolean;
|
|
9584
|
+
error?: string;
|
|
9451
9585
|
duration?: number;
|
|
9452
9586
|
startedAt?: number;
|
|
9453
9587
|
completedAt?: number;
|
|
@@ -9478,7 +9612,7 @@ type AgentWidgetApproval = {
|
|
|
9478
9612
|
type AgentWidgetMessageVariant = "assistant" | "reasoning" | "tool" | "approval";
|
|
9479
9613
|
/**
|
|
9480
9614
|
* Per-turn / per-step stop reason emitted by the runtime on
|
|
9481
|
-
* `
|
|
9615
|
+
* `turn_complete` and `step_complete` SSE events. The vocabulary is
|
|
9482
9616
|
* owned by the upstream Runtype API: do not extend without coordination.
|
|
9483
9617
|
*
|
|
9484
9618
|
* - `end_turn`: natural completion (no affordance needed)
|
|
@@ -9609,7 +9743,7 @@ type AgentWidgetMessage = {
|
|
|
9609
9743
|
*/
|
|
9610
9744
|
agentMetadata?: AgentMessageMetadata;
|
|
9611
9745
|
/**
|
|
9612
|
-
* Per-turn stop reason reported by the runtime on `
|
|
9746
|
+
* Per-turn stop reason reported by the runtime on `turn_complete`
|
|
9613
9747
|
* (agent-loop path) or the last `step_complete` for a prompt step
|
|
9614
9748
|
* (dispatch / flow path). Absent when the API did not report a value.
|
|
9615
9749
|
*
|
|
@@ -10290,7 +10424,7 @@ declare class AgentWidgetClient {
|
|
|
10290
10424
|
* Returns the raw Response so the caller can pipe its SSE body through
|
|
10291
10425
|
* `connectStream()`.
|
|
10292
10426
|
*
|
|
10293
|
-
* @param executionId - The paused execution id carried on `
|
|
10427
|
+
* @param executionId - The paused execution id carried on `await`.
|
|
10294
10428
|
* @param toolOutputs - Map keyed by per-call `toolCallId` (core#3878),
|
|
10295
10429
|
* falling back to tool name for legacy servers → the tool's result value.
|
|
10296
10430
|
*/
|
|
@@ -10576,6 +10710,8 @@ declare class AgentWidgetSession {
|
|
|
10576
10710
|
deactivateBargeIn(): Promise<void>;
|
|
10577
10711
|
private pendingVoiceUserMessageId;
|
|
10578
10712
|
private pendingVoiceAssistantMessageId;
|
|
10713
|
+
private voiceTurns;
|
|
10714
|
+
private voiceDisconnectPromise;
|
|
10579
10715
|
private ttsSpokenMessageIds;
|
|
10580
10716
|
private readAloud;
|
|
10581
10717
|
/**
|
|
@@ -10604,6 +10740,8 @@ declare class AgentWidgetSession {
|
|
|
10604
10740
|
* Cleanup voice resources
|
|
10605
10741
|
*/
|
|
10606
10742
|
cleanupVoice(): void;
|
|
10743
|
+
private disconnectVoice;
|
|
10744
|
+
private settlePendingVoiceTurn;
|
|
10607
10745
|
/**
|
|
10608
10746
|
* Extract voice configuration from widget config
|
|
10609
10747
|
*/
|
|
@@ -11098,7 +11236,7 @@ declare class AgentWidgetSession {
|
|
|
11098
11236
|
/**
|
|
11099
11237
|
* Resolve a paused `ask_user_question` LOCAL tool call.
|
|
11100
11238
|
*
|
|
11101
|
-
* When the server emits `
|
|
11239
|
+
* When the server emits `await` for `ask_user_question`, the widget
|
|
11102
11240
|
* renders the answer-pill sheet and calls this method once the user
|
|
11103
11241
|
* picks. Steps:
|
|
11104
11242
|
* 1. POST the answer to `/resume` via `client.resumeFlow`.
|
|
@@ -11127,10 +11265,10 @@ declare class AgentWidgetSession {
|
|
|
11127
11265
|
markAskUserQuestionResolved(toolMessage: AgentWidgetMessage, answers?: Record<string, string | string[]>): void;
|
|
11128
11266
|
resolveAskUserQuestion(toolMessage: AgentWidgetMessage, answer: string | Record<string, string | string[]>): Promise<void>;
|
|
11129
11267
|
/**
|
|
11130
|
-
* Collect an auto-resolving LOCAL-tool `
|
|
11268
|
+
* Collect an auto-resolving LOCAL-tool `await` (`webmcp:*` page tools
|
|
11131
11269
|
* and the built-in `suggest_replies`) into a per-executionId batch
|
|
11132
11270
|
* and schedule a single deferred flush. Parallel calls (core#3878) emit
|
|
11133
|
-
* several `
|
|
11271
|
+
* several `await`s for ONE paused execution within the same stream tick;
|
|
11134
11272
|
* buffering them and flushing once lets us post ONE `/resume` keyed by the
|
|
11135
11273
|
* per-call `webMcpToolCallId` rather than racing N name-keyed resumes on the
|
|
11136
11274
|
* same execution (which 404'd on the second and hung the turn).
|
|
@@ -11148,7 +11286,7 @@ declare class AgentWidgetSession {
|
|
|
11148
11286
|
/**
|
|
11149
11287
|
* Flush every buffered local-tool await batch, one `/resume` per executionId.
|
|
11150
11288
|
* Called once a stream ends (`status: idle` / `error`): by then all parallel
|
|
11151
|
-
* `
|
|
11289
|
+
* `await`s the stream carried have been collected, even if split across
|
|
11152
11290
|
* SSE chunks. Deferred via `queueMicrotask` (epoch-guarded) so the idle
|
|
11153
11291
|
* handler returns first and the stream's end-of-stream teardown (streaming /
|
|
11154
11292
|
* abortController) settles before a resolve grabs them: the same ordering the
|
|
@@ -11169,7 +11307,7 @@ declare class AgentWidgetSession {
|
|
|
11169
11307
|
* Persisted-resolution guard for `suggest_replies`. The in-memory dedupe
|
|
11170
11308
|
* sets (`webMcpInflightKeys` / `webMcpResolvedKeys`) are cleared by
|
|
11171
11309
|
* hydrateMessages/clearMessages/cancel, but `suggestRepliesResolved`
|
|
11172
|
-
* survives on the stored message, so a stale `
|
|
11310
|
+
* survives on the stored message, so a stale `await` re-emit after a
|
|
11173
11311
|
* hydration must not re-POST `/resume` for an already-resolved call (the
|
|
11174
11312
|
* historical double-resume failure mode the batching work exists to avoid).
|
|
11175
11313
|
* Checks the LIVE message first; the handleEvent snapshot is a fresh wire
|
|
@@ -11203,12 +11341,12 @@ declare class AgentWidgetSession {
|
|
|
11203
11341
|
* resumes with a canned "shown" result (the chips render from the message
|
|
11204
11342
|
* list, not from this resolve).
|
|
11205
11343
|
*
|
|
11206
|
-
* Triggered automatically from `handleEvent` when
|
|
11344
|
+
* Triggered automatically from `handleEvent` when an `await`-derived
|
|
11207
11345
|
* message arrives for such a tool: the user does not click a pill; the
|
|
11208
11346
|
* bridge's confirm-bubble gate (WebMCP only) is the only interactive
|
|
11209
11347
|
* surface.
|
|
11210
11348
|
*
|
|
11211
|
-
* Idempotent on the message's `toolCall.id`: re-emits of the same
|
|
11349
|
+
* Idempotent on the message's `toolCall.id`: re-emits of the same await
|
|
11212
11350
|
* (e.g. from message coalescing) won't double-fire `tool.execute`. Failure
|
|
11213
11351
|
* modes, declined, timed out, throw, unknown tool, all resolve into a
|
|
11214
11352
|
* `{ isError: true, content: [...] }` payload that resumes the dispatch
|
|
@@ -11287,7 +11425,7 @@ declare class AgentWidgetSession {
|
|
|
11287
11425
|
private trackCursor;
|
|
11288
11426
|
/**
|
|
11289
11427
|
* The drop gate: is this stream-end a dropped connection we should reconnect,
|
|
11290
|
-
* rather than a graceful finish or an intentional `
|
|
11428
|
+
* rather than a graceful finish or an intentional `await` pause? ALL must
|
|
11291
11429
|
* hold (see plan §Design overview keystone 3).
|
|
11292
11430
|
*/
|
|
11293
11431
|
private isDurableDrop;
|