@h-rig/cli 0.0.6-alpha.9 → 0.0.6-alpha.91

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 (116) hide show
  1. package/README.md +18 -19
  2. package/dist/bin/build-rig-binaries.d.ts +2 -0
  3. package/dist/bin/build-rig-binaries.js +22 -10
  4. package/dist/bin/rig.d.ts +72 -0
  5. package/dist/bin/rig.js +15637 -7344
  6. package/dist/config/rig-default-config.yml +5 -0
  7. package/dist/src/app/drone-ui.d.ts +34 -0
  8. package/dist/src/app/drone-ui.js +278 -0
  9. package/dist/src/commands/_async-ui.d.ts +10 -0
  10. package/dist/src/commands/_async-ui.js +121 -0
  11. package/dist/src/commands/_cli-format.d.ts +56 -0
  12. package/dist/src/commands/_cli-format.js +319 -0
  13. package/dist/src/commands/_connection-state.d.ts +54 -0
  14. package/dist/src/commands/_connection-state.js +75 -11
  15. package/dist/src/commands/_doctor-checks.d.ts +46 -0
  16. package/dist/src/commands/_doctor-checks.js +100 -267
  17. package/dist/src/commands/_help-catalog.d.ts +51 -0
  18. package/dist/src/commands/_help-catalog.js +502 -0
  19. package/dist/src/commands/_inprocess-services.d.ts +33 -0
  20. package/dist/src/commands/_inprocess-services.js +102 -0
  21. package/dist/src/commands/_json-output.d.ts +11 -0
  22. package/dist/src/commands/_json-output.js +60 -0
  23. package/dist/src/commands/_lazy-reconcile.d.ts +34 -0
  24. package/dist/src/commands/_lazy-reconcile.js +102 -0
  25. package/dist/src/commands/_parsers.d.ts +15 -0
  26. package/dist/src/commands/_parsers.js +18 -11
  27. package/dist/src/commands/_paths.d.ts +11 -0
  28. package/dist/src/commands/_paths.js +1 -1
  29. package/dist/src/commands/_pi-frontend.d.ts +35 -0
  30. package/dist/src/commands/_pi-frontend.js +64 -0
  31. package/dist/src/commands/_pi-install.d.ts +42 -0
  32. package/dist/src/commands/_pi-install.js +19 -36
  33. package/dist/src/commands/_policy.d.ts +8 -0
  34. package/dist/src/commands/_policy.js +67 -19
  35. package/dist/src/commands/_probes.d.ts +1 -0
  36. package/dist/src/commands/_run-bridge.d.ts +114 -0
  37. package/dist/src/commands/_run-bridge.js +387 -0
  38. package/dist/src/commands/_run-diagnostics.d.ts +9 -0
  39. package/dist/src/commands/_run-diagnostics.js +51 -0
  40. package/dist/src/commands/_run-driver-helpers.d.ts +26 -0
  41. package/dist/src/commands/_run-driver-helpers.js +79 -230
  42. package/dist/src/commands/_run-projection.d.ts +50 -0
  43. package/dist/src/commands/_run-projection.js +349 -0
  44. package/dist/src/commands/_run-subcommands.d.ts +3 -0
  45. package/dist/src/commands/_run-subcommands.js +31 -0
  46. package/dist/src/commands/_spinner.d.ts +25 -0
  47. package/dist/src/commands/_spinner.js +65 -0
  48. package/dist/src/commands/agent.d.ts +3 -0
  49. package/dist/src/commands/agent.js +8575 -236
  50. package/dist/src/commands/dist.d.ts +28 -0
  51. package/dist/src/commands/dist.js +44 -29
  52. package/dist/src/commands/doctor.d.ts +3 -0
  53. package/dist/src/commands/doctor.js +219 -268
  54. package/dist/src/commands/github.d.ts +3 -0
  55. package/dist/src/commands/github.js +236 -188
  56. package/dist/src/commands/inbox.d.ts +28 -0
  57. package/dist/src/commands/inbox.js +530 -111
  58. package/dist/src/commands/init.d.ts +64 -0
  59. package/dist/src/commands/init.js +912 -705
  60. package/dist/src/commands/inspect.d.ts +20 -0
  61. package/dist/src/commands/inspect.js +709 -119
  62. package/dist/src/commands/pi.d.ts +3 -0
  63. package/dist/src/commands/pi.js +177 -0
  64. package/dist/src/commands/plugin.d.ts +16 -0
  65. package/dist/src/commands/plugin.js +576 -29
  66. package/dist/src/commands/profile-and-review.d.ts +4 -0
  67. package/dist/src/commands/profile-and-review.js +112 -67
  68. package/dist/src/commands/queue.d.ts +3 -0
  69. package/dist/src/commands/queue.js +20 -20
  70. package/dist/src/commands/remote.d.ts +3 -0
  71. package/dist/src/commands/remote.js +880 -50
  72. package/dist/src/commands/repo-git-harness.d.ts +5 -0
  73. package/dist/src/commands/repo-git-harness.js +78 -28
  74. package/dist/src/commands/run.d.ts +21 -0
  75. package/dist/src/commands/run.js +17701 -661
  76. package/dist/src/commands/server.d.ts +3 -0
  77. package/dist/src/commands/server.js +166 -303
  78. package/dist/src/commands/setup.d.ts +16 -0
  79. package/dist/src/commands/setup.js +244 -299
  80. package/dist/src/commands/stats.d.ts +15 -0
  81. package/dist/src/commands/stats.js +979 -0
  82. package/dist/src/commands/task-run-driver.d.ts +94 -0
  83. package/dist/src/commands/task-run-driver.js +116 -1961
  84. package/dist/src/commands/task.d.ts +35 -0
  85. package/dist/src/commands/task.js +676 -1201
  86. package/dist/src/commands/test.d.ts +3 -0
  87. package/dist/src/commands/test.js +15 -8
  88. package/dist/src/commands/triage.d.ts +11 -0
  89. package/dist/src/commands/triage.js +227 -0
  90. package/dist/src/commands/workspace.d.ts +3 -0
  91. package/dist/src/commands/workspace.js +18 -11
  92. package/dist/src/commands.d.ts +13 -0
  93. package/dist/src/commands.js +16792 -8055
  94. package/dist/src/index.d.ts +4 -0
  95. package/dist/src/index.js +16862 -8450
  96. package/dist/src/launcher.d.ts +61 -0
  97. package/dist/src/launcher.js +81 -13
  98. package/dist/src/operator-cli.d.ts +2 -0
  99. package/dist/src/operator-cli.js +17837 -0
  100. package/dist/src/operator-entry.d.ts +1 -0
  101. package/dist/src/operator-entry.js +3 -0
  102. package/dist/src/runner.d.ts +47 -0
  103. package/dist/src/runner.js +16 -22
  104. package/dist/src/withMutedConsole.d.ts +2 -0
  105. package/package.json +21 -8
  106. package/dist/src/commands/_authority-runs.js +0 -111
  107. package/dist/src/commands/_operator-view.js +0 -340
  108. package/dist/src/commands/_preflight.js +0 -478
  109. package/dist/src/commands/_server-client.js +0 -382
  110. package/dist/src/commands/_snapshot-upload.js +0 -331
  111. package/dist/src/commands/_task-picker.js +0 -48
  112. package/dist/src/commands/browser.js +0 -890
  113. package/dist/src/commands/connect.js +0 -180
  114. package/dist/src/commands/inspector.js +0 -256
  115. package/dist/src/commands/task-report-bug.js +0 -1083
  116. package/dist/src/report-bug.js +0 -260
package/README.md CHANGED
@@ -4,27 +4,26 @@
4
4
 
5
5
  ## Purpose
6
6
 
7
- - route operator commands into the runtime control plane
8
- - provide setup, server, task, review, queue, and profile entry points
7
+ - launch upstream OMP with the Rig extension cockpit loaded
8
+ - keep the public root UX centered on bare `rig`, `rig --workspace <path>`, and
9
+ OMP collab joins
10
+ - fence legacy control-plane subcommands so retained automation paths are not
11
+ advertised as the current product flow
9
12
 
10
- ## Common command
13
+ ## Common commands
11
14
 
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`
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
19
20
 
20
21
  ## Notes
21
22
 
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.
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.
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env bun
2
+ export {};
@@ -5,7 +5,7 @@
5
5
  import { cpSync, existsSync, mkdirSync, readFileSync } from "fs";
6
6
  import { resolve } from "path";
7
7
  import { runCapture } from "@rig/runtime/control-plane/native/utils";
8
- import { buildRuntimeBinary } from "@rig/runtime/binary-run";
8
+ import { buildRuntimeBinary, runtimeRigCliBinaryExternals } from "@rig/runtime/binary-run";
9
9
  function readCliVersion(rootDir) {
10
10
  try {
11
11
  const pkg = JSON.parse(readFileSync(resolve(rootDir, "packages/cli/package.json"), "utf-8"));
@@ -21,14 +21,17 @@ async function main() {
21
21
  const stamp = timestamp();
22
22
  const outputDir = args.outputDir || resolve(rootDir, ".rig/dist", `rig-${stamp}`);
23
23
  const binDir = resolve(outputDir, "bin");
24
+ const configDir = resolve(outputDir, "config");
24
25
  const runtimeDir = resolve(outputDir, "runtime", "rig");
25
26
  mkdirSync(binDir, { recursive: true });
27
+ mkdirSync(configDir, { recursive: true });
26
28
  mkdirSync(runtimeDir, { recursive: true });
27
29
  const cliVersion = readCliVersion(rootDir);
28
30
  await buildBinary("packages/cli/bin/rig.ts", resolve(binDir, "rig"), rootDir, {
29
31
  "process.env.RIG_CLI_VERSION": JSON.stringify(cliVersion)
30
- });
32
+ }, runtimeRigCliBinaryExternals);
31
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"));
32
35
  for (const entry of [
33
36
  "hooks",
34
37
  "lib",
@@ -57,17 +60,21 @@ async function main() {
57
60
  };
58
61
  await Bun.write(resolve(outputDir, "manifest.json"), `${JSON.stringify(manifest, null, 2)}
59
62
  `);
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()}`);
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
+ }
64
70
  }
65
71
  console.log("Build complete");
66
72
  console.log(`- directory: ${outputDir}`);
67
- console.log(`- archive: ${archive}`);
73
+ if (archive)
74
+ console.log(`- archive: ${archive}`);
68
75
  }
69
76
  function parseArgs(argv) {
70
- const args = {};
77
+ const args = { archive: true };
71
78
  for (let i = 0;i < argv.length; i += 1) {
72
79
  const current = argv[i];
73
80
  if (current === "--output-dir") {
@@ -79,16 +86,21 @@ function parseArgs(argv) {
79
86
  i += 1;
80
87
  continue;
81
88
  }
89
+ if (current === "--no-archive") {
90
+ args.archive = false;
91
+ continue;
92
+ }
82
93
  throw new Error(`Unknown option: ${current}`);
83
94
  }
84
95
  return args;
85
96
  }
86
- async function buildBinary(source, output, cwd, define) {
97
+ async function buildBinary(source, output, cwd, define, external) {
87
98
  await buildRuntimeBinary({
88
99
  sourcePath: source,
89
100
  outputPath: output,
90
101
  cwd,
91
- ...define ? { define } : {}
102
+ ...define ? { define } : {},
103
+ ...external ? { external } : {}
92
104
  });
93
105
  }
94
106
  function timestamp() {
@@ -0,0 +1,72 @@
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 {};