@ponythewhite/base-context 1.0.7 → 1.0.9
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 +24 -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-5JRM6P4T.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-VSIYFWYI.js → chunk-KT2BNEPE.js} +21 -8
- package/dist/bundle/{chunk-VCW3YDFF.js → chunk-NEHLB7JV.js} +1548 -574
- 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-VVI3UKGR.js} +12 -9
- package/dist/bundle/{cli-main-MMHTK7EB.js → cli-main-YUDBEYE2.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-ZLGGAAGU.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 +9 -1
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +225 -29
- 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 +1 -1
- package/dist/core/inference-coordinator.d.ts.map +1 -1
- package/dist/core/inference-coordinator.js +110 -15
- 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 +13 -3
- package/dist/core/request-view-selection.d.ts.map +1 -1
- package/dist/core/request-view-selection.js +239 -101
- 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/session-manager.d.ts +2 -0
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +38 -13
- package/dist/core/session-manager.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
|
@@ -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-NEHLB7JV.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-NEHLB7JV.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-ZLGGAAGU.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-VVI3UKGR.js";
|
|
21
|
+
import "./chunk-NEHLB7JV.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) {
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
convertResponsesMessages,
|
|
11
11
|
convertResponsesTools,
|
|
12
12
|
processResponsesStream
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-KT2BNEPE.js";
|
|
14
14
|
import "./chunk-NQB5DCFC.js";
|
|
15
15
|
import {
|
|
16
16
|
OpenAI
|
|
@@ -30,9 +30,10 @@ import {
|
|
|
30
30
|
ProviderAttemptTracker,
|
|
31
31
|
clampThinkingLevel,
|
|
32
32
|
formatStreamFailureMessage,
|
|
33
|
+
openAIVisibleInput,
|
|
33
34
|
recordStreamFailure,
|
|
34
35
|
streamFailureFromStopReason
|
|
35
|
-
} from "./chunk-
|
|
36
|
+
} from "./chunk-D3KOF57W.js";
|
|
36
37
|
import "./chunk-BAWSWWEU.js";
|
|
37
38
|
|
|
38
39
|
// ../ai/src/providers/openai-responses.ts
|
|
@@ -81,6 +82,7 @@ var streamOpenAIResponses = (model, context, options) => {
|
|
|
81
82
|
const cacheRetention = resolveCacheRetention(options?.cacheRetention);
|
|
82
83
|
const cacheSessionId = cacheRetention === "none" ? void 0 : options?.sessionId;
|
|
83
84
|
let client = createClient(model, context, apiKey, options?.headers, cacheSessionId);
|
|
85
|
+
const preparationClient = client;
|
|
84
86
|
if (attempts.enabled) {
|
|
85
87
|
client = client.withOptions({});
|
|
86
88
|
client.fetchWithTimeout = attempts.wrapHttp(client.fetchWithTimeout.bind(client));
|
|
@@ -104,7 +106,7 @@ var streamOpenAIResponses = (model, context, options) => {
|
|
|
104
106
|
params = nextParams;
|
|
105
107
|
}
|
|
106
108
|
attempts.configure({ effort: params.reasoning?.effort ?? void 0, serviceTier: params.service_tier });
|
|
107
|
-
if (attempts.hasRequestBudget) {
|
|
109
|
+
if (attempts.hasRequestBudget || options?.attempts?.prepareRequest) {
|
|
108
110
|
let pendingPublicBody;
|
|
109
111
|
const body = JSON.stringify(params);
|
|
110
112
|
const serialized = JSON.parse(body);
|
|
@@ -119,7 +121,47 @@ var streamOpenAIResponses = (model, context, options) => {
|
|
|
119
121
|
}
|
|
120
122
|
);
|
|
121
123
|
}
|
|
122
|
-
const
|
|
124
|
+
const canCount = model.provider === "openai" && requestUrl === "https://api.openai.com/v1/responses" && serialized.model === model.id && !serialized.previous_response_id && !serialized.conversation && openAIVisibleInput(model.api, model.provider, JSON.parse(body)) !== void 0;
|
|
125
|
+
const countInput = canCount ? async (request) => {
|
|
126
|
+
const candidate = JSON.parse(request.body);
|
|
127
|
+
if (request.api !== model.api || request.provider !== model.provider || request.url !== requestUrl || request.retainedPrefix || candidate.model !== model.id || candidate.previous_response_id || candidate.conversation || !openAIVisibleInput(model.api, model.provider, candidate))
|
|
128
|
+
throw new Error("Input count requires the supported prepared stateless OpenAI request");
|
|
129
|
+
const countBody = Object.fromEntries(
|
|
130
|
+
[
|
|
131
|
+
"model",
|
|
132
|
+
"input",
|
|
133
|
+
"instructions",
|
|
134
|
+
"tools",
|
|
135
|
+
"text",
|
|
136
|
+
"tool_choice",
|
|
137
|
+
"parallel_tool_calls",
|
|
138
|
+
"personality",
|
|
139
|
+
"reasoning",
|
|
140
|
+
"truncation"
|
|
141
|
+
].filter((key) => candidate[key] !== void 0).map((key) => [key, candidate[key]])
|
|
142
|
+
);
|
|
143
|
+
const countClient = preparationClient.withOptions({ maxRetries: 0 });
|
|
144
|
+
countClient.fetchWithTimeout = attempts.wrapHttp(
|
|
145
|
+
countClient.fetchWithTimeout.bind(countClient),
|
|
146
|
+
"input-count"
|
|
147
|
+
);
|
|
148
|
+
try {
|
|
149
|
+
const result = await countClient.responses.inputTokens.count(countBody, {
|
|
150
|
+
signal: options?.signal,
|
|
151
|
+
...options?.timeoutMs !== void 0 ? { timeout: options.timeoutMs } : {},
|
|
152
|
+
maxRetries: 0
|
|
153
|
+
});
|
|
154
|
+
if (!Number.isSafeInteger(result.input_tokens) || result.input_tokens < 0)
|
|
155
|
+
throw new Error("Invalid provider input token count");
|
|
156
|
+
await attempts.settle("completed");
|
|
157
|
+
options?.signal?.throwIfAborted();
|
|
158
|
+
return result.input_tokens;
|
|
159
|
+
} catch (error) {
|
|
160
|
+
await attempts.settle(options?.signal?.aborted ? "cancelled" : "failed");
|
|
161
|
+
throw error;
|
|
162
|
+
}
|
|
163
|
+
} : void 0;
|
|
164
|
+
const selected = await attempts.prepareRequest({ url: requestUrl, body }, requestProjection, countInput);
|
|
123
165
|
if (options?.attempts?.pendingPublicMessageGroups?.length && (pendingPublicBody === void 0 || selected !== pendingPublicBody))
|
|
124
166
|
throw new Error("Pending original tool groups were not accepted as public");
|
|
125
167
|
params = JSON.parse(selected);
|
|
@@ -218,7 +260,8 @@ function createClient(model, context, apiKey, optionsHeaders, sessionId) {
|
|
|
218
260
|
function buildParams(model, context, requestUrl, options, onProjection) {
|
|
219
261
|
const messages = convertResponsesMessages(model, context, OPENAI_TOOL_CALL_PROVIDERS, {
|
|
220
262
|
onProjection,
|
|
221
|
-
pendingPublicMessageGroups: options?.attempts?.pendingPublicMessageGroups
|
|
263
|
+
pendingPublicMessageGroups: options?.attempts?.pendingPublicMessageGroups,
|
|
264
|
+
responsesMessageIds: options?.attempts?.responsesMessageIds
|
|
222
265
|
});
|
|
223
266
|
const cacheRetention = resolveCacheRetention(options?.cacheRetention);
|
|
224
267
|
const compat = getCompat(model, requestUrl);
|
|
@@ -380,6 +380,8 @@ export declare class AgentSession {
|
|
|
380
380
|
readonly requests: InferenceCoordinator;
|
|
381
381
|
readonly runtimeServices: SessionRuntimeServices;
|
|
382
382
|
private readonly _contextCompiler;
|
|
383
|
+
private _failedAutomaticCompaction?;
|
|
384
|
+
private _failedThresholdCompaction?;
|
|
383
385
|
private readonly _contextEpochsEnabled;
|
|
384
386
|
private readonly _initialContextMode;
|
|
385
387
|
private _contextMode;
|
|
@@ -527,6 +529,8 @@ export declare class AgentSession {
|
|
|
527
529
|
private _modelRegistry;
|
|
528
530
|
private _toolRegistry;
|
|
529
531
|
private _nativeRecoveryTools;
|
|
532
|
+
private _nativeRecoveryCursors;
|
|
533
|
+
private _nativeRecoveryCursorSource?;
|
|
530
534
|
private _nativeRecoveryProducer;
|
|
531
535
|
private _toolDefinitions;
|
|
532
536
|
private _toolPromptSnippets;
|
|
@@ -535,6 +539,7 @@ export declare class AgentSession {
|
|
|
535
539
|
private _baseSystemPromptOptions;
|
|
536
540
|
private _assistantTurnsSinceAutoRefine;
|
|
537
541
|
private _lastAutoRefineReviewAt;
|
|
542
|
+
private _lastAutoRefineEvidence?;
|
|
538
543
|
private _autoRefineInProgress;
|
|
539
544
|
private _autoRefineAdmissionClosed;
|
|
540
545
|
private readonly _autoRefineOperations;
|
|
@@ -683,6 +688,8 @@ export declare class AgentSession {
|
|
|
683
688
|
private _runBackgroundPlan;
|
|
684
689
|
private _runSerializedRefine;
|
|
685
690
|
private _getLatestCompactionTimestamp;
|
|
691
|
+
private _thresholdCompactionConfiguration;
|
|
692
|
+
private _hasFailedThresholdCompaction;
|
|
686
693
|
private _thresholdCompactionNeeded;
|
|
687
694
|
private _captureThresholdAutonomousOwner;
|
|
688
695
|
private _snapshotAutonomousRuntimeState;
|
|
@@ -1082,8 +1089,9 @@ export declare class AgentSession {
|
|
|
1082
1089
|
private _maybeAutoRefine;
|
|
1083
1090
|
private _runApprovedRefine;
|
|
1084
1091
|
private _resolveRefinementModel;
|
|
1092
|
+
private _autoRefineEvidence;
|
|
1085
1093
|
private _reviewAutoRefine;
|
|
1086
|
-
/**
|
|
1094
|
+
/** Merge existing session/global memory with the selected project's workspace memory. */
|
|
1087
1095
|
private _loadMergedHarnessState;
|
|
1088
1096
|
private _loadRefinementHistory;
|
|
1089
1097
|
/**
|