negotium 0.2.16 → 0.2.18

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.
Files changed (47) hide show
  1. package/dist/agent-helpers.js +83 -38
  2. package/dist/agent-helpers.js.map +13 -13
  3. package/dist/background-bash.js.map +1 -1
  4. package/dist/browser-runtime.js.map +1 -1
  5. package/dist/{chunk-5cpdbbeh.js → chunk-fc58cqry.js} +3 -1
  6. package/dist/{chunk-5cpdbbeh.js.map → chunk-fc58cqry.js.map} +4 -4
  7. package/dist/hosted-agent.js +5 -2
  8. package/dist/hosted-agent.js.map +6 -6
  9. package/dist/main.js +1228 -486
  10. package/dist/main.js.map +23 -22
  11. package/dist/mcp-factories.js +701 -97
  12. package/dist/mcp-factories.js.map +14 -14
  13. package/dist/prompts.js +8 -8
  14. package/dist/prompts.js.map +4 -4
  15. package/dist/query-runtime.js.map +1 -1
  16. package/dist/registry.js +3 -3
  17. package/dist/registry.js.map +2 -2
  18. package/dist/rollout.js +1 -1
  19. package/dist/runtime/src/agents/compaction-support.ts +1 -1
  20. package/dist/runtime/src/agents/idle-archiver.ts +3 -2
  21. package/dist/runtime/src/agents/maestro-provider.ts +3 -0
  22. package/dist/runtime/src/index.ts +1 -0
  23. package/dist/runtime/src/mcp/canonical-proxy-server.ts +18 -1
  24. package/dist/runtime/src/mcp/wiki-server.ts +801 -59
  25. package/dist/runtime/src/platform/mcp-config.ts +1 -0
  26. package/dist/runtime/src/prompts/agents/wiki-archiver.md +16 -6
  27. package/dist/runtime/src/prompts/builders.ts +17 -34
  28. package/dist/runtime/src/runtime/turn-event-stream.ts +26 -0
  29. package/dist/runtime/src/runtime/turn-runner.ts +34 -26
  30. package/dist/runtime/src/storage/api-topics.ts +13 -4
  31. package/dist/runtime/src/topics/lifecycle.ts +3 -2
  32. package/dist/runtime/src/types/api.ts +6 -0
  33. package/dist/runtime/src/types.ts +6 -0
  34. package/dist/runtime/src/version.ts +1 -1
  35. package/dist/runtime-helpers.js.map +1 -1
  36. package/dist/storage.js +12 -6
  37. package/dist/storage.js.map +4 -4
  38. package/dist/types/packages/core/src/agents/compaction-support.d.ts +1 -0
  39. package/dist/types/packages/core/src/mcp/wiki-server.d.ts +4 -0
  40. package/dist/types/packages/core/src/prompts/builders.d.ts +2 -4
  41. package/dist/types/packages/core/src/runtime/turn-runner.d.ts +4 -0
  42. package/dist/types/packages/core/src/storage/api-topics.d.ts +1 -0
  43. package/dist/types/packages/core/src/types/api.d.ts +6 -0
  44. package/dist/types/packages/core/src/types.d.ts +6 -0
  45. package/dist/types/packages/core/src/version.d.ts +1 -1
  46. package/dist/vault.js.map +1 -1
  47. package/package.json +2 -2
package/dist/storage.js CHANGED
@@ -1339,6 +1339,7 @@ function initializeApiTopicsSchema() {
1339
1339
  last_message_at TEXT,
1340
1340
  parent_topic_id TEXT,
1341
1341
  memory_topic_id TEXT,
1342
+ memory_key TEXT,
1342
1343
  is_fork INTEGER NOT NULL DEFAULT 0 CHECK (is_fork IN (0,1)),
1343
1344
  is_subagent INTEGER NOT NULL DEFAULT 0 CHECK (is_subagent IN (0,1)),
1344
1345
  visibility TEXT NOT NULL DEFAULT 'visible' CHECK (visibility IN ('visible','hidden')),
@@ -1388,8 +1389,8 @@ function initializeApiTopicsSchema() {
1388
1389
  const legacyBaseEffort = row.base_effort ?? row.default_effort;
1389
1390
  db.query(`INSERT INTO api_topics_next
1390
1391
  (id,title,kind,description,agent,base_model,base_effort,response_policy,
1391
- created_at,last_message_at,parent_topic_id,memory_topic_id,is_fork,is_subagent,visibility,access_mode,session_id)
1392
- VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)`).run(String(row.id), String(row.title), normalized.kind, typeof row.description === "string" ? row.description : null, normalized.agent ?? null, typeof legacyBaseModel === "string" ? legacyBaseModel : null, typeof legacyBaseEffort === "string" ? legacyBaseEffort : null, normalized.aiMode, String(row.created_at), typeof row.last_message_at === "string" ? row.last_message_at : null, typeof row.parent_topic_id === "string" ? row.parent_topic_id : null, typeof row.memory_topic_id === "string" ? row.memory_topic_id : null, Number(row.is_fork ?? 0) !== 0 ? 1 : 0, Number(row.is_subagent ?? 0) !== 0 ? 1 : 0, row.visibility === "hidden" ? "hidden" : "visible", row.access_mode === "shared" ? "shared" : "private", typeof row.session_id === "string" ? row.session_id : null);
1392
+ created_at,last_message_at,parent_topic_id,memory_topic_id,memory_key,is_fork,is_subagent,visibility,access_mode,session_id)
1393
+ VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)`).run(String(row.id), String(row.title), normalized.kind, typeof row.description === "string" ? row.description : null, normalized.agent ?? null, typeof legacyBaseModel === "string" ? legacyBaseModel : null, typeof legacyBaseEffort === "string" ? legacyBaseEffort : null, normalized.aiMode, String(row.created_at), typeof row.last_message_at === "string" ? row.last_message_at : null, typeof row.parent_topic_id === "string" ? row.parent_topic_id : null, typeof row.memory_topic_id === "string" ? row.memory_topic_id : null, typeof row.memory_key === "string" ? row.memory_key : null, Number(row.is_fork ?? 0) !== 0 ? 1 : 0, Number(row.is_subagent ?? 0) !== 0 ? 1 : 0, row.visibility === "hidden" ? "hidden" : "visible", row.access_mode === "shared" ? "shared" : "private", typeof row.session_id === "string" ? row.session_id : null);
1393
1394
  }
1394
1395
  db.exec("DROP TABLE IF EXISTS topic_members");
1395
1396
  db.exec("DROP TABLE api_topics");
@@ -1458,6 +1459,9 @@ function initializeApiTopicsSchema() {
1458
1459
  if (!tableColumns2("api_topics").has("memory_topic_id")) {
1459
1460
  db.exec("ALTER TABLE api_topics ADD COLUMN memory_topic_id TEXT");
1460
1461
  }
1462
+ if (!tableColumns2("api_topics").has("memory_key")) {
1463
+ db.exec("ALTER TABLE api_topics ADD COLUMN memory_key TEXT");
1464
+ }
1461
1465
  db.exec(`
1462
1466
  UPDATE api_topics
1463
1467
  SET browser_profile_owner = (
@@ -1519,6 +1523,7 @@ function rowToDto2(r, participants = getTopicParticipants(r.id), tellTargets) {
1519
1523
  lastMessageAt: r.last_message_at ?? new Date().toISOString(),
1520
1524
  parentTopicId: r.parent_topic_id ?? undefined,
1521
1525
  memoryTopicId: r.memory_topic_id ?? undefined,
1526
+ memoryKey: r.memory_key ?? undefined,
1522
1527
  isFork: r.is_fork !== 0,
1523
1528
  ...r.is_subagent !== 0 ? { isSubagent: true } : {},
1524
1529
  ...r.is_subagent !== 0 ? {
@@ -1613,9 +1618,9 @@ function upsertTopic(t) {
1613
1618
  db.transaction(() => {
1614
1619
  db.query(`INSERT INTO api_topics
1615
1620
  (id,title,kind,description,agent,base_model,base_effort,response_policy,
1616
- created_at,last_message_at,parent_topic_id,memory_topic_id,is_fork,is_subagent,visibility,access_mode,
1621
+ created_at,last_message_at,parent_topic_id,memory_topic_id,memory_key,is_fork,is_subagent,visibility,access_mode,
1617
1622
  subagent_report_mode)
1618
- VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
1623
+ VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
1619
1624
  ON CONFLICT(id) DO UPDATE SET
1620
1625
  title = excluded.title,
1621
1626
  kind = excluded.kind,
@@ -1628,11 +1633,12 @@ function upsertTopic(t) {
1628
1633
  last_message_at = excluded.last_message_at,
1629
1634
  parent_topic_id = excluded.parent_topic_id,
1630
1635
  memory_topic_id = excluded.memory_topic_id,
1636
+ memory_key = excluded.memory_key,
1631
1637
  is_fork = excluded.is_fork,
1632
1638
  is_subagent = excluded.is_subagent,
1633
1639
  visibility = excluded.visibility,
1634
1640
  access_mode = excluded.access_mode,
1635
- 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.isFork ? 1 : 0, t.isSubagent ? 1 : 0, normalizeTopicVisibility(t.visibility), normalizeTopicAccessMode(t.accessMode), t.subagentReportMode ?? "auto");
1641
+ 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), normalizeTopicAccessMode(t.accessMode), t.subagentReportMode ?? "auto");
1636
1642
  db.query("DELETE FROM topic_members WHERE topic_id = ?").run(t.id);
1637
1643
  for (const participant of t.participants) {
1638
1644
  db.query("INSERT INTO topic_members (topic_id,user_id,role) VALUES (?,?,?)").run(t.id, participant.userId, participant.role);
@@ -4166,4 +4172,4 @@ export {
4166
4172
  ConversationLogDivergedError
4167
4173
  };
4168
4174
 
4169
- //# debugId=0E9898BA8C097A7864756E2164756E21
4175
+ //# debugId=D0FC18F9A934EFB264756E2164756E21