negotium 0.1.30 → 0.1.31

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.
@@ -1515,28 +1515,11 @@ function extractLatestCodexContextUsage(jsonl) {
1515
1515
  return;
1516
1516
  }
1517
1517
  function readLatestCodexContextUsage(threadId) {
1518
- const sessionsDir = codexSessionsDir();
1519
- const candidates = [];
1520
- const buckets = candidateDateBuckets(threadId);
1518
+ const path = latestCodexRolloutPath(threadId);
1519
+ if (!path)
1520
+ return;
1521
1521
  try {
1522
- if (buckets) {
1523
- for (const bucket of buckets) {
1524
- const dir = join7(sessionsDir, bucket);
1525
- if (!existsSync5(dir))
1526
- continue;
1527
- const glob = new Bun.Glob(`rollout-*-${threadId}.jsonl`);
1528
- for (const rel of glob.scanSync({ cwd: dir, onlyFiles: true })) {
1529
- candidates.push(join7(dir, rel));
1530
- }
1531
- }
1532
- } else {
1533
- const glob = new Bun.Glob(`**/rollout-*-${threadId}.jsonl`);
1534
- for (const rel of glob.scanSync({ cwd: sessionsDir, onlyFiles: true })) {
1535
- candidates.push(join7(sessionsDir, rel));
1536
- }
1537
- }
1538
- const path = candidates.sort((a, b) => statSync2(b).mtimeMs - statSync2(a).mtimeMs)[0];
1539
- return path ? extractLatestCodexContextUsage(readFileSync4(path, "utf8")) : undefined;
1522
+ return extractLatestCodexContextUsage(readFileSync4(path, "utf8"));
1540
1523
  } catch (error) {
1541
1524
  logger.debug({ error, threadId }, "codex context usage: rollout read failed");
1542
1525
  return;
@@ -2739,11 +2722,10 @@ var MCP_CATALOG = {
2739
2722
  },
2740
2723
  "background-bash": {
2741
2724
  ...commonRuntimeMcpPolicy("background-bash"),
2742
- build({ agent, bgBashPort, userId, topicId, session }) {
2743
- const topic = topicId ?? session;
2744
- if (bgBashPort === undefined || !topic)
2725
+ build({ agent, bgBashPort, userId, topicId }) {
2726
+ if (bgBashPort === undefined || !topicId)
2745
2727
  return null;
2746
- return backgroundBashTransport(agent, bgBashPort, userId, topic);
2728
+ return backgroundBashTransport(agent, bgBashPort, userId, topicId);
2747
2729
  }
2748
2730
  },
2749
2731
  "agent-health": {
@@ -3537,7 +3519,7 @@ import { tmpdir } from "os";
3537
3519
  import { dirname as dirname7, join as join11 } from "path";
3538
3520
 
3539
3521
  // ../../packages/core/src/version.ts
3540
- var NEGOTIUM_VERSION = "0.1.30";
3522
+ var NEGOTIUM_VERSION = "0.1.31";
3541
3523
 
3542
3524
  // ../../packages/core/src/agents/codex-native-multi-agent.ts
3543
3525
  var moduleRequire = createRequire(import.meta.url);
@@ -5200,7 +5182,11 @@ function isEphemeralWikiTopicId(topicId) {
5200
5182
  return topicId?.startsWith("__") ?? false;
5201
5183
  }
5202
5184
  function wikiSummaryStorageSlug(rawTopic, topicId) {
5203
- return topicId && !isEphemeralWikiTopicId(topicId) ? wikiSummarySlug(topicId) : wikiSummarySlug(rawTopic);
5185
+ const titleSlug = wikiSummarySlug(rawTopic);
5186
+ if (!topicId || isEphemeralWikiTopicId(topicId))
5187
+ return titleSlug;
5188
+ const idSlug = wikiSummarySlug(topicId);
5189
+ return titleSlug === idSlug ? idSlug : `${titleSlug}--${idSlug}`;
5204
5190
  }
5205
5191
  function wikiSummaryFilename(date, rawTopic, topicId) {
5206
5192
  return `${date}-${wikiSummaryStorageSlug(rawTopic, topicId)}.md`;
@@ -6883,4 +6869,4 @@ export {
6883
6869
  MIN_MEMORY_ARCHIVE_EXCHANGES
6884
6870
  };
6885
6871
 
6886
- //# debugId=CC442F5FF6F506FC64756E2164756E21
6872
+ //# debugId=F639F58BC810D1BD64756E2164756E21