archymedes-cli 3.2.0 → 3.3.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/bin/archymedes.mjs +0 -0
- package/dist/{archymedes-qm9bwbe7.mjs → archymedes-cfwtgnjx.mjs} +3 -3
- package/dist/{archymedes-0jxzsh4z.mjs → archymedes-d5wqcmdr.mjs} +97 -97
- package/dist/{archymedes-1g1y6q74.mjs → archymedes-h13ap0za.mjs} +1 -1
- package/dist/{archymedes-95xvcvww.mjs → archymedes-j0vrbr99.mjs} +941 -151
- package/dist/archymedes-main.mjs +588 -946
- package/dist/{factory-8xk6y60m.mjs → factory-r6r0ypm6.mjs} +326 -326
- package/dist/{index-teq1cta4.mjs → index-qvgcwsvm.mjs} +1 -1
- package/dist/{node-0fh63p8z.mjs → node-mdgzx68h.mjs} +7 -7
- package/dist/{projection-4jjdaf41.mjs → projection-ndr3t77h.mjs} +2 -2
- package/dist/{sandbox-templates-8sd1psez.mjs → sandbox-templates-9jcjws23.mjs} +2 -2
- package/package.json +8 -8
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
//
|
|
1
|
+
// ../core/src/model-cost.ts
|
|
2
2
|
function utf8Length(codePoint) {
|
|
3
3
|
if (codePoint < 128)
|
|
4
4
|
return 1;
|
|
@@ -135,7 +135,7 @@ function modelPricesFromEnvironment(environment) {
|
|
|
135
135
|
return { inputRatePerMillion, outputRatePerMillion, ...cachedInputRatePerMillion !== undefined ? { cachedInputRatePerMillion } : {} };
|
|
136
136
|
}
|
|
137
137
|
|
|
138
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/internal/tslib.mjs
|
|
138
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/internal/tslib.mjs
|
|
139
139
|
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
140
140
|
if (kind === "m")
|
|
141
141
|
throw new TypeError("Private method is not writable");
|
|
@@ -153,7 +153,7 @@ function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
|
153
153
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/internal/utils/uuid.mjs
|
|
156
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/internal/utils/uuid.mjs
|
|
157
157
|
var uuid4 = function() {
|
|
158
158
|
const { crypto: crypto2 } = globalThis;
|
|
159
159
|
if (crypto2?.randomUUID) {
|
|
@@ -165,7 +165,7 @@ var uuid4 = function() {
|
|
|
165
165
|
return "10000000-1000-4000-8000-100000000000".replace(/[018]/g, (c) => (+c ^ randomByte() & 15 >> +c / 4).toString(16));
|
|
166
166
|
};
|
|
167
167
|
|
|
168
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/internal/errors.mjs
|
|
168
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/internal/errors.mjs
|
|
169
169
|
function isAbortError(err) {
|
|
170
170
|
return typeof err === "object" && err !== null && (("name" in err) && err.name === "AbortError" || ("message" in err) && String(err.message).includes("FetchRequestCanceledException"));
|
|
171
171
|
}
|
|
@@ -192,7 +192,7 @@ var castToError = (err) => {
|
|
|
192
192
|
return new Error(err);
|
|
193
193
|
};
|
|
194
194
|
|
|
195
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/core/error.mjs
|
|
195
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/core/error.mjs
|
|
196
196
|
class OpenAIError extends Error {
|
|
197
197
|
}
|
|
198
198
|
|
|
@@ -343,7 +343,7 @@ class SubjectTokenProviderError extends OpenAIError {
|
|
|
343
343
|
}
|
|
344
344
|
}
|
|
345
345
|
|
|
346
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/internal/utils/values.mjs
|
|
346
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/internal/utils/values.mjs
|
|
347
347
|
var startsWithSchemeRegexp = /^[a-z][a-z0-9+.-]*:/i;
|
|
348
348
|
var isAbsoluteURL = (url) => {
|
|
349
349
|
return startsWithSchemeRegexp.test(url);
|
|
@@ -386,13 +386,13 @@ var safeJSON = (text) => {
|
|
|
386
386
|
}
|
|
387
387
|
};
|
|
388
388
|
|
|
389
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/internal/utils/sleep.mjs
|
|
389
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/internal/utils/sleep.mjs
|
|
390
390
|
var sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
391
391
|
|
|
392
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/version.mjs
|
|
392
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/version.mjs
|
|
393
393
|
var VERSION = "6.49.0";
|
|
394
394
|
|
|
395
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/internal/detect-platform.mjs
|
|
395
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/internal/detect-platform.mjs
|
|
396
396
|
var isRunningInBrowser = () => {
|
|
397
397
|
return typeof window !== "undefined" && typeof window.document !== "undefined" && typeof navigator !== "undefined";
|
|
398
398
|
};
|
|
@@ -521,7 +521,7 @@ var getPlatformHeaders = () => {
|
|
|
521
521
|
return _platformHeaders ?? (_platformHeaders = getPlatformProperties());
|
|
522
522
|
};
|
|
523
523
|
|
|
524
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/internal/shims.mjs
|
|
524
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/internal/shims.mjs
|
|
525
525
|
function getDefaultFetch() {
|
|
526
526
|
if (typeof fetch !== "undefined") {
|
|
527
527
|
return fetch;
|
|
@@ -592,7 +592,7 @@ async function CancelReadableStream(stream) {
|
|
|
592
592
|
await cancelPromise;
|
|
593
593
|
}
|
|
594
594
|
|
|
595
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/internal/request-options.mjs
|
|
595
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/internal/request-options.mjs
|
|
596
596
|
var FallbackEncoder = ({ headers, body }) => {
|
|
597
597
|
return {
|
|
598
598
|
bodyHeaders: {
|
|
@@ -602,7 +602,7 @@ var FallbackEncoder = ({ headers, body }) => {
|
|
|
602
602
|
};
|
|
603
603
|
};
|
|
604
604
|
|
|
605
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/internal/qs/formats.mjs
|
|
605
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/internal/qs/formats.mjs
|
|
606
606
|
var default_format = "RFC3986";
|
|
607
607
|
var default_formatter = (v) => String(v);
|
|
608
608
|
var formatters = {
|
|
@@ -611,7 +611,7 @@ var formatters = {
|
|
|
611
611
|
};
|
|
612
612
|
var RFC1738 = "RFC1738";
|
|
613
613
|
|
|
614
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/internal/qs/utils.mjs
|
|
614
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/internal/qs/utils.mjs
|
|
615
615
|
var has = (obj, key) => (has = Object.hasOwn ?? Function.prototype.call.bind(Object.prototype.hasOwnProperty), has(obj, key));
|
|
616
616
|
var hex_table = /* @__PURE__ */ (() => {
|
|
617
617
|
const array = [];
|
|
@@ -683,7 +683,7 @@ function maybe_map(val, fn) {
|
|
|
683
683
|
return fn(val);
|
|
684
684
|
}
|
|
685
685
|
|
|
686
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/internal/qs/stringify.mjs
|
|
686
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/internal/qs/stringify.mjs
|
|
687
687
|
var array_prefix_generators = {
|
|
688
688
|
brackets(prefix) {
|
|
689
689
|
return String(prefix) + "[]";
|
|
@@ -911,12 +911,12 @@ function stringify(object, opts = {}) {
|
|
|
911
911
|
return joined.length > 0 ? prefix + joined : "";
|
|
912
912
|
}
|
|
913
913
|
|
|
914
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/internal/utils/query.mjs
|
|
914
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/internal/utils/query.mjs
|
|
915
915
|
function stringifyQuery(query) {
|
|
916
916
|
return stringify(query, { arrayFormat: "brackets" });
|
|
917
917
|
}
|
|
918
918
|
|
|
919
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/internal/utils/bytes.mjs
|
|
919
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/internal/utils/bytes.mjs
|
|
920
920
|
function concatBytes(buffers) {
|
|
921
921
|
let length = 0;
|
|
922
922
|
for (const buffer of buffers) {
|
|
@@ -941,7 +941,7 @@ function decodeUTF8(bytes) {
|
|
|
941
941
|
return (decodeUTF8_ ?? (decoder = new globalThis.TextDecoder, decodeUTF8_ = decoder.decode.bind(decoder)))(bytes);
|
|
942
942
|
}
|
|
943
943
|
|
|
944
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/internal/decoders/line.mjs
|
|
944
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/internal/decoders/line.mjs
|
|
945
945
|
var _LineDecoder_buffer;
|
|
946
946
|
var _LineDecoder_carriageReturnIndex;
|
|
947
947
|
|
|
@@ -1021,7 +1021,7 @@ function findDoubleNewlineIndex(buffer) {
|
|
|
1021
1021
|
return -1;
|
|
1022
1022
|
}
|
|
1023
1023
|
|
|
1024
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/internal/utils/log.mjs
|
|
1024
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/internal/utils/log.mjs
|
|
1025
1025
|
var levelNumbers = {
|
|
1026
1026
|
off: 0,
|
|
1027
1027
|
error: 200,
|
|
@@ -1093,7 +1093,7 @@ var formatRequestDetails = (details) => {
|
|
|
1093
1093
|
return details;
|
|
1094
1094
|
};
|
|
1095
1095
|
|
|
1096
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/core/streaming.mjs
|
|
1096
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/core/streaming.mjs
|
|
1097
1097
|
var _Stream_client;
|
|
1098
1098
|
|
|
1099
1099
|
class Stream {
|
|
@@ -1373,7 +1373,7 @@ function partition(str, delimiter) {
|
|
|
1373
1373
|
return [str, "", ""];
|
|
1374
1374
|
}
|
|
1375
1375
|
|
|
1376
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/internal/parse.mjs
|
|
1376
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/internal/parse.mjs
|
|
1377
1377
|
async function defaultParseResponse(client, props) {
|
|
1378
1378
|
const { response, requestLogID, retryOfRequestLogID, startTime } = props;
|
|
1379
1379
|
const body = await (async () => {
|
|
@@ -1423,7 +1423,7 @@ function addRequestID(value, response) {
|
|
|
1423
1423
|
});
|
|
1424
1424
|
}
|
|
1425
1425
|
|
|
1426
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/core/api-promise.mjs
|
|
1426
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/core/api-promise.mjs
|
|
1427
1427
|
var _APIPromise_client;
|
|
1428
1428
|
|
|
1429
1429
|
class APIPromise extends Promise {
|
|
@@ -1464,7 +1464,7 @@ class APIPromise extends Promise {
|
|
|
1464
1464
|
}
|
|
1465
1465
|
_APIPromise_client = new WeakMap;
|
|
1466
1466
|
|
|
1467
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/core/pagination.mjs
|
|
1467
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/core/pagination.mjs
|
|
1468
1468
|
var _AbstractPage_client;
|
|
1469
1469
|
|
|
1470
1470
|
class AbstractPage {
|
|
@@ -1624,7 +1624,7 @@ class NextCursorPage extends AbstractPage {
|
|
|
1624
1624
|
}
|
|
1625
1625
|
}
|
|
1626
1626
|
|
|
1627
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/auth/workload-identity-auth.mjs
|
|
1627
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/auth/workload-identity-auth.mjs
|
|
1628
1628
|
var SUBJECT_TOKEN_TYPES = {
|
|
1629
1629
|
jwt: "urn:ietf:params:oauth:token-type:jwt",
|
|
1630
1630
|
id: "urn:ietf:params:oauth:token-type:id_token"
|
|
@@ -1716,7 +1716,7 @@ class WorkloadIdentityAuth {
|
|
|
1716
1716
|
}
|
|
1717
1717
|
}
|
|
1718
1718
|
|
|
1719
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/internal/headers.mjs
|
|
1719
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/internal/headers.mjs
|
|
1720
1720
|
var brand_privateNullableHeaders = /* @__PURE__ */ Symbol("brand.privateNullableHeaders");
|
|
1721
1721
|
var httpTokenHeaderName = /^[!#$%&'*+\-.^_`|~0-9A-Za-z]+$/;
|
|
1722
1722
|
function* iterateHeaders(headers) {
|
|
@@ -1783,7 +1783,7 @@ var buildHeaders = (newHeaders) => {
|
|
|
1783
1783
|
return { [brand_privateNullableHeaders]: true, values: targetHeaders, nulls: nullHeaders };
|
|
1784
1784
|
};
|
|
1785
1785
|
|
|
1786
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/internal/uploads.mjs
|
|
1786
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/internal/uploads.mjs
|
|
1787
1787
|
var brand_privateStreamingFile = /* @__PURE__ */ Symbol("brand.privateStreamingFile");
|
|
1788
1788
|
function toStreamingFile(data, name, options) {
|
|
1789
1789
|
if (!name) {
|
|
@@ -2016,7 +2016,7 @@ var addFormValue = async (form, key, value) => {
|
|
|
2016
2016
|
throw new TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${value} instead`);
|
|
2017
2017
|
}
|
|
2018
2018
|
};
|
|
2019
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/internal/to-file.mjs
|
|
2019
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/internal/to-file.mjs
|
|
2020
2020
|
var isBlobLike = (value) => value != null && typeof value === "object" && typeof value.size === "number" && typeof value.type === "string" && typeof value.text === "function" && typeof value.slice === "function" && typeof value.arrayBuffer === "function";
|
|
2021
2021
|
var isFileLike = (value) => value != null && typeof value === "object" && typeof value.name === "string" && typeof value.lastModified === "number" && isBlobLike(value);
|
|
2022
2022
|
var isResponseLike = (value) => value != null && typeof value === "object" && typeof value.url === "string" && typeof value.blob === "function";
|
|
@@ -2066,14 +2066,14 @@ function propsForError(value) {
|
|
|
2066
2066
|
const props = Object.getOwnPropertyNames(value);
|
|
2067
2067
|
return `; props: [${props.map((p) => `"${p}"`).join(", ")}]`;
|
|
2068
2068
|
}
|
|
2069
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/core/resource.mjs
|
|
2069
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/core/resource.mjs
|
|
2070
2070
|
class APIResource {
|
|
2071
2071
|
constructor(client) {
|
|
2072
2072
|
this._client = client;
|
|
2073
2073
|
}
|
|
2074
2074
|
}
|
|
2075
2075
|
|
|
2076
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/internal/utils/path.mjs
|
|
2076
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/internal/utils/path.mjs
|
|
2077
2077
|
function encodeURIPath(str) {
|
|
2078
2078
|
return str.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g, encodeURIComponent);
|
|
2079
2079
|
}
|
|
@@ -2128,13 +2128,13 @@ ${underline}`);
|
|
|
2128
2128
|
};
|
|
2129
2129
|
var path = /* @__PURE__ */ createPathTagFunction(encodeURIPath);
|
|
2130
2130
|
|
|
2131
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/chat/completions/messages.mjs
|
|
2131
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/chat/completions/messages.mjs
|
|
2132
2132
|
class Messages extends APIResource {
|
|
2133
2133
|
list(completionID, query = {}, options) {
|
|
2134
2134
|
return this._client.getAPIList(path`/chat/completions/${completionID}/messages`, CursorPage, { query, ...options, __security: { bearerAuth: true } });
|
|
2135
2135
|
}
|
|
2136
2136
|
}
|
|
2137
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/lib/parser.mjs
|
|
2137
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/lib/parser.mjs
|
|
2138
2138
|
function isChatCompletionFunctionTool(tool) {
|
|
2139
2139
|
return tool !== undefined && "function" in tool && tool.function !== undefined;
|
|
2140
2140
|
}
|
|
@@ -2255,7 +2255,7 @@ function validateInputTools(tools) {
|
|
|
2255
2255
|
}
|
|
2256
2256
|
}
|
|
2257
2257
|
|
|
2258
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/lib/chatCompletionUtils.mjs
|
|
2258
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/lib/chatCompletionUtils.mjs
|
|
2259
2259
|
var isAssistantMessage = (message) => {
|
|
2260
2260
|
return message?.role === "assistant";
|
|
2261
2261
|
};
|
|
@@ -2263,7 +2263,7 @@ var isToolMessage = (message) => {
|
|
|
2263
2263
|
return message?.role === "tool";
|
|
2264
2264
|
};
|
|
2265
2265
|
|
|
2266
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/lib/EventStream.mjs
|
|
2266
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/lib/EventStream.mjs
|
|
2267
2267
|
var _EventStream_instances;
|
|
2268
2268
|
var _EventStream_connectedPromise;
|
|
2269
2269
|
var _EventStream_resolveConnectedPromise;
|
|
@@ -2524,12 +2524,12 @@ _EventStream_connectedPromise = new WeakMap, _EventStream_resolveConnectedPromis
|
|
|
2524
2524
|
return this._emit("error", new OpenAIError(String(error2)));
|
|
2525
2525
|
};
|
|
2526
2526
|
|
|
2527
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/lib/RunnableFunction.mjs
|
|
2527
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/lib/RunnableFunction.mjs
|
|
2528
2528
|
function isRunnableFunctionWithParse(fn) {
|
|
2529
2529
|
return typeof fn.parse === "function";
|
|
2530
2530
|
}
|
|
2531
2531
|
|
|
2532
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/lib/AbstractChatCompletionRunner.mjs
|
|
2532
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/lib/AbstractChatCompletionRunner.mjs
|
|
2533
2533
|
var _AbstractChatCompletionRunner_instances;
|
|
2534
2534
|
var _AbstractChatCompletionRunner_getFinalContent;
|
|
2535
2535
|
var _AbstractChatCompletionRunner_getFinalMessage;
|
|
@@ -2857,7 +2857,7 @@ _AbstractChatCompletionRunner_instances = new WeakSet, _AbstractChatCompletionRu
|
|
|
2857
2857
|
return typeof rawContent === "string" ? rawContent : rawContent === undefined ? "undefined" : JSON.stringify(rawContent);
|
|
2858
2858
|
};
|
|
2859
2859
|
|
|
2860
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/lib/ChatCompletionRunner.mjs
|
|
2860
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/lib/ChatCompletionRunner.mjs
|
|
2861
2861
|
class ChatCompletionRunner extends AbstractChatCompletionRunner {
|
|
2862
2862
|
static runTools(client, params, options) {
|
|
2863
2863
|
const runner = new ChatCompletionRunner;
|
|
@@ -2876,7 +2876,7 @@ class ChatCompletionRunner extends AbstractChatCompletionRunner {
|
|
|
2876
2876
|
}
|
|
2877
2877
|
}
|
|
2878
2878
|
|
|
2879
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/_vendor/partial-json-parser/parser.mjs
|
|
2879
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/_vendor/partial-json-parser/parser.mjs
|
|
2880
2880
|
var STR = 1;
|
|
2881
2881
|
var NUM = 2;
|
|
2882
2882
|
var ARR = 4;
|
|
@@ -3089,7 +3089,7 @@ var _parseJSON = (jsonString, allow) => {
|
|
|
3089
3089
|
return parseAny();
|
|
3090
3090
|
};
|
|
3091
3091
|
var partialParse = (input) => parseJSON(input, Allow.ALL ^ Allow.NUM);
|
|
3092
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/lib/ChatCompletionStream.mjs
|
|
3092
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/lib/ChatCompletionStream.mjs
|
|
3093
3093
|
var _ChatCompletionStream_instances;
|
|
3094
3094
|
var _ChatCompletionStream_params;
|
|
3095
3095
|
var _ChatCompletionStream_audioDoneChoiceIndexes;
|
|
@@ -3632,7 +3632,7 @@ function assertIsEmpty(obj) {
|
|
|
3632
3632
|
}
|
|
3633
3633
|
function assertNever(_x) {}
|
|
3634
3634
|
|
|
3635
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/lib/ChatCompletionStreamingRunner.mjs
|
|
3635
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/lib/ChatCompletionStreamingRunner.mjs
|
|
3636
3636
|
class ChatCompletionStreamingRunner extends ChatCompletionStream {
|
|
3637
3637
|
static fromReadableStream(stream) {
|
|
3638
3638
|
const runner = new ChatCompletionStreamingRunner(null);
|
|
@@ -3723,7 +3723,7 @@ class ChatCompletionStreamingRunner extends ChatCompletionStream {
|
|
|
3723
3723
|
}
|
|
3724
3724
|
}
|
|
3725
3725
|
|
|
3726
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/chat/completions/completions.mjs
|
|
3726
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/chat/completions/completions.mjs
|
|
3727
3727
|
class Completions extends APIResource {
|
|
3728
3728
|
constructor() {
|
|
3729
3729
|
super(...arguments);
|
|
@@ -3785,7 +3785,7 @@ class Completions extends APIResource {
|
|
|
3785
3785
|
}
|
|
3786
3786
|
Completions.Messages = Messages;
|
|
3787
3787
|
|
|
3788
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/chat/chat.mjs
|
|
3788
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/chat/chat.mjs
|
|
3789
3789
|
class Chat extends APIResource {
|
|
3790
3790
|
constructor() {
|
|
3791
3791
|
super(...arguments);
|
|
@@ -3793,7 +3793,7 @@ class Chat extends APIResource {
|
|
|
3793
3793
|
}
|
|
3794
3794
|
}
|
|
3795
3795
|
Chat.Completions = Completions;
|
|
3796
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/admin-api-keys.mjs
|
|
3796
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/admin-api-keys.mjs
|
|
3797
3797
|
class AdminAPIKeys extends APIResource {
|
|
3798
3798
|
create(body, options) {
|
|
3799
3799
|
return this._client.post("/organization/admin_api_keys", {
|
|
@@ -3823,7 +3823,7 @@ class AdminAPIKeys extends APIResource {
|
|
|
3823
3823
|
}
|
|
3824
3824
|
}
|
|
3825
3825
|
|
|
3826
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/audit-logs.mjs
|
|
3826
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/audit-logs.mjs
|
|
3827
3827
|
class AuditLogs extends APIResource {
|
|
3828
3828
|
list(query = {}, options) {
|
|
3829
3829
|
return this._client.getAPIList("/organization/audit_logs", ConversationCursorPage, {
|
|
@@ -3834,7 +3834,7 @@ class AuditLogs extends APIResource {
|
|
|
3834
3834
|
}
|
|
3835
3835
|
}
|
|
3836
3836
|
|
|
3837
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/certificates.mjs
|
|
3837
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/certificates.mjs
|
|
3838
3838
|
class Certificates extends APIResource {
|
|
3839
3839
|
create(body, options) {
|
|
3840
3840
|
return this._client.post("/organization/certificates", {
|
|
@@ -3879,7 +3879,7 @@ class Certificates extends APIResource {
|
|
|
3879
3879
|
}
|
|
3880
3880
|
}
|
|
3881
3881
|
|
|
3882
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/data-retention.mjs
|
|
3882
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/data-retention.mjs
|
|
3883
3883
|
class DataRetention extends APIResource {
|
|
3884
3884
|
retrieve(options) {
|
|
3885
3885
|
return this._client.get("/organization/data_retention", {
|
|
@@ -3896,7 +3896,7 @@ class DataRetention extends APIResource {
|
|
|
3896
3896
|
}
|
|
3897
3897
|
}
|
|
3898
3898
|
|
|
3899
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/invites.mjs
|
|
3899
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/invites.mjs
|
|
3900
3900
|
class Invites extends APIResource {
|
|
3901
3901
|
create(body, options) {
|
|
3902
3902
|
return this._client.post("/organization/invites", {
|
|
@@ -3926,7 +3926,7 @@ class Invites extends APIResource {
|
|
|
3926
3926
|
}
|
|
3927
3927
|
}
|
|
3928
3928
|
|
|
3929
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/roles.mjs
|
|
3929
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/roles.mjs
|
|
3930
3930
|
class Roles extends APIResource {
|
|
3931
3931
|
create(body, options) {
|
|
3932
3932
|
return this._client.post("/organization/roles", {
|
|
@@ -3963,7 +3963,7 @@ class Roles extends APIResource {
|
|
|
3963
3963
|
}
|
|
3964
3964
|
}
|
|
3965
3965
|
|
|
3966
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/spend-alerts.mjs
|
|
3966
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/spend-alerts.mjs
|
|
3967
3967
|
class SpendAlerts extends APIResource {
|
|
3968
3968
|
create(body, options) {
|
|
3969
3969
|
return this._client.post("/organization/spend_alerts", {
|
|
@@ -3996,7 +3996,7 @@ class SpendAlerts extends APIResource {
|
|
|
3996
3996
|
}
|
|
3997
3997
|
}
|
|
3998
3998
|
|
|
3999
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/spend-limit.mjs
|
|
3999
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/spend-limit.mjs
|
|
4000
4000
|
class SpendLimit extends APIResource {
|
|
4001
4001
|
retrieve(options) {
|
|
4002
4002
|
return this._client.get("/organization/spend_limit", {
|
|
@@ -4019,7 +4019,7 @@ class SpendLimit extends APIResource {
|
|
|
4019
4019
|
}
|
|
4020
4020
|
}
|
|
4021
4021
|
|
|
4022
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/usage.mjs
|
|
4022
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/usage.mjs
|
|
4023
4023
|
class Usage extends APIResource {
|
|
4024
4024
|
audioSpeeches(query, options) {
|
|
4025
4025
|
return this._client.get("/organization/usage/audio_speeches", {
|
|
@@ -4100,7 +4100,7 @@ class Usage extends APIResource {
|
|
|
4100
4100
|
}
|
|
4101
4101
|
}
|
|
4102
4102
|
|
|
4103
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/groups/roles.mjs
|
|
4103
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/groups/roles.mjs
|
|
4104
4104
|
class Roles2 extends APIResource {
|
|
4105
4105
|
create(groupID, body, options) {
|
|
4106
4106
|
return this._client.post(path`/organization/groups/${groupID}/roles`, {
|
|
@@ -4128,7 +4128,7 @@ class Roles2 extends APIResource {
|
|
|
4128
4128
|
}
|
|
4129
4129
|
}
|
|
4130
4130
|
|
|
4131
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/groups/users.mjs
|
|
4131
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/groups/users.mjs
|
|
4132
4132
|
class Users extends APIResource {
|
|
4133
4133
|
create(groupID, body, options) {
|
|
4134
4134
|
return this._client.post(path`/organization/groups/${groupID}/users`, {
|
|
@@ -4156,7 +4156,7 @@ class Users extends APIResource {
|
|
|
4156
4156
|
}
|
|
4157
4157
|
}
|
|
4158
4158
|
|
|
4159
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/groups/groups.mjs
|
|
4159
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/groups/groups.mjs
|
|
4160
4160
|
class Groups extends APIResource {
|
|
4161
4161
|
constructor() {
|
|
4162
4162
|
super(...arguments);
|
|
@@ -4200,7 +4200,7 @@ class Groups extends APIResource {
|
|
|
4200
4200
|
Groups.Users = Users;
|
|
4201
4201
|
Groups.Roles = Roles2;
|
|
4202
4202
|
|
|
4203
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/projects/api-keys.mjs
|
|
4203
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/projects/api-keys.mjs
|
|
4204
4204
|
class APIKeys extends APIResource {
|
|
4205
4205
|
retrieve(apiKeyID, params, options) {
|
|
4206
4206
|
const { project_id } = params;
|
|
@@ -4221,7 +4221,7 @@ class APIKeys extends APIResource {
|
|
|
4221
4221
|
}
|
|
4222
4222
|
}
|
|
4223
4223
|
|
|
4224
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/projects/certificates.mjs
|
|
4224
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/projects/certificates.mjs
|
|
4225
4225
|
class Certificates2 extends APIResource {
|
|
4226
4226
|
list(projectID, query = {}, options) {
|
|
4227
4227
|
return this._client.getAPIList(path`/organization/projects/${projectID}/certificates`, ConversationCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } });
|
|
@@ -4234,7 +4234,7 @@ class Certificates2 extends APIResource {
|
|
|
4234
4234
|
}
|
|
4235
4235
|
}
|
|
4236
4236
|
|
|
4237
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/projects/data-retention.mjs
|
|
4237
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/projects/data-retention.mjs
|
|
4238
4238
|
class DataRetention2 extends APIResource {
|
|
4239
4239
|
retrieve(projectID, options) {
|
|
4240
4240
|
return this._client.get(path`/organization/projects/${projectID}/data_retention`, {
|
|
@@ -4251,7 +4251,7 @@ class DataRetention2 extends APIResource {
|
|
|
4251
4251
|
}
|
|
4252
4252
|
}
|
|
4253
4253
|
|
|
4254
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/projects/hosted-tool-permissions.mjs
|
|
4254
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/projects/hosted-tool-permissions.mjs
|
|
4255
4255
|
class HostedToolPermissions extends APIResource {
|
|
4256
4256
|
retrieve(projectID, options) {
|
|
4257
4257
|
return this._client.get(path`/organization/projects/${projectID}/hosted_tool_permissions`, {
|
|
@@ -4268,7 +4268,7 @@ class HostedToolPermissions extends APIResource {
|
|
|
4268
4268
|
}
|
|
4269
4269
|
}
|
|
4270
4270
|
|
|
4271
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/projects/model-permissions.mjs
|
|
4271
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/projects/model-permissions.mjs
|
|
4272
4272
|
class ModelPermissions extends APIResource {
|
|
4273
4273
|
retrieve(projectID, options) {
|
|
4274
4274
|
return this._client.get(path`/organization/projects/${projectID}/model_permissions`, {
|
|
@@ -4291,7 +4291,7 @@ class ModelPermissions extends APIResource {
|
|
|
4291
4291
|
}
|
|
4292
4292
|
}
|
|
4293
4293
|
|
|
4294
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/projects/rate-limits.mjs
|
|
4294
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/projects/rate-limits.mjs
|
|
4295
4295
|
class RateLimits extends APIResource {
|
|
4296
4296
|
listRateLimits(projectID, query = {}, options) {
|
|
4297
4297
|
return this._client.getAPIList(path`/organization/projects/${projectID}/rate_limits`, ConversationCursorPage, { query, ...options, __security: { adminAPIKeyAuth: true } });
|
|
@@ -4306,7 +4306,7 @@ class RateLimits extends APIResource {
|
|
|
4306
4306
|
}
|
|
4307
4307
|
}
|
|
4308
4308
|
|
|
4309
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/projects/roles.mjs
|
|
4309
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/projects/roles.mjs
|
|
4310
4310
|
class Roles3 extends APIResource {
|
|
4311
4311
|
create(projectID, body, options) {
|
|
4312
4312
|
return this._client.post(path`/projects/${projectID}/roles`, {
|
|
@@ -4346,7 +4346,7 @@ class Roles3 extends APIResource {
|
|
|
4346
4346
|
}
|
|
4347
4347
|
}
|
|
4348
4348
|
|
|
4349
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/projects/spend-alerts.mjs
|
|
4349
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/projects/spend-alerts.mjs
|
|
4350
4350
|
class SpendAlerts2 extends APIResource {
|
|
4351
4351
|
create(projectID, body, options) {
|
|
4352
4352
|
return this._client.post(path`/organization/projects/${projectID}/spend_alerts`, {
|
|
@@ -4382,7 +4382,7 @@ class SpendAlerts2 extends APIResource {
|
|
|
4382
4382
|
}
|
|
4383
4383
|
}
|
|
4384
4384
|
|
|
4385
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/projects/spend-limit.mjs
|
|
4385
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/projects/spend-limit.mjs
|
|
4386
4386
|
class SpendLimit2 extends APIResource {
|
|
4387
4387
|
retrieve(projectID, options) {
|
|
4388
4388
|
return this._client.get(path`/organization/projects/${projectID}/spend_limit`, {
|
|
@@ -4405,7 +4405,7 @@ class SpendLimit2 extends APIResource {
|
|
|
4405
4405
|
}
|
|
4406
4406
|
}
|
|
4407
4407
|
|
|
4408
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/projects/groups/roles.mjs
|
|
4408
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/projects/groups/roles.mjs
|
|
4409
4409
|
class Roles4 extends APIResource {
|
|
4410
4410
|
create(groupID, params, options) {
|
|
4411
4411
|
const { project_id, ...body } = params;
|
|
@@ -4435,7 +4435,7 @@ class Roles4 extends APIResource {
|
|
|
4435
4435
|
}
|
|
4436
4436
|
}
|
|
4437
4437
|
|
|
4438
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/projects/groups/groups.mjs
|
|
4438
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/projects/groups/groups.mjs
|
|
4439
4439
|
class Groups2 extends APIResource {
|
|
4440
4440
|
constructor() {
|
|
4441
4441
|
super(...arguments);
|
|
@@ -4469,7 +4469,7 @@ class Groups2 extends APIResource {
|
|
|
4469
4469
|
}
|
|
4470
4470
|
Groups2.Roles = Roles4;
|
|
4471
4471
|
|
|
4472
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/projects/service-accounts/api-keys.mjs
|
|
4472
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/projects/service-accounts/api-keys.mjs
|
|
4473
4473
|
class APIKeys2 extends APIResource {
|
|
4474
4474
|
create(serviceAccountID, params, options) {
|
|
4475
4475
|
const { project_id, ...body } = params;
|
|
@@ -4477,7 +4477,7 @@ class APIKeys2 extends APIResource {
|
|
|
4477
4477
|
}
|
|
4478
4478
|
}
|
|
4479
4479
|
|
|
4480
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/projects/service-accounts/service-accounts.mjs
|
|
4480
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/projects/service-accounts/service-accounts.mjs
|
|
4481
4481
|
class ServiceAccounts extends APIResource {
|
|
4482
4482
|
constructor() {
|
|
4483
4483
|
super(...arguments);
|
|
@@ -4511,7 +4511,7 @@ class ServiceAccounts extends APIResource {
|
|
|
4511
4511
|
}
|
|
4512
4512
|
ServiceAccounts.APIKeys = APIKeys2;
|
|
4513
4513
|
|
|
4514
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/projects/users/roles.mjs
|
|
4514
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/projects/users/roles.mjs
|
|
4515
4515
|
class Roles5 extends APIResource {
|
|
4516
4516
|
create(userID, params, options) {
|
|
4517
4517
|
const { project_id, ...body } = params;
|
|
@@ -4541,7 +4541,7 @@ class Roles5 extends APIResource {
|
|
|
4541
4541
|
}
|
|
4542
4542
|
}
|
|
4543
4543
|
|
|
4544
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/projects/users/users.mjs
|
|
4544
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/projects/users/users.mjs
|
|
4545
4545
|
class Users2 extends APIResource {
|
|
4546
4546
|
constructor() {
|
|
4547
4547
|
super(...arguments);
|
|
@@ -4582,7 +4582,7 @@ class Users2 extends APIResource {
|
|
|
4582
4582
|
}
|
|
4583
4583
|
Users2.Roles = Roles5;
|
|
4584
4584
|
|
|
4585
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/projects/projects.mjs
|
|
4585
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/projects/projects.mjs
|
|
4586
4586
|
class Projects extends APIResource {
|
|
4587
4587
|
constructor() {
|
|
4588
4588
|
super(...arguments);
|
|
@@ -4646,7 +4646,7 @@ Projects.SpendLimit = SpendLimit2;
|
|
|
4646
4646
|
Projects.SpendAlerts = SpendAlerts2;
|
|
4647
4647
|
Projects.Certificates = Certificates2;
|
|
4648
4648
|
|
|
4649
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/users/roles.mjs
|
|
4649
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/users/roles.mjs
|
|
4650
4650
|
class Roles6 extends APIResource {
|
|
4651
4651
|
create(userID, body, options) {
|
|
4652
4652
|
return this._client.post(path`/organization/users/${userID}/roles`, {
|
|
@@ -4674,7 +4674,7 @@ class Roles6 extends APIResource {
|
|
|
4674
4674
|
}
|
|
4675
4675
|
}
|
|
4676
4676
|
|
|
4677
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/users/users.mjs
|
|
4677
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/users/users.mjs
|
|
4678
4678
|
class Users3 extends APIResource {
|
|
4679
4679
|
constructor() {
|
|
4680
4680
|
super(...arguments);
|
|
@@ -4709,7 +4709,7 @@ class Users3 extends APIResource {
|
|
|
4709
4709
|
}
|
|
4710
4710
|
Users3.Roles = Roles6;
|
|
4711
4711
|
|
|
4712
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/organization.mjs
|
|
4712
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/organization/organization.mjs
|
|
4713
4713
|
class Organization extends APIResource {
|
|
4714
4714
|
constructor() {
|
|
4715
4715
|
super(...arguments);
|
|
@@ -4740,7 +4740,7 @@ Organization.SpendAlerts = SpendAlerts;
|
|
|
4740
4740
|
Organization.Certificates = Certificates;
|
|
4741
4741
|
Organization.Projects = Projects;
|
|
4742
4742
|
|
|
4743
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/admin.mjs
|
|
4743
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/admin/admin.mjs
|
|
4744
4744
|
class Admin extends APIResource {
|
|
4745
4745
|
constructor() {
|
|
4746
4746
|
super(...arguments);
|
|
@@ -4748,7 +4748,7 @@ class Admin extends APIResource {
|
|
|
4748
4748
|
}
|
|
4749
4749
|
}
|
|
4750
4750
|
Admin.Organization = Organization;
|
|
4751
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/audio/speech.mjs
|
|
4751
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/audio/speech.mjs
|
|
4752
4752
|
class Speech extends APIResource {
|
|
4753
4753
|
create(body, options) {
|
|
4754
4754
|
return this._client.post("/audio/speech", {
|
|
@@ -4761,7 +4761,7 @@ class Speech extends APIResource {
|
|
|
4761
4761
|
}
|
|
4762
4762
|
}
|
|
4763
4763
|
|
|
4764
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/audio/transcriptions.mjs
|
|
4764
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/audio/transcriptions.mjs
|
|
4765
4765
|
class Transcriptions extends APIResource {
|
|
4766
4766
|
create(body, options) {
|
|
4767
4767
|
return this._client.post("/audio/transcriptions", multipartFormRequestOptions({
|
|
@@ -4774,14 +4774,14 @@ class Transcriptions extends APIResource {
|
|
|
4774
4774
|
}
|
|
4775
4775
|
}
|
|
4776
4776
|
|
|
4777
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/audio/translations.mjs
|
|
4777
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/audio/translations.mjs
|
|
4778
4778
|
class Translations extends APIResource {
|
|
4779
4779
|
create(body, options) {
|
|
4780
4780
|
return this._client.post("/audio/translations", multipartFormRequestOptions({ body, ...options, __metadata: { model: body.model }, __security: { bearerAuth: true } }, this._client));
|
|
4781
4781
|
}
|
|
4782
4782
|
}
|
|
4783
4783
|
|
|
4784
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/audio/audio.mjs
|
|
4784
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/audio/audio.mjs
|
|
4785
4785
|
class Audio extends APIResource {
|
|
4786
4786
|
constructor() {
|
|
4787
4787
|
super(...arguments);
|
|
@@ -4793,7 +4793,7 @@ class Audio extends APIResource {
|
|
|
4793
4793
|
Audio.Transcriptions = Transcriptions;
|
|
4794
4794
|
Audio.Translations = Translations;
|
|
4795
4795
|
Audio.Speech = Speech;
|
|
4796
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/batches.mjs
|
|
4796
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/batches.mjs
|
|
4797
4797
|
class Batches extends APIResource {
|
|
4798
4798
|
create(body, options) {
|
|
4799
4799
|
return this._client.post("/batches", { body, ...options, __security: { bearerAuth: true } });
|
|
@@ -4815,7 +4815,7 @@ class Batches extends APIResource {
|
|
|
4815
4815
|
});
|
|
4816
4816
|
}
|
|
4817
4817
|
}
|
|
4818
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/beta/assistants.mjs
|
|
4818
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/beta/assistants.mjs
|
|
4819
4819
|
class Assistants extends APIResource {
|
|
4820
4820
|
create(body, options) {
|
|
4821
4821
|
return this._client.post("/assistants", {
|
|
@@ -4857,7 +4857,7 @@ class Assistants extends APIResource {
|
|
|
4857
4857
|
}
|
|
4858
4858
|
}
|
|
4859
4859
|
|
|
4860
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/beta/realtime/sessions.mjs
|
|
4860
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/beta/realtime/sessions.mjs
|
|
4861
4861
|
class Sessions extends APIResource {
|
|
4862
4862
|
create(body, options) {
|
|
4863
4863
|
return this._client.post("/realtime/sessions", {
|
|
@@ -4869,7 +4869,7 @@ class Sessions extends APIResource {
|
|
|
4869
4869
|
}
|
|
4870
4870
|
}
|
|
4871
4871
|
|
|
4872
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/beta/realtime/transcription-sessions.mjs
|
|
4872
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/beta/realtime/transcription-sessions.mjs
|
|
4873
4873
|
class TranscriptionSessions extends APIResource {
|
|
4874
4874
|
create(body, options) {
|
|
4875
4875
|
return this._client.post("/realtime/transcription_sessions", {
|
|
@@ -4881,7 +4881,7 @@ class TranscriptionSessions extends APIResource {
|
|
|
4881
4881
|
}
|
|
4882
4882
|
}
|
|
4883
4883
|
|
|
4884
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/beta/realtime/realtime.mjs
|
|
4884
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/beta/realtime/realtime.mjs
|
|
4885
4885
|
class Realtime extends APIResource {
|
|
4886
4886
|
constructor() {
|
|
4887
4887
|
super(...arguments);
|
|
@@ -4892,7 +4892,7 @@ class Realtime extends APIResource {
|
|
|
4892
4892
|
Realtime.Sessions = Sessions;
|
|
4893
4893
|
Realtime.TranscriptionSessions = TranscriptionSessions;
|
|
4894
4894
|
|
|
4895
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/beta/chatkit/sessions.mjs
|
|
4895
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/beta/chatkit/sessions.mjs
|
|
4896
4896
|
class Sessions2 extends APIResource {
|
|
4897
4897
|
create(body, options) {
|
|
4898
4898
|
return this._client.post("/chatkit/sessions", {
|
|
@@ -4911,7 +4911,7 @@ class Sessions2 extends APIResource {
|
|
|
4911
4911
|
}
|
|
4912
4912
|
}
|
|
4913
4913
|
|
|
4914
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/beta/chatkit/threads.mjs
|
|
4914
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/beta/chatkit/threads.mjs
|
|
4915
4915
|
class Threads extends APIResource {
|
|
4916
4916
|
retrieve(threadID, options) {
|
|
4917
4917
|
return this._client.get(path`/chatkit/threads/${threadID}`, {
|
|
@@ -4945,7 +4945,7 @@ class Threads extends APIResource {
|
|
|
4945
4945
|
}
|
|
4946
4946
|
}
|
|
4947
4947
|
|
|
4948
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/beta/chatkit/chatkit.mjs
|
|
4948
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/beta/chatkit/chatkit.mjs
|
|
4949
4949
|
class ChatKit extends APIResource {
|
|
4950
4950
|
constructor() {
|
|
4951
4951
|
super(...arguments);
|
|
@@ -4956,7 +4956,7 @@ class ChatKit extends APIResource {
|
|
|
4956
4956
|
ChatKit.Sessions = Sessions2;
|
|
4957
4957
|
ChatKit.Threads = Threads;
|
|
4958
4958
|
|
|
4959
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/beta/responses/input-items.mjs
|
|
4959
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/beta/responses/input-items.mjs
|
|
4960
4960
|
class InputItems extends APIResource {
|
|
4961
4961
|
list(responseID, params = {}, options) {
|
|
4962
4962
|
const { betas, ...query } = params ?? {};
|
|
@@ -4972,7 +4972,7 @@ class InputItems extends APIResource {
|
|
|
4972
4972
|
}
|
|
4973
4973
|
}
|
|
4974
4974
|
|
|
4975
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/beta/responses/input-tokens.mjs
|
|
4975
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/beta/responses/input-tokens.mjs
|
|
4976
4976
|
class InputTokens extends APIResource {
|
|
4977
4977
|
count(params = {}, options) {
|
|
4978
4978
|
const { betas, ...body } = params ?? {};
|
|
@@ -4988,7 +4988,7 @@ class InputTokens extends APIResource {
|
|
|
4988
4988
|
}
|
|
4989
4989
|
}
|
|
4990
4990
|
|
|
4991
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/beta/responses/responses.mjs
|
|
4991
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/beta/responses/responses.mjs
|
|
4992
4992
|
class Responses extends APIResource {
|
|
4993
4993
|
constructor() {
|
|
4994
4994
|
super(...arguments);
|
|
@@ -5059,7 +5059,7 @@ class Responses extends APIResource {
|
|
|
5059
5059
|
Responses.InputItems = InputItems;
|
|
5060
5060
|
Responses.InputTokens = InputTokens;
|
|
5061
5061
|
|
|
5062
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/beta/threads/messages.mjs
|
|
5062
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/beta/threads/messages.mjs
|
|
5063
5063
|
class Messages2 extends APIResource {
|
|
5064
5064
|
create(threadID, body, options) {
|
|
5065
5065
|
return this._client.post(path`/threads/${threadID}/messages`, {
|
|
@@ -5104,7 +5104,7 @@ class Messages2 extends APIResource {
|
|
|
5104
5104
|
}
|
|
5105
5105
|
}
|
|
5106
5106
|
|
|
5107
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/beta/threads/runs/steps.mjs
|
|
5107
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/beta/threads/runs/steps.mjs
|
|
5108
5108
|
class Steps extends APIResource {
|
|
5109
5109
|
retrieve(stepID, params, options) {
|
|
5110
5110
|
const { thread_id, run_id, ...query } = params;
|
|
@@ -5125,7 +5125,7 @@ class Steps extends APIResource {
|
|
|
5125
5125
|
});
|
|
5126
5126
|
}
|
|
5127
5127
|
}
|
|
5128
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/internal/utils/base64.mjs
|
|
5128
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/internal/utils/base64.mjs
|
|
5129
5129
|
var toFloat32Array = (base64Str) => {
|
|
5130
5130
|
if (typeof Buffer !== "undefined") {
|
|
5131
5131
|
const buf = Buffer.from(base64Str, "base64");
|
|
@@ -5140,7 +5140,7 @@ var toFloat32Array = (base64Str) => {
|
|
|
5140
5140
|
return Array.from(new Float32Array(bytes.buffer));
|
|
5141
5141
|
}
|
|
5142
5142
|
};
|
|
5143
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/internal/utils/env.mjs
|
|
5143
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/internal/utils/env.mjs
|
|
5144
5144
|
var readEnv = (env) => {
|
|
5145
5145
|
if (typeof globalThis.process !== "undefined") {
|
|
5146
5146
|
return globalThis.process.env?.[env]?.trim() || undefined;
|
|
@@ -5150,7 +5150,7 @@ var readEnv = (env) => {
|
|
|
5150
5150
|
}
|
|
5151
5151
|
return;
|
|
5152
5152
|
};
|
|
5153
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/lib/AssistantStream.mjs
|
|
5153
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/lib/AssistantStream.mjs
|
|
5154
5154
|
var _AssistantStream_instances;
|
|
5155
5155
|
var _a;
|
|
5156
5156
|
var _AssistantStream_events;
|
|
@@ -5670,7 +5670,7 @@ _a = AssistantStream, _AssistantStream_addEvent = function _AssistantStream_addE
|
|
|
5670
5670
|
};
|
|
5671
5671
|
function assertNever2(_x) {}
|
|
5672
5672
|
|
|
5673
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/beta/threads/runs/runs.mjs
|
|
5673
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/beta/threads/runs/runs.mjs
|
|
5674
5674
|
class Runs extends APIResource {
|
|
5675
5675
|
constructor() {
|
|
5676
5676
|
super(...arguments);
|
|
@@ -5793,7 +5793,7 @@ class Runs extends APIResource {
|
|
|
5793
5793
|
}
|
|
5794
5794
|
Runs.Steps = Steps;
|
|
5795
5795
|
|
|
5796
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/beta/threads/threads.mjs
|
|
5796
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/beta/threads/threads.mjs
|
|
5797
5797
|
class Threads2 extends APIResource {
|
|
5798
5798
|
constructor() {
|
|
5799
5799
|
super(...arguments);
|
|
@@ -5851,7 +5851,7 @@ class Threads2 extends APIResource {
|
|
|
5851
5851
|
Threads2.Runs = Runs;
|
|
5852
5852
|
Threads2.Messages = Messages2;
|
|
5853
5853
|
|
|
5854
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/beta/beta.mjs
|
|
5854
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/beta/beta.mjs
|
|
5855
5855
|
class Beta extends APIResource {
|
|
5856
5856
|
constructor() {
|
|
5857
5857
|
super(...arguments);
|
|
@@ -5867,7 +5867,7 @@ Beta.Responses = Responses;
|
|
|
5867
5867
|
Beta.ChatKit = ChatKit;
|
|
5868
5868
|
Beta.Assistants = Assistants;
|
|
5869
5869
|
Beta.Threads = Threads2;
|
|
5870
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/completions.mjs
|
|
5870
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/completions.mjs
|
|
5871
5871
|
class Completions2 extends APIResource {
|
|
5872
5872
|
create(body, options) {
|
|
5873
5873
|
return this._client.post("/completions", {
|
|
@@ -5878,7 +5878,7 @@ class Completions2 extends APIResource {
|
|
|
5878
5878
|
});
|
|
5879
5879
|
}
|
|
5880
5880
|
}
|
|
5881
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/containers/files/content.mjs
|
|
5881
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/containers/files/content.mjs
|
|
5882
5882
|
class Content extends APIResource {
|
|
5883
5883
|
retrieve(fileID, params, options) {
|
|
5884
5884
|
const { container_id } = params;
|
|
@@ -5891,7 +5891,7 @@ class Content extends APIResource {
|
|
|
5891
5891
|
}
|
|
5892
5892
|
}
|
|
5893
5893
|
|
|
5894
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/containers/files/files.mjs
|
|
5894
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/containers/files/files.mjs
|
|
5895
5895
|
class Files extends APIResource {
|
|
5896
5896
|
constructor() {
|
|
5897
5897
|
super(...arguments);
|
|
@@ -5925,7 +5925,7 @@ class Files extends APIResource {
|
|
|
5925
5925
|
}
|
|
5926
5926
|
Files.Content = Content;
|
|
5927
5927
|
|
|
5928
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/containers/containers.mjs
|
|
5928
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/containers/containers.mjs
|
|
5929
5929
|
class Containers extends APIResource {
|
|
5930
5930
|
constructor() {
|
|
5931
5931
|
super(...arguments);
|
|
@@ -5956,7 +5956,7 @@ class Containers extends APIResource {
|
|
|
5956
5956
|
}
|
|
5957
5957
|
}
|
|
5958
5958
|
Containers.Files = Files;
|
|
5959
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/conversations/items.mjs
|
|
5959
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/conversations/items.mjs
|
|
5960
5960
|
class Items extends APIResource {
|
|
5961
5961
|
create(conversationID, params, options) {
|
|
5962
5962
|
const { include, ...body } = params;
|
|
@@ -5987,7 +5987,7 @@ class Items extends APIResource {
|
|
|
5987
5987
|
}
|
|
5988
5988
|
}
|
|
5989
5989
|
|
|
5990
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/conversations/conversations.mjs
|
|
5990
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/conversations/conversations.mjs
|
|
5991
5991
|
class Conversations extends APIResource {
|
|
5992
5992
|
constructor() {
|
|
5993
5993
|
super(...arguments);
|
|
@@ -6017,7 +6017,7 @@ class Conversations extends APIResource {
|
|
|
6017
6017
|
}
|
|
6018
6018
|
}
|
|
6019
6019
|
Conversations.Items = Items;
|
|
6020
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/embeddings.mjs
|
|
6020
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/embeddings.mjs
|
|
6021
6021
|
class Embeddings extends APIResource {
|
|
6022
6022
|
create(body, options) {
|
|
6023
6023
|
const hasUserProvidedEncodingFormat = !!body.encoding_format;
|
|
@@ -6048,7 +6048,7 @@ class Embeddings extends APIResource {
|
|
|
6048
6048
|
});
|
|
6049
6049
|
}
|
|
6050
6050
|
}
|
|
6051
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/evals/runs/output-items.mjs
|
|
6051
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/evals/runs/output-items.mjs
|
|
6052
6052
|
class OutputItems extends APIResource {
|
|
6053
6053
|
retrieve(outputItemID, params, options) {
|
|
6054
6054
|
const { eval_id, run_id } = params;
|
|
@@ -6063,7 +6063,7 @@ class OutputItems extends APIResource {
|
|
|
6063
6063
|
}
|
|
6064
6064
|
}
|
|
6065
6065
|
|
|
6066
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/evals/runs/runs.mjs
|
|
6066
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/evals/runs/runs.mjs
|
|
6067
6067
|
class Runs2 extends APIResource {
|
|
6068
6068
|
constructor() {
|
|
6069
6069
|
super(...arguments);
|
|
@@ -6107,7 +6107,7 @@ class Runs2 extends APIResource {
|
|
|
6107
6107
|
}
|
|
6108
6108
|
Runs2.OutputItems = OutputItems;
|
|
6109
6109
|
|
|
6110
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/evals/evals.mjs
|
|
6110
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/evals/evals.mjs
|
|
6111
6111
|
class Evals extends APIResource {
|
|
6112
6112
|
constructor() {
|
|
6113
6113
|
super(...arguments);
|
|
@@ -6134,7 +6134,7 @@ class Evals extends APIResource {
|
|
|
6134
6134
|
}
|
|
6135
6135
|
}
|
|
6136
6136
|
Evals.Runs = Runs2;
|
|
6137
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/files.mjs
|
|
6137
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/files.mjs
|
|
6138
6138
|
class Files2 extends APIResource {
|
|
6139
6139
|
create(body, options) {
|
|
6140
6140
|
return this._client.post("/files", multipartFormRequestOptions({ body, ...options, __security: { bearerAuth: true } }, this._client));
|
|
@@ -6176,11 +6176,11 @@ class Files2 extends APIResource {
|
|
|
6176
6176
|
return file;
|
|
6177
6177
|
}
|
|
6178
6178
|
}
|
|
6179
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/fine-tuning/methods.mjs
|
|
6179
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/fine-tuning/methods.mjs
|
|
6180
6180
|
class Methods extends APIResource {
|
|
6181
6181
|
}
|
|
6182
6182
|
|
|
6183
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/fine-tuning/alpha/graders.mjs
|
|
6183
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/fine-tuning/alpha/graders.mjs
|
|
6184
6184
|
class Graders extends APIResource {
|
|
6185
6185
|
run(body, options) {
|
|
6186
6186
|
return this._client.post("/fine_tuning/alpha/graders/run", {
|
|
@@ -6198,7 +6198,7 @@ class Graders extends APIResource {
|
|
|
6198
6198
|
}
|
|
6199
6199
|
}
|
|
6200
6200
|
|
|
6201
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/fine-tuning/alpha/alpha.mjs
|
|
6201
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/fine-tuning/alpha/alpha.mjs
|
|
6202
6202
|
class Alpha extends APIResource {
|
|
6203
6203
|
constructor() {
|
|
6204
6204
|
super(...arguments);
|
|
@@ -6207,7 +6207,7 @@ class Alpha extends APIResource {
|
|
|
6207
6207
|
}
|
|
6208
6208
|
Alpha.Graders = Graders;
|
|
6209
6209
|
|
|
6210
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/fine-tuning/checkpoints/permissions.mjs
|
|
6210
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/fine-tuning/checkpoints/permissions.mjs
|
|
6211
6211
|
class Permissions extends APIResource {
|
|
6212
6212
|
create(fineTunedModelCheckpoint, body, options) {
|
|
6213
6213
|
return this._client.getAPIList(path`/fine_tuning/checkpoints/${fineTunedModelCheckpoint}/permissions`, Page, { body, method: "post", ...options, __security: { adminAPIKeyAuth: true } });
|
|
@@ -6228,7 +6228,7 @@ class Permissions extends APIResource {
|
|
|
6228
6228
|
}
|
|
6229
6229
|
}
|
|
6230
6230
|
|
|
6231
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/fine-tuning/checkpoints/checkpoints.mjs
|
|
6231
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/fine-tuning/checkpoints/checkpoints.mjs
|
|
6232
6232
|
class Checkpoints extends APIResource {
|
|
6233
6233
|
constructor() {
|
|
6234
6234
|
super(...arguments);
|
|
@@ -6237,14 +6237,14 @@ class Checkpoints extends APIResource {
|
|
|
6237
6237
|
}
|
|
6238
6238
|
Checkpoints.Permissions = Permissions;
|
|
6239
6239
|
|
|
6240
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/fine-tuning/jobs/checkpoints.mjs
|
|
6240
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/fine-tuning/jobs/checkpoints.mjs
|
|
6241
6241
|
class Checkpoints2 extends APIResource {
|
|
6242
6242
|
list(fineTuningJobID, query2 = {}, options) {
|
|
6243
6243
|
return this._client.getAPIList(path`/fine_tuning/jobs/${fineTuningJobID}/checkpoints`, CursorPage, { query: query2, ...options, __security: { bearerAuth: true } });
|
|
6244
6244
|
}
|
|
6245
6245
|
}
|
|
6246
6246
|
|
|
6247
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/fine-tuning/jobs/jobs.mjs
|
|
6247
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/fine-tuning/jobs/jobs.mjs
|
|
6248
6248
|
class Jobs extends APIResource {
|
|
6249
6249
|
constructor() {
|
|
6250
6250
|
super(...arguments);
|
|
@@ -6290,7 +6290,7 @@ class Jobs extends APIResource {
|
|
|
6290
6290
|
}
|
|
6291
6291
|
Jobs.Checkpoints = Checkpoints2;
|
|
6292
6292
|
|
|
6293
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/fine-tuning/fine-tuning.mjs
|
|
6293
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/fine-tuning/fine-tuning.mjs
|
|
6294
6294
|
class FineTuning extends APIResource {
|
|
6295
6295
|
constructor() {
|
|
6296
6296
|
super(...arguments);
|
|
@@ -6304,11 +6304,11 @@ FineTuning.Methods = Methods;
|
|
|
6304
6304
|
FineTuning.Jobs = Jobs;
|
|
6305
6305
|
FineTuning.Checkpoints = Checkpoints;
|
|
6306
6306
|
FineTuning.Alpha = Alpha;
|
|
6307
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/graders/grader-models.mjs
|
|
6307
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/graders/grader-models.mjs
|
|
6308
6308
|
class GraderModels extends APIResource {
|
|
6309
6309
|
}
|
|
6310
6310
|
|
|
6311
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/graders/graders.mjs
|
|
6311
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/graders/graders.mjs
|
|
6312
6312
|
class Graders2 extends APIResource {
|
|
6313
6313
|
constructor() {
|
|
6314
6314
|
super(...arguments);
|
|
@@ -6316,7 +6316,7 @@ class Graders2 extends APIResource {
|
|
|
6316
6316
|
}
|
|
6317
6317
|
}
|
|
6318
6318
|
Graders2.GraderModels = GraderModels;
|
|
6319
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/images.mjs
|
|
6319
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/images.mjs
|
|
6320
6320
|
class Images extends APIResource {
|
|
6321
6321
|
createVariation(body, options) {
|
|
6322
6322
|
return this._client.post("/images/variations", multipartFormRequestOptions({ body, ...options, __security: { bearerAuth: true } }, this._client));
|
|
@@ -6333,7 +6333,7 @@ class Images extends APIResource {
|
|
|
6333
6333
|
});
|
|
6334
6334
|
}
|
|
6335
6335
|
}
|
|
6336
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/models.mjs
|
|
6336
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/models.mjs
|
|
6337
6337
|
class Models extends APIResource {
|
|
6338
6338
|
retrieve(model, options) {
|
|
6339
6339
|
return this._client.get(path`/models/${model}`, { ...options, __security: { bearerAuth: true } });
|
|
@@ -6345,13 +6345,13 @@ class Models extends APIResource {
|
|
|
6345
6345
|
return this._client.delete(path`/models/${model}`, { ...options, __security: { bearerAuth: true } });
|
|
6346
6346
|
}
|
|
6347
6347
|
}
|
|
6348
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/moderations.mjs
|
|
6348
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/moderations.mjs
|
|
6349
6349
|
class Moderations extends APIResource {
|
|
6350
6350
|
create(body, options) {
|
|
6351
6351
|
return this._client.post("/moderations", { body, ...options, __security: { bearerAuth: true } });
|
|
6352
6352
|
}
|
|
6353
6353
|
}
|
|
6354
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/realtime/calls.mjs
|
|
6354
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/realtime/calls.mjs
|
|
6355
6355
|
class Calls extends APIResource {
|
|
6356
6356
|
accept(callID, body, options) {
|
|
6357
6357
|
return this._client.post(path`/realtime/calls/${callID}/accept`, {
|
|
@@ -6386,7 +6386,7 @@ class Calls extends APIResource {
|
|
|
6386
6386
|
}
|
|
6387
6387
|
}
|
|
6388
6388
|
|
|
6389
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/realtime/client-secrets.mjs
|
|
6389
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/realtime/client-secrets.mjs
|
|
6390
6390
|
class ClientSecrets extends APIResource {
|
|
6391
6391
|
create(body, options) {
|
|
6392
6392
|
return this._client.post("/realtime/client_secrets", {
|
|
@@ -6397,7 +6397,7 @@ class ClientSecrets extends APIResource {
|
|
|
6397
6397
|
}
|
|
6398
6398
|
}
|
|
6399
6399
|
|
|
6400
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/realtime/realtime.mjs
|
|
6400
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/realtime/realtime.mjs
|
|
6401
6401
|
class Realtime2 extends APIResource {
|
|
6402
6402
|
constructor() {
|
|
6403
6403
|
super(...arguments);
|
|
@@ -6407,7 +6407,7 @@ class Realtime2 extends APIResource {
|
|
|
6407
6407
|
}
|
|
6408
6408
|
Realtime2.ClientSecrets = ClientSecrets;
|
|
6409
6409
|
Realtime2.Calls = Calls;
|
|
6410
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/lib/ResponsesParser.mjs
|
|
6410
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/lib/ResponsesParser.mjs
|
|
6411
6411
|
function maybeParseResponse(response, params) {
|
|
6412
6412
|
if (!params || !hasAutoParseableInput2(params)) {
|
|
6413
6413
|
const parsed = {
|
|
@@ -6533,7 +6533,7 @@ function addOutputText(rsp) {
|
|
|
6533
6533
|
rsp.output_text = texts.join("");
|
|
6534
6534
|
}
|
|
6535
6535
|
|
|
6536
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/lib/responses/ResponseAccumulator.mjs
|
|
6536
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/lib/responses/ResponseAccumulator.mjs
|
|
6537
6537
|
function accumulateResponse(event, snapshot) {
|
|
6538
6538
|
if (!snapshot) {
|
|
6539
6539
|
if (event.type !== "response.created") {
|
|
@@ -6922,7 +6922,7 @@ function assertNever3(value) {
|
|
|
6922
6922
|
throw new OpenAIError(`Unhandled response stream event: ${JSON.stringify(value)}`);
|
|
6923
6923
|
}
|
|
6924
6924
|
|
|
6925
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/lib/responses/ResponseStream.mjs
|
|
6925
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/lib/responses/ResponseStream.mjs
|
|
6926
6926
|
var _ResponseStream_instances;
|
|
6927
6927
|
var _ResponseStream_params;
|
|
6928
6928
|
var _ResponseStream_currentResponseSnapshot;
|
|
@@ -7113,14 +7113,14 @@ function finalizeResponse(snapshot, params) {
|
|
|
7113
7113
|
return maybeParseResponse(snapshot, params);
|
|
7114
7114
|
}
|
|
7115
7115
|
|
|
7116
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/responses/input-items.mjs
|
|
7116
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/responses/input-items.mjs
|
|
7117
7117
|
class InputItems2 extends APIResource {
|
|
7118
7118
|
list(responseID, query2 = {}, options) {
|
|
7119
7119
|
return this._client.getAPIList(path`/responses/${responseID}/input_items`, CursorPage, { query: query2, ...options, __security: { bearerAuth: true } });
|
|
7120
7120
|
}
|
|
7121
7121
|
}
|
|
7122
7122
|
|
|
7123
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/responses/input-tokens.mjs
|
|
7123
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/responses/input-tokens.mjs
|
|
7124
7124
|
class InputTokens2 extends APIResource {
|
|
7125
7125
|
count(body = {}, options) {
|
|
7126
7126
|
return this._client.post("/responses/input_tokens", {
|
|
@@ -7131,7 +7131,7 @@ class InputTokens2 extends APIResource {
|
|
|
7131
7131
|
}
|
|
7132
7132
|
}
|
|
7133
7133
|
|
|
7134
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/responses/responses.mjs
|
|
7134
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/responses/responses.mjs
|
|
7135
7135
|
class Responses2 extends APIResource {
|
|
7136
7136
|
constructor() {
|
|
7137
7137
|
super(...arguments);
|
|
@@ -7189,7 +7189,7 @@ class Responses2 extends APIResource {
|
|
|
7189
7189
|
}
|
|
7190
7190
|
Responses2.InputItems = InputItems2;
|
|
7191
7191
|
Responses2.InputTokens = InputTokens2;
|
|
7192
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/skills/content.mjs
|
|
7192
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/skills/content.mjs
|
|
7193
7193
|
class Content2 extends APIResource {
|
|
7194
7194
|
retrieve(skillID, options) {
|
|
7195
7195
|
return this._client.get(path`/skills/${skillID}/content`, {
|
|
@@ -7201,7 +7201,7 @@ class Content2 extends APIResource {
|
|
|
7201
7201
|
}
|
|
7202
7202
|
}
|
|
7203
7203
|
|
|
7204
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/skills/versions/content.mjs
|
|
7204
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/skills/versions/content.mjs
|
|
7205
7205
|
class Content3 extends APIResource {
|
|
7206
7206
|
retrieve(version, params, options) {
|
|
7207
7207
|
const { skill_id } = params;
|
|
@@ -7214,7 +7214,7 @@ class Content3 extends APIResource {
|
|
|
7214
7214
|
}
|
|
7215
7215
|
}
|
|
7216
7216
|
|
|
7217
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/skills/versions/versions.mjs
|
|
7217
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/skills/versions/versions.mjs
|
|
7218
7218
|
class Versions extends APIResource {
|
|
7219
7219
|
constructor() {
|
|
7220
7220
|
super(...arguments);
|
|
@@ -7247,7 +7247,7 @@ class Versions extends APIResource {
|
|
|
7247
7247
|
}
|
|
7248
7248
|
Versions.Content = Content3;
|
|
7249
7249
|
|
|
7250
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/skills/skills.mjs
|
|
7250
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/skills/skills.mjs
|
|
7251
7251
|
class Skills extends APIResource {
|
|
7252
7252
|
constructor() {
|
|
7253
7253
|
super(...arguments);
|
|
@@ -7280,14 +7280,14 @@ class Skills extends APIResource {
|
|
|
7280
7280
|
}
|
|
7281
7281
|
Skills.Content = Content2;
|
|
7282
7282
|
Skills.Versions = Versions;
|
|
7283
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/uploads/parts.mjs
|
|
7283
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/uploads/parts.mjs
|
|
7284
7284
|
class Parts extends APIResource {
|
|
7285
7285
|
create(uploadID, body, options) {
|
|
7286
7286
|
return this._client.post(path`/uploads/${uploadID}/parts`, multipartFormRequestOptions({ body, ...options, __security: { bearerAuth: true } }, this._client));
|
|
7287
7287
|
}
|
|
7288
7288
|
}
|
|
7289
7289
|
|
|
7290
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/uploads/uploads.mjs
|
|
7290
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/uploads/uploads.mjs
|
|
7291
7291
|
class Uploads extends APIResource {
|
|
7292
7292
|
constructor() {
|
|
7293
7293
|
super(...arguments);
|
|
@@ -7311,7 +7311,7 @@ class Uploads extends APIResource {
|
|
|
7311
7311
|
}
|
|
7312
7312
|
}
|
|
7313
7313
|
Uploads.Parts = Parts;
|
|
7314
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/lib/Util.mjs
|
|
7314
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/lib/Util.mjs
|
|
7315
7315
|
var allSettledWithThrow = async (promises) => {
|
|
7316
7316
|
const results = await Promise.allSettled(promises);
|
|
7317
7317
|
const rejected = results.filter((result) => result.status === "rejected");
|
|
@@ -7330,7 +7330,7 @@ var allSettledWithThrow = async (promises) => {
|
|
|
7330
7330
|
return values2;
|
|
7331
7331
|
};
|
|
7332
7332
|
|
|
7333
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/vector-stores/file-batches.mjs
|
|
7333
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/vector-stores/file-batches.mjs
|
|
7334
7334
|
class FileBatches extends APIResource {
|
|
7335
7335
|
create(vectorStoreID, body, options) {
|
|
7336
7336
|
return this._client.post(path`/vector_stores/${vectorStoreID}/file_batches`, {
|
|
@@ -7428,7 +7428,7 @@ class FileBatches extends APIResource {
|
|
|
7428
7428
|
}
|
|
7429
7429
|
}
|
|
7430
7430
|
|
|
7431
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/vector-stores/files.mjs
|
|
7431
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/vector-stores/files.mjs
|
|
7432
7432
|
class Files3 extends APIResource {
|
|
7433
7433
|
create(vectorStoreID, body, options) {
|
|
7434
7434
|
return this._client.post(path`/vector_stores/${vectorStoreID}/files`, {
|
|
@@ -7528,7 +7528,7 @@ class Files3 extends APIResource {
|
|
|
7528
7528
|
}
|
|
7529
7529
|
}
|
|
7530
7530
|
|
|
7531
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/vector-stores/vector-stores.mjs
|
|
7531
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/vector-stores/vector-stores.mjs
|
|
7532
7532
|
class VectorStores extends APIResource {
|
|
7533
7533
|
constructor() {
|
|
7534
7534
|
super(...arguments);
|
|
@@ -7585,7 +7585,7 @@ class VectorStores extends APIResource {
|
|
|
7585
7585
|
}
|
|
7586
7586
|
VectorStores.Files = Files3;
|
|
7587
7587
|
VectorStores.FileBatches = FileBatches;
|
|
7588
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/videos.mjs
|
|
7588
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/videos.mjs
|
|
7589
7589
|
class Videos extends APIResource {
|
|
7590
7590
|
create(body, options) {
|
|
7591
7591
|
return this._client.post("/videos", multipartFormRequestOptions({ body, ...options, __security: { bearerAuth: true } }, this._client));
|
|
@@ -7631,7 +7631,7 @@ class Videos extends APIResource {
|
|
|
7631
7631
|
return this._client.post(path`/videos/${videoID}/remix`, maybeMultipartFormRequestOptions({ body, ...options, __security: { bearerAuth: true } }, this._client));
|
|
7632
7632
|
}
|
|
7633
7633
|
}
|
|
7634
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/webhooks/webhooks.mjs
|
|
7634
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/resources/webhooks/webhooks.mjs
|
|
7635
7635
|
var _Webhooks_instances;
|
|
7636
7636
|
var _Webhooks_validateSecret;
|
|
7637
7637
|
var _Webhooks_getRequiredHeader;
|
|
@@ -7697,7 +7697,7 @@ _Webhooks_instances = new WeakSet, _Webhooks_validateSecret = function _Webhooks
|
|
|
7697
7697
|
}
|
|
7698
7698
|
return value;
|
|
7699
7699
|
};
|
|
7700
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/internal/provider.mjs
|
|
7700
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/internal/provider.mjs
|
|
7701
7701
|
var providerDefinitionsKey = Symbol.for("openai.node.providerDefinitions.v1");
|
|
7702
7702
|
var providerGlobal = globalThis;
|
|
7703
7703
|
var existingProviderDefinitions = providerGlobal[providerDefinitionsKey];
|
|
@@ -7713,7 +7713,7 @@ function configureProvider(provider) {
|
|
|
7713
7713
|
return definition.configure();
|
|
7714
7714
|
}
|
|
7715
7715
|
|
|
7716
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/client.mjs
|
|
7716
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/client.mjs
|
|
7717
7717
|
var _OpenAI_instances;
|
|
7718
7718
|
var _a2;
|
|
7719
7719
|
var _OpenAI_encoder;
|
|
@@ -8334,7 +8334,7 @@ function isUndiciDispatcherVersionMismatchError(error2) {
|
|
|
8334
8334
|
}
|
|
8335
8335
|
return false;
|
|
8336
8336
|
}
|
|
8337
|
-
// node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/azure.mjs
|
|
8337
|
+
// ../../node_modules/.bun/openai@6.49.0+ab3ed8e9421bfd7b/node_modules/openai/azure.mjs
|
|
8338
8338
|
var _deployments_endpoints = new Set([
|
|
8339
8339
|
"/completions",
|
|
8340
8340
|
"/chat/completions",
|
|
@@ -8346,7 +8346,797 @@ var _deployments_endpoints = new Set([
|
|
|
8346
8346
|
"/batches",
|
|
8347
8347
|
"/images/edits"
|
|
8348
8348
|
]);
|
|
8349
|
-
//
|
|
8349
|
+
// ../core/src/agent-runtime.ts
|
|
8350
|
+
import { createHash, randomUUID } from "node:crypto";
|
|
8351
|
+
|
|
8352
|
+
// ../core/src/effort-policy.ts
|
|
8353
|
+
var HARD_TASK = /\b(debug|fail(?:s|ed|ing|ure|ures)?|bugs?|broken|crash\w*|not working|doesn'?t work|find out|diagnos\w*|root[- ]cause|why (?:is|does|did|are|do|won'?t|isn'?t)|refactor\w*|architect\w*|design\w*|migrat\w*|security|vulnerab\w*|performance|optimi[sz]\w*|race condition|deadlock|investigat\w*|figure out|rewrite|algorithm|concurren\w*|memory leak|flaky|intermittent)\b/i;
|
|
8354
|
+
var CHATTER = /^\s*(?:hi|hello|hey|yo|thanks?|thank you|ok(?:ay)?|cool|nice|good (?:morning|evening)|how are you)\b/i;
|
|
8355
|
+
function classifyObjective(objective) {
|
|
8356
|
+
const text = objective.trim();
|
|
8357
|
+
if (HARD_TASK.test(text) || text.length > 700)
|
|
8358
|
+
return "hard";
|
|
8359
|
+
if (text.length <= 48 && (CHATTER.test(text) || !/[./\\]|\b(?:file|function|test|bug|fix|add|create|write|build|run|install|update|change|remove|delete|implement)\b/i.test(text)))
|
|
8360
|
+
return "trivial";
|
|
8361
|
+
return "routine";
|
|
8362
|
+
}
|
|
8363
|
+
var SHALLOW_ERROR = /does not exist|has no parameter|is a directory|not found in|no such file|escapes the workspace|requires |must be |is not available|oldText|identical|too large|outside the|unknown (?:application|tool)|looks like a binary/i;
|
|
8364
|
+
function isShallowToolError(content) {
|
|
8365
|
+
return SHALLOW_ERROR.test(content.slice(0, 600));
|
|
8366
|
+
}
|
|
8367
|
+
var READ_ONLY = new Set(["read_file", "list_files", "glob_files", "grep_files", "find_symbol", "scan_secrets", "application_status", "web_fetch", "web_search"]);
|
|
8368
|
+
var EDITING = new Set(["write_file", "edit_file", "notebook_edit"]);
|
|
8369
|
+
var ORDER = ["minimal", "low", "medium", "high", "xhigh", "max"];
|
|
8370
|
+
var rank = (effort) => ORDER.indexOf(effort);
|
|
8371
|
+
var atLeast = (effort, floor) => rank(effort) >= rank(floor) ? effort : floor;
|
|
8372
|
+
var atMost = (effort, ceiling) => rank(effort) <= rank(ceiling) ? effort : ceiling;
|
|
8373
|
+
function predictEffort(signals) {
|
|
8374
|
+
const decision = decide(signals);
|
|
8375
|
+
const hint = signals.difficultyHint;
|
|
8376
|
+
if (hint === "hard" && signals.iteration > 1 && signals.consecutiveFailures === 0 && !signals.greenSinceEdit && decision.effort !== undefined) {
|
|
8377
|
+
const raised = atLeast(decision.effort, "low");
|
|
8378
|
+
return raised === decision.effort ? decision : { effort: raised, reason: `${decision.reason}; Jev says the task is hard` };
|
|
8379
|
+
}
|
|
8380
|
+
if (hint === "routine" && signals.consecutiveFailures === 0 && !signals.unresolvedFailure) {
|
|
8381
|
+
const capped = decision.effort === undefined ? "low" : atMost(decision.effort, "low");
|
|
8382
|
+
return capped === decision.effort ? decision : { effort: capped, reason: `${decision.reason}; Jev says the task is routine` };
|
|
8383
|
+
}
|
|
8384
|
+
return decision;
|
|
8385
|
+
}
|
|
8386
|
+
function decide(s) {
|
|
8387
|
+
if (s.iteration <= 1 || s.lastResults.length === 0) {
|
|
8388
|
+
const kind = classifyObjective(s.objective);
|
|
8389
|
+
if (kind === "hard")
|
|
8390
|
+
return { effort: undefined, reason: "a task that reads as debugging, design or refactoring: the model's own default" };
|
|
8391
|
+
if (kind === "trivial")
|
|
8392
|
+
return { effort: "minimal", reason: "a short, simple message" };
|
|
8393
|
+
return { effort: s.difficultyHint === "hard" ? undefined : "low", reason: "an ordinary request: plan briefly" };
|
|
8394
|
+
}
|
|
8395
|
+
const substantive = s.lastResults.filter((result) => result.isError && !result.shallow);
|
|
8396
|
+
if (substantive.length > 0) {
|
|
8397
|
+
return { effort: undefined, reason: s.consecutiveFailures >= 2 ? `${s.consecutiveFailures} failures in a row: work out what is really wrong` : `${substantive[0].tool} failed: understand why` };
|
|
8398
|
+
}
|
|
8399
|
+
if (s.lastResults.some((result) => result.isError))
|
|
8400
|
+
return { effort: "low", reason: "a mistake in the arguments: correct it" };
|
|
8401
|
+
if (s.greenSinceEdit)
|
|
8402
|
+
return { effort: "minimal", reason: "verified: summarize" };
|
|
8403
|
+
if (s.lastResults.some((result) => READ_ONLY.has(result.tool))) {
|
|
8404
|
+
if (s.unresolvedFailure)
|
|
8405
|
+
return { effort: undefined, reason: "reading code while something is still broken: find the cause" };
|
|
8406
|
+
if (classifyObjective(s.objective) === "hard")
|
|
8407
|
+
return { effort: undefined, reason: "reading code for a hard task: understand it" };
|
|
8408
|
+
return { effort: "low", reason: "reading: take it in" };
|
|
8409
|
+
}
|
|
8410
|
+
if (s.lastResults.every((result) => EDITING.has(result.tool)))
|
|
8411
|
+
return { effort: "minimal", reason: "edits went through: continue the plan" };
|
|
8412
|
+
return { effort: "low", reason: "routine step succeeded" };
|
|
8413
|
+
}
|
|
8414
|
+
function reasoningFromEnvironment(environment) {
|
|
8415
|
+
const value = environment.ARCHYMEDES_REASONING?.trim().toLowerCase();
|
|
8416
|
+
return value === "auto" || value === "minimal" || value === "low" || value === "medium" || value === "high" ? value : undefined;
|
|
8417
|
+
}
|
|
8418
|
+
|
|
8419
|
+
// ../core/src/agent-runtime.ts
|
|
8420
|
+
var IMAGE_TOKEN_ESTIMATE = 1600;
|
|
8421
|
+
var IMAGE_CHAR_ESTIMATE = IMAGE_TOKEN_ESTIMATE * 4;
|
|
8422
|
+
function agentMessagePromptParts(message) {
|
|
8423
|
+
const parts = [message.content ?? ""];
|
|
8424
|
+
if ("images" in message)
|
|
8425
|
+
for (const _image of message.images ?? [])
|
|
8426
|
+
parts.push(" ".repeat(IMAGE_CHAR_ESTIMATE));
|
|
8427
|
+
if ("toolCalls" in message && Array.isArray(message.toolCalls)) {
|
|
8428
|
+
for (const call of message.toolCalls)
|
|
8429
|
+
parts.push(call.id, call.name, JSON.stringify(call.arguments ?? {}));
|
|
8430
|
+
} else if (message.role === "tool") {
|
|
8431
|
+
parts.push(message.toolCallId, message.name);
|
|
8432
|
+
}
|
|
8433
|
+
return parts;
|
|
8434
|
+
}
|
|
8435
|
+
function providerEffort(effort) {
|
|
8436
|
+
return effort === "minimal" ? "low" : effort;
|
|
8437
|
+
}
|
|
8438
|
+
var EVIDENCE_RANK = { check: 1, tests: 2, smoke: 3, behavior: 4 };
|
|
8439
|
+
function repeatedFailureHint(toolName, failures, missingPathStreak) {
|
|
8440
|
+
if (failures >= 2) {
|
|
8441
|
+
return `This exact ${toolName} call has now failed ${failures} times. Do not send it again unchanged: change the arguments, or run list_files with path "." to see what is really in the project.`;
|
|
8442
|
+
}
|
|
8443
|
+
if (missingPathStreak >= 3) {
|
|
8444
|
+
return 'Several paths in a row did not exist. Stop guessing paths: run list_files with path "." (or glob_files with "**/*") and use only names it returns.';
|
|
8445
|
+
}
|
|
8446
|
+
return null;
|
|
8447
|
+
}
|
|
8448
|
+
var MAX_VERIFICATION_NUDGES = 1;
|
|
8449
|
+
var MAX_UNAVAILABLE_TOOL_RECOVERIES = 1;
|
|
8450
|
+
var PROVIDER_BACKOFF_BASE_MS = 1000;
|
|
8451
|
+
var PROVIDER_BACKOFF_CAP_MS = 30000;
|
|
8452
|
+
var PROVIDER_RETRY_AFTER_CAP_MS = 60000;
|
|
8453
|
+
var MAX_TOOL_TURN_RECOVERIES = 2;
|
|
8454
|
+
var RETRY_POLICIES = {
|
|
8455
|
+
server: { maxAttempts: 4, baseDelayMs: 1000, maxDelayMs: 15000 },
|
|
8456
|
+
rate_limit: { maxAttempts: 6, baseDelayMs: 2000, maxDelayMs: 60000 },
|
|
8457
|
+
timeout: { maxAttempts: 2, baseDelayMs: 1000, maxDelayMs: 8000 },
|
|
8458
|
+
network: { maxAttempts: 3, baseDelayMs: 250, maxDelayMs: 4000 },
|
|
8459
|
+
unknown: { maxAttempts: 3, baseDelayMs: 1000, maxDelayMs: 8000 }
|
|
8460
|
+
};
|
|
8461
|
+
|
|
8462
|
+
class ProviderRequestError extends Error {
|
|
8463
|
+
attempts;
|
|
8464
|
+
kind;
|
|
8465
|
+
waitedMs;
|
|
8466
|
+
retrySuppressed;
|
|
8467
|
+
constructor(cause, options) {
|
|
8468
|
+
const original = cause instanceof Error ? cause.message : String(cause);
|
|
8469
|
+
const kind = options.kind ? ` (${options.kind.replace("_", " ")} error)` : "";
|
|
8470
|
+
const waited = options.waitedMs && options.waitedMs > 0 ? ` over ${(options.waitedMs / 1000).toFixed(1)}s of retries` : "";
|
|
8471
|
+
const detail = options.retrySuppressed === "output_started" ? "The model connection failed after output began, so Archymedes did not retry to avoid duplicated output, charges, or tool actions." : `The model request failed after ${options.attempts} attempt${options.attempts === 1 ? "" : "s"}${kind}${waited}.`;
|
|
8472
|
+
const advice = options.kind === "rate_limit" && !options.retrySuppressed ? " This model is rate limited right now: wait a minute, or switch with /model (on free mode, openrouter/free picks among the free models for you)." : "";
|
|
8473
|
+
super(`${detail}${advice} Provider message: ${original}`, { cause });
|
|
8474
|
+
this.name = "ProviderRequestError";
|
|
8475
|
+
this.attempts = options.attempts;
|
|
8476
|
+
if (options.kind)
|
|
8477
|
+
this.kind = options.kind;
|
|
8478
|
+
if (options.waitedMs !== undefined)
|
|
8479
|
+
this.waitedMs = options.waitedMs;
|
|
8480
|
+
this.retrySuppressed = options.retrySuppressed ?? null;
|
|
8481
|
+
}
|
|
8482
|
+
}
|
|
8483
|
+
var MAX_LENGTH_CONTINUATIONS = 3;
|
|
8484
|
+
var LENGTH_CONTINUATION_NUDGE = "Your previous message hit the output token limit and was cut off mid-answer. Continue from exactly where it stopped — do not repeat what you already wrote, and do not restart. If you were part-way through a tool call, send that tool call again from the beginning, since the truncated one was discarded. If the remaining work does not fit in one reply, do the part that fits and keep each reply shorter.";
|
|
8485
|
+
var VERIFICATION_NUDGE = "You changed the workspace but ended the turn without running anything that verifies it. Run the smallest relevant existing test, check, or smoke command and report the real result. Add a regression test only when the change would otherwise be unprotected. If this project genuinely has nothing relevant to run, say so explicitly instead of stopping silently.";
|
|
8486
|
+
var TEST_EVIDENCE_NUDGE = "That build/typecheck passing shows the code compiles, not that it behaves correctly. Run the smallest relevant existing test or smoke command for the changed behaviour and report the real result. Add a regression test only when the change would otherwise be unprotected. If the change genuinely has no behaviour to assert (documentation, formatting, configuration), say so explicitly and stop.";
|
|
8487
|
+
var TRANSIENT_PROVIDER_CODES = new Set([
|
|
8488
|
+
"ABORT_ERR",
|
|
8489
|
+
"ECONNREFUSED",
|
|
8490
|
+
"ECONNRESET",
|
|
8491
|
+
"EAI_AGAIN",
|
|
8492
|
+
"ENETDOWN",
|
|
8493
|
+
"ENETUNREACH",
|
|
8494
|
+
"ETIMEDOUT",
|
|
8495
|
+
"UND_ERR_CONNECT_TIMEOUT",
|
|
8496
|
+
"UND_ERR_HEADERS_TIMEOUT",
|
|
8497
|
+
"UND_ERR_SOCKET"
|
|
8498
|
+
]);
|
|
8499
|
+
function errorRecord(value) {
|
|
8500
|
+
return typeof value === "object" && value !== null ? value : undefined;
|
|
8501
|
+
}
|
|
8502
|
+
function isRetryableProviderError(error2) {
|
|
8503
|
+
let current = error2;
|
|
8504
|
+
const visited = new Set;
|
|
8505
|
+
const messages = [];
|
|
8506
|
+
for (let depth = 0;current !== undefined && current !== null && depth < 5 && !visited.has(current); depth += 1) {
|
|
8507
|
+
visited.add(current);
|
|
8508
|
+
const record = errorRecord(current);
|
|
8509
|
+
if (current instanceof Error)
|
|
8510
|
+
messages.push(current.message);
|
|
8511
|
+
else if (typeof current === "string")
|
|
8512
|
+
messages.push(current);
|
|
8513
|
+
if (!record)
|
|
8514
|
+
break;
|
|
8515
|
+
if (typeof record.retryable === "boolean")
|
|
8516
|
+
return record.retryable;
|
|
8517
|
+
const status = Number(record.status ?? record.statusCode);
|
|
8518
|
+
if (Number.isInteger(status)) {
|
|
8519
|
+
if (status === 408 || status === 409 || status === 425 || status === 429 || status === 500 || status === 502 || status === 503 || status === 504)
|
|
8520
|
+
return true;
|
|
8521
|
+
if (status >= 400 && status < 600)
|
|
8522
|
+
return false;
|
|
8523
|
+
}
|
|
8524
|
+
const code = typeof record.code === "string" ? record.code.toUpperCase() : "";
|
|
8525
|
+
if (TRANSIENT_PROVIDER_CODES.has(code))
|
|
8526
|
+
return true;
|
|
8527
|
+
current = record.cause;
|
|
8528
|
+
}
|
|
8529
|
+
return messages.some((message) => /\b(?:timed?\s*out|timeout|rate\s*limit|overload(?:ed)?|temporar(?:y|ily)|connection\s*reset|socket\s*hang\s*up|fetch\s*failed|network\s*error)\b/i.test(message));
|
|
8530
|
+
}
|
|
8531
|
+
function providerFailureKind(error2) {
|
|
8532
|
+
let current = error2;
|
|
8533
|
+
const visited = new Set;
|
|
8534
|
+
const messages = [];
|
|
8535
|
+
for (let depth = 0;current !== undefined && current !== null && depth < 5 && !visited.has(current); depth += 1) {
|
|
8536
|
+
visited.add(current);
|
|
8537
|
+
const record = errorRecord(current);
|
|
8538
|
+
if (current instanceof Error)
|
|
8539
|
+
messages.push(current.message);
|
|
8540
|
+
else if (typeof current === "string")
|
|
8541
|
+
messages.push(current);
|
|
8542
|
+
if (!record)
|
|
8543
|
+
break;
|
|
8544
|
+
const status = Number(record.status ?? record.statusCode);
|
|
8545
|
+
if (status === 408)
|
|
8546
|
+
return "timeout";
|
|
8547
|
+
if (status === 429)
|
|
8548
|
+
return "rate_limit";
|
|
8549
|
+
if (status >= 500 && status < 600)
|
|
8550
|
+
return "server";
|
|
8551
|
+
const code = typeof record.code === "string" ? record.code.toUpperCase() : "";
|
|
8552
|
+
if (/TIMEOUT/.test(code) || code === "ETIMEDOUT")
|
|
8553
|
+
return "timeout";
|
|
8554
|
+
if (TRANSIENT_PROVIDER_CODES.has(code))
|
|
8555
|
+
return "network";
|
|
8556
|
+
current = record.cause;
|
|
8557
|
+
}
|
|
8558
|
+
const message = messages.join(" ");
|
|
8559
|
+
if (/rate\s*limit|too many requests/i.test(message))
|
|
8560
|
+
return "rate_limit";
|
|
8561
|
+
if (/timed?\s*out|timeout/i.test(message))
|
|
8562
|
+
return "timeout";
|
|
8563
|
+
if (/overload|service unavailable|bad gateway|gateway timeout/i.test(message))
|
|
8564
|
+
return "server";
|
|
8565
|
+
if (/connection|socket|fetch failed|network/i.test(message))
|
|
8566
|
+
return "network";
|
|
8567
|
+
return "unknown";
|
|
8568
|
+
}
|
|
8569
|
+
function providerRetryDelayMs(error2, attempt, random = Math.random, policy = { baseDelayMs: PROVIDER_BACKOFF_BASE_MS, maxDelayMs: PROVIDER_BACKOFF_CAP_MS }) {
|
|
8570
|
+
const retryAfter = providerRetryAfterMs(error2);
|
|
8571
|
+
const base = Math.min(policy.maxDelayMs, policy.baseDelayMs * 2 ** Math.min(10, Math.max(0, attempt)));
|
|
8572
|
+
const jitter = 0.75 + 0.5 * Math.min(1, Math.max(0, random()));
|
|
8573
|
+
const backoff = Math.min(policy.maxDelayMs, Math.round(base * jitter));
|
|
8574
|
+
return retryAfter !== undefined ? Math.max(backoff, Math.min(PROVIDER_RETRY_AFTER_CAP_MS, Math.round(retryAfter))) : backoff;
|
|
8575
|
+
}
|
|
8576
|
+
function providerRetryAfterMs(error2) {
|
|
8577
|
+
let current = error2;
|
|
8578
|
+
const visited = new Set;
|
|
8579
|
+
for (let depth = 0;depth < 5 && current !== undefined && current !== null && !visited.has(current); depth += 1) {
|
|
8580
|
+
visited.add(current);
|
|
8581
|
+
const record = errorRecord(current);
|
|
8582
|
+
if (!record)
|
|
8583
|
+
break;
|
|
8584
|
+
const explicit = record.retryAfterMs;
|
|
8585
|
+
if (typeof explicit === "number" && Number.isFinite(explicit) && explicit >= 0)
|
|
8586
|
+
return explicit;
|
|
8587
|
+
const headers = record.headers;
|
|
8588
|
+
const raw = typeof headers?.get === "function" ? headers.get("retry-after") : headers?.["retry-after"];
|
|
8589
|
+
if (typeof raw === "string" && raw.trim() !== "") {
|
|
8590
|
+
const text = raw.trim();
|
|
8591
|
+
if (/^\d+(?:\.\d+)?$/.test(text))
|
|
8592
|
+
return Number(text) * 1000;
|
|
8593
|
+
const at = Date.parse(text);
|
|
8594
|
+
if (Number.isFinite(at))
|
|
8595
|
+
return Math.max(0, at - Date.now());
|
|
8596
|
+
}
|
|
8597
|
+
current = record.cause;
|
|
8598
|
+
}
|
|
8599
|
+
return;
|
|
8600
|
+
}
|
|
8601
|
+
function providerRetryDelay(delayMs, signal) {
|
|
8602
|
+
if (signal?.aborted)
|
|
8603
|
+
return Promise.resolve(false);
|
|
8604
|
+
return new Promise((resolve) => {
|
|
8605
|
+
const abort = () => finish(false);
|
|
8606
|
+
const finish = (elapsed) => {
|
|
8607
|
+
clearTimeout(timer);
|
|
8608
|
+
signal?.removeEventListener("abort", abort);
|
|
8609
|
+
resolve(elapsed);
|
|
8610
|
+
};
|
|
8611
|
+
const timer = setTimeout(() => finish(true), delayMs);
|
|
8612
|
+
signal?.addEventListener("abort", abort, { once: true });
|
|
8613
|
+
});
|
|
8614
|
+
}
|
|
8615
|
+
var emptyUsage = { inputTokens: 0, outputTokens: 0, totalTokens: 0, cachedInputTokens: 0, cacheWriteTokens: 0, reasoningTokens: 0 };
|
|
8616
|
+
function addUsage(total, next) {
|
|
8617
|
+
const values2 = Object.values(next);
|
|
8618
|
+
if (values2.some((value) => !Number.isSafeInteger(value) || value < 0))
|
|
8619
|
+
throw new Error("Model returned invalid usage accounting");
|
|
8620
|
+
return {
|
|
8621
|
+
inputTokens: total.inputTokens + next.inputTokens,
|
|
8622
|
+
outputTokens: total.outputTokens + next.outputTokens,
|
|
8623
|
+
totalTokens: total.totalTokens + next.totalTokens,
|
|
8624
|
+
cachedInputTokens: total.cachedInputTokens + next.cachedInputTokens,
|
|
8625
|
+
cacheWriteTokens: total.cacheWriteTokens + next.cacheWriteTokens,
|
|
8626
|
+
reasoningTokens: total.reasoningTokens + next.reasoningTokens
|
|
8627
|
+
};
|
|
8628
|
+
}
|
|
8629
|
+
function validateRequest(request) {
|
|
8630
|
+
if (!request.taskId.trim() || !request.runId.trim() || !request.stepId.trim())
|
|
8631
|
+
throw new Error("Task, run, and step identity are required");
|
|
8632
|
+
if (!request.objective.trim() || !request.systemPrompt.trim())
|
|
8633
|
+
throw new Error("Objective and systemPrompt are required");
|
|
8634
|
+
const bounded = [
|
|
8635
|
+
[request.maxIterations, 1, 100, "maxIterations"],
|
|
8636
|
+
[request.maxToolCalls, 0, 500, "maxToolCalls"],
|
|
8637
|
+
[request.maxToolCallsPerTurn, 1, 16, "maxToolCallsPerTurn"],
|
|
8638
|
+
[request.maxToolResultChars, 128, 1e6, "maxToolResultChars"],
|
|
8639
|
+
[request.maxTotalToolResultChars, 128, 4000000, "maxTotalToolResultChars"],
|
|
8640
|
+
[request.maxOutputTokens, 256, 128000, "maxOutputTokens"]
|
|
8641
|
+
];
|
|
8642
|
+
for (const [value, minimum, maximum, name] of bounded) {
|
|
8643
|
+
if (!Number.isInteger(value) || value < minimum || value > maximum)
|
|
8644
|
+
throw new Error(`${name} must be between ${minimum} and ${maximum}`);
|
|
8645
|
+
}
|
|
8646
|
+
if (!Number.isSafeInteger(request.modelReservationRwf) || request.modelReservationRwf < 0)
|
|
8647
|
+
throw new Error("modelReservationRwf must be a non-negative integer");
|
|
8648
|
+
validateHistory(request.history ?? []);
|
|
8649
|
+
}
|
|
8650
|
+
function validateHistory(history) {
|
|
8651
|
+
const pending = new Map;
|
|
8652
|
+
const seen = new Set;
|
|
8653
|
+
for (const message of history) {
|
|
8654
|
+
if (message.role === "system")
|
|
8655
|
+
throw new Error("Runtime history must not contain system messages");
|
|
8656
|
+
if (message.role === "tool") {
|
|
8657
|
+
const expectedName = pending.get(message.toolCallId);
|
|
8658
|
+
if (!expectedName)
|
|
8659
|
+
throw new Error(`Runtime history contains orphaned tool result ${message.toolCallId}`);
|
|
8660
|
+
if (expectedName !== message.name)
|
|
8661
|
+
throw new Error(`Runtime history tool result ${message.toolCallId} does not match ${expectedName}`);
|
|
8662
|
+
pending.delete(message.toolCallId);
|
|
8663
|
+
continue;
|
|
8664
|
+
}
|
|
8665
|
+
if (pending.size > 0)
|
|
8666
|
+
throw new Error("Runtime history contains unresolved tool calls before the next message");
|
|
8667
|
+
if (message.role === "assistant" && "toolCalls" in message) {
|
|
8668
|
+
for (const call of message.toolCalls) {
|
|
8669
|
+
if (!call.id.trim() || seen.has(call.id))
|
|
8670
|
+
throw new Error(`Runtime history contains missing or duplicate tool-call id ${call.id}`);
|
|
8671
|
+
seen.add(call.id);
|
|
8672
|
+
pending.set(call.id, call.name);
|
|
8673
|
+
}
|
|
8674
|
+
}
|
|
8675
|
+
}
|
|
8676
|
+
if (pending.size > 0)
|
|
8677
|
+
throw new Error("Runtime history ends with unresolved tool calls");
|
|
8678
|
+
}
|
|
8679
|
+
function normalizeArguments(value) {
|
|
8680
|
+
return typeof value === "object" && value !== null && !Array.isArray(value) ? value : undefined;
|
|
8681
|
+
}
|
|
8682
|
+
function truncate(value, maximum) {
|
|
8683
|
+
if (maximum <= 0)
|
|
8684
|
+
return "";
|
|
8685
|
+
if (maximum <= 32)
|
|
8686
|
+
return value.slice(0, maximum);
|
|
8687
|
+
return value.length <= maximum ? value : `${value.slice(0, Math.max(0, maximum - 32))}
|
|
8688
|
+
...[tool result truncated]`;
|
|
8689
|
+
}
|
|
8690
|
+
var MAX_IN_TURN_COMPACTIONS = 8;
|
|
8691
|
+
var COMPACTION_MIN_CHARS = 400;
|
|
8692
|
+
function compactedToolResult(toolName, chars, artifactPath, images = []) {
|
|
8693
|
+
if (images.length > 0) {
|
|
8694
|
+
const note = `[elided: ${images.length} image${images.length === 1 ? "" : "s"} (${images.map((image) => image.path).join(", ")}) from earlier ${toolName} output, to keep the conversation within its context budget; view ${images.length === 1 ? "it" : "them"} again if you need to]`;
|
|
8695
|
+
return chars > 0 ? `${compactedToolResult(toolName, chars, artifactPath)}
|
|
8696
|
+
${note}` : note;
|
|
8697
|
+
}
|
|
8698
|
+
return artifactPath ? `[elided: ${chars} chars of earlier ${toolName} output, to keep the conversation within its context budget; see artifact ${artifactPath} (read it with read_file if you need it again)]` : `[elided: ${chars} chars of earlier ${toolName} output, to keep the conversation within its context budget; run the tool again if you need it]`;
|
|
8699
|
+
}
|
|
8700
|
+
var EVICTION_MIN_BUDGET = 400;
|
|
8701
|
+
var ELISION_MARKER_BUDGET = 96;
|
|
8702
|
+
var EXCERPT_SHARE = 0.1;
|
|
8703
|
+
var EXCERPT_FLOOR = 1200;
|
|
8704
|
+
var DEDUPE_MIN_CHARS = 2000;
|
|
8705
|
+
function takeWithinBudget(lines, budget, fromEnd) {
|
|
8706
|
+
const taken = [];
|
|
8707
|
+
let used = 0;
|
|
8708
|
+
for (let step = 0;step < lines.length; step += 1) {
|
|
8709
|
+
const line = lines[fromEnd ? lines.length - 1 - step : step];
|
|
8710
|
+
const cost = line.length + 1;
|
|
8711
|
+
if (used + cost > budget)
|
|
8712
|
+
break;
|
|
8713
|
+
used += cost;
|
|
8714
|
+
taken.push(line);
|
|
8715
|
+
}
|
|
8716
|
+
return fromEnd ? taken.reverse() : taken;
|
|
8717
|
+
}
|
|
8718
|
+
function evictedToolResult(content, artifact, budget) {
|
|
8719
|
+
const header = `[Output too large for the transcript: ${artifact.lines} lines, ${artifact.bytes} bytes.` + ` The whole thing is saved at ${artifact.path} — read any window of it with read_file(path, offset, limit),` + ` or search it with run_command. The beginning and end are below.]`;
|
|
8720
|
+
if (budget < EVICTION_MIN_BUDGET || header.length + ELISION_MARKER_BUDGET + 64 > budget)
|
|
8721
|
+
return truncate(content, budget);
|
|
8722
|
+
const lines = content.split(`
|
|
8723
|
+
`);
|
|
8724
|
+
const bodyBudget = budget - header.length - 2 - ELISION_MARKER_BUDGET;
|
|
8725
|
+
const headBudget = Math.floor(bodyBudget * 0.6);
|
|
8726
|
+
const head = takeWithinBudget(lines, headBudget, false);
|
|
8727
|
+
const tail = takeWithinBudget(lines.slice(head.length), bodyBudget - headBudget, true);
|
|
8728
|
+
const elided = lines.length - head.length - tail.length;
|
|
8729
|
+
const marker = `...[${elided} line${elided === 1 ? "" : "s"} elided — full output at ${artifact.path}]...`;
|
|
8730
|
+
const assembled = [header, "", ...head, marker, ...tail].join(`
|
|
8731
|
+
`);
|
|
8732
|
+
return assembled.length <= budget ? assembled : assembled.slice(0, budget);
|
|
8733
|
+
}
|
|
8734
|
+
|
|
8735
|
+
class BoundedAgentRuntime {
|
|
8736
|
+
dependencies;
|
|
8737
|
+
toolsByName;
|
|
8738
|
+
constructor(dependencies) {
|
|
8739
|
+
this.dependencies = dependencies;
|
|
8740
|
+
this.toolsByName = new Map;
|
|
8741
|
+
for (const tool of dependencies.tools) {
|
|
8742
|
+
if (this.toolsByName.has(tool.name))
|
|
8743
|
+
throw new Error(`Duplicate tool name: ${tool.name}`);
|
|
8744
|
+
if (tool.effect === "external" && !tool.requiresApproval)
|
|
8745
|
+
throw new Error(`External tool ${tool.name} must require approval`);
|
|
8746
|
+
if (tool.effect !== "none" && tool.parallelSafe)
|
|
8747
|
+
throw new Error(`Effectful tool ${tool.name} cannot be marked parallel-safe`);
|
|
8748
|
+
this.toolsByName.set(tool.name, tool);
|
|
8749
|
+
}
|
|
8750
|
+
}
|
|
8751
|
+
async execute(request) {
|
|
8752
|
+
validateRequest(request);
|
|
8753
|
+
const capabilities = new Set(request.allowedCapabilityIds);
|
|
8754
|
+
const tools = [...this.toolsByName.values()].filter((tool) => capabilities.has(tool.capabilityId));
|
|
8755
|
+
const definitions = tools.map(({ name, description, inputSchema }) => ({ name, description, inputSchema }));
|
|
8756
|
+
const messages = [
|
|
8757
|
+
{ role: "system", content: request.systemPrompt },
|
|
8758
|
+
...request.history ?? [],
|
|
8759
|
+
{ role: "user", content: request.objective, ...request.images?.length ? { images: request.images } : {} }
|
|
8760
|
+
];
|
|
8761
|
+
let usage = { ...emptyUsage };
|
|
8762
|
+
let actualModelRwf = 0;
|
|
8763
|
+
let toolCallsExecuted = 0;
|
|
8764
|
+
let totalToolResultChars = 0;
|
|
8765
|
+
const sentResults = new Map;
|
|
8766
|
+
const failedCalls = new Map;
|
|
8767
|
+
let missingPathStreak = 0;
|
|
8768
|
+
let lastOutcomes = [];
|
|
8769
|
+
let consecutiveFailures = 0;
|
|
8770
|
+
let greenSinceEdit = false;
|
|
8771
|
+
let unresolvedFailure = false;
|
|
8772
|
+
const runToolResults = [];
|
|
8773
|
+
let inTurnCompactions = 0;
|
|
8774
|
+
let workspaceNeedsVerification = false;
|
|
8775
|
+
let verificationNudges = 0;
|
|
8776
|
+
let unavailableToolRecoveries = 0;
|
|
8777
|
+
let toolTurnRecoveries = 0;
|
|
8778
|
+
let lengthContinuations = 0;
|
|
8779
|
+
let strongestEvidence = 0;
|
|
8780
|
+
let askedForTestEvidence = false;
|
|
8781
|
+
const routingReceipts = [];
|
|
8782
|
+
let promptTotals = addPart(newPartTotals(), JSON.stringify(definitions));
|
|
8783
|
+
let measured = 0;
|
|
8784
|
+
const compactOlderToolResults = async (currentIteration, incoming = 0) => {
|
|
8785
|
+
if (inTurnCompactions >= MAX_IN_TURN_COMPACTIONS)
|
|
8786
|
+
return false;
|
|
8787
|
+
const target = Math.min(Math.floor(request.maxTotalToolResultChars / 2), request.maxTotalToolResultChars - incoming);
|
|
8788
|
+
let changed = false;
|
|
8789
|
+
for (const entry of runToolResults) {
|
|
8790
|
+
if (totalToolResultChars <= target)
|
|
8791
|
+
break;
|
|
8792
|
+
if (entry.compacted || entry.iteration >= currentIteration || entry.chars < COMPACTION_MIN_CHARS)
|
|
8793
|
+
continue;
|
|
8794
|
+
const message = messages[entry.index];
|
|
8795
|
+
if (message?.role !== "tool" || message.toolCallId !== entry.toolCallId)
|
|
8796
|
+
continue;
|
|
8797
|
+
const images = message.images ?? [];
|
|
8798
|
+
const stubText = message.content.length >= COMPACTION_MIN_CHARS;
|
|
8799
|
+
let path2 = entry.artifactPath;
|
|
8800
|
+
if (stubText && !path2 && this.dependencies.artifacts) {
|
|
8801
|
+
path2 = (await this.dependencies.artifacts.put({ toolName: entry.name, toolCallId: entry.toolCallId, content: message.content }).catch(() => {
|
|
8802
|
+
return;
|
|
8803
|
+
}))?.path;
|
|
8804
|
+
}
|
|
8805
|
+
const stub = images.length > 0 ? `${stubText ? compactedToolResult(entry.name, message.content.length, path2) : message.content}
|
|
8806
|
+
${compactedToolResult(entry.name, 0, undefined, images)}` : compactedToolResult(entry.name, message.content.length, path2);
|
|
8807
|
+
if (images.length === 0 && stub.length >= message.content.length)
|
|
8808
|
+
continue;
|
|
8809
|
+
const { images: _dropped, ...withoutImages } = message;
|
|
8810
|
+
messages[entry.index] = { ...withoutImages, content: stub };
|
|
8811
|
+
totalToolResultChars -= entry.chars - stub.length;
|
|
8812
|
+
entry.chars = stub.length;
|
|
8813
|
+
entry.images = 0;
|
|
8814
|
+
entry.compacted = true;
|
|
8815
|
+
changed = true;
|
|
8816
|
+
if (entry.digest) {
|
|
8817
|
+
const sent = sentResults.get(entry.digest);
|
|
8818
|
+
if (sent && !sent.path) {
|
|
8819
|
+
if (path2)
|
|
8820
|
+
sentResults.set(entry.digest, { ...sent, path: path2 });
|
|
8821
|
+
else
|
|
8822
|
+
sentResults.delete(entry.digest);
|
|
8823
|
+
}
|
|
8824
|
+
}
|
|
8825
|
+
}
|
|
8826
|
+
if (changed) {
|
|
8827
|
+
inTurnCompactions += 1;
|
|
8828
|
+
promptTotals = addPart(newPartTotals(), JSON.stringify(definitions));
|
|
8829
|
+
measured = 0;
|
|
8830
|
+
}
|
|
8831
|
+
return changed;
|
|
8832
|
+
};
|
|
8833
|
+
const stop = async (status, summary, iterations) => {
|
|
8834
|
+
await this.dependencies.control.persistEvent({ type: "runtime_stop", status, summary });
|
|
8835
|
+
return {
|
|
8836
|
+
status,
|
|
8837
|
+
summary,
|
|
8838
|
+
messages,
|
|
8839
|
+
usage,
|
|
8840
|
+
actualModelRwf,
|
|
8841
|
+
iterations,
|
|
8842
|
+
toolCallsExecuted,
|
|
8843
|
+
...routingReceipts.length > 0 ? { routingReceipts: [...routingReceipts] } : {}
|
|
8844
|
+
};
|
|
8845
|
+
};
|
|
8846
|
+
for (let iteration = 1;iteration <= request.maxIterations; iteration += 1) {
|
|
8847
|
+
await this.dependencies.control.heartbeat();
|
|
8848
|
+
if (request.signal?.aborted || await this.dependencies.control.isCancellationRequested())
|
|
8849
|
+
return stop("cancelled", "Run cancelled at a safe checkpoint.", iteration - 1);
|
|
8850
|
+
const approvedRemaining = request.modelReservationRwf - actualModelRwf;
|
|
8851
|
+
for (;measured < messages.length; measured += 1) {
|
|
8852
|
+
for (const part of agentMessagePromptParts(messages[measured]))
|
|
8853
|
+
addPart(promptTotals, part);
|
|
8854
|
+
}
|
|
8855
|
+
const maximumOutputTokens = affordableOutputTokensFor(tokenEstimateFrom(promptTotals), request.maxOutputTokens, Math.max(0, approvedRemaining), this.dependencies.prices);
|
|
8856
|
+
if (maximumOutputTokens < 1)
|
|
8857
|
+
return stop("iteration_limit", "Run reached its approved model budget before another provider call.", iteration - 1);
|
|
8858
|
+
const chosen = this.dependencies.effortPolicy?.({
|
|
8859
|
+
iteration,
|
|
8860
|
+
objective: request.objective,
|
|
8861
|
+
lastResults: lastOutcomes,
|
|
8862
|
+
consecutiveFailures,
|
|
8863
|
+
greenSinceEdit,
|
|
8864
|
+
unresolvedFailure
|
|
8865
|
+
});
|
|
8866
|
+
const effort = chosen ? chosen.effort : request.effort;
|
|
8867
|
+
const modelRequest = {
|
|
8868
|
+
requestId: `cli_${randomUUID()}`,
|
|
8869
|
+
...effort ? { effort } : {},
|
|
8870
|
+
messages: [...messages],
|
|
8871
|
+
tools: definitions,
|
|
8872
|
+
maxOutputTokens: maximumOutputTokens,
|
|
8873
|
+
safetyIdentifier: request.safetyIdentifier,
|
|
8874
|
+
signal: request.signal,
|
|
8875
|
+
onTextDelta: (text) => void this.dependencies.control.persistEvent({ type: "assistant_delta", iteration, text })
|
|
8876
|
+
};
|
|
8877
|
+
let turn;
|
|
8878
|
+
let waitedMs = 0;
|
|
8879
|
+
for (let attempt = 0;; attempt += 1) {
|
|
8880
|
+
let emittedOutput = false;
|
|
8881
|
+
const attemptRequest = {
|
|
8882
|
+
...modelRequest,
|
|
8883
|
+
onTextDelta: modelRequest.onTextDelta ? (text) => {
|
|
8884
|
+
emittedOutput = true;
|
|
8885
|
+
modelRequest.onTextDelta(text);
|
|
8886
|
+
} : undefined,
|
|
8887
|
+
onOutputProgress: (kind) => {
|
|
8888
|
+
emittedOutput = true;
|
|
8889
|
+
modelRequest.onOutputProgress?.(kind);
|
|
8890
|
+
}
|
|
8891
|
+
};
|
|
8892
|
+
try {
|
|
8893
|
+
turn = await this.dependencies.model.complete(attemptRequest);
|
|
8894
|
+
break;
|
|
8895
|
+
} catch (error2) {
|
|
8896
|
+
if (request.signal?.aborted || await this.dependencies.control.isCancellationRequested()) {
|
|
8897
|
+
return stop("cancelled", "Run cancelled while waiting for the model provider.", iteration - 1);
|
|
8898
|
+
}
|
|
8899
|
+
if (emittedOutput)
|
|
8900
|
+
throw new ProviderRequestError(error2, { attempts: attempt + 1, retrySuppressed: "output_started" });
|
|
8901
|
+
if (!isRetryableProviderError(error2))
|
|
8902
|
+
throw error2;
|
|
8903
|
+
const reason = providerFailureKind(error2);
|
|
8904
|
+
const policy = RETRY_POLICIES[reason];
|
|
8905
|
+
if (attempt + 1 >= policy.maxAttempts) {
|
|
8906
|
+
throw new ProviderRequestError(error2, { attempts: attempt + 1, kind: reason, waitedMs });
|
|
8907
|
+
}
|
|
8908
|
+
const delayMs = providerRetryDelayMs(error2, attempt, this.dependencies.retry?.random, policy);
|
|
8909
|
+
waitedMs += delayMs;
|
|
8910
|
+
await this.dependencies.control.persistEvent({
|
|
8911
|
+
type: "provider_retry",
|
|
8912
|
+
iteration,
|
|
8913
|
+
nextAttempt: attempt + 2,
|
|
8914
|
+
maxAttempts: policy.maxAttempts,
|
|
8915
|
+
delayMs,
|
|
8916
|
+
reason
|
|
8917
|
+
});
|
|
8918
|
+
if (!await (this.dependencies.retry?.sleep ?? providerRetryDelay)(delayMs, request.signal)) {
|
|
8919
|
+
return stop("cancelled", "Run cancelled while waiting to retry the model provider.", iteration - 1);
|
|
8920
|
+
}
|
|
8921
|
+
if (request.signal?.aborted || await this.dependencies.control.isCancellationRequested()) {
|
|
8922
|
+
return stop("cancelled", "Run cancelled while waiting to retry the model provider.", iteration - 1);
|
|
8923
|
+
}
|
|
8924
|
+
}
|
|
8925
|
+
}
|
|
8926
|
+
if (!turn)
|
|
8927
|
+
throw new Error("Model provider retry loop ended without a response");
|
|
8928
|
+
if (turn.routingReceipt)
|
|
8929
|
+
routingReceipts.push({ ...turn.routingReceipt, taskId: turn.routingReceipt.taskId ?? modelRequest.requestId });
|
|
8930
|
+
usage = addUsage(usage, turn.usage);
|
|
8931
|
+
actualModelRwf = priceActualModelUsage(usage.inputTokens, usage.outputTokens, this.dependencies.prices);
|
|
8932
|
+
if (actualModelRwf > request.modelReservationRwf)
|
|
8933
|
+
throw new Error("Actual model usage exceeds the reserved model budget");
|
|
8934
|
+
await this.dependencies.control.persistEvent({ type: "model_turn", requestId: modelRequest.requestId, iteration, responseId: turn.responseId, model: turn.model, toolCallCount: turn.toolCalls.length, usage: turn.usage, ...turn.allowance ? { allowance: turn.allowance } : {}, ...effort ? { effort } : {}, ...chosen ? { effortReason: chosen.reason } : {} });
|
|
8935
|
+
if (turn.finishReason === "refusal")
|
|
8936
|
+
return stop("blocked", turn.refusal?.trim() || "Model refused the task.", iteration);
|
|
8937
|
+
if (turn.finishReason === "length") {
|
|
8938
|
+
const partial = turn.content.trim();
|
|
8939
|
+
if (lengthContinuations >= MAX_LENGTH_CONTINUATIONS) {
|
|
8940
|
+
return stop("iteration_limit", `Model kept exceeding its output limit: ${MAX_LENGTH_CONTINUATIONS} continuations were not enough to finish the answer.`, iteration);
|
|
8941
|
+
}
|
|
8942
|
+
lengthContinuations += 1;
|
|
8943
|
+
messages.push({ role: "assistant", content: partial || "(no output before the limit was reached)" });
|
|
8944
|
+
messages.push({ role: "user", content: LENGTH_CONTINUATION_NUDGE });
|
|
8945
|
+
continue;
|
|
8946
|
+
}
|
|
8947
|
+
if (turn.finishReason === "stop") {
|
|
8948
|
+
const summary = turn.content.trim() || "Model completed without a summary.";
|
|
8949
|
+
messages.push({ role: "assistant", content: summary });
|
|
8950
|
+
if (workspaceNeedsVerification && verificationNudges < MAX_VERIFICATION_NUDGES) {
|
|
8951
|
+
verificationNudges += 1;
|
|
8952
|
+
messages.push({ role: "user", content: VERIFICATION_NUDGE, internal: true });
|
|
8953
|
+
continue;
|
|
8954
|
+
}
|
|
8955
|
+
if (strongestEvidence === EVIDENCE_RANK.check && !askedForTestEvidence) {
|
|
8956
|
+
askedForTestEvidence = true;
|
|
8957
|
+
messages.push({ role: "user", content: TEST_EVIDENCE_NUDGE, internal: true });
|
|
8958
|
+
continue;
|
|
8959
|
+
}
|
|
8960
|
+
return workspaceNeedsVerification ? stop("needs_verification", `Workspace changes were made without passing verification evidence. The agent reported: ${summary}`, iteration) : stop("completed", summary, iteration);
|
|
8961
|
+
}
|
|
8962
|
+
const recoverToolTurn = (reason, instruction) => {
|
|
8963
|
+
if (toolTurnRecoveries >= MAX_TOOL_TURN_RECOVERIES)
|
|
8964
|
+
return false;
|
|
8965
|
+
toolTurnRecoveries += 1;
|
|
8966
|
+
messages.push({ role: "user", content: `${reason} ${instruction}`, internal: true });
|
|
8967
|
+
return true;
|
|
8968
|
+
};
|
|
8969
|
+
if (turn.finishReason !== "tool_calls" || turn.toolCalls.length === 0) {
|
|
8970
|
+
if (recoverToolTurn("Your previous response declared tool use but contained no usable tool calls.", "Try again with a valid tool call, or answer normally if no tool is needed."))
|
|
8971
|
+
continue;
|
|
8972
|
+
return stop("failed", "Model repeatedly returned an invalid tool-call turn.", iteration);
|
|
8973
|
+
}
|
|
8974
|
+
if (turn.toolCalls.length > request.maxToolCallsPerTurn) {
|
|
8975
|
+
if (recoverToolTurn(`Your previous response requested ${turn.toolCalls.length} tools, above the per-turn limit of ${request.maxToolCallsPerTurn}; none were executed.`, `Retry with at most ${request.maxToolCallsPerTurn} calls, prioritizing the calls needed to make progress.`))
|
|
8976
|
+
continue;
|
|
8977
|
+
return stop("failed", `Model repeatedly exceeded the per-turn tool-call limit of ${request.maxToolCallsPerTurn}.`, iteration);
|
|
8978
|
+
}
|
|
8979
|
+
if (toolCallsExecuted + turn.toolCalls.length > request.maxToolCalls)
|
|
8980
|
+
return stop("iteration_limit", "Run reached its tool-call budget.", iteration);
|
|
8981
|
+
const seenCallIds = new Set;
|
|
8982
|
+
const malformed = turn.toolCalls.find((call) => {
|
|
8983
|
+
if (!call.id.trim() || seenCallIds.has(call.id))
|
|
8984
|
+
return true;
|
|
8985
|
+
seenCallIds.add(call.id);
|
|
8986
|
+
return !normalizeArguments(call.arguments);
|
|
8987
|
+
});
|
|
8988
|
+
if (malformed) {
|
|
8989
|
+
if (recoverToolTurn(`Your previous tool-call response was malformed (the ${JSON.stringify(malformed.name).slice(0, 80)} call); no tools were executed.`, 'Retry with a unique non-empty id for every call and a JSON object for every arguments value, for example {"path": "src/a.ts"}: double quotes, no trailing commas, no code fences.'))
|
|
8990
|
+
continue;
|
|
8991
|
+
return stop("failed", "Model repeatedly returned malformed tool calls.", iteration);
|
|
8992
|
+
}
|
|
8993
|
+
const unavailable = turn.toolCalls.find((call) => {
|
|
8994
|
+
const tool = this.toolsByName.get(call.name);
|
|
8995
|
+
return !tool || !capabilities.has(tool.capabilityId);
|
|
8996
|
+
});
|
|
8997
|
+
if (unavailable) {
|
|
8998
|
+
if (unavailableToolRecoveries >= MAX_UNAVAILABLE_TOOL_RECOVERIES) {
|
|
8999
|
+
return stop("failed", `Tool ${unavailable.name} is outside the run capability scope.`, iteration);
|
|
9000
|
+
}
|
|
9001
|
+
unavailableToolRecoveries += 1;
|
|
9002
|
+
messages.push({ role: "assistant", content: turn.content, toolCalls: turn.toolCalls });
|
|
9003
|
+
for (const call of turn.toolCalls) {
|
|
9004
|
+
messages.push({
|
|
9005
|
+
role: "tool",
|
|
9006
|
+
toolCallId: call.id,
|
|
9007
|
+
name: call.name,
|
|
9008
|
+
internal: true,
|
|
9009
|
+
content: call.id === unavailable.id ? `Tool ${call.name} is unavailable in the current mode. Continue with the listed tools, or answer without it.` : "This batch was not executed because another call was unavailable. Retry any still-needed available call separately."
|
|
9010
|
+
});
|
|
9011
|
+
}
|
|
9012
|
+
continue;
|
|
9013
|
+
}
|
|
9014
|
+
const prepared = [];
|
|
9015
|
+
for (const call of turn.toolCalls) {
|
|
9016
|
+
const tool = this.toolsByName.get(call.name);
|
|
9017
|
+
const argumentsValue = normalizeArguments(call.arguments);
|
|
9018
|
+
if (tool.requiresApproval) {
|
|
9019
|
+
const approval = await this.dependencies.control.isToolCallApproved(call, tool);
|
|
9020
|
+
if (approval !== true && approval !== "approved") {
|
|
9021
|
+
return approval === "denied" ? stop("blocked", `Tool ${call.name} was rejected by the user.`, iteration) : stop("needs_approval", `Tool ${call.name} requires approval before execution.`, iteration);
|
|
9022
|
+
}
|
|
9023
|
+
}
|
|
9024
|
+
prepared.push({ call, tool, argumentsValue });
|
|
9025
|
+
}
|
|
9026
|
+
messages.push({ role: "assistant", content: turn.content, toolCalls: turn.toolCalls });
|
|
9027
|
+
const runOne = async ({ call, tool, argumentsValue }) => {
|
|
9028
|
+
if (request.signal?.aborted || await this.dependencies.control.isCancellationRequested())
|
|
9029
|
+
return { call, tool, result: { content: "Tool execution cancelled before start.", isError: true } };
|
|
9030
|
+
await this.dependencies.control.persistEvent({ type: "tool_call", toolCallId: call.id, toolName: call.name, effect: tool.effect, arguments: argumentsValue });
|
|
9031
|
+
try {
|
|
9032
|
+
return { call, tool, result: await tool.execute(argumentsValue, request) };
|
|
9033
|
+
} catch (error2) {
|
|
9034
|
+
return { call, tool, result: { content: error2 instanceof Error ? error2.message : "Tool execution failed", isError: true } };
|
|
9035
|
+
}
|
|
9036
|
+
};
|
|
9037
|
+
const groups = [];
|
|
9038
|
+
for (const item of prepared) {
|
|
9039
|
+
const concurrent = item.tool.parallelSafe && item.tool.effect === "none";
|
|
9040
|
+
const last = groups.at(-1);
|
|
9041
|
+
const lastIsConcurrent = last !== undefined && last[0].tool.parallelSafe && last[0].tool.effect === "none";
|
|
9042
|
+
if (concurrent && lastIsConcurrent)
|
|
9043
|
+
last.push(item);
|
|
9044
|
+
else
|
|
9045
|
+
groups.push([item]);
|
|
9046
|
+
}
|
|
9047
|
+
const results = [];
|
|
9048
|
+
for (const group of groups) {
|
|
9049
|
+
if (group.length === 1)
|
|
9050
|
+
results.push(await runOne(group[0]));
|
|
9051
|
+
else
|
|
9052
|
+
results.push(...await Promise.all(group.map(runOne)));
|
|
9053
|
+
}
|
|
9054
|
+
const iterationCharBudget = Math.max(request.maxToolResultChars, Math.floor(request.maxTotalToolResultChars / 4));
|
|
9055
|
+
let iterationChars = 0;
|
|
9056
|
+
const incoming = Math.min(iterationCharBudget, results.reduce((sum, { result }) => sum + Math.min((result.content || " ").length, request.maxToolResultChars) + (result.images?.length ?? 0) * IMAGE_CHAR_ESTIMATE, 0));
|
|
9057
|
+
if (totalToolResultChars + incoming > request.maxTotalToolResultChars)
|
|
9058
|
+
await compactOlderToolResults(iteration, incoming);
|
|
9059
|
+
lastOutcomes = [];
|
|
9060
|
+
for (const { call, tool, result } of results) {
|
|
9061
|
+
toolCallsExecuted += 1;
|
|
9062
|
+
const remaining = request.maxTotalToolResultChars - totalToolResultChars;
|
|
9063
|
+
const budget = Math.max(0, Math.min(request.maxToolResultChars, remaining, iterationCharBudget - iterationChars));
|
|
9064
|
+
const raw = result.content || "(empty tool result)";
|
|
9065
|
+
let artifact;
|
|
9066
|
+
let content = truncate(raw, budget);
|
|
9067
|
+
const withinTwiceBudget = raw.length <= budget * 2 && raw.length <= remaining;
|
|
9068
|
+
const images = result.images?.length ? result.images : undefined;
|
|
9069
|
+
const digest = !images && raw.length >= DEDUPE_MIN_CHARS ? createHash("sha256").update(raw).digest("hex") : undefined;
|
|
9070
|
+
const alreadySent = digest ? sentResults.get(digest) : undefined;
|
|
9071
|
+
if (alreadySent) {
|
|
9072
|
+
content = `[Identical to the earlier ${alreadySent.toolName} result in this conversation${alreadySent.path ? `, saved at ${alreadySent.path}` : ""}. Unchanged since then; re-read it there if you need it again.]`;
|
|
9073
|
+
} else if (withinTwiceBudget) {
|
|
9074
|
+
content = raw;
|
|
9075
|
+
} else if (this.dependencies.artifacts && raw.length > budget && budget > 0) {
|
|
9076
|
+
const stored = await this.dependencies.artifacts.put({ toolName: call.name, toolCallId: call.id, content: raw }).catch(() => {
|
|
9077
|
+
return;
|
|
9078
|
+
});
|
|
9079
|
+
if (stored) {
|
|
9080
|
+
artifact = stored;
|
|
9081
|
+
content = evictedToolResult(raw, stored, Math.min(budget, Math.max(EXCERPT_FLOOR, Math.round(budget * EXCERPT_SHARE))));
|
|
9082
|
+
}
|
|
9083
|
+
}
|
|
9084
|
+
if (digest && !alreadySent)
|
|
9085
|
+
sentResults.set(digest, { toolName: call.name, path: artifact?.path });
|
|
9086
|
+
const imageChars = (images?.length ?? 0) * IMAGE_CHAR_ESTIMATE;
|
|
9087
|
+
totalToolResultChars += content.length + imageChars;
|
|
9088
|
+
iterationChars += content.length + imageChars;
|
|
9089
|
+
runToolResults.push({ index: messages.length, iteration, toolCallId: call.id, name: call.name, chars: content.length + imageChars, compacted: false, images: images?.length ?? 0, ...artifact ? { artifactPath: artifact.path } : {}, ...digest ? { digest } : {} });
|
|
9090
|
+
if (result.isError) {
|
|
9091
|
+
const signature = `${call.name}:${JSON.stringify(call.arguments ?? {})}`;
|
|
9092
|
+
const failures = (failedCalls.get(signature) ?? 0) + 1;
|
|
9093
|
+
failedCalls.set(signature, failures);
|
|
9094
|
+
missingPathStreak = /does not exist|No such file|not found/i.test(raw) ? missingPathStreak + 1 : 0;
|
|
9095
|
+
const hint = repeatedFailureHint(call.name, failures, missingPathStreak);
|
|
9096
|
+
if (hint)
|
|
9097
|
+
content = `${content}
|
|
9098
|
+
|
|
9099
|
+
${hint}`;
|
|
9100
|
+
} else {
|
|
9101
|
+
missingPathStreak = 0;
|
|
9102
|
+
}
|
|
9103
|
+
messages.push({ role: "tool", content, toolCallId: call.id, name: call.name, ...images ? { images } : {} });
|
|
9104
|
+
const effect = tool.effect === "external" ? "external" : result.effect ?? tool.effect;
|
|
9105
|
+
if (!result.isError && effect === "workspace") {
|
|
9106
|
+
workspaceNeedsVerification = true;
|
|
9107
|
+
greenSinceEdit = false;
|
|
9108
|
+
}
|
|
9109
|
+
lastOutcomes.push({
|
|
9110
|
+
tool: call.name,
|
|
9111
|
+
isError: result.isError ?? false,
|
|
9112
|
+
...result.isError ? { shallow: isShallowToolError(raw) } : {},
|
|
9113
|
+
...!result.isError && result.verification?.passed && result.verification.kind ? { verified: result.verification.kind } : {}
|
|
9114
|
+
});
|
|
9115
|
+
if (!result.isError && result.verification?.passed && result.verification.kind !== "check")
|
|
9116
|
+
greenSinceEdit = true;
|
|
9117
|
+
if (!result.isError && result.verification?.passed) {
|
|
9118
|
+
workspaceNeedsVerification = false;
|
|
9119
|
+
strongestEvidence = Math.max(strongestEvidence, EVIDENCE_RANK[result.verification.kind ?? "check"]);
|
|
9120
|
+
}
|
|
9121
|
+
await this.dependencies.control.persistEvent({ type: "tool_result", toolCallId: call.id, toolName: call.name, isError: result.isError ?? false, effect, content, ...result.data ? { data: result.data } : {}, ...artifact ? { artifact } : {} });
|
|
9122
|
+
}
|
|
9123
|
+
const failedInSubstance = lastOutcomes.some((outcome) => outcome.isError && !outcome.shallow);
|
|
9124
|
+
consecutiveFailures = failedInSubstance ? consecutiveFailures + 1 : 0;
|
|
9125
|
+
if (failedInSubstance)
|
|
9126
|
+
unresolvedFailure = true;
|
|
9127
|
+
else if (lastOutcomes.some((outcome) => outcome.verified && outcome.verified !== "check"))
|
|
9128
|
+
unresolvedFailure = false;
|
|
9129
|
+
if (totalToolResultChars >= request.maxTotalToolResultChars)
|
|
9130
|
+
await compactOlderToolResults(iteration);
|
|
9131
|
+
await this.dependencies.control.checkpointMessages?.(messages);
|
|
9132
|
+
if (totalToolResultChars >= request.maxTotalToolResultChars)
|
|
9133
|
+
return stop("iteration_limit", "Run reached its total tool-result context budget.", iteration);
|
|
9134
|
+
}
|
|
9135
|
+
return stop("iteration_limit", "Run reached its model iteration budget.", request.maxIterations);
|
|
9136
|
+
}
|
|
9137
|
+
}
|
|
9138
|
+
|
|
9139
|
+
// ../core/src/providers/routing-receipt.ts
|
|
8350
9140
|
var TASK_KINDS = [
|
|
8351
9141
|
"coding",
|
|
8352
9142
|
"design",
|
|
@@ -8504,7 +9294,7 @@ function mergeRoutingReceipts(...batches) {
|
|
|
8504
9294
|
return receipts;
|
|
8505
9295
|
}
|
|
8506
9296
|
|
|
8507
|
-
//
|
|
9297
|
+
// ../core/src/providers/openai-compatible.ts
|
|
8508
9298
|
function usageOf(response) {
|
|
8509
9299
|
if (!response.usage)
|
|
8510
9300
|
throw new Error("Model response did not include usage accounting");
|
|
@@ -8708,7 +9498,7 @@ async function collectChatStream(stream, onTextDelta, onOutputProgress) {
|
|
|
8708
9498
|
};
|
|
8709
9499
|
}
|
|
8710
9500
|
|
|
8711
|
-
//
|
|
9501
|
+
// ../core/src/providers/model-capabilities.ts
|
|
8712
9502
|
var CONSERVATIVE_CAPABILITIES = { contextWindow: 200000, maxOutputTokens: 16000, supportsEffort: false };
|
|
8713
9503
|
function exactCapabilities(models, contextWindow, maxOutputTokens, supportsEffort = false) {
|
|
8714
9504
|
return models.map((prefix) => ({ prefix, match: "exact", capabilities: { contextWindow, maxOutputTokens, supportsEffort } }));
|
|
@@ -8765,7 +9555,7 @@ function capabilitiesFor(modelId) {
|
|
|
8765
9555
|
var DEFAULT_OUTPUT_CEILING = 64000;
|
|
8766
9556
|
var PROTOCOL_MAX_OUTPUT_TOKENS = 128000;
|
|
8767
9557
|
|
|
8768
|
-
//
|
|
9558
|
+
// ../core/src/providers/stream-deadline.ts
|
|
8769
9559
|
var DEFAULT_FIRST_BYTE_TIMEOUT_MS = 300000;
|
|
8770
9560
|
var DEFAULT_IDLE_TIMEOUT_MS = 90000;
|
|
8771
9561
|
var DEFAULT_TOTAL_TIMEOUT_MS = 30 * 60000;
|
|
@@ -8901,7 +9691,7 @@ function createStreamDeadline(options = {}) {
|
|
|
8901
9691
|
};
|
|
8902
9692
|
}
|
|
8903
9693
|
|
|
8904
|
-
//
|
|
9694
|
+
// ../core/src/providers/openai-agent.ts
|
|
8905
9695
|
function usesInklingToolContract(model) {
|
|
8906
9696
|
return model === "thinkingmachines/inkling:free" || model === "thinkingmachines/inkling-small:free";
|
|
8907
9697
|
}
|
|
@@ -8938,7 +9728,7 @@ class OpenAIAgentTurnProvider {
|
|
|
8938
9728
|
...inkling ? { max_tokens: request.maxOutputTokens } : { max_completion_tokens: request.maxOutputTokens },
|
|
8939
9729
|
safety_identifier: request.safetyIdentifier,
|
|
8940
9730
|
prompt_cache_key: request.safetyIdentifier,
|
|
8941
|
-
...request.effort && this.capabilities.supportsEffort ? { reasoning_effort: request.effort } : {},
|
|
9731
|
+
...request.effort && this.capabilities.supportsEffort ? { reasoning_effort: providerEffort(request.effort) } : {},
|
|
8942
9732
|
stream: true,
|
|
8943
9733
|
stream_options: { include_usage: true }
|
|
8944
9734
|
};
|
|
@@ -8956,7 +9746,7 @@ class OpenAIAgentTurnProvider {
|
|
|
8956
9746
|
}
|
|
8957
9747
|
}
|
|
8958
9748
|
|
|
8959
|
-
//
|
|
9749
|
+
// ../core/src/wander.ts
|
|
8960
9750
|
var WANDER_MARKER = "[Wander]";
|
|
8961
9751
|
var WANDER_OBJECTIVE_MAX = 500;
|
|
8962
9752
|
var WANDER_LAB_FILES = {
|
|
@@ -9068,4 +9858,4 @@ function wanderGradeCounts(results) {
|
|
|
9068
9858
|
return WANDER_GRADES.map((grade) => ({ grade, count: results.claims.filter((claim) => claim.grade === grade).length }));
|
|
9069
9859
|
}
|
|
9070
9860
|
|
|
9071
|
-
export { approximateInputTokens,
|
|
9861
|
+
export { approximateInputTokens, affordableOutputTokens, priceActualModelUsage, modelPricesFromEnvironment, TASK_KINDS, buildTaskProfile, mergeRoutingReceipts, predictEffort, reasoningFromEnvironment, agentMessagePromptParts, providerEffort, providerRetryAfterMs, BoundedAgentRuntime, capabilitiesFor, DEFAULT_OUTPUT_CEILING, PROTOCOL_MAX_OUTPUT_TOKENS, DEFAULT_TOTAL_TIMEOUT_MS, StreamTimeoutError, streamTimeoutsFor, createStreamDeadline, APIConnectionError, makeParseableTextFormat, OpenAI, toWireMessages, withOpenRouterCacheControl, turnFromChatResponse, collectChatStream, OpenAIAgentTurnProvider, WANDER_MARKER, WANDER_LAB_FILES, isWanderObjective, isWanderRandomScheduleObjective, pickWanderTopic, buildWanderObjective, wanderPlannerInstructions, WANDER_GRADES, parseWanderResults, wanderGradeCounts };
|