toon-memory 1.0.7 โ†’ 1.0.9

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 luiggival
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,217 @@
1
+ # toon-memory
2
+
3
+ Persistent memory for AI coding agents โ€” remember decisions, patterns, and bugs between sessions.
4
+
5
+ ๐ŸŽ‰ **1.0 Released!**
6
+
7
+ Supercharge **OpenCode, VS Code Copilot, Claude Code, Cursor, Windsurf, Cline, Continue** and more with Persistent Memory
8
+
9
+ Saves context in **TOON format** (40% fewer tokens than JSON) ยท 5 MCP tools ยท Works everywhere
10
+
11
+ [![npm version](https://img.shields.io/npm/v/toon-memory.svg)](https://www.npmjs.com/package/toon-memory)
12
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
13
+
14
+ ---
15
+
16
+ ## What is toon-memory?
17
+
18
+ AI agents forget everything between sessions. toon-memory fixes this by providing persistent memory that survives restarts.
19
+
20
+ **Use cases:**
21
+ - Remember design decisions ("Why did we choose X over Y?")
22
+ - Track patterns ("This project uses Zod for validation")
23
+ - Store bug resolutions ("Redis pool exhaustion fix")
24
+ - Save project knowledge ("Broker uses RESP protocol")
25
+
26
+ ---
27
+
28
+ ## Get Started
29
+
30
+ ### 1. Install (one command)
31
+
32
+ ```bash
33
+ # macOS / Linux
34
+ curl -fsSL https://raw.githubusercontent.com/luiggival/toon-memory/main/install.sh | sh
35
+
36
+ # Windows (PowerShell)
37
+ irm https://raw.githubusercontent.com/luiggival/toon-memory/main/install.ps1 | iex
38
+
39
+ # Or with npm (any platform)
40
+ npm i -g toon-memory
41
+ ```
42
+
43
+ ### 2. Configure your agent(s)
44
+
45
+ ```bash
46
+ # Interactive installer โ€” detects agents and configures MCP
47
+ npx toon-memory
48
+ ```
49
+
50
+ ### 3. Use it
51
+
52
+ ```bash
53
+ # In your next session, run:
54
+ memory_stats # See what's in memory
55
+ memory_recall # Search memory before reading files
56
+ memory_remember # Save important decisions
57
+ ```
58
+
59
+ ---
60
+
61
+ ## Supported Agents
62
+
63
+ | Agent | Config Location | Status |
64
+ |-------|-----------------|--------|
65
+ | **OpenCode** | `.opencode/opencode.json` | โœ… Full support |
66
+ | **VS Code / Copilot** | `.vscode/mcp.json` | โœ… Full support |
67
+ | **Claude Code** | `.claude/settings.json` | โœ… Full support |
68
+ | **Cursor** | `.cursor/mcp.json` | โœ… Full support |
69
+ | **Windsurf** | `.windsurfrules` | โœ… Full support |
70
+ | **Cline** | `.cline/mcp.json` | โœ… Full support |
71
+ | **Continue** | `.continue/config.json` | โœ… Full support |
72
+ | **Aider** | `.aider.conf.yml` | โš ๏ธ Manual config |
73
+
74
+ ---
75
+
76
+ ## Tools
77
+
78
+ | Tool | Description |
79
+ |------|-------------|
80
+ | `memory_remember` | Save a decision, pattern, bug, or knowledge |
81
+ | `memory_recall` | Search memory (use BEFORE reading files) |
82
+ | `memory_forget` | Remove an entry by key or id |
83
+ | `memory_stats` | View memory state |
84
+ | `memory_summary` | Save/retrieve file summaries |
85
+
86
+ ---
87
+
88
+ ## How It Works
89
+
90
+ 1. **MCP Server** โ€” runs locally, talks to your agent via stdio
91
+ 2. **TOON Format** โ€” stores data in Token-Oriented Object Notation (~40% fewer tokens than JSON)
92
+ 3. **Per-project memory** โ€” each project gets `.opencode/memory/data.toon`
93
+ 4. **Zero config** โ€” just install and use
94
+
95
+ ### Memory File Format
96
+
97
+ ```
98
+ version: 1
99
+ entries[3|]{id|category|key|content|file|tags|date}:
100
+ a1b2c3d4|decision|use-zod|Use Zod for validation|src/types.ts|validation;types|2026-07-10
101
+ e5f6g7h8|pattern|pydantic-configs|Project uses Pydantic v2|config.py|python;patterns|2026-07-10
102
+ i9j0k1l2|bug|redis-pool-fix|Added max_connections=20|redis.ts|redis;fix|2026-07-10
103
+ summaries:
104
+ src/services/redis.ts: Redis connection pool with retry logic
105
+ ```
106
+
107
+ ---
108
+
109
+ ## CLI Commands
110
+
111
+ ```bash
112
+ npx toon-memory # Interactive installer
113
+ npx toon-memory mcp # Run MCP server directly
114
+ npx toon-memory uninstall # Remove from all agents
115
+ ```
116
+
117
+ ---
118
+
119
+ ## Uninstall
120
+
121
+ ```bash
122
+ # Remove from all agents and uninstall CLI
123
+ npx toon-memory uninstall
124
+
125
+ # Or with the global install
126
+ toon-memory uninstall
127
+ ```
128
+
129
+ ---
130
+
131
+ ## Configuration
132
+
133
+ ### Global (all projects)
134
+
135
+ Add to `~/.config/opencode/opencode.json`:
136
+
137
+ ```json
138
+ {
139
+ "mcp": {
140
+ "toon-memory": {
141
+ "type": "local",
142
+ "command": ["npx", "-y", "toon-memory", "mcp"],
143
+ "enabled": true
144
+ }
145
+ }
146
+ }
147
+ ```
148
+
149
+ ### Project-level
150
+
151
+ Add to `.opencode/opencode.json`:
152
+
153
+ ```json
154
+ {
155
+ "mcp": {
156
+ "toon-memory": {
157
+ "type": "local",
158
+ "command": ["npx", "-y", "toon-memory", "mcp"],
159
+ "enabled": true
160
+ }
161
+ }
162
+ }
163
+ ```
164
+
165
+ ### VS Code
166
+
167
+ Add to `.vscode/mcp.json`:
168
+
169
+ ```json
170
+ {
171
+ "servers": {
172
+ "toon-memory": {
173
+ "command": "npx",
174
+ "args": ["-y", "toon-memory", "mcp"]
175
+ }
176
+ }
177
+ }
178
+ ```
179
+
180
+ ---
181
+
182
+ ## Why TOON?
183
+
184
+ TOON (Token-Oriented Object Notation) is designed for LLMs:
185
+
186
+ | Format | Token Count | LLM Accuracy |
187
+ |--------|-------------|--------------|
188
+ | JSON | 100 | 75% |
189
+ | YAML | 95 | 72% |
190
+ | **TOON** | **60** | **76.4%** |
191
+
192
+ - **40% fewer tokens** than JSON
193
+ - **Lossless roundtrip** โ€” no data loss
194
+ - **Better LLM comprehension** โ€” structured for AI consumption
195
+
196
+ ---
197
+
198
+ ## Development
199
+
200
+ ```bash
201
+ git clone https://github.com/luiggival/toon-memory.git
202
+ cd toon-memory
203
+ npm install
204
+ npm run build
205
+ ```
206
+
207
+ ---
208
+
209
+ ## License
210
+
211
+ MIT
212
+
213
+ ---
214
+
215
+ ## Credits
216
+
217
+ Built with [@toon-format/toon](https://www.npmjs.com/package/@toon-format/toon) and [@modelcontextprotocol/server](https://www.npmjs.com/package/@modelcontextprotocol/server).
package/bin/setup.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { existsSync, mkdirSync, readFileSync, writeFileSync, cpSync } from "fs"
2
+ import { existsSync, mkdirSync, readFileSync, writeFileSync, cpSync, unlinkSync, rmdirSync } from "fs"
3
3
  import { dirname, join } from "path"
4
4
  import { fileURLToPath } from "url"
5
5
  import { execSync } from "child_process"
@@ -9,6 +9,7 @@ import { createRequire } from "module"
9
9
  const __dirname = dirname(fileURLToPath(import.meta.url))
10
10
  const projectRoot = process.cwd()
11
11
  const sourceDir = join(__dirname, "..", "src")
12
+ const HOME = process.env.HOME || "~"
12
13
 
13
14
  // Auto-install @toon-format/toon if not present
14
15
  try {
@@ -18,29 +19,69 @@ try {
18
19
  execSync("npm install @toon-format/toon", { cwd: projectRoot, stdio: "inherit" })
19
20
  }
20
21
 
21
- // Detect agents
22
+ // Detect all supported agents
22
23
  function detectAgents() {
23
24
  const agents = []
24
25
 
25
26
  // OpenCode
26
- const opencodeGlobal = join(process.env.HOME || "~", ".config", "opencode", "opencode.json")
27
+ const opencodeGlobal = join(HOME, ".config", "opencode", "opencode.json")
27
28
  const opencodeLocal = join(projectRoot, ".opencode", "opencode.json")
28
- if (existsSync(opencodeGlobal) || existsSync(opencodeLocal)) {
29
- agents.push({ name: "opencode", global: opencodeGlobal, local: opencodeLocal })
30
- }
29
+ agents.push({
30
+ name: "opencode",
31
+ global: opencodeGlobal,
32
+ local: opencodeLocal,
33
+ mcpKey: "mcp"
34
+ })
35
+
36
+ // VS Code / GitHub Copilot
37
+ const vscodeLocal = join(projectRoot, ".vscode", "mcp.json")
38
+ agents.push({
39
+ name: "vscode/copilot",
40
+ local: vscodeLocal,
41
+ mcpKey: "servers"
42
+ })
31
43
 
32
44
  // Claude Code
33
- const claudeGlobal = join(process.env.HOME || "~", ".claude", "settings.json")
45
+ const claudeGlobal = join(HOME, ".claude", "settings.json")
34
46
  const claudeLocal = join(projectRoot, ".claude", "settings.json")
35
- if (existsSync(claudeGlobal) || existsSync(claudeLocal)) {
36
- agents.push({ name: "claude", global: claudeGlobal, local: claudeLocal })
37
- }
47
+ agents.push({
48
+ name: "claude",
49
+ global: claudeGlobal,
50
+ local: claudeLocal,
51
+ mcpKey: "mcpServers"
52
+ })
38
53
 
39
54
  // Cursor
40
55
  const cursorLocal = join(projectRoot, ".cursor", "mcp.json")
41
- if (existsSync(cursorLocal)) {
42
- agents.push({ name: "cursor", local: cursorLocal })
43
- }
56
+ agents.push({
57
+ name: "cursor",
58
+ local: cursorLocal,
59
+ mcpKey: "mcpServers"
60
+ })
61
+
62
+ // Windsurf
63
+ const windsurfGlobal = join(HOME, ".codeium", "windsurf", "mcp_config.json")
64
+ agents.push({
65
+ name: "windsurf",
66
+ global: windsurfGlobal,
67
+ mcpKey: "mcpServers"
68
+ })
69
+
70
+ // Cline
71
+ const clineLocal = join(projectRoot, ".cline", "mcp.json")
72
+ agents.push({
73
+ name: "cline",
74
+ local: clineLocal,
75
+ mcpKey: "mcpServers"
76
+ })
77
+
78
+ // Continue
79
+ const continueLocal = join(projectRoot, ".continue", "config.json")
80
+ agents.push({
81
+ name: "continue",
82
+ local: continueLocal,
83
+ mcpKey: "mcpServers"
84
+ })
44
85
 
45
86
  return agents
46
87
  }
@@ -63,43 +104,86 @@ function installOpenCodeTools() {
63
104
  }
64
105
  }
65
106
 
66
- // Install MCP server config for OpenCode
67
- function installOpenCodeMCP(scope) {
68
- const configPath = scope === "global"
69
- ? join(process.env.HOME || "~", ".config", "opencode", "opencode.json")
70
- : join(projectRoot, ".opencode", "opencode.json")
107
+ // Install MCP server config for different agents
108
+ function installMCPConfig(agent, scope) {
109
+ const configPath = scope === "global" ? agent.global : agent.local
110
+
111
+ if (!configPath) {
112
+ console.log(` No ${scope} config path for ${agent.name}`)
113
+ return
114
+ }
71
115
 
72
116
  const configDir = dirname(configPath)
73
117
  if (!existsSync(configDir)) mkdirSync(configDir, { recursive: true })
74
118
 
75
119
  let config = {}
76
120
  if (existsSync(configPath)) {
77
- config = JSON.parse(readFileSync(configPath, "utf-8"))
121
+ try {
122
+ config = JSON.parse(readFileSync(configPath, "utf-8"))
123
+ } catch {
124
+ config = {}
125
+ }
78
126
  }
79
127
 
80
- if (!config.mcp) config.mcp = {}
81
- config.mcp["toon-memory"] = {
82
- type: "local",
83
- command: ["npx", "-y", "toon-memory", "mcp"],
84
- enabled: true
128
+ const mcpKey = agent.mcpKey || "mcpServers"
129
+ if (!config[mcpKey]) config[mcpKey] = {}
130
+
131
+ config[mcpKey]["toon-memory"] = {
132
+ command: "npx",
133
+ args: ["-y", "toon-memory", "mcp"]
85
134
  }
86
135
 
87
136
  writeFileSync(configPath, JSON.stringify(config, null, 2))
88
137
  console.log(` MCP server added to ${configPath}`)
89
138
  }
90
139
 
140
+ // Uninstall from all agents
141
+ function uninstall() {
142
+ console.log("\n๐Ÿง  toon-memory uninstaller\n")
143
+
144
+ const agents = detectAgents()
145
+
146
+ for (const agent of agents) {
147
+ const configs = [agent.global, agent.local].filter(Boolean)
148
+
149
+ for (const configPath of configs) {
150
+ if (!existsSync(configPath)) continue
151
+
152
+ try {
153
+ const config = JSON.parse(readFileSync(configPath, "utf-8"))
154
+ const mcpKey = agent.mcpKey || "mcpServers"
155
+
156
+ if (config[mcpKey]?.["toon-memory"]) {
157
+ delete config[mcpKey]["toon-memory"]
158
+ writeFileSync(configPath, JSON.stringify(config, null, 2))
159
+ console.log(` โœ… Removed from ${agent.name} (${configPath})`)
160
+ }
161
+ } catch {}
162
+ }
163
+ }
164
+
165
+ // Remove custom tools
166
+ const toolsFile = join(projectRoot, ".opencode", "tools", "memory.ts")
167
+ if (existsSync(toolsFile)) {
168
+ unlinkSync(toolsFile)
169
+ console.log(" โœ… Removed .opencode/tools/memory.ts")
170
+ }
171
+
172
+ console.log("\nโœ… toon-memory uninstalled from all agents\n")
173
+ }
174
+
91
175
  // Main
92
- const agents = detectAgents()
93
- console.log("\n๐Ÿง  toon-memory installer\n")
176
+ const args = process.argv.slice(2)
94
177
 
95
- if (agents.length === 0) {
96
- console.log("No supported agents detected. Installing custom tools...")
97
- installOpenCodeTools()
98
- console.log("\nDone! Restart your agent to use memory tools.")
178
+ if (args[0] === "uninstall") {
179
+ uninstall()
99
180
  process.exit(0)
100
181
  }
101
182
 
102
- console.log("Detected agents:")
183
+ const agents = detectAgents()
184
+ console.log("\n๐Ÿง  toon-memory installer\n")
185
+
186
+ console.log("Supported agents:")
103
187
  agents.forEach((a, i) => console.log(` ${i + 1}. ${a.name}`))
104
188
  console.log("")
105
189
 
@@ -109,13 +193,17 @@ rl.question("Install (1) Local or (2) Global? [1/2]: ", (answer) => {
109
193
  console.log(`\nInstalling ${scope}ly...\n`)
110
194
 
111
195
  for (const agent of agents) {
196
+ console.log(`${agent.name}:`)
197
+
112
198
  if (agent.name === "opencode") {
113
- console.log("OpenCode:")
114
199
  installOpenCodeTools()
115
- installOpenCodeMCP(scope)
116
200
  }
201
+
202
+ installMCPConfig(agent, scope)
203
+ console.log("")
117
204
  }
118
205
 
119
- console.log("\nDone! Restart your agent to use memory tools.")
206
+ console.log("Done! Restart your agent to use memory tools.")
207
+ console.log("Run 'npx toon-memory uninstall' to remove.\n")
120
208
  rl.close()
121
209
  })
package/install.sh ADDED
@@ -0,0 +1,75 @@
1
+ #!/bin/bash
2
+ set -e
3
+
4
+ # toon-memory installer for macOS/Linux
5
+ # Usage: curl -fsSL https://raw.githubusercontent.com/luiggival/toon-memory/main/install.sh | sh
6
+
7
+ TOON_VERSION="1.0.8"
8
+ NPM_REGISTRY="https://registry.npmjs.org"
9
+
10
+ echo "๐Ÿง  toon-memory installer"
11
+ echo ""
12
+
13
+ # Check if npm is available
14
+ if command -v npm &> /dev/null; then
15
+ echo "Installing toon-memory via npm..."
16
+ npm install -g toon-memory@${TOON_VERSION}
17
+ echo ""
18
+ echo "โœ… toon-memory installed!"
19
+ echo ""
20
+ echo "Next steps:"
21
+ echo " 1. Run: npx toon-memory"
22
+ echo " 2. Select your agent(s)"
23
+ echo " 3. Choose local or global install"
24
+ echo ""
25
+ else
26
+ echo "npm not found. Installing standalone..."
27
+ echo ""
28
+
29
+ # Create installation directory
30
+ INSTALL_DIR="${HOME}/.toon-memory"
31
+ mkdir -p "${INSTALL_DIR}"
32
+
33
+ # Download the package
34
+ echo "Downloading toon-memory v${TOON_VERSION}..."
35
+ curl -fsSL "https://registry.npmjs.org/toon-memory/-/toon-memory-${TOON_VERSION}.tgz" -o "${INSTALL_DIR}/toon-memory.tgz"
36
+
37
+ # Extract
38
+ cd "${INSTALL_DIR}"
39
+ tar xzf toon-memory.tgz
40
+ mv package/* .
41
+ rmdir package
42
+ rm toon-memory.tgz
43
+
44
+ # Create launcher script
45
+ cat > "${INSTALL_DIR}/toon-memory" << 'LAUNCHER'
46
+ #!/bin/bash
47
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
48
+ node "${SCRIPT_DIR}/bin/toon-memory.js" "$@"
49
+ LAUNCHER
50
+ chmod +x "${INSTALL_DIR}/toon-memory"
51
+
52
+ # Add to PATH if not already there
53
+ SHELL_RC=""
54
+ if [ -f "${HOME}/.bashrc" ]; then
55
+ SHELL_RC="${HOME}/.bashrc"
56
+ elif [ -f "${HOME}/.zshrc" ]; then
57
+ SHELL_RC="${HOME}/.zshrc"
58
+ fi
59
+
60
+ if [ -n "${SHELL_RC}" ]; then
61
+ if ! grep -q "${INSTALL_DIR}" "${SHELL_RC}" 2>/dev/null; then
62
+ echo "" >> "${SHELL_RC}"
63
+ echo "# toon-memory" >> "${SHELL_RC}"
64
+ echo "export PATH=\"${INSTALL_DIR}:\$PATH\"" >> "${SHELL_RC}"
65
+ echo "Added to PATH in ${SHELL_RC}"
66
+ fi
67
+ fi
68
+
69
+ echo ""
70
+ echo "โœ… toon-memory installed to ${INSTALL_DIR}"
71
+ echo ""
72
+ echo "โš ๏ธ Open a new terminal, then run:"
73
+ echo " toon-memory"
74
+ echo ""
75
+ fi
package/mcp/server.js CHANGED
@@ -623,7 +623,7 @@ function $constructor(name, initializer3, params) {
623
623
  Object.defineProperty(_, "name", { value: name });
624
624
  return _;
625
625
  }
626
- var $brand = /* @__PURE__ */ Symbol("zod_brand");
626
+ var $brand = Symbol("zod_brand");
627
627
  var $ZodAsyncError = class extends Error {
628
628
  constructor() {
629
629
  super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`);
@@ -10366,8 +10366,8 @@ function yo_default() {
10366
10366
 
10367
10367
  // node_modules/zod/v4/core/registries.js
10368
10368
  var _a2;
10369
- var $output = /* @__PURE__ */ Symbol("ZodOutput");
10370
- var $input = /* @__PURE__ */ Symbol("ZodInput");
10369
+ var $output = Symbol("ZodOutput");
10370
+ var $input = Symbol("ZodInput");
10371
10371
  var $ZodRegistry = class {
10372
10372
  constructor() {
10373
10373
  this._map = /* @__PURE__ */ new WeakMap();
@@ -21148,14 +21148,14 @@ var Ajv = import_ajv.Ajv;
21148
21148
  import process3 from "node:process";
21149
21149
 
21150
21150
  // node_modules/@modelcontextprotocol/server/dist/mcp-CM8J1mhp.mjs
21151
- var COMPLETABLE_SYMBOL = /* @__PURE__ */ Symbol.for("mcp.completable");
21151
+ var COMPLETABLE_SYMBOL = Symbol.for("mcp.completable");
21152
21152
  function isCompletable(schema) {
21153
21153
  return !!schema && typeof schema === "object" && COMPLETABLE_SYMBOL in schema;
21154
21154
  }
21155
21155
  function getCompleter(schema) {
21156
21156
  return schema[COMPLETABLE_SYMBOL]?.complete;
21157
21157
  }
21158
- var BRANDS = /* @__PURE__ */ Symbol.for("mcp.sdk.errorBrands");
21158
+ var BRANDS = Symbol.for("mcp.sdk.errorBrands");
21159
21159
  function stampErrorBrands(instance, ctor) {
21160
21160
  const brands = /* @__PURE__ */ new Set();
21161
21161
  let current = ctor;
@@ -22468,7 +22468,7 @@ var CACHEABLE_RESULT_METHODS = [
22468
22468
  function isCacheableResultMethod(method) {
22469
22469
  return CACHEABLE_RESULT_METHODS.includes(method);
22470
22470
  }
22471
- var RESULT_CACHE_HINT_FALLBACK = /* @__PURE__ */ Symbol("modelcontextprotocol.resultCacheHintFallback");
22471
+ var RESULT_CACHE_HINT_FALLBACK = Symbol("modelcontextprotocol.resultCacheHintFallback");
22472
22472
  function attachCacheHintFallback(result, hint) {
22473
22473
  if (hint === void 0) return result;
22474
22474
  const attached = result[RESULT_CACHE_HINT_FALLBACK];
@@ -27664,7 +27664,7 @@ function generateId() {
27664
27664
  return randomBytes(4).toString("hex");
27665
27665
  }
27666
27666
  var server = new McpServer(
27667
- { name: "toon-memory", version: "1.0.7" },
27667
+ { name: "toon-memory", version: "1.0.9" },
27668
27668
  { capabilities: { tools: { listChanged: true } } }
27669
27669
  );
27670
27670
  server.registerTool(
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "toon-memory",
3
- "version": "1.0.7",
4
- "description": "Persistent memory system for OpenCode AI agent using TOON format (40% fewer tokens than JSON)",
3
+ "version": "1.0.9",
4
+ "description": "Persistent memory system for AI coding agents using TOON format (40% fewer tokens than JSON)",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "toon-memory": "./bin/toon-memory.js"
@@ -10,15 +10,31 @@
10
10
  "src/",
11
11
  "bin/",
12
12
  "mcp/",
13
- "skills/"
13
+ "skills/",
14
+ "install.sh",
15
+ "uninstall.sh"
14
16
  ],
17
+ "scripts": {
18
+ "build": "esbuild src/mcp/server.ts --bundle --platform=node --format=esm --outfile=mcp/server.js",
19
+ "prepublishOnly": "npm run build"
20
+ },
15
21
  "dependencies": {
16
22
  "@modelcontextprotocol/server": "^2.0.0-beta.3",
17
23
  "@toon-format/toon": "^2.3.0",
18
24
  "zod": "^4.4.3"
19
25
  },
26
+ "devDependencies": {
27
+ "esbuild": "^0.25.0"
28
+ },
20
29
  "keywords": [
21
30
  "opencode",
31
+ "vscode",
32
+ "copilot",
33
+ "claude",
34
+ "cursor",
35
+ "windsurf",
36
+ "cline",
37
+ "continue",
22
38
  "ai-agent",
23
39
  "memory",
24
40
  "toon",
@@ -26,5 +42,14 @@
26
42
  "llm",
27
43
  "token-efficiency"
28
44
  ],
29
- "license": "MIT"
45
+ "author": "luiggival",
46
+ "license": "MIT",
47
+ "repository": {
48
+ "type": "git",
49
+ "url": "https://github.com/luiggival/toon-memory.git"
50
+ },
51
+ "homepage": "https://github.com/luiggival/toon-memory#readme",
52
+ "bugs": {
53
+ "url": "https://github.com/luiggival/toon-memory/issues"
54
+ }
30
55
  }
@@ -1,8 +1,21 @@
1
- # toon-memory โ€” Persistent Memory for OpenCode
1
+ # toon-memory โ€” Persistent Memory for AI Agents
2
2
 
3
3
  ## What is this?
4
4
 
5
- A persistent memory system for the OpenCode AI agent. It remembers decisions, patterns, bugs, and knowledge **between sessions** using TOON format (40% fewer tokens than JSON).
5
+ A persistent memory system for AI coding agents. It remembers decisions, patterns, bugs, and knowledge **between sessions** using TOON format (40% fewer tokens than JSON).
6
+
7
+ ## Supported Agents
8
+
9
+ | Agent | Config File | Format |
10
+ |-------|-------------|--------|
11
+ | OpenCode | `.opencode/opencode.json` | MCP server |
12
+ | VS Code / Copilot | `.vscode/mcp.json` | MCP server |
13
+ | Claude | `.claude/settings.json` | MCP server |
14
+ | Cursor | `.cursor/mcp.json` | MCP server |
15
+ | Windsurf | `.windsurfrules` | MCP server |
16
+ | Cline | `.cline/mcp.json` | MCP server |
17
+ | Continue | `.continue/config.json` | MCP server |
18
+ | Aider | `.aider.conf.yml` | Manual config |
6
19
 
7
20
  ## Tools
8
21
 
@@ -16,44 +29,27 @@ A persistent memory system for the OpenCode AI agent. It remembers decisions, pa
16
29
 
17
30
  ## Installation
18
31
 
19
- ### Option 1: Interactive installer (recommended)
32
+ ### Interactive installer (recommended)
20
33
 
21
34
  ```bash
22
35
  npx toon-memory
23
36
  ```
24
37
 
25
38
  This will:
26
- 1. Detect installed agents (OpenCode, Claude, Cursor)
39
+ 1. Detect installed agents
27
40
  2. Ask if you want local or global installation
28
41
  3. Configure the MCP server automatically
29
42
 
30
- ### Option 2: Global MCP Server
31
-
32
- Add to `~/.config/opencode/opencode.json`:
33
-
34
- ```json
35
- {
36
- "mcp": {
37
- "toon-memory": {
38
- "type": "local",
39
- "command": ["npx", "-y", "toon-memory", "mcp"],
40
- "enabled": true
41
- }
42
- }
43
- }
44
- ```
45
-
46
- ### Option 3: Project-level MCP Server
43
+ ### Manual installation
47
44
 
48
- Add to `.opencode/opencode.json`:
45
+ Add to your agent's MCP config:
49
46
 
50
47
  ```json
51
48
  {
52
- "mcp": {
49
+ "mcpServers": {
53
50
  "toon-memory": {
54
- "type": "local",
55
- "command": ["npx", "-y", "toon-memory", "mcp"],
56
- "enabled": true
51
+ "command": "npx",
52
+ "args": ["-y", "toon-memory", "mcp"]
57
53
  }
58
54
  }
59
55
  }
package/src/mcp/server.ts CHANGED
@@ -32,7 +32,7 @@ function generateId(): string {
32
32
  }
33
33
 
34
34
  const server = new McpServer(
35
- { name: "toon-memory", version: "1.0.7" },
35
+ { name: "toon-memory", version: "1.0.9" },
36
36
  { capabilities: { tools: { listChanged: true } } }
37
37
  )
38
38
 
package/uninstall.sh ADDED
@@ -0,0 +1,107 @@
1
+ #!/bin/bash
2
+ set -e
3
+
4
+ # toon-memory uninstaller
5
+ # Usage: npx toon-memory uninstall
6
+
7
+ echo "๐Ÿง  toon-memory uninstaller"
8
+ echo ""
9
+
10
+ # Remove from OpenCode
11
+ OPENCODE_GLOBAL="${HOME}/.config/opencode/opencode.json"
12
+ OPENCODE_LOCAL=".opencode/opencode.json"
13
+
14
+ remove_from_config() {
15
+ local file="$1"
16
+ local name="$2"
17
+
18
+ if [ -f "${file}" ]; then
19
+ if grep -q "toon-memory" "${file}" 2>/dev/null; then
20
+ echo "Removing from ${name} (${file})..."
21
+ # Use node to remove the MCP entry
22
+ node -e "
23
+ const fs = require('fs');
24
+ const config = JSON.parse(fs.readFileSync('${file}', 'utf-8'));
25
+ if (config.mcp && config.mcp['toon-memory']) {
26
+ delete config.mcp['toon-memory'];
27
+ fs.writeFileSync('${file}', JSON.stringify(config, null, 2));
28
+ console.log(' โœ… Removed');
29
+ } else if (config.mcpServers && config.mcpServers['toon-memory']) {
30
+ delete config.mcpServers['toon-memory'];
31
+ fs.writeFileSync('${file}', JSON.stringify(config, null, 2));
32
+ console.log(' โœ… Removed');
33
+ } else {
34
+ console.log(' โš ๏ธ Not found');
35
+ }
36
+ " 2>/dev/null || echo " โš ๏ธ Could not parse config"
37
+ fi
38
+ fi
39
+ }
40
+
41
+ # OpenCode
42
+ remove_from_config "${OPENCODE_GLOBAL}" "OpenCode (global)"
43
+ remove_from_config "${OPENCODE_LOCAL}" "OpenCode (local)"
44
+
45
+ # VS Code
46
+ remove_from_config ".vscode/mcp.json" "VS Code"
47
+
48
+ # Claude
49
+ remove_from_config "${HOME}/.claude/settings.json" "Claude (global)"
50
+ remove_from_config ".claude/settings.json" "Claude (local)"
51
+
52
+ # Cursor
53
+ remove_from_config ".cursor/mcp.json" "Cursor"
54
+
55
+ # Cline
56
+ remove_from_config ".cline/mcp.json" "Cline"
57
+
58
+ # Continue
59
+ remove_from_config ".continue/config.json" "Continue"
60
+
61
+ # Remove custom tools if they exist
62
+ if [ -d ".opencode/tools" ]; then
63
+ if [ -f ".opencode/tools/memory.ts" ]; then
64
+ echo "Removing custom tools..."
65
+ rm -f ".opencode/tools/memory.ts"
66
+ echo " โœ… Removed memory.ts"
67
+ fi
68
+ fi
69
+
70
+ # Remove memory file (ask user)
71
+ if [ -f ".opencode/memory/data.toon" ]; then
72
+ echo ""
73
+ read -p "Remove memory file (.opencode/memory/data.toon)? [y/N] " -n 1 -r
74
+ echo
75
+ if [[ $REPLY =~ ^[Yy]$ ]]; then
76
+ rm -rf ".opencode/memory"
77
+ echo " โœ… Removed memory directory"
78
+ fi
79
+ fi
80
+
81
+ # Uninstall npm package
82
+ echo ""
83
+ read -p "Uninstall toon-memory CLI? [y/N] " -n 1 -r
84
+ echo
85
+ if [[ $REPLY =~ ^[Yy]$ ]]; then
86
+ if command -v npm &> /dev/null; then
87
+ npm uninstall -g toon-memory 2>/dev/null && echo " โœ… Uninstalled from npm" || echo " โš ๏ธ Not installed via npm"
88
+ fi
89
+
90
+ # Remove standalone install
91
+ if [ -d "${HOME}/.toon-memory" ]; then
92
+ rm -rf "${HOME}/.toon-memory"
93
+ echo " โœ… Removed standalone install"
94
+ fi
95
+
96
+ # Remove from PATH in shell configs
97
+ for rc in "${HOME}/.bashrc" "${HOME}/.zshrc"; do
98
+ if [ -f "${rc}" ] && grep -q "toon-memory" "${rc}" 2>/dev/null; then
99
+ sed -i '/# toon-memory/d;/.toon-memory/d' "${rc}"
100
+ echo " โœ… Cleaned ${rc}"
101
+ fi
102
+ done
103
+ fi
104
+
105
+ echo ""
106
+ echo "โœ… toon-memory uninstalled"
107
+ echo ""