@h-rig/cli 0.0.6-alpha.77 → 0.0.6-alpha.79

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 (91) hide show
  1. package/dist/bin/build-rig-binaries.d.ts +2 -0
  2. package/dist/bin/rig.d.ts +2 -0
  3. package/dist/bin/rig.js +10214 -9309
  4. package/dist/src/app/board.d.ts +23 -0
  5. package/dist/src/app/board.js +1786 -0
  6. package/dist/src/app/drone-ui.d.ts +37 -0
  7. package/dist/src/app/drone-ui.js +294 -0
  8. package/dist/src/app/theme.d.ts +47 -0
  9. package/dist/src/{commands/_tui-theme.js → app/theme.js} +16 -1
  10. package/dist/src/commands/_async-ui.d.ts +13 -0
  11. package/dist/src/commands/_async-ui.js +74 -3
  12. package/dist/src/commands/_authority-runs.d.ts +22 -0
  13. package/dist/src/commands/_cli-format.d.ts +49 -0
  14. package/dist/src/commands/_cli-format.js +26 -8
  15. package/dist/src/commands/_connection-state.d.ts +44 -0
  16. package/dist/src/commands/_doctor-checks.d.ts +52 -0
  17. package/dist/src/commands/_doctor-checks.js +3 -1
  18. package/dist/src/commands/_help-catalog.d.ts +51 -0
  19. package/dist/src/commands/_help-catalog.js +9 -70
  20. package/dist/src/commands/_json-output.d.ts +11 -0
  21. package/dist/src/commands/_operator-surface.d.ts +34 -0
  22. package/dist/src/commands/_operator-view.d.ts +30 -0
  23. package/dist/src/commands/_operator-view.js +184 -7
  24. package/dist/src/commands/_parsers.d.ts +15 -0
  25. package/dist/src/commands/_paths.d.ts +11 -0
  26. package/dist/src/commands/_pi-frontend.d.ts +27 -0
  27. package/dist/src/commands/_pi-frontend.js +184 -7
  28. package/dist/src/commands/_pi-install.d.ts +42 -0
  29. package/dist/src/commands/_pi-install.js +1 -1
  30. package/dist/src/commands/_policy.d.ts +8 -0
  31. package/dist/src/commands/_preflight.d.ts +22 -0
  32. package/dist/src/commands/_preflight.js +3 -1
  33. package/dist/src/commands/_probes.d.ts +1 -0
  34. package/dist/src/commands/_run-driver-helpers.d.ts +99 -0
  35. package/dist/src/commands/_run-replay.d.ts +24 -0
  36. package/dist/src/commands/_server-client.d.ts +186 -0
  37. package/dist/src/commands/_server-client.js +3 -1
  38. package/dist/src/commands/_snapshot-upload.d.ts +39 -0
  39. package/dist/src/commands/_snapshot-upload.js +3 -1
  40. package/dist/src/commands/_spinner.d.ts +25 -0
  41. package/dist/src/commands/_task-picker.d.ts +9 -0
  42. package/dist/src/commands/_task-picker.js +132 -7
  43. package/dist/src/commands/agent.d.ts +3 -0
  44. package/dist/src/commands/browser.d.ts +65 -0
  45. package/dist/src/commands/browser.js +306 -30
  46. package/dist/src/commands/connect.d.ts +7 -0
  47. package/dist/src/commands/connect.js +130 -64
  48. package/dist/src/commands/dist.d.ts +28 -0
  49. package/dist/src/commands/doctor.d.ts +3 -0
  50. package/dist/src/commands/doctor.js +77 -4
  51. package/dist/src/commands/github.d.ts +3 -0
  52. package/dist/src/commands/github.js +77 -4
  53. package/dist/src/commands/inbox.d.ts +30 -0
  54. package/dist/src/commands/inbox.js +101 -78
  55. package/dist/src/commands/init.d.ts +74 -0
  56. package/dist/src/commands/init.js +350 -10
  57. package/dist/src/commands/inspect.d.ts +3 -0
  58. package/dist/src/commands/inspect.js +77 -4
  59. package/dist/src/commands/inspector.d.ts +3 -0
  60. package/dist/src/commands/pi.d.ts +3 -0
  61. package/dist/src/commands/plugin.d.ts +16 -0
  62. package/dist/src/commands/profile-and-review.d.ts +4 -0
  63. package/dist/src/commands/queue.d.ts +3 -0
  64. package/dist/src/commands/remote.d.ts +3 -0
  65. package/dist/src/commands/repo-git-harness.d.ts +5 -0
  66. package/dist/src/commands/run.d.ts +3 -0
  67. package/dist/src/commands/run.js +195 -69
  68. package/dist/src/commands/server.d.ts +7 -0
  69. package/dist/src/commands/server.js +133 -65
  70. package/dist/src/commands/setup.d.ts +16 -0
  71. package/dist/src/commands/setup.js +77 -4
  72. package/dist/src/commands/stats.d.ts +12 -0
  73. package/dist/src/commands/stats.js +57 -113
  74. package/dist/src/commands/task-report-bug.d.ts +19 -0
  75. package/dist/src/commands/task-report-bug.js +231 -40
  76. package/dist/src/commands/task-run-driver.d.ts +132 -0
  77. package/dist/src/commands/task-run-driver.js +26 -3
  78. package/dist/src/commands/task.d.ts +14 -0
  79. package/dist/src/commands/task.js +341 -229
  80. package/dist/src/commands/test.d.ts +3 -0
  81. package/dist/src/commands/workspace.d.ts +3 -0
  82. package/dist/src/commands.d.ts +29 -0
  83. package/dist/src/commands.js +10194 -9289
  84. package/dist/src/index.d.ts +4 -0
  85. package/dist/src/index.js +10200 -9295
  86. package/dist/src/launcher.d.ts +61 -0
  87. package/dist/src/report-bug.d.ts +44 -0
  88. package/dist/src/runner.d.ts +47 -0
  89. package/dist/src/withMutedConsole.d.ts +2 -0
  90. package/package.json +10 -9
  91. package/dist/src/commands/_operator-board.js +0 -730
@@ -0,0 +1,61 @@
1
+ import type { RunnerContext } from "./runner";
2
+ export type PolicyModeValue = "off" | "observe" | "enforce";
3
+ export interface ResolveProjectRootOptions {
4
+ readonly envProjectRoot?: string;
5
+ readonly execPath?: string;
6
+ readonly importDir?: string;
7
+ readonly cwd?: string;
8
+ }
9
+ export interface CliIo {
10
+ readonly log: (message: string) => void;
11
+ readonly error: (message: string) => void;
12
+ }
13
+ export interface RigCliRunOptions {
14
+ readonly argv?: readonly string[];
15
+ readonly io?: CliIo;
16
+ readonly envProjectRoot?: string;
17
+ readonly execPath?: string;
18
+ readonly importDir?: string;
19
+ readonly cwd?: string;
20
+ }
21
+ export interface RigCliModule {
22
+ readonly CliError: new (message: string, exitCode?: number) => Error & {
23
+ exitCode: number;
24
+ };
25
+ execute: (context: RunnerContext, args: string[]) => Promise<unknown>;
26
+ initializeRuntime: (options: {
27
+ projectRoot: string;
28
+ dryRun: boolean;
29
+ outputMode: "json" | "text";
30
+ runId?: string | undefined;
31
+ policyMode?: PolicyModeValue | undefined;
32
+ }) => Promise<RunnerContext>;
33
+ loadPolicy(projectRoot: string): {
34
+ mode: PolicyModeValue;
35
+ };
36
+ takeFlag(args: string[], flag: string): {
37
+ value: boolean;
38
+ rest: string[];
39
+ };
40
+ takeOption(args: string[], option: string): {
41
+ value?: string;
42
+ rest: string[];
43
+ };
44
+ withProjectRoot(projectRoot: string): void;
45
+ }
46
+ export declare function parsePolicyMode(value: string | undefined): PolicyModeValue | undefined;
47
+ export declare function resolveProjectRoot({ envProjectRoot, execPath, importDir, cwd, }: ResolveProjectRootOptions): string;
48
+ export interface CliErrorPayload {
49
+ readonly ok: false;
50
+ readonly code: string;
51
+ readonly message: string;
52
+ readonly exitCode: number;
53
+ /** Remediation hint (next command to run); rendered as `Next: <hint>`. */
54
+ readonly hint?: string;
55
+ readonly stack?: string;
56
+ }
57
+ export declare function normalizeCliErrorPayload(error: unknown, CliErrorClass: RigCliModule["CliError"], options?: {
58
+ readonly debug?: boolean;
59
+ }): CliErrorPayload;
60
+ export declare function runRigCli(module: RigCliModule, options?: RigCliRunOptions): Promise<void>;
61
+ export declare function hydrateProcessEnvFromDotEnv(projectRoot: string): void;
@@ -0,0 +1,44 @@
1
+ export type BrowserBugEnvironment = "local" | "shared-dev" | "staging" | "production" | "custom";
2
+ export type BrowserBugReportInput = {
3
+ projectRoot: string;
4
+ outputRoot: string;
5
+ title: string;
6
+ url: string;
7
+ browserRequired?: boolean;
8
+ environment: BrowserBugEnvironment | string;
9
+ preset: string;
10
+ profile: string;
11
+ attachUrl: string;
12
+ stateDir: string;
13
+ mode: string;
14
+ viewport: string;
15
+ summary: string;
16
+ steps: string[];
17
+ expected: string;
18
+ actual: string;
19
+ evidence: string[];
20
+ screenshots?: string[];
21
+ assets?: string[];
22
+ issueId?: string;
23
+ slug?: string;
24
+ overwrite: boolean;
25
+ };
26
+ export type BrowserBugReportResult = {
27
+ slug: string;
28
+ reportDir: string;
29
+ taskPath: string;
30
+ browserPath: string | null;
31
+ manifestPath: string;
32
+ assetDir: string;
33
+ screenshotDir: string;
34
+ copiedAssets: string[];
35
+ copiedScreenshots: string[];
36
+ };
37
+ export declare function slugifyBugTitle(value: string): string;
38
+ export declare function defaultBrowserBugProfile(title: string): string;
39
+ export declare function defaultBrowserBugOptions(environment: string): {
40
+ preset: string;
41
+ attachUrl: string;
42
+ stateDir: string;
43
+ };
44
+ export declare function createBugReportFiles(input: BrowserBugReportInput): BrowserBugReportResult;
@@ -0,0 +1,47 @@
1
+ import { CliError as RuntimeCliError } from "@rig/runtime/control-plane/errors";
2
+ import type { PolicyMode } from "@rig/runtime/control-plane/runtime/guard-types";
3
+ import type { RunnerContext } from "@rig/runtime/control-plane/runtime/runner-context";
4
+ import { buildBinary } from "@rig/runtime/control-plane/runtime/isolation";
5
+ import type { CommandExecutionResult, OutputMode } from "@rig/runtime/control-plane/runtime/types";
6
+ export type { RunnerContext } from "@rig/runtime/control-plane/runtime/runner-context";
7
+ /**
8
+ * CLI-side error with an optional remediation hint. The hint is rendered on
9
+ * its own line as `Next: <hint>` (and carried in the --json error payload),
10
+ * so every failure names the next command to run. Extends the runtime
11
+ * CliError so `instanceof` checks against either class keep working.
12
+ */
13
+ export declare class CliError extends RuntimeCliError {
14
+ readonly hint?: string;
15
+ constructor(message: string, exitCode?: number, options?: {
16
+ readonly hint?: string;
17
+ });
18
+ }
19
+ export declare function withProjectRoot(projectRoot: string): void;
20
+ export declare function formatCommand(parts: string[]): string;
21
+ type AgentShellBuild = typeof buildBinary;
22
+ type AgentShellMaterializationOptions = {
23
+ readonly env?: Record<string, string | undefined>;
24
+ readonly cwd?: string;
25
+ readonly moduleDir?: string;
26
+ readonly build?: AgentShellBuild;
27
+ };
28
+ export declare function resolveAgentMaterializationSourceRoot(projectRoot: string, options?: AgentShellMaterializationOptions): string;
29
+ export declare function ensureAgentShellBinary(projectRoot: string, options?: AgentShellMaterializationOptions): Promise<string>;
30
+ export declare function initializeRuntime(options: {
31
+ projectRoot: string;
32
+ dryRun: boolean;
33
+ outputMode: OutputMode;
34
+ runId?: string;
35
+ policyMode?: PolicyMode;
36
+ }): Promise<RunnerContext>;
37
+ export declare function runCommand(context: RunnerContext, parts: string[]): Promise<CommandExecutionResult>;
38
+ export declare function takeFlag(args: string[], flag: string): {
39
+ value: boolean;
40
+ rest: string[];
41
+ };
42
+ export declare function takeOption(args: string[], option: string): {
43
+ value: string | undefined;
44
+ rest: string[];
45
+ };
46
+ export declare function requireNoExtraArgs(args: string[], usage: string): void;
47
+ export declare function requireTask(taskId: string | undefined, usage: string): string;
@@ -0,0 +1,2 @@
1
+ export declare function withMutedConsole<T>(mute: boolean, fn: () => Promise<T>): Promise<T>;
2
+ export declare function withMutedConsole<T>(mute: boolean, fn: () => T): T;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@h-rig/cli",
3
- "version": "0.0.6-alpha.77",
3
+ "version": "0.0.6-alpha.79",
4
4
  "type": "module",
5
5
  "description": "Rig package",
6
6
  "license": "UNLICENSED",
@@ -10,6 +10,7 @@
10
10
  ],
11
11
  "exports": {
12
12
  ".": {
13
+ "types": "./dist/src/index.d.ts",
13
14
  "import": "./dist/src/index.js"
14
15
  }
15
16
  },
@@ -18,20 +19,20 @@
18
19
  },
19
20
  "main": "./dist/src/index.js",
20
21
  "module": "./dist/src/index.js",
22
+ "types": "./dist/src/index.d.ts",
21
23
  "bin": {
22
24
  "rig": "./dist/bin/rig.js"
23
25
  },
24
26
  "dependencies": {
25
- "@clack/prompts": "^1.2.0",
26
27
  "@earendil-works/pi-coding-agent": "0.79.0",
27
28
  "@earendil-works/pi-tui": "^0.79.0",
28
- "@rig/client": "npm:@h-rig/client@0.0.6-alpha.77",
29
- "@rig/contracts": "npm:@h-rig/contracts@0.0.6-alpha.77",
30
- "@rig/core": "npm:@h-rig/core@0.0.6-alpha.77",
31
- "@rig/pi-rig": "npm:@h-rig/pi-rig@0.0.6-alpha.77",
32
- "@rig/runtime": "npm:@h-rig/runtime@0.0.6-alpha.77",
33
- "@rig/server": "npm:@h-rig/server@0.0.6-alpha.77",
34
- "@rig/standard-plugin": "npm:@h-rig/standard-plugin@0.0.6-alpha.77",
29
+ "@rig/client": "npm:@h-rig/client@0.0.6-alpha.79",
30
+ "@rig/contracts": "npm:@h-rig/contracts@0.0.6-alpha.79",
31
+ "@rig/core": "npm:@h-rig/core@0.0.6-alpha.79",
32
+ "@rig/pi-rig": "npm:@h-rig/pi-rig@0.0.6-alpha.79",
33
+ "@rig/runtime": "npm:@h-rig/runtime@0.0.6-alpha.79",
34
+ "@rig/server": "npm:@h-rig/server@0.0.6-alpha.79",
35
+ "@rig/standard-plugin": "npm:@h-rig/standard-plugin@0.0.6-alpha.79",
35
36
  "effect": "4.0.0-beta.78",
36
37
  "picocolors": "^1.1.1"
37
38
  }