toon-memory 1.0.9 ā 1.1.0
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 +1 -1
- package/README.md +6 -3
- package/bin/setup.js +108 -2
- package/install.ps1 +62 -0
- package/mcp/server.js +1 -1
- package/package.json +2 -1
- package/src/mcp/server.ts +1 -1
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -31,10 +31,10 @@ AI agents forget everything between sessions. toon-memory fixes this by providin
|
|
|
31
31
|
|
|
32
32
|
```bash
|
|
33
33
|
# macOS / Linux
|
|
34
|
-
curl -fsSL https://raw.githubusercontent.com/
|
|
34
|
+
curl -fsSL https://raw.githubusercontent.com/LuiggiVal08/toon-memory/main/install.sh | sh
|
|
35
35
|
|
|
36
36
|
# Windows (PowerShell)
|
|
37
|
-
irm https://raw.githubusercontent.com/
|
|
37
|
+
irm https://raw.githubusercontent.com/LuiggiVal08/toon-memory/main/install.ps1 | iex
|
|
38
38
|
|
|
39
39
|
# Or with npm (any platform)
|
|
40
40
|
npm i -g toon-memory
|
|
@@ -110,7 +110,10 @@ summaries:
|
|
|
110
110
|
|
|
111
111
|
```bash
|
|
112
112
|
npx toon-memory # Interactive installer
|
|
113
|
+
npx toon-memory init # Quick setup (no prompts)
|
|
113
114
|
npx toon-memory mcp # Run MCP server directly
|
|
115
|
+
npx toon-memory status # Check installation status
|
|
116
|
+
npx toon-memory upgrade # Update to latest version
|
|
114
117
|
npx toon-memory uninstall # Remove from all agents
|
|
115
118
|
```
|
|
116
119
|
|
|
@@ -198,7 +201,7 @@ TOON (Token-Oriented Object Notation) is designed for LLMs:
|
|
|
198
201
|
## Development
|
|
199
202
|
|
|
200
203
|
```bash
|
|
201
|
-
git clone https://github.com/
|
|
204
|
+
git clone https://github.com/LuiggiVal08/toon-memory.git
|
|
202
205
|
cd toon-memory
|
|
203
206
|
npm install
|
|
204
207
|
npm run build
|
package/bin/setup.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { existsSync, mkdirSync, readFileSync, writeFileSync, cpSync, unlinkSync
|
|
2
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync, cpSync, unlinkSync } from "fs"
|
|
3
3
|
import { dirname, join } from "path"
|
|
4
4
|
import { fileURLToPath } from "url"
|
|
5
5
|
import { execSync } from "child_process"
|
|
@@ -9,7 +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
|
+
const HOME = process.env.HOME || process.env.USERPROFILE || "~"
|
|
13
13
|
|
|
14
14
|
// Auto-install @toon-format/toon if not present
|
|
15
15
|
try {
|
|
@@ -172,6 +172,97 @@ function uninstall() {
|
|
|
172
172
|
console.log("\nā
toon-memory uninstalled from all agents\n")
|
|
173
173
|
}
|
|
174
174
|
|
|
175
|
+
// Quick init without interactive prompts
|
|
176
|
+
function init(scope = "local") {
|
|
177
|
+
console.log("\nš§ toon-memory init\n")
|
|
178
|
+
|
|
179
|
+
const agents = detectAgents()
|
|
180
|
+
|
|
181
|
+
for (const agent of agents) {
|
|
182
|
+
console.log(`${agent.name}:`)
|
|
183
|
+
|
|
184
|
+
if (agent.name === "opencode") {
|
|
185
|
+
installOpenCodeTools()
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
installMCPConfig(agent, scope)
|
|
189
|
+
console.log("")
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
console.log("Done! Restart your agent to use memory tools.\n")
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
// Show installation status
|
|
196
|
+
function status() {
|
|
197
|
+
console.log("\nš§ toon-memory status\n")
|
|
198
|
+
|
|
199
|
+
// Check npm package
|
|
200
|
+
try {
|
|
201
|
+
const pkg = JSON.parse(readFileSync(join(__dirname, "..", "package.json"), "utf-8"))
|
|
202
|
+
console.log(`Version: ${pkg.version}`)
|
|
203
|
+
} catch {
|
|
204
|
+
console.log("Version: unknown")
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
// Check memory file
|
|
208
|
+
const memoryFile = join(projectRoot, ".opencode", "memory", "data.toon")
|
|
209
|
+
if (existsSync(memoryFile)) {
|
|
210
|
+
const data = readFileSync(memoryFile, "utf-8")
|
|
211
|
+
const lines = data.split("\n").filter((l) => l.startsWith(" ") && l.includes("|"))
|
|
212
|
+
console.log(`Memory: ${lines.length} entries`)
|
|
213
|
+
} else {
|
|
214
|
+
console.log("Memory: not initialized")
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
// Check agent configs
|
|
218
|
+
const agents = detectAgents()
|
|
219
|
+
console.log("\nAgent configs:")
|
|
220
|
+
|
|
221
|
+
for (const agent of agents) {
|
|
222
|
+
const configs = [agent.global, agent.local].filter(Boolean)
|
|
223
|
+
let found = false
|
|
224
|
+
|
|
225
|
+
for (const configPath of configs) {
|
|
226
|
+
if (!existsSync(configPath)) continue
|
|
227
|
+
|
|
228
|
+
try {
|
|
229
|
+
const config = JSON.parse(readFileSync(configPath, "utf-8"))
|
|
230
|
+
const mcpKey = agent.mcpKey || "mcpServers"
|
|
231
|
+
|
|
232
|
+
if (config[mcpKey]?.["toon-memory"]) {
|
|
233
|
+
console.log(` ā
${agent.name} (${configPath})`)
|
|
234
|
+
found = true
|
|
235
|
+
}
|
|
236
|
+
} catch {}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
if (!found) {
|
|
240
|
+
console.log(` ā ${agent.name} (not configured)`)
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
console.log("")
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
// Upgrade to latest version
|
|
248
|
+
function upgrade() {
|
|
249
|
+
console.log("\nš§ toon-memory upgrade\n")
|
|
250
|
+
|
|
251
|
+
try {
|
|
252
|
+
console.log("Checking for updates...")
|
|
253
|
+
const latest = execSync("npm view toon-memory version", { encoding: "utf-8" }).trim()
|
|
254
|
+
console.log(`Latest version: ${latest}`)
|
|
255
|
+
|
|
256
|
+
console.log("Upgrading...")
|
|
257
|
+
execSync("npm install -g toon-memory@" + latest, { stdio: "inherit" })
|
|
258
|
+
|
|
259
|
+
console.log("\nā
Upgraded to toon-memory@" + latest)
|
|
260
|
+
console.log("Restart your agent to use the new version.\n")
|
|
261
|
+
} catch (error) {
|
|
262
|
+
console.error("Upgrade failed:", error.message)
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
|
|
175
266
|
// Main
|
|
176
267
|
const args = process.argv.slice(2)
|
|
177
268
|
|
|
@@ -180,6 +271,21 @@ if (args[0] === "uninstall") {
|
|
|
180
271
|
process.exit(0)
|
|
181
272
|
}
|
|
182
273
|
|
|
274
|
+
if (args[0] === "init") {
|
|
275
|
+
init(args[1] || "local")
|
|
276
|
+
process.exit(0)
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
if (args[0] === "status") {
|
|
280
|
+
status()
|
|
281
|
+
process.exit(0)
|
|
282
|
+
}
|
|
283
|
+
|
|
284
|
+
if (args[0] === "upgrade") {
|
|
285
|
+
upgrade()
|
|
286
|
+
process.exit(0)
|
|
287
|
+
}
|
|
288
|
+
|
|
183
289
|
const agents = detectAgents()
|
|
184
290
|
console.log("\nš§ toon-memory installer\n")
|
|
185
291
|
|
package/install.ps1
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# toon-memory installer for Windows (PowerShell)
|
|
2
|
+
# Usage: irm https://raw.githubusercontent.com/LuiggiVal08/toon-memory/main/install.ps1 | iex
|
|
3
|
+
|
|
4
|
+
$TOON_VERSION = "1.0.9"
|
|
5
|
+
|
|
6
|
+
Write-Host "š§ toon-memory installer" -ForegroundColor Cyan
|
|
7
|
+
Write-Host ""
|
|
8
|
+
|
|
9
|
+
# Check if npm is available
|
|
10
|
+
if (Get-Command npm -ErrorAction SilentlyContinue) {
|
|
11
|
+
Write-Host "Installing toon-memory via npm..."
|
|
12
|
+
npm install -g toon-memory@$TOON_VERSION
|
|
13
|
+
Write-Host ""
|
|
14
|
+
Write-Host "ā
toon-memory installed!" -ForegroundColor Green
|
|
15
|
+
Write-Host ""
|
|
16
|
+
Write-Host "Next steps:"
|
|
17
|
+
Write-Host " 1. Run: npx toon-memory"
|
|
18
|
+
Write-Host " 2. Select your agent(s)"
|
|
19
|
+
Write-Host " 3. Choose local or global install"
|
|
20
|
+
Write-Host ""
|
|
21
|
+
} else {
|
|
22
|
+
Write-Host "npm not found. Installing standalone..." -ForegroundColor Yellow
|
|
23
|
+
Write-Host ""
|
|
24
|
+
|
|
25
|
+
# Create installation directory
|
|
26
|
+
$INSTALL_DIR = "$env:USERPROFILE\.toon-memory"
|
|
27
|
+
New-Item -ItemType Directory -Force -Path $INSTALL_DIR | Out-Null
|
|
28
|
+
|
|
29
|
+
# Download the package
|
|
30
|
+
Write-Host "Downloading toon-memory v$TOON_VERSION..."
|
|
31
|
+
$url = "https://registry.npmjs.org/toon-memory/-/toon-memory-$TOON_VERSION.tgz"
|
|
32
|
+
$tgzPath = "$INSTALL_DIR\toon-memory.tgz"
|
|
33
|
+
Invoke-WebRequest -Uri $url -OutFile $tgzPath
|
|
34
|
+
|
|
35
|
+
# Extract
|
|
36
|
+
cd $INSTALL_DIR
|
|
37
|
+
tar xzf toon-memory.tgz
|
|
38
|
+
Move-Item -Path "package\*" -Destination "." -Force
|
|
39
|
+
Remove-Item -Path "package" -Recurse -Force
|
|
40
|
+
Remove-Item -Path $tgzPath -Force
|
|
41
|
+
|
|
42
|
+
# Create launcher script
|
|
43
|
+
$launcherContent = @"
|
|
44
|
+
`$SCRIPT_DIR = Split-Path -Parent `$MyInvocation.MyCommand.Path
|
|
45
|
+
node "`$SCRIPT_DIR\bin\toon-memory.js" @args
|
|
46
|
+
"@
|
|
47
|
+
Set-Content -Path "$INSTALL_DIR\toon-memory.ps1" -Value $launcherContent
|
|
48
|
+
|
|
49
|
+
# Add to PATH if not already there
|
|
50
|
+
$currentPath = [Environment]::GetEnvironmentVariable("Path", "User")
|
|
51
|
+
if ($currentPath -notlike "*$INSTALL_DIR*") {
|
|
52
|
+
[Environment]::SetEnvironmentVariable("Path", "$INSTALL_DIR;$currentPath", "User")
|
|
53
|
+
Write-Host "Added to PATH"
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
Write-Host ""
|
|
57
|
+
Write-Host "ā
toon-memory installed to $INSTALL_DIR" -ForegroundColor Green
|
|
58
|
+
Write-Host ""
|
|
59
|
+
Write-Host "ā ļø Open a new PowerShell window, then run:"
|
|
60
|
+
Write-Host " toon-memory.ps1"
|
|
61
|
+
Write-Host ""
|
|
62
|
+
}
|
package/mcp/server.js
CHANGED
|
@@ -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
|
|
27667
|
+
{ name: "toon-memory", version: "1.1.0" },
|
|
27668
27668
|
{ capabilities: { tools: { listChanged: true } } }
|
|
27669
27669
|
);
|
|
27670
27670
|
server.registerTool(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "toon-memory",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "Persistent memory system for AI coding agents using TOON format (40% fewer tokens than JSON)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
"mcp/",
|
|
13
13
|
"skills/",
|
|
14
14
|
"install.sh",
|
|
15
|
+
"install.ps1",
|
|
15
16
|
"uninstall.sh"
|
|
16
17
|
],
|
|
17
18
|
"scripts": {
|
package/src/mcp/server.ts
CHANGED