negotium 0.22.0 → 0.22.2

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.
Files changed (42) hide show
  1. package/dist/agent-helpers.js +21 -5
  2. package/dist/agent-helpers.js.map +5 -5
  3. package/dist/background-bash.js +2 -2
  4. package/dist/background-bash.js.map +2 -2
  5. package/dist/browser-runtime.js +2 -2
  6. package/dist/browser-runtime.js.map +2 -2
  7. package/dist/{chunk-pvp197f1.js → chunk-9zn0bkc9.js} +2 -2
  8. package/dist/{chunk-pvp197f1.js.map → chunk-9zn0bkc9.js.map} +2 -2
  9. package/dist/{chunk-vtyyjgyn.js → chunk-bn1tt2qw.js} +1 -1
  10. package/dist/{chunk-bbwa785m.js → chunk-gzph93xn.js} +3 -3
  11. package/dist/{chunk-bbwa785m.js.map → chunk-gzph93xn.js.map} +2 -2
  12. package/dist/{chunk-zjz52hzq.js → chunk-kn8y5scr.js} +2 -2
  13. package/dist/{chunk-zjz52hzq.js.map → chunk-kn8y5scr.js.map} +4 -4
  14. package/dist/{chunk-e2bfvdaz.js → chunk-q5djsg78.js} +1 -1
  15. package/dist/hosted-agent.js +22 -6
  16. package/dist/hosted-agent.js.map +4 -4
  17. package/dist/main.js +21 -5
  18. package/dist/main.js.map +5 -5
  19. package/dist/mcp-factories.js +21 -5
  20. package/dist/mcp-factories.js.map +5 -5
  21. package/dist/media.js +2 -2
  22. package/dist/media.js.map +2 -2
  23. package/dist/prompts.js +2 -2
  24. package/dist/prompts.js.map +2 -2
  25. package/dist/query-runtime.js +2 -2
  26. package/dist/query-runtime.js.map +2 -2
  27. package/dist/registry.js +3 -3
  28. package/dist/rollout.js +2 -2
  29. package/dist/runtime/src/agents/rollout/codex.ts +30 -2
  30. package/dist/runtime/src/platform/config.ts +1 -1
  31. package/dist/runtime/src/version.ts +1 -1
  32. package/dist/runtime-helpers.js +2 -2
  33. package/dist/runtime-helpers.js.map +2 -2
  34. package/dist/types/packages/core/src/agents/rollout/codex.d.ts +3 -1
  35. package/dist/types/packages/core/src/platform/config.d.ts +1 -1
  36. package/dist/types/packages/core/src/version.d.ts +1 -1
  37. package/dist/vault.js +2 -2
  38. package/dist/vault.js.map +2 -2
  39. package/install-browser-rs.mjs +4 -4
  40. package/package.json +1 -1
  41. /package/dist/{chunk-vtyyjgyn.js.map → chunk-bn1tt2qw.js.map} +0 -0
  42. /package/dist/{chunk-e2bfvdaz.js.map → chunk-q5djsg78.js.map} +0 -0
@@ -96,7 +96,7 @@ import {
96
96
  resolveBrowserRsBin,
97
97
  resolveOutputLanguage,
98
98
  resolveTopicWorkspaceDir
99
- } from "./chunk-pvp197f1.js";
99
+ } from "./chunk-9zn0bkc9.js";
100
100
  import"./chunk-2mx7fq49.js";
101
101
  export {
102
102
  resolveTopicWorkspaceDir,
@@ -42,7 +42,7 @@ import {
42
42
  logger,
43
43
  resolveFallbackAgent,
44
44
  resolveTopicWorkspaceDir
45
- } from "./chunk-pvp197f1.js";
45
+ } from "./chunk-9zn0bkc9.js";
46
46
  import {
47
47
  __require
48
48
  } from "./chunk-2mx7fq49.js";
@@ -3581,7 +3581,7 @@ import { tmpdir } from "os";
3581
3581
  import { dirname as dirname5, join as join3 } from "path";
3582
3582
 
3583
3583
  // ../../packages/core/src/version.ts
3584
- var NEGOTIUM_VERSION = "0.22.0";
3584
+ var NEGOTIUM_VERSION = "0.22.2";
3585
3585
 
3586
3586
  // ../../packages/core/src/agents/codex-native-multi-agent.ts
3587
3587
  var moduleRequire = createRequire(import.meta.url);
@@ -4310,7 +4310,7 @@ async function createCodexVaultHookBridge(userId) {
4310
4310
  });
4311
4311
  restrictIpcEndpoint(socketPath);
4312
4312
  if (IS_WINDOWS2) {
4313
- const { BINARIES_DIR } = await import("./chunk-e2bfvdaz.js");
4313
+ const { BINARIES_DIR } = await import("./chunk-q5djsg78.js");
4314
4314
  const cached = await ensureCodexWindowsWrapperExe(join5(BINARIES_DIR, "codex-hook-wrapper"));
4315
4315
  await copyFile(cached, wrapperPath);
4316
4316
  await writeFile2(join5(root, "codex-with-hooks.cfg"), [process.execPath, codexCliScriptPath(), socketPath, token].join(`
@@ -4551,12 +4551,28 @@ function readLatestCodexContextUsage(threadId) {
4551
4551
  return;
4552
4552
  }
4553
4553
  }
4554
- function readLatestCodexTokenTotals(threadId) {
4554
+ function extractCodexForkedFromId(jsonl) {
4555
+ const newline = jsonl.indexOf(`
4556
+ `);
4557
+ try {
4558
+ const entry = JSON.parse(newline < 0 ? jsonl : jsonl.slice(0, newline));
4559
+ const id = entry.type === "session_meta" ? entry.payload?.forked_from_id : undefined;
4560
+ return typeof id === "string" && id ? id : undefined;
4561
+ } catch {
4562
+ return;
4563
+ }
4564
+ }
4565
+ function readLatestCodexTokenTotals(threadId, depth = 0) {
4555
4566
  const path = latestCodexRolloutPath(threadId);
4556
4567
  if (!path)
4557
4568
  return;
4558
4569
  try {
4559
- return extractLatestCodexTokenTotals(readFileSync4(path, "utf8"));
4570
+ const jsonl = readFileSync4(path, "utf8");
4571
+ const totals = extractLatestCodexTokenTotals(jsonl);
4572
+ if (totals || depth >= 8)
4573
+ return totals;
4574
+ const parentId = extractCodexForkedFromId(jsonl);
4575
+ return parentId && parentId !== threadId ? readLatestCodexTokenTotals(parentId, depth + 1) : undefined;
4560
4576
  } catch (error) {
4561
4577
  logger.debug({ error, threadId }, "codex token totals: rollout read failed");
4562
4578
  return;
@@ -5624,4 +5640,4 @@ export {
5624
5640
  buildClaudeDisallowedTools
5625
5641
  };
5626
5642
 
5627
- //# debugId=E0454C764C54C4BD64756E2164756E21
5643
+ //# debugId=EB04BDE8A56D649664756E2164756E21