@h-rig/cli 0.0.6-alpha.2 → 0.0.6-alpha.200

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 (47) hide show
  1. package/README.md +6 -28
  2. package/package.json +9 -27
  3. package/dist/bin/build-rig-binaries.js +0 -107
  4. package/dist/bin/rig.js +0 -9470
  5. package/dist/src/commands/_authority-runs.js +0 -110
  6. package/dist/src/commands/_connection-state.js +0 -123
  7. package/dist/src/commands/_doctor-checks.js +0 -519
  8. package/dist/src/commands/_operator-view.js +0 -340
  9. package/dist/src/commands/_parsers.js +0 -107
  10. package/dist/src/commands/_paths.js +0 -50
  11. package/dist/src/commands/_pi-install.js +0 -184
  12. package/dist/src/commands/_policy.js +0 -79
  13. package/dist/src/commands/_preflight.js +0 -478
  14. package/dist/src/commands/_probes.js +0 -13
  15. package/dist/src/commands/_run-driver-helpers.js +0 -289
  16. package/dist/src/commands/_server-client.js +0 -382
  17. package/dist/src/commands/_snapshot-upload.js +0 -331
  18. package/dist/src/commands/_task-picker.js +0 -48
  19. package/dist/src/commands/agent.js +0 -497
  20. package/dist/src/commands/browser.js +0 -890
  21. package/dist/src/commands/connect.js +0 -180
  22. package/dist/src/commands/dist.js +0 -402
  23. package/dist/src/commands/doctor.js +0 -529
  24. package/dist/src/commands/github.js +0 -294
  25. package/dist/src/commands/inbox.js +0 -160
  26. package/dist/src/commands/init.js +0 -1334
  27. package/dist/src/commands/inspect.js +0 -174
  28. package/dist/src/commands/inspector.js +0 -256
  29. package/dist/src/commands/plugin.js +0 -167
  30. package/dist/src/commands/profile-and-review.js +0 -178
  31. package/dist/src/commands/queue.js +0 -197
  32. package/dist/src/commands/remote.js +0 -507
  33. package/dist/src/commands/repo-git-harness.js +0 -221
  34. package/dist/src/commands/run.js +0 -771
  35. package/dist/src/commands/server.js +0 -386
  36. package/dist/src/commands/setup.js +0 -699
  37. package/dist/src/commands/task-report-bug.js +0 -1083
  38. package/dist/src/commands/task-run-driver.js +0 -1994
  39. package/dist/src/commands/task.js +0 -1343
  40. package/dist/src/commands/test.js +0 -39
  41. package/dist/src/commands/workspace.js +0 -123
  42. package/dist/src/commands.js +0 -9152
  43. package/dist/src/index.js +0 -9488
  44. package/dist/src/launcher.js +0 -131
  45. package/dist/src/report-bug.js +0 -260
  46. package/dist/src/runner.js +0 -272
  47. package/dist/src/withMutedConsole.js +0 -42
package/README.md CHANGED
@@ -1,30 +1,8 @@
1
- # CLI Package
1
+ # @h-rig/cli
2
2
 
3
- `@rig/cli` exposes the `rig` command.
3
+ Version anchor for the prebuilt, self-contained `rig` binaries, published per platform as `@h-rig/cli-<os>-<arch>`. There is no JS entrypoint; the installer links `rig` and `rig-run` directly to the platform binary.
4
4
 
5
- ## Purpose
6
-
7
- - route operator commands into the runtime control plane
8
- - provide setup, server, task, review, queue, and profile entry points
9
-
10
- ## Common command
11
-
12
- - `bun run rig -- <subcommand>`
13
- - `bun run rig report-bug`
14
- - `bun run rig report-bug --no-prompt --browser --title "OTP submit fails" --url "https://dev.rig.hptestingsite.com/login?next=%2F" --environment shared-dev --asset ./path/to/screenshot.png --video ./path/to/recording.webm`
15
- - `bun run rig report-bug --no-prompt --no-browser --title "OTP API fails" --url "https://dev.rig.hptestingsite.com/api/auth/email/otp/verify" --asset ./path/to/api-response.txt`
16
- - `bun run rig browser --help`
17
- - `bun run rig browser explain`
18
- - `bun run rig browser hp-next dev`
19
-
20
- ## Notes
21
-
22
- - CLI behavior should stay thin and delegate business logic into `@rig/runtime`.
23
- - `report-bug` uses `@clack/prompts` for its interactive wizard and asks whether Rig Browser is required.
24
- - `report-bug` creates a runnable beads `task` by default, writes committable evidence under `repos/spliter-monorepo/artifacts/<task-id>/bug-report/`, and upserts task-config wiring.
25
- - `report-bug --no-beads` keeps the old draft-only behavior under `docs/bug-reports/`.
26
- - `report-bug --no-browser` skips `browser.json`, the `browser-required` label, browser validation, and browser helper commands while preserving task assets.
27
- - `report-bug` accepts drag-and-drop asset values through `--asset` and `--video`; copied files are stored under `bug-report/assets/` and indexed in `manifest.json`.
28
- - Browser bug-report evidence must be tracked by git before validation/handoff; untracked assets fail `integration:browser-bug-report-task`.
29
- - Key `report-bug` flags: `--browser`, `--no-browser`, `--summary`, `--steps`, `--expected`, `--actual`, `--evidence`, `--asset`, `--video`, `--screenshot`, `--priority`, `--labels`, `--parent`, `--assignee`, `--owner`, `--preset`, `--profile`, `--attach-url`, `--state-dir`, `--mode`, `--viewport`, `--output-dir`, `--slug`, and `--overwrite`.
30
- - `rig browser` is the operator-friendly command family for Rig Browser help, hp-next launch/check/e2e/reset, and package-level CDP/profile diagnostics.
5
+ ```
6
+ curl -fsSL https://where.rig-does.work/install | bash
7
+ rig --help
8
+ ```
package/package.json CHANGED
@@ -1,31 +1,13 @@
1
1
  {
2
2
  "name": "@h-rig/cli",
3
- "version": "0.0.6-alpha.2",
4
- "type": "module",
5
- "description": "Rig package",
6
- "license": "UNLICENSED",
7
- "files": [
8
- "dist",
9
- "README.md"
10
- ],
11
- "exports": {
12
- ".": {
13
- "import": "./dist/src/index.js"
14
- }
15
- },
16
- "engines": {
17
- "bun": ">=1.3.11"
18
- },
19
- "main": "./dist/src/index.js",
20
- "module": "./dist/src/index.js",
21
- "bin": {
22
- "rig": "./dist/bin/rig.js"
23
- },
24
- "dependencies": {
25
- "@clack/prompts": "^1.2.0",
26
- "@rig/core": "npm:@h-rig/core@0.0.6-alpha.2",
27
- "@rig/runtime": "npm:@h-rig/runtime@0.0.6-alpha.2",
28
- "@rig/client": "npm:@h-rig/client@0.0.6-alpha.2",
29
- "picocolors": "^1.1.1"
3
+ "version": "0.0.6-alpha.200",
4
+ "description": "Rig — version anchor for the prebuilt single-file rig binaries (@h-rig/cli-<os>-<arch>). Install: curl -fsSL https://where.rig-does.work/install | bash",
5
+ "license": "MIT",
6
+ "optionalDependencies": {
7
+ "@h-rig/cli-darwin-arm64": "0.0.6-alpha.200",
8
+ "@h-rig/cli-darwin-x64": "0.0.6-alpha.200",
9
+ "@h-rig/cli-linux-x64": "0.0.6-alpha.200",
10
+ "@h-rig/cli-linux-arm64": "0.0.6-alpha.200",
11
+ "@h-rig/cli-win32-x64": "0.0.6-alpha.200"
30
12
  }
31
13
  }
@@ -1,107 +0,0 @@
1
- #!/usr/bin/env bun
2
- // @bun
3
-
4
- // packages/cli/bin/build-rig-binaries.ts
5
- import { cpSync, existsSync, mkdirSync, readFileSync } from "fs";
6
- import { resolve } from "path";
7
- import { runCapture } from "@rig/runtime/control-plane/native/utils";
8
- import { buildRuntimeBinary } from "@rig/runtime/binary-run";
9
- function readCliVersion(rootDir) {
10
- try {
11
- const pkg = JSON.parse(readFileSync(resolve(rootDir, "packages/cli/package.json"), "utf-8"));
12
- return pkg.version || "0.0.0-dev";
13
- } catch {
14
- return "0.0.0-dev";
15
- }
16
- }
17
- async function main() {
18
- const rootDir = resolve(import.meta.dir, "..", "..", "..");
19
- process.chdir(rootDir);
20
- const args = parseArgs(process.argv.slice(2));
21
- const stamp = timestamp();
22
- const outputDir = args.outputDir || resolve(rootDir, ".rig/dist", `rig-${stamp}`);
23
- const binDir = resolve(outputDir, "bin");
24
- const runtimeDir = resolve(outputDir, "runtime", "rig");
25
- mkdirSync(binDir, { recursive: true });
26
- mkdirSync(runtimeDir, { recursive: true });
27
- const cliVersion = readCliVersion(rootDir);
28
- await buildBinary("packages/cli/bin/rig.ts", resolve(binDir, "rig"), rootDir, {
29
- "process.env.RIG_CLI_VERSION": JSON.stringify(cliVersion)
30
- });
31
- await buildBinary("packages/runtime/bin/rig-agent-dispatch.ts", resolve(binDir, "rig-agent"), rootDir);
32
- for (const entry of [
33
- "hooks",
34
- "lib",
35
- "tools",
36
- "templates",
37
- "policy",
38
- "plugins",
39
- "config.sh",
40
- "task-config.json"
41
- ]) {
42
- const source = resolve(rootDir, "rig", entry);
43
- if (existsSync(source)) {
44
- cpSync(source, resolve(runtimeDir, entry), { recursive: true });
45
- }
46
- }
47
- const manifest = {
48
- name: "project-rig-harness",
49
- version: cliVersion,
50
- builtAt: new Date().toISOString(),
51
- gitHead: runCapture(["git", "rev-parse", "HEAD"], rootDir).stdout.trim() || "unknown",
52
- bunVersion: Bun.version,
53
- binaries: {
54
- rig: "bin/rig",
55
- rigAgent: "bin/rig-agent"
56
- }
57
- };
58
- await Bun.write(resolve(outputDir, "manifest.json"), `${JSON.stringify(manifest, null, 2)}
59
- `);
60
- const archive = `${outputDir}.tar.gz`;
61
- const tar = await Bun.$`tar -czf ${archive} -C ${outputDir} .`.cwd(rootDir).quiet().nothrow();
62
- if (tar.exitCode !== 0) {
63
- throw new Error(`Failed to create archive: ${tar.stderr.toString() || tar.stdout.toString()}`);
64
- }
65
- console.log("Build complete");
66
- console.log(`- directory: ${outputDir}`);
67
- console.log(`- archive: ${archive}`);
68
- }
69
- function parseArgs(argv) {
70
- const args = {};
71
- for (let i = 0;i < argv.length; i += 1) {
72
- const current = argv[i];
73
- if (current === "--output-dir") {
74
- const value = argv[i + 1];
75
- if (!value) {
76
- throw new Error("Missing value for --output-dir");
77
- }
78
- args.outputDir = resolve(process.cwd(), value);
79
- i += 1;
80
- continue;
81
- }
82
- throw new Error(`Unknown option: ${current}`);
83
- }
84
- return args;
85
- }
86
- async function buildBinary(source, output, cwd, define) {
87
- await buildRuntimeBinary({
88
- sourcePath: source,
89
- outputPath: output,
90
- cwd,
91
- ...define ? { define } : {}
92
- });
93
- }
94
- function timestamp() {
95
- const date = new Date;
96
- const yyyy = date.getFullYear();
97
- const mm = `${date.getMonth() + 1}`.padStart(2, "0");
98
- const dd = `${date.getDate()}`.padStart(2, "0");
99
- const hh = `${date.getHours()}`.padStart(2, "0");
100
- const min = `${date.getMinutes()}`.padStart(2, "0");
101
- const sec = `${date.getSeconds()}`.padStart(2, "0");
102
- return `${yyyy}${mm}${dd}-${hh}${min}${sec}`;
103
- }
104
- main().catch((error) => {
105
- console.error(error instanceof Error ? error.message : error);
106
- process.exit(1);
107
- });