negotium 0.12.0 → 0.12.1

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 (32) hide show
  1. package/dist/agent-helpers.js +12 -7
  2. package/dist/agent-helpers.js.map +7 -7
  3. package/dist/{chunk-4drjv7x2.js → chunk-547drc5t.js} +3 -1
  4. package/dist/{chunk-4drjv7x2.js.map → chunk-547drc5t.js.map} +3 -3
  5. package/dist/{chunk-tvx2tm5q.js → chunk-xc9x7xww.js} +3 -3
  6. package/dist/{chunk-tvx2tm5q.js.map → chunk-xc9x7xww.js.map} +2 -2
  7. package/dist/{chunk-q1fta5e3.js → chunk-xze4zxfq.js} +1 -1
  8. package/dist/hosted-agent.js +4 -2
  9. package/dist/hosted-agent.js.map +4 -4
  10. package/dist/main.js +14 -7
  11. package/dist/main.js.map +9 -9
  12. package/dist/mcp-factories.js +13 -7
  13. package/dist/mcp-factories.js.map +8 -8
  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/session-comm/context.ts +3 -0
  19. package/dist/runtime/src/mcp/session-comm/default-host.ts +3 -0
  20. package/dist/runtime/src/platform/mcp-config.ts +5 -0
  21. package/dist/runtime/src/query/active-rooms.ts +3 -0
  22. package/dist/runtime/src/runtime/ask-callbacks.ts +2 -0
  23. package/dist/runtime/src/runtime/inbox.ts +9 -0
  24. package/dist/runtime/src/runtime/turn-runner.ts +24 -2
  25. package/dist/runtime/src/version.ts +1 -1
  26. package/dist/types/packages/core/src/mcp/session-comm/context.d.ts +2 -0
  27. package/dist/types/packages/core/src/query/active-rooms.d.ts +2 -0
  28. package/dist/types/packages/core/src/runtime/ask-callbacks.d.ts +2 -0
  29. package/dist/types/packages/core/src/runtime/turn-runner.d.ts +1 -0
  30. package/dist/types/packages/core/src/version.d.ts +1 -1
  31. package/package.json +1 -1
  32. /package/dist/{chunk-q1fta5e3.js.map → chunk-xze4zxfq.js.map} +0 -0
@@ -1354,6 +1354,7 @@ var init_mcp_config = __esm(() => {
1354
1354
  agent,
1355
1355
  depth = 0,
1356
1356
  silent,
1357
+ threadRootId,
1357
1358
  peerBridge
1358
1359
  } = ctx;
1359
1360
  const effectiveAgent = agent ?? FALLBACK_AGENT;
@@ -1367,6 +1368,7 @@ var init_mcp_config = __esm(() => {
1367
1368
  `--agent=${effectiveAgent}`,
1368
1369
  ...cronSessionId ? [`--cron-session-id=${cronSessionId}`] : [],
1369
1370
  ...silent ? ["--reply-only=true"] : [],
1371
+ ...threadRootId ? [`--thread-root-id=${threadRootId}`] : [],
1370
1372
  ...peerBridge ? [`--peer-host-query-id=${peerBridge.hostQueryId}`] : []
1371
1373
  ];
1372
1374
  return buildBuiltinMcpServer("session-comm", ctx, () => buildStdioMcpServer(effectiveAgent, SESSION_COMM_SERVER, args, peerBridge ? peerSessionBridgeIpcEnv() : undefined));
@@ -3057,7 +3059,7 @@ var init_codex = __esm(async () => {
3057
3059
  });
3058
3060
 
3059
3061
  // ../../packages/core/src/version.ts
3060
- var NEGOTIUM_VERSION = "0.12.0";
3062
+ var NEGOTIUM_VERSION = "0.12.1";
3061
3063
 
3062
3064
  // ../../packages/core/src/agents/codex-native-multi-agent.ts
3063
3065
  import { spawn as spawn2 } from "child_process";
@@ -9516,7 +9518,7 @@ class InterSessionQueue {
9516
9518
  const base = bucket.items[bucket.head];
9517
9519
  const isAskReplyInject = (e) => !e.silent && Boolean(e.askReplySources?.length);
9518
9520
  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);
9521
+ 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
9522
  let end = bucket.head + 1;
9521
9523
  while (end < bucket.items.length && mergeable(bucket.items[end]))
9522
9524
  end++;
@@ -17104,7 +17106,7 @@ function notifyPlaywrightUnavailable(topicId) {
17104
17106
  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
17107
  WsHub.get().broadcastTopicNotice(topicId, "info", "Playwright \uC0AC\uC6A9 \uBD88\uAC00");
17106
17108
  }
17107
- function appendAskReplyMessage(topicId, text2, sourceLabel, body, kind, agentType) {
17109
+ function appendAskReplyMessage(topicId, text2, sourceLabel, body, kind, agentType, threadRootId) {
17108
17110
  const message = {
17109
17111
  id: randomUUID16(),
17110
17112
  topicId,
@@ -17117,6 +17119,7 @@ function appendAskReplyMessage(topicId, text2, sourceLabel, body, kind, agentTyp
17117
17119
  message: body
17118
17120
  },
17119
17121
  ...agentType ? { agentType } : {},
17122
+ ...threadRootId ? { threadRootId } : {},
17120
17123
  createdAt: new Date().toISOString()
17121
17124
  };
17122
17125
  appendApiMessage(message, { notify: false });
@@ -17198,6 +17201,7 @@ function redispatchInject(inject) {
17198
17201
  depth: inject.depth,
17199
17202
  silent: inject.silent,
17200
17203
  contextId: inject.contextId,
17204
+ ...inject.threadRootId ? { threadRootId: inject.threadRootId } : {},
17201
17205
  agentOverride: inject.agentOverride,
17202
17206
  modelOverride: inject.modelOverride,
17203
17207
  effortOverride: inject.effortOverride,
@@ -17258,7 +17262,7 @@ ${body}`;
17258
17262
  await markPendingAskFile(pending, "reply_ready");
17259
17263
  if (!callerTopic?.agent) {
17260
17264
  try {
17261
- appendAskReplyMessage(pending.callerTopicId, prompt, sourceLabel, body, kind);
17265
+ appendAskReplyMessage(pending.callerTopicId, prompt, sourceLabel, body, kind, undefined, pending.callerThreadRootId);
17262
17266
  await clearPendingAskFile(pending);
17263
17267
  return true;
17264
17268
  } catch (err2) {
@@ -17269,6 +17273,7 @@ ${body}`;
17269
17273
  const queued = askReplyInjectBatcher.enqueue({
17270
17274
  topicId: pending.callerTopicId,
17271
17275
  userId: pending.callerUserId,
17276
+ ...pending.callerThreadRootId ? { threadRootId: pending.callerThreadRootId } : {},
17272
17277
  prompt,
17273
17278
  origin: sourceLabel,
17274
17279
  requestId: pending.requestId,
@@ -17288,7 +17293,7 @@ ${body}`;
17288
17293
  }
17289
17294
  });
17290
17295
  if (queued) {
17291
- appendAskReplyMessage(pending.callerTopicId, prompt, sourceLabel, body, kind, callerTopic.agent);
17296
+ appendAskReplyMessage(pending.callerTopicId, prompt, sourceLabel, body, kind, callerTopic.agent, pending.callerThreadRootId);
17292
17297
  await markPendingAskFile(pending, "queued_for_caller");
17293
17298
  return true;
17294
17299
  }
@@ -17297,7 +17302,7 @@ ${body}`;
17297
17302
  return true;
17298
17303
  }
17299
17304
  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);
17305
+ appendAskReplyMessage(pending.callerTopicId, prompt, sourceLabel, body, kind, callerTopic.agent, pending.callerThreadRootId);
17301
17306
  await clearPendingAskFile(pending);
17302
17307
  return true;
17303
17308
  }
@@ -20325,4 +20330,4 @@ export {
20325
20330
  DEFAULT_SELF_CONFIG_PRODUCT
20326
20331
  };
20327
20332
 
20328
- //# debugId=BC9A0D1B93E3165264756E2164756E21
20333
+ //# debugId=08A64143601BA52464756E2164756E21