openagent-cli 1.0.8 → 1.0.10

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/openagent.js ADDED
@@ -0,0 +1,12 @@
1
+ #!/usr/bin/env node
2
+ const { spawn } = require("child_process")
3
+ const path = require("path")
4
+
5
+ const scriptDir = __dirname
6
+ const exe = path.join(scriptDir, "bin", "open-agent.exe")
7
+
8
+ const child = spawn(exe, process.argv.slice(2), { stdio: "inherit" })
9
+ child.on("exit", (code) => process.exit(code ?? 1))
10
+
11
+ process.on("SIGINT", () => child.kill("SIGINT"))
12
+ process.on("SIGTERM", () => child.kill("SIGTERM"))
package/package.json CHANGED
@@ -1,9 +1,7 @@
1
1
  {
2
2
  "name": "openagent-cli",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "description": "OpenAgent - AI coding agent. Run from any directory.",
5
- "bin": {
6
- "openagent": "bin/openagent.js"
7
- },
5
+ "bin": { "openagent": "openagent.js" },
8
6
  "license": "MIT"
9
7
  }
package/bin/openagent.js DELETED
@@ -1,34 +0,0 @@
1
- #!/usr/bin/env node
2
- const { spawn, execSync } = require("child_process")
3
- const path = require("path")
4
-
5
- const pkg = require("../package.json")
6
- const currentVersion = pkg.version
7
-
8
- const args = process.argv.slice(2)
9
- if (args.includes("--version") || args.includes("-v")) {
10
- console.log(currentVersion)
11
- process.exit(0)
12
- }
13
-
14
- const binDir = __dirname
15
- const exe = path.join(binDir, "open-agent.exe")
16
-
17
- let latest
18
- try {
19
- latest = execSync("npm view openagent-cli version", { timeout: 3000, encoding: "utf-8" }).trim()
20
- } catch {}
21
-
22
- const childArgs = [...args]
23
- if (!args.some(a => a.startsWith("--npm-version"))) {
24
- childArgs.unshift(`--npm-version=${currentVersion}`)
25
- }
26
- if (latest && latest !== currentVersion && !args.some(a => a.startsWith("--npm-update-available"))) {
27
- childArgs.unshift(`--npm-update-available=${latest}`)
28
- }
29
-
30
- const child = spawn(exe, childArgs, { stdio: "inherit" })
31
- child.on("exit", (code) => process.exit(code ?? 1))
32
-
33
- process.on("SIGINT", () => child.kill("SIGINT"))
34
- process.on("SIGTERM", () => child.kill("SIGTERM"))