agentrecap 0.0.1 → 0.5.4
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 +6 -5
- package/bin/agentrecap.js +91 -0
- package/package.json +22 -14
- package/index.js +0 -4
package/README.md
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
# agentrecap
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
[agentrecap Python project](https://github.com/bansalarnav/agentrecap).
|
|
5
|
-
|
|
6
|
-
Run the actual tool with:
|
|
3
|
+
Generate a local, metadata-only HTML report from your Codex, Claude Code, and OpenCode sessions.
|
|
7
4
|
|
|
8
5
|
```bash
|
|
9
|
-
|
|
6
|
+
npx agentrecap
|
|
10
7
|
```
|
|
8
|
+
|
|
9
|
+
This npm package installs a standalone native executable. Python is not required.
|
|
10
|
+
|
|
11
|
+
For documentation and source code, see [github.com/bansalarnav/agentrecap](https://github.com/bansalarnav/agentrecap).
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const childProcess = require("node:child_process");
|
|
4
|
+
const fs = require("node:fs");
|
|
5
|
+
const os = require("node:os");
|
|
6
|
+
const path = require("node:path");
|
|
7
|
+
|
|
8
|
+
const platform = os.platform();
|
|
9
|
+
const arch = os.arch();
|
|
10
|
+
|
|
11
|
+
function isMusl() {
|
|
12
|
+
if (platform !== "linux") {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const report = process.report?.getReport();
|
|
17
|
+
if (report?.header?.glibcVersionRuntime) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
try {
|
|
22
|
+
const result = childProcess.spawnSync("ldd", ["--version"], {
|
|
23
|
+
encoding: "utf8",
|
|
24
|
+
});
|
|
25
|
+
return `${result.stdout || ""}${result.stderr || ""}`
|
|
26
|
+
.toLowerCase()
|
|
27
|
+
.includes("musl");
|
|
28
|
+
} catch {
|
|
29
|
+
return true;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
const suffix = platform === "linux" && isMusl() ? "-musl" : "";
|
|
34
|
+
const packagePlatform = platform === "win32" ? "windows" : platform;
|
|
35
|
+
const packageName = `agentrecap-${packagePlatform}-${arch}${suffix}`;
|
|
36
|
+
const binaryName = platform === "win32" ? "agentrecap.exe" : "agentrecap";
|
|
37
|
+
|
|
38
|
+
let binary;
|
|
39
|
+
try {
|
|
40
|
+
const manifest = require.resolve(`${packageName}/package.json`);
|
|
41
|
+
binary = path.join(
|
|
42
|
+
path.dirname(manifest),
|
|
43
|
+
"bin",
|
|
44
|
+
"agentrecap",
|
|
45
|
+
binaryName,
|
|
46
|
+
);
|
|
47
|
+
} catch {
|
|
48
|
+
console.error(
|
|
49
|
+
`agentrecap does not have an installed binary for ${platform}-${arch}${suffix}.`,
|
|
50
|
+
);
|
|
51
|
+
console.error(`Try installing ${packageName} manually.`);
|
|
52
|
+
process.exit(1);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
if (!fs.existsSync(binary)) {
|
|
56
|
+
console.error(`The agentrecap binary is missing from ${packageName}.`);
|
|
57
|
+
process.exit(1);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const child = childProcess.spawn(binary, process.argv.slice(2), {
|
|
61
|
+
stdio: "inherit",
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
const signalHandlers = {};
|
|
65
|
+
for (const signal of ["SIGINT", "SIGTERM", "SIGHUP"]) {
|
|
66
|
+
signalHandlers[signal] = () => {
|
|
67
|
+
try {
|
|
68
|
+
child.kill(signal);
|
|
69
|
+
} catch {
|
|
70
|
+
// The child may already have exited.
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
process.on(signal, signalHandlers[signal]);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
child.on("error", (error) => {
|
|
77
|
+
console.error(error.message);
|
|
78
|
+
process.exit(1);
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
child.on("exit", (code, signal) => {
|
|
82
|
+
for (const [forwardedSignal, handler] of Object.entries(signalHandlers)) {
|
|
83
|
+
process.removeListener(forwardedSignal, handler);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
if (signal) {
|
|
87
|
+
process.kill(process.pid, signal);
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
process.exit(code ?? 1);
|
|
91
|
+
});
|
package/package.json
CHANGED
|
@@ -1,21 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentrecap",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"description": "
|
|
5
|
-
"
|
|
3
|
+
"version": "0.5.4",
|
|
4
|
+
"description": "Analyze local Codex, Claude Code, and OpenCode sessions",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/bansalarnav/agentrecap"
|
|
8
|
+
},
|
|
9
|
+
"bin": {
|
|
10
|
+
"agentrecap": "./bin/agentrecap.js"
|
|
11
|
+
},
|
|
6
12
|
"files": [
|
|
7
|
-
"
|
|
13
|
+
"bin",
|
|
8
14
|
"README.md"
|
|
9
15
|
],
|
|
10
|
-
"
|
|
11
|
-
"
|
|
12
|
-
"url": "git+https://github.com/bansalarnav/agentrecap.git"
|
|
16
|
+
"engines": {
|
|
17
|
+
"node": ">=18"
|
|
13
18
|
},
|
|
14
|
-
"
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
"agentrecap",
|
|
18
|
-
"
|
|
19
|
-
"
|
|
20
|
-
|
|
19
|
+
"optionalDependencies": {
|
|
20
|
+
"agentrecap-darwin-arm64": "0.5.4",
|
|
21
|
+
"agentrecap-darwin-x64": "0.5.4",
|
|
22
|
+
"agentrecap-linux-arm64": "0.5.4",
|
|
23
|
+
"agentrecap-linux-x64": "0.5.4",
|
|
24
|
+
"agentrecap-linux-arm64-musl": "0.5.4",
|
|
25
|
+
"agentrecap-linux-x64-musl": "0.5.4",
|
|
26
|
+
"agentrecap-windows-arm64": "0.5.4",
|
|
27
|
+
"agentrecap-windows-x64": "0.5.4"
|
|
28
|
+
}
|
|
21
29
|
}
|
package/index.js
DELETED