toon-memory 1.0.0 → 1.0.1

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.
Files changed (2) hide show
  1. package/bin/setup.js +9 -3
  2. package/package.json +1 -1
package/bin/setup.js CHANGED
@@ -3,6 +3,7 @@
3
3
  import { existsSync, mkdirSync, copyFileSync, readFileSync, writeFileSync } from "fs"
4
4
  import { join, dirname } from "path"
5
5
  import { fileURLToPath } from "url"
6
+ import { execSync } from "child_process"
6
7
 
7
8
  const __dirname = dirname(fileURLToPath(import.meta.url))
8
9
  const PROJECT_ROOT = process.cwd()
@@ -44,14 +45,19 @@ function main() {
44
45
  console.log(` ✅ Skill: ${SKILL_FILE}`)
45
46
  }
46
47
 
47
- // 4. Check if @toon-format/toon is installed
48
+ // 4. Install @toon-format/toon if not present
48
49
  const pkgPath = join(PROJECT_ROOT, "package.json")
49
50
  if (existsSync(pkgPath)) {
50
51
  const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"))
51
52
  const deps = { ...pkg.dependencies, ...pkg.devDependencies }
52
53
  if (!deps["@toon-format/toon"]) {
53
- console.log("\n ⚠️ @toon-format/toon not found in dependencies.")
54
- console.log(" Run: npm install @toon-format/toon")
54
+ console.log("\n 📦 Installing @toon-format/toon...")
55
+ try {
56
+ execSync("npm install @toon-format/toon", { cwd: PROJECT_ROOT, stdio: "inherit" })
57
+ console.log(" ✅ @toon-format/toon installed")
58
+ } catch {
59
+ console.log(" ⚠️ Failed to install. Run manually: npm install @toon-format/toon")
60
+ }
55
61
  }
56
62
  }
57
63
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "toon-memory",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "Persistent memory system for OpenCode AI agent using TOON format (40% fewer tokens than JSON)",
5
5
  "type": "module",
6
6
  "bin": {