@zilliz/memsearch-opencode 0.3.11 → 0.3.12
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/index.ts +22 -2
- package/package.json +1 -1
- package/skills/memory-config/SKILL.md +7 -0
- package/skills/memory-to-skill/SKILL.md +6 -0
package/index.ts
CHANGED
|
@@ -150,6 +150,23 @@ function shellEscape(s: string): string {
|
|
|
150
150
|
return s.replace(/'/g, "'\\''");
|
|
151
151
|
}
|
|
152
152
|
|
|
153
|
+
export function getSkillCandidateHint(memsearchDir: string, memsearchCmd: string): string {
|
|
154
|
+
try {
|
|
155
|
+
const result = spawnSync(
|
|
156
|
+
"bash",
|
|
157
|
+
[
|
|
158
|
+
"-c",
|
|
159
|
+
`MEMSEARCH_DIR='${shellEscape(memsearchDir)}' ${memsearchCmd} skills status --hint`,
|
|
160
|
+
],
|
|
161
|
+
{ encoding: "utf-8", timeout: 5000 }
|
|
162
|
+
);
|
|
163
|
+
if (result.status !== 0) return "";
|
|
164
|
+
return (result.stdout || "").trim().split("\n")[0] || "";
|
|
165
|
+
} catch {
|
|
166
|
+
return "";
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
|
|
153
170
|
/** Marks the start of memsearch's injected block within a system message. */
|
|
154
171
|
export const MEMSEARCH_SYSTEM_MARKER = "[memsearch] Memory available.";
|
|
155
172
|
|
|
@@ -277,6 +294,7 @@ const MemsearchPlugin: Plugin = async ({ project, directory, worktree }) => {
|
|
|
277
294
|
const collectionName = deriveCollectionName(projectDir);
|
|
278
295
|
const memsearchDir = join(projectDir, ".memsearch");
|
|
279
296
|
const memoryDir = join(memsearchDir, "memory");
|
|
297
|
+
const skillCandidateHint = getSkillCandidateHint(memsearchDir, memsearchCmd);
|
|
280
298
|
const home = process.env.HOME || "~";
|
|
281
299
|
|
|
282
300
|
// Skip capture/recall in child processes to prevent recursion
|
|
@@ -433,10 +451,12 @@ const MemsearchPlugin: Plugin = async ({ project, directory, worktree }) => {
|
|
|
433
451
|
"experimental.chat.system.transform": async (_input: any, output: any) => {
|
|
434
452
|
try {
|
|
435
453
|
const context = getRecentMemories(memoryDir);
|
|
436
|
-
if (context) {
|
|
454
|
+
if (context || skillCandidateHint) {
|
|
437
455
|
const memoryText =
|
|
438
456
|
`${MEMSEARCH_SYSTEM_MARKER} You have access to memory_search, ` +
|
|
439
|
-
`memory_get, and memory_transcript tools for recalling past sessions
|
|
457
|
+
`memory_get, and memory_transcript tools for recalling past sessions.` +
|
|
458
|
+
`${skillCandidateHint ? `\n${skillCandidateHint}` : ""}` +
|
|
459
|
+
`${context ? `\n\n${context}` : ""}`;
|
|
440
460
|
output.system = mergeSystemMemoryContext(output.system, memoryText);
|
|
441
461
|
}
|
|
442
462
|
} catch { /* ignore */ }
|
package/package.json
CHANGED
|
@@ -93,6 +93,8 @@ Check index health:
|
|
|
93
93
|
|
|
94
94
|
```bash
|
|
95
95
|
memsearch stats
|
|
96
|
+
STATE_DIR="${MEMSEARCH_DIR:-$(git rev-parse --show-toplevel 2>/dev/null || pwd)/.memsearch}"
|
|
97
|
+
test -f "$STATE_DIR/.index-state.json" && cat "$STATE_DIR/.index-state.json"
|
|
96
98
|
```
|
|
97
99
|
|
|
98
100
|
OpenCode transcript recall reads from OpenCode's SQLite database, while captured MemSearch memory lives as markdown under `.memsearch/memory/`.
|
|
@@ -208,6 +210,11 @@ Model guidance:
|
|
|
208
210
|
|
|
209
211
|
Advanced maintenance runs after the plugin wakes it, only when enabled, journal input changed, and `min_interval_hours` elapsed. `PROJECT.md` and `USER.md` are maintenance artifacts by default and are not automatically indexed.
|
|
210
212
|
|
|
213
|
+
If indexing seems silent or search looks stale, check `.memsearch/.index-state.json`
|
|
214
|
+
for `status`, `last_error`, and `failed_files`. `status: degraded` means the
|
|
215
|
+
scan completed but one or more files failed; `status: error` means the index run
|
|
216
|
+
did not complete.
|
|
217
|
+
|
|
211
218
|
If advanced maintenance or `memory_to_skill` seems silent, check
|
|
212
219
|
`.memsearch/.maintenance-state.json` for `<plugin>.<task>.last_error` and
|
|
213
220
|
`last_failed_at`; background hook errors may not surface in the chat.
|
|
@@ -47,10 +47,16 @@ captured automatically going forward) — do not force it.
|
|
|
47
47
|
## B. Review & install candidates (1→2)
|
|
48
48
|
|
|
49
49
|
```bash
|
|
50
|
+
memsearch skills status # pending candidate versions needing install
|
|
50
51
|
memsearch skills list # add -j for sources / installed paths
|
|
51
52
|
git -C .memsearch/skill-candidates log --oneline -5 2>/dev/null || true
|
|
52
53
|
```
|
|
53
54
|
|
|
55
|
+
`skills status` compares each candidate's current `SKILL.md` content hash with
|
|
56
|
+
the hash recorded by the last `skills install`. It does not inspect live agent
|
|
57
|
+
skill directories. A pending installed skill means the candidate source evolved
|
|
58
|
+
after the last deliberate install; reinstall only after reviewing the candidate.
|
|
59
|
+
|
|
54
60
|
Before recommending or installing, skim the candidate's body: if a step looks uncertain or loosely summarized, re-check it against the source (open the transcript if needed) or flag it to the user and let them decide — installing copies the candidate as-is, so this is the last chance to catch a wrong step.
|
|
55
61
|
When showing candidates, mention the store's recent git history when it helps
|
|
56
62
|
explain whether a candidate is new, evolved, removed, or re-created.
|