@agentmemory/agentmemory 0.9.27 → 0.9.28

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 (122) hide show
  1. package/AGENTS.md +5 -5
  2. package/README.md +97 -37
  3. package/dist/cli.d.mts.map +1 -1
  4. package/dist/cli.mjs +206 -154
  5. package/dist/cli.mjs.map +1 -1
  6. package/dist/config-ChC9EtgV.mjs +259 -0
  7. package/dist/config-ChC9EtgV.mjs.map +1 -0
  8. package/dist/{connect-bmZ5eqYN.mjs → connect-JnsJXc68.mjs} +136 -42
  9. package/dist/connect-JnsJXc68.mjs.map +1 -0
  10. package/dist/hooks/notification.mjs +2 -1
  11. package/dist/hooks/notification.mjs.map +1 -1
  12. package/dist/hooks/post-commit.mjs +2 -1
  13. package/dist/hooks/post-commit.mjs.map +1 -1
  14. package/dist/hooks/post-tool-failure.mjs +2 -1
  15. package/dist/hooks/post-tool-failure.mjs.map +1 -1
  16. package/dist/hooks/post-tool-use.mjs +2 -1
  17. package/dist/hooks/post-tool-use.mjs.map +1 -1
  18. package/dist/hooks/pre-compact.mjs +2 -1
  19. package/dist/hooks/pre-compact.mjs.map +1 -1
  20. package/dist/hooks/pre-tool-use.mjs +2 -1
  21. package/dist/hooks/pre-tool-use.mjs.map +1 -1
  22. package/dist/hooks/prompt-submit.mjs +2 -1
  23. package/dist/hooks/prompt-submit.mjs.map +1 -1
  24. package/dist/hooks/session-end.mjs +2 -1
  25. package/dist/hooks/session-end.mjs.map +1 -1
  26. package/dist/hooks/session-start.mjs +2 -1
  27. package/dist/hooks/session-start.mjs.map +1 -1
  28. package/dist/hooks/stop.mjs +2 -1
  29. package/dist/hooks/stop.mjs.map +1 -1
  30. package/dist/hooks/subagent-start.mjs +2 -1
  31. package/dist/hooks/subagent-start.mjs.map +1 -1
  32. package/dist/hooks/subagent-stop.mjs +2 -1
  33. package/dist/hooks/subagent-stop.mjs.map +1 -1
  34. package/dist/hooks/task-completed.mjs +2 -1
  35. package/dist/hooks/task-completed.mjs.map +1 -1
  36. package/dist/image-refs-BKLmp_sD.mjs +34 -0
  37. package/dist/image-refs-BKLmp_sD.mjs.map +1 -0
  38. package/dist/{image-refs-B5Zf_Djo.mjs → image-refs-C2YU7BIm.mjs} +3 -21
  39. package/dist/image-refs-C2YU7BIm.mjs.map +1 -0
  40. package/dist/index.mjs +118 -150
  41. package/dist/index.mjs.map +1 -1
  42. package/dist/{image-store-Gpo2mgM9.mjs → keyed-mutex-DTHtcZrt.mjs} +14 -11
  43. package/dist/keyed-mutex-DTHtcZrt.mjs.map +1 -0
  44. package/dist/{logger-yHTcEBAI.mjs → logger-BEB7pCI9.mjs} +1 -1
  45. package/dist/{logger-yHTcEBAI.mjs.map → logger-BEB7pCI9.mjs.map} +1 -1
  46. package/dist/{src-MOg2zKJs.mjs → src-CzgoepGU.mjs} +49 -30
  47. package/dist/src-CzgoepGU.mjs.map +1 -0
  48. package/dist/{standalone-BORXC71-.mjs → standalone-YsZFFQBM.mjs} +7 -4
  49. package/dist/standalone-YsZFFQBM.mjs.map +1 -0
  50. package/dist/standalone.d.mts.map +1 -1
  51. package/dist/standalone.mjs +6 -2
  52. package/dist/standalone.mjs.map +1 -1
  53. package/dist/{tools-registry-D8XVVPbJ.mjs → tools-registry-D3NEoe5m.mjs} +4 -256
  54. package/dist/tools-registry-D3NEoe5m.mjs.map +1 -0
  55. package/package.json +4 -1
  56. package/plugin/.claude-plugin/plugin.json +1 -1
  57. package/plugin/.codex-plugin/plugin.json +1 -1
  58. package/plugin/plugin.json +2 -2
  59. package/plugin/scripts/notification.mjs +2 -1
  60. package/plugin/scripts/notification.mjs.map +1 -1
  61. package/plugin/scripts/post-commit.mjs +2 -1
  62. package/plugin/scripts/post-commit.mjs.map +1 -1
  63. package/plugin/scripts/post-tool-failure.mjs +2 -1
  64. package/plugin/scripts/post-tool-failure.mjs.map +1 -1
  65. package/plugin/scripts/post-tool-use.mjs +2 -1
  66. package/plugin/scripts/post-tool-use.mjs.map +1 -1
  67. package/plugin/scripts/pre-compact.mjs +2 -1
  68. package/plugin/scripts/pre-compact.mjs.map +1 -1
  69. package/plugin/scripts/pre-tool-use.mjs +2 -1
  70. package/plugin/scripts/pre-tool-use.mjs.map +1 -1
  71. package/plugin/scripts/prompt-submit.mjs +2 -1
  72. package/plugin/scripts/prompt-submit.mjs.map +1 -1
  73. package/plugin/scripts/session-end.mjs +2 -1
  74. package/plugin/scripts/session-end.mjs.map +1 -1
  75. package/plugin/scripts/session-start.mjs +2 -1
  76. package/plugin/scripts/session-start.mjs.map +1 -1
  77. package/plugin/scripts/stop.mjs +2 -1
  78. package/plugin/scripts/stop.mjs.map +1 -1
  79. package/plugin/scripts/subagent-start.mjs +2 -1
  80. package/plugin/scripts/subagent-start.mjs.map +1 -1
  81. package/plugin/scripts/subagent-stop.mjs +2 -1
  82. package/plugin/scripts/subagent-stop.mjs.map +1 -1
  83. package/plugin/scripts/task-completed.mjs +2 -1
  84. package/plugin/scripts/task-completed.mjs.map +1 -1
  85. package/plugin/skills/_shared/TROUBLESHOOTING.md +38 -0
  86. package/plugin/skills/agentmemory-agents/REFERENCE.md +28 -0
  87. package/plugin/skills/agentmemory-agents/SKILL.md +34 -0
  88. package/plugin/skills/agentmemory-architecture/SKILL.md +33 -0
  89. package/plugin/skills/agentmemory-config/REFERENCE.md +42 -0
  90. package/plugin/skills/agentmemory-config/SKILL.md +37 -0
  91. package/plugin/skills/agentmemory-hooks/REFERENCE.md +20 -0
  92. package/plugin/skills/agentmemory-hooks/SKILL.md +39 -0
  93. package/plugin/skills/agentmemory-mcp-tools/REFERENCE.md +65 -0
  94. package/plugin/skills/agentmemory-mcp-tools/SKILL.md +39 -0
  95. package/plugin/skills/agentmemory-rest-api/REFERENCE.md +129 -0
  96. package/plugin/skills/agentmemory-rest-api/SKILL.md +43 -0
  97. package/plugin/skills/commit-context/EXAMPLES.md +71 -0
  98. package/plugin/skills/commit-context/SKILL.md +53 -8
  99. package/plugin/skills/commit-history/EXAMPLES.md +71 -0
  100. package/plugin/skills/commit-history/SKILL.md +51 -9
  101. package/plugin/skills/forget/EXAMPLES.md +75 -0
  102. package/plugin/skills/forget/SKILL.md +54 -14
  103. package/plugin/skills/handoff/EXAMPLES.md +56 -0
  104. package/plugin/skills/handoff/SKILL.md +56 -9
  105. package/plugin/skills/recall/EXAMPLES.md +74 -0
  106. package/plugin/skills/recall/SKILL.md +50 -11
  107. package/plugin/skills/recap/EXAMPLES.md +60 -0
  108. package/plugin/skills/recap/SKILL.md +51 -13
  109. package/plugin/skills/remember/EXAMPLES.md +67 -0
  110. package/plugin/skills/remember/SKILL.md +53 -17
  111. package/plugin/skills/session-history/EXAMPLES.md +59 -0
  112. package/plugin/skills/session-history/SKILL.md +54 -11
  113. package/plugin/skills/write-agentmemory-skill/SKILL.md +40 -0
  114. package/dist/connect-bmZ5eqYN.mjs.map +0 -1
  115. package/dist/image-refs-B5Zf_Djo.mjs.map +0 -1
  116. package/dist/image-store-Gpo2mgM9.mjs.map +0 -1
  117. package/dist/rolldown-runtime-twds-ZHy.mjs +0 -14
  118. package/dist/src-MOg2zKJs.mjs.map +0 -1
  119. package/dist/standalone-BORXC71-.mjs.map +0 -1
  120. package/dist/tools-registry-D8XVVPbJ.mjs.map +0 -1
  121. package/dist/version-9DNrRyph.mjs +0 -6
  122. package/dist/version-9DNrRyph.mjs.map +0 -1
@@ -1,18 +1,9 @@
1
- import { t as __exportAll } from "./rolldown-runtime-twds-ZHy.mjs";
2
1
  import { existsSync } from "node:fs";
3
2
  import { join, resolve, sep } from "node:path";
4
3
  import { homedir } from "node:os";
5
4
  import { createHash } from "node:crypto";
6
5
  import { mkdir, stat, unlink, utimes, writeFile } from "node:fs/promises";
7
6
  //#region src/utils/image-store.ts
8
- var image_store_exports = /* @__PURE__ */ __exportAll({
9
- IMAGES_DIR: () => IMAGES_DIR,
10
- deleteImage: () => deleteImage,
11
- getMaxBytes: () => getMaxBytes,
12
- isManagedImagePath: () => isManagedImagePath,
13
- saveImageToDisk: () => saveImageToDisk,
14
- touchImage: () => touchImage
15
- });
16
7
  const IMAGES_DIR = join(homedir(), ".agentmemory", "images");
17
8
  const DEFAULT_MAX_BYTES = 500 * 1024 * 1024;
18
9
  function getMaxBytes() {
@@ -80,6 +71,18 @@ async function touchImage(filePath) {
80
71
  } catch (err) {}
81
72
  }
82
73
  //#endregion
83
- export { isManagedImagePath as a, image_store_exports as i, deleteImage as n, touchImage as o, getMaxBytes as r, IMAGES_DIR as t };
74
+ //#region src/state/keyed-mutex.ts
75
+ const locks = /* @__PURE__ */ new Map();
76
+ function withKeyedLock(key, fn) {
77
+ const next = (locks.get(key) ?? Promise.resolve()).then(fn, fn);
78
+ const cleanup = next.then(() => {}, () => {});
79
+ locks.set(key, cleanup);
80
+ cleanup.then(() => {
81
+ if (locks.get(key) === cleanup) locks.delete(key);
82
+ });
83
+ return next;
84
+ }
85
+ //#endregion
86
+ export { isManagedImagePath as a, getMaxBytes as i, IMAGES_DIR as n, saveImageToDisk as o, deleteImage as r, touchImage as s, withKeyedLock as t };
84
87
 
85
- //# sourceMappingURL=image-store-Gpo2mgM9.mjs.map
88
+ //# sourceMappingURL=keyed-mutex-DTHtcZrt.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"keyed-mutex-DTHtcZrt.mjs","names":[],"sources":["../src/utils/image-store.ts","../src/state/keyed-mutex.ts"],"sourcesContent":["import { homedir } from \"node:os\";\nimport { join, resolve, sep } from \"node:path\";\nimport { existsSync } from \"node:fs\";\nimport { mkdir, writeFile, unlink, utimes, stat } from \"node:fs/promises\";\nimport { createHash } from \"node:crypto\";\n\nexport const IMAGES_DIR = join(homedir(), \".agentmemory\", \"images\");\n\nconst DEFAULT_MAX_BYTES = 500 * 1024 * 1024;\n\nexport function getMaxBytes(): number {\n return Number(process.env.AGENTMEMORY_IMAGE_STORE_MAX_BYTES) || DEFAULT_MAX_BYTES;\n}\n\nexport function isManagedImagePath(filePath: string): boolean {\n const resolved = resolve(filePath);\n const normalizedImagesDir = resolve(IMAGES_DIR);\n return resolved.startsWith(normalizedImagesDir + sep) || resolved === normalizedImagesDir;\n}\n\nfunction contentHash(data: string): string {\n return createHash(\"sha256\").update(data).digest(\"hex\");\n}\n\nexport async function saveImageToDisk(base64Data: string): Promise<{ filePath: string; bytesWritten: number }> {\n if (!base64Data) return { filePath: \"\", bytesWritten: 0 };\n\n if (!existsSync(IMAGES_DIR)) {\n await mkdir(IMAGES_DIR, { recursive: true });\n }\n\n let cleanBase64 = base64Data;\n let ext = \"png\";\n\n if (base64Data.startsWith(\"data:image/\")) {\n const commaIdx = base64Data.indexOf(\",\");\n if (commaIdx !== -1) {\n const meta = base64Data.substring(0, commaIdx);\n if (meta.includes(\"jpeg\") || meta.includes(\"jpg\")) ext = \"jpg\";\n else if (meta.includes(\"webp\")) ext = \"webp\";\n else if (meta.includes(\"gif\")) ext = \"gif\";\n cleanBase64 = base64Data.substring(commaIdx + 1);\n }\n } else if (base64Data.startsWith(\"/9j/\")) {\n ext = \"jpg\";\n }\n\n const hash = contentHash(cleanBase64);\n const filePath = join(IMAGES_DIR, `${hash}.${ext}`);\n\n if (existsSync(filePath)) {\n return { filePath, bytesWritten: 0 };\n }\n\n const buffer = Buffer.from(cleanBase64, \"base64\");\n await writeFile(filePath, buffer);\n\n const s = await stat(filePath);\n\n return { filePath, bytesWritten: s.size };\n}\n\nexport async function deleteImage(filePath: string | undefined): Promise<{ deletedBytes: number }> {\n if (!filePath) return { deletedBytes: 0 };\n if (!isManagedImagePath(filePath)) return { deletedBytes: 0 };\n try {\n if (existsSync(filePath)) {\n const s = await stat(filePath);\n const size = s.size;\n await unlink(filePath);\n return { deletedBytes: size };\n }\n } catch (err) {\n console.error(\"[agentmemory] Failed to delete image context:\", err);\n }\n return { deletedBytes: 0 };\n}\n\n/** Touch an image file to update its mtime (marking it as recently used for LRU eviction) */\nexport async function touchImage(filePath: string): Promise<void> {\n if (!filePath || !isManagedImagePath(filePath)) return;\n try {\n if (existsSync(filePath)) {\n const now = new Date();\n await utimes(filePath, now, now);\n }\n } catch (err) {\n // Ignore touch errors silently\n }\n}\n","const locks = new Map<string, Promise<void>>();\n\nexport function withKeyedLock<T>(\n key: string,\n fn: () => Promise<T>,\n): Promise<T> {\n const prev = locks.get(key) ?? Promise.resolve();\n const next = prev.then(fn, fn);\n const cleanup = next.then(\n () => {},\n () => {},\n );\n locks.set(key, cleanup);\n cleanup.then(() => {\n if (locks.get(key) === cleanup) locks.delete(key);\n });\n return next;\n}\n"],"mappings":";;;;;;AAMA,MAAa,aAAa,KAAK,SAAS,EAAE,gBAAgB,SAAS;AAEnE,MAAM,oBAAoB,MAAM,OAAO;AAEvC,SAAgB,cAAsB;AACpC,QAAO,OAAO,QAAQ,IAAI,kCAAkC,IAAI;;AAGlE,SAAgB,mBAAmB,UAA2B;CAC5D,MAAM,WAAW,QAAQ,SAAS;CAClC,MAAM,sBAAsB,QAAQ,WAAW;AAC/C,QAAO,SAAS,WAAW,sBAAsB,IAAI,IAAI,aAAa;;AAGxE,SAAS,YAAY,MAAsB;AACzC,QAAO,WAAW,SAAS,CAAC,OAAO,KAAK,CAAC,OAAO,MAAM;;AAGxD,eAAsB,gBAAgB,YAAyE;AAC7G,KAAI,CAAC,WAAY,QAAO;EAAE,UAAU;EAAI,cAAc;EAAG;AAEzD,KAAI,CAAC,WAAW,WAAW,CACzB,OAAM,MAAM,YAAY,EAAE,WAAW,MAAM,CAAC;CAG9C,IAAI,cAAc;CAClB,IAAI,MAAM;AAEV,KAAI,WAAW,WAAW,cAAc,EAAE;EACvC,MAAM,WAAW,WAAW,QAAQ,IAAI;AACxC,MAAI,aAAa,IAAI;GACnB,MAAM,OAAO,WAAW,UAAU,GAAG,SAAS;AAC9C,OAAI,KAAK,SAAS,OAAO,IAAI,KAAK,SAAS,MAAM,CAAE,OAAM;YAChD,KAAK,SAAS,OAAO,CAAE,OAAM;YAC7B,KAAK,SAAS,MAAM,CAAE,OAAM;AACrC,iBAAc,WAAW,UAAU,WAAW,EAAE;;YAE1C,WAAW,WAAW,OAAO,CACrC,OAAM;CAIT,MAAM,WAAW,KAAK,YAAY,GADrB,YAAY,YACgB,CAAC,GAAG,MAAM;AAEnD,KAAI,WAAW,SAAS,CACtB,QAAO;EAAE;EAAU,cAAc;EAAG;AAItC,OAAM,UAAU,UADD,OAAO,KAAK,aAAa,SACR,CAAC;AAIjC,QAAO;EAAE;EAAU,eAAc,MAFjB,KAAK,SAAS,EAEK;EAAM;;AAG3C,eAAsB,YAAY,UAAiE;AACjG,KAAI,CAAC,SAAU,QAAO,EAAE,cAAc,GAAG;AACzC,KAAI,CAAC,mBAAmB,SAAS,CAAE,QAAO,EAAE,cAAc,GAAG;AAC7D,KAAI;AACF,MAAI,WAAW,SAAS,EAAE;GAExB,MAAM,QAAO,MADG,KAAK,SAAS,EACf;AACf,SAAM,OAAO,SAAS;AACtB,UAAO,EAAE,cAAc,MAAM;;UAExB,KAAK;AACZ,UAAQ,MAAM,iDAAiD,IAAI;;AAErE,QAAO,EAAE,cAAc,GAAG;;;AAI5B,eAAsB,WAAW,UAAiC;AAChE,KAAI,CAAC,YAAY,CAAC,mBAAmB,SAAS,CAAE;AAChD,KAAI;AACF,MAAI,WAAW,SAAS,EAAE;GACxB,MAAM,sBAAM,IAAI,MAAM;AACtB,SAAM,OAAO,UAAU,KAAK,IAAI;;UAE3B,KAAK;;;;ACtFhB,MAAM,wBAAQ,IAAI,KAA4B;AAE9C,SAAgB,cACd,KACA,IACY;CAEZ,MAAM,QADO,MAAM,IAAI,IAAI,IAAI,QAAQ,SAAS,EAC9B,KAAK,IAAI,GAAG;CAC9B,MAAM,UAAU,KAAK,WACb,UACA,GACP;AACD,OAAM,IAAI,KAAK,QAAQ;AACvB,SAAQ,WAAW;AACjB,MAAI,MAAM,IAAI,IAAI,KAAK,QAAS,OAAM,OAAO,IAAI;GACjD;AACF,QAAO"}
@@ -40,4 +40,4 @@ function bootLog(msg) {
40
40
  //#endregion
41
41
  export { logger as n, setBootVerbose as r, bootLog as t };
42
42
 
43
- //# sourceMappingURL=logger-yHTcEBAI.mjs.map
43
+ //# sourceMappingURL=logger-BEB7pCI9.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"logger-yHTcEBAI.mjs","names":[],"sources":["../src/logger.ts"],"sourcesContent":["// Thin logging shim for agentmemory.\n//\n// iii-sdk v0.11 dropped `getContext()`, which had been the source of a\n// contextual logger in every function handler (`getContext().logger`).\n// Migrating directly to the v0.11 OTEL-based `getLogger()` would force\n// every call site to care about the OTEL Logger API shape (`emit(...)`\n// with severity numbers and attributes maps). Instead, this module\n// exposes a single `logger` singleton with the same `.info/.warn/.error`\n// signature the old code used, so the mechanical replacement across\n// 30+ function files is: drop the `getContext` import, drop the\n// `const ctx = getContext();` line, and rename `ctx.logger.*` to\n// `logger.*`. Nothing else changes.\n//\n// Output goes to stderr as `[agentmemory] <level> <msg> <json-fields>`.\n// The iii-engine's `iii-exec` worker runs the agentmemory binary as a\n// child process and forwards stderr into `docker logs\n// agentmemory-iii-engine-1`, so these lines end up next to the engine's\n// own output without needing any OTEL wiring. If we later want\n// structured OTEL logs, this file is the only thing that changes.\n//\n// See rohitg00/agentmemory#143 follow-up — the #116 migration updated\n// test mocks but left the real `getContext()` imports in place, which\n// passed `npm test` (tests mock iii-sdk) and `npm run build` (tsdown\n// doesn't type-check) but crashed `node dist/index.mjs` on first\n// import.\n\ntype Fields = Record<string, unknown> | undefined;\n\nfunction fmt(level: string, msg: string, fields: Fields): string {\n if (!fields || Object.keys(fields).length === 0) {\n return `[agentmemory] ${level} ${msg}`;\n }\n try {\n return `[agentmemory] ${level} ${msg} ${JSON.stringify(fields)}`;\n } catch {\n // Fields contained a circular reference or a BigInt — fall back\n // to the plain message so a log line never throws.\n return `[agentmemory] ${level} ${msg}`;\n }\n}\n\nfunction emit(level: string, msg: string, fields: Fields): void {\n try {\n process.stderr.write(fmt(level, msg, fields) + \"\\n\");\n } catch {\n // stderr is unavailable in some weird test/worker contexts — swallow\n // so no log line can ever crash a handler.\n }\n}\n\nexport const logger = {\n info(msg: string, fields?: Fields): void {\n emit(\"info\", msg, fields);\n },\n warn(msg: string, fields?: Fields): void {\n emit(\"warn\", msg, fields);\n },\n error(msg: string, fields?: Fields): void {\n emit(\"error\", msg, fields);\n },\n};\n\n// ---------- boot log ----------\n//\n// `bootLog` is for the one-shot status lines that every register-*\n// function used to dump via `console.log` during engine startup. On a\n// fresh install that's ~25 lines of `[agentmemory] X enabled` noise\n// before the user can see a prompt. In quiet mode (default), each\n// line is captured into a buffer and discarded; the CLI surfaces a\n// single compressed summary instead. In verbose mode (set by\n// `--verbose` or `AGENTMEMORY_VERBOSE=1`) the lines pass straight\n// through to stderr exactly like the old console.log calls.\n\nlet bootVerbose =\n process.env[\"AGENTMEMORY_VERBOSE\"] === \"1\" ||\n process.env[\"AGENTMEMORY_VERBOSE\"] === \"true\";\n\nconst bootBuffer: string[] = [];\n\nexport function setBootVerbose(enabled: boolean): void {\n bootVerbose = enabled;\n}\n\nexport function isBootVerbose(): boolean {\n return bootVerbose;\n}\n\nexport function bootLog(msg: string): void {\n if (bootVerbose) {\n try {\n process.stderr.write(`[agentmemory] ${msg}\\n`);\n } catch {\n // stderr unavailable — drop.\n }\n return;\n }\n if (bootBuffer.length < 500) bootBuffer.push(msg);\n}\n\nexport function bootWarn(msg: string): void {\n // Warnings always surface; they're rare and the user needs to see\n // them even when the rest of the boot log is suppressed.\n try {\n process.stderr.write(`[agentmemory] warn ${msg}\\n`);\n } catch {}\n}\n\nexport function getBootBuffer(): readonly string[] {\n return bootBuffer;\n}\n"],"mappings":";AA4BA,SAAS,IAAI,OAAe,KAAa,QAAwB;AAC/D,KAAI,CAAC,UAAU,OAAO,KAAK,OAAO,CAAC,WAAW,EAC5C,QAAO,iBAAiB,MAAM,GAAG;AAEnC,KAAI;AACF,SAAO,iBAAiB,MAAM,GAAG,IAAI,GAAG,KAAK,UAAU,OAAO;SACxD;AAGN,SAAO,iBAAiB,MAAM,GAAG;;;AAIrC,SAAS,KAAK,OAAe,KAAa,QAAsB;AAC9D,KAAI;AACF,UAAQ,OAAO,MAAM,IAAI,OAAO,KAAK,OAAO,GAAG,KAAK;SAC9C;;AAMV,MAAa,SAAS;CACpB,KAAK,KAAa,QAAuB;AACvC,OAAK,QAAQ,KAAK,OAAO;;CAE3B,KAAK,KAAa,QAAuB;AACvC,OAAK,QAAQ,KAAK,OAAO;;CAE3B,MAAM,KAAa,QAAuB;AACxC,OAAK,SAAS,KAAK,OAAO;;CAE7B;AAaD,IAAI,cACF,QAAQ,IAAI,2BAA2B,OACvC,QAAQ,IAAI,2BAA2B;AAEzC,MAAM,aAAuB,EAAE;AAE/B,SAAgB,eAAe,SAAwB;AACrD,eAAc;;AAOhB,SAAgB,QAAQ,KAAmB;AACzC,KAAI,aAAa;AACf,MAAI;AACF,WAAQ,OAAO,MAAM,iBAAiB,IAAI,IAAI;UACxC;AAGR;;AAEF,KAAI,WAAW,SAAS,IAAK,YAAW,KAAK,IAAI"}
1
+ {"version":3,"file":"logger-BEB7pCI9.mjs","names":[],"sources":["../src/logger.ts"],"sourcesContent":["// Thin logging shim for agentmemory.\n//\n// iii-sdk v0.11 dropped `getContext()`, which had been the source of a\n// contextual logger in every function handler (`getContext().logger`).\n// Migrating directly to the v0.11 OTEL-based `getLogger()` would force\n// every call site to care about the OTEL Logger API shape (`emit(...)`\n// with severity numbers and attributes maps). Instead, this module\n// exposes a single `logger` singleton with the same `.info/.warn/.error`\n// signature the old code used, so the mechanical replacement across\n// 30+ function files is: drop the `getContext` import, drop the\n// `const ctx = getContext();` line, and rename `ctx.logger.*` to\n// `logger.*`. Nothing else changes.\n//\n// Output goes to stderr as `[agentmemory] <level> <msg> <json-fields>`.\n// The iii-engine's `iii-exec` worker runs the agentmemory binary as a\n// child process and forwards stderr into `docker logs\n// agentmemory-iii-engine-1`, so these lines end up next to the engine's\n// own output without needing any OTEL wiring. If we later want\n// structured OTEL logs, this file is the only thing that changes.\n//\n// See rohitg00/agentmemory#143 follow-up — the #116 migration updated\n// test mocks but left the real `getContext()` imports in place, which\n// passed `npm test` (tests mock iii-sdk) and `npm run build` (tsdown\n// doesn't type-check) but crashed `node dist/index.mjs` on first\n// import.\n\ntype Fields = Record<string, unknown> | undefined;\n\nfunction fmt(level: string, msg: string, fields: Fields): string {\n if (!fields || Object.keys(fields).length === 0) {\n return `[agentmemory] ${level} ${msg}`;\n }\n try {\n return `[agentmemory] ${level} ${msg} ${JSON.stringify(fields)}`;\n } catch {\n // Fields contained a circular reference or a BigInt — fall back\n // to the plain message so a log line never throws.\n return `[agentmemory] ${level} ${msg}`;\n }\n}\n\nfunction emit(level: string, msg: string, fields: Fields): void {\n try {\n process.stderr.write(fmt(level, msg, fields) + \"\\n\");\n } catch {\n // stderr is unavailable in some weird test/worker contexts — swallow\n // so no log line can ever crash a handler.\n }\n}\n\nexport const logger = {\n info(msg: string, fields?: Fields): void {\n emit(\"info\", msg, fields);\n },\n warn(msg: string, fields?: Fields): void {\n emit(\"warn\", msg, fields);\n },\n error(msg: string, fields?: Fields): void {\n emit(\"error\", msg, fields);\n },\n};\n\n// ---------- boot log ----------\n//\n// `bootLog` is for the one-shot status lines that every register-*\n// function used to dump via `console.log` during engine startup. On a\n// fresh install that's ~25 lines of `[agentmemory] X enabled` noise\n// before the user can see a prompt. In quiet mode (default), each\n// line is captured into a buffer and discarded; the CLI surfaces a\n// single compressed summary instead. In verbose mode (set by\n// `--verbose` or `AGENTMEMORY_VERBOSE=1`) the lines pass straight\n// through to stderr exactly like the old console.log calls.\n\nlet bootVerbose =\n process.env[\"AGENTMEMORY_VERBOSE\"] === \"1\" ||\n process.env[\"AGENTMEMORY_VERBOSE\"] === \"true\";\n\nconst bootBuffer: string[] = [];\n\nexport function setBootVerbose(enabled: boolean): void {\n bootVerbose = enabled;\n}\n\nexport function isBootVerbose(): boolean {\n return bootVerbose;\n}\n\nexport function bootLog(msg: string): void {\n if (bootVerbose) {\n try {\n process.stderr.write(`[agentmemory] ${msg}\\n`);\n } catch {\n // stderr unavailable — drop.\n }\n return;\n }\n if (bootBuffer.length < 500) bootBuffer.push(msg);\n}\n\nexport function bootWarn(msg: string): void {\n // Warnings always surface; they're rare and the user needs to see\n // them even when the rest of the boot log is suppressed.\n try {\n process.stderr.write(`[agentmemory] warn ${msg}\\n`);\n } catch {}\n}\n\nexport function getBootBuffer(): readonly string[] {\n return bootBuffer;\n}\n"],"mappings":";AA4BA,SAAS,IAAI,OAAe,KAAa,QAAwB;AAC/D,KAAI,CAAC,UAAU,OAAO,KAAK,OAAO,CAAC,WAAW,EAC5C,QAAO,iBAAiB,MAAM,GAAG;AAEnC,KAAI;AACF,SAAO,iBAAiB,MAAM,GAAG,IAAI,GAAG,KAAK,UAAU,OAAO;SACxD;AAGN,SAAO,iBAAiB,MAAM,GAAG;;;AAIrC,SAAS,KAAK,OAAe,KAAa,QAAsB;AAC9D,KAAI;AACF,UAAQ,OAAO,MAAM,IAAI,OAAO,KAAK,OAAO,GAAG,KAAK;SAC9C;;AAMV,MAAa,SAAS;CACpB,KAAK,KAAa,QAAuB;AACvC,OAAK,QAAQ,KAAK,OAAO;;CAE3B,KAAK,KAAa,QAAuB;AACvC,OAAK,QAAQ,KAAK,OAAO;;CAE3B,MAAM,KAAa,QAAuB;AACxC,OAAK,SAAS,KAAK,OAAO;;CAE7B;AAaD,IAAI,cACF,QAAQ,IAAI,2BAA2B,OACvC,QAAQ,IAAI,2BAA2B;AAEzC,MAAM,aAAuB,EAAE;AAE/B,SAAgB,eAAe,SAAwB;AACrD,eAAc;;AAOhB,SAAgB,QAAQ,KAAmB;AACzC,KAAI,aAAa;AACf,MAAI;AACF,WAAQ,OAAO,MAAM,iBAAiB,IAAI,IAAI;UACxC;AAGR;;AAEF,KAAI,WAAW,SAAS,IAAK,YAAW,KAAK,IAAI"}
@@ -1,9 +1,8 @@
1
1
  import { a as jaccardSimilarity, i as generateId, n as STREAM, r as fingerprintId, t as KV } from "./schema-CNiCWzV9.mjs";
2
- import { n as logger, t as bootLog } from "./logger-yHTcEBAI.mjs";
3
- import { t as VERSION } from "./version-9DNrRyph.mjs";
4
- import { a as isManagedImagePath, n as deleteImage, r as getMaxBytes, t as IMAGES_DIR } from "./image-store-Gpo2mgM9.mjs";
5
- import { r as withKeyedLock, t as getImageRefCount } from "./image-refs-B5Zf_Djo.mjs";
6
- import { _ as loadConfig, a as getAgentId, b as loadSnapshotConfig, c as getFollowupWindowSeconds, d as isAutoCompressEnabled, f as isConsolidationEnabled, g as loadClaudeBridgeConfig, h as isGraphExtractionEnabled, i as detectLlmProviderKind, m as isDropStaleIndexEnabled, n as getVisibleTools, o as getConsolidationDecayDays, p as isContextInjectionEnabled, r as detectEmbeddingProvider, s as getEnvVar, t as getAllTools, u as isAgentScopeIsolated, v as loadEmbeddingConfig, x as loadTeamConfig, y as loadFallbackConfig } from "./tools-registry-D8XVVPbJ.mjs";
2
+ import { n as logger, t as bootLog } from "./logger-BEB7pCI9.mjs";
3
+ import { i as VERSION, n as getAllTools, r as getVisibleTools } from "./tools-registry-D3NEoe5m.mjs";
4
+ import { a as isManagedImagePath, i as getMaxBytes, n as IMAGES_DIR, o as saveImageToDisk, r as deleteImage, t as withKeyedLock } from "./keyed-mutex-DTHtcZrt.mjs";
5
+ import { _ as loadFallbackConfig, a as getEnvVar, c as isAgentScopeIsolated, d as isContextInjectionEnabled, f as isDropStaleIndexEnabled, g as loadEmbeddingConfig, h as loadConfig, i as getConsolidationDecayDays, l as isAutoCompressEnabled, m as loadClaudeBridgeConfig, n as detectLlmProviderKind, o as getFollowupWindowSeconds, p as isGraphExtractionEnabled, r as getAgentId, t as detectEmbeddingProvider, u as isConsolidationEnabled, v as loadSnapshotConfig, y as loadTeamConfig } from "./config-ChC9EtgV.mjs";
7
6
  import { createRequire } from "node:module";
8
7
  import { execFile } from "node:child_process";
9
8
  import { constants, existsSync, mkdirSync, readFileSync, unlinkSync, writeFileSync } from "node:fs";
@@ -3337,10 +3336,9 @@ function registerObserveFunction(sdk, kv, dedupMap, maxObservationsPerSession) {
3337
3336
  const inheritedAgentId = existingSession ? existingSession.agentId : getAgentId();
3338
3337
  if (inheritedAgentId) raw.agentId = inheritedAgentId;
3339
3338
  if (pendingImageData && (pendingImageData.startsWith("data:image/") || pendingImageData.startsWith("iVBORw0KGgo") || pendingImageData.startsWith("/9j/"))) {
3340
- const { saveImageToDisk } = await import("./image-store-Gpo2mgM9.mjs").then((n) => n.i);
3341
3339
  const { filePath, bytesWritten } = await saveImageToDisk(pendingImageData);
3342
3340
  raw.imageData = filePath;
3343
- const { incrementImageRef } = await import("./image-refs-B5Zf_Djo.mjs").then((n) => n.n);
3341
+ const { incrementImageRef } = await import("./image-refs-C2YU7BIm.mjs");
3344
3342
  await incrementImageRef(kv, filePath);
3345
3343
  sdk.trigger({
3346
3344
  function_id: "mem::disk-size-delta",
@@ -3360,13 +3358,13 @@ function registerObserveFunction(sdk, kv, dedupMap, maxObservationsPerSession) {
3360
3358
  try {
3361
3359
  await kv.set(KV.observations(payload.sessionId), obsId, raw);
3362
3360
  } catch (error) {
3363
- if (raw.imageData) {
3364
- const { deleteImage } = await import("./image-store-Gpo2mgM9.mjs").then((n) => n.i);
3365
- const { deletedBytes } = await deleteImage(raw.imageData);
3366
- if (deletedBytes > 0) sdk.trigger({
3367
- function_id: "mem::disk-size-delta",
3368
- payload: { deltaBytes: -deletedBytes },
3369
- action: TriggerAction.Void()
3361
+ if (raw.imageData) try {
3362
+ const { decrementImageRef } = await import("./image-refs-C2YU7BIm.mjs");
3363
+ await decrementImageRef(kv, sdk, raw.imageData);
3364
+ } catch (rollbackError) {
3365
+ logger.error("Failed to roll back image ref after observation write failure", {
3366
+ imageRef: raw.imageData,
3367
+ error: rollbackError instanceof Error ? rollbackError.message : String(rollbackError)
3370
3368
  });
3371
3369
  }
3372
3370
  throw error;
@@ -3535,6 +3533,7 @@ function registerImageQuotaCleanup(sdk, kv) {
3535
3533
  await withKeyedLock(`imgRef:${f.filePath}`, async () => {
3536
3534
  let refCount;
3537
3535
  try {
3536
+ const { getImageRefCount } = await import("./image-refs-C2YU7BIm.mjs");
3538
3537
  refCount = await getImageRefCount(kv, f.filePath);
3539
3538
  } catch (err) {
3540
3539
  logger.error("Failed to read refCount; skipping eviction", {
@@ -4625,6 +4624,12 @@ function registerContextFunction(sdk, kv, tokenBudget) {
4625
4624
  sdk.registerFunction("mem::context", async (data) => {
4626
4625
  const budget = data.budget || tokenBudget;
4627
4626
  const blocks = [];
4627
+ const isolated = isAgentScopeIsolated();
4628
+ const explicitAgentId = typeof data.agentId === "string" && data.agentId.trim().length > 0 ? data.agentId.trim() : void 0;
4629
+ const wildcardAgent = explicitAgentId === "*";
4630
+ const envAgentId = isolated ? getAgentId() : void 0;
4631
+ const filterAgentId = wildcardAgent ? void 0 : explicitAgentId ?? envAgentId;
4632
+ if (isolated && !wildcardAgent && !explicitAgentId && !envAgentId) throw new Error("mem::context: AGENTMEMORY_AGENT_SCOPE=isolated is set but no agent id is available (env AGENT_ID unset and no explicit agentId in the call). Refusing to read cross-agent rows. Pass agentId: \"*\" to opt in to a wildcard read.");
4628
4633
  const [pinnedSlots, profile, lessons] = await Promise.all([
4629
4634
  isSlotsEnabled() ? listPinnedSlots(kv).catch(() => []) : Promise.resolve([]),
4630
4635
  kv.get(KV.profiles, data.project).catch(() => null),
@@ -4671,7 +4676,7 @@ function registerContextFunction(sdk, kv, tokenBudget) {
4671
4676
  sourceIds: relevantLessons.map((l) => l.id)
4672
4677
  });
4673
4678
  }
4674
- const sessions = (await kv.list(KV.sessions)).filter((s) => s.project === data.project && s.id !== data.sessionId).sort((a, b) => new Date(b.startedAt).getTime() - new Date(a.startedAt).getTime()).slice(0, 10);
4679
+ const sessions = (await kv.list(KV.sessions)).filter((s) => s.project === data.project && s.id !== data.sessionId && (filterAgentId === void 0 || s.agentId === filterAgentId)).sort((a, b) => new Date(b.startedAt).getTime() - new Date(a.startedAt).getTime()).slice(0, 10);
4675
4680
  const summariesPerSession = await Promise.all(sessions.map((s) => kv.get(KV.summaries, s.id).catch(() => null)));
4676
4681
  const sessionsNeedingObs = [];
4677
4682
  for (let i = 0; i < sessions.length; i++) {
@@ -5661,7 +5666,7 @@ function registerRememberFunction(sdk, kv) {
5661
5666
  const deletedMemoryIds = [];
5662
5667
  const deletedObservationIds = [];
5663
5668
  let deletedSession = false;
5664
- const { decrementImageRef } = await import("./image-refs-B5Zf_Djo.mjs").then((n) => n.n);
5669
+ const { decrementImageRef } = await import("./image-refs-C2YU7BIm.mjs");
5665
5670
  if (data.memoryId) {
5666
5671
  const mem = await kv.get(KV.memories, data.memoryId);
5667
5672
  await kv.delete(KV.memories, data.memoryId);
@@ -5768,7 +5773,7 @@ async function runRecoveredSessionConsolidation(sdk) {
5768
5773
  function registerEvictFunction(sdk, kv) {
5769
5774
  sdk.registerFunction("mem::evict", async (data) => {
5770
5775
  const dryRun = data?.dryRun ?? false;
5771
- const { decrementImageRef } = await import("./image-refs-B5Zf_Djo.mjs").then((n) => n.n);
5776
+ const { decrementImageRef } = await import("./image-refs-C2YU7BIm.mjs");
5772
5777
  const configOverride = await kv.get(KV.config, "eviction").catch(() => null);
5773
5778
  const cfg = {
5774
5779
  ...DEFAULTS$1,
@@ -6583,7 +6588,7 @@ function registerAutoForgetFunction(sdk, kv) {
6583
6588
  sdk.registerFunction("mem::auto-forget", async (data) => {
6584
6589
  const dryRun = data?.dryRun ?? false;
6585
6590
  const now = Date.now();
6586
- const { decrementImageRef } = await import("./image-refs-B5Zf_Djo.mjs").then((n) => n.n);
6591
+ const { decrementImageRef } = await import("./image-refs-C2YU7BIm.mjs");
6587
6592
  const result = {
6588
6593
  ttlExpired: [],
6589
6594
  contradictions: [],
@@ -6843,7 +6848,8 @@ function registerExportImportFunction(sdk, kv) {
6843
6848
  "0.9.24",
6844
6849
  "0.9.25",
6845
6850
  "0.9.26",
6846
- "0.9.27"
6851
+ "0.9.27",
6852
+ "0.9.28"
6847
6853
  ]).has(importData.version)) return {
6848
6854
  success: false,
6849
6855
  error: `Unsupported export version: ${importData.version}`
@@ -13721,7 +13727,7 @@ function registerRetentionFunctions(sdk, kv) {
13721
13727
  const threshold = typeof data?.threshold === "number" && Number.isFinite(data.threshold) ? data.threshold : DEFAULT_DECAY.tierThresholds.cold;
13722
13728
  const maxEvictRaw = typeof data?.maxEvict === "number" && Number.isInteger(data.maxEvict) ? data.maxEvict : 50;
13723
13729
  const maxEvict = Math.min(1e3, Math.max(0, maxEvictRaw));
13724
- const { decrementImageRef } = await import("./image-refs-B5Zf_Djo.mjs").then((n) => n.n);
13730
+ const { decrementImageRef } = await import("./image-refs-C2YU7BIm.mjs");
13725
13731
  const candidates = (await kv.list(KV.retentionScores)).filter((s) => s.score < threshold).sort((a, b) => a.score - b.score).slice(0, maxEvict);
13726
13732
  if (data?.dryRun) return {
13727
13733
  success: true,
@@ -15189,11 +15195,15 @@ function registerApiTriggers(sdk, kv, secret, metricsStore, provider) {
15189
15195
  status_code: 400,
15190
15196
  body: { error: "budget must be a positive integer" }
15191
15197
  };
15198
+ const queryAgentId = typeof req.query_params?.["agentId"] === "string" ? req.query_params["agentId"] : void 0;
15199
+ const bodyAgentId = typeof body.agentId === "string" && body.agentId.trim().length > 0 ? body.agentId.trim() : void 0;
15192
15200
  const payload = {
15193
15201
  sessionId,
15194
15202
  project
15195
15203
  };
15196
15204
  if (budget !== void 0) payload.budget = budget;
15205
+ const agentId = bodyAgentId ?? queryAgentId;
15206
+ if (agentId !== void 0) payload.agentId = agentId;
15197
15207
  return {
15198
15208
  status_code: 200,
15199
15209
  body: await sdk.trigger({
@@ -15405,7 +15415,8 @@ function registerApiTriggers(sdk, kv, secret, metricsStore, provider) {
15405
15415
  function_id: "mem::context",
15406
15416
  payload: {
15407
15417
  sessionId,
15408
- project
15418
+ project,
15419
+ ...agentId ? { agentId } : {}
15409
15420
  }
15410
15421
  })).context
15411
15422
  }
@@ -15597,9 +15608,14 @@ function registerApiTriggers(sdk, kv, secret, metricsStore, provider) {
15597
15608
  const normalizedAgentId = typeof req.query_params?.["agentId"] === "string" ? req.query_params["agentId"].trim() : void 0;
15598
15609
  const wildcardAgent = normalizedAgentId === "*";
15599
15610
  const filterAgentId = wildcardAgent ? void 0 : (normalizedAgentId && !wildcardAgent ? normalizedAgentId : void 0) ?? (isAgentScopeIsolated() ? getAgentId() : void 0);
15611
+ const filtered = filterAgentId ? sessions.filter((s) => s.agentId === filterAgentId) : sessions;
15612
+ const summaries = await Promise.all(filtered.map((s) => kv.get(KV.summaries, s.id).catch(() => null)));
15600
15613
  return {
15601
15614
  status_code: 200,
15602
- body: { sessions: filterAgentId ? sessions.filter((s) => s.agentId === filterAgentId) : sessions }
15615
+ body: { sessions: filtered.map((s, i) => summaries[i] ? {
15616
+ ...s,
15617
+ summary: summaries[i]
15618
+ } : s) }
15603
15619
  };
15604
15620
  });
15605
15621
  sdk.registerTrigger({
@@ -18479,13 +18495,15 @@ function registerApiTriggers(sdk, kv, secret, metricsStore, provider) {
18479
18495
  //#region src/triggers/events.ts
18480
18496
  function registerEventTriggers(sdk, kv) {
18481
18497
  sdk.registerFunction("event::session::started", async (data) => {
18498
+ const agentId = (typeof data.agentId === "string" && data.agentId.trim().length > 0 ? data.agentId.trim().slice(0, 128) : void 0) ?? getAgentId();
18482
18499
  const session = {
18483
18500
  id: data.sessionId,
18484
18501
  project: data.project,
18485
18502
  cwd: data.cwd,
18486
18503
  startedAt: (/* @__PURE__ */ new Date()).toISOString(),
18487
18504
  status: "active",
18488
- observationCount: 0
18505
+ observationCount: 0,
18506
+ ...agentId ? { agentId } : {}
18489
18507
  };
18490
18508
  await kv.set(KV.sessions, data.sessionId, session);
18491
18509
  return {
@@ -18494,7 +18512,8 @@ function registerEventTriggers(sdk, kv) {
18494
18512
  function_id: "mem::context",
18495
18513
  payload: {
18496
18514
  sessionId: data.sessionId,
18497
- project: data.project
18515
+ project: data.project,
18516
+ ...agentId ? { agentId } : {}
18498
18517
  }
18499
18518
  })).context
18500
18519
  };
@@ -20419,10 +20438,10 @@ async function main() {
20419
20438
  }
20420
20439
  registerConsolidationPipelineFunction(sdk, kv, provider);
20421
20440
  bootLog(`Consolidation pipeline: registered (CONSOLIDATION_ENABLED=${isConsolidationEnabled() ? "true" : "false"})`);
20422
- if (isAutoCompressEnabled()) bootLog(`WARNING: AGENTMEMORY_AUTO_COMPRESS=true — every PostToolUse observation will be sent to your LLM provider for compression. This spends API tokens proportional to your session tool-use frequency (see #138). Set AGENTMEMORY_AUTO_COMPRESS=false to disable.`);
20423
- else bootLog(`Auto-compress: OFF (default, #138) — observations indexed via zero-LLM synthetic compression. Set AGENTMEMORY_AUTO_COMPRESS=true to opt-in to LLM-powered summaries (uses your API key).`);
20424
- if (isContextInjectionEnabled()) bootLog(`WARNING: AGENTMEMORY_INJECT_CONTEXT=true — the PreToolUse and SessionStart hooks will inject up to ~4000 chars of memory context into every tool turn. On Claude Pro this burns session tokens proportional to your tool-call frequency (see #143). Set AGENTMEMORY_INJECT_CONTEXT=false to disable.`);
20425
- else bootLog(`Context injection: OFF (default, #143) — hooks capture observations but do not inject context into Claude Code's conversation. Set AGENTMEMORY_INJECT_CONTEXT=true to opt-in (warning: expect your Claude Pro allocation to drain faster).`);
20441
+ if (isAutoCompressEnabled()) bootLog(`WARNING: AGENTMEMORY_AUTO_COMPRESS=true — every PostToolUse observation will be sent to your LLM provider for compression. This spends API tokens proportional to your session tool-use frequency. Set AGENTMEMORY_AUTO_COMPRESS=false to disable.`);
20442
+ else bootLog(`Auto-compress: OFF (default) — observations indexed via zero-LLM synthetic compression. Set AGENTMEMORY_AUTO_COMPRESS=true to opt-in to LLM-powered summaries (uses your API key).`);
20443
+ if (isContextInjectionEnabled()) bootLog(`WARNING: AGENTMEMORY_INJECT_CONTEXT=true — the PreToolUse and SessionStart hooks will inject up to ~4000 chars of memory context into every tool turn. On Claude Pro this burns session tokens proportional to your tool-call frequency. Set AGENTMEMORY_INJECT_CONTEXT=false to disable.`);
20444
+ else bootLog(`Context injection: OFF (default) — hooks capture observations but do not inject context into Claude Code's conversation. Set AGENTMEMORY_INJECT_CONTEXT=true to opt-in (warning: expect your Claude Pro allocation to drain faster).`);
20426
20445
  const teamConfig = loadTeamConfig();
20427
20446
  if (teamConfig) {
20428
20447
  registerTeamFunction(sdk, kv, teamConfig);
@@ -20529,7 +20548,7 @@ async function main() {
20529
20548
  backfilled++;
20530
20549
  }
20531
20550
  if (backfilled > 0) {
20532
- bootLog(`Backfilled ${backfilled} memories into BM25 (legacy gap before #257)`);
20551
+ bootLog(`Backfilled ${backfilled} memories into BM25 (legacy index gap)`);
20533
20552
  indexPersistence.scheduleSave();
20534
20553
  }
20535
20554
  } catch (err) {
@@ -20613,4 +20632,4 @@ main().catch((err) => {
20613
20632
  //#endregion
20614
20633
  export {};
20615
20634
 
20616
- //# sourceMappingURL=src-MOg2zKJs.mjs.map
20635
+ //# sourceMappingURL=src-CzgoepGU.mjs.map