squish-memory 0.8.2 → 0.9.2
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/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +2 -2
- package/.env.mcp +30 -0
- package/.mcp.json +2 -5
- package/CHANGELOG.md +111 -0
- package/QUICK-START.md +65 -0
- package/README.md +188 -530
- package/commands/managed-sync.ts +69 -0
- package/commands/mcp-server.ts +519 -0
- package/config/mcp-cli-fallback-policy.json +22 -0
- package/config/mcp-migration-map.json +22 -0
- package/config/mcp-mode-semantics.json +21 -0
- package/config/mcp-remote-auth.json +36 -0
- package/config/mcp-universal.schema.json +48 -0
- package/config/mcp.json +38 -0
- package/config/remote-memory-policy.json +32 -0
- package/dist/algorithms/merge/detection/hash-filters.js +2 -2
- package/dist/algorithms/merge/detection/hash-filters.js.map +1 -1
- package/dist/algorithms/merge/detection/two-stage-detector.d.ts +5 -2
- package/dist/algorithms/merge/detection/two-stage-detector.d.ts.map +1 -1
- package/dist/algorithms/merge/detection/two-stage-detector.js +139 -22
- package/dist/algorithms/merge/detection/two-stage-detector.js.map +1 -1
- package/dist/api/web/index.d.ts +3 -0
- package/dist/api/web/index.d.ts.map +1 -0
- package/dist/api/web/index.js +4 -0
- package/dist/api/web/index.js.map +1 -0
- package/dist/api/web/web-server.d.ts +3 -0
- package/dist/api/web/web-server.d.ts.map +1 -0
- package/dist/api/web/web-server.js +6 -0
- package/dist/api/web/web-server.js.map +1 -0
- package/dist/api/web/web.d.ts.map +1 -1
- package/dist/api/web/web.js +227 -78
- package/dist/api/web/web.js.map +1 -1
- package/dist/commands/managed-sync.d.ts +10 -0
- package/dist/commands/managed-sync.d.ts.map +1 -0
- package/dist/commands/managed-sync.js +64 -0
- package/dist/commands/managed-sync.js.map +1 -0
- package/dist/commands/mcp-server.d.ts +3 -0
- package/dist/commands/mcp-server.d.ts.map +1 -0
- package/dist/commands/mcp-server.js +389 -0
- package/dist/commands/mcp-server.js.map +1 -0
- package/dist/config.d.ts +24 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +32 -1
- package/dist/config.js.map +1 -1
- package/dist/core/associations.d.ts +1 -1
- package/dist/core/associations.d.ts.map +1 -1
- package/dist/core/consolidation.d.ts +31 -0
- package/dist/core/consolidation.d.ts.map +1 -1
- package/dist/core/consolidation.js +237 -29
- package/dist/core/consolidation.js.map +1 -1
- package/dist/core/embeddings/google-multimodal.d.ts +14 -0
- package/dist/core/embeddings/google-multimodal.d.ts.map +1 -0
- package/dist/core/embeddings/google-multimodal.js +142 -0
- package/dist/core/embeddings/google-multimodal.js.map +1 -0
- package/dist/core/embeddings.d.ts +3 -2
- package/dist/core/embeddings.d.ts.map +1 -1
- package/dist/core/embeddings.js +61 -39
- package/dist/core/embeddings.js.map +1 -1
- package/dist/core/mcp/client.d.ts +17 -0
- package/dist/core/mcp/client.d.ts.map +1 -0
- package/dist/core/mcp/client.js +101 -0
- package/dist/core/mcp/client.js.map +1 -0
- package/dist/core/mcp/index.d.ts +6 -0
- package/dist/core/mcp/index.d.ts.map +1 -0
- package/dist/core/mcp/index.js +6 -0
- package/dist/core/mcp/index.js.map +1 -0
- package/dist/core/mcp/server.d.ts +18 -0
- package/dist/core/mcp/server.d.ts.map +1 -0
- package/dist/core/mcp/server.js +131 -0
- package/dist/core/mcp/server.js.map +1 -0
- package/dist/core/mcp/standalone-server.d.ts +13 -0
- package/dist/core/mcp/standalone-server.d.ts.map +1 -0
- package/dist/core/mcp/standalone-server.js +46 -0
- package/dist/core/mcp/standalone-server.js.map +1 -0
- package/dist/core/mcp/tools.d.ts +9 -0
- package/dist/core/mcp/tools.d.ts.map +1 -0
- package/dist/core/mcp/tools.js +262 -0
- package/dist/core/mcp/tools.js.map +1 -0
- package/dist/core/mcp/types.d.ts +315 -0
- package/dist/core/mcp/types.d.ts.map +1 -0
- package/dist/core/mcp/types.js +48 -0
- package/dist/core/mcp/types.js.map +1 -0
- package/dist/core/memory/categorizer.d.ts +27 -0
- package/dist/core/memory/categorizer.d.ts.map +1 -0
- package/dist/core/memory/categorizer.js +304 -0
- package/dist/core/memory/categorizer.js.map +1 -0
- package/dist/core/memory/conflict-detector.d.ts +7 -0
- package/dist/core/memory/conflict-detector.d.ts.map +1 -0
- package/dist/core/memory/conflict-detector.js +43 -0
- package/dist/core/memory/conflict-detector.js.map +1 -0
- package/dist/core/memory/context-collector.d.ts +10 -0
- package/dist/core/memory/context-collector.d.ts.map +1 -0
- package/dist/core/memory/context-collector.js +55 -0
- package/dist/core/memory/context-collector.js.map +1 -0
- package/dist/core/memory/contradiction-resolver.d.ts +40 -0
- package/dist/core/memory/contradiction-resolver.d.ts.map +1 -0
- package/dist/core/memory/contradiction-resolver.js +368 -0
- package/dist/core/memory/contradiction-resolver.js.map +1 -0
- package/dist/core/memory/edit-workflow.d.ts +19 -0
- package/dist/core/memory/edit-workflow.d.ts.map +1 -0
- package/dist/core/memory/edit-workflow.js +120 -0
- package/dist/core/memory/edit-workflow.js.map +1 -0
- package/dist/core/memory/feedback-tracker.d.ts +12 -0
- package/dist/core/memory/feedback-tracker.d.ts.map +1 -0
- package/dist/core/memory/feedback-tracker.js +151 -0
- package/dist/core/memory/feedback-tracker.js.map +1 -0
- package/dist/core/memory/hybrid-retrieval.d.ts +11 -12
- package/dist/core/memory/hybrid-retrieval.d.ts.map +1 -1
- package/dist/core/memory/hybrid-retrieval.js +56 -28
- package/dist/core/memory/hybrid-retrieval.js.map +1 -1
- package/dist/core/memory/hybrid-scorer.d.ts +5 -16
- package/dist/core/memory/hybrid-scorer.d.ts.map +1 -1
- package/dist/core/memory/hybrid-scorer.js +161 -125
- package/dist/core/memory/hybrid-scorer.js.map +1 -1
- package/dist/core/memory/hybrid-search.js +64 -22
- package/dist/core/memory/hybrid-search.js.map +1 -1
- package/dist/core/memory/memories.d.ts +4 -0
- package/dist/core/memory/memories.d.ts.map +1 -1
- package/dist/core/memory/memories.js +138 -60
- package/dist/core/memory/memories.js.map +1 -1
- package/dist/core/memory/progressive-disclosure.d.ts +43 -0
- package/dist/core/memory/progressive-disclosure.d.ts.map +1 -0
- package/dist/core/memory/progressive-disclosure.js +280 -0
- package/dist/core/memory/progressive-disclosure.js.map +1 -0
- package/dist/core/memory/query-rewriter.d.ts +13 -0
- package/dist/core/memory/query-rewriter.d.ts.map +1 -0
- package/dist/core/memory/query-rewriter.js +118 -0
- package/dist/core/memory/query-rewriter.js.map +1 -0
- package/dist/core/memory/response-analyzer.d.ts +9 -0
- package/dist/core/memory/response-analyzer.d.ts.map +1 -0
- package/dist/core/memory/response-analyzer.js +61 -0
- package/dist/core/memory/response-analyzer.js.map +1 -0
- package/dist/core/memory/stats.d.ts +17 -0
- package/dist/core/memory/stats.d.ts.map +1 -0
- package/dist/core/memory/stats.js +87 -0
- package/dist/core/memory/stats.js.map +1 -0
- package/dist/core/memory/telemetry.d.ts +69 -0
- package/dist/core/memory/telemetry.d.ts.map +1 -0
- package/dist/core/memory/telemetry.js +313 -0
- package/dist/core/memory/telemetry.js.map +1 -0
- package/dist/core/memory/temporal-facts.d.ts +41 -0
- package/dist/core/memory/temporal-facts.d.ts.map +1 -0
- package/dist/core/memory/temporal-facts.js +262 -0
- package/dist/core/memory/temporal-facts.js.map +1 -0
- package/dist/core/memory/trigger-detector.d.ts +14 -0
- package/dist/core/memory/trigger-detector.d.ts.map +1 -0
- package/dist/core/memory/trigger-detector.js +42 -0
- package/dist/core/memory/trigger-detector.js.map +1 -0
- package/dist/core/memory/write-gate.d.ts +54 -0
- package/dist/core/memory/write-gate.d.ts.map +1 -0
- package/dist/core/memory/write-gate.js +210 -0
- package/dist/core/memory/write-gate.js.map +1 -0
- package/dist/core/observations.d.ts.map +1 -1
- package/dist/core/observations.js +1 -0
- package/dist/core/observations.js.map +1 -1
- package/dist/core/projects.d.ts +2 -0
- package/dist/core/projects.d.ts.map +1 -1
- package/dist/core/projects.js +33 -0
- package/dist/core/projects.js.map +1 -1
- package/dist/core/scheduler/cron-scheduler.d.ts +32 -0
- package/dist/core/scheduler/cron-scheduler.d.ts.map +1 -0
- package/dist/core/scheduler/cron-scheduler.js +238 -0
- package/dist/core/scheduler/cron-scheduler.js.map +1 -0
- package/dist/core/scheduler/heartbeat.d.ts +11 -0
- package/dist/core/scheduler/heartbeat.d.ts.map +1 -0
- package/dist/core/scheduler/heartbeat.js +73 -0
- package/dist/core/scheduler/heartbeat.js.map +1 -0
- package/dist/core/scheduler/index.d.ts +8 -0
- package/dist/core/scheduler/index.d.ts.map +1 -0
- package/dist/core/scheduler/index.js +8 -0
- package/dist/core/scheduler/index.js.map +1 -0
- package/dist/core/scheduler/job-runner.d.ts +11 -0
- package/dist/core/scheduler/job-runner.d.ts.map +1 -0
- package/dist/core/scheduler/job-runner.js +161 -0
- package/dist/core/scheduler/job-runner.js.map +1 -0
- package/dist/core/session/auto-load.d.ts +6 -0
- package/dist/core/session/auto-load.d.ts.map +1 -0
- package/dist/core/session/auto-load.js +119 -0
- package/dist/core/session/auto-load.js.map +1 -0
- package/dist/core/session/index.d.ts +7 -0
- package/dist/core/session/index.d.ts.map +1 -0
- package/dist/core/session/index.js +7 -0
- package/dist/core/session/index.js.map +1 -0
- package/dist/core/session/types.d.ts +26 -0
- package/dist/core/session/types.d.ts.map +1 -0
- package/dist/core/session/types.js +10 -0
- package/dist/core/session/types.js.map +1 -0
- package/dist/core/snapshots/comparison.d.ts.map +1 -1
- package/dist/core/snapshots/comparison.js +8 -2
- package/dist/core/snapshots/comparison.js.map +1 -1
- package/dist/core/utils/content-extraction.d.ts.map +1 -1
- package/dist/core/utils/content-extraction.js +11 -1
- package/dist/core/utils/content-extraction.js.map +1 -1
- package/dist/core/utils/memory-operations.d.ts.map +1 -1
- package/dist/core/utils/memory-operations.js +3 -1
- package/dist/core/utils/memory-operations.js.map +1 -1
- package/dist/core/utils/summarization-helpers.d.ts.map +1 -1
- package/dist/core/utils/summarization-helpers.js +4 -1
- package/dist/core/utils/summarization-helpers.js.map +1 -1
- package/dist/core/utils.d.ts.map +1 -1
- package/dist/core/utils.js +26 -3
- package/dist/core/utils.js.map +1 -1
- package/dist/core/worker.d.ts +20 -0
- package/dist/core/worker.d.ts.map +1 -1
- package/dist/core/worker.js +86 -0
- package/dist/core/worker.js.map +1 -1
- package/dist/db/adapter.d.ts +1 -5
- package/dist/db/adapter.d.ts.map +1 -1
- package/dist/db/adapter.js +137 -12
- package/dist/db/adapter.js.map +1 -1
- package/dist/db/bootstrap.d.ts.map +1 -1
- package/dist/db/bootstrap.js +178 -3
- package/dist/db/bootstrap.js.map +1 -1
- package/dist/db/index.d.ts +1 -5
- package/dist/db/index.d.ts.map +1 -1
- package/dist/db/index.js +7 -4
- package/dist/db/index.js.map +1 -1
- package/dist/drizzle/schema-sqlite.d.ts +1953 -612
- package/dist/drizzle/schema-sqlite.d.ts.map +1 -1
- package/dist/drizzle/schema-sqlite.js +134 -0
- package/dist/drizzle/schema-sqlite.js.map +1 -1
- package/dist/drizzle/schema.d.ts +684 -3
- package/dist/drizzle/schema.d.ts.map +1 -1
- package/dist/drizzle/schema.js +81 -1
- package/dist/drizzle/schema.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +152 -13
- package/dist/index.js.map +1 -1
- package/package.json +126 -103
- package/scripts/build-release.sh +33 -0
- package/scripts/db/check-db.mjs +88 -0
- package/scripts/db/fix-all-columns.mjs +52 -0
- package/scripts/db/fix-schema-all.mjs +55 -0
- package/scripts/db/fix-schema-full.mjs +46 -0
- package/scripts/db/fix-schema.mjs +38 -0
- package/scripts/db/init-db.mjs +13 -0
- package/scripts/db/recreate-db.mjs +14 -0
- package/scripts/generate-mcp.mjs +264 -0
- package/scripts/github-release.sh +61 -0
- package/scripts/init-dirs.mjs +13 -0
- package/scripts/init-dirs.ts +15 -0
- package/scripts/install-mcp.mjs +116 -0
- package/scripts/install-web.sh +120 -0
- package/scripts/install.mjs +340 -0
- package/scripts/openclaw-bootstrap.mjs +127 -0
- package/scripts/package-release.sh +71 -0
- package/scripts/remote-preflight.mjs +62 -0
- package/scripts/squish-fallback.mjs +132 -0
- package/scripts/test/test-all-systems.mjs +139 -0
- package/scripts/test/test-memory-system.mjs +139 -0
- package/scripts/test/test-v0.5.0.mjs +210 -0
- package/scripts/verify-mcp.mjs +214 -0
- package/skills/memory-guide/SKILL.md +181 -123
- package/skills/squish-cli/SKILL.md +200 -0
- package/skills/squish-mcp/SKILL.md +311 -0
- package/skills/squish-memory/SKILL.md +100 -62
- package/skills/squish-memory/claude-desktop.json +12 -0
- package/skills/squish-memory/install.mjs +335 -0
- package/skills/squish-memory/install.sh +94 -62
- package/skills/squish-memory/openclaw.json +13 -0
- package/skills/squish-memory/opencode.json +14 -0
- package/skills/squish-memory/skill.json +32 -0
- package/dist/adapters/claude-code/capture.d.ts +0 -11
- package/dist/adapters/claude-code/capture.d.ts.map +0 -1
- package/dist/adapters/claude-code/capture.js +0 -100
- package/dist/adapters/claude-code/capture.js.map +0 -1
- package/dist/adapters/claude-code/index.d.ts +0 -5
- package/dist/adapters/claude-code/index.d.ts.map +0 -1
- package/dist/adapters/claude-code/index.js +0 -6
- package/dist/adapters/claude-code/index.js.map +0 -1
- package/dist/adapters/claude-code/injection.d.ts +0 -34
- package/dist/adapters/claude-code/injection.d.ts.map +0 -1
- package/dist/adapters/claude-code/injection.js +0 -127
- package/dist/adapters/claude-code/injection.js.map +0 -1
- package/dist/adapters/claude-code/plugin-wrapper.d.ts +0 -21
- package/dist/adapters/claude-code/plugin-wrapper.d.ts.map +0 -1
- package/dist/adapters/claude-code/plugin-wrapper.js +0 -239
- package/dist/adapters/claude-code/plugin-wrapper.js.map +0 -1
- package/dist/adapters/claude-code/types.d.ts +0 -46
- package/dist/adapters/claude-code/types.d.ts.map +0 -1
- package/dist/adapters/claude-code/types.js +0 -6
- package/dist/adapters/claude-code/types.js.map +0 -1
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Squish Memory v0.9.0 - OpenClaw Self-Install Script
|
|
5
|
+
*
|
|
6
|
+
* Usage: npx squish-memory install
|
|
7
|
+
* node install.mjs
|
|
8
|
+
*
|
|
9
|
+
* This script:
|
|
10
|
+
* 1. Detects OpenClaw directory
|
|
11
|
+
* 2. Installs Squish CLI globally if needed
|
|
12
|
+
* 3. Configures MCP via mcporter
|
|
13
|
+
* 4. Creates .squish data directory
|
|
14
|
+
* 5. Runs health check
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import fs from "node:fs";
|
|
18
|
+
import os from "node:os";
|
|
19
|
+
import path from "node:path";
|
|
20
|
+
import { spawnSync, spawn } from "node:child_process";
|
|
21
|
+
|
|
22
|
+
const SQUISH_VERSION = "0.9.0";
|
|
23
|
+
const OPENCLAW_DEFAULT_DIR = path.join(os.homedir(), ".openclaw");
|
|
24
|
+
const SQUISH_DATA_DIR = path.join(os.homedir(), ".squish");
|
|
25
|
+
|
|
26
|
+
const colors = {
|
|
27
|
+
red: "\x1b[31m",
|
|
28
|
+
green: "\x1b[32m",
|
|
29
|
+
yellow: "\x1b[33m",
|
|
30
|
+
blue: "\x1b[34m",
|
|
31
|
+
cyan: "\x1b[36m",
|
|
32
|
+
reset: "\x1b[0m"
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
function log(color, message) {
|
|
36
|
+
console.log(`${colors[color]}${message}${colors.reset}`);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function detectOpenClawDir() {
|
|
40
|
+
// Check environment variable first
|
|
41
|
+
if (process.env.OPENCLAW_HOME) {
|
|
42
|
+
return process.env.OPENCLAW_HOME;
|
|
43
|
+
}
|
|
44
|
+
return OPENCLAW_DEFAULT_DIR;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function checkCommandAvailable(cmd) {
|
|
48
|
+
const result = spawnSync(cmd, ["--version"], {
|
|
49
|
+
encoding: "utf8",
|
|
50
|
+
shell: process.platform === "win32"
|
|
51
|
+
});
|
|
52
|
+
return result.status === 0;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function getSquishBinary() {
|
|
56
|
+
// Check if squish is available globally
|
|
57
|
+
if (checkCommandAvailable("squish")) {
|
|
58
|
+
return "squish";
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
// Check common install locations
|
|
62
|
+
const candidates = [
|
|
63
|
+
path.join(os.homedir(), ".local", "bin", "squish"),
|
|
64
|
+
path.join(os.homedir(), "node_modules", ".bin", "squish"),
|
|
65
|
+
"/usr/local/bin/squish",
|
|
66
|
+
"/usr/bin/squish"
|
|
67
|
+
];
|
|
68
|
+
|
|
69
|
+
for (const candidate of candidates) {
|
|
70
|
+
if (fs.existsSync(candidate)) {
|
|
71
|
+
return candidate;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function installSquishGlobally() {
|
|
79
|
+
log("blue", "Installing squish-memory globally...");
|
|
80
|
+
|
|
81
|
+
// Try bun first, then npm
|
|
82
|
+
let result = spawnSync("bun", ["add", "-g", "squish-memory"], {
|
|
83
|
+
encoding: "utf8",
|
|
84
|
+
shell: process.platform === "win32",
|
|
85
|
+
stdio: "inherit"
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
if (result.status !== 0) {
|
|
89
|
+
log("yellow", "bun not available, trying npm...");
|
|
90
|
+
result = spawnSync("npm", ["install", "-g", "squish-memory"], {
|
|
91
|
+
encoding: "utf8",
|
|
92
|
+
shell: process.platform === "win32",
|
|
93
|
+
stdio: "inherit"
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
return result.status === 0;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
function ensureDir(dirPath) {
|
|
101
|
+
if (!fs.existsSync(dirPath)) {
|
|
102
|
+
fs.mkdirSync(dirPath, { recursive: true });
|
|
103
|
+
log("green", `Created directory: ${dirPath}`);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
function readJson(filePath) {
|
|
108
|
+
if (!fs.existsSync(filePath)) {
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
111
|
+
try {
|
|
112
|
+
return JSON.parse(fs.readFileSync(filePath, "utf8"));
|
|
113
|
+
} catch {
|
|
114
|
+
return null;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
function writeJson(filePath, data) {
|
|
119
|
+
fs.writeFileSync(filePath, `${JSON.stringify(data, null, 2)}\n`, "utf8");
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
function deepMerge(base, overlay) {
|
|
123
|
+
if (Array.isArray(base) || Array.isArray(overlay)) {
|
|
124
|
+
return overlay;
|
|
125
|
+
}
|
|
126
|
+
if (base && typeof base === "object" && overlay && typeof overlay === "object") {
|
|
127
|
+
const out = { ...base };
|
|
128
|
+
for (const [key, value] of Object.entries(overlay)) {
|
|
129
|
+
out[key] = key in out ? deepMerge(out[key], value) : value;
|
|
130
|
+
}
|
|
131
|
+
return out;
|
|
132
|
+
}
|
|
133
|
+
return overlay;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function backupIfExists(filePath) {
|
|
137
|
+
if (fs.existsSync(filePath)) {
|
|
138
|
+
const backupPath = `${filePath}.bak.${Date.now()}`;
|
|
139
|
+
fs.copyFileSync(filePath, backupPath);
|
|
140
|
+
log("yellow", `Backed up: ${backupPath}`);
|
|
141
|
+
return backupPath;
|
|
142
|
+
}
|
|
143
|
+
return null;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
function configureMcporter(openclawDir) {
|
|
147
|
+
const mcporterPath = path.join(openclawDir, "mcporter.json");
|
|
148
|
+
|
|
149
|
+
// Squish MCP server configuration
|
|
150
|
+
const squishConfig = {
|
|
151
|
+
command: "squish",
|
|
152
|
+
args: [],
|
|
153
|
+
env: {
|
|
154
|
+
SQUISH_MODE: "local",
|
|
155
|
+
SQUISH_EMBEDDINGS_PROVIDER: "local"
|
|
156
|
+
},
|
|
157
|
+
transport: "stdio"
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
let config = readJson(mcporterPath) || { mcpServers: {} };
|
|
161
|
+
|
|
162
|
+
// Check if squish is already configured
|
|
163
|
+
if (config.mcpServers?.squish) {
|
|
164
|
+
log("cyan", "Squish already configured in mcporter.json");
|
|
165
|
+
return true;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
// Backup existing config
|
|
169
|
+
backupIfExists(mcporterPath);
|
|
170
|
+
|
|
171
|
+
// Add squish to mcpServers
|
|
172
|
+
if (!config.mcpServers) {
|
|
173
|
+
config.mcpServers = {};
|
|
174
|
+
}
|
|
175
|
+
config.mcpServers.squish = squishConfig;
|
|
176
|
+
|
|
177
|
+
writeJson(mcporterPath, config);
|
|
178
|
+
log("green", `Configured mcporter: ${mcporterPath}`);
|
|
179
|
+
|
|
180
|
+
return true;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
function runHealthCheck() {
|
|
184
|
+
const squishBin = getSquishBinary();
|
|
185
|
+
if (!squishBin) {
|
|
186
|
+
log("yellow", "Squish binary not found, skipping health check");
|
|
187
|
+
return false;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
log("blue", "Running health check...");
|
|
191
|
+
const result = spawnSync(squishBin, ["health"], {
|
|
192
|
+
encoding: "utf8",
|
|
193
|
+
shell: process.platform === "win32",
|
|
194
|
+
stdio: "inherit"
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
return result.status === 0;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
function printSuccess(openclawDir) {
|
|
201
|
+
console.log("");
|
|
202
|
+
log("green", "===========================================");
|
|
203
|
+
log("green", ` Squish Memory v${SQUISH_VERSION} Installed!`);
|
|
204
|
+
log("green", "===========================================");
|
|
205
|
+
console.log("");
|
|
206
|
+
log("cyan", "Configuration:");
|
|
207
|
+
console.log(` OpenClaw dir: ${openclawDir}`);
|
|
208
|
+
console.log(` Data dir: ${SQUISH_DATA_DIR}`);
|
|
209
|
+
console.log(` MCP config: ${path.join(openclawDir, "mcporter.json")}`);
|
|
210
|
+
console.log("");
|
|
211
|
+
log("cyan", "CLI Commands:");
|
|
212
|
+
console.log(" squish health - Check service health");
|
|
213
|
+
console.log(" squish remember \"text\" - Store a memory");
|
|
214
|
+
console.log(" squish search \"query\" - Search memories");
|
|
215
|
+
console.log(" squish stats - View statistics");
|
|
216
|
+
console.log("");
|
|
217
|
+
log("cyan", "MCP Tools (via mcporter):");
|
|
218
|
+
console.log(" remember, search, recall, observe");
|
|
219
|
+
console.log(" context, health, core_memory, forget");
|
|
220
|
+
console.log("");
|
|
221
|
+
log("blue", "Documentation: https://github.com/michielhdoteth/squish");
|
|
222
|
+
console.log("");
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
function printDryRun(openclawDir) {
|
|
226
|
+
log("cyan", "=== DRY RUN MODE ===");
|
|
227
|
+
console.log("");
|
|
228
|
+
console.log("Would perform:");
|
|
229
|
+
console.log(` 1. Ensure OpenClaw dir: ${openclawDir}`);
|
|
230
|
+
console.log(` 2. Ensure data dir: ${SQUISH_DATA_DIR}`);
|
|
231
|
+
console.log(` 3. Configure mcporter: ${path.join(openclawDir, "mcporter.json")}`);
|
|
232
|
+
console.log(` 4. Run health check`);
|
|
233
|
+
console.log("");
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
function parseArgs(argv) {
|
|
237
|
+
const args = {
|
|
238
|
+
dryRun: false,
|
|
239
|
+
openclawDir: null,
|
|
240
|
+
skipInstall: false
|
|
241
|
+
};
|
|
242
|
+
|
|
243
|
+
for (let i = 2; i < argv.length; i++) {
|
|
244
|
+
const token = argv[i];
|
|
245
|
+
if (token === "--dry-run" || token === "-n") {
|
|
246
|
+
args.dryRun = true;
|
|
247
|
+
continue;
|
|
248
|
+
}
|
|
249
|
+
if (token === "--openclaw-dir" || token === "-o") {
|
|
250
|
+
args.openclawDir = path.resolve(argv[i + 1]);
|
|
251
|
+
i++;
|
|
252
|
+
continue;
|
|
253
|
+
}
|
|
254
|
+
if (token === "--skip-install") {
|
|
255
|
+
args.skipInstall = true;
|
|
256
|
+
continue;
|
|
257
|
+
}
|
|
258
|
+
if (token === "--help" || token === "-h") {
|
|
259
|
+
console.log(`
|
|
260
|
+
Squish Memory v${SQUISH_VERSION} - OpenClaw Self-Install
|
|
261
|
+
|
|
262
|
+
Usage: npx squish-memory install [options]
|
|
263
|
+
|
|
264
|
+
Options:
|
|
265
|
+
--dry-run, -n Show what would be done without making changes
|
|
266
|
+
--openclaw-dir, -o Specify OpenClaw directory (default: ~/.openclaw)
|
|
267
|
+
--skip-install Skip global npm install step
|
|
268
|
+
--help, -h Show this help message
|
|
269
|
+
`);
|
|
270
|
+
process.exit(0);
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
return args;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
async function main() {
|
|
278
|
+
const args = parseArgs(process.argv);
|
|
279
|
+
|
|
280
|
+
log("blue", `Squish Memory v${SQUISH_VERSION} - OpenClaw Installer`);
|
|
281
|
+
log("blue", "===================================================");
|
|
282
|
+
console.log("");
|
|
283
|
+
|
|
284
|
+
const openclawDir = args.openclawDir || detectOpenClawDir();
|
|
285
|
+
|
|
286
|
+
if (args.dryRun) {
|
|
287
|
+
printDryRun(openclawDir);
|
|
288
|
+
return;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
// Step 1: Check/install Squish globally
|
|
292
|
+
let squishBin = getSquishBinary();
|
|
293
|
+
if (!squishBin && !args.skipInstall) {
|
|
294
|
+
const installed = installSquishGlobally();
|
|
295
|
+
if (!installed) {
|
|
296
|
+
log("red", "Failed to install squish-memory globally");
|
|
297
|
+
log("yellow", "Please install manually: npm install -g squish-memory");
|
|
298
|
+
process.exit(1);
|
|
299
|
+
}
|
|
300
|
+
squishBin = getSquishBinary();
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
if (!squishBin) {
|
|
304
|
+
log("red", "Squish binary not found after installation");
|
|
305
|
+
process.exit(1);
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
log("green", `Squish binary: ${squishBin}`);
|
|
309
|
+
|
|
310
|
+
// Step 2: Ensure OpenClaw directory exists
|
|
311
|
+
ensureDir(openclawDir);
|
|
312
|
+
|
|
313
|
+
// Step 3: Ensure .squish data directory exists
|
|
314
|
+
ensureDir(SQUISH_DATA_DIR);
|
|
315
|
+
|
|
316
|
+
// Step 4: Configure mcporter
|
|
317
|
+
configureMcporter(openclawDir);
|
|
318
|
+
|
|
319
|
+
// Step 5: Run health check
|
|
320
|
+
const healthOk = runHealthCheck();
|
|
321
|
+
|
|
322
|
+
if (!healthOk) {
|
|
323
|
+
log("yellow", "Health check failed, but installation completed");
|
|
324
|
+
log("yellow", "You may need to restart your shell or add squish to PATH");
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
// Print success message
|
|
328
|
+
printSuccess(openclawDir);
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
main().catch((err) => {
|
|
332
|
+
log("red", `Installation failed: ${err.message}`);
|
|
333
|
+
console.error(err);
|
|
334
|
+
process.exit(1);
|
|
335
|
+
});
|
|
@@ -1,91 +1,123 @@
|
|
|
1
1
|
#!/bin/bash
|
|
2
|
-
# Squish Memory Skill Installer for OpenClaw
|
|
3
|
-
# Usage: curl -sSL https://raw.githubusercontent.com/michielhdoteth/squish/
|
|
2
|
+
# Squish Memory Skill Installer for OpenClaw v0.9.0
|
|
3
|
+
# Usage: curl -sSL https://raw.githubusercontent.com/michielhdoteth/squish/main/skills/squish-memory/install.sh | bash
|
|
4
4
|
|
|
5
5
|
set -e
|
|
6
6
|
|
|
7
|
+
SQUISH_VERSION="0.9.0"
|
|
7
8
|
INSTALL_DIR="$HOME/.openclaw/skills/squish-memory"
|
|
8
9
|
GITHUB_REPO="https://github.com/michielhdoteth/squish"
|
|
9
|
-
RAW_BASE="https://raw.githubusercontent.com/michielhdoteth/squish/
|
|
10
|
+
RAW_BASE="https://raw.githubusercontent.com/michielhdoteth/squish/main"
|
|
10
11
|
|
|
11
|
-
echo "Squish Memory
|
|
12
|
-
echo "
|
|
12
|
+
echo "Squish Memory v${SQUISH_VERSION} - OpenClaw Installer"
|
|
13
|
+
echo "====================================================="
|
|
14
|
+
echo ""
|
|
15
|
+
|
|
16
|
+
# Method 1: Use npx (recommended)
|
|
17
|
+
echo "Installing via npx..."
|
|
18
|
+
if command -v npx &> /dev/null; then
|
|
19
|
+
npx squish-memory install
|
|
20
|
+
exit 0
|
|
21
|
+
fi
|
|
22
|
+
|
|
23
|
+
# Method 2: Manual install for systems without npx
|
|
24
|
+
echo "npx not available, performing manual installation..."
|
|
13
25
|
|
|
14
26
|
# Create install directory
|
|
15
27
|
echo "Installing to: $INSTALL_DIR"
|
|
16
28
|
mkdir -p "$INSTALL_DIR"
|
|
17
29
|
|
|
18
30
|
# Download skill definition
|
|
19
|
-
echo "Downloading skill
|
|
31
|
+
echo "Downloading skill files..."
|
|
20
32
|
curl -sSL "$RAW_BASE/skills/squish-memory/SKILL.md" -o "$INSTALL_DIR/SKILL.md"
|
|
33
|
+
curl -sSL "$RAW_BASE/skills/squish-memory/mcp-config.json" -o "$INSTALL_DIR/mcp-config.json"
|
|
21
34
|
|
|
22
|
-
#
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
# Squish OpenClaw Gateway Launcher
|
|
26
|
-
|
|
27
|
-
# Check if Squish is installed
|
|
28
|
-
if [ ! -d "$HOME/.squish" ] && [ ! -d "./node_modules/squish" ]; then
|
|
29
|
-
echo "Squish not found. Installing..."
|
|
30
|
-
npm install -g squish || {
|
|
31
|
-
echo "Installing from source..."
|
|
32
|
-
git clone https://github.com/michielhdoteth/squish.git /tmp/squish-install
|
|
33
|
-
cd /tmp/squish-install
|
|
34
|
-
npm install
|
|
35
|
-
npm run build
|
|
36
|
-
npm pack
|
|
37
|
-
npm install -g squish-*.tgz
|
|
38
|
-
}
|
|
39
|
-
fi
|
|
40
|
-
|
|
41
|
-
# Start Squish with OpenClaw gateway enabled
|
|
42
|
-
export OPENCLAW_GATEWAY_ENABLED=true
|
|
43
|
-
export SQUISH_MODE=local
|
|
35
|
+
# Download and setup install script
|
|
36
|
+
curl -sSL "$RAW_BASE/skills/squish-memory/install.mjs" -o "$INSTALL_DIR/install.mjs"
|
|
37
|
+
chmod +x "$INSTALL_DIR/install.mjs"
|
|
44
38
|
|
|
45
|
-
#
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
39
|
+
# Install squish-memory globally
|
|
40
|
+
echo "Installing squish-memory CLI..."
|
|
41
|
+
if command -v bun &> /dev/null; then
|
|
42
|
+
bun add -g squish-memory
|
|
43
|
+
elif command -v npm &> /dev/null; then
|
|
44
|
+
npm install -g squish-memory
|
|
50
45
|
else
|
|
51
|
-
|
|
52
|
-
|
|
46
|
+
echo "ERROR: Neither bun nor npm found. Please install Node.js or Bun first."
|
|
47
|
+
exit 1
|
|
53
48
|
fi
|
|
54
49
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
echo "
|
|
58
|
-
echo ""
|
|
59
|
-
echo "To stop: kill $SQUISH_PID"
|
|
60
|
-
EOF
|
|
50
|
+
# Create .squish data directory
|
|
51
|
+
mkdir -p "$HOME/.squish"
|
|
52
|
+
echo "Created data directory: $HOME/.squish"
|
|
61
53
|
|
|
62
|
-
|
|
54
|
+
# Configure mcporter if directory exists
|
|
55
|
+
OPENCLAW_DIR="$HOME/.openclaw"
|
|
56
|
+
if [ -d "$OPENCLAW_DIR" ]; then
|
|
57
|
+
MCPORTER_CONFIG="$OPENCLAW_DIR/mcporter.json"
|
|
63
58
|
|
|
64
|
-
#
|
|
65
|
-
|
|
59
|
+
# Backup existing config
|
|
60
|
+
if [ -f "$MCPORTER_CONFIG" ]; then
|
|
61
|
+
cp "$MCPORTER_CONFIG" "$MCPORTER_CONFIG.bak.$(date +%s)"
|
|
62
|
+
fi
|
|
63
|
+
|
|
64
|
+
# Create or update config with squish
|
|
65
|
+
if [ -f "$MCPORTER_CONFIG" ]; then
|
|
66
|
+
# Merge with existing config using node if available
|
|
67
|
+
if command -v node &> /dev/null; then
|
|
68
|
+
node -e "
|
|
69
|
+
const fs = require('fs');
|
|
70
|
+
const config = JSON.parse(fs.readFileSync('$MCPORTER_CONFIG', 'utf8'));
|
|
71
|
+
if (!config.mcpServers) config.mcpServers = {};
|
|
72
|
+
config.mcpServers.squish = {
|
|
73
|
+
command: 'squish',
|
|
74
|
+
args: [],
|
|
75
|
+
env: { SQUISH_MODE: 'local', SQUISH_EMBEDDINGS_PROVIDER: 'local' },
|
|
76
|
+
transport: 'stdio'
|
|
77
|
+
};
|
|
78
|
+
fs.writeFileSync('$MCPORTER_CONFIG', JSON.stringify(config, null, 2));
|
|
79
|
+
"
|
|
80
|
+
echo "Updated mcporter.json with Squish configuration"
|
|
81
|
+
fi
|
|
82
|
+
else
|
|
83
|
+
# Create new config
|
|
84
|
+
cat > "$MCPORTER_CONFIG" << 'EOF'
|
|
66
85
|
{
|
|
67
|
-
"
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
"remember": "Store a new memory",
|
|
78
|
-
"recall": "Retrieve a memory by ID",
|
|
79
|
-
"status": "Check Squish status"
|
|
86
|
+
"mcpServers": {
|
|
87
|
+
"squish": {
|
|
88
|
+
"command": "squish",
|
|
89
|
+
"args": [],
|
|
90
|
+
"env": {
|
|
91
|
+
"SQUISH_MODE": "local",
|
|
92
|
+
"SQUISH_EMBEDDINGS_PROVIDER": "local"
|
|
93
|
+
},
|
|
94
|
+
"transport": "stdio"
|
|
95
|
+
}
|
|
80
96
|
}
|
|
81
97
|
}
|
|
82
98
|
EOF
|
|
99
|
+
echo "Created mcporter.json with Squish configuration"
|
|
100
|
+
fi
|
|
101
|
+
fi
|
|
102
|
+
|
|
103
|
+
# Run health check
|
|
104
|
+
echo ""
|
|
105
|
+
echo "Running health check..."
|
|
106
|
+
squish health || echo "Health check failed - you may need to restart your shell"
|
|
83
107
|
|
|
84
108
|
echo ""
|
|
85
|
-
echo "
|
|
109
|
+
echo "==========================================="
|
|
110
|
+
echo " Squish Memory v${SQUISH_VERSION} Installed!"
|
|
111
|
+
echo "==========================================="
|
|
112
|
+
echo ""
|
|
113
|
+
echo "CLI Commands:"
|
|
114
|
+
echo " squish health - Check service health"
|
|
115
|
+
echo " squish remember \"text\" - Store a memory"
|
|
116
|
+
echo " squish search \"query\" - Search memories"
|
|
117
|
+
echo " squish stats - View statistics"
|
|
86
118
|
echo ""
|
|
87
|
-
echo "
|
|
88
|
-
echo "
|
|
89
|
-
echo "
|
|
119
|
+
echo "MCP Tools (via mcporter):"
|
|
120
|
+
echo " remember, search, recall, observe"
|
|
121
|
+
echo " context, health, core_memory, forget"
|
|
90
122
|
echo ""
|
|
91
|
-
echo "
|
|
123
|
+
echo "Documentation: $GITHUB_REPO"
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://opencode.ai/config.json",
|
|
3
|
+
"mcp": {
|
|
4
|
+
"squish": {
|
|
5
|
+
"type": "local",
|
|
6
|
+
"command": ["npx", "-y", "squish-memory", "mcp"],
|
|
7
|
+
"enabled": true,
|
|
8
|
+
"environment": {
|
|
9
|
+
"SQUISH_MODE": "local",
|
|
10
|
+
"SQUISH_DATA_DIR": "~/.squish"
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "squish-memory",
|
|
3
|
+
"version": "0.9.0",
|
|
4
|
+
"description": "Persistent memory system with semantic search for AI assistants",
|
|
5
|
+
"author": "michielhdoteth",
|
|
6
|
+
"repository": "https://github.com/michielhdoteth/squish",
|
|
7
|
+
"homepage": "https://github.com/michielhdoteth/squish",
|
|
8
|
+
"keywords": ["memory", "persistence", "search", "semantic-search", "ai-assistant", "mcp", "cli"],
|
|
9
|
+
"license": "MIT",
|
|
10
|
+
"skills": [
|
|
11
|
+
{
|
|
12
|
+
"name": "squish-memory",
|
|
13
|
+
"path": "skills/squish-memory",
|
|
14
|
+
"description": "Overview, quick start, and configuration"
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"name": "squish-mcp",
|
|
18
|
+
"path": "skills/squish-mcp",
|
|
19
|
+
"description": "MCP tools (16 tools) for Claude Code, OpenCode, Cursor"
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"name": "squish-cli",
|
|
23
|
+
"path": "skills/squish-cli",
|
|
24
|
+
"description": "CLI commands for OpenClaw and bash scripting"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"name": "memory-guide",
|
|
28
|
+
"path": "skills/memory-guide",
|
|
29
|
+
"description": "Usage guide and best practices"
|
|
30
|
+
}
|
|
31
|
+
]
|
|
32
|
+
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Auto-Capture System
|
|
3
|
-
* Captures tool usage and user prompts as observations
|
|
4
|
-
*/
|
|
5
|
-
import type { PluginContext, CapturedObservation } from './types.js';
|
|
6
|
-
export declare function captureUserPrompt(projectPath: string, prompt: string, context: PluginContext): Promise<CapturedObservation | null>;
|
|
7
|
-
export declare function captureToolUse(projectPath: string, toolName: string, toolArgs: Record<string, unknown> | undefined, toolResult: string | Record<string, unknown> | undefined, context: PluginContext): Promise<CapturedObservation | null>;
|
|
8
|
-
export declare function queueForSummarization(observationId: string, projectPath?: string): Promise<void>;
|
|
9
|
-
export declare function captureFileChange(projectPath: string, filePath: string, changeType: 'created' | 'modified' | 'deleted', context: PluginContext): Promise<CapturedObservation | null>;
|
|
10
|
-
export declare function captureError(projectPath: string, error: Error, errorContext: string, pluginContext: PluginContext): Promise<CapturedObservation | null>;
|
|
11
|
-
//# sourceMappingURL=capture.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"capture.d.ts","sourceRoot":"","sources":["../../../adapters/claude-code/capture.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAsDrE,wBAAsB,iBAAiB,CACrC,WAAW,EAAE,MAAM,EACnB,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAarC;AAED,wBAAsB,cAAc,CAClC,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EAC7C,UAAU,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EACxD,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAqCrC;AAED,wBAAsB,qBAAqB,CAAC,aAAa,EAAE,MAAM,EAAE,WAAW,GAAE,MAAW,GAAG,OAAO,CAAC,IAAI,CAAC,CAyB1G;AAED,wBAAsB,iBAAiB,CACrC,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,SAAS,GAAG,UAAU,GAAG,SAAS,EAC9C,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAYrC;AAED,wBAAsB,YAAY,CAChC,WAAW,EAAE,MAAM,EACnB,KAAK,EAAE,KAAK,EACZ,YAAY,EAAE,MAAM,EACpB,aAAa,EAAE,aAAa,GAC3B,OAAO,CAAC,mBAAmB,GAAG,IAAI,CAAC,CAYrC"}
|