@becrafter/memory-core
v0.1.0
Published
Cross-platform local memory core: Markdown canonical source + SQLite derived index
Readme
@becrafter/memory-core
Cross-platform local memory core for craft-plugins. Markdown is the canonical source; SQLite is a derived index that can be rebuilt.
Current distribution status
This package is currently workspace-only. It is included by the repository's shared/packages/* workspace and consumed by the OpenCode plugin through:
"@becrafter/memory-core": "workspace:*"It has not been published to npm, so do not document npm install or npm install -g as a supported installation path yet. Claude Code's memory skill expects the craft-memory CLI after a local workspace build or an explicitly linked local package.
Local development
From the repository root:
pnpm install
pnpm --filter @becrafter/memory-core build
pnpm --filter @becrafter/memory-core typecheck
pnpm --filter @becrafter/memory-core test
pnpm --filter @becrafter/memory-core pack:verifyThe build writes dist/index.js, declarations, and the craft-memory CLI entry at dist/bin.js. The OpenCode adapter must import from the package root; it must not import src/* deep paths.
Runtime status
The package declares better-sqlite3 and contains a Node SQLite driver implementation, but the current normal memory lifecycle falls back to Markdown-only storage/search unless a verified SQLite driver is connected by the caller. The fallback is intentional: SQLite is a derived index and must never be treated as the canonical source. Do not interpret the presence of the dependency or driver source as proof that every runtime path has SQLite/FTS/WAL enabled.
Public API
resolveMemoryPolicy / init / reconcile / verify / search / save / list / inject / getStats
The source barrel also contains APIs from later memory phases; the supported surface and release gates are still governed by the phase documentation under docs/features/memory/.
CLI
craft-memory init | status | save | search | list | verify | reconcile | injectsave reads content from --stdin or --file (never --content). --json emits a single JSON object on stdout; diagnostics go to stderr. Exit codes: 0 success, 2 args, 3 security refusal, 4 storage/index.
See docs/features/memory/v1-mvp.md for the delivery checklist and docs/features/memory/feat-memory-plugin-plan.md for the full specification. Phase 0 capability validation is not represented as complete merely because the package builds or unit tests pass.
