negotium 0.23.2 → 0.23.3

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
@@ -6564,7 +6564,7 @@ var exports_version = {};
6564
6564
  __export(exports_version, {
6565
6565
  NEGOTIUM_VERSION: () => NEGOTIUM_VERSION
6566
6566
  });
6567
- var NEGOTIUM_VERSION = "0.23.2";
6567
+ var NEGOTIUM_VERSION = "0.23.3";
6568
6568
 
6569
6569
  // ../../packages/core/src/agents/codex-native-multi-agent.ts
6570
6570
  import { spawn as spawn2 } from "child_process";
@@ -42027,6 +42027,7 @@ function createInitialState(userId) {
42027
42027
  topicUsage: {},
42028
42028
  messageHistory: {},
42029
42029
  activity: {},
42030
+ unread: {},
42030
42031
  input: "",
42031
42032
  inputCursor: { row: 0, col: 0 },
42032
42033
  suggestionIndex: 0,
@@ -42263,11 +42264,12 @@ function sortedTopicEntries(state, entries) {
42263
42264
  function topicPickerItems(state) {
42264
42265
  const visible = visibleTopicPickerIds(state);
42265
42266
  const indexedTopics = state.topics.map((topic, index) => ({ topic, index })).filter(({ topic }) => visible.has(topic.id));
42266
- const managerEntries = sortedTopicEntries(state, indexedTopics.filter(({ topic }) => topic.kind === "manager"));
42267
- const regularEntries = sortedTopicEntries(state, indexedTopics.filter(({ topic }) => topic.kind !== "manager"));
42268
42267
  return [
42269
- ...managerEntries.map(({ topic, index }) => ({ kind: "topic", id: topic.id, index })),
42270
- ...regularEntries.map(({ topic, index }) => ({ kind: "topic", id: topic.id, index })),
42268
+ ...managerFirstTopicEntries(state, indexedTopics).map(({ topic, index }) => ({
42269
+ kind: "topic",
42270
+ id: topic.id,
42271
+ index
42272
+ })),
42271
42273
  ...visibleBackgroundSessions(state).map((session) => ({
42272
42274
  kind: "background",
42273
42275
  id: session.id
@@ -42343,6 +42345,7 @@ function setTopics(state, topics, preferredTitle) {
42343
42345
  ...state,
42344
42346
  topics: orderedTopics,
42345
42347
  activity,
42348
+ unread: withoutUnread(state.unread, nextActive),
42346
42349
  activeTopicId: nextActive,
42347
42350
  scrollOffset: nextActive === state.activeTopicId ? state.scrollOffset : 0,
42348
42351
  askChoiceIndex: nextActive === state.activeTopicId ? state.askChoiceIndex : 0,
@@ -42350,11 +42353,32 @@ function setTopics(state, topics, preferredTitle) {
42350
42353
  topicPickerBackgroundId: state.topicPickerBackgroundId
42351
42354
  });
42352
42355
  }
42356
+ function withoutUnread(unread, topicId) {
42357
+ if (topicId === null || !unread[topicId])
42358
+ return unread;
42359
+ const next = { ...unread };
42360
+ delete next[topicId];
42361
+ return next;
42362
+ }
42363
+ function managerFirstTopicEntries(state, entries) {
42364
+ return [
42365
+ ...sortedTopicEntries(state, entries.filter(({ topic }) => topic.kind === "manager")),
42366
+ ...sortedTopicEntries(state, entries.filter(({ topic }) => topic.kind !== "manager"))
42367
+ ];
42368
+ }
42369
+ function adjacentTopicId(state, delta) {
42370
+ const order = managerFirstTopicEntries(state, state.topics.map((topic) => ({ topic }))).map(({ topic }) => topic.id);
42371
+ const current3 = order.indexOf(state.activeTopicId ?? "");
42372
+ if (current3 < 0 || order.length < 2)
42373
+ return null;
42374
+ return order[(current3 + delta + order.length) % order.length] ?? null;
42375
+ }
42353
42376
  function selectTopic(state, topicId) {
42354
42377
  if (!state.topics.some((topic) => topic.id === topicId))
42355
42378
  return state;
42356
42379
  return {
42357
42380
  ...state,
42381
+ unread: withoutUnread(state.unread, topicId),
42358
42382
  activeTopicId: topicId,
42359
42383
  scrollOffset: 0,
42360
42384
  askChoiceIndex: 0,
@@ -42442,6 +42466,11 @@ function removeMessage(state, topicId, messageId) {
42442
42466
  return state;
42443
42467
  return { ...state, messages: { ...state.messages, [topicId]: next } };
42444
42468
  }
42469
+ function flagUnreadReply(state, topicId, wasRunning) {
42470
+ if (!wasRunning || topicId === state.activeTopicId)
42471
+ return state;
42472
+ return { ...state, unread: { ...state.unread, [topicId]: true } };
42473
+ }
42445
42474
  function activityFor(state, topicId) {
42446
42475
  return state.activity[topicId] ?? { running: false, tools: [] };
42447
42476
  }
@@ -42610,11 +42639,11 @@ function applyAiStatus(state, topicId, raw, createdAt) {
42610
42639
  if (kind === "ai_done") {
42611
42640
  if (isStaleTerminalStatus(current3, status))
42612
42641
  return state;
42613
- return setActivity(state, topicId, {
42642
+ return flagUnreadReply(setActivity(state, topicId, {
42614
42643
  ...liveCurrent,
42615
42644
  running: false,
42616
42645
  status: "Done"
42617
- });
42646
+ }), topicId, current3.running);
42618
42647
  }
42619
42648
  if (kind === "ai_aborted") {
42620
42649
  if (isStaleTerminalStatus(current3, status))
@@ -42628,12 +42657,12 @@ function applyAiStatus(state, topicId, raw, createdAt) {
42628
42657
  if (kind === "ai_error") {
42629
42658
  if (isStaleTerminalStatus(current3, status))
42630
42659
  return state;
42631
- return setActivity(state, topicId, {
42660
+ return flagUnreadReply(setActivity(state, topicId, {
42632
42661
  ...liveCurrent,
42633
42662
  running: false,
42634
42663
  status: "Error",
42635
42664
  error: String(status.error ?? "Unknown error")
42636
- });
42665
+ }), topicId, current3.running);
42637
42666
  }
42638
42667
  if (kind === "tool_call") {
42639
42668
  if (isStaleTerminalStatus(current3, status))
@@ -44001,6 +44030,8 @@ function topicStatusIndicator(state, topic, animationFrame) {
44001
44030
  if (state.activity[topic.id]?.running) {
44002
44031
  return { icon: workingFrame(animationFrame), fg: theme.green };
44003
44032
  }
44033
+ if (state.unread[topic.id])
44034
+ return { icon: "\u25CF", fg: theme.blue };
44004
44035
  return { icon: "\u25CB", fg: theme.muted };
44005
44036
  }
44006
44037
  function topicPanelRowLines(state, topic, topicIndex, animationFrame) {
@@ -44239,6 +44270,7 @@ function helpLines() {
44239
44270
  line(" Ctrl-R sort topics panel (activity / name) \xB7 drag a \u2502 divider to resize"),
44240
44271
  line(" Ctrl-T open/close a shell on the right (closing ends it) \xB7 click it to type"),
44241
44272
  line(" Ctrl-O topics \xB7 Ctrl-G subagents \xB7 Ctrl-D decisions \xB7 Ctrl-X abort"),
44273
+ line(" Ctrl/Alt-\u2191 \u2193 step through topics \xB7 a blue \u25CF marks an unread reply"),
44242
44274
  line(" In topics: type to filter \xB7 Ctrl-N new \xB7 Ctrl-D delete"),
44243
44275
  line(" Esc/Ctrl-C stop active turn \xB7 Ctrl-C twice when idle to quit"),
44244
44276
  line(""),
@@ -45449,6 +45481,7 @@ var init_render = __esm(async () => {
45449
45481
  cyan: [87, 205, 220],
45450
45482
  tool: [196, 181, 253],
45451
45483
  green: [94, 211, 142],
45484
+ blue: [96, 165, 250],
45452
45485
  diffAddBg: [18, 43, 32],
45453
45486
  amber: [241, 190, 91],
45454
45487
  red: [245, 116, 128],
@@ -48582,6 +48615,12 @@ class TerminalApp {
48582
48615
  this.#openNewTopicComposer();
48583
48616
  return;
48584
48617
  }
48618
+ if (this.#state.overlay === null && (PREVIOUS_TOPIC_KEYS.has(chunk) || NEXT_TOPIC_KEYS.has(chunk))) {
48619
+ const topicId = adjacentTopicId(this.#state, PREVIOUS_TOPIC_KEYS.has(chunk) ? -1 : 1);
48620
+ if (topicId !== null)
48621
+ this.#activateTopic(topicId);
48622
+ return;
48623
+ }
48585
48624
  if (chunk === "\x10") {
48586
48625
  if (editingVaultSecret)
48587
48626
  return;
@@ -50290,7 +50329,7 @@ class TerminalApp {
50290
50329
  await this.#client.stop();
50291
50330
  }
50292
50331
  }
50293
- var KITTY_KEYBOARD_PUSH = "\x1B[>1u", KITTY_KEYBOARD_POP = "\x1B[<u", CANVAS_RGB, ENTER_ALT_SCREEN, EXIT_ALT_SCREEN, ABORT_ENTER_ALT_SCREEN, NEW_TOPIC_KEY = "\x0E", DELETE_TOPIC_KEY = "\x04", TERMINAL_PANE_KEY = "\x14", FILTER_BACKSPACE_KEYS, CONFIRM_KEYS, CANCEL_KEYS, INPUT_CARRY_FLUSH_MS = 15;
50332
+ var KITTY_KEYBOARD_PUSH = "\x1B[>1u", KITTY_KEYBOARD_POP = "\x1B[<u", CANVAS_RGB, ENTER_ALT_SCREEN, EXIT_ALT_SCREEN, ABORT_ENTER_ALT_SCREEN, NEW_TOPIC_KEY = "\x0E", DELETE_TOPIC_KEY = "\x04", TERMINAL_PANE_KEY = "\x14", PREVIOUS_TOPIC_KEYS, NEXT_TOPIC_KEYS, FILTER_BACKSPACE_KEYS, CONFIRM_KEYS, CANCEL_KEYS, INPUT_CARRY_FLUSH_MS = 15;
50294
50333
  var init_app = __esm(async () => {
50295
50334
  init_color_depth();
50296
50335
  init_commands();
@@ -50314,6 +50353,8 @@ var init_app = __esm(async () => {
50314
50353
  ENTER_ALT_SCREEN = altScreenSequences().enter;
50315
50354
  EXIT_ALT_SCREEN = altScreenSequences().exit;
50316
50355
  ABORT_ENTER_ALT_SCREEN = altScreenSequences().abortEnter;
50356
+ PREVIOUS_TOPIC_KEYS = new Set(["\x1B[1;5A", "\x1B[1;3A", "\x1B\x1B[A"]);
50357
+ NEXT_TOPIC_KEYS = new Set(["\x1B[1;5B", "\x1B[1;3B", "\x1B\x1B[B"]);
50317
50358
  FILTER_BACKSPACE_KEYS = new Set(["\x7F", "\b"]);
50318
50359
  CONFIRM_KEYS = new Set(["y", "\u315B"]);
50319
50360
  CANCEL_KEYS = new Set(["n", "\u315C"]);
@@ -60355,4 +60396,4 @@ switch (command) {
60355
60396
  }
60356
60397
  }
60357
60398
 
60358
- //# debugId=3FFA808EE892362C64756E2164756E21
60399
+ //# debugId=202F5FA265766A0464756E2164756E21