@mathew-cf/opencode-memory 0.3.1 → 1.0.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 +12 -10
- package/dist/cli.d.ts +90 -2
- package/dist/cli.d.ts.map +1 -1
- package/dist/cli.js +310 -158
- package/dist/config.d.ts +2 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/constants.d.ts +2 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/hooks/guard.d.ts +1 -8
- package/dist/hooks/guard.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +226 -154
- package/dist/lib/paths.d.ts +36 -8
- package/dist/lib/paths.d.ts.map +1 -1
- package/dist/tools/memory.d.ts +11 -40
- package/dist/tools/memory.d.ts.map +1 -1
- package/dist/tools/session.d.ts +4 -47
- package/dist/tools/session.d.ts.map +1 -1
- package/package.json +14 -2
package/dist/config.d.ts
CHANGED
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
* the search work. They're scoped tight enough not to crowd out the
|
|
19
19
|
* memory bits but useful enough to ship as opinionated defaults.
|
|
20
20
|
*/
|
|
21
|
-
export declare
|
|
21
|
+
export declare function buildMemoryPromptAppendix(memoryDir?: string): string;
|
|
22
|
+
export declare const MEMORY_PROMPT_APPENDIX: string;
|
|
22
23
|
/**
|
|
23
24
|
* Subagents that should get the memory prompt appendix. These are the
|
|
24
25
|
* built-in subagent names used by OpenCode — custom agents are left alone.
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH;;;;;;;;;;GAUG;AACH,wBAAgB,yBAAyB,CAAC,SAAS,SAA+B,GAAG,MAAM,CAuB1F;AAED,eAAO,MAAM,sBAAsB,QAA8B,CAAC;AAElE;;;GAGG;AACH,eAAO,MAAM,aAAa,uEAAwE,CAAC;AAEnG;;;GAGG;AACH,eAAO,MAAM,mBAAmB,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAOtD,CAAC;AAEF,UAAU,UAAU;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChC,MAAM,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IAC/C,UAAU,CAAC,EAAE;QACX,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC;QACxC,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC;KACvD,CAAC;CACH;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,IAAI,CAgEzG"}
|
package/dist/constants.d.ts
CHANGED
|
@@ -13,7 +13,8 @@ export declare const CATEGORIES: readonly ["preferences", "repos", "technical",
|
|
|
13
13
|
export type Category = (typeof CATEGORIES)[number];
|
|
14
14
|
/**
|
|
15
15
|
* Default directory, relative to the user's home, where memory files live.
|
|
16
|
-
* The `
|
|
16
|
+
* The `OPENCODE_MEMORY_DIR` env var overrides this (primarily for tests
|
|
17
|
+
* and for users who keep their knowledge base in a non-default location).
|
|
17
18
|
*/
|
|
18
19
|
export declare const DEFAULT_MEMORY_SUBDIR = "opencode-memory";
|
|
19
20
|
/**
|
package/dist/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,UAAU,4FAQb,CAAC;AAEX,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnD
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH;;;;;GAKG;AACH,eAAO,MAAM,UAAU,4FAQb,CAAC;AAEX,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnD;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,oBAAoB,CAAC;AAEvD;;;;GAIG;AACH,eAAO,MAAM,gBAAgB,SAAS,CAAC;AAEvC;;;;GAIG;AACH,eAAO,MAAM,UAAU,aAYrB,CAAC"}
|
package/dist/hooks/guard.d.ts
CHANGED
|
@@ -33,17 +33,10 @@ export declare function makeInitialState(): SessionState;
|
|
|
33
33
|
* (`opencode-memory.memory_search` or similar). Exported for tests.
|
|
34
34
|
*/
|
|
35
35
|
export declare function matchesToolName(toolName: string, candidates: string[]): boolean;
|
|
36
|
-
/**
|
|
37
|
-
* After-tool-call reducer. Updates state and returns any reminder text to
|
|
38
|
-
* append to the tool's output. Returns `null` if no reminder should fire.
|
|
39
|
-
*
|
|
40
|
-
* Kept as a pure function on `(state, input) -> reminder | null` so tests
|
|
41
|
-
* can reason about the nudge timing without plumbing through a full plugin
|
|
42
|
-
* context.
|
|
43
|
-
*/
|
|
44
36
|
export declare function afterToolUpdate(state: SessionState, input: {
|
|
45
37
|
tool: string;
|
|
46
38
|
output: string;
|
|
39
|
+
memoryDir?: string;
|
|
47
40
|
}): string | null;
|
|
48
41
|
/**
|
|
49
42
|
* Build the compaction context that should survive a session summarization
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"guard.d.ts","sourceRoot":"","sources":["../../src/hooks/gu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;QAAC,MAAM,CAAC,EAAE,MAAM,CAAA;KAAE;EAMlG"}
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAC;AAgElD;;;;;;;;;;GAUG;;;;;AACH,wBAGE;AAGF,OAAO,EAAE,WAAW,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAC9E,OAAO,EACL,eAAe,EACf,sBAAsB,EACtB,gBAAgB,EAChB,gBAAgB,EAChB,eAAe,EACf,KAAK,YAAY,GAClB,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,WAAW,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,YAAY,MAAM,iBAAiB,CAAC"}
|