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
@@ -1245,6 +1245,7 @@ function hostedMcpCacheIdentity(surface, ctx) {
1245
1245
  depth: ctx.depth ?? 0,
1246
1246
  silent: ctx.silent ?? false,
1247
1247
  agent: ctx.agent,
1248
+ threadRootId: ctx.threadRootId ?? null,
1248
1249
  peerBridge: ctx.peerBridge ?? null
1249
1250
  };
1250
1251
  break;
@@ -1617,6 +1618,7 @@ function buildBuiltinMcpServer(surface, ctx, stdio) {
1617
1618
  ...ctx.queryId ? { queryId: ctx.queryId } : {},
1618
1619
  ...ctx.wikiTopicId ? { wikiTopicId: ctx.wikiTopicId } : {},
1619
1620
  ...ctx.subagentParentTopicId ? { subagentParentTopicId: ctx.subagentParentTopicId } : {},
1621
+ ...ctx.threadRootId ? { threadRootId: ctx.threadRootId } : {},
1620
1622
  cwd: ctx.cwd ?? (ctx.topicId ? resolveTopicWorkspaceDir(ctx.topicId) : process.cwd()),
1621
1623
  agent,
1622
1624
  ...ctx.model ? { model: ctx.model } : {},
@@ -2047,6 +2049,7 @@ var init_mcp_config = __esm(() => {
2047
2049
  agent,
2048
2050
  depth = 0,
2049
2051
  silent,
2052
+ threadRootId,
2050
2053
  peerBridge
2051
2054
  } = ctx;
2052
2055
  const effectiveAgent = agent ?? FALLBACK_AGENT;
@@ -2060,6 +2063,7 @@ var init_mcp_config = __esm(() => {
2060
2063
  `--agent=${effectiveAgent}`,
2061
2064
  ...cronSessionId ? [`--cron-session-id=${cronSessionId}`] : [],
2062
2065
  ...silent ? ["--reply-only=true"] : [],
2066
+ ...threadRootId ? [`--thread-root-id=${threadRootId}`] : [],
2063
2067
  ...peerBridge ? [`--peer-host-query-id=${peerBridge.hostQueryId}`] : []
2064
2068
  ];
2065
2069
  return buildBuiltinMcpServer("session-comm", ctx, () => buildStdioMcpServer(effectiveAgent, SESSION_COMM_SERVER, args, peerBridge ? peerSessionBridgeIpcEnv() : undefined));
@@ -3096,7 +3100,7 @@ var init_codex = __esm(async () => {
3096
3100
  });
3097
3101
 
3098
3102
  // ../../packages/core/src/version.ts
3099
- var NEGOTIUM_VERSION = "0.12.0";
3103
+ var NEGOTIUM_VERSION = "0.12.2";
3100
3104
 
3101
3105
  // ../../packages/core/src/agents/codex-native-multi-agent.ts
3102
3106
  import { spawn as spawn2 } from "child_process";
@@ -7366,7 +7370,7 @@ class InterSessionQueue {
7366
7370
  const base = bucket.items[bucket.head];
7367
7371
  const isAskReplyInject = (e) => !e.silent && Boolean(e.askReplySources?.length);
7368
7372
  const baseIsAskReplyInject = isAskReplyInject(base);
7369
- 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);
7373
+ 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);
7370
7374
  let end = bucket.head + 1;
7371
7375
  while (end < bucket.items.length && mergeable(bucket.items[end]))
7372
7376
  end++;
@@ -17092,7 +17096,7 @@ function notifyPlaywrightUnavailable(topicId) {
17092
17096
  appendSystemMessage(topicId, "Playwright browser tools are unavailable this turn. Browser automation was removed from the tool catalog; retry shortly if browser interaction is required.");
17093
17097
  WsHub.get().broadcastTopicNotice(topicId, "info", "Playwright \uC0AC\uC6A9 \uBD88\uAC00");
17094
17098
  }
17095
- function appendAskReplyMessage(topicId, text2, sourceLabel, body, kind, agentType) {
17099
+ function appendAskReplyMessage(topicId, text2, sourceLabel, body, kind, agentType, threadRootId) {
17096
17100
  const message = {
17097
17101
  id: randomUUID16(),
17098
17102
  topicId,
@@ -17105,6 +17109,7 @@ function appendAskReplyMessage(topicId, text2, sourceLabel, body, kind, agentTyp
17105
17109
  message: body
17106
17110
  },
17107
17111
  ...agentType ? { agentType } : {},
17112
+ ...threadRootId ? { threadRootId } : {},
17108
17113
  createdAt: new Date().toISOString()
17109
17114
  };
17110
17115
  appendApiMessage(message, { notify: false });
@@ -17186,6 +17191,7 @@ function redispatchInject(inject) {
17186
17191
  depth: inject.depth,
17187
17192
  silent: inject.silent,
17188
17193
  contextId: inject.contextId,
17194
+ ...inject.threadRootId ? { threadRootId: inject.threadRootId } : {},
17189
17195
  agentOverride: inject.agentOverride,
17190
17196
  modelOverride: inject.modelOverride,
17191
17197
  effortOverride: inject.effortOverride,
@@ -17246,7 +17252,7 @@ ${body}`;
17246
17252
  await markPendingAskFile(pending, "reply_ready");
17247
17253
  if (!callerTopic?.agent) {
17248
17254
  try {
17249
- appendAskReplyMessage(pending.callerTopicId, prompt, sourceLabel, body, kind);
17255
+ appendAskReplyMessage(pending.callerTopicId, prompt, sourceLabel, body, kind, undefined, pending.callerThreadRootId);
17250
17256
  await clearPendingAskFile(pending);
17251
17257
  return true;
17252
17258
  } catch (err) {
@@ -17257,6 +17263,7 @@ ${body}`;
17257
17263
  const queued = askReplyInjectBatcher.enqueue({
17258
17264
  topicId: pending.callerTopicId,
17259
17265
  userId: pending.callerUserId,
17266
+ ...pending.callerThreadRootId ? { threadRootId: pending.callerThreadRootId } : {},
17260
17267
  prompt,
17261
17268
  origin: sourceLabel,
17262
17269
  requestId: pending.requestId,
@@ -17276,7 +17283,7 @@ ${body}`;
17276
17283
  }
17277
17284
  });
17278
17285
  if (queued) {
17279
- appendAskReplyMessage(pending.callerTopicId, prompt, sourceLabel, body, kind, callerTopic.agent);
17286
+ appendAskReplyMessage(pending.callerTopicId, prompt, sourceLabel, body, kind, callerTopic.agent, pending.callerThreadRootId);
17280
17287
  await markPendingAskFile(pending, "queued_for_caller");
17281
17288
  return true;
17282
17289
  }
@@ -17285,7 +17292,7 @@ ${body}`;
17285
17292
  return true;
17286
17293
  }
17287
17294
  logger.warn({ requestId: pending.requestId, callerTopicId: pending.callerTopicId, source: sourceLabel }, "sessions: ask callback could not enter caller batch; appending direct fallback");
17288
- appendAskReplyMessage(pending.callerTopicId, prompt, sourceLabel, body, kind, callerTopic.agent);
17295
+ appendAskReplyMessage(pending.callerTopicId, prompt, sourceLabel, body, kind, callerTopic.agent, pending.callerThreadRootId);
17289
17296
  await clearPendingAskFile(pending);
17290
17297
  return true;
17291
17298
  }
@@ -19387,6 +19394,7 @@ function parseSessionCommContext(args, defaults) {
19387
19394
  userId: value(args, "user-id") ?? defaults.userId,
19388
19395
  currentTopic: value(args, "topic") ?? "",
19389
19396
  currentTopicId: value(args, "topic-id") || undefined,
19397
+ currentThreadRootId: value(args, "thread-root-id") || undefined,
19390
19398
  subagentParentTopicId: value(args, "subagent-parent-topic-id") || undefined,
19391
19399
  peerHostQueryId: value(args, "peer-host-query-id") || undefined,
19392
19400
  cronSessionId: value(args, "cron-session-id") || undefined,
@@ -22603,4 +22611,4 @@ export {
22603
22611
  createAgentHealthMcpServer
22604
22612
  };
22605
22613
 
22606
- //# debugId=C6EAEC3CD8A6025964756E2164756E21
22614
+ //# debugId=CCB6CFA80BA7C08F64756E2164756E21