@h-rig/cli 0.0.6-alpha.90 → 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 (118) hide show
  1. package/README.md +18 -19
  2. package/dist/bin/build-rig-binaries.js +22 -10
  3. package/dist/bin/rig.d.ts +71 -1
  4. package/dist/bin/rig.js +15078 -11169
  5. package/dist/config/rig-default-config.yml +5 -0
  6. package/dist/src/app/drone-ui.d.ts +11 -14
  7. package/dist/src/app/drone-ui.js +70 -86
  8. package/dist/src/commands/_async-ui.d.ts +1 -4
  9. package/dist/src/commands/_async-ui.js +9 -111
  10. package/dist/src/commands/_cli-format.d.ts +16 -9
  11. package/dist/src/commands/_cli-format.js +167 -295
  12. package/dist/src/commands/_connection-state.d.ts +11 -1
  13. package/dist/src/commands/_connection-state.js +50 -5
  14. package/dist/src/commands/_doctor-checks.d.ts +0 -6
  15. package/dist/src/commands/_doctor-checks.js +79 -382
  16. package/dist/src/commands/_help-catalog.d.ts +1 -1
  17. package/dist/src/commands/_help-catalog.js +217 -157
  18. package/dist/src/commands/_inprocess-services.d.ts +33 -0
  19. package/dist/src/commands/_inprocess-services.js +102 -0
  20. package/dist/src/commands/_json-output.js +4 -0
  21. package/dist/src/commands/_lazy-reconcile.d.ts +34 -0
  22. package/dist/src/commands/_lazy-reconcile.js +102 -0
  23. package/dist/src/commands/_paths.js +1 -1
  24. package/dist/src/commands/_pi-frontend.d.ts +18 -10
  25. package/dist/src/commands/_pi-frontend.js +37 -715
  26. package/dist/src/commands/_pi-install.js +18 -36
  27. package/dist/src/commands/_policy.d.ts +1 -1
  28. package/dist/src/commands/_policy.js +56 -15
  29. package/dist/src/commands/_run-bridge.d.ts +114 -0
  30. package/dist/src/commands/_run-bridge.js +387 -0
  31. package/dist/src/commands/_run-diagnostics.d.ts +9 -0
  32. package/dist/src/commands/_run-diagnostics.js +51 -0
  33. package/dist/src/commands/_run-driver-helpers.d.ts +8 -81
  34. package/dist/src/commands/_run-driver-helpers.js +79 -283
  35. package/dist/src/commands/_run-projection.d.ts +50 -0
  36. package/dist/src/commands/_run-projection.js +349 -0
  37. package/dist/src/commands/_run-subcommands.d.ts +3 -0
  38. package/dist/src/commands/_run-subcommands.js +31 -0
  39. package/dist/src/commands/_spinner.js +1 -1
  40. package/dist/src/commands/agent.d.ts +1 -1
  41. package/dist/src/commands/agent.js +8559 -239
  42. package/dist/src/commands/dist.d.ts +1 -1
  43. package/dist/src/commands/dist.js +27 -19
  44. package/dist/src/commands/doctor.d.ts +1 -1
  45. package/dist/src/commands/doctor.js +93 -475
  46. package/dist/src/commands/github.d.ts +1 -1
  47. package/dist/src/commands/github.js +113 -387
  48. package/dist/src/commands/inbox.d.ts +22 -24
  49. package/dist/src/commands/inbox.js +420 -691
  50. package/dist/src/commands/init.d.ts +6 -16
  51. package/dist/src/commands/init.js +334 -971
  52. package/dist/src/commands/inspect.d.ts +19 -2
  53. package/dist/src/commands/inspect.js +644 -610
  54. package/dist/src/commands/pi.d.ts +1 -1
  55. package/dist/src/commands/plugin.d.ts +1 -1
  56. package/dist/src/commands/plugin.js +486 -7
  57. package/dist/src/commands/profile-and-review.d.ts +1 -1
  58. package/dist/src/commands/profile-and-review.js +94 -56
  59. package/dist/src/commands/queue.js +1 -21
  60. package/dist/src/commands/remote.d.ts +1 -1
  61. package/dist/src/commands/remote.js +837 -14
  62. package/dist/src/commands/repo-git-harness.d.ts +1 -1
  63. package/dist/src/commands/repo-git-harness.js +57 -14
  64. package/dist/src/commands/run.d.ts +20 -2
  65. package/dist/src/commands/run.js +17579 -1759
  66. package/dist/src/commands/server.d.ts +2 -6
  67. package/dist/src/commands/server.js +141 -723
  68. package/dist/src/commands/setup.d.ts +1 -1
  69. package/dist/src/commands/setup.js +102 -484
  70. package/dist/src/commands/stats.d.ts +13 -10
  71. package/dist/src/commands/stats.js +689 -761
  72. package/dist/src/commands/task-run-driver.d.ts +50 -88
  73. package/dist/src/commands/task-run-driver.js +116 -2717
  74. package/dist/src/commands/task.d.ts +34 -13
  75. package/dist/src/commands/task.js +668 -2523
  76. package/dist/src/commands/test.d.ts +1 -1
  77. package/dist/src/commands/triage.d.ts +11 -0
  78. package/dist/src/commands/triage.js +227 -0
  79. package/dist/src/commands/workspace.d.ts +1 -1
  80. package/dist/src/commands.d.ts +0 -16
  81. package/dist/src/commands.js +16657 -12250
  82. package/dist/src/index.js +16528 -12497
  83. package/dist/src/launcher.js +4 -0
  84. package/dist/src/operator-cli.d.ts +2 -0
  85. package/dist/src/operator-cli.js +17837 -0
  86. package/dist/src/operator-entry.d.ts +1 -0
  87. package/dist/src/operator-entry.js +3 -0
  88. package/package.json +18 -12
  89. package/dist/src/app/board.d.ts +0 -23
  90. package/dist/src/app/board.js +0 -1786
  91. package/dist/src/app/theme.d.ts +0 -47
  92. package/dist/src/app/theme.js +0 -150
  93. package/dist/src/commands/_authority-runs.d.ts +0 -22
  94. package/dist/src/commands/_authority-runs.js +0 -110
  95. package/dist/src/commands/_operator-surface.d.ts +0 -34
  96. package/dist/src/commands/_operator-surface.js +0 -220
  97. package/dist/src/commands/_operator-view.d.ts +0 -30
  98. package/dist/src/commands/_operator-view.js +0 -1070
  99. package/dist/src/commands/_preflight.d.ts +0 -22
  100. package/dist/src/commands/_preflight.js +0 -540
  101. package/dist/src/commands/_run-replay.d.ts +0 -24
  102. package/dist/src/commands/_run-replay.js +0 -142
  103. package/dist/src/commands/_server-client.d.ts +0 -186
  104. package/dist/src/commands/_server-client.js +0 -681
  105. package/dist/src/commands/_snapshot-upload.d.ts +0 -39
  106. package/dist/src/commands/_snapshot-upload.js +0 -455
  107. package/dist/src/commands/_task-picker.d.ts +0 -9
  108. package/dist/src/commands/_task-picker.js +0 -201
  109. package/dist/src/commands/browser.d.ts +0 -65
  110. package/dist/src/commands/browser.js +0 -1173
  111. package/dist/src/commands/connect.d.ts +0 -7
  112. package/dist/src/commands/connect.js +0 -419
  113. package/dist/src/commands/inspector.d.ts +0 -3
  114. package/dist/src/commands/inspector.js +0 -263
  115. package/dist/src/commands/task-report-bug.d.ts +0 -19
  116. package/dist/src/commands/task-report-bug.js +0 -1281
  117. package/dist/src/report-bug.d.ts +0 -44
  118. 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 `artifacts/<task-id>/bug-report/` (relative to the resolved monorepo root), 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.
@@ -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() {
package/dist/bin/rig.d.ts CHANGED
@@ -1,2 +1,72 @@
1
- #!/usr/bin/env bun
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>;
2
72
  export {};