engrm 0.4.0 → 0.4.3
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 +49 -5
- package/dist/cli.js +288 -28
- package/dist/hooks/codex-stop.js +62 -0
- package/dist/hooks/elicitation-result.js +1690 -1637
- package/dist/hooks/post-tool-use.js +326 -231
- package/dist/hooks/pre-compact.js +410 -78
- package/dist/hooks/sentinel.js +150 -103
- package/dist/hooks/session-start.js +2311 -1983
- package/dist/hooks/stop.js +302 -147
- package/dist/server.js +634 -118
- package/package.json +6 -5
- package/bin/build.mjs +0 -97
- package/bin/engrm.mjs +0 -13
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "engrm",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3",
|
|
4
4
|
"description": "Cross-device, team-shared memory layer for AI coding agents",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/server.js",
|
|
@@ -8,11 +8,9 @@
|
|
|
8
8
|
"engrm": "dist/cli.js"
|
|
9
9
|
},
|
|
10
10
|
"files": [
|
|
11
|
-
"bin/",
|
|
12
11
|
"dist/",
|
|
13
12
|
"packs/",
|
|
14
|
-
"LICENSE"
|
|
15
|
-
"LICENSE-SENTINEL"
|
|
13
|
+
"LICENSE"
|
|
16
14
|
],
|
|
17
15
|
"scripts": {
|
|
18
16
|
"start": "bun run src/server.ts",
|
|
@@ -50,10 +48,13 @@
|
|
|
50
48
|
"typescript": "^5.8.3"
|
|
51
49
|
},
|
|
52
50
|
"homepage": "https://engrm.dev",
|
|
51
|
+
"bugs": {
|
|
52
|
+
"url": "https://github.com/dr12hes/engrm/issues"
|
|
53
|
+
},
|
|
53
54
|
"license": "FSL-1.1-ALv2",
|
|
54
55
|
"author": "Engrm <hello@engrm.dev> (https://engrm.dev)",
|
|
55
56
|
"repository": {
|
|
56
57
|
"type": "git",
|
|
57
|
-
"url": "https://github.com/
|
|
58
|
+
"url": "https://github.com/dr12hes/engrm.git"
|
|
58
59
|
}
|
|
59
60
|
}
|
package/bin/build.mjs
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bun
|
|
2
|
-
/**
|
|
3
|
-
* Build script — compiles TypeScript to Node.js-compatible JavaScript.
|
|
4
|
-
*
|
|
5
|
-
* Uses Bun's bundler to produce self-contained .js files that run on Node.js.
|
|
6
|
-
* Output goes to dist/ and is what gets published to npm.
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
import { rmSync, mkdirSync, copyFileSync, writeFileSync } from "node:fs";
|
|
10
|
-
import { join, dirname } from "node:path";
|
|
11
|
-
import { fileURLToPath } from "node:url";
|
|
12
|
-
|
|
13
|
-
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
14
|
-
const root = join(__dirname, "..");
|
|
15
|
-
const dist = join(root, "dist");
|
|
16
|
-
|
|
17
|
-
// Clean
|
|
18
|
-
rmSync(dist, { recursive: true, force: true });
|
|
19
|
-
mkdirSync(dist, { recursive: true });
|
|
20
|
-
mkdirSync(join(dist, "hooks"), { recursive: true });
|
|
21
|
-
|
|
22
|
-
console.log("Building Engrm for Node.js...\n");
|
|
23
|
-
|
|
24
|
-
// Build CLI + MCP server
|
|
25
|
-
const mainResult = await Bun.build({
|
|
26
|
-
entrypoints: [
|
|
27
|
-
join(root, "src/cli.ts"),
|
|
28
|
-
join(root, "src/server.ts"),
|
|
29
|
-
],
|
|
30
|
-
outdir: dist,
|
|
31
|
-
target: "node",
|
|
32
|
-
format: "esm",
|
|
33
|
-
external: [
|
|
34
|
-
"better-sqlite3",
|
|
35
|
-
"sqlite-vec",
|
|
36
|
-
"@xenova/transformers",
|
|
37
|
-
"@modelcontextprotocol/sdk",
|
|
38
|
-
"@anthropic-ai/claude-agent-sdk",
|
|
39
|
-
],
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
if (!mainResult.success) {
|
|
43
|
-
console.error("Build failed (main):");
|
|
44
|
-
for (const msg of mainResult.logs) console.error(msg);
|
|
45
|
-
process.exit(1);
|
|
46
|
-
}
|
|
47
|
-
console.log(" dist/cli.js");
|
|
48
|
-
console.log(" dist/server.js");
|
|
49
|
-
|
|
50
|
-
// Build hooks
|
|
51
|
-
const hookResult = await Bun.build({
|
|
52
|
-
entrypoints: [
|
|
53
|
-
join(root, "hooks/session-start.ts"),
|
|
54
|
-
join(root, "hooks/pre-compact.ts"),
|
|
55
|
-
join(root, "hooks/post-tool-use.ts"),
|
|
56
|
-
join(root, "hooks/stop.ts"),
|
|
57
|
-
join(root, "hooks/sentinel.ts"),
|
|
58
|
-
join(root, "hooks/elicitation-result.ts"),
|
|
59
|
-
],
|
|
60
|
-
outdir: join(dist, "hooks"),
|
|
61
|
-
target: "node",
|
|
62
|
-
format: "esm",
|
|
63
|
-
external: [
|
|
64
|
-
"better-sqlite3",
|
|
65
|
-
"sqlite-vec",
|
|
66
|
-
"@xenova/transformers",
|
|
67
|
-
"@modelcontextprotocol/sdk",
|
|
68
|
-
"@anthropic-ai/claude-agent-sdk",
|
|
69
|
-
],
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
if (!hookResult.success) {
|
|
73
|
-
console.error("Build failed (hooks):");
|
|
74
|
-
for (const msg of hookResult.logs) console.error(msg);
|
|
75
|
-
process.exit(1);
|
|
76
|
-
}
|
|
77
|
-
console.log(" dist/hooks/session-start.js");
|
|
78
|
-
console.log(" dist/hooks/pre-compact.js");
|
|
79
|
-
console.log(" dist/hooks/post-tool-use.js");
|
|
80
|
-
console.log(" dist/hooks/stop.js");
|
|
81
|
-
console.log(" dist/hooks/sentinel.js");
|
|
82
|
-
console.log(" dist/hooks/elicitation-result.js");
|
|
83
|
-
|
|
84
|
-
// Add Node.js shebang to CLI and hooks (strip any existing shebangs first)
|
|
85
|
-
async function addShebang(filePath) {
|
|
86
|
-
const raw = await Bun.file(filePath).text();
|
|
87
|
-
const stripped = raw.replace(/^#!.*\n/gm, "");
|
|
88
|
-
writeFileSync(filePath, `#!/usr/bin/env node\n${stripped}`);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
await addShebang(join(dist, "cli.js"));
|
|
92
|
-
await addShebang(join(dist, "server.js"));
|
|
93
|
-
for (const hook of ["session-start", "pre-compact", "post-tool-use", "stop", "sentinel", "elicitation-result"]) {
|
|
94
|
-
await addShebang(join(dist, "hooks", `${hook}.js`));
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
console.log("\nBuild complete.");
|
package/bin/engrm.mjs
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* Engrm CLI entry point for npm/npx.
|
|
4
|
-
* Runs the pre-built dist/cli.js on Node.js — no Bun required.
|
|
5
|
-
*/
|
|
6
|
-
import { fileURLToPath } from "node:url";
|
|
7
|
-
import { dirname, join } from "node:path";
|
|
8
|
-
|
|
9
|
-
const __filename = fileURLToPath(import.meta.url);
|
|
10
|
-
const __dirname = dirname(__filename);
|
|
11
|
-
|
|
12
|
-
// Import and run the built CLI
|
|
13
|
-
await import(join(__dirname, "..", "dist", "cli.js"));
|