@guiho/runx 0.2.6 → 0.4.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.
Files changed (92) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/DOCS.md +128 -109
  3. package/README.md +58 -58
  4. package/devops/build-binaries.ts +44 -62
  5. package/devops/devops.xdocs.md +8 -5
  6. package/devops/install.ps1 +182 -152
  7. package/devops/install.sh +197 -262
  8. package/devops/installers.spec.ts +31 -0
  9. package/devops/verify-release-assets.ts +17 -0
  10. package/docs/decisions/decisions.xdocs.md +4 -0
  11. package/docs/decisions/interactive-init-manifest.md +187 -0
  12. package/docs/docs.xdocs.md +3 -1
  13. package/docs/plans/interactive-init-manifest.md +177 -0
  14. package/docs/plans/plans.xdocs.md +11 -0
  15. package/docs/plans/rfc-0034-cli-compliance-migration.md +586 -0
  16. package/docs/plans/upgrade-reliability-implementation.md +95 -0
  17. package/docs/reviews/implementation/implementation.xdocs.md +6 -0
  18. package/docs/reviews/implementation/interactive-init-manifest-review.md +69 -0
  19. package/docs/reviews/implementation/rfc-0034-cli-compliance-migration-review.md +59 -0
  20. package/docs/reviews/plans/interactive-init-manifest-review.md +82 -0
  21. package/docs/reviews/plans/plans.xdocs.md +10 -0
  22. package/docs/reviews/plans/rfc-0034-cli-compliance-migration-review.md +80 -0
  23. package/docs/reviews/plans/upgrade-reliability-implementation-review.md +65 -0
  24. package/docs/superpowers/specs/2026-07-15-upgrade-reliability-design.md +662 -0
  25. package/docs/superpowers/specs/specs.xdocs.md +24 -0
  26. package/docs/superpowers/superpowers.xdocs.md +21 -0
  27. package/docs/todo/rfc-0034-cli-compliance-migration-implementation.md +58 -0
  28. package/docs/todo/rfc-0034-cli-compliance-migration.md +151 -0
  29. package/docs/todo/todo.xdocs.md +6 -2
  30. package/docs/validation/interactive-init-manifest.md +79 -0
  31. package/docs/validation/rfc-0034-cli-compliance-migration.md +67 -0
  32. package/docs/validation/upgrade-reliability.md +124 -0
  33. package/docs/validation/validation.xdocs.md +9 -0
  34. package/library/agents.d.ts +28 -4
  35. package/library/agents.d.ts.map +1 -1
  36. package/library/agents.js +143 -41
  37. package/library/cli.d.ts.map +1 -1
  38. package/library/cli.js +297 -317
  39. package/library/configuration.d.ts +57 -0
  40. package/library/configuration.d.ts.map +1 -0
  41. package/library/configuration.js +111 -0
  42. package/library/embedded-resources.d.ts +6 -1
  43. package/library/embedded-resources.d.ts.map +1 -1
  44. package/library/embedded-resources.js +10 -4
  45. package/library/executor.d.ts +5 -1
  46. package/library/executor.d.ts.map +1 -1
  47. package/library/executor.js +10 -10
  48. package/library/help.d.ts +8 -4
  49. package/library/help.d.ts.map +1 -1
  50. package/library/help.js +70 -42
  51. package/library/init.d.ts +18 -0
  52. package/library/init.d.ts.map +1 -0
  53. package/library/init.js +43 -0
  54. package/library/manifest.d.ts +4 -40
  55. package/library/manifest.d.ts.map +1 -1
  56. package/library/manifest.js +4 -112
  57. package/library/path-utils.d.ts +13 -0
  58. package/library/path-utils.d.ts.map +1 -0
  59. package/library/path-utils.js +82 -0
  60. package/library/recovery.d.ts +7 -0
  61. package/library/recovery.d.ts.map +1 -0
  62. package/library/recovery.js +23 -0
  63. package/library/release-catalog.d.ts +32 -0
  64. package/library/release-catalog.d.ts.map +1 -0
  65. package/library/release-catalog.js +124 -0
  66. package/library/self-management.d.ts +24 -4
  67. package/library/self-management.d.ts.map +1 -1
  68. package/library/self-management.js +279 -99
  69. package/library/storage.d.ts +13 -0
  70. package/library/storage.d.ts.map +1 -0
  71. package/library/storage.js +38 -0
  72. package/library/types.d.ts +11 -16
  73. package/library/types.d.ts.map +1 -1
  74. package/library/types.js +3 -0
  75. package/library/update-cache.d.ts +21 -0
  76. package/library/update-cache.d.ts.map +1 -0
  77. package/library/update-cache.js +68 -0
  78. package/library/upgrade-reporting.d.ts +11 -0
  79. package/library/upgrade-reporting.d.ts.map +1 -0
  80. package/library/upgrade-reporting.js +67 -0
  81. package/library/upgrade-types.d.ts +72 -0
  82. package/library/upgrade-types.d.ts.map +1 -0
  83. package/library/upgrade-types.js +3 -0
  84. package/package.json +6 -3
  85. package/scripts/runx-bin.mjs +49 -0
  86. package/scripts/runx-bin.spec.ts +62 -0
  87. package/scripts/scripts.xdocs.md +3 -3
  88. package/skills/guiho-s-runx/SKILL.md +64 -59
  89. package/skills/guiho-s-runx/guiho-s-runx.xdocs.md +7 -4
  90. package/skills/skills.xdocs.md +1 -1
  91. package/docs/todo/implement-runx-alpha.md +0 -36
  92. package/scripts/runx-bin.ts +0 -24
package/CHANGELOG.md CHANGED
@@ -15,6 +15,50 @@ owner: runx
15
15
 
16
16
  # Changelog
17
17
 
18
+ ## 0.4.0 - 2026-07-18
19
+
20
+ ### Added
21
+
22
+ - Added complete Developer Context help, the singular agent skill/instruction/prompt namespace, a detached TypeBox-validated update cache, and the canonical `guiho-i-runx` prompt.
23
+ - Added a Node-compatible npm bootstrap, complete dual-tool direct installers, and exact verification for twelve native binaries plus two agent assets.
24
+
25
+ ### Changed
26
+
27
+ - Rebuilt RunX around the complete RFC 0034 Bun, strict ESM TypeScript, raw Citty, and TypeBox contract.
28
+ - Configuration now resolves only through `--config`, effective-cwd `runx.yaml`, then `~/.guiho/runx/runx.yaml`.
29
+ - The startup banner, help modes, output streams, exit codes, upgrade catalog, release names, bundled skill, documentation, and workflows now follow the canonical RFC contract.
30
+
31
+ ### Removed
32
+
33
+ - Removed the run command alias, root selector shorthand, `--file`, parent-directory discovery, plural agent namespace, arbitrary short flags, legacy platform asset names, and Bun-dependent npm launcher.
34
+
35
+ ## 0.3.0 - 2026-07-18
36
+
37
+ ### Added
38
+
39
+ - Added transactional executable replacement and automatic rollback for both Windows and POSIX updates with a bounded 10-second verification timeout.
40
+ - Added a complete GitHub release catalog parser that paginates all releases and implements SemVer prerelease precedence.
41
+ - Added structured JSON progress events and equivalent console phase reporting.
42
+ - Added exact-version recovery commands and process-stop commands to every upgrade outcome.
43
+ - Added hardened direct installers (`install.ps1`/`install.sh`) that verify the installed version and support rollback.
44
+
45
+ ## 0.2.7 - 2026-07-15
46
+
47
+ ### Added
48
+
49
+ - Added an interactive `runx init` command that collects the project name and
50
+ scripts directory, previews the generated catalog, and confirms before writing.
51
+ - Added safe cancellation and explicit overwrite confirmation so initialization
52
+ never leaves a partial manifest or replaces an existing catalog silently.
53
+
54
+ ### Changed
55
+
56
+ - Initialized catalogs now use the SemVer-compatible manifest version `1.0.0`,
57
+ configure `scripts.directory`, include the required `public` group, and begin
58
+ with an empty command list.
59
+ - `runx init` creates only `runx.yaml`; the configured `scripts` directory is
60
+ created later with the first real script.
61
+
18
62
  ## 0.2.6 - 2026-07-14
19
63
 
20
64
  ### Added
package/DOCS.md CHANGED
@@ -1,136 +1,155 @@
1
1
  ---
2
2
  name: RunX Documentation
3
- purpose: Provide the canonical user-facing RunX CLI and manifest reference.
4
- description: Documents command behavior, manifest schema, safety model, agent workflow, and native distribution.
3
+ purpose: Define the canonical supported RunX CLI contract.
4
+ description: Complete reference for command routing, YAML configuration, startup, help, output, agents, upgrades, installation, and release assets.
5
5
  created: 2026-07-12
6
- flags: []
6
+ flags:
7
+ - canonical
7
8
  tags:
8
- - documentation
9
9
  - cli
10
+ - reference
10
11
  keywords:
11
- - runx
12
- - manifest
12
+ - RFC 0034
13
+ - runx.yaml
14
+ - agent namespace
15
+ - release assets
13
16
  owner: runx
14
17
  ---
15
18
 
16
19
  # RunX Documentation
17
20
 
18
- ## Purpose
19
-
20
- RunX makes project operations visible and documented. A `runx.yaml` file is a
21
- single local command catalog; RunX discovers the nearest catalog, validates it,
22
- lists its commands, and runs exactly one selected command.
23
-
24
- ## Commands
25
-
26
- | Command | Purpose |
27
- | --- | --- |
28
- | `runx` | Show the home page and usage without loading a manifest. |
29
- | `runx -h`, `runx --help` | Show Citty-generated usage without loading a manifest. Append help to a command for command-specific usage. |
30
- | `runx -v`, `runx --version` | Show the installed version without loading a manifest. |
31
- | `runx list` | List all manifest commands. Add `--format json` for structured output. |
32
- | `runx describe <selector>` | Show one command's description and operational metadata. |
33
- | `runx check` | Validate discovery and the manifest without execution. |
34
- | `runx run <selector>` | Execute a selected command. |
35
- | `runx r <selector>` | Short alias for `runx run`. |
36
- | `runx <selector>` | Human shorthand for `runx run <selector>` when no built-in name conflicts. |
37
- | `runx agents install <local|global>` | Install `guiho-s-runx`; add `--tool agents|claude|all` when needed. |
38
- | `runx agents instructions` | Add or refresh the managed RunX section in `AGENTS.md`. |
39
- | `runx upgrade` | Replace a native installed executable when a newer release is available. |
40
- | `runx upgrade check` | Check whether a newer release is available. |
41
- | `runx upgrade list` | List recent release versions. |
42
- | `runx uninstall [--dry-run]` | Remove a native installed executable. |
43
-
44
- Global flags: `--cwd <path>`, `--file <path>`, `--format <text|json>`,
45
- `--verbose`, `-v`/`--version`, `-h`/`--help`, `--help-tree`, and
46
- `--help-docs`. Applicable command flags include `--dry-run`, `--yes`, and
47
- `--tool <agents|claude|all>`. Options may appear before or after their command.
48
- Unknown options and missing required arguments produce command usage instead
49
- of falling through to manifest discovery.
50
-
51
- Citty is the CLI parser, command router, alias registry, and ordinary usage
52
- renderer. RunX keeps its home page, extended command tree, and manifest guide
53
- as the explicit `runx`, `--help-tree`, and `--help-docs` surfaces.
54
-
55
- ## Manifest
56
-
57
- RunX searches upward from the current directory for `runx.yaml`. Use `--file`
58
- to select an explicit manifest. RunX does not merge files.
59
-
60
- ```yaml
61
- version: 1
62
- project:
63
- name: example
64
- groups:
65
- development:
66
- summary: Local development work.
67
- release:
68
- summary: Explicit release actions.
69
- commands:
70
- - uid: example-check
71
- id: check
72
- group: development
73
- summary: Type-check the project.
74
- description: Runs the project's static type checker without emitting build files.
75
- command: bun run typecheck
76
- cwd: .
77
- shell: auto
78
- tags: [validation]
79
- - uid: example-release
80
- id: release
81
- group: release
82
- summary: Build the release artifact.
83
- description: Builds the release artifact after the project has passed its required checks.
84
- command: bun run build
85
- confirm: always
21
+ ## Runtime Contract
22
+
23
+ RunX uses Bun, strict ESM TypeScript, raw Citty, and TypeBox. Core source is
24
+ Bun-only. The isolated npm bootstrap is Node-compatible because it must work
25
+ before Bun is installed.
26
+
27
+ No arguments prints exactly:
28
+
29
+ ```text
30
+ Hello Windows - runx v<version>
31
+ ```
32
+
33
+ The foreground reads `~/.guiho/runx/cache.json` and never waits for network
34
+ work. A detached worker validates GitHub release data and atomically refreshes
35
+ that cache. When a decoded cache announces an update, RunX prints:
36
+
37
+ ```text
38
+ New version available. Run this command to upgrade: runx upgrade
86
39
  ```
87
40
 
88
- Required fields are `uid`, `id`, `group`, `summary`, `description`, and
89
- `command`. `uid` and `id` begin with a lowercase letter and use lowercase
90
- letters, digits, and hyphens. `uid` is globally unique; the group and ID pair
91
- is also unique.
41
+ ## Configuration
42
+
43
+ RunX loads YAML only. Resolution is:
44
+
45
+ 1. `--config <path>`;
46
+ 2. `<effective-cwd>/runx.yaml`;
47
+ 3. `~/.guiho/runx/runx.yaml`.
48
+
49
+ Whenever loaded, the absolute path is reported as:
50
+
51
+ ```text
52
+ configuration file loaded: <absolute-path>
53
+ ```
54
+
55
+ The complete manifest and nested records are TypeBox-decoded. Invalid or absent
56
+ configuration exits `3`.
57
+
58
+ ## Commands And Help
92
59
 
93
- Optional fields are `cwd`, `shell`, `tags`, and `confirm`. `cwd` is relative to
94
- the manifest and cannot escape its directory. Shell values are `auto`, `bash`,
95
- `sh`, `powershell`, and `cmd`. Confirmation values are `never` and `always`.
60
+ The public command tree is the catalog shown in [README.md](README.md). Citty is
61
+ the only parser and router. The only short flags are `-h` and root `-v`.
96
62
 
97
- ## Selectors and Safety
63
+ Every root, group, and leaf supports:
98
64
 
99
- RunX resolves selectors in this order: exact UID, exact `group/id`, one-based
100
- manifest index, then an unambiguous bare ID. Use UIDs in automation. An index is
101
- only stable until commands are reordered, and an ambiguous bare ID fails rather
102
- than selecting a command.
65
+ - standard help with usage, description, positionals, flags, and examples;
66
+ - `--help-tree`, using Unicode box-drawing branches;
67
+ - `--help-tree-depth <positive-integer>`;
68
+ - redirect-safe Markdown through `--help-docs`.
103
69
 
104
- `list`, `describe`, `check`, and `run --dry-run` never execute a configured
105
- command. A real run streams stdout/stderr and uses the child process exit code.
106
- `confirm: always` requires the user to add `--yes`.
70
+ Only `runx run <selector>` executes catalog code. Listing, describing, checking,
71
+ help, initialization, agent operations, upgrade inspection, and dry runs do not.
107
72
 
108
- Manifests are executable local code. Do not place secrets in a manifest and do
109
- not assume a group name determines safety.
73
+ ## Output And Exit Codes
110
74
 
111
- ## Agent Skill
75
+ Text results use stdout and diagnostics use stderr. JSON mode emits one valid
76
+ JSON document on stdout; configuration reports and diagnostics remain on
77
+ stderr.
112
78
 
113
- The bundled `guiho-s-runx` skill directs agents to validate and list a catalog,
114
- select a UID, inspect unfamiliar commands, use dry runs, and obtain explicit
115
- authorization before `--yes` for high-impact commands. Install it with:
79
+ | Code | Meaning |
80
+ | ---: | --- |
81
+ | `0` | Success |
82
+ | `1` | Unexpected operational failure |
83
+ | `2` | Usage or structured flag validation failure |
84
+ | `3` | Configuration resolution or decoding failure |
85
+ | `4` | Release or network failure |
86
+ | `5` | Installation, upgrade, or filesystem mutation failure |
87
+ | `130` | Interruption |
88
+
89
+ An executed catalog command preserves its exact delegated exit code.
90
+
91
+ ## Agent Integration
92
+
93
+ Skill install, update, and uninstall default to global scope and target both:
94
+
95
+ ```text
96
+ ~/.agents/skills/guiho-s-runx
97
+ ~/.claude/skills/guiho-s-runx
98
+ ```
99
+
100
+ Use `--local` for the corresponding project-local paths.
101
+
102
+ Instruction actions manage both `AGENTS.md` and `CLAUDE.md` when both exist,
103
+ the existing one when only one exists, and create `AGENTS.md` when neither
104
+ exists. The exact idempotent boundaries are:
116
105
 
117
106
  ```text
118
- runx agents install local
107
+ <!-- BEGIN RUNX — DO NOT EDIT THIS SECTION -->
108
+ <!-- END RUNX -->
119
109
  ```
120
110
 
121
- ## Native Install, Upgrade, and Uninstall
111
+ The canonical prompt is `guiho-i-runx`. `agent prompt list --names` prints raw
112
+ names; `agent prompt show <id>` prints only the raw prompt.
122
113
 
123
- `devops/install.ps1` installs Windows assets and `devops/install.sh` installs
124
- macOS/Linux assets from GitHub Releases into the user's local bin directory.
125
- `runx upgrade` uses the matching release asset and replaces a native executable.
126
- On Windows it renames the running executable, installs and verifies the target
127
- version at the original path, and restores the previous executable if replacement
128
- fails. Only cleanup of the renamed old image is deferred until RunX exits.
129
- `runx uninstall` removes the same native executable and supports `--dry-run`.
114
+ ## Upgrade And Installation
130
115
 
131
- When the latest GitHub Release matches the installed version, `runx upgrade` prints `Already up to date.` and exits successfully without downloading or scheduling executable replacement. JSON output reports `upToDate: true`.
116
+ `runx upgrade` accepts `--version`, `--arch`, `--variant`, `--dry-run`, and
117
+ `--format`. x64 defaults to `baseline`. `upgrade list` supports positive
118
+ `--page` and `--per-page` plus `--pre-releases`.
132
119
 
133
- CI validates code and compiles the local executable plus the native release
134
- matrix. Protected `@guiho/runx@*` tags run the `production` publish workflow,
135
- which uploads twelve native assets to GitHub Releases and publishes the public
136
- npm package through OIDC trusted publishing.
120
+ Replacement is transactional: download, native-format validation, backup,
121
+ replacement, version verification, rollback on failure, agent-skill refresh,
122
+ instruction reconciliation, then cleanup.
123
+
124
+ Both direct installers show target metadata and download progress, configure
125
+ PATH, install both global skill copies, reconcile project instructions, and
126
+ verify the final version.
127
+
128
+ ## Npm Bootstrap
129
+
130
+ `scripts/runx-bin.mjs` detects platform and architecture, chooses the exact
131
+ versioned native asset, caches it under `~/.guiho/runx/npm/<version>/`, applies
132
+ Unix execute permissions, delegates args/stdin/stdout/stderr/environment, and
133
+ preserves the native exit code. It contains no RunX domain logic.
134
+
135
+ ## Release Assets
136
+
137
+ Every release contains exactly fourteen assets: twelve native binaries and two
138
+ agent assets.
139
+
140
+ ```text
141
+ runx-linux-arm64
142
+ runx-linux-x64
143
+ runx-linux-x64-baseline
144
+ runx-linux-x64-modern
145
+ runx-darwin-arm64
146
+ runx-darwin-x64
147
+ runx-darwin-x64-baseline
148
+ runx-darwin-x64-modern
149
+ runx-windows-arm64.exe
150
+ runx-windows-x64.exe
151
+ runx-windows-x64-baseline.exe
152
+ runx-windows-x64-modern.exe
153
+ guiho-s-runx
154
+ guiho-i-runx
155
+ ```
package/README.md CHANGED
@@ -1,89 +1,89 @@
1
1
  ---
2
2
  name: RunX README
3
- purpose: Introduce RunX and give users the shortest installation and command-catalog path.
4
- description: Public overview, direct installation commands, quick manifest example, and documentation links.
3
+ purpose: Introduce RunX and provide the supported RFC 0034 installation and quick-start workflow.
4
+ description: Public overview of the RunX YAML command catalog, native CLI, agent integration, and release channels.
5
5
  created: 2026-07-12
6
- flags: []
6
+ flags:
7
+ - public
7
8
  tags:
8
- - documentation
9
9
  - cli
10
- keywords:
11
10
  - runx
12
- - readme
11
+ keywords:
12
+ - runx.yaml
13
+ - native binary
14
+ - command catalog
13
15
  owner: runx
14
16
  ---
15
17
 
16
- # GUIHO RunX
18
+ # RunX
17
19
 
18
- RunX is a local, language-agnostic command catalog. Put documented commands in
19
- `runx.yaml`; use `runx list` to discover them and `runx run` to execute one.
20
- It works for Bun, Python, Go, shell, and mixed repositories because it executes
21
- local shell commands rather than package-manager scripts.
20
+ RunX is a language-agnostic command catalog backed by a strict `runx.yaml`
21
+ file. It makes project operations discoverable and keeps execution explicit:
22
+ only `runx run <selector>` spawns a configured command.
22
23
 
23
24
  ## Install
24
25
 
25
- RunX is distributed as a native executable from GitHub Releases and as the
26
- public `@guiho/runx` package on npm. The npm launcher requires Bun.
27
-
28
- ```sh
29
- bun add --global @guiho/runx
30
- ```
26
+ PowerShell:
31
27
 
32
28
  ```powershell
33
29
  irm https://raw.githubusercontent.com/CGuiho/runx/main/devops/install.ps1 | iex
34
30
  ```
35
31
 
32
+ POSIX:
33
+
36
34
  ```sh
37
- curl -fsSL https://raw.githubusercontent.com/CGuiho/runx/main/devops/install.sh | sh
35
+ curl --proto '=https' --tlsv1.2 -fsSL https://raw.githubusercontent.com/CGuiho/runx/main/devops/install.sh | sh
38
36
  ```
39
37
 
40
- ## Quick Start
38
+ The direct installers select and verify a native asset, install `runx` on PATH,
39
+ install `guiho-s-runx` into both global agent-tool directories, and reconcile
40
+ RunX instructions in the current project.
41
41
 
42
- Create `runx.yaml` in a project root:
43
-
44
- ```yaml
45
- version: 1
46
- groups:
47
- development:
48
- summary: Local development commands.
49
- commands:
50
- - uid: app-dev
51
- id: dev
52
- group: development
53
- summary: Start the application locally.
54
- description: Starts the application in local development mode until interrupted.
55
- command: bun run dev
56
- shell: bash
57
- tags: [local, watch]
58
- ```
42
+ The npm package is a Node-compatible bootstrap that downloads and delegates to
43
+ the version-matched native binary. Bun is not required for npm installation or
44
+ first execution.
59
45
 
60
- Then use RunX:
46
+ ## Quick Start
61
47
 
62
48
  ```text
63
- runx Show the home page and usage.
64
- runx -h Show Citty-generated command help.
65
- runx -v Show the installed version without loading a manifest.
66
- runx list List commands in the nearest manifest.
67
- runx describe app-dev Explain one command without execution.
68
- runx run app-dev --dry-run Inspect the execution plan.
69
- runx run app-dev Execute the command.
70
- runx r app-dev Use the short run alias.
71
- runx app-dev Use the human selector shorthand.
49
+ runx init
50
+ runx check
51
+ runx list
52
+ runx describe app-dev
53
+ runx run app-dev --dry-run
54
+ runx run app-dev
72
55
  ```
73
56
 
74
- Use `confirm: always` for commands that should require an explicit `--yes`.
75
- Use `runx list --format json` and stable UIDs for agent automation.
76
- RunX uses Citty for argument parsing, aliases, command routing, and ordinary
77
- usage text, so conventional `-h`/`--help` and `-v`/`--version` work outside a
78
- configured project.
57
+ Configuration resolves in this exact order:
58
+
59
+ 1. `--config <path>`;
60
+ 2. `<effective-cwd>/runx.yaml`;
61
+ 3. `~/.guiho/runx/runx.yaml`.
79
62
 
80
- ## Documentation
63
+ RunX never searches parent directories.
81
64
 
82
- - [Full CLI and manifest reference](DOCS.md)
83
- - [Contributing](CONTRIBUTING.md)
84
- - [Security policy](SECURITY.md)
85
- - [Changelog](CHANGELOG.md)
65
+ ## Command Catalog
66
+
67
+ ```text
68
+ runx
69
+ ├── list
70
+ ├── describe <selector>
71
+ ├── run <selector>
72
+ ├── check
73
+ ├── init
74
+ ├── agent
75
+ │ ├── skill install|uninstall|update|list|show
76
+ │ ├── instruction apply|remove|update|show
77
+ │ └── prompt list|show
78
+ ├── upgrade
79
+ │ ├── check
80
+ │ └── list
81
+ └── uninstall
82
+ ```
86
83
 
87
- ## License
84
+ Every scope supports `--help`, `-h`, `--help-tree`,
85
+ `--help-tree-depth <positive-integer>`, and `--help-docs`. Only root
86
+ `--version` also has `-v`.
88
87
 
89
- [MIT](LICENSE.md)
88
+ See [DOCS.md](DOCS.md) for configuration, output, exit codes, agent resources,
89
+ upgrade behavior, installers, npm bootstrap, and the exact release matrix.
@@ -1,57 +1,53 @@
1
1
  /**
2
- * @copyright Copyright (c) 2026 GUIHO Technologies as represented by Cristóvão GUIHO. All Rights Reserved.
3
- *
4
- * Build release binaries for the supported RunX platform matrix.
2
+ * @copyright Copyright © 2026 GUIHO Technologies as represented by Cristóvão GUIHO. All Rights Reserved.
5
3
  */
6
4
 
7
- import { mkdir, rm, stat } from 'node:fs/promises'
8
- import { join } from 'node:path'
9
- import { fileURLToPath } from 'node:url'
5
+ import { $ } from 'bun'
6
+ import { joinPath } from '../source/path-utils.js'
7
+
8
+ export {
9
+ agentAssetNames,
10
+ binaryTargets,
11
+ expectedReleaseAssetNames,
12
+ }
10
13
 
11
14
  type BinaryTarget = {
12
15
  readonly bunTarget: string
13
16
  readonly assetName: string
14
17
  }
15
18
 
16
- const targets: readonly BinaryTarget[] = [
19
+ const binaryTargets: readonly BinaryTarget[] = [
17
20
  { bunTarget: 'bun-linux-arm64', assetName: 'runx-linux-arm64' },
18
21
  { bunTarget: 'bun-linux-x64', assetName: 'runx-linux-x64' },
19
22
  { bunTarget: 'bun-linux-x64-baseline', assetName: 'runx-linux-x64-baseline' },
20
23
  { bunTarget: 'bun-linux-x64-modern', assetName: 'runx-linux-x64-modern' },
21
- { bunTarget: 'bun-darwin-arm64', assetName: 'runx-macos-arm64' },
22
- { bunTarget: 'bun-darwin-x64', assetName: 'runx-macos-x64' },
23
- { bunTarget: 'bun-darwin-x64-baseline', assetName: 'runx-macos-x64-baseline' },
24
- { bunTarget: 'bun-darwin-x64-modern', assetName: 'runx-macos-x64-modern' },
24
+ { bunTarget: 'bun-darwin-arm64', assetName: 'runx-darwin-arm64' },
25
+ { bunTarget: 'bun-darwin-x64', assetName: 'runx-darwin-x64' },
26
+ { bunTarget: 'bun-darwin-x64-baseline', assetName: 'runx-darwin-x64-baseline' },
27
+ { bunTarget: 'bun-darwin-x64-modern', assetName: 'runx-darwin-x64-modern' },
25
28
  { bunTarget: 'bun-windows-arm64', assetName: 'runx-windows-arm64.exe' },
26
29
  { bunTarget: 'bun-windows-x64', assetName: 'runx-windows-x64.exe' },
27
30
  { bunTarget: 'bun-windows-x64-baseline', assetName: 'runx-windows-x64-baseline.exe' },
28
31
  { bunTarget: 'bun-windows-x64-modern', assetName: 'runx-windows-x64-modern.exe' },
29
32
  ]
30
33
 
31
- const expectedAssetCount = 12
32
- const assetNames = targets.map((target) => target.assetName)
33
- const uniqueAssetNames = new Set(assetNames)
34
+ const agentAssetNames = ['guiho-s-runx', 'guiho-i-runx'] as const
35
+ const expectedReleaseAssetNames = [...binaryTargets.map((target) => target.assetName), ...agentAssetNames]
34
36
 
35
- if (targets.length !== expectedAssetCount) {
36
- throw new Error(`Expected ${expectedAssetCount} binary targets, found ${targets.length}`)
37
+ if (expectedReleaseAssetNames.length !== 14 || new Set(expectedReleaseAssetNames).size !== 14) {
38
+ throw new Error('RunX release matrix must contain exactly fourteen unique assets.')
37
39
  }
38
40
 
39
- if (uniqueAssetNames.size !== assetNames.length) {
40
- throw new Error('Binary target matrix contains duplicate asset names')
41
- }
42
-
43
- const root = fileURLToPath(new URL('..', import.meta.url))
44
- const binDirectory = join(root, 'bin')
45
- const bunExecutable = process.execPath
46
-
47
- await rm(binDirectory, { recursive: true, force: true })
48
- await mkdir(binDirectory, { recursive: true })
41
+ if (import.meta.main) {
42
+ const root = Bun.fileURLToPath(new URL('..', import.meta.url))
43
+ const bin = joinPath(root, 'bin')
44
+ await $`rm -rf ${bin}`.quiet()
45
+ await $`mkdir -p ${bin}`.quiet()
49
46
 
50
- const builds = targets.map(async (target) => {
51
- const outputPath = join(binDirectory, target.assetName)
52
- const proc = Bun.spawn({
53
- cmd: [
54
- bunExecutable,
47
+ for (const target of binaryTargets) {
48
+ const output = joinPath(bin, target.assetName)
49
+ const child = Bun.spawn([
50
+ process.execPath,
55
51
  'build',
56
52
  'source/guiho-runx-native-bin.ts',
57
53
  '--compile',
@@ -61,39 +57,25 @@ const builds = targets.map(async (target) => {
61
57
  '--target',
62
58
  target.bunTarget,
63
59
  '--outfile',
64
- outputPath,
65
- ],
66
- cwd: root,
67
- stdout: 'pipe',
68
- stderr: 'pipe',
69
- })
70
-
71
- const [stdout, stderr, exitCode] = await Promise.all([
72
- new Response(proc.stdout).text(),
73
- new Response(proc.stderr).text(),
74
- proc.exited,
75
- ])
76
-
77
- if (exitCode !== 0) {
78
- throw new Error([
79
- `Failed to build ${target.bunTarget} -> ${target.assetName}`,
80
- stdout.trim(),
81
- stderr.trim(),
82
- ].filter(Boolean).join('\n'))
60
+ output,
61
+ ], { cwd: root, stdout: 'pipe', stderr: 'pipe' })
62
+ const [stdout, stderr, exitCode] = await Promise.all([
63
+ new Response(child.stdout).text(),
64
+ new Response(child.stderr).text(),
65
+ child.exited,
66
+ ])
67
+ if (exitCode !== 0) throw new Error([`Failed to build ${target.assetName}`, stdout, stderr].filter(Boolean).join('\n'))
68
+ if ((await Bun.file(output).size) === 0) throw new Error(`Built binary is empty: ${target.assetName}`)
69
+ process.stdout.write(`built: ${target.assetName}\n`)
83
70
  }
84
71
 
85
- process.stdout.write(`built: ${target.bunTarget} -> bin/${target.assetName}\n`)
86
- })
87
-
88
- await Promise.all(builds)
72
+ await Bun.write(joinPath(bin, 'guiho-s-runx'), Bun.file(joinPath(root, 'skills', 'guiho-s-runx', 'SKILL.md')))
73
+ await Bun.write(joinPath(bin, 'guiho-i-runx'), Bun.file(joinPath(root, 'prompts', 'guiho-i-runx.md')))
89
74
 
90
- for (const target of targets) {
91
- const outputPath = join(binDirectory, target.assetName)
92
- const output = await stat(outputPath)
93
-
94
- if (output.size === 0) {
95
- throw new Error(`Built binary is empty: bin/${target.assetName}`)
75
+ const observed = [...new Bun.Glob('*').scanSync({ cwd: bin, onlyFiles: true })].sort()
76
+ const expected = [...expectedReleaseAssetNames].sort()
77
+ if (JSON.stringify(observed) !== JSON.stringify(expected)) {
78
+ throw new Error(`Release asset mismatch.\nExpected: ${expected.join(', ')}\nObserved: ${observed.join(', ')}`)
96
79
  }
80
+ process.stdout.write('verified exactly 14 release assets\n')
97
81
  }
98
-
99
- process.stdout.write(`verified ${targets.length} native binary assets\n`)
@@ -4,9 +4,11 @@ description: Native release-asset compilation and direct RunX installer scripts.
4
4
  parent: runx
5
5
  children: []
6
6
  files:
7
- build-binaries.ts: Cross-compiles supported Bun native executable assets.
8
- install.ps1: Installs the latest Windows executable from GitHub Releases.
9
- install.sh: Installs the latest macOS or Linux executable from GitHub Releases.
7
+ build-binaries.ts: Cross-compiles twelve RFC-named native binaries and adds the two exact agent assets.
8
+ verify-release-assets.ts: Fails on any missing, duplicate, extra, or legacy release asset name.
9
+ installers.spec.ts: Verifies both installers expose progress, validation, dual-tool skills, instruction reconciliation, and no POSIX Bun dependency.
10
+ install.ps1: Resolves an exact Windows release, downloads and validates a compatible asset, transactionally replaces the canonical executable, verifies its version, and rolls back on failure.
11
+ install.sh: POSIX installer for Linux or Darwin with progress, validation, PATH, dual skills, instructions, verification, and rollback.
10
12
  documents: {}
11
13
  tags:
12
14
  - devops
@@ -15,11 +17,12 @@ tags:
15
17
  keywords:
16
18
  - runx
17
19
  - windows
18
- - macos
20
+ - darwin
19
21
  - linux
20
22
  - native binary
21
23
  flags: []
22
24
  status: stable
23
25
  ---
24
26
 
25
- These scripts support direct native installation without an npm publication.
27
+ These scripts build and verify the exact fourteen-asset release and support
28
+ direct installation without npm or Bun.