negotium 0.22.5 → 0.22.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-helpers.js +394 -1295
- package/dist/agent-helpers.js.map +3 -3
- package/dist/background-bash.js +12 -12
- package/dist/background-bash.js.map +2 -2
- package/dist/browser-runtime.js +42 -44
- package/dist/browser-runtime.js.map +2 -2
- package/dist/canonical-mcp-bridge.js +8 -9
- package/dist/canonical-mcp-bridge.js.map +1 -1
- package/dist/{chunk-a3me2mje.js → chunk-1e0nxy7p.js} +12 -12
- package/dist/{chunk-a3me2mje.js.map → chunk-1e0nxy7p.js.map} +2 -2
- package/dist/{chunk-9zn0bkc9.js → chunk-1mba9m1j.js} +77 -116
- package/dist/{chunk-9zn0bkc9.js.map → chunk-1mba9m1j.js.map} +2 -2
- package/dist/{chunk-vh8px000.js → chunk-9a50csg6.js} +115 -119
- package/dist/{chunk-vh8px000.js.map → chunk-9a50csg6.js.map} +6 -6
- package/dist/chunk-bnyvxss3.js +77 -0
- package/dist/{chunk-q5djsg78.js.map → chunk-bnyvxss3.js.map} +1 -1
- package/dist/{chunk-7rpbcn1j.js → chunk-e59kzyvy.js} +4 -5
- package/dist/{chunk-7rpbcn1j.js.map → chunk-e59kzyvy.js.map} +2 -2
- package/dist/{chunk-f7p0h1gs.js → chunk-ww8a4ej4.js} +5 -5
- package/dist/{chunk-f7p0h1gs.js.map → chunk-ww8a4ej4.js.map} +2 -2
- package/dist/hosted-agent.js +119 -122
- package/dist/hosted-agent.js.map +3 -3
- package/dist/main.js +3303 -5132
- package/dist/main.js.map +5 -5
- package/dist/mcp-catalog.js +4 -4
- package/dist/mcp-catalog.js.map +1 -1
- package/dist/mcp-factories.js +616 -1509
- package/dist/mcp-factories.js.map +3 -3
- package/dist/mcp-servers.js +5 -5
- package/dist/mcp-servers.js.map +1 -1
- package/dist/media.js +3 -3
- package/dist/media.js.map +1 -1
- package/dist/outbox.js +15 -15
- package/dist/outbox.js.map +2 -2
- package/dist/platform-runtime.js +7 -7
- package/dist/platform-runtime.js.map +1 -1
- package/dist/prompts.js +6 -6
- package/dist/prompts.js.map +2 -2
- package/dist/query-runtime.js +16 -18
- package/dist/query-runtime.js.map +2 -2
- package/dist/registry.js +19 -20
- package/dist/registry.js.map +2 -2
- package/dist/rollout.js +41 -41
- package/dist/rollout.js.map +2 -2
- package/dist/runtime/src/topics/update.ts +20 -0
- package/dist/runtime/src/version.ts +1 -1
- package/dist/runtime-gateway.js +12 -12
- package/dist/runtime-gateway.js.map +2 -2
- package/dist/runtime-helpers.js +52 -54
- package/dist/runtime-helpers.js.map +2 -2
- package/dist/sqlite.js +3 -5
- package/dist/sqlite.js.map +2 -2
- package/dist/storage.js +4831 -4802
- package/dist/storage.js.map +2 -2
- package/dist/types/packages/core/src/version.d.ts +1 -1
- package/dist/vault.js +20 -22
- package/dist/vault.js.map +2 -2
- package/package.json +1 -1
- package/dist/chunk-2mx7fq49.js +0 -6
- package/dist/chunk-2mx7fq49.js.map +0 -9
- package/dist/chunk-q5djsg78.js +0 -200
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
var __require = import.meta.require;
|
|
3
|
-
|
|
4
2
|
// ../../packages/core/src/agents/rollout/shared.ts
|
|
5
3
|
import { mkdirSync as mkdirSync2 } from "fs";
|
|
6
4
|
import { resolve as resolve3 } from "path";
|
|
@@ -389,7 +387,7 @@ var trustedWorkspaceRoots = [
|
|
|
389
387
|
SESSION_WORKSPACE_DIR,
|
|
390
388
|
TOPIC_WORKSPACE_DIR
|
|
391
389
|
].map((root) => resolve3(root));
|
|
392
|
-
function
|
|
390
|
+
function configureRolloutHost2(options) {
|
|
393
391
|
if (!options.workspaceRoots && !options.fixturesDir) {
|
|
394
392
|
throw new Error("configureRolloutHost requires workspaceRoots or fixturesDir");
|
|
395
393
|
}
|
|
@@ -441,7 +439,7 @@ function truncate(text, n) {
|
|
|
441
439
|
const cps = Array.from(text);
|
|
442
440
|
return cps.length > n ? `${cps.slice(0, n).join("")}\u2026` : text;
|
|
443
441
|
}
|
|
444
|
-
function
|
|
442
|
+
function extractChatPairs2(entries, opts = { includeToolAnnotations: true }) {
|
|
445
443
|
const pairs = [];
|
|
446
444
|
let pendingUsers = [];
|
|
447
445
|
let pendingBatchSize = null;
|
|
@@ -545,9 +543,91 @@ ${toolBuffer.join(`
|
|
|
545
543
|
return pairs;
|
|
546
544
|
}
|
|
547
545
|
|
|
546
|
+
// ../../packages/core/src/platform/jsonl.ts
|
|
547
|
+
import {
|
|
548
|
+
appendFileSync,
|
|
549
|
+
closeSync,
|
|
550
|
+
fsyncSync,
|
|
551
|
+
mkdirSync as mkdirSync3,
|
|
552
|
+
openSync,
|
|
553
|
+
readFileSync as readFileSync2,
|
|
554
|
+
renameSync,
|
|
555
|
+
statSync,
|
|
556
|
+
unlinkSync as unlinkSync2,
|
|
557
|
+
writeFileSync as writeFileSync2
|
|
558
|
+
} from "fs";
|
|
559
|
+
import { dirname as dirname3 } from "path";
|
|
560
|
+
|
|
561
|
+
// ../../packages/core/src/platform/file-utils.ts
|
|
562
|
+
import { unlinkSync } from "fs";
|
|
563
|
+
function createSafeUnlink(host) {
|
|
564
|
+
return (path, warnLabel) => {
|
|
565
|
+
try {
|
|
566
|
+
host.unlink(path);
|
|
567
|
+
} catch (e) {
|
|
568
|
+
if (e?.code === "ENOENT")
|
|
569
|
+
return;
|
|
570
|
+
if (warnLabel)
|
|
571
|
+
host.warn({ err: e, path }, warnLabel);
|
|
572
|
+
}
|
|
573
|
+
};
|
|
574
|
+
}
|
|
575
|
+
var defaultSafeUnlink = createSafeUnlink({
|
|
576
|
+
unlink: unlinkSync,
|
|
577
|
+
warn: (context, message) => logger.warn(context, message)
|
|
578
|
+
});
|
|
579
|
+
|
|
580
|
+
// ../../packages/core/src/platform/jsonl.ts
|
|
581
|
+
function parseJsonlText(raw) {
|
|
582
|
+
return raw.trim().split(`
|
|
583
|
+
`).filter(Boolean).map((line) => JSON.parse(line));
|
|
584
|
+
}
|
|
585
|
+
var LOCK_SLEEP = new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT));
|
|
586
|
+
function writeJsonlFile(filePath, entries) {
|
|
587
|
+
const dir = dirname3(filePath);
|
|
588
|
+
mkdirSync3(dir, { recursive: true });
|
|
589
|
+
const tmpPath = `${filePath}.tmp-${process.pid}-${Date.now()}-${Math.random().toString(16).slice(2)}`;
|
|
590
|
+
const payload = `${entries.map((e) => JSON.stringify(e)).join(`
|
|
591
|
+
`)}
|
|
592
|
+
`;
|
|
593
|
+
let fd = null;
|
|
594
|
+
try {
|
|
595
|
+
fd = openSync(tmpPath, "w");
|
|
596
|
+
writeFileSync2(fd, payload);
|
|
597
|
+
fsyncSync(fd);
|
|
598
|
+
closeSync(fd);
|
|
599
|
+
fd = null;
|
|
600
|
+
renameSync(tmpPath, filePath);
|
|
601
|
+
fsyncDirectoryBestEffort(dir);
|
|
602
|
+
} catch (err) {
|
|
603
|
+
if (fd !== null) {
|
|
604
|
+
try {
|
|
605
|
+
closeSync(fd);
|
|
606
|
+
} catch {}
|
|
607
|
+
}
|
|
608
|
+
try {
|
|
609
|
+
unlinkSync2(tmpPath);
|
|
610
|
+
} catch {}
|
|
611
|
+
throw err;
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
function fsyncDirectoryBestEffort(dir) {
|
|
615
|
+
let fd = null;
|
|
616
|
+
try {
|
|
617
|
+
fd = openSync(dir, "r");
|
|
618
|
+
fsyncSync(fd);
|
|
619
|
+
} catch {} finally {
|
|
620
|
+
if (fd !== null) {
|
|
621
|
+
try {
|
|
622
|
+
closeSync(fd);
|
|
623
|
+
} catch {}
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
|
|
548
628
|
// ../../packages/core/src/agents/execution-host.ts
|
|
549
629
|
import { AsyncLocalStorage } from "async_hooks";
|
|
550
|
-
import { dirname as
|
|
630
|
+
import { dirname as dirname5 } from "path";
|
|
551
631
|
|
|
552
632
|
// ../../packages/core/src/security/sensitive-path.ts
|
|
553
633
|
import { realpathSync as realpathSync2 } from "fs";
|
|
@@ -1205,12 +1285,12 @@ function createBackgroundBashManager(options = {}) {
|
|
|
1205
1285
|
usedPorts.clear();
|
|
1206
1286
|
knownContexts.clear();
|
|
1207
1287
|
const deadline = now() + 3000;
|
|
1208
|
-
await Promise.all(entries.map((instance) => new Promise((
|
|
1288
|
+
await Promise.all(entries.map((instance) => new Promise((resolve) => {
|
|
1209
1289
|
if (instance.process.exitCode !== null || instance.process.killed)
|
|
1210
|
-
return
|
|
1211
|
-
instance.process.once("exit",
|
|
1212
|
-
instance.process.once("error",
|
|
1213
|
-
const timer = setTimeout(
|
|
1290
|
+
return resolve();
|
|
1291
|
+
instance.process.once("exit", resolve);
|
|
1292
|
+
instance.process.once("error", resolve);
|
|
1293
|
+
const timer = setTimeout(resolve, Math.max(0, deadline - now()));
|
|
1214
1294
|
timer.unref?.();
|
|
1215
1295
|
})));
|
|
1216
1296
|
}
|
|
@@ -1305,9 +1385,9 @@ var RESERVED_TOPIC_NAMES = new Set([
|
|
|
1305
1385
|
var GENERAL_TOPIC_ID = "general";
|
|
1306
1386
|
|
|
1307
1387
|
// ../../packages/core/src/storage/storage-host.ts
|
|
1308
|
-
import { mkdirSync as
|
|
1388
|
+
import { mkdirSync as mkdirSync4 } from "fs";
|
|
1309
1389
|
import { homedir as homedir2 } from "os";
|
|
1310
|
-
import { dirname as
|
|
1390
|
+
import { dirname as dirname4, join as join2, resolve as resolve5 } from "path";
|
|
1311
1391
|
|
|
1312
1392
|
// ../../packages/core/src/storage/sqlite.ts
|
|
1313
1393
|
var isBun = typeof process.versions.bun === "string";
|
|
@@ -1442,7 +1522,7 @@ function defaultDatabase() {
|
|
|
1442
1522
|
return state.fallbackDatabase;
|
|
1443
1523
|
if (state.fallbackDatabase)
|
|
1444
1524
|
closeDatabase(state.fallbackDatabase);
|
|
1445
|
-
|
|
1525
|
+
mkdirSync4(dirname4(path), { recursive: true });
|
|
1446
1526
|
state.fallbackDatabase = new Database(path, { create: true });
|
|
1447
1527
|
state.fallbackDatabasePath = path;
|
|
1448
1528
|
initializeDatabase(state.fallbackDatabase);
|
|
@@ -1642,7 +1722,7 @@ var SCHEMA_TRIGGERS = {
|
|
|
1642
1722
|
};
|
|
1643
1723
|
var OTIUM_TOPIC_SCOPE_IMMUTABLE_ERROR = "otium_topic_scope_immutable";
|
|
1644
1724
|
function topicLinkSchemaIsCurrent(database, nodeId) {
|
|
1645
|
-
const objects = new Map(database.query("SELECT name, sql FROM sqlite_master WHERE type IN ('table','index','trigger')").all().map((
|
|
1725
|
+
const objects = new Map(database.query("SELECT name, sql FROM sqlite_master WHERE type IN ('table','index','trigger')").all().map((row) => [row.name, row.sql ?? ""]));
|
|
1646
1726
|
for (const name of [...SCHEMA_TABLES, ...SCHEMA_INDEXES, ...SCHEMA_INDEXES_TOMBSTONES]) {
|
|
1647
1727
|
if (!objects.has(name))
|
|
1648
1728
|
return false;
|
|
@@ -1659,7 +1739,7 @@ function topicLinkSchemaIsCurrent(database, nodeId) {
|
|
|
1659
1739
|
return false;
|
|
1660
1740
|
}
|
|
1661
1741
|
const identity = database.query("SELECT node_id, epoch_id FROM api_node_identity WHERE singleton = 1").all();
|
|
1662
|
-
if (identity.some((
|
|
1742
|
+
if (identity.some((row) => row.epoch_id === null))
|
|
1663
1743
|
return false;
|
|
1664
1744
|
if (nodeId && identity[0]?.node_id !== nodeId)
|
|
1665
1745
|
return false;
|
|
@@ -3093,7 +3173,7 @@ function hideProviderIntrospectionForOtium(servers, topicId) {
|
|
|
3093
3173
|
}
|
|
3094
3174
|
|
|
3095
3175
|
// ../../packages/core/src/storage/vault.ts
|
|
3096
|
-
import { chmodSync as chmodSync2, mkdirSync as
|
|
3176
|
+
import { chmodSync as chmodSync2, mkdirSync as mkdirSync5 } from "fs";
|
|
3097
3177
|
import { join as join3 } from "path";
|
|
3098
3178
|
|
|
3099
3179
|
// ../../packages/core/src/storage/vault-crypto-core.ts
|
|
@@ -3187,7 +3267,7 @@ function initializeVaultDatabase(database) {
|
|
|
3187
3267
|
function openVaultDatabase(dataDir) {
|
|
3188
3268
|
const vaultDir = join3(dataDir, "vault");
|
|
3189
3269
|
const path = join3(vaultDir, "vault.db");
|
|
3190
|
-
|
|
3270
|
+
mkdirSync5(vaultDir, { recursive: true, mode: 448 });
|
|
3191
3271
|
const database = new Database(path, { create: true });
|
|
3192
3272
|
chmodSync2(path, 384);
|
|
3193
3273
|
initializeVaultDatabase(database);
|
|
@@ -3308,97 +3388,13 @@ function hostedCodexAuthFilePath() {
|
|
|
3308
3388
|
return activeHost().codexAuthFilePath();
|
|
3309
3389
|
}
|
|
3310
3390
|
function hostedCodexHomePath() {
|
|
3311
|
-
return
|
|
3391
|
+
return dirname5(hostedCodexAuthFilePath());
|
|
3312
3392
|
}
|
|
3313
3393
|
|
|
3314
3394
|
// ../../packages/core/src/agents/rollout/codex.ts
|
|
3315
3395
|
import { randomBytes as randomBytes4 } from "crypto";
|
|
3316
3396
|
import { existsSync as existsSync3, readFileSync as readFileSync3, realpathSync as realpathSync3, statSync as statSync2, unlinkSync as unlinkSync3 } from "fs";
|
|
3317
3397
|
import { basename, dirname as dirname6, join as join4, resolve as resolve6 } from "path";
|
|
3318
|
-
|
|
3319
|
-
// ../../packages/core/src/platform/jsonl.ts
|
|
3320
|
-
import {
|
|
3321
|
-
appendFileSync,
|
|
3322
|
-
closeSync,
|
|
3323
|
-
fsyncSync,
|
|
3324
|
-
mkdirSync as mkdirSync5,
|
|
3325
|
-
openSync,
|
|
3326
|
-
readFileSync as readFileSync2,
|
|
3327
|
-
renameSync,
|
|
3328
|
-
statSync,
|
|
3329
|
-
unlinkSync as unlinkSync2,
|
|
3330
|
-
writeFileSync as writeFileSync2
|
|
3331
|
-
} from "fs";
|
|
3332
|
-
import { dirname as dirname5 } from "path";
|
|
3333
|
-
|
|
3334
|
-
// ../../packages/core/src/platform/file-utils.ts
|
|
3335
|
-
import { unlinkSync } from "fs";
|
|
3336
|
-
function createSafeUnlink(host) {
|
|
3337
|
-
return (path, warnLabel) => {
|
|
3338
|
-
try {
|
|
3339
|
-
host.unlink(path);
|
|
3340
|
-
} catch (e) {
|
|
3341
|
-
if (e?.code === "ENOENT")
|
|
3342
|
-
return;
|
|
3343
|
-
if (warnLabel)
|
|
3344
|
-
host.warn({ err: e, path }, warnLabel);
|
|
3345
|
-
}
|
|
3346
|
-
};
|
|
3347
|
-
}
|
|
3348
|
-
var defaultSafeUnlink = createSafeUnlink({
|
|
3349
|
-
unlink: unlinkSync,
|
|
3350
|
-
warn: (context, message) => logger.warn(context, message)
|
|
3351
|
-
});
|
|
3352
|
-
|
|
3353
|
-
// ../../packages/core/src/platform/jsonl.ts
|
|
3354
|
-
function parseJsonlText(raw) {
|
|
3355
|
-
return raw.trim().split(`
|
|
3356
|
-
`).filter(Boolean).map((line) => JSON.parse(line));
|
|
3357
|
-
}
|
|
3358
|
-
var LOCK_SLEEP = new Int32Array(new SharedArrayBuffer(Int32Array.BYTES_PER_ELEMENT));
|
|
3359
|
-
function writeJsonlFile(filePath, entries) {
|
|
3360
|
-
const dir = dirname5(filePath);
|
|
3361
|
-
mkdirSync5(dir, { recursive: true });
|
|
3362
|
-
const tmpPath = `${filePath}.tmp-${process.pid}-${Date.now()}-${Math.random().toString(16).slice(2)}`;
|
|
3363
|
-
const payload = `${entries.map((e) => JSON.stringify(e)).join(`
|
|
3364
|
-
`)}
|
|
3365
|
-
`;
|
|
3366
|
-
let fd = null;
|
|
3367
|
-
try {
|
|
3368
|
-
fd = openSync(tmpPath, "w");
|
|
3369
|
-
writeFileSync2(fd, payload);
|
|
3370
|
-
fsyncSync(fd);
|
|
3371
|
-
closeSync(fd);
|
|
3372
|
-
fd = null;
|
|
3373
|
-
renameSync(tmpPath, filePath);
|
|
3374
|
-
fsyncDirectoryBestEffort(dir);
|
|
3375
|
-
} catch (err) {
|
|
3376
|
-
if (fd !== null) {
|
|
3377
|
-
try {
|
|
3378
|
-
closeSync(fd);
|
|
3379
|
-
} catch {}
|
|
3380
|
-
}
|
|
3381
|
-
try {
|
|
3382
|
-
unlinkSync2(tmpPath);
|
|
3383
|
-
} catch {}
|
|
3384
|
-
throw err;
|
|
3385
|
-
}
|
|
3386
|
-
}
|
|
3387
|
-
function fsyncDirectoryBestEffort(dir) {
|
|
3388
|
-
let fd = null;
|
|
3389
|
-
try {
|
|
3390
|
-
fd = openSync(dir, "r");
|
|
3391
|
-
fsyncSync(fd);
|
|
3392
|
-
} catch {} finally {
|
|
3393
|
-
if (fd !== null) {
|
|
3394
|
-
try {
|
|
3395
|
-
closeSync(fd);
|
|
3396
|
-
} catch {}
|
|
3397
|
-
}
|
|
3398
|
-
}
|
|
3399
|
-
}
|
|
3400
|
-
|
|
3401
|
-
// ../../packages/core/src/agents/rollout/codex.ts
|
|
3402
3398
|
function codexSessionsDir() {
|
|
3403
3399
|
return join4(hostedCodexHomePath(), "sessions");
|
|
3404
3400
|
}
|
|
@@ -3465,7 +3461,7 @@ function patchEnvContext(envContext, cwd, currentDate, timezone) {
|
|
|
3465
3461
|
}
|
|
3466
3462
|
}
|
|
3467
3463
|
function codexRolloutPath(threadId, fallback) {
|
|
3468
|
-
const threadCreatedAt =
|
|
3464
|
+
const threadCreatedAt = decodeUuidV7Timestamp2(threadId);
|
|
3469
3465
|
const createdAt = threadCreatedAt === null ? fallback : new Date(threadCreatedAt);
|
|
3470
3466
|
const yyyy = String(createdAt.getFullYear());
|
|
3471
3467
|
const mm = String(createdAt.getMonth() + 1).padStart(2, "0");
|
|
@@ -3537,7 +3533,7 @@ function changedPatchLines(value) {
|
|
|
3537
3533
|
`) } : {}
|
|
3538
3534
|
};
|
|
3539
3535
|
}
|
|
3540
|
-
function
|
|
3536
|
+
function extractLatestCodexPatchPreview2(jsonl, expectedPaths, consumedCallIds = new Set, expectedCallId) {
|
|
3541
3537
|
const expected = expectedPaths.map(canonicalFilePath);
|
|
3542
3538
|
const lines = jsonl.trimEnd().split(`
|
|
3543
3539
|
`);
|
|
@@ -3574,7 +3570,7 @@ function extractLatestCodexPatchPreview(jsonl, expectedPaths, consumedCallIds =
|
|
|
3574
3570
|
}
|
|
3575
3571
|
return;
|
|
3576
3572
|
}
|
|
3577
|
-
function
|
|
3573
|
+
function extractCodexPatchCallIds2(jsonl) {
|
|
3578
3574
|
const callIds = [];
|
|
3579
3575
|
for (const line of jsonl.trimEnd().split(`
|
|
3580
3576
|
`)) {
|
|
@@ -3587,29 +3583,29 @@ function extractCodexPatchCallIds(jsonl) {
|
|
|
3587
3583
|
}
|
|
3588
3584
|
return callIds;
|
|
3589
3585
|
}
|
|
3590
|
-
function
|
|
3586
|
+
function readCodexPatchCallIds2(threadId) {
|
|
3591
3587
|
const path = latestCodexRolloutPath(threadId);
|
|
3592
3588
|
if (!path)
|
|
3593
3589
|
return [];
|
|
3594
3590
|
try {
|
|
3595
|
-
return
|
|
3591
|
+
return extractCodexPatchCallIds2(readFileSync3(path, "utf8"));
|
|
3596
3592
|
} catch (error) {
|
|
3597
3593
|
logger.debug({ error, threadId }, "codex patch ids: rollout read failed");
|
|
3598
3594
|
return [];
|
|
3599
3595
|
}
|
|
3600
3596
|
}
|
|
3601
|
-
function
|
|
3597
|
+
function readLatestCodexPatchPreview2(threadId, expectedPaths, consumedCallIds = new Set, expectedCallId) {
|
|
3602
3598
|
const path = latestCodexRolloutPath(threadId);
|
|
3603
3599
|
if (!path)
|
|
3604
3600
|
return;
|
|
3605
3601
|
try {
|
|
3606
|
-
return
|
|
3602
|
+
return extractLatestCodexPatchPreview2(readFileSync3(path, "utf8"), expectedPaths, consumedCallIds, expectedCallId);
|
|
3607
3603
|
} catch (error) {
|
|
3608
3604
|
logger.debug({ error, threadId }, "codex patch preview: rollout read failed");
|
|
3609
3605
|
return;
|
|
3610
3606
|
}
|
|
3611
3607
|
}
|
|
3612
|
-
function
|
|
3608
|
+
function extractLatestCodexContextUsage2(jsonl) {
|
|
3613
3609
|
const lines = jsonl.trimEnd().split(`
|
|
3614
3610
|
`);
|
|
3615
3611
|
for (let index = lines.length - 1;index >= 0; index -= 1) {
|
|
@@ -3626,18 +3622,18 @@ function extractLatestCodexContextUsage(jsonl) {
|
|
|
3626
3622
|
}
|
|
3627
3623
|
return;
|
|
3628
3624
|
}
|
|
3629
|
-
function
|
|
3625
|
+
function readLatestCodexContextUsage2(threadId) {
|
|
3630
3626
|
const path = latestCodexRolloutPath(threadId);
|
|
3631
3627
|
if (!path)
|
|
3632
3628
|
return;
|
|
3633
3629
|
try {
|
|
3634
|
-
return
|
|
3630
|
+
return extractLatestCodexContextUsage2(readFileSync3(path, "utf8"));
|
|
3635
3631
|
} catch (error) {
|
|
3636
3632
|
logger.debug({ error, threadId }, "codex context usage: rollout read failed");
|
|
3637
3633
|
return;
|
|
3638
3634
|
}
|
|
3639
3635
|
}
|
|
3640
|
-
function
|
|
3636
|
+
function migrateCodexRolloutNativeMultiAgentMetadata2(threadId) {
|
|
3641
3637
|
const path = latestCodexRolloutPath(threadId);
|
|
3642
3638
|
if (!path)
|
|
3643
3639
|
return false;
|
|
@@ -3692,11 +3688,11 @@ function latestCodexRolloutPath(threadId) {
|
|
|
3692
3688
|
return;
|
|
3693
3689
|
}
|
|
3694
3690
|
}
|
|
3695
|
-
function
|
|
3691
|
+
function writeCodexRollout2(opts) {
|
|
3696
3692
|
const threadId = opts.threadId ?? uuidv7();
|
|
3697
3693
|
assertUuidLike("threadId", threadId);
|
|
3698
3694
|
ensureCwdExists(opts.cwd);
|
|
3699
|
-
const pairs = opts.pairs ??
|
|
3695
|
+
const pairs = opts.pairs ?? extractChatPairs2(opts.entries ?? []);
|
|
3700
3696
|
const now = new Date;
|
|
3701
3697
|
const tsIso = now.toISOString();
|
|
3702
3698
|
const currentDate = [
|
|
@@ -3845,7 +3841,7 @@ var MAX_DAY_SPAN = 30;
|
|
|
3845
3841
|
var DAY_MS = 86400000;
|
|
3846
3842
|
var LOCAL_DATE_SKEW_DAYS = 1;
|
|
3847
3843
|
function candidateDateBuckets(threadId) {
|
|
3848
|
-
const tidMs =
|
|
3844
|
+
const tidMs = decodeUuidV7Timestamp2(threadId);
|
|
3849
3845
|
if (tidMs === null)
|
|
3850
3846
|
return null;
|
|
3851
3847
|
const nowMs = Date.now();
|
|
@@ -3862,7 +3858,7 @@ function candidateDateBuckets(threadId) {
|
|
|
3862
3858
|
}
|
|
3863
3859
|
return buckets;
|
|
3864
3860
|
}
|
|
3865
|
-
function
|
|
3861
|
+
function decodeUuidV7Timestamp2(threadId) {
|
|
3866
3862
|
if (typeof threadId !== "string")
|
|
3867
3863
|
return null;
|
|
3868
3864
|
const m = /^([0-9a-fA-F]{8})-([0-9a-fA-F]{4})-7[0-9a-fA-F]{3}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/.exec(threadId);
|
|
@@ -3885,6 +3881,6 @@ function formatDateBucket(d) {
|
|
|
3885
3881
|
return `${yyyy}/${mm}/${dd}`;
|
|
3886
3882
|
}
|
|
3887
3883
|
|
|
3888
|
-
export {
|
|
3884
|
+
export { CLAUDE_EFFORT_VALUES, CODEX_EFFORT_VALUES, MAESTRO_EFFORT_VALUES, logger, MODEL_SONNET, MODEL_OPUS, MODEL_FABLE, configureRolloutHost2, FIXTURES_DIR, clone, assertUuidLike, ensureCwdExists, extractChatPairs2, parseJsonlText, writeJsonlFile, hostedCodexHomePath, extractLatestCodexPatchPreview2, extractCodexPatchCallIds2, readCodexPatchCallIds2, readLatestCodexPatchPreview2, extractLatestCodexContextUsage2, readLatestCodexContextUsage2, migrateCodexRolloutNativeMultiAgentMetadata2, latestCodexRolloutPath, writeCodexRollout2, decodeUuidV7Timestamp2 };
|
|
3889
3885
|
|
|
3890
|
-
//# debugId=
|
|
3886
|
+
//# debugId=D6748D5B00827E4364756E2164756E21
|