@zilliz/memsearch-opencode 0.3.5 → 0.3.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zilliz/memsearch-opencode",
3
- "version": "0.3.5",
3
+ "version": "0.3.6",
4
4
  "description": "memsearch plugin for OpenCode — semantic memory search across sessions",
5
5
  "type": "module",
6
6
  "main": "index.ts",
@@ -53,6 +53,21 @@ How to write a good skill body (this is what makes the skill usable):
53
53
  - The "description" is the trigger signal — if it does not name the situation and
54
54
  the verbs a user would type, the skill will never fire. Spend care on it.
55
55
 
56
+ Accuracy — confirm from the original, do not hallucinate:
57
+ - The journal entries are LOSSY SUMMARIES; they drop the exact commands, flags,
58
+ and paths. Do not reconstruct those from the summary alone.
59
+ - Before writing a step's exact command, confirm it from the original transcript.
60
+ Each journal entry has an anchor comment naming the original conversation; the
61
+ key differs by agent — `transcript:<file>` (Claude Code), `rollout:<file>`
62
+ (Codex), or `db:`/a `session:` id (OpenCode). For a file-based transcript, run
63
+ `memsearch transcript <file>` (optionally `--turn <id>`) to read the original
64
+ turns WITH their tool calls — that is where the real commands and output live.
65
+ For a session/db anchor (OpenCode), use that platform's transcript script.
66
+ - If you cannot read the transcript or confirm a detail, capture only what the
67
+ summary clearly states; keep the step general or omit it — a plausible-but-wrong
68
+ command is worse than none. Never invent specifics.
69
+ - Prefer fewer, verified steps over a complete-looking but partly-guessed procedure.
70
+
56
71
  JSON examples:
57
72
  {"skills":[]}
58
73
 
@@ -376,7 +376,14 @@ def run_native_provider(ctx, prompt: str) -> str:
376
376
  env = {**os.environ, "MEMSEARCH_NO_WATCH": "1"}
377
377
 
378
378
  if ctx.platform == "claude-code":
379
- cmd = ["claude", "-p", "--strict-mcp-config", "--tools", "", "--no-session-persistence", "--no-chrome"]
379
+ cmd = ["claude", "-p", "--strict-mcp-config", "--no-session-persistence", "--no-chrome"]
380
+ # Skill distillation needs to read original transcripts for exact commands.
381
+ # Open a narrow hole — Bash limited to the two read-only memsearch drill
382
+ # commands — only for that task; other maintenance keeps all tools off.
383
+ if getattr(ctx, "task", "") == "memory_to_skill":
384
+ cmd += ["--tools", "Bash", "--allowed-tools", "Bash(memsearch transcript:*) Bash(memsearch expand:*)"]
385
+ else:
386
+ cmd += ["--tools", ""]
380
387
  if model:
381
388
  cmd += ["--model", model]
382
389
  cmd += [
@@ -25,7 +25,9 @@ Candidates are never installed automatically; installing is always a human step.
25
25
  You already have the context, so **draft the skill yourself** — do not call the
26
26
  background distiller for this. Write a SKILL.md **body** (markdown, no
27
27
  frontmatter): imperative numbered steps for the recurring task, concrete commands
28
- and paths, no secrets, self-contained. Then persist it as a candidate:
28
+ and paths, no secrets, self-contained.
29
+
30
+ **Be exact — do not guess.** You have the live session for what you just did, so use the real commands, paths, and output, not approximations. If a detail is uncertain, verify it (re-read the relevant files or the transcript) or keep that step general — a wrong command is worse than a vague one. Then persist it as a candidate:
29
31
 
30
32
  ```bash
31
33
  printf '%s' "## <title>\n\n1. ...\n2. ..." | memsearch skills add \
@@ -45,6 +47,8 @@ recurring workflows get captured automatically going forward) — do not force i
45
47
  memsearch skills list # add -j for sources / installed paths
46
48
  ```
47
49
 
50
+ 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.
51
+
48
52
  Pick one, resolve where to install (ask if unset), then install:
49
53
 
50
54
  ```bash
@@ -65,8 +69,9 @@ reusable one and persist it with `memsearch skills add` (one call per skill), th
65
69
  same way as **A**. Use your own judgment: only propose procedures that recur and
66
70
  generalize, not one-offs from a single day.
67
71
 
68
- The background pass does this automatically when enabled; doing it here on demand
69
- uses your own reasoning and needs no provider configuration.
72
+ **Drill into the original before drafting.** The journal bullets are a lossy summary; the exact commands, flags, and paths live in the original conversation. OpenCode stores transcripts in its session database (not a file), and the journal anchor carries a `session:` id (and `turn:` when present). Run `python3 __INSTALL_DIR__/scripts/parse-transcript.py <session_id>` (add `--turn <id>` when the anchor has one) to read the original turns with their tool calls — that is where the executed commands and output live. Write the skill from that. If the shown excerpt feels incomplete, skim nearby turns in the same original source before committing to exact commands or paths. If you cannot read it or confirm a detail, keep the step general or omit it — never fabricate.
73
+
74
+ The background pass mines automatically when enabled, but it can only see the summaries; doing it here on demand lets you read the original transcripts, so the result is more accurate.
70
75
 
71
76
  ## D. Configure
72
77