@karlorz/codexhost-cli-win32-arm64 0.13.3-6 → 0.13.3-7
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/README.md +1 -1
- package/app/codexhost-distribution.json +1 -1
- package/app/console-server.mjs +484 -91
- package/app/console-web.js +553 -37
- package/app/cpa-live-voice-hook.js +550 -33
- package/app/desktop-controller.mjs +25 -1
- package/app/host-runtime.mjs +985 -478
- package/app/plugins/antigravity/plugin.mjs +25 -1
- package/app/plugins/claude-code/plugin.mjs +32 -5
- package/app/plugins/codebuddy/plugin.mjs +32 -5
- package/app/plugins/codex-usage/plugin.mjs +131 -67
- package/app/plugins/cursor-cli/plugin.mjs +20737 -44915
- package/app/plugins/deepseek-harness/plugin.mjs +32 -5
- package/app/plugins/grok/plugin.mjs +802 -155
- package/app/plugins/hermes/plugin.mjs +32 -5
- package/app/plugins/kimi-code/plugin.mjs +25 -1
- package/app/plugins/kiro-cli/plugin.mjs +25 -1
- package/app/plugins/omp/plugin.mjs +2288 -2072
- package/app/plugins/opencode/plugin.mjs +32 -5
- package/app/plugins/pi/plugin.mjs +2373 -2264
- package/app/plugins/qoder/plugin.mjs +32 -5
- package/app/plugins/qoder-cn/plugin.mjs +32 -5
- package/app/plugins/workbuddy/plugin.mjs +32 -5
- package/app/plugins/zcode/plugin.mjs +32 -5
- package/app/renderer-extension.js +1973 -1085
- package/bin/codexhost.exe +0 -0
- package/libexec/codexhost-node-repl.exe +0 -0
- package/libexec/codexhost-shim.exe +0 -0
- package/libexec/codexhost-updater.exe +0 -0
- package/package.json +1 -1
|
@@ -15240,6 +15240,8 @@ var CONSOLE_HOST_METHODS = Object.freeze([
|
|
|
15240
15240
|
"codexhost/harness/installation",
|
|
15241
15241
|
"codexhost/harness/launch-settings/get",
|
|
15242
15242
|
"codexhost/harness/launch-settings/set",
|
|
15243
|
+
"codexhost/harness/grok-computer-use/get",
|
|
15244
|
+
"codexhost/harness/grok-computer-use/set",
|
|
15243
15245
|
"codexhost/harness/web-ui/open",
|
|
15244
15246
|
"codexhost/harness/accounts/sources",
|
|
15245
15247
|
"codexhost/harness/accounts/list",
|
|
@@ -15768,7 +15770,9 @@ var harnessInspectionSchema = external_exports.union([
|
|
|
15768
15770
|
var harnessInspectParamsSchema = external_exports.object({
|
|
15769
15771
|
harnessId: harnessIdSchema,
|
|
15770
15772
|
cwd: nonBlankTextSchema2.max(16384).optional(),
|
|
15771
|
-
refresh: external_exports.boolean().optional()
|
|
15773
|
+
refresh: external_exports.boolean().optional(),
|
|
15774
|
+
/** `availability` asks only whether the Harness can run; see `InspectHarnessInput.purpose`. */
|
|
15775
|
+
purpose: external_exports.literal("availability").optional()
|
|
15772
15776
|
}).strict();
|
|
15773
15777
|
var harnessWebUiOpenParamsSchema = external_exports.object({
|
|
15774
15778
|
harnessId: harnessIdSchema
|
|
@@ -15942,6 +15946,26 @@ var harnessLaunchSettingsSchema = external_exports.object({
|
|
|
15942
15946
|
restartRequired: external_exports.boolean()
|
|
15943
15947
|
}).strict();
|
|
15944
15948
|
|
|
15949
|
+
// ../../shared-contracts/dist/grok-computer-use.js
|
|
15950
|
+
var grokComputerUseGetSchema = external_exports.object({}).strict();
|
|
15951
|
+
var grokComputerUseSetSchema = external_exports.object({
|
|
15952
|
+
enabled: external_exports.boolean().optional(),
|
|
15953
|
+
browser: external_exports.boolean().optional()
|
|
15954
|
+
}).strict().refine((value) => value.enabled !== void 0 || value.browser !== void 0, {
|
|
15955
|
+
message: "Expected enabled or browser"
|
|
15956
|
+
});
|
|
15957
|
+
var grokComputerUseSettingsSchema = external_exports.object({
|
|
15958
|
+
enabled: external_exports.boolean(),
|
|
15959
|
+
available: external_exports.boolean(),
|
|
15960
|
+
unavailableReason: external_exports.string().min(1).max(500).optional(),
|
|
15961
|
+
browser: external_exports.boolean().optional(),
|
|
15962
|
+
browserFilesPresent: external_exports.boolean().optional(),
|
|
15963
|
+
browserAvailable: external_exports.boolean().optional(),
|
|
15964
|
+
browserUnavailableReason: external_exports.string().min(1).max(500).optional(),
|
|
15965
|
+
applyFailed: external_exports.boolean().optional(),
|
|
15966
|
+
applyError: external_exports.string().min(1).max(500).optional()
|
|
15967
|
+
}).strict();
|
|
15968
|
+
|
|
15945
15969
|
// ../../shared-contracts/dist/harness-installation.js
|
|
15946
15970
|
var harnessInstallationParamsSchema = external_exports.object({
|
|
15947
15971
|
harnessId: harnessIdSchema,
|
|
@@ -14834,6 +14834,8 @@ var CONSOLE_HOST_METHODS = Object.freeze([
|
|
|
14834
14834
|
"codexhost/harness/installation",
|
|
14835
14835
|
"codexhost/harness/launch-settings/get",
|
|
14836
14836
|
"codexhost/harness/launch-settings/set",
|
|
14837
|
+
"codexhost/harness/grok-computer-use/get",
|
|
14838
|
+
"codexhost/harness/grok-computer-use/set",
|
|
14837
14839
|
"codexhost/harness/web-ui/open",
|
|
14838
14840
|
"codexhost/harness/accounts/sources",
|
|
14839
14841
|
"codexhost/harness/accounts/list",
|
|
@@ -15362,7 +15364,9 @@ var harnessInspectionSchema = external_exports.union([
|
|
|
15362
15364
|
var harnessInspectParamsSchema = external_exports.object({
|
|
15363
15365
|
harnessId: harnessIdSchema,
|
|
15364
15366
|
cwd: nonBlankTextSchema2.max(16384).optional(),
|
|
15365
|
-
refresh: external_exports.boolean().optional()
|
|
15367
|
+
refresh: external_exports.boolean().optional(),
|
|
15368
|
+
/** `availability` asks only whether the Harness can run; see `InspectHarnessInput.purpose`. */
|
|
15369
|
+
purpose: external_exports.literal("availability").optional()
|
|
15366
15370
|
}).strict();
|
|
15367
15371
|
var harnessWebUiOpenParamsSchema = external_exports.object({
|
|
15368
15372
|
harnessId: harnessIdSchema
|
|
@@ -15536,6 +15540,26 @@ var harnessLaunchSettingsSchema = external_exports.object({
|
|
|
15536
15540
|
restartRequired: external_exports.boolean()
|
|
15537
15541
|
}).strict();
|
|
15538
15542
|
|
|
15543
|
+
// ../../shared-contracts/dist/grok-computer-use.js
|
|
15544
|
+
var grokComputerUseGetSchema = external_exports.object({}).strict();
|
|
15545
|
+
var grokComputerUseSetSchema = external_exports.object({
|
|
15546
|
+
enabled: external_exports.boolean().optional(),
|
|
15547
|
+
browser: external_exports.boolean().optional()
|
|
15548
|
+
}).strict().refine((value) => value.enabled !== void 0 || value.browser !== void 0, {
|
|
15549
|
+
message: "Expected enabled or browser"
|
|
15550
|
+
});
|
|
15551
|
+
var grokComputerUseSettingsSchema = external_exports.object({
|
|
15552
|
+
enabled: external_exports.boolean(),
|
|
15553
|
+
available: external_exports.boolean(),
|
|
15554
|
+
unavailableReason: external_exports.string().min(1).max(500).optional(),
|
|
15555
|
+
browser: external_exports.boolean().optional(),
|
|
15556
|
+
browserFilesPresent: external_exports.boolean().optional(),
|
|
15557
|
+
browserAvailable: external_exports.boolean().optional(),
|
|
15558
|
+
browserUnavailableReason: external_exports.string().min(1).max(500).optional(),
|
|
15559
|
+
applyFailed: external_exports.boolean().optional(),
|
|
15560
|
+
applyError: external_exports.string().min(1).max(500).optional()
|
|
15561
|
+
}).strict();
|
|
15562
|
+
|
|
15539
15563
|
// ../../shared-contracts/dist/harness-installation.js
|
|
15540
15564
|
var harnessInstallationParamsSchema = external_exports.object({
|
|
15541
15565
|
harnessId: harnessIdSchema,
|
|
@@ -17569,10 +17593,13 @@ function usageSessionTitle(value) {
|
|
|
17569
17593
|
return void 0;
|
|
17570
17594
|
if (normalized.length <= MAX_SESSION_TITLE_LENGTH)
|
|
17571
17595
|
return normalized;
|
|
17572
|
-
|
|
17573
|
-
|
|
17574
|
-
|
|
17575
|
-
|
|
17596
|
+
let title = "";
|
|
17597
|
+
for (const character of normalized) {
|
|
17598
|
+
if (title.length + character.length >= MAX_SESSION_TITLE_LENGTH)
|
|
17599
|
+
break;
|
|
17600
|
+
title += character;
|
|
17601
|
+
}
|
|
17602
|
+
return `${title.trimEnd()}…`;
|
|
17576
17603
|
}
|
|
17577
17604
|
function sessionIdOk(value) {
|
|
17578
17605
|
return typeof value === "string" && value.length > 0 && value.length <= MAX_SESSION_ID_LENGTH;
|
|
@@ -15310,6 +15310,8 @@ var CONSOLE_HOST_METHODS = Object.freeze([
|
|
|
15310
15310
|
"codexhost/harness/installation",
|
|
15311
15311
|
"codexhost/harness/launch-settings/get",
|
|
15312
15312
|
"codexhost/harness/launch-settings/set",
|
|
15313
|
+
"codexhost/harness/grok-computer-use/get",
|
|
15314
|
+
"codexhost/harness/grok-computer-use/set",
|
|
15313
15315
|
"codexhost/harness/web-ui/open",
|
|
15314
15316
|
"codexhost/harness/accounts/sources",
|
|
15315
15317
|
"codexhost/harness/accounts/list",
|
|
@@ -15838,7 +15840,9 @@ var harnessInspectionSchema = external_exports.union([
|
|
|
15838
15840
|
var harnessInspectParamsSchema = external_exports.object({
|
|
15839
15841
|
harnessId: harnessIdSchema,
|
|
15840
15842
|
cwd: nonBlankTextSchema2.max(16384).optional(),
|
|
15841
|
-
refresh: external_exports.boolean().optional()
|
|
15843
|
+
refresh: external_exports.boolean().optional(),
|
|
15844
|
+
/** `availability` asks only whether the Harness can run; see `InspectHarnessInput.purpose`. */
|
|
15845
|
+
purpose: external_exports.literal("availability").optional()
|
|
15842
15846
|
}).strict();
|
|
15843
15847
|
var harnessWebUiOpenParamsSchema = external_exports.object({
|
|
15844
15848
|
harnessId: harnessIdSchema
|
|
@@ -16012,6 +16016,26 @@ var harnessLaunchSettingsSchema = external_exports.object({
|
|
|
16012
16016
|
restartRequired: external_exports.boolean()
|
|
16013
16017
|
}).strict();
|
|
16014
16018
|
|
|
16019
|
+
// ../../shared-contracts/dist/grok-computer-use.js
|
|
16020
|
+
var grokComputerUseGetSchema = external_exports.object({}).strict();
|
|
16021
|
+
var grokComputerUseSetSchema = external_exports.object({
|
|
16022
|
+
enabled: external_exports.boolean().optional(),
|
|
16023
|
+
browser: external_exports.boolean().optional()
|
|
16024
|
+
}).strict().refine((value) => value.enabled !== void 0 || value.browser !== void 0, {
|
|
16025
|
+
message: "Expected enabled or browser"
|
|
16026
|
+
});
|
|
16027
|
+
var grokComputerUseSettingsSchema = external_exports.object({
|
|
16028
|
+
enabled: external_exports.boolean(),
|
|
16029
|
+
available: external_exports.boolean(),
|
|
16030
|
+
unavailableReason: external_exports.string().min(1).max(500).optional(),
|
|
16031
|
+
browser: external_exports.boolean().optional(),
|
|
16032
|
+
browserFilesPresent: external_exports.boolean().optional(),
|
|
16033
|
+
browserAvailable: external_exports.boolean().optional(),
|
|
16034
|
+
browserUnavailableReason: external_exports.string().min(1).max(500).optional(),
|
|
16035
|
+
applyFailed: external_exports.boolean().optional(),
|
|
16036
|
+
applyError: external_exports.string().min(1).max(500).optional()
|
|
16037
|
+
}).strict();
|
|
16038
|
+
|
|
16015
16039
|
// ../../shared-contracts/dist/harness-installation.js
|
|
16016
16040
|
var harnessInstallationParamsSchema = external_exports.object({
|
|
16017
16041
|
harnessId: harnessIdSchema,
|
|
@@ -17055,10 +17079,13 @@ function usageSessionTitle(value) {
|
|
|
17055
17079
|
return void 0;
|
|
17056
17080
|
if (normalized.length <= MAX_SESSION_TITLE_LENGTH)
|
|
17057
17081
|
return normalized;
|
|
17058
|
-
|
|
17059
|
-
|
|
17060
|
-
|
|
17061
|
-
|
|
17082
|
+
let title = "";
|
|
17083
|
+
for (const character of normalized) {
|
|
17084
|
+
if (title.length + character.length >= MAX_SESSION_TITLE_LENGTH)
|
|
17085
|
+
break;
|
|
17086
|
+
title += character;
|
|
17087
|
+
}
|
|
17088
|
+
return `${title.trimEnd()}…`;
|
|
17062
17089
|
}
|
|
17063
17090
|
function sessionIdOk(value) {
|
|
17064
17091
|
return typeof value === "string" && value.length > 0 && value.length <= MAX_SESSION_ID_LENGTH;
|
|
@@ -14828,6 +14828,8 @@ var CONSOLE_HOST_METHODS = Object.freeze([
|
|
|
14828
14828
|
"codexhost/harness/installation",
|
|
14829
14829
|
"codexhost/harness/launch-settings/get",
|
|
14830
14830
|
"codexhost/harness/launch-settings/set",
|
|
14831
|
+
"codexhost/harness/grok-computer-use/get",
|
|
14832
|
+
"codexhost/harness/grok-computer-use/set",
|
|
14831
14833
|
"codexhost/harness/web-ui/open",
|
|
14832
14834
|
"codexhost/harness/accounts/sources",
|
|
14833
14835
|
"codexhost/harness/accounts/list",
|
|
@@ -15356,7 +15358,9 @@ var harnessInspectionSchema = external_exports.union([
|
|
|
15356
15358
|
var harnessInspectParamsSchema = external_exports.object({
|
|
15357
15359
|
harnessId: harnessIdSchema,
|
|
15358
15360
|
cwd: nonBlankTextSchema2.max(16384).optional(),
|
|
15359
|
-
refresh: external_exports.boolean().optional()
|
|
15361
|
+
refresh: external_exports.boolean().optional(),
|
|
15362
|
+
/** `availability` asks only whether the Harness can run; see `InspectHarnessInput.purpose`. */
|
|
15363
|
+
purpose: external_exports.literal("availability").optional()
|
|
15360
15364
|
}).strict();
|
|
15361
15365
|
var harnessWebUiOpenParamsSchema = external_exports.object({
|
|
15362
15366
|
harnessId: harnessIdSchema
|
|
@@ -15530,6 +15534,26 @@ var harnessLaunchSettingsSchema = external_exports.object({
|
|
|
15530
15534
|
restartRequired: external_exports.boolean()
|
|
15531
15535
|
}).strict();
|
|
15532
15536
|
|
|
15537
|
+
// ../../shared-contracts/dist/grok-computer-use.js
|
|
15538
|
+
var grokComputerUseGetSchema = external_exports.object({}).strict();
|
|
15539
|
+
var grokComputerUseSetSchema = external_exports.object({
|
|
15540
|
+
enabled: external_exports.boolean().optional(),
|
|
15541
|
+
browser: external_exports.boolean().optional()
|
|
15542
|
+
}).strict().refine((value) => value.enabled !== void 0 || value.browser !== void 0, {
|
|
15543
|
+
message: "Expected enabled or browser"
|
|
15544
|
+
});
|
|
15545
|
+
var grokComputerUseSettingsSchema = external_exports.object({
|
|
15546
|
+
enabled: external_exports.boolean(),
|
|
15547
|
+
available: external_exports.boolean(),
|
|
15548
|
+
unavailableReason: external_exports.string().min(1).max(500).optional(),
|
|
15549
|
+
browser: external_exports.boolean().optional(),
|
|
15550
|
+
browserFilesPresent: external_exports.boolean().optional(),
|
|
15551
|
+
browserAvailable: external_exports.boolean().optional(),
|
|
15552
|
+
browserUnavailableReason: external_exports.string().min(1).max(500).optional(),
|
|
15553
|
+
applyFailed: external_exports.boolean().optional(),
|
|
15554
|
+
applyError: external_exports.string().min(1).max(500).optional()
|
|
15555
|
+
}).strict();
|
|
15556
|
+
|
|
15533
15557
|
// ../../shared-contracts/dist/harness-installation.js
|
|
15534
15558
|
var harnessInstallationParamsSchema = external_exports.object({
|
|
15535
15559
|
harnessId: harnessIdSchema,
|
|
@@ -15992,10 +16016,13 @@ function usageSessionTitle(value) {
|
|
|
15992
16016
|
return void 0;
|
|
15993
16017
|
if (normalized.length <= MAX_SESSION_TITLE_LENGTH)
|
|
15994
16018
|
return normalized;
|
|
15995
|
-
|
|
15996
|
-
|
|
15997
|
-
|
|
15998
|
-
|
|
16019
|
+
let title = "";
|
|
16020
|
+
for (const character of normalized) {
|
|
16021
|
+
if (title.length + character.length >= MAX_SESSION_TITLE_LENGTH)
|
|
16022
|
+
break;
|
|
16023
|
+
title += character;
|
|
16024
|
+
}
|
|
16025
|
+
return `${title.trimEnd()}…`;
|
|
15999
16026
|
}
|
|
16000
16027
|
function sessionIdOk(value) {
|
|
16001
16028
|
return typeof value === "string" && value.length > 0 && value.length <= MAX_SESSION_ID_LENGTH;
|
|
@@ -16498,8 +16525,9 @@ var CodexCounters = class {
|
|
|
16498
16525
|
// dist/rollout-io.js
|
|
16499
16526
|
import { createReadStream as createReadStream2 } from "node:fs";
|
|
16500
16527
|
import { StringDecoder } from "node:string_decoder";
|
|
16501
|
-
import {
|
|
16502
|
-
import {
|
|
16528
|
+
import { pipeline } from "node:stream/promises";
|
|
16529
|
+
import { Readable } from "node:stream";
|
|
16530
|
+
import { constants as zstdConstants, createZstdDecompress } from "node:zlib";
|
|
16503
16531
|
/*!
|
|
16504
16532
|
* Rollout reading: zstd frame walking, streaming copy-prefix comparison.
|
|
16505
16533
|
*
|
|
@@ -16522,74 +16550,103 @@ import { zstdDecompress } from "node:zlib";
|
|
|
16522
16550
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
16523
16551
|
* SOFTWARE.
|
|
16524
16552
|
*/
|
|
16525
|
-
var decompress = promisify(zstdDecompress);
|
|
16526
|
-
var MAX_FRAME = 64 * 1024 * 1024;
|
|
16527
16553
|
var MAX_LINE = 128 * 1024 * 1024;
|
|
16528
|
-
function frameSize(data) {
|
|
16529
|
-
if (data.length < 8)
|
|
16530
|
-
return null;
|
|
16531
|
-
const magic = data.readUInt32LE(0);
|
|
16532
|
-
if ((magic & 4294967280) === 407710288) {
|
|
16533
|
-
const size = 8 + data.readUInt32LE(4);
|
|
16534
|
-
if (size > MAX_FRAME)
|
|
16535
|
-
throw new Error("Codex zstd frame exceeds the safety limit");
|
|
16536
|
-
return data.length >= size ? { size, skip: true } : null;
|
|
16537
|
-
}
|
|
16538
|
-
if (magic !== 4247762216)
|
|
16539
|
-
throw new Error("Invalid Codex zstd frame");
|
|
16540
|
-
const descriptor = data.readUInt8(4);
|
|
16541
|
-
if (descriptor & 8)
|
|
16542
|
-
throw new Error("Reserved Codex zstd frame header");
|
|
16543
|
-
const single = descriptor >> 5 & 1;
|
|
16544
|
-
let offset = 5 + (single ? 0 : 1) + ([0, 1, 2, 4][descriptor & 3] ?? 0) + ([single, 2, 4, 8][descriptor >> 6] ?? 0);
|
|
16545
|
-
for (; ; ) {
|
|
16546
|
-
if (offset + 3 > data.length)
|
|
16547
|
-
return null;
|
|
16548
|
-
const block = data.readUIntLE(offset, 3);
|
|
16549
|
-
const type = block >> 1 & 3;
|
|
16550
|
-
if (type === 3)
|
|
16551
|
-
throw new Error("Reserved Codex zstd block");
|
|
16552
|
-
offset += 3 + (type === 1 ? 1 : block >>> 3);
|
|
16553
|
-
if (offset > MAX_FRAME)
|
|
16554
|
-
throw new Error("Codex zstd frame exceeds the safety limit");
|
|
16555
|
-
if (block & 1)
|
|
16556
|
-
break;
|
|
16557
|
-
}
|
|
16558
|
-
if (descriptor & 4)
|
|
16559
|
-
offset += 4;
|
|
16560
|
-
return data.length >= offset ? { size: offset, skip: false } : null;
|
|
16561
|
-
}
|
|
16562
16554
|
async function* rolloutBytes(file2, signal) {
|
|
16563
16555
|
signal.throwIfAborted();
|
|
16564
16556
|
const stream = createReadStream2(file2, { signal });
|
|
16565
|
-
let pending = Buffer.alloc(0);
|
|
16566
16557
|
try {
|
|
16567
|
-
|
|
16568
|
-
|
|
16569
|
-
|
|
16570
|
-
if (!file2.endsWith(".zst")) {
|
|
16558
|
+
if (!file2.endsWith(".zst")) {
|
|
16559
|
+
for await (const chunk of stream) {
|
|
16560
|
+
signal.throwIfAborted();
|
|
16571
16561
|
yield chunk;
|
|
16562
|
+
}
|
|
16563
|
+
return;
|
|
16564
|
+
}
|
|
16565
|
+
const input = stream[Symbol.asyncIterator]();
|
|
16566
|
+
let pending = Buffer.alloc(0);
|
|
16567
|
+
async function readExact(size, allowEof = false) {
|
|
16568
|
+
const parts = [];
|
|
16569
|
+
let length = 0;
|
|
16570
|
+
while (length < size) {
|
|
16571
|
+
signal.throwIfAborted();
|
|
16572
|
+
if (!pending.length) {
|
|
16573
|
+
const next = await input.next();
|
|
16574
|
+
if (next.done) {
|
|
16575
|
+
if (allowEof && !length)
|
|
16576
|
+
return Buffer.alloc(0);
|
|
16577
|
+
throw new Error("Truncated Codex zstd rollout");
|
|
16578
|
+
}
|
|
16579
|
+
pending = next.value;
|
|
16580
|
+
}
|
|
16581
|
+
const count2 = Math.min(size - length, pending.length);
|
|
16582
|
+
parts.push(pending.subarray(0, count2));
|
|
16583
|
+
pending = pending.subarray(count2);
|
|
16584
|
+
length += count2;
|
|
16585
|
+
}
|
|
16586
|
+
return Buffer.concat(parts, length);
|
|
16587
|
+
}
|
|
16588
|
+
for (; ; ) {
|
|
16589
|
+
const magicBytes = await readExact(4, true);
|
|
16590
|
+
if (!magicBytes.length)
|
|
16591
|
+
break;
|
|
16592
|
+
const magic = magicBytes.readUInt32LE(0);
|
|
16593
|
+
if ((magic & 4294967280) === 407710288) {
|
|
16594
|
+
let size = (await readExact(4)).readUInt32LE(0);
|
|
16595
|
+
while (size) {
|
|
16596
|
+
const count2 = Math.min(size, 64 * 1024);
|
|
16597
|
+
await readExact(count2);
|
|
16598
|
+
size -= count2;
|
|
16599
|
+
}
|
|
16572
16600
|
continue;
|
|
16573
16601
|
}
|
|
16574
|
-
|
|
16575
|
-
|
|
16576
|
-
|
|
16577
|
-
|
|
16578
|
-
|
|
16579
|
-
|
|
16580
|
-
|
|
16581
|
-
|
|
16582
|
-
|
|
16602
|
+
if (magic !== 4247762216)
|
|
16603
|
+
throw new Error("Invalid Codex zstd frame");
|
|
16604
|
+
const descriptorBytes = await readExact(1);
|
|
16605
|
+
const descriptor = descriptorBytes.readUInt8(0);
|
|
16606
|
+
if (descriptor & 8)
|
|
16607
|
+
throw new Error("Reserved Codex zstd frame header");
|
|
16608
|
+
const single = descriptor >> 5 & 1;
|
|
16609
|
+
const headerSize = (single ? 0 : 1) + ([0, 1, 2, 4][descriptor & 3] ?? 0) + ([single, 2, 4, 8][descriptor >> 6] ?? 0);
|
|
16610
|
+
const header = Buffer.concat([magicBytes, descriptorBytes, await readExact(headerSize)]);
|
|
16611
|
+
async function* frameChunks() {
|
|
16612
|
+
yield header;
|
|
16613
|
+
for (; ; ) {
|
|
16614
|
+
const blockBytes = await readExact(3);
|
|
16615
|
+
const block = blockBytes.readUIntLE(0, 3);
|
|
16616
|
+
const type = block >> 1 & 3;
|
|
16617
|
+
if (type === 3)
|
|
16618
|
+
throw new Error("Reserved Codex zstd block");
|
|
16619
|
+
const blockSize = block >>> 3;
|
|
16620
|
+
if (blockSize > 128 * 1024)
|
|
16621
|
+
throw new Error("Invalid Codex zstd block size");
|
|
16622
|
+
yield blockBytes;
|
|
16623
|
+
yield await readExact(type === 1 ? 1 : blockSize);
|
|
16624
|
+
if (block & 1)
|
|
16625
|
+
break;
|
|
16626
|
+
}
|
|
16627
|
+
if (descriptor & 4)
|
|
16628
|
+
yield await readExact(4);
|
|
16629
|
+
}
|
|
16630
|
+
const frame = Readable.from(frameChunks(), { objectMode: false });
|
|
16631
|
+
const decoder = createZstdDecompress({
|
|
16632
|
+
chunkSize: 64 * 1024,
|
|
16633
|
+
params: { [zstdConstants.ZSTD_d_windowLogMax]: 27 }
|
|
16634
|
+
});
|
|
16635
|
+
const completed = pipeline(frame, decoder, { signal }).then(() => null, (error51) => error51);
|
|
16636
|
+
try {
|
|
16637
|
+
for await (const chunk of decoder) {
|
|
16583
16638
|
signal.throwIfAborted();
|
|
16584
|
-
yield
|
|
16639
|
+
yield chunk;
|
|
16585
16640
|
}
|
|
16586
|
-
|
|
16641
|
+
const error51 = await completed;
|
|
16642
|
+
if (error51)
|
|
16643
|
+
throw error51;
|
|
16644
|
+
} finally {
|
|
16645
|
+
frame.destroy();
|
|
16646
|
+
decoder.destroy();
|
|
16647
|
+
await completed;
|
|
16587
16648
|
}
|
|
16588
|
-
if (pending.length > MAX_FRAME)
|
|
16589
|
-
throw new Error("Codex zstd frame exceeds the safety limit");
|
|
16590
16649
|
}
|
|
16591
|
-
if (pending.length)
|
|
16592
|
-
throw new Error("Truncated Codex zstd rollout");
|
|
16593
16650
|
} finally {
|
|
16594
16651
|
stream.destroy();
|
|
16595
16652
|
}
|
|
@@ -16663,12 +16720,17 @@ var ROW_KINDS = /* @__PURE__ */ new Set([
|
|
|
16663
16720
|
]);
|
|
16664
16721
|
var HEAD_TYPE = /"type"\s*:\s*"([^"]+)"/u;
|
|
16665
16722
|
var TAIL_TYPE = /"type"\s*:\s*"([^"]+)"\s*\}\s*$/u;
|
|
16723
|
+
var USER_ROLE = /"role"\s*:\s*"user"/u;
|
|
16724
|
+
var EVENT_OF_INTEREST = /"type"\s*:\s*"(?:token_count|task_started|thread_settings_applied|user_message)"/u;
|
|
16666
16725
|
function rowKind(line) {
|
|
16667
16726
|
const head = HEAD_TYPE.exec(line.slice(0, 1024))?.[1];
|
|
16668
16727
|
if (head && ROW_KINDS.has(head))
|
|
16669
16728
|
return head;
|
|
16670
16729
|
return TAIL_TYPE.exec(line.slice(-1024))?.[1] ?? head;
|
|
16671
16730
|
}
|
|
16731
|
+
function markerIn(pattern, line) {
|
|
16732
|
+
return pattern.test(line.slice(0, 1024)) || pattern.test(line.slice(-1024));
|
|
16733
|
+
}
|
|
16672
16734
|
async function stamp(file2) {
|
|
16673
16735
|
const s = await lstat(file2, { bigint: true });
|
|
16674
16736
|
if (!s.isFile())
|
|
@@ -16732,9 +16794,9 @@ async function readCodexRollouts(files, thread, signal, options = {}) {
|
|
|
16732
16794
|
options.onIncomplete?.();
|
|
16733
16795
|
if (!kind || !ROW_KINDS.has(kind))
|
|
16734
16796
|
continue;
|
|
16735
|
-
if (kind === "response_item" &&
|
|
16797
|
+
if (kind === "response_item" && !markerIn(USER_ROLE, line))
|
|
16736
16798
|
continue;
|
|
16737
|
-
if (kind === "event_msg" &&
|
|
16799
|
+
if (kind === "event_msg" && !markerIn(EVENT_OF_INTEREST, line))
|
|
16738
16800
|
continue;
|
|
16739
16801
|
let row;
|
|
16740
16802
|
try {
|
|
@@ -16785,8 +16847,10 @@ async function readCodexRollouts(files, thread, signal, options = {}) {
|
|
|
16785
16847
|
break;
|
|
16786
16848
|
}
|
|
16787
16849
|
case "response_item":
|
|
16788
|
-
|
|
16789
|
-
|
|
16850
|
+
if (p.type === "message" && p.role === "user") {
|
|
16851
|
+
counters.boundary();
|
|
16852
|
+
firstPrompt ??= userItemPrompt(p);
|
|
16853
|
+
}
|
|
16790
16854
|
break;
|
|
16791
16855
|
case "event_msg":
|
|
16792
16856
|
if (p.type === "task_started") {
|