negotium 0.16.3 → 0.16.4

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.
@@ -2009,6 +2009,7 @@ var init_mcp_config = __esm(() => {
2009
2009
  ...commonRuntimeMcpPolicy("runtime"),
2010
2010
  build({
2011
2011
  userId,
2012
+ actorUserId,
2012
2013
  session,
2013
2014
  topicId,
2014
2015
  queryId,
@@ -2025,7 +2026,7 @@ var init_mcp_config = __esm(() => {
2025
2026
  if (!topicId || !agent)
2026
2027
  return null;
2027
2028
  return buildRuntimeMcpSpec(agent, {
2028
- userId,
2029
+ userId: actorUserId ?? userId,
2029
2030
  topicId,
2030
2031
  topicTitle: session,
2031
2032
  queryId,
@@ -3163,7 +3164,7 @@ var init_codex = __esm(async () => {
3163
3164
  });
3164
3165
 
3165
3166
  // ../../packages/core/src/version.ts
3166
- var NEGOTIUM_VERSION = "0.16.3";
3167
+ var NEGOTIUM_VERSION = "0.16.4";
3167
3168
 
3168
3169
  // ../../packages/core/src/agents/codex-native-multi-agent.ts
3169
3170
  import { spawn as spawn2 } from "child_process";
@@ -13719,10 +13720,7 @@ async function createDerivedTopicImpl(topic, sourceTopicId, userId, copyHistory,
13719
13720
  const sourceConfig = getApiTopicConfig(sourceTopicId);
13720
13721
  const agent = subagent?.agent ?? effectiveAgentForTopic(sourceTopicId, topic);
13721
13722
  const subagentModel = agent && subagent?.model ? resolveModelForAgent(agent, subagent.model, getRegistry(agent)) : undefined;
13722
- const participants = copyHistory || subagent ? [
13723
- ...topic.participants.filter((p) => p.userId !== userId).map((p) => ({ ...p, role: "member" })),
13724
- { userId, role: "owner" }
13725
- ] : [{ userId, role: "owner" }];
13723
+ const participants = subagent ? topic.participants.map((p) => ({ ...p })) : [{ userId, role: "owner" }];
13726
13724
  const kind = topic.kind ?? inferTopicKind(topic);
13727
13725
  const surface = topic.surface ?? defaultTopicSurface();
13728
13726
  const surfaceScope = topic.surfaceScope ?? null;
@@ -19364,10 +19362,11 @@ ${card.task}${reportInstruction}`;
19364
19362
  error: "Error: subagent management is only available in agent rooms."
19365
19363
  };
19366
19364
  }
19365
+ const rootOwnerId = parent.participants.find((participant) => participant.role === "owner")?.userId;
19367
19366
  return {
19368
19367
  ok: true,
19369
19368
  parent,
19370
- children: (() => {
19369
+ children: rootOwnerId ? (() => {
19371
19370
  const topics = host.storage.listTopics();
19372
19371
  const byParent = new Map;
19373
19372
  for (const topic of topics) {
@@ -19384,7 +19383,7 @@ ${card.task}${reportInstruction}`;
19384
19383
  if (visited.has(child.id))
19385
19384
  continue;
19386
19385
  visited.add(child.id);
19387
- if (!child.participants.some((participant) => participant.userId === ctx.userId && participant.role === "owner")) {
19386
+ if (!child.participants.some((participant) => participant.userId === rootOwnerId && participant.role === "owner")) {
19388
19387
  continue;
19389
19388
  }
19390
19389
  descendants.push(child);
@@ -19393,7 +19392,7 @@ ${card.task}${reportInstruction}`;
19393
19392
  };
19394
19393
  visit(ctx.topicId);
19395
19394
  return descendants;
19396
- })()
19395
+ })() : []
19397
19396
  };
19398
19397
  }
19399
19398
  function subagentStatus(parentTopicId, childTopicId) {
@@ -23084,4 +23083,4 @@ export {
23084
23083
  createAgentHealthMcpServer
23085
23084
  };
23086
23085
 
23087
- //# debugId=6B1408748C02CA6F64756E2164756E21
23086
+ //# debugId=FA32629C98A74C7A64756E2164756E21