@corca-org/ceal 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/README.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @corca-org/ceal
2
2
 
3
- The Ceal command-line client for npm-supported platforms. The package installs the platform-specific, signed `ceal` binary and, on Linux, `cealctl`.
3
+ The Ceal user package for npm-supported platforms. It installs the platform-specific signed `ceal` client and the `ceal-host` lifecycle launcher. It does not install the administrator-only `cealctl` client.
4
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.
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. On macOS and Linux, diagnose an older `ceal` shadowing the npm installation by invoking the installed package directly first:
6
+
7
+ ```sh
8
+ CEAL_NPM_BIN="$(npm prefix -g)/bin"
9
+ "$CEAL_NPM_BIN/ceal" doctor
10
+ export PATH="$CEAL_NPM_BIN:$PATH"
11
+ hash -r
12
+ ceal version
13
+ ceal doctor
14
+ ceal-host version
15
+ ```
16
+
17
+ `ceal doctor` is read-only. Its `command_resolution` reports whether the shell resolves `ceal` and `ceal-host` from the installed package's bin directory.
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import { launch } from "./launch.js"; await launch({ meta: "ceal-host", product: "ceal-host", supported: ["linux-x64","linux-arm64","darwin-arm64","win32-x64"], binaryName: "ceal-host" });
package/bin/ceal.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import { launch } from "./launch.js"; await launch({ meta: "ceal", product: "ceal", supported: ["linux-x64", "linux-arm64", "darwin-arm64", "win32-x64"], binaryName: "ceal", companion: { packageName: "@corca-org/ceal-host", entry: "bin/ceal-host.js", env: "CEAL_HOST_LAUNCHER_PATH" } });
2
+ import { launch } from "./launch.js"; await launch({ meta: "ceal", product: "ceal", supported: ["linux-x64","linux-arm64","darwin-arm64","win32-x64"], binaryName: "ceal", companion: { entry: "ceal-host.js", env: "CEAL_HOST_LAUNCHER_PATH" } });
package/bin/launch.js CHANGED
@@ -8,6 +8,7 @@ import { createRequire } from "node:module";
8
8
  import { dirname, join } from "node:path";
9
9
  import { constants as osConstants } from "node:os";
10
10
  import { spawn } from "node:child_process";
11
+ import { fileURLToPath } from "node:url";
11
12
 
12
13
  const require = createRequire(import.meta.url);
13
14
 
@@ -24,12 +25,7 @@ export function launch(input) {
24
25
  const launcherPath = process.env.CEAL_LAUNCHER_PATH ?? process.argv[1] ?? null;
25
26
  let companionEnvironment = {};
26
27
  if (input.companion) {
27
- try {
28
- const root = dirname(require.resolve(`${input.companion.packageName}/package.json`));
29
- companionEnvironment[input.companion.env] = join(root, input.companion.entry);
30
- } catch {
31
- return refuse(input.product, `required package ${input.companion.packageName} is unavailable.`);
32
- }
28
+ companionEnvironment[input.companion.env] = join(dirname(fileURLToPath(import.meta.url)), input.companion.entry);
33
29
  }
34
30
  const child = spawn(join(packageRoot, "bin", executableName), process.argv.slice(2), {
35
31
  stdio: "inherit",
@@ -37,8 +33,7 @@ export function launch(input) {
37
33
  env: { ...process.env, ...companionEnvironment, ...(launcherPath === null ? {} : { CEAL_LAUNCHER_PATH: launcherPath }) },
38
34
  });
39
35
  child.once("error", (error) => {
40
- process.stderr.write(`${input.product}: could not start the platform binary: ${error.message}\n`);
41
- process.exit(1);
36
+ refuse(input.product, `could not start the platform binary: ${error.message}`);
42
37
  });
43
38
  child.once("exit", (code, signal) => {
44
39
  if (signal !== null && process.platform !== "win32") {
@@ -50,6 +45,17 @@ export function launch(input) {
50
45
  }
51
46
 
52
47
  function refuse(product, message) {
53
- process.stderr.write(`${product}: ${message}\n`);
54
- process.exit(1);
48
+ process.stdout.write(`${JSON.stringify(launcherRefusal(product, process.argv[2] ?? "", message))}\n`);
49
+ process.exitCode = 1;
50
+ }
51
+
52
+ export function launcherRefusal(product, command, message) {
53
+ if (product === "ceal-host") return { schema_version: "ceal.host_command_result.v1", command, ok: false, code: "launcher_unavailable", message };
54
+ return {
55
+ schema_version: `${product}.error.v1`,
56
+ ok: false,
57
+ status: "failure",
58
+ execution_started: false,
59
+ error: { schema_version: "ceal.operation_error.v1", code: "launcher_unavailable", message, next_action: "repair_local_installation", retryable: false },
60
+ };
55
61
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@corca-org/ceal",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "description": "The Ceal command-line client",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -9,16 +9,16 @@
9
9
  },
10
10
  "bin": {
11
11
  "ceal": "bin/ceal.js",
12
- "cealctl": "bin/cealctl.js"
12
+ "ceal-host": "bin/ceal-host.js"
13
13
  },
14
14
  "optionalDependencies": {
15
- "@corca-org/ceal-linux-x64": "1.0.8",
16
- "@corca-org/ceal-linux-arm64": "1.0.8",
17
- "@corca-org/ceal-darwin-arm64": "1.0.8",
18
- "@corca-org/ceal-win32-x64": "1.0.8"
15
+ "@corca-org/ceal-linux-x64": "1.0.10",
16
+ "@corca-org/ceal-linux-arm64": "1.0.10",
17
+ "@corca-org/ceal-darwin-arm64": "1.0.10",
18
+ "@corca-org/ceal-win32-x64": "1.0.10"
19
19
  },
20
20
  "dependencies": {
21
- "@corca-org/ceal-host": "1.0.8"
21
+ "@corca-org/ceal-host": "1.0.10"
22
22
  },
23
23
  "repository": {
24
24
  "type": "git",
package/bin/cealctl.js DELETED
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import { launch } from "./launch.js"; await launch({ meta: "ceal", product: "cealctl", supported: ["linux-x64", "linux-arm64"], binaryName: "cealctl" });