@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 +16 -5
- package/dist/cli.js +2281 -2098
- package/dist/config.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2449 -2171
- package/dist/lib/paths.d.ts +7 -0
- package/dist/lib/paths.d.ts.map +1 -1
- package/dist/lib/rag.d.ts +16 -0
- package/dist/lib/rag.d.ts.map +1 -1
- package/dist/lib/search-terms.d.ts +1 -0
- package/dist/lib/search-terms.d.ts.map +1 -1
- package/dist/tools/memory.d.ts +11 -0
- package/dist/tools/memory.d.ts.map +1 -1
- package/dist/tools/session.d.ts +7 -0
- package/dist/tools/session.d.ts.map +1 -1
- package/package.json +2 -2
- package/skills/opencode-memory/SKILL.md +6 -4
package/dist/lib/paths.d.ts
CHANGED
|
@@ -41,6 +41,13 @@ export declare function normPath(p: string): string;
|
|
|
41
41
|
* `path.posix.join` so the result keeps the plugin's forward-slash invariant.
|
|
42
42
|
*/
|
|
43
43
|
export declare function normalizeDirPath(p: string): string;
|
|
44
|
+
/**
|
|
45
|
+
* Resolve a caller-provided relative path beneath a trusted root.
|
|
46
|
+
*
|
|
47
|
+
* This is a lexical containment check; callers that read existing files
|
|
48
|
+
* should additionally compare their real paths if symlinks are in scope.
|
|
49
|
+
*/
|
|
50
|
+
export declare function resolveContainedPath(root: string, relativePath: string): string;
|
|
44
51
|
/**
|
|
45
52
|
* Expand a leading `~` in user-provided paths. Shells usually expand
|
|
46
53
|
* this before setting OPENCODE_MEMORY_DIR, but JSON-based host configs
|
package/dist/lib/paths.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/lib/paths.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAKH;;;;;;;;;;;;;;GAcG;AACH,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,MAAM,CAiB/E;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAOtF;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAK7E;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,SAAS,EAAE,MAAM,EAAE,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,MAAM,CAczG;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,GAAG,GAAE,MAAM,CAAC,UAAwB,GACnC,MAAM,CAIR;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAErD"}
|
package/dist/lib/rag.d.ts
CHANGED
|
@@ -53,6 +53,22 @@ export declare function installGuidance(): string;
|
|
|
53
53
|
* parse error upstream) resolves to the empty string — degrading
|
|
54
54
|
* gracefully rather than propagating shell exceptions.
|
|
55
55
|
*/
|
|
56
|
+
export interface RagCommandResult {
|
|
57
|
+
exitCode: number;
|
|
58
|
+
stdout: string;
|
|
59
|
+
stderr: string;
|
|
60
|
+
}
|
|
61
|
+
export type RagCommandRunner = (argv: string[]) => Promise<RagCommandResult>;
|
|
62
|
+
/**
|
|
63
|
+
* Execute a semantic search with source diversification. Exported with an
|
|
64
|
+
* injectable runner so compatibility behavior can be tested without spawning
|
|
65
|
+
* the installed binary.
|
|
66
|
+
*/
|
|
67
|
+
export declare function runRagSearch(shim: string, args: {
|
|
68
|
+
query: string;
|
|
69
|
+
indexDir: string;
|
|
70
|
+
topK?: number;
|
|
71
|
+
}, runner?: RagCommandRunner): Promise<string>;
|
|
56
72
|
export declare function ragSearch(args: {
|
|
57
73
|
query: string;
|
|
58
74
|
indexDir: string;
|
package/dist/lib/rag.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rag.d.ts","sourceRoot":"","sources":["../../src/lib/rag.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAQH,MAAM,WAAW,SAAS;IACxB,qEAAqE;IACrE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,GAAG,IAAI,CAMhD;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,IAAI,SAAS,CAEpC;AAED,uCAAuC;AACvC,wBAAgB,YAAY,IAAI,OAAO,CAEtC;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,IAAI,MAAM,CAoBxC;AAED;;;;;GAKG;AACH,wBAAsB,SAAS,CAAC,IAAI,EAAE;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GAAG,OAAO,CAAC,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"rag.d.ts","sourceRoot":"","sources":["../../src/lib/rag.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAQH,MAAM,WAAW,SAAS;IACxB,qEAAqE;IACrE,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,GAAG,IAAI,CAMhD;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,IAAI,SAAS,CAEpC;AAED,uCAAuC;AACvC,wBAAgB,YAAY,IAAI,OAAO,CAEtC;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,IAAI,MAAM,CAoBxC;AAED;;;;;GAKG;AACH,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,gBAAgB,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,OAAO,CAAC,gBAAgB,CAAC,CAAC;AAmB7E;;;;GAIG;AACH,wBAAsB,YAAY,CAChC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,EACxD,MAAM,GAAE,gBAAgC,GACvC,OAAO,CAAC,MAAM,CAAC,CAsBjB;AAED,wBAAsB,SAAS,CAAC,IAAI,EAAE;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GAAG,OAAO,CAAC,MAAM,CAAC,CAIlB;AAED;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;CAClB,GAAG,OAAO,CAQV;AAED;;;;GAIG;AACH,wBAAsB,aAAa,IAAI,OAAO,CAAC,MAAM,CAAC,CAUrD"}
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
* - Quoted phrases become a single term (with the quotes stripped).
|
|
11
11
|
* - Whitespace-separated words become individual terms.
|
|
12
12
|
* - Very short words (<2 chars) and common stop words are filtered out.
|
|
13
|
+
* - Duplicate terms are removed case-insensitively, preserving first-seen order.
|
|
13
14
|
*
|
|
14
15
|
* The original casing is preserved in the return value; downstream callers
|
|
15
16
|
* lowercase when they need to compare. That's intentional: a future ranker
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search-terms.d.ts","sourceRoot":"","sources":["../../src/lib/search-terms.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH
|
|
1
|
+
{"version":3,"file":"search-terms.d.ts","sourceRoot":"","sources":["../../src/lib/search-terms.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,CAgBxD;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAItE;AAED;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,0DAA0D;IAC1D,OAAO,EAAE,OAAO,CAAC;IACjB,+DAA+D;IAC/D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oEAAoE;IACpE,WAAW,EAAE,MAAM,CAAC;IACpB,iDAAiD;IACjD,UAAU,EAAE,MAAM,CAAC;IACnB,mDAAmD;IACnD,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC;IAChB,qDAAqD;IACrD,IAAI,EAAE,MAAM,CAAC;IACb,qDAAqD;IACrD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,qEAAqE;IACrE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iCAAiC;IACjC,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,WAAW,GAAG,MAAM,CAgDzD"}
|
package/dist/tools/memory.d.ts
CHANGED
|
@@ -36,14 +36,25 @@ export declare const search: ToolDefinition;
|
|
|
36
36
|
* wrapper so tests can call it with plain arguments and assert against the
|
|
37
37
|
* returned string without constructing a full tool context.
|
|
38
38
|
*/
|
|
39
|
+
export type MemorySearchDetail = "compact" | "normal" | "debug";
|
|
39
40
|
export declare function runSearch(input: {
|
|
40
41
|
query: string;
|
|
41
42
|
category?: string;
|
|
43
|
+
detail?: MemorySearchDetail;
|
|
42
44
|
}): Promise<string>;
|
|
43
45
|
export declare const list: ToolDefinition;
|
|
44
46
|
export declare function runList(input: {
|
|
45
47
|
category?: string;
|
|
46
48
|
}): Promise<string>;
|
|
49
|
+
/** Select an ATX heading and its descendants, stopping at the next peer/parent. */
|
|
50
|
+
export declare function selectHeadingSection(body: string, heading: string): string | undefined;
|
|
51
|
+
export declare const read: ToolDefinition;
|
|
52
|
+
export declare function runRead(input: {
|
|
53
|
+
path: string;
|
|
54
|
+
heading?: string;
|
|
55
|
+
offset?: number;
|
|
56
|
+
maxChars?: number;
|
|
57
|
+
}): Promise<string>;
|
|
47
58
|
export declare const access: ToolDefinition;
|
|
48
59
|
export declare function runAccess(input: {
|
|
49
60
|
path: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../src/tools/memory.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAQ,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"memory.d.ts","sourceRoot":"","sources":["../../src/tools/memory.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAQ,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAC;AA+ChE;;;GAGG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAMrD;AAED;;;GAGG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,GAAG,KAAK,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAWpG;AAED;;;;GAIG;AACH,wBAAgB,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAEpE;AAkBD,wBAAgB,uBAAuB,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAqBlE;AAED,wBAAgB,qBAAqB,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAMhE;AAED,wBAAgB,2BAA2B,CAAC,SAAS,CAAC,EAAE,MAAM,GAAG,MAAM,CAGtE;AAED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EH,wBAAsB,QAAQ,IAAI,OAAO,CAAC,MAAM,CAAC,CAwBhD"}
|
package/dist/tools/session.d.ts
CHANGED
|
@@ -18,6 +18,11 @@ export declare function likeOr(col: string, patterns: string[]): string;
|
|
|
18
18
|
* used as a ranking signal so rows matching more terms surface first.
|
|
19
19
|
*/
|
|
20
20
|
export declare function termHits(col: string, patterns: string[]): string;
|
|
21
|
+
export declare function escapeLikeTerm(term: string): string;
|
|
22
|
+
/** Count distinct query terms found in either the title or any session part. */
|
|
23
|
+
export declare function sessionTermHits(titleCol: string, sessionIdCol: string, partsCte: string, patterns: string[]): string;
|
|
24
|
+
/** Return short context centered around the earliest case-insensitive term match. */
|
|
25
|
+
export declare function centerSnippet(text: string, terms: string[], maxChars?: number): string;
|
|
21
26
|
export interface SessionSearchRow {
|
|
22
27
|
id: string;
|
|
23
28
|
title: string | null;
|
|
@@ -34,6 +39,7 @@ export interface SessionListRow {
|
|
|
34
39
|
created: string;
|
|
35
40
|
updated: string;
|
|
36
41
|
}
|
|
42
|
+
export declare function normalizeSessionInteger(value: number | undefined, fallback: number, minimum: number, maximum: number): number;
|
|
37
43
|
export declare const search: ToolDefinition;
|
|
38
44
|
export declare function runSessionSearch(input: {
|
|
39
45
|
query: string;
|
|
@@ -54,6 +60,7 @@ export declare function runSessionRead(input: {
|
|
|
54
60
|
sessionId: string;
|
|
55
61
|
limit?: number;
|
|
56
62
|
offset?: number;
|
|
63
|
+
messageCharOffset?: number;
|
|
57
64
|
role?: "all" | "user" | "assistant";
|
|
58
65
|
currentSessionId?: string;
|
|
59
66
|
}): Promise<string>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/tools/session.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAQ,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"session.d.ts","sourceRoot":"","sources":["../../src/tools/session.ts"],"names":[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ACf,OAAO,EAAE,MAAM,GACd,MAAM,CAGR;AA0BD,eAAO,MAAM,MAAM,EAAE,cA2BnB,CAAC;AAEH,wBAAsB,gBAAgB,CAAC,KAAK,EAAE;IAC5C,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,GAAG,OAAO,CAAC,MAAM,CAAC,CAgIlB;AAED,eAAO,MAAM,IAAI,EAAE,cAqCjB,CAAC;AAEH,wBAAsB,cAAc,CAAC,KAAK,EAAE;IAC1C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,GAAG,OAAO,CAAC,MAAM,CAAC,CAsDlB;AAED,eAAO,MAAM,IAAI,EAAE,cA6CjB,CAAC;AAEH,wBAAsB,cAAc,CAAC,KAAK,EAAE;IAC1C,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,IAAI,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,WAAW,CAAC;IACpC,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,GAAG,OAAO,CAAC,MAAM,CAAC,CAwIlB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mathew-cf/opencode-memory",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Persistent cross-session memory for OpenCode — a hybrid keyword + semantic search layer over a local markdown knowledge base, plus session history tools and guardrails that nudge agents to use them.",
|
|
5
5
|
"author": "mat",
|
|
6
6
|
"license": "Apache-2.0",
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"persistence"
|
|
47
47
|
],
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@mathew-cf/rag-cli": "^
|
|
49
|
+
"@mathew-cf/rag-cli": "^1.1.0",
|
|
50
50
|
"@vscode/ripgrep": "^1.17.1",
|
|
51
51
|
"zod": "^3.25.0"
|
|
52
52
|
},
|
|
@@ -13,13 +13,14 @@ The goal isn't to save everything — it's to save what took >1 minute to figure
|
|
|
13
13
|
|
|
14
14
|
| Tool | Purpose |
|
|
15
15
|
| --------------------------------- | --------------------------------------- |
|
|
16
|
-
| `memory_search(query, category?)` |
|
|
16
|
+
| `memory_search(query, category?, detail?)` | Compact hybrid keyword + semantic search (up to 5 results) |
|
|
17
|
+
| `memory_read(path, heading?, max_chars?)` | Read bounded content and record access automatically |
|
|
17
18
|
| `memory_list(category?)` | Browse categories or list files |
|
|
18
19
|
| `memory_save()` | Commit + re-index after writing/editing |
|
|
19
20
|
| `memory_access(path)` | Mark a file as read & useful (bumps ranking) |
|
|
20
21
|
| `memory_setup()` | Check `rag` install status, print guidance |
|
|
21
22
|
|
|
22
|
-
Read search results with
|
|
23
|
+
Read search results with `memory_read`; use `heading` to retrieve only a relevant section. The legacy `memory_access` remains available when a memory was read through another surface.
|
|
23
24
|
|
|
24
25
|
---
|
|
25
26
|
|
|
@@ -27,7 +28,7 @@ Read search results with the Read tool on `~/opencode-memory/{path}`.
|
|
|
27
28
|
|
|
28
29
|
```
|
|
29
30
|
START → memory_search("what I'm working on")
|
|
30
|
-
|
|
31
|
+
memory_read relevant files or heading sections
|
|
31
32
|
Verify mutable facts via live sources (not memory)
|
|
32
33
|
|
|
33
34
|
DURING → Save discoveries immediately when they happen
|
|
@@ -269,7 +270,8 @@ Fix: document the target architecture as if it's already the design. If you must
|
|
|
269
270
|
- Be specific: `memory_search("retry jitter config")` not `memory_search("retry")`
|
|
270
271
|
- Multi-term = OR with ranking: `"oauth scopes"` surfaces files with both terms first
|
|
271
272
|
- Filter by category: `memory_search("api-core", category="repos")`
|
|
272
|
-
-
|
|
273
|
+
- Use `memory_read(path, heading?)` on likely matches instead of loading whole files
|
|
274
|
+
- Use `detail="debug"` only when ranking diagnostics or related-file expansion is needed
|
|
273
275
|
- Set `importance: high` for frequently referenced knowledge; it affects ranking
|
|
274
276
|
|
|
275
277
|
---
|