@h-rig/cli 0.0.6-alpha.83 → 0.0.6-alpha.84
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/dist/bin/rig.js +22085 -14618
- package/dist/src/app/board.js +155 -28
- package/dist/src/app-opentui/adapters/doctor.d.ts +0 -2
- package/dist/src/app-opentui/adapters/doctor.js +1 -25
- package/dist/src/app-opentui/adapters/family.d.ts +62 -0
- package/dist/src/app-opentui/adapters/family.js +14305 -0
- package/dist/src/app-opentui/adapters/fleet.d.ts +0 -2
- package/dist/src/app-opentui/adapters/fleet.js +6 -40
- package/dist/src/app-opentui/adapters/inbox.d.ts +12 -2
- package/dist/src/app-opentui/adapters/inbox.js +54 -59
- package/dist/src/app-opentui/adapters/init.d.ts +0 -2
- package/dist/src/app-opentui/adapters/init.js +0 -26
- package/dist/src/app-opentui/adapters/inspect.d.ts +52 -0
- package/dist/src/app-opentui/adapters/inspect.js +1024 -0
- package/dist/src/app-opentui/adapters/pi-attach.d.ts +15 -6
- package/dist/src/app-opentui/adapters/pi-attach.js +348 -93
- package/dist/src/app-opentui/adapters/pi.d.ts +23 -0
- package/dist/src/app-opentui/adapters/pi.js +363 -0
- package/dist/src/app-opentui/adapters/plugin.d.ts +84 -0
- package/dist/src/app-opentui/adapters/plugin.js +544 -0
- package/dist/src/app-opentui/adapters/repo.d.ts +37 -0
- package/dist/src/app-opentui/adapters/repo.js +186 -0
- package/dist/src/app-opentui/adapters/run-detail.d.ts +9 -2
- package/dist/src/app-opentui/adapters/run-detail.js +97 -44
- package/dist/src/app-opentui/adapters/server.d.ts +10 -2
- package/dist/src/app-opentui/adapters/server.js +96 -27
- package/dist/src/app-opentui/adapters/tasks.d.ts +0 -2
- package/dist/src/app-opentui/adapters/tasks.js +437 -105
- package/dist/src/app-opentui/adapters/workspace.d.ts +49 -0
- package/dist/src/app-opentui/adapters/workspace.js +333 -0
- package/dist/src/app-opentui/autocomplete.d.ts +20 -0
- package/dist/src/app-opentui/autocomplete.js +576 -0
- package/dist/src/app-opentui/bootstrap.js +24296 -16919
- package/dist/src/app-opentui/command-palette.d.ts +3 -0
- package/dist/src/app-opentui/command-palette.js +1010 -0
- package/dist/src/app-opentui/drone.js +8 -6
- package/dist/src/app-opentui/fleet-stats.d.ts +32 -0
- package/dist/src/app-opentui/fleet-stats.js +114 -0
- package/dist/src/app-opentui/index.js +3438 -1724
- package/dist/src/app-opentui/intent.js +71 -48
- package/dist/src/app-opentui/keymap.d.ts +6 -5
- package/dist/src/app-opentui/keymap.js +1064 -23
- package/dist/src/app-opentui/layout.d.ts +7 -0
- package/dist/src/app-opentui/layout.js +13 -6
- package/dist/src/app-opentui/list-search.d.ts +24 -0
- package/dist/src/app-opentui/list-search.js +88 -1
- package/dist/src/app-opentui/pi-host-child.js +33 -1
- package/dist/src/app-opentui/pi-pty-host.d.ts +5 -0
- package/dist/src/app-opentui/pi-pty-host.js +21 -3
- package/dist/src/app-opentui/react/App.d.ts +9 -0
- package/dist/src/app-opentui/react/App.js +5144 -0
- package/dist/src/app-opentui/react/Backdrop.d.ts +5 -0
- package/dist/src/app-opentui/react/Backdrop.js +1834 -0
- package/dist/src/app-opentui/react/ChromeHost.d.ts +5 -0
- package/dist/src/app-opentui/react/ChromeHost.js +2942 -0
- package/dist/src/app-opentui/react/SceneFrameView.d.ts +7 -0
- package/dist/src/app-opentui/react/SceneFrameView.js +529 -0
- package/dist/src/app-opentui/react/context.d.ts +17 -0
- package/dist/src/app-opentui/react/context.js +37 -0
- package/dist/src/app-opentui/react/launch.d.ts +2 -0
- package/dist/src/app-opentui/react/launch.js +5743 -0
- package/dist/src/app-opentui/react/nav.d.ts +18 -0
- package/dist/src/app-opentui/react/nav.js +54 -0
- package/dist/src/app-opentui/react/scroll.d.ts +12 -0
- package/dist/src/app-opentui/react/scroll.js +21 -0
- package/dist/src/app-opentui/react/syntax.d.ts +2 -0
- package/dist/src/app-opentui/react/syntax.js +64 -0
- package/dist/src/app-opentui/registry.js +19923 -5151
- package/dist/src/app-opentui/render/constants.d.ts +31 -0
- package/dist/src/app-opentui/render/constants.js +66 -0
- package/dist/src/app-opentui/render/graphics.d.ts +2 -1
- package/dist/src/app-opentui/render/graphics.js +106 -39
- package/dist/src/app-opentui/render/image-visual-layer-worker.js +108 -20
- package/dist/src/app-opentui/render/image-visual-layer.d.ts +7 -0
- package/dist/src/app-opentui/render/image-visual-layer.js +109 -20
- package/dist/src/app-opentui/render/native-host.d.ts +37 -0
- package/dist/src/app-opentui/render/native-host.js +179 -0
- package/dist/src/app-opentui/render/panels.js +18 -11
- package/dist/src/app-opentui/render/preloader.js +8 -6
- package/dist/src/app-opentui/render/scene.d.ts +50 -1
- package/dist/src/app-opentui/render/scene.js +183 -6
- package/dist/src/app-opentui/render/text.d.ts +7 -1
- package/dist/src/app-opentui/render/text.js +10 -7
- package/dist/src/app-opentui/render/type-bar.js +69 -30
- package/dist/src/app-opentui/runtime.d.ts +44 -1
- package/dist/src/app-opentui/runtime.js +3231 -1363
- package/dist/src/app-opentui/scenes/command.js +20 -6
- package/dist/src/app-opentui/scenes/doctor.js +176 -11
- package/dist/src/app-opentui/scenes/error.js +20 -10
- package/dist/src/app-opentui/scenes/family-domains/agent.d.ts +2 -0
- package/dist/src/app-opentui/scenes/family-domains/agent.js +348 -0
- package/dist/src/app-opentui/scenes/family-domains/browser.d.ts +2 -0
- package/dist/src/app-opentui/scenes/family-domains/browser.js +195 -0
- package/dist/src/app-opentui/scenes/family-domains/dist.d.ts +2 -0
- package/dist/src/app-opentui/scenes/family-domains/dist.js +243 -0
- package/dist/src/app-opentui/scenes/family-domains/git.d.ts +2 -0
- package/dist/src/app-opentui/scenes/family-domains/git.js +195 -0
- package/dist/src/app-opentui/scenes/family-domains/github.d.ts +2 -0
- package/dist/src/app-opentui/scenes/family-domains/github.js +274 -0
- package/dist/src/app-opentui/scenes/family-domains/harness.d.ts +2 -0
- package/dist/src/app-opentui/scenes/family-domains/harness.js +152 -0
- package/dist/src/app-opentui/scenes/family-domains/index.d.ts +4 -0
- package/dist/src/app-opentui/scenes/family-domains/index.js +1679 -0
- package/dist/src/app-opentui/scenes/family-domains/kit.d.ts +76 -0
- package/dist/src/app-opentui/scenes/family-domains/kit.js +305 -0
- package/dist/src/app-opentui/scenes/family-domains/profile.d.ts +2 -0
- package/dist/src/app-opentui/scenes/family-domains/profile.js +212 -0
- package/dist/src/app-opentui/scenes/family-domains/queue.d.ts +2 -0
- package/dist/src/app-opentui/scenes/family-domains/queue.js +146 -0
- package/dist/src/app-opentui/scenes/family-domains/remote.d.ts +2 -0
- package/dist/src/app-opentui/scenes/family-domains/remote.js +518 -0
- package/dist/src/app-opentui/scenes/family-domains/review.d.ts +2 -0
- package/dist/src/app-opentui/scenes/family-domains/review.js +280 -0
- package/dist/src/app-opentui/scenes/family-domains/setup.d.ts +2 -0
- package/dist/src/app-opentui/scenes/family-domains/setup.js +267 -0
- package/dist/src/app-opentui/scenes/family-domains/stats.d.ts +2 -0
- package/dist/src/app-opentui/scenes/family-domains/stats.js +370 -0
- package/dist/src/app-opentui/scenes/family.d.ts +3 -0
- package/dist/src/app-opentui/scenes/family.js +2144 -0
- package/dist/src/app-opentui/scenes/fleet.js +521 -31
- package/dist/src/app-opentui/scenes/handoff.js +204 -12
- package/dist/src/app-opentui/scenes/help.js +609 -40
- package/dist/src/app-opentui/scenes/inbox.js +278 -17
- package/dist/src/app-opentui/scenes/init.js +84 -39
- package/dist/src/app-opentui/scenes/inspect.d.ts +3 -0
- package/dist/src/app-opentui/scenes/inspect.js +793 -0
- package/dist/src/app-opentui/scenes/main.js +218 -39
- package/dist/src/app-opentui/scenes/pi.d.ts +3 -0
- package/dist/src/app-opentui/scenes/pi.js +508 -0
- package/dist/src/app-opentui/scenes/plugin.d.ts +3 -0
- package/dist/src/app-opentui/scenes/plugin.js +486 -0
- package/dist/src/app-opentui/scenes/repo.d.ts +3 -0
- package/dist/src/app-opentui/scenes/repo.js +424 -0
- package/dist/src/app-opentui/scenes/run-detail.js +333 -20
- package/dist/src/app-opentui/scenes/server.js +181 -15
- package/dist/src/app-opentui/scenes/tasks.js +486 -31
- package/dist/src/app-opentui/scenes/workspace.d.ts +3 -0
- package/dist/src/app-opentui/scenes/workspace.js +426 -0
- package/dist/src/app-opentui/selectable.d.ts +19 -0
- package/dist/src/app-opentui/selectable.js +79 -0
- package/dist/src/app-opentui/state.js +83 -30
- package/dist/src/app-opentui/surface-catalog.d.ts +20 -0
- package/dist/src/app-opentui/surface-catalog.js +540 -0
- package/dist/src/app-opentui/theme.d.ts +28 -6
- package/dist/src/app-opentui/theme.js +61 -8
- package/dist/src/app-opentui/types.d.ts +121 -4
- package/dist/src/commands/_authority-runs.d.ts +1 -1
- package/dist/src/commands/_authority-runs.js +2 -12
- package/dist/src/commands/_help-catalog.js +95 -15
- package/dist/src/commands/_operator-view.js +34 -2
- package/dist/src/commands/_pi-frontend.d.ts +2 -0
- package/dist/src/commands/_pi-frontend.js +34 -0
- package/dist/src/commands/_server-events.d.ts +26 -0
- package/dist/src/commands/_server-events.js +310 -0
- package/dist/src/commands/agent.js +2 -12
- package/dist/src/commands/run.js +34 -2
- package/dist/src/commands/server.js +2 -12
- package/dist/src/commands/stats.js +95 -15
- package/dist/src/commands/task-run-driver.js +2 -12
- package/dist/src/commands/task.js +131 -29
- package/dist/src/commands.js +192 -31
- package/dist/src/index.js +192 -31
- package/package.json +11 -9
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { AppIntent, AppSceneId, AppState } from "../types";
|
|
2
|
+
export type PrimaryNavSection = {
|
|
3
|
+
readonly id: string;
|
|
4
|
+
readonly label: string;
|
|
5
|
+
readonly scene: AppSceneId;
|
|
6
|
+
readonly argv: readonly string[];
|
|
7
|
+
readonly enterLabel: string;
|
|
8
|
+
readonly member: readonly AppSceneId[];
|
|
9
|
+
readonly badge?: (state: AppState) => number;
|
|
10
|
+
};
|
|
11
|
+
/** Pending blocker count (approvals + input requests) off the inbox slice. */
|
|
12
|
+
export declare function inboxPendingCount(state: AppState): number;
|
|
13
|
+
export declare const PRIMARY_NAV: readonly PrimaryNavSection[];
|
|
14
|
+
export declare function navSectionIntent(section: PrimaryNavSection): AppIntent;
|
|
15
|
+
export declare function activeNavSection(scene: AppSceneId): PrimaryNavSection;
|
|
16
|
+
export declare function sectionForScene(scene: AppSceneId): string;
|
|
17
|
+
export declare function primaryNavIntent(scene: AppSceneId): AppIntent;
|
|
18
|
+
export declare function nextPrimaryScene(current: AppSceneId, delta: number): AppSceneId;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// packages/cli/src/app-opentui/react/nav.ts
|
|
3
|
+
function inboxPendingCount(state) {
|
|
4
|
+
const inbox = state.data.inbox;
|
|
5
|
+
if (!inbox || typeof inbox !== "object" || Array.isArray(inbox))
|
|
6
|
+
return 0;
|
|
7
|
+
const record = inbox;
|
|
8
|
+
const approvals = Array.isArray(record.approvals) ? record.approvals.length : 0;
|
|
9
|
+
const inputs = Array.isArray(record.inputs) ? record.inputs.length : 0;
|
|
10
|
+
return approvals + inputs;
|
|
11
|
+
}
|
|
12
|
+
var PRIMARY_NAV = [
|
|
13
|
+
{ id: "cockpit", label: "Cockpit", scene: "main", argv: ["main"], enterLabel: "Cockpit", member: ["main"] },
|
|
14
|
+
{ id: "runs", label: "Runs", scene: "fleet", argv: ["runs"], enterLabel: "Runs", member: ["fleet", "run-detail", "inspect", "handoff"] },
|
|
15
|
+
{ id: "tasks", label: "Tasks", scene: "tasks", argv: ["tasks"], enterLabel: "Tasks", member: ["tasks"] },
|
|
16
|
+
{ id: "inbox", label: "Inbox", scene: "inbox", argv: ["inbox"], enterLabel: "Inbox", member: ["inbox"], badge: inboxPendingCount },
|
|
17
|
+
{ id: "stats", label: "Stats", scene: "family", argv: ["stats"], enterLabel: "Stats", member: ["family"] },
|
|
18
|
+
{ id: "setup", label: "Setup", scene: "init", argv: ["init"], enterLabel: "Setup", member: ["init", "doctor", "server", "pi", "plugin", "repo", "workspace"] },
|
|
19
|
+
{ id: "help", label: "Help", scene: "help", argv: ["help"], enterLabel: "Help", member: ["help"] }
|
|
20
|
+
];
|
|
21
|
+
function navSectionIntent(section) {
|
|
22
|
+
if (section.scene === "help") {
|
|
23
|
+
return { scene: "help", argv: ["help"], action: { kind: "none", label: "Help" } };
|
|
24
|
+
}
|
|
25
|
+
if (section.scene === "family") {
|
|
26
|
+
return { scene: "family", argv: section.argv, action: { kind: "refresh", label: section.enterLabel, payload: { family: section.argv[0] } } };
|
|
27
|
+
}
|
|
28
|
+
return { scene: section.scene, argv: section.argv, action: { kind: "refresh", label: section.enterLabel } };
|
|
29
|
+
}
|
|
30
|
+
function activeNavSection(scene) {
|
|
31
|
+
return PRIMARY_NAV.find((section) => section.member.includes(scene)) ?? PRIMARY_NAV[0];
|
|
32
|
+
}
|
|
33
|
+
function sectionForScene(scene) {
|
|
34
|
+
return activeNavSection(scene).id;
|
|
35
|
+
}
|
|
36
|
+
function primaryNavIntent(scene) {
|
|
37
|
+
const section = PRIMARY_NAV.find((entry) => entry.scene === scene || entry.member.includes(scene)) ?? PRIMARY_NAV[0];
|
|
38
|
+
return navSectionIntent(section);
|
|
39
|
+
}
|
|
40
|
+
function nextPrimaryScene(current, delta) {
|
|
41
|
+
const active = activeNavSection(current);
|
|
42
|
+
const index = PRIMARY_NAV.findIndex((entry) => entry.id === active.id);
|
|
43
|
+
const base = index < 0 ? 0 : index;
|
|
44
|
+
return PRIMARY_NAV[(base + delta + PRIMARY_NAV.length) % PRIMARY_NAV.length].scene;
|
|
45
|
+
}
|
|
46
|
+
export {
|
|
47
|
+
sectionForScene,
|
|
48
|
+
primaryNavIntent,
|
|
49
|
+
nextPrimaryScene,
|
|
50
|
+
navSectionIntent,
|
|
51
|
+
inboxPendingCount,
|
|
52
|
+
activeNavSection,
|
|
53
|
+
PRIMARY_NAV
|
|
54
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** The minimal surface the keymap needs: a visible flag + scrollBy(delta). Both
|
|
2
|
+
* ScrollBoxRenderable and the line-pipeline scroll panels satisfy this. */
|
|
3
|
+
export type ScrollableBody = {
|
|
4
|
+
readonly visible: boolean;
|
|
5
|
+
scrollBy(delta: number): void;
|
|
6
|
+
};
|
|
7
|
+
/** Register a provider of scrollable bodies (e.g. the panel pool, the native
|
|
8
|
+
* overlay). Returns an unregister fn for effect cleanup. */
|
|
9
|
+
export declare function registerScrollables(provider: () => readonly ScrollableBody[]): () => void;
|
|
10
|
+
/** Scroll every currently-visible registered body by `delta` rows — the react
|
|
11
|
+
* equivalent of the legacy keymap's scrollActiveBody. */
|
|
12
|
+
export declare function scrollActiveBody(delta: number): void;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// packages/cli/src/app-opentui/react/scroll.ts
|
|
3
|
+
var registries = new Set;
|
|
4
|
+
function registerScrollables(provider) {
|
|
5
|
+
registries.add(provider);
|
|
6
|
+
return () => {
|
|
7
|
+
registries.delete(provider);
|
|
8
|
+
};
|
|
9
|
+
}
|
|
10
|
+
function scrollActiveBody(delta) {
|
|
11
|
+
for (const provider of registries) {
|
|
12
|
+
for (const body of provider()) {
|
|
13
|
+
if (body.visible)
|
|
14
|
+
body.scrollBy(delta);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
scrollActiveBody,
|
|
20
|
+
registerScrollables
|
|
21
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// packages/cli/src/app-opentui/react/syntax.ts
|
|
3
|
+
import { RGBA, SyntaxStyle } from "@opentui/core";
|
|
4
|
+
|
|
5
|
+
// packages/cli/src/app-opentui/theme.ts
|
|
6
|
+
import {
|
|
7
|
+
bold as otuiBold,
|
|
8
|
+
dim as otuiDim,
|
|
9
|
+
fg as otuiFg,
|
|
10
|
+
t,
|
|
11
|
+
TextAttributes
|
|
12
|
+
} from "@opentui/core";
|
|
13
|
+
var RIG_UI = {
|
|
14
|
+
bg: "#070809",
|
|
15
|
+
bg2: "#0b0c0e",
|
|
16
|
+
panel: "#101115",
|
|
17
|
+
panel2: "#14161b",
|
|
18
|
+
glass: "#1e2230",
|
|
19
|
+
border: "#2a2e3a",
|
|
20
|
+
ink: "#f4f5f8",
|
|
21
|
+
ink2: "#c7c9d3",
|
|
22
|
+
ink3: "#9aa0ae",
|
|
23
|
+
ink4: "#787b86",
|
|
24
|
+
lime: "#ccff4d",
|
|
25
|
+
limeDim: "#a9d63f",
|
|
26
|
+
cyan: "#56d8ff",
|
|
27
|
+
cyanDim: "#3f9fbd",
|
|
28
|
+
red: "#ff5d5d",
|
|
29
|
+
yellow: "#ffd24d",
|
|
30
|
+
magenta: "#ff79b0"
|
|
31
|
+
};
|
|
32
|
+
var styles = {
|
|
33
|
+
ink: otuiFg(RIG_UI.ink),
|
|
34
|
+
ink2: otuiFg(RIG_UI.ink2),
|
|
35
|
+
ink3: otuiFg(RIG_UI.ink3),
|
|
36
|
+
ink4: otuiFg(RIG_UI.ink4),
|
|
37
|
+
lime: otuiFg(RIG_UI.lime),
|
|
38
|
+
limeDim: otuiFg(RIG_UI.limeDim),
|
|
39
|
+
cyan: otuiFg(RIG_UI.cyan),
|
|
40
|
+
red: otuiFg(RIG_UI.red),
|
|
41
|
+
yellow: otuiFg(RIG_UI.yellow),
|
|
42
|
+
magenta: otuiFg(RIG_UI.magenta)
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
// packages/cli/src/app-opentui/react/syntax.ts
|
|
46
|
+
var cached = null;
|
|
47
|
+
function rigSyntaxStyle() {
|
|
48
|
+
if (cached)
|
|
49
|
+
return cached;
|
|
50
|
+
cached = SyntaxStyle.fromStyles({
|
|
51
|
+
keyword: { fg: RGBA.fromHex(RIG_UI.magenta), bold: true },
|
|
52
|
+
string: { fg: RGBA.fromHex(RIG_UI.lime) },
|
|
53
|
+
number: { fg: RGBA.fromHex(RIG_UI.cyan) },
|
|
54
|
+
comment: { fg: RGBA.fromHex(RIG_UI.ink4), italic: true },
|
|
55
|
+
function: { fg: RGBA.fromHex(RIG_UI.cyan) },
|
|
56
|
+
type: { fg: RGBA.fromHex(RIG_UI.limeDim) },
|
|
57
|
+
constant: { fg: RGBA.fromHex(RIG_UI.yellow) },
|
|
58
|
+
default: { fg: RGBA.fromHex(RIG_UI.ink2) }
|
|
59
|
+
});
|
|
60
|
+
return cached;
|
|
61
|
+
}
|
|
62
|
+
export {
|
|
63
|
+
rigSyntaxStyle
|
|
64
|
+
};
|