negotium 0.6.4 → 0.6.6

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.
@@ -3019,7 +3019,7 @@ var init_codex = __esm(async () => {
3019
3019
  });
3020
3020
 
3021
3021
  // ../../packages/core/src/version.ts
3022
- var NEGOTIUM_VERSION = "0.6.4";
3022
+ var NEGOTIUM_VERSION = "0.6.6";
3023
3023
 
3024
3024
  // ../../packages/core/src/agents/codex-native-multi-agent.ts
3025
3025
  import { spawn as spawn2 } from "child_process";
@@ -4137,7 +4137,7 @@ var init_api_messages = __esm(async () => {
4137
4137
  });
4138
4138
 
4139
4139
  // ../../packages/core/src/platform/constants.ts
4140
- var FROM_AUTO_CONTINUE = "auto-continue", FROM_SELF_SCHEDULE = "self-schedule", RESERVED_TOPIC_NAMES, GENERAL_TOPIC_ID = "general";
4140
+ var FROM_AUTO_CONTINUE = "auto-continue", FROM_SELF_SCHEDULE = "self-schedule", RESERVED_TOPIC_NAMES, GENERAL_TOPIC_ID = "general", MANAGER_TOPIC_LOG_NAME = "general", NODE_LOCAL_USER_ID = "local";
4141
4141
  var init_constants = __esm(() => {
4142
4142
  RESERVED_TOPIC_NAMES = new Set([
4143
4143
  FROM_AUTO_CONTINUE,
@@ -7481,12 +7481,15 @@ import { dirname as dirname10, join as join15 } from "path";
7481
7481
  function conversationDir(_userId) {
7482
7482
  return join15(resolveStorageDataDir(), "conversations");
7483
7483
  }
7484
- function topicFilename(topicName) {
7484
+ function topicFilename(userId, topicName) {
7485
7485
  const t = sanitizeTopicName(topicName, true);
7486
- return `${t}.jsonl`;
7486
+ const owner = String(userId);
7487
+ if (t !== MANAGER_TOPIC_LOG_NAME || owner === NODE_LOCAL_USER_ID)
7488
+ return `${t}.jsonl`;
7489
+ return `${t}.${sanitizeId(owner)}.jsonl`;
7487
7490
  }
7488
7491
  function getConversationPath(userId, topicName) {
7489
- return join15(conversationDir(userId), topicFilename(topicName));
7492
+ return join15(conversationDir(userId), topicFilename(userId, topicName));
7490
7493
  }
7491
7494
  function getActiveConversationPath(userId, topicName) {
7492
7495
  const rawPath = getConversationPath(userId, topicName);
@@ -7576,6 +7579,7 @@ function replaceConversationPathStrict(path, entries) {
7576
7579
  }
7577
7580
  var ConversationLogDivergedError;
7578
7581
  var init_conversations = __esm(async () => {
7582
+ init_constants();
7579
7583
  init_jsonl();
7580
7584
  init_logger();
7581
7585
  await init_storage_host();
@@ -10856,12 +10860,15 @@ function createArchiverRuntime(host) {
10856
10860
  const agent = params.agent ?? "claude";
10857
10861
  const model = params.model;
10858
10862
  const outputLanguage = resolveMemoryLanguage();
10863
+ const generalReplyInstruction = `Reply with a short completion message in ${outputLanguage} for display in #General. ` + "Do not include tool-call logs or raw transcripts \u2014 just briefly name the summary / brief / articles you saved.";
10859
10864
  const prompt = mode === "active-topic" ? [
10860
10865
  `Recent idle conversation snapshot of session "${topicTitle}". Extract durable memory from the archive below and save it into this topic's wiki.`,
10861
10866
  `archive_path: ${archivePath}`,
10862
10867
  ...rawArchivePaths.map((path) => `raw_archive_path: ${path}`),
10863
10868
  `wiki_dir: ${wikiDir}`,
10864
- `output_language: ${outputLanguage}`
10869
+ `output_language: ${outputLanguage}`,
10870
+ "",
10871
+ generalReplyInstruction
10865
10872
  ].join(`
10866
10873
  `) : [
10867
10874
  `Session "${topicTitle}" was deleted. Extract durable memory from the archive below and save it into the wiki.`,
@@ -10870,7 +10877,7 @@ function createArchiverRuntime(host) {
10870
10877
  `wiki_dir: ${wikiDir}`,
10871
10878
  `output_language: ${outputLanguage}`,
10872
10879
  "",
10873
- `Reply with a short completion message in ${outputLanguage} for display in #General. ` + "Do not include tool-call logs or raw transcripts \u2014 just briefly name the summary / brief / articles you saved."
10880
+ generalReplyInstruction
10874
10881
  ].join(`
10875
10882
  `);
10876
10883
  const activeSessionId = `memory:${host.config.createId()}`;
@@ -10998,10 +11005,8 @@ function createArchiverRuntime(host) {
10998
11005
  host.config.warn({ err, userId, topicTitle }, "archiver: settlement callback failed");
10999
11006
  }
11000
11007
  }
11001
- if (mode === "deleted-topic") {
11002
- const text = finalText.trimEnd();
11003
- finalizeGeneralMemory(host, userId, topicTitle, messageCount, startMs, ok, topicId, ok && text ? { text, agent, model, usage } : undefined);
11004
- }
11008
+ const text = finalText.trimEnd();
11009
+ finalizeGeneralMemory(host, userId, topicTitle, messageCount, startMs, ok, mode, topicId, ok && text ? { text, agent, model, usage } : undefined);
11005
11010
  });
11006
11011
  topicQueues.set(safeTopic, work);
11007
11012
  work.finally(() => {
@@ -11047,7 +11052,7 @@ function findSummaryFile(storage, topicTitle, date, sinceMs, topicId) {
11047
11052
  }
11048
11053
  return best?.path ?? null;
11049
11054
  }
11050
- function finalizeGeneralMemory(host, userId, topicTitle, messageCount, startMs, ok, topicId, generalReply) {
11055
+ function finalizeGeneralMemory(host, userId, topicTitle, messageCount, startMs, ok, mode, topicId, generalReply) {
11051
11056
  const generalTopicId = host.storage.getGeneralTopicId(userId);
11052
11057
  const date = host.config.now().toISOString().slice(0, 10);
11053
11058
  try {
@@ -11064,7 +11069,7 @@ function finalizeGeneralMemory(host, userId, topicTitle, messageCount, startMs,
11064
11069
  ].slice(0, MAX_BRIEF_ENTRIES);
11065
11070
  const briefMd = `# Workspace Memory Hub
11066
11071
 
11067
- Recent memory digest distilled from deleted topics. Use \`wiki_query\` for details.
11072
+ Recent memory digest distilled from archived topics (deletions and idle/session-reset snapshots). Use \`wiki_query\` for details.
11068
11073
 
11069
11074
  ## Recent Archives
11070
11075
  ${rolled.join(`
@@ -11079,7 +11084,7 @@ ${rolled.join(`
11079
11084
  }
11080
11085
  try {
11081
11086
  const replyText = generalReply?.text.trim();
11082
- const text = replyText || (ok ? `\uD83D\uDDC2 Topic "${topicTitle}" was deleted and archived into #General memory.` : `\uD83D\uDDC2 Archived topic "${topicTitle}" (summary extraction failed \u2014 raw log preserved in wiki/archive).`);
11087
+ const text = replyText || (mode === "deleted-topic" ? ok ? `\uD83D\uDDC2 Topic "${topicTitle}" was deleted and archived into #General memory.` : `\uD83D\uDDC2 Archived topic "${topicTitle}" (summary extraction failed \u2014 raw log preserved in wiki/archive).` : ok ? `\uD83D\uDDC2 Session "${topicTitle}" was snapshotted and archived into #General memory.` : `\uD83D\uDDC2 Archived a snapshot of "${topicTitle}" (summary extraction failed \u2014 raw log preserved in wiki/archive).`);
11083
11088
  const replyMeta = generalReply && replyText ? {
11084
11089
  authorId: "ai",
11085
11090
  agentType: generalReply.agent,
@@ -21547,4 +21552,4 @@ export {
21547
21552
  createAgentHealthMcpServer
21548
21553
  };
21549
21554
 
21550
- //# debugId=17A2FD732002839B64756E2164756E21
21555
+ //# debugId=84FF0128D358C07F64756E2164756E21