ziiagentmemory 0.1.0

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 (160) hide show
  1. package/.env.example +175 -0
  2. package/AGENTS.md +124 -0
  3. package/LICENSE +190 -0
  4. package/README.md +1546 -0
  5. package/dist/cli.d.mts +5 -0
  6. package/dist/cli.d.mts.map +1 -0
  7. package/dist/cli.mjs +2859 -0
  8. package/dist/cli.mjs.map +1 -0
  9. package/dist/config-ChC9EtgV.mjs +259 -0
  10. package/dist/config-ChC9EtgV.mjs.map +1 -0
  11. package/dist/connect-JnsJXc68.mjs +1075 -0
  12. package/dist/connect-JnsJXc68.mjs.map +1 -0
  13. package/dist/hooks/notification.d.mts +1 -0
  14. package/dist/hooks/notification.mjs +74 -0
  15. package/dist/hooks/notification.mjs.map +1 -0
  16. package/dist/hooks/post-commit.d.mts +1 -0
  17. package/dist/hooks/post-commit.mjs +101 -0
  18. package/dist/hooks/post-commit.mjs.map +1 -0
  19. package/dist/hooks/post-tool-failure.d.mts +1 -0
  20. package/dist/hooks/post-tool-failure.mjs +75 -0
  21. package/dist/hooks/post-tool-failure.mjs.map +1 -0
  22. package/dist/hooks/post-tool-use.d.mts +1 -0
  23. package/dist/hooks/post-tool-use.mjs +120 -0
  24. package/dist/hooks/post-tool-use.mjs.map +1 -0
  25. package/dist/hooks/pre-compact.d.mts +1 -0
  26. package/dist/hooks/pre-compact.mjs +78 -0
  27. package/dist/hooks/pre-compact.mjs.map +1 -0
  28. package/dist/hooks/pre-tool-use.d.mts +1 -0
  29. package/dist/hooks/pre-tool-use.mjs +84 -0
  30. package/dist/hooks/pre-tool-use.mjs.map +1 -0
  31. package/dist/hooks/prompt-submit.d.mts +1 -0
  32. package/dist/hooks/prompt-submit.mjs +67 -0
  33. package/dist/hooks/prompt-submit.mjs.map +1 -0
  34. package/dist/hooks/session-end.d.mts +1 -0
  35. package/dist/hooks/session-end.mjs +60 -0
  36. package/dist/hooks/session-end.mjs.map +1 -0
  37. package/dist/hooks/session-start.d.mts +1 -0
  38. package/dist/hooks/session-start.mjs +85 -0
  39. package/dist/hooks/session-start.mjs.map +1 -0
  40. package/dist/hooks/stop.d.mts +1 -0
  41. package/dist/hooks/stop.mjs +44 -0
  42. package/dist/hooks/stop.mjs.map +1 -0
  43. package/dist/hooks/subagent-start.d.mts +1 -0
  44. package/dist/hooks/subagent-start.mjs +73 -0
  45. package/dist/hooks/subagent-start.mjs.map +1 -0
  46. package/dist/hooks/subagent-stop.d.mts +1 -0
  47. package/dist/hooks/subagent-stop.mjs +74 -0
  48. package/dist/hooks/subagent-stop.mjs.map +1 -0
  49. package/dist/hooks/task-completed.d.mts +1 -0
  50. package/dist/hooks/task-completed.mjs +73 -0
  51. package/dist/hooks/task-completed.mjs.map +1 -0
  52. package/dist/image-refs-BKLmp_sD.mjs +34 -0
  53. package/dist/image-refs-BKLmp_sD.mjs.map +1 -0
  54. package/dist/image-refs-C2YU7BIm.mjs +34 -0
  55. package/dist/image-refs-C2YU7BIm.mjs.map +1 -0
  56. package/dist/index.d.mts +2 -0
  57. package/dist/index.mjs +22324 -0
  58. package/dist/index.mjs.map +1 -0
  59. package/dist/keyed-mutex-DTHtcZrt.mjs +88 -0
  60. package/dist/keyed-mutex-DTHtcZrt.mjs.map +1 -0
  61. package/dist/logger-BEB7pCI9.mjs +43 -0
  62. package/dist/logger-BEB7pCI9.mjs.map +1 -0
  63. package/dist/schema-CNiCWzV9.mjs +78 -0
  64. package/dist/schema-CNiCWzV9.mjs.map +1 -0
  65. package/dist/src-Cr3pH_uH.mjs +20745 -0
  66. package/dist/src-Cr3pH_uH.mjs.map +1 -0
  67. package/dist/standalone-C6KzNkt5.mjs +700 -0
  68. package/dist/standalone-C6KzNkt5.mjs.map +1 -0
  69. package/dist/standalone.d.mts +25 -0
  70. package/dist/standalone.d.mts.map +1 -0
  71. package/dist/standalone.mjs +1867 -0
  72. package/dist/standalone.mjs.map +1 -0
  73. package/dist/tools-registry-DCt2KAWA.mjs +1145 -0
  74. package/dist/tools-registry-DCt2KAWA.mjs.map +1 -0
  75. package/docker-compose.yml +47 -0
  76. package/iii-config.docker.yaml +53 -0
  77. package/iii-config.yaml +61 -0
  78. package/package.json +99 -0
  79. package/plugin/.claude-plugin/plugin.json +13 -0
  80. package/plugin/.codex-plugin/plugin.json +15 -0
  81. package/plugin/.mcp.copilot.json +15 -0
  82. package/plugin/.mcp.json +13 -0
  83. package/plugin/hooks/hooks.codex.json +67 -0
  84. package/plugin/hooks/hooks.copilot.json +72 -0
  85. package/plugin/hooks/hooks.json +125 -0
  86. package/plugin/opencode/README.md +229 -0
  87. package/plugin/opencode/agentmemory-capture.ts +687 -0
  88. package/plugin/opencode/commands/recall.md +19 -0
  89. package/plugin/opencode/commands/remember.md +19 -0
  90. package/plugin/opencode/plugin.json +12 -0
  91. package/plugin/plugin.json +15 -0
  92. package/plugin/scripts/diagnostics.mjs +551 -0
  93. package/plugin/scripts/notification.d.mts +1 -0
  94. package/plugin/scripts/notification.mjs +74 -0
  95. package/plugin/scripts/notification.mjs.map +1 -0
  96. package/plugin/scripts/post-commit.d.mts +1 -0
  97. package/plugin/scripts/post-commit.mjs +101 -0
  98. package/plugin/scripts/post-commit.mjs.map +1 -0
  99. package/plugin/scripts/post-tool-failure.d.mts +1 -0
  100. package/plugin/scripts/post-tool-failure.mjs +75 -0
  101. package/plugin/scripts/post-tool-failure.mjs.map +1 -0
  102. package/plugin/scripts/post-tool-use.d.mts +1 -0
  103. package/plugin/scripts/post-tool-use.mjs +120 -0
  104. package/plugin/scripts/post-tool-use.mjs.map +1 -0
  105. package/plugin/scripts/pre-compact.d.mts +1 -0
  106. package/plugin/scripts/pre-compact.mjs +78 -0
  107. package/plugin/scripts/pre-compact.mjs.map +1 -0
  108. package/plugin/scripts/pre-tool-use.d.mts +1 -0
  109. package/plugin/scripts/pre-tool-use.mjs +84 -0
  110. package/plugin/scripts/pre-tool-use.mjs.map +1 -0
  111. package/plugin/scripts/prompt-submit.d.mts +1 -0
  112. package/plugin/scripts/prompt-submit.mjs +67 -0
  113. package/plugin/scripts/prompt-submit.mjs.map +1 -0
  114. package/plugin/scripts/session-end.d.mts +1 -0
  115. package/plugin/scripts/session-end.mjs +60 -0
  116. package/plugin/scripts/session-end.mjs.map +1 -0
  117. package/plugin/scripts/session-start.d.mts +1 -0
  118. package/plugin/scripts/session-start.mjs +85 -0
  119. package/plugin/scripts/session-start.mjs.map +1 -0
  120. package/plugin/scripts/stop.d.mts +1 -0
  121. package/plugin/scripts/stop.mjs +44 -0
  122. package/plugin/scripts/stop.mjs.map +1 -0
  123. package/plugin/scripts/subagent-start.d.mts +1 -0
  124. package/plugin/scripts/subagent-start.mjs +73 -0
  125. package/plugin/scripts/subagent-start.mjs.map +1 -0
  126. package/plugin/scripts/subagent-stop.d.mts +1 -0
  127. package/plugin/scripts/subagent-stop.mjs +74 -0
  128. package/plugin/scripts/subagent-stop.mjs.map +1 -0
  129. package/plugin/scripts/task-completed.d.mts +1 -0
  130. package/plugin/scripts/task-completed.mjs +73 -0
  131. package/plugin/scripts/task-completed.mjs.map +1 -0
  132. package/plugin/skills/_shared/TROUBLESHOOTING.md +38 -0
  133. package/plugin/skills/agentmemory-agents/REFERENCE.md +28 -0
  134. package/plugin/skills/agentmemory-agents/SKILL.md +34 -0
  135. package/plugin/skills/agentmemory-architecture/SKILL.md +33 -0
  136. package/plugin/skills/agentmemory-config/REFERENCE.md +42 -0
  137. package/plugin/skills/agentmemory-config/SKILL.md +37 -0
  138. package/plugin/skills/agentmemory-hooks/REFERENCE.md +20 -0
  139. package/plugin/skills/agentmemory-hooks/SKILL.md +39 -0
  140. package/plugin/skills/agentmemory-mcp-tools/REFERENCE.md +65 -0
  141. package/plugin/skills/agentmemory-mcp-tools/SKILL.md +39 -0
  142. package/plugin/skills/agentmemory-rest-api/REFERENCE.md +129 -0
  143. package/plugin/skills/agentmemory-rest-api/SKILL.md +43 -0
  144. package/plugin/skills/commit-context/EXAMPLES.md +71 -0
  145. package/plugin/skills/commit-context/SKILL.md +64 -0
  146. package/plugin/skills/commit-history/EXAMPLES.md +71 -0
  147. package/plugin/skills/commit-history/SKILL.md +62 -0
  148. package/plugin/skills/forget/EXAMPLES.md +75 -0
  149. package/plugin/skills/forget/SKILL.md +66 -0
  150. package/plugin/skills/handoff/EXAMPLES.md +56 -0
  151. package/plugin/skills/handoff/SKILL.md +68 -0
  152. package/plugin/skills/recall/EXAMPLES.md +74 -0
  153. package/plugin/skills/recall/SKILL.md +60 -0
  154. package/plugin/skills/recap/EXAMPLES.md +60 -0
  155. package/plugin/skills/recap/SKILL.md +63 -0
  156. package/plugin/skills/remember/EXAMPLES.md +67 -0
  157. package/plugin/skills/remember/SKILL.md +61 -0
  158. package/plugin/skills/session-history/EXAMPLES.md +59 -0
  159. package/plugin/skills/session-history/SKILL.md +61 -0
  160. package/plugin/skills/write-agentmemory-skill/SKILL.md +40 -0
@@ -0,0 +1,61 @@
1
+ ---
2
+ name: remember
3
+ description: Save an insight, decision, or learning to agentmemory's long-term storage with searchable concept tags. Use when the user says "remember this", "save this", "note that", "don't forget", or wants to preserve knowledge for future sessions.
4
+ argument-hint: "[what to remember]"
5
+ user-invocable: true
6
+ ---
7
+
8
+ The user wants to save this to long-term memory: $ARGUMENTS
9
+
10
+ ## Quick start
11
+
12
+ ```json
13
+ memory_save {
14
+ "content": "We rotate JWT refresh tokens on every use; the old token is revoked server-side in auth/refresh.ts.",
15
+ "concepts": "jwt-refresh-rotation, token-revocation, auth-flow",
16
+ "files": "src/auth/refresh.ts"
17
+ }
18
+ ```
19
+
20
+ Expected output:
21
+
22
+ ```text
23
+ Saved memory abc12345 with 3 concepts: jwt-refresh-rotation, token-revocation, auth-flow.
24
+ ```
25
+
26
+ ## Why
27
+
28
+ A memory is only as useful as the terms that retrieve it. Tag with specific
29
+ concepts so a future `recall` finds it, and preserve the user's own phrasing.
30
+
31
+ ## Workflow
32
+
33
+ 1. Pull the core insight, decision, or fact out of `$ARGUMENTS`.
34
+ 2. Extract 2-5 lowercased concept phrases. Prefer specific over generic
35
+ (`jwt-refresh-rotation` beats `auth`).
36
+ 3. Extract referenced file paths (absolute or repo-relative). Empty if none.
37
+ 4. Call `memory_save` with `content`, `concepts` (comma-separated string), and
38
+ `files` (comma-separated string).
39
+ 5. Confirm the save and echo the concepts so the user knows the retrieval terms.
40
+
41
+ ## Anti-patterns
42
+
43
+ WRONG: `concepts: "stuff, code, notes"` (generic tags nothing can find later).
44
+
45
+ RIGHT: `concepts: "jwt-refresh-rotation, token-revocation"` (specific, retrievable).
46
+
47
+ ## Checklist
48
+
49
+ - Content preserves the user's phrasing, not a paraphrase.
50
+ - Concepts are specific, lowercased, 2-5 items.
51
+ - File paths are real references, not guesses.
52
+ - Confirmation echoes the exact concepts tagged.
53
+
54
+ ## See also
55
+
56
+ - `recall`: retrieve what you save here (the pair to this skill).
57
+ - `forget`: remove a memory you saved by mistake.
58
+
59
+ ## Troubleshooting
60
+
61
+ See ../_shared/TROUBLESHOOTING.md if `memory_save` is not available.
@@ -0,0 +1,59 @@
1
+ # session-history worked examples
2
+
3
+ ## 1. Standard timeline
4
+
5
+ User: "Show me the session history."
6
+
7
+ Invocation:
8
+
9
+ ```json
10
+ memory_sessions { "limit": 20 }
11
+ ```
12
+
13
+ Response:
14
+
15
+ ```json
16
+ {
17
+ "sessions": [
18
+ { "id": "7f3a9c21", "project": "app", "startedAt": "2026-06-07T09:00:00Z",
19
+ "status": "completed", "observationCount": 14,
20
+ "summary": "Reworked refresh rotation",
21
+ "highlights": [ { "type": "decision", "title": "Rotate refresh tokens on every use" } ] },
22
+ { "id": "b21d004e", "project": "app", "startedAt": "2026-06-05T14:00:00Z",
23
+ "status": "completed", "observationCount": 9,
24
+ "highlights": [ { "type": "code", "title": "limit.ts counts per-IP" } ] }
25
+ ]
26
+ }
27
+ ```
28
+
29
+ Present:
30
+
31
+ > - `7f3a9c2` app, 2026-06-07 09:00, completed, 14 obs
32
+ > - decision: Rotate refresh tokens on every use (summary: Reworked refresh rotation)
33
+ > - `b21d004` app, 2026-06-05 14:00, completed, 9 obs
34
+ > - code: limit.ts counts per-IP
35
+
36
+ ## 2. Session with no observations
37
+
38
+ If a returned session has `observationCount: 0`, list it but say so:
39
+
40
+ > - `c98f110` app, 2026-06-04 11:00, abandoned, 0 obs (no recorded work)
41
+
42
+ ## 3. Empty history
43
+
44
+ User: "What did we do last time?"
45
+
46
+ ```json
47
+ memory_sessions { "limit": 20 }
48
+ ```
49
+
50
+ Response:
51
+
52
+ ```json
53
+ { "sessions": [] }
54
+ ```
55
+
56
+ Present:
57
+
58
+ > No recorded sessions yet for this project. Once you work with memory capture
59
+ > on, they will show here. Use `remember` to save a note now.
@@ -0,0 +1,61 @@
1
+ ---
2
+ name: session-history
3
+ description: Show what happened in recent past sessions on this project as a clean timeline. Use when the user asks "what did we do last time", "session history", "past sessions", or wants an overview of previous work.
4
+ user-invocable: true
5
+ ---
6
+
7
+ The user wants an overview of recent sessions on this project.
8
+
9
+ ## Quick start
10
+
11
+ ```json
12
+ memory_sessions { "limit": 20 }
13
+ ```
14
+
15
+ Expected output:
16
+
17
+ ```text
18
+ 7f3a9c2 · app · 2026-06-07 09:00 · completed · 14 obs
19
+ - decision: Rotate refresh tokens on every use
20
+ b21d004 · app · 2026-06-05 14:00 · completed · 9 obs
21
+ - code: limit.ts counts per-IP
22
+ ```
23
+
24
+ ## Why
25
+
26
+ Only show sessions and observations the tool returned. An empty history is a
27
+ real answer, never a cue to invent past work.
28
+
29
+ ## Workflow
30
+
31
+ 1. Call `memory_sessions` with `limit: 20` for a meaningful window.
32
+ 2. Present in reverse chronological order: session id (first 8), project, start
33
+ time, status.
34
+ 3. For sessions with observations, show the key highlights (type plus title).
35
+ 4. Note the total observation count per session.
36
+ 5. When a session summary exists, surface its title and the key decisions.
37
+
38
+ ## Anti-patterns
39
+
40
+ WRONG: the tool returns two sessions, you describe "several sessions of steady
41
+ progress" and add ones you remember from the conversation.
42
+
43
+ RIGHT: show exactly the two sessions returned, each with its real id, status, and
44
+ observation count.
45
+
46
+ ## Checklist
47
+
48
+ - Every session shown came from the tool response.
49
+ - Order is reverse-chronological.
50
+ - Per-session observation counts match the response.
51
+ - No session or highlight was invented or merged.
52
+
53
+ ## See also
54
+
55
+ - `recap`: same data grouped by date with highlights.
56
+ - `handoff`: jump straight into the most recent session.
57
+ - `recall`: search across all sessions by topic.
58
+
59
+ ## Troubleshooting
60
+
61
+ See ../_shared/TROUBLESHOOTING.md if `memory_sessions` is not available.
@@ -0,0 +1,40 @@
1
+ ---
2
+ name: write-agentmemory-skill
3
+ description: The house format and rules for writing or updating an agentmemory skill. Use when adding a new skill, restructuring an existing one, or reviewing a skill contribution for consistency.
4
+ user-invocable: false
5
+ ---
6
+
7
+ agentmemory skills follow one tiered format so they stay skimmable, accurate, and current. Match it exactly.
8
+
9
+ ## Directory layout
10
+
11
+ ```text
12
+ plugin/skills/<name>/
13
+ SKILL.md (required, under 100 lines)
14
+ REFERENCE.md (optional, dense facts; auto-generate data tables)
15
+ EXAMPLES.md (optional, worked transcripts)
16
+ ```
17
+
18
+ ## SKILL.md rules
19
+
20
+ - Frontmatter: `name`, `description`, optional `argument-hint`, and `user-invocable`. Set `user-invocable: true` only for skills the user runs as a slash command; reference and knowledge skills are `false`.
21
+ - Description is two sentences and the only thing the agent sees when deciding to load the skill. Sentence one states the capability. Sentence two starts "Use when" and lists concrete triggers. Keep it distinct from sibling skills, under 1024 chars, third person.
22
+ - Body order: Quick start (one concrete example), Why (the governing principle), Workflow (numbered steps with decision gates), Anti-patterns (a WRONG vs RIGHT callout for the top mistake), Checklist, See also (cross-link siblings), Reference or Troubleshooting pointer.
23
+ - Stay under 100 lines. Move dense facts to REFERENCE.md and examples to EXAMPLES.md.
24
+ - Cross-references link one level deep only. Shared recovery steps live in `../_shared/TROUBLESHOOTING.md`, never inlined.
25
+
26
+ ## Keep it current
27
+
28
+ Facts that exist in source (tool names and parameters, REST endpoints, env vars, connect adapters, hook events) are generated, never hand-typed. Edit the source, then run `npm run skills:gen`. CI runs `npm run skills:check` and fails on drift, so generated tables cannot fall behind the code.
29
+
30
+ ## Style
31
+
32
+ No external or competitor product names. No emojis. No em-dashes. No filler. State the thing and stop.
33
+
34
+ ## Checklist
35
+
36
+ - Description has a "Use when" sentence with real triggers.
37
+ - SKILL.md is under 100 lines.
38
+ - No time-sensitive claims and no duplicated troubleshooting block.
39
+ - Concrete example present; generated facts come from the generator.
40
+ - Cross-links resolve and go one level deep.