@corca-org/ceal 1.0.0
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 +5 -0
- package/bin/ceal.js +2 -0
- package/bin/cealctl.js +2 -0
- package/bin/launch.js +46 -0
- package/package.json +33 -0
package/README.md
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
# @corca-org/ceal
|
|
2
|
+
|
|
3
|
+
The Ceal command-line client for npm-supported platforms. The package installs the platform-specific, signed `ceal` binary and, on Linux, `cealctl`.
|
|
4
|
+
|
|
5
|
+
Install globally with `npm install -g @corca-org/ceal`. Use `npm update -g @corca-org/ceal` to update and `npm uninstall -g @corca-org/ceal` to remove it. Run `ceal doctor` to inspect the installed client without changing anything.
|
package/bin/ceal.js
ADDED
package/bin/cealctl.js
ADDED
package/bin/launch.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Meta-package bin/launch.js files are replaced with this module during
|
|
3
|
+
* assembly. The tracked bridge points here for source-tree development; the
|
|
4
|
+
* published copy is self-contained and never imports ../../shared/launch.js.
|
|
5
|
+
*/
|
|
6
|
+
import process from "node:process";
|
|
7
|
+
import { createRequire } from "node:module";
|
|
8
|
+
import { dirname, join } from "node:path";
|
|
9
|
+
import { constants as osConstants } from "node:os";
|
|
10
|
+
import { spawn } from "node:child_process";
|
|
11
|
+
|
|
12
|
+
const require = createRequire(import.meta.url);
|
|
13
|
+
|
|
14
|
+
export function launch(input) {
|
|
15
|
+
const platform = `${process.platform}-${process.arch === "x64" ? "x64" : process.arch}`;
|
|
16
|
+
if (!input.supported.includes(platform)) return refuse(input.product, `unsupported platform ${platform}; supported platforms: ${input.supported.join(", ")}.`);
|
|
17
|
+
let packageRoot;
|
|
18
|
+
try {
|
|
19
|
+
packageRoot = dirname(require.resolve(`@corca-org/${input.meta}-${platform}/package.json`));
|
|
20
|
+
} catch {
|
|
21
|
+
return refuse(input.product, `platform package @corca-org/${input.meta}-${platform} is unavailable for ${platform}; supported platforms: ${input.supported.join(", ")}.`);
|
|
22
|
+
}
|
|
23
|
+
const executableName = process.platform === "win32" ? `${input.binaryName}.exe` : input.binaryName;
|
|
24
|
+
const launcherPath = process.env.CEAL_LAUNCHER_PATH ?? process.argv[1] ?? null;
|
|
25
|
+
const child = spawn(join(packageRoot, "bin", executableName), process.argv.slice(2), {
|
|
26
|
+
stdio: "inherit",
|
|
27
|
+
windowsHide: process.platform === "win32" ? false : undefined,
|
|
28
|
+
env: { ...process.env, ...(launcherPath === null ? {} : { CEAL_LAUNCHER_PATH: launcherPath }) },
|
|
29
|
+
});
|
|
30
|
+
child.once("error", (error) => {
|
|
31
|
+
process.stderr.write(`${input.product}: could not start the platform binary: ${error.message}\n`);
|
|
32
|
+
process.exit(1);
|
|
33
|
+
});
|
|
34
|
+
child.once("exit", (code, signal) => {
|
|
35
|
+
if (signal !== null && process.platform !== "win32") {
|
|
36
|
+
process.kill(process.pid, signal);
|
|
37
|
+
process.exit(128 + (osConstants.signals[signal] ?? 1));
|
|
38
|
+
}
|
|
39
|
+
process.exit(code ?? 1);
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function refuse(product, message) {
|
|
44
|
+
process.stderr.write(`${product}: ${message}\n`);
|
|
45
|
+
process.exit(1);
|
|
46
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@corca-org/ceal",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "The Ceal command-line client",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": ">=22.19.0"
|
|
9
|
+
},
|
|
10
|
+
"bin": {
|
|
11
|
+
"ceal": "bin/ceal.js",
|
|
12
|
+
"cealctl": "bin/cealctl.js"
|
|
13
|
+
},
|
|
14
|
+
"optionalDependencies": {
|
|
15
|
+
"@corca-org/ceal-linux-x64": "1.0.0",
|
|
16
|
+
"@corca-org/ceal-linux-arm64": "1.0.0",
|
|
17
|
+
"@corca-org/ceal-darwin-arm64": "1.0.0",
|
|
18
|
+
"@corca-org/ceal-win32-x64": "1.0.0"
|
|
19
|
+
},
|
|
20
|
+
"publishConfig": {
|
|
21
|
+
"access": "public",
|
|
22
|
+
"provenance": true
|
|
23
|
+
},
|
|
24
|
+
"repository": {
|
|
25
|
+
"type": "git",
|
|
26
|
+
"url": "https://github.com/corca-ai/ceal.git"
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"bin",
|
|
30
|
+
"bin/launch.js",
|
|
31
|
+
"README.md"
|
|
32
|
+
]
|
|
33
|
+
}
|