pi-hermes-memory 0.8.0 → 0.8.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.
package/README.md CHANGED
@@ -92,6 +92,18 @@ Every write — memory and skills — passes through a scanner before being acce
92
92
 
93
93
  ![Security: Content Scanning](docs/images/security-flow.svg)
94
94
 
95
+ ## Development
96
+
97
+ `npm run check` and `npm test` only work from a **full git checkout** after `npm install`. The published npm package intentionally omits `tests/`, TypeScript, and `tsconfig.json` (production install for Pi). Validate from source or rely on CI before publish.
98
+
99
+ ```bash
100
+ git clone https://github.com/chandra447/pi-hermes-memory.git
101
+ cd pi-hermes-memory
102
+ npm install
103
+ npm run check
104
+ npm test
105
+ ```
106
+
95
107
  ## Installation
96
108
 
97
109
  ```bash
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "pi-hermes-memory",
3
- "version": "0.8.0",
3
+ "version": "0.8.1",
4
4
  "description": "🧠 Persistent memory + 🔍 session search + 🛡️ secret scanning for Pi. Token-aware policy-only memory by default, SQLite FTS5 search, auto-consolidation, procedural skills. 693 tests. Ported from Hermes agent.",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
7
7
  "files": [
8
8
  "src",
9
+ "scripts",
9
10
  "README.md",
10
11
  "LICENSE",
11
12
  "docs"
@@ -16,8 +17,8 @@
16
17
  ]
17
18
  },
18
19
  "scripts": {
19
- "check": "tsc --noEmit",
20
- "test": "tests/run-all.sh"
20
+ "check": "node scripts/ensure-dev.mjs check && tsc --noEmit",
21
+ "test": "node scripts/ensure-dev.mjs test && tests/run-all.sh"
21
22
  },
22
23
  "keywords": [
23
24
  "pi-package",
@@ -0,0 +1,57 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Guard for check/test npm scripts.
4
+ *
5
+ * The published tarball intentionally omits tests/ and TypeScript (devDependency).
6
+ * When those scripts are run from an installed package (e.g. after `pi install`),
7
+ * fail with a clear message instead of `tsc: not found` / `tests/run-all.sh: not found`.
8
+ *
9
+ * @see https://github.com/chandra447/pi-hermes-memory/issues/108
10
+ */
11
+ import { existsSync } from "node:fs";
12
+ import { createRequire } from "node:module";
13
+ import { dirname, join } from "node:path";
14
+ import { fileURLToPath } from "node:url";
15
+
16
+ const root = join(dirname(fileURLToPath(import.meta.url)), "..");
17
+ const mode = process.argv[2];
18
+ const REPO = "https://github.com/chandra447/pi-hermes-memory";
19
+
20
+ function fail(message) {
21
+ console.error(`\n[pi-hermes-memory] ${message}`);
22
+ console.error("");
23
+ console.error("These scripts only work from a full source checkout:");
24
+ console.error(` git clone ${REPO}.git`);
25
+ console.error(" cd pi-hermes-memory && npm install");
26
+ console.error(" npm run check # or: npm test");
27
+ console.error("");
28
+ console.error(
29
+ "The published package is for runtime use via Pi; CI validates check/test before publish.",
30
+ );
31
+ console.error("");
32
+ process.exit(1);
33
+ }
34
+
35
+ if (mode === "check") {
36
+ const require = createRequire(join(root, "package.json"));
37
+ try {
38
+ require.resolve("typescript/package.json");
39
+ } catch {
40
+ fail(
41
+ "`npm run check` requires TypeScript (a devDependency). The published npm package does not include it.",
42
+ );
43
+ }
44
+ if (!existsSync(join(root, "tsconfig.json"))) {
45
+ fail(
46
+ "`npm run check` requires tsconfig.json. The published npm package does not include it.",
47
+ );
48
+ }
49
+ } else if (mode === "test") {
50
+ if (!existsSync(join(root, "tests", "run-all.sh"))) {
51
+ fail(
52
+ "`npm test` requires the tests/ directory. The published npm package intentionally omits it.",
53
+ );
54
+ }
55
+ } else {
56
+ fail(`Unknown mode "${mode ?? ""}". Expected "check" or "test".`);
57
+ }