agentrecap 0.0.1 → 0.5.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 CHANGED
@@ -1,10 +1,11 @@
1
1
  # agentrecap
2
2
 
3
- This npm package reserves the `agentrecap` name for the
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
- uvx agentrecap
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,86 @@
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(path.dirname(manifest), "bin", binaryName);
42
+ } catch {
43
+ console.error(
44
+ `agentrecap does not have an installed binary for ${platform}-${arch}${suffix}.`,
45
+ );
46
+ console.error(`Try installing ${packageName} manually.`);
47
+ process.exit(1);
48
+ }
49
+
50
+ if (!fs.existsSync(binary)) {
51
+ console.error(`The agentrecap binary is missing from ${packageName}.`);
52
+ process.exit(1);
53
+ }
54
+
55
+ const child = childProcess.spawn(binary, process.argv.slice(2), {
56
+ stdio: "inherit",
57
+ });
58
+
59
+ const signalHandlers = {};
60
+ for (const signal of ["SIGINT", "SIGTERM", "SIGHUP"]) {
61
+ signalHandlers[signal] = () => {
62
+ try {
63
+ child.kill(signal);
64
+ } catch {
65
+ // The child may already have exited.
66
+ }
67
+ };
68
+ process.on(signal, signalHandlers[signal]);
69
+ }
70
+
71
+ child.on("error", (error) => {
72
+ console.error(error.message);
73
+ process.exit(1);
74
+ });
75
+
76
+ child.on("exit", (code, signal) => {
77
+ for (const [forwardedSignal, handler] of Object.entries(signalHandlers)) {
78
+ process.removeListener(forwardedSignal, handler);
79
+ }
80
+
81
+ if (signal) {
82
+ process.kill(process.pid, signal);
83
+ return;
84
+ }
85
+ process.exit(code ?? 1);
86
+ });
package/package.json CHANGED
@@ -1,21 +1,29 @@
1
1
  {
2
2
  "name": "agentrecap",
3
- "version": "0.0.1",
4
- "description": "Name holder for the agentrecap Python package",
5
- "main": "index.js",
3
+ "version": "0.5.3",
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
- "index.js",
13
+ "bin",
8
14
  "README.md"
9
15
  ],
10
- "repository": {
11
- "type": "git",
12
- "url": "git+https://github.com/bansalarnav/agentrecap.git"
16
+ "engines": {
17
+ "node": ">=18"
13
18
  },
14
- "homepage": "https://github.com/bansalarnav/agentrecap#readme",
15
- "bugs": "https://github.com/bansalarnav/agentrecap/issues",
16
- "keywords": [
17
- "agentrecap",
18
- "codex",
19
- "claude-code"
20
- ]
19
+ "optionalDependencies": {
20
+ "agentrecap-darwin-arm64": "0.5.3",
21
+ "agentrecap-darwin-x64": "0.5.3",
22
+ "agentrecap-linux-arm64": "0.5.3",
23
+ "agentrecap-linux-x64": "0.5.3",
24
+ "agentrecap-linux-arm64-musl": "0.5.3",
25
+ "agentrecap-linux-x64-musl": "0.5.3",
26
+ "agentrecap-windows-arm64": "0.5.3",
27
+ "agentrecap-windows-x64": "0.5.3"
28
+ }
21
29
  }
package/index.js DELETED
@@ -1,4 +0,0 @@
1
- module.exports = {
2
- message: "agentrecap is a Python package. Run it with: uvx agentrecap",
3
- repository: "https://github.com/bansalarnav/agentrecap"
4
- };