supercompat 3.15.7 → 3.16.1
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 +1183 -92
- 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 +1159 -72
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -436,6 +436,9 @@ __export(index_exports, {
|
|
|
436
436
|
ollamaClientAdapter: function() {
|
|
437
437
|
return ollamaClientAdapter;
|
|
438
438
|
},
|
|
439
|
+
openRouterClientAdapter: function() {
|
|
440
|
+
return openRouterClientAdapter;
|
|
441
|
+
},
|
|
439
442
|
openaiClientAdapter: function() {
|
|
440
443
|
return openaiClientAdapter;
|
|
441
444
|
},
|
|
@@ -1197,7 +1200,7 @@ var get3 = function(param) {
|
|
|
1197
1200
|
var azureAiProject = param.azureAiProject;
|
|
1198
1201
|
return function(_url, _options) {
|
|
1199
1202
|
return _async_to_generator(function() {
|
|
1200
|
-
var
|
|
1203
|
+
var models14, _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, deployment, err, error;
|
|
1201
1204
|
return _ts_generator(this, function(_state) {
|
|
1202
1205
|
switch(_state.label){
|
|
1203
1206
|
case 0:
|
|
@@ -1207,7 +1210,7 @@ var get3 = function(param) {
|
|
|
1207
1210
|
,
|
|
1208
1211
|
14
|
|
1209
1212
|
]);
|
|
1210
|
-
|
|
1213
|
+
models14 = [];
|
|
1211
1214
|
_iteratorAbruptCompletion = false, _didIteratorError = false;
|
|
1212
1215
|
_state.label = 1;
|
|
1213
1216
|
case 1:
|
|
@@ -1232,7 +1235,7 @@ var get3 = function(param) {
|
|
|
1232
1235
|
_value = _step.value;
|
|
1233
1236
|
deployment = _value;
|
|
1234
1237
|
if (deployment.type === "ModelDeployment" && "modelName" in deployment && "modelPublisher" in deployment) {
|
|
1235
|
-
|
|
1238
|
+
models14.push({
|
|
1236
1239
|
id: deployment.modelName,
|
|
1237
1240
|
object: "model",
|
|
1238
1241
|
created: Date.now(),
|
|
@@ -1298,7 +1301,7 @@ var get3 = function(param) {
|
|
|
1298
1301
|
2,
|
|
1299
1302
|
new Response(JSON.stringify({
|
|
1300
1303
|
object: "list",
|
|
1301
|
-
data:
|
|
1304
|
+
data: models14
|
|
1302
1305
|
}), {
|
|
1303
1306
|
status: 200,
|
|
1304
1307
|
headers: {
|
|
@@ -2661,7 +2664,7 @@ var post5 = function(param) {
|
|
|
2661
2664
|
stream = new ReadableStream({
|
|
2662
2665
|
start: function start(controller) {
|
|
2663
2666
|
return _async_to_generator(function() {
|
|
2664
|
-
var blockIndexToToolUseId, toolUseIdToIndex, toolUseIdArgumentBuffer, computerToolUseIds, normalizedComputerCalls, nextToolCallIndex,
|
|
2667
|
+
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;
|
|
2665
2668
|
return _ts_generator(this, function(_state) {
|
|
2666
2669
|
switch(_state.label){
|
|
2667
2670
|
case 0:
|
|
@@ -2671,7 +2674,7 @@ var post5 = function(param) {
|
|
|
2671
2674
|
computerToolUseIds = /* @__PURE__ */ new Set();
|
|
2672
2675
|
normalizedComputerCalls = /* @__PURE__ */ new Set();
|
|
2673
2676
|
nextToolCallIndex = 0;
|
|
2674
|
-
|
|
2677
|
+
parseJson3 = function(value) {
|
|
2675
2678
|
try {
|
|
2676
2679
|
return JSON.parse(value);
|
|
2677
2680
|
} catch (unused) {
|
|
@@ -2768,7 +2771,7 @@ var post5 = function(param) {
|
|
|
2768
2771
|
if (toolUseId && computerToolUseIds.has(toolUseId) && !normalizedComputerCalls.has(toolUseId)) {
|
|
2769
2772
|
;
|
|
2770
2773
|
buffered = (_toolUseIdArgumentBuffer_get = toolUseIdArgumentBuffer.get(toolUseId)) !== null && _toolUseIdArgumentBuffer_get !== void 0 ? _toolUseIdArgumentBuffer_get : "";
|
|
2771
|
-
parsed = buffered ?
|
|
2774
|
+
parsed = buffered ? parseJson3(buffered) : void 0;
|
|
2772
2775
|
if (parsed !== void 0) {
|
|
2773
2776
|
normalized = normalizeComputerToolCallPayload(parsed);
|
|
2774
2777
|
toolCallIndex = getOrCreateIndexForToolUseId(toolUseId);
|
|
@@ -2833,7 +2836,7 @@ var post5 = function(param) {
|
|
|
2833
2836
|
updated = "".concat(existing).concat((_chunk_delta_partial_json = chunk.delta.partial_json) !== null && _chunk_delta_partial_json !== void 0 ? _chunk_delta_partial_json : "");
|
|
2834
2837
|
toolUseIdArgumentBuffer.set(toolUseId1, updated);
|
|
2835
2838
|
if (!normalizedComputerCalls.has(toolUseId1)) {
|
|
2836
|
-
parsed1 =
|
|
2839
|
+
parsed1 = parseJson3(updated);
|
|
2837
2840
|
if (parsed1 !== void 0) {
|
|
2838
2841
|
normalized1 = normalizeComputerToolCallPayload(parsed1);
|
|
2839
2842
|
toolCallIndex2 = getOrCreateIndexForToolUseId(toolUseId1);
|
|
@@ -4009,10 +4012,877 @@ var post9 = function(param) {
|
|
|
4009
4012
|
stream = new ReadableStream({
|
|
4010
4013
|
start: function start(controller) {
|
|
4011
4014
|
return _async_to_generator(function() {
|
|
4012
|
-
var _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, chunk, err;
|
|
4015
|
+
var _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, chunk, err;
|
|
4016
|
+
return _ts_generator(this, function(_state) {
|
|
4017
|
+
switch(_state.label){
|
|
4018
|
+
case 0:
|
|
4019
|
+
_iteratorAbruptCompletion = false, _didIteratorError = false;
|
|
4020
|
+
_state.label = 1;
|
|
4021
|
+
case 1:
|
|
4022
|
+
_state.trys.push([
|
|
4023
|
+
1,
|
|
4024
|
+
6,
|
|
4025
|
+
7,
|
|
4026
|
+
12
|
|
4027
|
+
]);
|
|
4028
|
+
_iterator = _async_iterator(response);
|
|
4029
|
+
_state.label = 2;
|
|
4030
|
+
case 2:
|
|
4031
|
+
return [
|
|
4032
|
+
4,
|
|
4033
|
+
_iterator.next()
|
|
4034
|
+
];
|
|
4035
|
+
case 3:
|
|
4036
|
+
if (!(_iteratorAbruptCompletion = !(_step = _state.sent()).done)) return [
|
|
4037
|
+
3,
|
|
4038
|
+
5
|
|
4039
|
+
];
|
|
4040
|
+
_value = _step.value;
|
|
4041
|
+
chunk = _value;
|
|
4042
|
+
controller.enqueue("data: ".concat(JSON.stringify(chunk), "\n\n"));
|
|
4043
|
+
_state.label = 4;
|
|
4044
|
+
case 4:
|
|
4045
|
+
_iteratorAbruptCompletion = false;
|
|
4046
|
+
return [
|
|
4047
|
+
3,
|
|
4048
|
+
2
|
|
4049
|
+
];
|
|
4050
|
+
case 5:
|
|
4051
|
+
return [
|
|
4052
|
+
3,
|
|
4053
|
+
12
|
|
4054
|
+
];
|
|
4055
|
+
case 6:
|
|
4056
|
+
err = _state.sent();
|
|
4057
|
+
_didIteratorError = true;
|
|
4058
|
+
_iteratorError = err;
|
|
4059
|
+
return [
|
|
4060
|
+
3,
|
|
4061
|
+
12
|
|
4062
|
+
];
|
|
4063
|
+
case 7:
|
|
4064
|
+
_state.trys.push([
|
|
4065
|
+
7,
|
|
4066
|
+
,
|
|
4067
|
+
10,
|
|
4068
|
+
11
|
|
4069
|
+
]);
|
|
4070
|
+
if (!(_iteratorAbruptCompletion && _iterator.return != null)) return [
|
|
4071
|
+
3,
|
|
4072
|
+
9
|
|
4073
|
+
];
|
|
4074
|
+
return [
|
|
4075
|
+
4,
|
|
4076
|
+
_iterator.return()
|
|
4077
|
+
];
|
|
4078
|
+
case 8:
|
|
4079
|
+
_state.sent();
|
|
4080
|
+
_state.label = 9;
|
|
4081
|
+
case 9:
|
|
4082
|
+
return [
|
|
4083
|
+
3,
|
|
4084
|
+
11
|
|
4085
|
+
];
|
|
4086
|
+
case 10:
|
|
4087
|
+
if (_didIteratorError) {
|
|
4088
|
+
throw _iteratorError;
|
|
4089
|
+
}
|
|
4090
|
+
return [
|
|
4091
|
+
7
|
|
4092
|
+
];
|
|
4093
|
+
case 11:
|
|
4094
|
+
return [
|
|
4095
|
+
7
|
|
4096
|
+
];
|
|
4097
|
+
case 12:
|
|
4098
|
+
controller.close();
|
|
4099
|
+
return [
|
|
4100
|
+
2
|
|
4101
|
+
];
|
|
4102
|
+
}
|
|
4103
|
+
});
|
|
4104
|
+
})();
|
|
4105
|
+
}
|
|
4106
|
+
});
|
|
4107
|
+
return [
|
|
4108
|
+
2,
|
|
4109
|
+
new Response(stream, {
|
|
4110
|
+
headers: {
|
|
4111
|
+
"Content-Type": "text/event-stream"
|
|
4112
|
+
}
|
|
4113
|
+
})
|
|
4114
|
+
];
|
|
4115
|
+
case 2:
|
|
4116
|
+
_state.trys.push([
|
|
4117
|
+
2,
|
|
4118
|
+
4,
|
|
4119
|
+
,
|
|
4120
|
+
5
|
|
4121
|
+
]);
|
|
4122
|
+
return [
|
|
4123
|
+
4,
|
|
4124
|
+
ollama.chat.completions.create(body)
|
|
4125
|
+
];
|
|
4126
|
+
case 3:
|
|
4127
|
+
data = _state.sent();
|
|
4128
|
+
return [
|
|
4129
|
+
2,
|
|
4130
|
+
new Response(JSON.stringify({
|
|
4131
|
+
data: data
|
|
4132
|
+
}), {
|
|
4133
|
+
status: 200,
|
|
4134
|
+
headers: {
|
|
4135
|
+
"Content-Type": "application/json"
|
|
4136
|
+
}
|
|
4137
|
+
})
|
|
4138
|
+
];
|
|
4139
|
+
case 4:
|
|
4140
|
+
error = _state.sent();
|
|
4141
|
+
return [
|
|
4142
|
+
2,
|
|
4143
|
+
new Response(JSON.stringify({
|
|
4144
|
+
error: error
|
|
4145
|
+
}), {
|
|
4146
|
+
status: 500,
|
|
4147
|
+
headers: {
|
|
4148
|
+
"Content-Type": "application/json"
|
|
4149
|
+
}
|
|
4150
|
+
})
|
|
4151
|
+
];
|
|
4152
|
+
case 5:
|
|
4153
|
+
return [
|
|
4154
|
+
2
|
|
4155
|
+
];
|
|
4156
|
+
}
|
|
4157
|
+
});
|
|
4158
|
+
})();
|
|
4159
|
+
};
|
|
4160
|
+
};
|
|
4161
|
+
// src/adapters/client/ollamaClientAdapter/completions/index.ts
|
|
4162
|
+
var completions9 = function(param) {
|
|
4163
|
+
var ollama = param.ollama;
|
|
4164
|
+
return {
|
|
4165
|
+
post: post9({
|
|
4166
|
+
ollama: ollama
|
|
4167
|
+
})
|
|
4168
|
+
};
|
|
4169
|
+
};
|
|
4170
|
+
// src/adapters/client/ollamaClientAdapter/index.ts
|
|
4171
|
+
var ollamaClientAdapter = function(param) {
|
|
4172
|
+
var ollama = param.ollama;
|
|
4173
|
+
return {
|
|
4174
|
+
client: ollama,
|
|
4175
|
+
requestHandlers: {
|
|
4176
|
+
"^/v1/models$": models12({
|
|
4177
|
+
ollama: ollama
|
|
4178
|
+
}),
|
|
4179
|
+
"^/(?:v1|/?openai)/chat/completions$": completions9({
|
|
4180
|
+
ollama: ollama
|
|
4181
|
+
})
|
|
4182
|
+
}
|
|
4183
|
+
};
|
|
4184
|
+
};
|
|
4185
|
+
// src/adapters/client/openRouterClientAdapter/models/get.ts
|
|
4186
|
+
var get11 = function(param) {
|
|
4187
|
+
var openRouter = param.openRouter;
|
|
4188
|
+
return function(_url, _options) {
|
|
4189
|
+
return _async_to_generator(function() {
|
|
4190
|
+
var data, error;
|
|
4191
|
+
return _ts_generator(this, function(_state) {
|
|
4192
|
+
switch(_state.label){
|
|
4193
|
+
case 0:
|
|
4194
|
+
_state.trys.push([
|
|
4195
|
+
0,
|
|
4196
|
+
2,
|
|
4197
|
+
,
|
|
4198
|
+
3
|
|
4199
|
+
]);
|
|
4200
|
+
return [
|
|
4201
|
+
4,
|
|
4202
|
+
openRouter.models.list()
|
|
4203
|
+
];
|
|
4204
|
+
case 1:
|
|
4205
|
+
data = _state.sent();
|
|
4206
|
+
return [
|
|
4207
|
+
2,
|
|
4208
|
+
new Response(JSON.stringify(data), {
|
|
4209
|
+
status: 200,
|
|
4210
|
+
headers: {
|
|
4211
|
+
"Content-Type": "application/json"
|
|
4212
|
+
}
|
|
4213
|
+
})
|
|
4214
|
+
];
|
|
4215
|
+
case 2:
|
|
4216
|
+
error = _state.sent();
|
|
4217
|
+
return [
|
|
4218
|
+
2,
|
|
4219
|
+
new Response(JSON.stringify({
|
|
4220
|
+
error: error
|
|
4221
|
+
}), {
|
|
4222
|
+
status: 500,
|
|
4223
|
+
headers: {
|
|
4224
|
+
"Content-Type": "application/json"
|
|
4225
|
+
}
|
|
4226
|
+
})
|
|
4227
|
+
];
|
|
4228
|
+
case 3:
|
|
4229
|
+
return [
|
|
4230
|
+
2
|
|
4231
|
+
];
|
|
4232
|
+
}
|
|
4233
|
+
});
|
|
4234
|
+
})();
|
|
4235
|
+
};
|
|
4236
|
+
};
|
|
4237
|
+
// src/adapters/client/openRouterClientAdapter/models/index.ts
|
|
4238
|
+
var models13 = function(param) {
|
|
4239
|
+
var openRouter = param.openRouter;
|
|
4240
|
+
return {
|
|
4241
|
+
get: get11({
|
|
4242
|
+
openRouter: openRouter
|
|
4243
|
+
})
|
|
4244
|
+
};
|
|
4245
|
+
};
|
|
4246
|
+
// src/adapters/client/openRouterClientAdapter/completions/normalizeComputerCall.ts
|
|
4247
|
+
var MODEL_QUIRKS = {
|
|
4248
|
+
"z-ai/glm-4.6v": {
|
|
4249
|
+
normalizedCoords: true,
|
|
4250
|
+
cleanArtifacts: true
|
|
4251
|
+
},
|
|
4252
|
+
"qwen/": {
|
|
4253
|
+
fuzzyFallback: true
|
|
4254
|
+
},
|
|
4255
|
+
"google/": {
|
|
4256
|
+
normalizedCoords: true
|
|
4257
|
+
}
|
|
4258
|
+
};
|
|
4259
|
+
var getQuirks = function(model) {
|
|
4260
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
4261
|
+
try {
|
|
4262
|
+
for(var _iterator = Object.entries(MODEL_QUIRKS)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
4263
|
+
var _step_value = _sliced_to_array(_step.value, 2), prefix = _step_value[0], quirks = _step_value[1];
|
|
4264
|
+
if (model.startsWith(prefix)) return quirks;
|
|
4265
|
+
}
|
|
4266
|
+
} catch (err) {
|
|
4267
|
+
_didIteratorError = true;
|
|
4268
|
+
_iteratorError = err;
|
|
4269
|
+
} finally{
|
|
4270
|
+
try {
|
|
4271
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
4272
|
+
_iterator.return();
|
|
4273
|
+
}
|
|
4274
|
+
} finally{
|
|
4275
|
+
if (_didIteratorError) {
|
|
4276
|
+
throw _iteratorError;
|
|
4277
|
+
}
|
|
4278
|
+
}
|
|
4279
|
+
}
|
|
4280
|
+
return {};
|
|
4281
|
+
};
|
|
4282
|
+
var cleanTextArtifacts = function(text) {
|
|
4283
|
+
return text.replace(/<\|begin_of_box\|>/g, "").replace(/<\|end_of_box\|>/g, "").replace(/<arg_key>[^<]*<\/arg_key>/g, "").replace(/<\/arg_value>/g, "").trim();
|
|
4284
|
+
};
|
|
4285
|
+
var KNOWN_ACTION_TYPES = [
|
|
4286
|
+
"double_click",
|
|
4287
|
+
"screenshot",
|
|
4288
|
+
"keypress",
|
|
4289
|
+
"scroll",
|
|
4290
|
+
"click",
|
|
4291
|
+
"move",
|
|
4292
|
+
"type",
|
|
4293
|
+
"drag",
|
|
4294
|
+
"wait"
|
|
4295
|
+
];
|
|
4296
|
+
var splitCoordDigits = function(numStr) {
|
|
4297
|
+
for(var i = 1; i < numStr.length; i++){
|
|
4298
|
+
var x = parseInt(numStr.slice(0, i));
|
|
4299
|
+
var y = parseInt(numStr.slice(i));
|
|
4300
|
+
if (x >= 0 && x <= 1e3 && y >= 0 && y <= 1e3) {
|
|
4301
|
+
return {
|
|
4302
|
+
x: x,
|
|
4303
|
+
y: y
|
|
4304
|
+
};
|
|
4305
|
+
}
|
|
4306
|
+
}
|
|
4307
|
+
return null;
|
|
4308
|
+
};
|
|
4309
|
+
var cleanGlmAction = function(action) {
|
|
4310
|
+
var typeVal = action.type;
|
|
4311
|
+
if (typeof typeVal !== "string") return action;
|
|
4312
|
+
var argValueMatch = typeVal.match(/<arg_value>\s*(\{[\s\S]*\})\s*$/);
|
|
4313
|
+
if (argValueMatch) {
|
|
4314
|
+
var inner = parseJson2(argValueMatch[1]);
|
|
4315
|
+
if (inner && (typeof inner === "undefined" ? "undefined" : _type_of(inner)) === "object") {
|
|
4316
|
+
return inner;
|
|
4317
|
+
}
|
|
4318
|
+
}
|
|
4319
|
+
var cleanedType = typeVal.replace(/<\/?[^>]+>/g, "").replace(/\n/g, "").trim();
|
|
4320
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
4321
|
+
try {
|
|
4322
|
+
for(var _iterator = KNOWN_ACTION_TYPES[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
4323
|
+
var actionType = _step.value;
|
|
4324
|
+
if (cleanedType.startsWith(actionType) && cleanedType !== actionType) {
|
|
4325
|
+
var rest = cleanedType.slice(actionType.length);
|
|
4326
|
+
var nums = rest.match(/\d+/g);
|
|
4327
|
+
if (nums && nums.length >= 2) {
|
|
4328
|
+
return _object_spread_props(_object_spread({}, action), {
|
|
4329
|
+
type: actionType,
|
|
4330
|
+
x: parseInt(nums[0]),
|
|
4331
|
+
y: parseInt(nums[1])
|
|
4332
|
+
});
|
|
4333
|
+
}
|
|
4334
|
+
if (nums && nums.length === 1 && nums[0].length >= 2) {
|
|
4335
|
+
var coords = splitCoordDigits(nums[0]);
|
|
4336
|
+
if (coords) {
|
|
4337
|
+
return _object_spread(_object_spread_props(_object_spread({}, action), {
|
|
4338
|
+
type: actionType
|
|
4339
|
+
}), coords);
|
|
4340
|
+
}
|
|
4341
|
+
}
|
|
4342
|
+
return _object_spread_props(_object_spread({}, action), {
|
|
4343
|
+
type: actionType
|
|
4344
|
+
});
|
|
4345
|
+
}
|
|
4346
|
+
}
|
|
4347
|
+
} catch (err) {
|
|
4348
|
+
_didIteratorError = true;
|
|
4349
|
+
_iteratorError = err;
|
|
4350
|
+
} finally{
|
|
4351
|
+
try {
|
|
4352
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
4353
|
+
_iterator.return();
|
|
4354
|
+
}
|
|
4355
|
+
} finally{
|
|
4356
|
+
if (_didIteratorError) {
|
|
4357
|
+
throw _iteratorError;
|
|
4358
|
+
}
|
|
4359
|
+
}
|
|
4360
|
+
}
|
|
4361
|
+
if (cleanedType === typeVal) return action;
|
|
4362
|
+
return _object_spread_props(_object_spread({}, action), {
|
|
4363
|
+
type: cleanedType
|
|
4364
|
+
});
|
|
4365
|
+
};
|
|
4366
|
+
var cleanGlmFields = function(action) {
|
|
4367
|
+
var result = _object_spread({}, action);
|
|
4368
|
+
if (typeof result.x === "string") {
|
|
4369
|
+
var nums = result.x.match(/\d+/g);
|
|
4370
|
+
if (nums && nums.length >= 2) {
|
|
4371
|
+
result.x = parseInt(nums[0]);
|
|
4372
|
+
if (result.y === void 0 || typeof result.y === "string") {
|
|
4373
|
+
result.y = parseInt(nums[1]);
|
|
4374
|
+
}
|
|
4375
|
+
} else if (nums && nums.length === 1) {
|
|
4376
|
+
result.x = parseInt(nums[0]);
|
|
4377
|
+
}
|
|
4378
|
+
}
|
|
4379
|
+
if (typeof result.y === "string") {
|
|
4380
|
+
var nums1 = result.y.match(/\d+/g);
|
|
4381
|
+
if (nums1 && nums1.length >= 1) {
|
|
4382
|
+
result.y = parseInt(nums1[0]);
|
|
4383
|
+
}
|
|
4384
|
+
}
|
|
4385
|
+
for(var _i = 0, _iter = [
|
|
4386
|
+
"scroll_x",
|
|
4387
|
+
"scroll_y"
|
|
4388
|
+
]; _i < _iter.length; _i++){
|
|
4389
|
+
var key = _iter[_i];
|
|
4390
|
+
if (typeof result[key] === "string") {
|
|
4391
|
+
var nums2 = result[key].match(/\d+/g);
|
|
4392
|
+
if (nums2) result[key] = parseInt(nums2[0]);
|
|
4393
|
+
}
|
|
4394
|
+
}
|
|
4395
|
+
if (typeof result.type === "string") {
|
|
4396
|
+
result.type = result.type.replace(/<[^>]*>/g, "").replace(/^\{|\}$/g, "").replace(/\n/g, "").trim();
|
|
4397
|
+
}
|
|
4398
|
+
return result;
|
|
4399
|
+
};
|
|
4400
|
+
var applyArtifactCleanup = function(action) {
|
|
4401
|
+
return cleanGlmFields(cleanGlmAction(action));
|
|
4402
|
+
};
|
|
4403
|
+
var parseJson2 = function(text) {
|
|
4404
|
+
try {
|
|
4405
|
+
return JSON.parse(text);
|
|
4406
|
+
} catch (unused) {
|
|
4407
|
+
return void 0;
|
|
4408
|
+
}
|
|
4409
|
+
};
|
|
4410
|
+
var extractJson = function(text) {
|
|
4411
|
+
var direct = parseJson2(text);
|
|
4412
|
+
if (direct) return direct;
|
|
4413
|
+
var codeBlockMatch = text.match(/```(?:json)?\s*([\s\S]*?)```/);
|
|
4414
|
+
if (codeBlockMatch) {
|
|
4415
|
+
var parsed = parseJson2(codeBlockMatch[1].trim());
|
|
4416
|
+
if (parsed) return parsed;
|
|
4417
|
+
}
|
|
4418
|
+
var jsonMatch = text.match(/(\{[\s\S]*\})\s*$/);
|
|
4419
|
+
if (jsonMatch) {
|
|
4420
|
+
var parsed1 = parseJson2(jsonMatch[1].trim());
|
|
4421
|
+
if (parsed1) return parsed1;
|
|
4422
|
+
}
|
|
4423
|
+
return void 0;
|
|
4424
|
+
};
|
|
4425
|
+
var fuzzyExtractJson = function(text) {
|
|
4426
|
+
var clickMatch = text.match(/"action"\s*:\s*"click"\s*,\s*"x"\s*:\s*\[?\s*(\d+)\s*,\s*(\d+)/);
|
|
4427
|
+
if (clickMatch) {
|
|
4428
|
+
return {
|
|
4429
|
+
action: {
|
|
4430
|
+
type: "click",
|
|
4431
|
+
x: parseInt(clickMatch[1]),
|
|
4432
|
+
y: parseInt(clickMatch[2])
|
|
4433
|
+
}
|
|
4434
|
+
};
|
|
4435
|
+
}
|
|
4436
|
+
var actionTypeMatch = text.match(/"type"\s*:\s*"(\w+)"/);
|
|
4437
|
+
if (actionTypeMatch) {
|
|
4438
|
+
var result = {
|
|
4439
|
+
type: actionTypeMatch[1]
|
|
4440
|
+
};
|
|
4441
|
+
var xMatch = text.match(/"x"\s*:\s*\[?\s*(\d+)/);
|
|
4442
|
+
var yMatch = text.match(/"y"\s*:\s*(\d+)/);
|
|
4443
|
+
if (xMatch) result.x = parseInt(xMatch[1]);
|
|
4444
|
+
if (yMatch) {
|
|
4445
|
+
result.y = parseInt(yMatch[1]);
|
|
4446
|
+
} else if (xMatch) {
|
|
4447
|
+
var _xMatch_index;
|
|
4448
|
+
var afterX = text.slice(((_xMatch_index = xMatch.index) !== null && _xMatch_index !== void 0 ? _xMatch_index : 0) + xMatch[0].length);
|
|
4449
|
+
var nextNum = afterX.match(/\s*,?\s*(\d+)/);
|
|
4450
|
+
if (nextNum) result.y = parseInt(nextNum[1]);
|
|
4451
|
+
}
|
|
4452
|
+
var textMatch = text.match(/"text"\s*:\s*"([^"]*)"/);
|
|
4453
|
+
if (textMatch) result.text = textMatch[1];
|
|
4454
|
+
return {
|
|
4455
|
+
action: result
|
|
4456
|
+
};
|
|
4457
|
+
}
|
|
4458
|
+
return void 0;
|
|
4459
|
+
};
|
|
4460
|
+
var denormalize = function(value, dimension) {
|
|
4461
|
+
return Math.round(value / 1e3 * dimension);
|
|
4462
|
+
};
|
|
4463
|
+
var denormalizeAction = function(action, displayWidth, displayHeight) {
|
|
4464
|
+
var result = _object_spread({}, action);
|
|
4465
|
+
if (typeof result.x === "number") {
|
|
4466
|
+
result.x = denormalize(result.x, displayWidth);
|
|
4467
|
+
}
|
|
4468
|
+
if (typeof result.y === "number") {
|
|
4469
|
+
result.y = denormalize(result.y, displayHeight);
|
|
4470
|
+
}
|
|
4471
|
+
if (Array.isArray(result.path)) {
|
|
4472
|
+
result.path = result.path.map(function(point) {
|
|
4473
|
+
if (point && (typeof point === "undefined" ? "undefined" : _type_of(point)) === "object") {
|
|
4474
|
+
return _object_spread({}, point, typeof point.x === "number" ? {
|
|
4475
|
+
x: denormalize(point.x, displayWidth)
|
|
4476
|
+
} : {}, typeof point.y === "number" ? {
|
|
4477
|
+
y: denormalize(point.y, displayHeight)
|
|
4478
|
+
} : {});
|
|
4479
|
+
}
|
|
4480
|
+
return point;
|
|
4481
|
+
});
|
|
4482
|
+
}
|
|
4483
|
+
return result;
|
|
4484
|
+
};
|
|
4485
|
+
var COORD_FIELDS = [
|
|
4486
|
+
"x",
|
|
4487
|
+
"y",
|
|
4488
|
+
"text",
|
|
4489
|
+
"keys",
|
|
4490
|
+
"button",
|
|
4491
|
+
"direction",
|
|
4492
|
+
"scroll_x",
|
|
4493
|
+
"scroll_y",
|
|
4494
|
+
"path"
|
|
4495
|
+
];
|
|
4496
|
+
var normalizeStructure = function(parsed, shouldCleanArtifacts) {
|
|
4497
|
+
var clean = shouldCleanArtifacts ? function(action) {
|
|
4498
|
+
return applyArtifactCleanup(action);
|
|
4499
|
+
} : function(action) {
|
|
4500
|
+
return action;
|
|
4501
|
+
};
|
|
4502
|
+
if (parsed.action && _type_of(parsed.action) === "object") {
|
|
4503
|
+
return _object_spread_props(_object_spread({}, parsed), {
|
|
4504
|
+
action: clean(parsed.action)
|
|
4505
|
+
});
|
|
4506
|
+
}
|
|
4507
|
+
if (typeof parsed.action === "string") {
|
|
4508
|
+
var actionObj = {
|
|
4509
|
+
type: parsed.action
|
|
4510
|
+
};
|
|
4511
|
+
var rest = {};
|
|
4512
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
4513
|
+
try {
|
|
4514
|
+
for(var _iterator = Object.entries(parsed)[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
4515
|
+
var _step_value = _sliced_to_array(_step.value, 2), key = _step_value[0], value = _step_value[1];
|
|
4516
|
+
if (key === "action") continue;
|
|
4517
|
+
if (COORD_FIELDS.includes(key)) {
|
|
4518
|
+
actionObj[key] = value;
|
|
4519
|
+
} else {
|
|
4520
|
+
rest[key] = value;
|
|
4521
|
+
}
|
|
4522
|
+
}
|
|
4523
|
+
} catch (err) {
|
|
4524
|
+
_didIteratorError = true;
|
|
4525
|
+
_iteratorError = err;
|
|
4526
|
+
} finally{
|
|
4527
|
+
try {
|
|
4528
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
4529
|
+
_iterator.return();
|
|
4530
|
+
}
|
|
4531
|
+
} finally{
|
|
4532
|
+
if (_didIteratorError) {
|
|
4533
|
+
throw _iteratorError;
|
|
4534
|
+
}
|
|
4535
|
+
}
|
|
4536
|
+
}
|
|
4537
|
+
return _object_spread_props(_object_spread({}, rest), {
|
|
4538
|
+
action: clean(actionObj)
|
|
4539
|
+
});
|
|
4540
|
+
}
|
|
4541
|
+
if (typeof parsed.type === "string") {
|
|
4542
|
+
var actionObj1 = {};
|
|
4543
|
+
var rest1 = {};
|
|
4544
|
+
var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
|
|
4545
|
+
try {
|
|
4546
|
+
for(var _iterator1 = Object.entries(parsed)[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true){
|
|
4547
|
+
var _step_value1 = _sliced_to_array(_step1.value, 2), key1 = _step_value1[0], value1 = _step_value1[1];
|
|
4548
|
+
if (key1 === "type" || COORD_FIELDS.includes(key1)) {
|
|
4549
|
+
actionObj1[key1] = value1;
|
|
4550
|
+
} else {
|
|
4551
|
+
rest1[key1] = value1;
|
|
4552
|
+
}
|
|
4553
|
+
}
|
|
4554
|
+
} catch (err) {
|
|
4555
|
+
_didIteratorError1 = true;
|
|
4556
|
+
_iteratorError1 = err;
|
|
4557
|
+
} finally{
|
|
4558
|
+
try {
|
|
4559
|
+
if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
|
|
4560
|
+
_iterator1.return();
|
|
4561
|
+
}
|
|
4562
|
+
} finally{
|
|
4563
|
+
if (_didIteratorError1) {
|
|
4564
|
+
throw _iteratorError1;
|
|
4565
|
+
}
|
|
4566
|
+
}
|
|
4567
|
+
}
|
|
4568
|
+
return _object_spread_props(_object_spread({}, rest1), {
|
|
4569
|
+
action: clean(actionObj1)
|
|
4570
|
+
});
|
|
4571
|
+
}
|
|
4572
|
+
return parsed;
|
|
4573
|
+
};
|
|
4574
|
+
var denormalizeComputerCallArguments = function(param) {
|
|
4575
|
+
var argumentsText = param.argumentsText, displayWidth = param.displayWidth, displayHeight = param.displayHeight, model = param.model;
|
|
4576
|
+
if ((typeof argumentsText === "undefined" ? "undefined" : _type_of(argumentsText)) === "object" && argumentsText !== null) {
|
|
4577
|
+
argumentsText = JSON.stringify(argumentsText);
|
|
4578
|
+
}
|
|
4579
|
+
var quirks = getQuirks(model);
|
|
4580
|
+
var text = argumentsText;
|
|
4581
|
+
if (quirks.cleanArtifacts) {
|
|
4582
|
+
text = cleanTextArtifacts(text);
|
|
4583
|
+
}
|
|
4584
|
+
var parsed = extractJson(text);
|
|
4585
|
+
if (!parsed && (quirks.cleanArtifacts || quirks.fuzzyFallback)) {
|
|
4586
|
+
parsed = fuzzyExtractJson(text);
|
|
4587
|
+
}
|
|
4588
|
+
if (!parsed || (typeof parsed === "undefined" ? "undefined" : _type_of(parsed)) !== "object") {
|
|
4589
|
+
return argumentsText;
|
|
4590
|
+
}
|
|
4591
|
+
var normalized = normalizeStructure(parsed, !!quirks.cleanArtifacts);
|
|
4592
|
+
if (quirks.normalizedCoords && normalized.action && _type_of(normalized.action) === "object") {
|
|
4593
|
+
return JSON.stringify(_object_spread_props(_object_spread({}, normalized), {
|
|
4594
|
+
action: denormalizeAction(normalized.action, displayWidth, displayHeight)
|
|
4595
|
+
}));
|
|
4596
|
+
}
|
|
4597
|
+
return JSON.stringify(normalized);
|
|
4598
|
+
};
|
|
4599
|
+
// src/adapters/client/openRouterClientAdapter/completions/computerUseTool.ts
|
|
4600
|
+
var buildComputerCallFunction = function(model, displayWidth, displayHeight) {
|
|
4601
|
+
var quirks = getQuirks(model);
|
|
4602
|
+
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, ").");
|
|
4603
|
+
var xDesc = quirks.normalizedCoords ? "X coordinate (0-1000 normalized)" : "X coordinate in pixels (0-".concat(displayWidth, ")");
|
|
4604
|
+
var yDesc = quirks.normalizedCoords ? "Y coordinate (0-1000 normalized)" : "Y coordinate in pixels (0-".concat(displayHeight, ")");
|
|
4605
|
+
return {
|
|
4606
|
+
name: "computer_call",
|
|
4607
|
+
description: "Perform a computer action. ".concat(coordDesc),
|
|
4608
|
+
parameters: {
|
|
4609
|
+
type: "object",
|
|
4610
|
+
properties: {
|
|
4611
|
+
action: {
|
|
4612
|
+
type: "object",
|
|
4613
|
+
description: "The action to perform",
|
|
4614
|
+
properties: {
|
|
4615
|
+
type: {
|
|
4616
|
+
type: "string",
|
|
4617
|
+
enum: [
|
|
4618
|
+
"screenshot",
|
|
4619
|
+
"click",
|
|
4620
|
+
"double_click",
|
|
4621
|
+
"type",
|
|
4622
|
+
"keypress",
|
|
4623
|
+
"scroll",
|
|
4624
|
+
"move",
|
|
4625
|
+
"drag",
|
|
4626
|
+
"wait"
|
|
4627
|
+
]
|
|
4628
|
+
},
|
|
4629
|
+
x: {
|
|
4630
|
+
type: "number",
|
|
4631
|
+
description: xDesc
|
|
4632
|
+
},
|
|
4633
|
+
y: {
|
|
4634
|
+
type: "number",
|
|
4635
|
+
description: yDesc
|
|
4636
|
+
},
|
|
4637
|
+
text: {
|
|
4638
|
+
type: "string",
|
|
4639
|
+
description: "Text to type"
|
|
4640
|
+
},
|
|
4641
|
+
keys: {
|
|
4642
|
+
type: "array",
|
|
4643
|
+
items: {
|
|
4644
|
+
type: "string"
|
|
4645
|
+
},
|
|
4646
|
+
description: "Keys to press"
|
|
4647
|
+
},
|
|
4648
|
+
button: {
|
|
4649
|
+
type: "string",
|
|
4650
|
+
enum: [
|
|
4651
|
+
"left",
|
|
4652
|
+
"right",
|
|
4653
|
+
"wheel"
|
|
4654
|
+
]
|
|
4655
|
+
},
|
|
4656
|
+
direction: {
|
|
4657
|
+
type: "string",
|
|
4658
|
+
enum: [
|
|
4659
|
+
"up",
|
|
4660
|
+
"down",
|
|
4661
|
+
"left",
|
|
4662
|
+
"right"
|
|
4663
|
+
]
|
|
4664
|
+
},
|
|
4665
|
+
scroll_x: {
|
|
4666
|
+
type: "number"
|
|
4667
|
+
},
|
|
4668
|
+
scroll_y: {
|
|
4669
|
+
type: "number"
|
|
4670
|
+
},
|
|
4671
|
+
path: {
|
|
4672
|
+
type: "array",
|
|
4673
|
+
items: {
|
|
4674
|
+
type: "object",
|
|
4675
|
+
properties: {
|
|
4676
|
+
x: {
|
|
4677
|
+
type: "number"
|
|
4678
|
+
},
|
|
4679
|
+
y: {
|
|
4680
|
+
type: "number"
|
|
4681
|
+
}
|
|
4682
|
+
}
|
|
4683
|
+
},
|
|
4684
|
+
description: "Path for drag action"
|
|
4685
|
+
}
|
|
4686
|
+
},
|
|
4687
|
+
required: [
|
|
4688
|
+
"type"
|
|
4689
|
+
]
|
|
4690
|
+
},
|
|
4691
|
+
pending_safety_checks: {
|
|
4692
|
+
type: "array",
|
|
4693
|
+
items: {
|
|
4694
|
+
type: "object"
|
|
4695
|
+
}
|
|
4696
|
+
}
|
|
4697
|
+
},
|
|
4698
|
+
required: [
|
|
4699
|
+
"action"
|
|
4700
|
+
]
|
|
4701
|
+
}
|
|
4702
|
+
};
|
|
4703
|
+
};
|
|
4704
|
+
var transformTools = function(tools, model) {
|
|
4705
|
+
if (!tools || tools.length === 0) {
|
|
4706
|
+
return {
|
|
4707
|
+
tools: tools !== null && tools !== void 0 ? tools : [],
|
|
4708
|
+
computerUseConfig: null
|
|
4709
|
+
};
|
|
4710
|
+
}
|
|
4711
|
+
var computerUseConfig = null;
|
|
4712
|
+
var transformed = tools.map(function(tool) {
|
|
4713
|
+
if (tool.type === "computer_use_preview") {
|
|
4714
|
+
var _tool_computer_use_preview, _ref, _config_display_width, _ref1, _config_display_height;
|
|
4715
|
+
var config = (_tool_computer_use_preview = tool.computer_use_preview) !== null && _tool_computer_use_preview !== void 0 ? _tool_computer_use_preview : tool;
|
|
4716
|
+
computerUseConfig = {
|
|
4717
|
+
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,
|
|
4718
|
+
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
|
|
4719
|
+
};
|
|
4720
|
+
return {
|
|
4721
|
+
type: "function",
|
|
4722
|
+
function: buildComputerCallFunction(model, computerUseConfig.displayWidth, computerUseConfig.displayHeight)
|
|
4723
|
+
};
|
|
4724
|
+
}
|
|
4725
|
+
return tool;
|
|
4726
|
+
});
|
|
4727
|
+
return {
|
|
4728
|
+
tools: transformed,
|
|
4729
|
+
computerUseConfig: computerUseConfig
|
|
4730
|
+
};
|
|
4731
|
+
};
|
|
4732
|
+
// src/adapters/client/openRouterClientAdapter/completions/post.ts
|
|
4733
|
+
var ARTIFACT_TAGS = /<\|begin_of_box\|>|<\|end_of_box\|>/g;
|
|
4734
|
+
var sanitizeContent = function(content) {
|
|
4735
|
+
if (!content) return content;
|
|
4736
|
+
return content.replace(ARTIFACT_TAGS, "").trim();
|
|
4737
|
+
};
|
|
4738
|
+
var post10 = function(param) {
|
|
4739
|
+
var openRouter = param.openRouter;
|
|
4740
|
+
return function(_url, options) {
|
|
4741
|
+
return _async_to_generator(function() {
|
|
4742
|
+
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;
|
|
4743
|
+
return _ts_generator(this, function(_state) {
|
|
4744
|
+
switch(_state.label){
|
|
4745
|
+
case 0:
|
|
4746
|
+
body = JSON.parse(options.body);
|
|
4747
|
+
model = body.model;
|
|
4748
|
+
_transformTools = transformTools(body.tools, model), transformedTools = _transformTools.tools, computerUseConfig = _transformTools.computerUseConfig;
|
|
4749
|
+
resultOptions = _object_spread({}, body, transformedTools.length > 0 ? {
|
|
4750
|
+
tools: transformedTools
|
|
4751
|
+
} : {});
|
|
4752
|
+
if (!body.stream) return [
|
|
4753
|
+
3,
|
|
4754
|
+
2
|
|
4755
|
+
];
|
|
4756
|
+
return [
|
|
4757
|
+
4,
|
|
4758
|
+
openRouter.chat.completions.create(resultOptions)
|
|
4759
|
+
];
|
|
4760
|
+
case 1:
|
|
4761
|
+
response = _state.sent();
|
|
4762
|
+
shouldCleanArtifacts = getQuirks(model).cleanArtifacts;
|
|
4763
|
+
if (!computerUseConfig) {
|
|
4764
|
+
stream2 = new ReadableStream({
|
|
4765
|
+
start: function start(controller) {
|
|
4766
|
+
return _async_to_generator(function() {
|
|
4767
|
+
var _iteratorAbruptCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, chunk, _chunk_choices_, _chunk_choices, delta, err;
|
|
4768
|
+
return _ts_generator(this, function(_state) {
|
|
4769
|
+
switch(_state.label){
|
|
4770
|
+
case 0:
|
|
4771
|
+
_iteratorAbruptCompletion = false, _didIteratorError = false;
|
|
4772
|
+
_state.label = 1;
|
|
4773
|
+
case 1:
|
|
4774
|
+
_state.trys.push([
|
|
4775
|
+
1,
|
|
4776
|
+
6,
|
|
4777
|
+
7,
|
|
4778
|
+
12
|
|
4779
|
+
]);
|
|
4780
|
+
_iterator = _async_iterator(response);
|
|
4781
|
+
_state.label = 2;
|
|
4782
|
+
case 2:
|
|
4783
|
+
return [
|
|
4784
|
+
4,
|
|
4785
|
+
_iterator.next()
|
|
4786
|
+
];
|
|
4787
|
+
case 3:
|
|
4788
|
+
if (!(_iteratorAbruptCompletion = !(_step = _state.sent()).done)) return [
|
|
4789
|
+
3,
|
|
4790
|
+
5
|
|
4791
|
+
];
|
|
4792
|
+
_value = _step.value;
|
|
4793
|
+
chunk = _value;
|
|
4794
|
+
if (shouldCleanArtifacts) {
|
|
4795
|
+
;
|
|
4796
|
+
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;
|
|
4797
|
+
if (delta === null || delta === void 0 ? void 0 : delta.content) {
|
|
4798
|
+
delta.content = sanitizeContent(delta.content);
|
|
4799
|
+
}
|
|
4800
|
+
}
|
|
4801
|
+
controller.enqueue("data: ".concat(JSON.stringify(chunk), "\n\n"));
|
|
4802
|
+
_state.label = 4;
|
|
4803
|
+
case 4:
|
|
4804
|
+
_iteratorAbruptCompletion = false;
|
|
4805
|
+
return [
|
|
4806
|
+
3,
|
|
4807
|
+
2
|
|
4808
|
+
];
|
|
4809
|
+
case 5:
|
|
4810
|
+
return [
|
|
4811
|
+
3,
|
|
4812
|
+
12
|
|
4813
|
+
];
|
|
4814
|
+
case 6:
|
|
4815
|
+
err = _state.sent();
|
|
4816
|
+
_didIteratorError = true;
|
|
4817
|
+
_iteratorError = err;
|
|
4818
|
+
return [
|
|
4819
|
+
3,
|
|
4820
|
+
12
|
|
4821
|
+
];
|
|
4822
|
+
case 7:
|
|
4823
|
+
_state.trys.push([
|
|
4824
|
+
7,
|
|
4825
|
+
,
|
|
4826
|
+
10,
|
|
4827
|
+
11
|
|
4828
|
+
]);
|
|
4829
|
+
if (!(_iteratorAbruptCompletion && _iterator.return != null)) return [
|
|
4830
|
+
3,
|
|
4831
|
+
9
|
|
4832
|
+
];
|
|
4833
|
+
return [
|
|
4834
|
+
4,
|
|
4835
|
+
_iterator.return()
|
|
4836
|
+
];
|
|
4837
|
+
case 8:
|
|
4838
|
+
_state.sent();
|
|
4839
|
+
_state.label = 9;
|
|
4840
|
+
case 9:
|
|
4841
|
+
return [
|
|
4842
|
+
3,
|
|
4843
|
+
11
|
|
4844
|
+
];
|
|
4845
|
+
case 10:
|
|
4846
|
+
if (_didIteratorError) {
|
|
4847
|
+
throw _iteratorError;
|
|
4848
|
+
}
|
|
4849
|
+
return [
|
|
4850
|
+
7
|
|
4851
|
+
];
|
|
4852
|
+
case 11:
|
|
4853
|
+
return [
|
|
4854
|
+
7
|
|
4855
|
+
];
|
|
4856
|
+
case 12:
|
|
4857
|
+
controller.close();
|
|
4858
|
+
return [
|
|
4859
|
+
2
|
|
4860
|
+
];
|
|
4861
|
+
}
|
|
4862
|
+
});
|
|
4863
|
+
})();
|
|
4864
|
+
}
|
|
4865
|
+
});
|
|
4866
|
+
return [
|
|
4867
|
+
2,
|
|
4868
|
+
new Response(stream2, {
|
|
4869
|
+
headers: {
|
|
4870
|
+
"Content-Type": "text/event-stream"
|
|
4871
|
+
}
|
|
4872
|
+
})
|
|
4873
|
+
];
|
|
4874
|
+
}
|
|
4875
|
+
displayWidth = computerUseConfig.displayWidth, displayHeight = computerUseConfig.displayHeight;
|
|
4876
|
+
stream = new ReadableStream({
|
|
4877
|
+
start: function start(controller) {
|
|
4878
|
+
return _async_to_generator(function() {
|
|
4879
|
+
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, _ref, _tc_function1, initialArgs, denormalized, _argumentBuffers_get, _ref1, _tc_function2, buf, denormalized1, modifiedChunk, err1, _iteratorNormalCompletion1, _didIteratorError2, _iteratorError2, _iterator2, _step2, _step_value, index, buf1, denormalized2, flushChunk;
|
|
4013
4880
|
return _ts_generator(this, function(_state) {
|
|
4014
4881
|
switch(_state.label){
|
|
4015
4882
|
case 0:
|
|
4883
|
+
computerCallIndices = /* @__PURE__ */ new Set();
|
|
4884
|
+
argumentBuffers = /* @__PURE__ */ new Map();
|
|
4885
|
+
emittedIndices = /* @__PURE__ */ new Set();
|
|
4016
4886
|
_iteratorAbruptCompletion = false, _didIteratorError = false;
|
|
4017
4887
|
_state.label = 1;
|
|
4018
4888
|
case 1:
|
|
@@ -4036,7 +4906,105 @@ var post9 = function(param) {
|
|
|
4036
4906
|
];
|
|
4037
4907
|
_value = _step.value;
|
|
4038
4908
|
chunk = _value;
|
|
4039
|
-
|
|
4909
|
+
choices = (_chunk_choices = chunk.choices) !== null && _chunk_choices !== void 0 ? _chunk_choices : [];
|
|
4910
|
+
choice = choices[0];
|
|
4911
|
+
if (!(choice === null || choice === void 0 ? void 0 : (_choice_delta = choice.delta) === null || _choice_delta === void 0 ? void 0 : _choice_delta.tool_calls)) {
|
|
4912
|
+
controller.enqueue("data: ".concat(JSON.stringify(chunk), "\n\n"));
|
|
4913
|
+
return [
|
|
4914
|
+
3,
|
|
4915
|
+
4
|
|
4916
|
+
];
|
|
4917
|
+
}
|
|
4918
|
+
passThrough = [];
|
|
4919
|
+
_iteratorNormalCompletion = true, _didIteratorError1 = false, _iteratorError1 = undefined;
|
|
4920
|
+
try {
|
|
4921
|
+
for(_iterator1 = choice.delta.tool_calls[Symbol.iterator](); !(_iteratorNormalCompletion = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion = true){
|
|
4922
|
+
tc = _step1.value;
|
|
4923
|
+
;
|
|
4924
|
+
if (((_tc_function = tc.function) === null || _tc_function === void 0 ? void 0 : _tc_function.name) === "computer_call") {
|
|
4925
|
+
;
|
|
4926
|
+
;
|
|
4927
|
+
computerCallIndices.add(tc.index);
|
|
4928
|
+
initialArgs = (_ref = (_tc_function1 = tc.function) === null || _tc_function1 === void 0 ? void 0 : _tc_function1.arguments) !== null && _ref !== void 0 ? _ref : "";
|
|
4929
|
+
argumentBuffers.set(tc.index, initialArgs);
|
|
4930
|
+
passThrough.push(_object_spread_props(_object_spread({}, tc), {
|
|
4931
|
+
function: _object_spread_props(_object_spread({}, tc.function), {
|
|
4932
|
+
arguments: ""
|
|
4933
|
+
})
|
|
4934
|
+
}));
|
|
4935
|
+
if (initialArgs) {
|
|
4936
|
+
try {
|
|
4937
|
+
JSON.parse(initialArgs);
|
|
4938
|
+
denormalized = denormalizeComputerCallArguments({
|
|
4939
|
+
argumentsText: initialArgs,
|
|
4940
|
+
displayWidth: displayWidth,
|
|
4941
|
+
displayHeight: displayHeight,
|
|
4942
|
+
model: model
|
|
4943
|
+
});
|
|
4944
|
+
passThrough.push({
|
|
4945
|
+
index: tc.index,
|
|
4946
|
+
function: {
|
|
4947
|
+
arguments: denormalized
|
|
4948
|
+
}
|
|
4949
|
+
});
|
|
4950
|
+
emittedIndices.add(tc.index);
|
|
4951
|
+
} catch (unused) {}
|
|
4952
|
+
}
|
|
4953
|
+
continue;
|
|
4954
|
+
}
|
|
4955
|
+
if (computerCallIndices.has(tc.index)) {
|
|
4956
|
+
;
|
|
4957
|
+
;
|
|
4958
|
+
buf = ((_argumentBuffers_get = argumentBuffers.get(tc.index)) !== null && _argumentBuffers_get !== void 0 ? _argumentBuffers_get : "") + ((_ref1 = (_tc_function2 = tc.function) === null || _tc_function2 === void 0 ? void 0 : _tc_function2.arguments) !== null && _ref1 !== void 0 ? _ref1 : "");
|
|
4959
|
+
argumentBuffers.set(tc.index, buf);
|
|
4960
|
+
if (!emittedIndices.has(tc.index)) {
|
|
4961
|
+
try {
|
|
4962
|
+
JSON.parse(buf);
|
|
4963
|
+
denormalized1 = denormalizeComputerCallArguments({
|
|
4964
|
+
argumentsText: buf,
|
|
4965
|
+
displayWidth: displayWidth,
|
|
4966
|
+
displayHeight: displayHeight,
|
|
4967
|
+
model: model
|
|
4968
|
+
});
|
|
4969
|
+
passThrough.push({
|
|
4970
|
+
index: tc.index,
|
|
4971
|
+
function: {
|
|
4972
|
+
arguments: denormalized1
|
|
4973
|
+
}
|
|
4974
|
+
});
|
|
4975
|
+
emittedIndices.add(tc.index);
|
|
4976
|
+
} catch (unused) {}
|
|
4977
|
+
}
|
|
4978
|
+
continue;
|
|
4979
|
+
}
|
|
4980
|
+
passThrough.push(tc);
|
|
4981
|
+
}
|
|
4982
|
+
} catch (err) {
|
|
4983
|
+
_didIteratorError1 = true;
|
|
4984
|
+
_iteratorError1 = err;
|
|
4985
|
+
} finally{
|
|
4986
|
+
try {
|
|
4987
|
+
if (!_iteratorNormalCompletion && _iterator1.return != null) {
|
|
4988
|
+
_iterator1.return();
|
|
4989
|
+
}
|
|
4990
|
+
} finally{
|
|
4991
|
+
if (_didIteratorError1) {
|
|
4992
|
+
throw _iteratorError1;
|
|
4993
|
+
}
|
|
4994
|
+
}
|
|
4995
|
+
}
|
|
4996
|
+
if (passThrough.length > 0) {
|
|
4997
|
+
modifiedChunk = _object_spread_props(_object_spread({}, chunk), {
|
|
4998
|
+
choices: [
|
|
4999
|
+
_object_spread_props(_object_spread({}, choice), {
|
|
5000
|
+
delta: _object_spread_props(_object_spread({}, choice.delta), {
|
|
5001
|
+
tool_calls: passThrough
|
|
5002
|
+
})
|
|
5003
|
+
})
|
|
5004
|
+
]
|
|
5005
|
+
});
|
|
5006
|
+
controller.enqueue("data: ".concat(JSON.stringify(modifiedChunk), "\n\n"));
|
|
5007
|
+
}
|
|
4040
5008
|
_state.label = 4;
|
|
4041
5009
|
case 4:
|
|
4042
5010
|
_iteratorAbruptCompletion = false;
|
|
@@ -4050,9 +5018,9 @@ var post9 = function(param) {
|
|
|
4050
5018
|
12
|
|
4051
5019
|
];
|
|
4052
5020
|
case 6:
|
|
4053
|
-
|
|
5021
|
+
err1 = _state.sent();
|
|
4054
5022
|
_didIteratorError = true;
|
|
4055
|
-
_iteratorError =
|
|
5023
|
+
_iteratorError = err1;
|
|
4056
5024
|
return [
|
|
4057
5025
|
3,
|
|
4058
5026
|
12
|
|
@@ -4092,6 +5060,52 @@ var post9 = function(param) {
|
|
|
4092
5060
|
7
|
|
4093
5061
|
];
|
|
4094
5062
|
case 12:
|
|
5063
|
+
_iteratorNormalCompletion1 = true, _didIteratorError2 = false, _iteratorError2 = undefined;
|
|
5064
|
+
try {
|
|
5065
|
+
for(_iterator2 = Array.from(argumentBuffers)[Symbol.iterator](); !(_iteratorNormalCompletion1 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion1 = true){
|
|
5066
|
+
_step_value = _sliced_to_array(_step2.value, 2), index = _step_value[0], buf1 = _step_value[1];
|
|
5067
|
+
if (!emittedIndices.has(index) && buf1) {
|
|
5068
|
+
denormalized2 = denormalizeComputerCallArguments({
|
|
5069
|
+
argumentsText: buf1,
|
|
5070
|
+
displayWidth: displayWidth,
|
|
5071
|
+
displayHeight: displayHeight,
|
|
5072
|
+
model: model
|
|
5073
|
+
});
|
|
5074
|
+
flushChunk = {
|
|
5075
|
+
object: "chat.completion.chunk",
|
|
5076
|
+
choices: [
|
|
5077
|
+
{
|
|
5078
|
+
index: 0,
|
|
5079
|
+
delta: {
|
|
5080
|
+
tool_calls: [
|
|
5081
|
+
{
|
|
5082
|
+
index: index,
|
|
5083
|
+
function: {
|
|
5084
|
+
arguments: denormalized2
|
|
5085
|
+
}
|
|
5086
|
+
}
|
|
5087
|
+
]
|
|
5088
|
+
}
|
|
5089
|
+
}
|
|
5090
|
+
]
|
|
5091
|
+
};
|
|
5092
|
+
controller.enqueue("data: ".concat(JSON.stringify(flushChunk), "\n\n"));
|
|
5093
|
+
}
|
|
5094
|
+
}
|
|
5095
|
+
} catch (err) {
|
|
5096
|
+
_didIteratorError2 = true;
|
|
5097
|
+
_iteratorError2 = err;
|
|
5098
|
+
} finally{
|
|
5099
|
+
try {
|
|
5100
|
+
if (!_iteratorNormalCompletion1 && _iterator2.return != null) {
|
|
5101
|
+
_iterator2.return();
|
|
5102
|
+
}
|
|
5103
|
+
} finally{
|
|
5104
|
+
if (_didIteratorError2) {
|
|
5105
|
+
throw _iteratorError2;
|
|
5106
|
+
}
|
|
5107
|
+
}
|
|
5108
|
+
}
|
|
4095
5109
|
controller.close();
|
|
4096
5110
|
return [
|
|
4097
5111
|
2
|
|
@@ -4118,15 +5132,91 @@ var post9 = function(param) {
|
|
|
4118
5132
|
]);
|
|
4119
5133
|
return [
|
|
4120
5134
|
4,
|
|
4121
|
-
|
|
5135
|
+
openRouter.chat.completions.create(resultOptions)
|
|
4122
5136
|
];
|
|
4123
5137
|
case 3:
|
|
4124
5138
|
data = _state.sent();
|
|
5139
|
+
if (computerUseConfig) {
|
|
5140
|
+
;
|
|
5141
|
+
_iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = undefined;
|
|
5142
|
+
try {
|
|
5143
|
+
for(_iterator = ((_data_choices = data.choices) !== null && _data_choices !== void 0 ? _data_choices : [])[Symbol.iterator](); !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true){
|
|
5144
|
+
choice = _step.value;
|
|
5145
|
+
;
|
|
5146
|
+
;
|
|
5147
|
+
_iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = undefined;
|
|
5148
|
+
try {
|
|
5149
|
+
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){
|
|
5150
|
+
tc = _step1.value;
|
|
5151
|
+
fn = tc.function;
|
|
5152
|
+
if ((fn === null || fn === void 0 ? void 0 : fn.name) === "computer_call") {
|
|
5153
|
+
fn.arguments = denormalizeComputerCallArguments({
|
|
5154
|
+
argumentsText: fn.arguments,
|
|
5155
|
+
displayWidth: computerUseConfig.displayWidth,
|
|
5156
|
+
displayHeight: computerUseConfig.displayHeight,
|
|
5157
|
+
model: model
|
|
5158
|
+
});
|
|
5159
|
+
}
|
|
5160
|
+
}
|
|
5161
|
+
} catch (err) {
|
|
5162
|
+
_didIteratorError1 = true;
|
|
5163
|
+
_iteratorError1 = err;
|
|
5164
|
+
} finally{
|
|
5165
|
+
try {
|
|
5166
|
+
if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
|
|
5167
|
+
_iterator1.return();
|
|
5168
|
+
}
|
|
5169
|
+
} finally{
|
|
5170
|
+
if (_didIteratorError1) {
|
|
5171
|
+
throw _iteratorError1;
|
|
5172
|
+
}
|
|
5173
|
+
}
|
|
5174
|
+
}
|
|
5175
|
+
}
|
|
5176
|
+
} catch (err) {
|
|
5177
|
+
_didIteratorError = true;
|
|
5178
|
+
_iteratorError = err;
|
|
5179
|
+
} finally{
|
|
5180
|
+
try {
|
|
5181
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
5182
|
+
_iterator.return();
|
|
5183
|
+
}
|
|
5184
|
+
} finally{
|
|
5185
|
+
if (_didIteratorError) {
|
|
5186
|
+
throw _iteratorError;
|
|
5187
|
+
}
|
|
5188
|
+
}
|
|
5189
|
+
}
|
|
5190
|
+
}
|
|
5191
|
+
if (getQuirks(model).cleanArtifacts) {
|
|
5192
|
+
;
|
|
5193
|
+
_iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = undefined;
|
|
5194
|
+
try {
|
|
5195
|
+
for(_iterator2 = ((_data_choices1 = data.choices) !== null && _data_choices1 !== void 0 ? _data_choices1 : [])[Symbol.iterator](); !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true){
|
|
5196
|
+
choice1 = _step2.value;
|
|
5197
|
+
;
|
|
5198
|
+
if ((_choice_message1 = choice1.message) === null || _choice_message1 === void 0 ? void 0 : _choice_message1.content) {
|
|
5199
|
+
choice1.message.content = sanitizeContent(choice1.message.content);
|
|
5200
|
+
}
|
|
5201
|
+
}
|
|
5202
|
+
} catch (err) {
|
|
5203
|
+
_didIteratorError2 = true;
|
|
5204
|
+
_iteratorError2 = err;
|
|
5205
|
+
} finally{
|
|
5206
|
+
try {
|
|
5207
|
+
if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
|
|
5208
|
+
_iterator2.return();
|
|
5209
|
+
}
|
|
5210
|
+
} finally{
|
|
5211
|
+
if (_didIteratorError2) {
|
|
5212
|
+
throw _iteratorError2;
|
|
5213
|
+
}
|
|
5214
|
+
}
|
|
5215
|
+
}
|
|
5216
|
+
}
|
|
4125
5217
|
return [
|
|
4126
5218
|
2,
|
|
4127
|
-
new Response(JSON.stringify({
|
|
4128
|
-
data: data
|
|
4129
|
-
}), {
|
|
5219
|
+
new Response(JSON.stringify(data), {
|
|
4130
5220
|
status: 200,
|
|
4131
5221
|
headers: {
|
|
4132
5222
|
"Content-Type": "application/json"
|
|
@@ -4155,26 +5245,26 @@ var post9 = function(param) {
|
|
|
4155
5245
|
})();
|
|
4156
5246
|
};
|
|
4157
5247
|
};
|
|
4158
|
-
// src/adapters/client/
|
|
4159
|
-
var
|
|
4160
|
-
var
|
|
5248
|
+
// src/adapters/client/openRouterClientAdapter/completions/index.ts
|
|
5249
|
+
var completions10 = function(param) {
|
|
5250
|
+
var openRouter = param.openRouter;
|
|
4161
5251
|
return {
|
|
4162
|
-
post:
|
|
4163
|
-
|
|
5252
|
+
post: post10({
|
|
5253
|
+
openRouter: openRouter
|
|
4164
5254
|
})
|
|
4165
5255
|
};
|
|
4166
5256
|
};
|
|
4167
|
-
// src/adapters/client/
|
|
4168
|
-
var
|
|
4169
|
-
var
|
|
5257
|
+
// src/adapters/client/openRouterClientAdapter/index.ts
|
|
5258
|
+
var openRouterClientAdapter = function(param) {
|
|
5259
|
+
var openRouter = param.openRouter;
|
|
4170
5260
|
return {
|
|
4171
|
-
client:
|
|
5261
|
+
client: openRouter,
|
|
4172
5262
|
requestHandlers: {
|
|
4173
|
-
"^/v1/models$":
|
|
4174
|
-
|
|
5263
|
+
"^/v1/models$": models13({
|
|
5264
|
+
openRouter: openRouter
|
|
4175
5265
|
}),
|
|
4176
|
-
"^/(?:v1|/?openai)/chat/completions$":
|
|
4177
|
-
|
|
5266
|
+
"^/(?:v1|/?openai)/chat/completions$": completions10({
|
|
5267
|
+
openRouter: openRouter
|
|
4178
5268
|
})
|
|
4179
5269
|
}
|
|
4180
5270
|
};
|
|
@@ -4821,7 +5911,7 @@ var serializeThread = function(param) {
|
|
|
4821
5911
|
};
|
|
4822
5912
|
};
|
|
4823
5913
|
// src/adapters/storage/prismaStorageAdapter/threads/post.ts
|
|
4824
|
-
var
|
|
5914
|
+
var post11 = function(param) {
|
|
4825
5915
|
var prisma = param.prisma;
|
|
4826
5916
|
return function(_urlString, options) {
|
|
4827
5917
|
return _async_to_generator(function() {
|
|
@@ -4897,7 +5987,7 @@ var post10 = function(param) {
|
|
|
4897
5987
|
var threads = function(param) {
|
|
4898
5988
|
var prisma = param.prisma;
|
|
4899
5989
|
return {
|
|
4900
|
-
post:
|
|
5990
|
+
post: post11({
|
|
4901
5991
|
prisma: prisma
|
|
4902
5992
|
})
|
|
4903
5993
|
};
|
|
@@ -4957,7 +6047,7 @@ var messageContentBlocks = function(param) {
|
|
|
4957
6047
|
}
|
|
4958
6048
|
];
|
|
4959
6049
|
};
|
|
4960
|
-
var
|
|
6050
|
+
var post12 = function(param) {
|
|
4961
6051
|
var prisma = param.prisma;
|
|
4962
6052
|
return function(urlString, options) {
|
|
4963
6053
|
return _async_to_generator(function() {
|
|
@@ -5005,7 +6095,7 @@ var post11 = function(param) {
|
|
|
5005
6095
|
};
|
|
5006
6096
|
// src/adapters/storage/prismaStorageAdapter/threads/messages/get.ts
|
|
5007
6097
|
var import_radash10 = require("radash");
|
|
5008
|
-
var
|
|
6098
|
+
var get12 = function(param) {
|
|
5009
6099
|
var prisma = param.prisma;
|
|
5010
6100
|
return function(urlString) {
|
|
5011
6101
|
return _async_to_generator(function() {
|
|
@@ -5066,10 +6156,10 @@ var get11 = function(param) {
|
|
|
5066
6156
|
var messages2 = function(param) {
|
|
5067
6157
|
var prisma = param.prisma;
|
|
5068
6158
|
return {
|
|
5069
|
-
post:
|
|
6159
|
+
post: post12({
|
|
5070
6160
|
prisma: prisma
|
|
5071
6161
|
}),
|
|
5072
|
-
get:
|
|
6162
|
+
get: get12({
|
|
5073
6163
|
prisma: prisma
|
|
5074
6164
|
})
|
|
5075
6165
|
};
|
|
@@ -5140,7 +6230,7 @@ var mapPrismaRun = function(run4) {
|
|
|
5140
6230
|
};
|
|
5141
6231
|
};
|
|
5142
6232
|
// src/adapters/storage/prismaStorageAdapter/threads/runs/get.ts
|
|
5143
|
-
var
|
|
6233
|
+
var get13 = function(param) {
|
|
5144
6234
|
var prisma = param.prisma;
|
|
5145
6235
|
return function(urlString) {
|
|
5146
6236
|
return _async_to_generator(function() {
|
|
@@ -5587,7 +6677,7 @@ var getMessages = function(param) {
|
|
|
5587
6677
|
};
|
|
5588
6678
|
};
|
|
5589
6679
|
// src/adapters/storage/prismaStorageAdapter/threads/runs/post.ts
|
|
5590
|
-
var
|
|
6680
|
+
var post13 = function(param) {
|
|
5591
6681
|
var prisma = param.prisma, runAdapter = param.runAdapter;
|
|
5592
6682
|
return function(urlString, options) {
|
|
5593
6683
|
return _async_to_generator(function() {
|
|
@@ -5761,17 +6851,17 @@ var post12 = function(param) {
|
|
|
5761
6851
|
var runs = function(param) {
|
|
5762
6852
|
var prisma = param.prisma, runAdapter = param.runAdapter;
|
|
5763
6853
|
return {
|
|
5764
|
-
get:
|
|
6854
|
+
get: get13({
|
|
5765
6855
|
prisma: prisma
|
|
5766
6856
|
}),
|
|
5767
|
-
post:
|
|
6857
|
+
post: post13({
|
|
5768
6858
|
prisma: prisma,
|
|
5769
6859
|
runAdapter: runAdapter
|
|
5770
6860
|
})
|
|
5771
6861
|
};
|
|
5772
6862
|
};
|
|
5773
6863
|
// src/adapters/storage/prismaStorageAdapter/threads/run/get.ts
|
|
5774
|
-
var
|
|
6864
|
+
var get14 = function(param) {
|
|
5775
6865
|
var prisma = param.prisma;
|
|
5776
6866
|
return function(urlString) {
|
|
5777
6867
|
return _async_to_generator(function() {
|
|
@@ -5826,14 +6916,14 @@ var get13 = function(param) {
|
|
|
5826
6916
|
var run = function(param) {
|
|
5827
6917
|
var prisma = param.prisma, runAdapter = param.runAdapter;
|
|
5828
6918
|
return {
|
|
5829
|
-
get:
|
|
6919
|
+
get: get14({
|
|
5830
6920
|
prisma: prisma
|
|
5831
6921
|
})
|
|
5832
6922
|
};
|
|
5833
6923
|
};
|
|
5834
6924
|
// src/adapters/storage/prismaStorageAdapter/threads/runs/steps/get.ts
|
|
5835
6925
|
var import_radash13 = require("radash");
|
|
5836
|
-
var
|
|
6926
|
+
var get15 = function(param) {
|
|
5837
6927
|
var prisma = param.prisma;
|
|
5838
6928
|
return function(urlString) {
|
|
5839
6929
|
return _async_to_generator(function() {
|
|
@@ -5895,7 +6985,7 @@ var get14 = function(param) {
|
|
|
5895
6985
|
var steps = function(param) {
|
|
5896
6986
|
var prisma = param.prisma;
|
|
5897
6987
|
return {
|
|
5898
|
-
get:
|
|
6988
|
+
get: get15({
|
|
5899
6989
|
prisma: prisma
|
|
5900
6990
|
})
|
|
5901
6991
|
};
|
|
@@ -6063,7 +7153,7 @@ var updateRun = function(param) {
|
|
|
6063
7153
|
})();
|
|
6064
7154
|
};
|
|
6065
7155
|
// src/adapters/storage/prismaStorageAdapter/threads/runs/submitToolOutputs/post/index.ts
|
|
6066
|
-
var
|
|
7156
|
+
var post14 = function(param) {
|
|
6067
7157
|
var prisma = param.prisma, runAdapter = param.runAdapter;
|
|
6068
7158
|
return function(urlString, options) {
|
|
6069
7159
|
return _async_to_generator(function() {
|
|
@@ -6231,7 +7321,7 @@ var post13 = function(param) {
|
|
|
6231
7321
|
var submitToolOutputs = function(param) {
|
|
6232
7322
|
var prisma = param.prisma, runAdapter = param.runAdapter;
|
|
6233
7323
|
return {
|
|
6234
|
-
post:
|
|
7324
|
+
post: post14({
|
|
6235
7325
|
prisma: prisma,
|
|
6236
7326
|
// @ts-ignore-next-line
|
|
6237
7327
|
runAdapter: runAdapter
|
|
@@ -6240,7 +7330,7 @@ var submitToolOutputs = function(param) {
|
|
|
6240
7330
|
};
|
|
6241
7331
|
// src/adapters/storage/prismaStorageAdapter/assistants/post.ts
|
|
6242
7332
|
var import_dayjs9 = __toESM(require("dayjs"), 1);
|
|
6243
|
-
var
|
|
7333
|
+
var post15 = function(param) {
|
|
6244
7334
|
var prisma = param.prisma;
|
|
6245
7335
|
return function(_url, options) {
|
|
6246
7336
|
return _async_to_generator(function() {
|
|
@@ -6293,7 +7383,7 @@ var post14 = function(param) {
|
|
|
6293
7383
|
var assistants = function(param) {
|
|
6294
7384
|
var prisma = param.prisma;
|
|
6295
7385
|
return {
|
|
6296
|
-
post:
|
|
7386
|
+
post: post15({
|
|
6297
7387
|
prisma: prisma
|
|
6298
7388
|
})
|
|
6299
7389
|
};
|
|
@@ -6342,7 +7432,7 @@ var serializeThread2 = function(param) {
|
|
|
6342
7432
|
};
|
|
6343
7433
|
};
|
|
6344
7434
|
// src/adapters/storage/responsesStorageAdapter/threads/post.ts
|
|
6345
|
-
var
|
|
7435
|
+
var post16 = function(param) {
|
|
6346
7436
|
var client = param.client, _param_addAnnotations = param.addAnnotations, addAnnotations = _param_addAnnotations === void 0 ? false : _param_addAnnotations;
|
|
6347
7437
|
return function(_urlString, options) {
|
|
6348
7438
|
return _async_to_generator(function() {
|
|
@@ -6463,7 +7553,7 @@ var post15 = function(param) {
|
|
|
6463
7553
|
var threads2 = function(param) {
|
|
6464
7554
|
var client = param.client, _param_addAnnotations = param.addAnnotations, addAnnotations = _param_addAnnotations === void 0 ? false : _param_addAnnotations;
|
|
6465
7555
|
return {
|
|
6466
|
-
post:
|
|
7556
|
+
post: post16({
|
|
6467
7557
|
client: client,
|
|
6468
7558
|
addAnnotations: addAnnotations
|
|
6469
7559
|
})
|
|
@@ -6641,7 +7731,7 @@ var messageContentBlocks2 = function(param) {
|
|
|
6641
7731
|
attachments: attachments
|
|
6642
7732
|
})));
|
|
6643
7733
|
};
|
|
6644
|
-
var
|
|
7734
|
+
var post17 = function(param) {
|
|
6645
7735
|
var runAdapter = param.runAdapter, createResponseItems = param.createResponseItems, _param_addAnnotations = param.addAnnotations, addAnnotations = _param_addAnnotations === void 0 ? false : _param_addAnnotations;
|
|
6646
7736
|
return function(urlString, options) {
|
|
6647
7737
|
return _async_to_generator(function() {
|
|
@@ -6734,7 +7824,7 @@ function responseId(param) {
|
|
|
6734
7824
|
return null;
|
|
6735
7825
|
}
|
|
6736
7826
|
// src/adapters/storage/responsesStorageAdapter/threads/messages/get.ts
|
|
6737
|
-
var
|
|
7827
|
+
var get16 = function(param) {
|
|
6738
7828
|
var client = param.client, runAdapter = param.runAdapter;
|
|
6739
7829
|
return function(urlString) {
|
|
6740
7830
|
return _async_to_generator(function() {
|
|
@@ -6946,19 +8036,19 @@ var assignTimestamps = function(param) {
|
|
|
6946
8036
|
var messages3 = function(param) {
|
|
6947
8037
|
var client = param.client, runAdapter = param.runAdapter, createResponseItems = param.createResponseItems, _param_addAnnotations = param.addAnnotations, addAnnotations = _param_addAnnotations === void 0 ? false : _param_addAnnotations;
|
|
6948
8038
|
return {
|
|
6949
|
-
post:
|
|
8039
|
+
post: post17({
|
|
6950
8040
|
runAdapter: runAdapter,
|
|
6951
8041
|
createResponseItems: createResponseItems,
|
|
6952
8042
|
addAnnotations: addAnnotations
|
|
6953
8043
|
}),
|
|
6954
|
-
get:
|
|
8044
|
+
get: get16({
|
|
6955
8045
|
client: client,
|
|
6956
8046
|
runAdapter: runAdapter
|
|
6957
8047
|
})
|
|
6958
8048
|
};
|
|
6959
8049
|
};
|
|
6960
8050
|
// src/adapters/storage/responsesStorageAdapter/threads/runs/get.ts
|
|
6961
|
-
var
|
|
8051
|
+
var get17 = function() {
|
|
6962
8052
|
return function(urlString) {
|
|
6963
8053
|
return _async_to_generator(function() {
|
|
6964
8054
|
return _ts_generator(this, function(_state) {
|
|
@@ -7459,7 +8549,7 @@ var defaultAssistant = {
|
|
|
7459
8549
|
}
|
|
7460
8550
|
};
|
|
7461
8551
|
// src/adapters/storage/responsesStorageAdapter/threads/runs/post.ts
|
|
7462
|
-
var
|
|
8552
|
+
var post18 = function(param) {
|
|
7463
8553
|
var client = param.client, runAdapter = param.runAdapter, createResponseItems = param.createResponseItems;
|
|
7464
8554
|
return function(urlString, options) {
|
|
7465
8555
|
return _async_to_generator(function() {
|
|
@@ -7638,8 +8728,8 @@ var post17 = function(param) {
|
|
|
7638
8728
|
var runs2 = function(param) {
|
|
7639
8729
|
var client = param.client, runAdapter = param.runAdapter, createResponseItems = param.createResponseItems;
|
|
7640
8730
|
return {
|
|
7641
|
-
get:
|
|
7642
|
-
post:
|
|
8731
|
+
get: get17(),
|
|
8732
|
+
post: post18({
|
|
7643
8733
|
client: client,
|
|
7644
8734
|
createResponseItems: createResponseItems,
|
|
7645
8735
|
runAdapter: runAdapter
|
|
@@ -7647,7 +8737,7 @@ var runs2 = function(param) {
|
|
|
7647
8737
|
};
|
|
7648
8738
|
};
|
|
7649
8739
|
// src/adapters/storage/responsesStorageAdapter/threads/run/get.ts
|
|
7650
|
-
var
|
|
8740
|
+
var get18 = function(param) {
|
|
7651
8741
|
var client = param.client, runAdapter = param.runAdapter;
|
|
7652
8742
|
return function(urlString) {
|
|
7653
8743
|
return _async_to_generator(function() {
|
|
@@ -7697,7 +8787,7 @@ var get17 = function(param) {
|
|
|
7697
8787
|
var run2 = function(param) {
|
|
7698
8788
|
var client = param.client, runAdapter = param.runAdapter;
|
|
7699
8789
|
return {
|
|
7700
|
-
get:
|
|
8790
|
+
get: get18({
|
|
7701
8791
|
client: client,
|
|
7702
8792
|
runAdapter: runAdapter
|
|
7703
8793
|
})
|
|
@@ -8218,7 +9308,7 @@ var serializeItemAsReasoningRunStep = function(param) {
|
|
|
8218
9308
|
};
|
|
8219
9309
|
};
|
|
8220
9310
|
// src/adapters/storage/responsesStorageAdapter/threads/runs/steps/get.ts
|
|
8221
|
-
var
|
|
9311
|
+
var get19 = function(param) {
|
|
8222
9312
|
var client = param.client, runAdapter = param.runAdapter;
|
|
8223
9313
|
return function(urlString) {
|
|
8224
9314
|
return _async_to_generator(function() {
|
|
@@ -8387,7 +9477,7 @@ var get18 = function(param) {
|
|
|
8387
9477
|
var steps2 = function(param) {
|
|
8388
9478
|
var client = param.client, runAdapter = param.runAdapter;
|
|
8389
9479
|
return {
|
|
8390
|
-
get:
|
|
9480
|
+
get: get19({
|
|
8391
9481
|
client: client,
|
|
8392
9482
|
runAdapter: runAdapter
|
|
8393
9483
|
})
|
|
@@ -8469,7 +9559,7 @@ var truncation2 = function(param) {
|
|
|
8469
9559
|
return "auto";
|
|
8470
9560
|
};
|
|
8471
9561
|
// src/adapters/storage/responsesStorageAdapter/threads/runs/submitToolOutputs/post/index.ts
|
|
8472
|
-
var
|
|
9562
|
+
var post19 = function(param) {
|
|
8473
9563
|
var client = param.client, runAdapter = param.runAdapter;
|
|
8474
9564
|
return function(urlString, options) {
|
|
8475
9565
|
return _async_to_generator(function() {
|
|
@@ -8606,14 +9696,14 @@ var post18 = function(param) {
|
|
|
8606
9696
|
var submitToolOutputs2 = function(param) {
|
|
8607
9697
|
var client = param.client, runAdapter = param.runAdapter;
|
|
8608
9698
|
return {
|
|
8609
|
-
post:
|
|
9699
|
+
post: post19({
|
|
8610
9700
|
client: client,
|
|
8611
9701
|
runAdapter: runAdapter
|
|
8612
9702
|
})
|
|
8613
9703
|
};
|
|
8614
9704
|
};
|
|
8615
9705
|
// src/adapters/storage/responsesStorageAdapter/assistants/get.ts
|
|
8616
|
-
var
|
|
9706
|
+
var get20 = function(param) {
|
|
8617
9707
|
var runAdapter = param.runAdapter;
|
|
8618
9708
|
return function(_urlString) {
|
|
8619
9709
|
return _async_to_generator(function() {
|
|
@@ -8662,7 +9752,7 @@ var get19 = function(param) {
|
|
|
8662
9752
|
};
|
|
8663
9753
|
};
|
|
8664
9754
|
// src/adapters/storage/responsesStorageAdapter/assistants/post.ts
|
|
8665
|
-
var
|
|
9755
|
+
var post20 = function() {
|
|
8666
9756
|
return function() {
|
|
8667
9757
|
return _async_to_generator(function() {
|
|
8668
9758
|
return _ts_generator(this, function(_state) {
|
|
@@ -8688,10 +9778,10 @@ var post19 = function() {
|
|
|
8688
9778
|
var assistants2 = function(param) {
|
|
8689
9779
|
var runAdapter = param.runAdapter;
|
|
8690
9780
|
return {
|
|
8691
|
-
get:
|
|
9781
|
+
get: get20({
|
|
8692
9782
|
runAdapter: runAdapter
|
|
8693
9783
|
}),
|
|
8694
|
-
post:
|
|
9784
|
+
post: post20()
|
|
8695
9785
|
};
|
|
8696
9786
|
};
|
|
8697
9787
|
// src/adapters/storage/responsesStorageAdapter/index.ts
|
|
@@ -8735,7 +9825,7 @@ var responseRegexp = "^/(?:v1|/?openai)/responses/([^/]+)$";
|
|
|
8735
9825
|
var import_radash23 = require("radash");
|
|
8736
9826
|
var import_dayjs21 = __toESM(require("dayjs"), 1);
|
|
8737
9827
|
var import_radash24 = require("radash");
|
|
8738
|
-
var
|
|
9828
|
+
var post21 = function(param) {
|
|
8739
9829
|
var client = param.client, runAdapter = param.runAdapter, createResponseItems = param.createResponseItems;
|
|
8740
9830
|
return function(urlString, options) {
|
|
8741
9831
|
return _async_to_generator(function() {
|
|
@@ -8926,8 +10016,8 @@ var post20 = function(param) {
|
|
|
8926
10016
|
var runs3 = function(param) {
|
|
8927
10017
|
var client = param.client, runAdapter = param.runAdapter, createResponseItems = param.createResponseItems;
|
|
8928
10018
|
return {
|
|
8929
|
-
get:
|
|
8930
|
-
post:
|
|
10019
|
+
get: get17(),
|
|
10020
|
+
post: post21({
|
|
8931
10021
|
client: client,
|
|
8932
10022
|
createResponseItems: createResponseItems,
|
|
8933
10023
|
runAdapter: runAdapter
|
|
@@ -8935,7 +10025,7 @@ var runs3 = function(param) {
|
|
|
8935
10025
|
};
|
|
8936
10026
|
};
|
|
8937
10027
|
// src/adapters/storage/azureResponsesStorageAdapter/threads/runs/submitToolOutputs/post/index.ts
|
|
8938
|
-
var
|
|
10028
|
+
var post22 = function(param) {
|
|
8939
10029
|
var client = param.client, runAdapter = param.runAdapter;
|
|
8940
10030
|
return function(urlString, options) {
|
|
8941
10031
|
return _async_to_generator(function() {
|
|
@@ -9081,14 +10171,14 @@ var post21 = function(param) {
|
|
|
9081
10171
|
var submitToolOutputs3 = function(param) {
|
|
9082
10172
|
var client = param.client, runAdapter = param.runAdapter;
|
|
9083
10173
|
return {
|
|
9084
|
-
post:
|
|
10174
|
+
post: post22({
|
|
9085
10175
|
client: client,
|
|
9086
10176
|
runAdapter: runAdapter
|
|
9087
10177
|
})
|
|
9088
10178
|
};
|
|
9089
10179
|
};
|
|
9090
10180
|
// src/adapters/storage/azureResponsesStorageAdapter/responses/get.ts
|
|
9091
|
-
var
|
|
10181
|
+
var get21 = function(param) {
|
|
9092
10182
|
var client = param.client;
|
|
9093
10183
|
return function(urlString) {
|
|
9094
10184
|
return _async_to_generator(function() {
|
|
@@ -9122,7 +10212,7 @@ var get20 = function(param) {
|
|
|
9122
10212
|
var responses = function(param) {
|
|
9123
10213
|
var client = param.client;
|
|
9124
10214
|
return {
|
|
9125
|
-
get:
|
|
10215
|
+
get: get21({
|
|
9126
10216
|
client: client
|
|
9127
10217
|
})
|
|
9128
10218
|
};
|
|
@@ -9333,7 +10423,7 @@ var azureResponsesStorageAdapter = function() {
|
|
|
9333
10423
|
};
|
|
9334
10424
|
// src/adapters/storage/azureAgentsStorageAdapter/threads/post.ts
|
|
9335
10425
|
var import_dayjs22 = __toESM(require("dayjs"), 1);
|
|
9336
|
-
var
|
|
10426
|
+
var post23 = function(param) {
|
|
9337
10427
|
var azureAiProject = param.azureAiProject;
|
|
9338
10428
|
return function(_urlString, options) {
|
|
9339
10429
|
return _async_to_generator(function() {
|
|
@@ -9379,14 +10469,14 @@ var post22 = function(param) {
|
|
|
9379
10469
|
var threads3 = function(param) {
|
|
9380
10470
|
var azureAiProject = param.azureAiProject;
|
|
9381
10471
|
return {
|
|
9382
|
-
post:
|
|
10472
|
+
post: post23({
|
|
9383
10473
|
azureAiProject: azureAiProject
|
|
9384
10474
|
})
|
|
9385
10475
|
};
|
|
9386
10476
|
};
|
|
9387
10477
|
// src/adapters/storage/azureAgentsStorageAdapter/threads/messages/post.ts
|
|
9388
10478
|
var import_dayjs23 = __toESM(require("dayjs"), 1);
|
|
9389
|
-
var
|
|
10479
|
+
var post24 = function(param) {
|
|
9390
10480
|
var azureAiProject = param.azureAiProject, runAdapter = param.runAdapter;
|
|
9391
10481
|
return function(urlString, options) {
|
|
9392
10482
|
return _async_to_generator(function() {
|
|
@@ -9500,7 +10590,7 @@ var post23 = function(param) {
|
|
|
9500
10590
|
};
|
|
9501
10591
|
// src/adapters/storage/azureAgentsStorageAdapter/threads/messages/get.ts
|
|
9502
10592
|
var import_dayjs24 = __toESM(require("dayjs"), 1);
|
|
9503
|
-
var
|
|
10593
|
+
var get22 = function(param) {
|
|
9504
10594
|
var azureAiProject = param.azureAiProject, runAdapter = param.runAdapter;
|
|
9505
10595
|
return function(urlString) {
|
|
9506
10596
|
return _async_to_generator(function() {
|
|
@@ -9688,18 +10778,18 @@ var get21 = function(param) {
|
|
|
9688
10778
|
var messages4 = function(param) {
|
|
9689
10779
|
var azureAiProject = param.azureAiProject, runAdapter = param.runAdapter;
|
|
9690
10780
|
return {
|
|
9691
|
-
post:
|
|
10781
|
+
post: post24({
|
|
9692
10782
|
azureAiProject: azureAiProject,
|
|
9693
10783
|
runAdapter: runAdapter
|
|
9694
10784
|
}),
|
|
9695
|
-
get:
|
|
10785
|
+
get: get22({
|
|
9696
10786
|
azureAiProject: azureAiProject,
|
|
9697
10787
|
runAdapter: runAdapter
|
|
9698
10788
|
})
|
|
9699
10789
|
};
|
|
9700
10790
|
};
|
|
9701
10791
|
// src/adapters/storage/azureAgentsStorageAdapter/threads/runs/get.ts
|
|
9702
|
-
var
|
|
10792
|
+
var get23 = function() {
|
|
9703
10793
|
return function() {
|
|
9704
10794
|
return _async_to_generator(function() {
|
|
9705
10795
|
var response;
|
|
@@ -9726,7 +10816,7 @@ var get22 = function() {
|
|
|
9726
10816
|
// src/adapters/storage/azureAgentsStorageAdapter/threads/runs/post.ts
|
|
9727
10817
|
var import_radash25 = require("radash");
|
|
9728
10818
|
var import_dayjs25 = __toESM(require("dayjs"), 1);
|
|
9729
|
-
var
|
|
10819
|
+
var post25 = function(param) {
|
|
9730
10820
|
var azureAiProject = param.azureAiProject, runAdapter = param.runAdapter;
|
|
9731
10821
|
return function(urlString, options) {
|
|
9732
10822
|
return _async_to_generator(function() {
|
|
@@ -9995,8 +11085,8 @@ var post24 = function(param) {
|
|
|
9995
11085
|
var runs4 = function(param) {
|
|
9996
11086
|
var azureAiProject = param.azureAiProject, runAdapter = param.runAdapter;
|
|
9997
11087
|
return {
|
|
9998
|
-
get:
|
|
9999
|
-
post:
|
|
11088
|
+
get: get23(),
|
|
11089
|
+
post: post25({
|
|
10000
11090
|
azureAiProject: azureAiProject,
|
|
10001
11091
|
runAdapter: runAdapter
|
|
10002
11092
|
})
|
|
@@ -10004,7 +11094,7 @@ var runs4 = function(param) {
|
|
|
10004
11094
|
};
|
|
10005
11095
|
// src/adapters/storage/azureAgentsStorageAdapter/threads/run/get.ts
|
|
10006
11096
|
var import_dayjs26 = __toESM(require("dayjs"), 1);
|
|
10007
|
-
var
|
|
11097
|
+
var get24 = function(param) {
|
|
10008
11098
|
var azureAiProject = param.azureAiProject, runAdapter = param.runAdapter;
|
|
10009
11099
|
return function(urlString) {
|
|
10010
11100
|
return _async_to_generator(function() {
|
|
@@ -10088,7 +11178,7 @@ var get23 = function(param) {
|
|
|
10088
11178
|
var run3 = function(param) {
|
|
10089
11179
|
var azureAiProject = param.azureAiProject, runAdapter = param.runAdapter;
|
|
10090
11180
|
return {
|
|
10091
|
-
get:
|
|
11181
|
+
get: get24({
|
|
10092
11182
|
azureAiProject: azureAiProject,
|
|
10093
11183
|
runAdapter: runAdapter
|
|
10094
11184
|
})
|
|
@@ -10096,7 +11186,7 @@ var run3 = function(param) {
|
|
|
10096
11186
|
};
|
|
10097
11187
|
// src/adapters/storage/azureAgentsStorageAdapter/threads/runs/steps/get.ts
|
|
10098
11188
|
var import_dayjs27 = __toESM(require("dayjs"), 1);
|
|
10099
|
-
var
|
|
11189
|
+
var get25 = function(param) {
|
|
10100
11190
|
var azureAiProject = param.azureAiProject, runAdapter = param.runAdapter, prisma = param.prisma;
|
|
10101
11191
|
return function(urlString) {
|
|
10102
11192
|
return _async_to_generator(function() {
|
|
@@ -10307,7 +11397,7 @@ var get24 = function(param) {
|
|
|
10307
11397
|
var steps3 = function(param) {
|
|
10308
11398
|
var azureAiProject = param.azureAiProject, runAdapter = param.runAdapter, prisma = param.prisma;
|
|
10309
11399
|
return {
|
|
10310
|
-
get:
|
|
11400
|
+
get: get25({
|
|
10311
11401
|
azureAiProject: azureAiProject,
|
|
10312
11402
|
runAdapter: runAdapter,
|
|
10313
11403
|
prisma: prisma
|
|
@@ -10635,7 +11725,7 @@ function convertAzureEventToOpenAI(azureEvent, assistantId, outputsMap) {
|
|
|
10635
11725
|
}
|
|
10636
11726
|
return null;
|
|
10637
11727
|
}
|
|
10638
|
-
var
|
|
11728
|
+
var post26 = function(param) {
|
|
10639
11729
|
var azureAiProject = param.azureAiProject, runAdapter = param.runAdapter, prisma = param.prisma;
|
|
10640
11730
|
return function(urlString, options) {
|
|
10641
11731
|
return _async_to_generator(function() {
|
|
@@ -10948,7 +12038,7 @@ var post25 = function(param) {
|
|
|
10948
12038
|
var submitToolOutputs4 = function(param) {
|
|
10949
12039
|
var azureAiProject = param.azureAiProject, runAdapter = param.runAdapter, prisma = param.prisma;
|
|
10950
12040
|
return {
|
|
10951
|
-
post:
|
|
12041
|
+
post: post26({
|
|
10952
12042
|
azureAiProject: azureAiProject,
|
|
10953
12043
|
runAdapter: runAdapter,
|
|
10954
12044
|
prisma: prisma
|
|
@@ -10956,7 +12046,7 @@ var submitToolOutputs4 = function(param) {
|
|
|
10956
12046
|
};
|
|
10957
12047
|
};
|
|
10958
12048
|
// src/adapters/storage/azureAgentsStorageAdapter/assistants/post.ts
|
|
10959
|
-
var
|
|
12049
|
+
var post27 = function(param) {
|
|
10960
12050
|
var runAdapter = param.runAdapter;
|
|
10961
12051
|
return function(_urlString, options) {
|
|
10962
12052
|
return _async_to_generator(function() {
|
|
@@ -10998,7 +12088,7 @@ var post26 = function(param) {
|
|
|
10998
12088
|
var assistants3 = function(param) {
|
|
10999
12089
|
var runAdapter = param.runAdapter;
|
|
11000
12090
|
return {
|
|
11001
|
-
post:
|
|
12091
|
+
post: post27({
|
|
11002
12092
|
runAdapter: runAdapter
|
|
11003
12093
|
})
|
|
11004
12094
|
};
|
|
@@ -13929,6 +15019,7 @@ var azureAgentsRunAdapter = function(param) {
|
|
|
13929
15019
|
humirisClientAdapter: humirisClientAdapter,
|
|
13930
15020
|
mistralClientAdapter: mistralClientAdapter,
|
|
13931
15021
|
ollamaClientAdapter: ollamaClientAdapter,
|
|
15022
|
+
openRouterClientAdapter: openRouterClientAdapter,
|
|
13932
15023
|
openaiClientAdapter: openaiClientAdapter,
|
|
13933
15024
|
perplexityClientAdapter: perplexityClientAdapter,
|
|
13934
15025
|
prismaStorageAdapter: prismaStorageAdapter,
|