@witness-ai/opencode 0.7.0-beta.0 → 0.7.1

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.
Files changed (3) hide show
  1. package/README.md +6 -0
  2. package/package.json +3 -3
  3. package/witness.js +8 -4
package/README.md CHANGED
@@ -52,6 +52,12 @@ npm exec --yes --package=@witness-ai/opencode@beta -- witness doctor
52
52
  npm exec --yes --package=@witness-ai/opencode@beta -- witness distill status
53
53
  ```
54
54
 
55
+ > **Upgrade note:** Older witness releases could leave an OpenCode session whose agent or title is
56
+ > `witness-distill` when distillation was interrupted. Current releases no longer create or filter
57
+ > those sessions in OpenCode's user database. Before the first import after upgrading, remove any
58
+ > leftover `witness-distill` sessions with OpenCode's supported session-management tools so they are
59
+ > not captured as normal archive data.
60
+
55
61
  By default the model is downloaded from Hugging Face. A custom `WITNESS_MODEL_BASE_URL` must serve the same paths (`onnx/model.onnx` and `tokenizer.json`) and also set `WITNESS_MODEL_SHA256` plus `WITNESS_TOKENIZER_SHA256`.
56
62
 
57
63
  Automatic distillation is batched by default: sessions are reconciled on startup and idle, while model work starts at most once every 10 minutes, drains the current queue, then exits so the embed model is not resident. Edit witness `config.toml` if you want manual-only behavior:
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@witness-ai/opencode",
3
3
  "mcpName": "io.github.IngTian/witness",
4
- "version": "0.7.0-beta.0",
4
+ "version": "0.7.1",
5
5
  "description": "MCP memory / second brain for Claude Code & OpenCode — captures your coding sessions and distills how your knowledge and habits evolve over time, queryable by your agent.",
6
6
  "type": "module",
7
7
  "main": "./witness.js",
@@ -21,8 +21,8 @@
21
21
  "README.md"
22
22
  ],
23
23
  "optionalDependencies": {
24
- "@witness-ai/opencode-darwin-arm64": "0.7.0-beta.0",
25
- "@witness-ai/opencode-linux-x64": "0.7.0-beta.0"
24
+ "@witness-ai/opencode-darwin-arm64": "0.7.1",
25
+ "@witness-ai/opencode-linux-x64": "0.7.1"
26
26
  },
27
27
  "keywords": [
28
28
  "mcp",
package/witness.js CHANGED
@@ -104,7 +104,11 @@ const plugin = async () => {
104
104
  quietTimer = setTimeout(() => {
105
105
  quietTimer = null
106
106
  if (disposed || disposing) return
107
- spawnWitness(["worker-run", "--auto"])
107
+ // worker-kick, NOT `worker-run --auto`: dispose below runs `worker stop
108
+ // --auto-only`, which latches a durable worker_stop_requested flag that an auto
109
+ // worker refuses to run under. Only the shared kick gate clears it, so spawning
110
+ // worker-run directly would no-op forever after the first OpenCode close.
111
+ spawnWitness(["worker-kick"])
108
112
  }, QUIET_PERIOD_MS)
109
113
  quietTimer.unref?.()
110
114
  }
@@ -140,7 +144,7 @@ const plugin = async () => {
140
144
  }
141
145
 
142
146
  function syncOpenCode(sessions = []) {
143
- const args = ["import", "--agent", "opencode", "--quiet"]
147
+ const args = ["import", "--agent", "opencode", "--quiet", "--no-kick"]
144
148
  for (const sessionID of sessions) args.push("--session", sessionID)
145
149
  const proc = spawnWitness(args)
146
150
  if (!proc) return
@@ -269,8 +273,8 @@ const plugin = async () => {
269
273
  await waitForExit(download?.child)
270
274
  download = null
271
275
  // Only stop automatically-started workers. A user may have explicitly run
272
- // `witness distill start`; closing OpenCode must not kill that manual job.
273
- const proc = spawnWitness(["distill", "stop", "--auto-only"])
276
+ // `witness worker run --detach`; closing OpenCode must not kill that manual job.
277
+ const proc = spawnWitness(["worker", "stop", "--auto-only"])
274
278
  await proc?.exited?.catch?.(() => {})
275
279
  })()
276
280
  return disposePromise