@sys9/tape9-cli 0.6.4-rc.0 → 0.7.0-darwin-x64

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,31 +1,19 @@
1
1
  # @sys9/tape9-cli
2
2
 
3
- `@sys9/tape9-cli` installs the `tape9` command.
3
+ Prefer `@sys9/cli`. It runs tape9 as `sys9 tape`.
4
4
 
5
- The published npm layout mirrors Codex: `@sys9/tape9-cli` is a lightweight Node launcher, and the native `tape9` binary arrives through one platform-specific optional dependency.
5
+ Install:
6
6
 
7
- Each machine downloads only its matching Linux/macOS `x64` or `arm64` binary package.
8
-
9
- ## Install
10
-
11
- ```bash
12
- npm install -g @sys9/tape9-cli
7
+ ```sh
8
+ npm install -g @sys9/cli
13
9
  # or
14
- bun add -g @sys9/tape9-cli
10
+ bun install -g @sys9/cli
15
11
  ```
16
12
 
17
- ## Supported platforms
13
+ Run:
18
14
 
19
- - Linux `x64`, `arm64`
20
- - macOS `x64`, `arm64`
21
-
22
- ## Release contract
15
+ ```sh
16
+ sys9 tape --help
17
+ ```
23
18
 
24
- - npm package version `X.Y.Z` publishes a lightweight root package plus four platform-specific optional dependency packages
25
- - the root package keeps the `tape9` launcher under `bin/tape9` and resolves the native binary from `@sys9/tape9-cli-<platform>`
26
- - each platform package ships exactly one prebuilt binary under `vendor/<goos>_<goarch>/tape9`
27
- - the source package is only a template; release tarballs must be staged with `python3 ./scripts/stage-npm-packages.py`
28
- - GitHub release tag `vX.Y.Z-tape9-cli` publishes matching standalone binaries and the staged npm tarballs
29
- - the tag release workflow requires the npm package to trust `sys9-ai/bricks` + `.github/workflows/tape9-release.yml` as a trusted publisher before the tag is pushed
30
- - if that package-side trust is repaired after a failed tag release, rerun the same `vX.Y.Z-tape9-cli` workflow run; it reuses the existing GitHub release and skips npm versions that were already published
31
- - the installed executable name is `tape9`
19
+ `@sys9/tape9-cli` remains the tape9 package used by `@sys9/cli`.
package/package.json CHANGED
@@ -1,30 +1,22 @@
1
1
  {
2
2
  "name": "@sys9/tape9-cli",
3
- "version": "0.6.4-rc.0",
4
- "description": "Install the tape9 CLI with platform-native npm packages for Linux and macOS",
3
+ "version": "0.7.0-darwin-x64",
4
+ "description": "tape9 CLI package used by @sys9/cli",
5
5
  "license": "UNLICENSED",
6
+ "os": [
7
+ "darwin"
8
+ ],
9
+ "cpu": [
10
+ "x64"
11
+ ],
12
+ "files": [
13
+ "vendor"
14
+ ],
6
15
  "repository": {
7
16
  "type": "git",
8
17
  "url": "git+https://github.com/sys9-ai/bricks.git"
9
18
  },
10
- "publishConfig": {
11
- "access": "public"
12
- },
13
- "bin": {
14
- "tape9": "bin/tape9"
15
- },
16
- "files": [
17
- "README.md",
18
- "bin",
19
- "lib"
20
- ],
21
19
  "engines": {
22
20
  "node": ">=16"
23
- },
24
- "optionalDependencies": {
25
- "@sys9/tape9-cli-linux-x64": "npm:@sys9/tape9-cli@0.6.4-rc.0-linux-x64",
26
- "@sys9/tape9-cli-linux-arm64": "npm:@sys9/tape9-cli@0.6.4-rc.0-linux-arm64",
27
- "@sys9/tape9-cli-darwin-x64": "npm:@sys9/tape9-cli@0.6.4-rc.0-darwin-x64",
28
- "@sys9/tape9-cli-darwin-arm64": "npm:@sys9/tape9-cli@0.6.4-rc.0-darwin-arm64"
29
21
  }
30
22
  }
Binary file
package/bin/tape9 DELETED
@@ -1,95 +0,0 @@
1
- #!/usr/bin/env node
2
-
3
- "use strict";
4
-
5
- const { spawn } = require("node:child_process");
6
- const { existsSync } = require("node:fs");
7
- const path = require("node:path");
8
-
9
- const packageJSON = require("../package.json");
10
- const {
11
- resolvePackagedBinaryPath,
12
- resolvePlatformPackageName,
13
- } = require("../lib/platform");
14
-
15
- function detectPackageManager() {
16
- const userAgent = process.env.npm_config_user_agent || "";
17
- if (/\bbun\//.test(userAgent)) {
18
- return "bun";
19
- }
20
-
21
- const execPath = process.env.npm_execpath || "";
22
- if (execPath.includes("bun")) {
23
- return "bun";
24
- }
25
-
26
- if (
27
- __dirname.includes(".bun/install/global") ||
28
- __dirname.includes(".bun\\install\\global")
29
- ) {
30
- return "bun";
31
- }
32
-
33
- return userAgent ? "npm" : null;
34
- }
35
-
36
- function resolveBinaryPath() {
37
- const platformPackage = resolvePlatformPackageName(packageJSON.name);
38
- try {
39
- const packageJSONPath = require.resolve(platformPackage + "/package.json");
40
- return {
41
- binaryPath: resolvePackagedBinaryPath(path.dirname(packageJSONPath)),
42
- platformPackage,
43
- };
44
- } catch {
45
- return {
46
- binaryPath: resolvePackagedBinaryPath(path.join(__dirname, "..")),
47
- platformPackage,
48
- };
49
- }
50
- }
51
-
52
- const { binaryPath, platformPackage } = resolveBinaryPath();
53
- if (!existsSync(binaryPath)) {
54
- const packageManager = detectPackageManager();
55
- const updateCommand =
56
- packageManager === "bun"
57
- ? "bun add -g @sys9/tape9-cli@latest"
58
- : "npm install -g @sys9/tape9-cli@latest";
59
- throw new Error(
60
- "Missing optional dependency " + platformPackage + ". Reinstall tape9: " + updateCommand,
61
- );
62
- }
63
-
64
- const child = spawn(binaryPath, process.argv.slice(2), {
65
- stdio: "inherit",
66
- env: process.env,
67
- });
68
-
69
- child.on("error", (error) => {
70
- console.error(error);
71
- process.exit(1);
72
- });
73
-
74
- const forwardSignal = (signal) => {
75
- if (child.killed) {
76
- return;
77
- }
78
- try {
79
- child.kill(signal);
80
- } catch {
81
- // Ignore failures while the child is already exiting.
82
- }
83
- };
84
-
85
- ["SIGINT", "SIGTERM", "SIGHUP"].forEach((signal) => {
86
- process.on(signal, () => forwardSignal(signal));
87
- });
88
-
89
- child.on("exit", (code, signal) => {
90
- if (signal) {
91
- process.kill(process.pid, signal);
92
- return;
93
- }
94
- process.exit(code ?? 1);
95
- });
package/lib/platform.js DELETED
@@ -1,60 +0,0 @@
1
- "use strict";
2
-
3
- const path = require("node:path");
4
-
5
- const SUPPORTED_TARGETS = [
6
- {
7
- slug: "linux-x64",
8
- os: "linux",
9
- cpu: "x64",
10
- vendorDir: "linux_amd64",
11
- targetTriple: "x86_64-unknown-linux-musl",
12
- },
13
- {
14
- slug: "linux-arm64",
15
- os: "linux",
16
- cpu: "arm64",
17
- vendorDir: "linux_arm64",
18
- targetTriple: "aarch64-unknown-linux-musl",
19
- },
20
- {
21
- slug: "darwin-x64",
22
- os: "darwin",
23
- cpu: "x64",
24
- vendorDir: "darwin_amd64",
25
- targetTriple: "x86_64-apple-darwin",
26
- },
27
- {
28
- slug: "darwin-arm64",
29
- os: "darwin",
30
- cpu: "arm64",
31
- vendorDir: "darwin_arm64",
32
- targetTriple: "aarch64-apple-darwin",
33
- }
34
- ];
35
-
36
- function resolveSupportedTarget(platform = process.platform, arch = process.arch) {
37
- for (const target of SUPPORTED_TARGETS) {
38
- if (target.os === platform && target.cpu === arch) {
39
- return target;
40
- }
41
- }
42
- throw new Error("unsupported platform: " + platform + " (" + arch + ")");
43
- }
44
-
45
- function resolvePackagedBinaryPath(rootDir, platform = process.platform, arch = process.arch) {
46
- const target = resolveSupportedTarget(platform, arch);
47
- return path.join(rootDir, "vendor", target.vendorDir, "tape9");
48
- }
49
-
50
- function resolvePlatformPackageName(rootPackageName, platform = process.platform, arch = process.arch) {
51
- const target = resolveSupportedTarget(platform, arch);
52
- return rootPackageName + "-" + target.slug;
53
- }
54
-
55
- module.exports = {
56
- SUPPORTED_TARGETS,
57
- resolvePackagedBinaryPath,
58
- resolvePlatformPackageName,
59
- resolveSupportedTarget,
60
- };