@h-rig/cli 0.0.6-alpha.2 → 0.0.6-alpha.20
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 +1288 -315
- package/dist/src/commands/_authority-runs.js +1 -0
- package/dist/src/commands/_cli-format.js +106 -0
- package/dist/src/commands/_doctor-checks.js +10 -22
- package/dist/src/commands/_operator-surface.js +204 -0
- package/dist/src/commands/_operator-view.js +207 -51
- package/dist/src/commands/_pi-install.js +4 -3
- package/dist/src/commands/_pi-session.js +253 -0
- package/dist/src/commands/_preflight.js +33 -28
- package/dist/src/commands/_server-client.js +80 -27
- package/dist/src/commands/_snapshot-upload.js +7 -20
- package/dist/src/commands/_task-picker.js +44 -16
- package/dist/src/commands/agent.js +2 -0
- package/dist/src/commands/doctor.js +10 -22
- package/dist/src/commands/github.js +9 -22
- package/dist/src/commands/init.js +295 -66
- package/dist/src/commands/queue.js +1 -0
- package/dist/src/commands/run.js +456 -95
- package/dist/src/commands/server.js +9 -22
- package/dist/src/commands/setup.js +10 -22
- package/dist/src/commands/task-run-driver.js +539 -64
- package/dist/src/commands/task.js +502 -130
- package/dist/src/commands.js +1276 -306
- package/dist/src/index.js +1288 -315
- package/dist/src/launcher.js +5 -3
- package/dist/src/runner.js +3 -2
- package/package.json +5 -4
package/dist/src/launcher.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
// packages/cli/src/launcher.ts
|
|
3
3
|
import { existsSync } from "fs";
|
|
4
|
-
import { resolve } from "path";
|
|
4
|
+
import { basename, resolve } from "path";
|
|
5
5
|
import { loadDotEnvSecrets } from "@rig/runtime/baked-secrets";
|
|
6
6
|
import { RIG_DEFINITION_DIRNAME, RIG_STATE_DIRNAME, resolveNearestRigProjectRoot } from "@rig/runtime/layout";
|
|
7
7
|
function parsePolicyMode(value) {
|
|
@@ -14,7 +14,7 @@ function parsePolicyMode(value) {
|
|
|
14
14
|
throw new Error(`Invalid --policy-mode value: ${value}. Use off|observe|enforce.`);
|
|
15
15
|
}
|
|
16
16
|
function hasRigProjectMarker(candidate) {
|
|
17
|
-
return existsSync(resolve(candidate, RIG_DEFINITION_DIRNAME)) || existsSync(resolve(candidate, RIG_STATE_DIRNAME)) || existsSync(resolve(candidate, "rig.config.ts")) || existsSync(resolve(candidate, "rig.config.json"));
|
|
17
|
+
return existsSync(resolve(candidate, RIG_DEFINITION_DIRNAME)) || existsSync(resolve(candidate, RIG_STATE_DIRNAME)) || existsSync(resolve(candidate, "rig.config.ts")) || existsSync(resolve(candidate, "rig.config.json")) || existsSync(resolve(candidate, ".git"));
|
|
18
18
|
}
|
|
19
19
|
function resolveProjectRoot({
|
|
20
20
|
envProjectRoot,
|
|
@@ -26,7 +26,9 @@ function resolveProjectRoot({
|
|
|
26
26
|
return resolve(cwd, envProjectRoot);
|
|
27
27
|
}
|
|
28
28
|
const fallbackImportDir = importDir ?? cwd;
|
|
29
|
-
const
|
|
29
|
+
const execName = basename(execPath).toLowerCase();
|
|
30
|
+
const execCandidates = execName === "rig" || execName === "rig.exe" ? [resolve(execPath, "..", "..")] : [];
|
|
31
|
+
const candidates = [cwd, ...execCandidates, resolve(fallbackImportDir, "..")];
|
|
30
32
|
for (const candidate of candidates) {
|
|
31
33
|
const nearest = resolveNearestRigProjectRoot(candidate);
|
|
32
34
|
if (hasRigProjectMarker(nearest)) {
|
package/dist/src/runner.js
CHANGED
|
@@ -99,12 +99,13 @@ async function runCommand(context, parts) {
|
|
|
99
99
|
const envMode = process.env.RIG_BASH_MODE;
|
|
100
100
|
const effectiveMode = context.policyMode || (envMode === "off" || envMode === "observe" || envMode === "enforce" ? envMode : loadPolicy(context.projectRoot).mode);
|
|
101
101
|
const controlledPath = `${resolve(context.projectRoot, ".rig", "bin")}:${context.projectRoot}/rig/tools:${process.env.PATH ?? ""}`;
|
|
102
|
-
const
|
|
102
|
+
const usesInfrastructureBinary = parts[0] === "rig-server";
|
|
103
|
+
const controlledBash = usesInfrastructureBinary ? null : await ensureAgentShellBinary(context.projectRoot);
|
|
103
104
|
const commandEnv = [
|
|
104
105
|
"env",
|
|
105
106
|
`PATH=${controlledPath}`,
|
|
106
107
|
`PROJECT_RIG_ROOT=${context.projectRoot}`,
|
|
107
|
-
`BASH=${controlledBash}
|
|
108
|
+
...controlledBash ? [`BASH=${controlledBash}`] : [],
|
|
108
109
|
`RIG_BASH_MODE=${effectiveMode}`,
|
|
109
110
|
`RIG_POLICY_FILE=${resolve(context.projectRoot, "rig/policy/policy.json")}`,
|
|
110
111
|
...context.eventBus.getEventsFile() ? [`RIG_EVENTS_FILE=${context.eventBus.getEventsFile()}`] : []
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@h-rig/cli",
|
|
3
|
-
"version": "0.0.6-alpha.
|
|
3
|
+
"version": "0.0.6-alpha.20",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Rig package",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -23,9 +23,10 @@
|
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@clack/prompts": "^1.2.0",
|
|
26
|
-
"@rig/core": "npm:@h-rig/core@0.0.6-alpha.
|
|
27
|
-
"@rig/runtime": "npm:@h-rig/runtime@0.0.6-alpha.
|
|
28
|
-
"@rig/client": "npm:@h-rig/client@0.0.6-alpha.
|
|
26
|
+
"@rig/core": "npm:@h-rig/core@0.0.6-alpha.20",
|
|
27
|
+
"@rig/runtime": "npm:@h-rig/runtime@0.0.6-alpha.20",
|
|
28
|
+
"@rig/client": "npm:@h-rig/client@0.0.6-alpha.20",
|
|
29
|
+
"@rig/server": "npm:@h-rig/server@0.0.6-alpha.20",
|
|
29
30
|
"picocolors": "^1.1.1"
|
|
30
31
|
}
|
|
31
32
|
}
|