negotium 0.12.0 → 0.12.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 (34) hide show
  1. package/dist/agent-helpers.js +14 -7
  2. package/dist/agent-helpers.js.map +8 -8
  3. package/dist/{chunk-tvx2tm5q.js → chunk-bw6mrsc6.js} +3 -3
  4. package/dist/{chunk-tvx2tm5q.js.map → chunk-bw6mrsc6.js.map} +2 -2
  5. package/dist/{chunk-4drjv7x2.js → chunk-jz4jf6t1.js} +5 -1
  6. package/dist/{chunk-4drjv7x2.js.map → chunk-jz4jf6t1.js.map} +4 -4
  7. package/dist/{chunk-q1fta5e3.js → chunk-v9vh52nc.js} +1 -1
  8. package/dist/hosted-agent.js +6 -2
  9. package/dist/hosted-agent.js.map +5 -5
  10. package/dist/main.js +17 -7
  11. package/dist/main.js.map +11 -11
  12. package/dist/mcp-factories.js +15 -7
  13. package/dist/mcp-factories.js.map +9 -9
  14. package/dist/query-runtime.js +2 -2
  15. package/dist/query-runtime.js.map +3 -3
  16. package/dist/registry.js +3 -3
  17. package/dist/rollout.js +2 -2
  18. package/dist/runtime/src/mcp/runtime-spec.ts +12 -0
  19. package/dist/runtime/src/mcp/session-comm/context.ts +3 -0
  20. package/dist/runtime/src/mcp/session-comm/default-host.ts +3 -0
  21. package/dist/runtime/src/platform/mcp-config.ts +6 -0
  22. package/dist/runtime/src/query/active-rooms.ts +3 -0
  23. package/dist/runtime/src/runtime/ask-callbacks.ts +2 -0
  24. package/dist/runtime/src/runtime/inbox.ts +9 -0
  25. package/dist/runtime/src/runtime/turn-runner.ts +24 -2
  26. package/dist/runtime/src/version.ts +1 -1
  27. package/dist/types/packages/core/src/mcp/runtime-spec.d.ts +8 -0
  28. package/dist/types/packages/core/src/mcp/session-comm/context.d.ts +2 -0
  29. package/dist/types/packages/core/src/query/active-rooms.d.ts +2 -0
  30. package/dist/types/packages/core/src/runtime/ask-callbacks.d.ts +2 -0
  31. package/dist/types/packages/core/src/runtime/turn-runner.d.ts +1 -0
  32. package/dist/types/packages/core/src/version.d.ts +1 -1
  33. package/package.json +1 -1
  34. /package/dist/{chunk-q1fta5e3.js.map → chunk-v9vh52nc.js.map} +0 -0
@@ -552,6 +552,7 @@ function hostedMcpCacheIdentity(surface, ctx) {
552
552
  depth: ctx.depth ?? 0,
553
553
  silent: ctx.silent ?? false,
554
554
  agent: ctx.agent,
555
+ threadRootId: ctx.threadRootId ?? null,
555
556
  peerBridge: ctx.peerBridge ?? null
556
557
  };
557
558
  break;
@@ -924,6 +925,7 @@ function buildBuiltinMcpServer(surface, ctx, stdio) {
924
925
  ...ctx.queryId ? { queryId: ctx.queryId } : {},
925
926
  ...ctx.wikiTopicId ? { wikiTopicId: ctx.wikiTopicId } : {},
926
927
  ...ctx.subagentParentTopicId ? { subagentParentTopicId: ctx.subagentParentTopicId } : {},
928
+ ...ctx.threadRootId ? { threadRootId: ctx.threadRootId } : {},
927
929
  cwd: ctx.cwd ?? (ctx.topicId ? resolveTopicWorkspaceDir(ctx.topicId) : process.cwd()),
928
930
  agent,
929
931
  ...ctx.model ? { model: ctx.model } : {},
@@ -1354,6 +1356,7 @@ var init_mcp_config = __esm(() => {
1354
1356
  agent,
1355
1357
  depth = 0,
1356
1358
  silent,
1359
+ threadRootId,
1357
1360
  peerBridge
1358
1361
  } = ctx;
1359
1362
  const effectiveAgent = agent ?? FALLBACK_AGENT;
@@ -1367,6 +1370,7 @@ var init_mcp_config = __esm(() => {
1367
1370
  `--agent=${effectiveAgent}`,
1368
1371
  ...cronSessionId ? [`--cron-session-id=${cronSessionId}`] : [],
1369
1372
  ...silent ? ["--reply-only=true"] : [],
1373
+ ...threadRootId ? [`--thread-root-id=${threadRootId}`] : [],
1370
1374
  ...peerBridge ? [`--peer-host-query-id=${peerBridge.hostQueryId}`] : []
1371
1375
  ];
1372
1376
  return buildBuiltinMcpServer("session-comm", ctx, () => buildStdioMcpServer(effectiveAgent, SESSION_COMM_SERVER, args, peerBridge ? peerSessionBridgeIpcEnv() : undefined));
@@ -3057,7 +3061,7 @@ var init_codex = __esm(async () => {
3057
3061
  });
3058
3062
 
3059
3063
  // ../../packages/core/src/version.ts
3060
- var NEGOTIUM_VERSION = "0.12.0";
3064
+ var NEGOTIUM_VERSION = "0.12.2";
3061
3065
 
3062
3066
  // ../../packages/core/src/agents/codex-native-multi-agent.ts
3063
3067
  import { spawn as spawn2 } from "child_process";
@@ -9516,7 +9520,7 @@ class InterSessionQueue {
9516
9520
  const base = bucket.items[bucket.head];
9517
9521
  const isAskReplyInject = (e) => !e.silent && Boolean(e.askReplySources?.length);
9518
9522
  const baseIsAskReplyInject = isAskReplyInject(base);
9519
- const mergeable = (e) => (baseIsAskReplyInject ? isAskReplyInject(e) : !isAskReplyInject(e) && e.origin === base.origin && (e.silent ?? false) === (base.silent ?? false)) && e.onDispatched !== undefined === (base.onDispatched !== undefined) && (e.agentOverride ?? null) === (base.agentOverride ?? null) && (e.modelOverride ?? null) === (base.modelOverride ?? null) && (e.effortOverride ?? null) === (base.effortOverride ?? null) && (e.runtimeEpoch ?? 0) === (base.runtimeEpoch ?? 0) && (e.sessionId ?? null) === (base.sessionId ?? null) && (e.forkHandle?.forkId ?? null) === (base.forkHandle?.forkId ?? null) && (e.prepareSession ?? null) === (base.prepareSession ?? null) && (e.cwd ?? null) === (base.cwd ?? null) && (e.sessionName ?? null) === (base.sessionName ?? null) && (e.sessionType ?? null) === (base.sessionType ?? null) && (e.onSessionId ?? null) === (base.onSessionId ?? null) && (e.onSessionReset ?? null) === (base.onSessionReset ?? null) && (e.bridgeSessionFromHistory ?? false) === (base.bridgeSessionFromHistory ?? false) && (e.onSettled ?? null) === (base.onSettled ?? null);
9523
+ const mergeable = (e) => (baseIsAskReplyInject ? isAskReplyInject(e) : !isAskReplyInject(e) && e.origin === base.origin && (e.silent ?? false) === (base.silent ?? false)) && (e.threadRootId ?? null) === (base.threadRootId ?? null) && e.onDispatched !== undefined === (base.onDispatched !== undefined) && (e.agentOverride ?? null) === (base.agentOverride ?? null) && (e.modelOverride ?? null) === (base.modelOverride ?? null) && (e.effortOverride ?? null) === (base.effortOverride ?? null) && (e.runtimeEpoch ?? 0) === (base.runtimeEpoch ?? 0) && (e.sessionId ?? null) === (base.sessionId ?? null) && (e.forkHandle?.forkId ?? null) === (base.forkHandle?.forkId ?? null) && (e.prepareSession ?? null) === (base.prepareSession ?? null) && (e.cwd ?? null) === (base.cwd ?? null) && (e.sessionName ?? null) === (base.sessionName ?? null) && (e.sessionType ?? null) === (base.sessionType ?? null) && (e.onSessionId ?? null) === (base.onSessionId ?? null) && (e.onSessionReset ?? null) === (base.onSessionReset ?? null) && (e.bridgeSessionFromHistory ?? false) === (base.bridgeSessionFromHistory ?? false) && (e.onSettled ?? null) === (base.onSettled ?? null);
9520
9524
  let end = bucket.head + 1;
9521
9525
  while (end < bucket.items.length && mergeable(bucket.items[end]))
9522
9526
  end++;
@@ -17104,7 +17108,7 @@ function notifyPlaywrightUnavailable(topicId) {
17104
17108
  appendSystemMessage(topicId, "Playwright browser tools are unavailable this turn. Browser automation was removed from the tool catalog; retry shortly if browser interaction is required.");
17105
17109
  WsHub.get().broadcastTopicNotice(topicId, "info", "Playwright \uC0AC\uC6A9 \uBD88\uAC00");
17106
17110
  }
17107
- function appendAskReplyMessage(topicId, text2, sourceLabel, body, kind, agentType) {
17111
+ function appendAskReplyMessage(topicId, text2, sourceLabel, body, kind, agentType, threadRootId) {
17108
17112
  const message = {
17109
17113
  id: randomUUID16(),
17110
17114
  topicId,
@@ -17117,6 +17121,7 @@ function appendAskReplyMessage(topicId, text2, sourceLabel, body, kind, agentTyp
17117
17121
  message: body
17118
17122
  },
17119
17123
  ...agentType ? { agentType } : {},
17124
+ ...threadRootId ? { threadRootId } : {},
17120
17125
  createdAt: new Date().toISOString()
17121
17126
  };
17122
17127
  appendApiMessage(message, { notify: false });
@@ -17198,6 +17203,7 @@ function redispatchInject(inject) {
17198
17203
  depth: inject.depth,
17199
17204
  silent: inject.silent,
17200
17205
  contextId: inject.contextId,
17206
+ ...inject.threadRootId ? { threadRootId: inject.threadRootId } : {},
17201
17207
  agentOverride: inject.agentOverride,
17202
17208
  modelOverride: inject.modelOverride,
17203
17209
  effortOverride: inject.effortOverride,
@@ -17258,7 +17264,7 @@ ${body}`;
17258
17264
  await markPendingAskFile(pending, "reply_ready");
17259
17265
  if (!callerTopic?.agent) {
17260
17266
  try {
17261
- appendAskReplyMessage(pending.callerTopicId, prompt, sourceLabel, body, kind);
17267
+ appendAskReplyMessage(pending.callerTopicId, prompt, sourceLabel, body, kind, undefined, pending.callerThreadRootId);
17262
17268
  await clearPendingAskFile(pending);
17263
17269
  return true;
17264
17270
  } catch (err2) {
@@ -17269,6 +17275,7 @@ ${body}`;
17269
17275
  const queued = askReplyInjectBatcher.enqueue({
17270
17276
  topicId: pending.callerTopicId,
17271
17277
  userId: pending.callerUserId,
17278
+ ...pending.callerThreadRootId ? { threadRootId: pending.callerThreadRootId } : {},
17272
17279
  prompt,
17273
17280
  origin: sourceLabel,
17274
17281
  requestId: pending.requestId,
@@ -17288,7 +17295,7 @@ ${body}`;
17288
17295
  }
17289
17296
  });
17290
17297
  if (queued) {
17291
- appendAskReplyMessage(pending.callerTopicId, prompt, sourceLabel, body, kind, callerTopic.agent);
17298
+ appendAskReplyMessage(pending.callerTopicId, prompt, sourceLabel, body, kind, callerTopic.agent, pending.callerThreadRootId);
17292
17299
  await markPendingAskFile(pending, "queued_for_caller");
17293
17300
  return true;
17294
17301
  }
@@ -17297,7 +17304,7 @@ ${body}`;
17297
17304
  return true;
17298
17305
  }
17299
17306
  logger.warn({ requestId: pending.requestId, callerTopicId: pending.callerTopicId, source: sourceLabel }, "sessions: ask callback could not enter caller batch; appending direct fallback");
17300
- appendAskReplyMessage(pending.callerTopicId, prompt, sourceLabel, body, kind, callerTopic.agent);
17307
+ appendAskReplyMessage(pending.callerTopicId, prompt, sourceLabel, body, kind, callerTopic.agent, pending.callerThreadRootId);
17301
17308
  await clearPendingAskFile(pending);
17302
17309
  return true;
17303
17310
  }
@@ -20325,4 +20332,4 @@ export {
20325
20332
  DEFAULT_SELF_CONFIG_PRODUCT
20326
20333
  };
20327
20334
 
20328
- //# debugId=BC9A0D1B93E3165264756E2164756E21
20335
+ //# debugId=B016EB0E277AFC1F64756E2164756E21