@h-rig/cli 0.0.6-alpha.93 → 0.0.6-alpha.95
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 +6 -27
- package/bin/rig.js +16 -0
- package/package.json +14 -40
- package/dist/bin/build-rig-binaries.d.ts +0 -2
- package/dist/bin/build-rig-binaries.js +0 -119
- package/dist/bin/rig.d.ts +0 -72
- package/dist/bin/rig.js +0 -17845
- package/dist/config/rig-default-config.yml +0 -5
- package/dist/src/app/drone-ui.d.ts +0 -34
- package/dist/src/app/drone-ui.js +0 -278
- package/dist/src/commands/_async-ui.d.ts +0 -10
- package/dist/src/commands/_async-ui.js +0 -121
- package/dist/src/commands/_cli-format.d.ts +0 -56
- package/dist/src/commands/_cli-format.js +0 -319
- package/dist/src/commands/_connection-state.d.ts +0 -54
- package/dist/src/commands/_connection-state.js +0 -187
- package/dist/src/commands/_doctor-checks.d.ts +0 -46
- package/dist/src/commands/_doctor-checks.js +0 -352
- package/dist/src/commands/_help-catalog.d.ts +0 -51
- package/dist/src/commands/_help-catalog.js +0 -502
- package/dist/src/commands/_inprocess-services.d.ts +0 -33
- package/dist/src/commands/_inprocess-services.js +0 -102
- package/dist/src/commands/_json-output.d.ts +0 -11
- package/dist/src/commands/_json-output.js +0 -60
- package/dist/src/commands/_lazy-reconcile.d.ts +0 -34
- package/dist/src/commands/_lazy-reconcile.js +0 -102
- package/dist/src/commands/_parsers.d.ts +0 -15
- package/dist/src/commands/_parsers.js +0 -114
- package/dist/src/commands/_paths.d.ts +0 -11
- package/dist/src/commands/_paths.js +0 -50
- package/dist/src/commands/_pi-frontend.d.ts +0 -35
- package/dist/src/commands/_pi-frontend.js +0 -64
- package/dist/src/commands/_pi-install.d.ts +0 -42
- package/dist/src/commands/_pi-install.js +0 -167
- package/dist/src/commands/_policy.d.ts +0 -8
- package/dist/src/commands/_policy.js +0 -127
- package/dist/src/commands/_probes.d.ts +0 -1
- package/dist/src/commands/_probes.js +0 -13
- package/dist/src/commands/_run-bridge.d.ts +0 -114
- package/dist/src/commands/_run-bridge.js +0 -387
- package/dist/src/commands/_run-diagnostics.d.ts +0 -9
- package/dist/src/commands/_run-diagnostics.js +0 -51
- package/dist/src/commands/_run-driver-helpers.d.ts +0 -26
- package/dist/src/commands/_run-driver-helpers.js +0 -138
- package/dist/src/commands/_run-projection.d.ts +0 -50
- package/dist/src/commands/_run-projection.js +0 -349
- package/dist/src/commands/_run-subcommands.d.ts +0 -3
- package/dist/src/commands/_run-subcommands.js +0 -31
- package/dist/src/commands/_spinner.d.ts +0 -25
- package/dist/src/commands/_spinner.js +0 -65
- package/dist/src/commands/agent.d.ts +0 -3
- package/dist/src/commands/agent.js +0 -8837
- package/dist/src/commands/dist.d.ts +0 -28
- package/dist/src/commands/dist.js +0 -417
- package/dist/src/commands/doctor.d.ts +0 -3
- package/dist/src/commands/doctor.js +0 -480
- package/dist/src/commands/github.d.ts +0 -3
- package/dist/src/commands/github.js +0 -342
- package/dist/src/commands/inbox.d.ts +0 -28
- package/dist/src/commands/inbox.js +0 -579
- package/dist/src/commands/init.d.ts +0 -64
- package/dist/src/commands/init.js +0 -1541
- package/dist/src/commands/inspect.d.ts +0 -20
- package/dist/src/commands/inspect.js +0 -764
- package/dist/src/commands/pi.d.ts +0 -3
- package/dist/src/commands/pi.js +0 -177
- package/dist/src/commands/plugin.d.ts +0 -16
- package/dist/src/commands/plugin.js +0 -714
- package/dist/src/commands/profile-and-review.d.ts +0 -4
- package/dist/src/commands/profile-and-review.js +0 -223
- package/dist/src/commands/queue.d.ts +0 -3
- package/dist/src/commands/queue.js +0 -197
- package/dist/src/commands/remote.d.ts +0 -3
- package/dist/src/commands/remote.js +0 -1337
- package/dist/src/commands/repo-git-harness.d.ts +0 -5
- package/dist/src/commands/repo-git-harness.js +0 -271
- package/dist/src/commands/run.d.ts +0 -21
- package/dist/src/commands/run.js +0 -17837
- package/dist/src/commands/server.d.ts +0 -3
- package/dist/src/commands/server.js +0 -249
- package/dist/src/commands/setup.d.ts +0 -16
- package/dist/src/commands/setup.js +0 -644
- package/dist/src/commands/stats.d.ts +0 -15
- package/dist/src/commands/stats.js +0 -979
- package/dist/src/commands/task-run-driver.d.ts +0 -94
- package/dist/src/commands/task-run-driver.js +0 -203
- package/dist/src/commands/task.d.ts +0 -35
- package/dist/src/commands/task.js +0 -818
- package/dist/src/commands/test.d.ts +0 -3
- package/dist/src/commands/test.js +0 -46
- package/dist/src/commands/triage.d.ts +0 -11
- package/dist/src/commands/triage.js +0 -227
- package/dist/src/commands/workspace.d.ts +0 -3
- package/dist/src/commands/workspace.js +0 -130
- package/dist/src/commands.d.ts +0 -13
- package/dist/src/commands.js +0 -17969
- package/dist/src/index.d.ts +0 -4
- package/dist/src/index.js +0 -17981
- package/dist/src/launcher.d.ts +0 -61
- package/dist/src/launcher.js +0 -199
- package/dist/src/operator-cli.d.ts +0 -2
- package/dist/src/operator-cli.js +0 -17837
- package/dist/src/operator-entry.d.ts +0 -1
- package/dist/src/operator-entry.js +0 -3
- package/dist/src/runner.d.ts +0 -47
- package/dist/src/runner.js +0 -267
- package/dist/src/withMutedConsole.d.ts +0 -2
- package/dist/src/withMutedConsole.js +0 -42
package/README.md
CHANGED
|
@@ -1,29 +1,8 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @h-rig/cli
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Installs the prebuilt, self-contained `rig` binary for your platform via an os/cpu-gated optional dependency, then launches it.
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
OMP collab joins
|
|
10
|
-
- fence legacy control-plane subcommands so retained automation paths are not
|
|
11
|
-
advertised as the current product flow
|
|
12
|
-
|
|
13
|
-
## Common commands
|
|
14
|
-
|
|
15
|
-
- `bun run rig` — open OMP with the Rig cockpit for the current workspace
|
|
16
|
-
- `bun run rig -- --workspace /path/to/repo` — open the cockpit scoped to a
|
|
17
|
-
specific workspace
|
|
18
|
-
- `bun run rig -- join <collab-link>` — join an encrypted OMP collab session
|
|
19
|
-
- `bun run rig -- --help` — show the root OMP/cockpit help
|
|
20
|
-
|
|
21
|
-
## Notes
|
|
22
|
-
|
|
23
|
-
- Root command routing lives in `bin/rig.ts`; it forwards OMP launch/join/acp
|
|
24
|
-
arguments with `@rig/rig-extension` injected.
|
|
25
|
-
- Legacy groups such as `init`, `task`, `doctor`, `run`, `inspect`, `stats`,
|
|
26
|
-
and `inbox` must stay rejected or clearly compatibility-routed at the public
|
|
27
|
-
root.
|
|
28
|
-
- CLI behavior should stay thin and delegate product behavior to OMP extension
|
|
29
|
-
surfaces or narrow compatibility modules.
|
|
5
|
+
```
|
|
6
|
+
bun add -g @h-rig/cli # or: npm i -g @h-rig/cli
|
|
7
|
+
rig --help
|
|
8
|
+
```
|
package/bin/rig.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
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 exe = process.platform === "win32" ? "rig.exe" : "rig";
|
|
7
|
+
let bin;
|
|
8
|
+
try { bin = require.resolve("@h-rig/cli-" + tag + "/" + exe); } catch (_) {}
|
|
9
|
+
if (!bin) {
|
|
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 res = spawnSync(bin, process.argv.slice(2), { stdio: "inherit" });
|
|
15
|
+
if (res.error) { console.error(String(res.error.message || res.error)); process.exit(1); }
|
|
16
|
+
process.exit(res.status == null ? 1 : res.status);
|
package/package.json
CHANGED
|
@@ -1,45 +1,19 @@
|
|
|
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
|
-
"types": "./dist/src/index.d.ts",
|
|
14
|
-
"import": "./dist/src/index.js"
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
"engines": {
|
|
18
|
-
"bun": ">=1.3.11"
|
|
19
|
-
},
|
|
20
|
-
"main": "./dist/src/index.js",
|
|
21
|
-
"module": "./dist/src/index.js",
|
|
22
|
-
"types": "./dist/src/index.d.ts",
|
|
3
|
+
"version": "0.0.6-alpha.95",
|
|
4
|
+
"description": "Rig CLI — installs the prebuilt single-file rig binary for your platform.",
|
|
5
|
+
"license": "MIT",
|
|
23
6
|
"bin": {
|
|
24
|
-
"rig": "
|
|
7
|
+
"rig": "bin/rig.js"
|
|
25
8
|
},
|
|
26
|
-
"
|
|
27
|
-
"@
|
|
28
|
-
"@
|
|
29
|
-
"@
|
|
30
|
-
"@
|
|
31
|
-
"@rig/
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
"@rig/rig-host": "npm:@h-rig/rig-host@0.0.6-alpha.93",
|
|
37
|
-
"@rig/runtime": "npm:@h-rig/runtime@0.0.6-alpha.93",
|
|
38
|
-
"@rig/shared": "npm:@h-rig/shared@0.0.6-alpha.93",
|
|
39
|
-
"@rig/standard-plugin": "npm:@h-rig/standard-plugin@0.0.6-alpha.93",
|
|
40
|
-
"@xterm/headless": "^6.0.0",
|
|
41
|
-
"effect": "4.0.0-beta.78",
|
|
42
|
-
"picocolors": "^1.1.1",
|
|
43
|
-
"react": "^19.2.0"
|
|
44
|
-
}
|
|
9
|
+
"optionalDependencies": {
|
|
10
|
+
"@h-rig/cli-darwin-arm64": "0.0.6-alpha.95",
|
|
11
|
+
"@h-rig/cli-darwin-x64": "0.0.6-alpha.95",
|
|
12
|
+
"@h-rig/cli-linux-x64": "0.0.6-alpha.95",
|
|
13
|
+
"@h-rig/cli-linux-arm64": "0.0.6-alpha.95",
|
|
14
|
+
"@h-rig/cli-win32-x64": "0.0.6-alpha.95"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"bin"
|
|
18
|
+
]
|
|
45
19
|
}
|
|
@@ -1,119 +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, runtimeRigCliBinaryExternals } 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 configDir = resolve(outputDir, "config");
|
|
25
|
-
const runtimeDir = resolve(outputDir, "runtime", "rig");
|
|
26
|
-
mkdirSync(binDir, { recursive: true });
|
|
27
|
-
mkdirSync(configDir, { recursive: true });
|
|
28
|
-
mkdirSync(runtimeDir, { recursive: true });
|
|
29
|
-
const cliVersion = readCliVersion(rootDir);
|
|
30
|
-
await buildBinary("packages/cli/bin/rig.ts", resolve(binDir, "rig"), rootDir, {
|
|
31
|
-
"process.env.RIG_CLI_VERSION": JSON.stringify(cliVersion)
|
|
32
|
-
}, runtimeRigCliBinaryExternals);
|
|
33
|
-
await buildBinary("packages/runtime/bin/rig-agent-dispatch.ts", resolve(binDir, "rig-agent"), rootDir);
|
|
34
|
-
cpSync(resolve(rootDir, "packages/cli/config/rig-default-config.yml"), resolve(configDir, "rig-default-config.yml"));
|
|
35
|
-
for (const entry of [
|
|
36
|
-
"hooks",
|
|
37
|
-
"lib",
|
|
38
|
-
"tools",
|
|
39
|
-
"templates",
|
|
40
|
-
"policy",
|
|
41
|
-
"plugins",
|
|
42
|
-
"config.sh",
|
|
43
|
-
"task-config.json"
|
|
44
|
-
]) {
|
|
45
|
-
const source = resolve(rootDir, "rig", entry);
|
|
46
|
-
if (existsSync(source)) {
|
|
47
|
-
cpSync(source, resolve(runtimeDir, entry), { recursive: true });
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
const manifest = {
|
|
51
|
-
name: "project-rig-harness",
|
|
52
|
-
version: cliVersion,
|
|
53
|
-
builtAt: new Date().toISOString(),
|
|
54
|
-
gitHead: runCapture(["git", "rev-parse", "HEAD"], rootDir).stdout.trim() || "unknown",
|
|
55
|
-
bunVersion: Bun.version,
|
|
56
|
-
binaries: {
|
|
57
|
-
rig: "bin/rig",
|
|
58
|
-
rigAgent: "bin/rig-agent"
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
await Bun.write(resolve(outputDir, "manifest.json"), `${JSON.stringify(manifest, null, 2)}
|
|
62
|
-
`);
|
|
63
|
-
let archive = null;
|
|
64
|
-
if (args.archive) {
|
|
65
|
-
archive = `${outputDir}.tar.gz`;
|
|
66
|
-
const tar = await Bun.$`tar -czf ${archive} -C ${outputDir} .`.cwd(rootDir).quiet().nothrow();
|
|
67
|
-
if (tar.exitCode !== 0) {
|
|
68
|
-
throw new Error(`Failed to create archive: ${tar.stderr.toString() || tar.stdout.toString()}`);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
console.log("Build complete");
|
|
72
|
-
console.log(`- directory: ${outputDir}`);
|
|
73
|
-
if (archive)
|
|
74
|
-
console.log(`- archive: ${archive}`);
|
|
75
|
-
}
|
|
76
|
-
function parseArgs(argv) {
|
|
77
|
-
const args = { archive: true };
|
|
78
|
-
for (let i = 0;i < argv.length; i += 1) {
|
|
79
|
-
const current = argv[i];
|
|
80
|
-
if (current === "--output-dir") {
|
|
81
|
-
const value = argv[i + 1];
|
|
82
|
-
if (!value) {
|
|
83
|
-
throw new Error("Missing value for --output-dir");
|
|
84
|
-
}
|
|
85
|
-
args.outputDir = resolve(process.cwd(), value);
|
|
86
|
-
i += 1;
|
|
87
|
-
continue;
|
|
88
|
-
}
|
|
89
|
-
if (current === "--no-archive") {
|
|
90
|
-
args.archive = false;
|
|
91
|
-
continue;
|
|
92
|
-
}
|
|
93
|
-
throw new Error(`Unknown option: ${current}`);
|
|
94
|
-
}
|
|
95
|
-
return args;
|
|
96
|
-
}
|
|
97
|
-
async function buildBinary(source, output, cwd, define, external) {
|
|
98
|
-
await buildRuntimeBinary({
|
|
99
|
-
sourcePath: source,
|
|
100
|
-
outputPath: output,
|
|
101
|
-
cwd,
|
|
102
|
-
...define ? { define } : {},
|
|
103
|
-
...external ? { external } : {}
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
function timestamp() {
|
|
107
|
-
const date = new Date;
|
|
108
|
-
const yyyy = date.getFullYear();
|
|
109
|
-
const mm = `${date.getMonth() + 1}`.padStart(2, "0");
|
|
110
|
-
const dd = `${date.getDate()}`.padStart(2, "0");
|
|
111
|
-
const hh = `${date.getHours()}`.padStart(2, "0");
|
|
112
|
-
const min = `${date.getMinutes()}`.padStart(2, "0");
|
|
113
|
-
const sec = `${date.getSeconds()}`.padStart(2, "0");
|
|
114
|
-
return `${yyyy}${mm}${dd}-${hh}${min}${sec}`;
|
|
115
|
-
}
|
|
116
|
-
main().catch((error) => {
|
|
117
|
-
console.error(error instanceof Error ? error.message : error);
|
|
118
|
-
process.exit(1);
|
|
119
|
-
});
|
package/dist/bin/rig.d.ts
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
export declare function resolveRigServerEntrypointArgv(argv: readonly string[]): string[] | null;
|
|
2
|
-
export declare function stripRigServerEntrypointArg(argv: readonly string[]): string[];
|
|
3
|
-
export declare function runRigServerEntrypoint(argv?: readonly string[]): Promise<boolean>;
|
|
4
|
-
export type RigRootRoute = {
|
|
5
|
-
readonly kind: "omp";
|
|
6
|
-
readonly argv: readonly string[];
|
|
7
|
-
readonly workspaceRoot?: string;
|
|
8
|
-
} | {
|
|
9
|
-
readonly kind: "run";
|
|
10
|
-
readonly taskRef: string;
|
|
11
|
-
readonly title?: string;
|
|
12
|
-
readonly model?: string;
|
|
13
|
-
readonly prompt?: string;
|
|
14
|
-
readonly workspaceRoot?: string;
|
|
15
|
-
} | {
|
|
16
|
-
readonly kind: "help";
|
|
17
|
-
readonly argv: readonly string[];
|
|
18
|
-
} | {
|
|
19
|
-
readonly kind: "version";
|
|
20
|
-
} | {
|
|
21
|
-
readonly kind: "operator";
|
|
22
|
-
readonly argv: readonly string[];
|
|
23
|
-
readonly workspaceRoot?: string;
|
|
24
|
-
} | {
|
|
25
|
-
readonly kind: "unsupported";
|
|
26
|
-
readonly argv: readonly string[];
|
|
27
|
-
readonly message: string;
|
|
28
|
-
};
|
|
29
|
-
export declare function resolveRigDefaultConfigPath(): string;
|
|
30
|
-
export declare function resolveRigRootRoute(argv: readonly string[]): RigRootRoute;
|
|
31
|
-
type RigExtensionTask = {
|
|
32
|
-
readonly id: string;
|
|
33
|
-
readonly title?: string | null;
|
|
34
|
-
readonly status?: string | null;
|
|
35
|
-
readonly source?: string | null;
|
|
36
|
-
readonly url?: string | null;
|
|
37
|
-
readonly body?: string | null;
|
|
38
|
-
};
|
|
39
|
-
type RigExtensionServerState = {
|
|
40
|
-
readonly alias: string;
|
|
41
|
-
readonly kind: "local" | "remote";
|
|
42
|
-
readonly baseUrl?: string | null;
|
|
43
|
-
readonly projectRoot?: string | null;
|
|
44
|
-
readonly status?: string | null;
|
|
45
|
-
readonly taskSource?: string | null;
|
|
46
|
-
};
|
|
47
|
-
type RigExtensionAttachResult = {
|
|
48
|
-
readonly sessionPath?: string | null;
|
|
49
|
-
readonly joinLink?: string | null;
|
|
50
|
-
readonly collabSessionId?: string | null;
|
|
51
|
-
};
|
|
52
|
-
type RigExtensionServerBridge = {
|
|
53
|
-
readonly selectedServer: {
|
|
54
|
-
readServerState(): Promise<RigExtensionServerState>;
|
|
55
|
-
listTasks(): Promise<readonly RigExtensionTask[]>;
|
|
56
|
-
getTask(taskId: string): Promise<RigExtensionTask | null>;
|
|
57
|
-
dispatchTask(input: {
|
|
58
|
-
readonly taskId: string;
|
|
59
|
-
readonly title?: string | null;
|
|
60
|
-
}): Promise<{
|
|
61
|
-
runId: string;
|
|
62
|
-
}>;
|
|
63
|
-
attachRun(input: {
|
|
64
|
-
readonly runId: string;
|
|
65
|
-
readonly taskId?: string;
|
|
66
|
-
}): Promise<RigExtensionAttachResult | null>;
|
|
67
|
-
};
|
|
68
|
-
};
|
|
69
|
-
export declare function createRigExtensionBridge(projectRoot: string): RigExtensionServerBridge;
|
|
70
|
-
export declare function installRigExtensionBridge(projectRoot: string, bridge?: RigExtensionServerBridge): RigExtensionServerBridge;
|
|
71
|
-
export declare function runRigRootCli(argv?: readonly string[]): Promise<void>;
|
|
72
|
-
export {};
|