negotium 0.2.25 → 0.2.27

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.
@@ -2395,7 +2395,7 @@ var init_claude_registry = __esm(() => {
2395
2395
  });
2396
2396
 
2397
2397
  // ../../packages/core/src/version.ts
2398
- var NEGOTIUM_VERSION = "0.2.25";
2398
+ var NEGOTIUM_VERSION = "0.2.27";
2399
2399
 
2400
2400
  // ../../packages/core/src/agents/codex-native-multi-agent.ts
2401
2401
  import { spawn as spawn2 } from "child_process";
@@ -7636,11 +7636,11 @@ function backfillTopicSurfaces() {
7636
7636
  logger.info({ surface }, "api_topics: surface backfilled");
7637
7637
  }
7638
7638
  function renameSurfaceTitleCollisions() {
7639
- const rows = db.query("SELECT id, title, kind, surface FROM api_topics ORDER BY created_at ASC, rowid ASC").all();
7639
+ const rows = db.query("SELECT id, title, kind, surface FROM api_topics WHERE kind != 'manager' ORDER BY created_at ASC, rowid ASC").all();
7640
7640
  const taken = new Set;
7641
7641
  const update = db.query("UPDATE api_topics SET title = ? WHERE id = ?");
7642
7642
  for (const row of rows) {
7643
- const key = (title) => `${row.surface}\x00${row.kind}\x00${normalizedTitle(title)}`;
7643
+ const key = (title) => [row.surface, row.kind, normalizedTitle(title)].join("\x00");
7644
7644
  if (!taken.has(key(row.title))) {
7645
7645
  taken.add(key(row.title));
7646
7646
  continue;
@@ -7793,7 +7793,7 @@ function upsertTopic(t) {
7793
7793
  is_subagent = excluded.is_subagent,
7794
7794
  visibility = excluded.visibility,
7795
7795
  surface = excluded.surface,
7796
- subagent_report_mode = excluded.subagent_report_mode`).run(t.id, t.title, normalized.kind, t.description ?? null, normalized.agent ?? null, t.defaultModel ?? null, t.defaultEffort ?? null, normalized.aiMode, t.createdAt, t.lastMessageAt ?? null, t.parentTopicId ?? null, t.memoryTopicId ?? null, t.memoryKey ?? null, t.isFork ? 1 : 0, t.isSubagent ? 1 : 0, normalizeTopicVisibility(t.visibility), normalizeTopicSurface(t.surface), t.subagentReportMode ?? "auto");
7796
+ subagent_report_mode = excluded.subagent_report_mode`).run(t.id, t.title, normalized.kind, t.description ?? null, normalized.agent ?? null, t.defaultModel ?? null, t.defaultEffort ?? null, normalized.aiMode, t.createdAt, t.lastMessageAt ?? null, t.parentTopicId ?? null, t.memoryTopicId ?? null, t.memoryKey ?? null, t.isFork ? 1 : 0, t.isSubagent ? 1 : 0, normalizeTopicVisibility(t.visibility), normalizeTopicSurface(t.surface ?? defaultTopicSurface()), t.subagentReportMode ?? "auto");
7797
7797
  db.query("DELETE FROM topic_members WHERE topic_id = ?").run(t.id);
7798
7798
  for (const participant of t.participants) {
7799
7799
  db.query("INSERT INTO topic_members (topic_id,user_id,role) VALUES (?,?,?)").run(t.id, participant.userId, participant.role);
@@ -7857,12 +7857,10 @@ function findTopicTitleConflict(title, kind, opts = {}) {
7857
7857
  if (general)
7858
7858
  return rowToDto2(general);
7859
7859
  }
7860
- const params = [wanted, surface];
7861
- let sql = "SELECT * FROM api_topics WHERE LOWER(TRIM(title)) = ? AND surface = ?";
7862
- if (kind !== "manager") {
7863
- sql += " AND (kind = ? OR id = ?)";
7864
- params.push(kind, GENERAL_TOPIC_ID);
7865
- }
7860
+ if (kind === "manager")
7861
+ return null;
7862
+ const params = [wanted, surface, kind, GENERAL_TOPIC_ID];
7863
+ let sql = "SELECT * FROM api_topics WHERE LOWER(TRIM(title)) = ? AND surface = ? AND (kind = ? OR id = ?)";
7866
7864
  if (opts.excludeTopicId) {
7867
7865
  sql += " AND id != ?";
7868
7866
  params.push(opts.excludeTopicId);
@@ -18810,4 +18808,4 @@ export {
18810
18808
  DEFAULT_SELF_CONFIG_PRODUCT
18811
18809
  };
18812
18810
 
18813
- //# debugId=F0D2AC4BD6AF764E64756E2164756E21
18811
+ //# debugId=B1C944EBC633AE5864756E2164756E21