@h-rig/cli-surface-plugin 0.0.6-alpha.157 → 0.0.6-alpha.158

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 (112) hide show
  1. package/dist/src/app/drone-ui.d.ts +0 -11
  2. package/dist/src/app/drone-ui.js +0 -114
  3. package/dist/src/commands/_async-ui.d.ts +1 -1
  4. package/dist/src/commands/_cli-format.d.ts +0 -29
  5. package/dist/src/commands/_cli-format.js +59 -113
  6. package/dist/src/commands/_connection-state.d.ts +6 -33
  7. package/dist/src/commands/_connection-state.js +654 -138
  8. package/dist/src/commands/_doctor-checks.d.ts +2 -5
  9. package/dist/src/commands/_doctor-checks.js +10 -9
  10. package/dist/src/commands/_help-catalog.d.ts +2 -1
  11. package/dist/src/commands/_help-catalog.js +654 -7
  12. package/dist/src/commands/_inprocess-services.d.ts +5 -5
  13. package/dist/src/commands/_inprocess-services.js +1 -1
  14. package/dist/src/commands/_parsers.js +651 -12
  15. package/dist/src/commands/_paths.d.ts +0 -2
  16. package/dist/src/commands/_paths.js +2 -10
  17. package/dist/src/commands/_pi-install.d.ts +2 -12
  18. package/dist/src/commands/_pi-install.js +3 -36
  19. package/dist/src/commands/_policy.js +659 -20
  20. package/dist/src/commands/agent.d.ts +1 -1
  21. package/dist/src/commands/agent.js +675 -24
  22. package/dist/src/commands/config.d.ts +1 -1
  23. package/dist/src/commands/config.js +656 -21
  24. package/dist/src/commands/dist.d.ts +1 -1
  25. package/dist/src/commands/dist.js +828 -102
  26. package/dist/src/commands/doctor.d.ts +1 -1
  27. package/dist/src/commands/doctor.js +658 -12
  28. package/dist/src/commands/github.d.ts +1 -1
  29. package/dist/src/commands/github.js +658 -19
  30. package/dist/src/commands/inbox.d.ts +12 -8
  31. package/dist/src/commands/inbox.js +741 -22
  32. package/dist/src/commands/init.d.ts +17 -19
  33. package/dist/src/commands/init.js +836 -306
  34. package/dist/src/commands/inspect.d.ts +5 -6
  35. package/dist/src/commands/inspect.js +754 -42
  36. package/dist/src/commands/pi.d.ts +1 -1
  37. package/dist/src/commands/pi.js +655 -16
  38. package/dist/src/commands/plugin.d.ts +9 -9
  39. package/dist/src/commands/plugin.js +652 -13
  40. package/dist/src/commands/profile-and-review.d.ts +1 -1
  41. package/dist/src/commands/profile-and-review.js +655 -16
  42. package/dist/src/commands/queue.d.ts +1 -1
  43. package/dist/src/commands/queue.js +871 -12
  44. package/dist/src/commands/remote-client.d.ts +152 -0
  45. package/dist/src/commands/remote-client.js +475 -0
  46. package/dist/src/commands/remote.d.ts +1 -1
  47. package/dist/src/commands/remote.js +1100 -29
  48. package/dist/src/commands/repo-git-harness.d.ts +1 -1
  49. package/dist/src/commands/repo-git-harness.js +2321 -47
  50. package/dist/src/commands/run.d.ts +10 -6
  51. package/dist/src/commands/run.js +830 -50
  52. package/dist/src/commands/server.d.ts +1 -1
  53. package/dist/src/commands/server.js +649 -11
  54. package/dist/src/commands/setup.d.ts +2 -2
  55. package/dist/src/commands/setup.js +829 -18
  56. package/dist/src/commands/stats.d.ts +2 -4
  57. package/dist/src/commands/stats.js +1299 -20
  58. package/dist/src/commands/test.d.ts +1 -1
  59. package/dist/src/commands/test.js +648 -9
  60. package/dist/src/commands/triage.d.ts +2 -3
  61. package/dist/src/commands/triage.js +657 -11
  62. package/dist/src/commands/workspace.d.ts +1 -1
  63. package/dist/src/commands/workspace.js +1280 -15
  64. package/dist/src/control-plane/agent-binary-build.d.ts +9 -0
  65. package/dist/src/control-plane/agent-binary-build.js +88 -0
  66. package/dist/src/control-plane/embedded-native-assets.d.ts +7 -0
  67. package/dist/src/control-plane/embedded-native-assets.js +6 -0
  68. package/dist/src/control-plane/guard.d.ts +17 -0
  69. package/dist/src/control-plane/guard.js +684 -0
  70. package/dist/src/control-plane/harness-cli.d.ts +12 -0
  71. package/dist/src/control-plane/harness-cli.js +1623 -0
  72. package/dist/src/control-plane/native/git-ops.d.ts +67 -0
  73. package/dist/src/control-plane/native/git-ops.js +1381 -0
  74. package/dist/src/control-plane/native/github-auth-env.d.ts +1 -0
  75. package/dist/src/control-plane/native/github-auth-env.js +21 -0
  76. package/dist/src/control-plane/native/host-git.d.ts +4 -0
  77. package/dist/src/control-plane/native/host-git.js +51 -0
  78. package/dist/src/control-plane/priority-queue.d.ts +22 -0
  79. package/dist/src/control-plane/priority-queue.js +212 -0
  80. package/dist/src/control-plane/rigfig.d.ts +9 -0
  81. package/dist/src/control-plane/rigfig.js +70 -0
  82. package/dist/src/control-plane/scope.d.ts +3 -0
  83. package/dist/src/control-plane/scope.js +58 -0
  84. package/dist/src/control-plane/setup-status.d.ts +44 -0
  85. package/dist/src/control-plane/setup-status.js +164 -0
  86. package/dist/src/control-plane/task-data.d.ts +2 -0
  87. package/dist/src/control-plane/task-data.js +12 -0
  88. package/dist/src/control-plane/workspace-ops.d.ts +79 -0
  89. package/dist/src/control-plane/workspace-ops.js +639 -0
  90. package/dist/src/help-catalog-data.d.ts +7 -0
  91. package/dist/src/help-catalog-data.js +660 -0
  92. package/dist/src/kernel-dispatch.js +1 -3
  93. package/dist/src/plugin.js +10072 -30
  94. package/dist/src/runner.d.ts +7 -9
  95. package/dist/src/runner.js +750 -30
  96. package/package.json +12 -13
  97. package/dist/src/commands/_json-output.d.ts +0 -11
  98. package/dist/src/commands/_json-output.js +0 -54
  99. package/dist/src/commands/_pi-frontend.d.ts +0 -35
  100. package/dist/src/commands/_pi-frontend.js +0 -64
  101. package/dist/src/commands/_run-driver-helpers.d.ts +0 -26
  102. package/dist/src/commands/_run-driver-helpers.js +0 -132
  103. package/dist/src/commands/task-run-driver.d.ts +0 -93
  104. package/dist/src/commands/task-run-driver.js +0 -136
  105. package/dist/src/commands/task.d.ts +0 -46
  106. package/dist/src/commands/task.js +0 -555
  107. package/dist/src/provider-model.d.ts +0 -34
  108. package/dist/src/provider-model.js +0 -56
  109. package/dist/src/rig-config-package-deps.d.ts +0 -10
  110. package/dist/src/rig-config-package-deps.js +0 -272
  111. package/dist/src/version.d.ts +0 -8
  112. package/dist/src/version.js +0 -47
@@ -1,13 +1,10 @@
1
1
  // @bun
2
2
  // packages/cli-surface-plugin/src/commands/_paths.ts
3
3
  import { resolve } from "path";
4
- import { resolveMonorepoRoot } from "@rig/runtime/layout";
4
+ import { resolveMonorepoRoot } from "@rig/core/layout";
5
5
  function resolveControlPlaneMonorepoRoot(projectRoot) {
6
6
  return resolveMonorepoRoot(projectRoot);
7
7
  }
8
- function resolveControlPlaneTaskConfigPath(projectRoot) {
9
- return resolve(resolveControlPlaneMonorepoRoot(projectRoot), ".rig", "task-config.json");
10
- }
11
8
  function resolveControlPlaneHostStateRoot(projectRoot) {
12
9
  return resolve(projectRoot, ".rig");
13
10
  }
@@ -29,14 +26,10 @@ function resolveControlPlaneMonorepoStateRoot(projectRoot) {
29
26
  function resolveControlPlaneMonorepoRuntimeDir(projectRoot) {
30
27
  return resolve(resolveControlPlaneMonorepoStateRoot(projectRoot), "runtime");
31
28
  }
32
- function resolveControlPlaneArtifactsDir(projectRoot) {
33
- return resolve(resolveControlPlaneMonorepoRoot(projectRoot), "artifacts");
34
- }
35
29
  function resolveControlPlaneDefinitionRoot(projectRoot) {
36
30
  return resolve(projectRoot, "rig");
37
31
  }
38
32
  export {
39
- resolveControlPlaneTaskConfigPath,
40
33
  resolveControlPlaneMonorepoStateRoot,
41
34
  resolveControlPlaneMonorepoRuntimeDir,
42
35
  resolveControlPlaneMonorepoRoot,
@@ -45,6 +38,5 @@ export {
45
38
  resolveControlPlaneHostLogsDir,
46
39
  resolveControlPlaneHostDistDir,
47
40
  resolveControlPlaneHostBinDir,
48
- resolveControlPlaneDefinitionRoot,
49
- resolveControlPlaneArtifactsDir
41
+ resolveControlPlaneDefinitionRoot
50
42
  };
@@ -1,8 +1,8 @@
1
1
  export type PiInstallCheck = {
2
2
  readonly ok: boolean;
3
3
  readonly label: string;
4
- readonly detail?: string;
5
- readonly hint?: string;
4
+ readonly detail?: string | undefined;
5
+ readonly hint?: string | undefined;
6
6
  };
7
7
  export type CommandRunner = (command: string[], options?: {
8
8
  cwd?: string;
@@ -30,13 +30,3 @@ export declare function ensurePiRigInstalled(input: {
30
30
  }): Promise<PiRigInstallStatus & {
31
31
  installedPath: string;
32
32
  }>;
33
- export declare function ensureRemotePiRigInstalled(input: {
34
- readonly requestJson: (pathname: string, init?: RequestInit) => Promise<unknown>;
35
- }): Promise<PiRigInstallStatus & {
36
- readonly remote: true;
37
- }>;
38
- export declare function buildPiSetupChecks(input?: {
39
- readonly homeDir?: string;
40
- readonly commandRunner?: CommandRunner;
41
- readonly exists?: (path: string) => boolean;
42
- }): Promise<PiInstallCheck[]>;
@@ -5,7 +5,7 @@ import { homedir } from "os";
5
5
  import { resolve } from "path";
6
6
  var PI_RIG_PACKAGE_NAME = "@h-rig/pi-rig";
7
7
  async function defaultCommandRunner(command, options = {}) {
8
- const proc = Bun.spawn(command, { cwd: options.cwd, stdout: "pipe", stderr: "pipe" });
8
+ const proc = Bun.spawn(command, { ...options.cwd !== undefined ? { cwd: options.cwd } : {}, stdout: "pipe", stderr: "pipe" });
9
9
  const [stdout, stderr, exitCode] = await Promise.all([
10
10
  new Response(proc.stdout).text(),
11
11
  new Response(proc.stderr).text(),
@@ -110,7 +110,7 @@ ${piListResult.stderr}`);
110
110
  async function ensurePiRigInstalled(input) {
111
111
  const home = resolvePiHomeDir(input.homeDir);
112
112
  if (process.env.RIG_TEST_FAKE_PI_INSTALL === "1") {
113
- const status = await checkPiRigInstall({ homeDir: home, commandRunner: input.commandRunner });
113
+ const status = await checkPiRigInstall({ homeDir: home, ...input.commandRunner ? { commandRunner: input.commandRunner } : {} });
114
114
  return { ...status, installedPath: status.extensionPath };
115
115
  }
116
116
  const runner = input.commandRunner ?? defaultCommandRunner;
@@ -126,42 +126,9 @@ async function ensurePiRigInstalled(input) {
126
126
  const next = await checkPiRigInstall({ homeDir: home, commandRunner: runner });
127
127
  return { ...next, installedPath: packageSource };
128
128
  }
129
- async function ensureRemotePiRigInstalled(input) {
130
- const payload = await input.requestJson("/api/pi-rig/install", {
131
- method: "POST",
132
- headers: { "content-type": "application/json" },
133
- body: JSON.stringify({ package: PI_RIG_PACKAGE_NAME, scope: "global" })
134
- });
135
- const record = payload && typeof payload === "object" && !Array.isArray(payload) ? payload : {};
136
- const piOk = record.piOk === true || record.ok === true;
137
- const piRigOk = record.piRigOk === true || record.installed === true || record.ok === true;
138
- const extensionPath = typeof record.extensionPath === "string" ? record.extensionPath : "remote:~/.pi/agent/extensions/pi-rig";
139
- return {
140
- remote: true,
141
- extensionPath,
142
- pi: {
143
- ok: piOk,
144
- label: "pi",
145
- detail: typeof record.piVersion === "string" ? record.piVersion : undefined,
146
- hint: piOk ? undefined : "Install/update Pi on the selected remote control host, then verify with bare `rig` / Cockpit \u2192 Doctor."
147
- },
148
- piRig: {
149
- ok: piRigOk,
150
- label: "pi-rig global extension",
151
- detail: extensionPath,
152
- hint: piRigOk ? undefined : `Install/enable the Rig OMP extension (${PI_RIG_PACKAGE_NAME}) on the selected remote control host, then verify with bare \`rig\` / Cockpit \u2192 Doctor.`
153
- }
154
- };
155
- }
156
- async function buildPiSetupChecks(input = {}) {
157
- const status = await checkPiRigInstall(input);
158
- return [status.pi, status.piRig];
159
- }
160
129
  export {
161
130
  resolvePiRigPackageSource,
162
131
  resolvePiRigExtensionPath,
163
- ensureRemotePiRigInstalled,
164
132
  ensurePiRigInstalled,
165
- checkPiRigInstall,
166
- buildPiSetupChecks
133
+ checkPiRigInstall
167
134
  };