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.
@@ -1299,6 +1299,7 @@ var init_mcp_config = __esm(() => {
1299
1299
  ...commonRuntimeMcpPolicy("runtime"),
1300
1300
  build({
1301
1301
  userId,
1302
+ actorUserId,
1302
1303
  session,
1303
1304
  topicId,
1304
1305
  queryId,
@@ -1315,7 +1316,7 @@ var init_mcp_config = __esm(() => {
1315
1316
  if (!topicId || !agent)
1316
1317
  return null;
1317
1318
  return buildRuntimeMcpSpec(agent, {
1318
- userId,
1319
+ userId: actorUserId ?? userId,
1319
1320
  topicId,
1320
1321
  topicTitle: session,
1321
1322
  queryId,
@@ -3117,7 +3118,7 @@ var init_codex = __esm(async () => {
3117
3118
  });
3118
3119
 
3119
3120
  // ../../packages/core/src/version.ts
3120
- var NEGOTIUM_VERSION = "0.16.3";
3121
+ var NEGOTIUM_VERSION = "0.16.4";
3121
3122
 
3122
3123
  // ../../packages/core/src/agents/codex-native-multi-agent.ts
3123
3124
  import { spawn as spawn2 } from "child_process";
@@ -14316,10 +14317,7 @@ async function createDerivedTopicImpl(topic, sourceTopicId, userId, copyHistory,
14316
14317
  const sourceConfig = getApiTopicConfig(sourceTopicId);
14317
14318
  const agent = subagent?.agent ?? effectiveAgentForTopic(sourceTopicId, topic);
14318
14319
  const subagentModel = agent && subagent?.model ? resolveModelForAgent(agent, subagent.model, getRegistry(agent)) : undefined;
14319
- const participants = copyHistory || subagent ? [
14320
- ...topic.participants.filter((p) => p.userId !== userId).map((p) => ({ ...p, role: "member" })),
14321
- { userId, role: "owner" }
14322
- ] : [{ userId, role: "owner" }];
14320
+ const participants = subagent ? topic.participants.map((p) => ({ ...p })) : [{ userId, role: "owner" }];
14323
14321
  const kind = topic.kind ?? inferTopicKind(topic);
14324
14322
  const surface = topic.surface ?? defaultTopicSurface();
14325
14323
  const surfaceScope = topic.surfaceScope ?? null;
@@ -19267,10 +19265,11 @@ ${card.task}${reportInstruction}`;
19267
19265
  error: "Error: subagent management is only available in agent rooms."
19268
19266
  };
19269
19267
  }
19268
+ const rootOwnerId = parent.participants.find((participant) => participant.role === "owner")?.userId;
19270
19269
  return {
19271
19270
  ok: true,
19272
19271
  parent,
19273
- children: (() => {
19272
+ children: rootOwnerId ? (() => {
19274
19273
  const topics = host.storage.listTopics();
19275
19274
  const byParent = new Map;
19276
19275
  for (const topic of topics) {
@@ -19287,7 +19286,7 @@ ${card.task}${reportInstruction}`;
19287
19286
  if (visited.has(child.id))
19288
19287
  continue;
19289
19288
  visited.add(child.id);
19290
- if (!child.participants.some((participant) => participant.userId === ctx.userId && participant.role === "owner")) {
19289
+ if (!child.participants.some((participant) => participant.userId === rootOwnerId && participant.role === "owner")) {
19291
19290
  continue;
19292
19291
  }
19293
19292
  descendants.push(child);
@@ -19296,7 +19295,7 @@ ${card.task}${reportInstruction}`;
19296
19295
  };
19297
19296
  visit(ctx.topicId);
19298
19297
  return descendants;
19299
- })()
19298
+ })() : []
19300
19299
  };
19301
19300
  }
19302
19301
  function subagentStatus(parentTopicId, childTopicId) {
@@ -20886,4 +20885,4 @@ export {
20886
20885
  DEFAULT_SELF_CONFIG_PRODUCT
20887
20886
  };
20888
20887
 
20889
- //# debugId=45EDD0169F537C9E64756E2164756E21
20888
+ //# debugId=0C381456723AA9D364756E2164756E21