@mathew-cf/opencode-memory 1.0.1 → 1.2.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.
package/README.md CHANGED
@@ -12,7 +12,7 @@ LLM agents forget everything between sessions. That means rediscovering the same
12
12
 
13
13
  | Category | Additions |
14
14
  | ------------------ | ------------------------------------------------------------------------- |
15
- | **Memory tools** | `memory_search`, `memory_list`, `memory_save`, `memory_access`, `memory_setup` |
15
+ | **Memory tools** | `memory_search`, `memory_read`, `memory_list`, `memory_save`, `memory_access`, `memory_setup` |
16
16
  | **Session tools** | `session_search`, `session_read`, `session_list` (OpenCode only — read OpenCode's SQLite history) |
17
17
  | **Hooks** | Search-first nudge at 8 tool calls; discovery nudge on subagent outputs; retrospective reminder at compaction time (OpenCode only) |
18
18
  | **Skill** | `opencode-memory` — auto-registered in OpenCode, dropped at `~/.agents/skills/opencode-memory` for Zed & Pi |
@@ -25,7 +25,7 @@ LLM agents forget everything between sessions. That means rediscovering the same
25
25
  ```jsonc
26
26
  // opencode.jsonc
27
27
  {
28
- "plugin": ["@mathew-cf/opencode-memory@1.0.1"]
28
+ "plugin": ["@mathew-cf/opencode-memory@1.2.0"]
29
29
  }
30
30
  ```
31
31
 
@@ -106,12 +106,23 @@ After writing or editing files, call `memory_save` — it runs `git add -A` + co
106
106
  ### Searching
107
107
 
108
108
  ```
109
- memory_search("retry jitter") # hybrid rg + rag
109
+ memory_search("retry jitter") # compact hybrid rg + rag results (up to 5)
110
110
  memory_search("auth", category="repos") # filter to a category
111
- memory_list() # browse categories + counts
112
- memory_list("technical") # list files in one category
111
+ memory_read("repos/example.md") # frontmatter + first 4,000 body chars
112
+ memory_read("repos/example.md", heading="Build") # retrieve one heading section
113
+ memory_list() # browse categories + counts
114
+ memory_list("technical") # list files in one category
113
115
  ```
114
116
 
117
+ ### Reading session history
118
+
119
+ `session_search` returns a message `offset` for each content match. Pass that to
120
+ `session_read` to jump to the relevant message. Session reads normalize invalid
121
+ pagination values, cap `limit` at 100 messages, and expose at most about 16,000
122
+ message-text characters per call. If that bound falls within one oversized
123
+ message, the response provides both `offset` and `message_char_offset`; pass
124
+ both back to continue at a UTF-safe boundary without skipping content.
125
+
115
126
  See the bundled skill (`skills/opencode-memory/SKILL.md`) for the full protocol.
116
127
 
117
128
  ## How the guard hook works