@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.
- package/README.md +0 -1
- package/dist/animations/glyph-cycle.d.cts +1 -1
- package/dist/animations/glyph-cycle.d.ts +1 -1
- package/dist/animations/{types-DgYsuwXL.d.cts → types-B_xbfvR0.d.cts} +263 -181
- package/dist/animations/{types-DgYsuwXL.d.ts → types-B_xbfvR0.d.ts} +263 -181
- package/dist/animations/wipe.d.cts +1 -1
- package/dist/animations/wipe.d.ts +1 -1
- package/dist/codegen.cjs +1 -1
- package/dist/codegen.js +1 -1
- package/dist/index.cjs +47 -47
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +328 -821
- package/dist/index.d.ts +328 -821
- package/dist/index.global.js +39 -39
- package/dist/index.global.js.map +1 -1
- package/dist/index.js +47 -47
- package/dist/index.js.map +1 -1
- package/dist/install.global.js +1 -1
- package/dist/install.global.js.map +1 -1
- package/dist/smart-dom-reader.d.cts +268 -181
- package/dist/smart-dom-reader.d.ts +268 -181
- package/dist/theme-editor-preview.cjs +41 -41
- package/dist/theme-editor-preview.d.cts +268 -181
- package/dist/theme-editor-preview.d.ts +268 -181
- package/dist/theme-editor-preview.js +41 -41
- package/dist/theme-editor.d.cts +268 -181
- package/dist/theme-editor.d.ts +268 -181
- package/package.json +1 -1
- package/src/client.test.ts +506 -1003
- package/src/client.ts +676 -909
- package/src/components/tool-bubble.ts +46 -33
- package/src/generated/runtype-openapi-contract.ts +211 -714
- package/src/index-core.ts +2 -3
- package/src/install.test.ts +1 -34
- package/src/install.ts +1 -22
- package/src/runtime/init.test.ts +8 -67
- package/src/runtime/init.ts +2 -17
- package/src/session.test.ts +8 -8
- package/src/session.ts +1 -1
- package/src/types.ts +11 -2
- package/src/ui.postprocess.test.ts +107 -0
- package/src/ui.ts +40 -5
- package/src/utils/__fixtures__/unified-translator.oracle.ts +717 -0
- package/src/utils/copy-selection.test.ts +37 -0
- package/src/utils/copy-selection.ts +19 -0
- package/src/utils/event-stream-capture.test.ts +9 -64
- package/src/utils/sequence-buffer.test.ts +0 -256
- package/src/utils/sequence-buffer.ts +0 -130
|
@@ -1018,57 +1018,80 @@ type DeepPartial<T> = T extends object ? {
|
|
|
1018
1018
|
[P in keyof T]?: DeepPartial<T[P]>;
|
|
1019
1019
|
} : T;
|
|
1020
1020
|
|
|
1021
|
-
type
|
|
1022
|
-
agentId
|
|
1023
|
-
agentName
|
|
1024
|
-
config?:
|
|
1025
|
-
enableReflection?: boolean;
|
|
1026
|
-
model?: string;
|
|
1027
|
-
};
|
|
1021
|
+
type RuntypeExecutionStreamEvent = ({
|
|
1022
|
+
agentId?: string;
|
|
1023
|
+
agentName?: string;
|
|
1024
|
+
config?: Record<string, unknown>;
|
|
1028
1025
|
executionId: string;
|
|
1029
|
-
|
|
1026
|
+
flowId?: string;
|
|
1027
|
+
flowName?: string;
|
|
1028
|
+
kind: "agent" | "flow";
|
|
1029
|
+
maxTurns?: number;
|
|
1030
1030
|
seq: number;
|
|
1031
|
+
source?: string;
|
|
1031
1032
|
startedAt: string;
|
|
1032
|
-
|
|
1033
|
-
|
|
1033
|
+
totalSteps?: number;
|
|
1034
|
+
type: "execution_start";
|
|
1035
|
+
}) | ({
|
|
1036
|
+
completedAt?: string;
|
|
1037
|
+
durationMs?: number;
|
|
1034
1038
|
executionId: string;
|
|
1035
|
-
|
|
1036
|
-
|
|
1039
|
+
failedSteps?: number;
|
|
1040
|
+
finalOutput?: string;
|
|
1041
|
+
iterations?: number;
|
|
1042
|
+
kind: "agent" | "flow";
|
|
1037
1043
|
seq: number;
|
|
1038
|
-
|
|
1044
|
+
stopReason?: string;
|
|
1045
|
+
success: boolean;
|
|
1046
|
+
successfulSteps?: number;
|
|
1039
1047
|
totalCost?: number;
|
|
1040
|
-
|
|
1041
|
-
|
|
1048
|
+
totalSteps?: number;
|
|
1049
|
+
totalTokens?: {
|
|
1050
|
+
input: number;
|
|
1051
|
+
output: number;
|
|
1052
|
+
};
|
|
1053
|
+
type: "execution_complete";
|
|
1054
|
+
}) | ({
|
|
1055
|
+
code?: string;
|
|
1056
|
+
completedAt?: string;
|
|
1057
|
+
error: string | {
|
|
1058
|
+
code: string;
|
|
1059
|
+
details?: Record<string, unknown>;
|
|
1060
|
+
message: string;
|
|
1061
|
+
};
|
|
1042
1062
|
executionId: string;
|
|
1043
|
-
|
|
1044
|
-
role: "user" | "assistant" | "system";
|
|
1063
|
+
kind: "agent" | "flow";
|
|
1045
1064
|
seq: number;
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
type: "agent_turn_start";
|
|
1065
|
+
type: "execution_error";
|
|
1066
|
+
upgradeUrl?: string;
|
|
1049
1067
|
}) | ({
|
|
1050
|
-
contentType: "text" | "thinking" | "tool_input";
|
|
1051
|
-
delta: string;
|
|
1052
1068
|
executionId: string;
|
|
1053
|
-
|
|
1069
|
+
id: string;
|
|
1070
|
+
iteration?: number;
|
|
1071
|
+
role: "user" | "assistant" | "system";
|
|
1054
1072
|
seq: number;
|
|
1055
|
-
|
|
1056
|
-
type: "
|
|
1073
|
+
turnIndex?: number;
|
|
1074
|
+
type: "turn_start";
|
|
1057
1075
|
}) | ({
|
|
1058
|
-
completedAt
|
|
1076
|
+
completedAt?: string;
|
|
1059
1077
|
content?: string;
|
|
1060
1078
|
cost?: number;
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1079
|
+
executionId: string;
|
|
1080
|
+
fallback?: {
|
|
1081
|
+
attempts: Array<{
|
|
1082
|
+
attempt: number;
|
|
1083
|
+
error?: string;
|
|
1084
|
+
model?: string;
|
|
1085
|
+
success: boolean;
|
|
1086
|
+
type: "retry" | "model" | "message" | "flow";
|
|
1065
1087
|
}>;
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1088
|
+
exhausted: boolean;
|
|
1089
|
+
model?: string;
|
|
1090
|
+
reason?: string | null;
|
|
1091
|
+
used: boolean;
|
|
1069
1092
|
};
|
|
1070
|
-
|
|
1071
|
-
iteration
|
|
1093
|
+
id: string;
|
|
1094
|
+
iteration?: number;
|
|
1072
1095
|
role: "user" | "assistant" | "system";
|
|
1073
1096
|
seq: number;
|
|
1074
1097
|
stopReason?: "end_turn" | "max_tool_calls" | "length" | "content_filter" | "error" | "unknown";
|
|
@@ -1076,207 +1099,260 @@ type RuntypeAgentSSEEvent = {
|
|
|
1076
1099
|
input: number;
|
|
1077
1100
|
output: number;
|
|
1078
1101
|
};
|
|
1079
|
-
|
|
1080
|
-
|
|
1102
|
+
type: "turn_complete";
|
|
1103
|
+
}) | {
|
|
1104
|
+
executionId: string;
|
|
1105
|
+
id: string;
|
|
1106
|
+
index?: number;
|
|
1107
|
+
name?: string;
|
|
1108
|
+
outputVariable?: string;
|
|
1109
|
+
seq: number;
|
|
1110
|
+
startedAt?: string;
|
|
1111
|
+
stepType?: string;
|
|
1112
|
+
totalSteps?: number;
|
|
1113
|
+
type: "step_start";
|
|
1114
|
+
} | ({
|
|
1115
|
+
completedAt?: string;
|
|
1116
|
+
durationMs?: number;
|
|
1117
|
+
error?: string;
|
|
1118
|
+
executionId: string;
|
|
1119
|
+
fallback?: {
|
|
1120
|
+
attempts: Array<{
|
|
1121
|
+
attempt: number;
|
|
1122
|
+
error?: string;
|
|
1123
|
+
model?: string;
|
|
1124
|
+
success: boolean;
|
|
1125
|
+
type: "retry" | "model" | "message" | "flow";
|
|
1126
|
+
}>;
|
|
1127
|
+
exhausted: boolean;
|
|
1128
|
+
model?: string;
|
|
1129
|
+
reason?: string | null;
|
|
1130
|
+
used: boolean;
|
|
1131
|
+
};
|
|
1132
|
+
id: string;
|
|
1133
|
+
name?: string;
|
|
1134
|
+
result?: unknown;
|
|
1135
|
+
seq: number;
|
|
1136
|
+
stepType?: string;
|
|
1137
|
+
stopReason?: "end_turn" | "max_tool_calls" | "length" | "content_filter" | "error" | "unknown";
|
|
1138
|
+
success?: boolean;
|
|
1139
|
+
tokensUsed?: number;
|
|
1140
|
+
type: "step_complete";
|
|
1141
|
+
unresolvedVariables?: Array<string>;
|
|
1142
|
+
}) | {
|
|
1143
|
+
executionId: string;
|
|
1144
|
+
id: string;
|
|
1145
|
+
index?: number;
|
|
1146
|
+
name?: string;
|
|
1147
|
+
seq: number;
|
|
1148
|
+
skippedAt?: string;
|
|
1149
|
+
stepType?: string;
|
|
1150
|
+
totalSteps?: number;
|
|
1151
|
+
type: "step_skip";
|
|
1152
|
+
when?: string;
|
|
1153
|
+
} | ({
|
|
1154
|
+
executionId: string;
|
|
1155
|
+
id: string;
|
|
1156
|
+
parentToolCallId?: string;
|
|
1157
|
+
role?: "user" | "assistant" | "system";
|
|
1158
|
+
seq: number;
|
|
1159
|
+
stepId?: string;
|
|
1160
|
+
turnId?: string;
|
|
1161
|
+
type: "text_start";
|
|
1162
|
+
}) | {
|
|
1163
|
+
delta: string;
|
|
1164
|
+
executionId: string;
|
|
1165
|
+
id: string;
|
|
1166
|
+
seq: number;
|
|
1167
|
+
type: "text_delta";
|
|
1168
|
+
} | {
|
|
1169
|
+
executionId: string;
|
|
1170
|
+
id: string;
|
|
1171
|
+
seq: number;
|
|
1172
|
+
text?: string;
|
|
1173
|
+
type: "text_complete";
|
|
1174
|
+
} | ({
|
|
1175
|
+
executionId: string;
|
|
1176
|
+
id: string;
|
|
1177
|
+
parentToolCallId?: string;
|
|
1178
|
+
scope?: "turn" | "loop";
|
|
1179
|
+
seq: number;
|
|
1180
|
+
type: "reasoning_start";
|
|
1181
|
+
}) | {
|
|
1182
|
+
delta: string;
|
|
1183
|
+
executionId: string;
|
|
1184
|
+
id: string;
|
|
1185
|
+
seq: number;
|
|
1186
|
+
type: "reasoning_delta";
|
|
1187
|
+
} | ({
|
|
1188
|
+
executionId: string;
|
|
1189
|
+
id: string;
|
|
1190
|
+
scope?: "turn" | "loop";
|
|
1191
|
+
seq: number;
|
|
1192
|
+
text?: string;
|
|
1193
|
+
type: "reasoning_complete";
|
|
1081
1194
|
}) | ({
|
|
1082
1195
|
executionId: string;
|
|
1083
|
-
|
|
1196
|
+
id: string;
|
|
1197
|
+
mediaType: string;
|
|
1198
|
+
role?: "user" | "assistant" | "system";
|
|
1199
|
+
seq: number;
|
|
1200
|
+
toolCallId?: string;
|
|
1201
|
+
type: "media_start";
|
|
1202
|
+
}) | {
|
|
1203
|
+
delta: string;
|
|
1204
|
+
executionId: string;
|
|
1205
|
+
id: string;
|
|
1206
|
+
seq: number;
|
|
1207
|
+
type: "media_delta";
|
|
1208
|
+
} | {
|
|
1209
|
+
data?: string;
|
|
1210
|
+
executionId: string;
|
|
1211
|
+
id: string;
|
|
1212
|
+
mediaType?: string;
|
|
1213
|
+
seq: number;
|
|
1214
|
+
toolCallId?: string;
|
|
1215
|
+
type: "media_complete";
|
|
1216
|
+
url?: string;
|
|
1217
|
+
} | ({
|
|
1218
|
+
artifactType: "markdown" | "component";
|
|
1219
|
+
component?: string;
|
|
1220
|
+
executionId?: string;
|
|
1221
|
+
id: string;
|
|
1222
|
+
seq?: number;
|
|
1223
|
+
title?: string;
|
|
1224
|
+
type: "artifact_start";
|
|
1225
|
+
}) | {
|
|
1226
|
+
delta: string;
|
|
1227
|
+
executionId?: string;
|
|
1228
|
+
id: string;
|
|
1229
|
+
seq?: number;
|
|
1230
|
+
type: "artifact_delta";
|
|
1231
|
+
} | {
|
|
1232
|
+
component: string;
|
|
1233
|
+
executionId?: string;
|
|
1234
|
+
id: string;
|
|
1235
|
+
props: Record<string, unknown>;
|
|
1236
|
+
seq?: number;
|
|
1237
|
+
type: "artifact_update";
|
|
1238
|
+
} | {
|
|
1239
|
+
executionId?: string;
|
|
1240
|
+
id: string;
|
|
1241
|
+
seq?: number;
|
|
1242
|
+
type: "artifact_complete";
|
|
1243
|
+
} | {
|
|
1244
|
+
executionId: string;
|
|
1245
|
+
id?: string;
|
|
1246
|
+
seq: number;
|
|
1247
|
+
sourceType?: string;
|
|
1248
|
+
title?: string;
|
|
1249
|
+
type: "source";
|
|
1250
|
+
url?: string;
|
|
1251
|
+
[key: string]: unknown;
|
|
1252
|
+
} | ({
|
|
1253
|
+
executionId: string;
|
|
1254
|
+
hiddenParameterNames?: Array<string>;
|
|
1255
|
+
iteration?: number;
|
|
1084
1256
|
origin?: "webmcp" | "sdk";
|
|
1085
1257
|
pageOrigin?: string;
|
|
1086
1258
|
parameters?: Record<string, unknown>;
|
|
1087
1259
|
seq: number;
|
|
1260
|
+
startedAt?: string;
|
|
1261
|
+
stepId?: string;
|
|
1088
1262
|
toolCallId: string;
|
|
1089
1263
|
toolName: string;
|
|
1090
|
-
toolType:
|
|
1091
|
-
type: "
|
|
1264
|
+
toolType: string;
|
|
1265
|
+
type: "tool_start";
|
|
1092
1266
|
}) | {
|
|
1093
1267
|
delta: string;
|
|
1094
1268
|
executionId: string;
|
|
1095
|
-
iteration: number;
|
|
1096
1269
|
seq: number;
|
|
1097
1270
|
toolCallId: string;
|
|
1098
|
-
type: "
|
|
1271
|
+
type: "tool_input_delta";
|
|
1099
1272
|
} | {
|
|
1100
|
-
delta: string;
|
|
1101
1273
|
executionId: string;
|
|
1102
|
-
|
|
1274
|
+
hiddenParameterNames?: Array<string>;
|
|
1275
|
+
parameters: Record<string, unknown>;
|
|
1103
1276
|
seq: number;
|
|
1104
1277
|
toolCallId: string;
|
|
1105
|
-
|
|
1278
|
+
toolName?: string;
|
|
1279
|
+
type: "tool_input_complete";
|
|
1106
1280
|
} | {
|
|
1281
|
+
delta: string;
|
|
1107
1282
|
executionId: string;
|
|
1108
|
-
hiddenParameterNames?: Array<string>;
|
|
1109
|
-
iteration: number;
|
|
1110
|
-
parameters: Record<string, unknown>;
|
|
1111
1283
|
seq: number;
|
|
1112
1284
|
toolCallId: string;
|
|
1113
|
-
|
|
1114
|
-
type: "agent_tool_input_complete";
|
|
1285
|
+
type: "tool_output_delta";
|
|
1115
1286
|
} | {
|
|
1287
|
+
error?: string;
|
|
1116
1288
|
executionId: string;
|
|
1117
1289
|
executionTime?: number;
|
|
1118
|
-
iteration
|
|
1290
|
+
iteration?: number;
|
|
1119
1291
|
result?: unknown;
|
|
1120
1292
|
seq: number;
|
|
1293
|
+
stepId?: string;
|
|
1121
1294
|
success: boolean;
|
|
1122
1295
|
toolCallId: string;
|
|
1123
|
-
toolName
|
|
1124
|
-
type: "
|
|
1125
|
-
} |
|
|
1126
|
-
executionId?: string;
|
|
1127
|
-
iteration: number;
|
|
1128
|
-
media: Array<({
|
|
1129
|
-
annotations?: {
|
|
1130
|
-
audience?: Array<"user" | "assistant">;
|
|
1131
|
-
};
|
|
1132
|
-
data: string;
|
|
1133
|
-
mediaType: string;
|
|
1134
|
-
type: "media";
|
|
1135
|
-
}) | ({
|
|
1136
|
-
annotations?: {
|
|
1137
|
-
audience?: Array<"user" | "assistant">;
|
|
1138
|
-
};
|
|
1139
|
-
mediaType?: string;
|
|
1140
|
-
type: "image-url";
|
|
1141
|
-
url: string;
|
|
1142
|
-
}) | ({
|
|
1143
|
-
annotations?: {
|
|
1144
|
-
audience?: Array<"user" | "assistant">;
|
|
1145
|
-
};
|
|
1146
|
-
mediaType: string;
|
|
1147
|
-
type: "file-url";
|
|
1148
|
-
url: string;
|
|
1149
|
-
})>;
|
|
1150
|
-
seq?: number;
|
|
1151
|
-
toolCallId: string;
|
|
1152
|
-
toolName: string;
|
|
1153
|
-
type: "agent_media";
|
|
1154
|
-
}) | {
|
|
1296
|
+
toolName?: string;
|
|
1297
|
+
type: "tool_complete";
|
|
1298
|
+
} | {
|
|
1155
1299
|
approvalId: string;
|
|
1156
|
-
description
|
|
1300
|
+
description?: string;
|
|
1157
1301
|
executionId: string;
|
|
1158
|
-
externalAgent?: {
|
|
1159
|
-
contextId?: string;
|
|
1160
|
-
taskId?: string;
|
|
1161
|
-
};
|
|
1162
1302
|
iteration?: number;
|
|
1163
1303
|
parameters?: Record<string, unknown>;
|
|
1164
1304
|
reason?: string;
|
|
1165
1305
|
seq: number;
|
|
1166
|
-
startedAt
|
|
1167
|
-
|
|
1168
|
-
|
|
1306
|
+
startedAt?: string;
|
|
1307
|
+
subagent?: {
|
|
1308
|
+
agentName?: string;
|
|
1309
|
+
toolName: string;
|
|
1310
|
+
};
|
|
1311
|
+
timeout?: number;
|
|
1312
|
+
toolCallId?: string;
|
|
1169
1313
|
toolName: string;
|
|
1170
|
-
toolType
|
|
1171
|
-
type: "
|
|
1314
|
+
toolType?: string;
|
|
1315
|
+
type: "approval_start";
|
|
1172
1316
|
} | ({
|
|
1173
1317
|
approvalId: string;
|
|
1174
|
-
completedAt
|
|
1318
|
+
completedAt?: string;
|
|
1175
1319
|
decision: "approved" | "denied" | "timeout";
|
|
1176
1320
|
executionId: string;
|
|
1177
|
-
resolvedBy
|
|
1321
|
+
resolvedBy?: "user" | "system";
|
|
1178
1322
|
seq: number;
|
|
1179
|
-
type: "
|
|
1323
|
+
type: "approval_complete";
|
|
1180
1324
|
}) | ({
|
|
1181
|
-
awaitedAt
|
|
1325
|
+
awaitedAt?: string;
|
|
1182
1326
|
executionId: string;
|
|
1183
1327
|
origin?: "webmcp" | "sdk";
|
|
1184
1328
|
pageOrigin?: string;
|
|
1185
1329
|
parameters?: Record<string, unknown>;
|
|
1186
1330
|
seq: number;
|
|
1187
1331
|
toolCallId?: string;
|
|
1188
|
-
toolId
|
|
1189
|
-
toolName
|
|
1190
|
-
type: "
|
|
1191
|
-
}) | {
|
|
1192
|
-
completedAt: string;
|
|
1193
|
-
cost?: number;
|
|
1194
|
-
duration?: number;
|
|
1195
|
-
estimatedContextBreakdown?: {
|
|
1196
|
-
categories: Record<string, {
|
|
1197
|
-
chars: number;
|
|
1198
|
-
estimatedTokens: number;
|
|
1199
|
-
}>;
|
|
1200
|
-
contextWindowSize?: number;
|
|
1201
|
-
estimatedTotalTokens: number;
|
|
1202
|
-
estimatedUtilizationPercent?: number;
|
|
1203
|
-
};
|
|
1204
|
-
executionId: string;
|
|
1205
|
-
iteration: number;
|
|
1206
|
-
output?: string;
|
|
1207
|
-
runningTotalCost?: number;
|
|
1208
|
-
seq: number;
|
|
1209
|
-
stopConditionMet: boolean;
|
|
1210
|
-
tokens?: {
|
|
1211
|
-
input: number;
|
|
1212
|
-
output: number;
|
|
1213
|
-
};
|
|
1214
|
-
toolCallsMade: number;
|
|
1215
|
-
type: "agent_iteration_complete";
|
|
1216
|
-
} | {
|
|
1217
|
-
executionId: string;
|
|
1218
|
-
iteration: number;
|
|
1219
|
-
reflection?: string;
|
|
1220
|
-
seq: number;
|
|
1221
|
-
timestamp?: string;
|
|
1222
|
-
type: "agent_reflection";
|
|
1223
|
-
} | {
|
|
1224
|
-
activatedCapabilities: Array<string>;
|
|
1225
|
-
executionId: string;
|
|
1226
|
-
iteration: number;
|
|
1227
|
-
seq: number;
|
|
1228
|
-
skill: string;
|
|
1229
|
-
timestamp?: string;
|
|
1230
|
-
toolCallId: string;
|
|
1231
|
-
type: "agent_skill_loaded";
|
|
1232
|
-
} | ({
|
|
1233
|
-
executionId: string;
|
|
1234
|
-
iteration: number;
|
|
1235
|
-
outcome: "pending_approval" | "auto_published";
|
|
1236
|
-
proposalId?: string;
|
|
1237
|
-
seq: number;
|
|
1238
|
-
skill: string;
|
|
1239
|
-
timestamp?: string;
|
|
1240
|
-
toolCallId: string;
|
|
1241
|
-
type: "agent_skill_proposed";
|
|
1332
|
+
toolId?: string;
|
|
1333
|
+
toolName?: string;
|
|
1334
|
+
type: "await";
|
|
1242
1335
|
}) | ({
|
|
1243
|
-
|
|
1244
|
-
completedAt: string;
|
|
1245
|
-
duration?: number;
|
|
1246
|
-
error?: string;
|
|
1247
|
-
executionId: string;
|
|
1248
|
-
externalAgent?: {
|
|
1249
|
-
contextId?: string;
|
|
1250
|
-
taskId?: string;
|
|
1251
|
-
};
|
|
1252
|
-
finalOutput?: string;
|
|
1253
|
-
iterations: number;
|
|
1254
|
-
seq: number;
|
|
1255
|
-
stopReason: "complete" | "end_turn" | "max_turns" | "max_cost" | "timeout" | "error";
|
|
1256
|
-
success: boolean;
|
|
1257
|
-
totalCost?: number;
|
|
1258
|
-
totalTokens?: {
|
|
1259
|
-
input: number;
|
|
1260
|
-
output: number;
|
|
1261
|
-
};
|
|
1262
|
-
type: "agent_complete";
|
|
1263
|
-
}) | {
|
|
1264
|
-
error: {
|
|
1336
|
+
error: string | {
|
|
1265
1337
|
code: string;
|
|
1266
1338
|
details?: Record<string, unknown>;
|
|
1267
1339
|
message: string;
|
|
1268
1340
|
};
|
|
1269
1341
|
executionId: string;
|
|
1270
|
-
|
|
1271
|
-
recoverable: boolean;
|
|
1342
|
+
recoverable?: boolean;
|
|
1272
1343
|
seq: number;
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
} | {
|
|
1344
|
+
type: "error";
|
|
1345
|
+
}) | {
|
|
1276
1346
|
executionId: string;
|
|
1277
1347
|
seq: number;
|
|
1278
1348
|
timestamp: string;
|
|
1279
|
-
type: "
|
|
1349
|
+
type: "ping";
|
|
1350
|
+
} | {
|
|
1351
|
+
executionId?: string;
|
|
1352
|
+
name: string;
|
|
1353
|
+
seq?: number;
|
|
1354
|
+
type: "custom";
|
|
1355
|
+
value?: unknown;
|
|
1280
1356
|
};
|
|
1281
1357
|
type RuntypeFlowSSEEvent = {
|
|
1282
1358
|
executionContext?: Record<string, unknown>;
|
|
@@ -1574,9 +1650,9 @@ type RuntypeFlowSSEEvent = {
|
|
|
1574
1650
|
type RuntypeStreamEventOf<U, T extends string> = Extract<U, {
|
|
1575
1651
|
type: T;
|
|
1576
1652
|
}>;
|
|
1577
|
-
type
|
|
1653
|
+
type RuntypeTurnCompleteEvent = RuntypeStreamEventOf<RuntypeExecutionStreamEvent, "turn_complete">;
|
|
1578
1654
|
type RuntypeStepCompleteEvent = RuntypeStreamEventOf<RuntypeFlowSSEEvent, "step_complete">;
|
|
1579
|
-
type RuntypeStopReasonKind = NonNullable<
|
|
1655
|
+
type RuntypeStopReasonKind = NonNullable<RuntypeTurnCompleteEvent["stopReason"] | RuntypeStepCompleteEvent["stopReason"]>;
|
|
1580
1656
|
|
|
1581
1657
|
/**
|
|
1582
1658
|
* Text content part for multi-modal messages
|
|
@@ -4690,6 +4766,11 @@ type AgentWidgetConfig = {
|
|
|
4690
4766
|
* When provided, the widget uses agent loop execution instead of flow dispatch.
|
|
4691
4767
|
* Mutually exclusive with `flowId`.
|
|
4692
4768
|
*
|
|
4769
|
+
* Note: `@runtypelabs/persona-proxy` rejects a client-supplied `agent` (it was
|
|
4770
|
+
* an open relay). This option is only for endpoints authorized to accept a
|
|
4771
|
+
* client agent — your own backend, or token-scoped direct-to-Runtype dispatch.
|
|
4772
|
+
* For the proxy, pin the agent server-side with `agentConfig`/`agentId`.
|
|
4773
|
+
*
|
|
4693
4774
|
* @example
|
|
4694
4775
|
* ```typescript
|
|
4695
4776
|
* config: {
|
|
@@ -5339,6 +5420,12 @@ type AgentWidgetReasoning = {
|
|
|
5339
5420
|
id: string;
|
|
5340
5421
|
status: "pending" | "streaming" | "complete";
|
|
5341
5422
|
chunks: string[];
|
|
5423
|
+
/**
|
|
5424
|
+
* Reasoning channel scope (unified spec). `"turn"` is ordinary per-turn
|
|
5425
|
+
* thinking; `"loop"` is a cross-iteration agent reflection (the fold that
|
|
5426
|
+
* replaced the legacy `agent_reflection` event). Absent for legacy streams.
|
|
5427
|
+
*/
|
|
5428
|
+
scope?: "turn" | "loop";
|
|
5342
5429
|
startedAt?: number;
|
|
5343
5430
|
completedAt?: number;
|
|
5344
5431
|
durationMs?: number;
|