negotium 0.4.9 → 0.5.0

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
@@ -273,7 +273,7 @@ function resolveDefaultModel(agent, registryDefaultModel) {
273
273
  function codexAuthFilePath() {
274
274
  return process.env.NEGOTIUM_CODEX_AUTH_FILE || join(process.env.CODEX_HOME || join(homedir(), ".codex"), "auth.json");
275
275
  }
276
- var HOME, PROJECT_ROOT, STATE_DIR_ENV, STATE_DIR, WORKSPACE_DIR, TOPIC_WORKSPACE_DIR, SHARED_WIKI_DIR, CRON_WORKSPACE_DIR, BROWSER_DIR, BROWSER_PROFILES_DIR, BINARIES_DIR, SECRETS_DIR, DM_WORKSPACE_DIR, SESSION_WORKSPACE_DIR, CLAUDE_EXECUTABLE_ENV, CLAUDE_EXECUTABLE, DEFAULT_OUTPUT_LANGUAGE = "English", BROWSER_RS_VERSION = "v0.1.22", BROWSER_RS_MIN_SECURE_VERSION = "0.1.15", BROWSER_RS_VERSION_PROBE_TIMEOUT_MS = 15000, SNIPPETS_API_URL, BROWSER_RS_BIN, BASH_RS_VERSION = "v0.1.7", BASH_RS_BIN, PLAYWRIGHT_MCP_BIN, TSX_BIN, TSX_LOADER, TSCONFIG_PATH, SESSION_COMM_SERVER, TASK_SERVER, DECISION_SERVER, CANONICAL_MCP_PROXY_SERVER, WIKI_SERVER, TOKEN_STATS_SERVER, COMPACTION_LOG_SERVER, SYSTEM_HEALTH_SERVER, AGENT_HEALTH_SERVER, VAULT_SERVER, BG_BASH_BASE_PORT, BG_BASH_MAX_PORT, RUNTIME_MCP_SECRET, NODE_CONTROL_TOKEN, NODE_ID, VAULT_MASTER_KEY, NEGOTIUM_PORT, hostname, DATA_DIR, LOG_DIR, UPLOADS_DIR, VAULT_DIR, SESSIONS_DB, DEBUG_FILE, USERS_LOG_DIR, RUN_DIR, PROGRESS_DIR, DM_CMD_DIR, DM_RESP_DIR, SESSION_INBOX_DIR, SESSION_ASKS_DIR, BASHRS_SPILL_ROOT, PLAYWRIGHT_BASE_PORT, PLAYWRIGHT_MAX_PORT, PLAYWRIGHT_PORTS_DIR, ACTIVE_QUERY_STALE_MS, AGENTS_PROMPTS_DIR, RESOURCES_DIR, FILE_TAG_REGEX, MODEL_SONNET = "claude-sonnet-5", MODEL_OPUS = "claude-opus-5", MODEL_FABLE = "claude-fable-5", FALLBACK_AGENT, SESSION_AGENT, GATEWAY_AGENT, FALLBACK_MODEL, SESSION_MODEL, GATEWAY_MODEL, FFMPEG_BIN, FFPROBE_BIN, PYTHON_BIN, FASTER_WHISPER_WRAPPER, WHISPER_MODEL, TESSERACT_BIN, PDFTOTEXT_BIN, _envMaxTellDepth, MAX_TELL_DEPTH;
276
+ var HOME, PROJECT_ROOT, STATE_DIR_ENV, STATE_DIR, WORKSPACE_DIR, TOPIC_WORKSPACE_DIR, SHARED_WIKI_DIR, CRON_WORKSPACE_DIR, BROWSER_DIR, BROWSER_PROFILES_DIR, BINARIES_DIR, SECRETS_DIR, DM_WORKSPACE_DIR, SESSION_WORKSPACE_DIR, CLAUDE_EXECUTABLE_ENV, CLAUDE_EXECUTABLE, DEFAULT_OUTPUT_LANGUAGE = "English", BROWSER_RS_VERSION = "v0.1.23", BROWSER_RS_MIN_SECURE_VERSION = "0.1.15", BROWSER_RS_VERSION_PROBE_TIMEOUT_MS = 15000, SNIPPETS_API_URL, BROWSER_RS_BIN, BASH_RS_VERSION = "v0.1.7", BASH_RS_BIN, PLAYWRIGHT_MCP_BIN, TSX_BIN, TSX_LOADER, TSCONFIG_PATH, SESSION_COMM_SERVER, TASK_SERVER, DECISION_SERVER, CANONICAL_MCP_PROXY_SERVER, WIKI_SERVER, TOKEN_STATS_SERVER, COMPACTION_LOG_SERVER, SYSTEM_HEALTH_SERVER, AGENT_HEALTH_SERVER, VAULT_SERVER, BG_BASH_BASE_PORT, BG_BASH_MAX_PORT, RUNTIME_MCP_SECRET, NODE_CONTROL_TOKEN, NODE_ID, VAULT_MASTER_KEY, NEGOTIUM_PORT, hostname, DATA_DIR, LOG_DIR, UPLOADS_DIR, VAULT_DIR, SESSIONS_DB, DEBUG_FILE, USERS_LOG_DIR, RUN_DIR, PROGRESS_DIR, DM_CMD_DIR, DM_RESP_DIR, SESSION_INBOX_DIR, SESSION_ASKS_DIR, BASHRS_SPILL_ROOT, PLAYWRIGHT_BASE_PORT, PLAYWRIGHT_MAX_PORT, PLAYWRIGHT_PORTS_DIR, ACTIVE_QUERY_STALE_MS, AGENTS_PROMPTS_DIR, RESOURCES_DIR, FILE_TAG_REGEX, MODEL_SONNET = "claude-sonnet-5", MODEL_OPUS = "claude-opus-5", MODEL_FABLE = "claude-fable-5", FALLBACK_AGENT, SESSION_AGENT, GATEWAY_AGENT, FALLBACK_MODEL, SESSION_MODEL, GATEWAY_MODEL, FFMPEG_BIN, FFPROBE_BIN, PYTHON_BIN, FASTER_WHISPER_WRAPPER, WHISPER_MODEL, TESSERACT_BIN, PDFTOTEXT_BIN, _envMaxTellDepth, MAX_TELL_DEPTH;
277
277
  var init_config = __esm(() => {
278
278
  init_config_helpers();
279
279
  init_logger();
@@ -1868,7 +1868,7 @@ var exports_version = {};
1868
1868
  __export(exports_version, {
1869
1869
  NEGOTIUM_VERSION: () => NEGOTIUM_VERSION
1870
1870
  });
1871
- var NEGOTIUM_VERSION = "0.4.9";
1871
+ var NEGOTIUM_VERSION = "0.5.0";
1872
1872
 
1873
1873
  // ../../packages/core/src/agents/codex-native-multi-agent.ts
1874
1874
  import { spawn } from "child_process";
@@ -33212,13 +33212,60 @@ function compactDetail(decision) {
33212
33212
  const rationale = decision.reasoning.replace(/\s+/g, " ").trim();
33213
33213
  return `${rationale} \xB7 ${decision.agent}${decision.model ? `/${decision.model}` : ""}`;
33214
33214
  }
33215
+ function chronologicalSequenceEdges(ordered) {
33216
+ const parent = new Map;
33217
+ for (const decision of ordered)
33218
+ parent.set(decision.id, decision.id);
33219
+ const find = (id) => {
33220
+ let root = id;
33221
+ while (parent.get(root) !== root) {
33222
+ const next = parent.get(root);
33223
+ if (next === undefined)
33224
+ break;
33225
+ root = next;
33226
+ }
33227
+ return root;
33228
+ };
33229
+ const union = (a, b) => {
33230
+ const rootA = find(a);
33231
+ const rootB = find(b);
33232
+ if (rootA !== rootB)
33233
+ parent.set(rootA, rootB);
33234
+ };
33235
+ for (const decision of ordered) {
33236
+ for (const upstream of decision.causedBy ?? []) {
33237
+ if (parent.has(upstream))
33238
+ union(upstream, decision.id);
33239
+ }
33240
+ }
33241
+ const edges = [];
33242
+ for (let index = 1;index < ordered.length; index += 1) {
33243
+ const previous = ordered[index - 1];
33244
+ const current3 = ordered[index];
33245
+ if (!previous || !current3)
33246
+ continue;
33247
+ if (find(previous.id) === find(current3.id))
33248
+ continue;
33249
+ union(previous.id, current3.id);
33250
+ edges.push({
33251
+ id: `sequence:${previous.id}:${current3.id}`,
33252
+ source: previous.id,
33253
+ target: current3.id,
33254
+ kind: "sequence",
33255
+ direction: "none",
33256
+ style: "dashed"
33257
+ });
33258
+ }
33259
+ return edges;
33260
+ }
33215
33261
  function buildDecisionGraph(decisions2, topicTitle) {
33216
33262
  const ids = new Set(decisions2.map((decision) => decision.id));
33263
+ const ordered = [...decisions2].sort((a, b) => (a.timestamp ?? 0) - (b.timestamp ?? 0) || a.id.localeCompare(b.id));
33217
33264
  return {
33218
33265
  id: "decisions",
33219
33266
  title: topicTitle,
33220
33267
  direction: "DOWN",
33221
- nodes: decisions2.map((decision) => ({
33268
+ nodes: ordered.map((decision) => ({
33222
33269
  id: decision.id,
33223
33270
  label: `#${decision.id} ${decision.action}`,
33224
33271
  detail: compactDetail(decision),
@@ -33226,15 +33273,17 @@ function buildDecisionGraph(decisions2, topicTitle) {
33226
33273
  state: decisionNodeState(decision.status),
33227
33274
  metadata: { timestamp: decision.timestamp, agent: decision.agent, model: decision.model }
33228
33275
  })),
33229
- edges: decisions2.flatMap((decision) => (decision.causedBy ?? []).filter((upstream) => ids.has(upstream)).map((upstream) => ({
33230
- id: `caused:${upstream}:${decision.id}`,
33231
- source: upstream,
33232
- target: decision.id,
33233
- label: "caused",
33234
- kind: "caused",
33235
- direction: "forward",
33236
- style: "solid"
33237
- })))
33276
+ edges: [
33277
+ ...ordered.flatMap((decision) => (decision.causedBy ?? []).filter((upstream) => ids.has(upstream)).map((upstream) => ({
33278
+ id: `caused:${upstream}:${decision.id}`,
33279
+ source: upstream,
33280
+ target: decision.id,
33281
+ kind: "caused",
33282
+ direction: "forward",
33283
+ style: "solid"
33284
+ }))),
33285
+ ...chronologicalSequenceEdges(ordered)
33286
+ ]
33238
33287
  };
33239
33288
  }
33240
33289
  async function renderDecisionGraph(graph, spacing = DEFAULT_DECISION_GRAPH_SPACING, signal) {
@@ -33242,14 +33291,15 @@ async function renderDecisionGraph(graph, spacing = DEFAULT_DECISION_GRAPH_SPACI
33242
33291
  direction: "DOWN",
33243
33292
  spacing,
33244
33293
  signal,
33245
- timeoutMs: 15000
33294
+ timeoutMs: 15000,
33295
+ maxNodeWidth: DECISION_NODE_MAX_WIDTH
33246
33296
  });
33247
33297
  return {
33248
33298
  canvas: { ...renderTerminalGraph(graph, geometry), title: graph.title },
33249
33299
  svg: renderSvgGraph(graph, geometry, { title: graph.title })
33250
33300
  };
33251
33301
  }
33252
- var DEFAULT_DECISION_GRAPH_SPACING = 4, MIN_DECISION_GRAPH_SPACING = 2, MAX_DECISION_GRAPH_SPACING = 10;
33302
+ var DEFAULT_DECISION_GRAPH_SPACING = 4, MIN_DECISION_GRAPH_SPACING = 2, MAX_DECISION_GRAPH_SPACING = 10, DECISION_NODE_MAX_WIDTH = 30;
33253
33303
  var init_decision_graph = () => {};
33254
33304
 
33255
33305
  // ../../adapters/terminal/src/subagent-graph.ts
@@ -35556,7 +35606,7 @@ function decisionGraphLines(state, width, height) {
35556
35606
  bold: true
35557
35607
  }),
35558
35608
  line(` [/] spacing ${state.decisionGraphSpacing} \xB7 drag/wheel/arrows/hjkl move \xB7 Ctrl-D/Esc close${position}`, { fg: theme.muted }),
35559
- line(" \u25CB accepted \xB7 \u25F7 proposed \xB7 \u2713 executed \xB7 \u2717 rejected \xB7 ! superseded", {
35609
+ line(" \u25CB accepted \xB7 \u25CC proposed \xB7 \u2713 executed \xB7 \u2715 rejected \xB7 \u25C6 superseded", {
35560
35610
  fg: theme.subtle
35561
35611
  }),
35562
35612
  line("")
@@ -47589,4 +47639,4 @@ switch (command) {
47589
47639
  }
47590
47640
  }
47591
47641
 
47592
- //# debugId=A95E28BED5799E3A64756E2164756E21
47642
+ //# debugId=A120DD1C769C1B1164756E2164756E21