negotium 0.6.10 → 0.6.11

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 (37) hide show
  1. package/dist/agent-helpers.js +27 -6
  2. package/dist/agent-helpers.js.map +9 -8
  3. package/dist/{chunk-hrev8sxf.js → chunk-93e2mas3.js} +3 -3
  4. package/dist/{chunk-hrev8sxf.js.map → chunk-93e2mas3.js.map} +2 -2
  5. package/dist/{chunk-cxtngn3p.js → chunk-rsmbwyzv.js} +17 -1
  6. package/dist/{chunk-cxtngn3p.js.map → chunk-rsmbwyzv.js.map} +5 -4
  7. package/dist/{chunk-v7tj2vtq.js → chunk-ypbe1gc9.js} +1 -1
  8. package/dist/hosted-agent.js +18 -2
  9. package/dist/hosted-agent.js.map +6 -5
  10. package/dist/main.js +174 -35
  11. package/dist/main.js.map +14 -13
  12. package/dist/mcp-factories.js +29 -6
  13. package/dist/mcp-factories.js.map +11 -10
  14. package/dist/registry.js +3 -3
  15. package/dist/rollout.js +2 -2
  16. package/dist/runtime/cron/module.ts +4 -0
  17. package/dist/runtime/src/cron-host.ts +1 -0
  18. package/dist/runtime/src/mcp/factories/session-comm.ts +7 -0
  19. package/dist/runtime/src/mcp/session-comm/context.ts +3 -0
  20. package/dist/runtime/src/mcp/session-comm/default-host.ts +51 -0
  21. package/dist/runtime/src/mcp/session-comm/runtime.ts +1 -0
  22. package/dist/runtime/src/mcp/session-comm/server.ts +60 -0
  23. package/dist/runtime/src/platform/mcp-config.ts +5 -0
  24. package/dist/runtime/src/runtime/ask-callbacks.ts +1 -0
  25. package/dist/runtime/src/runtime/cron-sessions.ts +35 -0
  26. package/dist/runtime/src/runtime/inbox.ts +103 -32
  27. package/dist/runtime/src/runtime/turn-event-stream.ts +1 -1
  28. package/dist/runtime/src/runtime/turn-runner.ts +7 -1
  29. package/dist/runtime/src/version.ts +1 -1
  30. package/dist/types/packages/core/src/mcp/factories/session-comm.d.ts +1 -0
  31. package/dist/types/packages/core/src/mcp/session-comm/context.d.ts +2 -0
  32. package/dist/types/packages/core/src/runtime/ask-callbacks.d.ts +1 -0
  33. package/dist/types/packages/core/src/runtime/cron-sessions.d.ts +9 -0
  34. package/dist/types/packages/core/src/runtime/turn-runner.d.ts +1 -0
  35. package/dist/types/packages/core/src/version.d.ts +1 -1
  36. package/package.json +1 -1
  37. /package/dist/{chunk-v7tj2vtq.js.map → chunk-ypbe1gc9.js.map} +0 -0
@@ -877,6 +877,24 @@ var init_mcp_transport = __esm(() => {
877
877
  init_capability();
878
878
  });
879
879
 
880
+ // ../../packages/core/src/runtime/cron-sessions.ts
881
+ function getRegisteredCronSession(topicId, agent) {
882
+ const registration = providers.at(-1);
883
+ if (!registration)
884
+ return null;
885
+ try {
886
+ return registration.provider(topicId, agent);
887
+ } catch (error) {
888
+ logger.warn({ err: error, topicId, agent }, "cron-session: provider lookup failed");
889
+ return null;
890
+ }
891
+ }
892
+ var providers;
893
+ var init_cron_sessions = __esm(() => {
894
+ init_logger();
895
+ providers = [];
896
+ });
897
+
880
898
  // ../../packages/core/src/platform/mcp-config.ts
881
899
  function buildStdioMcpServer(agent, serverFile, serverArgs, env) {
882
900
  if (agent === "codex") {
@@ -1208,6 +1226,7 @@ var init_mcp_config = __esm(() => {
1208
1226
  init_mcp_catalog_policy();
1209
1227
  init_capability();
1210
1228
  init_mcp_transport();
1229
+ init_cron_sessions();
1211
1230
  _playwrightUnavailableLastNotifiedAt = new Map;
1212
1231
  _PLAYWRIGHT_UNAVAILABLE_COOLDOWN_MS = 5 * 60000;
1213
1232
  _playwrightUnavailableThisTurn = new Set;
@@ -1333,6 +1352,7 @@ var init_mcp_config = __esm(() => {
1333
1352
  peerBridge
1334
1353
  } = ctx;
1335
1354
  const effectiveAgent = agent ?? FALLBACK_AGENT;
1355
+ const cronSessionId = topicId ? getRegisteredCronSession(topicId, effectiveAgent)?.sessionId : undefined;
1336
1356
  const args = [
1337
1357
  `--user-id=${userId}`,
1338
1358
  `--topic=${session}`,
@@ -1340,6 +1360,7 @@ var init_mcp_config = __esm(() => {
1340
1360
  ...subagentParentTopicId ? [`--subagent-parent-topic-id=${subagentParentTopicId}`] : [],
1341
1361
  `--depth=${depth}`,
1342
1362
  `--agent=${effectiveAgent}`,
1363
+ ...cronSessionId ? [`--cron-session-id=${cronSessionId}`] : [],
1343
1364
  ...silent ? ["--reply-only=true"] : [],
1344
1365
  ...peerBridge ? [`--peer-host-query-id=${peerBridge.hostQueryId}`] : []
1345
1366
  ];
@@ -2980,7 +3001,7 @@ var init_codex = __esm(async () => {
2980
3001
  });
2981
3002
 
2982
3003
  // ../../packages/core/src/version.ts
2983
- var NEGOTIUM_VERSION = "0.6.10";
3004
+ var NEGOTIUM_VERSION = "0.6.11";
2984
3005
 
2985
3006
  // ../../packages/core/src/agents/codex-native-multi-agent.ts
2986
3007
  import { spawn as spawn2 } from "child_process";
@@ -12234,7 +12255,7 @@ function text(value, maxLen) {
12234
12255
  const normalized = value.replace(/\s+/g, " ").trim();
12235
12256
  return maxLen === undefined ? normalized : normalized.slice(0, maxLen);
12236
12257
  }
12237
- var providers, transientSessions;
12258
+ var providers2, transientSessions;
12238
12259
  var init_background_sessions = __esm(async () => {
12239
12260
  await init_archiver();
12240
12261
  init_tool_format();
@@ -12242,7 +12263,7 @@ var init_background_sessions = __esm(async () => {
12242
12263
  await init_runtime_events();
12243
12264
  await init_runtime_leases();
12244
12265
  init_background_session_policy();
12245
- providers = new Set;
12266
+ providers2 = new Set;
12246
12267
  transientSessions = new Map;
12247
12268
  });
12248
12269
 
@@ -15786,7 +15807,7 @@ ${JSON.stringify(event.input ?? {})}`);
15786
15807
  const { resolveAskCallback: resolveAskCallback2 } = await init_ask_callbacks().then(() => exports_ask_callbacks);
15787
15808
  const pending = resolveAskCallback2(queryId);
15788
15809
  if (pending) {
15789
- const sourceLabel = topicTitle;
15810
+ const sourceLabel = pending.sourceLabel ?? topicTitle;
15790
15811
  const replyText = pending.timedOut ? `\u26A0\uFE0F [Timeout - reply from ${sourceLabel} took too long and was dropped]` : accumulatedText.trim() || "(\uCC98\uB9AC\uB428, \uBCC4\uB3C4 \uC751\uB2F5 \uC5C6\uC74C)";
15791
15812
  await deliverAskCallbackToCaller(pending, sourceLabel, replyText, "reply");
15792
15813
  }
@@ -16354,7 +16375,7 @@ async function deliverAskError(queryId, sourceLabel, error) {
16354
16375
  const prefix = pending.timedOut ? `\u26A0\uFE0F [Timeout - error notification was dropped]
16355
16376
 
16356
16377
  ` : "";
16357
- await deliverAskCallbackToCaller(pending, sourceLabel, `${prefix}${error}`, "error");
16378
+ await deliverAskCallbackToCaller(pending, pending.sourceLabel ?? sourceLabel, `${prefix}${error}`, "error");
16358
16379
  }
16359
16380
  } catch {}
16360
16381
  }
@@ -19315,4 +19336,4 @@ export {
19315
19336
  DEFAULT_SELF_CONFIG_PRODUCT
19316
19337
  };
19317
19338
 
19318
- //# debugId=AE676600CD28F23E64756E2164756E21
19339
+ //# debugId=25AB947064107E8364756E2164756E21