@runtypelabs/persona 3.36.0 → 4.0.0

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.
Files changed (48) hide show
  1. package/README.md +0 -1
  2. package/dist/animations/glyph-cycle.d.cts +1 -1
  3. package/dist/animations/glyph-cycle.d.ts +1 -1
  4. package/dist/animations/{types-DgYsuwXL.d.cts → types-B_xbfvR0.d.cts} +263 -181
  5. package/dist/animations/{types-DgYsuwXL.d.ts → types-B_xbfvR0.d.ts} +263 -181
  6. package/dist/animations/wipe.d.cts +1 -1
  7. package/dist/animations/wipe.d.ts +1 -1
  8. package/dist/codegen.cjs +1 -1
  9. package/dist/codegen.js +1 -1
  10. package/dist/index.cjs +47 -47
  11. package/dist/index.cjs.map +1 -1
  12. package/dist/index.d.cts +328 -821
  13. package/dist/index.d.ts +328 -821
  14. package/dist/index.global.js +39 -39
  15. package/dist/index.global.js.map +1 -1
  16. package/dist/index.js +47 -47
  17. package/dist/index.js.map +1 -1
  18. package/dist/install.global.js +1 -1
  19. package/dist/install.global.js.map +1 -1
  20. package/dist/smart-dom-reader.d.cts +268 -181
  21. package/dist/smart-dom-reader.d.ts +268 -181
  22. package/dist/theme-editor-preview.cjs +41 -41
  23. package/dist/theme-editor-preview.d.cts +268 -181
  24. package/dist/theme-editor-preview.d.ts +268 -181
  25. package/dist/theme-editor-preview.js +41 -41
  26. package/dist/theme-editor.d.cts +268 -181
  27. package/dist/theme-editor.d.ts +268 -181
  28. package/package.json +1 -1
  29. package/src/client.test.ts +506 -1003
  30. package/src/client.ts +676 -909
  31. package/src/components/tool-bubble.ts +46 -33
  32. package/src/generated/runtype-openapi-contract.ts +211 -714
  33. package/src/index-core.ts +2 -3
  34. package/src/install.test.ts +1 -34
  35. package/src/install.ts +1 -22
  36. package/src/runtime/init.test.ts +8 -67
  37. package/src/runtime/init.ts +2 -17
  38. package/src/session.test.ts +8 -8
  39. package/src/session.ts +1 -1
  40. package/src/types.ts +11 -2
  41. package/src/ui.postprocess.test.ts +107 -0
  42. package/src/ui.ts +40 -5
  43. package/src/utils/__fixtures__/unified-translator.oracle.ts +717 -0
  44. package/src/utils/copy-selection.test.ts +37 -0
  45. package/src/utils/copy-selection.ts +19 -0
  46. package/src/utils/event-stream-capture.test.ts +9 -64
  47. package/src/utils/sequence-buffer.test.ts +0 -256
  48. package/src/utils/sequence-buffer.ts +0 -130
@@ -1,54 +1,77 @@
1
- type RuntypeAgentSSEEvent = {
2
- agentId: string;
3
- agentName: string;
4
- config?: {
5
- enableReflection?: boolean;
6
- model?: string;
7
- };
1
+ type RuntypeExecutionStreamEvent = ({
2
+ agentId?: string;
3
+ agentName?: string;
4
+ config?: Record<string, unknown>;
8
5
  executionId: string;
9
- maxTurns: number;
6
+ flowId?: string;
7
+ flowName?: string;
8
+ kind: "agent" | "flow";
9
+ maxTurns?: number;
10
10
  seq: number;
11
+ source?: string;
11
12
  startedAt: string;
12
- type: "agent_start";
13
- } | {
13
+ totalSteps?: number;
14
+ type: "execution_start";
15
+ }) | ({
16
+ completedAt?: string;
17
+ durationMs?: number;
14
18
  executionId: string;
15
- iteration: number;
16
- maxTurns: number;
19
+ failedSteps?: number;
20
+ finalOutput?: string;
21
+ iterations?: number;
22
+ kind: "agent" | "flow";
17
23
  seq: number;
18
- startedAt: string;
24
+ stopReason?: string;
25
+ success: boolean;
26
+ successfulSteps?: number;
19
27
  totalCost?: number;
20
- type: "agent_iteration_start";
21
- } | ({
28
+ totalSteps?: number;
29
+ totalTokens?: {
30
+ input: number;
31
+ output: number;
32
+ };
33
+ type: "execution_complete";
34
+ }) | ({
35
+ code?: string;
36
+ completedAt?: string;
37
+ error: string | {
38
+ code: string;
39
+ details?: Record<string, unknown>;
40
+ message: string;
41
+ };
22
42
  executionId: string;
23
- iteration: number;
24
- role: "user" | "assistant" | "system";
43
+ kind: "agent" | "flow";
25
44
  seq: number;
26
- turnId: string;
27
- turnIndex: number;
28
- type: "agent_turn_start";
45
+ type: "execution_error";
46
+ upgradeUrl?: string;
29
47
  }) | ({
30
- contentType: "text" | "thinking" | "tool_input";
31
- delta: string;
32
48
  executionId: string;
33
- iteration: number;
49
+ id: string;
50
+ iteration?: number;
51
+ role: "user" | "assistant" | "system";
34
52
  seq: number;
35
- turnId: string;
36
- type: "agent_turn_delta";
53
+ turnIndex?: number;
54
+ type: "turn_start";
37
55
  }) | ({
38
- completedAt: string;
56
+ completedAt?: string;
39
57
  content?: string;
40
58
  cost?: number;
41
- estimatedContextBreakdown?: {
42
- categories: Record<string, {
43
- chars: number;
44
- estimatedTokens: number;
59
+ executionId: string;
60
+ fallback?: {
61
+ attempts: Array<{
62
+ attempt: number;
63
+ error?: string;
64
+ model?: string;
65
+ success: boolean;
66
+ type: "retry" | "model" | "message" | "flow";
45
67
  }>;
46
- contextWindowSize?: number;
47
- estimatedTotalTokens: number;
48
- estimatedUtilizationPercent?: number;
68
+ exhausted: boolean;
69
+ model?: string;
70
+ reason?: string | null;
71
+ used: boolean;
49
72
  };
50
- executionId: string;
51
- iteration: number;
73
+ id: string;
74
+ iteration?: number;
52
75
  role: "user" | "assistant" | "system";
53
76
  seq: number;
54
77
  stopReason?: "end_turn" | "max_tool_calls" | "length" | "content_filter" | "error" | "unknown";
@@ -56,207 +79,260 @@ type RuntypeAgentSSEEvent = {
56
79
  input: number;
57
80
  output: number;
58
81
  };
59
- turnId: string;
60
- type: "agent_turn_complete";
82
+ type: "turn_complete";
83
+ }) | {
84
+ executionId: string;
85
+ id: string;
86
+ index?: number;
87
+ name?: string;
88
+ outputVariable?: string;
89
+ seq: number;
90
+ startedAt?: string;
91
+ stepType?: string;
92
+ totalSteps?: number;
93
+ type: "step_start";
94
+ } | ({
95
+ completedAt?: string;
96
+ durationMs?: number;
97
+ error?: string;
98
+ executionId: string;
99
+ fallback?: {
100
+ attempts: Array<{
101
+ attempt: number;
102
+ error?: string;
103
+ model?: string;
104
+ success: boolean;
105
+ type: "retry" | "model" | "message" | "flow";
106
+ }>;
107
+ exhausted: boolean;
108
+ model?: string;
109
+ reason?: string | null;
110
+ used: boolean;
111
+ };
112
+ id: string;
113
+ name?: string;
114
+ result?: unknown;
115
+ seq: number;
116
+ stepType?: string;
117
+ stopReason?: "end_turn" | "max_tool_calls" | "length" | "content_filter" | "error" | "unknown";
118
+ success?: boolean;
119
+ tokensUsed?: number;
120
+ type: "step_complete";
121
+ unresolvedVariables?: Array<string>;
122
+ }) | {
123
+ executionId: string;
124
+ id: string;
125
+ index?: number;
126
+ name?: string;
127
+ seq: number;
128
+ skippedAt?: string;
129
+ stepType?: string;
130
+ totalSteps?: number;
131
+ type: "step_skip";
132
+ when?: string;
133
+ } | ({
134
+ executionId: string;
135
+ id: string;
136
+ parentToolCallId?: string;
137
+ role?: "user" | "assistant" | "system";
138
+ seq: number;
139
+ stepId?: string;
140
+ turnId?: string;
141
+ type: "text_start";
142
+ }) | {
143
+ delta: string;
144
+ executionId: string;
145
+ id: string;
146
+ seq: number;
147
+ type: "text_delta";
148
+ } | {
149
+ executionId: string;
150
+ id: string;
151
+ seq: number;
152
+ text?: string;
153
+ type: "text_complete";
154
+ } | ({
155
+ executionId: string;
156
+ id: string;
157
+ parentToolCallId?: string;
158
+ scope?: "turn" | "loop";
159
+ seq: number;
160
+ type: "reasoning_start";
161
+ }) | {
162
+ delta: string;
163
+ executionId: string;
164
+ id: string;
165
+ seq: number;
166
+ type: "reasoning_delta";
167
+ } | ({
168
+ executionId: string;
169
+ id: string;
170
+ scope?: "turn" | "loop";
171
+ seq: number;
172
+ text?: string;
173
+ type: "reasoning_complete";
61
174
  }) | ({
62
175
  executionId: string;
63
- iteration: number;
176
+ id: string;
177
+ mediaType: string;
178
+ role?: "user" | "assistant" | "system";
179
+ seq: number;
180
+ toolCallId?: string;
181
+ type: "media_start";
182
+ }) | {
183
+ delta: string;
184
+ executionId: string;
185
+ id: string;
186
+ seq: number;
187
+ type: "media_delta";
188
+ } | {
189
+ data?: string;
190
+ executionId: string;
191
+ id: string;
192
+ mediaType?: string;
193
+ seq: number;
194
+ toolCallId?: string;
195
+ type: "media_complete";
196
+ url?: string;
197
+ } | ({
198
+ artifactType: "markdown" | "component";
199
+ component?: string;
200
+ executionId?: string;
201
+ id: string;
202
+ seq?: number;
203
+ title?: string;
204
+ type: "artifact_start";
205
+ }) | {
206
+ delta: string;
207
+ executionId?: string;
208
+ id: string;
209
+ seq?: number;
210
+ type: "artifact_delta";
211
+ } | {
212
+ component: string;
213
+ executionId?: string;
214
+ id: string;
215
+ props: Record<string, unknown>;
216
+ seq?: number;
217
+ type: "artifact_update";
218
+ } | {
219
+ executionId?: string;
220
+ id: string;
221
+ seq?: number;
222
+ type: "artifact_complete";
223
+ } | {
224
+ executionId: string;
225
+ id?: string;
226
+ seq: number;
227
+ sourceType?: string;
228
+ title?: string;
229
+ type: "source";
230
+ url?: string;
231
+ [key: string]: unknown;
232
+ } | ({
233
+ executionId: string;
234
+ hiddenParameterNames?: Array<string>;
235
+ iteration?: number;
64
236
  origin?: "webmcp" | "sdk";
65
237
  pageOrigin?: string;
66
238
  parameters?: Record<string, unknown>;
67
239
  seq: number;
240
+ startedAt?: string;
241
+ stepId?: string;
68
242
  toolCallId: string;
69
243
  toolName: string;
70
- toolType: "flow" | "mcp" | "builtin" | "custom" | "external" | "advisor" | "subagent" | "local";
71
- type: "agent_tool_start";
244
+ toolType: string;
245
+ type: "tool_start";
72
246
  }) | {
73
247
  delta: string;
74
248
  executionId: string;
75
- iteration: number;
76
249
  seq: number;
77
250
  toolCallId: string;
78
- type: "agent_tool_delta";
251
+ type: "tool_input_delta";
79
252
  } | {
80
- delta: string;
81
253
  executionId: string;
82
- iteration: number;
254
+ hiddenParameterNames?: Array<string>;
255
+ parameters: Record<string, unknown>;
83
256
  seq: number;
84
257
  toolCallId: string;
85
- type: "agent_tool_input_delta";
258
+ toolName?: string;
259
+ type: "tool_input_complete";
86
260
  } | {
261
+ delta: string;
87
262
  executionId: string;
88
- hiddenParameterNames?: Array<string>;
89
- iteration: number;
90
- parameters: Record<string, unknown>;
91
263
  seq: number;
92
264
  toolCallId: string;
93
- toolName: string;
94
- type: "agent_tool_input_complete";
265
+ type: "tool_output_delta";
95
266
  } | {
267
+ error?: string;
96
268
  executionId: string;
97
269
  executionTime?: number;
98
- iteration: number;
270
+ iteration?: number;
99
271
  result?: unknown;
100
272
  seq: number;
273
+ stepId?: string;
101
274
  success: boolean;
102
275
  toolCallId: string;
103
- toolName: string;
104
- type: "agent_tool_complete";
105
- } | ({
106
- executionId?: string;
107
- iteration: number;
108
- media: Array<({
109
- annotations?: {
110
- audience?: Array<"user" | "assistant">;
111
- };
112
- data: string;
113
- mediaType: string;
114
- type: "media";
115
- }) | ({
116
- annotations?: {
117
- audience?: Array<"user" | "assistant">;
118
- };
119
- mediaType?: string;
120
- type: "image-url";
121
- url: string;
122
- }) | ({
123
- annotations?: {
124
- audience?: Array<"user" | "assistant">;
125
- };
126
- mediaType: string;
127
- type: "file-url";
128
- url: string;
129
- })>;
130
- seq?: number;
131
- toolCallId: string;
132
- toolName: string;
133
- type: "agent_media";
134
- }) | {
276
+ toolName?: string;
277
+ type: "tool_complete";
278
+ } | {
135
279
  approvalId: string;
136
- description: string;
280
+ description?: string;
137
281
  executionId: string;
138
- externalAgent?: {
139
- contextId?: string;
140
- taskId?: string;
141
- };
142
282
  iteration?: number;
143
283
  parameters?: Record<string, unknown>;
144
284
  reason?: string;
145
285
  seq: number;
146
- startedAt: string;
147
- timeout: number;
148
- toolCallId: string;
286
+ startedAt?: string;
287
+ subagent?: {
288
+ agentName?: string;
289
+ toolName: string;
290
+ };
291
+ timeout?: number;
292
+ toolCallId?: string;
149
293
  toolName: string;
150
- toolType: string;
151
- type: "agent_approval_start";
294
+ toolType?: string;
295
+ type: "approval_start";
152
296
  } | ({
153
297
  approvalId: string;
154
- completedAt: string;
298
+ completedAt?: string;
155
299
  decision: "approved" | "denied" | "timeout";
156
300
  executionId: string;
157
- resolvedBy: "user" | "system";
301
+ resolvedBy?: "user" | "system";
158
302
  seq: number;
159
- type: "agent_approval_complete";
303
+ type: "approval_complete";
160
304
  }) | ({
161
- awaitedAt: string;
305
+ awaitedAt?: string;
162
306
  executionId: string;
163
307
  origin?: "webmcp" | "sdk";
164
308
  pageOrigin?: string;
165
309
  parameters?: Record<string, unknown>;
166
310
  seq: number;
167
311
  toolCallId?: string;
168
- toolId: string;
169
- toolName: string;
170
- type: "agent_await";
171
- }) | {
172
- completedAt: string;
173
- cost?: number;
174
- duration?: number;
175
- estimatedContextBreakdown?: {
176
- categories: Record<string, {
177
- chars: number;
178
- estimatedTokens: number;
179
- }>;
180
- contextWindowSize?: number;
181
- estimatedTotalTokens: number;
182
- estimatedUtilizationPercent?: number;
183
- };
184
- executionId: string;
185
- iteration: number;
186
- output?: string;
187
- runningTotalCost?: number;
188
- seq: number;
189
- stopConditionMet: boolean;
190
- tokens?: {
191
- input: number;
192
- output: number;
193
- };
194
- toolCallsMade: number;
195
- type: "agent_iteration_complete";
196
- } | {
197
- executionId: string;
198
- iteration: number;
199
- reflection?: string;
200
- seq: number;
201
- timestamp?: string;
202
- type: "agent_reflection";
203
- } | {
204
- activatedCapabilities: Array<string>;
205
- executionId: string;
206
- iteration: number;
207
- seq: number;
208
- skill: string;
209
- timestamp?: string;
210
- toolCallId: string;
211
- type: "agent_skill_loaded";
212
- } | ({
213
- executionId: string;
214
- iteration: number;
215
- outcome: "pending_approval" | "auto_published";
216
- proposalId?: string;
217
- seq: number;
218
- skill: string;
219
- timestamp?: string;
220
- toolCallId: string;
221
- type: "agent_skill_proposed";
312
+ toolId?: string;
313
+ toolName?: string;
314
+ type: "await";
222
315
  }) | ({
223
- agentId: string;
224
- completedAt: string;
225
- duration?: number;
226
- error?: string;
227
- executionId: string;
228
- externalAgent?: {
229
- contextId?: string;
230
- taskId?: string;
231
- };
232
- finalOutput?: string;
233
- iterations: number;
234
- seq: number;
235
- stopReason: "complete" | "end_turn" | "max_turns" | "max_cost" | "timeout" | "error";
236
- success: boolean;
237
- totalCost?: number;
238
- totalTokens?: {
239
- input: number;
240
- output: number;
241
- };
242
- type: "agent_complete";
243
- }) | {
244
- error: {
316
+ error: string | {
245
317
  code: string;
246
318
  details?: Record<string, unknown>;
247
319
  message: string;
248
320
  };
249
321
  executionId: string;
250
- iteration?: number;
251
- recoverable: boolean;
322
+ recoverable?: boolean;
252
323
  seq: number;
253
- timestamp?: string;
254
- type: "agent_error";
255
- } | {
324
+ type: "error";
325
+ }) | {
256
326
  executionId: string;
257
327
  seq: number;
258
328
  timestamp: string;
259
- type: "agent_ping";
329
+ type: "ping";
330
+ } | {
331
+ executionId?: string;
332
+ name: string;
333
+ seq?: number;
334
+ type: "custom";
335
+ value?: unknown;
260
336
  };
261
337
  type RuntypeFlowSSEEvent = {
262
338
  executionContext?: Record<string, unknown>;
@@ -554,9 +630,9 @@ type RuntypeFlowSSEEvent = {
554
630
  type RuntypeStreamEventOf<U, T extends string> = Extract<U, {
555
631
  type: T;
556
632
  }>;
557
- type RuntypeAgentTurnCompleteEvent = RuntypeStreamEventOf<RuntypeAgentSSEEvent, "agent_turn_complete">;
633
+ type RuntypeTurnCompleteEvent = RuntypeStreamEventOf<RuntypeExecutionStreamEvent, "turn_complete">;
558
634
  type RuntypeStepCompleteEvent = RuntypeStreamEventOf<RuntypeFlowSSEEvent, "step_complete">;
559
- type RuntypeStopReasonKind = NonNullable<RuntypeAgentTurnCompleteEvent["stopReason"] | RuntypeStepCompleteEvent["stopReason"]>;
635
+ type RuntypeStopReasonKind = NonNullable<RuntypeTurnCompleteEvent["stopReason"] | RuntypeStepCompleteEvent["stopReason"]>;
560
636
 
561
637
  /**
562
638
  * Text content part for multi-modal messages
@@ -752,6 +828,12 @@ type AgentWidgetReasoning = {
752
828
  id: string;
753
829
  status: "pending" | "streaming" | "complete";
754
830
  chunks: string[];
831
+ /**
832
+ * Reasoning channel scope (unified spec). `"turn"` is ordinary per-turn
833
+ * thinking; `"loop"` is a cross-iteration agent reflection (the fold that
834
+ * replaced the legacy `agent_reflection` event). Absent for legacy streams.
835
+ */
836
+ scope?: "turn" | "loop";
755
837
  startedAt?: number;
756
838
  completedAt?: number;
757
839
  durationMs?: number;
@@ -1,4 +1,4 @@
1
- import { S as StreamAnimationPlugin } from './types-DgYsuwXL.cjs';
1
+ import { S as StreamAnimationPlugin } from './types-B_xbfvR0.cjs';
2
2
 
3
3
  declare const wipe: StreamAnimationPlugin;
4
4
 
@@ -1,4 +1,4 @@
1
- import { S as StreamAnimationPlugin } from './types-DgYsuwXL.js';
1
+ import { S as StreamAnimationPlugin } from './types-B_xbfvR0.js';
2
2
 
3
3
  declare const wipe: StreamAnimationPlugin;
4
4
 
package/dist/codegen.cjs CHANGED
@@ -1,4 +1,4 @@
1
- "use strict";var $=Object.defineProperty;var T=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames;var R=Object.prototype.hasOwnProperty;var I=(e,r)=>{for(var n in r)$(e,n,{get:r[n],enumerable:!0})},W=(e,r,n,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of M(r))!R.call(e,o)&&o!==n&&$(e,o,{get:()=>r[o],enumerable:!(s=T(r,o))||s.enumerable});return e};var H=e=>W($({},"__esModule",{value:!0}),e);var B={};I(B,{generateCodeSnippet:()=>v});module.exports=H(B);var x="3.36.0";var c=x;function u(e){if(e!==void 0)return typeof e=="string"?e:Array.isArray(e)?`[${e.map(r=>r.toString()).join(", ")}]`:e.toString()}function k(e){if(e)return{getHeaders:u(e.getHeaders),onFeedback:u(e.onFeedback),onCopy:u(e.onCopy),requestMiddleware:u(e.requestMiddleware),actionHandlers:u(e.actionHandlers),actionParsers:u(e.actionParsers),postprocessMessage:u(e.postprocessMessage),contextProviders:u(e.contextProviders),streamParser:u(e.streamParser)}}var A=`({ text, message }: any) => {
1
+ "use strict";var $=Object.defineProperty;var T=Object.getOwnPropertyDescriptor;var M=Object.getOwnPropertyNames;var R=Object.prototype.hasOwnProperty;var I=(e,r)=>{for(var n in r)$(e,n,{get:r[n],enumerable:!0})},W=(e,r,n,s)=>{if(r&&typeof r=="object"||typeof r=="function")for(let o of M(r))!R.call(e,o)&&o!==n&&$(e,o,{get:()=>r[o],enumerable:!(s=T(r,o))||s.enumerable});return e};var H=e=>W($({},"__esModule",{value:!0}),e);var B={};I(B,{generateCodeSnippet:()=>v});module.exports=H(B);var x="4.0.0";var c=x;function u(e){if(e!==void 0)return typeof e=="string"?e:Array.isArray(e)?`[${e.map(r=>r.toString()).join(", ")}]`:e.toString()}function k(e){if(e)return{getHeaders:u(e.getHeaders),onFeedback:u(e.onFeedback),onCopy:u(e.onCopy),requestMiddleware:u(e.requestMiddleware),actionHandlers:u(e.actionHandlers),actionParsers:u(e.actionParsers),postprocessMessage:u(e.postprocessMessage),contextProviders:u(e.contextProviders),streamParser:u(e.streamParser)}}var A=`({ text, message }: any) => {
2
2
  const jsonSource = (message as any).rawContent || text || message.content;
3
3
  if (!jsonSource || typeof jsonSource !== 'string') return null;
4
4
  let cleanJson = jsonSource
package/dist/codegen.js CHANGED
@@ -1,4 +1,4 @@
1
- var S="3.36.0";var c=S;function u(e){if(e!==void 0)return typeof e=="string"?e:Array.isArray(e)?`[${e.map(r=>r.toString()).join(", ")}]`:e.toString()}function _(e){if(e)return{getHeaders:u(e.getHeaders),onFeedback:u(e.onFeedback),onCopy:u(e.onCopy),requestMiddleware:u(e.requestMiddleware),actionHandlers:u(e.actionHandlers),actionParsers:u(e.actionParsers),postprocessMessage:u(e.postprocessMessage),contextProviders:u(e.contextProviders),streamParser:u(e.streamParser)}}var x=`({ text, message }: any) => {
1
+ var S="4.0.0";var c=S;function u(e){if(e!==void 0)return typeof e=="string"?e:Array.isArray(e)?`[${e.map(r=>r.toString()).join(", ")}]`:e.toString()}function _(e){if(e)return{getHeaders:u(e.getHeaders),onFeedback:u(e.onFeedback),onCopy:u(e.onCopy),requestMiddleware:u(e.requestMiddleware),actionHandlers:u(e.actionHandlers),actionParsers:u(e.actionParsers),postprocessMessage:u(e.postprocessMessage),contextProviders:u(e.contextProviders),streamParser:u(e.streamParser)}}var x=`({ text, message }: any) => {
2
2
  const jsonSource = (message as any).rawContent || text || message.content;
3
3
  if (!jsonSource || typeof jsonSource !== 'string') return null;
4
4
  let cleanJson = jsonSource