@h-rig/cli 0.0.6-alpha.19 → 0.0.6-alpha.190

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 (50) hide show
  1. package/README.md +7 -28
  2. package/bin/rig-run.js +19 -0
  3. package/bin/rig.js +19 -0
  4. package/package.json +15 -27
  5. package/dist/bin/build-rig-binaries.js +0 -107
  6. package/dist/bin/rig.js +0 -10233
  7. package/dist/src/commands/_authority-runs.js +0 -111
  8. package/dist/src/commands/_connection-state.js +0 -123
  9. package/dist/src/commands/_doctor-checks.js +0 -506
  10. package/dist/src/commands/_operator-surface.js +0 -204
  11. package/dist/src/commands/_operator-view.js +0 -496
  12. package/dist/src/commands/_parsers.js +0 -107
  13. package/dist/src/commands/_paths.js +0 -50
  14. package/dist/src/commands/_pi-install.js +0 -184
  15. package/dist/src/commands/_policy.js +0 -79
  16. package/dist/src/commands/_preflight.js +0 -482
  17. package/dist/src/commands/_probes.js +0 -13
  18. package/dist/src/commands/_run-driver-helpers.js +0 -289
  19. package/dist/src/commands/_server-client.js +0 -435
  20. package/dist/src/commands/_snapshot-upload.js +0 -318
  21. package/dist/src/commands/_task-picker.js +0 -56
  22. package/dist/src/commands/agent.js +0 -499
  23. package/dist/src/commands/browser.js +0 -890
  24. package/dist/src/commands/connect.js +0 -180
  25. package/dist/src/commands/dist.js +0 -402
  26. package/dist/src/commands/doctor.js +0 -516
  27. package/dist/src/commands/github.js +0 -281
  28. package/dist/src/commands/inbox.js +0 -160
  29. package/dist/src/commands/init.js +0 -1562
  30. package/dist/src/commands/inspect.js +0 -174
  31. package/dist/src/commands/inspector.js +0 -256
  32. package/dist/src/commands/plugin.js +0 -167
  33. package/dist/src/commands/profile-and-review.js +0 -178
  34. package/dist/src/commands/queue.js +0 -198
  35. package/dist/src/commands/remote.js +0 -507
  36. package/dist/src/commands/repo-git-harness.js +0 -221
  37. package/dist/src/commands/run.js +0 -972
  38. package/dist/src/commands/server.js +0 -373
  39. package/dist/src/commands/setup.js +0 -686
  40. package/dist/src/commands/task-report-bug.js +0 -1083
  41. package/dist/src/commands/task-run-driver.js +0 -2469
  42. package/dist/src/commands/task.js +0 -1523
  43. package/dist/src/commands/test.js +0 -39
  44. package/dist/src/commands/workspace.js +0 -123
  45. package/dist/src/commands.js +0 -9912
  46. package/dist/src/index.js +0 -10251
  47. package/dist/src/launcher.js +0 -133
  48. package/dist/src/report-bug.js +0 -260
  49. package/dist/src/runner.js +0 -273
  50. package/dist/src/withMutedConsole.js +0 -42
@@ -1,39 +0,0 @@
1
- // @bun
2
- // packages/cli/src/runner.ts
3
- import { EventBus } from "@rig/runtime/control-plane/runtime/events";
4
- import { CliError } from "@rig/runtime/control-plane/errors";
5
- import { evaluate, loadPolicy, resolveAction } from "@rig/runtime/control-plane/runtime/guard";
6
- import { PluginManager } from "@rig/runtime/control-plane/runtime/plugins";
7
- import { loadRuntimeContextFromEnv } from "@rig/runtime/control-plane/runtime/context";
8
- import { buildBinary } from "@rig/runtime/control-plane/runtime/isolation";
9
- import { CliError as CliError2 } from "@rig/runtime/control-plane/errors";
10
- function requireNoExtraArgs(args, usage) {
11
- if (args.length > 0) {
12
- throw new CliError(`Unexpected arguments: ${args.join(" ")}
13
- Usage: ${usage}`);
14
- }
15
- }
16
-
17
- // packages/cli/src/commands/test.ts
18
- async function executeTest(context, args) {
19
- const [command = "unit", ...rest] = args;
20
- switch (command) {
21
- case "unit":
22
- requireNoExtraArgs(rest, "bun run rig test unit");
23
- await context.runCommand(["bun", "test", "tests/harness/", "--ignore", "tests/harness/e2e/**"]);
24
- return { ok: true, group: "test", command };
25
- case "e2e":
26
- requireNoExtraArgs(rest, "bun run rig test e2e");
27
- await context.runCommand(["bun", "test", "tests/harness/e2e/"]);
28
- return { ok: true, group: "test", command };
29
- case "all":
30
- requireNoExtraArgs(rest, "bun run rig test all");
31
- await context.runCommand(["bun", "test", "tests/harness/"]);
32
- return { ok: true, group: "test", command };
33
- default:
34
- throw new CliError2(`Unknown test command: ${command}`);
35
- }
36
- }
37
- export {
38
- executeTest
39
- };
@@ -1,123 +0,0 @@
1
- // @bun
2
- // packages/cli/src/runner.ts
3
- import { EventBus } from "@rig/runtime/control-plane/runtime/events";
4
- import { CliError } from "@rig/runtime/control-plane/errors";
5
- import { evaluate, loadPolicy, resolveAction } from "@rig/runtime/control-plane/runtime/guard";
6
- import { PluginManager } from "@rig/runtime/control-plane/runtime/plugins";
7
- import { loadRuntimeContextFromEnv } from "@rig/runtime/control-plane/runtime/context";
8
- import { buildBinary } from "@rig/runtime/control-plane/runtime/isolation";
9
- import { CliError as CliError2 } from "@rig/runtime/control-plane/errors";
10
- function takeOption(args, option) {
11
- const rest = [];
12
- let value;
13
- for (let index = 0;index < args.length; index += 1) {
14
- const current = args[index];
15
- if (current === option) {
16
- const next = args[index + 1];
17
- if (!next || next.startsWith("-")) {
18
- throw new CliError(`Missing value for ${option}`);
19
- }
20
- value = next;
21
- index += 1;
22
- continue;
23
- }
24
- if (current !== undefined) {
25
- rest.push(current);
26
- }
27
- }
28
- return { value, rest };
29
- }
30
- function requireNoExtraArgs(args, usage) {
31
- if (args.length > 0) {
32
- throw new CliError(`Unexpected arguments: ${args.join(" ")}
33
- Usage: ${usage}`);
34
- }
35
- }
36
-
37
- // packages/cli/src/commands/workspace.ts
38
- import {
39
- mutateWorkspaceServiceFabric,
40
- readWorkspaceRemoteFleet,
41
- readWorkspaceSummary,
42
- readWorkspaceTopology
43
- } from "@rig/runtime/control-plane/native/workspace-ops";
44
- async function executeWorkspace(context, args) {
45
- const [command = "summary", ...rest] = args;
46
- switch (command) {
47
- case "summary": {
48
- requireNoExtraArgs(rest, "bun run rig workspace summary");
49
- const summary = await readWorkspaceSummary(context.projectRoot);
50
- if (context.outputMode === "text") {
51
- console.log("Workspace Summary");
52
- console.log(` root: ${summary.rootPath}`);
53
- console.log(` tasks: ${summary.taskCounts.total} total \xB7 ${summary.taskCounts.ready} ready \xB7 ${summary.taskCounts.running} running \xB7 ${summary.taskCounts.blocked} blocked \xB7 ${summary.taskCounts.completed} completed \xB7 ${summary.taskCounts.unknown} unknown`);
54
- console.log(` runtimes: ${summary.runtimeCount}`);
55
- console.log(` artifact tasks: ${summary.artifactTaskCount}`);
56
- console.log(` topology: ${summary.topology.status} \xB7 ${summary.topology.serviceCount} services from ${summary.topology.manifestCount} manifests`);
57
- console.log(` remote hosts: ${summary.remoteFleet.status} \xB7 ${summary.remoteFleet.onlineHostCount} online of ${summary.remoteFleet.hostCount}`);
58
- if (summary.serviceFabric) {
59
- console.log(` service fabric: ${String(summary.serviceFabric.status ?? "unknown")} \xB7 ${String(summary.serviceFabric.healthyServiceCount ?? 0)} healthy of ${String(summary.serviceFabric.serviceCount ?? 0)}`);
60
- }
61
- console.log(` failures log: ${summary.failedApproachesPresent ? "present" : "missing"}`);
62
- if (summary.warnings.length > 0) {
63
- console.log(`
64
- Warnings:`);
65
- for (const warning of summary.warnings) {
66
- console.log(` - ${warning}`);
67
- }
68
- }
69
- }
70
- return { ok: true, group: "workspace", command, details: summary };
71
- }
72
- case "topology": {
73
- requireNoExtraArgs(rest, "bun run rig workspace topology");
74
- const topology = readWorkspaceTopology(context.projectRoot);
75
- if (context.outputMode === "text") {
76
- console.log(`Topology: ${topology.status}`);
77
- for (const service of topology.services) {
78
- const suffix = [service.runtime, service.port != null ? `:${service.port}` : null, service.healthcheck].filter(Boolean).join(" \xB7 ");
79
- console.log(`- ${service.name}${suffix ? ` (${suffix})` : ""}`);
80
- console.log(` ${service.relativeRootPath}`);
81
- }
82
- }
83
- return { ok: true, group: "workspace", command, details: topology };
84
- }
85
- case "remote-hosts": {
86
- requireNoExtraArgs(rest, "bun run rig workspace remote-hosts");
87
- const fleet = readWorkspaceRemoteFleet(context.projectRoot);
88
- if (context.outputMode === "text") {
89
- console.log(`Remote Hosts: ${fleet.status}`);
90
- for (const host of fleet.hosts) {
91
- console.log(`- ${host.name} \xB7 ${host.status} \xB7 ${host.baseUrl}${host.workspacePath ? ` \xB7 ${host.workspacePath}` : ""}`);
92
- }
93
- }
94
- return { ok: true, group: "workspace", command, details: fleet };
95
- }
96
- case "service-fabric": {
97
- const [action = "status", ...serviceRest] = rest;
98
- let pending = serviceRest;
99
- const services = takeOption(pending, "--service");
100
- pending = services.rest;
101
- requireNoExtraArgs(pending, "bun run rig workspace service-fabric <status|up|verify|down> [--service <name>]");
102
- if (action !== "status" && action !== "up" && action !== "verify" && action !== "down") {
103
- throw new CliError2(`Unknown workspace service-fabric action: ${action}`);
104
- }
105
- const selectedServices = services.value ? services.value.split(",").map((entry) => entry.trim()).filter(Boolean) : [];
106
- const summary = action === "status" ? await mutateWorkspaceServiceFabric(context.projectRoot, "verify", selectedServices) : await mutateWorkspaceServiceFabric(context.projectRoot, action, selectedServices);
107
- if (context.outputMode === "text") {
108
- console.log(JSON.stringify(summary, null, 2));
109
- }
110
- return {
111
- ok: true,
112
- group: "workspace",
113
- command: `service-fabric:${action}`,
114
- details: summary
115
- };
116
- }
117
- default:
118
- throw new CliError2(`Unknown workspace command: ${command}`);
119
- }
120
- }
121
- export {
122
- executeWorkspace
123
- };