@runtypelabs/persona 3.26.0 → 3.27.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.
@@ -1,3 +1,553 @@
1
+ type RuntypeAgentSSEEvent = {
2
+ agentId: string;
3
+ agentName: string;
4
+ config?: {
5
+ enableReflection?: boolean;
6
+ model?: string;
7
+ };
8
+ executionId: string;
9
+ maxTurns: number;
10
+ seq: number;
11
+ startedAt: string;
12
+ type: "agent_start";
13
+ } | {
14
+ executionId: string;
15
+ iteration: number;
16
+ maxTurns: number;
17
+ seq: number;
18
+ startedAt: string;
19
+ totalCost?: number;
20
+ type: "agent_iteration_start";
21
+ } | ({
22
+ executionId: string;
23
+ iteration: number;
24
+ role: "user" | "assistant" | "system";
25
+ seq: number;
26
+ turnId: string;
27
+ turnIndex: number;
28
+ type: "agent_turn_start";
29
+ }) | ({
30
+ contentType: "text" | "thinking" | "tool_input";
31
+ delta: string;
32
+ executionId: string;
33
+ iteration: number;
34
+ seq: number;
35
+ turnId: string;
36
+ type: "agent_turn_delta";
37
+ }) | ({
38
+ completedAt: string;
39
+ content?: string;
40
+ cost?: number;
41
+ estimatedContextBreakdown?: {
42
+ categories: Record<string, {
43
+ chars: number;
44
+ estimatedTokens: number;
45
+ }>;
46
+ contextWindowSize?: number;
47
+ estimatedTotalTokens: number;
48
+ estimatedUtilizationPercent?: number;
49
+ };
50
+ executionId: string;
51
+ iteration: number;
52
+ role: "user" | "assistant" | "system";
53
+ seq: number;
54
+ stopReason?: "end_turn" | "max_tool_calls" | "length" | "content_filter" | "error" | "unknown";
55
+ tokens?: {
56
+ input: number;
57
+ output: number;
58
+ };
59
+ turnId: string;
60
+ type: "agent_turn_complete";
61
+ }) | ({
62
+ executionId: string;
63
+ iteration: number;
64
+ origin?: "webmcp" | "sdk";
65
+ pageOrigin?: string;
66
+ parameters?: Record<string, unknown>;
67
+ seq: number;
68
+ toolCallId: string;
69
+ toolName: string;
70
+ toolType: "flow" | "mcp" | "builtin" | "custom" | "external" | "advisor" | "subagent" | "local";
71
+ type: "agent_tool_start";
72
+ }) | {
73
+ delta: string;
74
+ executionId: string;
75
+ iteration: number;
76
+ seq: number;
77
+ toolCallId: string;
78
+ type: "agent_tool_delta";
79
+ } | {
80
+ delta: string;
81
+ executionId: string;
82
+ iteration: number;
83
+ seq: number;
84
+ toolCallId: string;
85
+ type: "agent_tool_input_delta";
86
+ } | {
87
+ executionId: string;
88
+ hiddenParameterNames?: Array<string>;
89
+ iteration: number;
90
+ parameters: Record<string, unknown>;
91
+ seq: number;
92
+ toolCallId: string;
93
+ toolName: string;
94
+ type: "agent_tool_input_complete";
95
+ } | {
96
+ executionId: string;
97
+ executionTime?: number;
98
+ iteration: number;
99
+ result?: unknown;
100
+ seq: number;
101
+ success: boolean;
102
+ 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
+ }) | {
135
+ approvalId: string;
136
+ description: string;
137
+ executionId: string;
138
+ externalAgent?: {
139
+ contextId?: string;
140
+ taskId?: string;
141
+ };
142
+ iteration?: number;
143
+ parameters?: Record<string, unknown>;
144
+ seq: number;
145
+ startedAt: string;
146
+ timeout: number;
147
+ toolCallId: string;
148
+ toolName: string;
149
+ toolType: string;
150
+ type: "agent_approval_start";
151
+ } | ({
152
+ approvalId: string;
153
+ completedAt: string;
154
+ decision: "approved" | "denied" | "timeout";
155
+ executionId: string;
156
+ resolvedBy: "user" | "system";
157
+ seq: number;
158
+ type: "agent_approval_complete";
159
+ }) | ({
160
+ awaitedAt: string;
161
+ executionId: string;
162
+ origin?: "webmcp" | "sdk";
163
+ pageOrigin?: string;
164
+ parameters?: Record<string, unknown>;
165
+ seq: number;
166
+ toolCallId?: string;
167
+ toolId: string;
168
+ toolName: string;
169
+ type: "agent_await";
170
+ }) | {
171
+ completedAt: string;
172
+ cost?: number;
173
+ duration?: number;
174
+ estimatedContextBreakdown?: {
175
+ categories: Record<string, {
176
+ chars: number;
177
+ estimatedTokens: number;
178
+ }>;
179
+ contextWindowSize?: number;
180
+ estimatedTotalTokens: number;
181
+ estimatedUtilizationPercent?: number;
182
+ };
183
+ executionId: string;
184
+ iteration: number;
185
+ output?: string;
186
+ runningTotalCost?: number;
187
+ seq: number;
188
+ stopConditionMet: boolean;
189
+ tokens?: {
190
+ input: number;
191
+ output: number;
192
+ };
193
+ toolCallsMade: number;
194
+ type: "agent_iteration_complete";
195
+ } | {
196
+ executionId: string;
197
+ iteration: number;
198
+ reflection?: string;
199
+ seq: number;
200
+ type: "agent_reflection";
201
+ } | {
202
+ activatedCapabilities: Array<string>;
203
+ executionId: string;
204
+ iteration: number;
205
+ seq: number;
206
+ skill: string;
207
+ toolCallId: string;
208
+ type: "agent_skill_loaded";
209
+ } | ({
210
+ executionId: string;
211
+ iteration: number;
212
+ outcome: "pending_approval" | "auto_published";
213
+ proposalId?: string;
214
+ seq: number;
215
+ skill: string;
216
+ toolCallId: string;
217
+ type: "agent_skill_proposed";
218
+ }) | ({
219
+ agentId: string;
220
+ completedAt: string;
221
+ duration?: number;
222
+ error?: string;
223
+ executionId: string;
224
+ externalAgent?: {
225
+ contextId?: string;
226
+ taskId?: string;
227
+ };
228
+ finalOutput?: string;
229
+ iterations: number;
230
+ seq: number;
231
+ stopReason: "complete" | "end_turn" | "max_turns" | "max_cost" | "timeout" | "error";
232
+ success: boolean;
233
+ totalCost?: number;
234
+ totalTokens?: {
235
+ input: number;
236
+ output: number;
237
+ };
238
+ type: "agent_complete";
239
+ }) | {
240
+ error: {
241
+ code: string;
242
+ details?: Record<string, unknown>;
243
+ message: string;
244
+ };
245
+ executionId: string;
246
+ iteration?: number;
247
+ recoverable: boolean;
248
+ seq: number;
249
+ type: "agent_error";
250
+ } | {
251
+ executionId: string;
252
+ seq: number;
253
+ timestamp: string;
254
+ type: "agent_ping";
255
+ };
256
+ type RuntypeFlowSSEEvent = {
257
+ executionContext?: Record<string, unknown>;
258
+ executionId?: string;
259
+ flowId: string;
260
+ flowName?: string;
261
+ input?: unknown;
262
+ seq?: number;
263
+ source?: string;
264
+ startedAt: string;
265
+ toolContext?: {
266
+ executionId: string;
267
+ stepId: string;
268
+ toolId: string;
269
+ };
270
+ totalSteps?: number;
271
+ type: "flow_start";
272
+ } | {
273
+ completedAt?: string;
274
+ completedSteps?: number;
275
+ duration?: number;
276
+ executionContext?: Record<string, unknown>;
277
+ executionId?: string;
278
+ executionTime?: number;
279
+ failedSteps?: number;
280
+ finalOutput?: string;
281
+ flowId?: string;
282
+ output?: unknown;
283
+ seq?: number;
284
+ source?: string;
285
+ success?: boolean;
286
+ successfulSteps?: number;
287
+ toolContext?: {
288
+ executionId: string;
289
+ stepId: string;
290
+ toolId: string;
291
+ };
292
+ totalSteps?: number;
293
+ totalTokensUsed?: number;
294
+ type: "flow_complete";
295
+ } | ({
296
+ code?: string;
297
+ error: string | {
298
+ code: string;
299
+ message: string;
300
+ stepId?: string;
301
+ stepType?: string;
302
+ };
303
+ executionId?: string;
304
+ executionTime?: number;
305
+ flowId?: string;
306
+ seq?: number;
307
+ timestamp?: string;
308
+ toolContext?: {
309
+ executionId: string;
310
+ stepId: string;
311
+ toolId: string;
312
+ };
313
+ type: "flow_error";
314
+ upgradeUrl?: string;
315
+ }) | ({
316
+ awaitedAt: string;
317
+ executionId?: string;
318
+ flowId: string;
319
+ origin?: "webmcp" | "sdk";
320
+ pageOrigin?: string;
321
+ parameters?: Record<string, unknown>;
322
+ seq?: number;
323
+ toolCallId?: string;
324
+ toolId?: string;
325
+ toolName?: string;
326
+ type: "flow_await";
327
+ }) | {
328
+ estimatedTokens?: number;
329
+ executionId?: string;
330
+ id?: string;
331
+ index?: number;
332
+ name?: string;
333
+ seq?: number;
334
+ startedAt: string;
335
+ stepId?: string;
336
+ stepName?: string;
337
+ stepType?: string;
338
+ toolContext?: {
339
+ executionId: string;
340
+ stepId: string;
341
+ toolId: string;
342
+ };
343
+ totalSteps?: number;
344
+ type: "step_start";
345
+ } | {
346
+ delta?: string;
347
+ executionId?: string;
348
+ id?: string;
349
+ messageId?: string;
350
+ partId?: string;
351
+ seq?: number;
352
+ text?: string;
353
+ toolContext?: {
354
+ executionId: string;
355
+ stepId: string;
356
+ toolId: string;
357
+ };
358
+ toolId?: string;
359
+ type: "step_delta";
360
+ } | ({
361
+ completedAt?: string;
362
+ duration?: number;
363
+ durationMs?: number;
364
+ error?: string;
365
+ executionId?: string;
366
+ executionTime?: number;
367
+ id?: string;
368
+ index?: number;
369
+ name?: string;
370
+ output?: unknown;
371
+ result?: unknown;
372
+ seq?: number;
373
+ stepId?: string;
374
+ stepName?: string;
375
+ stepType?: string;
376
+ stopReason?: "end_turn" | "max_tool_calls" | "length" | "content_filter" | "error" | "unknown";
377
+ success?: boolean;
378
+ tokensUsed?: number;
379
+ toolContext?: {
380
+ executionId: string;
381
+ stepId: string;
382
+ toolId: string;
383
+ };
384
+ type: "step_complete";
385
+ }) | {
386
+ error: string;
387
+ executionId?: string;
388
+ executionTime?: number;
389
+ id?: string;
390
+ index?: number;
391
+ name?: string;
392
+ seq?: number;
393
+ stepType?: string;
394
+ type: "step_error";
395
+ } | {
396
+ error?: string;
397
+ executionId?: string;
398
+ id: string;
399
+ index?: number;
400
+ name?: string;
401
+ seq?: number;
402
+ skippedAt: string;
403
+ stepType: string;
404
+ totalSteps: number;
405
+ type: "step_skip";
406
+ when: string;
407
+ } | {
408
+ executionId?: string;
409
+ seq?: number;
410
+ type: "step_await";
411
+ [key: string]: unknown;
412
+ } | ({
413
+ agentContext?: {
414
+ executionId: string;
415
+ iteration: number;
416
+ seq: number;
417
+ };
418
+ executionId?: string;
419
+ hiddenParameterNames?: Array<string>;
420
+ name?: string;
421
+ parameters?: Record<string, unknown>;
422
+ providerOptions?: Record<string, unknown>;
423
+ seq?: number;
424
+ startedAt?: string;
425
+ stepId?: string;
426
+ toolCallId?: string;
427
+ toolId?: string;
428
+ toolName?: string;
429
+ toolType: "flow" | "mcp" | "builtin" | "custom" | "external" | "advisor" | "subagent" | "local";
430
+ type: "tool_start";
431
+ [key: string]: unknown;
432
+ }) | {
433
+ delta?: string;
434
+ executionId?: string;
435
+ seq?: number;
436
+ toolId?: string;
437
+ type: "tool_delta";
438
+ [key: string]: unknown;
439
+ } | {
440
+ delta: string;
441
+ executionId?: string;
442
+ seq?: number;
443
+ stepId?: string;
444
+ toolCallId?: string;
445
+ toolId?: string;
446
+ type: "tool_input_delta";
447
+ } | {
448
+ executionId?: string;
449
+ hiddenParameterNames?: Array<string>;
450
+ parameters: Record<string, unknown>;
451
+ providerOptions?: Record<string, unknown>;
452
+ seq?: number;
453
+ stepId?: string;
454
+ toolCallId?: string;
455
+ toolId?: string;
456
+ toolName?: string;
457
+ type: "tool_input_complete";
458
+ } | {
459
+ agentContext?: {
460
+ executionId: string;
461
+ iteration: number;
462
+ seq: number;
463
+ };
464
+ completedAt?: string;
465
+ error?: string;
466
+ executionId?: string;
467
+ executionTime?: number;
468
+ name?: string;
469
+ result?: unknown;
470
+ seq?: number;
471
+ stepId?: string;
472
+ success: boolean;
473
+ toolCallId?: string;
474
+ toolCost?: number;
475
+ toolId?: string;
476
+ toolName?: string;
477
+ type: "tool_complete";
478
+ } | {
479
+ agentContext?: {
480
+ executionId: string;
481
+ iteration: number;
482
+ seq: number;
483
+ };
484
+ error: string;
485
+ executionId?: string;
486
+ executionTime?: number;
487
+ failedAt?: string;
488
+ name: string;
489
+ seq?: number;
490
+ toolId: string;
491
+ type: "tool_error";
492
+ } | {
493
+ executionId?: string;
494
+ id: string;
495
+ seq?: number;
496
+ text: string;
497
+ type: "chunk";
498
+ } | {
499
+ executionId?: string;
500
+ seq?: number;
501
+ type: "text_start";
502
+ [key: string]: unknown;
503
+ } | {
504
+ executionId?: string;
505
+ seq?: number;
506
+ type: "text_end";
507
+ [key: string]: unknown;
508
+ } | {
509
+ executionId?: string;
510
+ seq?: number;
511
+ type: "reason_start";
512
+ [key: string]: unknown;
513
+ } | {
514
+ executionId?: string;
515
+ seq?: number;
516
+ type: "reason_delta";
517
+ [key: string]: unknown;
518
+ } | {
519
+ executionId?: string;
520
+ seq?: number;
521
+ type: "reason_complete";
522
+ [key: string]: unknown;
523
+ } | {
524
+ executionId?: string;
525
+ seq?: number;
526
+ type: "source";
527
+ [key: string]: unknown;
528
+ } | {
529
+ executionId?: string;
530
+ seq?: number;
531
+ type: "fallback_start";
532
+ [key: string]: unknown;
533
+ } | {
534
+ executionId?: string;
535
+ seq?: number;
536
+ type: "fallback_complete";
537
+ [key: string]: unknown;
538
+ } | {
539
+ executionId?: string;
540
+ seq?: number;
541
+ type: "fallback_exhausted";
542
+ [key: string]: unknown;
543
+ };
544
+ type RuntypeStreamEventOf<U, T extends string> = Extract<U, {
545
+ type: T;
546
+ }>;
547
+ type RuntypeAgentTurnCompleteEvent = RuntypeStreamEventOf<RuntypeAgentSSEEvent, "agent_turn_complete">;
548
+ type RuntypeStepCompleteEvent = RuntypeStreamEventOf<RuntypeFlowSSEEvent, "step_complete">;
549
+ type RuntypeStopReasonKind = NonNullable<RuntypeAgentTurnCompleteEvent["stopReason"] | RuntypeStepCompleteEvent["stopReason"]>;
550
+
1
551
  /**
2
552
  * Text content part for multi-modal messages
3
553
  */
@@ -232,7 +782,7 @@ type AgentWidgetMessageVariant = "assistant" | "reasoning" | "tool" | "approval"
232
782
  *
233
783
  * Absent (`undefined`) means "not reported" — distinct from `'unknown'`.
234
784
  */
235
- type StopReasonKind = 'end_turn' | 'max_tool_calls' | 'length' | 'content_filter' | 'error' | 'unknown';
785
+ type StopReasonKind = RuntypeStopReasonKind;
236
786
  /**
237
787
  * Represents a message in the chat conversation.
238
788
  *
@@ -1,4 +1,4 @@
1
- import { S as StreamAnimationPlugin } from './types-BZVr1YOV.cjs';
1
+ import { S as StreamAnimationPlugin } from './types-CxvHw0X6.cjs';
2
2
 
3
3
  declare const wipe: StreamAnimationPlugin;
4
4
 
@@ -1,4 +1,4 @@
1
- import { S as StreamAnimationPlugin } from './types-BZVr1YOV.js';
1
+ import { S as StreamAnimationPlugin } from './types-CxvHw0X6.js';
2
2
 
3
3
  declare const wipe: StreamAnimationPlugin;
4
4