@h-rig/cli 0.0.6-alpha.8 → 0.0.6-alpha.81
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.
- package/README.md +1 -1
- package/dist/bin/build-rig-binaries.d.ts +2 -0
- package/dist/bin/rig.d.ts +2 -0
- package/dist/bin/rig.js +18374 -8205
- package/dist/src/app/board.d.ts +23 -0
- package/dist/src/app/board.js +1815 -0
- package/dist/src/app/drone-ui.d.ts +37 -0
- package/dist/src/app/drone-ui.js +294 -0
- package/dist/src/app/theme.d.ts +47 -0
- package/dist/src/app/theme.js +151 -0
- package/dist/src/app-opentui/adapters/common.d.ts +53 -0
- package/dist/src/app-opentui/adapters/common.js +149 -0
- package/dist/src/app-opentui/adapters/doctor.d.ts +11 -0
- package/dist/src/app-opentui/adapters/doctor.js +780 -0
- package/dist/src/app-opentui/adapters/fleet.d.ts +16 -0
- package/dist/src/app-opentui/adapters/fleet.js +874 -0
- package/dist/src/app-opentui/adapters/inbox.d.ts +33 -0
- package/dist/src/app-opentui/adapters/inbox.js +1454 -0
- package/dist/src/app-opentui/adapters/init.d.ts +13 -0
- package/dist/src/app-opentui/adapters/init.js +2357 -0
- package/dist/src/app-opentui/adapters/pi-attach.d.ts +16 -0
- package/dist/src/app-opentui/adapters/pi-attach.js +1295 -0
- package/dist/src/app-opentui/adapters/run-detail.d.ts +20 -0
- package/dist/src/app-opentui/adapters/run-detail.js +893 -0
- package/dist/src/app-opentui/adapters/server.d.ts +14 -0
- package/dist/src/app-opentui/adapters/server.js +798 -0
- package/dist/src/app-opentui/adapters/tasks.d.ts +55 -0
- package/dist/src/app-opentui/adapters/tasks.js +3472 -0
- package/dist/src/app-opentui/bootstrap.d.ts +16 -0
- package/dist/src/app-opentui/bootstrap.js +19509 -0
- package/dist/src/app-opentui/drone.d.ts +12 -0
- package/dist/src/app-opentui/drone.js +227 -0
- package/dist/src/app-opentui/events.d.ts +7 -0
- package/dist/src/app-opentui/events.js +28 -0
- package/dist/src/app-opentui/index.d.ts +8 -0
- package/dist/src/app-opentui/index.js +3477 -0
- package/dist/src/app-opentui/intent.d.ts +3 -0
- package/dist/src/app-opentui/intent.js +211 -0
- package/dist/src/app-opentui/layout.d.ts +15 -0
- package/dist/src/app-opentui/layout.js +44 -0
- package/dist/src/app-opentui/list-search.d.ts +8 -0
- package/dist/src/app-opentui/list-search.js +43 -0
- package/dist/src/app-opentui/pi-host-child.d.ts +2 -0
- package/dist/src/app-opentui/pi-host-child.js +778 -0
- package/dist/src/app-opentui/pi-pty-host.d.ts +64 -0
- package/dist/src/app-opentui/pi-pty-host.js +384 -0
- package/dist/src/app-opentui/registry.d.ts +4 -0
- package/dist/src/app-opentui/registry.js +6835 -0
- package/dist/src/app-opentui/render/graphics.d.ts +39 -0
- package/dist/src/app-opentui/render/graphics.js +537 -0
- package/dist/src/app-opentui/render/image-visual-layer-native-canvas.d.ts +2 -0
- package/dist/src/app-opentui/render/image-visual-layer-native-canvas.js +1480 -0
- package/dist/src/app-opentui/render/image-visual-layer-worker.d.ts +1 -0
- package/dist/src/app-opentui/render/image-visual-layer-worker.js +1541 -0
- package/dist/src/app-opentui/render/image-visual-layer.d.ts +93 -0
- package/dist/src/app-opentui/render/image-visual-layer.js +945 -0
- package/dist/src/app-opentui/render/panels.d.ts +10 -0
- package/dist/src/app-opentui/render/panels.js +201 -0
- package/dist/src/app-opentui/render/scene.d.ts +16 -0
- package/dist/src/app-opentui/render/scene.js +110 -0
- package/dist/src/app-opentui/render/text.d.ts +10 -0
- package/dist/src/app-opentui/render/text.js +121 -0
- package/dist/src/app-opentui/render/type-bar.d.ts +14 -0
- package/dist/src/app-opentui/render/type-bar.js +137 -0
- package/dist/src/app-opentui/runtime.d.ts +2 -0
- package/dist/src/app-opentui/runtime.js +3406 -0
- package/dist/src/app-opentui/scenes/doctor.d.ts +2 -0
- package/dist/src/app-opentui/scenes/doctor.js +91 -0
- package/dist/src/app-opentui/scenes/error.d.ts +2 -0
- package/dist/src/app-opentui/scenes/error.js +190 -0
- package/dist/src/app-opentui/scenes/fleet.d.ts +3 -0
- package/dist/src/app-opentui/scenes/fleet.js +207 -0
- package/dist/src/app-opentui/scenes/handoff.d.ts +2 -0
- package/dist/src/app-opentui/scenes/handoff.js +147 -0
- package/dist/src/app-opentui/scenes/help.d.ts +3 -0
- package/dist/src/app-opentui/scenes/help.js +138 -0
- package/dist/src/app-opentui/scenes/inbox.d.ts +2 -0
- package/dist/src/app-opentui/scenes/inbox.js +118 -0
- package/dist/src/app-opentui/scenes/init.d.ts +2 -0
- package/dist/src/app-opentui/scenes/init.js +94 -0
- package/dist/src/app-opentui/scenes/main.d.ts +2 -0
- package/dist/src/app-opentui/scenes/main.js +96 -0
- package/dist/src/app-opentui/scenes/run-detail.d.ts +2 -0
- package/dist/src/app-opentui/scenes/run-detail.js +139 -0
- package/dist/src/app-opentui/scenes/server.d.ts +2 -0
- package/dist/src/app-opentui/scenes/server.js +88 -0
- package/dist/src/app-opentui/scenes/tasks.d.ts +3 -0
- package/dist/src/app-opentui/scenes/tasks.js +230 -0
- package/dist/src/app-opentui/state.d.ts +4 -0
- package/dist/src/app-opentui/state.js +286 -0
- package/dist/src/app-opentui/theme.d.ts +36 -0
- package/dist/src/app-opentui/theme.js +88 -0
- package/dist/src/app-opentui/types.d.ts +188 -0
- package/dist/src/app-opentui/types.js +1 -0
- package/dist/src/commands/_async-ui.d.ts +13 -0
- package/dist/src/commands/_async-ui.js +223 -0
- package/dist/src/commands/_authority-runs.d.ts +22 -0
- package/dist/src/commands/_authority-runs.js +2 -3
- package/dist/src/commands/_cli-format.d.ts +49 -0
- package/dist/src/commands/_cli-format.js +447 -0
- package/dist/src/commands/_connection-state.d.ts +44 -0
- package/dist/src/commands/_connection-state.js +30 -11
- package/dist/src/commands/_doctor-checks.d.ts +52 -0
- package/dist/src/commands/_doctor-checks.js +180 -44
- package/dist/src/commands/_help-catalog.d.ts +51 -0
- package/dist/src/commands/_help-catalog.js +442 -0
- package/dist/src/commands/_json-output.d.ts +11 -0
- package/dist/src/commands/_json-output.js +56 -0
- package/dist/src/commands/_operator-surface.d.ts +34 -0
- package/dist/src/commands/_operator-surface.js +220 -0
- package/dist/src/commands/_operator-view.d.ts +30 -0
- package/dist/src/commands/_operator-view.js +803 -73
- package/dist/src/commands/_parsers.d.ts +15 -0
- package/dist/src/commands/_parsers.js +18 -11
- package/dist/src/commands/_paths.d.ts +11 -0
- package/dist/src/commands/_pi-frontend.d.ts +27 -0
- package/dist/src/commands/_pi-frontend.js +742 -0
- package/dist/src/commands/_pi-install.d.ts +42 -0
- package/dist/src/commands/_pi-install.js +5 -4
- package/dist/src/commands/_policy.d.ts +8 -0
- package/dist/src/commands/_policy.js +12 -5
- package/dist/src/commands/_preflight.d.ts +22 -0
- package/dist/src/commands/_preflight.js +190 -128
- package/dist/src/commands/_probes.d.ts +1 -0
- package/dist/src/commands/_run-driver-helpers.d.ts +99 -0
- package/dist/src/commands/_run-driver-helpers.js +75 -22
- package/dist/src/commands/_run-replay.d.ts +24 -0
- package/dist/src/commands/_run-replay.js +142 -0
- package/dist/src/commands/_server-client.d.ts +186 -0
- package/dist/src/commands/_server-client.js +360 -61
- package/dist/src/commands/_snapshot-upload.d.ts +39 -0
- package/dist/src/commands/_snapshot-upload.js +163 -39
- package/dist/src/commands/_spinner.d.ts +25 -0
- package/dist/src/commands/_spinner.js +65 -0
- package/dist/src/commands/_task-picker.d.ts +9 -0
- package/dist/src/commands/_task-picker.js +172 -19
- package/dist/src/commands/agent.d.ts +3 -0
- package/dist/src/commands/agent.js +39 -20
- package/dist/src/commands/browser.d.ts +65 -0
- package/dist/src/commands/browser.js +334 -51
- package/dist/src/commands/connect.d.ts +7 -0
- package/dist/src/commands/connect.js +272 -33
- package/dist/src/commands/dist.d.ts +28 -0
- package/dist/src/commands/dist.js +19 -12
- package/dist/src/commands/doctor.d.ts +3 -0
- package/dist/src/commands/doctor.js +378 -45
- package/dist/src/commands/github.d.ts +3 -0
- package/dist/src/commands/github.js +375 -53
- package/dist/src/commands/inbox.d.ts +30 -0
- package/dist/src/commands/inbox.js +760 -70
- package/dist/src/commands/init.d.ts +74 -0
- package/dist/src/commands/init.js +963 -119
- package/dist/src/commands/inspect.d.ts +3 -0
- package/dist/src/commands/inspect.js +588 -32
- package/dist/src/commands/inspector.d.ts +3 -0
- package/dist/src/commands/inspector.js +20 -13
- package/dist/src/commands/pi.d.ts +3 -0
- package/dist/src/commands/pi.js +177 -0
- package/dist/src/commands/plugin.d.ts +16 -0
- package/dist/src/commands/plugin.js +95 -27
- package/dist/src/commands/profile-and-review.d.ts +4 -0
- package/dist/src/commands/profile-and-review.js +26 -19
- package/dist/src/commands/queue.d.ts +3 -0
- package/dist/src/commands/queue.js +32 -12
- package/dist/src/commands/remote.d.ts +3 -0
- package/dist/src/commands/remote.js +43 -36
- package/dist/src/commands/repo-git-harness.d.ts +5 -0
- package/dist/src/commands/repo-git-harness.js +22 -15
- package/dist/src/commands/run.d.ts +3 -0
- package/dist/src/commands/run.js +1379 -159
- package/dist/src/commands/server.d.ts +7 -0
- package/dist/src/commands/server.js +502 -57
- package/dist/src/commands/setup.d.ts +16 -0
- package/dist/src/commands/setup.js +390 -63
- package/dist/src/commands/stats.d.ts +12 -0
- package/dist/src/commands/stats.js +1051 -0
- package/dist/src/commands/task-report-bug.d.ts +19 -0
- package/dist/src/commands/task-report-bug.js +260 -62
- package/dist/src/commands/task-run-driver.d.ts +132 -0
- package/dist/src/commands/task-run-driver.js +886 -130
- package/dist/src/commands/task.d.ts +14 -0
- package/dist/src/commands/task.js +1644 -314
- package/dist/src/commands/test.d.ts +3 -0
- package/dist/src/commands/test.js +15 -8
- package/dist/src/commands/workspace.d.ts +3 -0
- package/dist/src/commands/workspace.js +18 -11
- package/dist/src/commands.d.ts +29 -0
- package/dist/src/commands.js +10996 -6637
- package/dist/src/index.d.ts +4 -0
- package/dist/src/index.js +10197 -5787
- package/dist/src/launcher.d.ts +61 -0
- package/dist/src/launcher.js +77 -13
- package/dist/src/report-bug.d.ts +44 -0
- package/dist/src/report-bug.js +3 -3
- package/dist/src/runner.d.ts +47 -0
- package/dist/src/runner.js +16 -22
- package/dist/src/withMutedConsole.d.ts +2 -0
- package/package.json +16 -6
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// packages/cli/src/app-opentui/adapters/common.ts
|
|
3
|
+
function adapterContextFromRuntime(runtime, renderer) {
|
|
4
|
+
return {
|
|
5
|
+
projectRoot: runtime.getState().projectRoot,
|
|
6
|
+
renderer,
|
|
7
|
+
ensureRuntime: () => runtime.getRunnerContext(),
|
|
8
|
+
emit: (event) => runtime.emit(event),
|
|
9
|
+
getState: () => runtime.getState()
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
function projectRootOf(ctx) {
|
|
13
|
+
const root = ctx.rig?.projectRoot ?? ctx.projectRoot ?? ctx.getState().projectRoot;
|
|
14
|
+
if (typeof root === "string" && root.trim())
|
|
15
|
+
return root;
|
|
16
|
+
throw new Error("Rig app adapter requires a projectRoot.");
|
|
17
|
+
}
|
|
18
|
+
async function runtimeOf(ctx) {
|
|
19
|
+
if (ctx.rig && "runId" in ctx.rig && ctx.ensureRuntime === undefined) {
|
|
20
|
+
return ctx.rig;
|
|
21
|
+
}
|
|
22
|
+
if (ctx.ensureRuntime)
|
|
23
|
+
return ctx.ensureRuntime();
|
|
24
|
+
throw new Error("Rig app adapter requires ensureRuntime() before this action can run.");
|
|
25
|
+
}
|
|
26
|
+
function normalizeAppError(error) {
|
|
27
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
28
|
+
const rawHint = error instanceof Error ? error.hint : undefined;
|
|
29
|
+
return {
|
|
30
|
+
message,
|
|
31
|
+
...typeof rawHint === "string" && rawHint.trim() ? { hint: rawHint.trim() } : {}
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
function emitStarted(ctx, label, optimistic) {
|
|
35
|
+
ctx.emit({ type: "action.started", label, ...optimistic ? { optimistic } : {} });
|
|
36
|
+
}
|
|
37
|
+
function emitProgress(ctx, label, detail, data) {
|
|
38
|
+
ctx.emit({ type: "action.progress", label, ...detail ? { detail } : {}, ...data ? { data } : {} });
|
|
39
|
+
}
|
|
40
|
+
function emitCompleted(ctx, label, data) {
|
|
41
|
+
ctx.emit({ type: "action.completed", label, ...data ? { data } : {} });
|
|
42
|
+
}
|
|
43
|
+
function emitFailed(ctx, label, error, data) {
|
|
44
|
+
if (data)
|
|
45
|
+
patchData(ctx, data);
|
|
46
|
+
const normalized = normalizeAppError(error);
|
|
47
|
+
ctx.emit({
|
|
48
|
+
type: "action.failed",
|
|
49
|
+
label,
|
|
50
|
+
message: normalized.message,
|
|
51
|
+
...normalized.hint ? { hint: normalized.hint } : {},
|
|
52
|
+
cause: error
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
function patchData(ctx, data) {
|
|
56
|
+
ctx.emit({ type: "data.patch", data });
|
|
57
|
+
}
|
|
58
|
+
function patchFooter(ctx, footer) {
|
|
59
|
+
ctx.emit({ type: "footer.patch", footer });
|
|
60
|
+
}
|
|
61
|
+
async function captureConsole(fn) {
|
|
62
|
+
const output = [];
|
|
63
|
+
const original = {
|
|
64
|
+
log: console.log,
|
|
65
|
+
info: console.info,
|
|
66
|
+
warn: console.warn,
|
|
67
|
+
error: console.error
|
|
68
|
+
};
|
|
69
|
+
const capture = (...parts) => {
|
|
70
|
+
output.push(parts.map((part) => typeof part === "string" ? part : JSON.stringify(part)).join(" "));
|
|
71
|
+
};
|
|
72
|
+
console.log = capture;
|
|
73
|
+
console.info = capture;
|
|
74
|
+
console.warn = capture;
|
|
75
|
+
console.error = capture;
|
|
76
|
+
try {
|
|
77
|
+
const result = await fn();
|
|
78
|
+
return { result, output };
|
|
79
|
+
} finally {
|
|
80
|
+
console.log = original.log;
|
|
81
|
+
console.info = original.info;
|
|
82
|
+
console.warn = original.warn;
|
|
83
|
+
console.error = original.error;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
async function releaseRendererForExternalTui(ctx) {
|
|
87
|
+
const renderer = ctx.renderer;
|
|
88
|
+
if (!renderer)
|
|
89
|
+
return;
|
|
90
|
+
if (renderer.suspend) {
|
|
91
|
+
await renderer.suspend();
|
|
92
|
+
return;
|
|
93
|
+
}
|
|
94
|
+
if (renderer.destroy) {
|
|
95
|
+
await renderer.destroy();
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
function arrayFromPayload(value) {
|
|
99
|
+
if (Array.isArray(value)) {
|
|
100
|
+
return value.filter((entry) => Boolean(entry && typeof entry === "object" && !Array.isArray(entry)));
|
|
101
|
+
}
|
|
102
|
+
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
103
|
+
const entries = value.entries;
|
|
104
|
+
if (Array.isArray(entries))
|
|
105
|
+
return arrayFromPayload(entries);
|
|
106
|
+
}
|
|
107
|
+
return [];
|
|
108
|
+
}
|
|
109
|
+
function stringField(record, keys, fallback = "") {
|
|
110
|
+
for (const key of keys) {
|
|
111
|
+
const value = record[key];
|
|
112
|
+
if (typeof value === "string" && value.trim())
|
|
113
|
+
return value.trim();
|
|
114
|
+
if (typeof value === "number" && Number.isFinite(value))
|
|
115
|
+
return String(value);
|
|
116
|
+
}
|
|
117
|
+
return fallback;
|
|
118
|
+
}
|
|
119
|
+
function compactRecord(record, keys) {
|
|
120
|
+
const out = {};
|
|
121
|
+
for (const key of keys) {
|
|
122
|
+
const value = record[key];
|
|
123
|
+
if (value !== undefined && value !== null && value !== "")
|
|
124
|
+
out[key] = value;
|
|
125
|
+
}
|
|
126
|
+
return out;
|
|
127
|
+
}
|
|
128
|
+
function payloadString(intent, key) {
|
|
129
|
+
const value = intent.action.payload?.[key];
|
|
130
|
+
return typeof value === "string" && value.trim() ? value.trim() : undefined;
|
|
131
|
+
}
|
|
132
|
+
export {
|
|
133
|
+
stringField,
|
|
134
|
+
runtimeOf,
|
|
135
|
+
releaseRendererForExternalTui,
|
|
136
|
+
projectRootOf,
|
|
137
|
+
payloadString,
|
|
138
|
+
patchFooter,
|
|
139
|
+
patchData,
|
|
140
|
+
normalizeAppError,
|
|
141
|
+
emitStarted,
|
|
142
|
+
emitProgress,
|
|
143
|
+
emitFailed,
|
|
144
|
+
emitCompleted,
|
|
145
|
+
compactRecord,
|
|
146
|
+
captureConsole,
|
|
147
|
+
arrayFromPayload,
|
|
148
|
+
adapterContextFromRuntime
|
|
149
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { AppAdapter } from "../types";
|
|
2
|
+
import { type AppAdapterContext } from "./common";
|
|
3
|
+
export declare function createDoctorAdapter(): AppAdapter;
|
|
4
|
+
export type AppDoctorCheck = {
|
|
5
|
+
readonly id: string;
|
|
6
|
+
readonly label: string;
|
|
7
|
+
readonly status: "pass" | "warn" | "fail";
|
|
8
|
+
readonly detail?: string;
|
|
9
|
+
readonly remediation?: string;
|
|
10
|
+
};
|
|
11
|
+
export declare function runDoctorChecksForApp(ctx: AppAdapterContext): Promise<AppDoctorCheck[]>;
|