supercompat 3.9.4 → 3.10.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/dist/index.cjs +1436 -629
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1394 -587
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -1859,7 +1859,7 @@ var models6 = function(param) {
|
|
|
1859
1859
|
};
|
|
1860
1860
|
};
|
|
1861
1861
|
// src/adapters/client/anthropicClientAdapter/completions/post.ts
|
|
1862
|
-
var
|
|
1862
|
+
var import_radash4 = require("radash");
|
|
1863
1863
|
// src/lib/messages/nonEmptyMessages.ts
|
|
1864
1864
|
var nonEmptyContent = function(param) {
|
|
1865
1865
|
var message = param.message;
|
|
@@ -1914,7 +1914,9 @@ var serializeTools = function(param) {
|
|
|
1914
1914
|
}
|
|
1915
1915
|
};
|
|
1916
1916
|
}
|
|
1917
|
-
return
|
|
1917
|
+
return _object_spread({
|
|
1918
|
+
type: tool.type
|
|
1919
|
+
}, tool[tool.type] || {});
|
|
1918
1920
|
});
|
|
1919
1921
|
};
|
|
1920
1922
|
// src/adapters/client/anthropicClientAdapter/completions/serializeMessages/serializeMessage.ts
|
|
@@ -1967,18 +1969,485 @@ var serializeMessages = function(param) {
|
|
|
1967
1969
|
});
|
|
1968
1970
|
});
|
|
1969
1971
|
};
|
|
1972
|
+
// src/adapters/client/anthropicClientAdapter/completions/serializeBetas.ts
|
|
1973
|
+
var serializeBetas = function(param) {
|
|
1974
|
+
var _param_tools = param.tools, tools = _param_tools === void 0 ? [] : _param_tools;
|
|
1975
|
+
var betas = [];
|
|
1976
|
+
if (tools.some(function(tool) {
|
|
1977
|
+
return tool.type === "computer_20250124";
|
|
1978
|
+
})) {
|
|
1979
|
+
betas.push("computer-use-2025-01-24");
|
|
1980
|
+
}
|
|
1981
|
+
if (tools.some(function(tool) {
|
|
1982
|
+
return tool.type === "code_execution_20250825";
|
|
1983
|
+
})) {
|
|
1984
|
+
betas.push("code-execution-2025-08-25");
|
|
1985
|
+
}
|
|
1986
|
+
if (!betas.length) {
|
|
1987
|
+
return {};
|
|
1988
|
+
}
|
|
1989
|
+
return {
|
|
1990
|
+
betas: betas
|
|
1991
|
+
};
|
|
1992
|
+
};
|
|
1993
|
+
// src/adapters/client/anthropicClientAdapter/normalizeComputerToolCallPayload.ts
|
|
1994
|
+
var import_radash3 = require("radash");
|
|
1995
|
+
var coordinateKeys = [
|
|
1996
|
+
"coordinate",
|
|
1997
|
+
"coordinates",
|
|
1998
|
+
"coordinate_start",
|
|
1999
|
+
"coordinate_end",
|
|
2000
|
+
"start",
|
|
2001
|
+
"end",
|
|
2002
|
+
"from",
|
|
2003
|
+
"to",
|
|
2004
|
+
"target",
|
|
2005
|
+
"point",
|
|
2006
|
+
"position",
|
|
2007
|
+
"cursor_position",
|
|
2008
|
+
"path"
|
|
2009
|
+
];
|
|
2010
|
+
var clickButtonMap = {
|
|
2011
|
+
left_click: "left",
|
|
2012
|
+
right_click: "right",
|
|
2013
|
+
middle_click: "wheel",
|
|
2014
|
+
double_click: "left",
|
|
2015
|
+
triple_click: "left",
|
|
2016
|
+
left_mouse_down: "left",
|
|
2017
|
+
left_mouse_up: "left"
|
|
2018
|
+
};
|
|
2019
|
+
var keyAliasMap = {
|
|
2020
|
+
ctrl: "ctrl",
|
|
2021
|
+
control: "ctrl",
|
|
2022
|
+
cmd: "meta",
|
|
2023
|
+
command: "meta",
|
|
2024
|
+
meta: "meta",
|
|
2025
|
+
win: "meta",
|
|
2026
|
+
option: "alt",
|
|
2027
|
+
alt: "alt",
|
|
2028
|
+
shift: "shift",
|
|
2029
|
+
enter: "enter",
|
|
2030
|
+
return: "enter",
|
|
2031
|
+
esc: "escape",
|
|
2032
|
+
escape: "escape",
|
|
2033
|
+
tab: "tab",
|
|
2034
|
+
space: "space",
|
|
2035
|
+
spacebar: "space",
|
|
2036
|
+
backspace: "backspace",
|
|
2037
|
+
del: "delete",
|
|
2038
|
+
delete: "delete",
|
|
2039
|
+
pageup: "pageup",
|
|
2040
|
+
pagedown: "pagedown",
|
|
2041
|
+
up: "up",
|
|
2042
|
+
down: "down",
|
|
2043
|
+
left: "left",
|
|
2044
|
+
right: "right"
|
|
2045
|
+
};
|
|
2046
|
+
var sanitizeNumber = function(value) {
|
|
2047
|
+
return typeof value === "number" ? value : void 0;
|
|
2048
|
+
};
|
|
2049
|
+
var toCoordinate = function(value) {
|
|
2050
|
+
if (!value) return void 0;
|
|
2051
|
+
if (Array.isArray(value)) {
|
|
2052
|
+
if (value.length === 2 && typeof value[0] === "number" && typeof value[1] === "number") {
|
|
2053
|
+
return {
|
|
2054
|
+
x: value[0],
|
|
2055
|
+
y: value[1]
|
|
2056
|
+
};
|
|
2057
|
+
}
|
|
2058
|
+
if (value.length > 0 && Array.isArray(value[0])) {
|
|
2059
|
+
var tuple = value[0];
|
|
2060
|
+
if (tuple.length === 2 && typeof tuple[0] === "number" && typeof tuple[1] === "number") {
|
|
2061
|
+
return {
|
|
2062
|
+
x: tuple[0],
|
|
2063
|
+
y: tuple[1]
|
|
2064
|
+
};
|
|
2065
|
+
}
|
|
2066
|
+
}
|
|
2067
|
+
}
|
|
2068
|
+
if ((typeof value === "undefined" ? "undefined" : _type_of(value)) === "object") {
|
|
2069
|
+
var maybe = value;
|
|
2070
|
+
var x = sanitizeNumber(maybe.x);
|
|
2071
|
+
var y = sanitizeNumber(maybe.y);
|
|
2072
|
+
if (typeof x === "number" && typeof y === "number") {
|
|
2073
|
+
return {
|
|
2074
|
+
x: x,
|
|
2075
|
+
y: y
|
|
2076
|
+
};
|
|
2077
|
+
}
|
|
2078
|
+
}
|
|
2079
|
+
if (typeof value === "string") {
|
|
2080
|
+
var parts = value.split(/[, ]+/).map(Number).filter(Number.isFinite);
|
|
2081
|
+
if (parts.length >= 2) {
|
|
2082
|
+
return {
|
|
2083
|
+
x: parts[0],
|
|
2084
|
+
y: parts[1]
|
|
2085
|
+
};
|
|
2086
|
+
}
|
|
2087
|
+
}
|
|
2088
|
+
return void 0;
|
|
2089
|
+
};
|
|
2090
|
+
var findCoordinatesInDetails = function(details) {
|
|
2091
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
2092
|
+
try {
|
|
2093
|
+
for(var _iterator = coordinateKeys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
2094
|
+
var key = _step.value;
|
|
2095
|
+
var value = details[key];
|
|
2096
|
+
var coords = toCoordinate(value);
|
|
2097
|
+
if (coords) {
|
|
2098
|
+
return coords;
|
|
2099
|
+
}
|
|
2100
|
+
}
|
|
2101
|
+
} catch (err) {
|
|
2102
|
+
_didIteratorError = true;
|
|
2103
|
+
_iteratorError = err;
|
|
2104
|
+
} finally{
|
|
2105
|
+
try {
|
|
2106
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
2107
|
+
_iterator.return();
|
|
2108
|
+
}
|
|
2109
|
+
} finally{
|
|
2110
|
+
if (_didIteratorError) {
|
|
2111
|
+
throw _iteratorError;
|
|
2112
|
+
}
|
|
2113
|
+
}
|
|
2114
|
+
}
|
|
2115
|
+
return void 0;
|
|
2116
|
+
};
|
|
2117
|
+
var buildDragPath = function(details) {
|
|
2118
|
+
var path = [];
|
|
2119
|
+
if (Array.isArray(details.path)) {
|
|
2120
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
2121
|
+
try {
|
|
2122
|
+
for(var _iterator = details.path[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
2123
|
+
var point = _step.value;
|
|
2124
|
+
var coords = toCoordinate(point);
|
|
2125
|
+
if (coords) {
|
|
2126
|
+
path.push(coords);
|
|
2127
|
+
}
|
|
2128
|
+
}
|
|
2129
|
+
} catch (err) {
|
|
2130
|
+
_didIteratorError = true;
|
|
2131
|
+
_iteratorError = err;
|
|
2132
|
+
} finally{
|
|
2133
|
+
try {
|
|
2134
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
2135
|
+
_iterator.return();
|
|
2136
|
+
}
|
|
2137
|
+
} finally{
|
|
2138
|
+
if (_didIteratorError) {
|
|
2139
|
+
throw _iteratorError;
|
|
2140
|
+
}
|
|
2141
|
+
}
|
|
2142
|
+
}
|
|
2143
|
+
}
|
|
2144
|
+
if (!path.length) {
|
|
2145
|
+
var start = toCoordinate(details.coordinate_start) || toCoordinate(details.start) || toCoordinate(details.from);
|
|
2146
|
+
if (start) {
|
|
2147
|
+
path.push(start);
|
|
2148
|
+
}
|
|
2149
|
+
var end = toCoordinate(details.coordinate_end) || toCoordinate(details.end) || toCoordinate(details.to) || toCoordinate(details.target);
|
|
2150
|
+
if (end) {
|
|
2151
|
+
path.push(end);
|
|
2152
|
+
}
|
|
2153
|
+
}
|
|
2154
|
+
if (!path.length) {
|
|
2155
|
+
var coords1 = findCoordinatesInDetails(details);
|
|
2156
|
+
if (coords1) {
|
|
2157
|
+
path.push(coords1);
|
|
2158
|
+
}
|
|
2159
|
+
}
|
|
2160
|
+
if (!path.length) {
|
|
2161
|
+
path.push({
|
|
2162
|
+
x: 0,
|
|
2163
|
+
y: 0
|
|
2164
|
+
});
|
|
2165
|
+
}
|
|
2166
|
+
return path;
|
|
2167
|
+
};
|
|
2168
|
+
var parseKeys = function(input) {
|
|
2169
|
+
if (Array.isArray(input)) {
|
|
2170
|
+
return input.map(String).map(function(key) {
|
|
2171
|
+
return key.trim();
|
|
2172
|
+
}).filter(Boolean);
|
|
2173
|
+
}
|
|
2174
|
+
if (typeof input === "string") {
|
|
2175
|
+
return input.split(RegExp("(?:(?<!\\\\)\\+|\\s+)")).map(function(key) {
|
|
2176
|
+
return key.replace(/\\\+/g, "+");
|
|
2177
|
+
}).map(function(key) {
|
|
2178
|
+
return key.trim();
|
|
2179
|
+
}).filter(Boolean);
|
|
2180
|
+
}
|
|
2181
|
+
return [];
|
|
2182
|
+
};
|
|
2183
|
+
var normalizeKeys = function(keys) {
|
|
2184
|
+
return keys.map(function(key) {
|
|
2185
|
+
var lowerKey = key.toLowerCase();
|
|
2186
|
+
var _keyAliasMap_lowerKey;
|
|
2187
|
+
return (_keyAliasMap_lowerKey = keyAliasMap[lowerKey]) !== null && _keyAliasMap_lowerKey !== void 0 ? _keyAliasMap_lowerKey : lowerKey;
|
|
2188
|
+
});
|
|
2189
|
+
};
|
|
2190
|
+
var normalizeScroll = function(details) {
|
|
2191
|
+
var _sanitizeNumber;
|
|
2192
|
+
var scrollX = (_sanitizeNumber = sanitizeNumber(details.scroll_x)) !== null && _sanitizeNumber !== void 0 ? _sanitizeNumber : 0;
|
|
2193
|
+
var _sanitizeNumber1;
|
|
2194
|
+
var scrollY = (_sanitizeNumber1 = sanitizeNumber(details.scroll_y)) !== null && _sanitizeNumber1 !== void 0 ? _sanitizeNumber1 : 0;
|
|
2195
|
+
var _sanitizeNumber2, _ref;
|
|
2196
|
+
var amount = (_ref = (_sanitizeNumber2 = sanitizeNumber(details.scroll_amount)) !== null && _sanitizeNumber2 !== void 0 ? _sanitizeNumber2 : sanitizeNumber(details.amount)) !== null && _ref !== void 0 ? _ref : 0;
|
|
2197
|
+
var direction = typeof details.scroll_direction === "string" ? details.scroll_direction.toLowerCase() : typeof details.direction === "string" ? details.direction.toLowerCase() : void 0;
|
|
2198
|
+
if (!scrollX && !scrollY && direction && amount) {
|
|
2199
|
+
switch(direction){
|
|
2200
|
+
case "up":
|
|
2201
|
+
scrollY = -amount;
|
|
2202
|
+
break;
|
|
2203
|
+
case "down":
|
|
2204
|
+
scrollY = amount;
|
|
2205
|
+
break;
|
|
2206
|
+
case "left":
|
|
2207
|
+
scrollX = -amount;
|
|
2208
|
+
break;
|
|
2209
|
+
case "right":
|
|
2210
|
+
scrollX = amount;
|
|
2211
|
+
break;
|
|
2212
|
+
default:
|
|
2213
|
+
break;
|
|
2214
|
+
}
|
|
2215
|
+
}
|
|
2216
|
+
return {
|
|
2217
|
+
scroll_x: scrollX,
|
|
2218
|
+
scroll_y: scrollY
|
|
2219
|
+
};
|
|
2220
|
+
};
|
|
2221
|
+
var normalizeActionString = function(action, details) {
|
|
2222
|
+
var coords = findCoordinatesInDetails(details);
|
|
2223
|
+
switch(action){
|
|
2224
|
+
case "screenshot":
|
|
2225
|
+
return {
|
|
2226
|
+
type: "screenshot"
|
|
2227
|
+
};
|
|
2228
|
+
case "left_click":
|
|
2229
|
+
case "right_click":
|
|
2230
|
+
case "middle_click":
|
|
2231
|
+
{
|
|
2232
|
+
var _coords_x, _coords_y;
|
|
2233
|
+
return {
|
|
2234
|
+
type: "click",
|
|
2235
|
+
button: clickButtonMap[action],
|
|
2236
|
+
x: (_coords_x = coords === null || coords === void 0 ? void 0 : coords.x) !== null && _coords_x !== void 0 ? _coords_x : 0,
|
|
2237
|
+
y: (_coords_y = coords === null || coords === void 0 ? void 0 : coords.y) !== null && _coords_y !== void 0 ? _coords_y : 0
|
|
2238
|
+
};
|
|
2239
|
+
}
|
|
2240
|
+
case "double_click":
|
|
2241
|
+
var _coords_x1, _coords_y1;
|
|
2242
|
+
return {
|
|
2243
|
+
type: "double_click",
|
|
2244
|
+
x: (_coords_x1 = coords === null || coords === void 0 ? void 0 : coords.x) !== null && _coords_x1 !== void 0 ? _coords_x1 : 0,
|
|
2245
|
+
y: (_coords_y1 = coords === null || coords === void 0 ? void 0 : coords.y) !== null && _coords_y1 !== void 0 ? _coords_y1 : 0
|
|
2246
|
+
};
|
|
2247
|
+
case "triple_click":
|
|
2248
|
+
var _coords_x2, _coords_y2;
|
|
2249
|
+
return {
|
|
2250
|
+
type: "double_click",
|
|
2251
|
+
x: (_coords_x2 = coords === null || coords === void 0 ? void 0 : coords.x) !== null && _coords_x2 !== void 0 ? _coords_x2 : 0,
|
|
2252
|
+
y: (_coords_y2 = coords === null || coords === void 0 ? void 0 : coords.y) !== null && _coords_y2 !== void 0 ? _coords_y2 : 0,
|
|
2253
|
+
repetitions: 3
|
|
2254
|
+
};
|
|
2255
|
+
case "left_mouse_down":
|
|
2256
|
+
var _coords_x3, _coords_y3;
|
|
2257
|
+
return {
|
|
2258
|
+
type: "click",
|
|
2259
|
+
button: clickButtonMap[action],
|
|
2260
|
+
state: "down",
|
|
2261
|
+
x: (_coords_x3 = coords === null || coords === void 0 ? void 0 : coords.x) !== null && _coords_x3 !== void 0 ? _coords_x3 : 0,
|
|
2262
|
+
y: (_coords_y3 = coords === null || coords === void 0 ? void 0 : coords.y) !== null && _coords_y3 !== void 0 ? _coords_y3 : 0
|
|
2263
|
+
};
|
|
2264
|
+
case "left_mouse_up":
|
|
2265
|
+
var _coords_x4, _coords_y4;
|
|
2266
|
+
return {
|
|
2267
|
+
type: "click",
|
|
2268
|
+
button: clickButtonMap[action],
|
|
2269
|
+
state: "up",
|
|
2270
|
+
x: (_coords_x4 = coords === null || coords === void 0 ? void 0 : coords.x) !== null && _coords_x4 !== void 0 ? _coords_x4 : 0,
|
|
2271
|
+
y: (_coords_y4 = coords === null || coords === void 0 ? void 0 : coords.y) !== null && _coords_y4 !== void 0 ? _coords_y4 : 0
|
|
2272
|
+
};
|
|
2273
|
+
case "left_click_drag":
|
|
2274
|
+
{
|
|
2275
|
+
var path = buildDragPath(details).map(function(param) {
|
|
2276
|
+
var x = param.x, y = param.y;
|
|
2277
|
+
return {
|
|
2278
|
+
x: x,
|
|
2279
|
+
y: y
|
|
2280
|
+
};
|
|
2281
|
+
});
|
|
2282
|
+
return {
|
|
2283
|
+
type: "drag",
|
|
2284
|
+
path: path
|
|
2285
|
+
};
|
|
2286
|
+
}
|
|
2287
|
+
case "mouse_move":
|
|
2288
|
+
case "cursor_position":
|
|
2289
|
+
var _coords_x5, _coords_y5;
|
|
2290
|
+
return {
|
|
2291
|
+
type: "move",
|
|
2292
|
+
x: (_coords_x5 = coords === null || coords === void 0 ? void 0 : coords.x) !== null && _coords_x5 !== void 0 ? _coords_x5 : 0,
|
|
2293
|
+
y: (_coords_y5 = coords === null || coords === void 0 ? void 0 : coords.y) !== null && _coords_y5 !== void 0 ? _coords_y5 : 0
|
|
2294
|
+
};
|
|
2295
|
+
case "scroll":
|
|
2296
|
+
{
|
|
2297
|
+
var _normalizeScroll = normalizeScroll(details), scroll_x = _normalizeScroll.scroll_x, scroll_y = _normalizeScroll.scroll_y;
|
|
2298
|
+
var _coords_x6, _coords_y6;
|
|
2299
|
+
return _object_spread({
|
|
2300
|
+
type: "scroll",
|
|
2301
|
+
x: (_coords_x6 = coords === null || coords === void 0 ? void 0 : coords.x) !== null && _coords_x6 !== void 0 ? _coords_x6 : 0,
|
|
2302
|
+
y: (_coords_y6 = coords === null || coords === void 0 ? void 0 : coords.y) !== null && _coords_y6 !== void 0 ? _coords_y6 : 0,
|
|
2303
|
+
scroll_x: scroll_x,
|
|
2304
|
+
scroll_y: scroll_y
|
|
2305
|
+
}, typeof details.scroll_direction === "string" ? {
|
|
2306
|
+
direction: details.scroll_direction
|
|
2307
|
+
} : typeof details.direction === "string" ? {
|
|
2308
|
+
direction: details.direction
|
|
2309
|
+
} : {}, typeof details.scroll_amount === "number" ? {
|
|
2310
|
+
amount: details.scroll_amount
|
|
2311
|
+
} : typeof details.amount === "number" ? {
|
|
2312
|
+
amount: details.amount
|
|
2313
|
+
} : {});
|
|
2314
|
+
}
|
|
2315
|
+
case "type":
|
|
2316
|
+
{
|
|
2317
|
+
var text = typeof details.text === "string" ? details.text : typeof details.input === "string" ? details.input : "";
|
|
2318
|
+
return {
|
|
2319
|
+
type: "type",
|
|
2320
|
+
text: text
|
|
2321
|
+
};
|
|
2322
|
+
}
|
|
2323
|
+
case "key":
|
|
2324
|
+
case "hold_key":
|
|
2325
|
+
{
|
|
2326
|
+
var _details_text, _ref;
|
|
2327
|
+
var keys = normalizeKeys(parseKeys((_ref = (_details_text = details.text) !== null && _details_text !== void 0 ? _details_text : details.keys) !== null && _ref !== void 0 ? _ref : details.key));
|
|
2328
|
+
var normalized = {
|
|
2329
|
+
type: "keypress",
|
|
2330
|
+
keys: keys
|
|
2331
|
+
};
|
|
2332
|
+
if (action === "hold_key") {
|
|
2333
|
+
var duration = sanitizeNumber(details.duration);
|
|
2334
|
+
if (typeof duration === "number") {
|
|
2335
|
+
normalized.hold_duration_ms = Math.round(duration * 1e3);
|
|
2336
|
+
}
|
|
2337
|
+
}
|
|
2338
|
+
return normalized;
|
|
2339
|
+
}
|
|
2340
|
+
case "wait":
|
|
2341
|
+
{
|
|
2342
|
+
var duration1 = sanitizeNumber(details.duration);
|
|
2343
|
+
return _object_spread({
|
|
2344
|
+
type: "wait"
|
|
2345
|
+
}, typeof duration1 === "number" ? {
|
|
2346
|
+
duration_ms: Math.round(duration1 * 1e3)
|
|
2347
|
+
} : {});
|
|
2348
|
+
}
|
|
2349
|
+
default:
|
|
2350
|
+
{
|
|
2351
|
+
return _object_spread({
|
|
2352
|
+
type: action
|
|
2353
|
+
}, coords ? {
|
|
2354
|
+
x: coords.x,
|
|
2355
|
+
y: coords.y
|
|
2356
|
+
} : {}, (0, import_radash3.omit)(details, _to_consumable_array(coordinateKeys).concat([
|
|
2357
|
+
"text",
|
|
2358
|
+
"scroll_direction",
|
|
2359
|
+
"direction",
|
|
2360
|
+
"scroll_amount",
|
|
2361
|
+
"amount",
|
|
2362
|
+
"scroll_x",
|
|
2363
|
+
"scroll_y",
|
|
2364
|
+
"keys",
|
|
2365
|
+
"duration"
|
|
2366
|
+
])));
|
|
2367
|
+
}
|
|
2368
|
+
}
|
|
2369
|
+
};
|
|
2370
|
+
var normalizeAction = function(payload) {
|
|
2371
|
+
if (payload && (typeof payload === "undefined" ? "undefined" : _type_of(payload)) === "object") {
|
|
2372
|
+
var rawAction = payload.action;
|
|
2373
|
+
if (typeof rawAction === "string") {
|
|
2374
|
+
var parsedAction = parseJson(rawAction);
|
|
2375
|
+
if (parsedAction && (typeof parsedAction === "undefined" ? "undefined" : _type_of(parsedAction)) === "object") {
|
|
2376
|
+
rawAction = parsedAction;
|
|
2377
|
+
}
|
|
2378
|
+
}
|
|
2379
|
+
if (rawAction && (typeof rawAction === "undefined" ? "undefined" : _type_of(rawAction)) === "object" && typeof rawAction.type === "string") {
|
|
2380
|
+
return rawAction;
|
|
2381
|
+
}
|
|
2382
|
+
if (typeof rawAction === "string") {
|
|
2383
|
+
var details = (0, import_radash3.omit)(payload, [
|
|
2384
|
+
"action",
|
|
2385
|
+
"pending_safety_checks",
|
|
2386
|
+
"status"
|
|
2387
|
+
]);
|
|
2388
|
+
return normalizeActionString(rawAction, details);
|
|
2389
|
+
}
|
|
2390
|
+
if (typeof payload.type === "string") {
|
|
2391
|
+
return payload;
|
|
2392
|
+
}
|
|
2393
|
+
}
|
|
2394
|
+
if (typeof payload === "string") {
|
|
2395
|
+
var parsed = parseJson(payload);
|
|
2396
|
+
if (parsed && (typeof parsed === "undefined" ? "undefined" : _type_of(parsed)) === "object") {
|
|
2397
|
+
return normalizeAction(parsed);
|
|
2398
|
+
}
|
|
2399
|
+
return {
|
|
2400
|
+
type: payload
|
|
2401
|
+
};
|
|
2402
|
+
}
|
|
2403
|
+
return {
|
|
2404
|
+
type: "unknown",
|
|
2405
|
+
value: payload
|
|
2406
|
+
};
|
|
2407
|
+
};
|
|
2408
|
+
var normalizeComputerToolCallPayload = function(payload) {
|
|
2409
|
+
var normalizedPayload = payload;
|
|
2410
|
+
if (typeof payload === "string") {
|
|
2411
|
+
var parsed = parseJson(payload);
|
|
2412
|
+
if (parsed !== void 0) {
|
|
2413
|
+
normalizedPayload = parsed;
|
|
2414
|
+
}
|
|
2415
|
+
}
|
|
2416
|
+
var pendingSafetyChecksRaw = normalizedPayload && (typeof normalizedPayload === "undefined" ? "undefined" : _type_of(normalizedPayload)) === "object" ? normalizedPayload.pending_safety_checks : void 0;
|
|
2417
|
+
if (typeof pendingSafetyChecksRaw === "string") {
|
|
2418
|
+
var parsed1 = parseJson(pendingSafetyChecksRaw);
|
|
2419
|
+
pendingSafetyChecksRaw = Array.isArray(parsed1) ? parsed1 : [];
|
|
2420
|
+
}
|
|
2421
|
+
var pendingSafetyChecks = Array.isArray(pendingSafetyChecksRaw) ? pendingSafetyChecksRaw : [];
|
|
2422
|
+
var normalizedAction = normalizeAction(normalizedPayload);
|
|
2423
|
+
var result = {
|
|
2424
|
+
action: normalizedAction,
|
|
2425
|
+
pending_safety_checks: pendingSafetyChecks
|
|
2426
|
+
};
|
|
2427
|
+
if (normalizedPayload && (typeof normalizedPayload === "undefined" ? "undefined" : _type_of(normalizedPayload)) === "object" && "status" in normalizedPayload) {
|
|
2428
|
+
result.status = normalizedPayload.status;
|
|
2429
|
+
}
|
|
2430
|
+
return result;
|
|
2431
|
+
};
|
|
2432
|
+
var parseJson = function(value) {
|
|
2433
|
+
try {
|
|
2434
|
+
return JSON.parse(value);
|
|
2435
|
+
} catch (e) {
|
|
2436
|
+
return void 0;
|
|
2437
|
+
}
|
|
2438
|
+
};
|
|
1970
2439
|
// src/adapters/client/anthropicClientAdapter/completions/post.ts
|
|
1971
2440
|
var post5 = function(param) {
|
|
1972
2441
|
var anthropic = param.anthropic;
|
|
1973
2442
|
return /*#__PURE__*/ function() {
|
|
1974
2443
|
var _ref = _async_to_generator(function(_url, options) {
|
|
1975
|
-
var body, messages4, _ref, systemMessages, otherMessages, system, chatMessages, resultOptions, response, stream, data, error;
|
|
2444
|
+
var body, messages4, _ref, systemMessages, otherMessages, system, chatMessages, resultOptions, response, stream, data, normalizedContent, normalizedData, error;
|
|
1976
2445
|
return _ts_generator(this, function(_state) {
|
|
1977
2446
|
switch(_state.label){
|
|
1978
2447
|
case 0:
|
|
1979
2448
|
body = JSON.parse(options.body);
|
|
1980
2449
|
messages4 = body.messages;
|
|
1981
|
-
_ref = _sliced_to_array((0,
|
|
2450
|
+
_ref = _sliced_to_array((0, import_radash4.fork)(messages4, function(message) {
|
|
1982
2451
|
return message.role === "system";
|
|
1983
2452
|
}), 2), systemMessages = _ref[0], otherMessages = _ref[1];
|
|
1984
2453
|
system = systemMessages.map(function(message) {
|
|
@@ -1991,10 +2460,14 @@ var post5 = function(param) {
|
|
|
1991
2460
|
})
|
|
1992
2461
|
})
|
|
1993
2462
|
});
|
|
1994
|
-
resultOptions = _object_spread_props(_object_spread({}, (0,
|
|
2463
|
+
resultOptions = _object_spread_props(_object_spread(_object_spread_props(_object_spread({}, (0, import_radash4.omit)(body, [
|
|
1995
2464
|
"response_format"
|
|
1996
2465
|
])), {
|
|
1997
|
-
|
|
2466
|
+
model: body.model
|
|
2467
|
+
}), serializeBetas({
|
|
2468
|
+
tools: body.tools
|
|
2469
|
+
})), {
|
|
2470
|
+
stream: body.stream,
|
|
1998
2471
|
system: system,
|
|
1999
2472
|
messages: serializeMessages({
|
|
2000
2473
|
messages: chatMessages
|
|
@@ -2004,23 +2477,98 @@ var post5 = function(param) {
|
|
|
2004
2477
|
tools: body.tools
|
|
2005
2478
|
})
|
|
2006
2479
|
});
|
|
2007
|
-
if (!
|
|
2480
|
+
if (!resultOptions.stream) return [
|
|
2008
2481
|
3,
|
|
2009
2482
|
2
|
|
2010
2483
|
];
|
|
2011
2484
|
return [
|
|
2012
2485
|
4,
|
|
2013
|
-
anthropic.messages.
|
|
2486
|
+
anthropic.beta.messages.create(resultOptions)
|
|
2014
2487
|
];
|
|
2015
2488
|
case 1:
|
|
2016
2489
|
response = _state.sent();
|
|
2017
2490
|
stream = new ReadableStream({
|
|
2018
2491
|
start: function start(controller) {
|
|
2019
2492
|
return _async_to_generator(function() {
|
|
2020
|
-
var _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, chunk, delta, messageDelta, delta1, messageDelta1, messageDelta2, err;
|
|
2493
|
+
var blockIndexToToolUseId, toolUseIdToIndex, toolUseIdArgumentBuffer, computerToolUseIds, normalizedComputerCalls, nextToolCallIndex, parseJson2, getOrCreateIndexForToolUseId, assignBlockToToolUse, markComputerToolUse, getToolUseIdFromBlock, emitNormalizedToolCall, getOrCreateIndexForBlock, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, _ref, chunk, toolUseId, _toolUseIdArgumentBuffer_get, buffered, parsed, normalized, toolCallIndex, chunkIndex, delta, toolUseId1, _toolUseIdArgumentBuffer_get1, existing, _chunk_delta_partial_json, updated, parsed1, normalized1, toolCallIndex1, chunkIndex1, _toolUseIdArgumentBuffer_get2, existing1, _chunk_delta_partial_json1, index, messageDelta, delta1, toolName, normalizedToolName, index1, index2, _chunk_content_block_content, outputPayload, _getToolUseIdFromBlock, toolCallId, index3, _getToolUseIdFromBlock1, toolCallId1, _chunk_content_block, _toolUseId, _type, _id, rest, index4, _chunk_content_block_content1, outputPayload1, messageDelta1, messageDelta2, err;
|
|
2021
2494
|
return _ts_generator(this, function(_state) {
|
|
2022
2495
|
switch(_state.label){
|
|
2023
2496
|
case 0:
|
|
2497
|
+
blockIndexToToolUseId = /* @__PURE__ */ new Map();
|
|
2498
|
+
toolUseIdToIndex = /* @__PURE__ */ new Map();
|
|
2499
|
+
toolUseIdArgumentBuffer = /* @__PURE__ */ new Map();
|
|
2500
|
+
computerToolUseIds = /* @__PURE__ */ new Set();
|
|
2501
|
+
normalizedComputerCalls = /* @__PURE__ */ new Set();
|
|
2502
|
+
nextToolCallIndex = 0;
|
|
2503
|
+
parseJson2 = function(value) {
|
|
2504
|
+
try {
|
|
2505
|
+
return JSON.parse(value);
|
|
2506
|
+
} catch (e) {
|
|
2507
|
+
return void 0;
|
|
2508
|
+
}
|
|
2509
|
+
};
|
|
2510
|
+
getOrCreateIndexForToolUseId = function(toolUseId) {
|
|
2511
|
+
if (!toolUseId) {
|
|
2512
|
+
return 0;
|
|
2513
|
+
}
|
|
2514
|
+
if (!toolUseIdToIndex.has(toolUseId)) {
|
|
2515
|
+
toolUseIdToIndex.set(toolUseId, nextToolCallIndex++);
|
|
2516
|
+
}
|
|
2517
|
+
var _toolUseIdToIndex_get;
|
|
2518
|
+
return (_toolUseIdToIndex_get = toolUseIdToIndex.get(toolUseId)) !== null && _toolUseIdToIndex_get !== void 0 ? _toolUseIdToIndex_get : 0;
|
|
2519
|
+
};
|
|
2520
|
+
assignBlockToToolUse = function(param) {
|
|
2521
|
+
var blockIndex = param.blockIndex, toolUseId = param.toolUseId;
|
|
2522
|
+
if (typeof blockIndex === "number" && toolUseId) {
|
|
2523
|
+
blockIndexToToolUseId.set(blockIndex, toolUseId);
|
|
2524
|
+
}
|
|
2525
|
+
};
|
|
2526
|
+
markComputerToolUse = function(toolUseId) {
|
|
2527
|
+
if (!toolUseId) return;
|
|
2528
|
+
computerToolUseIds.add(toolUseId);
|
|
2529
|
+
normalizedComputerCalls.delete(toolUseId);
|
|
2530
|
+
toolUseIdArgumentBuffer.set(toolUseId, "");
|
|
2531
|
+
};
|
|
2532
|
+
getToolUseIdFromBlock = function(block) {
|
|
2533
|
+
if (!block || (typeof block === "undefined" ? "undefined" : _type_of(block)) !== "object") return void 0;
|
|
2534
|
+
if (typeof block.tool_use_id === "string") {
|
|
2535
|
+
return block.tool_use_id;
|
|
2536
|
+
}
|
|
2537
|
+
if (typeof block.id === "string") {
|
|
2538
|
+
return block.id;
|
|
2539
|
+
}
|
|
2540
|
+
return void 0;
|
|
2541
|
+
};
|
|
2542
|
+
emitNormalizedToolCall = function(param) {
|
|
2543
|
+
var normalized = param.normalized, toolCallIndex = param.toolCallIndex, chunkIndex = param.chunkIndex;
|
|
2544
|
+
var messageDelta = {
|
|
2545
|
+
id: "chatcmpl-".concat((0, import_radash4.uid)(29)),
|
|
2546
|
+
object: "chat.completion.chunk",
|
|
2547
|
+
choices: [
|
|
2548
|
+
{
|
|
2549
|
+
index: chunkIndex,
|
|
2550
|
+
delta: {
|
|
2551
|
+
tool_calls: [
|
|
2552
|
+
{
|
|
2553
|
+
index: toolCallIndex,
|
|
2554
|
+
function: {
|
|
2555
|
+
arguments: JSON.stringify(normalized)
|
|
2556
|
+
}
|
|
2557
|
+
}
|
|
2558
|
+
]
|
|
2559
|
+
}
|
|
2560
|
+
}
|
|
2561
|
+
]
|
|
2562
|
+
};
|
|
2563
|
+
controller.enqueue("data: ".concat(JSON.stringify(messageDelta), "\n\n"));
|
|
2564
|
+
};
|
|
2565
|
+
getOrCreateIndexForBlock = function(blockIndex) {
|
|
2566
|
+
if (typeof blockIndex !== "number") {
|
|
2567
|
+
return 0;
|
|
2568
|
+
}
|
|
2569
|
+
var toolUseId = blockIndexToToolUseId.get(blockIndex);
|
|
2570
|
+
return getOrCreateIndexForToolUseId(toolUseId);
|
|
2571
|
+
};
|
|
2024
2572
|
_iteratorAbruptCompletion = false, _didIteratorError = false;
|
|
2025
2573
|
_state.label = 1;
|
|
2026
2574
|
case 1:
|
|
@@ -2043,14 +2591,79 @@ var post5 = function(param) {
|
|
|
2043
2591
|
5
|
|
2044
2592
|
];
|
|
2045
2593
|
_value = _step.value;
|
|
2046
|
-
|
|
2594
|
+
_ref = _value;
|
|
2595
|
+
chunk = _ref;
|
|
2596
|
+
if (chunk.type === "content_block_stop") {
|
|
2597
|
+
toolUseId = typeof chunk.index === "number" ? blockIndexToToolUseId.get(chunk.index) : void 0;
|
|
2598
|
+
if (toolUseId && computerToolUseIds.has(toolUseId) && !normalizedComputerCalls.has(toolUseId)) {
|
|
2599
|
+
;
|
|
2600
|
+
buffered = (_toolUseIdArgumentBuffer_get = toolUseIdArgumentBuffer.get(toolUseId)) !== null && _toolUseIdArgumentBuffer_get !== void 0 ? _toolUseIdArgumentBuffer_get : "";
|
|
2601
|
+
parsed = buffered ? parseJson2(buffered) : void 0;
|
|
2602
|
+
if (parsed !== void 0) {
|
|
2603
|
+
normalized = normalizeComputerToolCallPayload(parsed);
|
|
2604
|
+
toolCallIndex = getOrCreateIndexForToolUseId(toolUseId);
|
|
2605
|
+
chunkIndex = typeof chunk.index === "number" ? chunk.index : 0;
|
|
2606
|
+
emitNormalizedToolCall({
|
|
2607
|
+
normalized: normalized,
|
|
2608
|
+
toolCallIndex: toolCallIndex,
|
|
2609
|
+
chunkIndex: chunkIndex
|
|
2610
|
+
});
|
|
2611
|
+
normalizedComputerCalls.add(toolUseId);
|
|
2612
|
+
}
|
|
2613
|
+
}
|
|
2614
|
+
if (toolUseId) {
|
|
2615
|
+
toolUseIdArgumentBuffer.delete(toolUseId);
|
|
2616
|
+
computerToolUseIds.delete(toolUseId);
|
|
2617
|
+
normalizedComputerCalls.delete(toolUseId);
|
|
2618
|
+
}
|
|
2619
|
+
if (typeof chunk.index === "number") {
|
|
2620
|
+
blockIndexToToolUseId.delete(chunk.index);
|
|
2621
|
+
}
|
|
2622
|
+
return [
|
|
2623
|
+
3,
|
|
2624
|
+
4
|
|
2625
|
+
];
|
|
2626
|
+
}
|
|
2047
2627
|
if (chunk.type === "content_block_delta") {
|
|
2048
2628
|
delta = void 0;
|
|
2049
2629
|
if (chunk.delta.type === "input_json_delta") {
|
|
2630
|
+
toolUseId1 = typeof chunk.index === "number" ? blockIndexToToolUseId.get(chunk.index) : void 0;
|
|
2631
|
+
if (toolUseId1 && computerToolUseIds.has(toolUseId1)) {
|
|
2632
|
+
;
|
|
2633
|
+
existing = (_toolUseIdArgumentBuffer_get1 = toolUseIdArgumentBuffer.get(toolUseId1)) !== null && _toolUseIdArgumentBuffer_get1 !== void 0 ? _toolUseIdArgumentBuffer_get1 : "";
|
|
2634
|
+
;
|
|
2635
|
+
updated = "".concat(existing).concat((_chunk_delta_partial_json = chunk.delta.partial_json) !== null && _chunk_delta_partial_json !== void 0 ? _chunk_delta_partial_json : "");
|
|
2636
|
+
toolUseIdArgumentBuffer.set(toolUseId1, updated);
|
|
2637
|
+
if (!normalizedComputerCalls.has(toolUseId1)) {
|
|
2638
|
+
parsed1 = parseJson2(updated);
|
|
2639
|
+
if (parsed1 !== void 0) {
|
|
2640
|
+
normalized1 = normalizeComputerToolCallPayload(parsed1);
|
|
2641
|
+
toolCallIndex1 = getOrCreateIndexForToolUseId(toolUseId1);
|
|
2642
|
+
chunkIndex1 = typeof chunk.index === "number" ? chunk.index : 0;
|
|
2643
|
+
emitNormalizedToolCall({
|
|
2644
|
+
normalized: normalized1,
|
|
2645
|
+
toolCallIndex: toolCallIndex1,
|
|
2646
|
+
chunkIndex: chunkIndex1
|
|
2647
|
+
});
|
|
2648
|
+
normalizedComputerCalls.add(toolUseId1);
|
|
2649
|
+
}
|
|
2650
|
+
}
|
|
2651
|
+
return [
|
|
2652
|
+
3,
|
|
2653
|
+
4
|
|
2654
|
+
];
|
|
2655
|
+
}
|
|
2656
|
+
if (toolUseId1) {
|
|
2657
|
+
;
|
|
2658
|
+
existing1 = (_toolUseIdArgumentBuffer_get2 = toolUseIdArgumentBuffer.get(toolUseId1)) !== null && _toolUseIdArgumentBuffer_get2 !== void 0 ? _toolUseIdArgumentBuffer_get2 : "";
|
|
2659
|
+
;
|
|
2660
|
+
toolUseIdArgumentBuffer.set(toolUseId1, "".concat(existing1).concat((_chunk_delta_partial_json1 = chunk.delta.partial_json) !== null && _chunk_delta_partial_json1 !== void 0 ? _chunk_delta_partial_json1 : ""));
|
|
2661
|
+
}
|
|
2662
|
+
index = getOrCreateIndexForBlock(chunk.index);
|
|
2050
2663
|
delta = {
|
|
2051
2664
|
tool_calls: [
|
|
2052
2665
|
{
|
|
2053
|
-
index:
|
|
2666
|
+
index: index,
|
|
2054
2667
|
function: {
|
|
2055
2668
|
arguments: chunk.delta.partial_json
|
|
2056
2669
|
}
|
|
@@ -2067,7 +2680,7 @@ var post5 = function(param) {
|
|
|
2067
2680
|
};
|
|
2068
2681
|
}
|
|
2069
2682
|
messageDelta = {
|
|
2070
|
-
id: "chatcmpl-".concat((0,
|
|
2683
|
+
id: "chatcmpl-".concat((0, import_radash4.uid)(29)),
|
|
2071
2684
|
object: "chat.completion.chunk",
|
|
2072
2685
|
choices: [
|
|
2073
2686
|
{
|
|
@@ -2080,11 +2693,46 @@ var post5 = function(param) {
|
|
|
2080
2693
|
} else if (chunk.type === "content_block_start") {
|
|
2081
2694
|
delta1 = void 0;
|
|
2082
2695
|
if (chunk.content_block.type === "tool_use") {
|
|
2696
|
+
toolName = chunk.content_block.name;
|
|
2697
|
+
normalizedToolName = toolName === "computer" ? "computer_call" : toolName;
|
|
2698
|
+
index1 = getOrCreateIndexForToolUseId(chunk.content_block.id);
|
|
2699
|
+
assignBlockToToolUse({
|
|
2700
|
+
blockIndex: chunk.index,
|
|
2701
|
+
toolUseId: chunk.content_block.id
|
|
2702
|
+
});
|
|
2703
|
+
if (normalizedToolName === "computer_call") {
|
|
2704
|
+
markComputerToolUse(chunk.content_block.id);
|
|
2705
|
+
} else if (!toolUseIdArgumentBuffer.has(chunk.content_block.id)) {
|
|
2706
|
+
toolUseIdArgumentBuffer.set(chunk.content_block.id, "");
|
|
2707
|
+
}
|
|
2708
|
+
delta1 = {
|
|
2709
|
+
content: null,
|
|
2710
|
+
tool_calls: [
|
|
2711
|
+
{
|
|
2712
|
+
index: index1,
|
|
2713
|
+
id: chunk.content_block.id,
|
|
2714
|
+
type: "function",
|
|
2715
|
+
function: {
|
|
2716
|
+
name: normalizedToolName,
|
|
2717
|
+
arguments: ""
|
|
2718
|
+
}
|
|
2719
|
+
}
|
|
2720
|
+
]
|
|
2721
|
+
};
|
|
2722
|
+
} else if (chunk.content_block.type === "server_tool_use") {
|
|
2723
|
+
index2 = getOrCreateIndexForToolUseId(chunk.content_block.id);
|
|
2724
|
+
assignBlockToToolUse({
|
|
2725
|
+
blockIndex: chunk.index,
|
|
2726
|
+
toolUseId: chunk.content_block.id
|
|
2727
|
+
});
|
|
2728
|
+
if (!toolUseIdArgumentBuffer.has(chunk.content_block.id)) {
|
|
2729
|
+
toolUseIdArgumentBuffer.set(chunk.content_block.id, "");
|
|
2730
|
+
}
|
|
2083
2731
|
delta1 = {
|
|
2084
2732
|
content: null,
|
|
2085
2733
|
tool_calls: [
|
|
2086
2734
|
{
|
|
2087
|
-
index:
|
|
2735
|
+
index: index2,
|
|
2088
2736
|
id: chunk.content_block.id,
|
|
2089
2737
|
type: "function",
|
|
2090
2738
|
function: {
|
|
@@ -2094,6 +2742,65 @@ var post5 = function(param) {
|
|
|
2094
2742
|
}
|
|
2095
2743
|
]
|
|
2096
2744
|
};
|
|
2745
|
+
} else if (chunk.content_block.type === "web_search_tool_result") {
|
|
2746
|
+
;
|
|
2747
|
+
outputPayload = {
|
|
2748
|
+
content: (_chunk_content_block_content = chunk.content_block.content) !== null && _chunk_content_block_content !== void 0 ? _chunk_content_block_content : []
|
|
2749
|
+
};
|
|
2750
|
+
;
|
|
2751
|
+
toolCallId = (_getToolUseIdFromBlock = getToolUseIdFromBlock(chunk.content_block)) !== null && _getToolUseIdFromBlock !== void 0 ? _getToolUseIdFromBlock : "";
|
|
2752
|
+
index3 = getOrCreateIndexForToolUseId(toolCallId);
|
|
2753
|
+
assignBlockToToolUse({
|
|
2754
|
+
blockIndex: chunk.index,
|
|
2755
|
+
toolUseId: toolCallId
|
|
2756
|
+
});
|
|
2757
|
+
delta1 = {
|
|
2758
|
+
content: null,
|
|
2759
|
+
tool_calls: [
|
|
2760
|
+
{
|
|
2761
|
+
index: index3,
|
|
2762
|
+
id: toolCallId,
|
|
2763
|
+
type: "function",
|
|
2764
|
+
function: {
|
|
2765
|
+
output: JSON.stringify(outputPayload)
|
|
2766
|
+
}
|
|
2767
|
+
}
|
|
2768
|
+
]
|
|
2769
|
+
};
|
|
2770
|
+
} else if ([
|
|
2771
|
+
"code_execution_tool_result",
|
|
2772
|
+
"bash_code_execution_tool_result",
|
|
2773
|
+
"python_code_execution_tool_result"
|
|
2774
|
+
].includes(chunk.content_block.type)) {
|
|
2775
|
+
;
|
|
2776
|
+
toolCallId1 = (_getToolUseIdFromBlock1 = getToolUseIdFromBlock(chunk.content_block)) !== null && _getToolUseIdFromBlock1 !== void 0 ? _getToolUseIdFromBlock1 : "";
|
|
2777
|
+
_chunk_content_block = chunk.content_block, _toolUseId = _chunk_content_block.tool_use_id, _type = _chunk_content_block.type, _id = _chunk_content_block.id, rest = _object_without_properties(_chunk_content_block, [
|
|
2778
|
+
"tool_use_id",
|
|
2779
|
+
"type",
|
|
2780
|
+
"id"
|
|
2781
|
+
]);
|
|
2782
|
+
index4 = getOrCreateIndexForToolUseId(toolCallId1);
|
|
2783
|
+
assignBlockToToolUse({
|
|
2784
|
+
blockIndex: chunk.index,
|
|
2785
|
+
toolUseId: toolCallId1
|
|
2786
|
+
});
|
|
2787
|
+
;
|
|
2788
|
+
outputPayload1 = Object.keys(rest).length > 0 ? rest : {
|
|
2789
|
+
content: (_chunk_content_block_content1 = chunk.content_block.content) !== null && _chunk_content_block_content1 !== void 0 ? _chunk_content_block_content1 : {}
|
|
2790
|
+
};
|
|
2791
|
+
delta1 = {
|
|
2792
|
+
content: null,
|
|
2793
|
+
tool_calls: [
|
|
2794
|
+
{
|
|
2795
|
+
index: index4,
|
|
2796
|
+
id: toolCallId1,
|
|
2797
|
+
type: "function",
|
|
2798
|
+
function: {
|
|
2799
|
+
output: JSON.stringify(outputPayload1)
|
|
2800
|
+
}
|
|
2801
|
+
}
|
|
2802
|
+
]
|
|
2803
|
+
};
|
|
2097
2804
|
} else if ("text" in chunk.content_block) {
|
|
2098
2805
|
delta1 = {
|
|
2099
2806
|
content: chunk.content_block.text
|
|
@@ -2104,7 +2811,7 @@ var post5 = function(param) {
|
|
|
2104
2811
|
};
|
|
2105
2812
|
}
|
|
2106
2813
|
messageDelta1 = {
|
|
2107
|
-
id: "chatcmpl-".concat((0,
|
|
2814
|
+
id: "chatcmpl-".concat((0, import_radash4.uid)(29)),
|
|
2108
2815
|
object: "chat.completion.chunk",
|
|
2109
2816
|
choices: [
|
|
2110
2817
|
{
|
|
@@ -2116,7 +2823,7 @@ var post5 = function(param) {
|
|
|
2116
2823
|
controller.enqueue("data: ".concat(JSON.stringify(messageDelta1), "\n\n"));
|
|
2117
2824
|
} else if (chunk.type === "message_start") {
|
|
2118
2825
|
messageDelta2 = {
|
|
2119
|
-
id: "chatcmpl-".concat((0,
|
|
2826
|
+
id: "chatcmpl-".concat((0, import_radash4.uid)(29)),
|
|
2120
2827
|
object: "chat.completion.chunk",
|
|
2121
2828
|
choices: [
|
|
2122
2829
|
{
|
|
@@ -2214,10 +2921,22 @@ var post5 = function(param) {
|
|
|
2214
2921
|
];
|
|
2215
2922
|
case 3:
|
|
2216
2923
|
data = _state.sent();
|
|
2924
|
+
normalizedContent = Array.isArray(data === null || data === void 0 ? void 0 : data.content) ? data.content.map(function(block) {
|
|
2925
|
+
if ((block === null || block === void 0 ? void 0 : block.type) === "tool_use" && (block === null || block === void 0 ? void 0 : block.name) === "computer") {
|
|
2926
|
+
var _block_input;
|
|
2927
|
+
return _object_spread_props(_object_spread({}, block), {
|
|
2928
|
+
input: normalizeComputerToolCallPayload((_block_input = block.input) !== null && _block_input !== void 0 ? _block_input : {})
|
|
2929
|
+
});
|
|
2930
|
+
}
|
|
2931
|
+
return block;
|
|
2932
|
+
}) : data === null || data === void 0 ? void 0 : data.content;
|
|
2933
|
+
normalizedData = _object_spread({}, data, normalizedContent ? {
|
|
2934
|
+
content: normalizedContent
|
|
2935
|
+
} : {});
|
|
2217
2936
|
return [
|
|
2218
2937
|
2,
|
|
2219
2938
|
new Response(JSON.stringify({
|
|
2220
|
-
data:
|
|
2939
|
+
data: normalizedData
|
|
2221
2940
|
}), {
|
|
2222
2941
|
status: 200,
|
|
2223
2942
|
headers: {
|
|
@@ -3287,21 +4006,21 @@ var ollamaClientAdapter = function(param) {
|
|
|
3287
4006
|
};
|
|
3288
4007
|
// src/adapters/run/completionsRunAdapter/index.ts
|
|
3289
4008
|
var import_lodash = __toESM(require("lodash"), 1);
|
|
3290
|
-
var
|
|
4009
|
+
var import_radash7 = require("radash");
|
|
3291
4010
|
var import_dayjs = __toESM(require("dayjs"), 1);
|
|
3292
4011
|
// src/adapters/run/completionsRunAdapter/messages/index.ts
|
|
3293
|
-
var
|
|
4012
|
+
var import_radash6 = require("radash");
|
|
3294
4013
|
// src/adapters/run/completionsRunAdapter/messages/serializeMessage.ts
|
|
3295
|
-
var
|
|
4014
|
+
var import_radash5 = require("radash");
|
|
3296
4015
|
var validToolCallContentTypes = [
|
|
3297
4016
|
"image",
|
|
3298
4017
|
"text"
|
|
3299
4018
|
];
|
|
3300
4019
|
var serializeToolContent = function(param) {
|
|
3301
4020
|
var toolCall = param.toolCall;
|
|
3302
|
-
if ((0,
|
|
4021
|
+
if ((0, import_radash5.isArray)(toolCall.function.output)) {
|
|
3303
4022
|
var isEveryToolPartValid = toolCall.function.output.every(function(toolPart) {
|
|
3304
|
-
if (!(0,
|
|
4023
|
+
if (!(0, import_radash5.isObject)(toolPart)) return false;
|
|
3305
4024
|
return validToolCallContentTypes.includes(toolPart.type);
|
|
3306
4025
|
});
|
|
3307
4026
|
if (isEveryToolPartValid) {
|
|
@@ -3389,7 +4108,7 @@ var messages = /*#__PURE__*/ function() {
|
|
|
3389
4108
|
content: run3.instructions
|
|
3390
4109
|
}
|
|
3391
4110
|
] : [])).concat;
|
|
3392
|
-
_2 = (0,
|
|
4111
|
+
_2 = (0, import_radash6.flat);
|
|
3393
4112
|
return [
|
|
3394
4113
|
4,
|
|
3395
4114
|
getMessages2()
|
|
@@ -3419,7 +4138,7 @@ var messages = /*#__PURE__*/ function() {
|
|
|
3419
4138
|
// src/adapters/run/completionsRunAdapter/index.ts
|
|
3420
4139
|
var updatedToolCall = function(param) {
|
|
3421
4140
|
var toolCall = param.toolCall, delta = param.delta;
|
|
3422
|
-
if (!toolCall) return (0,
|
|
4141
|
+
if (!toolCall) return (0, import_radash7.omit)(delta, [
|
|
3423
4142
|
"index"
|
|
3424
4143
|
]);
|
|
3425
4144
|
var result = import_lodash.default.cloneDeep(toolCall);
|
|
@@ -3450,10 +4169,11 @@ var toolCallsData = function(param) {
|
|
|
3450
4169
|
var prevToolCalls = param.prevToolCalls, delta = param.delta;
|
|
3451
4170
|
if (!prevToolCalls) {
|
|
3452
4171
|
return delta.tool_calls.map(function(tc) {
|
|
4172
|
+
var _tc_type;
|
|
3453
4173
|
return _object_spread({
|
|
3454
|
-
id: (0,
|
|
3455
|
-
type: "function"
|
|
3456
|
-
}, (0,
|
|
4174
|
+
id: (0, import_radash7.uid)(24),
|
|
4175
|
+
type: (_tc_type = tc.type) !== null && _tc_type !== void 0 ? _tc_type : "function"
|
|
4176
|
+
}, (0, import_radash7.omit)(tc, [
|
|
3457
4177
|
"index"
|
|
3458
4178
|
]));
|
|
3459
4179
|
});
|
|
@@ -3488,7 +4208,7 @@ var completionsRunAdapter = function() {
|
|
|
3488
4208
|
return {
|
|
3489
4209
|
handleRun: /*#__PURE__*/ function() {
|
|
3490
4210
|
var _ref = _async_to_generator(function(param) {
|
|
3491
|
-
var client, run3, onEvent2, getMessages2, opts, _tmp, providerResponse, e, _e_cause, _e_message, _e_cause_message, message, toolCallsRunStep, currentContent, currentToolCalls, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, chunk, _chunk_choices, choices, choice, delta, _delta_content, err;
|
|
4211
|
+
var client, run3, onEvent2, getMessages2, opts, _tmp, providerResponse, e, _e_cause, _e_message, _e_cause_message, message, toolCallsRunStep, currentContent, currentToolCalls, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, chunk, _chunk_choices, choices, choice, delta, _delta_content, err, _message_toolCalls, messageToolCalls, functionToolCalls, pendingFunctionToolCalls, requiredToolCalls;
|
|
3492
4212
|
return _ts_generator(this, function(_state) {
|
|
3493
4213
|
switch(_state.label){
|
|
3494
4214
|
case 0:
|
|
@@ -3513,7 +4233,7 @@ var completionsRunAdapter = function() {
|
|
|
3513
4233
|
case 1:
|
|
3514
4234
|
opts = _object_spread.apply(void 0, [
|
|
3515
4235
|
(_tmp.messages = _state.sent(), _tmp.model = run3.model, _tmp.stream = true, _tmp.response_format = run3.response_format, _tmp),
|
|
3516
|
-
(0,
|
|
4236
|
+
(0, import_radash7.isEmpty)(run3.tools) ? {} : {
|
|
3517
4237
|
tools: run3.tools
|
|
3518
4238
|
}
|
|
3519
4239
|
]);
|
|
@@ -3695,9 +4415,10 @@ var completionsRunAdapter = function() {
|
|
|
3695
4415
|
step_details: {
|
|
3696
4416
|
type: "tool_calls",
|
|
3697
4417
|
tool_calls: delta.tool_calls.map(function(tc) {
|
|
4418
|
+
var _tc_type;
|
|
3698
4419
|
return _object_spread({
|
|
3699
|
-
id: (0,
|
|
3700
|
-
type: "function"
|
|
4420
|
+
id: (0, import_radash7.uid)(24),
|
|
4421
|
+
type: (_tc_type = tc.type) !== null && _tc_type !== void 0 ? _tc_type : "function"
|
|
3701
4422
|
}, tc);
|
|
3702
4423
|
})
|
|
3703
4424
|
}
|
|
@@ -3805,28 +4526,93 @@ var completionsRunAdapter = function() {
|
|
|
3805
4526
|
];
|
|
3806
4527
|
case 22:
|
|
3807
4528
|
message = _state.sent();
|
|
3808
|
-
|
|
3809
|
-
|
|
3810
|
-
|
|
3811
|
-
|
|
3812
|
-
|
|
3813
|
-
|
|
3814
|
-
|
|
3815
|
-
|
|
3816
|
-
|
|
3817
|
-
|
|
3818
|
-
|
|
3819
|
-
|
|
4529
|
+
messageToolCalls = (_message_toolCalls = message.toolCalls) !== null && _message_toolCalls !== void 0 ? _message_toolCalls : [];
|
|
4530
|
+
functionToolCalls = messageToolCalls.filter(function(toolCall) {
|
|
4531
|
+
return toolCall.type === "function";
|
|
4532
|
+
});
|
|
4533
|
+
pendingFunctionToolCalls = functionToolCalls.filter(function(toolCall) {
|
|
4534
|
+
var _toolCall_function;
|
|
4535
|
+
return !((_toolCall_function = toolCall.function) === null || _toolCall_function === void 0 ? void 0 : _toolCall_function.output);
|
|
4536
|
+
});
|
|
4537
|
+
if (!(0, import_radash7.isEmpty)(pendingFunctionToolCalls)) return [
|
|
4538
|
+
3,
|
|
4539
|
+
25
|
|
4540
|
+
];
|
|
4541
|
+
if (!toolCallsRunStep) return [
|
|
4542
|
+
3,
|
|
4543
|
+
24
|
|
4544
|
+
];
|
|
3820
4545
|
return [
|
|
3821
|
-
|
|
4546
|
+
4,
|
|
3822
4547
|
onEvent2({
|
|
3823
|
-
event: "thread.run.
|
|
3824
|
-
data: _object_spread_props(_object_spread({},
|
|
3825
|
-
status: "
|
|
3826
|
-
|
|
3827
|
-
|
|
4548
|
+
event: "thread.run.step.completed",
|
|
4549
|
+
data: _object_spread_props(_object_spread({}, toolCallsRunStep), {
|
|
4550
|
+
status: "completed",
|
|
4551
|
+
completed_at: (0, import_dayjs.default)().unix(),
|
|
4552
|
+
step_details: {
|
|
4553
|
+
type: "tool_calls",
|
|
4554
|
+
tool_calls: currentToolCalls !== null && currentToolCalls !== void 0 ? currentToolCalls : []
|
|
4555
|
+
}
|
|
4556
|
+
})
|
|
4557
|
+
})
|
|
4558
|
+
];
|
|
4559
|
+
case 23:
|
|
4560
|
+
toolCallsRunStep = _state.sent();
|
|
4561
|
+
_state.label = 24;
|
|
4562
|
+
case 24:
|
|
4563
|
+
return [
|
|
4564
|
+
2,
|
|
4565
|
+
onEvent2({
|
|
4566
|
+
event: "thread.run.completed",
|
|
4567
|
+
data: _object_spread_props(_object_spread({}, run3), {
|
|
4568
|
+
status: "completed",
|
|
4569
|
+
completed_at: (0, import_dayjs.default)().unix()
|
|
4570
|
+
})
|
|
4571
|
+
})
|
|
4572
|
+
];
|
|
4573
|
+
case 25:
|
|
4574
|
+
requiredToolCalls = pendingFunctionToolCalls.map(function(toolCall) {
|
|
4575
|
+
var _toolCall_function, _toolCall_function1, _toolCall_function2;
|
|
4576
|
+
var _toolCall_function_arguments;
|
|
4577
|
+
var args = (_toolCall_function_arguments = (_toolCall_function = toolCall.function) === null || _toolCall_function === void 0 ? void 0 : _toolCall_function.arguments) !== null && _toolCall_function_arguments !== void 0 ? _toolCall_function_arguments : "";
|
|
4578
|
+
if (((_toolCall_function1 = toolCall.function) === null || _toolCall_function1 === void 0 ? void 0 : _toolCall_function1.name) === "computer_call") {
|
|
4579
|
+
var parsedArguments = {};
|
|
4580
|
+
try {
|
|
4581
|
+
parsedArguments = JSON.parse(args || "{}");
|
|
4582
|
+
} catch (e) {
|
|
4583
|
+
parsedArguments = {};
|
|
4584
|
+
}
|
|
4585
|
+
var _parsedArguments_action, _ref;
|
|
4586
|
+
var computerCall = {
|
|
4587
|
+
action: (_ref = (_parsedArguments_action = parsedArguments === null || parsedArguments === void 0 ? void 0 : parsedArguments.action) !== null && _parsedArguments_action !== void 0 ? _parsedArguments_action : parsedArguments) !== null && _ref !== void 0 ? _ref : {},
|
|
4588
|
+
pending_safety_checks: Array.isArray(parsedArguments === null || parsedArguments === void 0 ? void 0 : parsedArguments.pending_safety_checks) ? parsedArguments.pending_safety_checks : []
|
|
4589
|
+
};
|
|
4590
|
+
return {
|
|
4591
|
+
id: toolCall.id,
|
|
4592
|
+
type: "computer_call",
|
|
4593
|
+
computer_call: computerCall
|
|
4594
|
+
};
|
|
4595
|
+
}
|
|
4596
|
+
var _toolCall_function_name;
|
|
4597
|
+
return {
|
|
4598
|
+
id: toolCall.id,
|
|
4599
|
+
type: "function",
|
|
4600
|
+
function: {
|
|
4601
|
+
name: (_toolCall_function_name = (_toolCall_function2 = toolCall.function) === null || _toolCall_function2 === void 0 ? void 0 : _toolCall_function2.name) !== null && _toolCall_function_name !== void 0 ? _toolCall_function_name : "",
|
|
4602
|
+
arguments: args
|
|
4603
|
+
}
|
|
4604
|
+
};
|
|
4605
|
+
});
|
|
4606
|
+
return [
|
|
4607
|
+
2,
|
|
4608
|
+
onEvent2({
|
|
4609
|
+
event: "thread.run.requires_action",
|
|
4610
|
+
data: _object_spread_props(_object_spread({}, run3), {
|
|
4611
|
+
status: "requires_action",
|
|
4612
|
+
required_action: {
|
|
4613
|
+
type: "submit_tool_outputs",
|
|
3828
4614
|
submit_tool_outputs: {
|
|
3829
|
-
tool_calls:
|
|
4615
|
+
tool_calls: requiredToolCalls
|
|
3830
4616
|
}
|
|
3831
4617
|
}
|
|
3832
4618
|
})
|
|
@@ -3952,10 +4738,10 @@ var threads = function(param) {
|
|
|
3952
4738
|
};
|
|
3953
4739
|
};
|
|
3954
4740
|
// src/adapters/storage/prismaStorageAdapter/threads/messages/post.ts
|
|
3955
|
-
var
|
|
4741
|
+
var import_radash9 = require("radash");
|
|
3956
4742
|
// src/adapters/storage/prismaStorageAdapter/threads/messages/serializeMessage.ts
|
|
3957
4743
|
var import_dayjs4 = __toESM(require("dayjs"), 1);
|
|
3958
|
-
var
|
|
4744
|
+
var import_radash8 = require("radash");
|
|
3959
4745
|
var serializeMessage4 = function(param) {
|
|
3960
4746
|
var message = param.message;
|
|
3961
4747
|
var _message_metadata;
|
|
@@ -3973,7 +4759,7 @@ var serializeMessage4 = function(param) {
|
|
|
3973
4759
|
run_id: message.runId,
|
|
3974
4760
|
attachments: message.attachments,
|
|
3975
4761
|
status: message.status.toLowerCase(),
|
|
3976
|
-
metadata: (0,
|
|
4762
|
+
metadata: (0, import_radash8.assign)((_message_metadata = message.metadata) !== null && _message_metadata !== void 0 ? _message_metadata : {}, message.toolCalls ? {
|
|
3977
4763
|
toolCalls: message.toolCalls
|
|
3978
4764
|
} : {})
|
|
3979
4765
|
};
|
|
@@ -3981,7 +4767,7 @@ var serializeMessage4 = function(param) {
|
|
|
3981
4767
|
// src/adapters/storage/prismaStorageAdapter/threads/messages/post.ts
|
|
3982
4768
|
var messageContentBlocks = function(param) {
|
|
3983
4769
|
var content = param.content;
|
|
3984
|
-
if ((0,
|
|
4770
|
+
if ((0, import_radash9.isArray)(content)) {
|
|
3985
4771
|
return content.map(function(item) {
|
|
3986
4772
|
if (item.type === "text") {
|
|
3987
4773
|
var _item_text;
|
|
@@ -4056,7 +4842,7 @@ var post11 = function(param) {
|
|
|
4056
4842
|
}();
|
|
4057
4843
|
};
|
|
4058
4844
|
// src/adapters/storage/prismaStorageAdapter/threads/messages/get.ts
|
|
4059
|
-
var
|
|
4845
|
+
var import_radash10 = require("radash");
|
|
4060
4846
|
var get10 = function(param) {
|
|
4061
4847
|
var prisma = param.prisma;
|
|
4062
4848
|
return /*#__PURE__*/ function() {
|
|
@@ -4067,7 +4853,7 @@ var get10 = function(param) {
|
|
|
4067
4853
|
case 0:
|
|
4068
4854
|
url = new URL(urlString);
|
|
4069
4855
|
_url_pathname_match = _sliced_to_array(url.pathname.match(new RegExp(messagesRegexp)), 2), threadId = _url_pathname_match[1];
|
|
4070
|
-
_ref = (0,
|
|
4856
|
+
_ref = (0, import_radash10.assign)({
|
|
4071
4857
|
limit: "20",
|
|
4072
4858
|
order: "desc"
|
|
4073
4859
|
}, Object.fromEntries(url.searchParams)), limit = _ref.limit, order = _ref.order, after = _ref.after;
|
|
@@ -4101,7 +4887,7 @@ var get10 = function(param) {
|
|
|
4101
4887
|
});
|
|
4102
4888
|
}),
|
|
4103
4889
|
has_more: messagesPlusOne.length > pageSize,
|
|
4104
|
-
last_id: (_id = (_this = (0,
|
|
4890
|
+
last_id: (_id = (_this = (0, import_radash10.last)(messages4)) === null || _this === void 0 ? void 0 : _this.id) !== null && _id !== void 0 ? _id : null
|
|
4105
4891
|
}), {
|
|
4106
4892
|
status: 200,
|
|
4107
4893
|
headers: {
|
|
@@ -4130,7 +4916,7 @@ var messages2 = function(param) {
|
|
|
4130
4916
|
};
|
|
4131
4917
|
};
|
|
4132
4918
|
// src/adapters/storage/prismaStorageAdapter/threads/runs/get.ts
|
|
4133
|
-
var
|
|
4919
|
+
var import_radash11 = require("radash");
|
|
4134
4920
|
// src/adapters/storage/prismaStorageAdapter/threads/runs/serializeRun.ts
|
|
4135
4921
|
var import_dayjs5 = __toESM(require("dayjs"), 1);
|
|
4136
4922
|
var serializeRun = function(param) {
|
|
@@ -4205,7 +4991,7 @@ var get11 = function(param) {
|
|
|
4205
4991
|
case 0:
|
|
4206
4992
|
url = new URL(urlString);
|
|
4207
4993
|
_url_pathname_match = _sliced_to_array(url.pathname.match(new RegExp(runsRegexp)), 2), threadId = _url_pathname_match[1];
|
|
4208
|
-
_ref = (0,
|
|
4994
|
+
_ref = (0, import_radash11.assign)({
|
|
4209
4995
|
limit: "20",
|
|
4210
4996
|
order: "desc"
|
|
4211
4997
|
}, Object.fromEntries(url.searchParams)), limit = _ref.limit, order = _ref.order, after = _ref.after;
|
|
@@ -4257,7 +5043,7 @@ var get11 = function(param) {
|
|
|
4257
5043
|
};
|
|
4258
5044
|
// src/adapters/storage/prismaStorageAdapter/threads/runs/post.ts
|
|
4259
5045
|
var import_dayjs7 = __toESM(require("dayjs"), 1);
|
|
4260
|
-
var
|
|
5046
|
+
var import_radash12 = require("radash");
|
|
4261
5047
|
// src/adapters/storage/prismaStorageAdapter/threads/runs/onEvent/handlers/threadRunInProgress.ts
|
|
4262
5048
|
var threadRunInProgress = function(param) {
|
|
4263
5049
|
var prisma = param.prisma, event = param.event, controller = param.controller;
|
|
@@ -4399,6 +5185,40 @@ var threadRunStepDelta = function(param) {
|
|
|
4399
5185
|
var event = param.event, controller = param.controller;
|
|
4400
5186
|
return controller.enqueue(event);
|
|
4401
5187
|
};
|
|
5188
|
+
// src/adapters/storage/prismaStorageAdapter/threads/runs/onEvent/handlers/threadRunStepCompleted.ts
|
|
5189
|
+
var threadRunStepCompleted = /*#__PURE__*/ function() {
|
|
5190
|
+
var _ref = _async_to_generator(function(param) {
|
|
5191
|
+
var prisma, event, controller;
|
|
5192
|
+
return _ts_generator(this, function(_state) {
|
|
5193
|
+
switch(_state.label){
|
|
5194
|
+
case 0:
|
|
5195
|
+
prisma = param.prisma, event = param.event, controller = param.controller;
|
|
5196
|
+
controller.enqueue(event);
|
|
5197
|
+
return [
|
|
5198
|
+
4,
|
|
5199
|
+
prisma.runStep.update({
|
|
5200
|
+
where: {
|
|
5201
|
+
id: event.data.id
|
|
5202
|
+
},
|
|
5203
|
+
data: {
|
|
5204
|
+
status: "COMPLETED" /* COMPLETED */ ,
|
|
5205
|
+
stepDetails: event.data.step_details,
|
|
5206
|
+
completedAt: event.data.completed_at
|
|
5207
|
+
}
|
|
5208
|
+
})
|
|
5209
|
+
];
|
|
5210
|
+
case 1:
|
|
5211
|
+
_state.sent();
|
|
5212
|
+
return [
|
|
5213
|
+
2
|
|
5214
|
+
];
|
|
5215
|
+
}
|
|
5216
|
+
});
|
|
5217
|
+
});
|
|
5218
|
+
return function threadRunStepCompleted(_) {
|
|
5219
|
+
return _ref.apply(this, arguments);
|
|
5220
|
+
};
|
|
5221
|
+
}();
|
|
4402
5222
|
// src/adapters/storage/prismaStorageAdapter/threads/runs/onEvent/handlers/threadMessageCreated.ts
|
|
4403
5223
|
var status2 = function(event) {
|
|
4404
5224
|
if (event.data.status === "completed") return "COMPLETED" /* COMPLETED */ ;
|
|
@@ -4529,6 +5349,7 @@ var handlers = {
|
|
|
4529
5349
|
"thread.run.requires_action": threadRunRequiresAction,
|
|
4530
5350
|
"thread.run.step.created": threadRunStepCreated,
|
|
4531
5351
|
"thread.run.step.delta": threadRunStepDelta,
|
|
5352
|
+
"thread.run.step.completed": threadRunStepCompleted,
|
|
4532
5353
|
"thread.message.created": threadMessageCreated,
|
|
4533
5354
|
"thread.message.delta": threadMessageDelta,
|
|
4534
5355
|
"thread.message.completed": threadMessageCompleted
|
|
@@ -4650,7 +5471,7 @@ var post12 = function(param) {
|
|
|
4650
5471
|
if (!assistant) {
|
|
4651
5472
|
throw new Error("Assistant not found");
|
|
4652
5473
|
}
|
|
4653
|
-
_ref = (0,
|
|
5474
|
+
_ref = (0, import_radash12.assign)({
|
|
4654
5475
|
model: assistant.modelSlug,
|
|
4655
5476
|
instructions: "",
|
|
4656
5477
|
additional_instructions: null,
|
|
@@ -4872,7 +5693,7 @@ var run = function(param) {
|
|
|
4872
5693
|
};
|
|
4873
5694
|
};
|
|
4874
5695
|
// src/adapters/storage/prismaStorageAdapter/threads/runs/steps/get.ts
|
|
4875
|
-
var
|
|
5696
|
+
var import_radash13 = require("radash");
|
|
4876
5697
|
var get13 = function(param) {
|
|
4877
5698
|
var prisma = param.prisma;
|
|
4878
5699
|
return /*#__PURE__*/ function() {
|
|
@@ -4883,7 +5704,7 @@ var get13 = function(param) {
|
|
|
4883
5704
|
case 0:
|
|
4884
5705
|
url = new URL(urlString);
|
|
4885
5706
|
_url_pathname_match = _sliced_to_array(url.pathname.match(new RegExp(stepsRegexp)), 3), threadId = _url_pathname_match[1], runId = _url_pathname_match[2];
|
|
4886
|
-
_ref = (0,
|
|
5707
|
+
_ref = (0, import_radash13.assign)({
|
|
4887
5708
|
limit: "20",
|
|
4888
5709
|
order: "desc"
|
|
4889
5710
|
}, Object.fromEntries(url.searchParams)), limit = _ref.limit, order = _ref.order, after = _ref.after;
|
|
@@ -5466,9 +6287,9 @@ var threads2 = function(param) {
|
|
|
5466
6287
|
};
|
|
5467
6288
|
// src/adapters/storage/responsesStorageAdapter/threads/messages/post.ts
|
|
5468
6289
|
var import_dayjs10 = __toESM(require("dayjs"), 1);
|
|
5469
|
-
var
|
|
6290
|
+
var import_radash15 = require("radash");
|
|
5470
6291
|
// src/lib/items/serializeItemAsMessage.ts
|
|
5471
|
-
var
|
|
6292
|
+
var import_radash14 = require("radash");
|
|
5472
6293
|
var serializeContent2 = function(param) {
|
|
5473
6294
|
var item = param.item;
|
|
5474
6295
|
if (item.type === "message") {
|
|
@@ -5544,7 +6365,7 @@ var serializeMetadata = function(param) {
|
|
|
5544
6365
|
var serializeItemAsMessage = function(param) {
|
|
5545
6366
|
var item = param.item, threadId = param.threadId, openaiAssistant = param.openaiAssistant, createdAt = param.createdAt, _param_runId = param.runId, runId = _param_runId === void 0 ? null : _param_runId, tmp = param.status, status3 = tmp === void 0 ? "completed" : tmp;
|
|
5546
6367
|
return {
|
|
5547
|
-
id: item.id || (0,
|
|
6368
|
+
id: item.id || (0, import_radash14.uid)(24),
|
|
5548
6369
|
object: "thread.message",
|
|
5549
6370
|
created_at: createdAt,
|
|
5550
6371
|
thread_id: threadId,
|
|
@@ -5569,7 +6390,7 @@ var serializeItemAsMessage = function(param) {
|
|
|
5569
6390
|
// src/adapters/storage/responsesStorageAdapter/threads/messages/post.ts
|
|
5570
6391
|
var contentBlocksFromContent = function(param) {
|
|
5571
6392
|
var content = param.content;
|
|
5572
|
-
if ((0,
|
|
6393
|
+
if ((0, import_radash15.isArray)(content)) {
|
|
5573
6394
|
return content.map(function(item) {
|
|
5574
6395
|
if (item.type === "text") {
|
|
5575
6396
|
return {
|
|
@@ -5680,7 +6501,7 @@ var post16 = function(param) {
|
|
|
5680
6501
|
}();
|
|
5681
6502
|
};
|
|
5682
6503
|
// src/adapters/storage/responsesStorageAdapter/threads/messages/get.ts
|
|
5683
|
-
var
|
|
6504
|
+
var import_radash16 = require("radash");
|
|
5684
6505
|
// src/lib/items/responseId.ts
|
|
5685
6506
|
function responseId(param) {
|
|
5686
6507
|
var conversation = param.conversation, itemId = param.itemId;
|
|
@@ -5728,7 +6549,7 @@ var get14 = function(param) {
|
|
|
5728
6549
|
case 0:
|
|
5729
6550
|
url = new URL(urlString);
|
|
5730
6551
|
_url_pathname_match = _sliced_to_array(url.pathname.match(new RegExp(messagesRegexp)), 2), threadId = _url_pathname_match[1];
|
|
5731
|
-
_ref = (0,
|
|
6552
|
+
_ref = (0, import_radash16.assign)({
|
|
5732
6553
|
limit: "20",
|
|
5733
6554
|
order: "desc"
|
|
5734
6555
|
}, Object.fromEntries(url.searchParams)), limit = _ref.limit, order = _ref.order, after = _ref.after;
|
|
@@ -5972,9 +6793,9 @@ var get15 = function() {
|
|
|
5972
6793
|
}();
|
|
5973
6794
|
};
|
|
5974
6795
|
// src/adapters/storage/responsesStorageAdapter/threads/runs/post.ts
|
|
5975
|
-
var import_radash16 = require("radash");
|
|
5976
|
-
var import_dayjs11 = __toESM(require("dayjs"), 1);
|
|
5977
6796
|
var import_radash17 = require("radash");
|
|
6797
|
+
var import_dayjs11 = __toESM(require("dayjs"), 1);
|
|
6798
|
+
var import_radash18 = require("radash");
|
|
5978
6799
|
// src/lib/responses/serializeResponseAsRun.ts
|
|
5979
6800
|
var serializeStatus = function(param) {
|
|
5980
6801
|
var response = param.response;
|
|
@@ -6462,7 +7283,7 @@ var post17 = function(param) {
|
|
|
6462
7283
|
}
|
|
6463
7284
|
body = JSON.parse(options.body);
|
|
6464
7285
|
assistant_id = body.assistant_id, stream = body.stream;
|
|
6465
|
-
_ = (0,
|
|
7286
|
+
_ = (0, import_radash18.assign);
|
|
6466
7287
|
_tmp = [
|
|
6467
7288
|
{},
|
|
6468
7289
|
defaultAssistant
|
|
@@ -6545,7 +7366,7 @@ var post17 = function(param) {
|
|
|
6545
7366
|
event = {
|
|
6546
7367
|
event: "thread.run.failed",
|
|
6547
7368
|
data: {
|
|
6548
|
-
id: (0,
|
|
7369
|
+
id: (0, import_radash17.uid)(24),
|
|
6549
7370
|
failed_at: (0, import_dayjs11.default)().unix(),
|
|
6550
7371
|
last_error: {
|
|
6551
7372
|
code: "server_error",
|
|
@@ -6701,13 +7522,13 @@ var run2 = function(param) {
|
|
|
6701
7522
|
};
|
|
6702
7523
|
};
|
|
6703
7524
|
// src/adapters/storage/responsesStorageAdapter/threads/runs/steps/get.ts
|
|
6704
|
-
var
|
|
7525
|
+
var import_radash22 = require("radash");
|
|
6705
7526
|
// src/lib/items/serializeItemAsMessageCreationRunStep.ts
|
|
6706
7527
|
var import_dayjs12 = __toESM(require("dayjs"), 1);
|
|
6707
|
-
var
|
|
7528
|
+
var import_radash19 = require("radash");
|
|
6708
7529
|
function serializeItemAsMessageCreationRunStep(param) {
|
|
6709
|
-
var item = param.item, threadId = param.threadId, openaiAssistant = param.openaiAssistant, _param_runId = param.runId, runId = _param_runId === void 0 ? "run_".concat((0,
|
|
6710
|
-
var itemId = typeof item.id === "string" ? item.id : "item_".concat((0,
|
|
7530
|
+
var item = param.item, threadId = param.threadId, openaiAssistant = param.openaiAssistant, _param_runId = param.runId, runId = _param_runId === void 0 ? "run_".concat((0, import_radash19.uid)(24)) : _param_runId, tmp = param.status, status3 = tmp === void 0 ? "completed" : tmp, _param_completedAt = param.completedAt, completedAt = _param_completedAt === void 0 ? (0, import_dayjs12.default)().unix() : _param_completedAt;
|
|
7531
|
+
var itemId = typeof item.id === "string" ? item.id : "item_".concat((0, import_radash19.uid)(18));
|
|
6711
7532
|
var base = {
|
|
6712
7533
|
id: itemId,
|
|
6713
7534
|
object: "thread.run.step",
|
|
@@ -6770,7 +7591,7 @@ function serializeItemAsMessageCreationRunStep(param) {
|
|
|
6770
7591
|
}
|
|
6771
7592
|
// src/lib/items/serializeItemAsFunctionCallRunStep.ts
|
|
6772
7593
|
var import_dayjs13 = __toESM(require("dayjs"), 1);
|
|
6773
|
-
var
|
|
7594
|
+
var import_radash20 = require("radash");
|
|
6774
7595
|
var serializeFunctionCallOutput = function(param) {
|
|
6775
7596
|
var functionCallOutput = param.functionCallOutput;
|
|
6776
7597
|
if (!functionCallOutput) return null;
|
|
@@ -6780,8 +7601,8 @@ var serializeFunctionCallOutput = function(param) {
|
|
|
6780
7601
|
return JSON.stringify(functionCallOutput.output);
|
|
6781
7602
|
};
|
|
6782
7603
|
var serializeItemAsFunctionCallRunStep = function(param) {
|
|
6783
|
-
var item = param.item, items = param.items, threadId = param.threadId, openaiAssistant = param.openaiAssistant, _param_runId = param.runId, runId = _param_runId === void 0 ? "run_".concat((0,
|
|
6784
|
-
var itemId = typeof item.id === "string" ? item.id : "item_".concat((0,
|
|
7604
|
+
var item = param.item, items = param.items, threadId = param.threadId, openaiAssistant = param.openaiAssistant, _param_runId = param.runId, runId = _param_runId === void 0 ? "run_".concat((0, import_radash20.uid)(24)) : _param_runId, tmp = param.status, status3 = tmp === void 0 ? "completed" : tmp, _param_completedAt = param.completedAt, completedAt = _param_completedAt === void 0 ? (0, import_dayjs13.default)().unix() : _param_completedAt;
|
|
7605
|
+
var itemId = typeof item.id === "string" ? item.id : "item_".concat((0, import_radash20.uid)(18));
|
|
6785
7606
|
var base = {
|
|
6786
7607
|
id: itemId,
|
|
6787
7608
|
object: "thread.run.step",
|
|
@@ -7111,10 +7932,10 @@ var serializeItemAsCodeInterpreterCallRunStep = function(param) {
|
|
|
7111
7932
|
};
|
|
7112
7933
|
// src/lib/items/serializeItemAsComputerCallRunStep.ts
|
|
7113
7934
|
var import_dayjs19 = __toESM(require("dayjs"), 1);
|
|
7114
|
-
var
|
|
7935
|
+
var import_radash21 = require("radash");
|
|
7115
7936
|
var serializeItemAsComputerCallRunStep = function(param) {
|
|
7116
|
-
var item = param.item, items = param.items, threadId = param.threadId, openaiAssistant = param.openaiAssistant, _param_runId = param.runId, runId = _param_runId === void 0 ? "run_".concat((0,
|
|
7117
|
-
var itemId = typeof item.id === "string" ? item.id : "item_".concat((0,
|
|
7937
|
+
var item = param.item, items = param.items, threadId = param.threadId, openaiAssistant = param.openaiAssistant, _param_runId = param.runId, runId = _param_runId === void 0 ? "run_".concat((0, import_radash21.uid)(24)) : _param_runId, tmp = param.status, status3 = tmp === void 0 ? "completed" : tmp, _param_completedAt = param.completedAt, completedAt = _param_completedAt === void 0 ? (0, import_dayjs19.default)().unix() : _param_completedAt;
|
|
7938
|
+
var itemId = typeof item.id === "string" ? item.id : "item_".concat((0, import_radash21.uid)(18));
|
|
7118
7939
|
var base = {
|
|
7119
7940
|
id: itemId,
|
|
7120
7941
|
object: "thread.run.step",
|
|
@@ -7367,7 +8188,7 @@ var get17 = function(param) {
|
|
|
7367
8188
|
new Response(JSON.stringify({
|
|
7368
8189
|
data: data,
|
|
7369
8190
|
has_more: false,
|
|
7370
|
-
last_id: (_id = (_this = (0,
|
|
8191
|
+
last_id: (_id = (_this = (0, import_radash22.last)(response.output)) === null || _this === void 0 ? void 0 : _this.id) !== null && _id !== void 0 ? _id : null
|
|
7371
8192
|
}), {
|
|
7372
8193
|
status: 200,
|
|
7373
8194
|
headers: {
|
|
@@ -7734,7 +8555,7 @@ var responsesStorageAdapter = function() {
|
|
|
7734
8555
|
};
|
|
7735
8556
|
// src/adapters/run/responsesRunAdapter/index.ts
|
|
7736
8557
|
var import_dayjs21 = __toESM(require("dayjs"), 1);
|
|
7737
|
-
var
|
|
8558
|
+
var import_radash23 = require("radash");
|
|
7738
8559
|
var serializeToolCalls2 = function(param) {
|
|
7739
8560
|
var toolCalls = param.toolCalls;
|
|
7740
8561
|
return toolCalls.map(function(toolCall) {
|
|
@@ -7819,12 +8640,13 @@ var responsesRunAdapter = function(param) {
|
|
|
7819
8640
|
}();
|
|
7820
8641
|
var handleRun = /*#__PURE__*/ function() {
|
|
7821
8642
|
var _ref = _async_to_generator(function(param) {
|
|
7822
|
-
var client, threadId, response, onEvent2, responseCreatedResponse, toolCalls, mcpCalls, codeInterpreterCalls, itemIds, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, event, _, _tmp, _tmp1, _tmp2, _tmp3,
|
|
8643
|
+
var client, threadId, response, onEvent2, responseCreatedResponse, responseCompletedResponse, toolCalls, mcpCalls, codeInterpreterCalls, itemIds, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, event, _, _tmp, _tmp1, _tmp2, _tmp3, _tmp4, _tmp5, _tmp6, _tmp7, _tmp8, _tmp9, _tmp10, _tmp11, _tmp12, _tmp13, _tmp14, _tmp15, _tmp16, _tmp17, _tmp18, _tmp19, _tmp20, _tmp21, _tmp22, _tmp23, _tmp24, _tmp25, _tmp26, _tmp27, _tmp28, _tmp29, _tmp30, _tmp31, _tmp32, _tmp33, _tmp34, _tmp35, _tmp36, _tmp37, _tmp38, _tmp39, _tmp40, _tmp41, _tmp42, _tmp43, _tmp44, _tmp45, _tmp46, _tmp47, _tmp48, _tmp49, _tmp50, _tmp51, _tmp52, _tmp53, _tmp54, _tmp55, _tmp56, _tmp57, _tmp58, _tmp59, _tmp60, _tmp61, _tmp62, _tmp63, _tmp64, _tmp65, _tmp66, _tmp67, _tmp68, _tmp69, _tmp70, _tmp71, _tmp72, _tmp73, _tmp74, _tmp75, _tmp76, _tmp77, _tmp78, _tmp79, _tmp80, _tmp81, _tmp82, _tmp83, _tmp84, _tmp85, _tmp86, _tmp87, _tmp88, _tmp89, _tmp90, _tmp91, _tmp92, _tmp93, _tmp94, _tmp95, toolCall, mcpCall, _tmp96, _tmp97, _tmp98, _tmp99, err, _responseCompletedResponse_output, toolCalls2, serializedRun, _tmp100, e, _tmp101, _tmp102;
|
|
7823
8644
|
return _ts_generator(this, function(_state) {
|
|
7824
8645
|
switch(_state.label){
|
|
7825
8646
|
case 0:
|
|
7826
8647
|
client = param.client, threadId = param.threadId, response = param.response, onEvent2 = param.onEvent;
|
|
7827
8648
|
responseCreatedResponse = null;
|
|
8649
|
+
responseCompletedResponse = null;
|
|
7828
8650
|
toolCalls = {};
|
|
7829
8651
|
mcpCalls = {};
|
|
7830
8652
|
codeInterpreterCalls = {};
|
|
@@ -7833,18 +8655,18 @@ var responsesRunAdapter = function(param) {
|
|
|
7833
8655
|
case 1:
|
|
7834
8656
|
_state.trys.push([
|
|
7835
8657
|
1,
|
|
7836
|
-
|
|
7837
|
-
|
|
7838
|
-
|
|
8658
|
+
151,
|
|
8659
|
+
154,
|
|
8660
|
+
155
|
|
7839
8661
|
]);
|
|
7840
8662
|
_iteratorAbruptCompletion = false, _didIteratorError = false;
|
|
7841
8663
|
_state.label = 2;
|
|
7842
8664
|
case 2:
|
|
7843
8665
|
_state.trys.push([
|
|
7844
8666
|
2,
|
|
7845
|
-
|
|
7846
|
-
|
|
7847
|
-
|
|
8667
|
+
139,
|
|
8668
|
+
140,
|
|
8669
|
+
145
|
|
7848
8670
|
]);
|
|
7849
8671
|
_iterator = _async_iterator(response);
|
|
7850
8672
|
_state.label = 3;
|
|
@@ -7856,7 +8678,7 @@ var responsesRunAdapter = function(param) {
|
|
|
7856
8678
|
case 4:
|
|
7857
8679
|
if (!(_iteratorAbruptCompletion = !(_step = _state.sent()).done)) return [
|
|
7858
8680
|
3,
|
|
7859
|
-
|
|
8681
|
+
138
|
|
7860
8682
|
];
|
|
7861
8683
|
_value = _step.value;
|
|
7862
8684
|
event = _value;
|
|
@@ -7880,52 +8702,52 @@ var responsesRunAdapter = function(param) {
|
|
|
7880
8702
|
case "response.failed":
|
|
7881
8703
|
return [
|
|
7882
8704
|
3,
|
|
7883
|
-
|
|
8705
|
+
12
|
|
7884
8706
|
];
|
|
7885
8707
|
case "response.output_text.delta":
|
|
7886
8708
|
return [
|
|
7887
8709
|
3,
|
|
7888
|
-
|
|
8710
|
+
15
|
|
7889
8711
|
];
|
|
7890
8712
|
case "response.output_item.added":
|
|
7891
8713
|
return [
|
|
7892
8714
|
3,
|
|
7893
|
-
|
|
8715
|
+
17
|
|
7894
8716
|
];
|
|
7895
8717
|
case "response.output_item.done":
|
|
7896
8718
|
return [
|
|
7897
8719
|
3,
|
|
7898
|
-
|
|
8720
|
+
75
|
|
7899
8721
|
];
|
|
7900
8722
|
case "response.function_call_arguments.delta":
|
|
7901
8723
|
return [
|
|
7902
8724
|
3,
|
|
7903
|
-
|
|
8725
|
+
126
|
|
7904
8726
|
];
|
|
7905
8727
|
case "response.mcp_call_arguments.delta":
|
|
7906
8728
|
return [
|
|
7907
8729
|
3,
|
|
7908
|
-
|
|
8730
|
+
128
|
|
7909
8731
|
];
|
|
7910
8732
|
case "response.image_generation_call.in_progress":
|
|
7911
8733
|
return [
|
|
7912
8734
|
3,
|
|
7913
|
-
|
|
8735
|
+
130
|
|
7914
8736
|
];
|
|
7915
8737
|
case "response.image_generation_call.generating":
|
|
7916
8738
|
return [
|
|
7917
8739
|
3,
|
|
7918
|
-
|
|
8740
|
+
130
|
|
7919
8741
|
];
|
|
7920
8742
|
case "response.image_generation_call.partial_image":
|
|
7921
8743
|
return [
|
|
7922
8744
|
3,
|
|
7923
|
-
|
|
8745
|
+
133
|
|
7924
8746
|
];
|
|
7925
8747
|
}
|
|
7926
8748
|
return [
|
|
7927
8749
|
3,
|
|
7928
|
-
|
|
8750
|
+
136
|
|
7929
8751
|
];
|
|
7930
8752
|
case 5:
|
|
7931
8753
|
responseCreatedResponse = event.response;
|
|
@@ -7956,7 +8778,7 @@ var responsesRunAdapter = function(param) {
|
|
|
7956
8778
|
_state.sent();
|
|
7957
8779
|
return [
|
|
7958
8780
|
3,
|
|
7959
|
-
|
|
8781
|
+
137
|
|
7960
8782
|
];
|
|
7961
8783
|
case 8:
|
|
7962
8784
|
_tmp2 = {
|
|
@@ -7986,103 +8808,27 @@ var responsesRunAdapter = function(param) {
|
|
|
7986
8808
|
_state.sent();
|
|
7987
8809
|
return [
|
|
7988
8810
|
3,
|
|
7989
|
-
|
|
8811
|
+
137
|
|
7990
8812
|
];
|
|
7991
8813
|
case 11:
|
|
7992
|
-
|
|
7993
|
-
|
|
7994
|
-
|
|
7995
|
-
|
|
7996
|
-
|
|
7997
|
-
|
|
7998
|
-
|
|
7999
|
-
|
|
8000
|
-
|
|
8001
|
-
|
|
8002
|
-
|
|
8003
|
-
|
|
8004
|
-
|
|
8005
|
-
event: "thread.run.requires_action"
|
|
8006
|
-
};
|
|
8007
|
-
_tmp5 = [
|
|
8008
|
-
{}
|
|
8009
|
-
];
|
|
8010
|
-
_tmp6 = {
|
|
8011
|
-
response: event.response
|
|
8012
|
-
};
|
|
8013
|
-
return [
|
|
8014
|
-
4,
|
|
8015
|
-
getOpenaiAssistant({
|
|
8016
|
-
select: {
|
|
8017
|
-
id: true
|
|
8018
|
-
}
|
|
8019
|
-
})
|
|
8020
|
-
];
|
|
8814
|
+
{
|
|
8815
|
+
responseCompletedResponse = event.response;
|
|
8816
|
+
itemIds = event.response.output.filter(function(o) {
|
|
8817
|
+
return o.id;
|
|
8818
|
+
}).map(function(o) {
|
|
8819
|
+
return o.id;
|
|
8820
|
+
});
|
|
8821
|
+
return [
|
|
8822
|
+
3,
|
|
8823
|
+
137
|
|
8824
|
+
];
|
|
8825
|
+
}
|
|
8826
|
+
_state.label = 12;
|
|
8021
8827
|
case 12:
|
|
8022
|
-
|
|
8023
|
-
4,
|
|
8024
|
-
onEvent2.apply(void 0, [
|
|
8025
|
-
(_tmp4.data = _object_spread.apply(void 0, _tmp5.concat([
|
|
8026
|
-
serializeResponseAsRun.apply(void 0, [
|
|
8027
|
-
(_tmp6.assistantId = _state.sent().id, _tmp6)
|
|
8028
|
-
]),
|
|
8029
|
-
{
|
|
8030
|
-
status: "requires_action",
|
|
8031
|
-
required_action: {
|
|
8032
|
-
type: "submit_tool_outputs",
|
|
8033
|
-
submit_tool_outputs: {
|
|
8034
|
-
tool_calls: _to_consumable_array(serializeToolCalls2({
|
|
8035
|
-
toolCalls: toolCalls2
|
|
8036
|
-
}))
|
|
8037
|
-
}
|
|
8038
|
-
}
|
|
8039
|
-
}
|
|
8040
|
-
])), _tmp4)
|
|
8041
|
-
])
|
|
8042
|
-
];
|
|
8043
|
-
case 13:
|
|
8044
|
-
_state.sent();
|
|
8045
|
-
return [
|
|
8046
|
-
3,
|
|
8047
|
-
17
|
|
8048
|
-
];
|
|
8049
|
-
case 14:
|
|
8050
|
-
_tmp7 = {
|
|
8051
|
-
event: "thread.run.completed"
|
|
8052
|
-
};
|
|
8053
|
-
_tmp8 = {
|
|
8054
|
-
response: event.response
|
|
8055
|
-
};
|
|
8056
|
-
return [
|
|
8057
|
-
4,
|
|
8058
|
-
getOpenaiAssistant({
|
|
8059
|
-
select: {
|
|
8060
|
-
id: true
|
|
8061
|
-
}
|
|
8062
|
-
})
|
|
8063
|
-
];
|
|
8064
|
-
case 15:
|
|
8065
|
-
return [
|
|
8066
|
-
4,
|
|
8067
|
-
onEvent2.apply(void 0, [
|
|
8068
|
-
(_tmp7.data = serializeResponseAsRun.apply(void 0, [
|
|
8069
|
-
(_tmp8.assistantId = _state.sent().id, _tmp8)
|
|
8070
|
-
]), _tmp7)
|
|
8071
|
-
])
|
|
8072
|
-
];
|
|
8073
|
-
case 16:
|
|
8074
|
-
_state.sent();
|
|
8075
|
-
_state.label = 17;
|
|
8076
|
-
case 17:
|
|
8077
|
-
return [
|
|
8078
|
-
3,
|
|
8079
|
-
143
|
|
8080
|
-
];
|
|
8081
|
-
case 18:
|
|
8082
|
-
_tmp9 = {
|
|
8828
|
+
_tmp4 = {
|
|
8083
8829
|
event: "thread.run.failed"
|
|
8084
8830
|
};
|
|
8085
|
-
|
|
8831
|
+
_tmp5 = {
|
|
8086
8832
|
response: event.response
|
|
8087
8833
|
};
|
|
8088
8834
|
return [
|
|
@@ -8093,22 +8839,22 @@ var responsesRunAdapter = function(param) {
|
|
|
8093
8839
|
}
|
|
8094
8840
|
})
|
|
8095
8841
|
];
|
|
8096
|
-
case
|
|
8842
|
+
case 13:
|
|
8097
8843
|
return [
|
|
8098
8844
|
4,
|
|
8099
8845
|
onEvent2.apply(void 0, [
|
|
8100
|
-
(
|
|
8101
|
-
(
|
|
8102
|
-
]),
|
|
8846
|
+
(_tmp4.data = serializeResponseAsRun.apply(void 0, [
|
|
8847
|
+
(_tmp5.assistantId = _state.sent().id, _tmp5)
|
|
8848
|
+
]), _tmp4)
|
|
8103
8849
|
])
|
|
8104
8850
|
];
|
|
8105
|
-
case
|
|
8851
|
+
case 14:
|
|
8106
8852
|
_state.sent();
|
|
8107
8853
|
return [
|
|
8108
8854
|
3,
|
|
8109
|
-
|
|
8855
|
+
137
|
|
8110
8856
|
];
|
|
8111
|
-
case
|
|
8857
|
+
case 15:
|
|
8112
8858
|
return [
|
|
8113
8859
|
4,
|
|
8114
8860
|
onEvent2({
|
|
@@ -8129,21 +8875,21 @@ var responsesRunAdapter = function(param) {
|
|
|
8129
8875
|
}
|
|
8130
8876
|
})
|
|
8131
8877
|
];
|
|
8132
|
-
case
|
|
8878
|
+
case 16:
|
|
8133
8879
|
_state.sent();
|
|
8134
8880
|
return [
|
|
8135
8881
|
3,
|
|
8136
|
-
|
|
8882
|
+
137
|
|
8137
8883
|
];
|
|
8138
|
-
case
|
|
8884
|
+
case 17:
|
|
8139
8885
|
if (!(event.item.type === "message")) return [
|
|
8140
8886
|
3,
|
|
8141
|
-
|
|
8887
|
+
22
|
|
8142
8888
|
];
|
|
8143
|
-
|
|
8889
|
+
_tmp6 = {
|
|
8144
8890
|
event: "thread.message.created"
|
|
8145
8891
|
};
|
|
8146
|
-
|
|
8892
|
+
_tmp7 = {
|
|
8147
8893
|
item: event.item,
|
|
8148
8894
|
threadId: threadId
|
|
8149
8895
|
};
|
|
@@ -8155,21 +8901,21 @@ var responsesRunAdapter = function(param) {
|
|
|
8155
8901
|
}
|
|
8156
8902
|
})
|
|
8157
8903
|
];
|
|
8158
|
-
case
|
|
8904
|
+
case 18:
|
|
8159
8905
|
return [
|
|
8160
8906
|
4,
|
|
8161
8907
|
onEvent2.apply(void 0, [
|
|
8162
|
-
(
|
|
8163
|
-
(
|
|
8164
|
-
]),
|
|
8908
|
+
(_tmp6.data = serializeItemAsMessage.apply(void 0, [
|
|
8909
|
+
(_tmp7.openaiAssistant = _state.sent(), _tmp7.createdAt = (0, import_dayjs21.default)().unix(), _tmp7.runId = responseCreatedResponse.id, _tmp7.status = "in_progress", _tmp7)
|
|
8910
|
+
]), _tmp6)
|
|
8165
8911
|
])
|
|
8166
8912
|
];
|
|
8167
|
-
case
|
|
8913
|
+
case 19:
|
|
8168
8914
|
_state.sent();
|
|
8169
|
-
|
|
8915
|
+
_tmp8 = {
|
|
8170
8916
|
event: "thread.run.step.created"
|
|
8171
8917
|
};
|
|
8172
|
-
|
|
8918
|
+
_tmp9 = {
|
|
8173
8919
|
item: event.item,
|
|
8174
8920
|
threadId: threadId
|
|
8175
8921
|
};
|
|
@@ -8181,31 +8927,31 @@ var responsesRunAdapter = function(param) {
|
|
|
8181
8927
|
}
|
|
8182
8928
|
})
|
|
8183
8929
|
];
|
|
8184
|
-
case
|
|
8930
|
+
case 20:
|
|
8185
8931
|
return [
|
|
8186
8932
|
4,
|
|
8187
8933
|
onEvent2.apply(void 0, [
|
|
8188
|
-
(
|
|
8189
|
-
(
|
|
8190
|
-
]),
|
|
8934
|
+
(_tmp8.data = serializeItemAsMessageCreationRunStep.apply(void 0, [
|
|
8935
|
+
(_tmp9.openaiAssistant = _state.sent(), _tmp9.runId = responseCreatedResponse.id, _tmp9.status = "in_progress", _tmp9.completedAt = null, _tmp9)
|
|
8936
|
+
]), _tmp8)
|
|
8191
8937
|
])
|
|
8192
8938
|
];
|
|
8193
|
-
case
|
|
8939
|
+
case 21:
|
|
8194
8940
|
_state.sent();
|
|
8195
8941
|
return [
|
|
8196
8942
|
3,
|
|
8197
|
-
|
|
8943
|
+
74
|
|
8198
8944
|
];
|
|
8199
|
-
case
|
|
8945
|
+
case 22:
|
|
8200
8946
|
if (!(event.item.type === "function_call")) return [
|
|
8201
8947
|
3,
|
|
8202
|
-
|
|
8948
|
+
25
|
|
8203
8949
|
];
|
|
8204
8950
|
toolCalls[event.item.id] = event.item;
|
|
8205
|
-
|
|
8951
|
+
_tmp10 = {
|
|
8206
8952
|
event: "thread.run.step.created"
|
|
8207
8953
|
};
|
|
8208
|
-
|
|
8954
|
+
_tmp11 = {
|
|
8209
8955
|
item: event.item,
|
|
8210
8956
|
threadId: threadId
|
|
8211
8957
|
};
|
|
@@ -8217,30 +8963,30 @@ var responsesRunAdapter = function(param) {
|
|
|
8217
8963
|
}
|
|
8218
8964
|
})
|
|
8219
8965
|
];
|
|
8220
|
-
case
|
|
8966
|
+
case 23:
|
|
8221
8967
|
return [
|
|
8222
8968
|
4,
|
|
8223
8969
|
onEvent2.apply(void 0, [
|
|
8224
|
-
(
|
|
8225
|
-
(
|
|
8226
|
-
]),
|
|
8970
|
+
(_tmp10.data = serializeItemAsMessageCreationRunStep.apply(void 0, [
|
|
8971
|
+
(_tmp11.openaiAssistant = _state.sent(), _tmp11.runId = responseCreatedResponse.id, _tmp11)
|
|
8972
|
+
]), _tmp10)
|
|
8227
8973
|
])
|
|
8228
8974
|
];
|
|
8229
|
-
case
|
|
8975
|
+
case 24:
|
|
8230
8976
|
_state.sent();
|
|
8231
8977
|
return [
|
|
8232
8978
|
3,
|
|
8233
|
-
|
|
8979
|
+
74
|
|
8234
8980
|
];
|
|
8235
|
-
case
|
|
8981
|
+
case 25:
|
|
8236
8982
|
if (!(event.item.type === "computer_call")) return [
|
|
8237
8983
|
3,
|
|
8238
|
-
|
|
8984
|
+
32
|
|
8239
8985
|
];
|
|
8240
|
-
|
|
8986
|
+
_tmp12 = {
|
|
8241
8987
|
event: "thread.message.created"
|
|
8242
8988
|
};
|
|
8243
|
-
|
|
8989
|
+
_tmp13 = {
|
|
8244
8990
|
item: event.item,
|
|
8245
8991
|
threadId: threadId
|
|
8246
8992
|
};
|
|
@@ -8252,21 +8998,21 @@ var responsesRunAdapter = function(param) {
|
|
|
8252
8998
|
}
|
|
8253
8999
|
})
|
|
8254
9000
|
];
|
|
8255
|
-
case
|
|
9001
|
+
case 26:
|
|
8256
9002
|
return [
|
|
8257
9003
|
4,
|
|
8258
9004
|
onEvent2.apply(void 0, [
|
|
8259
|
-
(
|
|
8260
|
-
(
|
|
8261
|
-
]),
|
|
9005
|
+
(_tmp12.data = serializeItemAsMessage.apply(void 0, [
|
|
9006
|
+
(_tmp13.openaiAssistant = _state.sent(), _tmp13.createdAt = (0, import_dayjs21.default)().unix(), _tmp13.runId = responseCreatedResponse.id, _tmp13.status = "in_progress", _tmp13)
|
|
9007
|
+
]), _tmp12)
|
|
8262
9008
|
])
|
|
8263
9009
|
];
|
|
8264
|
-
case
|
|
9010
|
+
case 27:
|
|
8265
9011
|
_state.sent();
|
|
8266
|
-
|
|
9012
|
+
_tmp14 = {
|
|
8267
9013
|
event: "thread.run.step.created"
|
|
8268
9014
|
};
|
|
8269
|
-
|
|
9015
|
+
_tmp15 = {
|
|
8270
9016
|
item: event.item,
|
|
8271
9017
|
threadId: threadId
|
|
8272
9018
|
};
|
|
@@ -8278,21 +9024,21 @@ var responsesRunAdapter = function(param) {
|
|
|
8278
9024
|
}
|
|
8279
9025
|
})
|
|
8280
9026
|
];
|
|
8281
|
-
case
|
|
9027
|
+
case 28:
|
|
8282
9028
|
return [
|
|
8283
9029
|
4,
|
|
8284
9030
|
onEvent2.apply(void 0, [
|
|
8285
|
-
(
|
|
8286
|
-
(
|
|
8287
|
-
]),
|
|
9031
|
+
(_tmp14.data = serializeItemAsMessageCreationRunStep.apply(void 0, [
|
|
9032
|
+
(_tmp15.openaiAssistant = _state.sent(), _tmp15.runId = responseCreatedResponse.id, _tmp15)
|
|
9033
|
+
]), _tmp14)
|
|
8288
9034
|
])
|
|
8289
9035
|
];
|
|
8290
|
-
case
|
|
9036
|
+
case 29:
|
|
8291
9037
|
_state.sent();
|
|
8292
|
-
|
|
9038
|
+
_tmp16 = {
|
|
8293
9039
|
event: "thread.run.step.created"
|
|
8294
9040
|
};
|
|
8295
|
-
|
|
9041
|
+
_tmp17 = {
|
|
8296
9042
|
item: event.item,
|
|
8297
9043
|
items: []
|
|
8298
9044
|
};
|
|
@@ -8304,30 +9050,30 @@ var responsesRunAdapter = function(param) {
|
|
|
8304
9050
|
}
|
|
8305
9051
|
})
|
|
8306
9052
|
];
|
|
8307
|
-
case
|
|
9053
|
+
case 30:
|
|
8308
9054
|
return [
|
|
8309
9055
|
4,
|
|
8310
9056
|
onEvent2.apply(void 0, [
|
|
8311
|
-
(
|
|
8312
|
-
(
|
|
8313
|
-
]),
|
|
9057
|
+
(_tmp16.data = serializeItemAsComputerCallRunStep.apply(void 0, [
|
|
9058
|
+
(_tmp17.openaiAssistant = _state.sent(), _tmp17.threadId = threadId, _tmp17.runId = responseCreatedResponse.id, _tmp17.completedAt = null, _tmp17)
|
|
9059
|
+
]), _tmp16)
|
|
8314
9060
|
])
|
|
8315
9061
|
];
|
|
8316
|
-
case
|
|
9062
|
+
case 31:
|
|
8317
9063
|
_state.sent();
|
|
8318
9064
|
return [
|
|
8319
9065
|
3,
|
|
8320
|
-
|
|
9066
|
+
74
|
|
8321
9067
|
];
|
|
8322
|
-
case
|
|
9068
|
+
case 32:
|
|
8323
9069
|
if (!(event.item.type === "image_generation_call")) return [
|
|
8324
9070
|
3,
|
|
8325
|
-
|
|
9071
|
+
39
|
|
8326
9072
|
];
|
|
8327
|
-
|
|
9073
|
+
_tmp18 = {
|
|
8328
9074
|
event: "thread.message.created"
|
|
8329
9075
|
};
|
|
8330
|
-
|
|
9076
|
+
_tmp19 = {
|
|
8331
9077
|
item: event.item,
|
|
8332
9078
|
threadId: threadId
|
|
8333
9079
|
};
|
|
@@ -8339,21 +9085,21 @@ var responsesRunAdapter = function(param) {
|
|
|
8339
9085
|
}
|
|
8340
9086
|
})
|
|
8341
9087
|
];
|
|
8342
|
-
case
|
|
9088
|
+
case 33:
|
|
8343
9089
|
return [
|
|
8344
9090
|
4,
|
|
8345
9091
|
onEvent2.apply(void 0, [
|
|
8346
|
-
(
|
|
8347
|
-
(
|
|
8348
|
-
]),
|
|
9092
|
+
(_tmp18.data = serializeItemAsMessage.apply(void 0, [
|
|
9093
|
+
(_tmp19.openaiAssistant = _state.sent(), _tmp19.createdAt = (0, import_dayjs21.default)().unix(), _tmp19.runId = responseCreatedResponse.id, _tmp19.status = "in_progress", _tmp19)
|
|
9094
|
+
]), _tmp18)
|
|
8349
9095
|
])
|
|
8350
9096
|
];
|
|
8351
|
-
case
|
|
9097
|
+
case 34:
|
|
8352
9098
|
_state.sent();
|
|
8353
|
-
|
|
9099
|
+
_tmp20 = {
|
|
8354
9100
|
event: "thread.run.step.created"
|
|
8355
9101
|
};
|
|
8356
|
-
|
|
9102
|
+
_tmp21 = {
|
|
8357
9103
|
item: event.item,
|
|
8358
9104
|
threadId: threadId
|
|
8359
9105
|
};
|
|
@@ -8365,21 +9111,21 @@ var responsesRunAdapter = function(param) {
|
|
|
8365
9111
|
}
|
|
8366
9112
|
})
|
|
8367
9113
|
];
|
|
8368
|
-
case
|
|
9114
|
+
case 35:
|
|
8369
9115
|
return [
|
|
8370
9116
|
4,
|
|
8371
9117
|
onEvent2.apply(void 0, [
|
|
8372
|
-
(
|
|
8373
|
-
(
|
|
8374
|
-
]),
|
|
9118
|
+
(_tmp20.data = serializeItemAsMessageCreationRunStep.apply(void 0, [
|
|
9119
|
+
(_tmp21.openaiAssistant = _state.sent(), _tmp21.runId = responseCreatedResponse.id, _tmp21.status = "in_progress", _tmp21.completedAt = null, _tmp21)
|
|
9120
|
+
]), _tmp20)
|
|
8375
9121
|
])
|
|
8376
9122
|
];
|
|
8377
|
-
case
|
|
9123
|
+
case 36:
|
|
8378
9124
|
_state.sent();
|
|
8379
|
-
|
|
9125
|
+
_tmp22 = {
|
|
8380
9126
|
event: "thread.run.step.created"
|
|
8381
9127
|
};
|
|
8382
|
-
|
|
9128
|
+
_tmp23 = {
|
|
8383
9129
|
item: event.item
|
|
8384
9130
|
};
|
|
8385
9131
|
return [
|
|
@@ -8390,30 +9136,30 @@ var responsesRunAdapter = function(param) {
|
|
|
8390
9136
|
}
|
|
8391
9137
|
})
|
|
8392
9138
|
];
|
|
8393
|
-
case
|
|
9139
|
+
case 37:
|
|
8394
9140
|
return [
|
|
8395
9141
|
4,
|
|
8396
9142
|
onEvent2.apply(void 0, [
|
|
8397
|
-
(
|
|
8398
|
-
(
|
|
8399
|
-
]),
|
|
9143
|
+
(_tmp22.data = serializeItemAsImageGenerationRunStep.apply(void 0, [
|
|
9144
|
+
(_tmp23.openaiAssistant = _state.sent(), _tmp23.threadId = threadId, _tmp23.runId = responseCreatedResponse.id, _tmp23.status = "in_progress", _tmp23.completedAt = null, _tmp23)
|
|
9145
|
+
]), _tmp22)
|
|
8400
9146
|
])
|
|
8401
9147
|
];
|
|
8402
|
-
case
|
|
9148
|
+
case 38:
|
|
8403
9149
|
_state.sent();
|
|
8404
9150
|
return [
|
|
8405
9151
|
3,
|
|
8406
|
-
|
|
9152
|
+
74
|
|
8407
9153
|
];
|
|
8408
|
-
case
|
|
9154
|
+
case 39:
|
|
8409
9155
|
if (!(event.item.type === "reasoning")) return [
|
|
8410
9156
|
3,
|
|
8411
|
-
|
|
9157
|
+
46
|
|
8412
9158
|
];
|
|
8413
|
-
|
|
9159
|
+
_tmp24 = {
|
|
8414
9160
|
event: "thread.message.created"
|
|
8415
9161
|
};
|
|
8416
|
-
|
|
9162
|
+
_tmp25 = {
|
|
8417
9163
|
item: event.item,
|
|
8418
9164
|
threadId: threadId
|
|
8419
9165
|
};
|
|
@@ -8425,21 +9171,21 @@ var responsesRunAdapter = function(param) {
|
|
|
8425
9171
|
}
|
|
8426
9172
|
})
|
|
8427
9173
|
];
|
|
8428
|
-
case
|
|
9174
|
+
case 40:
|
|
8429
9175
|
return [
|
|
8430
9176
|
4,
|
|
8431
9177
|
onEvent2.apply(void 0, [
|
|
8432
|
-
(
|
|
8433
|
-
(
|
|
8434
|
-
]),
|
|
9178
|
+
(_tmp24.data = serializeItemAsMessage.apply(void 0, [
|
|
9179
|
+
(_tmp25.openaiAssistant = _state.sent(), _tmp25.createdAt = (0, import_dayjs21.default)().unix(), _tmp25.runId = responseCreatedResponse.id, _tmp25.status = "in_progress", _tmp25)
|
|
9180
|
+
]), _tmp24)
|
|
8435
9181
|
])
|
|
8436
9182
|
];
|
|
8437
|
-
case
|
|
9183
|
+
case 41:
|
|
8438
9184
|
_state.sent();
|
|
8439
|
-
|
|
9185
|
+
_tmp26 = {
|
|
8440
9186
|
event: "thread.run.step.created"
|
|
8441
9187
|
};
|
|
8442
|
-
|
|
9188
|
+
_tmp27 = {
|
|
8443
9189
|
item: event.item,
|
|
8444
9190
|
threadId: threadId
|
|
8445
9191
|
};
|
|
@@ -8451,21 +9197,21 @@ var responsesRunAdapter = function(param) {
|
|
|
8451
9197
|
}
|
|
8452
9198
|
})
|
|
8453
9199
|
];
|
|
8454
|
-
case
|
|
9200
|
+
case 42:
|
|
8455
9201
|
return [
|
|
8456
9202
|
4,
|
|
8457
9203
|
onEvent2.apply(void 0, [
|
|
8458
|
-
(
|
|
8459
|
-
(
|
|
8460
|
-
]),
|
|
9204
|
+
(_tmp26.data = serializeItemAsMessageCreationRunStep.apply(void 0, [
|
|
9205
|
+
(_tmp27.openaiAssistant = _state.sent(), _tmp27.runId = responseCreatedResponse.id, _tmp27.status = "in_progress", _tmp27.completedAt = null, _tmp27)
|
|
9206
|
+
]), _tmp26)
|
|
8461
9207
|
])
|
|
8462
9208
|
];
|
|
8463
|
-
case
|
|
9209
|
+
case 43:
|
|
8464
9210
|
_state.sent();
|
|
8465
|
-
|
|
9211
|
+
_tmp28 = {
|
|
8466
9212
|
event: "thread.run.step.created"
|
|
8467
9213
|
};
|
|
8468
|
-
|
|
9214
|
+
_tmp29 = {
|
|
8469
9215
|
item: event.item
|
|
8470
9216
|
};
|
|
8471
9217
|
return [
|
|
@@ -8476,30 +9222,30 @@ var responsesRunAdapter = function(param) {
|
|
|
8476
9222
|
}
|
|
8477
9223
|
})
|
|
8478
9224
|
];
|
|
8479
|
-
case
|
|
9225
|
+
case 44:
|
|
8480
9226
|
return [
|
|
8481
9227
|
4,
|
|
8482
9228
|
onEvent2.apply(void 0, [
|
|
8483
|
-
(
|
|
8484
|
-
(
|
|
8485
|
-
]),
|
|
9229
|
+
(_tmp28.data = serializeItemAsReasoningRunStep.apply(void 0, [
|
|
9230
|
+
(_tmp29.openaiAssistant = _state.sent(), _tmp29.threadId = threadId, _tmp29.runId = responseCreatedResponse.id, _tmp29.completedAt = null, _tmp29)
|
|
9231
|
+
]), _tmp28)
|
|
8486
9232
|
])
|
|
8487
9233
|
];
|
|
8488
|
-
case
|
|
9234
|
+
case 45:
|
|
8489
9235
|
_state.sent();
|
|
8490
9236
|
return [
|
|
8491
9237
|
3,
|
|
8492
|
-
|
|
9238
|
+
74
|
|
8493
9239
|
];
|
|
8494
|
-
case
|
|
9240
|
+
case 46:
|
|
8495
9241
|
if (!(event.item.type === "web_search_call")) return [
|
|
8496
9242
|
3,
|
|
8497
|
-
|
|
9243
|
+
53
|
|
8498
9244
|
];
|
|
8499
|
-
|
|
9245
|
+
_tmp30 = {
|
|
8500
9246
|
event: "thread.message.created"
|
|
8501
9247
|
};
|
|
8502
|
-
|
|
9248
|
+
_tmp31 = {
|
|
8503
9249
|
item: event.item,
|
|
8504
9250
|
threadId: threadId
|
|
8505
9251
|
};
|
|
@@ -8511,21 +9257,21 @@ var responsesRunAdapter = function(param) {
|
|
|
8511
9257
|
}
|
|
8512
9258
|
})
|
|
8513
9259
|
];
|
|
8514
|
-
case
|
|
9260
|
+
case 47:
|
|
8515
9261
|
return [
|
|
8516
9262
|
4,
|
|
8517
9263
|
onEvent2.apply(void 0, [
|
|
8518
|
-
(
|
|
8519
|
-
(
|
|
8520
|
-
]),
|
|
9264
|
+
(_tmp30.data = serializeItemAsMessage.apply(void 0, [
|
|
9265
|
+
(_tmp31.openaiAssistant = _state.sent(), _tmp31.createdAt = (0, import_dayjs21.default)().unix(), _tmp31.runId = responseCreatedResponse.id, _tmp31.status = "in_progress", _tmp31)
|
|
9266
|
+
]), _tmp30)
|
|
8521
9267
|
])
|
|
8522
9268
|
];
|
|
8523
|
-
case
|
|
9269
|
+
case 48:
|
|
8524
9270
|
_state.sent();
|
|
8525
|
-
|
|
9271
|
+
_tmp32 = {
|
|
8526
9272
|
event: "thread.run.step.created"
|
|
8527
9273
|
};
|
|
8528
|
-
|
|
9274
|
+
_tmp33 = {
|
|
8529
9275
|
item: event.item,
|
|
8530
9276
|
threadId: threadId
|
|
8531
9277
|
};
|
|
@@ -8537,21 +9283,21 @@ var responsesRunAdapter = function(param) {
|
|
|
8537
9283
|
}
|
|
8538
9284
|
})
|
|
8539
9285
|
];
|
|
8540
|
-
case
|
|
9286
|
+
case 49:
|
|
8541
9287
|
return [
|
|
8542
9288
|
4,
|
|
8543
9289
|
onEvent2.apply(void 0, [
|
|
8544
|
-
(
|
|
8545
|
-
(
|
|
8546
|
-
]),
|
|
9290
|
+
(_tmp32.data = serializeItemAsMessageCreationRunStep.apply(void 0, [
|
|
9291
|
+
(_tmp33.openaiAssistant = _state.sent(), _tmp33.runId = responseCreatedResponse.id, _tmp33.status = "in_progress", _tmp33.completedAt = null, _tmp33)
|
|
9292
|
+
]), _tmp32)
|
|
8547
9293
|
])
|
|
8548
9294
|
];
|
|
8549
|
-
case
|
|
9295
|
+
case 50:
|
|
8550
9296
|
_state.sent();
|
|
8551
|
-
|
|
9297
|
+
_tmp34 = {
|
|
8552
9298
|
event: "thread.run.step.created"
|
|
8553
9299
|
};
|
|
8554
|
-
|
|
9300
|
+
_tmp35 = {
|
|
8555
9301
|
item: event.item
|
|
8556
9302
|
};
|
|
8557
9303
|
return [
|
|
@@ -8562,30 +9308,30 @@ var responsesRunAdapter = function(param) {
|
|
|
8562
9308
|
}
|
|
8563
9309
|
})
|
|
8564
9310
|
];
|
|
8565
|
-
case
|
|
9311
|
+
case 51:
|
|
8566
9312
|
return [
|
|
8567
9313
|
4,
|
|
8568
9314
|
onEvent2.apply(void 0, [
|
|
8569
|
-
(
|
|
8570
|
-
(
|
|
8571
|
-
]),
|
|
9315
|
+
(_tmp34.data = serializeItemAsWebSearchRunStep.apply(void 0, [
|
|
9316
|
+
(_tmp35.openaiAssistant = _state.sent(), _tmp35.threadId = threadId, _tmp35.runId = responseCreatedResponse.id, _tmp35.completedAt = null, _tmp35)
|
|
9317
|
+
]), _tmp34)
|
|
8572
9318
|
])
|
|
8573
9319
|
];
|
|
8574
|
-
case
|
|
9320
|
+
case 52:
|
|
8575
9321
|
_state.sent();
|
|
8576
9322
|
return [
|
|
8577
9323
|
3,
|
|
8578
|
-
|
|
9324
|
+
74
|
|
8579
9325
|
];
|
|
8580
|
-
case
|
|
9326
|
+
case 53:
|
|
8581
9327
|
if (!(event.item.type === "mcp_list_tools")) return [
|
|
8582
9328
|
3,
|
|
8583
|
-
|
|
9329
|
+
60
|
|
8584
9330
|
];
|
|
8585
|
-
|
|
9331
|
+
_tmp36 = {
|
|
8586
9332
|
event: "thread.message.created"
|
|
8587
9333
|
};
|
|
8588
|
-
|
|
9334
|
+
_tmp37 = {
|
|
8589
9335
|
item: event.item,
|
|
8590
9336
|
threadId: threadId
|
|
8591
9337
|
};
|
|
@@ -8597,21 +9343,21 @@ var responsesRunAdapter = function(param) {
|
|
|
8597
9343
|
}
|
|
8598
9344
|
})
|
|
8599
9345
|
];
|
|
8600
|
-
case
|
|
9346
|
+
case 54:
|
|
8601
9347
|
return [
|
|
8602
9348
|
4,
|
|
8603
9349
|
onEvent2.apply(void 0, [
|
|
8604
|
-
(
|
|
8605
|
-
(
|
|
8606
|
-
]),
|
|
9350
|
+
(_tmp36.data = serializeItemAsMessage.apply(void 0, [
|
|
9351
|
+
(_tmp37.openaiAssistant = _state.sent(), _tmp37.createdAt = (0, import_dayjs21.default)().unix(), _tmp37.runId = responseCreatedResponse.id, _tmp37.status = "in_progress", _tmp37)
|
|
9352
|
+
]), _tmp36)
|
|
8607
9353
|
])
|
|
8608
9354
|
];
|
|
8609
|
-
case
|
|
9355
|
+
case 55:
|
|
8610
9356
|
_state.sent();
|
|
8611
|
-
|
|
9357
|
+
_tmp38 = {
|
|
8612
9358
|
event: "thread.run.step.created"
|
|
8613
9359
|
};
|
|
8614
|
-
|
|
9360
|
+
_tmp39 = {
|
|
8615
9361
|
item: event.item,
|
|
8616
9362
|
threadId: threadId
|
|
8617
9363
|
};
|
|
@@ -8623,21 +9369,21 @@ var responsesRunAdapter = function(param) {
|
|
|
8623
9369
|
}
|
|
8624
9370
|
})
|
|
8625
9371
|
];
|
|
8626
|
-
case
|
|
9372
|
+
case 56:
|
|
8627
9373
|
return [
|
|
8628
9374
|
4,
|
|
8629
9375
|
onEvent2.apply(void 0, [
|
|
8630
|
-
(
|
|
8631
|
-
(
|
|
8632
|
-
]),
|
|
9376
|
+
(_tmp38.data = serializeItemAsMessageCreationRunStep.apply(void 0, [
|
|
9377
|
+
(_tmp39.openaiAssistant = _state.sent(), _tmp39.runId = responseCreatedResponse.id, _tmp39.status = "in_progress", _tmp39.completedAt = null, _tmp39)
|
|
9378
|
+
]), _tmp38)
|
|
8633
9379
|
])
|
|
8634
9380
|
];
|
|
8635
|
-
case
|
|
9381
|
+
case 57:
|
|
8636
9382
|
_state.sent();
|
|
8637
|
-
|
|
9383
|
+
_tmp40 = {
|
|
8638
9384
|
event: "thread.run.step.created"
|
|
8639
9385
|
};
|
|
8640
|
-
|
|
9386
|
+
_tmp41 = {
|
|
8641
9387
|
item: event.item
|
|
8642
9388
|
};
|
|
8643
9389
|
return [
|
|
@@ -8648,31 +9394,31 @@ var responsesRunAdapter = function(param) {
|
|
|
8648
9394
|
}
|
|
8649
9395
|
})
|
|
8650
9396
|
];
|
|
8651
|
-
case
|
|
9397
|
+
case 58:
|
|
8652
9398
|
return [
|
|
8653
9399
|
4,
|
|
8654
9400
|
onEvent2.apply(void 0, [
|
|
8655
|
-
(
|
|
8656
|
-
(
|
|
8657
|
-
]),
|
|
9401
|
+
(_tmp40.data = serializeItemAsMcpListToolsRunStep.apply(void 0, [
|
|
9402
|
+
(_tmp41.openaiAssistant = _state.sent(), _tmp41.threadId = threadId, _tmp41.runId = responseCreatedResponse.id, _tmp41.completedAt = null, _tmp41)
|
|
9403
|
+
]), _tmp40)
|
|
8658
9404
|
])
|
|
8659
9405
|
];
|
|
8660
|
-
case
|
|
9406
|
+
case 59:
|
|
8661
9407
|
_state.sent();
|
|
8662
9408
|
return [
|
|
8663
9409
|
3,
|
|
8664
|
-
|
|
9410
|
+
74
|
|
8665
9411
|
];
|
|
8666
|
-
case
|
|
9412
|
+
case 60:
|
|
8667
9413
|
if (!(event.item.type === "mcp_call")) return [
|
|
8668
9414
|
3,
|
|
8669
|
-
|
|
9415
|
+
67
|
|
8670
9416
|
];
|
|
8671
9417
|
mcpCalls[event.item.id] = event.item;
|
|
8672
|
-
|
|
9418
|
+
_tmp42 = {
|
|
8673
9419
|
event: "thread.message.created"
|
|
8674
9420
|
};
|
|
8675
|
-
|
|
9421
|
+
_tmp43 = {
|
|
8676
9422
|
item: event.item,
|
|
8677
9423
|
threadId: threadId
|
|
8678
9424
|
};
|
|
@@ -8684,21 +9430,21 @@ var responsesRunAdapter = function(param) {
|
|
|
8684
9430
|
}
|
|
8685
9431
|
})
|
|
8686
9432
|
];
|
|
8687
|
-
case
|
|
9433
|
+
case 61:
|
|
8688
9434
|
return [
|
|
8689
9435
|
4,
|
|
8690
9436
|
onEvent2.apply(void 0, [
|
|
8691
|
-
(
|
|
8692
|
-
(
|
|
8693
|
-
]),
|
|
9437
|
+
(_tmp42.data = serializeItemAsMessage.apply(void 0, [
|
|
9438
|
+
(_tmp43.openaiAssistant = _state.sent(), _tmp43.createdAt = (0, import_dayjs21.default)().unix(), _tmp43.runId = responseCreatedResponse.id, _tmp43.status = "in_progress", _tmp43)
|
|
9439
|
+
]), _tmp42)
|
|
8694
9440
|
])
|
|
8695
9441
|
];
|
|
8696
|
-
case
|
|
9442
|
+
case 62:
|
|
8697
9443
|
_state.sent();
|
|
8698
|
-
|
|
9444
|
+
_tmp44 = {
|
|
8699
9445
|
event: "thread.run.step.created"
|
|
8700
9446
|
};
|
|
8701
|
-
|
|
9447
|
+
_tmp45 = {
|
|
8702
9448
|
item: event.item,
|
|
8703
9449
|
threadId: threadId
|
|
8704
9450
|
};
|
|
@@ -8710,21 +9456,21 @@ var responsesRunAdapter = function(param) {
|
|
|
8710
9456
|
}
|
|
8711
9457
|
})
|
|
8712
9458
|
];
|
|
8713
|
-
case
|
|
9459
|
+
case 63:
|
|
8714
9460
|
return [
|
|
8715
9461
|
4,
|
|
8716
9462
|
onEvent2.apply(void 0, [
|
|
8717
|
-
(
|
|
8718
|
-
(
|
|
8719
|
-
]),
|
|
9463
|
+
(_tmp44.data = serializeItemAsMessageCreationRunStep.apply(void 0, [
|
|
9464
|
+
(_tmp45.openaiAssistant = _state.sent(), _tmp45.runId = responseCreatedResponse.id, _tmp45.status = "in_progress", _tmp45.completedAt = null, _tmp45)
|
|
9465
|
+
]), _tmp44)
|
|
8720
9466
|
])
|
|
8721
9467
|
];
|
|
8722
|
-
case
|
|
9468
|
+
case 64:
|
|
8723
9469
|
_state.sent();
|
|
8724
|
-
|
|
9470
|
+
_tmp46 = {
|
|
8725
9471
|
event: "thread.run.step.created"
|
|
8726
9472
|
};
|
|
8727
|
-
|
|
9473
|
+
_tmp47 = {
|
|
8728
9474
|
item: event.item
|
|
8729
9475
|
};
|
|
8730
9476
|
return [
|
|
@@ -8735,31 +9481,31 @@ var responsesRunAdapter = function(param) {
|
|
|
8735
9481
|
}
|
|
8736
9482
|
})
|
|
8737
9483
|
];
|
|
8738
|
-
case
|
|
9484
|
+
case 65:
|
|
8739
9485
|
return [
|
|
8740
9486
|
4,
|
|
8741
9487
|
onEvent2.apply(void 0, [
|
|
8742
|
-
(
|
|
8743
|
-
(
|
|
8744
|
-
]),
|
|
9488
|
+
(_tmp46.data = serializeItemAsMcpCallRunStep.apply(void 0, [
|
|
9489
|
+
(_tmp47.openaiAssistant = _state.sent(), _tmp47.threadId = threadId, _tmp47.runId = responseCreatedResponse.id, _tmp47.completedAt = null, _tmp47)
|
|
9490
|
+
]), _tmp46)
|
|
8745
9491
|
])
|
|
8746
9492
|
];
|
|
8747
|
-
case
|
|
9493
|
+
case 66:
|
|
8748
9494
|
_state.sent();
|
|
8749
9495
|
return [
|
|
8750
9496
|
3,
|
|
8751
|
-
|
|
9497
|
+
74
|
|
8752
9498
|
];
|
|
8753
|
-
case
|
|
9499
|
+
case 67:
|
|
8754
9500
|
if (!(event.item.type === "code_interpreter_call")) return [
|
|
8755
9501
|
3,
|
|
8756
|
-
|
|
9502
|
+
74
|
|
8757
9503
|
];
|
|
8758
9504
|
codeInterpreterCalls[event.item.id] = event.item;
|
|
8759
|
-
|
|
9505
|
+
_tmp48 = {
|
|
8760
9506
|
event: "thread.message.created"
|
|
8761
9507
|
};
|
|
8762
|
-
|
|
9508
|
+
_tmp49 = {
|
|
8763
9509
|
item: event.item,
|
|
8764
9510
|
threadId: threadId
|
|
8765
9511
|
};
|
|
@@ -8771,21 +9517,21 @@ var responsesRunAdapter = function(param) {
|
|
|
8771
9517
|
}
|
|
8772
9518
|
})
|
|
8773
9519
|
];
|
|
8774
|
-
case
|
|
9520
|
+
case 68:
|
|
8775
9521
|
return [
|
|
8776
9522
|
4,
|
|
8777
9523
|
onEvent2.apply(void 0, [
|
|
8778
|
-
(
|
|
8779
|
-
(
|
|
8780
|
-
]),
|
|
9524
|
+
(_tmp48.data = serializeItemAsMessage.apply(void 0, [
|
|
9525
|
+
(_tmp49.openaiAssistant = _state.sent(), _tmp49.createdAt = (0, import_dayjs21.default)().unix(), _tmp49.runId = responseCreatedResponse.id, _tmp49.status = "in_progress", _tmp49)
|
|
9526
|
+
]), _tmp48)
|
|
8781
9527
|
])
|
|
8782
9528
|
];
|
|
8783
|
-
case
|
|
9529
|
+
case 69:
|
|
8784
9530
|
_state.sent();
|
|
8785
|
-
|
|
9531
|
+
_tmp50 = {
|
|
8786
9532
|
event: "thread.run.step.created"
|
|
8787
9533
|
};
|
|
8788
|
-
|
|
9534
|
+
_tmp51 = {
|
|
8789
9535
|
item: event.item,
|
|
8790
9536
|
threadId: threadId
|
|
8791
9537
|
};
|
|
@@ -8797,21 +9543,21 @@ var responsesRunAdapter = function(param) {
|
|
|
8797
9543
|
}
|
|
8798
9544
|
})
|
|
8799
9545
|
];
|
|
8800
|
-
case
|
|
9546
|
+
case 70:
|
|
8801
9547
|
return [
|
|
8802
9548
|
4,
|
|
8803
9549
|
onEvent2.apply(void 0, [
|
|
8804
|
-
(
|
|
8805
|
-
(
|
|
8806
|
-
]),
|
|
9550
|
+
(_tmp50.data = serializeItemAsMessageCreationRunStep.apply(void 0, [
|
|
9551
|
+
(_tmp51.openaiAssistant = _state.sent(), _tmp51.runId = responseCreatedResponse.id, _tmp51.status = "in_progress", _tmp51.completedAt = null, _tmp51)
|
|
9552
|
+
]), _tmp50)
|
|
8807
9553
|
])
|
|
8808
9554
|
];
|
|
8809
|
-
case
|
|
9555
|
+
case 71:
|
|
8810
9556
|
_state.sent();
|
|
8811
|
-
|
|
9557
|
+
_tmp52 = {
|
|
8812
9558
|
event: "thread.run.step.created"
|
|
8813
9559
|
};
|
|
8814
|
-
|
|
9560
|
+
_tmp53 = {
|
|
8815
9561
|
item: event.item
|
|
8816
9562
|
};
|
|
8817
9563
|
return [
|
|
@@ -8822,33 +9568,33 @@ var responsesRunAdapter = function(param) {
|
|
|
8822
9568
|
}
|
|
8823
9569
|
})
|
|
8824
9570
|
];
|
|
8825
|
-
case
|
|
9571
|
+
case 72:
|
|
8826
9572
|
return [
|
|
8827
9573
|
4,
|
|
8828
9574
|
onEvent2.apply(void 0, [
|
|
8829
|
-
(
|
|
8830
|
-
(
|
|
8831
|
-
]),
|
|
9575
|
+
(_tmp52.data = serializeItemAsCodeInterpreterCallRunStep.apply(void 0, [
|
|
9576
|
+
(_tmp53.openaiAssistant = _state.sent(), _tmp53.threadId = threadId, _tmp53.runId = responseCreatedResponse.id, _tmp53.completedAt = null, _tmp53)
|
|
9577
|
+
]), _tmp52)
|
|
8832
9578
|
])
|
|
8833
9579
|
];
|
|
8834
|
-
case
|
|
9580
|
+
case 73:
|
|
8835
9581
|
_state.sent();
|
|
8836
|
-
_state.label =
|
|
8837
|
-
case
|
|
9582
|
+
_state.label = 74;
|
|
9583
|
+
case 74:
|
|
8838
9584
|
if (event.item.id) itemIds.push(event.item.id);
|
|
8839
9585
|
return [
|
|
8840
9586
|
3,
|
|
8841
|
-
|
|
9587
|
+
137
|
|
8842
9588
|
];
|
|
8843
|
-
case
|
|
9589
|
+
case 75:
|
|
8844
9590
|
if (!(event.item.type === "message")) return [
|
|
8845
9591
|
3,
|
|
8846
|
-
|
|
9592
|
+
80
|
|
8847
9593
|
];
|
|
8848
|
-
|
|
9594
|
+
_tmp54 = {
|
|
8849
9595
|
event: "thread.run.step.completed"
|
|
8850
9596
|
};
|
|
8851
|
-
|
|
9597
|
+
_tmp55 = {
|
|
8852
9598
|
item: event.item,
|
|
8853
9599
|
threadId: threadId
|
|
8854
9600
|
};
|
|
@@ -8860,21 +9606,21 @@ var responsesRunAdapter = function(param) {
|
|
|
8860
9606
|
}
|
|
8861
9607
|
})
|
|
8862
9608
|
];
|
|
8863
|
-
case
|
|
9609
|
+
case 76:
|
|
8864
9610
|
return [
|
|
8865
9611
|
4,
|
|
8866
9612
|
onEvent2.apply(void 0, [
|
|
8867
|
-
(
|
|
8868
|
-
(
|
|
8869
|
-
]),
|
|
9613
|
+
(_tmp54.data = serializeItemAsMessageCreationRunStep.apply(void 0, [
|
|
9614
|
+
(_tmp55.openaiAssistant = _state.sent(), _tmp55.runId = responseCreatedResponse.id, _tmp55)
|
|
9615
|
+
]), _tmp54)
|
|
8870
9616
|
])
|
|
8871
9617
|
];
|
|
8872
|
-
case
|
|
9618
|
+
case 77:
|
|
8873
9619
|
_state.sent();
|
|
8874
|
-
|
|
9620
|
+
_tmp56 = {
|
|
8875
9621
|
event: "thread.message.completed"
|
|
8876
9622
|
};
|
|
8877
|
-
|
|
9623
|
+
_tmp57 = {
|
|
8878
9624
|
item: event.item,
|
|
8879
9625
|
threadId: threadId
|
|
8880
9626
|
};
|
|
@@ -8886,31 +9632,31 @@ var responsesRunAdapter = function(param) {
|
|
|
8886
9632
|
}
|
|
8887
9633
|
})
|
|
8888
9634
|
];
|
|
8889
|
-
case
|
|
9635
|
+
case 78:
|
|
8890
9636
|
return [
|
|
8891
9637
|
4,
|
|
8892
9638
|
onEvent2.apply(void 0, [
|
|
8893
|
-
(
|
|
8894
|
-
(
|
|
8895
|
-
]),
|
|
9639
|
+
(_tmp56.data = serializeItemAsMessage.apply(void 0, [
|
|
9640
|
+
(_tmp57.openaiAssistant = _state.sent(), _tmp57.createdAt = (0, import_dayjs21.default)().unix(), _tmp57.runId = responseCreatedResponse.id, _tmp57)
|
|
9641
|
+
]), _tmp56)
|
|
8896
9642
|
])
|
|
8897
9643
|
];
|
|
8898
|
-
case
|
|
9644
|
+
case 79:
|
|
8899
9645
|
_state.sent();
|
|
8900
9646
|
return [
|
|
8901
9647
|
3,
|
|
8902
|
-
|
|
9648
|
+
125
|
|
8903
9649
|
];
|
|
8904
|
-
case
|
|
9650
|
+
case 80:
|
|
8905
9651
|
if (!(event.item.type === "function_call")) return [
|
|
8906
9652
|
3,
|
|
8907
|
-
|
|
9653
|
+
83
|
|
8908
9654
|
];
|
|
8909
9655
|
toolCalls[event.item.id] = event.item;
|
|
8910
|
-
|
|
9656
|
+
_tmp58 = {
|
|
8911
9657
|
event: "thread.run.step.in_progress"
|
|
8912
9658
|
};
|
|
8913
|
-
|
|
9659
|
+
_tmp59 = {
|
|
8914
9660
|
item: event.item,
|
|
8915
9661
|
threadId: threadId
|
|
8916
9662
|
};
|
|
@@ -8922,30 +9668,30 @@ var responsesRunAdapter = function(param) {
|
|
|
8922
9668
|
}
|
|
8923
9669
|
})
|
|
8924
9670
|
];
|
|
8925
|
-
case
|
|
9671
|
+
case 81:
|
|
8926
9672
|
return [
|
|
8927
9673
|
4,
|
|
8928
9674
|
onEvent2.apply(void 0, [
|
|
8929
|
-
(
|
|
8930
|
-
(
|
|
8931
|
-
]),
|
|
9675
|
+
(_tmp58.data = serializeItemAsMessageCreationRunStep.apply(void 0, [
|
|
9676
|
+
(_tmp59.openaiAssistant = _state.sent(), _tmp59.runId = responseCreatedResponse.id, _tmp59)
|
|
9677
|
+
]), _tmp58)
|
|
8932
9678
|
])
|
|
8933
9679
|
];
|
|
8934
|
-
case
|
|
9680
|
+
case 82:
|
|
8935
9681
|
_state.sent();
|
|
8936
9682
|
return [
|
|
8937
9683
|
3,
|
|
8938
|
-
|
|
9684
|
+
125
|
|
8939
9685
|
];
|
|
8940
|
-
case
|
|
9686
|
+
case 83:
|
|
8941
9687
|
if (!(event.item.type === "image_generation_call")) return [
|
|
8942
9688
|
3,
|
|
8943
|
-
|
|
9689
|
+
90
|
|
8944
9690
|
];
|
|
8945
|
-
|
|
9691
|
+
_tmp60 = {
|
|
8946
9692
|
event: "thread.run.step.completed"
|
|
8947
9693
|
};
|
|
8948
|
-
|
|
9694
|
+
_tmp61 = {
|
|
8949
9695
|
item: event.item
|
|
8950
9696
|
};
|
|
8951
9697
|
return [
|
|
@@ -8956,21 +9702,21 @@ var responsesRunAdapter = function(param) {
|
|
|
8956
9702
|
}
|
|
8957
9703
|
})
|
|
8958
9704
|
];
|
|
8959
|
-
case
|
|
9705
|
+
case 84:
|
|
8960
9706
|
return [
|
|
8961
9707
|
4,
|
|
8962
9708
|
onEvent2.apply(void 0, [
|
|
8963
|
-
(
|
|
8964
|
-
(
|
|
8965
|
-
]),
|
|
9709
|
+
(_tmp60.data = serializeItemAsImageGenerationRunStep.apply(void 0, [
|
|
9710
|
+
(_tmp61.openaiAssistant = _state.sent(), _tmp61.threadId = threadId, _tmp61.runId = responseCreatedResponse.id, _tmp61)
|
|
9711
|
+
]), _tmp60)
|
|
8966
9712
|
])
|
|
8967
9713
|
];
|
|
8968
|
-
case
|
|
9714
|
+
case 85:
|
|
8969
9715
|
_state.sent();
|
|
8970
|
-
|
|
9716
|
+
_tmp62 = {
|
|
8971
9717
|
event: "thread.run.step.completed"
|
|
8972
9718
|
};
|
|
8973
|
-
|
|
9719
|
+
_tmp63 = {
|
|
8974
9720
|
item: event.item,
|
|
8975
9721
|
threadId: threadId
|
|
8976
9722
|
};
|
|
@@ -8982,21 +9728,21 @@ var responsesRunAdapter = function(param) {
|
|
|
8982
9728
|
}
|
|
8983
9729
|
})
|
|
8984
9730
|
];
|
|
8985
|
-
case
|
|
9731
|
+
case 86:
|
|
8986
9732
|
return [
|
|
8987
9733
|
4,
|
|
8988
9734
|
onEvent2.apply(void 0, [
|
|
8989
|
-
(
|
|
8990
|
-
(
|
|
8991
|
-
]),
|
|
9735
|
+
(_tmp62.data = serializeItemAsMessageCreationRunStep.apply(void 0, [
|
|
9736
|
+
(_tmp63.openaiAssistant = _state.sent(), _tmp63.runId = responseCreatedResponse.id, _tmp63)
|
|
9737
|
+
]), _tmp62)
|
|
8992
9738
|
])
|
|
8993
9739
|
];
|
|
8994
|
-
case
|
|
9740
|
+
case 87:
|
|
8995
9741
|
_state.sent();
|
|
8996
|
-
|
|
9742
|
+
_tmp64 = {
|
|
8997
9743
|
event: "thread.message.completed"
|
|
8998
9744
|
};
|
|
8999
|
-
|
|
9745
|
+
_tmp65 = {
|
|
9000
9746
|
item: event.item,
|
|
9001
9747
|
threadId: threadId
|
|
9002
9748
|
};
|
|
@@ -9008,30 +9754,30 @@ var responsesRunAdapter = function(param) {
|
|
|
9008
9754
|
}
|
|
9009
9755
|
})
|
|
9010
9756
|
];
|
|
9011
|
-
case
|
|
9757
|
+
case 88:
|
|
9012
9758
|
return [
|
|
9013
9759
|
4,
|
|
9014
9760
|
onEvent2.apply(void 0, [
|
|
9015
|
-
(
|
|
9016
|
-
(
|
|
9017
|
-
]),
|
|
9761
|
+
(_tmp64.data = serializeItemAsMessage.apply(void 0, [
|
|
9762
|
+
(_tmp65.openaiAssistant = _state.sent(), _tmp65.createdAt = (0, import_dayjs21.default)().unix(), _tmp65.runId = responseCreatedResponse.id, _tmp65)
|
|
9763
|
+
]), _tmp64)
|
|
9018
9764
|
])
|
|
9019
9765
|
];
|
|
9020
|
-
case
|
|
9766
|
+
case 89:
|
|
9021
9767
|
_state.sent();
|
|
9022
9768
|
return [
|
|
9023
9769
|
3,
|
|
9024
|
-
|
|
9770
|
+
125
|
|
9025
9771
|
];
|
|
9026
|
-
case
|
|
9772
|
+
case 90:
|
|
9027
9773
|
if (!(event.item.type === "reasoning")) return [
|
|
9028
9774
|
3,
|
|
9029
|
-
|
|
9775
|
+
97
|
|
9030
9776
|
];
|
|
9031
|
-
|
|
9777
|
+
_tmp66 = {
|
|
9032
9778
|
event: "thread.run.step.completed"
|
|
9033
9779
|
};
|
|
9034
|
-
|
|
9780
|
+
_tmp67 = {
|
|
9035
9781
|
item: event.item
|
|
9036
9782
|
};
|
|
9037
9783
|
return [
|
|
@@ -9042,21 +9788,21 @@ var responsesRunAdapter = function(param) {
|
|
|
9042
9788
|
}
|
|
9043
9789
|
})
|
|
9044
9790
|
];
|
|
9045
|
-
case
|
|
9791
|
+
case 91:
|
|
9046
9792
|
return [
|
|
9047
9793
|
4,
|
|
9048
9794
|
onEvent2.apply(void 0, [
|
|
9049
|
-
(
|
|
9050
|
-
(
|
|
9051
|
-
]),
|
|
9795
|
+
(_tmp66.data = serializeItemAsReasoningRunStep.apply(void 0, [
|
|
9796
|
+
(_tmp67.openaiAssistant = _state.sent(), _tmp67.threadId = threadId, _tmp67.runId = responseCreatedResponse.id, _tmp67)
|
|
9797
|
+
]), _tmp66)
|
|
9052
9798
|
])
|
|
9053
9799
|
];
|
|
9054
|
-
case
|
|
9800
|
+
case 92:
|
|
9055
9801
|
_state.sent();
|
|
9056
|
-
|
|
9802
|
+
_tmp68 = {
|
|
9057
9803
|
event: "thread.run.step.completed"
|
|
9058
9804
|
};
|
|
9059
|
-
|
|
9805
|
+
_tmp69 = {
|
|
9060
9806
|
item: event.item,
|
|
9061
9807
|
threadId: threadId
|
|
9062
9808
|
};
|
|
@@ -9068,21 +9814,21 @@ var responsesRunAdapter = function(param) {
|
|
|
9068
9814
|
}
|
|
9069
9815
|
})
|
|
9070
9816
|
];
|
|
9071
|
-
case
|
|
9817
|
+
case 93:
|
|
9072
9818
|
return [
|
|
9073
9819
|
4,
|
|
9074
9820
|
onEvent2.apply(void 0, [
|
|
9075
|
-
(
|
|
9076
|
-
(
|
|
9077
|
-
]),
|
|
9821
|
+
(_tmp68.data = serializeItemAsMessageCreationRunStep.apply(void 0, [
|
|
9822
|
+
(_tmp69.openaiAssistant = _state.sent(), _tmp69.runId = responseCreatedResponse.id, _tmp69)
|
|
9823
|
+
]), _tmp68)
|
|
9078
9824
|
])
|
|
9079
9825
|
];
|
|
9080
|
-
case
|
|
9826
|
+
case 94:
|
|
9081
9827
|
_state.sent();
|
|
9082
|
-
|
|
9828
|
+
_tmp70 = {
|
|
9083
9829
|
event: "thread.message.completed"
|
|
9084
9830
|
};
|
|
9085
|
-
|
|
9831
|
+
_tmp71 = {
|
|
9086
9832
|
item: event.item,
|
|
9087
9833
|
threadId: threadId
|
|
9088
9834
|
};
|
|
@@ -9094,30 +9840,30 @@ var responsesRunAdapter = function(param) {
|
|
|
9094
9840
|
}
|
|
9095
9841
|
})
|
|
9096
9842
|
];
|
|
9097
|
-
case
|
|
9843
|
+
case 95:
|
|
9098
9844
|
return [
|
|
9099
9845
|
4,
|
|
9100
9846
|
onEvent2.apply(void 0, [
|
|
9101
|
-
(
|
|
9102
|
-
(
|
|
9103
|
-
]),
|
|
9847
|
+
(_tmp70.data = serializeItemAsMessage.apply(void 0, [
|
|
9848
|
+
(_tmp71.openaiAssistant = _state.sent(), _tmp71.createdAt = (0, import_dayjs21.default)().unix(), _tmp71.runId = responseCreatedResponse.id, _tmp71)
|
|
9849
|
+
]), _tmp70)
|
|
9104
9850
|
])
|
|
9105
9851
|
];
|
|
9106
|
-
case
|
|
9852
|
+
case 96:
|
|
9107
9853
|
_state.sent();
|
|
9108
9854
|
return [
|
|
9109
9855
|
3,
|
|
9110
|
-
|
|
9856
|
+
125
|
|
9111
9857
|
];
|
|
9112
|
-
case
|
|
9858
|
+
case 97:
|
|
9113
9859
|
if (!(event.item.type === "web_search_call")) return [
|
|
9114
9860
|
3,
|
|
9115
|
-
|
|
9861
|
+
104
|
|
9116
9862
|
];
|
|
9117
|
-
|
|
9863
|
+
_tmp72 = {
|
|
9118
9864
|
event: "thread.run.step.completed"
|
|
9119
9865
|
};
|
|
9120
|
-
|
|
9866
|
+
_tmp73 = {
|
|
9121
9867
|
item: event.item
|
|
9122
9868
|
};
|
|
9123
9869
|
return [
|
|
@@ -9128,21 +9874,21 @@ var responsesRunAdapter = function(param) {
|
|
|
9128
9874
|
}
|
|
9129
9875
|
})
|
|
9130
9876
|
];
|
|
9131
|
-
case
|
|
9877
|
+
case 98:
|
|
9132
9878
|
return [
|
|
9133
9879
|
4,
|
|
9134
9880
|
onEvent2.apply(void 0, [
|
|
9135
|
-
(
|
|
9136
|
-
(
|
|
9137
|
-
]),
|
|
9881
|
+
(_tmp72.data = serializeItemAsWebSearchRunStep.apply(void 0, [
|
|
9882
|
+
(_tmp73.openaiAssistant = _state.sent(), _tmp73.threadId = threadId, _tmp73.runId = responseCreatedResponse.id, _tmp73)
|
|
9883
|
+
]), _tmp72)
|
|
9138
9884
|
])
|
|
9139
9885
|
];
|
|
9140
|
-
case
|
|
9886
|
+
case 99:
|
|
9141
9887
|
_state.sent();
|
|
9142
|
-
|
|
9888
|
+
_tmp74 = {
|
|
9143
9889
|
event: "thread.run.step.completed"
|
|
9144
9890
|
};
|
|
9145
|
-
|
|
9891
|
+
_tmp75 = {
|
|
9146
9892
|
item: event.item,
|
|
9147
9893
|
threadId: threadId
|
|
9148
9894
|
};
|
|
@@ -9154,21 +9900,21 @@ var responsesRunAdapter = function(param) {
|
|
|
9154
9900
|
}
|
|
9155
9901
|
})
|
|
9156
9902
|
];
|
|
9157
|
-
case
|
|
9903
|
+
case 100:
|
|
9158
9904
|
return [
|
|
9159
9905
|
4,
|
|
9160
9906
|
onEvent2.apply(void 0, [
|
|
9161
|
-
(
|
|
9162
|
-
(
|
|
9163
|
-
]),
|
|
9907
|
+
(_tmp74.data = serializeItemAsMessageCreationRunStep.apply(void 0, [
|
|
9908
|
+
(_tmp75.openaiAssistant = _state.sent(), _tmp75.runId = responseCreatedResponse.id, _tmp75)
|
|
9909
|
+
]), _tmp74)
|
|
9164
9910
|
])
|
|
9165
9911
|
];
|
|
9166
|
-
case
|
|
9912
|
+
case 101:
|
|
9167
9913
|
_state.sent();
|
|
9168
|
-
|
|
9914
|
+
_tmp76 = {
|
|
9169
9915
|
event: "thread.message.completed"
|
|
9170
9916
|
};
|
|
9171
|
-
|
|
9917
|
+
_tmp77 = {
|
|
9172
9918
|
item: event.item,
|
|
9173
9919
|
threadId: threadId
|
|
9174
9920
|
};
|
|
@@ -9180,30 +9926,30 @@ var responsesRunAdapter = function(param) {
|
|
|
9180
9926
|
}
|
|
9181
9927
|
})
|
|
9182
9928
|
];
|
|
9183
|
-
case
|
|
9929
|
+
case 102:
|
|
9184
9930
|
return [
|
|
9185
9931
|
4,
|
|
9186
9932
|
onEvent2.apply(void 0, [
|
|
9187
|
-
(
|
|
9188
|
-
(
|
|
9189
|
-
]),
|
|
9933
|
+
(_tmp76.data = serializeItemAsMessage.apply(void 0, [
|
|
9934
|
+
(_tmp77.openaiAssistant = _state.sent(), _tmp77.createdAt = (0, import_dayjs21.default)().unix(), _tmp77.runId = responseCreatedResponse.id, _tmp77)
|
|
9935
|
+
]), _tmp76)
|
|
9190
9936
|
])
|
|
9191
9937
|
];
|
|
9192
|
-
case
|
|
9938
|
+
case 103:
|
|
9193
9939
|
_state.sent();
|
|
9194
9940
|
return [
|
|
9195
9941
|
3,
|
|
9196
|
-
|
|
9942
|
+
125
|
|
9197
9943
|
];
|
|
9198
|
-
case
|
|
9944
|
+
case 104:
|
|
9199
9945
|
if (!(event.item.type === "mcp_list_tools")) return [
|
|
9200
9946
|
3,
|
|
9201
|
-
|
|
9947
|
+
111
|
|
9202
9948
|
];
|
|
9203
|
-
|
|
9949
|
+
_tmp78 = {
|
|
9204
9950
|
event: "thread.run.step.completed"
|
|
9205
9951
|
};
|
|
9206
|
-
|
|
9952
|
+
_tmp79 = {
|
|
9207
9953
|
item: event.item
|
|
9208
9954
|
};
|
|
9209
9955
|
return [
|
|
@@ -9214,21 +9960,21 @@ var responsesRunAdapter = function(param) {
|
|
|
9214
9960
|
}
|
|
9215
9961
|
})
|
|
9216
9962
|
];
|
|
9217
|
-
case
|
|
9963
|
+
case 105:
|
|
9218
9964
|
return [
|
|
9219
9965
|
4,
|
|
9220
9966
|
onEvent2.apply(void 0, [
|
|
9221
|
-
(
|
|
9222
|
-
(
|
|
9223
|
-
]),
|
|
9967
|
+
(_tmp78.data = serializeItemAsMcpListToolsRunStep.apply(void 0, [
|
|
9968
|
+
(_tmp79.openaiAssistant = _state.sent(), _tmp79.threadId = threadId, _tmp79.runId = responseCreatedResponse.id, _tmp79)
|
|
9969
|
+
]), _tmp78)
|
|
9224
9970
|
])
|
|
9225
9971
|
];
|
|
9226
|
-
case
|
|
9972
|
+
case 106:
|
|
9227
9973
|
_state.sent();
|
|
9228
|
-
|
|
9974
|
+
_tmp80 = {
|
|
9229
9975
|
event: "thread.run.step.completed"
|
|
9230
9976
|
};
|
|
9231
|
-
|
|
9977
|
+
_tmp81 = {
|
|
9232
9978
|
item: event.item,
|
|
9233
9979
|
threadId: threadId
|
|
9234
9980
|
};
|
|
@@ -9240,21 +9986,21 @@ var responsesRunAdapter = function(param) {
|
|
|
9240
9986
|
}
|
|
9241
9987
|
})
|
|
9242
9988
|
];
|
|
9243
|
-
case
|
|
9989
|
+
case 107:
|
|
9244
9990
|
return [
|
|
9245
9991
|
4,
|
|
9246
9992
|
onEvent2.apply(void 0, [
|
|
9247
|
-
(
|
|
9248
|
-
(
|
|
9249
|
-
]),
|
|
9993
|
+
(_tmp80.data = serializeItemAsMessageCreationRunStep.apply(void 0, [
|
|
9994
|
+
(_tmp81.openaiAssistant = _state.sent(), _tmp81.runId = responseCreatedResponse.id, _tmp81)
|
|
9995
|
+
]), _tmp80)
|
|
9250
9996
|
])
|
|
9251
9997
|
];
|
|
9252
|
-
case
|
|
9998
|
+
case 108:
|
|
9253
9999
|
_state.sent();
|
|
9254
|
-
|
|
10000
|
+
_tmp82 = {
|
|
9255
10001
|
event: "thread.message.completed"
|
|
9256
10002
|
};
|
|
9257
|
-
|
|
10003
|
+
_tmp83 = {
|
|
9258
10004
|
item: event.item,
|
|
9259
10005
|
threadId: threadId
|
|
9260
10006
|
};
|
|
@@ -9266,30 +10012,30 @@ var responsesRunAdapter = function(param) {
|
|
|
9266
10012
|
}
|
|
9267
10013
|
})
|
|
9268
10014
|
];
|
|
9269
|
-
case
|
|
10015
|
+
case 109:
|
|
9270
10016
|
return [
|
|
9271
10017
|
4,
|
|
9272
10018
|
onEvent2.apply(void 0, [
|
|
9273
|
-
(
|
|
9274
|
-
(
|
|
9275
|
-
]),
|
|
10019
|
+
(_tmp82.data = serializeItemAsMessage.apply(void 0, [
|
|
10020
|
+
(_tmp83.openaiAssistant = _state.sent(), _tmp83.createdAt = (0, import_dayjs21.default)().unix(), _tmp83.runId = responseCreatedResponse.id, _tmp83)
|
|
10021
|
+
]), _tmp82)
|
|
9276
10022
|
])
|
|
9277
10023
|
];
|
|
9278
|
-
case
|
|
10024
|
+
case 110:
|
|
9279
10025
|
_state.sent();
|
|
9280
10026
|
return [
|
|
9281
10027
|
3,
|
|
9282
|
-
|
|
10028
|
+
125
|
|
9283
10029
|
];
|
|
9284
|
-
case
|
|
10030
|
+
case 111:
|
|
9285
10031
|
if (!(event.item.type === "mcp_call")) return [
|
|
9286
10032
|
3,
|
|
9287
|
-
|
|
10033
|
+
118
|
|
9288
10034
|
];
|
|
9289
|
-
|
|
10035
|
+
_tmp84 = {
|
|
9290
10036
|
event: "thread.run.step.completed"
|
|
9291
10037
|
};
|
|
9292
|
-
|
|
10038
|
+
_tmp85 = {
|
|
9293
10039
|
item: event.item
|
|
9294
10040
|
};
|
|
9295
10041
|
return [
|
|
@@ -9300,21 +10046,21 @@ var responsesRunAdapter = function(param) {
|
|
|
9300
10046
|
}
|
|
9301
10047
|
})
|
|
9302
10048
|
];
|
|
9303
|
-
case
|
|
10049
|
+
case 112:
|
|
9304
10050
|
return [
|
|
9305
10051
|
4,
|
|
9306
10052
|
onEvent2.apply(void 0, [
|
|
9307
|
-
(
|
|
9308
|
-
(
|
|
9309
|
-
]),
|
|
10053
|
+
(_tmp84.data = serializeItemAsMcpCallRunStep.apply(void 0, [
|
|
10054
|
+
(_tmp85.openaiAssistant = _state.sent(), _tmp85.threadId = threadId, _tmp85.runId = responseCreatedResponse.id, _tmp85)
|
|
10055
|
+
]), _tmp84)
|
|
9310
10056
|
])
|
|
9311
10057
|
];
|
|
9312
|
-
case
|
|
10058
|
+
case 113:
|
|
9313
10059
|
_state.sent();
|
|
9314
|
-
|
|
10060
|
+
_tmp86 = {
|
|
9315
10061
|
event: "thread.run.step.completed"
|
|
9316
10062
|
};
|
|
9317
|
-
|
|
10063
|
+
_tmp87 = {
|
|
9318
10064
|
item: event.item,
|
|
9319
10065
|
threadId: threadId
|
|
9320
10066
|
};
|
|
@@ -9326,21 +10072,21 @@ var responsesRunAdapter = function(param) {
|
|
|
9326
10072
|
}
|
|
9327
10073
|
})
|
|
9328
10074
|
];
|
|
9329
|
-
case
|
|
10075
|
+
case 114:
|
|
9330
10076
|
return [
|
|
9331
10077
|
4,
|
|
9332
10078
|
onEvent2.apply(void 0, [
|
|
9333
|
-
(
|
|
9334
|
-
(
|
|
9335
|
-
]),
|
|
10079
|
+
(_tmp86.data = serializeItemAsMessageCreationRunStep.apply(void 0, [
|
|
10080
|
+
(_tmp87.openaiAssistant = _state.sent(), _tmp87.runId = responseCreatedResponse.id, _tmp87)
|
|
10081
|
+
]), _tmp86)
|
|
9336
10082
|
])
|
|
9337
10083
|
];
|
|
9338
|
-
case
|
|
10084
|
+
case 115:
|
|
9339
10085
|
_state.sent();
|
|
9340
|
-
|
|
10086
|
+
_tmp88 = {
|
|
9341
10087
|
event: "thread.message.completed"
|
|
9342
10088
|
};
|
|
9343
|
-
|
|
10089
|
+
_tmp89 = {
|
|
9344
10090
|
item: event.item,
|
|
9345
10091
|
threadId: threadId
|
|
9346
10092
|
};
|
|
@@ -9352,30 +10098,30 @@ var responsesRunAdapter = function(param) {
|
|
|
9352
10098
|
}
|
|
9353
10099
|
})
|
|
9354
10100
|
];
|
|
9355
|
-
case
|
|
10101
|
+
case 116:
|
|
9356
10102
|
return [
|
|
9357
10103
|
4,
|
|
9358
10104
|
onEvent2.apply(void 0, [
|
|
9359
|
-
(
|
|
9360
|
-
(
|
|
9361
|
-
]),
|
|
10105
|
+
(_tmp88.data = serializeItemAsMessage.apply(void 0, [
|
|
10106
|
+
(_tmp89.openaiAssistant = _state.sent(), _tmp89.createdAt = (0, import_dayjs21.default)().unix(), _tmp89.runId = responseCreatedResponse.id, _tmp89)
|
|
10107
|
+
]), _tmp88)
|
|
9362
10108
|
])
|
|
9363
10109
|
];
|
|
9364
|
-
case
|
|
10110
|
+
case 117:
|
|
9365
10111
|
_state.sent();
|
|
9366
10112
|
return [
|
|
9367
10113
|
3,
|
|
9368
|
-
|
|
10114
|
+
125
|
|
9369
10115
|
];
|
|
9370
|
-
case
|
|
10116
|
+
case 118:
|
|
9371
10117
|
if (!(event.item.type === "code_interpreter_call")) return [
|
|
9372
10118
|
3,
|
|
9373
|
-
|
|
10119
|
+
125
|
|
9374
10120
|
];
|
|
9375
|
-
|
|
10121
|
+
_tmp90 = {
|
|
9376
10122
|
event: "thread.run.step.completed"
|
|
9377
10123
|
};
|
|
9378
|
-
|
|
10124
|
+
_tmp91 = {
|
|
9379
10125
|
item: event.item
|
|
9380
10126
|
};
|
|
9381
10127
|
return [
|
|
@@ -9386,21 +10132,21 @@ var responsesRunAdapter = function(param) {
|
|
|
9386
10132
|
}
|
|
9387
10133
|
})
|
|
9388
10134
|
];
|
|
9389
|
-
case
|
|
10135
|
+
case 119:
|
|
9390
10136
|
return [
|
|
9391
10137
|
4,
|
|
9392
10138
|
onEvent2.apply(void 0, [
|
|
9393
|
-
(
|
|
9394
|
-
(
|
|
9395
|
-
]),
|
|
10139
|
+
(_tmp90.data = serializeItemAsCodeInterpreterCallRunStep.apply(void 0, [
|
|
10140
|
+
(_tmp91.openaiAssistant = _state.sent(), _tmp91.threadId = threadId, _tmp91.runId = responseCreatedResponse.id, _tmp91)
|
|
10141
|
+
]), _tmp90)
|
|
9396
10142
|
])
|
|
9397
10143
|
];
|
|
9398
|
-
case
|
|
10144
|
+
case 120:
|
|
9399
10145
|
_state.sent();
|
|
9400
|
-
|
|
10146
|
+
_tmp92 = {
|
|
9401
10147
|
event: "thread.run.step.completed"
|
|
9402
10148
|
};
|
|
9403
|
-
|
|
10149
|
+
_tmp93 = {
|
|
9404
10150
|
item: event.item,
|
|
9405
10151
|
threadId: threadId
|
|
9406
10152
|
};
|
|
@@ -9412,21 +10158,21 @@ var responsesRunAdapter = function(param) {
|
|
|
9412
10158
|
}
|
|
9413
10159
|
})
|
|
9414
10160
|
];
|
|
9415
|
-
case
|
|
10161
|
+
case 121:
|
|
9416
10162
|
return [
|
|
9417
10163
|
4,
|
|
9418
10164
|
onEvent2.apply(void 0, [
|
|
9419
|
-
(
|
|
9420
|
-
(
|
|
9421
|
-
]),
|
|
10165
|
+
(_tmp92.data = serializeItemAsMessageCreationRunStep.apply(void 0, [
|
|
10166
|
+
(_tmp93.openaiAssistant = _state.sent(), _tmp93.runId = responseCreatedResponse.id, _tmp93)
|
|
10167
|
+
]), _tmp92)
|
|
9422
10168
|
])
|
|
9423
10169
|
];
|
|
9424
|
-
case
|
|
10170
|
+
case 122:
|
|
9425
10171
|
_state.sent();
|
|
9426
|
-
|
|
10172
|
+
_tmp94 = {
|
|
9427
10173
|
event: "thread.message.completed"
|
|
9428
10174
|
};
|
|
9429
|
-
|
|
10175
|
+
_tmp95 = {
|
|
9430
10176
|
item: event.item,
|
|
9431
10177
|
threadId: threadId
|
|
9432
10178
|
};
|
|
@@ -9438,28 +10184,28 @@ var responsesRunAdapter = function(param) {
|
|
|
9438
10184
|
}
|
|
9439
10185
|
})
|
|
9440
10186
|
];
|
|
9441
|
-
case
|
|
10187
|
+
case 123:
|
|
9442
10188
|
return [
|
|
9443
10189
|
4,
|
|
9444
10190
|
onEvent2.apply(void 0, [
|
|
9445
|
-
(
|
|
9446
|
-
(
|
|
9447
|
-
]),
|
|
10191
|
+
(_tmp94.data = serializeItemAsMessage.apply(void 0, [
|
|
10192
|
+
(_tmp95.openaiAssistant = _state.sent(), _tmp95.createdAt = (0, import_dayjs21.default)().unix(), _tmp95.runId = responseCreatedResponse.id, _tmp95)
|
|
10193
|
+
]), _tmp94)
|
|
9448
10194
|
])
|
|
9449
10195
|
];
|
|
9450
|
-
case
|
|
10196
|
+
case 124:
|
|
9451
10197
|
_state.sent();
|
|
9452
|
-
_state.label =
|
|
9453
|
-
case
|
|
10198
|
+
_state.label = 125;
|
|
10199
|
+
case 125:
|
|
9454
10200
|
return [
|
|
9455
10201
|
3,
|
|
9456
|
-
|
|
10202
|
+
137
|
|
9457
10203
|
];
|
|
9458
|
-
case
|
|
10204
|
+
case 126:
|
|
9459
10205
|
toolCall = toolCalls[event.item_id];
|
|
9460
10206
|
if (!toolCall) return [
|
|
9461
10207
|
3,
|
|
9462
|
-
|
|
10208
|
+
137
|
|
9463
10209
|
];
|
|
9464
10210
|
return [
|
|
9465
10211
|
4,
|
|
@@ -9488,17 +10234,17 @@ var responsesRunAdapter = function(param) {
|
|
|
9488
10234
|
}
|
|
9489
10235
|
})
|
|
9490
10236
|
];
|
|
9491
|
-
case
|
|
10237
|
+
case 127:
|
|
9492
10238
|
_state.sent();
|
|
9493
10239
|
return [
|
|
9494
10240
|
3,
|
|
9495
|
-
|
|
10241
|
+
137
|
|
9496
10242
|
];
|
|
9497
|
-
case
|
|
10243
|
+
case 128:
|
|
9498
10244
|
mcpCall = mcpCalls[event.item_id];
|
|
9499
10245
|
if (!mcpCall) return [
|
|
9500
10246
|
3,
|
|
9501
|
-
|
|
10247
|
+
137
|
|
9502
10248
|
];
|
|
9503
10249
|
return [
|
|
9504
10250
|
4,
|
|
@@ -9527,17 +10273,17 @@ var responsesRunAdapter = function(param) {
|
|
|
9527
10273
|
}
|
|
9528
10274
|
})
|
|
9529
10275
|
];
|
|
9530
|
-
case
|
|
10276
|
+
case 129:
|
|
9531
10277
|
_state.sent();
|
|
9532
10278
|
return [
|
|
9533
10279
|
3,
|
|
9534
|
-
|
|
10280
|
+
137
|
|
9535
10281
|
];
|
|
9536
|
-
case
|
|
9537
|
-
|
|
10282
|
+
case 130:
|
|
10283
|
+
_tmp96 = {
|
|
9538
10284
|
event: "thread.message.in_progress"
|
|
9539
10285
|
};
|
|
9540
|
-
|
|
10286
|
+
_tmp97 = {
|
|
9541
10287
|
id: event.item_id,
|
|
9542
10288
|
object: "thread.message",
|
|
9543
10289
|
created_at: (0, import_dayjs21.default)().unix(),
|
|
@@ -9556,26 +10302,26 @@ var responsesRunAdapter = function(param) {
|
|
|
9556
10302
|
}
|
|
9557
10303
|
})
|
|
9558
10304
|
];
|
|
9559
|
-
case
|
|
10305
|
+
case 131:
|
|
9560
10306
|
return [
|
|
9561
10307
|
4,
|
|
9562
10308
|
onEvent2.apply(void 0, [
|
|
9563
|
-
(
|
|
10309
|
+
(_tmp96.data = (_tmp97.assistant_id = _state.sent().id, _tmp97.run_id = responseCreatedResponse.id, _tmp97.attachments = [], _tmp97.status = "in_progress", _tmp97.metadata = {
|
|
9564
10310
|
event: JSON.stringify(event)
|
|
9565
|
-
},
|
|
10311
|
+
}, _tmp97), _tmp96)
|
|
9566
10312
|
])
|
|
9567
10313
|
];
|
|
9568
|
-
case
|
|
10314
|
+
case 132:
|
|
9569
10315
|
_state.sent();
|
|
9570
10316
|
return [
|
|
9571
10317
|
3,
|
|
9572
|
-
|
|
10318
|
+
137
|
|
9573
10319
|
];
|
|
9574
|
-
case
|
|
9575
|
-
|
|
10320
|
+
case 133:
|
|
10321
|
+
_tmp98 = {
|
|
9576
10322
|
event: "thread.message.in_progress"
|
|
9577
10323
|
};
|
|
9578
|
-
|
|
10324
|
+
_tmp99 = {
|
|
9579
10325
|
id: event.item_id,
|
|
9580
10326
|
object: "thread.message",
|
|
9581
10327
|
created_at: (0, import_dayjs21.default)().unix(),
|
|
@@ -9603,93 +10349,154 @@ var responsesRunAdapter = function(param) {
|
|
|
9603
10349
|
}
|
|
9604
10350
|
})
|
|
9605
10351
|
];
|
|
9606
|
-
case
|
|
10352
|
+
case 134:
|
|
9607
10353
|
return [
|
|
9608
10354
|
4,
|
|
9609
10355
|
onEvent2.apply(void 0, [
|
|
9610
|
-
(
|
|
10356
|
+
(_tmp98.data = (_tmp99.assistant_id = _state.sent().id, _tmp99.run_id = responseCreatedResponse.id, _tmp99.attachments = [], _tmp99.status = "in_progress", _tmp99.metadata = {
|
|
9611
10357
|
event: JSON.stringify(_object_spread_props(_object_spread({}, event), {
|
|
9612
10358
|
partial_image_b64: "truncated"
|
|
9613
10359
|
}))
|
|
9614
|
-
},
|
|
10360
|
+
}, _tmp99), _tmp98)
|
|
9615
10361
|
])
|
|
9616
10362
|
];
|
|
9617
|
-
case
|
|
10363
|
+
case 135:
|
|
9618
10364
|
_state.sent();
|
|
9619
10365
|
return [
|
|
9620
10366
|
3,
|
|
9621
|
-
|
|
10367
|
+
137
|
|
9622
10368
|
];
|
|
9623
|
-
case
|
|
10369
|
+
case 136:
|
|
9624
10370
|
return [
|
|
9625
10371
|
3,
|
|
9626
|
-
|
|
10372
|
+
137
|
|
9627
10373
|
];
|
|
9628
|
-
case
|
|
10374
|
+
case 137:
|
|
9629
10375
|
_iteratorAbruptCompletion = false;
|
|
9630
10376
|
return [
|
|
9631
10377
|
3,
|
|
9632
10378
|
3
|
|
9633
10379
|
];
|
|
9634
|
-
case
|
|
10380
|
+
case 138:
|
|
9635
10381
|
return [
|
|
9636
10382
|
3,
|
|
9637
|
-
|
|
10383
|
+
145
|
|
9638
10384
|
];
|
|
9639
|
-
case
|
|
10385
|
+
case 139:
|
|
9640
10386
|
err = _state.sent();
|
|
9641
10387
|
_didIteratorError = true;
|
|
9642
10388
|
_iteratorError = err;
|
|
9643
10389
|
return [
|
|
9644
10390
|
3,
|
|
9645
|
-
|
|
10391
|
+
145
|
|
9646
10392
|
];
|
|
9647
|
-
case
|
|
10393
|
+
case 140:
|
|
9648
10394
|
_state.trys.push([
|
|
9649
|
-
|
|
10395
|
+
140,
|
|
9650
10396
|
,
|
|
9651
|
-
|
|
9652
|
-
|
|
10397
|
+
143,
|
|
10398
|
+
144
|
|
9653
10399
|
]);
|
|
9654
10400
|
if (!(_iteratorAbruptCompletion && _iterator.return != null)) return [
|
|
9655
10401
|
3,
|
|
9656
|
-
|
|
10402
|
+
142
|
|
9657
10403
|
];
|
|
9658
10404
|
return [
|
|
9659
10405
|
4,
|
|
9660
10406
|
_iterator.return()
|
|
9661
10407
|
];
|
|
9662
|
-
case
|
|
10408
|
+
case 141:
|
|
9663
10409
|
_state.sent();
|
|
9664
|
-
_state.label =
|
|
9665
|
-
case
|
|
10410
|
+
_state.label = 142;
|
|
10411
|
+
case 142:
|
|
9666
10412
|
return [
|
|
9667
10413
|
3,
|
|
9668
|
-
|
|
10414
|
+
144
|
|
9669
10415
|
];
|
|
9670
|
-
case
|
|
10416
|
+
case 143:
|
|
9671
10417
|
if (_didIteratorError) {
|
|
9672
10418
|
throw _iteratorError;
|
|
9673
10419
|
}
|
|
9674
10420
|
return [
|
|
9675
10421
|
7
|
|
9676
10422
|
];
|
|
9677
|
-
case
|
|
10423
|
+
case 144:
|
|
9678
10424
|
return [
|
|
9679
10425
|
7
|
|
9680
10426
|
];
|
|
9681
|
-
case
|
|
10427
|
+
case 145:
|
|
10428
|
+
if (!responseCompletedResponse) return [
|
|
10429
|
+
3,
|
|
10430
|
+
150
|
|
10431
|
+
];
|
|
10432
|
+
toolCalls2 = ((_responseCompletedResponse_output = responseCompletedResponse.output) !== null && _responseCompletedResponse_output !== void 0 ? _responseCompletedResponse_output : []).filter(function(o) {
|
|
10433
|
+
return o.type === "function_call" || o.type === "computer_call";
|
|
10434
|
+
});
|
|
10435
|
+
_tmp100 = {
|
|
10436
|
+
response: responseCompletedResponse
|
|
10437
|
+
};
|
|
9682
10438
|
return [
|
|
10439
|
+
4,
|
|
10440
|
+
getOpenaiAssistant({
|
|
10441
|
+
select: {
|
|
10442
|
+
id: true
|
|
10443
|
+
}
|
|
10444
|
+
})
|
|
10445
|
+
];
|
|
10446
|
+
case 146:
|
|
10447
|
+
serializedRun = serializeResponseAsRun.apply(void 0, [
|
|
10448
|
+
(_tmp100.assistantId = _state.sent().id, _tmp100)
|
|
10449
|
+
]);
|
|
10450
|
+
if (!(toolCalls2.length > 0)) return [
|
|
9683
10451
|
3,
|
|
9684
|
-
|
|
10452
|
+
148
|
|
9685
10453
|
];
|
|
9686
|
-
|
|
10454
|
+
return [
|
|
10455
|
+
4,
|
|
10456
|
+
onEvent2({
|
|
10457
|
+
event: "thread.run.requires_action",
|
|
10458
|
+
data: _object_spread_props(_object_spread({}, serializedRun), {
|
|
10459
|
+
status: "requires_action",
|
|
10460
|
+
required_action: {
|
|
10461
|
+
type: "submit_tool_outputs",
|
|
10462
|
+
submit_tool_outputs: {
|
|
10463
|
+
tool_calls: serializeToolCalls2({
|
|
10464
|
+
toolCalls: toolCalls2
|
|
10465
|
+
})
|
|
10466
|
+
}
|
|
10467
|
+
}
|
|
10468
|
+
})
|
|
10469
|
+
})
|
|
10470
|
+
];
|
|
10471
|
+
case 147:
|
|
10472
|
+
_state.sent();
|
|
10473
|
+
return [
|
|
10474
|
+
3,
|
|
10475
|
+
150
|
|
10476
|
+
];
|
|
10477
|
+
case 148:
|
|
10478
|
+
return [
|
|
10479
|
+
4,
|
|
10480
|
+
onEvent2({
|
|
10481
|
+
event: "thread.run.completed",
|
|
10482
|
+
data: serializedRun
|
|
10483
|
+
})
|
|
10484
|
+
];
|
|
10485
|
+
case 149:
|
|
10486
|
+
_state.sent();
|
|
10487
|
+
_state.label = 150;
|
|
10488
|
+
case 150:
|
|
10489
|
+
return [
|
|
10490
|
+
3,
|
|
10491
|
+
155
|
|
10492
|
+
];
|
|
10493
|
+
case 151:
|
|
9687
10494
|
e = _state.sent();
|
|
9688
|
-
|
|
10495
|
+
_tmp101 = {
|
|
9689
10496
|
event: "thread.run.failed"
|
|
9690
10497
|
};
|
|
9691
|
-
|
|
9692
|
-
id: (responseCreatedResponse === null || responseCreatedResponse === void 0 ? void 0 : responseCreatedResponse.id) || "run_".concat((0,
|
|
10498
|
+
_tmp102 = {
|
|
10499
|
+
id: (responseCreatedResponse === null || responseCreatedResponse === void 0 ? void 0 : responseCreatedResponse.id) || "run_".concat((0, import_radash23.uid)(18)),
|
|
9693
10500
|
object: "thread.run",
|
|
9694
10501
|
thread_id: threadId
|
|
9695
10502
|
};
|
|
@@ -9701,23 +10508,23 @@ var responsesRunAdapter = function(param) {
|
|
|
9701
10508
|
}
|
|
9702
10509
|
})
|
|
9703
10510
|
];
|
|
9704
|
-
case
|
|
10511
|
+
case 152:
|
|
9705
10512
|
return [
|
|
9706
10513
|
4,
|
|
9707
10514
|
onEvent2.apply(void 0, [
|
|
9708
|
-
(
|
|
10515
|
+
(_tmp101.data = (_tmp102.assistant_id = _state.sent().id, _tmp102.status = "failed", _tmp102.failed_at = (0, import_dayjs21.default)().unix(), _tmp102.last_error = {
|
|
9709
10516
|
code: "server_error",
|
|
9710
10517
|
message: String((e === null || e === void 0 ? void 0 : e.message) || e || "Unknown error")
|
|
9711
|
-
},
|
|
10518
|
+
}, _tmp102), _tmp101)
|
|
9712
10519
|
])
|
|
9713
10520
|
];
|
|
9714
|
-
case
|
|
10521
|
+
case 153:
|
|
9715
10522
|
_state.sent();
|
|
9716
10523
|
return [
|
|
9717
10524
|
3,
|
|
9718
|
-
|
|
10525
|
+
155
|
|
9719
10526
|
];
|
|
9720
|
-
case
|
|
10527
|
+
case 154:
|
|
9721
10528
|
waitUntil(new Promise(/*#__PURE__*/ function() {
|
|
9722
10529
|
var _ref = _async_to_generator(function(resolve) {
|
|
9723
10530
|
return _ts_generator(this, function(_state) {
|
|
@@ -9754,7 +10561,7 @@ var responsesRunAdapter = function(param) {
|
|
|
9754
10561
|
return [
|
|
9755
10562
|
7
|
|
9756
10563
|
];
|
|
9757
|
-
case
|
|
10564
|
+
case 155:
|
|
9758
10565
|
return [
|
|
9759
10566
|
2
|
|
9760
10567
|
];
|