@h-rig/cli 0.0.6-alpha.63 → 0.0.6-alpha.65
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/dist/bin/rig.js +1349 -1599
- package/dist/src/commands/_connection-state.js +14 -5
- package/dist/src/commands/_doctor-checks.js +71 -11
- package/dist/src/commands/_help-catalog.js +99 -60
- package/dist/src/commands/_json-output.js +56 -0
- package/dist/src/commands/_operator-view.js +97 -784
- package/dist/src/commands/_parsers.js +18 -9
- package/dist/src/commands/_pi-frontend.js +96 -788
- package/dist/src/commands/_policy.js +12 -3
- package/dist/src/commands/_preflight.js +73 -13
- package/dist/src/commands/_run-driver-helpers.js +31 -5
- package/dist/src/commands/_run-replay.js +2 -2
- package/dist/src/commands/_server-client.js +76 -16
- package/dist/src/commands/_snapshot-upload.js +70 -10
- package/dist/src/commands/agent.js +21 -11
- package/dist/src/commands/browser.js +24 -15
- package/dist/src/commands/connect.js +22 -17
- package/dist/src/commands/dist.js +15 -6
- package/dist/src/commands/doctor.js +70 -10
- package/dist/src/commands/github.js +79 -19
- package/dist/src/commands/inbox.js +215 -131
- package/dist/src/commands/init.js +202 -35
- package/dist/src/commands/inspect.js +77 -17
- package/dist/src/commands/inspector.js +18 -9
- package/dist/src/commands/pi.js +18 -9
- package/dist/src/commands/plugin.js +19 -10
- package/dist/src/commands/profile-and-review.js +22 -13
- package/dist/src/commands/queue.js +19 -9
- package/dist/src/commands/remote.js +25 -16
- package/dist/src/commands/repo-git-harness.js +18 -9
- package/dist/src/commands/run.js +158 -805
- package/dist/src/commands/server.js +85 -25
- package/dist/src/commands/setup.js +73 -13
- package/dist/src/commands/stats.js +681 -0
- package/dist/src/commands/task-report-bug.js +24 -15
- package/dist/src/commands/task-run-driver.js +121 -49
- package/dist/src/commands/task.js +254 -893
- package/dist/src/commands/test.js +12 -3
- package/dist/src/commands/workspace.js +14 -5
- package/dist/src/commands.js +1339 -1650
- package/dist/src/index.js +1349 -1599
- package/dist/src/launcher.js +72 -10
- package/dist/src/runner.js +14 -5
- package/package.json +10 -7
- package/dist/src/commands/_pi-remote-session.js +0 -771
- package/dist/src/commands/_pi-worker-bridge-extension.js +0 -834
|
@@ -7,10 +7,19 @@ import { resolve } from "path";
|
|
|
7
7
|
|
|
8
8
|
// packages/cli/src/runner.ts
|
|
9
9
|
import { EventBus } from "@rig/runtime/control-plane/runtime/events";
|
|
10
|
-
import { CliError } from "@rig/runtime/control-plane/errors";
|
|
10
|
+
import { CliError as RuntimeCliError } from "@rig/runtime/control-plane/errors";
|
|
11
11
|
import { evaluate, loadPolicy, resolveAction } from "@rig/runtime/control-plane/runtime/guard";
|
|
12
12
|
import { buildBinary } from "@rig/runtime/control-plane/runtime/isolation";
|
|
13
|
-
|
|
13
|
+
|
|
14
|
+
class CliError extends RuntimeCliError {
|
|
15
|
+
hint;
|
|
16
|
+
constructor(message, exitCode = 1, options = {}) {
|
|
17
|
+
super(message, exitCode);
|
|
18
|
+
if (options.hint?.trim()) {
|
|
19
|
+
this.hint = options.hint.trim();
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
}
|
|
14
23
|
|
|
15
24
|
// packages/cli/src/commands/_parsers.ts
|
|
16
25
|
function parsePositiveInt(value, option, fallback) {
|
|
@@ -19,7 +28,7 @@ function parsePositiveInt(value, option, fallback) {
|
|
|
19
28
|
}
|
|
20
29
|
const parsed = Number.parseInt(value, 10);
|
|
21
30
|
if (!Number.isFinite(parsed) || parsed <= 0) {
|
|
22
|
-
throw new
|
|
31
|
+
throw new CliError(`Invalid ${option} value: ${value}`, 1, { hint: `Pass a positive integer, e.g. \`${option} 10\`.` });
|
|
23
32
|
}
|
|
24
33
|
return parsed;
|
|
25
34
|
}
|
|
@@ -29,17 +38,17 @@ function parseOptionalPositiveInt(value, option) {
|
|
|
29
38
|
}
|
|
30
39
|
const parsed = Number.parseInt(value, 10);
|
|
31
40
|
if (!Number.isFinite(parsed) || parsed <= 0) {
|
|
32
|
-
throw new
|
|
41
|
+
throw new CliError(`Invalid ${option} value: ${value}`, 1, { hint: `Pass a positive integer, e.g. \`${option} 10\`.` });
|
|
33
42
|
}
|
|
34
43
|
return parsed;
|
|
35
44
|
}
|
|
36
45
|
function parseRequiredPositiveInt(value, option) {
|
|
37
46
|
if (!value) {
|
|
38
|
-
throw new
|
|
47
|
+
throw new CliError(`Missing value for ${option}.`, 1, { hint: `Provide a value after ${option}, e.g. \`${option} 10\`.` });
|
|
39
48
|
}
|
|
40
49
|
const parsed = Number.parseInt(value, 10);
|
|
41
50
|
if (!Number.isFinite(parsed) || parsed <= 0) {
|
|
42
|
-
throw new
|
|
51
|
+
throw new CliError(`Invalid ${option} value: ${value}`, 1, { hint: `Pass a positive integer, e.g. \`${option} 10\`.` });
|
|
43
52
|
}
|
|
44
53
|
return parsed;
|
|
45
54
|
}
|
|
@@ -53,7 +62,7 @@ function parseAction(value) {
|
|
|
53
62
|
if (value === "pipeline") {
|
|
54
63
|
return "pipeline";
|
|
55
64
|
}
|
|
56
|
-
throw new
|
|
65
|
+
throw new CliError(`Invalid --action value: ${value}. Use validate, verify, or pipeline.`);
|
|
57
66
|
}
|
|
58
67
|
function parseIsolationMode(value, allowOff) {
|
|
59
68
|
if (!value) {
|
|
@@ -65,7 +74,7 @@ function parseIsolationMode(value, allowOff) {
|
|
|
65
74
|
if (allowOff && value === "off") {
|
|
66
75
|
return value;
|
|
67
76
|
}
|
|
68
|
-
throw new
|
|
77
|
+
throw new CliError(`Invalid isolation mode: ${value}. Use ${allowOff ? "off|" : ""}worktree.`);
|
|
69
78
|
}
|
|
70
79
|
function parseInstallScope(value) {
|
|
71
80
|
if (!value || value === "user") {
|
|
@@ -74,7 +83,7 @@ function parseInstallScope(value) {
|
|
|
74
83
|
if (value === "system") {
|
|
75
84
|
return "system";
|
|
76
85
|
}
|
|
77
|
-
throw new
|
|
86
|
+
throw new CliError(`Invalid --scope value: ${value}. Use user|system.`);
|
|
78
87
|
}
|
|
79
88
|
function resolveInstallDir(scope, explicitPath) {
|
|
80
89
|
if (explicitPath) {
|