opencode-session-recall 0.5.0 → 0.6.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
@@ -24,13 +24,19 @@ No embeddings. No vector store. No data duplication. No setup. Just install the
24
24
 
25
25
  ## Install
26
26
 
27
+ ```bash
28
+ opencode plugin opencode-session-recall
29
+ ```
30
+
31
+ Or add it to your `opencode.json` manually:
32
+
27
33
  ```jsonc
28
34
  {
29
35
  "plugin": [
30
36
  "opencode-session-recall",
31
37
 
32
- // Enable cross-project search
33
- ["opencode-session-recall", { "global": true }],
38
+ // Disable cross-project search if needed
39
+ ["opencode-session-recall", { "global": false }],
34
40
  ],
35
41
  }
36
42
  ```
@@ -129,7 +135,7 @@ Five tool calls, complete narrative reconstructed across projects.
129
135
  | Option | Type | Default | Description |
130
136
  | --------- | --------- | ------- | --------------------------------------------------- |
131
137
  | `primary` | `boolean` | `true` | Register tools as primary (available to all agents) |
132
- | `global` | `boolean` | `false` | Enable cross-project search via `scope: "global"` |
138
+ | `global` | `boolean` | `true` | Allow cross-project search via `scope: "global"` |
133
139
 
134
140
  ## How it works
135
141
 
@@ -141,7 +147,7 @@ When opencode compacts a session, it doesn't delete anything. Tool outputs get a
141
147
  - Zero setup — no embeddings to generate, no indexes to build, no data to sync
142
148
  - Sessions are scanned newest-first with bounded concurrency
143
149
  - Respects abort signals for long-running searches
144
- - Global scope is disabled by default
150
+ - Cross-project search enabled by default (disable with `global: false`)
145
151
 
146
152
  ## License
147
153
 
@@ -40,7 +40,7 @@ function errmsg(e) {
40
40
  // src/sessions.ts
41
41
  function sessions(client, unscoped, global, limits) {
42
42
  return tool({
43
- description: `List sessions from the opencode database. Use this FIRST to discover which sessions exist, then search their content with recall. Returns session titles, directories, and timestamps. For cross-project discovery, use scope "global" (requires plugin option global: true).
43
+ description: `List sessions from the opencode database. Use this FIRST to discover which sessions exist, then search their content with recall. Also use at session start to check if related work exists in other sessions or projects.
44
44
 
45
45
  Search filters by session title only (case-insensitive substring match \u2014 use recall for content search). Sessions are returned newest-updated first. This is a cheap metadata-only call.
46
46
 
@@ -57,7 +57,7 @@ Returns { ok, sessions: [{ id, title, directory, time, archived }], returned, sc
57
57
  if (args.scope === "global" && !global) {
58
58
  const err = {
59
59
  ok: false,
60
- error: "Global scope disabled. Enable via plugin option: global: true"
60
+ error: "Global scope disabled via plugin option: global: false"
61
61
  };
62
62
  return JSON.stringify(err);
63
63
  }
@@ -312,7 +312,7 @@ function scan(messages2, session, query, type, role, limit, before, after, width
312
312
  }
313
313
  function search(client, unscoped, global, limits) {
314
314
  return tool2({
315
- description: `Search your conversation history in the opencode database. Use this to recover context lost to compaction \u2014 original tool outputs, earlier messages, reasoning, and user instructions that were pruned from your context window.
315
+ description: `Search your conversation history in the opencode database. Use this to recover context lost to compaction \u2014 original tool outputs, earlier messages, reasoning, and user instructions that were pruned from your context window. Before debugging an issue or implementing a feature, check whether prior sessions already tackled it \u2014 the history shows whether an approach succeeded or was abandoned.
316
316
 
317
317
  Searches text content, tool inputs/outputs, and reasoning via case-insensitive substring matching. Returns matching snippets with session/message IDs you can pass to recall_get for full content, or recall_context if you need surrounding messages.
318
318
 
@@ -322,7 +322,7 @@ Scope costs: "session" scans 1 session. "project" scans up to \`sessions\` sessi
322
322
 
323
323
  Returns { ok, results: [{ sessionID, messageID, role, time, partID, partType, pruned, snippet, toolName? }], scanned, total, truncated }. Each result includes a pruned flag \u2014 if true, the content was compacted from your context window and recall_get will return the original full output. Check truncated to know if more matches exist beyond your results limit.
324
324
 
325
- This tool's own outputs are excluded from search results to prevent recursive noise, but remain visible via recall_get, recall_context, and recall_messages.`,
325
+ This tool's own outputs are excluded from search results to prevent recursive noise; use recall_get or recall_context to retrieve any message directly.`,
326
326
  args: {
327
327
  query: tool2.schema.string().min(1).describe("Text to search for (case-insensitive substring match)"),
328
328
  scope: tool2.schema.enum(["session", "project", "global"]).default("session").describe(
@@ -351,7 +351,7 @@ This tool's own outputs are excluded from search results to prevent recursive no
351
351
  if (args.scope === "global" && !args.sessionID && !global) {
352
352
  const err = {
353
353
  ok: false,
354
- error: "Global scope disabled. Enable via plugin option: global: true"
354
+ error: "Global scope disabled via plugin option: global: false"
355
355
  };
356
356
  return JSON.stringify(err);
357
357
  }
@@ -721,7 +721,7 @@ Returns { messages: [{ message: { id, role, time }, parts: [...] }], pagination:
721
721
  var server = async (ctx, options) => {
722
722
  const opts = options ?? {};
723
723
  const primary = opts.primary !== false;
724
- const global = opts.global === true;
724
+ const global = opts.global !== false;
725
725
  const clamp = (val, fallback, min = 1) => Math.max(min, Math.floor(val ?? fallback));
726
726
  const limits = {
727
727
  concurrency: clamp(opts.concurrency, DEFAULTS.concurrency),
@@ -1 +1 @@
1
- {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../src/search.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EAEpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EACV,cAAc,EAIf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAKL,KAAK,MAAM,EACZ,MAAM,YAAY,CAAC;AAqEpB,wBAAgB,MAAM,CACpB,MAAM,EAAE,cAAc,EACtB,QAAQ,EAAE,cAAc,EACxB,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GACb,cAAc,CAyNhB"}
1
+ {"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../src/search.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EAEpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EACV,cAAc,EAIf,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAKL,KAAK,MAAM,EACZ,MAAM,YAAY,CAAC;AAqEpB,wBAAgB,MAAM,CACpB,MAAM,EAAE,cAAc,EACtB,QAAQ,EAAE,cAAc,EACxB,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GACb,cAAc,CAwNhB"}
@@ -1 +1 @@
1
- {"version":3,"file":"sessions.d.ts","sourceRoot":"","sources":["../src/sessions.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EAEpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAKL,KAAK,MAAM,EACZ,MAAM,YAAY,CAAC;AAEpB,wBAAgB,QAAQ,CACtB,MAAM,EAAE,cAAc,EACtB,QAAQ,EAAE,cAAc,EACxB,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GACb,cAAc,CA8GhB"}
1
+ {"version":3,"file":"sessions.d.ts","sourceRoot":"","sources":["../src/sessions.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EAEpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAKL,KAAK,MAAM,EACZ,MAAM,YAAY,CAAC;AAEpB,wBAAgB,QAAQ,CACtB,MAAM,EAAE,cAAc,EACtB,QAAQ,EAAE,cAAc,EACxB,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GACb,cAAc,CA6GhB"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "$schema": "https://json.schemastore.org/package.json",
3
3
  "name": "opencode-session-recall",
4
- "version": "0.5.0",
4
+ "version": "0.6.0",
5
5
  "type": "module",
6
6
  "description": "Agent memory without a memory system — search and retrieve opencode conversation history that was lost to compaction, across sessions and projects",
7
7
  "main": "./dist/opencode-session-recall.js",