@agentmemory/agentmemory 0.9.29 → 0.9.31

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 (352) hide show
  1. package/.env.example +102 -35
  2. package/AGENTS.md +19 -26
  3. package/README.md +417 -525
  4. package/dist/.env.example +102 -35
  5. package/dist/cli.d.mts.map +1 -1
  6. package/dist/cli.mjs +2316 -655
  7. package/dist/cli.mjs.map +1 -1
  8. package/dist/compression-recovery-CnhLQC6N.mjs +5912 -0
  9. package/dist/compression-recovery-CnhLQC6N.mjs.map +1 -0
  10. package/dist/{connect-Qaeq15TQ.mjs → connect-BSLIAMpw.mjs} +900 -302
  11. package/dist/connect-BSLIAMpw.mjs.map +1 -0
  12. package/dist/hooks/_capture.d.mts +25 -0
  13. package/dist/hooks/_capture.d.mts.map +1 -0
  14. package/dist/hooks/_capture.mjs +944 -0
  15. package/dist/hooks/_capture.mjs.map +1 -0
  16. package/dist/hooks/antigravity-bridge.d.mts +1 -1
  17. package/dist/hooks/antigravity-bridge.d.mts.map +1 -1
  18. package/dist/hooks/antigravity-bridge.mjs +24 -15
  19. package/dist/hooks/antigravity-bridge.mjs.map +1 -1
  20. package/dist/hooks/notification.mjs +35 -29
  21. package/dist/hooks/notification.mjs.map +1 -1
  22. package/dist/hooks/post-commit.mjs +91 -1
  23. package/dist/hooks/post-commit.mjs.map +1 -1
  24. package/dist/hooks/post-tool-failure.mjs +71 -29
  25. package/dist/hooks/post-tool-failure.mjs.map +1 -1
  26. package/dist/hooks/post-tool-use.mjs +99 -39
  27. package/dist/hooks/post-tool-use.mjs.map +1 -1
  28. package/dist/hooks/pre-compact.mjs +113 -6
  29. package/dist/hooks/pre-compact.mjs.map +1 -1
  30. package/dist/hooks/pre-tool-use.mjs +91 -1
  31. package/dist/hooks/pre-tool-use.mjs.map +1 -1
  32. package/dist/hooks/prompt-submit.mjs +25 -25
  33. package/dist/hooks/prompt-submit.mjs.map +1 -1
  34. package/dist/hooks/session-end.mjs +67 -31
  35. package/dist/hooks/session-end.mjs.map +1 -1
  36. package/dist/hooks/session-start.mjs +110 -6
  37. package/dist/hooks/session-start.mjs.map +1 -1
  38. package/dist/hooks/stop.mjs +80 -8
  39. package/dist/hooks/stop.mjs.map +1 -1
  40. package/dist/hooks/subagent-start.mjs +28 -29
  41. package/dist/hooks/subagent-start.mjs.map +1 -1
  42. package/dist/hooks/subagent-stop.mjs +33 -29
  43. package/dist/hooks/subagent-stop.mjs.map +1 -1
  44. package/dist/hooks/task-completed.mjs +31 -31
  45. package/dist/hooks/task-completed.mjs.map +1 -1
  46. package/dist/{image-refs-BKLmp_sD.mjs → image-refs-BaT-9oMU.mjs} +2 -2
  47. package/dist/image-refs-BaT-9oMU.mjs.map +1 -0
  48. package/dist/{image-refs-CJgZmb9X.mjs → image-refs-Cyta4Lf9.mjs} +3 -3
  49. package/dist/image-refs-Cyta4Lf9.mjs.map +1 -0
  50. package/dist/{keyed-mutex-DTHtcZrt.mjs → image-store-BsN4vyjr.mjs} +2 -14
  51. package/dist/image-store-BsN4vyjr.mjs.map +1 -0
  52. package/dist/index.mjs +15180 -4119
  53. package/dist/index.mjs.map +1 -1
  54. package/dist/integrations/dsh.d.mts +55 -0
  55. package/dist/integrations/dsh.d.mts.map +1 -0
  56. package/dist/integrations/dsh.mjs +1145 -0
  57. package/dist/integrations/dsh.mjs.map +1 -0
  58. package/dist/{schema-BFZhNTF7.mjs → keyed-mutex-DCUh7PG-.mjs} +81 -8
  59. package/dist/keyed-mutex-DCUh7PG-.mjs.map +1 -0
  60. package/dist/secret-store-D9GwO0xp.mjs +2449 -0
  61. package/dist/secret-store-D9GwO0xp.mjs.map +1 -0
  62. package/dist/session-arguments-zxsbbd8y.mjs +113 -0
  63. package/dist/session-arguments-zxsbbd8y.mjs.map +1 -0
  64. package/dist/{src-G7yt8gGm.mjs → src-DaMtDzt_.mjs} +8320 -4260
  65. package/dist/src-DaMtDzt_.mjs.map +1 -0
  66. package/dist/{standalone-BqNJDJ04.mjs → standalone-BlqshyZ5.mjs} +246 -62
  67. package/dist/standalone-BlqshyZ5.mjs.map +1 -0
  68. package/dist/standalone.d.mts +1 -1
  69. package/dist/standalone.d.mts.map +1 -1
  70. package/dist/standalone.mjs +866 -78
  71. package/dist/standalone.mjs.map +1 -1
  72. package/dist/viewer/index.html +7394 -2816
  73. package/integrations/hermes/README.md +84 -0
  74. package/integrations/hermes/__init__.py +669 -0
  75. package/integrations/hermes/plugin.yaml +27 -0
  76. package/integrations/omp/LICENSE +190 -0
  77. package/integrations/omp/README.md +76 -0
  78. package/integrations/omp/capture.ts +1 -0
  79. package/integrations/omp/dist/index.mjs +1450 -0
  80. package/integrations/omp/index.ts +488 -0
  81. package/integrations/omp/package.json +13 -0
  82. package/integrations/omp/security.ts +67 -0
  83. package/integrations/omp/skills/agentmemory-agents/REFERENCE.md +32 -0
  84. package/integrations/omp/skills/agentmemory-agents/SKILL.md +48 -0
  85. package/integrations/omp/skills/agentmemory-agents/TROUBLESHOOTING.md +70 -0
  86. package/integrations/omp/skills/agentmemory-architecture/SKILL.md +33 -0
  87. package/integrations/omp/skills/agentmemory-architecture/TROUBLESHOOTING.md +70 -0
  88. package/integrations/omp/skills/agentmemory-config/REFERENCE.md +90 -0
  89. package/integrations/omp/skills/agentmemory-config/SKILL.md +78 -0
  90. package/integrations/omp/skills/agentmemory-config/TROUBLESHOOTING.md +70 -0
  91. package/integrations/omp/skills/agentmemory-hooks/REFERENCE.md +20 -0
  92. package/integrations/omp/skills/agentmemory-hooks/SKILL.md +49 -0
  93. package/integrations/omp/skills/agentmemory-hooks/TROUBLESHOOTING.md +70 -0
  94. package/integrations/omp/skills/agentmemory-mcp-tools/REFERENCE.md +66 -0
  95. package/integrations/omp/skills/agentmemory-mcp-tools/SKILL.md +42 -0
  96. package/integrations/omp/skills/agentmemory-mcp-tools/TROUBLESHOOTING.md +70 -0
  97. package/integrations/omp/skills/agentmemory-rest-api/REFERENCE.md +158 -0
  98. package/integrations/omp/skills/agentmemory-rest-api/SKILL.md +49 -0
  99. package/integrations/omp/skills/agentmemory-rest-api/TROUBLESHOOTING.md +70 -0
  100. package/integrations/omp/skills/commit-context/EXAMPLES.md +71 -0
  101. package/integrations/omp/skills/commit-context/SKILL.md +64 -0
  102. package/integrations/omp/skills/commit-context/TROUBLESHOOTING.md +70 -0
  103. package/integrations/omp/skills/commit-history/EXAMPLES.md +71 -0
  104. package/integrations/omp/skills/commit-history/SKILL.md +62 -0
  105. package/integrations/omp/skills/commit-history/TROUBLESHOOTING.md +70 -0
  106. package/integrations/omp/skills/forget/EXAMPLES.md +40 -0
  107. package/integrations/omp/skills/forget/SKILL.md +73 -0
  108. package/integrations/omp/skills/forget/TROUBLESHOOTING.md +70 -0
  109. package/integrations/omp/skills/handoff/EXAMPLES.md +57 -0
  110. package/integrations/omp/skills/handoff/SKILL.md +75 -0
  111. package/integrations/omp/skills/handoff/TROUBLESHOOTING.md +70 -0
  112. package/integrations/omp/skills/lesson/SKILL.md +64 -0
  113. package/integrations/omp/skills/lesson/TROUBLESHOOTING.md +70 -0
  114. package/integrations/omp/skills/memory-discipline/SKILL.md +65 -0
  115. package/integrations/omp/skills/memory-discipline/TROUBLESHOOTING.md +70 -0
  116. package/integrations/omp/skills/recall/EXAMPLES.md +74 -0
  117. package/integrations/omp/skills/recall/SKILL.md +74 -0
  118. package/integrations/omp/skills/recall/TROUBLESHOOTING.md +70 -0
  119. package/integrations/omp/skills/recap/EXAMPLES.md +62 -0
  120. package/integrations/omp/skills/recap/SKILL.md +68 -0
  121. package/integrations/omp/skills/recap/TROUBLESHOOTING.md +70 -0
  122. package/integrations/omp/skills/remember/EXAMPLES.md +67 -0
  123. package/integrations/omp/skills/remember/SKILL.md +66 -0
  124. package/integrations/omp/skills/remember/TROUBLESHOOTING.md +70 -0
  125. package/integrations/omp/skills/session-history/EXAMPLES.md +59 -0
  126. package/integrations/omp/skills/session-history/SKILL.md +67 -0
  127. package/integrations/omp/skills/session-history/TROUBLESHOOTING.md +70 -0
  128. package/integrations/omp/skills/write-agentmemory-skill/SKILL.md +41 -0
  129. package/integrations/omp/skills/write-agentmemory-skill/TROUBLESHOOTING.md +70 -0
  130. package/integrations/openclaw/LICENSE +190 -0
  131. package/integrations/openclaw/README.md +88 -0
  132. package/integrations/openclaw/openclaw.plugin.json +71 -0
  133. package/integrations/openclaw/package.json +38 -0
  134. package/integrations/openclaw/plugin.mjs +425 -0
  135. package/integrations/openclaw/plugin.yaml +26 -0
  136. package/integrations/openclaw/skills/agentmemory-agents/REFERENCE.md +32 -0
  137. package/integrations/openclaw/skills/agentmemory-agents/SKILL.md +48 -0
  138. package/integrations/openclaw/skills/agentmemory-agents/TROUBLESHOOTING.md +70 -0
  139. package/integrations/openclaw/skills/agentmemory-architecture/SKILL.md +33 -0
  140. package/integrations/openclaw/skills/agentmemory-architecture/TROUBLESHOOTING.md +70 -0
  141. package/integrations/openclaw/skills/agentmemory-config/REFERENCE.md +90 -0
  142. package/integrations/openclaw/skills/agentmemory-config/SKILL.md +78 -0
  143. package/integrations/openclaw/skills/agentmemory-config/TROUBLESHOOTING.md +70 -0
  144. package/integrations/openclaw/skills/agentmemory-hooks/REFERENCE.md +20 -0
  145. package/integrations/openclaw/skills/agentmemory-hooks/SKILL.md +49 -0
  146. package/integrations/openclaw/skills/agentmemory-hooks/TROUBLESHOOTING.md +70 -0
  147. package/integrations/openclaw/skills/agentmemory-mcp-tools/REFERENCE.md +66 -0
  148. package/integrations/openclaw/skills/agentmemory-mcp-tools/SKILL.md +42 -0
  149. package/integrations/openclaw/skills/agentmemory-mcp-tools/TROUBLESHOOTING.md +70 -0
  150. package/integrations/openclaw/skills/agentmemory-rest-api/REFERENCE.md +158 -0
  151. package/integrations/openclaw/skills/agentmemory-rest-api/SKILL.md +49 -0
  152. package/integrations/openclaw/skills/agentmemory-rest-api/TROUBLESHOOTING.md +70 -0
  153. package/integrations/openclaw/skills/commit-context/EXAMPLES.md +71 -0
  154. package/integrations/openclaw/skills/commit-context/SKILL.md +64 -0
  155. package/integrations/openclaw/skills/commit-context/TROUBLESHOOTING.md +70 -0
  156. package/integrations/openclaw/skills/commit-history/EXAMPLES.md +71 -0
  157. package/integrations/openclaw/skills/commit-history/SKILL.md +62 -0
  158. package/integrations/openclaw/skills/commit-history/TROUBLESHOOTING.md +70 -0
  159. package/integrations/openclaw/skills/forget/EXAMPLES.md +40 -0
  160. package/integrations/openclaw/skills/forget/SKILL.md +73 -0
  161. package/integrations/openclaw/skills/forget/TROUBLESHOOTING.md +70 -0
  162. package/integrations/openclaw/skills/handoff/EXAMPLES.md +57 -0
  163. package/integrations/openclaw/skills/handoff/SKILL.md +75 -0
  164. package/integrations/openclaw/skills/handoff/TROUBLESHOOTING.md +70 -0
  165. package/integrations/openclaw/skills/lesson/SKILL.md +64 -0
  166. package/integrations/openclaw/skills/lesson/TROUBLESHOOTING.md +70 -0
  167. package/integrations/openclaw/skills/memory-discipline/SKILL.md +65 -0
  168. package/integrations/openclaw/skills/memory-discipline/TROUBLESHOOTING.md +70 -0
  169. package/integrations/openclaw/skills/recall/EXAMPLES.md +74 -0
  170. package/integrations/openclaw/skills/recall/SKILL.md +74 -0
  171. package/integrations/openclaw/skills/recall/TROUBLESHOOTING.md +70 -0
  172. package/integrations/openclaw/skills/recap/EXAMPLES.md +62 -0
  173. package/integrations/openclaw/skills/recap/SKILL.md +68 -0
  174. package/integrations/openclaw/skills/recap/TROUBLESHOOTING.md +70 -0
  175. package/integrations/openclaw/skills/remember/EXAMPLES.md +67 -0
  176. package/integrations/openclaw/skills/remember/SKILL.md +66 -0
  177. package/integrations/openclaw/skills/remember/TROUBLESHOOTING.md +70 -0
  178. package/integrations/openclaw/skills/session-history/EXAMPLES.md +59 -0
  179. package/integrations/openclaw/skills/session-history/SKILL.md +67 -0
  180. package/integrations/openclaw/skills/session-history/TROUBLESHOOTING.md +70 -0
  181. package/integrations/openclaw/skills/write-agentmemory-skill/SKILL.md +41 -0
  182. package/integrations/openclaw/skills/write-agentmemory-skill/TROUBLESHOOTING.md +70 -0
  183. package/integrations/pi/LICENSE +190 -0
  184. package/integrations/pi/README.md +45 -51
  185. package/integrations/pi/dist/index.mjs +1379 -0
  186. package/integrations/pi/index.ts +139 -173
  187. package/integrations/pi/package.json +16 -6
  188. package/integrations/pi/security.ts +54 -22
  189. package/integrations/pi/skills/agentmemory-agents/REFERENCE.md +32 -0
  190. package/integrations/pi/skills/agentmemory-agents/SKILL.md +48 -0
  191. package/integrations/pi/skills/agentmemory-agents/TROUBLESHOOTING.md +70 -0
  192. package/integrations/pi/skills/agentmemory-architecture/SKILL.md +33 -0
  193. package/integrations/pi/skills/agentmemory-architecture/TROUBLESHOOTING.md +70 -0
  194. package/integrations/pi/skills/agentmemory-config/REFERENCE.md +90 -0
  195. package/integrations/pi/skills/agentmemory-config/SKILL.md +78 -0
  196. package/integrations/pi/skills/agentmemory-config/TROUBLESHOOTING.md +70 -0
  197. package/integrations/pi/skills/agentmemory-hooks/REFERENCE.md +20 -0
  198. package/integrations/pi/skills/agentmemory-hooks/SKILL.md +49 -0
  199. package/integrations/pi/skills/agentmemory-hooks/TROUBLESHOOTING.md +70 -0
  200. package/integrations/pi/skills/agentmemory-mcp-tools/REFERENCE.md +66 -0
  201. package/integrations/pi/skills/agentmemory-mcp-tools/SKILL.md +42 -0
  202. package/integrations/pi/skills/agentmemory-mcp-tools/TROUBLESHOOTING.md +70 -0
  203. package/integrations/pi/skills/agentmemory-rest-api/REFERENCE.md +158 -0
  204. package/integrations/pi/skills/agentmemory-rest-api/SKILL.md +49 -0
  205. package/integrations/pi/skills/agentmemory-rest-api/TROUBLESHOOTING.md +70 -0
  206. package/integrations/pi/skills/commit-context/EXAMPLES.md +71 -0
  207. package/integrations/pi/skills/commit-context/SKILL.md +64 -0
  208. package/integrations/pi/skills/commit-context/TROUBLESHOOTING.md +70 -0
  209. package/integrations/pi/skills/commit-history/EXAMPLES.md +71 -0
  210. package/integrations/pi/skills/commit-history/SKILL.md +62 -0
  211. package/integrations/pi/skills/commit-history/TROUBLESHOOTING.md +70 -0
  212. package/integrations/pi/skills/forget/EXAMPLES.md +40 -0
  213. package/integrations/pi/skills/forget/SKILL.md +73 -0
  214. package/integrations/pi/skills/forget/TROUBLESHOOTING.md +70 -0
  215. package/integrations/pi/skills/handoff/EXAMPLES.md +57 -0
  216. package/integrations/pi/skills/handoff/SKILL.md +75 -0
  217. package/integrations/pi/skills/handoff/TROUBLESHOOTING.md +70 -0
  218. package/integrations/pi/skills/lesson/SKILL.md +64 -0
  219. package/integrations/pi/skills/lesson/TROUBLESHOOTING.md +70 -0
  220. package/integrations/pi/skills/memory-discipline/SKILL.md +65 -0
  221. package/integrations/pi/skills/memory-discipline/TROUBLESHOOTING.md +70 -0
  222. package/integrations/pi/skills/recall/EXAMPLES.md +74 -0
  223. package/integrations/pi/skills/recall/SKILL.md +74 -0
  224. package/integrations/pi/skills/recall/TROUBLESHOOTING.md +70 -0
  225. package/integrations/pi/skills/recap/EXAMPLES.md +62 -0
  226. package/integrations/pi/skills/recap/SKILL.md +68 -0
  227. package/integrations/pi/skills/recap/TROUBLESHOOTING.md +70 -0
  228. package/integrations/pi/skills/remember/EXAMPLES.md +67 -0
  229. package/integrations/pi/skills/remember/SKILL.md +66 -0
  230. package/integrations/pi/skills/remember/TROUBLESHOOTING.md +70 -0
  231. package/integrations/pi/skills/session-history/EXAMPLES.md +59 -0
  232. package/integrations/pi/skills/session-history/SKILL.md +67 -0
  233. package/integrations/pi/skills/session-history/TROUBLESHOOTING.md +70 -0
  234. package/integrations/pi/skills/write-agentmemory-skill/SKILL.md +41 -0
  235. package/integrations/pi/skills/write-agentmemory-skill/TROUBLESHOOTING.md +70 -0
  236. package/package.json +42 -12
  237. package/plugin/.claude-plugin/plugin.json +2 -2
  238. package/plugin/.codex-plugin/plugin.json +27 -4
  239. package/plugin/.devin-plugin/plugin.json +5 -3
  240. package/plugin/.mcp.codex.json +12 -0
  241. package/plugin/.mcp.copilot.json +2 -7
  242. package/plugin/.mcp.json +2 -7
  243. package/plugin/assets/icon.svg +35 -0
  244. package/plugin/cursor/hooks.json +23 -8
  245. package/plugin/hooks/hooks.copilot.json +11 -11
  246. package/plugin/hooks.json +67 -0
  247. package/plugin/opencode/README.md +267 -31
  248. package/plugin/opencode/agentmemory-capture.ts +594 -11
  249. package/plugin/opencode/plugin.json +1 -1
  250. package/plugin/plugin.json +1 -1
  251. package/plugin/scripts/_capture.d.mts +25 -0
  252. package/plugin/scripts/_capture.d.mts.map +1 -0
  253. package/plugin/scripts/_capture.mjs +944 -0
  254. package/plugin/scripts/_capture.mjs.map +1 -0
  255. package/plugin/scripts/antigravity-bridge.d.mts +1 -1
  256. package/plugin/scripts/antigravity-bridge.d.mts.map +1 -1
  257. package/plugin/scripts/antigravity-bridge.mjs +24 -15
  258. package/plugin/scripts/antigravity-bridge.mjs.map +1 -1
  259. package/plugin/scripts/cursor/run-detached.d.mts +1 -0
  260. package/plugin/scripts/cursor/run-detached.mjs +786 -0
  261. package/plugin/scripts/cursor/run-detached.mjs.map +1 -0
  262. package/plugin/scripts/cursor/run-hook.d.mts +1 -0
  263. package/plugin/scripts/cursor/run-hook.mjs +704 -0
  264. package/plugin/scripts/cursor/run-hook.mjs.map +1 -0
  265. package/plugin/scripts/notification.mjs +35 -29
  266. package/plugin/scripts/notification.mjs.map +1 -1
  267. package/plugin/scripts/plugin-bridge.mjs +409 -0
  268. package/plugin/scripts/post-commit.mjs +91 -1
  269. package/plugin/scripts/post-commit.mjs.map +1 -1
  270. package/plugin/scripts/post-tool-failure.mjs +71 -29
  271. package/plugin/scripts/post-tool-failure.mjs.map +1 -1
  272. package/plugin/scripts/post-tool-use.mjs +99 -39
  273. package/plugin/scripts/post-tool-use.mjs.map +1 -1
  274. package/plugin/scripts/pre-compact.mjs +113 -6
  275. package/plugin/scripts/pre-compact.mjs.map +1 -1
  276. package/plugin/scripts/pre-tool-use.mjs +91 -1
  277. package/plugin/scripts/pre-tool-use.mjs.map +1 -1
  278. package/plugin/scripts/prompt-submit.mjs +25 -25
  279. package/plugin/scripts/prompt-submit.mjs.map +1 -1
  280. package/plugin/scripts/session-end.mjs +67 -31
  281. package/plugin/scripts/session-end.mjs.map +1 -1
  282. package/plugin/scripts/session-start.mjs +110 -6
  283. package/plugin/scripts/session-start.mjs.map +1 -1
  284. package/plugin/scripts/stop.mjs +80 -8
  285. package/plugin/scripts/stop.mjs.map +1 -1
  286. package/plugin/scripts/subagent-start.mjs +28 -29
  287. package/plugin/scripts/subagent-start.mjs.map +1 -1
  288. package/plugin/scripts/subagent-stop.mjs +33 -29
  289. package/plugin/scripts/subagent-stop.mjs.map +1 -1
  290. package/plugin/scripts/task-completed.mjs +31 -31
  291. package/plugin/scripts/task-completed.mjs.map +1 -1
  292. package/plugin/skills/_shared/TROUBLESHOOTING.md +42 -12
  293. package/plugin/skills/agentmemory-agents/REFERENCE.md +10 -9
  294. package/plugin/skills/agentmemory-agents/SKILL.md +19 -5
  295. package/plugin/skills/agentmemory-agents/TROUBLESHOOTING.md +70 -0
  296. package/plugin/skills/agentmemory-architecture/SKILL.md +4 -4
  297. package/plugin/skills/agentmemory-architecture/TROUBLESHOOTING.md +70 -0
  298. package/plugin/skills/agentmemory-config/REFERENCE.md +48 -3
  299. package/plugin/skills/agentmemory-config/SKILL.md +51 -10
  300. package/plugin/skills/agentmemory-config/TROUBLESHOOTING.md +70 -0
  301. package/plugin/skills/agentmemory-hooks/SKILL.md +15 -5
  302. package/plugin/skills/agentmemory-hooks/TROUBLESHOOTING.md +70 -0
  303. package/plugin/skills/agentmemory-mcp-tools/REFERENCE.md +5 -5
  304. package/plugin/skills/agentmemory-mcp-tools/SKILL.md +6 -3
  305. package/plugin/skills/agentmemory-mcp-tools/TROUBLESHOOTING.md +70 -0
  306. package/plugin/skills/agentmemory-rest-api/REFERENCE.md +18 -2
  307. package/plugin/skills/agentmemory-rest-api/SKILL.md +12 -6
  308. package/plugin/skills/agentmemory-rest-api/TROUBLESHOOTING.md +70 -0
  309. package/plugin/skills/commit-context/SKILL.md +1 -1
  310. package/plugin/skills/commit-context/TROUBLESHOOTING.md +70 -0
  311. package/plugin/skills/commit-history/SKILL.md +1 -1
  312. package/plugin/skills/commit-history/TROUBLESHOOTING.md +70 -0
  313. package/plugin/skills/forget/EXAMPLES.md +19 -54
  314. package/plugin/skills/forget/SKILL.md +16 -12
  315. package/plugin/skills/forget/TROUBLESHOOTING.md +70 -0
  316. package/plugin/skills/handoff/EXAMPLES.md +5 -4
  317. package/plugin/skills/handoff/SKILL.md +13 -6
  318. package/plugin/skills/handoff/TROUBLESHOOTING.md +70 -0
  319. package/plugin/skills/lesson/SKILL.md +1 -1
  320. package/plugin/skills/lesson/TROUBLESHOOTING.md +70 -0
  321. package/plugin/skills/memory-discipline/SKILL.md +14 -6
  322. package/plugin/skills/memory-discipline/TROUBLESHOOTING.md +70 -0
  323. package/plugin/skills/recall/SKILL.md +18 -7
  324. package/plugin/skills/recall/TROUBLESHOOTING.md +70 -0
  325. package/plugin/skills/recap/EXAMPLES.md +5 -3
  326. package/plugin/skills/recap/SKILL.md +11 -6
  327. package/plugin/skills/recap/TROUBLESHOOTING.md +70 -0
  328. package/plugin/skills/remember/EXAMPLES.md +3 -3
  329. package/plugin/skills/remember/SKILL.md +1 -1
  330. package/plugin/skills/remember/TROUBLESHOOTING.md +70 -0
  331. package/plugin/skills/session-history/EXAMPLES.md +2 -2
  332. package/plugin/skills/session-history/SKILL.md +10 -4
  333. package/plugin/skills/session-history/TROUBLESHOOTING.md +70 -0
  334. package/plugin/skills/write-agentmemory-skill/SKILL.md +2 -1
  335. package/plugin/skills/write-agentmemory-skill/TROUBLESHOOTING.md +70 -0
  336. package/dist/connect-Qaeq15TQ.mjs.map +0 -1
  337. package/dist/docker-compose.yml +0 -47
  338. package/dist/iii-config.docker.yaml +0 -53
  339. package/dist/iii-config.yaml +0 -61
  340. package/dist/image-refs-BKLmp_sD.mjs.map +0 -1
  341. package/dist/image-refs-CJgZmb9X.mjs.map +0 -1
  342. package/dist/keyed-mutex-DTHtcZrt.mjs.map +0 -1
  343. package/dist/logger-BEB7pCI9.mjs +0 -43
  344. package/dist/logger-BEB7pCI9.mjs.map +0 -1
  345. package/dist/schema-BFZhNTF7.mjs.map +0 -1
  346. package/dist/src-G7yt8gGm.mjs.map +0 -1
  347. package/dist/standalone-BqNJDJ04.mjs.map +0 -1
  348. package/dist/tools-registry-BV_2bu7z.mjs +0 -1405
  349. package/dist/tools-registry-BV_2bu7z.mjs.map +0 -1
  350. package/docker-compose.yml +0 -47
  351. package/iii-config.docker.yaml +0 -53
  352. package/iii-config.yaml +0 -61
@@ -11,6 +11,7 @@
11
11
  <p align="center">
12
12
  <img src="https://img.shields.io/badge/MCP-54_tools-1f6feb?style=flat-square" alt="54 MCP tools" />
13
13
  <img src="https://img.shields.io/badge/Plugin-22_hooks-1f6feb?style=flat-square" alt="22 hooks" />
14
+ <img src="https://img.shields.io/badge/OpenCode-1.x_%2B_2.x-1f6feb?style=flat-square" alt="OpenCode 1.x and 2.x" />
14
15
  <img src="https://img.shields.io/badge/Commands-2_slash-1f6feb?style=flat-square" alt="2 slash commands" />
15
16
  <img src="https://img.shields.io/badge/R@5-95.2%25-00875f?style=flat-square" alt="95.2% R@5" />
16
17
  </p>
@@ -45,20 +46,41 @@ Add to `~/.config/opencode/opencode.json` or your project's `.opencode/opencode.
45
46
 
46
47
  ### 3. Install the plugin
47
48
 
48
- Add to `~/.config/opencode/opencode.json`:
49
+ Copy the plugin file:
50
+
51
+ ```bash
52
+ mkdir -p ~/.config/opencode/plugins
53
+ cp plugin/opencode/agentmemory-capture.ts ~/.config/opencode/plugins/
54
+ ```
55
+
56
+ That is the whole install. OpenCode loads every plugin file in
57
+ `~/.config/opencode/plugins/` automatically, so there is nothing to register.
58
+
59
+ > **Do not also add it to `opencode.json`.** Listing the file under
60
+ > `"plugins"` on top of leaving it in the auto-loaded directory registers the
61
+ > same plugin twice, and it then captures every event twice. If you see doubled
62
+ > observations, remove the `"plugins"` entry and keep the file where it is.
63
+ >
64
+ > If you would rather keep plugins outside that directory, install the file
65
+ > somewhere else and point the config key at it:
66
+ >
67
+ > ```json
68
+ > {
69
+ > "plugins": ["./my-plugins/agentmemory-capture.ts"]
70
+ > }
71
+ > ```
72
+ >
73
+ > Either location works. The two must not both be in effect at once.
74
+
75
+ **OpenCode 1.x** — the same file works, using the V1 key instead:
49
76
 
50
77
  ```json
51
78
  {
52
- "plugin": ["./plugins/agentmemory-capture.ts"]
79
+ "plugin": ["./my-plugins/agentmemory-capture.ts"]
53
80
  }
54
81
  ```
55
82
 
56
- Copy the plugin file from this repo:
57
-
58
- ```bash
59
- mkdir -p ~/.config/opencode/plugins
60
- cp plugin/opencode/agentmemory-capture.ts ~/.config/opencode/plugins/
61
- ```
83
+ See [OpenCode 1.x and 2.x](#opencode-1x-and-2x) below.
62
84
 
63
85
  ### 4. Add the slash commands
64
86
 
@@ -72,6 +94,213 @@ cp plugin/opencode/commands/remember.md ~/.config/opencode/commands/
72
94
 
73
95
  Restart OpenCode or open a new session. The plugin auto-captures everything.
74
96
 
97
+ ## OpenCode 1.x and 2.x
98
+
99
+ `agentmemory-capture.ts` supports both plugin APIs from a single file.
100
+
101
+ OpenCode 2 replaced the V1 `Hooks`-object plugin shape: the default export must
102
+ carry an `id` plus a `setup(ctx)`, and hooks are registered on the domain that
103
+ owns the operation. The plugin therefore default-exports both:
104
+
105
+ ```ts
106
+ export default {
107
+ id: "agentmemory-capture",
108
+ setup: v2Setup, // OpenCode 2.x
109
+ server: v1Hooks, // OpenCode 1.x (SDK 1.18.x era)
110
+ }
111
+ ```
112
+
113
+ - **OpenCode 2.x** reads `id` and `setup()`.
114
+ - **OpenCode 1.17 and 1.18** call `server()` and use the returned hooks. They
115
+ also call `setup()`, with a context that has no `tool`, `session` or `event`.
116
+ `setup()` returns immediately when those are missing, so only the V1 hooks
117
+ run there.
118
+ - The two implementations are separate on purpose. Sharing an export does not
119
+ translate V1 hooks into V2 hooks, and the payloads differ enough that a shared
120
+ core would overstate V2 coverage.
121
+ - The named `export const AgentmemoryCapturePlugin` exists for direct imports
122
+ and for V1 releases older than 1.18.29, which expect a function as the
123
+ default export. A V1 loader that resolves `default` and calls `server()` on it
124
+ sees one plugin; the named export is not consulted unless a loader iterates
125
+ every export, which no observed version does.
126
+
127
+ **V1 load, verified.** OpenCode 1.17.10 and 1.18.34 (the `opencode-ai` npm
128
+ package) were run against this file in live sessions: one plugin instance,
129
+ reads and shell calls captured through the V1 hooks, and one `config_loaded`
130
+ per session.
131
+
132
+ Validated against **OpenCode v2.0.22**, and re-checked on **v2.0.24**, by running the plugin inside a live
133
+ session and logging the objects as they arrive, not by reading the generated
134
+ SDK types. That distinction matters: `@opencode-ai/sdk` 1.4.10 declares
135
+ `event.properties` and the V1 event names, and it is stale relative to the
136
+ runtime. Where this README says a payload was observed, it was read off a
137
+ running server.
138
+
139
+ ### What the V2 runtime actually does
140
+
141
+ - **The payload is in `event.data`, not `event.properties`.** The envelope is
142
+ `created, data, id, location, type`. Reading `properties` yields `{}`.
143
+ - **The V1 event names are gone.** They were not renamed one-for-one; the
144
+ stream is organised differently. `location` on the envelope is
145
+ process-level, so session identity comes from `data.sessionID`.
146
+ - **`list()` returns `{ data, location }`.** `ctx.agent.list()`,
147
+ `ctx.provider.list()` and `ctx.mcp.list()` all resolve to that shape.
148
+ - **`ctx.model.default()` is a promise.** Unawaited it is `{}`.
149
+ - **`session.created` exists.** On v2.0.24 it carries `sessionID`,
150
+ `projectID`, `location`, `version`, `subpath` and `slug`. The title arrives
151
+ later in `session.renamed`, so a session registers on creation with its
152
+ directory in hand. The fallback to
153
+ "first event carrying an ID" remains for sessions that predate the plugin
154
+ load, which never emit the event. An earlier revision of this plugin claimed
155
+ `session.created` did not exist; that came from observing an already-open
156
+ session and never creating one, which is absence in a sample rather than
157
+ absence in the API.
158
+ - **`ctx.session.hook("compaction")` registers, but its invocation is
159
+ unverified.** Calling `ctx.session.compact()` only *queues* a compaction
160
+ request; the hook would fire when the compaction actually runs. Forcing a
161
+ compaction in a running v2.0.22 emitted `session.compaction.started` and
162
+ `session.compaction.failed` immediately, with `Nothing to compact yet`,
163
+ because the session was empty. That proves the events fire and says nothing
164
+ about the hook, which never got a real compaction to run. The hook is kept
165
+ and the events are captured alongside it: if the hook is invoked it attaches
166
+ memory to the compaction prompt, and the events record that compaction
167
+ happened either way.
168
+ - **`session.execution.succeeded` triggers `/summarize`.** It fires when a run
169
+ finishes and carries only `{ sessionID }`, so it adds no observation. V1
170
+ summarizes when a session goes idle; this is the V2 equivalent.
171
+ - **`session.instructions.updated` carries `delta`, a map from instruction
172
+ source to content hash.** The plugin records the source names, not the
173
+ hashes.
174
+ - **A standalone `opencode session delete` exits before the plugin sees
175
+ `session.deleted`.** The session then stays open in agentmemory. Summaries do
176
+ not depend on it, because they come from `session.execution.succeeded`.
177
+ - **`parentID` is accepted by `ctx.session.create` but appears in no event
178
+ payload.** The `parentID` sent to `/session/start` is therefore always null;
179
+ the field is kept in case a future version populates it.
180
+
181
+ ### Hook mapping
182
+
183
+ | V1 | V2 | Status |
184
+ |---|---|---|
185
+ | `event` | `ctx.event.subscribe()` | ported |
186
+ | `tool.execute.before` | `ctx.tool.hook("execute.before")` | ported |
187
+ | tool results (`message.part.updated`) | `ctx.tool.hook("execute.after")` | ported |
188
+ | `chat.message` | `ctx.session.hook("prompt")` | ported |
189
+ | `experimental.chat.system.transform` | `ctx.session.hook("context")` | ported |
190
+ | `experimental.session.compacting` | `ctx.session.hook("compaction")` | ported, **unverified** |
191
+ | `config` | *(no hook)* | snapshot at `setup`, refreshed on `*.updated` |
192
+ | `chat.params` | *(no equivalent)* | not captured |
193
+
194
+ `output.system` (a string array) became `event.system` (`SystemPart[]`), so
195
+ injection pushes part objects rather than strings.
196
+
197
+ ### Event mapping
198
+
199
+ | V1 event | V2 |
200
+ |---|---|
201
+ | `session.created` | `session.created` (or first event carrying `data.sessionID`) |
202
+ | `session.deleted` | `session.deleted` |
203
+ | `session.status`, `session.idle` | `session.step.started` / `session.step.ended`; `session.execution.succeeded` triggers `/summarize` |
204
+ | `message.updated` | `session.text.ended` (`assistant_message`), `session.reasoning.ended` |
205
+ | `message.part.updated` | `ctx.tool.hook("execute.after")` |
206
+ | `command.executed` | the command arrives through `execute.after`; `shell.exited` records a non-zero exit |
207
+ | `session.error` | `session.execution.failed` |
208
+ | `file.edited` | `file.watcher.updated` |
209
+ | `session.compacted` | `session.compaction.started` / `.failed` |
210
+ | `permission.updated` | `permission.asked` (payload is a `PermissionRequest`) |
211
+ | `todo.updated`, `session.diff` | *no V2 equivalent observed* |
212
+
213
+ `permission.asked` and `permission.replied` were not seen firing during
214
+ development. They are handled against the documented shape, reading both the
215
+ V2 field names and the V1 fallbacks, and are not covered by the observed
216
+ columns in the table below.
217
+
218
+ ### Injection happens on every call, fetched once per prompt
219
+
220
+ `ctx.session.hook("context")` fires on every model call, so recalled memory is
221
+ injected every time. The previous implementation injected once per session,
222
+ which meant only the first prompt of a session carried memory.
223
+
224
+ Because the hook also fires on each tool continuation, `/context` is requested
225
+ at most once per prompt and then reused for the rest of the turn: the recalled
226
+ set does not change while a prompt is being answered. A new prompt clears the
227
+ cache. The `compaction` hook reuses the same turn cache.
228
+
229
+ Compaction is also captured from the `session.compaction.started` / `.failed`
230
+ events, which are observed.
231
+
232
+ ### What V2 cannot do
233
+
234
+ - **`chat.params`** — V2's `context` hook exposes `options` with `maxTokens`
235
+ only; temperature and `topP` are absent, and `model` carries only
236
+ `id` / `providerID` / `variant`. Recorded `llm_params` would be wrong rather
237
+ than partial, so they are not recorded. The `model` on the hook is captured
238
+ in `step_start` instead, where it is real.
239
+
240
+ ### Why `ctx` is typed `any`
241
+
242
+ The V2 setup signature is `async function v2Setup(ctx: any)`. That is
243
+ deliberate, and worth explaining because it looks like a shortcut.
244
+
245
+ Typing it properly would mean importing types from `@opencode-ai/plugin`. The
246
+ generated types shipped for that package are **stale for V2**: SDK 1.4.10
247
+ declares `EventSessionCreated = { type, properties: { sessionID, info } }` and
248
+ enumerates the V1 event names, none of which the v2.0.22 runtime emits. A
249
+ type-only import would therefore make the compiler reject correct code while
250
+ accepting the shape that caused the original bug. Silence was the safer of the
251
+ two failure modes, so `any` is used and the correctness burden moved to runtime
252
+ verification.
253
+
254
+ The known cost, stated plainly:
255
+
256
+ - The compiler will not catch V2 payload drift. A renamed field becomes a
257
+ `undefined` at runtime instead of a type error.
258
+ - Nothing checks that the event names in `handleEvent` are real. This branch
259
+ shipped a handler for fifteen V1 event names, none of which fire.
260
+ - There is no compile-time guarantee that `ctx.session.hook(...)` takes a name
261
+ that exists. The loader accepts any string, so a typo registers nothing and
262
+ fails silently.
263
+
264
+ That is why the verification suite drives the plugin with payloads captured
265
+ from a live server instead of hand-built objects, and why the
266
+ [Verification](#verification) section distinguishes observed from inferred. If a
267
+ future release ships correct V2 types, this signature should be tightened and
268
+ these three risks retired with it.
269
+
270
+ ### Verification
271
+
272
+ - `test/opencode-plugin-v2.test.ts` — 38 cases driving the V2 path with payloads
273
+ captured from v2.0.22. It runs under the repo's existing vitest, so:
274
+
275
+ ```bash
276
+ npx vitest run test/opencode-plugin-v2.test.ts
277
+ ```
278
+
279
+ It covers session lifecycle, the tool hooks, memory injection on every model
280
+ call, compaction, the event switch, and the regression where an early
281
+ `return` ended the event subscription. Each case added with the compaction
282
+ change was checked against the previous commit: the three compaction cases
283
+ fail on it and pass here.
284
+ - In a live session the plugin produced real observations for
285
+ `post_tool_use`, `config_loaded`, `step_start`, `step_finish`,
286
+ `reasoning`, `assistant_message` and `notification`, and requested
287
+ `/summarize` when the run finished.
288
+ `session.compaction.started` and `session.compaction.failed` were confirmed
289
+ by forcing a compaction in a running v2.0.22.
290
+
291
+ `session.text.started`, `session.reasoning.started`, `session.inbox.delivered`,
292
+ `shell.created` and `session.usage.updated` are read but not recorded. The
293
+ first two carry no text yet, the inbox event carries only an ID, `shell.created`
294
+ duplicates the command that `execute.after` already records, and usage
295
+ duplicates the token and cost figures in `step_finish`. A config snapshot equal
296
+ to the previous one is not recorded again.
297
+
298
+ Earlier in this branch the V2 path loaded cleanly and captured almost nothing,
299
+ because it was verified against a hand-built context object that agreed with
300
+ its own assumptions. Verifying that the plugin loads is not verifying that it
301
+ works, and the suite exists so that the next person does not have to learn that
302
+ twice.
303
+
75
304
  ## What gets captured
76
305
 
77
306
  ### Session lifecycle
@@ -89,12 +318,12 @@ Restart OpenCode or open a new session. The plugin auto-captures everything.
89
318
 
90
319
  ### Messages & prompts
91
320
 
92
- | Event | Hook | agentmemory API |
93
- |---|---|---|
94
- | User prompt (rich) | `chat.message` | POST /observe |
95
- | User prompt metadata | `message.updated` (user) | POST /observe |
96
- | Assistant response | `message.updated` (assistant) | POST /observe |
97
- | Message removed (undo) | `message.removed` | POST /observe |
321
+ | Event | V1 hook | V2 hook | agentmemory API |
322
+ |---|---|---|---|
323
+ | User prompt (rich) | `chat.message` | `ctx.session.hook("prompt")` | POST /observe |
324
+ | User prompt metadata | `message.updated` (user) | `message.updated` (user) | POST /observe |
325
+ | Assistant response | `message.updated` (assistant) | `message.updated` (assistant) | POST /observe |
326
+ | Message removed (undo) | `message.removed` | `message.removed` | POST /observe |
98
327
 
99
328
  ### Parts & steps
100
329
 
@@ -112,20 +341,23 @@ Restart OpenCode or open a new session. The plugin auto-captures everything.
112
341
 
113
342
  ### File enrichment pipeline
114
343
 
115
- | Event | Hook | agentmemory API |
116
- |---|---|---|
117
- | File tool params | `tool.execute.before` → stash paths | — |
118
- | File edited | `file.edited` → stash paths | — |
119
- | File part attached | `message.part.updated` (file) → stash paths | — |
120
- | Enrichment inject | `experimental.chat.system.transform` | POST /enrich → `output.system[]` |
121
- | Memory context inject | `experimental.chat.system.transform` | POST /context → `output.system[]` |
344
+ | Event | V1 hook | V2 hook | agentmemory API |
345
+ |---|---|---|---|
346
+ | File tool params | `tool.execute.before` → stash paths | `ctx.tool.hook("execute.before")` | - |
347
+ | File edited | `file.edited` → stash paths | `file.edited` | - |
348
+ | File part attached | `message.part.updated` (file) → stash paths | `message.part.updated` (file) | - |
349
+ | Enrichment inject | `experimental.chat.system.transform` | `ctx.session.hook("context")` | POST /enrich → system prompt |
350
+ | Memory context inject | `experimental.chat.system.transform` | `ctx.session.hook("context")` | POST /context → system prompt |
351
+
352
+ On V1 the two injects land in `output.system[]`. On V2 they are pushed as
353
+ `SystemPart` objects onto `event.system`.
122
354
 
123
355
  ### Permissions
124
356
 
125
- | Event | Hook | agentmemory API |
126
- |---|---|---|
127
- | Permission prompt | `permission.updated` | POST /observe |
128
- | Permission reply | `permission.replied` | POST /observe |
357
+ | Event | V1 hook | V2 hook | agentmemory API |
358
+ |---|---|---|---|
359
+ | Permission prompt | `permission.updated` | `permission.asked` | POST /observe |
360
+ | Permission reply | `permission.replied` | `permission.replied` | POST /observe |
129
361
 
130
362
  ### Tasks & commands
131
363
 
@@ -136,11 +368,15 @@ Restart OpenCode or open a new session. The plugin auto-captures everything.
136
368
 
137
369
  ### Model & config
138
370
 
139
- | Event | Hook | agentmemory API |
140
- |---|---|---|
141
- | LLM parameters | `chat.params` | POST /observe |
142
- | Config loaded | `config` | POST /observe |
143
- | Compaction (WIP) | `experimental.session.compacting` | POST /context → `output.context[]` |
371
+ | Event | V1 hook | V2 | agentmemory API |
372
+ |---|---|---|---|
373
+ | LLM parameters | `chat.params` | not captured | POST /observe (V1 only) |
374
+ | Config loaded | `config` | snapshot at setup | POST /observe |
375
+ | Compaction context | `experimental.session.compacting` | `ctx.session.hook("compaction")`, unverified | POST /context → `event.system[]` |
376
+
377
+ These three are the only differences between the V1 and V2 paths. Everything
378
+ else in this document is captured identically on both. See
379
+ [What V2 cannot do](#what-v2-cannot-do).
144
380
 
145
381
  ### File enrichment + memory injection (two-layer pipeline)
146
382
 
@@ -204,7 +440,7 @@ agentmemory ──push──▶ OpenCode system prompt
204
440
 
205
441
  ### Why OpenCode goes direct
206
442
 
207
- agentmemory already persists everything in SQLite (`data/state_store.db`). Adding an intermediate MEMORY.md file would duplicate data, introduce sync lag, and require the model to re-parse structured context from markdown. Direct injection delivers the same data with lower latency and zero staleness — the agent always sees what agentmemory knows right now.
443
+ agentmemory persists state through the iii state worker, using file-backed KV (`data/state_store.db`) by default or Redis when configured. Adding an intermediate MEMORY.md file would duplicate data, introduce sync lag, and require the model to re-parse structured context from markdown. Direct injection delivers the same data with lower latency and zero staleness — the agent always sees what agentmemory knows right now.
208
444
 
209
445
  ## Slash commands
210
446