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.
package/dist/main.js CHANGED
@@ -3088,6 +3088,7 @@ var init_mcp_config = __esm(() => {
3088
3088
  ...commonRuntimeMcpPolicy("runtime"),
3089
3089
  build({
3090
3090
  userId,
3091
+ actorUserId,
3091
3092
  session,
3092
3093
  topicId,
3093
3094
  queryId,
@@ -3104,7 +3105,7 @@ var init_mcp_config = __esm(() => {
3104
3105
  if (!topicId || !agent)
3105
3106
  return null;
3106
3107
  return buildRuntimeMcpSpec(agent, {
3107
- userId,
3108
+ userId: actorUserId ?? userId,
3108
3109
  topicId,
3109
3110
  topicTitle: session,
3110
3111
  queryId,
@@ -3889,7 +3890,7 @@ var exports_version = {};
3889
3890
  __export(exports_version, {
3890
3891
  NEGOTIUM_VERSION: () => NEGOTIUM_VERSION
3891
3892
  });
3892
- var NEGOTIUM_VERSION = "0.16.3";
3893
+ var NEGOTIUM_VERSION = "0.16.4";
3893
3894
 
3894
3895
  // ../../packages/core/src/agents/codex-native-multi-agent.ts
3895
3896
  import { spawn as spawn2 } from "child_process";
@@ -15966,10 +15967,7 @@ async function createDerivedTopicImpl(topic, sourceTopicId, userId, copyHistory,
15966
15967
  const sourceConfig = getApiTopicConfig(sourceTopicId);
15967
15968
  const agent = subagent?.agent ?? effectiveAgentForTopic(sourceTopicId, topic);
15968
15969
  const subagentModel = agent && subagent?.model ? resolveModelForAgent(agent, subagent.model, getRegistry(agent)) : undefined;
15969
- const participants = copyHistory || subagent ? [
15970
- ...topic.participants.filter((p) => p.userId !== userId).map((p) => ({ ...p, role: "member" })),
15971
- { userId, role: "owner" }
15972
- ] : [{ userId, role: "owner" }];
15970
+ const participants = subagent ? topic.participants.map((p) => ({ ...p })) : [{ userId, role: "owner" }];
15973
15971
  const kind = topic.kind ?? inferTopicKind(topic);
15974
15972
  const surface = topic.surface ?? defaultTopicSurface();
15975
15973
  const surfaceScope = topic.surfaceScope ?? null;
@@ -22080,10 +22078,11 @@ ${card.task}${reportInstruction}`;
22080
22078
  error: "Error: subagent management is only available in agent rooms."
22081
22079
  };
22082
22080
  }
22081
+ const rootOwnerId = parent.participants.find((participant) => participant.role === "owner")?.userId;
22083
22082
  return {
22084
22083
  ok: true,
22085
22084
  parent,
22086
- children: (() => {
22085
+ children: rootOwnerId ? (() => {
22087
22086
  const topics = host.storage.listTopics();
22088
22087
  const byParent = new Map;
22089
22088
  for (const topic of topics) {
@@ -22100,7 +22099,7 @@ ${card.task}${reportInstruction}`;
22100
22099
  if (visited.has(child.id))
22101
22100
  continue;
22102
22101
  visited.add(child.id);
22103
- if (!child.participants.some((participant) => participant.userId === ctx.userId && participant.role === "owner")) {
22102
+ if (!child.participants.some((participant) => participant.userId === rootOwnerId && participant.role === "owner")) {
22104
22103
  continue;
22105
22104
  }
22106
22105
  descendants.push(child);
@@ -22109,7 +22108,7 @@ ${card.task}${reportInstruction}`;
22109
22108
  };
22110
22109
  visit(ctx.topicId);
22111
22110
  return descendants;
22112
- })()
22111
+ })() : []
22113
22112
  };
22114
22113
  }
22115
22114
  function subagentStatus(parentTopicId, childTopicId) {
@@ -51832,4 +51831,4 @@ switch (command) {
51832
51831
  }
51833
51832
  }
51834
51833
 
51835
- //# debugId=1B4BD7F8F10E7E7A64756E2164756E21
51834
+ //# debugId=25E31C8CAD59F99364756E2164756E21