@deeplake/hivemind 0.7.71 → 0.7.72
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 +3 -3
- package/.claude-plugin/plugin.json +1 -1
- package/bundle/cli.js +5 -5
- package/codex/bundle/pre-tool-use.js +52 -67
- package/cursor/bundle/pre-tool-use.js +8 -2
- package/hermes/bundle/pre-tool-use.js +8 -2
- package/openclaw/dist/index.js +1 -1
- package/openclaw/openclaw.plugin.json +1 -1
- package/openclaw/package.json +1 -1
- package/package.json +1 -1
|
@@ -6,18 +6,18 @@
|
|
|
6
6
|
},
|
|
7
7
|
"metadata": {
|
|
8
8
|
"description": "Cloud-backed persistent shared memory for AI agents powered by Deeplake",
|
|
9
|
-
"version": "0.7.
|
|
9
|
+
"version": "0.7.72"
|
|
10
10
|
},
|
|
11
11
|
"plugins": [
|
|
12
12
|
{
|
|
13
13
|
"name": "hivemind",
|
|
14
14
|
"description": "Persistent shared memory powered by Deeplake — captures all session activity and provides cross-session, cross-agent memory search",
|
|
15
|
-
"version": "0.7.
|
|
15
|
+
"version": "0.7.72",
|
|
16
16
|
"source": {
|
|
17
17
|
"source": "git-subdir",
|
|
18
18
|
"url": "https://github.com/activeloopai/hivemind.git",
|
|
19
19
|
"path": "claude-code",
|
|
20
|
-
"sha": "
|
|
20
|
+
"sha": "103bb69c8ecb83325c0c3e39029d22691c4f2d4a"
|
|
21
21
|
},
|
|
22
22
|
"homepage": "https://github.com/activeloopai/hivemind"
|
|
23
23
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hivemind",
|
|
3
3
|
"description": "Cloud-backed persistent memory powered by Deeplake — read, write, and share memory across Claude Code sessions and agents",
|
|
4
|
-
"version": "0.7.
|
|
4
|
+
"version": "0.7.72",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Activeloop",
|
|
7
7
|
"url": "https://deeplake.ai"
|
package/bundle/cli.js
CHANGED
|
@@ -11647,7 +11647,7 @@ async function runUpdate(opts = {}) {
|
|
|
11647
11647
|
switch (detected.kind) {
|
|
11648
11648
|
case "npm-global": {
|
|
11649
11649
|
if (opts.dryRun) {
|
|
11650
|
-
log(`(dry-run) Would run: npm install -g ${PKG_NAME}
|
|
11650
|
+
log(`(dry-run) Would run: npm install -g ${PKG_NAME}@${latest}`);
|
|
11651
11651
|
log(`(dry-run) Would re-run: hivemind install --skip-auth`);
|
|
11652
11652
|
return 0;
|
|
11653
11653
|
}
|
|
@@ -11658,10 +11658,10 @@ async function runUpdate(opts = {}) {
|
|
|
11658
11658
|
try {
|
|
11659
11659
|
log(`Upgrading via npm\u2026`);
|
|
11660
11660
|
try {
|
|
11661
|
-
spawn5("npm", ["install", "-g", `${PKG_NAME}
|
|
11661
|
+
spawn5("npm", ["install", "-g", `${PKG_NAME}@${latest}`]);
|
|
11662
11662
|
} catch (e) {
|
|
11663
11663
|
warn(`npm install failed: ${e.message}`);
|
|
11664
|
-
warn(`Try running it manually: npm install -g ${PKG_NAME}
|
|
11664
|
+
warn(`Try running it manually: npm install -g ${PKG_NAME}@${latest}`);
|
|
11665
11665
|
return 1;
|
|
11666
11666
|
}
|
|
11667
11667
|
log(``);
|
|
@@ -11692,7 +11692,7 @@ async function runUpdate(opts = {}) {
|
|
|
11692
11692
|
log(``);
|
|
11693
11693
|
log(`Or install globally so future updates are one command:`);
|
|
11694
11694
|
log(``);
|
|
11695
|
-
log(` npm install -g ${PKG_NAME}
|
|
11695
|
+
log(` npm install -g ${PKG_NAME}@${latest}`);
|
|
11696
11696
|
return 0;
|
|
11697
11697
|
}
|
|
11698
11698
|
case "local-dev": {
|
|
@@ -11712,7 +11712,7 @@ async function runUpdate(opts = {}) {
|
|
|
11712
11712
|
return 0;
|
|
11713
11713
|
}
|
|
11714
11714
|
warn(`Could not determine how hivemind was installed (path: ${detected.installDir}).`);
|
|
11715
|
-
warn(`Update manually: npm install -g ${PKG_NAME}
|
|
11715
|
+
warn(`Update manually: npm install -g ${PKG_NAME}@${latest}`);
|
|
11716
11716
|
return 1;
|
|
11717
11717
|
}
|
|
11718
11718
|
}
|
|
@@ -52,12 +52,6 @@ var init_index_marker_store = __esm({
|
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
54
|
|
|
55
|
-
// dist/src/hooks/codex/pre-tool-use.js
|
|
56
|
-
import { execFileSync } from "node:child_process";
|
|
57
|
-
import { existsSync as existsSync5 } from "node:fs";
|
|
58
|
-
import { join as join12, dirname as dirname3 } from "node:path";
|
|
59
|
-
import { fileURLToPath as fileURLToPath3 } from "node:url";
|
|
60
|
-
|
|
61
55
|
// dist/src/utils/stdin.js
|
|
62
56
|
function readStdin() {
|
|
63
57
|
return new Promise((resolve3, reject) => {
|
|
@@ -3042,12 +3036,13 @@ var SAFE_BUILTINS = /* @__PURE__ */ new Set([
|
|
|
3042
3036
|
"du",
|
|
3043
3037
|
"tree",
|
|
3044
3038
|
"file",
|
|
3039
|
+
// sed and awk removed: sed supports `-e '1e <cmd>'` (execute shell command)
|
|
3040
|
+
// and awk supports `system()` / `|` pipelines — both enable arbitrary code
|
|
3041
|
+
// execution through the just-bash fallback.
|
|
3045
3042
|
"grep",
|
|
3046
3043
|
"egrep",
|
|
3047
3044
|
"fgrep",
|
|
3048
3045
|
"rg",
|
|
3049
|
-
"sed",
|
|
3050
|
-
"awk",
|
|
3051
3046
|
"cut",
|
|
3052
3047
|
"tr",
|
|
3053
3048
|
"sort",
|
|
@@ -3068,15 +3063,18 @@ var SAFE_BUILTINS = /* @__PURE__ */ new Set([
|
|
|
3068
3063
|
"diff",
|
|
3069
3064
|
"strings",
|
|
3070
3065
|
"split",
|
|
3066
|
+
// xargs removed: it executes its input as a child command (`… | xargs curl`).
|
|
3067
|
+
// `find` stays because the VFS serves `find -name`, but isSafe() rejects the
|
|
3068
|
+
// command-dispatching `-exec/-execdir/-ok/-okdir` primaries below.
|
|
3071
3069
|
"find",
|
|
3072
|
-
"xargs",
|
|
3073
3070
|
"which",
|
|
3074
3071
|
"jq",
|
|
3075
3072
|
"yq",
|
|
3076
3073
|
"xan",
|
|
3077
3074
|
"base64",
|
|
3078
3075
|
"od",
|
|
3079
|
-
|
|
3076
|
+
// tar removed: --to-command=<cmd> executes an arbitrary program per entry.
|
|
3077
|
+
// env removed: `env <cmd>` runs an arbitrary program.
|
|
3080
3078
|
"gzip",
|
|
3081
3079
|
"gunzip",
|
|
3082
3080
|
"zcat",
|
|
@@ -3090,16 +3088,15 @@ var SAFE_BUILTINS = /* @__PURE__ */ new Set([
|
|
|
3090
3088
|
"cd",
|
|
3091
3089
|
"basename",
|
|
3092
3090
|
"dirname",
|
|
3093
|
-
"env",
|
|
3094
3091
|
"printenv",
|
|
3095
3092
|
"hostname",
|
|
3096
3093
|
"whoami",
|
|
3094
|
+
// timeout and time removed: both are wrappers that run an arbitrary child
|
|
3095
|
+
// command (`timeout 1 curl …`, `time curl …`).
|
|
3097
3096
|
"date",
|
|
3098
3097
|
"seq",
|
|
3099
3098
|
"expr",
|
|
3100
3099
|
"sleep",
|
|
3101
|
-
"timeout",
|
|
3102
|
-
"time",
|
|
3103
3100
|
"true",
|
|
3104
3101
|
"false",
|
|
3105
3102
|
"test",
|
|
@@ -3107,17 +3104,12 @@ var SAFE_BUILTINS = /* @__PURE__ */ new Set([
|
|
|
3107
3104
|
"unalias",
|
|
3108
3105
|
"history",
|
|
3109
3106
|
"help",
|
|
3110
|
-
"clear"
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
"then",
|
|
3117
|
-
"else",
|
|
3118
|
-
"fi",
|
|
3119
|
-
"case",
|
|
3120
|
-
"esac"
|
|
3107
|
+
"clear"
|
|
3108
|
+
// Shell control keywords removed: as a stage's first token they let a child
|
|
3109
|
+
// command ride in as a later token (`if true; then curl …; fi` splits into a
|
|
3110
|
+
// `then curl …` stage whose leading `then` would otherwise pass). No VFS
|
|
3111
|
+
// handler emulates control flow, so dropping them only sends such commands to
|
|
3112
|
+
// the guidance/deny path — they never reach a real shell.
|
|
3121
3113
|
]);
|
|
3122
3114
|
function stripHeredocBodies(cmd) {
|
|
3123
3115
|
if (!cmd.includes("<<"))
|
|
@@ -3143,9 +3135,11 @@ function stripHeredocBodies(cmd) {
|
|
|
3143
3135
|
}
|
|
3144
3136
|
function isSafe(cmd) {
|
|
3145
3137
|
const validated = stripHeredocBodies(cmd);
|
|
3146
|
-
if (/\$\(|`|<\(/.test(validated))
|
|
3138
|
+
if (/\$\(|`|<\(|\$'/.test(validated))
|
|
3147
3139
|
return false;
|
|
3148
3140
|
const stripped = validated.replace(/'[^']*'/g, "''").replace(/"[^"]*"/g, '""');
|
|
3141
|
+
if (/(?:^|\s)-(?:exec|execdir|ok|okdir)\b/.test(stripped))
|
|
3142
|
+
return false;
|
|
3149
3143
|
const stages = stripped.split(/\||;|&&|\|\||\n/);
|
|
3150
3144
|
for (const stage of stages) {
|
|
3151
3145
|
const firstToken = stage.trim().split(/\s+/)[0] ?? "";
|
|
@@ -3154,32 +3148,23 @@ function isSafe(cmd) {
|
|
|
3154
3148
|
}
|
|
3155
3149
|
return true;
|
|
3156
3150
|
}
|
|
3151
|
+
function escapeRe(s) {
|
|
3152
|
+
return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
3153
|
+
}
|
|
3154
|
+
var MEMORY_BOUNDARY = "(?![A-Za-z0-9._-])";
|
|
3155
|
+
var MEMORY_PREFIX_RE = new RegExp("(?:" + [MEMORY_PATH, TILDE_PATH, HOME_VAR_PATH].map(escapeRe).join("|") + ")" + MEMORY_BOUNDARY);
|
|
3157
3156
|
function touchesMemory(p) {
|
|
3158
|
-
return
|
|
3157
|
+
return MEMORY_PREFIX_RE.test(p);
|
|
3159
3158
|
}
|
|
3160
3159
|
function rewritePaths(cmd) {
|
|
3161
|
-
|
|
3160
|
+
const tail = "(?:\\/|" + MEMORY_BOUNDARY + ")";
|
|
3161
|
+
return cmd.replace(new RegExp(escapeRe(MEMORY_PATH) + tail, "g"), "/").replace(new RegExp(escapeRe(TILDE_PATH) + tail, "g"), "/").replace(new RegExp('"' + escapeRe(HOME_VAR_PATH) + tail + '"', "g"), '"/"').replace(new RegExp(escapeRe(HOME_VAR_PATH) + tail, "g"), "/");
|
|
3162
3162
|
}
|
|
3163
3163
|
|
|
3164
3164
|
// dist/src/hooks/codex/pre-tool-use.js
|
|
3165
3165
|
var log6 = (msg) => log("codex-pre", msg);
|
|
3166
|
-
var __bundleDir = dirname3(fileURLToPath3(import.meta.url));
|
|
3167
|
-
var SHELL_BUNDLE = existsSync5(join12(__bundleDir, "shell", "deeplake-shell.js")) ? join12(__bundleDir, "shell", "deeplake-shell.js") : join12(__bundleDir, "..", "shell", "deeplake-shell.js");
|
|
3168
3166
|
function buildUnsupportedGuidance() {
|
|
3169
|
-
return "This command is not supported for ~/.deeplake/memory/ operations. Only bash builtins are available: cat, ls, grep, echo, jq, head, tail,
|
|
3170
|
-
}
|
|
3171
|
-
function runVirtualShell(cmd, shellBundle = SHELL_BUNDLE, logFn = log6) {
|
|
3172
|
-
try {
|
|
3173
|
-
return execFileSync("node", [shellBundle, "-c", cmd], {
|
|
3174
|
-
encoding: "utf-8",
|
|
3175
|
-
timeout: 1e4,
|
|
3176
|
-
env: { ...process.env },
|
|
3177
|
-
stdio: ["pipe", "pipe", "pipe"]
|
|
3178
|
-
}).trim();
|
|
3179
|
-
} catch (e) {
|
|
3180
|
-
logFn(`virtual shell failed: ${e.message}`);
|
|
3181
|
-
return "";
|
|
3182
|
-
}
|
|
3167
|
+
return "This command is not supported for ~/.deeplake/memory/ operations. Only bash builtins are available: cat, ls, grep, echo, jq, head, tail, wc, sort, find, etc. Do NOT use python, python3, node, curl, or other interpreters. Rewrite your command using only bash tools and retry.";
|
|
3183
3168
|
}
|
|
3184
3169
|
function buildIndexContent(rows) {
|
|
3185
3170
|
const lines = ["# Memory Index", "", `${rows.length} sessions:`, ""];
|
|
@@ -3193,18 +3178,17 @@ function buildIndexContent(rows) {
|
|
|
3193
3178
|
return lines.join("\n");
|
|
3194
3179
|
}
|
|
3195
3180
|
async function processCodexPreToolUse(input, deps = {}) {
|
|
3196
|
-
const { config = loadConfig(), createApi = (table, activeConfig) => new DeeplakeApi(activeConfig.token, activeConfig.apiUrl, activeConfig.orgId, activeConfig.workspaceId, table), executeCompiledBashCommandFn = executeCompiledBashCommand, readVirtualPathContentsFn = readVirtualPathContents, readVirtualPathContentFn = readVirtualPathContent, listVirtualPathRowsFn = listVirtualPathRows, findVirtualPathsFn = findVirtualPaths, handleGrepDirectFn = handleGrepDirect, readCachedIndexContentFn = readCachedIndexContent, writeCachedIndexContentFn = writeCachedIndexContent,
|
|
3181
|
+
const { config = loadConfig(), createApi = (table, activeConfig) => new DeeplakeApi(activeConfig.token, activeConfig.apiUrl, activeConfig.orgId, activeConfig.workspaceId, table), executeCompiledBashCommandFn = executeCompiledBashCommand, readVirtualPathContentsFn = readVirtualPathContents, readVirtualPathContentFn = readVirtualPathContent, listVirtualPathRowsFn = listVirtualPathRows, findVirtualPathsFn = findVirtualPaths, handleGrepDirectFn = handleGrepDirect, readCachedIndexContentFn = readCachedIndexContent, writeCachedIndexContentFn = writeCachedIndexContent, logFn = log6 } = deps;
|
|
3197
3182
|
const cmd = input.tool_input?.command ?? "";
|
|
3198
3183
|
logFn(`hook fired: cmd=${cmd}`);
|
|
3199
3184
|
if (!touchesMemory(cmd))
|
|
3200
3185
|
return { action: "pass" };
|
|
3201
3186
|
const rewritten = rewritePaths(cmd);
|
|
3202
3187
|
if (!isSafe(rewritten)) {
|
|
3203
|
-
|
|
3204
|
-
logFn(`unsupported command, returning guidance: ${rewritten}`);
|
|
3188
|
+
logFn(`unsupported command, blocking with guidance: ${rewritten}`);
|
|
3205
3189
|
return {
|
|
3206
|
-
action: "
|
|
3207
|
-
output:
|
|
3190
|
+
action: "block",
|
|
3191
|
+
output: buildUnsupportedGuidance(),
|
|
3208
3192
|
rewrittenCommand: rewritten
|
|
3209
3193
|
};
|
|
3210
3194
|
}
|
|
@@ -3214,22 +3198,22 @@ async function processCodexPreToolUse(input, deps = {}) {
|
|
|
3214
3198
|
const api = createApi(table, config);
|
|
3215
3199
|
const readVirtualPathContentsWithCache = async (cachePaths) => {
|
|
3216
3200
|
const uniquePaths = [...new Set(cachePaths)];
|
|
3217
|
-
const
|
|
3201
|
+
const result = new Map(uniquePaths.map((path) => [path, null]));
|
|
3218
3202
|
const cachedIndex = uniquePaths.includes("/index.md") ? readCachedIndexContentFn(input.session_id) : null;
|
|
3219
3203
|
const remainingPaths = cachedIndex === null ? uniquePaths : uniquePaths.filter((path) => path !== "/index.md");
|
|
3220
3204
|
if (cachedIndex !== null) {
|
|
3221
|
-
|
|
3205
|
+
result.set("/index.md", cachedIndex);
|
|
3222
3206
|
}
|
|
3223
3207
|
if (remainingPaths.length > 0) {
|
|
3224
3208
|
const fetched = await readVirtualPathContentsFn(api, table, sessionsTable, remainingPaths);
|
|
3225
3209
|
for (const [path, content] of fetched)
|
|
3226
|
-
|
|
3210
|
+
result.set(path, content);
|
|
3227
3211
|
}
|
|
3228
|
-
const fetchedIndex =
|
|
3212
|
+
const fetchedIndex = result.get("/index.md");
|
|
3229
3213
|
if (typeof fetchedIndex === "string") {
|
|
3230
3214
|
writeCachedIndexContentFn(input.session_id, fetchedIndex);
|
|
3231
3215
|
}
|
|
3232
|
-
return
|
|
3216
|
+
return result;
|
|
3233
3217
|
};
|
|
3234
3218
|
try {
|
|
3235
3219
|
const compiled = await executeCompiledBashCommandFn(api, table, sessionsTable, rewritten, {
|
|
@@ -3307,6 +3291,8 @@ async function processCodexPreToolUse(input, deps = {}) {
|
|
|
3307
3291
|
}
|
|
3308
3292
|
return { action: "block", output: content, rewrittenCommand: rewritten };
|
|
3309
3293
|
}
|
|
3294
|
+
logFn(`virtual path not found: ${virtualPath}`);
|
|
3295
|
+
return { action: "block", output: `${virtualPath}: No such file or directory`, rewrittenCommand: rewritten };
|
|
3310
3296
|
}
|
|
3311
3297
|
const lsMatch = rewritten.match(/^ls\s+(?:-[a-zA-Z]+\s+)*(\S+)?\s*$/);
|
|
3312
3298
|
if (lsMatch) {
|
|
@@ -3352,38 +3338,38 @@ async function processCodexPreToolUse(input, deps = {}) {
|
|
|
3352
3338
|
rewrittenCommand: rewritten
|
|
3353
3339
|
};
|
|
3354
3340
|
}
|
|
3355
|
-
const findMatch = rewritten.match(/^find\s+(\S+)\s
|
|
3341
|
+
const findMatch = rewritten.match(/^find\s+(\S+)\s+-name\s+(?:'([^']+)'|"([^"]+)"|([^\s|]+))\s*(?:\|\s*wc\s+-l)?\s*$/);
|
|
3356
3342
|
if (findMatch) {
|
|
3357
3343
|
const dir = findMatch[1].replace(/\/+$/, "") || "/";
|
|
3358
|
-
const
|
|
3359
|
-
|
|
3344
|
+
const rawPattern = findMatch[2] ?? findMatch[3] ?? findMatch[4] ?? "";
|
|
3345
|
+
const namePattern = sqlLike(rawPattern).replace(/\*/g, "%").replace(/\?/g, "_");
|
|
3346
|
+
logFn(`direct find: ${dir} -name '${rawPattern}'`);
|
|
3360
3347
|
const paths = await findVirtualPathsFn(api, table, sessionsTable, dir, namePattern);
|
|
3361
|
-
let
|
|
3348
|
+
let result = paths.join("\n") || "";
|
|
3362
3349
|
if (/\|\s*wc\s+-l\s*$/.test(rewritten))
|
|
3363
|
-
|
|
3350
|
+
result = String(paths.length);
|
|
3364
3351
|
return {
|
|
3365
3352
|
action: "block",
|
|
3366
|
-
output:
|
|
3353
|
+
output: result || "(no matches)",
|
|
3367
3354
|
rewrittenCommand: rewritten
|
|
3368
3355
|
};
|
|
3369
3356
|
}
|
|
3370
3357
|
const grepParams = parseBashGrep(rewritten);
|
|
3371
3358
|
if (grepParams) {
|
|
3372
3359
|
logFn(`direct grep: pattern=${grepParams.pattern} path=${grepParams.targetPath}`);
|
|
3373
|
-
const
|
|
3374
|
-
if (
|
|
3375
|
-
return { action: "block", output:
|
|
3360
|
+
const result = await handleGrepDirectFn(api, table, sessionsTable, grepParams);
|
|
3361
|
+
if (result !== null) {
|
|
3362
|
+
return { action: "block", output: result, rewrittenCommand: rewritten };
|
|
3376
3363
|
}
|
|
3377
3364
|
}
|
|
3378
3365
|
} catch (e) {
|
|
3379
|
-
logFn(`direct query failed
|
|
3366
|
+
logFn(`direct query failed: ${e.message}`);
|
|
3380
3367
|
}
|
|
3381
3368
|
}
|
|
3382
|
-
logFn(`
|
|
3383
|
-
const result = runVirtualShellFn(rewritten, shellBundle, logFn);
|
|
3369
|
+
logFn(`unroutable memory command, blocking with guidance: ${rewritten}`);
|
|
3384
3370
|
return {
|
|
3385
3371
|
action: "block",
|
|
3386
|
-
output:
|
|
3372
|
+
output: buildUnsupportedGuidance(),
|
|
3387
3373
|
rewrittenCommand: rewritten
|
|
3388
3374
|
};
|
|
3389
3375
|
}
|
|
@@ -3412,6 +3398,5 @@ export {
|
|
|
3412
3398
|
isSafe,
|
|
3413
3399
|
processCodexPreToolUse,
|
|
3414
3400
|
rewritePaths,
|
|
3415
|
-
runVirtualShell,
|
|
3416
3401
|
touchesMemory
|
|
3417
3402
|
};
|
|
@@ -2322,11 +2322,17 @@ import { join as join10 } from "node:path";
|
|
|
2322
2322
|
var MEMORY_PATH = join10(homedir8(), ".deeplake", "memory");
|
|
2323
2323
|
var TILDE_PATH = "~/.deeplake/memory";
|
|
2324
2324
|
var HOME_VAR_PATH = "$HOME/.deeplake/memory";
|
|
2325
|
+
function escapeRe(s) {
|
|
2326
|
+
return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
2327
|
+
}
|
|
2328
|
+
var MEMORY_BOUNDARY = "(?![A-Za-z0-9._-])";
|
|
2329
|
+
var MEMORY_PREFIX_RE = new RegExp("(?:" + [MEMORY_PATH, TILDE_PATH, HOME_VAR_PATH].map(escapeRe).join("|") + ")" + MEMORY_BOUNDARY);
|
|
2325
2330
|
function touchesMemory(p) {
|
|
2326
|
-
return
|
|
2331
|
+
return MEMORY_PREFIX_RE.test(p);
|
|
2327
2332
|
}
|
|
2328
2333
|
function rewritePaths(cmd) {
|
|
2329
|
-
|
|
2334
|
+
const tail = "(?:\\/|" + MEMORY_BOUNDARY + ")";
|
|
2335
|
+
return cmd.replace(new RegExp(escapeRe(MEMORY_PATH) + tail, "g"), "/").replace(new RegExp(escapeRe(TILDE_PATH) + tail, "g"), "/").replace(new RegExp('"' + escapeRe(HOME_VAR_PATH) + tail + '"', "g"), '"/"').replace(new RegExp(escapeRe(HOME_VAR_PATH) + tail, "g"), "/");
|
|
2330
2336
|
}
|
|
2331
2337
|
|
|
2332
2338
|
// dist/src/hooks/cursor/pre-tool-use.js
|
|
@@ -2322,11 +2322,17 @@ import { join as join10 } from "node:path";
|
|
|
2322
2322
|
var MEMORY_PATH = join10(homedir8(), ".deeplake", "memory");
|
|
2323
2323
|
var TILDE_PATH = "~/.deeplake/memory";
|
|
2324
2324
|
var HOME_VAR_PATH = "$HOME/.deeplake/memory";
|
|
2325
|
+
function escapeRe(s) {
|
|
2326
|
+
return s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
2327
|
+
}
|
|
2328
|
+
var MEMORY_BOUNDARY = "(?![A-Za-z0-9._-])";
|
|
2329
|
+
var MEMORY_PREFIX_RE = new RegExp("(?:" + [MEMORY_PATH, TILDE_PATH, HOME_VAR_PATH].map(escapeRe).join("|") + ")" + MEMORY_BOUNDARY);
|
|
2325
2330
|
function touchesMemory(p) {
|
|
2326
|
-
return
|
|
2331
|
+
return MEMORY_PREFIX_RE.test(p);
|
|
2327
2332
|
}
|
|
2328
2333
|
function rewritePaths(cmd) {
|
|
2329
|
-
|
|
2334
|
+
const tail = "(?:\\/|" + MEMORY_BOUNDARY + ")";
|
|
2335
|
+
return cmd.replace(new RegExp(escapeRe(MEMORY_PATH) + tail, "g"), "/").replace(new RegExp(escapeRe(TILDE_PATH) + tail, "g"), "/").replace(new RegExp('"' + escapeRe(HOME_VAR_PATH) + tail + '"', "g"), '"/"').replace(new RegExp(escapeRe(HOME_VAR_PATH) + tail, "g"), "/");
|
|
2330
2336
|
}
|
|
2331
2337
|
|
|
2332
2338
|
// dist/src/hooks/hermes/pre-tool-use.js
|
package/openclaw/dist/index.js
CHANGED
|
@@ -1801,7 +1801,7 @@ function extractLatestVersion(body) {
|
|
|
1801
1801
|
return typeof v === "string" && v.length > 0 ? v : null;
|
|
1802
1802
|
}
|
|
1803
1803
|
function getInstalledVersion() {
|
|
1804
|
-
return "0.7.
|
|
1804
|
+
return "0.7.72".length > 0 ? "0.7.72" : null;
|
|
1805
1805
|
}
|
|
1806
1806
|
function isNewer(latest, current) {
|
|
1807
1807
|
const parse = (v) => v.replace(/-.*$/, "").split(".").map(Number);
|
package/openclaw/package.json
CHANGED