@h-rig/cli 0.0.6-alpha.89 → 0.0.6-alpha.90
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/build-rig-binaries.js +8 -40
- package/dist/bin/rig.js +12519 -26675
- package/dist/src/app/board.js +74 -693
- package/dist/src/app/drone-ui.js +1 -1
- package/dist/src/app/theme.js +0 -1
- package/dist/src/commands/_async-ui.js +1 -1
- package/dist/src/commands/_authority-runs.d.ts +1 -1
- package/dist/src/commands/_authority-runs.js +12 -2
- package/dist/src/commands/_cli-format.d.ts +1 -10
- package/dist/src/commands/_cli-format.js +2 -5
- package/dist/src/commands/_connection-state.d.ts +1 -11
- package/dist/src/commands/_connection-state.js +5 -50
- package/dist/src/commands/_doctor-checks.js +40 -501
- package/dist/src/commands/_help-catalog.js +17 -99
- package/dist/src/commands/_json-output.js +0 -4
- package/dist/src/commands/_operator-view.js +54 -575
- package/dist/src/commands/_pi-frontend.d.ts +0 -27
- package/dist/src/commands/_pi-frontend.js +52 -576
- package/dist/src/commands/_preflight.js +66 -553
- package/dist/src/commands/_server-client.d.ts +0 -33
- package/dist/src/commands/_server-client.js +46 -541
- package/dist/src/commands/_snapshot-upload.js +42 -503
- package/dist/src/commands/_spinner.js +1 -1
- package/dist/src/commands/agent.js +12 -2
- package/dist/src/commands/browser.js +1 -1
- package/dist/src/commands/connect.js +15 -626
- package/dist/src/commands/doctor.js +41 -502
- package/dist/src/commands/github.js +51 -584
- package/dist/src/commands/inbox.js +41 -502
- package/dist/src/commands/init.js +74 -561
- package/dist/src/commands/inspect.js +41 -502
- package/dist/src/commands/run.js +54 -578
- package/dist/src/commands/server.js +163 -692
- package/dist/src/commands/setup.js +46 -507
- package/dist/src/commands/stats.js +58 -601
- package/dist/src/commands/task-run-driver.js +58 -509
- package/dist/src/commands/task.js +110 -729
- package/dist/src/commands.js +237 -1112
- package/dist/src/index.js +244 -1123
- package/dist/src/launcher.js +0 -4
- package/package.json +9 -13
- package/dist/src/app-opentui/adapters/command.d.ts +0 -2
- package/dist/src/app-opentui/adapters/command.js +0 -329
- package/dist/src/app-opentui/adapters/common.d.ts +0 -56
- package/dist/src/app-opentui/adapters/common.js +0 -153
- package/dist/src/app-opentui/adapters/doctor.d.ts +0 -9
- package/dist/src/app-opentui/adapters/doctor.js +0 -1217
- package/dist/src/app-opentui/adapters/family.d.ts +0 -62
- package/dist/src/app-opentui/adapters/family.js +0 -14855
- package/dist/src/app-opentui/adapters/fleet.d.ts +0 -14
- package/dist/src/app-opentui/adapters/fleet.js +0 -1335
- package/dist/src/app-opentui/adapters/inbox.d.ts +0 -43
- package/dist/src/app-opentui/adapters/inbox.js +0 -1944
- package/dist/src/app-opentui/adapters/init.d.ts +0 -11
- package/dist/src/app-opentui/adapters/init.js +0 -2818
- package/dist/src/app-opentui/adapters/inspect.d.ts +0 -52
- package/dist/src/app-opentui/adapters/inspect.js +0 -1455
- package/dist/src/app-opentui/adapters/pi-attach.d.ts +0 -32
- package/dist/src/app-opentui/adapters/pi-attach.js +0 -2101
- package/dist/src/app-opentui/adapters/pi.d.ts +0 -23
- package/dist/src/app-opentui/adapters/pi.js +0 -363
- package/dist/src/app-opentui/adapters/plugin.d.ts +0 -84
- package/dist/src/app-opentui/adapters/plugin.js +0 -544
- package/dist/src/app-opentui/adapters/repo.d.ts +0 -37
- package/dist/src/app-opentui/adapters/repo.js +0 -186
- package/dist/src/app-opentui/adapters/run-detail.d.ts +0 -27
- package/dist/src/app-opentui/adapters/run-detail.js +0 -1441
- package/dist/src/app-opentui/adapters/server.d.ts +0 -48
- package/dist/src/app-opentui/adapters/server.js +0 -1561
- package/dist/src/app-opentui/adapters/tasks.d.ts +0 -64
- package/dist/src/app-opentui/adapters/tasks.js +0 -4524
- package/dist/src/app-opentui/adapters/workspace.d.ts +0 -49
- package/dist/src/app-opentui/adapters/workspace.js +0 -333
- package/dist/src/app-opentui/autocomplete.d.ts +0 -20
- package/dist/src/app-opentui/autocomplete.js +0 -578
- package/dist/src/app-opentui/bootstrap.d.ts +0 -11
- package/dist/src/app-opentui/bootstrap.js +0 -27833
- package/dist/src/app-opentui/command-palette.d.ts +0 -3
- package/dist/src/app-opentui/command-palette.js +0 -1038
- package/dist/src/app-opentui/command-pty-host.d.ts +0 -62
- package/dist/src/app-opentui/command-pty-host.js +0 -248
- package/dist/src/app-opentui/drone.d.ts +0 -12
- package/dist/src/app-opentui/drone.js +0 -230
- package/dist/src/app-opentui/events.d.ts +0 -7
- package/dist/src/app-opentui/events.js +0 -28
- package/dist/src/app-opentui/fleet-stats.d.ts +0 -32
- package/dist/src/app-opentui/fleet-stats.js +0 -114
- package/dist/src/app-opentui/focus-manager.d.ts +0 -14
- package/dist/src/app-opentui/focus-manager.js +0 -24
- package/dist/src/app-opentui/index.d.ts +0 -8
- package/dist/src/app-opentui/index.js +0 -5260
- package/dist/src/app-opentui/intent.d.ts +0 -3
- package/dist/src/app-opentui/intent.js +0 -365
- package/dist/src/app-opentui/keymap.d.ts +0 -21
- package/dist/src/app-opentui/keymap.js +0 -1377
- package/dist/src/app-opentui/launch-routing.d.ts +0 -16
- package/dist/src/app-opentui/launch-routing.js +0 -55
- package/dist/src/app-opentui/layout.d.ts +0 -22
- package/dist/src/app-opentui/layout.js +0 -51
- package/dist/src/app-opentui/list-search.d.ts +0 -36
- package/dist/src/app-opentui/list-search.js +0 -130
- package/dist/src/app-opentui/pi-host-child.d.ts +0 -2
- package/dist/src/app-opentui/pi-host-child.js +0 -1299
- package/dist/src/app-opentui/pi-pty-host.d.ts +0 -28
- package/dist/src/app-opentui/pi-pty-host.js +0 -10
- package/dist/src/app-opentui/react/App.d.ts +0 -9
- package/dist/src/app-opentui/react/App.js +0 -3866
- package/dist/src/app-opentui/react/Backdrop.d.ts +0 -5
- package/dist/src/app-opentui/react/Backdrop.js +0 -823
- package/dist/src/app-opentui/react/ChromeHost.d.ts +0 -5
- package/dist/src/app-opentui/react/ChromeHost.js +0 -1539
- package/dist/src/app-opentui/react/SceneFrameView.d.ts +0 -7
- package/dist/src/app-opentui/react/SceneFrameView.js +0 -579
- package/dist/src/app-opentui/react/context.d.ts +0 -17
- package/dist/src/app-opentui/react/context.js +0 -37
- package/dist/src/app-opentui/react/launch.d.ts +0 -2
- package/dist/src/app-opentui/react/launch.js +0 -4897
- package/dist/src/app-opentui/react/nav.d.ts +0 -18
- package/dist/src/app-opentui/react/nav.js +0 -54
- package/dist/src/app-opentui/react/scroll.d.ts +0 -12
- package/dist/src/app-opentui/react/scroll.js +0 -21
- package/dist/src/app-opentui/react/syntax.d.ts +0 -2
- package/dist/src/app-opentui/react/syntax.js +0 -65
- package/dist/src/app-opentui/registry.d.ts +0 -4
- package/dist/src/app-opentui/registry.js +0 -22876
- package/dist/src/app-opentui/remote-link.d.ts +0 -10
- package/dist/src/app-opentui/remote-link.js +0 -47
- package/dist/src/app-opentui/render/ascii-fleet.d.ts +0 -15
- package/dist/src/app-opentui/render/ascii-fleet.js +0 -82
- package/dist/src/app-opentui/render/constants.d.ts +0 -30
- package/dist/src/app-opentui/render/constants.js +0 -64
- package/dist/src/app-opentui/render/graphics.d.ts +0 -40
- package/dist/src/app-opentui/render/graphics.js +0 -713
- package/dist/src/app-opentui/render/hover.d.ts +0 -11
- package/dist/src/app-opentui/render/hover.js +0 -34
- package/dist/src/app-opentui/render/native-host.d.ts +0 -37
- package/dist/src/app-opentui/render/native-host.js +0 -180
- package/dist/src/app-opentui/render/panel-layout.d.ts +0 -38
- package/dist/src/app-opentui/render/panel-layout.js +0 -48
- package/dist/src/app-opentui/render/panels.d.ts +0 -12
- package/dist/src/app-opentui/render/panels.js +0 -288
- package/dist/src/app-opentui/render/preloader.d.ts +0 -10
- package/dist/src/app-opentui/render/preloader.js +0 -166
- package/dist/src/app-opentui/render/scene.d.ts +0 -68
- package/dist/src/app-opentui/render/scene.js +0 -300
- package/dist/src/app-opentui/render/terminal-handoff.d.ts +0 -16
- package/dist/src/app-opentui/render/terminal-handoff.js +0 -14
- package/dist/src/app-opentui/render/text.d.ts +0 -29
- package/dist/src/app-opentui/render/text.js +0 -177
- package/dist/src/app-opentui/render/type-bar.d.ts +0 -15
- package/dist/src/app-opentui/render/type-bar.js +0 -212
- package/dist/src/app-opentui/runtime-resources.d.ts +0 -16
- package/dist/src/app-opentui/runtime-resources.js +0 -62
- package/dist/src/app-opentui/runtime.d.ts +0 -45
- package/dist/src/app-opentui/runtime.js +0 -5232
- package/dist/src/app-opentui/scenes/command.d.ts +0 -3
- package/dist/src/app-opentui/scenes/command.js +0 -118
- package/dist/src/app-opentui/scenes/doctor.d.ts +0 -3
- package/dist/src/app-opentui/scenes/doctor.js +0 -296
- package/dist/src/app-opentui/scenes/error.d.ts +0 -2
- package/dist/src/app-opentui/scenes/error.js +0 -277
- package/dist/src/app-opentui/scenes/family-domains/agent.d.ts +0 -2
- package/dist/src/app-opentui/scenes/family-domains/agent.js +0 -349
- package/dist/src/app-opentui/scenes/family-domains/browser.d.ts +0 -2
- package/dist/src/app-opentui/scenes/family-domains/browser.js +0 -196
- package/dist/src/app-opentui/scenes/family-domains/dist.d.ts +0 -2
- package/dist/src/app-opentui/scenes/family-domains/dist.js +0 -244
- package/dist/src/app-opentui/scenes/family-domains/git.d.ts +0 -2
- package/dist/src/app-opentui/scenes/family-domains/git.js +0 -196
- package/dist/src/app-opentui/scenes/family-domains/github.d.ts +0 -2
- package/dist/src/app-opentui/scenes/family-domains/github.js +0 -275
- package/dist/src/app-opentui/scenes/family-domains/harness.d.ts +0 -2
- package/dist/src/app-opentui/scenes/family-domains/harness.js +0 -153
- package/dist/src/app-opentui/scenes/family-domains/index.d.ts +0 -4
- package/dist/src/app-opentui/scenes/family-domains/index.js +0 -1680
- package/dist/src/app-opentui/scenes/family-domains/kit.d.ts +0 -76
- package/dist/src/app-opentui/scenes/family-domains/kit.js +0 -306
- package/dist/src/app-opentui/scenes/family-domains/profile.d.ts +0 -2
- package/dist/src/app-opentui/scenes/family-domains/profile.js +0 -213
- package/dist/src/app-opentui/scenes/family-domains/queue.d.ts +0 -2
- package/dist/src/app-opentui/scenes/family-domains/queue.js +0 -147
- package/dist/src/app-opentui/scenes/family-domains/remote.d.ts +0 -2
- package/dist/src/app-opentui/scenes/family-domains/remote.js +0 -519
- package/dist/src/app-opentui/scenes/family-domains/review.d.ts +0 -2
- package/dist/src/app-opentui/scenes/family-domains/review.js +0 -281
- package/dist/src/app-opentui/scenes/family-domains/setup.d.ts +0 -2
- package/dist/src/app-opentui/scenes/family-domains/setup.js +0 -268
- package/dist/src/app-opentui/scenes/family-domains/stats.d.ts +0 -2
- package/dist/src/app-opentui/scenes/family-domains/stats.js +0 -371
- package/dist/src/app-opentui/scenes/family.d.ts +0 -3
- package/dist/src/app-opentui/scenes/family.js +0 -2199
- package/dist/src/app-opentui/scenes/fleet.d.ts +0 -3
- package/dist/src/app-opentui/scenes/fleet.js +0 -766
- package/dist/src/app-opentui/scenes/handoff.d.ts +0 -2
- package/dist/src/app-opentui/scenes/handoff.js +0 -455
- package/dist/src/app-opentui/scenes/help.d.ts +0 -3
- package/dist/src/app-opentui/scenes/help.js +0 -725
- package/dist/src/app-opentui/scenes/inbox.d.ts +0 -3
- package/dist/src/app-opentui/scenes/inbox.js +0 -427
- package/dist/src/app-opentui/scenes/init.d.ts +0 -3
- package/dist/src/app-opentui/scenes/init.js +0 -181
- package/dist/src/app-opentui/scenes/inspect.d.ts +0 -3
- package/dist/src/app-opentui/scenes/inspect.js +0 -794
- package/dist/src/app-opentui/scenes/main.d.ts +0 -3
- package/dist/src/app-opentui/scenes/main.js +0 -332
- package/dist/src/app-opentui/scenes/pi.d.ts +0 -3
- package/dist/src/app-opentui/scenes/pi.js +0 -509
- package/dist/src/app-opentui/scenes/plugin.d.ts +0 -3
- package/dist/src/app-opentui/scenes/plugin.js +0 -487
- package/dist/src/app-opentui/scenes/repo.d.ts +0 -3
- package/dist/src/app-opentui/scenes/repo.js +0 -425
- package/dist/src/app-opentui/scenes/run-detail.d.ts +0 -3
- package/dist/src/app-opentui/scenes/run-detail.js +0 -467
- package/dist/src/app-opentui/scenes/server.d.ts +0 -3
- package/dist/src/app-opentui/scenes/server.js +0 -378
- package/dist/src/app-opentui/scenes/tasks.d.ts +0 -3
- package/dist/src/app-opentui/scenes/tasks.js +0 -768
- package/dist/src/app-opentui/scenes/workspace.d.ts +0 -3
- package/dist/src/app-opentui/scenes/workspace.js +0 -427
- package/dist/src/app-opentui/selectable.d.ts +0 -19
- package/dist/src/app-opentui/selectable.js +0 -80
- package/dist/src/app-opentui/state.d.ts +0 -4
- package/dist/src/app-opentui/state.js +0 -399
- package/dist/src/app-opentui/surface-catalog.d.ts +0 -20
- package/dist/src/app-opentui/surface-catalog.js +0 -542
- package/dist/src/app-opentui/theme.d.ts +0 -59
- package/dist/src/app-opentui/theme.js +0 -142
- package/dist/src/app-opentui/types.d.ts +0 -313
- package/dist/src/app-opentui/types.js +0 -1
- package/dist/src/commands/_server-events.d.ts +0 -26
- package/dist/src/commands/_server-events.js +0 -715
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import { blank, line } from "../../render/scene";
|
|
2
|
-
import { selectableDeckRow, withSelectable } from "../../selectable";
|
|
3
|
-
import { RIG_UI, statusLabel } from "../../theme";
|
|
4
|
-
import { barString, statusSegments, type StatusSegments } from "../../fleet-stats";
|
|
5
|
-
import type { StageLayout } from "../../layout";
|
|
6
|
-
import type { AppSceneLine, AppSelectableItem } from "../../types";
|
|
7
|
-
import type { AppFamilySnapshot, AppFamilySubcommand } from "../../adapters/family";
|
|
8
|
-
export { blank, line, selectableDeckRow, withSelectable, RIG_UI, statusLabel, barString, statusSegments };
|
|
9
|
-
export type { AppSceneLine, AppSelectableItem, AppFamilySnapshot, AppFamilySubcommand, StageLayout, StatusSegments };
|
|
10
|
-
/** Relativize an ISO timestamp into a compact "3m ago" / "2h ago" / "5d ago"
|
|
11
|
-
* string. Returns "" for an empty/unparseable value, and "just now" for <60s.
|
|
12
|
-
* `now` is injectable so renderers + tests stay deterministic. */
|
|
13
|
-
export declare function relativeTime(iso: string, now?: number): string;
|
|
14
|
-
/** The structured live state a domain renderer draws from. `details` is the
|
|
15
|
-
* captured command's typed result payload (narrow it per domain); `lines` is the
|
|
16
|
-
* captured stdout fallback when there is no structured detail. */
|
|
17
|
-
export type DomainState = AppFamilySnapshot["state"];
|
|
18
|
-
/** Everything a bespoke domain renderer needs. `cursor` tracks the running
|
|
19
|
-
* selectable position so highlight/selection works without manual index math —
|
|
20
|
-
* call `cursor.deck(...)` for every selectable row in render order. */
|
|
21
|
-
export type DomainCtx = {
|
|
22
|
-
readonly family: string;
|
|
23
|
-
readonly snap: AppFamilySnapshot;
|
|
24
|
-
readonly state: DomainState;
|
|
25
|
-
readonly details: Record<string, unknown> | null;
|
|
26
|
-
readonly selected: number;
|
|
27
|
-
readonly layout?: StageLayout;
|
|
28
|
-
readonly cursor: SelCursor;
|
|
29
|
-
/** The id of the drilled-into item for this family (set by a data row via
|
|
30
|
-
* `drillItem`, cleared by `drillBackItem` or a family switch). When set, the
|
|
31
|
-
* renderer should show that item's dedicated DETAIL screen (#5). */
|
|
32
|
-
readonly drillId?: string;
|
|
33
|
-
};
|
|
34
|
-
/** A bespoke per-domain renderer: produces the overview body for one family. */
|
|
35
|
-
export type DomainRenderer = (ctx: DomainCtx) => readonly AppSceneLine[];
|
|
36
|
-
export type SelCursor = {
|
|
37
|
-
/** Render a selectable deck row at the current position and advance. */
|
|
38
|
-
deck(opts: {
|
|
39
|
-
readonly label: string;
|
|
40
|
-
readonly detail: string;
|
|
41
|
-
}, item: AppSelectableItem): AppSceneLine;
|
|
42
|
-
/** Render an arbitrary selectable line (e.g. a clickable data row) and advance. */
|
|
43
|
-
row(content: AppSceneLine, item: AppSelectableItem): AppSceneLine;
|
|
44
|
-
/** The index the next selectable will occupy (for `active:` math if needed). */
|
|
45
|
-
readonly index: number;
|
|
46
|
-
};
|
|
47
|
-
export declare function makeCursor(selected: number): SelCursor;
|
|
48
|
-
/** The canonical action item for a subcommand — IDENTICAL wiring to the generic
|
|
49
|
-
* overview: a field-less command runs directly (command-run); a parameterized
|
|
50
|
-
* command opens the shared form drill-down (refresh + formSub payload). Use this
|
|
51
|
-
* for every action row so bespoke surfaces stay wired like the rest of the app. */
|
|
52
|
-
export declare function actionItemFor(family: string, sub: AppFamilySubcommand): AppSelectableItem;
|
|
53
|
-
/** Detail suffix for an action row: field count for parameterized commands. */
|
|
54
|
-
export declare function actionDetail(sub: AppFamilySubcommand): string;
|
|
55
|
-
/** Render a list of subcommands as a contextual ACTIONS deck. Domains that want
|
|
56
|
-
* the default action list can call this; domains that group/relabel actions can
|
|
57
|
-
* build rows directly with `cursor.deck(..., actionItemFor(family, sub))`. */
|
|
58
|
-
export declare function actionDeck(ctx: DomainCtx, subs: readonly AppFamilySubcommand[], heading?: string): AppSceneLine[];
|
|
59
|
-
/** Narrow a details value to string/number/boolean for display. */
|
|
60
|
-
export declare function detailText(details: Record<string, unknown> | null, key: string): string | undefined;
|
|
61
|
-
/** A labeled metric tile line: " LABEL value". Right-pads the label. */
|
|
62
|
-
export declare function metric(label: string, value: string, opts?: {
|
|
63
|
-
readonly fg?: string;
|
|
64
|
-
readonly bold?: boolean;
|
|
65
|
-
}): AppSceneLine;
|
|
66
|
-
/** A section heading line in the cockpit style — bright + bold so headings LEAD
|
|
67
|
-
* the eye instead of receding dimmer than the body text under them. */
|
|
68
|
-
export declare function heading(text: string): AppSceneLine;
|
|
69
|
-
/** A selectable item that DRILLS INTO a dedicated detail screen for one data
|
|
70
|
-
* row (#5). Activating it patches `familyDrillId` (a pure data patch — no
|
|
71
|
-
* refetch), so the renderer re-renders with `ctx.drillId` set to this id. Carry
|
|
72
|
-
* extra row context on `data` for the detail view via `extra`. */
|
|
73
|
-
export declare function drillItem(id: string, label: string, message?: string, extra?: Record<string, unknown>): AppSelectableItem;
|
|
74
|
-
/** The "back" row out of a detail screen — clears `familyDrillId` to return to
|
|
75
|
-
* the family overview. */
|
|
76
|
-
export declare function drillBackItem(message?: string): AppSelectableItem;
|
|
@@ -1,306 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
// packages/cli/src/app-opentui/theme.ts
|
|
3
|
-
import {
|
|
4
|
-
bold as otuiBold,
|
|
5
|
-
dim as otuiDim,
|
|
6
|
-
fg as otuiFg,
|
|
7
|
-
t,
|
|
8
|
-
TextAttributes
|
|
9
|
-
} from "@opentui/core";
|
|
10
|
-
var RIG_UI = {
|
|
11
|
-
bg: "#070809",
|
|
12
|
-
bg2: "#0b0c0e",
|
|
13
|
-
panel: "#101115",
|
|
14
|
-
panel2: "#14161b",
|
|
15
|
-
hover: "#181b24",
|
|
16
|
-
glass: "#1e2230",
|
|
17
|
-
border: "#2a2e3a",
|
|
18
|
-
ink: "#f4f5f8",
|
|
19
|
-
ink2: "#c7c9d3",
|
|
20
|
-
ink3: "#9aa0ae",
|
|
21
|
-
ink4: "#787b86",
|
|
22
|
-
lime: "#ccff4d",
|
|
23
|
-
limeDim: "#a9d63f",
|
|
24
|
-
cyan: "#56d8ff",
|
|
25
|
-
cyanDim: "#3f9fbd",
|
|
26
|
-
red: "#ff5d5d",
|
|
27
|
-
yellow: "#ffd24d",
|
|
28
|
-
magenta: "#ff79b0"
|
|
29
|
-
};
|
|
30
|
-
var styles = {
|
|
31
|
-
ink: otuiFg(RIG_UI.ink),
|
|
32
|
-
ink2: otuiFg(RIG_UI.ink2),
|
|
33
|
-
ink3: otuiFg(RIG_UI.ink3),
|
|
34
|
-
ink4: otuiFg(RIG_UI.ink4),
|
|
35
|
-
lime: otuiFg(RIG_UI.lime),
|
|
36
|
-
limeDim: otuiFg(RIG_UI.limeDim),
|
|
37
|
-
cyan: otuiFg(RIG_UI.cyan),
|
|
38
|
-
red: otuiFg(RIG_UI.red),
|
|
39
|
-
yellow: otuiFg(RIG_UI.yellow),
|
|
40
|
-
magenta: otuiFg(RIG_UI.magenta)
|
|
41
|
-
};
|
|
42
|
-
function statusColor(status) {
|
|
43
|
-
switch (status) {
|
|
44
|
-
case "success":
|
|
45
|
-
case "completed":
|
|
46
|
-
case "merged":
|
|
47
|
-
return RIG_UI.lime;
|
|
48
|
-
case "running":
|
|
49
|
-
case "preparing":
|
|
50
|
-
case "created":
|
|
51
|
-
case "validating":
|
|
52
|
-
case "reviewing":
|
|
53
|
-
case "closing-out":
|
|
54
|
-
case "stopping":
|
|
55
|
-
case "loading":
|
|
56
|
-
case "action":
|
|
57
|
-
return RIG_UI.cyan;
|
|
58
|
-
case "needs-attention":
|
|
59
|
-
case "needs_attention":
|
|
60
|
-
return RIG_UI.yellow;
|
|
61
|
-
case "failed":
|
|
62
|
-
case "error":
|
|
63
|
-
return RIG_UI.red;
|
|
64
|
-
default:
|
|
65
|
-
return RIG_UI.ink3;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
function statusGlyph(status) {
|
|
69
|
-
switch (status) {
|
|
70
|
-
case "success":
|
|
71
|
-
case "completed":
|
|
72
|
-
case "merged":
|
|
73
|
-
return "\u2713";
|
|
74
|
-
case "running":
|
|
75
|
-
return "\u25CF";
|
|
76
|
-
case "preparing":
|
|
77
|
-
case "created":
|
|
78
|
-
case "validating":
|
|
79
|
-
case "reviewing":
|
|
80
|
-
case "closing-out":
|
|
81
|
-
case "stopping":
|
|
82
|
-
case "loading":
|
|
83
|
-
case "action":
|
|
84
|
-
return "\u25D0";
|
|
85
|
-
case "needs-attention":
|
|
86
|
-
case "needs_attention":
|
|
87
|
-
return "\u26A0";
|
|
88
|
-
case "failed":
|
|
89
|
-
case "error":
|
|
90
|
-
return "\u2717";
|
|
91
|
-
default:
|
|
92
|
-
return "\xB7";
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
function noColorActive() {
|
|
96
|
-
const noColor = process.env.NO_COLOR;
|
|
97
|
-
if (noColor !== undefined && noColor !== "") {
|
|
98
|
-
return true;
|
|
99
|
-
}
|
|
100
|
-
return process.env.RIG_NO_COLOR !== undefined;
|
|
101
|
-
}
|
|
102
|
-
function statusLabel(status) {
|
|
103
|
-
return {
|
|
104
|
-
glyph: statusGlyph(status),
|
|
105
|
-
color: noColorActive() ? RIG_UI.ink : statusColor(status)
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
// packages/cli/src/app-opentui/drone.ts
|
|
110
|
-
import { RGBA, StyledText, TextAttributes as TextAttributes2 } from "@opentui/core";
|
|
111
|
-
var COLOR = {
|
|
112
|
-
body: RGBA.fromHex(RIG_UI.lime),
|
|
113
|
-
mini: RGBA.fromHex(RIG_UI.limeDim),
|
|
114
|
-
rotor: RGBA.fromHex(RIG_UI.cyan),
|
|
115
|
-
path: RGBA.fromHex(RIG_UI.cyan),
|
|
116
|
-
eye: RGBA.fromHex(RIG_UI.ink),
|
|
117
|
-
dim: RGBA.fromHex(RIG_UI.ink4),
|
|
118
|
-
ink: RGBA.fromHex(RIG_UI.ink2)
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
// packages/cli/src/app-opentui/render/scene.ts
|
|
122
|
-
function line(text, options = {}) {
|
|
123
|
-
return { text, ...options };
|
|
124
|
-
}
|
|
125
|
-
function blank() {
|
|
126
|
-
return { text: "" };
|
|
127
|
-
}
|
|
128
|
-
function deckRow(input) {
|
|
129
|
-
const prefix = input.active ? "\u25B8" : " ";
|
|
130
|
-
const label = input.label.toUpperCase().padEnd(10);
|
|
131
|
-
return line(`${prefix} ${label} ${input.detail}`, {
|
|
132
|
-
fg: input.active ? RIG_UI.lime : RIG_UI.ink2,
|
|
133
|
-
bold: input.active,
|
|
134
|
-
selectableIndex: input.index,
|
|
135
|
-
activateOnClick: input.activateOnClick
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
// packages/cli/src/app-opentui/selectable.ts
|
|
140
|
-
function selectableDeckRow(deck, item) {
|
|
141
|
-
return { ...deckRow({ ...deck, activateOnClick: true }), selectable: item };
|
|
142
|
-
}
|
|
143
|
-
function withSelectable(line2, item) {
|
|
144
|
-
return { ...line2, selectable: item, activateOnClick: true };
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
// packages/cli/src/app-opentui/fleet-stats.ts
|
|
148
|
-
var ACTIVE_STATUSES = new Set([
|
|
149
|
-
"running",
|
|
150
|
-
"preparing",
|
|
151
|
-
"created",
|
|
152
|
-
"validating",
|
|
153
|
-
"reviewing",
|
|
154
|
-
"closing-out",
|
|
155
|
-
"stopping",
|
|
156
|
-
"loading"
|
|
157
|
-
]);
|
|
158
|
-
var BAR_CHARS = ["\u258F", "\u258E", "\u258D", "\u258C", "\u258B", "\u258A", "\u2589", "\u2588"];
|
|
159
|
-
function barString(ratio, width) {
|
|
160
|
-
if (width <= 0)
|
|
161
|
-
return "";
|
|
162
|
-
const clamped = Math.max(0, Math.min(1, ratio));
|
|
163
|
-
const totalEighths = Math.round(clamped * width * 8);
|
|
164
|
-
const full = Math.floor(totalEighths / 8);
|
|
165
|
-
const remainder = totalEighths % 8;
|
|
166
|
-
let bar = "\u2588".repeat(Math.min(width, full));
|
|
167
|
-
if (full < width && remainder > 0)
|
|
168
|
-
bar += BAR_CHARS[remainder - 1];
|
|
169
|
-
return bar.padEnd(width, " ").slice(0, width);
|
|
170
|
-
}
|
|
171
|
-
function statusSegments(stats, width) {
|
|
172
|
-
if (width <= 0 || stats.total === 0)
|
|
173
|
-
return { active: "", done: "", failed: "", other: "" };
|
|
174
|
-
const other = Math.max(0, stats.total - stats.active - stats.succeeded - stats.failed);
|
|
175
|
-
const raw = [
|
|
176
|
-
{ key: "active", value: stats.active },
|
|
177
|
-
{ key: "done", value: stats.succeeded },
|
|
178
|
-
{ key: "failed", value: stats.failed },
|
|
179
|
-
{ key: "other", value: other }
|
|
180
|
-
];
|
|
181
|
-
const exact = raw.map((entry) => ({ key: entry.key, exact: entry.value / stats.total * width }));
|
|
182
|
-
const floored = exact.map((entry) => ({ key: entry.key, n: Math.floor(entry.exact), frac: entry.exact - Math.floor(entry.exact) }));
|
|
183
|
-
let remaining = width - floored.reduce((sum, entry) => sum + entry.n, 0);
|
|
184
|
-
for (const entry of [...floored].sort((a, b) => b.frac - a.frac)) {
|
|
185
|
-
if (remaining <= 0)
|
|
186
|
-
break;
|
|
187
|
-
entry.n += 1;
|
|
188
|
-
remaining -= 1;
|
|
189
|
-
}
|
|
190
|
-
const widths = new Map(floored.map((entry) => [entry.key, entry.n]));
|
|
191
|
-
return {
|
|
192
|
-
active: "\u2588".repeat(widths.get("active") ?? 0),
|
|
193
|
-
done: "\u2588".repeat(widths.get("done") ?? 0),
|
|
194
|
-
failed: "\u2588".repeat(widths.get("failed") ?? 0),
|
|
195
|
-
other: "\u2592".repeat(widths.get("other") ?? 0)
|
|
196
|
-
};
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
// packages/cli/src/app-opentui/scenes/family-domains/kit.ts
|
|
200
|
-
function relativeTime(iso, now = Date.now()) {
|
|
201
|
-
if (!iso)
|
|
202
|
-
return "";
|
|
203
|
-
const then = Date.parse(iso);
|
|
204
|
-
if (!Number.isFinite(then))
|
|
205
|
-
return "";
|
|
206
|
-
const deltaMs = now - then;
|
|
207
|
-
if (deltaMs < 0)
|
|
208
|
-
return "just now";
|
|
209
|
-
const seconds = Math.floor(deltaMs / 1000);
|
|
210
|
-
if (seconds < 60)
|
|
211
|
-
return "just now";
|
|
212
|
-
const minutes = Math.floor(seconds / 60);
|
|
213
|
-
if (minutes < 60)
|
|
214
|
-
return `${minutes}m ago`;
|
|
215
|
-
const hours = Math.floor(minutes / 60);
|
|
216
|
-
if (hours < 24)
|
|
217
|
-
return `${hours}h ago`;
|
|
218
|
-
const days = Math.floor(hours / 24);
|
|
219
|
-
return `${days}d ago`;
|
|
220
|
-
}
|
|
221
|
-
function makeCursor(selected) {
|
|
222
|
-
let i = 0;
|
|
223
|
-
return {
|
|
224
|
-
deck(opts, item) {
|
|
225
|
-
const row = selectableDeckRow({ ...opts, index: i, active: selected === i }, item);
|
|
226
|
-
i += 1;
|
|
227
|
-
return row;
|
|
228
|
-
},
|
|
229
|
-
row(content, item) {
|
|
230
|
-
const row = withSelectable({ ...content, bold: selected === i ? true : content.bold }, item);
|
|
231
|
-
i += 1;
|
|
232
|
-
return row;
|
|
233
|
-
},
|
|
234
|
-
get index() {
|
|
235
|
-
return i;
|
|
236
|
-
}
|
|
237
|
-
};
|
|
238
|
-
}
|
|
239
|
-
function actionItemFor(family, sub) {
|
|
240
|
-
const base = sub.base.join(" ");
|
|
241
|
-
if (sub.direct) {
|
|
242
|
-
const label = `run rig ${family} ${base}`.trim();
|
|
243
|
-
return {
|
|
244
|
-
id: `action:${sub.id}`,
|
|
245
|
-
label,
|
|
246
|
-
intent: { scene: "command", argv: [family, ...sub.base], action: { kind: "command-run", label: `Run rig ${family} ${base}`.trim(), payload: { argv: [family, ...sub.base], family } } },
|
|
247
|
-
message: label
|
|
248
|
-
};
|
|
249
|
-
}
|
|
250
|
-
return {
|
|
251
|
-
id: `action:${sub.id}`,
|
|
252
|
-
label: `configure ${family} ${base}`.trim(),
|
|
253
|
-
intent: { scene: "family", argv: [family], action: { kind: "refresh", label: `Configure ${sub.template}`, payload: { family, formSub: sub.id } } },
|
|
254
|
-
message: `configure & run rig ${family} ${sub.template}`
|
|
255
|
-
};
|
|
256
|
-
}
|
|
257
|
-
function actionDetail(sub) {
|
|
258
|
-
return sub.direct ? sub.description : `${sub.description} \xB7 ${sub.fields.length} field${sub.fields.length === 1 ? "" : "s"}`;
|
|
259
|
-
}
|
|
260
|
-
function actionDeck(ctx, subs, heading = "ACTIONS") {
|
|
261
|
-
const out = [line(heading, { fg: RIG_UI.ink3, bold: true })];
|
|
262
|
-
for (const sub of subs) {
|
|
263
|
-
out.push(ctx.cursor.deck({ label: sub.base.join(" ") || ctx.family, detail: actionDetail(sub) }, actionItemFor(ctx.family, sub)));
|
|
264
|
-
}
|
|
265
|
-
return out;
|
|
266
|
-
}
|
|
267
|
-
function detailText(details, key) {
|
|
268
|
-
const value = details?.[key];
|
|
269
|
-
if (value === undefined || value === null)
|
|
270
|
-
return;
|
|
271
|
-
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean")
|
|
272
|
-
return String(value);
|
|
273
|
-
return;
|
|
274
|
-
}
|
|
275
|
-
function metric(label, value, opts = {}) {
|
|
276
|
-
return line(` ${label.padEnd(22)} ${value}`, { fg: opts.fg ?? RIG_UI.ink2, bold: opts.bold });
|
|
277
|
-
}
|
|
278
|
-
function heading(text) {
|
|
279
|
-
return line(text, { fg: RIG_UI.ink, bold: true });
|
|
280
|
-
}
|
|
281
|
-
function drillItem(id, label, message, extra) {
|
|
282
|
-
return { id, label, data: { ...extra ?? {}, familyDrillId: id }, message: message ?? label };
|
|
283
|
-
}
|
|
284
|
-
function drillBackItem(message = "return to overview") {
|
|
285
|
-
return { id: "drill-back", label: "back", data: { familyDrillId: undefined }, message };
|
|
286
|
-
}
|
|
287
|
-
export {
|
|
288
|
-
withSelectable,
|
|
289
|
-
statusSegments,
|
|
290
|
-
statusLabel,
|
|
291
|
-
selectableDeckRow,
|
|
292
|
-
relativeTime,
|
|
293
|
-
metric,
|
|
294
|
-
makeCursor,
|
|
295
|
-
line,
|
|
296
|
-
heading,
|
|
297
|
-
drillItem,
|
|
298
|
-
drillBackItem,
|
|
299
|
-
detailText,
|
|
300
|
-
blank,
|
|
301
|
-
barString,
|
|
302
|
-
actionItemFor,
|
|
303
|
-
actionDetail,
|
|
304
|
-
actionDeck,
|
|
305
|
-
RIG_UI
|
|
306
|
-
};
|
|
@@ -1,213 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
// packages/cli/src/app-opentui/theme.ts
|
|
3
|
-
import {
|
|
4
|
-
bold as otuiBold,
|
|
5
|
-
dim as otuiDim,
|
|
6
|
-
fg as otuiFg,
|
|
7
|
-
t,
|
|
8
|
-
TextAttributes
|
|
9
|
-
} from "@opentui/core";
|
|
10
|
-
var RIG_UI = {
|
|
11
|
-
bg: "#070809",
|
|
12
|
-
bg2: "#0b0c0e",
|
|
13
|
-
panel: "#101115",
|
|
14
|
-
panel2: "#14161b",
|
|
15
|
-
hover: "#181b24",
|
|
16
|
-
glass: "#1e2230",
|
|
17
|
-
border: "#2a2e3a",
|
|
18
|
-
ink: "#f4f5f8",
|
|
19
|
-
ink2: "#c7c9d3",
|
|
20
|
-
ink3: "#9aa0ae",
|
|
21
|
-
ink4: "#787b86",
|
|
22
|
-
lime: "#ccff4d",
|
|
23
|
-
limeDim: "#a9d63f",
|
|
24
|
-
cyan: "#56d8ff",
|
|
25
|
-
cyanDim: "#3f9fbd",
|
|
26
|
-
red: "#ff5d5d",
|
|
27
|
-
yellow: "#ffd24d",
|
|
28
|
-
magenta: "#ff79b0"
|
|
29
|
-
};
|
|
30
|
-
var styles = {
|
|
31
|
-
ink: otuiFg(RIG_UI.ink),
|
|
32
|
-
ink2: otuiFg(RIG_UI.ink2),
|
|
33
|
-
ink3: otuiFg(RIG_UI.ink3),
|
|
34
|
-
ink4: otuiFg(RIG_UI.ink4),
|
|
35
|
-
lime: otuiFg(RIG_UI.lime),
|
|
36
|
-
limeDim: otuiFg(RIG_UI.limeDim),
|
|
37
|
-
cyan: otuiFg(RIG_UI.cyan),
|
|
38
|
-
red: otuiFg(RIG_UI.red),
|
|
39
|
-
yellow: otuiFg(RIG_UI.yellow),
|
|
40
|
-
magenta: otuiFg(RIG_UI.magenta)
|
|
41
|
-
};
|
|
42
|
-
|
|
43
|
-
// packages/cli/src/app-opentui/drone.ts
|
|
44
|
-
import { RGBA, StyledText, TextAttributes as TextAttributes2 } from "@opentui/core";
|
|
45
|
-
var COLOR = {
|
|
46
|
-
body: RGBA.fromHex(RIG_UI.lime),
|
|
47
|
-
mini: RGBA.fromHex(RIG_UI.limeDim),
|
|
48
|
-
rotor: RGBA.fromHex(RIG_UI.cyan),
|
|
49
|
-
path: RGBA.fromHex(RIG_UI.cyan),
|
|
50
|
-
eye: RGBA.fromHex(RIG_UI.ink),
|
|
51
|
-
dim: RGBA.fromHex(RIG_UI.ink4),
|
|
52
|
-
ink: RGBA.fromHex(RIG_UI.ink2)
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
// packages/cli/src/app-opentui/render/scene.ts
|
|
56
|
-
function line(text, options = {}) {
|
|
57
|
-
return { text, ...options };
|
|
58
|
-
}
|
|
59
|
-
function blank() {
|
|
60
|
-
return { text: "" };
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// packages/cli/src/app-opentui/fleet-stats.ts
|
|
64
|
-
var ACTIVE_STATUSES = new Set([
|
|
65
|
-
"running",
|
|
66
|
-
"preparing",
|
|
67
|
-
"created",
|
|
68
|
-
"validating",
|
|
69
|
-
"reviewing",
|
|
70
|
-
"closing-out",
|
|
71
|
-
"stopping",
|
|
72
|
-
"loading"
|
|
73
|
-
]);
|
|
74
|
-
|
|
75
|
-
// packages/cli/src/app-opentui/scenes/family-domains/kit.ts
|
|
76
|
-
function actionItemFor(family, sub) {
|
|
77
|
-
const base = sub.base.join(" ");
|
|
78
|
-
if (sub.direct) {
|
|
79
|
-
const label = `run rig ${family} ${base}`.trim();
|
|
80
|
-
return {
|
|
81
|
-
id: `action:${sub.id}`,
|
|
82
|
-
label,
|
|
83
|
-
intent: { scene: "command", argv: [family, ...sub.base], action: { kind: "command-run", label: `Run rig ${family} ${base}`.trim(), payload: { argv: [family, ...sub.base], family } } },
|
|
84
|
-
message: label
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
return {
|
|
88
|
-
id: `action:${sub.id}`,
|
|
89
|
-
label: `configure ${family} ${base}`.trim(),
|
|
90
|
-
intent: { scene: "family", argv: [family], action: { kind: "refresh", label: `Configure ${sub.template}`, payload: { family, formSub: sub.id } } },
|
|
91
|
-
message: `configure & run rig ${family} ${sub.template}`
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
function actionDetail(sub) {
|
|
95
|
-
return sub.direct ? sub.description : `${sub.description} \xB7 ${sub.fields.length} field${sub.fields.length === 1 ? "" : "s"}`;
|
|
96
|
-
}
|
|
97
|
-
function actionDeck(ctx, subs, heading = "ACTIONS") {
|
|
98
|
-
const out = [line(heading, { fg: RIG_UI.ink3, bold: true })];
|
|
99
|
-
for (const sub of subs) {
|
|
100
|
-
out.push(ctx.cursor.deck({ label: sub.base.join(" ") || ctx.family, detail: actionDetail(sub) }, actionItemFor(ctx.family, sub)));
|
|
101
|
-
}
|
|
102
|
-
return out;
|
|
103
|
-
}
|
|
104
|
-
function detailText(details, key) {
|
|
105
|
-
const value = details?.[key];
|
|
106
|
-
if (value === undefined || value === null)
|
|
107
|
-
return;
|
|
108
|
-
if (typeof value === "string" || typeof value === "number" || typeof value === "boolean")
|
|
109
|
-
return String(value);
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
function metric(label, value, opts = {}) {
|
|
113
|
-
return line(` ${label.padEnd(22)} ${value}`, { fg: opts.fg ?? RIG_UI.ink2, bold: opts.bold });
|
|
114
|
-
}
|
|
115
|
-
function heading(text) {
|
|
116
|
-
return line(text, { fg: RIG_UI.ink, bold: true });
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
// packages/cli/src/app-opentui/scenes/family-domains/profile.ts
|
|
120
|
-
var PROFILE_PRESETS = ["claude-code", "codex-cli", "pi"];
|
|
121
|
-
var PRESET_BLURB = {
|
|
122
|
-
"claude-code": "Claude Code runtime + plugin stack",
|
|
123
|
-
"codex-cli": "Codex CLI runtime + plugin stack",
|
|
124
|
-
pi: "Pi coding-agent runtime + plugin stack"
|
|
125
|
-
};
|
|
126
|
-
function presetPicker(ctx, activePlugin) {
|
|
127
|
-
const active = activePlugin ? activePlugin.toLowerCase() : null;
|
|
128
|
-
const out = [heading("SWITCH AGENT STACK")];
|
|
129
|
-
for (const preset of PROFILE_PRESETS) {
|
|
130
|
-
const isActive = active !== null && (active === preset || active.includes(preset));
|
|
131
|
-
const argv = ["profile", "set", preset];
|
|
132
|
-
const label = isActive ? `[\u25CF ${preset}]` : `[ ${preset}]`;
|
|
133
|
-
const item = {
|
|
134
|
-
id: `profile-preset:${preset}`,
|
|
135
|
-
label: `set profile preset ${preset}`,
|
|
136
|
-
intent: { scene: "command", argv, action: { kind: "command-run", label: `rig profile set ${preset}`, payload: { argv: [...argv], family: ctx.family } } },
|
|
137
|
-
message: `switch agent stack to ${preset}`
|
|
138
|
-
};
|
|
139
|
-
const content = line(` ${label.padEnd(18)} ${PRESET_BLURB[preset] ?? ""}`, {
|
|
140
|
-
fg: isActive ? RIG_UI.bg : RIG_UI.ink2,
|
|
141
|
-
bg: isActive ? RIG_UI.lime : undefined,
|
|
142
|
-
bold: isActive
|
|
143
|
-
});
|
|
144
|
-
out.push(ctx.cursor.row(content, item));
|
|
145
|
-
}
|
|
146
|
-
return out;
|
|
147
|
-
}
|
|
148
|
-
function parseKeyValue(text) {
|
|
149
|
-
const match = /^\s*([A-Za-z][A-Za-z _-]*?)\s*:\s+(.+?)\s*$/.exec(text);
|
|
150
|
-
if (!match)
|
|
151
|
-
return null;
|
|
152
|
-
const key = match[1]?.trim().toLowerCase();
|
|
153
|
-
const value = match[2]?.trim();
|
|
154
|
-
if (!key || !value)
|
|
155
|
-
return null;
|
|
156
|
-
return [key, value];
|
|
157
|
-
}
|
|
158
|
-
function readProfile(details, lines) {
|
|
159
|
-
const fromDetails = {
|
|
160
|
-
model: detailText(details, "model") ?? null,
|
|
161
|
-
runtime: detailText(details, "runtime") ?? null,
|
|
162
|
-
plugin: detailText(details, "plugin") ?? detailText(details, "agent_plugin") ?? null
|
|
163
|
-
};
|
|
164
|
-
if (fromDetails.model || fromDetails.runtime || fromDetails.plugin)
|
|
165
|
-
return fromDetails;
|
|
166
|
-
const map = new Map;
|
|
167
|
-
for (const text of lines) {
|
|
168
|
-
const kv = parseKeyValue(text);
|
|
169
|
-
if (kv)
|
|
170
|
-
map.set(kv[0], kv[1]);
|
|
171
|
-
}
|
|
172
|
-
return {
|
|
173
|
-
model: map.get("model") ?? null,
|
|
174
|
-
runtime: map.get("runtime") ?? null,
|
|
175
|
-
plugin: map.get("plugin") ?? null
|
|
176
|
-
};
|
|
177
|
-
}
|
|
178
|
-
function tile(label, value) {
|
|
179
|
-
return value ? metric(label, value, { fg: RIG_UI.ink, bold: true }) : metric(label, "\u2014", { fg: RIG_UI.ink4 });
|
|
180
|
-
}
|
|
181
|
-
var renderProfile = (ctx) => {
|
|
182
|
-
const lines = [];
|
|
183
|
-
const profile = readProfile(ctx.details, ctx.state.lines);
|
|
184
|
-
const captured = Boolean(profile.model || profile.runtime || profile.plugin);
|
|
185
|
-
if (captured) {
|
|
186
|
-
lines.push(line("RUNTIME PROFILE \xB7 active defaults", { fg: RIG_UI.lime, bold: true }));
|
|
187
|
-
lines.push(blank());
|
|
188
|
-
lines.push(heading("AGENT DEFAULTS"));
|
|
189
|
-
lines.push(tile("model", profile.model));
|
|
190
|
-
lines.push(tile("runtime", profile.runtime));
|
|
191
|
-
lines.push(tile("agent plugin", profile.plugin));
|
|
192
|
-
lines.push(blank());
|
|
193
|
-
} else if (ctx.state.ran && ctx.state.lines.length > 0) {
|
|
194
|
-
lines.push(line("RUNTIME PROFILE", { fg: RIG_UI.lime, bold: true }));
|
|
195
|
-
lines.push(blank());
|
|
196
|
-
for (const text of ctx.state.lines.slice(0, 40))
|
|
197
|
-
lines.push(line(` ${text}`, { fg: RIG_UI.ink2 }));
|
|
198
|
-
lines.push(blank());
|
|
199
|
-
} else {
|
|
200
|
-
lines.push(line("RUNTIME PROFILE", { fg: RIG_UI.lime, bold: true }));
|
|
201
|
-
lines.push(line(" no profile captured yet \u2014 run show below", { fg: RIG_UI.ink4 }));
|
|
202
|
-
lines.push(blank());
|
|
203
|
-
}
|
|
204
|
-
lines.push(...presetPicker(ctx, profile.plugin));
|
|
205
|
-
lines.push(blank());
|
|
206
|
-
lines.push(...actionDeck(ctx, ctx.snap.subcommands, "ACTIONS"));
|
|
207
|
-
lines.push(blank());
|
|
208
|
-
lines.push(line("pick a stack cell to switch presets \xB7 show reloads \xB7 set opens the form for --model/--runtime", { fg: RIG_UI.ink4 }));
|
|
209
|
-
return lines;
|
|
210
|
-
};
|
|
211
|
-
export {
|
|
212
|
-
renderProfile
|
|
213
|
-
};
|