memorizz 0.5.2 → 0.6.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/README.md CHANGED
@@ -11,6 +11,10 @@ developers. On `npm install -g memorizz` it:
11
11
 
12
12
  The `memorizz` command then execs the uv-installed CLI.
13
13
 
14
+ This includes `memorizz harness` for governing installed Codex, Claude Code,
15
+ OpenHands, and native MemAgent workers. The bootstrapper does not install those
16
+ vendor CLIs; inspect local readiness with `memorizz harness doctor`.
17
+
14
18
  ## First-class install paths
15
19
 
16
20
  If you already use Python tooling, prefer these:
package/bin/memorizz.js CHANGED
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  // Copyright (c) 2024 Richmond Alake. Licensed under PolyForm Noncommercial 1.0.0.
3
3
  //
4
- // Thin launcher: exec the uv-installed `memorizz`, forwarding argv/stdio/exit
5
- // code. Falls back to `uv tool run memorizz` when the launcher isn't yet on PATH
6
- // (e.g. a fresh shell after install, or a postinstall that failed soft).
4
+ // Thin launcher: exec the exact uv-installed `memorizz`, forwarding
5
+ // argv/stdio/exit code. Falls back to `uv tool run` with the pinned package
6
+ // specification when the managed binary is missing or stale.
7
7
  "use strict";
8
8
 
9
9
  const { spawnSync } = require("child_process");
@@ -12,6 +12,17 @@ const path = require("path");
12
12
  const fs = require("fs");
13
13
  const VERSION = require("../package.json").version;
14
14
  const PACKAGE_SPEC = `memorizz[mcp]==${VERSION}`;
15
+ const EXPECTED_VERSION = `memorizz ${VERSION}`;
16
+
17
+ function realpath(value) {
18
+ try {
19
+ return fs.realpathSync(value);
20
+ } catch (_) {
21
+ return path.resolve(value);
22
+ }
23
+ }
24
+
25
+ const LAUNCHER_PATH = realpath(__filename);
15
26
 
16
27
  function findExe(name) {
17
28
  const finder = process.platform === "win32" ? "where" : "which";
@@ -28,19 +39,52 @@ function findExe(name) {
28
39
  return null;
29
40
  }
30
41
 
42
+ function uvToolBinDir(uv) {
43
+ const result = spawnSync(uv, ["tool", "dir", "--bin"], {
44
+ encoding: "utf8",
45
+ });
46
+ if (result.status !== 0 || !result.stdout.trim()) return null;
47
+ return result.stdout.trim().split(/\r?\n/).pop();
48
+ }
49
+
50
+ function isExpectedCli(candidate) {
51
+ if (!candidate || !fs.existsSync(candidate)) return false;
52
+ if (realpath(candidate) === LAUNCHER_PATH) return false;
53
+ const result = spawnSync(candidate, ["--version"], { encoding: "utf8" });
54
+ return result.status === 0 && result.stdout.trim() === EXPECTED_VERSION;
55
+ }
56
+
57
+ function findUvManagedCli(uv) {
58
+ const binDir = uvToolBinDir(uv);
59
+ if (!binDir) return null;
60
+ const executable = process.platform === "win32" ? "memorizz.exe" : "memorizz";
61
+ const candidate = path.join(binDir, executable);
62
+ return isExpectedCli(candidate) ? candidate : null;
63
+ }
64
+
65
+ function findCompatibleCliOnPath() {
66
+ const executable = process.platform === "win32" ? "memorizz.exe" : "memorizz";
67
+ for (const directory of (process.env.PATH || "").split(path.delimiter)) {
68
+ if (!directory) continue;
69
+ const candidate = path.join(directory, executable);
70
+ if (isExpectedCli(candidate)) return candidate;
71
+ }
72
+ return null;
73
+ }
74
+
31
75
  const args = process.argv.slice(2);
32
- const exe = findExe("memorizz");
76
+ const uv = findExe("uv");
77
+ const exe = (uv && findUvManagedCli(uv)) || findCompatibleCliOnPath();
33
78
 
34
79
  let res;
35
80
  if (exe) {
36
81
  res = spawnSync(exe, args, { stdio: "inherit" });
37
82
  } else {
38
- const uv = findExe("uv");
39
83
  if (!uv) {
40
84
  process.stderr.write(
41
- "[memorizz] CLI not installed and uv not found.\n" +
85
+ `[memorizz] MemoRizz ${VERSION} is not installed and uv was not found.\n` +
42
86
  " Try: npm rebuild -g memorizz (re-runs the bootstrapper)\n" +
43
- " Or: uv tool install memorizz / pipx install memorizz\n"
87
+ ` Or: uv tool install '${PACKAGE_SPEC}'\n`
44
88
  );
45
89
  process.exit(127);
46
90
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "memorizz",
3
- "version": "0.5.2",
4
- "description": "npm bootstrapper for the memorizz Python CLI installs the real tool via uv.",
3
+ "version": "0.6.2",
4
+ "description": "npm bootstrapper for the memory-first Memorizz agent CLI and meta-harness.",
5
5
  "license": "PolyForm-Noncommercial-1.0.0",
6
6
  "homepage": "https://github.com/RichmondAlake/memorizz",
7
7
  "repository": {
@@ -9,16 +9,33 @@
9
9
  "url": "git+https://github.com/RichmondAlake/memorizz.git",
10
10
  "directory": "packaging/npm"
11
11
  },
12
- "keywords": ["memorizz", "ai", "agent", "cli", "memory", "llm", "ollama"],
12
+ "keywords": [
13
+ "memorizz",
14
+ "ai",
15
+ "agent",
16
+ "cli",
17
+ "memory",
18
+ "llm",
19
+ "metaharness",
20
+ "ollama"
21
+ ],
13
22
  "bin": {
14
23
  "memorizz": "bin/memorizz.js"
15
24
  },
16
25
  "scripts": {
17
26
  "postinstall": "node scripts/postinstall.js"
18
27
  },
19
- "files": ["bin/", "scripts/", "README.md"],
28
+ "files": [
29
+ "bin/",
30
+ "scripts/",
31
+ "README.md"
32
+ ],
20
33
  "engines": {
21
34
  "node": ">=16"
22
35
  },
23
- "os": ["darwin", "linux", "win32"]
36
+ "os": [
37
+ "darwin",
38
+ "linux",
39
+ "win32"
40
+ ]
24
41
  }