@oxap/cli 0.0.0 → 0.1.0-alpha.34
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/bin/oxap.js +19 -0
- package/index.js +13 -0
- package/package.json +22 -6
- package/README.md +0 -10
package/bin/oxap.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
const { spawn } = require("node:child_process");
|
|
5
|
+
const { binaryPath } = require("../index.js");
|
|
6
|
+
|
|
7
|
+
const child = spawn(binaryPath(), process.argv.slice(2), { stdio: "inherit" });
|
|
8
|
+
const forwarded = ["SIGINT", "SIGTERM", "SIGHUP"];
|
|
9
|
+
const forward = (signal) => child.kill(signal);
|
|
10
|
+
for (const signal of forwarded) process.on(signal, forward);
|
|
11
|
+
|
|
12
|
+
child.on("error", (error) => {
|
|
13
|
+
throw error;
|
|
14
|
+
});
|
|
15
|
+
child.on("exit", (code, signal) => {
|
|
16
|
+
for (const name of forwarded) process.off(name, forward);
|
|
17
|
+
if (signal) process.kill(process.pid, signal);
|
|
18
|
+
else process.exit(code ?? 1);
|
|
19
|
+
});
|
package/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
function binaryPath() {
|
|
4
|
+
const target = `${process.platform}-${process.arch}`;
|
|
5
|
+
const binary = process.platform === "win32" ? "oxap.exe" : "oxap";
|
|
6
|
+
try {
|
|
7
|
+
return require.resolve(`@oxap/cli-${target}/bin/${binary}`);
|
|
8
|
+
} catch {
|
|
9
|
+
throw new Error(`@oxap/cli has no binary for ${target}: @oxap/cli-${target} is not installed`);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
module.exports = { binaryPath };
|
package/package.json
CHANGED
|
@@ -1,10 +1,26 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oxap/cli",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.1.0-alpha.34",
|
|
4
|
+
"description": "The oxap runtime, CLI and TUI",
|
|
5
|
+
"bin": {
|
|
6
|
+
"oxap": "bin/oxap.js"
|
|
7
|
+
},
|
|
8
|
+
"main": "index.js",
|
|
9
|
+
"files": [
|
|
10
|
+
"bin/",
|
|
11
|
+
"index.js"
|
|
12
|
+
],
|
|
13
|
+
"optionalDependencies": {
|
|
14
|
+
"@oxap/cli-darwin-arm64": "0.1.0-alpha.34",
|
|
15
|
+
"@oxap/cli-darwin-x64": "0.1.0-alpha.34",
|
|
16
|
+
"@oxap/cli-linux-arm64": "0.1.0-alpha.34",
|
|
17
|
+
"@oxap/cli-linux-x64": "0.1.0-alpha.34",
|
|
18
|
+
"@oxap/cli-win32-x64": "0.1.0-alpha.34",
|
|
19
|
+
"@oxap/cli-win32-arm64": "0.1.0-alpha.34"
|
|
20
|
+
},
|
|
21
|
+
"license": "ISC",
|
|
5
22
|
"repository": {
|
|
6
23
|
"type": "git",
|
|
7
|
-
"url": "
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
}
|
|
24
|
+
"url": "https://github.com/lsm/oxap"
|
|
25
|
+
}
|
|
26
|
+
}
|
package/README.md
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
# Placeholder
|
|
2
|
-
|
|
3
|
-
This package name is reserved for the Open Agent Protocol project (OXAP).
|
|
4
|
-
|
|
5
|
-
The first real release publishes here through npm Trusted Publishing from
|
|
6
|
-
https://github.com/lsm/oxap. Until then, install the prerelease directly:
|
|
7
|
-
|
|
8
|
-
npm install @oxap/cli@next
|
|
9
|
-
|
|
10
|
-
This 0.0.0 version is empty by design and ships no code.
|