supercompat 3.15.6 → 3.16.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 +1160 -115
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +15 -1
- package/dist/index.d.ts +15 -1
- package/dist/index.js +1136 -95
- package/dist/index.js.map +1 -1
- package/dist/supercompat.cjs +0 -9
- package/dist/supercompat.cjs.map +1 -1
- package/dist/supercompat.js +0 -9
- package/dist/supercompat.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -372,18 +372,13 @@ var requestHandlers = function(param) {
|
|
|
372
372
|
var findRequestHandler = function(param) {
|
|
373
373
|
var url = param.url, requestHandlers2 = param.requestHandlers;
|
|
374
374
|
var pathname = new URL(url).pathname;
|
|
375
|
-
console.log("[findRequestHandler] Looking for handler for pathname:", pathname);
|
|
376
|
-
console.log("[findRequestHandler] Available patterns:", Object.keys(requestHandlers2));
|
|
377
375
|
for(var key in requestHandlers2){
|
|
378
376
|
var regex = new RegExp(key);
|
|
379
377
|
var matches = regex.test(pathname);
|
|
380
|
-
console.log("[findRequestHandler] Testing pattern:", key, "- Matches:", matches);
|
|
381
378
|
if (matches) {
|
|
382
|
-
console.log("[findRequestHandler] Found handler!");
|
|
383
379
|
return requestHandlers2[key];
|
|
384
380
|
}
|
|
385
381
|
}
|
|
386
|
-
console.log("[findRequestHandler] No handler found for pathname:", pathname);
|
|
387
382
|
};
|
|
388
383
|
// src/supercompatFetch/originalFetch.ts
|
|
389
384
|
var originalFetch = function(param) {
|
|
@@ -446,13 +441,11 @@ var supercompatFetch = function(param) {
|
|
|
446
441
|
var _ref, _args, url, options, pathHandler, method, requestHandler;
|
|
447
442
|
return _ts_generator(this, function(_state) {
|
|
448
443
|
_args = _sliced_to_array(args, 2), url = _args[0], options = _args[1];
|
|
449
|
-
console.log("[supercompatFetch] Request:", (options === null || options === void 0 ? void 0 : options.method) || "GET", url);
|
|
450
444
|
pathHandler = findRequestHandler({
|
|
451
445
|
url: url,
|
|
452
446
|
requestHandlers: requestHandlers2
|
|
453
447
|
});
|
|
454
448
|
if (!pathHandler) {
|
|
455
|
-
console.log("[supercompatFetch] No handler found, using originalFetch");
|
|
456
449
|
return [
|
|
457
450
|
2,
|
|
458
451
|
originalFetch({
|
|
@@ -464,7 +457,6 @@ var supercompatFetch = function(param) {
|
|
|
464
457
|
method = (_ref = options === null || options === void 0 ? void 0 : options.method) !== null && _ref !== void 0 ? _ref : "";
|
|
465
458
|
requestHandler = pathHandler[method.toLowerCase()];
|
|
466
459
|
if (!requestHandler) {
|
|
467
|
-
console.log("[supercompatFetch] Handler found but no method handler, using originalFetch");
|
|
468
460
|
return [
|
|
469
461
|
2,
|
|
470
462
|
originalFetch({
|
|
@@ -473,7 +465,6 @@ var supercompatFetch = function(param) {
|
|
|
473
465
|
})
|
|
474
466
|
];
|
|
475
467
|
}
|
|
476
|
-
console.log("[supercompatFetch] Handler found, calling it");
|
|
477
468
|
return [
|
|
478
469
|
2,
|
|
479
470
|
requestHandler.apply(void 0, _to_consumable_array(args))
|
|
@@ -1085,7 +1076,7 @@ var get3 = function(param) {
|
|
|
1085
1076
|
var azureAiProject = param.azureAiProject;
|
|
1086
1077
|
return function(_url, _options) {
|
|
1087
1078
|
return _async_to_generator(function() {
|
|
1088
|
-
var
|
|
1079
|
+
var models14, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, deployment, err, error;
|
|
1089
1080
|
return _ts_generator(this, function(_state) {
|
|
1090
1081
|
switch(_state.label){
|
|
1091
1082
|
case 0:
|
|
@@ -1095,7 +1086,7 @@ var get3 = function(param) {
|
|
|
1095
1086
|
,
|
|
1096
1087
|
14
|
|
1097
1088
|
]);
|
|
1098
|
-
|
|
1089
|
+
models14 = [];
|
|
1099
1090
|
_iteratorAbruptCompletion = false, _didIteratorError = false;
|
|
1100
1091
|
_state.label = 1;
|
|
1101
1092
|
case 1:
|
|
@@ -1120,7 +1111,7 @@ var get3 = function(param) {
|
|
|
1120
1111
|
_value = _step.value;
|
|
1121
1112
|
deployment = _value;
|
|
1122
1113
|
if (deployment.type === "ModelDeployment" && "modelName" in deployment && "modelPublisher" in deployment) {
|
|
1123
|
-
|
|
1114
|
+
models14.push({
|
|
1124
1115
|
id: deployment.modelName,
|
|
1125
1116
|
object: "model",
|
|
1126
1117
|
created: Date.now(),
|
|
@@ -1186,7 +1177,7 @@ var get3 = function(param) {
|
|
|
1186
1177
|
2,
|
|
1187
1178
|
new Response(JSON.stringify({
|
|
1188
1179
|
object: "list",
|
|
1189
|
-
data:
|
|
1180
|
+
data: models14
|
|
1190
1181
|
}), {
|
|
1191
1182
|
status: 200,
|
|
1192
1183
|
headers: {
|
|
@@ -2549,7 +2540,7 @@ var post5 = function(param) {
|
|
|
2549
2540
|
stream = new ReadableStream({
|
|
2550
2541
|
start: function start(controller) {
|
|
2551
2542
|
return _async_to_generator(function() {
|
|
2552
|
-
var blockIndexToToolUseId, toolUseIdToIndex, toolUseIdArgumentBuffer, computerToolUseIds, normalizedComputerCalls, nextToolCallIndex,
|
|
2543
|
+
var blockIndexToToolUseId, toolUseIdToIndex, toolUseIdArgumentBuffer, computerToolUseIds, normalizedComputerCalls, nextToolCallIndex, parseJson3, getOrCreateIndexForToolUseId, assignBlockToToolUse, markComputerToolUse, getToolUseIdFromBlock, emitNormalizedToolCall, getOrCreateIndexForBlock, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, chunk, toolUseId, _toolUseIdArgumentBuffer_get, buffered, parsed, normalized, toolCallIndex, chunkIndex, _toolUseIdArgumentBuffer_get1, buffered1, toolCallIndex1, chunkIndex1, messageDelta, delta, toolUseId1, _toolUseIdArgumentBuffer_get2, _chunk_delta_partial_json, existing, updated, parsed1, normalized1, toolCallIndex2, chunkIndex2, _toolUseIdArgumentBuffer_get3, _chunk_delta_partial_json1, existing1, index, messageDelta1, delta1, toolName, normalizedToolName, index1, index2, _chunk_content_block_content, _getToolUseIdFromBlock, outputPayload, toolCallId, index3, _getToolUseIdFromBlock1, _chunk_content_block_content1, toolCallId1, _chunk_content_block, _toolUseId, _type, _id, rest, index4, outputPayload1, messageDelta2, messageDelta3, err;
|
|
2553
2544
|
return _ts_generator(this, function(_state) {
|
|
2554
2545
|
switch(_state.label){
|
|
2555
2546
|
case 0:
|
|
@@ -2559,7 +2550,7 @@ var post5 = function(param) {
|
|
|
2559
2550
|
computerToolUseIds = /* @__PURE__ */ new Set();
|
|
2560
2551
|
normalizedComputerCalls = /* @__PURE__ */ new Set();
|
|
2561
2552
|
nextToolCallIndex = 0;
|
|
2562
|
-
|
|
2553
|
+
parseJson3 = function(value) {
|
|
2563
2554
|
try {
|
|
2564
2555
|
return JSON.parse(value);
|
|
2565
2556
|
} catch (unused) {
|
|
@@ -2656,7 +2647,7 @@ var post5 = function(param) {
|
|
|
2656
2647
|
if (toolUseId && computerToolUseIds.has(toolUseId) && !normalizedComputerCalls.has(toolUseId)) {
|
|
2657
2648
|
;
|
|
2658
2649
|
buffered = (_toolUseIdArgumentBuffer_get = toolUseIdArgumentBuffer.get(toolUseId)) !== null && _toolUseIdArgumentBuffer_get !== void 0 ? _toolUseIdArgumentBuffer_get : "";
|
|
2659
|
-
parsed = buffered ?
|
|
2650
|
+
parsed = buffered ? parseJson3(buffered) : void 0;
|
|
2660
2651
|
if (parsed !== void 0) {
|
|
2661
2652
|
normalized = normalizeComputerToolCallPayload(parsed);
|
|
2662
2653
|
toolCallIndex = getOrCreateIndexForToolUseId(toolUseId);
|
|
@@ -2721,7 +2712,7 @@ var post5 = function(param) {
|
|
|
2721
2712
|
updated = "".concat(existing).concat((_chunk_delta_partial_json = chunk.delta.partial_json) !== null && _chunk_delta_partial_json !== void 0 ? _chunk_delta_partial_json : "");
|
|
2722
2713
|
toolUseIdArgumentBuffer.set(toolUseId1, updated);
|
|
2723
2714
|
if (!normalizedComputerCalls.has(toolUseId1)) {
|
|
2724
|
-
parsed1 =
|
|
2715
|
+
parsed1 = parseJson3(updated);
|
|
2725
2716
|
if (parsed1 !== void 0) {
|
|
2726
2717
|
normalized1 = normalizeComputerToolCallPayload(parsed1);
|
|
2727
2718
|
toolCallIndex2 = getOrCreateIndexForToolUseId(toolUseId1);
|
|
@@ -4067,6 +4058,1069 @@ var ollamaClientAdapter = function(param) {
|
|
|
4067
4058
|
}
|
|
4068
4059
|
};
|
|
4069
4060
|
};
|
|
4061
|
+
// src/adapters/client/openRouterClientAdapter/models/get.ts
|
|
4062
|
+
var get11 = function(param) {
|
|
4063
|
+
var openRouter = param.openRouter;
|
|
4064
|
+
return function(_url, _options) {
|
|
4065
|
+
return _async_to_generator(function() {
|
|
4066
|
+
var data, error;
|
|
4067
|
+
return _ts_generator(this, function(_state) {
|
|
4068
|
+
switch(_state.label){
|
|
4069
|
+
case 0:
|
|
4070
|
+
_state.trys.push([
|
|
4071
|
+
0,
|
|
4072
|
+
2,
|
|
4073
|
+
,
|
|
4074
|
+
3
|
|
4075
|
+
]);
|
|
4076
|
+
return [
|
|
4077
|
+
4,
|
|
4078
|
+
openRouter.models.list()
|
|
4079
|
+
];
|
|
4080
|
+
case 1:
|
|
4081
|
+
data = _state.sent();
|
|
4082
|
+
return [
|
|
4083
|
+
2,
|
|
4084
|
+
new Response(JSON.stringify(data), {
|
|
4085
|
+
status: 200,
|
|
4086
|
+
headers: {
|
|
4087
|
+
"Content-Type": "application/json"
|
|
4088
|
+
}
|
|
4089
|
+
})
|
|
4090
|
+
];
|
|
4091
|
+
case 2:
|
|
4092
|
+
error = _state.sent();
|
|
4093
|
+
return [
|
|
4094
|
+
2,
|
|
4095
|
+
new Response(JSON.stringify({
|
|
4096
|
+
error: error
|
|
4097
|
+
}), {
|
|
4098
|
+
status: 500,
|
|
4099
|
+
headers: {
|
|
4100
|
+
"Content-Type": "application/json"
|
|
4101
|
+
}
|
|
4102
|
+
})
|
|
4103
|
+
];
|
|
4104
|
+
case 3:
|
|
4105
|
+
return [
|
|
4106
|
+
2
|
|
4107
|
+
];
|
|
4108
|
+
}
|
|
4109
|
+
});
|
|
4110
|
+
})();
|
|
4111
|
+
};
|
|
4112
|
+
};
|
|
4113
|
+
// src/adapters/client/openRouterClientAdapter/models/index.ts
|
|
4114
|
+
var models13 = function(param) {
|
|
4115
|
+
var openRouter = param.openRouter;
|
|
4116
|
+
return {
|
|
4117
|
+
get: get11({
|
|
4118
|
+
openRouter: openRouter
|
|
4119
|
+
})
|
|
4120
|
+
};
|
|
4121
|
+
};
|
|
4122
|
+
// src/adapters/client/openRouterClientAdapter/completions/normalizeComputerCall.ts
|
|
4123
|
+
var MODEL_QUIRKS = {
|
|
4124
|
+
"z-ai/glm-4.6v": {
|
|
4125
|
+
normalizedCoords: true,
|
|
4126
|
+
cleanArtifacts: true
|
|
4127
|
+
},
|
|
4128
|
+
"qwen/": {
|
|
4129
|
+
fuzzyFallback: true
|
|
4130
|
+
}
|
|
4131
|
+
};
|
|
4132
|
+
var getQuirks = function(model) {
|
|
4133
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
4134
|
+
try {
|
|
4135
|
+
for(var _iterator = Object.entries(MODEL_QUIRKS)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
4136
|
+
var _step_value = _sliced_to_array(_step.value, 2), prefix = _step_value[0], quirks = _step_value[1];
|
|
4137
|
+
if (model.startsWith(prefix)) return quirks;
|
|
4138
|
+
}
|
|
4139
|
+
} catch (err) {
|
|
4140
|
+
_didIteratorError = true;
|
|
4141
|
+
_iteratorError = err;
|
|
4142
|
+
} finally{
|
|
4143
|
+
try {
|
|
4144
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
4145
|
+
_iterator.return();
|
|
4146
|
+
}
|
|
4147
|
+
} finally{
|
|
4148
|
+
if (_didIteratorError) {
|
|
4149
|
+
throw _iteratorError;
|
|
4150
|
+
}
|
|
4151
|
+
}
|
|
4152
|
+
}
|
|
4153
|
+
return {};
|
|
4154
|
+
};
|
|
4155
|
+
var cleanTextArtifacts = function(text) {
|
|
4156
|
+
return text.replace(/<\|begin_of_box\|>/g, "").replace(/<\|end_of_box\|>/g, "").replace(/<arg_key>[^<]*<\/arg_key>/g, "").replace(/<\/arg_value>/g, "").trim();
|
|
4157
|
+
};
|
|
4158
|
+
var KNOWN_ACTION_TYPES = [
|
|
4159
|
+
"double_click",
|
|
4160
|
+
"screenshot",
|
|
4161
|
+
"keypress",
|
|
4162
|
+
"scroll",
|
|
4163
|
+
"click",
|
|
4164
|
+
"move",
|
|
4165
|
+
"type",
|
|
4166
|
+
"drag",
|
|
4167
|
+
"wait"
|
|
4168
|
+
];
|
|
4169
|
+
var splitCoordDigits = function(numStr) {
|
|
4170
|
+
for(var i = 1; i < numStr.length; i++){
|
|
4171
|
+
var x = parseInt(numStr.slice(0, i));
|
|
4172
|
+
var y = parseInt(numStr.slice(i));
|
|
4173
|
+
if (x >= 0 && x <= 1e3 && y >= 0 && y <= 1e3) {
|
|
4174
|
+
return {
|
|
4175
|
+
x: x,
|
|
4176
|
+
y: y
|
|
4177
|
+
};
|
|
4178
|
+
}
|
|
4179
|
+
}
|
|
4180
|
+
return null;
|
|
4181
|
+
};
|
|
4182
|
+
var cleanGlmAction = function(action) {
|
|
4183
|
+
var typeVal = action.type;
|
|
4184
|
+
if (typeof typeVal !== "string") return action;
|
|
4185
|
+
var argValueMatch = typeVal.match(/<arg_value>\s*(\{[\s\S]*\})\s*$/);
|
|
4186
|
+
if (argValueMatch) {
|
|
4187
|
+
var inner = parseJson2(argValueMatch[1]);
|
|
4188
|
+
if (inner && (typeof inner === "undefined" ? "undefined" : _type_of(inner)) === "object") {
|
|
4189
|
+
return inner;
|
|
4190
|
+
}
|
|
4191
|
+
}
|
|
4192
|
+
var cleanedType = typeVal.replace(/<\/?[^>]+>/g, "").replace(/\n/g, "").trim();
|
|
4193
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
4194
|
+
try {
|
|
4195
|
+
for(var _iterator = KNOWN_ACTION_TYPES[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
4196
|
+
var actionType = _step.value;
|
|
4197
|
+
if (cleanedType.startsWith(actionType) && cleanedType !== actionType) {
|
|
4198
|
+
var rest = cleanedType.slice(actionType.length);
|
|
4199
|
+
var nums = rest.match(/\d+/g);
|
|
4200
|
+
if (nums && nums.length >= 2) {
|
|
4201
|
+
return _object_spread_props(_object_spread({}, action), {
|
|
4202
|
+
type: actionType,
|
|
4203
|
+
x: parseInt(nums[0]),
|
|
4204
|
+
y: parseInt(nums[1])
|
|
4205
|
+
});
|
|
4206
|
+
}
|
|
4207
|
+
if (nums && nums.length === 1 && nums[0].length >= 2) {
|
|
4208
|
+
var coords = splitCoordDigits(nums[0]);
|
|
4209
|
+
if (coords) {
|
|
4210
|
+
return _object_spread(_object_spread_props(_object_spread({}, action), {
|
|
4211
|
+
type: actionType
|
|
4212
|
+
}), coords);
|
|
4213
|
+
}
|
|
4214
|
+
}
|
|
4215
|
+
return _object_spread_props(_object_spread({}, action), {
|
|
4216
|
+
type: actionType
|
|
4217
|
+
});
|
|
4218
|
+
}
|
|
4219
|
+
}
|
|
4220
|
+
} catch (err) {
|
|
4221
|
+
_didIteratorError = true;
|
|
4222
|
+
_iteratorError = err;
|
|
4223
|
+
} finally{
|
|
4224
|
+
try {
|
|
4225
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
4226
|
+
_iterator.return();
|
|
4227
|
+
}
|
|
4228
|
+
} finally{
|
|
4229
|
+
if (_didIteratorError) {
|
|
4230
|
+
throw _iteratorError;
|
|
4231
|
+
}
|
|
4232
|
+
}
|
|
4233
|
+
}
|
|
4234
|
+
if (cleanedType === typeVal) return action;
|
|
4235
|
+
return _object_spread_props(_object_spread({}, action), {
|
|
4236
|
+
type: cleanedType
|
|
4237
|
+
});
|
|
4238
|
+
};
|
|
4239
|
+
var cleanGlmFields = function(action) {
|
|
4240
|
+
var result = _object_spread({}, action);
|
|
4241
|
+
if (typeof result.x === "string") {
|
|
4242
|
+
var nums = result.x.match(/\d+/g);
|
|
4243
|
+
if (nums && nums.length >= 2) {
|
|
4244
|
+
result.x = parseInt(nums[0]);
|
|
4245
|
+
if (result.y === void 0 || typeof result.y === "string") {
|
|
4246
|
+
result.y = parseInt(nums[1]);
|
|
4247
|
+
}
|
|
4248
|
+
} else if (nums && nums.length === 1) {
|
|
4249
|
+
result.x = parseInt(nums[0]);
|
|
4250
|
+
}
|
|
4251
|
+
}
|
|
4252
|
+
if (typeof result.y === "string") {
|
|
4253
|
+
var nums1 = result.y.match(/\d+/g);
|
|
4254
|
+
if (nums1 && nums1.length >= 1) {
|
|
4255
|
+
result.y = parseInt(nums1[0]);
|
|
4256
|
+
}
|
|
4257
|
+
}
|
|
4258
|
+
for(var _i = 0, _iter = [
|
|
4259
|
+
"scroll_x",
|
|
4260
|
+
"scroll_y"
|
|
4261
|
+
]; _i < _iter.length; _i++){
|
|
4262
|
+
var key = _iter[_i];
|
|
4263
|
+
if (typeof result[key] === "string") {
|
|
4264
|
+
var nums2 = result[key].match(/\d+/g);
|
|
4265
|
+
if (nums2) result[key] = parseInt(nums2[0]);
|
|
4266
|
+
}
|
|
4267
|
+
}
|
|
4268
|
+
if (typeof result.type === "string") {
|
|
4269
|
+
result.type = result.type.replace(/<[^>]*>/g, "").replace(/^\{|\}$/g, "").replace(/\n/g, "").trim();
|
|
4270
|
+
}
|
|
4271
|
+
return result;
|
|
4272
|
+
};
|
|
4273
|
+
var applyArtifactCleanup = function(action) {
|
|
4274
|
+
return cleanGlmFields(cleanGlmAction(action));
|
|
4275
|
+
};
|
|
4276
|
+
var parseJson2 = function(text) {
|
|
4277
|
+
try {
|
|
4278
|
+
return JSON.parse(text);
|
|
4279
|
+
} catch (unused) {
|
|
4280
|
+
return void 0;
|
|
4281
|
+
}
|
|
4282
|
+
};
|
|
4283
|
+
var extractJson = function(text) {
|
|
4284
|
+
var direct = parseJson2(text);
|
|
4285
|
+
if (direct) return direct;
|
|
4286
|
+
var codeBlockMatch = text.match(/```(?:json)?\s*([\s\S]*?)```/);
|
|
4287
|
+
if (codeBlockMatch) {
|
|
4288
|
+
var parsed = parseJson2(codeBlockMatch[1].trim());
|
|
4289
|
+
if (parsed) return parsed;
|
|
4290
|
+
}
|
|
4291
|
+
var jsonMatch = text.match(/(\{[\s\S]*\})\s*$/);
|
|
4292
|
+
if (jsonMatch) {
|
|
4293
|
+
var parsed1 = parseJson2(jsonMatch[1].trim());
|
|
4294
|
+
if (parsed1) return parsed1;
|
|
4295
|
+
}
|
|
4296
|
+
return void 0;
|
|
4297
|
+
};
|
|
4298
|
+
var fuzzyExtractJson = function(text) {
|
|
4299
|
+
var clickMatch = text.match(/"action"\s*:\s*"click"\s*,\s*"x"\s*:\s*\[?\s*(\d+)\s*,\s*(\d+)/);
|
|
4300
|
+
if (clickMatch) {
|
|
4301
|
+
return {
|
|
4302
|
+
action: {
|
|
4303
|
+
type: "click",
|
|
4304
|
+
x: parseInt(clickMatch[1]),
|
|
4305
|
+
y: parseInt(clickMatch[2])
|
|
4306
|
+
}
|
|
4307
|
+
};
|
|
4308
|
+
}
|
|
4309
|
+
var actionTypeMatch = text.match(/"type"\s*:\s*"(\w+)"/);
|
|
4310
|
+
if (actionTypeMatch) {
|
|
4311
|
+
var result = {
|
|
4312
|
+
type: actionTypeMatch[1]
|
|
4313
|
+
};
|
|
4314
|
+
var xMatch = text.match(/"x"\s*:\s*\[?\s*(\d+)/);
|
|
4315
|
+
var yMatch = text.match(/"y"\s*:\s*(\d+)/);
|
|
4316
|
+
if (xMatch) result.x = parseInt(xMatch[1]);
|
|
4317
|
+
if (yMatch) {
|
|
4318
|
+
result.y = parseInt(yMatch[1]);
|
|
4319
|
+
} else if (xMatch) {
|
|
4320
|
+
var _xMatch_index;
|
|
4321
|
+
var afterX = text.slice(((_xMatch_index = xMatch.index) !== null && _xMatch_index !== void 0 ? _xMatch_index : 0) + xMatch[0].length);
|
|
4322
|
+
var nextNum = afterX.match(/\s*,?\s*(\d+)/);
|
|
4323
|
+
if (nextNum) result.y = parseInt(nextNum[1]);
|
|
4324
|
+
}
|
|
4325
|
+
var textMatch = text.match(/"text"\s*:\s*"([^"]*)"/);
|
|
4326
|
+
if (textMatch) result.text = textMatch[1];
|
|
4327
|
+
return {
|
|
4328
|
+
action: result
|
|
4329
|
+
};
|
|
4330
|
+
}
|
|
4331
|
+
return void 0;
|
|
4332
|
+
};
|
|
4333
|
+
var denormalize = function(value, dimension) {
|
|
4334
|
+
return Math.round(value / 1e3 * dimension);
|
|
4335
|
+
};
|
|
4336
|
+
var denormalizeAction = function(action, displayWidth, displayHeight) {
|
|
4337
|
+
var result = _object_spread({}, action);
|
|
4338
|
+
if (typeof result.x === "number") {
|
|
4339
|
+
result.x = denormalize(result.x, displayWidth);
|
|
4340
|
+
}
|
|
4341
|
+
if (typeof result.y === "number") {
|
|
4342
|
+
result.y = denormalize(result.y, displayHeight);
|
|
4343
|
+
}
|
|
4344
|
+
if (Array.isArray(result.path)) {
|
|
4345
|
+
result.path = result.path.map(function(point) {
|
|
4346
|
+
if (point && (typeof point === "undefined" ? "undefined" : _type_of(point)) === "object") {
|
|
4347
|
+
return _object_spread({}, point, typeof point.x === "number" ? {
|
|
4348
|
+
x: denormalize(point.x, displayWidth)
|
|
4349
|
+
} : {}, typeof point.y === "number" ? {
|
|
4350
|
+
y: denormalize(point.y, displayHeight)
|
|
4351
|
+
} : {});
|
|
4352
|
+
}
|
|
4353
|
+
return point;
|
|
4354
|
+
});
|
|
4355
|
+
}
|
|
4356
|
+
return result;
|
|
4357
|
+
};
|
|
4358
|
+
var COORD_FIELDS = [
|
|
4359
|
+
"x",
|
|
4360
|
+
"y",
|
|
4361
|
+
"text",
|
|
4362
|
+
"keys",
|
|
4363
|
+
"button",
|
|
4364
|
+
"direction",
|
|
4365
|
+
"scroll_x",
|
|
4366
|
+
"scroll_y",
|
|
4367
|
+
"path"
|
|
4368
|
+
];
|
|
4369
|
+
var normalizeStructure = function(parsed, shouldCleanArtifacts) {
|
|
4370
|
+
var clean = shouldCleanArtifacts ? function(action) {
|
|
4371
|
+
return applyArtifactCleanup(action);
|
|
4372
|
+
} : function(action) {
|
|
4373
|
+
return action;
|
|
4374
|
+
};
|
|
4375
|
+
if (parsed.action && _type_of(parsed.action) === "object") {
|
|
4376
|
+
return _object_spread_props(_object_spread({}, parsed), {
|
|
4377
|
+
action: clean(parsed.action)
|
|
4378
|
+
});
|
|
4379
|
+
}
|
|
4380
|
+
if (typeof parsed.action === "string") {
|
|
4381
|
+
var actionObj = {
|
|
4382
|
+
type: parsed.action
|
|
4383
|
+
};
|
|
4384
|
+
var rest = {};
|
|
4385
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
4386
|
+
try {
|
|
4387
|
+
for(var _iterator = Object.entries(parsed)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
4388
|
+
var _step_value = _sliced_to_array(_step.value, 2), key = _step_value[0], value = _step_value[1];
|
|
4389
|
+
if (key === "action") continue;
|
|
4390
|
+
if (COORD_FIELDS.includes(key)) {
|
|
4391
|
+
actionObj[key] = value;
|
|
4392
|
+
} else {
|
|
4393
|
+
rest[key] = value;
|
|
4394
|
+
}
|
|
4395
|
+
}
|
|
4396
|
+
} catch (err) {
|
|
4397
|
+
_didIteratorError = true;
|
|
4398
|
+
_iteratorError = err;
|
|
4399
|
+
} finally{
|
|
4400
|
+
try {
|
|
4401
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
4402
|
+
_iterator.return();
|
|
4403
|
+
}
|
|
4404
|
+
} finally{
|
|
4405
|
+
if (_didIteratorError) {
|
|
4406
|
+
throw _iteratorError;
|
|
4407
|
+
}
|
|
4408
|
+
}
|
|
4409
|
+
}
|
|
4410
|
+
return _object_spread_props(_object_spread({}, rest), {
|
|
4411
|
+
action: clean(actionObj)
|
|
4412
|
+
});
|
|
4413
|
+
}
|
|
4414
|
+
if (typeof parsed.type === "string") {
|
|
4415
|
+
var actionObj1 = {};
|
|
4416
|
+
var rest1 = {};
|
|
4417
|
+
var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
|
|
4418
|
+
try {
|
|
4419
|
+
for(var _iterator1 = Object.entries(parsed)[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
|
|
4420
|
+
var _step_value1 = _sliced_to_array(_step1.value, 2), key1 = _step_value1[0], value1 = _step_value1[1];
|
|
4421
|
+
if (key1 === "type" || COORD_FIELDS.includes(key1)) {
|
|
4422
|
+
actionObj1[key1] = value1;
|
|
4423
|
+
} else {
|
|
4424
|
+
rest1[key1] = value1;
|
|
4425
|
+
}
|
|
4426
|
+
}
|
|
4427
|
+
} catch (err) {
|
|
4428
|
+
_didIteratorError1 = true;
|
|
4429
|
+
_iteratorError1 = err;
|
|
4430
|
+
} finally{
|
|
4431
|
+
try {
|
|
4432
|
+
if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
|
|
4433
|
+
_iterator1.return();
|
|
4434
|
+
}
|
|
4435
|
+
} finally{
|
|
4436
|
+
if (_didIteratorError1) {
|
|
4437
|
+
throw _iteratorError1;
|
|
4438
|
+
}
|
|
4439
|
+
}
|
|
4440
|
+
}
|
|
4441
|
+
return _object_spread_props(_object_spread({}, rest1), {
|
|
4442
|
+
action: clean(actionObj1)
|
|
4443
|
+
});
|
|
4444
|
+
}
|
|
4445
|
+
return parsed;
|
|
4446
|
+
};
|
|
4447
|
+
var denormalizeComputerCallArguments = function(param) {
|
|
4448
|
+
var argumentsText = param.argumentsText, displayWidth = param.displayWidth, displayHeight = param.displayHeight, model = param.model;
|
|
4449
|
+
if ((typeof argumentsText === "undefined" ? "undefined" : _type_of(argumentsText)) === "object" && argumentsText !== null) {
|
|
4450
|
+
argumentsText = JSON.stringify(argumentsText);
|
|
4451
|
+
}
|
|
4452
|
+
var quirks = getQuirks(model);
|
|
4453
|
+
var text = argumentsText;
|
|
4454
|
+
if (quirks.cleanArtifacts) {
|
|
4455
|
+
text = cleanTextArtifacts(text);
|
|
4456
|
+
}
|
|
4457
|
+
var parsed = extractJson(text);
|
|
4458
|
+
if (!parsed && (quirks.cleanArtifacts || quirks.fuzzyFallback)) {
|
|
4459
|
+
parsed = fuzzyExtractJson(text);
|
|
4460
|
+
}
|
|
4461
|
+
if (!parsed || (typeof parsed === "undefined" ? "undefined" : _type_of(parsed)) !== "object") {
|
|
4462
|
+
return argumentsText;
|
|
4463
|
+
}
|
|
4464
|
+
var normalized = normalizeStructure(parsed, !!quirks.cleanArtifacts);
|
|
4465
|
+
if (quirks.normalizedCoords && normalized.action && _type_of(normalized.action) === "object") {
|
|
4466
|
+
return JSON.stringify(_object_spread_props(_object_spread({}, normalized), {
|
|
4467
|
+
action: denormalizeAction(normalized.action, displayWidth, displayHeight)
|
|
4468
|
+
}));
|
|
4469
|
+
}
|
|
4470
|
+
return JSON.stringify(normalized);
|
|
4471
|
+
};
|
|
4472
|
+
// src/adapters/client/openRouterClientAdapter/completions/computerUseTool.ts
|
|
4473
|
+
var buildComputerCallFunction = function(model, displayWidth, displayHeight) {
|
|
4474
|
+
var quirks = getQuirks(model);
|
|
4475
|
+
var coordDesc = quirks.normalizedCoords ? "Coordinates use 0-1000 normalized scale (0,0=top-left, 1000,1000=bottom-right)." : "Coordinates are in pixels (screen is ".concat(displayWidth, "x").concat(displayHeight, ").");
|
|
4476
|
+
var xDesc = quirks.normalizedCoords ? "X coordinate (0-1000 normalized)" : "X coordinate in pixels (0-".concat(displayWidth, ")");
|
|
4477
|
+
var yDesc = quirks.normalizedCoords ? "Y coordinate (0-1000 normalized)" : "Y coordinate in pixels (0-".concat(displayHeight, ")");
|
|
4478
|
+
return {
|
|
4479
|
+
name: "computer_call",
|
|
4480
|
+
description: "Perform a computer action. ".concat(coordDesc),
|
|
4481
|
+
parameters: {
|
|
4482
|
+
type: "object",
|
|
4483
|
+
properties: {
|
|
4484
|
+
action: {
|
|
4485
|
+
type: "object",
|
|
4486
|
+
description: "The action to perform",
|
|
4487
|
+
properties: {
|
|
4488
|
+
type: {
|
|
4489
|
+
type: "string",
|
|
4490
|
+
enum: [
|
|
4491
|
+
"screenshot",
|
|
4492
|
+
"click",
|
|
4493
|
+
"double_click",
|
|
4494
|
+
"type",
|
|
4495
|
+
"keypress",
|
|
4496
|
+
"scroll",
|
|
4497
|
+
"move",
|
|
4498
|
+
"drag",
|
|
4499
|
+
"wait"
|
|
4500
|
+
]
|
|
4501
|
+
},
|
|
4502
|
+
x: {
|
|
4503
|
+
type: "number",
|
|
4504
|
+
description: xDesc
|
|
4505
|
+
},
|
|
4506
|
+
y: {
|
|
4507
|
+
type: "number",
|
|
4508
|
+
description: yDesc
|
|
4509
|
+
},
|
|
4510
|
+
text: {
|
|
4511
|
+
type: "string",
|
|
4512
|
+
description: "Text to type"
|
|
4513
|
+
},
|
|
4514
|
+
keys: {
|
|
4515
|
+
type: "array",
|
|
4516
|
+
items: {
|
|
4517
|
+
type: "string"
|
|
4518
|
+
},
|
|
4519
|
+
description: "Keys to press"
|
|
4520
|
+
},
|
|
4521
|
+
button: {
|
|
4522
|
+
type: "string",
|
|
4523
|
+
enum: [
|
|
4524
|
+
"left",
|
|
4525
|
+
"right",
|
|
4526
|
+
"wheel"
|
|
4527
|
+
]
|
|
4528
|
+
},
|
|
4529
|
+
direction: {
|
|
4530
|
+
type: "string",
|
|
4531
|
+
enum: [
|
|
4532
|
+
"up",
|
|
4533
|
+
"down",
|
|
4534
|
+
"left",
|
|
4535
|
+
"right"
|
|
4536
|
+
]
|
|
4537
|
+
},
|
|
4538
|
+
scroll_x: {
|
|
4539
|
+
type: "number"
|
|
4540
|
+
},
|
|
4541
|
+
scroll_y: {
|
|
4542
|
+
type: "number"
|
|
4543
|
+
},
|
|
4544
|
+
path: {
|
|
4545
|
+
type: "array",
|
|
4546
|
+
items: {
|
|
4547
|
+
type: "object",
|
|
4548
|
+
properties: {
|
|
4549
|
+
x: {
|
|
4550
|
+
type: "number"
|
|
4551
|
+
},
|
|
4552
|
+
y: {
|
|
4553
|
+
type: "number"
|
|
4554
|
+
}
|
|
4555
|
+
}
|
|
4556
|
+
},
|
|
4557
|
+
description: "Path for drag action"
|
|
4558
|
+
}
|
|
4559
|
+
},
|
|
4560
|
+
required: [
|
|
4561
|
+
"type"
|
|
4562
|
+
]
|
|
4563
|
+
},
|
|
4564
|
+
pending_safety_checks: {
|
|
4565
|
+
type: "array",
|
|
4566
|
+
items: {
|
|
4567
|
+
type: "object"
|
|
4568
|
+
}
|
|
4569
|
+
}
|
|
4570
|
+
},
|
|
4571
|
+
required: [
|
|
4572
|
+
"action"
|
|
4573
|
+
]
|
|
4574
|
+
}
|
|
4575
|
+
};
|
|
4576
|
+
};
|
|
4577
|
+
var transformTools = function(tools, model) {
|
|
4578
|
+
if (!tools || tools.length === 0) {
|
|
4579
|
+
return {
|
|
4580
|
+
tools: tools !== null && tools !== void 0 ? tools : [],
|
|
4581
|
+
computerUseConfig: null
|
|
4582
|
+
};
|
|
4583
|
+
}
|
|
4584
|
+
var computerUseConfig = null;
|
|
4585
|
+
var transformed = tools.map(function(tool) {
|
|
4586
|
+
if (tool.type === "computer_use_preview") {
|
|
4587
|
+
var _tool_computer_use_preview, _ref, _config_display_width, _ref1, _config_display_height;
|
|
4588
|
+
var config = (_tool_computer_use_preview = tool.computer_use_preview) !== null && _tool_computer_use_preview !== void 0 ? _tool_computer_use_preview : tool;
|
|
4589
|
+
computerUseConfig = {
|
|
4590
|
+
displayWidth: (_ref = (_config_display_width = config.display_width) !== null && _config_display_width !== void 0 ? _config_display_width : config.display_width_px) !== null && _ref !== void 0 ? _ref : 1280,
|
|
4591
|
+
displayHeight: (_ref1 = (_config_display_height = config.display_height) !== null && _config_display_height !== void 0 ? _config_display_height : config.display_height_px) !== null && _ref1 !== void 0 ? _ref1 : 720
|
|
4592
|
+
};
|
|
4593
|
+
return {
|
|
4594
|
+
type: "function",
|
|
4595
|
+
function: buildComputerCallFunction(model, computerUseConfig.displayWidth, computerUseConfig.displayHeight)
|
|
4596
|
+
};
|
|
4597
|
+
}
|
|
4598
|
+
return tool;
|
|
4599
|
+
});
|
|
4600
|
+
return {
|
|
4601
|
+
tools: transformed,
|
|
4602
|
+
computerUseConfig: computerUseConfig
|
|
4603
|
+
};
|
|
4604
|
+
};
|
|
4605
|
+
// src/adapters/client/openRouterClientAdapter/completions/post.ts
|
|
4606
|
+
var ARTIFACT_TAGS = /<\|begin_of_box\|>|<\|end_of_box\|>/g;
|
|
4607
|
+
var sanitizeContent = function(content) {
|
|
4608
|
+
if (!content) return content;
|
|
4609
|
+
return content.replace(ARTIFACT_TAGS, "").trim();
|
|
4610
|
+
};
|
|
4611
|
+
var post10 = function(param) {
|
|
4612
|
+
var openRouter = param.openRouter;
|
|
4613
|
+
return function(_url, options) {
|
|
4614
|
+
return _async_to_generator(function() {
|
|
4615
|
+
var body, model, _transformTools, transformedTools, computerUseConfig, resultOptions, response, shouldCleanArtifacts, stream2, displayWidth, displayHeight, stream, data, _data_choices, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, choice, _ref, _choice_message, _iteratorNormalCompletion1, _didIteratorError1, _iteratorError1, _iterator1, _step1, tc, fn, _data_choices1, _iteratorNormalCompletion2, _didIteratorError2, _iteratorError2, _iterator2, _step2, choice1, _choice_message1, error;
|
|
4616
|
+
return _ts_generator(this, function(_state) {
|
|
4617
|
+
switch(_state.label){
|
|
4618
|
+
case 0:
|
|
4619
|
+
body = JSON.parse(options.body);
|
|
4620
|
+
model = body.model;
|
|
4621
|
+
_transformTools = transformTools(body.tools, model), transformedTools = _transformTools.tools, computerUseConfig = _transformTools.computerUseConfig;
|
|
4622
|
+
resultOptions = _object_spread({}, body, transformedTools.length > 0 ? {
|
|
4623
|
+
tools: transformedTools
|
|
4624
|
+
} : {});
|
|
4625
|
+
if (!body.stream) return [
|
|
4626
|
+
3,
|
|
4627
|
+
2
|
|
4628
|
+
];
|
|
4629
|
+
return [
|
|
4630
|
+
4,
|
|
4631
|
+
openRouter.chat.completions.create(resultOptions)
|
|
4632
|
+
];
|
|
4633
|
+
case 1:
|
|
4634
|
+
response = _state.sent();
|
|
4635
|
+
shouldCleanArtifacts = getQuirks(model).cleanArtifacts;
|
|
4636
|
+
if (!computerUseConfig) {
|
|
4637
|
+
stream2 = new ReadableStream({
|
|
4638
|
+
start: function start(controller) {
|
|
4639
|
+
return _async_to_generator(function() {
|
|
4640
|
+
var _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, chunk, _chunk_choices_, _chunk_choices, delta, err;
|
|
4641
|
+
return _ts_generator(this, function(_state) {
|
|
4642
|
+
switch(_state.label){
|
|
4643
|
+
case 0:
|
|
4644
|
+
_iteratorAbruptCompletion = false, _didIteratorError = false;
|
|
4645
|
+
_state.label = 1;
|
|
4646
|
+
case 1:
|
|
4647
|
+
_state.trys.push([
|
|
4648
|
+
1,
|
|
4649
|
+
6,
|
|
4650
|
+
7,
|
|
4651
|
+
12
|
|
4652
|
+
]);
|
|
4653
|
+
_iterator = _async_iterator(response);
|
|
4654
|
+
_state.label = 2;
|
|
4655
|
+
case 2:
|
|
4656
|
+
return [
|
|
4657
|
+
4,
|
|
4658
|
+
_iterator.next()
|
|
4659
|
+
];
|
|
4660
|
+
case 3:
|
|
4661
|
+
if (!(_iteratorAbruptCompletion = !(_step = _state.sent()).done)) return [
|
|
4662
|
+
3,
|
|
4663
|
+
5
|
|
4664
|
+
];
|
|
4665
|
+
_value = _step.value;
|
|
4666
|
+
chunk = _value;
|
|
4667
|
+
if (shouldCleanArtifacts) {
|
|
4668
|
+
;
|
|
4669
|
+
delta = (_chunk_choices = chunk.choices) === null || _chunk_choices === void 0 ? void 0 : (_chunk_choices_ = _chunk_choices[0]) === null || _chunk_choices_ === void 0 ? void 0 : _chunk_choices_.delta;
|
|
4670
|
+
if (delta === null || delta === void 0 ? void 0 : delta.content) {
|
|
4671
|
+
delta.content = sanitizeContent(delta.content);
|
|
4672
|
+
}
|
|
4673
|
+
}
|
|
4674
|
+
controller.enqueue("data: ".concat(JSON.stringify(chunk), "\n\n"));
|
|
4675
|
+
_state.label = 4;
|
|
4676
|
+
case 4:
|
|
4677
|
+
_iteratorAbruptCompletion = false;
|
|
4678
|
+
return [
|
|
4679
|
+
3,
|
|
4680
|
+
2
|
|
4681
|
+
];
|
|
4682
|
+
case 5:
|
|
4683
|
+
return [
|
|
4684
|
+
3,
|
|
4685
|
+
12
|
|
4686
|
+
];
|
|
4687
|
+
case 6:
|
|
4688
|
+
err = _state.sent();
|
|
4689
|
+
_didIteratorError = true;
|
|
4690
|
+
_iteratorError = err;
|
|
4691
|
+
return [
|
|
4692
|
+
3,
|
|
4693
|
+
12
|
|
4694
|
+
];
|
|
4695
|
+
case 7:
|
|
4696
|
+
_state.trys.push([
|
|
4697
|
+
7,
|
|
4698
|
+
,
|
|
4699
|
+
10,
|
|
4700
|
+
11
|
|
4701
|
+
]);
|
|
4702
|
+
if (!(_iteratorAbruptCompletion && _iterator.return != null)) return [
|
|
4703
|
+
3,
|
|
4704
|
+
9
|
|
4705
|
+
];
|
|
4706
|
+
return [
|
|
4707
|
+
4,
|
|
4708
|
+
_iterator.return()
|
|
4709
|
+
];
|
|
4710
|
+
case 8:
|
|
4711
|
+
_state.sent();
|
|
4712
|
+
_state.label = 9;
|
|
4713
|
+
case 9:
|
|
4714
|
+
return [
|
|
4715
|
+
3,
|
|
4716
|
+
11
|
|
4717
|
+
];
|
|
4718
|
+
case 10:
|
|
4719
|
+
if (_didIteratorError) {
|
|
4720
|
+
throw _iteratorError;
|
|
4721
|
+
}
|
|
4722
|
+
return [
|
|
4723
|
+
7
|
|
4724
|
+
];
|
|
4725
|
+
case 11:
|
|
4726
|
+
return [
|
|
4727
|
+
7
|
|
4728
|
+
];
|
|
4729
|
+
case 12:
|
|
4730
|
+
controller.close();
|
|
4731
|
+
return [
|
|
4732
|
+
2
|
|
4733
|
+
];
|
|
4734
|
+
}
|
|
4735
|
+
});
|
|
4736
|
+
})();
|
|
4737
|
+
}
|
|
4738
|
+
});
|
|
4739
|
+
return [
|
|
4740
|
+
2,
|
|
4741
|
+
new Response(stream2, {
|
|
4742
|
+
headers: {
|
|
4743
|
+
"Content-Type": "text/event-stream"
|
|
4744
|
+
}
|
|
4745
|
+
})
|
|
4746
|
+
];
|
|
4747
|
+
}
|
|
4748
|
+
displayWidth = computerUseConfig.displayWidth, displayHeight = computerUseConfig.displayHeight;
|
|
4749
|
+
stream = new ReadableStream({
|
|
4750
|
+
start: function start(controller) {
|
|
4751
|
+
return _async_to_generator(function() {
|
|
4752
|
+
var computerCallIndices, argumentBuffers, emittedIndices, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, chunk, _chunk_choices, _choice_delta, choices, choice, passThrough, _iteratorNormalCompletion, _didIteratorError1, _iteratorError1, _iterator1, _step1, tc, _tc_function, _argumentBuffers_get, _ref, _tc_function1, buf, denormalized, modifiedChunk, err1, _iteratorNormalCompletion1, _didIteratorError2, _iteratorError2, _iterator2, _step2, _step_value, index, buf1, denormalized1, flushChunk;
|
|
4753
|
+
return _ts_generator(this, function(_state) {
|
|
4754
|
+
switch(_state.label){
|
|
4755
|
+
case 0:
|
|
4756
|
+
computerCallIndices = /* @__PURE__ */ new Set();
|
|
4757
|
+
argumentBuffers = /* @__PURE__ */ new Map();
|
|
4758
|
+
emittedIndices = /* @__PURE__ */ new Set();
|
|
4759
|
+
_iteratorAbruptCompletion = false, _didIteratorError = false;
|
|
4760
|
+
_state.label = 1;
|
|
4761
|
+
case 1:
|
|
4762
|
+
_state.trys.push([
|
|
4763
|
+
1,
|
|
4764
|
+
6,
|
|
4765
|
+
7,
|
|
4766
|
+
12
|
|
4767
|
+
]);
|
|
4768
|
+
_iterator = _async_iterator(response);
|
|
4769
|
+
_state.label = 2;
|
|
4770
|
+
case 2:
|
|
4771
|
+
return [
|
|
4772
|
+
4,
|
|
4773
|
+
_iterator.next()
|
|
4774
|
+
];
|
|
4775
|
+
case 3:
|
|
4776
|
+
if (!(_iteratorAbruptCompletion = !(_step = _state.sent()).done)) return [
|
|
4777
|
+
3,
|
|
4778
|
+
5
|
|
4779
|
+
];
|
|
4780
|
+
_value = _step.value;
|
|
4781
|
+
chunk = _value;
|
|
4782
|
+
choices = (_chunk_choices = chunk.choices) !== null && _chunk_choices !== void 0 ? _chunk_choices : [];
|
|
4783
|
+
choice = choices[0];
|
|
4784
|
+
if (!(choice === null || choice === void 0 ? void 0 : (_choice_delta = choice.delta) === null || _choice_delta === void 0 ? void 0 : _choice_delta.tool_calls)) {
|
|
4785
|
+
controller.enqueue("data: ".concat(JSON.stringify(chunk), "\n\n"));
|
|
4786
|
+
return [
|
|
4787
|
+
3,
|
|
4788
|
+
4
|
|
4789
|
+
];
|
|
4790
|
+
}
|
|
4791
|
+
passThrough = [];
|
|
4792
|
+
_iteratorNormalCompletion = true, _didIteratorError1 = false, _iteratorError1 = undefined;
|
|
4793
|
+
try {
|
|
4794
|
+
for(_iterator1 = choice.delta.tool_calls[Symbol.iterator](); !(_iteratorNormalCompletion = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion = true){
|
|
4795
|
+
tc = _step1.value;
|
|
4796
|
+
;
|
|
4797
|
+
if (((_tc_function = tc.function) === null || _tc_function === void 0 ? void 0 : _tc_function.name) === "computer_call") {
|
|
4798
|
+
computerCallIndices.add(tc.index);
|
|
4799
|
+
argumentBuffers.set(tc.index, "");
|
|
4800
|
+
passThrough.push(_object_spread_props(_object_spread({}, tc), {
|
|
4801
|
+
function: _object_spread_props(_object_spread({}, tc.function), {
|
|
4802
|
+
arguments: ""
|
|
4803
|
+
})
|
|
4804
|
+
}));
|
|
4805
|
+
continue;
|
|
4806
|
+
}
|
|
4807
|
+
if (computerCallIndices.has(tc.index)) {
|
|
4808
|
+
;
|
|
4809
|
+
;
|
|
4810
|
+
buf = ((_argumentBuffers_get = argumentBuffers.get(tc.index)) !== null && _argumentBuffers_get !== void 0 ? _argumentBuffers_get : "") + ((_ref = (_tc_function1 = tc.function) === null || _tc_function1 === void 0 ? void 0 : _tc_function1.arguments) !== null && _ref !== void 0 ? _ref : "");
|
|
4811
|
+
argumentBuffers.set(tc.index, buf);
|
|
4812
|
+
if (!emittedIndices.has(tc.index)) {
|
|
4813
|
+
try {
|
|
4814
|
+
JSON.parse(buf);
|
|
4815
|
+
denormalized = denormalizeComputerCallArguments({
|
|
4816
|
+
argumentsText: buf,
|
|
4817
|
+
displayWidth: displayWidth,
|
|
4818
|
+
displayHeight: displayHeight,
|
|
4819
|
+
model: model
|
|
4820
|
+
});
|
|
4821
|
+
passThrough.push({
|
|
4822
|
+
index: tc.index,
|
|
4823
|
+
function: {
|
|
4824
|
+
arguments: denormalized
|
|
4825
|
+
}
|
|
4826
|
+
});
|
|
4827
|
+
emittedIndices.add(tc.index);
|
|
4828
|
+
} catch (unused) {}
|
|
4829
|
+
}
|
|
4830
|
+
continue;
|
|
4831
|
+
}
|
|
4832
|
+
passThrough.push(tc);
|
|
4833
|
+
}
|
|
4834
|
+
} catch (err) {
|
|
4835
|
+
_didIteratorError1 = true;
|
|
4836
|
+
_iteratorError1 = err;
|
|
4837
|
+
} finally{
|
|
4838
|
+
try {
|
|
4839
|
+
if (!_iteratorNormalCompletion && _iterator1.return != null) {
|
|
4840
|
+
_iterator1.return();
|
|
4841
|
+
}
|
|
4842
|
+
} finally{
|
|
4843
|
+
if (_didIteratorError1) {
|
|
4844
|
+
throw _iteratorError1;
|
|
4845
|
+
}
|
|
4846
|
+
}
|
|
4847
|
+
}
|
|
4848
|
+
if (passThrough.length > 0) {
|
|
4849
|
+
modifiedChunk = _object_spread_props(_object_spread({}, chunk), {
|
|
4850
|
+
choices: [
|
|
4851
|
+
_object_spread_props(_object_spread({}, choice), {
|
|
4852
|
+
delta: _object_spread_props(_object_spread({}, choice.delta), {
|
|
4853
|
+
tool_calls: passThrough
|
|
4854
|
+
})
|
|
4855
|
+
})
|
|
4856
|
+
]
|
|
4857
|
+
});
|
|
4858
|
+
controller.enqueue("data: ".concat(JSON.stringify(modifiedChunk), "\n\n"));
|
|
4859
|
+
}
|
|
4860
|
+
_state.label = 4;
|
|
4861
|
+
case 4:
|
|
4862
|
+
_iteratorAbruptCompletion = false;
|
|
4863
|
+
return [
|
|
4864
|
+
3,
|
|
4865
|
+
2
|
|
4866
|
+
];
|
|
4867
|
+
case 5:
|
|
4868
|
+
return [
|
|
4869
|
+
3,
|
|
4870
|
+
12
|
|
4871
|
+
];
|
|
4872
|
+
case 6:
|
|
4873
|
+
err1 = _state.sent();
|
|
4874
|
+
_didIteratorError = true;
|
|
4875
|
+
_iteratorError = err1;
|
|
4876
|
+
return [
|
|
4877
|
+
3,
|
|
4878
|
+
12
|
|
4879
|
+
];
|
|
4880
|
+
case 7:
|
|
4881
|
+
_state.trys.push([
|
|
4882
|
+
7,
|
|
4883
|
+
,
|
|
4884
|
+
10,
|
|
4885
|
+
11
|
|
4886
|
+
]);
|
|
4887
|
+
if (!(_iteratorAbruptCompletion && _iterator.return != null)) return [
|
|
4888
|
+
3,
|
|
4889
|
+
9
|
|
4890
|
+
];
|
|
4891
|
+
return [
|
|
4892
|
+
4,
|
|
4893
|
+
_iterator.return()
|
|
4894
|
+
];
|
|
4895
|
+
case 8:
|
|
4896
|
+
_state.sent();
|
|
4897
|
+
_state.label = 9;
|
|
4898
|
+
case 9:
|
|
4899
|
+
return [
|
|
4900
|
+
3,
|
|
4901
|
+
11
|
|
4902
|
+
];
|
|
4903
|
+
case 10:
|
|
4904
|
+
if (_didIteratorError) {
|
|
4905
|
+
throw _iteratorError;
|
|
4906
|
+
}
|
|
4907
|
+
return [
|
|
4908
|
+
7
|
|
4909
|
+
];
|
|
4910
|
+
case 11:
|
|
4911
|
+
return [
|
|
4912
|
+
7
|
|
4913
|
+
];
|
|
4914
|
+
case 12:
|
|
4915
|
+
_iteratorNormalCompletion1 = true, _didIteratorError2 = false, _iteratorError2 = undefined;
|
|
4916
|
+
try {
|
|
4917
|
+
for(_iterator2 = Array.from(argumentBuffers)[Symbol.iterator](); !(_iteratorNormalCompletion1 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion1 = true){
|
|
4918
|
+
_step_value = _sliced_to_array(_step2.value, 2), index = _step_value[0], buf1 = _step_value[1];
|
|
4919
|
+
if (!emittedIndices.has(index) && buf1) {
|
|
4920
|
+
denormalized1 = denormalizeComputerCallArguments({
|
|
4921
|
+
argumentsText: buf1,
|
|
4922
|
+
displayWidth: displayWidth,
|
|
4923
|
+
displayHeight: displayHeight,
|
|
4924
|
+
model: model
|
|
4925
|
+
});
|
|
4926
|
+
flushChunk = {
|
|
4927
|
+
object: "chat.completion.chunk",
|
|
4928
|
+
choices: [
|
|
4929
|
+
{
|
|
4930
|
+
index: 0,
|
|
4931
|
+
delta: {
|
|
4932
|
+
tool_calls: [
|
|
4933
|
+
{
|
|
4934
|
+
index: index,
|
|
4935
|
+
function: {
|
|
4936
|
+
arguments: denormalized1
|
|
4937
|
+
}
|
|
4938
|
+
}
|
|
4939
|
+
]
|
|
4940
|
+
}
|
|
4941
|
+
}
|
|
4942
|
+
]
|
|
4943
|
+
};
|
|
4944
|
+
controller.enqueue("data: ".concat(JSON.stringify(flushChunk), "\n\n"));
|
|
4945
|
+
}
|
|
4946
|
+
}
|
|
4947
|
+
} catch (err) {
|
|
4948
|
+
_didIteratorError2 = true;
|
|
4949
|
+
_iteratorError2 = err;
|
|
4950
|
+
} finally{
|
|
4951
|
+
try {
|
|
4952
|
+
if (!_iteratorNormalCompletion1 && _iterator2.return != null) {
|
|
4953
|
+
_iterator2.return();
|
|
4954
|
+
}
|
|
4955
|
+
} finally{
|
|
4956
|
+
if (_didIteratorError2) {
|
|
4957
|
+
throw _iteratorError2;
|
|
4958
|
+
}
|
|
4959
|
+
}
|
|
4960
|
+
}
|
|
4961
|
+
controller.close();
|
|
4962
|
+
return [
|
|
4963
|
+
2
|
|
4964
|
+
];
|
|
4965
|
+
}
|
|
4966
|
+
});
|
|
4967
|
+
})();
|
|
4968
|
+
}
|
|
4969
|
+
});
|
|
4970
|
+
return [
|
|
4971
|
+
2,
|
|
4972
|
+
new Response(stream, {
|
|
4973
|
+
headers: {
|
|
4974
|
+
"Content-Type": "text/event-stream"
|
|
4975
|
+
}
|
|
4976
|
+
})
|
|
4977
|
+
];
|
|
4978
|
+
case 2:
|
|
4979
|
+
_state.trys.push([
|
|
4980
|
+
2,
|
|
4981
|
+
4,
|
|
4982
|
+
,
|
|
4983
|
+
5
|
|
4984
|
+
]);
|
|
4985
|
+
return [
|
|
4986
|
+
4,
|
|
4987
|
+
openRouter.chat.completions.create(resultOptions)
|
|
4988
|
+
];
|
|
4989
|
+
case 3:
|
|
4990
|
+
data = _state.sent();
|
|
4991
|
+
if (computerUseConfig) {
|
|
4992
|
+
;
|
|
4993
|
+
_iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
4994
|
+
try {
|
|
4995
|
+
for(_iterator = ((_data_choices = data.choices) !== null && _data_choices !== void 0 ? _data_choices : [])[Symbol.iterator](); !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
4996
|
+
choice = _step.value;
|
|
4997
|
+
;
|
|
4998
|
+
;
|
|
4999
|
+
_iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
|
|
5000
|
+
try {
|
|
5001
|
+
for(_iterator1 = ((_ref = (_choice_message = choice.message) === null || _choice_message === void 0 ? void 0 : _choice_message.tool_calls) !== null && _ref !== void 0 ? _ref : [])[Symbol.iterator](); !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
|
|
5002
|
+
tc = _step1.value;
|
|
5003
|
+
fn = tc.function;
|
|
5004
|
+
if ((fn === null || fn === void 0 ? void 0 : fn.name) === "computer_call") {
|
|
5005
|
+
fn.arguments = denormalizeComputerCallArguments({
|
|
5006
|
+
argumentsText: fn.arguments,
|
|
5007
|
+
displayWidth: computerUseConfig.displayWidth,
|
|
5008
|
+
displayHeight: computerUseConfig.displayHeight,
|
|
5009
|
+
model: model
|
|
5010
|
+
});
|
|
5011
|
+
}
|
|
5012
|
+
}
|
|
5013
|
+
} catch (err) {
|
|
5014
|
+
_didIteratorError1 = true;
|
|
5015
|
+
_iteratorError1 = err;
|
|
5016
|
+
} finally{
|
|
5017
|
+
try {
|
|
5018
|
+
if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
|
|
5019
|
+
_iterator1.return();
|
|
5020
|
+
}
|
|
5021
|
+
} finally{
|
|
5022
|
+
if (_didIteratorError1) {
|
|
5023
|
+
throw _iteratorError1;
|
|
5024
|
+
}
|
|
5025
|
+
}
|
|
5026
|
+
}
|
|
5027
|
+
}
|
|
5028
|
+
} catch (err) {
|
|
5029
|
+
_didIteratorError = true;
|
|
5030
|
+
_iteratorError = err;
|
|
5031
|
+
} finally{
|
|
5032
|
+
try {
|
|
5033
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
5034
|
+
_iterator.return();
|
|
5035
|
+
}
|
|
5036
|
+
} finally{
|
|
5037
|
+
if (_didIteratorError) {
|
|
5038
|
+
throw _iteratorError;
|
|
5039
|
+
}
|
|
5040
|
+
}
|
|
5041
|
+
}
|
|
5042
|
+
}
|
|
5043
|
+
if (getQuirks(model).cleanArtifacts) {
|
|
5044
|
+
;
|
|
5045
|
+
_iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = undefined;
|
|
5046
|
+
try {
|
|
5047
|
+
for(_iterator2 = ((_data_choices1 = data.choices) !== null && _data_choices1 !== void 0 ? _data_choices1 : [])[Symbol.iterator](); !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true){
|
|
5048
|
+
choice1 = _step2.value;
|
|
5049
|
+
;
|
|
5050
|
+
if ((_choice_message1 = choice1.message) === null || _choice_message1 === void 0 ? void 0 : _choice_message1.content) {
|
|
5051
|
+
choice1.message.content = sanitizeContent(choice1.message.content);
|
|
5052
|
+
}
|
|
5053
|
+
}
|
|
5054
|
+
} catch (err) {
|
|
5055
|
+
_didIteratorError2 = true;
|
|
5056
|
+
_iteratorError2 = err;
|
|
5057
|
+
} finally{
|
|
5058
|
+
try {
|
|
5059
|
+
if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
|
|
5060
|
+
_iterator2.return();
|
|
5061
|
+
}
|
|
5062
|
+
} finally{
|
|
5063
|
+
if (_didIteratorError2) {
|
|
5064
|
+
throw _iteratorError2;
|
|
5065
|
+
}
|
|
5066
|
+
}
|
|
5067
|
+
}
|
|
5068
|
+
}
|
|
5069
|
+
return [
|
|
5070
|
+
2,
|
|
5071
|
+
new Response(JSON.stringify(data), {
|
|
5072
|
+
status: 200,
|
|
5073
|
+
headers: {
|
|
5074
|
+
"Content-Type": "application/json"
|
|
5075
|
+
}
|
|
5076
|
+
})
|
|
5077
|
+
];
|
|
5078
|
+
case 4:
|
|
5079
|
+
error = _state.sent();
|
|
5080
|
+
return [
|
|
5081
|
+
2,
|
|
5082
|
+
new Response(JSON.stringify({
|
|
5083
|
+
error: error
|
|
5084
|
+
}), {
|
|
5085
|
+
status: 500,
|
|
5086
|
+
headers: {
|
|
5087
|
+
"Content-Type": "application/json"
|
|
5088
|
+
}
|
|
5089
|
+
})
|
|
5090
|
+
];
|
|
5091
|
+
case 5:
|
|
5092
|
+
return [
|
|
5093
|
+
2
|
|
5094
|
+
];
|
|
5095
|
+
}
|
|
5096
|
+
});
|
|
5097
|
+
})();
|
|
5098
|
+
};
|
|
5099
|
+
};
|
|
5100
|
+
// src/adapters/client/openRouterClientAdapter/completions/index.ts
|
|
5101
|
+
var completions10 = function(param) {
|
|
5102
|
+
var openRouter = param.openRouter;
|
|
5103
|
+
return {
|
|
5104
|
+
post: post10({
|
|
5105
|
+
openRouter: openRouter
|
|
5106
|
+
})
|
|
5107
|
+
};
|
|
5108
|
+
};
|
|
5109
|
+
// src/adapters/client/openRouterClientAdapter/index.ts
|
|
5110
|
+
var openRouterClientAdapter = function(param) {
|
|
5111
|
+
var openRouter = param.openRouter;
|
|
5112
|
+
return {
|
|
5113
|
+
client: openRouter,
|
|
5114
|
+
requestHandlers: {
|
|
5115
|
+
"^/v1/models$": models13({
|
|
5116
|
+
openRouter: openRouter
|
|
5117
|
+
}),
|
|
5118
|
+
"^/(?:v1|/?openai)/chat/completions$": completions10({
|
|
5119
|
+
openRouter: openRouter
|
|
5120
|
+
})
|
|
5121
|
+
}
|
|
5122
|
+
};
|
|
5123
|
+
};
|
|
4070
5124
|
// src/adapters/run/completionsRunAdapter/index.ts
|
|
4071
5125
|
import _ from "lodash";
|
|
4072
5126
|
import { uid as uid2, omit as omit4, isEmpty as isEmpty2 } from "radash";
|
|
@@ -4708,7 +5762,7 @@ var serializeThread = function(param) {
|
|
|
4708
5762
|
};
|
|
4709
5763
|
};
|
|
4710
5764
|
// src/adapters/storage/prismaStorageAdapter/threads/post.ts
|
|
4711
|
-
var
|
|
5765
|
+
var post11 = function(param) {
|
|
4712
5766
|
var prisma = param.prisma;
|
|
4713
5767
|
return function(_urlString, options) {
|
|
4714
5768
|
return _async_to_generator(function() {
|
|
@@ -4784,7 +5838,7 @@ var post10 = function(param) {
|
|
|
4784
5838
|
var threads = function(param) {
|
|
4785
5839
|
var prisma = param.prisma;
|
|
4786
5840
|
return {
|
|
4787
|
-
post:
|
|
5841
|
+
post: post11({
|
|
4788
5842
|
prisma: prisma
|
|
4789
5843
|
})
|
|
4790
5844
|
};
|
|
@@ -4844,7 +5898,7 @@ var messageContentBlocks = function(param) {
|
|
|
4844
5898
|
}
|
|
4845
5899
|
];
|
|
4846
5900
|
};
|
|
4847
|
-
var
|
|
5901
|
+
var post12 = function(param) {
|
|
4848
5902
|
var prisma = param.prisma;
|
|
4849
5903
|
return function(urlString, options) {
|
|
4850
5904
|
return _async_to_generator(function() {
|
|
@@ -4892,7 +5946,7 @@ var post11 = function(param) {
|
|
|
4892
5946
|
};
|
|
4893
5947
|
// src/adapters/storage/prismaStorageAdapter/threads/messages/get.ts
|
|
4894
5948
|
import { assign as assign3, last } from "radash";
|
|
4895
|
-
var
|
|
5949
|
+
var get12 = function(param) {
|
|
4896
5950
|
var prisma = param.prisma;
|
|
4897
5951
|
return function(urlString) {
|
|
4898
5952
|
return _async_to_generator(function() {
|
|
@@ -4953,10 +6007,10 @@ var get11 = function(param) {
|
|
|
4953
6007
|
var messages2 = function(param) {
|
|
4954
6008
|
var prisma = param.prisma;
|
|
4955
6009
|
return {
|
|
4956
|
-
post:
|
|
6010
|
+
post: post12({
|
|
4957
6011
|
prisma: prisma
|
|
4958
6012
|
}),
|
|
4959
|
-
get:
|
|
6013
|
+
get: get12({
|
|
4960
6014
|
prisma: prisma
|
|
4961
6015
|
})
|
|
4962
6016
|
};
|
|
@@ -5027,7 +6081,7 @@ var mapPrismaRun = function(run4) {
|
|
|
5027
6081
|
};
|
|
5028
6082
|
};
|
|
5029
6083
|
// src/adapters/storage/prismaStorageAdapter/threads/runs/get.ts
|
|
5030
|
-
var
|
|
6084
|
+
var get13 = function(param) {
|
|
5031
6085
|
var prisma = param.prisma;
|
|
5032
6086
|
return function(urlString) {
|
|
5033
6087
|
return _async_to_generator(function() {
|
|
@@ -5474,7 +6528,7 @@ var getMessages = function(param) {
|
|
|
5474
6528
|
};
|
|
5475
6529
|
};
|
|
5476
6530
|
// src/adapters/storage/prismaStorageAdapter/threads/runs/post.ts
|
|
5477
|
-
var
|
|
6531
|
+
var post13 = function(param) {
|
|
5478
6532
|
var prisma = param.prisma, runAdapter = param.runAdapter;
|
|
5479
6533
|
return function(urlString, options) {
|
|
5480
6534
|
return _async_to_generator(function() {
|
|
@@ -5648,17 +6702,17 @@ var post12 = function(param) {
|
|
|
5648
6702
|
var runs = function(param) {
|
|
5649
6703
|
var prisma = param.prisma, runAdapter = param.runAdapter;
|
|
5650
6704
|
return {
|
|
5651
|
-
get:
|
|
6705
|
+
get: get13({
|
|
5652
6706
|
prisma: prisma
|
|
5653
6707
|
}),
|
|
5654
|
-
post:
|
|
6708
|
+
post: post13({
|
|
5655
6709
|
prisma: prisma,
|
|
5656
6710
|
runAdapter: runAdapter
|
|
5657
6711
|
})
|
|
5658
6712
|
};
|
|
5659
6713
|
};
|
|
5660
6714
|
// src/adapters/storage/prismaStorageAdapter/threads/run/get.ts
|
|
5661
|
-
var
|
|
6715
|
+
var get14 = function(param) {
|
|
5662
6716
|
var prisma = param.prisma;
|
|
5663
6717
|
return function(urlString) {
|
|
5664
6718
|
return _async_to_generator(function() {
|
|
@@ -5713,14 +6767,14 @@ var get13 = function(param) {
|
|
|
5713
6767
|
var run = function(param) {
|
|
5714
6768
|
var prisma = param.prisma, runAdapter = param.runAdapter;
|
|
5715
6769
|
return {
|
|
5716
|
-
get:
|
|
6770
|
+
get: get14({
|
|
5717
6771
|
prisma: prisma
|
|
5718
6772
|
})
|
|
5719
6773
|
};
|
|
5720
6774
|
};
|
|
5721
6775
|
// src/adapters/storage/prismaStorageAdapter/threads/runs/steps/get.ts
|
|
5722
6776
|
import { assign as assign6 } from "radash";
|
|
5723
|
-
var
|
|
6777
|
+
var get15 = function(param) {
|
|
5724
6778
|
var prisma = param.prisma;
|
|
5725
6779
|
return function(urlString) {
|
|
5726
6780
|
return _async_to_generator(function() {
|
|
@@ -5782,7 +6836,7 @@ var get14 = function(param) {
|
|
|
5782
6836
|
var steps = function(param) {
|
|
5783
6837
|
var prisma = param.prisma;
|
|
5784
6838
|
return {
|
|
5785
|
-
get:
|
|
6839
|
+
get: get15({
|
|
5786
6840
|
prisma: prisma
|
|
5787
6841
|
})
|
|
5788
6842
|
};
|
|
@@ -5950,7 +7004,7 @@ var updateRun = function(param) {
|
|
|
5950
7004
|
})();
|
|
5951
7005
|
};
|
|
5952
7006
|
// src/adapters/storage/prismaStorageAdapter/threads/runs/submitToolOutputs/post/index.ts
|
|
5953
|
-
var
|
|
7007
|
+
var post14 = function(param) {
|
|
5954
7008
|
var prisma = param.prisma, runAdapter = param.runAdapter;
|
|
5955
7009
|
return function(urlString, options) {
|
|
5956
7010
|
return _async_to_generator(function() {
|
|
@@ -6118,7 +7172,7 @@ var post13 = function(param) {
|
|
|
6118
7172
|
var submitToolOutputs = function(param) {
|
|
6119
7173
|
var prisma = param.prisma, runAdapter = param.runAdapter;
|
|
6120
7174
|
return {
|
|
6121
|
-
post:
|
|
7175
|
+
post: post14({
|
|
6122
7176
|
prisma: prisma,
|
|
6123
7177
|
// @ts-ignore-next-line
|
|
6124
7178
|
runAdapter: runAdapter
|
|
@@ -6127,7 +7181,7 @@ var submitToolOutputs = function(param) {
|
|
|
6127
7181
|
};
|
|
6128
7182
|
// src/adapters/storage/prismaStorageAdapter/assistants/post.ts
|
|
6129
7183
|
import dayjs9 from "dayjs";
|
|
6130
|
-
var
|
|
7184
|
+
var post15 = function(param) {
|
|
6131
7185
|
var prisma = param.prisma;
|
|
6132
7186
|
return function(_url, options) {
|
|
6133
7187
|
return _async_to_generator(function() {
|
|
@@ -6180,7 +7234,7 @@ var post14 = function(param) {
|
|
|
6180
7234
|
var assistants = function(param) {
|
|
6181
7235
|
var prisma = param.prisma;
|
|
6182
7236
|
return {
|
|
6183
|
-
post:
|
|
7237
|
+
post: post15({
|
|
6184
7238
|
prisma: prisma
|
|
6185
7239
|
})
|
|
6186
7240
|
};
|
|
@@ -6229,7 +7283,7 @@ var serializeThread2 = function(param) {
|
|
|
6229
7283
|
};
|
|
6230
7284
|
};
|
|
6231
7285
|
// src/adapters/storage/responsesStorageAdapter/threads/post.ts
|
|
6232
|
-
var
|
|
7286
|
+
var post16 = function(param) {
|
|
6233
7287
|
var client = param.client, _param_addAnnotations = param.addAnnotations, addAnnotations = _param_addAnnotations === void 0 ? false : _param_addAnnotations;
|
|
6234
7288
|
return function(_urlString, options) {
|
|
6235
7289
|
return _async_to_generator(function() {
|
|
@@ -6350,7 +7404,7 @@ var post15 = function(param) {
|
|
|
6350
7404
|
var threads2 = function(param) {
|
|
6351
7405
|
var client = param.client, _param_addAnnotations = param.addAnnotations, addAnnotations = _param_addAnnotations === void 0 ? false : _param_addAnnotations;
|
|
6352
7406
|
return {
|
|
6353
|
-
post:
|
|
7407
|
+
post: post16({
|
|
6354
7408
|
client: client,
|
|
6355
7409
|
addAnnotations: addAnnotations
|
|
6356
7410
|
})
|
|
@@ -6528,7 +7582,7 @@ var messageContentBlocks2 = function(param) {
|
|
|
6528
7582
|
attachments: attachments
|
|
6529
7583
|
})));
|
|
6530
7584
|
};
|
|
6531
|
-
var
|
|
7585
|
+
var post17 = function(param) {
|
|
6532
7586
|
var runAdapter = param.runAdapter, createResponseItems = param.createResponseItems, _param_addAnnotations = param.addAnnotations, addAnnotations = _param_addAnnotations === void 0 ? false : _param_addAnnotations;
|
|
6533
7587
|
return function(urlString, options) {
|
|
6534
7588
|
return _async_to_generator(function() {
|
|
@@ -6621,7 +7675,7 @@ function responseId(param) {
|
|
|
6621
7675
|
return null;
|
|
6622
7676
|
}
|
|
6623
7677
|
// src/adapters/storage/responsesStorageAdapter/threads/messages/get.ts
|
|
6624
|
-
var
|
|
7678
|
+
var get16 = function(param) {
|
|
6625
7679
|
var client = param.client, runAdapter = param.runAdapter;
|
|
6626
7680
|
return function(urlString) {
|
|
6627
7681
|
return _async_to_generator(function() {
|
|
@@ -6833,19 +7887,19 @@ var assignTimestamps = function(param) {
|
|
|
6833
7887
|
var messages3 = function(param) {
|
|
6834
7888
|
var client = param.client, runAdapter = param.runAdapter, createResponseItems = param.createResponseItems, _param_addAnnotations = param.addAnnotations, addAnnotations = _param_addAnnotations === void 0 ? false : _param_addAnnotations;
|
|
6835
7889
|
return {
|
|
6836
|
-
post:
|
|
7890
|
+
post: post17({
|
|
6837
7891
|
runAdapter: runAdapter,
|
|
6838
7892
|
createResponseItems: createResponseItems,
|
|
6839
7893
|
addAnnotations: addAnnotations
|
|
6840
7894
|
}),
|
|
6841
|
-
get:
|
|
7895
|
+
get: get16({
|
|
6842
7896
|
client: client,
|
|
6843
7897
|
runAdapter: runAdapter
|
|
6844
7898
|
})
|
|
6845
7899
|
};
|
|
6846
7900
|
};
|
|
6847
7901
|
// src/adapters/storage/responsesStorageAdapter/threads/runs/get.ts
|
|
6848
|
-
var
|
|
7902
|
+
var get17 = function() {
|
|
6849
7903
|
return function(urlString) {
|
|
6850
7904
|
return _async_to_generator(function() {
|
|
6851
7905
|
return _ts_generator(this, function(_state) {
|
|
@@ -7346,7 +8400,7 @@ var defaultAssistant = {
|
|
|
7346
8400
|
}
|
|
7347
8401
|
};
|
|
7348
8402
|
// src/adapters/storage/responsesStorageAdapter/threads/runs/post.ts
|
|
7349
|
-
var
|
|
8403
|
+
var post18 = function(param) {
|
|
7350
8404
|
var client = param.client, runAdapter = param.runAdapter, createResponseItems = param.createResponseItems;
|
|
7351
8405
|
return function(urlString, options) {
|
|
7352
8406
|
return _async_to_generator(function() {
|
|
@@ -7525,8 +8579,8 @@ var post17 = function(param) {
|
|
|
7525
8579
|
var runs2 = function(param) {
|
|
7526
8580
|
var client = param.client, runAdapter = param.runAdapter, createResponseItems = param.createResponseItems;
|
|
7527
8581
|
return {
|
|
7528
|
-
get:
|
|
7529
|
-
post:
|
|
8582
|
+
get: get17(),
|
|
8583
|
+
post: post18({
|
|
7530
8584
|
client: client,
|
|
7531
8585
|
createResponseItems: createResponseItems,
|
|
7532
8586
|
runAdapter: runAdapter
|
|
@@ -7534,7 +8588,7 @@ var runs2 = function(param) {
|
|
|
7534
8588
|
};
|
|
7535
8589
|
};
|
|
7536
8590
|
// src/adapters/storage/responsesStorageAdapter/threads/run/get.ts
|
|
7537
|
-
var
|
|
8591
|
+
var get18 = function(param) {
|
|
7538
8592
|
var client = param.client, runAdapter = param.runAdapter;
|
|
7539
8593
|
return function(urlString) {
|
|
7540
8594
|
return _async_to_generator(function() {
|
|
@@ -7584,7 +8638,7 @@ var get17 = function(param) {
|
|
|
7584
8638
|
var run2 = function(param) {
|
|
7585
8639
|
var client = param.client, runAdapter = param.runAdapter;
|
|
7586
8640
|
return {
|
|
7587
|
-
get:
|
|
8641
|
+
get: get18({
|
|
7588
8642
|
client: client,
|
|
7589
8643
|
runAdapter: runAdapter
|
|
7590
8644
|
})
|
|
@@ -8105,7 +9159,7 @@ var serializeItemAsReasoningRunStep = function(param) {
|
|
|
8105
9159
|
};
|
|
8106
9160
|
};
|
|
8107
9161
|
// src/adapters/storage/responsesStorageAdapter/threads/runs/steps/get.ts
|
|
8108
|
-
var
|
|
9162
|
+
var get19 = function(param) {
|
|
8109
9163
|
var client = param.client, runAdapter = param.runAdapter;
|
|
8110
9164
|
return function(urlString) {
|
|
8111
9165
|
return _async_to_generator(function() {
|
|
@@ -8274,7 +9328,7 @@ var get18 = function(param) {
|
|
|
8274
9328
|
var steps2 = function(param) {
|
|
8275
9329
|
var client = param.client, runAdapter = param.runAdapter;
|
|
8276
9330
|
return {
|
|
8277
|
-
get:
|
|
9331
|
+
get: get19({
|
|
8278
9332
|
client: client,
|
|
8279
9333
|
runAdapter: runAdapter
|
|
8280
9334
|
})
|
|
@@ -8356,7 +9410,7 @@ var truncation2 = function(param) {
|
|
|
8356
9410
|
return "auto";
|
|
8357
9411
|
};
|
|
8358
9412
|
// src/adapters/storage/responsesStorageAdapter/threads/runs/submitToolOutputs/post/index.ts
|
|
8359
|
-
var
|
|
9413
|
+
var post19 = function(param) {
|
|
8360
9414
|
var client = param.client, runAdapter = param.runAdapter;
|
|
8361
9415
|
return function(urlString, options) {
|
|
8362
9416
|
return _async_to_generator(function() {
|
|
@@ -8493,14 +9547,14 @@ var post18 = function(param) {
|
|
|
8493
9547
|
var submitToolOutputs2 = function(param) {
|
|
8494
9548
|
var client = param.client, runAdapter = param.runAdapter;
|
|
8495
9549
|
return {
|
|
8496
|
-
post:
|
|
9550
|
+
post: post19({
|
|
8497
9551
|
client: client,
|
|
8498
9552
|
runAdapter: runAdapter
|
|
8499
9553
|
})
|
|
8500
9554
|
};
|
|
8501
9555
|
};
|
|
8502
9556
|
// src/adapters/storage/responsesStorageAdapter/assistants/get.ts
|
|
8503
|
-
var
|
|
9557
|
+
var get20 = function(param) {
|
|
8504
9558
|
var runAdapter = param.runAdapter;
|
|
8505
9559
|
return function(_urlString) {
|
|
8506
9560
|
return _async_to_generator(function() {
|
|
@@ -8549,7 +9603,7 @@ var get19 = function(param) {
|
|
|
8549
9603
|
};
|
|
8550
9604
|
};
|
|
8551
9605
|
// src/adapters/storage/responsesStorageAdapter/assistants/post.ts
|
|
8552
|
-
var
|
|
9606
|
+
var post20 = function() {
|
|
8553
9607
|
return function() {
|
|
8554
9608
|
return _async_to_generator(function() {
|
|
8555
9609
|
return _ts_generator(this, function(_state) {
|
|
@@ -8575,10 +9629,10 @@ var post19 = function() {
|
|
|
8575
9629
|
var assistants2 = function(param) {
|
|
8576
9630
|
var runAdapter = param.runAdapter;
|
|
8577
9631
|
return {
|
|
8578
|
-
get:
|
|
9632
|
+
get: get20({
|
|
8579
9633
|
runAdapter: runAdapter
|
|
8580
9634
|
}),
|
|
8581
|
-
post:
|
|
9635
|
+
post: post20()
|
|
8582
9636
|
};
|
|
8583
9637
|
};
|
|
8584
9638
|
// src/adapters/storage/responsesStorageAdapter/index.ts
|
|
@@ -8622,7 +9676,7 @@ var responseRegexp = "^/(?:v1|/?openai)/responses/([^/]+)$";
|
|
|
8622
9676
|
import { uid as uid8 } from "radash";
|
|
8623
9677
|
import dayjs21 from "dayjs";
|
|
8624
9678
|
import { assign as assign9 } from "radash";
|
|
8625
|
-
var
|
|
9679
|
+
var post21 = function(param) {
|
|
8626
9680
|
var client = param.client, runAdapter = param.runAdapter, createResponseItems = param.createResponseItems;
|
|
8627
9681
|
return function(urlString, options) {
|
|
8628
9682
|
return _async_to_generator(function() {
|
|
@@ -8813,8 +9867,8 @@ var post20 = function(param) {
|
|
|
8813
9867
|
var runs3 = function(param) {
|
|
8814
9868
|
var client = param.client, runAdapter = param.runAdapter, createResponseItems = param.createResponseItems;
|
|
8815
9869
|
return {
|
|
8816
|
-
get:
|
|
8817
|
-
post:
|
|
9870
|
+
get: get17(),
|
|
9871
|
+
post: post21({
|
|
8818
9872
|
client: client,
|
|
8819
9873
|
createResponseItems: createResponseItems,
|
|
8820
9874
|
runAdapter: runAdapter
|
|
@@ -8822,7 +9876,7 @@ var runs3 = function(param) {
|
|
|
8822
9876
|
};
|
|
8823
9877
|
};
|
|
8824
9878
|
// src/adapters/storage/azureResponsesStorageAdapter/threads/runs/submitToolOutputs/post/index.ts
|
|
8825
|
-
var
|
|
9879
|
+
var post22 = function(param) {
|
|
8826
9880
|
var client = param.client, runAdapter = param.runAdapter;
|
|
8827
9881
|
return function(urlString, options) {
|
|
8828
9882
|
return _async_to_generator(function() {
|
|
@@ -8968,14 +10022,14 @@ var post21 = function(param) {
|
|
|
8968
10022
|
var submitToolOutputs3 = function(param) {
|
|
8969
10023
|
var client = param.client, runAdapter = param.runAdapter;
|
|
8970
10024
|
return {
|
|
8971
|
-
post:
|
|
10025
|
+
post: post22({
|
|
8972
10026
|
client: client,
|
|
8973
10027
|
runAdapter: runAdapter
|
|
8974
10028
|
})
|
|
8975
10029
|
};
|
|
8976
10030
|
};
|
|
8977
10031
|
// src/adapters/storage/azureResponsesStorageAdapter/responses/get.ts
|
|
8978
|
-
var
|
|
10032
|
+
var get21 = function(param) {
|
|
8979
10033
|
var client = param.client;
|
|
8980
10034
|
return function(urlString) {
|
|
8981
10035
|
return _async_to_generator(function() {
|
|
@@ -9009,7 +10063,7 @@ var get20 = function(param) {
|
|
|
9009
10063
|
var responses = function(param) {
|
|
9010
10064
|
var client = param.client;
|
|
9011
10065
|
return {
|
|
9012
|
-
get:
|
|
10066
|
+
get: get21({
|
|
9013
10067
|
client: client
|
|
9014
10068
|
})
|
|
9015
10069
|
};
|
|
@@ -9028,26 +10082,22 @@ var azureResponsesStorageAdapter = function() {
|
|
|
9028
10082
|
};
|
|
9029
10083
|
var getAzureClient = function() {
|
|
9030
10084
|
return _async_to_generator(function() {
|
|
9031
|
-
var _aiProjectClient__options, aiProjectClient, apiVersion,
|
|
10085
|
+
var _aiProjectClient__options, aiProjectClient, apiVersion, azureClient, azureClient1;
|
|
9032
10086
|
return _ts_generator(this, function(_state) {
|
|
9033
10087
|
switch(_state.label){
|
|
9034
10088
|
case 0:
|
|
9035
|
-
console.log("[azureResponsesStorageAdapter] getAzureClient called");
|
|
9036
10089
|
if (cachedClient) {
|
|
9037
|
-
console.log("[azureResponsesStorageAdapter] Returning cached Azure client");
|
|
9038
10090
|
return [
|
|
9039
10091
|
2,
|
|
9040
10092
|
cachedClient
|
|
9041
10093
|
];
|
|
9042
10094
|
}
|
|
9043
10095
|
aiProjectClient = getAIProjectClient();
|
|
9044
|
-
console.log("[azureResponsesStorageAdapter] aiProjectClient obtained");
|
|
9045
10096
|
apiVersion = (typeof aiProjectClient === "undefined" ? "undefined" : _type_of(aiProjectClient)) === "object" ? (_aiProjectClient__options = aiProjectClient._options) === null || _aiProjectClient__options === void 0 ? void 0 : _aiProjectClient__options.apiVersion : void 0;
|
|
9046
10097
|
if (!(aiProjectClient && (typeof aiProjectClient === "undefined" ? "undefined" : _type_of(aiProjectClient)) === "object" && "getAzureOpenAIClient" in aiProjectClient && typeof aiProjectClient.getAzureOpenAIClient === "function")) return [
|
|
9047
10098
|
3,
|
|
9048
10099
|
2
|
|
9049
10100
|
];
|
|
9050
|
-
console.log("[azureResponsesStorageAdapter] Calling getAzureOpenAIClient()");
|
|
9051
10101
|
return [
|
|
9052
10102
|
4,
|
|
9053
10103
|
aiProjectClient.getAzureOpenAIClient(apiVersion ? {
|
|
@@ -9056,9 +10106,6 @@ var azureResponsesStorageAdapter = function() {
|
|
|
9056
10106
|
];
|
|
9057
10107
|
case 1:
|
|
9058
10108
|
azureClient = _state.sent();
|
|
9059
|
-
console.log("[azureResponsesStorageAdapter] Azure OpenAI client obtained");
|
|
9060
|
-
console.log("[azureResponsesStorageAdapter] Azure client baseURL:", azureClient.baseURL);
|
|
9061
|
-
console.log("[azureResponsesStorageAdapter] Azure client apiKey:", ((_azureClient_apiKey = azureClient.apiKey) === null || _azureClient_apiKey === void 0 ? void 0 : _azureClient_apiKey.substring(0, 20)) + "...");
|
|
9062
10109
|
cachedClient = azureClient;
|
|
9063
10110
|
return [
|
|
9064
10111
|
2,
|
|
@@ -9069,7 +10116,6 @@ var azureResponsesStorageAdapter = function() {
|
|
|
9069
10116
|
3,
|
|
9070
10117
|
4
|
|
9071
10118
|
];
|
|
9072
|
-
console.log("[azureResponsesStorageAdapter] Calling getOpenAIClient()");
|
|
9073
10119
|
return [
|
|
9074
10120
|
4,
|
|
9075
10121
|
aiProjectClient.getOpenAIClient(apiVersion ? {
|
|
@@ -9078,16 +10124,12 @@ var azureResponsesStorageAdapter = function() {
|
|
|
9078
10124
|
];
|
|
9079
10125
|
case 3:
|
|
9080
10126
|
azureClient1 = _state.sent();
|
|
9081
|
-
console.log("[azureResponsesStorageAdapter] Azure OpenAI client obtained");
|
|
9082
|
-
console.log("[azureResponsesStorageAdapter] Azure client baseURL:", azureClient1.baseURL);
|
|
9083
|
-
console.log("[azureResponsesStorageAdapter] Azure client apiKey:", ((_azureClient_apiKey1 = azureClient1.apiKey) === null || _azureClient_apiKey1 === void 0 ? void 0 : _azureClient_apiKey1.substring(0, 20)) + "...");
|
|
9084
10127
|
cachedClient = azureClient1;
|
|
9085
10128
|
return [
|
|
9086
10129
|
2,
|
|
9087
10130
|
azureClient1
|
|
9088
10131
|
];
|
|
9089
10132
|
case 4:
|
|
9090
|
-
console.log("[azureResponsesStorageAdapter] Not an AIProjectClient, treating as OpenAI client");
|
|
9091
10133
|
cachedClient = aiProjectClient;
|
|
9092
10134
|
return [
|
|
9093
10135
|
2,
|
|
@@ -9162,7 +10204,6 @@ var azureResponsesStorageAdapter = function() {
|
|
|
9162
10204
|
return _ts_generator(this, function(_state) {
|
|
9163
10205
|
switch(_state.label){
|
|
9164
10206
|
case 0:
|
|
9165
|
-
console.log("[azureResponsesStorageAdapter] Handler called for:", urlString);
|
|
9166
10207
|
return [
|
|
9167
10208
|
4,
|
|
9168
10209
|
getAzureClient()
|
|
@@ -9233,7 +10274,7 @@ var azureResponsesStorageAdapter = function() {
|
|
|
9233
10274
|
};
|
|
9234
10275
|
// src/adapters/storage/azureAgentsStorageAdapter/threads/post.ts
|
|
9235
10276
|
import dayjs22 from "dayjs";
|
|
9236
|
-
var
|
|
10277
|
+
var post23 = function(param) {
|
|
9237
10278
|
var azureAiProject = param.azureAiProject;
|
|
9238
10279
|
return function(_urlString, options) {
|
|
9239
10280
|
return _async_to_generator(function() {
|
|
@@ -9279,14 +10320,14 @@ var post22 = function(param) {
|
|
|
9279
10320
|
var threads3 = function(param) {
|
|
9280
10321
|
var azureAiProject = param.azureAiProject;
|
|
9281
10322
|
return {
|
|
9282
|
-
post:
|
|
10323
|
+
post: post23({
|
|
9283
10324
|
azureAiProject: azureAiProject
|
|
9284
10325
|
})
|
|
9285
10326
|
};
|
|
9286
10327
|
};
|
|
9287
10328
|
// src/adapters/storage/azureAgentsStorageAdapter/threads/messages/post.ts
|
|
9288
10329
|
import dayjs23 from "dayjs";
|
|
9289
|
-
var
|
|
10330
|
+
var post24 = function(param) {
|
|
9290
10331
|
var azureAiProject = param.azureAiProject, runAdapter = param.runAdapter;
|
|
9291
10332
|
return function(urlString, options) {
|
|
9292
10333
|
return _async_to_generator(function() {
|
|
@@ -9400,7 +10441,7 @@ var post23 = function(param) {
|
|
|
9400
10441
|
};
|
|
9401
10442
|
// src/adapters/storage/azureAgentsStorageAdapter/threads/messages/get.ts
|
|
9402
10443
|
import dayjs24 from "dayjs";
|
|
9403
|
-
var
|
|
10444
|
+
var get22 = function(param) {
|
|
9404
10445
|
var azureAiProject = param.azureAiProject, runAdapter = param.runAdapter;
|
|
9405
10446
|
return function(urlString) {
|
|
9406
10447
|
return _async_to_generator(function() {
|
|
@@ -9588,18 +10629,18 @@ var get21 = function(param) {
|
|
|
9588
10629
|
var messages4 = function(param) {
|
|
9589
10630
|
var azureAiProject = param.azureAiProject, runAdapter = param.runAdapter;
|
|
9590
10631
|
return {
|
|
9591
|
-
post:
|
|
10632
|
+
post: post24({
|
|
9592
10633
|
azureAiProject: azureAiProject,
|
|
9593
10634
|
runAdapter: runAdapter
|
|
9594
10635
|
}),
|
|
9595
|
-
get:
|
|
10636
|
+
get: get22({
|
|
9596
10637
|
azureAiProject: azureAiProject,
|
|
9597
10638
|
runAdapter: runAdapter
|
|
9598
10639
|
})
|
|
9599
10640
|
};
|
|
9600
10641
|
};
|
|
9601
10642
|
// src/adapters/storage/azureAgentsStorageAdapter/threads/runs/get.ts
|
|
9602
|
-
var
|
|
10643
|
+
var get23 = function() {
|
|
9603
10644
|
return function() {
|
|
9604
10645
|
return _async_to_generator(function() {
|
|
9605
10646
|
var response;
|
|
@@ -9626,7 +10667,7 @@ var get22 = function() {
|
|
|
9626
10667
|
// src/adapters/storage/azureAgentsStorageAdapter/threads/runs/post.ts
|
|
9627
10668
|
import { uid as uid9 } from "radash";
|
|
9628
10669
|
import dayjs25 from "dayjs";
|
|
9629
|
-
var
|
|
10670
|
+
var post25 = function(param) {
|
|
9630
10671
|
var azureAiProject = param.azureAiProject, runAdapter = param.runAdapter;
|
|
9631
10672
|
return function(urlString, options) {
|
|
9632
10673
|
return _async_to_generator(function() {
|
|
@@ -9895,8 +10936,8 @@ var post24 = function(param) {
|
|
|
9895
10936
|
var runs4 = function(param) {
|
|
9896
10937
|
var azureAiProject = param.azureAiProject, runAdapter = param.runAdapter;
|
|
9897
10938
|
return {
|
|
9898
|
-
get:
|
|
9899
|
-
post:
|
|
10939
|
+
get: get23(),
|
|
10940
|
+
post: post25({
|
|
9900
10941
|
azureAiProject: azureAiProject,
|
|
9901
10942
|
runAdapter: runAdapter
|
|
9902
10943
|
})
|
|
@@ -9904,7 +10945,7 @@ var runs4 = function(param) {
|
|
|
9904
10945
|
};
|
|
9905
10946
|
// src/adapters/storage/azureAgentsStorageAdapter/threads/run/get.ts
|
|
9906
10947
|
import dayjs26 from "dayjs";
|
|
9907
|
-
var
|
|
10948
|
+
var get24 = function(param) {
|
|
9908
10949
|
var azureAiProject = param.azureAiProject, runAdapter = param.runAdapter;
|
|
9909
10950
|
return function(urlString) {
|
|
9910
10951
|
return _async_to_generator(function() {
|
|
@@ -9988,7 +11029,7 @@ var get23 = function(param) {
|
|
|
9988
11029
|
var run3 = function(param) {
|
|
9989
11030
|
var azureAiProject = param.azureAiProject, runAdapter = param.runAdapter;
|
|
9990
11031
|
return {
|
|
9991
|
-
get:
|
|
11032
|
+
get: get24({
|
|
9992
11033
|
azureAiProject: azureAiProject,
|
|
9993
11034
|
runAdapter: runAdapter
|
|
9994
11035
|
})
|
|
@@ -9996,7 +11037,7 @@ var run3 = function(param) {
|
|
|
9996
11037
|
};
|
|
9997
11038
|
// src/adapters/storage/azureAgentsStorageAdapter/threads/runs/steps/get.ts
|
|
9998
11039
|
import dayjs27 from "dayjs";
|
|
9999
|
-
var
|
|
11040
|
+
var get25 = function(param) {
|
|
10000
11041
|
var azureAiProject = param.azureAiProject, runAdapter = param.runAdapter, prisma = param.prisma;
|
|
10001
11042
|
return function(urlString) {
|
|
10002
11043
|
return _async_to_generator(function() {
|
|
@@ -10207,7 +11248,7 @@ var get24 = function(param) {
|
|
|
10207
11248
|
var steps3 = function(param) {
|
|
10208
11249
|
var azureAiProject = param.azureAiProject, runAdapter = param.runAdapter, prisma = param.prisma;
|
|
10209
11250
|
return {
|
|
10210
|
-
get:
|
|
11251
|
+
get: get25({
|
|
10211
11252
|
azureAiProject: azureAiProject,
|
|
10212
11253
|
runAdapter: runAdapter,
|
|
10213
11254
|
prisma: prisma
|
|
@@ -10535,7 +11576,7 @@ function convertAzureEventToOpenAI(azureEvent, assistantId, outputsMap) {
|
|
|
10535
11576
|
}
|
|
10536
11577
|
return null;
|
|
10537
11578
|
}
|
|
10538
|
-
var
|
|
11579
|
+
var post26 = function(param) {
|
|
10539
11580
|
var azureAiProject = param.azureAiProject, runAdapter = param.runAdapter, prisma = param.prisma;
|
|
10540
11581
|
return function(urlString, options) {
|
|
10541
11582
|
return _async_to_generator(function() {
|
|
@@ -10848,7 +11889,7 @@ var post25 = function(param) {
|
|
|
10848
11889
|
var submitToolOutputs4 = function(param) {
|
|
10849
11890
|
var azureAiProject = param.azureAiProject, runAdapter = param.runAdapter, prisma = param.prisma;
|
|
10850
11891
|
return {
|
|
10851
|
-
post:
|
|
11892
|
+
post: post26({
|
|
10852
11893
|
azureAiProject: azureAiProject,
|
|
10853
11894
|
runAdapter: runAdapter,
|
|
10854
11895
|
prisma: prisma
|
|
@@ -10856,7 +11897,7 @@ var submitToolOutputs4 = function(param) {
|
|
|
10856
11897
|
};
|
|
10857
11898
|
};
|
|
10858
11899
|
// src/adapters/storage/azureAgentsStorageAdapter/assistants/post.ts
|
|
10859
|
-
var
|
|
11900
|
+
var post27 = function(param) {
|
|
10860
11901
|
var runAdapter = param.runAdapter;
|
|
10861
11902
|
return function(_urlString, options) {
|
|
10862
11903
|
return _async_to_generator(function() {
|
|
@@ -10898,7 +11939,7 @@ var post26 = function(param) {
|
|
|
10898
11939
|
var assistants3 = function(param) {
|
|
10899
11940
|
var runAdapter = param.runAdapter;
|
|
10900
11941
|
return {
|
|
10901
|
-
post:
|
|
11942
|
+
post: post27({
|
|
10902
11943
|
runAdapter: runAdapter
|
|
10903
11944
|
})
|
|
10904
11945
|
};
|
|
@@ -13815,5 +14856,5 @@ var azureAgentsRunAdapter = function(param) {
|
|
|
13815
14856
|
handleRun: handleRun
|
|
13816
14857
|
};
|
|
13817
14858
|
};
|
|
13818
|
-
export { anthropicClientAdapter, azureAgentsRunAdapter, azureAgentsStorageAdapter, azureAiProjectClientAdapter, azureOpenaiClientAdapter, azureResponsesStorageAdapter, completionsRunAdapter, googleClientAdapter, groqClientAdapter, humirisClientAdapter, mistralClientAdapter, ollamaClientAdapter, openaiClientAdapter, perplexityClientAdapter, prismaStorageAdapter, responsesRunAdapter, responsesStorageAdapter, supercompat, togetherClientAdapter };
|
|
14859
|
+
export { anthropicClientAdapter, azureAgentsRunAdapter, azureAgentsStorageAdapter, azureAiProjectClientAdapter, azureOpenaiClientAdapter, azureResponsesStorageAdapter, completionsRunAdapter, googleClientAdapter, groqClientAdapter, humirisClientAdapter, mistralClientAdapter, ollamaClientAdapter, openRouterClientAdapter, openaiClientAdapter, perplexityClientAdapter, prismaStorageAdapter, responsesRunAdapter, responsesStorageAdapter, supercompat, togetherClientAdapter };
|
|
13819
14860
|
//# sourceMappingURL=index.js.map
|