Initial scaffold: open-memory plugin for OpenCode

- Plugin entry point with hooks: experimental.session.compacting,
  experimental.chat.system.transform, event
- Context tracker: SSE-based token tracking per session with
  green/yellow/red/critical thresholds
- Tools: memory_context, memory_compact, memory_summary,
  memory_sessions, memory_messages, memory_search, memory_plans
- History module: sqlite3 queries + markdown rendering
- Compaction: improved prompt emphasizing self-continuity
- Research docs: ARCHITECTURE.md + opencode-memory reference
This commit is contained in:
2026-04-20 14:55:20 +00:00
commit 9a42dcfb94
16 changed files with 1296 additions and 0 deletions

43
package.json Normal file
View File

@@ -0,0 +1,43 @@
{
"name": "@alkdev/open-memory",
"version": "0.1.0",
"description": "OpenCode plugin for session memory browsing, context awareness, and compaction management.",
"type": "module",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js"
}
},
"scripts": {
"build": "bun build src/index.ts --outdir dist --target bun --format esm && tsc --emitDeclarationOnly",
"lint": "bunx @biomejs/biome check .",
"format": "bunx @biomejs/biome format --write .",
"typecheck": "tsc --noEmit",
"test": "bun test"
},
"author": "Alkimia Development",
"license": "Apache-2.0",
"repository": {
"type": "git",
"url": "git@git.alk.dev:alkdev/open-memory.git"
},
"keywords": [
"opencode",
"plugin",
"memory",
"context",
"compaction",
"session"
],
"dependencies": {
"@opencode-ai/plugin": "^1.1.3"
},
"devDependencies": {
"@types/bun": "^1.2.0",
"@types/node": "^20.14.0",
"typescript": "^5.7.3"
}
}