@use05/cli 0.0.6 → 0.0.8

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.
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/env node
2
+ // Runs a 05 binary for this machine: use05, or use05-cloud (named by this file). npm installs
3
+ // exactly one platform package, chosen by its "os" and "cpu" fields; this finds it and hands over
4
+ // arguments, stdio and the exit code.
5
+ "use strict";
6
+
7
+ const { spawnSync } = require("child_process");
8
+ const path = require("path");
9
+
10
+ const name = path.basename(__filename, ".js");
11
+
12
+ const pkg = `@use05/cli-${process.platform}-${process.arch}`;
13
+ let bin;
14
+ try {
15
+ bin = path.join(path.dirname(require.resolve(`${pkg}/package.json`)), "bin", name);
16
+ } catch {
17
+ const shipped = ["darwin-arm64", "darwin-x64", "linux-arm64", "linux-x64"].includes(`${process.platform}-${process.arch}`);
18
+ console.error(
19
+ shipped
20
+ ? `${name}: npm did not install ${pkg}, which holds the binary. Reinstall without --no-optional or --omit=optional.`
21
+ : `${name}: there is no binary for ${process.platform}-${process.arch}. 05 ships for macOS and Linux on x64 and arm64.`
22
+ );
23
+ process.exit(1);
24
+ }
25
+
26
+ const result = spawnSync(bin, process.argv.slice(2), { stdio: "inherit" });
27
+ if (result.error) {
28
+ console.error(`${name}: could not run ${bin}: ${result.error.message}`);
29
+ process.exit(1);
30
+ }
31
+ if (result.signal) {
32
+ process.kill(process.pid, result.signal);
33
+ }
34
+ process.exit(result.status ?? 1);
package/bin/use05.js CHANGED
@@ -1,28 +1,31 @@
1
1
  #!/usr/bin/env node
2
- // Runs the use05 binary for this machine. npm installs exactly one platform package, chosen by
3
- // its "os" and "cpu" fields; this finds it and hands over arguments, stdio and the exit code.
2
+ // Runs a 05 binary for this machine: use05, or use05-cloud (named by this file). npm installs
3
+ // exactly one platform package, chosen by its "os" and "cpu" fields; this finds it and hands over
4
+ // arguments, stdio and the exit code.
4
5
  "use strict";
5
6
 
6
7
  const { spawnSync } = require("child_process");
7
8
  const path = require("path");
8
9
 
10
+ const name = path.basename(__filename, ".js");
11
+
9
12
  const pkg = `@use05/cli-${process.platform}-${process.arch}`;
10
13
  let bin;
11
14
  try {
12
- bin = path.join(path.dirname(require.resolve(`${pkg}/package.json`)), "bin", "use05");
15
+ bin = path.join(path.dirname(require.resolve(`${pkg}/package.json`)), "bin", name);
13
16
  } catch {
14
17
  const shipped = ["darwin-arm64", "darwin-x64", "linux-arm64", "linux-x64"].includes(`${process.platform}-${process.arch}`);
15
18
  console.error(
16
19
  shipped
17
- ? `use05: npm did not install ${pkg}, which holds the binary. Reinstall without --no-optional or --omit=optional.`
18
- : `use05: there is no binary for ${process.platform}-${process.arch}. 05 ships for macOS and Linux on x64 and arm64.`
20
+ ? `${name}: npm did not install ${pkg}, which holds the binary. Reinstall without --no-optional or --omit=optional.`
21
+ : `${name}: there is no binary for ${process.platform}-${process.arch}. 05 ships for macOS and Linux on x64 and arm64.`
19
22
  );
20
23
  process.exit(1);
21
24
  }
22
25
 
23
26
  const result = spawnSync(bin, process.argv.slice(2), { stdio: "inherit" });
24
27
  if (result.error) {
25
- console.error(`use05: could not run ${bin}: ${result.error.message}`);
28
+ console.error(`${name}: could not run ${bin}: ${result.error.message}`);
26
29
  process.exit(1);
27
30
  }
28
31
  if (result.signal) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@use05/cli",
3
- "version": "0.0.6",
3
+ "version": "0.0.8",
4
4
  "description": "05: the acceptance layer for AI-written code. Prove and verify what agents did.",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://use05.dev",
@@ -9,19 +9,21 @@
9
9
  "url": "git+https://github.com/use05-dev/use05.git"
10
10
  },
11
11
  "bin": {
12
- "use05": "bin/use05.js"
12
+ "use05": "bin/use05.js",
13
+ "use05-cloud": "bin/use05-cloud.js"
13
14
  },
14
15
  "files": [
15
16
  "bin/use05.js",
17
+ "bin/use05-cloud.js",
16
18
  "README.md"
17
19
  ],
18
20
  "engines": {
19
21
  "node": ">=18"
20
22
  },
21
23
  "optionalDependencies": {
22
- "@use05/cli-darwin-arm64": "0.0.6",
23
- "@use05/cli-darwin-x64": "0.0.6",
24
- "@use05/cli-linux-arm64": "0.0.6",
25
- "@use05/cli-linux-x64": "0.0.6"
24
+ "@use05/cli-darwin-arm64": "0.0.8",
25
+ "@use05/cli-darwin-x64": "0.0.8",
26
+ "@use05/cli-linux-arm64": "0.0.8",
27
+ "@use05/cli-linux-x64": "0.0.8"
26
28
  }
27
29
  }