@ponythewhite/base-context 1.0.7 → 1.0.8
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/CHANGELOG.md +19 -0
- package/dist/base-context-runtime/pyproject.toml +1 -1
- package/dist/base-context-runtime/src/rlm/__init__.py +3 -0
- package/dist/base-context-runtime/src/rlm/harness.py +86 -48
- package/dist/base-context-runtime/test/test_harness.py +215 -140
- package/dist/base-context-runtime/uv.lock +1 -1
- package/dist/build-info.json +1 -1
- package/dist/bundle/amazon-bedrock.js +3 -3
- package/dist/bundle/{anthropic-UV5GZDGU.js → anthropic-5PSCZEER.js} +2 -7
- package/dist/bundle/{azure-openai-responses-WSNPXLYC.js → azure-openai-responses-AYTLJR33.js} +2 -2
- package/dist/bundle/{bundled-modules-PS66L3IT.js → bundled-modules-IGMJH2MU.js} +5 -5
- package/dist/bundle/{chunk-UPVDERMD.js → chunk-2IPDSTDR.js} +11 -9
- package/dist/bundle/chunk-D3KOF57W.js +22040 -0
- package/dist/bundle/{chunk-VCW3YDFF.js → chunk-EXEFSSF4.js} +1475 -562
- package/dist/bundle/{chunk-VSIYFWYI.js → chunk-KT2BNEPE.js} +21 -8
- package/dist/bundle/{chunk-KTNETTHI.js → chunk-Q3MBSBEB.js} +3 -101
- package/dist/bundle/{chunk-LFPWHI42.js → chunk-QKIFBA7N.js} +2 -2
- package/dist/bundle/{chunk-PFROC4EV.js → chunk-RVJVXZCS.js} +12 -9
- package/dist/bundle/{cli-main-MMHTK7EB.js → cli-main-BUK7QTHO.js} +4 -4
- package/dist/bundle/cli.js +1 -1
- package/dist/bundle/{google-T32FMD4G.js → google-HTMCUJ7X.js} +2 -2
- package/dist/bundle/{google-vertex-56KP6I3B.js → google-vertex-ZQO65AXF.js} +2 -2
- package/dist/bundle/{main-XAIVH4Y7.js → main-2FWHT2WZ.js} +5 -5
- package/dist/bundle/{mistral-WGBMYIVU.js → mistral-SB7LU56G.js} +1 -1
- package/dist/bundle/{openai-codex-responses-PIV2RQ3G.js → openai-codex-responses-5CEW4VN3.js} +53 -27
- package/dist/bundle/{openai-completions-64C3JPR4.js → openai-completions-BAZJQSS2.js} +1 -1
- package/dist/bundle/{openai-responses-UI7RSTDV.js → openai-responses-VHOE427P.js} +48 -5
- package/dist/core/agent-session.d.ts +6 -1
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +177 -24
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/canonical-context.d.ts +8 -0
- package/dist/core/canonical-context.d.ts.map +1 -1
- package/dist/core/canonical-context.js +37 -5
- package/dist/core/canonical-context.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts +2 -2
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +31 -13
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/context-epoch.d.ts +1 -1
- package/dist/core/context-epoch.d.ts.map +1 -1
- package/dist/core/context-epoch.js +2 -1
- package/dist/core/context-epoch.js.map +1 -1
- package/dist/core/extensions/types.d.ts +2 -2
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/history-index-worker.d.ts.map +1 -1
- package/dist/core/history-index-worker.js +29 -8
- package/dist/core/history-index-worker.js.map +1 -1
- package/dist/core/history-index.d.ts +11 -1
- package/dist/core/history-index.d.ts.map +1 -1
- package/dist/core/history-index.js +2 -1
- package/dist/core/history-index.js.map +1 -1
- package/dist/core/inference-coordinator.d.ts.map +1 -1
- package/dist/core/inference-coordinator.js +108 -13
- package/dist/core/inference-coordinator.js.map +1 -1
- package/dist/core/kernel/bootstrap.d.ts.map +1 -1
- package/dist/core/kernel/bootstrap.js +97 -107
- package/dist/core/kernel/bootstrap.js.map +1 -1
- package/dist/core/kernel/repl-manager.d.ts.map +1 -1
- package/dist/core/kernel/repl-manager.js +11 -0
- package/dist/core/kernel/repl-manager.js.map +1 -1
- package/dist/core/kernel/shared.d.ts +2 -0
- package/dist/core/kernel/shared.d.ts.map +1 -1
- package/dist/core/kernel/shared.js.map +1 -1
- package/dist/core/messages.d.ts.map +1 -1
- package/dist/core/messages.js +4 -1
- package/dist/core/messages.js.map +1 -1
- package/dist/core/prompts/rlm.d.ts.map +1 -1
- package/dist/core/prompts/rlm.js +4 -2
- package/dist/core/prompts/rlm.js.map +1 -1
- package/dist/core/public-context.d.ts.map +1 -1
- package/dist/core/public-context.js +16 -0
- package/dist/core/public-context.js.map +1 -1
- package/dist/core/refinement/refinement.d.ts +19 -5
- package/dist/core/refinement/refinement.d.ts.map +1 -1
- package/dist/core/refinement/refinement.js +90 -35
- package/dist/core/refinement/refinement.js.map +1 -1
- package/dist/core/request-view-selection.d.ts +10 -2
- package/dist/core/request-view-selection.d.ts.map +1 -1
- package/dist/core/request-view-selection.js +235 -100
- package/dist/core/request-view-selection.js.map +1 -1
- package/dist/core/retained-tool-output.d.ts +28 -0
- package/dist/core/retained-tool-output.d.ts.map +1 -0
- package/dist/core/retained-tool-output.js +102 -0
- package/dist/core/retained-tool-output.js.map +1 -0
- package/dist/core/selective-recovery.d.ts +47 -3
- package/dist/core/selective-recovery.d.ts.map +1 -1
- package/dist/core/selective-recovery.js +428 -109
- package/dist/core/selective-recovery.js.map +1 -1
- package/dist/core/session-history-index.d.ts +3 -1
- package/dist/core/session-history-index.d.ts.map +1 -1
- package/dist/core/session-history-index.js +1 -1
- package/dist/core/session-history-index.js.map +1 -1
- package/dist/core/settings-manager.d.ts +5 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +3 -0
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/system-prompt.d.ts +3 -1
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +3 -3
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/task-frame.d.ts +1 -1
- package/dist/core/task-frame.d.ts.map +1 -1
- package/dist/core/task-frame.js +21 -1
- package/dist/core/task-frame.js.map +1 -1
- package/dist/core/task-state-reader.d.ts +10 -2
- package/dist/core/task-state-reader.d.ts.map +1 -1
- package/dist/core/task-state-reader.js +75 -9
- package/dist/core/task-state-reader.js.map +1 -1
- package/dist/core/tools/ipython.d.ts +5 -0
- package/dist/core/tools/ipython.d.ts.map +1 -1
- package/dist/core/tools/ipython.js +59 -17
- package/dist/core/tools/ipython.js.map +1 -1
- package/dist/core/tools/prime-context.d.ts.map +1 -1
- package/dist/core/tools/prime-context.js +1 -1
- package/dist/core/tools/prime-context.js.map +1 -1
- package/dist/core/view-units.d.ts +4 -0
- package/dist/core/view-units.d.ts.map +1 -1
- package/dist/core/view-units.js +28 -19
- package/dist/core/view-units.js.map +1 -1
- package/dist/installer.mjs +98 -77
- package/dist/modes/interactive/components/refinement-outcome-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/refinement-outcome-message.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +5 -5
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/skills/skill-creator/SKILL.md +18 -1
- package/docs/settings.md +45 -0
- package/docs/skills.md +77 -2
- package/package.json +4 -4
- package/skills/skill-creator/SKILL.md +18 -1
- package/dist/bundle/chunk-W46VZFI6.js +0 -21681
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
calculateCost,
|
|
15
15
|
classifyStreamFailure,
|
|
16
16
|
withRequestBody
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-D3KOF57W.js";
|
|
18
18
|
|
|
19
19
|
// ../ai/src/providers/openai-responses-shared.ts
|
|
20
20
|
function encodeTextSignatureV1(id, phase) {
|
|
@@ -56,11 +56,10 @@ function matchesResponsesTextSignature(signature, item) {
|
|
|
56
56
|
const parsed = parseTextSignature(signature);
|
|
57
57
|
return parsed !== void 0 && parsed.id === item.id && parsed.phase === phase;
|
|
58
58
|
}
|
|
59
|
-
function captureResponsesProjection(model, context,
|
|
59
|
+
function captureResponsesProjection(model, context, unchangedSource, positionDependentMessageIndices, input, messageIndices, pendingPublicMessageGroups) {
|
|
60
60
|
if (!(model.provider === "openai" && model.api === "openai-responses" || model.provider === "openai-codex" && model.api === "openai-codex-responses"))
|
|
61
61
|
return;
|
|
62
|
-
if (
|
|
63
|
-
return;
|
|
62
|
+
if (!unchangedSource) return;
|
|
64
63
|
const items = context.messages.map(() => []);
|
|
65
64
|
for (const [index, sourceIndex] of messageIndices.entries()) {
|
|
66
65
|
if (sourceIndex !== null) items[sourceIndex].push(input[index]);
|
|
@@ -112,7 +111,7 @@ function captureResponsesProjection(model, context, transformed, input, messageI
|
|
|
112
111
|
const item = rendered[blockIndex];
|
|
113
112
|
if (block.type === "text") {
|
|
114
113
|
if (!matchesResponsesTextSignature(block.textSignature, item)) return;
|
|
115
|
-
if (
|
|
114
|
+
if (positionDependentMessageIndices.has(index) && !generatedMessageIndices.includes(index))
|
|
116
115
|
generatedMessageIndices.push(index);
|
|
117
116
|
} else if (block.type === "thinking") {
|
|
118
117
|
if (!block.thinkingSignature || item.type !== "reasoning") return;
|
|
@@ -240,6 +239,13 @@ function convertResponsesMessages(model, context, allowedToolCallProviders, opti
|
|
|
240
239
|
normalizeToolCallId,
|
|
241
240
|
pendingPublicMessageGroups
|
|
242
241
|
);
|
|
242
|
+
const unchangedSource = (options?.onProjection !== void 0 || options?.responsesMessageIds !== void 0) && transformedMessages.length === context.messages.length && transformedMessages.every(
|
|
243
|
+
(message, index) => JSON.stringify(message) === JSON.stringify(context.messages[index])
|
|
244
|
+
);
|
|
245
|
+
const sourceIds = options?.responsesMessageIds;
|
|
246
|
+
const assignedIds = sourceIds?.filter((id) => id !== void 0);
|
|
247
|
+
const responsesMessageIds = unchangedSource && sourceIds?.length === context.messages.length && assignedIds?.every((id) => Number.isSafeInteger(id) && id >= 0) && new Set(assignedIds).size === assignedIds.length ? sourceIds : void 0;
|
|
248
|
+
const positionDependentMessageIndices = /* @__PURE__ */ new Set();
|
|
243
249
|
const includeSystemPrompt = options?.includeSystemPrompt ?? true;
|
|
244
250
|
if (includeSystemPrompt && context.systemPrompt) {
|
|
245
251
|
const role = model.reasoning ? "developer" : "system";
|
|
@@ -282,7 +288,7 @@ function convertResponsesMessages(model, context, allowedToolCallProviders, opti
|
|
|
282
288
|
const output = [];
|
|
283
289
|
const assistantMsg = msg;
|
|
284
290
|
const isDifferentModel = assistantMsg.model !== model.id && assistantMsg.provider === model.provider && assistantMsg.api === model.api;
|
|
285
|
-
for (const block of msg.content) {
|
|
291
|
+
for (const [blockIndex, block] of msg.content.entries()) {
|
|
286
292
|
if (block.type === "thinking") {
|
|
287
293
|
if (block.thinkingSignature) {
|
|
288
294
|
const reasoningItem = JSON.parse(block.thinkingSignature);
|
|
@@ -293,7 +299,13 @@ function convertResponsesMessages(model, context, allowedToolCallProviders, opti
|
|
|
293
299
|
const parsedSignature = parseTextSignature(textBlock.textSignature);
|
|
294
300
|
let msgId = parsedSignature?.id;
|
|
295
301
|
if (!msgId) {
|
|
296
|
-
|
|
302
|
+
const sourceId = responsesMessageIds?.[sourceIndex];
|
|
303
|
+
if (sourceId !== void 0) {
|
|
304
|
+
msgId = `msg_src_${sourceId}_${blockIndex}`;
|
|
305
|
+
} else {
|
|
306
|
+
msgId = `msg_${msgIndex}_${blockIndex}`;
|
|
307
|
+
positionDependentMessageIndices.add(sourceIndex);
|
|
308
|
+
}
|
|
297
309
|
} else if (msgId.length > 64) {
|
|
298
310
|
msgId = `msg_${shortHash(msgId)}`;
|
|
299
311
|
}
|
|
@@ -365,7 +377,8 @@ function convertResponsesMessages(model, context, allowedToolCallProviders, opti
|
|
|
365
377
|
const projection = captureResponsesProjection(
|
|
366
378
|
model,
|
|
367
379
|
context,
|
|
368
|
-
|
|
380
|
+
unchangedSource,
|
|
381
|
+
positionDependentMessageIndices,
|
|
369
382
|
messages,
|
|
370
383
|
messageIndices,
|
|
371
384
|
pendingPublicMessageGroups
|
|
@@ -3,6 +3,9 @@ import {
|
|
|
3
3
|
sanitizeSurrogates,
|
|
4
4
|
transformMessages
|
|
5
5
|
} from "./chunk-4GXPNXOJ.js";
|
|
6
|
+
import {
|
|
7
|
+
require_base64_js
|
|
8
|
+
} from "./chunk-D3KOF57W.js";
|
|
6
9
|
import {
|
|
7
10
|
__commonJS,
|
|
8
11
|
__require,
|
|
@@ -3847,107 +3850,6 @@ var require_src3 = __commonJS({
|
|
|
3847
3850
|
}
|
|
3848
3851
|
});
|
|
3849
3852
|
|
|
3850
|
-
// ../../node_modules/base64-js/index.js
|
|
3851
|
-
var require_base64_js = __commonJS({
|
|
3852
|
-
"../../node_modules/base64-js/index.js"(exports) {
|
|
3853
|
-
"use strict";
|
|
3854
|
-
exports.byteLength = byteLength;
|
|
3855
|
-
exports.toByteArray = toByteArray;
|
|
3856
|
-
exports.fromByteArray = fromByteArray;
|
|
3857
|
-
var lookup = [];
|
|
3858
|
-
var revLookup = [];
|
|
3859
|
-
var Arr = typeof Uint8Array !== "undefined" ? Uint8Array : Array;
|
|
3860
|
-
var code = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
3861
|
-
for (i = 0, len = code.length; i < len; ++i) {
|
|
3862
|
-
lookup[i] = code[i];
|
|
3863
|
-
revLookup[code.charCodeAt(i)] = i;
|
|
3864
|
-
}
|
|
3865
|
-
var i;
|
|
3866
|
-
var len;
|
|
3867
|
-
revLookup["-".charCodeAt(0)] = 62;
|
|
3868
|
-
revLookup["_".charCodeAt(0)] = 63;
|
|
3869
|
-
function getLens(b64) {
|
|
3870
|
-
var len2 = b64.length;
|
|
3871
|
-
if (len2 % 4 > 0) {
|
|
3872
|
-
throw new Error("Invalid string. Length must be a multiple of 4");
|
|
3873
|
-
}
|
|
3874
|
-
var validLen = b64.indexOf("=");
|
|
3875
|
-
if (validLen === -1) validLen = len2;
|
|
3876
|
-
var placeHoldersLen = validLen === len2 ? 0 : 4 - validLen % 4;
|
|
3877
|
-
return [validLen, placeHoldersLen];
|
|
3878
|
-
}
|
|
3879
|
-
function byteLength(b64) {
|
|
3880
|
-
var lens = getLens(b64);
|
|
3881
|
-
var validLen = lens[0];
|
|
3882
|
-
var placeHoldersLen = lens[1];
|
|
3883
|
-
return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;
|
|
3884
|
-
}
|
|
3885
|
-
function _byteLength(b64, validLen, placeHoldersLen) {
|
|
3886
|
-
return (validLen + placeHoldersLen) * 3 / 4 - placeHoldersLen;
|
|
3887
|
-
}
|
|
3888
|
-
function toByteArray(b64) {
|
|
3889
|
-
var tmp;
|
|
3890
|
-
var lens = getLens(b64);
|
|
3891
|
-
var validLen = lens[0];
|
|
3892
|
-
var placeHoldersLen = lens[1];
|
|
3893
|
-
var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen));
|
|
3894
|
-
var curByte = 0;
|
|
3895
|
-
var len2 = placeHoldersLen > 0 ? validLen - 4 : validLen;
|
|
3896
|
-
var i2;
|
|
3897
|
-
for (i2 = 0; i2 < len2; i2 += 4) {
|
|
3898
|
-
tmp = revLookup[b64.charCodeAt(i2)] << 18 | revLookup[b64.charCodeAt(i2 + 1)] << 12 | revLookup[b64.charCodeAt(i2 + 2)] << 6 | revLookup[b64.charCodeAt(i2 + 3)];
|
|
3899
|
-
arr[curByte++] = tmp >> 16 & 255;
|
|
3900
|
-
arr[curByte++] = tmp >> 8 & 255;
|
|
3901
|
-
arr[curByte++] = tmp & 255;
|
|
3902
|
-
}
|
|
3903
|
-
if (placeHoldersLen === 2) {
|
|
3904
|
-
tmp = revLookup[b64.charCodeAt(i2)] << 2 | revLookup[b64.charCodeAt(i2 + 1)] >> 4;
|
|
3905
|
-
arr[curByte++] = tmp & 255;
|
|
3906
|
-
}
|
|
3907
|
-
if (placeHoldersLen === 1) {
|
|
3908
|
-
tmp = revLookup[b64.charCodeAt(i2)] << 10 | revLookup[b64.charCodeAt(i2 + 1)] << 4 | revLookup[b64.charCodeAt(i2 + 2)] >> 2;
|
|
3909
|
-
arr[curByte++] = tmp >> 8 & 255;
|
|
3910
|
-
arr[curByte++] = tmp & 255;
|
|
3911
|
-
}
|
|
3912
|
-
return arr;
|
|
3913
|
-
}
|
|
3914
|
-
function tripletToBase64(num) {
|
|
3915
|
-
return lookup[num >> 18 & 63] + lookup[num >> 12 & 63] + lookup[num >> 6 & 63] + lookup[num & 63];
|
|
3916
|
-
}
|
|
3917
|
-
function encodeChunk(uint8, start, end) {
|
|
3918
|
-
var tmp;
|
|
3919
|
-
var output = [];
|
|
3920
|
-
for (var i2 = start; i2 < end; i2 += 3) {
|
|
3921
|
-
tmp = (uint8[i2] << 16 & 16711680) + (uint8[i2 + 1] << 8 & 65280) + (uint8[i2 + 2] & 255);
|
|
3922
|
-
output.push(tripletToBase64(tmp));
|
|
3923
|
-
}
|
|
3924
|
-
return output.join("");
|
|
3925
|
-
}
|
|
3926
|
-
function fromByteArray(uint8) {
|
|
3927
|
-
var tmp;
|
|
3928
|
-
var len2 = uint8.length;
|
|
3929
|
-
var extraBytes = len2 % 3;
|
|
3930
|
-
var parts = [];
|
|
3931
|
-
var maxChunkLength = 16383;
|
|
3932
|
-
for (var i2 = 0, len22 = len2 - extraBytes; i2 < len22; i2 += maxChunkLength) {
|
|
3933
|
-
parts.push(encodeChunk(uint8, i2, i2 + maxChunkLength > len22 ? len22 : i2 + maxChunkLength));
|
|
3934
|
-
}
|
|
3935
|
-
if (extraBytes === 1) {
|
|
3936
|
-
tmp = uint8[len2 - 1];
|
|
3937
|
-
parts.push(
|
|
3938
|
-
lookup[tmp >> 2] + lookup[tmp << 4 & 63] + "=="
|
|
3939
|
-
);
|
|
3940
|
-
} else if (extraBytes === 2) {
|
|
3941
|
-
tmp = (uint8[len2 - 2] << 8) + uint8[len2 - 1];
|
|
3942
|
-
parts.push(
|
|
3943
|
-
lookup[tmp >> 10] + lookup[tmp >> 4 & 63] + lookup[tmp << 2 & 63] + "="
|
|
3944
|
-
);
|
|
3945
|
-
}
|
|
3946
|
-
return parts.join("");
|
|
3947
|
-
}
|
|
3948
|
-
}
|
|
3949
|
-
});
|
|
3950
|
-
|
|
3951
3853
|
// ../../node_modules/google-auth-library/build/src/crypto/shared.js
|
|
3952
3854
|
var require_shared = __commonJS({
|
|
3953
3855
|
"../../node_modules/google-auth-library/build/src/crypto/shared.js"(exports) {
|
|
@@ -2,11 +2,11 @@ import { createRequire as __piBundleCreateRequire } from 'node:module'; const re
|
|
|
2
2
|
import {
|
|
3
3
|
appendRotatingLog,
|
|
4
4
|
getAgentLogPath
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-2IPDSTDR.js";
|
|
6
6
|
import {
|
|
7
7
|
setLogSink,
|
|
8
8
|
stringifyLogEntry
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-D3KOF57W.js";
|
|
10
10
|
|
|
11
11
|
// dist/core/logging.js
|
|
12
12
|
var AGENT_LOG_MAX_BYTES = 20 * 1024 * 1024;
|
|
@@ -348,7 +348,7 @@ import {
|
|
|
348
348
|
watchWithErrorHandler,
|
|
349
349
|
workerRosterEntryFromSummary,
|
|
350
350
|
wrapTextWithAnsi
|
|
351
|
-
} from "./chunk-
|
|
351
|
+
} from "./chunk-EXEFSSF4.js";
|
|
352
352
|
import {
|
|
353
353
|
array,
|
|
354
354
|
boolean,
|
|
@@ -367,7 +367,7 @@ import {
|
|
|
367
367
|
import {
|
|
368
368
|
installFileLogSink,
|
|
369
369
|
setLogContext
|
|
370
|
-
} from "./chunk-
|
|
370
|
+
} from "./chunk-QKIFBA7N.js";
|
|
371
371
|
import {
|
|
372
372
|
APP_NAME,
|
|
373
373
|
APP_TITLE,
|
|
@@ -413,7 +413,7 @@ import {
|
|
|
413
413
|
shouldUseWindowsShell,
|
|
414
414
|
signalProcessGroupOrProcess,
|
|
415
415
|
typebox_exports
|
|
416
|
-
} from "./chunk-
|
|
416
|
+
} from "./chunk-2IPDSTDR.js";
|
|
417
417
|
import {
|
|
418
418
|
PRODUCT,
|
|
419
419
|
PRODUCT_ENV
|
|
@@ -435,7 +435,7 @@ import {
|
|
|
435
435
|
getProviders,
|
|
436
436
|
modelsAreEqual,
|
|
437
437
|
supportsFastMode
|
|
438
|
-
} from "./chunk-
|
|
438
|
+
} from "./chunk-D3KOF57W.js";
|
|
439
439
|
import {
|
|
440
440
|
__commonJS,
|
|
441
441
|
__export,
|
|
@@ -6370,6 +6370,9 @@ var SettingsManager = class _SettingsManager {
|
|
|
6370
6370
|
const model = this.settings.autoRefine?.model;
|
|
6371
6371
|
return model === void 0 ? void 0 : structuredClone(model);
|
|
6372
6372
|
}
|
|
6373
|
+
getLearningEnabled() {
|
|
6374
|
+
return this.settings.learning?.enabled === true;
|
|
6375
|
+
}
|
|
6373
6376
|
getAutoRefineSettings() {
|
|
6374
6377
|
const turnInterval = this.settings.autoRefine?.turnInterval;
|
|
6375
6378
|
const cooldownMs = this.settings.autoRefine?.cooldownMs;
|
|
@@ -52785,7 +52788,7 @@ ${message}`, ["Yes", "No"], opts);
|
|
|
52785
52788
|
if (this.sideQuestionBashDiscarded !== void 0) {
|
|
52786
52789
|
this.sideQuestionBashDiscarded = void 0;
|
|
52787
52790
|
this.activeBashComponent = void 0;
|
|
52788
|
-
this.ui.
|
|
52791
|
+
this.ui.flushRender();
|
|
52789
52792
|
break;
|
|
52790
52793
|
}
|
|
52791
52794
|
const component = this.activeBashComponent;
|
|
@@ -52803,7 +52806,7 @@ ${message}`, ["Yes", "No"], opts);
|
|
|
52803
52806
|
this.sideQuestionBashComponent = void 0;
|
|
52804
52807
|
this.finishSideQuestionBash(event, component.getOutput());
|
|
52805
52808
|
}
|
|
52806
|
-
this.ui.
|
|
52809
|
+
this.ui.flushRender();
|
|
52807
52810
|
break;
|
|
52808
52811
|
}
|
|
52809
52812
|
case "message_start":
|
|
@@ -52876,7 +52879,7 @@ ${message}`, ["Yes", "No"], opts);
|
|
|
52876
52879
|
this.streamingMessage = void 0;
|
|
52877
52880
|
this.footer.invalidate();
|
|
52878
52881
|
}
|
|
52879
|
-
this.ui.
|
|
52882
|
+
this.ui.flushRender();
|
|
52880
52883
|
break;
|
|
52881
52884
|
case "tool_execution_start": {
|
|
52882
52885
|
this.startedToolCalls.add(event.toolCallId);
|
|
@@ -52908,7 +52911,7 @@ ${message}`, ["Yes", "No"], opts);
|
|
|
52908
52911
|
component.updateResult({ ...event.result, isError: event.isError });
|
|
52909
52912
|
this.pendingTools.delete(event.toolCallId);
|
|
52910
52913
|
this.startedToolCalls.delete(event.toolCallId);
|
|
52911
|
-
this.ui.
|
|
52914
|
+
this.ui.flushRender();
|
|
52912
52915
|
}
|
|
52913
52916
|
break;
|
|
52914
52917
|
}
|
|
@@ -52945,8 +52948,8 @@ ${message}`, ["Yes", "No"], opts);
|
|
|
52945
52948
|
this.renderRecap();
|
|
52946
52949
|
this.applyOptimisticContextUsage();
|
|
52947
52950
|
void this.refreshConnectionContextUsage();
|
|
52951
|
+
this.ui.flushRender();
|
|
52948
52952
|
await this.checkShutdownRequested();
|
|
52949
|
-
this.ui.requestRender();
|
|
52950
52953
|
break;
|
|
52951
52954
|
case "compaction_start": {
|
|
52952
52955
|
this.startCompactionLoader(event.reason, event.customInstructions);
|
|
@@ -5,10 +5,10 @@ import {
|
|
|
5
5
|
isOwnedSessionWorkerProcess,
|
|
6
6
|
maybeRunOwnedSessionWorkerFrontend,
|
|
7
7
|
maybeStartDaemonEarly
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-EXEFSSF4.js";
|
|
9
9
|
import {
|
|
10
10
|
APP_NAME
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-2IPDSTDR.js";
|
|
12
12
|
import "./chunk-5QCJ5DQU.js";
|
|
13
13
|
import "./chunk-CRBVRZBV.js";
|
|
14
14
|
import "./chunk-GRJFXLBM.js";
|
|
@@ -16,7 +16,7 @@ import "./chunk-2T7M7VJ4.js";
|
|
|
16
16
|
import "./chunk-UIRUOAIQ.js";
|
|
17
17
|
import "./chunk-HXOBFFJX.js";
|
|
18
18
|
import "./chunk-DGNX7HQ3.js";
|
|
19
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-D3KOF57W.js";
|
|
20
20
|
import "./chunk-BAWSWWEU.js";
|
|
21
21
|
|
|
22
22
|
// dist/cli-main.js
|
|
@@ -39,7 +39,7 @@ async function runCli() {
|
|
|
39
39
|
}
|
|
40
40
|
const [{ EnvHttpProxyAgent, setGlobalDispatcher }, { main }] = await Promise.all([
|
|
41
41
|
import("undici"),
|
|
42
|
-
import("./main-
|
|
42
|
+
import("./main-2FWHT2WZ.js")
|
|
43
43
|
]);
|
|
44
44
|
setGlobalDispatcher(new EnvHttpProxyAgent({ bodyTimeout: 0, headersTimeout: 0 }));
|
|
45
45
|
try {
|
package/dist/bundle/cli.js
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
mapToolChoice,
|
|
11
11
|
observeGoogleUsage,
|
|
12
12
|
retainThoughtSignature
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-Q3MBSBEB.js";
|
|
14
14
|
import {
|
|
15
15
|
buildBaseOptions,
|
|
16
16
|
sanitizeSurrogates
|
|
@@ -26,7 +26,7 @@ import {
|
|
|
26
26
|
formatStreamFailureMessage,
|
|
27
27
|
recordStreamFailure,
|
|
28
28
|
streamFailureFromStopReason
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-D3KOF57W.js";
|
|
30
30
|
import "./chunk-BAWSWWEU.js";
|
|
31
31
|
|
|
32
32
|
// ../ai/src/providers/google.ts
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
mapToolChoice,
|
|
13
13
|
observeGoogleUsage,
|
|
14
14
|
retainThoughtSignature
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-Q3MBSBEB.js";
|
|
16
16
|
import {
|
|
17
17
|
buildBaseOptions,
|
|
18
18
|
sanitizeSurrogates
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
formatStreamFailureMessage,
|
|
26
26
|
recordStreamFailure,
|
|
27
27
|
streamFailureFromStopReason
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-D3KOF57W.js";
|
|
29
29
|
import "./chunk-BAWSWWEU.js";
|
|
30
30
|
|
|
31
31
|
// ../ai/src/providers/google-vertex.ts
|
|
@@ -17,11 +17,11 @@ import {
|
|
|
17
17
|
shouldUseDaemonClientRuntime,
|
|
18
18
|
shouldUseDaemonInteractive,
|
|
19
19
|
shouldUseEphemeralSessionManagerForDaemonInteractive
|
|
20
|
-
} from "./chunk-
|
|
21
|
-
import "./chunk-
|
|
20
|
+
} from "./chunk-RVJVXZCS.js";
|
|
21
|
+
import "./chunk-EXEFSSF4.js";
|
|
22
22
|
import "./chunk-CFNASUYO.js";
|
|
23
|
-
import "./chunk-
|
|
24
|
-
import "./chunk-
|
|
23
|
+
import "./chunk-QKIFBA7N.js";
|
|
24
|
+
import "./chunk-2IPDSTDR.js";
|
|
25
25
|
import "./chunk-5QCJ5DQU.js";
|
|
26
26
|
import "./chunk-CRBVRZBV.js";
|
|
27
27
|
import "./chunk-GRJFXLBM.js";
|
|
@@ -29,7 +29,7 @@ import "./chunk-2T7M7VJ4.js";
|
|
|
29
29
|
import "./chunk-UIRUOAIQ.js";
|
|
30
30
|
import "./chunk-HXOBFFJX.js";
|
|
31
31
|
import "./chunk-DGNX7HQ3.js";
|
|
32
|
-
import "./chunk-
|
|
32
|
+
import "./chunk-D3KOF57W.js";
|
|
33
33
|
import "./chunk-BAWSWWEU.js";
|
|
34
34
|
export {
|
|
35
35
|
createDefaultRuntimeFactory,
|
package/dist/bundle/{openai-codex-responses-PIV2RQ3G.js → openai-codex-responses-5CEW4VN3.js}
RENAMED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
convertResponsesTools,
|
|
9
9
|
observeResponsesEvent,
|
|
10
10
|
processResponsesStream
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-KT2BNEPE.js";
|
|
12
12
|
import "./chunk-NQB5DCFC.js";
|
|
13
13
|
import {
|
|
14
14
|
headersToRecord
|
|
@@ -33,9 +33,32 @@ import {
|
|
|
33
33
|
formatThrownValue,
|
|
34
34
|
isLocalRequestPreparationError,
|
|
35
35
|
recordStreamFailure
|
|
36
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-D3KOF57W.js";
|
|
37
37
|
import "./chunk-BAWSWWEU.js";
|
|
38
38
|
|
|
39
|
+
// ../ai/src/utils/abortable-delay.ts
|
|
40
|
+
function abortableDelay(ms, signal) {
|
|
41
|
+
return new Promise((resolve, reject) => {
|
|
42
|
+
if (signal?.aborted) {
|
|
43
|
+
reject(new Error("Request was aborted"));
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
const cleanup = () => {
|
|
47
|
+
clearTimeout(timeout);
|
|
48
|
+
signal?.removeEventListener("abort", onAbort);
|
|
49
|
+
};
|
|
50
|
+
const onAbort = () => {
|
|
51
|
+
cleanup();
|
|
52
|
+
reject(new Error("Request was aborted"));
|
|
53
|
+
};
|
|
54
|
+
const timeout = setTimeout(() => {
|
|
55
|
+
cleanup();
|
|
56
|
+
resolve();
|
|
57
|
+
}, ms);
|
|
58
|
+
signal?.addEventListener("abort", onAbort, { once: true });
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
|
|
39
62
|
// ../ai/src/providers/openai-codex-responses.ts
|
|
40
63
|
var _os = null;
|
|
41
64
|
var dynamicImport = (specifier) => import(specifier);
|
|
@@ -78,19 +101,6 @@ function codexTransportError(error) {
|
|
|
78
101
|
{ cause: error }
|
|
79
102
|
);
|
|
80
103
|
}
|
|
81
|
-
function sleep(ms, signal) {
|
|
82
|
-
return new Promise((resolve, reject) => {
|
|
83
|
-
if (signal?.aborted) {
|
|
84
|
-
reject(new Error("Request was aborted"));
|
|
85
|
-
return;
|
|
86
|
-
}
|
|
87
|
-
const timeout = setTimeout(resolve, ms);
|
|
88
|
-
signal?.addEventListener("abort", () => {
|
|
89
|
-
clearTimeout(timeout);
|
|
90
|
-
reject(new Error("Request was aborted"));
|
|
91
|
-
});
|
|
92
|
-
});
|
|
93
|
-
}
|
|
94
104
|
var streamOpenAICodexResponses = (model, context, options) => {
|
|
95
105
|
const stream = new AssistantMessageEventStream();
|
|
96
106
|
(async () => {
|
|
@@ -279,8 +289,10 @@ var streamOpenAICodexResponses = (model, context, options) => {
|
|
|
279
289
|
}
|
|
280
290
|
if (!(attempt < MAX_RETRIES && isRetryableError(lastError))) throw lastError;
|
|
281
291
|
await attempts.settle("failed");
|
|
282
|
-
const
|
|
283
|
-
|
|
292
|
+
const retryAfter = response?.headers.get("retry-after");
|
|
293
|
+
const retryAfterMs = retryAfter ? /^\d+(\.\d+)?$/.test(retryAfter) ? Number(retryAfter) * 1e3 : Date.parse(retryAfter) - Date.now() : NaN;
|
|
294
|
+
const delayMs = Number.isFinite(retryAfterMs) ? Math.max(0, retryAfterMs) : BASE_DELAY_MS * 2 ** attempt;
|
|
295
|
+
await abortableDelay(delayMs, options?.signal);
|
|
284
296
|
}
|
|
285
297
|
if (!response?.ok) {
|
|
286
298
|
throw lastError ?? new Error("Failed after retries");
|
|
@@ -325,7 +337,8 @@ function buildRequestBody(model, context, options, onProjection) {
|
|
|
325
337
|
const messages = convertResponsesMessages(model, context, CODEX_TOOL_CALL_PROVIDERS, {
|
|
326
338
|
includeSystemPrompt: false,
|
|
327
339
|
onProjection,
|
|
328
|
-
pendingPublicMessageGroups: options?.attempts?.pendingPublicMessageGroups
|
|
340
|
+
pendingPublicMessageGroups: options?.attempts?.pendingPublicMessageGroups,
|
|
341
|
+
responsesMessageIds: options?.attempts?.responsesMessageIds
|
|
329
342
|
});
|
|
330
343
|
const body = {
|
|
331
344
|
model: model.id,
|
|
@@ -335,7 +348,7 @@ function buildRequestBody(model, context, options, onProjection) {
|
|
|
335
348
|
input: messages,
|
|
336
349
|
text: { verbosity: options?.textVerbosity || "low" },
|
|
337
350
|
include: ["reasoning.encrypted_content"],
|
|
338
|
-
prompt_cache_key: options?.sessionId,
|
|
351
|
+
prompt_cache_key: options?.cacheRetention === "none" ? void 0 : options?.sessionId,
|
|
339
352
|
tool_choice: "auto",
|
|
340
353
|
parallel_tool_calls: true
|
|
341
354
|
};
|
|
@@ -505,6 +518,13 @@ async function* parseSSE(response) {
|
|
|
505
518
|
}
|
|
506
519
|
var OPENAI_BETA_RESPONSES_WEBSOCKETS = "responses_websockets=2026-02-06";
|
|
507
520
|
var SESSION_WEBSOCKET_CACHE_TTL_MS = 5 * 60 * 1e3;
|
|
521
|
+
var WEBSOCKET_AUTH_HEADERS = [
|
|
522
|
+
"authorization",
|
|
523
|
+
"chatgpt-account-id",
|
|
524
|
+
"openai-organization",
|
|
525
|
+
"openai-project",
|
|
526
|
+
"x-api-key"
|
|
527
|
+
];
|
|
508
528
|
var websocketSessionCache = /* @__PURE__ */ new Map();
|
|
509
529
|
var websocketDebugStats = /* @__PURE__ */ new Map();
|
|
510
530
|
var websocketSseFallbackSessions = /* @__PURE__ */ new Set();
|
|
@@ -613,7 +633,9 @@ function scheduleSessionWebSocketExpiry(sessionId, entry) {
|
|
|
613
633
|
entry.idleTimer = setTimeout(() => {
|
|
614
634
|
if (entry.busy) return;
|
|
615
635
|
closeWebSocketSilently(entry.socket, 1e3, "idle_timeout");
|
|
616
|
-
websocketSessionCache.
|
|
636
|
+
if (websocketSessionCache.get(sessionId) === entry) {
|
|
637
|
+
websocketSessionCache.delete(sessionId);
|
|
638
|
+
}
|
|
617
639
|
}, SESSION_WEBSOCKET_CACHE_TTL_MS);
|
|
618
640
|
}
|
|
619
641
|
async function connectWebSocket(url, headers, signal, timeoutMs = 3e4) {
|
|
@@ -705,16 +727,19 @@ async function acquireWebSocket(url, headers, sessionId, signal, timeoutMs) {
|
|
|
705
727
|
clearTimeout(cached.idleTimer);
|
|
706
728
|
cached.idleTimer = void 0;
|
|
707
729
|
}
|
|
708
|
-
|
|
730
|
+
const matchesConnection = cached.url === url && WEBSOCKET_AUTH_HEADERS.every((name) => cached.headers.get(name) === headers.get(name));
|
|
731
|
+
if (!cached.busy && matchesConnection && isWebSocketReusable(cached.socket)) {
|
|
709
732
|
cached.busy = true;
|
|
710
733
|
return {
|
|
711
734
|
socket: cached.socket,
|
|
712
735
|
entry: cached,
|
|
713
736
|
reused: true,
|
|
714
737
|
release: ({ keep } = {}) => {
|
|
715
|
-
if (!keep || !isWebSocketReusable(cached.socket)) {
|
|
738
|
+
if (!keep || !isWebSocketReusable(cached.socket) || websocketSessionCache.get(sessionId) !== cached) {
|
|
716
739
|
closeWebSocketSilently(cached.socket);
|
|
717
|
-
websocketSessionCache.
|
|
740
|
+
if (websocketSessionCache.get(sessionId) === cached) {
|
|
741
|
+
websocketSessionCache.delete(sessionId);
|
|
742
|
+
}
|
|
718
743
|
return;
|
|
719
744
|
}
|
|
720
745
|
cached.busy = false;
|
|
@@ -732,20 +757,21 @@ async function acquireWebSocket(url, headers, sessionId, signal, timeoutMs) {
|
|
|
732
757
|
}
|
|
733
758
|
};
|
|
734
759
|
}
|
|
735
|
-
|
|
736
|
-
|
|
760
|
+
cached.continuation = void 0;
|
|
761
|
+
closeWebSocketSilently(cached.socket);
|
|
762
|
+
if (websocketSessionCache.get(sessionId) === cached) {
|
|
737
763
|
websocketSessionCache.delete(sessionId);
|
|
738
764
|
}
|
|
739
765
|
}
|
|
740
766
|
const socket = await connectWebSocket(url, headers, signal, timeoutMs);
|
|
741
|
-
const entry = { socket, url, busy: true };
|
|
767
|
+
const entry = { socket, url, headers: new Headers(headers), busy: true };
|
|
742
768
|
websocketSessionCache.set(sessionId, entry);
|
|
743
769
|
return {
|
|
744
770
|
socket,
|
|
745
771
|
entry,
|
|
746
772
|
reused: false,
|
|
747
773
|
release: ({ keep } = {}) => {
|
|
748
|
-
if (!keep || !isWebSocketReusable(entry.socket)) {
|
|
774
|
+
if (!keep || !isWebSocketReusable(entry.socket) || websocketSessionCache.get(sessionId) !== entry) {
|
|
749
775
|
closeWebSocketSilently(entry.socket);
|
|
750
776
|
if (entry.idleTimer) clearTimeout(entry.idleTimer);
|
|
751
777
|
if (websocketSessionCache.get(sessionId) === entry) {
|