opencode-fractal-memory 0.6.9 → 0.6.11
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 +34 -33
- package/dist/management-server.js +4 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -409,7 +409,7 @@ Opens at [http://localhost:8787](http://localhost:8787). The server starts as a
|
|
|
409
409
|
|
|
410
410
|
When OpenCode loads the plugin, `initStorage()` runs automatically:
|
|
411
411
|
|
|
412
|
-
1. **SQLite database** — created at
|
|
412
|
+
1. **SQLite database** — created at `~/.config/opencode/memory.db` with all tables and indexes. Project-scope nodes are stored alongside global nodes with a `project_name` discriminator column
|
|
413
413
|
2. **Seed nodes** — rule nodes, built-in playbooks (6), and skills (9) inserted into `memory_nodes`
|
|
414
414
|
3. **Model files** — `ensureModels()` checks `~/.config/opencode/models/` and downloads ONNX + tokenizer (~24 MB) if missing
|
|
415
415
|
4. **Agent files** — `ensureAgentFiles()` copies `agent/` directory to `~/.config/opencode/agent/`
|
|
@@ -464,43 +464,44 @@ Use `--ignore-scripts` to avoid trust prompts. Models download automatically on
|
|
|
464
464
|
## Architecture
|
|
465
465
|
|
|
466
466
|
```
|
|
467
|
-
|
|
468
|
-
│ Plugin Layer (plugin/index.ts)
|
|
469
|
-
│
|
|
470
|
-
│ │ Memory │ Skills │ Journal │ Auto-
|
|
471
|
-
│ │ Store │ (nodes) │ Store │ Retrieve
|
|
472
|
-
│
|
|
473
|
-
│ │ │ │ │
|
|
474
|
-
│
|
|
475
|
-
│ │ SQLite (
|
|
476
|
-
│ │ - memory_nodes (labels, content, embeds)
|
|
477
|
-
│ │ -
|
|
478
|
-
│ │ -
|
|
479
|
-
│ │ -
|
|
480
|
-
│ │
|
|
481
|
-
│ │
|
|
482
|
-
│ │ -
|
|
483
|
-
│
|
|
484
|
-
│
|
|
485
|
-
│
|
|
486
|
-
│
|
|
487
|
-
│
|
|
488
|
-
│
|
|
489
|
-
│
|
|
490
|
-
│
|
|
491
|
-
│
|
|
492
|
-
│
|
|
493
|
-
|
|
467
|
+
┌──────────────────────────────────────────────────────┐
|
|
468
|
+
│ Plugin Layer (plugin/index.ts) │
|
|
469
|
+
│ ┌──────────┬──────────┬──────────┬───────────────┐ │
|
|
470
|
+
│ │ Memory │ Skills │ Journal │ Auto- │ │
|
|
471
|
+
│ │ Store │ (nodes) │ Store │ Retrieve │ │
|
|
472
|
+
│ └────┬─────┴────┬─────┴────┬─────┴───────┬───────┘ │
|
|
473
|
+
│ │ │ │ │ │
|
|
474
|
+
│ ┌────┴──────────┴──────────┴─────────────┴───────┐ │
|
|
475
|
+
│ │ SQLite (~/.config/opencode/memory.db) │ │
|
|
476
|
+
│ │ - memory_nodes (labels, content, embeds) │ │
|
|
477
|
+
│ │ - scope: "global" | "project" │ │
|
|
478
|
+
│ │ - project_name (for project-scope nodes) │ │
|
|
479
|
+
│ │ - type: "note" / "skill" / "playbook" │ │
|
|
480
|
+
│ │ - sticky playbooks/skills never pruned │ │
|
|
481
|
+
│ │ - metadata.steps for playbook steps │ │
|
|
482
|
+
│ │ - memory_links (wiki-link crossrefs) │ │
|
|
483
|
+
│ │ - bm25_index (full-text search) │ │
|
|
484
|
+
│ │ - injection_metrics / session_metrics │ │
|
|
485
|
+
│ └─────────────────────────────────────────────────┘ │
|
|
486
|
+
│ │
|
|
487
|
+
│ ┌─────────────────────────────────────────────────┐ │
|
|
488
|
+
│ │ HNSW Vector Index (in-memory, 384-dim) │ │
|
|
489
|
+
│ └─────────────────────────────────────────────────┘ │
|
|
490
|
+
│ │
|
|
491
|
+
│ ┌─────────────────────────────────────────────────┐ │
|
|
492
|
+
│ │ ONNX Embedding Model (all-MiniLM-L6-v2) │ │
|
|
493
|
+
│ │ onnxruntime-web + @huggingface/tokenizers │ │
|
|
494
|
+
│ └─────────────────────────────────────────────────┘ │
|
|
495
|
+
└──────────────────────────────────────────────────────┘
|
|
494
496
|
```
|
|
495
497
|
|
|
496
498
|
## Storage
|
|
497
499
|
|
|
498
|
-
|
|
500
|
+
Unified SQLite database with `project_name` discriminator:
|
|
499
501
|
|
|
500
|
-
|
|
|
501
|
-
|
|
502
|
-
|
|
|
503
|
-
| Project | `<project>/.opencode/memory.db` | Project-specific memory, nodes, playbooks, journal |
|
|
502
|
+
| Path | Purpose |
|
|
503
|
+
|---|---|
|
|
504
|
+
| `~/.config/opencode/memory.db` | Global rules, persona, preferences (scope=global) + project-specific memory, nodes, playbooks (scope=project, discriminated by `project_name`) |
|
|
504
505
|
|
|
505
506
|
## License
|
|
506
507
|
|
|
@@ -15,6 +15,7 @@ export function startManagementServer(_store, directory, config) {
|
|
|
15
15
|
MGMT_PROJECT_DIR: directory,
|
|
16
16
|
},
|
|
17
17
|
stdio: ["ignore", "pipe", "pipe"],
|
|
18
|
+
deathSignal: "SIGKILL",
|
|
18
19
|
});
|
|
19
20
|
activeProcess = proc;
|
|
20
21
|
proc.exited.then((code) => {
|
|
@@ -45,3 +46,6 @@ export function stopManagementServer() {
|
|
|
45
46
|
activeProcess = null;
|
|
46
47
|
}
|
|
47
48
|
}
|
|
49
|
+
process.on("exit", stopManagementServer);
|
|
50
|
+
process.on("SIGINT", stopManagementServer);
|
|
51
|
+
process.on("SIGTERM", stopManagementServer);
|