@h-rig/cli 0.0.6-alpha.19 → 0.0.6-alpha.190
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 +7 -28
- package/bin/rig-run.js +19 -0
- package/bin/rig.js +19 -0
- package/package.json +15 -27
- package/dist/bin/build-rig-binaries.js +0 -107
- package/dist/bin/rig.js +0 -10233
- package/dist/src/commands/_authority-runs.js +0 -111
- package/dist/src/commands/_connection-state.js +0 -123
- package/dist/src/commands/_doctor-checks.js +0 -506
- package/dist/src/commands/_operator-surface.js +0 -204
- package/dist/src/commands/_operator-view.js +0 -496
- package/dist/src/commands/_parsers.js +0 -107
- package/dist/src/commands/_paths.js +0 -50
- package/dist/src/commands/_pi-install.js +0 -184
- package/dist/src/commands/_policy.js +0 -79
- package/dist/src/commands/_preflight.js +0 -482
- package/dist/src/commands/_probes.js +0 -13
- package/dist/src/commands/_run-driver-helpers.js +0 -289
- package/dist/src/commands/_server-client.js +0 -435
- package/dist/src/commands/_snapshot-upload.js +0 -318
- package/dist/src/commands/_task-picker.js +0 -56
- package/dist/src/commands/agent.js +0 -499
- package/dist/src/commands/browser.js +0 -890
- package/dist/src/commands/connect.js +0 -180
- package/dist/src/commands/dist.js +0 -402
- package/dist/src/commands/doctor.js +0 -516
- package/dist/src/commands/github.js +0 -281
- package/dist/src/commands/inbox.js +0 -160
- package/dist/src/commands/init.js +0 -1562
- package/dist/src/commands/inspect.js +0 -174
- package/dist/src/commands/inspector.js +0 -256
- package/dist/src/commands/plugin.js +0 -167
- package/dist/src/commands/profile-and-review.js +0 -178
- package/dist/src/commands/queue.js +0 -198
- package/dist/src/commands/remote.js +0 -507
- package/dist/src/commands/repo-git-harness.js +0 -221
- package/dist/src/commands/run.js +0 -972
- package/dist/src/commands/server.js +0 -373
- package/dist/src/commands/setup.js +0 -686
- package/dist/src/commands/task-report-bug.js +0 -1083
- package/dist/src/commands/task-run-driver.js +0 -2469
- package/dist/src/commands/task.js +0 -1523
- package/dist/src/commands/test.js +0 -39
- package/dist/src/commands/workspace.js +0 -123
- package/dist/src/commands.js +0 -9912
- package/dist/src/index.js +0 -10251
- package/dist/src/launcher.js +0 -133
- package/dist/src/report-bug.js +0 -260
- package/dist/src/runner.js +0 -273
- package/dist/src/withMutedConsole.js +0 -42
package/README.md
CHANGED
|
@@ -1,30 +1,9 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @h-rig/cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Installs the prebuilt, self-contained `rig` and `rig-run` binaries for your platform via an os/cpu-gated optional dependency, then launches them.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
-
|
|
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
|
+
bun add -g @h-rig/cli # or: npm i -g @h-rig/cli
|
|
7
|
+
rig --help
|
|
8
|
+
rig-run --version
|
|
9
|
+
```
|
package/bin/rig-run.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
// Launcher for the prebuilt rig-run binary (@h-rig/cli-<os>-<arch>, an optional dep).
|
|
4
|
+
const { spawnSync } = require("node:child_process");
|
|
5
|
+
const tag = process.platform + "-" + process.arch;
|
|
6
|
+
const rigExe = process.platform === "win32" ? "rig.exe" : "rig";
|
|
7
|
+
let rigBin;
|
|
8
|
+
try { rigBin = require.resolve("@h-rig/cli-" + tag + "/" + rigExe); } catch {}
|
|
9
|
+
if (!rigBin) {
|
|
10
|
+
console.error("@h-rig/cli: no prebuilt rig-run binary for " + tag + ".");
|
|
11
|
+
console.error("Supported: darwin-arm64, darwin-x64, linux-x64, linux-arm64, win32-x64.");
|
|
12
|
+
process.exit(1);
|
|
13
|
+
}
|
|
14
|
+
const env = "rig-run" === "rig-run"
|
|
15
|
+
? { ...process.env, RIG_EXEC_BASENAME: "rig-run" }
|
|
16
|
+
: process.env;
|
|
17
|
+
const res = spawnSync(rigBin, process.argv.slice(2), { stdio: "inherit", env });
|
|
18
|
+
if (res.error) { console.error(String(res.error.message || res.error)); process.exit(1); }
|
|
19
|
+
process.exit(res.status == null ? 1 : res.status);
|
package/bin/rig.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
// Launcher for the prebuilt rig binary (@h-rig/cli-<os>-<arch>, an optional dep).
|
|
4
|
+
const { spawnSync } = require("node:child_process");
|
|
5
|
+
const tag = process.platform + "-" + process.arch;
|
|
6
|
+
const rigExe = process.platform === "win32" ? "rig.exe" : "rig";
|
|
7
|
+
let rigBin;
|
|
8
|
+
try { rigBin = require.resolve("@h-rig/cli-" + tag + "/" + rigExe); } catch {}
|
|
9
|
+
if (!rigBin) {
|
|
10
|
+
console.error("@h-rig/cli: no prebuilt rig binary for " + tag + ".");
|
|
11
|
+
console.error("Supported: darwin-arm64, darwin-x64, linux-x64, linux-arm64, win32-x64.");
|
|
12
|
+
process.exit(1);
|
|
13
|
+
}
|
|
14
|
+
const env = "rig" === "rig-run"
|
|
15
|
+
? { ...process.env, RIG_EXEC_BASENAME: "rig-run" }
|
|
16
|
+
: process.env;
|
|
17
|
+
const res = spawnSync(rigBin, process.argv.slice(2), { stdio: "inherit", env });
|
|
18
|
+
if (res.error) { console.error(String(res.error.message || res.error)); process.exit(1); }
|
|
19
|
+
process.exit(res.status == null ? 1 : res.status);
|
package/package.json
CHANGED
|
@@ -1,32 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@h-rig/cli",
|
|
3
|
-
"version": "0.0.6-alpha.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
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",
|
|
3
|
+
"version": "0.0.6-alpha.190",
|
|
4
|
+
"description": "Rig CLI — installs the prebuilt single-file rig/rig-run binaries for your platform.",
|
|
5
|
+
"license": "MIT",
|
|
21
6
|
"bin": {
|
|
22
|
-
"rig": "
|
|
7
|
+
"rig": "bin/rig.js",
|
|
8
|
+
"rig-run": "bin/rig-run.js"
|
|
23
9
|
},
|
|
24
|
-
"
|
|
25
|
-
"@
|
|
26
|
-
"@rig/
|
|
27
|
-
"@rig/
|
|
28
|
-
"@rig/
|
|
29
|
-
"@rig/
|
|
30
|
-
|
|
31
|
-
|
|
10
|
+
"optionalDependencies": {
|
|
11
|
+
"@h-rig/cli-darwin-arm64": "0.0.6-alpha.190",
|
|
12
|
+
"@h-rig/cli-darwin-x64": "0.0.6-alpha.190",
|
|
13
|
+
"@h-rig/cli-linux-x64": "0.0.6-alpha.190",
|
|
14
|
+
"@h-rig/cli-linux-arm64": "0.0.6-alpha.190",
|
|
15
|
+
"@h-rig/cli-win32-x64": "0.0.6-alpha.190"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"bin"
|
|
19
|
+
]
|
|
32
20
|
}
|
|
@@ -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
|
-
});
|