@bakers-build/addon-bakers-ui 0.6.1-next.5 → 0.6.1-next.7
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/src/Component/section-list/index.d.ts +5 -5
- package/dist/src/Component/section-list/index.js +2 -2
- package/dist/src/Entity/conductor/Data/conductors.d.ts +2 -12
- package/dist/src/Entity/conductor/Data/conductors.js +3 -25
- package/dist/src/Entity/conductor/Data/own-conductor.d.ts +5 -7
- package/dist/src/Entity/conductor/Data/own-conductor.js +9 -16
- package/dist/src/Entity/project/Screen/projects-screen.js +1 -4
- package/dist/src/Entity/run/Component/run-detail/index.d.ts +1 -1
- package/dist/src/Entity/run/Component/run-detail/index.js +1 -1
- package/dist/src/Entity/run/Data/query.d.ts +0 -5
- package/dist/src/Entity/run/Data/query.js +0 -8
- package/dist/src/Entity/run/Data/runs.d.ts +0 -2
- package/dist/src/Entity/run/Data/runs.js +1 -26
- package/dist/src/Entity/run/Screen/run-detail.d.ts +5 -2
- package/dist/src/Entity/run/Screen/run-detail.js +13 -2
- package/dist/src/Entity/ticket/Component/edit-form/index.d.ts +1 -2
- package/dist/src/Entity/ticket/Component/edit-form/index.js +1 -2
- package/dist/src/Entity/ticket/Component/ticket-content/index.d.ts +3 -8
- package/dist/src/Entity/ticket/Component/ticket-content/index.js +4 -71
- package/dist/src/Entity/ticket/Component/ticket-content/model.d.ts +0 -25
- package/dist/src/Entity/ticket/Component/ticket-content/model.js +0 -195
- package/dist/src/Entity/ticket/Data/parents.d.ts +3 -3
- package/dist/src/Entity/ticket/Data/parents.js +8 -9
- package/dist/src/Entity/ticket/Data/query.d.ts +0 -2
- package/dist/src/Entity/ticket/Data/query.js +0 -8
- package/dist/src/Entity/ticket/Data/tickets.d.ts +0 -2
- package/dist/src/Entity/ticket/Data/tickets.js +1 -20
- package/dist/src/Entity/ticket/Data/write.d.ts +0 -32
- package/dist/src/Entity/ticket/Data/write.js +0 -94
- package/dist/src/Entity/ticket/Form/edit-data.js +10 -4
- package/dist/src/Entity/ticket/Form/edit-parent-source.d.ts +1 -1
- package/dist/src/Entity/ticket/Form/edit.d.ts +11 -8
- package/dist/src/Entity/ticket/Form/edit.js +1 -1
- package/dist/src/Entity/ticket/Form/parent-filter.d.ts +2 -2
- package/dist/src/Entity/ticket/Form/parent-filter.js +1 -1
- package/dist/src/Entity/ticket/Form/parent-source.d.ts +11 -2
- package/dist/src/Entity/ticket/Form/parent-source.js +5 -7
- package/dist/src/Entity/ticket/Screen/edit-assignment-form.d.ts +2 -2
- package/dist/src/Entity/ticket/Screen/edit-assignment-form.js +3 -3
- package/dist/src/Entity/ticket/Screen/parent-filter-form.js +3 -4
- package/dist/src/Entity/ticket/Screen/ticket-content-screen.d.ts +1 -1
- package/dist/src/Entity/ticket/Screen/ticket-content-screen.js +1 -1
- package/dist/src/Entity/ticket/Screen/ticket-react-markdown.js +2 -2
- package/dist/src/Entity/ticket/Screen/ticket-runs.d.ts +2 -0
- package/dist/src/Entity/ticket/Screen/ticket-runs.js +26 -16
- package/dist/src/Entity/ticket/Screen/ticket-search.d.ts +1 -1
- package/dist/src/Entity/ticket/Screen/tickets.d.ts +1 -2
- package/dist/src/Entity/ticket/Screen/tickets.js +0 -23
- package/dist/src/Entity/user/Data/member-context.d.ts +1 -1
- package/dist/src/Entity/user/Data/users.d.ts +17 -98
- package/dist/src/Entity/user/Data/users.js +27 -74
- package/dist/src/Entity/user/Screen/member-overview.d.ts +12 -29
- package/dist/src/Entity/user/Screen/member-overview.js +38 -38
- package/dist/src/Entity/workspace/Screen/workspace-picker.js +1 -2
- package/dist/src/Form/field.js +1 -1
- package/dist/src/Kernel/key-input.d.ts +1 -2
- package/dist/src/Kernel/key-input.js +1 -2
- package/dist/src/Kernel/logo.d.ts +3 -0
- package/dist/src/Kernel/logo.js +48 -0
- package/dist/src/Kernel/splash.js +5 -5
- package/dist/src/Kernel/tui-kernel.js +1 -5
- package/dist/src/Routing/context.d.ts +0 -5
- package/dist/src/Routing/context.js +0 -6
- package/dist/src/Routing/registry.js +3 -6
- package/dist/src/Routing/routes.js +1 -24
- package/dist/src/Screen/async-modal-screen.d.ts +1 -1
- package/dist/src/Screen/async-modal-screen.js +1 -1
- package/dist/src/Widget/chrome.d.ts +1 -1
- package/dist/src/Widget/chrome.js +1 -1
- package/dist/src/Widget/option-source.js +3 -3
- package/dist/src/Widget/types.d.ts +2 -3
- package/dist/src/index.d.ts +0 -1
- package/dist/src/index.js +1 -2
- package/dist/src/launcher.d.ts +7 -14
- package/dist/src/launcher.js +2 -10
- package/dist/src/lib/cursor.d.ts +5 -5
- package/dist/src/lib/cursor.js +5 -5
- package/dist/src/lib/refresh-signal.d.ts +2 -2
- package/dist/src/lib/refresh-signal.js +3 -2
- package/dist/src/lib/theme.d.ts +7 -23
- package/dist/src/lib/theme.js +7 -23
- package/dist/src/plugin.d.ts +1 -2
- package/dist/src/plugin.js +3 -7
- package/dist/src/react-experiment.js +0 -2
- package/dist/src/route.js +1 -1
- package/dist/src/types.d.ts +5 -56
- package/package.json +4 -4
- package/dist/src/Agent/launch.d.ts +0 -25
- package/dist/src/Agent/launch.js +0 -57
- package/dist/src/Component/badge/index.d.ts +0 -11
- package/dist/src/Component/badge/index.js +0 -10
- package/dist/src/Component/bar-chart/index.d.ts +0 -16
- package/dist/src/Component/bar-chart/index.js +0 -63
- package/dist/src/Component/heat-map/index.d.ts +0 -21
- package/dist/src/Component/heat-map/index.js +0 -86
- package/dist/src/Component/stats-panel/index.d.ts +0 -61
- package/dist/src/Component/stats-panel/index.js +0 -112
- package/dist/src/Component/team-member-workload-list/index.d.ts +0 -9
- package/dist/src/Component/team-member-workload-list/index.js +0 -31
- package/dist/src/Entity/team/Data/members.d.ts +0 -30
- package/dist/src/Entity/team/Data/members.js +0 -83
- package/dist/src/Entity/team/Data/projects.d.ts +0 -3
- package/dist/src/Entity/team/Data/projects.js +0 -23
- package/dist/src/Entity/team/Data/team.d.ts +0 -22
- package/dist/src/Entity/team/Data/team.js +0 -38
- package/dist/src/Entity/team/Data/teams.d.ts +0 -223
- package/dist/src/Entity/team/Data/teams.js +0 -268
- package/dist/src/Entity/team/Data/workload.d.ts +0 -25
- package/dist/src/Entity/team/Data/workload.js +0 -60
- package/dist/src/Entity/team/Screen/team-member-work.d.ts +0 -41
- package/dist/src/Entity/team/Screen/team-member-work.js +0 -56
- package/dist/src/Entity/team/Screen/team-users.d.ts +0 -63
- package/dist/src/Entity/team/Screen/team-users.js +0 -210
- package/dist/src/Entity/team/Screen/team-work.d.ts +0 -39
- package/dist/src/Entity/team/Screen/team-work.js +0 -112
- package/dist/src/Entity/team/Screen/teams-screen.d.ts +0 -110
- package/dist/src/Entity/team/Screen/teams-screen.js +0 -264
- package/dist/src/Entity/ticket/Component/create-form/index.d.ts +0 -28
- package/dist/src/Entity/ticket/Component/create-form/index.js +0 -74
- package/dist/src/Entity/ticket/Component/demo-statistics.d.ts +0 -14
- package/dist/src/Entity/ticket/Component/demo-statistics.js +0 -88
- package/dist/src/Entity/ticket/Component/react-statistics.d.ts +0 -14
- package/dist/src/Entity/ticket/Component/react-statistics.js +0 -23
- package/dist/src/Entity/ticket/Data/workflow.d.ts +0 -9
- package/dist/src/Entity/ticket/Data/workflow.js +0 -18
- package/dist/src/Entity/ticket/Form/create-data.d.ts +0 -75
- package/dist/src/Entity/ticket/Form/create-data.js +0 -217
- package/dist/src/Entity/ticket/Form/create.d.ts +0 -230
- package/dist/src/Entity/ticket/Form/create.js +0 -198
- package/dist/src/Entity/ticket/Screen/create-ticket-form.d.ts +0 -133
- package/dist/src/Entity/ticket/Screen/create-ticket-form.js +0 -621
- package/dist/src/Entity/ticket/Screen/ticket-agents.d.ts +0 -134
- package/dist/src/Entity/ticket/Screen/ticket-agents.js +0 -253
- package/dist/src/Entity/ticket/Screen/ticket-react.d.ts +0 -41
- package/dist/src/Entity/ticket/Screen/ticket-react.js +0 -136
- package/dist/src/Entity/ticket-template/Data/templates.d.ts +0 -26
- package/dist/src/Entity/ticket-template/Data/templates.js +0 -62
- package/dist/src/Kernel/braid.d.ts +0 -4
- package/dist/src/Kernel/braid.js +0 -10
- package/dist/src/Screen/empty-overview.d.ts +0 -9
- package/dist/src/Screen/empty-overview.js +0 -14
- package/dist/src/Statistics/client.d.ts +0 -73
- package/dist/src/Statistics/client.js +0 -220
- package/dist/src/Statistics/comparison-chart.d.ts +0 -7
- package/dist/src/Statistics/comparison-chart.js +0 -525
- package/dist/src/Statistics/dashboard.d.ts +0 -93
- package/dist/src/Statistics/dashboard.js +0 -206
- package/dist/src/Statistics/figures.d.ts +0 -18
- package/dist/src/Statistics/figures.js +0 -162
- package/dist/src/Statistics/member-stats.d.ts +0 -58
- package/dist/src/Statistics/member-stats.js +0 -152
- package/dist/src/Statistics/presentation.d.ts +0 -8
- package/dist/src/Statistics/presentation.js +0 -36
- package/dist/src/Statistics/screen.d.ts +0 -44
- package/dist/src/Statistics/screen.js +0 -204
package/dist/src/lib/theme.d.ts
CHANGED
|
@@ -2,9 +2,10 @@ import { RGBA } from '@opentui/core';
|
|
|
2
2
|
export declare const THEME_SLOTS: {
|
|
3
3
|
/** Frame / chrome outline — same wire as {@link FOREGROUND} (no cyan). */
|
|
4
4
|
readonly border: 245;
|
|
5
|
-
/**
|
|
6
|
-
readonly
|
|
7
|
-
readonly
|
|
5
|
+
/** Bread-slice logo: butter tile, dark line, white slice — reserved for the brand mark. */
|
|
6
|
+
readonly brandTile: 221;
|
|
7
|
+
readonly brandLine: 235;
|
|
8
|
+
readonly brandSlice: 231;
|
|
8
9
|
/** Stronger outline / brand mark — same wire as {@link FOREGROUND_HIGHLIGHT}. */
|
|
9
10
|
readonly borderEmphasis: 231;
|
|
10
11
|
/** Reserved surface fill (wire `48;5;250`) — unused by chrome; body is framed, unfilled. */
|
|
@@ -17,23 +18,12 @@ export declare const THEME_SLOTS: {
|
|
|
17
18
|
readonly foregroundHighlight: 231;
|
|
18
19
|
/** Selected / active control text — full white (wire `38;5;15`). */
|
|
19
20
|
readonly foregroundActive: 15;
|
|
20
|
-
/** Comparison series A — violet (wire `38;5;141`). */
|
|
21
|
-
readonly seriesA: 141;
|
|
22
|
-
/** Comparison series B — mint (wire `38;5;79`). */
|
|
23
|
-
readonly seriesB: 79;
|
|
24
|
-
/** Comparison series C — orange (wire `38;5;214`). */
|
|
25
|
-
readonly seriesC: 214;
|
|
26
|
-
/** Comparison series D — blue (wire `38;5;75`). */
|
|
27
|
-
readonly seriesD: 75;
|
|
28
|
-
/** Comparison series E — pink (wire `38;5;169`). */
|
|
29
|
-
readonly seriesE: 169;
|
|
30
|
-
/** Comparison series F — yellow-green (wire `38;5;185`). */
|
|
31
|
-
readonly seriesF: 185;
|
|
32
21
|
};
|
|
33
22
|
/** Interactive splash hold before the first usable chrome frame. */
|
|
34
23
|
export declare const SPLASH_MS = 500;
|
|
35
|
-
export declare const
|
|
36
|
-
export declare const
|
|
24
|
+
export declare const BRAND_TILE: RGBA;
|
|
25
|
+
export declare const BRAND_LINE: RGBA;
|
|
26
|
+
export declare const BRAND_SLICE: RGBA;
|
|
37
27
|
export declare const BORDER: RGBA;
|
|
38
28
|
export declare const BORDER_EMPHASIS: RGBA;
|
|
39
29
|
export declare const BACKGROUND: RGBA;
|
|
@@ -41,12 +31,6 @@ export declare const BACKGROUND_ACTIVE: RGBA;
|
|
|
41
31
|
export declare const FOREGROUND: RGBA;
|
|
42
32
|
export declare const FOREGROUND_HIGHLIGHT: RGBA;
|
|
43
33
|
export declare const FOREGROUND_ACTIVE: RGBA;
|
|
44
|
-
export declare const SERIES_A: RGBA;
|
|
45
|
-
export declare const SERIES_B: RGBA;
|
|
46
|
-
export declare const SERIES_C: RGBA;
|
|
47
|
-
export declare const SERIES_D: RGBA;
|
|
48
|
-
export declare const SERIES_E: RGBA;
|
|
49
|
-
export declare const SERIES_F: RGBA;
|
|
50
34
|
/**
|
|
51
35
|
* Terminal theme background (`ESC[49m`) — header/modal when we do not paint
|
|
52
36
|
* {@link BACKGROUND}. Do **not** reassign to a slot.
|
package/dist/src/lib/theme.js
CHANGED
|
@@ -6,9 +6,10 @@ import { RGBA } from '@opentui/core';
|
|
|
6
6
|
export const THEME_SLOTS = {
|
|
7
7
|
/** Frame / chrome outline — same wire as {@link FOREGROUND} (no cyan). */
|
|
8
8
|
border: 245,
|
|
9
|
-
/**
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
/** Bread-slice logo: butter tile, dark line, white slice — reserved for the brand mark. */
|
|
10
|
+
brandTile: 221,
|
|
11
|
+
brandLine: 235,
|
|
12
|
+
brandSlice: 231,
|
|
12
13
|
/** Stronger outline / brand mark — same wire as {@link FOREGROUND_HIGHLIGHT}. */
|
|
13
14
|
borderEmphasis: 231,
|
|
14
15
|
/** Reserved surface fill (wire `48;5;250`) — unused by chrome; body is framed, unfilled. */
|
|
@@ -21,23 +22,12 @@ export const THEME_SLOTS = {
|
|
|
21
22
|
foregroundHighlight: 231,
|
|
22
23
|
/** Selected / active control text — full white (wire `38;5;15`). */
|
|
23
24
|
foregroundActive: 15,
|
|
24
|
-
/** Comparison series A — violet (wire `38;5;141`). */
|
|
25
|
-
seriesA: 141,
|
|
26
|
-
/** Comparison series B — mint (wire `38;5;79`). */
|
|
27
|
-
seriesB: 79,
|
|
28
|
-
/** Comparison series C — orange (wire `38;5;214`). */
|
|
29
|
-
seriesC: 214,
|
|
30
|
-
/** Comparison series D — blue (wire `38;5;75`). */
|
|
31
|
-
seriesD: 75,
|
|
32
|
-
/** Comparison series E — pink (wire `38;5;169`). */
|
|
33
|
-
seriesE: 169,
|
|
34
|
-
/** Comparison series F — yellow-green (wire `38;5;185`). */
|
|
35
|
-
seriesF: 185,
|
|
36
25
|
};
|
|
37
26
|
/** Interactive splash hold before the first usable chrome frame. */
|
|
38
27
|
export const SPLASH_MS = 500;
|
|
39
|
-
export const
|
|
40
|
-
export const
|
|
28
|
+
export const BRAND_TILE = RGBA.fromIndex(THEME_SLOTS.brandTile);
|
|
29
|
+
export const BRAND_LINE = RGBA.fromIndex(THEME_SLOTS.brandLine);
|
|
30
|
+
export const BRAND_SLICE = RGBA.fromIndex(THEME_SLOTS.brandSlice);
|
|
41
31
|
export const BORDER = RGBA.fromIndex(THEME_SLOTS.border);
|
|
42
32
|
export const BORDER_EMPHASIS = RGBA.fromIndex(THEME_SLOTS.borderEmphasis);
|
|
43
33
|
export const BACKGROUND = RGBA.fromIndex(THEME_SLOTS.background);
|
|
@@ -45,12 +35,6 @@ export const BACKGROUND_ACTIVE = RGBA.fromIndex(THEME_SLOTS.backgroundActive);
|
|
|
45
35
|
export const FOREGROUND = RGBA.fromIndex(THEME_SLOTS.foreground);
|
|
46
36
|
export const FOREGROUND_HIGHLIGHT = RGBA.fromIndex(THEME_SLOTS.foregroundHighlight);
|
|
47
37
|
export const FOREGROUND_ACTIVE = RGBA.fromIndex(THEME_SLOTS.foregroundActive);
|
|
48
|
-
export const SERIES_A = RGBA.fromIndex(THEME_SLOTS.seriesA);
|
|
49
|
-
export const SERIES_B = RGBA.fromIndex(THEME_SLOTS.seriesB);
|
|
50
|
-
export const SERIES_C = RGBA.fromIndex(THEME_SLOTS.seriesC);
|
|
51
|
-
export const SERIES_D = RGBA.fromIndex(THEME_SLOTS.seriesD);
|
|
52
|
-
export const SERIES_E = RGBA.fromIndex(THEME_SLOTS.seriesE);
|
|
53
|
-
export const SERIES_F = RGBA.fromIndex(THEME_SLOTS.seriesF);
|
|
54
38
|
/**
|
|
55
39
|
* Terminal theme background (`ESC[49m`) — header/modal when we do not paint
|
|
56
40
|
* {@link BACKGROUND}. Do **not** reassign to a slot.
|
package/dist/src/plugin.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { RendererServices, TuiOptions } from './types.js';
|
|
2
|
-
/** Options the launcher passes into the factory
|
|
3
|
-
* intent-level agent service so `bakers ui` can drive launch/list/focus/…). */
|
|
2
|
+
/** Options the launcher passes into the factory. */
|
|
4
3
|
export type BbUiOptions = TuiOptions;
|
|
5
4
|
export default function bakersUiPlugin(options?: BbUiOptions): {
|
|
6
5
|
id: string;
|
package/dist/src/plugin.js
CHANGED
|
@@ -30,9 +30,9 @@ export default function bakersUiPlugin(options = {}) {
|
|
|
30
30
|
});
|
|
31
31
|
// BB-232 (D9): the second thing resolved here, for the same reason.
|
|
32
32
|
// `~/.bakers/conductors.json` used to tell the entry which project this
|
|
33
|
-
// checkout belongs to
|
|
34
|
-
//
|
|
35
|
-
// exists to ask. Only when the entry handed over a `.bakers` dir — no
|
|
33
|
+
// checkout belongs to; the control plane knows it from the conductor
|
|
34
|
+
// record matching the `.bakers` dir, and this is the first place a
|
|
35
|
+
// client exists to ask. Only when the entry handed over a `.bakers` dir — no
|
|
36
36
|
// dir, no read, so a cockpit outside any project boots as before.
|
|
37
37
|
const own = options.bakersDir === undefined
|
|
38
38
|
? undefined
|
|
@@ -75,10 +75,6 @@ export default function bakersUiPlugin(options = {}) {
|
|
|
75
75
|
...(options.project === undefined && own?.project !== undefined
|
|
76
76
|
? { project: own.project }
|
|
77
77
|
: {}),
|
|
78
|
-
...(options.ownConductorMachineId === undefined &&
|
|
79
|
-
own?.machineId !== undefined
|
|
80
|
-
? { ownConductorMachineId: own.machineId }
|
|
81
|
-
: {}),
|
|
82
78
|
// Optional at every hop — omitting the key is the My work path.
|
|
83
79
|
...(route !== undefined ? { route } : {}),
|
|
84
80
|
...(workspace !== undefined ? { workspace } : {}),
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { TicketReactScreen } from './Entity/ticket/Screen/ticket-react.js';
|
|
2
1
|
import { TicketReactMarkdownScreen } from './Entity/ticket/Screen/ticket-react-markdown.js';
|
|
3
2
|
import { register } from './Extension/store.js';
|
|
4
3
|
register('bakers/react-experiment', (api) => {
|
|
5
|
-
api.add(TicketReactScreen);
|
|
6
4
|
api.add(TicketReactMarkdownScreen);
|
|
7
5
|
});
|
package/dist/src/route.js
CHANGED
|
@@ -105,7 +105,7 @@ async function resolveTicketByOrigin(client, route, ctx) {
|
|
|
105
105
|
/**
|
|
106
106
|
* The repo URLs a `bb_project` row declares, normalised. `repository` is a
|
|
107
107
|
* single-cardinality `bb_repo` field: JSON:API serves it as one object
|
|
108
|
-
* (measured on this branch's
|
|
108
|
+
* (measured on this branch's local site), but both a JSON *string* and an array are
|
|
109
109
|
* tolerated too, so a differently-serialized deployment does not silently stop
|
|
110
110
|
* matching. Anything unparseable yields no URLs — a malformed value is
|
|
111
111
|
* skipped, never fatal.
|
package/dist/src/types.d.ts
CHANGED
|
@@ -41,14 +41,6 @@ export interface DropshClient {
|
|
|
41
41
|
get(path: string, params?: unknown): Promise<unknown>;
|
|
42
42
|
/** PATCH `{ data: { type, id, ...body } }` — dropsh 0.5.8's `update`. */
|
|
43
43
|
update(type: string, id: string, body: ResourceWriteBody): Promise<unknown>;
|
|
44
|
-
/**
|
|
45
|
-
* POST `{ data: { type, ...body } }` — dropsh 0.5.8's `create` (BB-309 D4).
|
|
46
|
-
*
|
|
47
|
-
* Added for the same reason `update` was in BB-233: the read-only shape was
|
|
48
|
-
* the TYPE, never the object. The real client has always had this method, so
|
|
49
|
-
* declaring it costs no HTTP plumbing and no new dependency.
|
|
50
|
-
*/
|
|
51
|
-
create(type: string, body: ResourceWriteBody): Promise<unknown>;
|
|
52
44
|
/**
|
|
53
45
|
* POST a raw document to a path — dropsh's `post`, for the custom resources
|
|
54
46
|
* that are not an entity create (the addon inbox send).
|
|
@@ -75,48 +67,12 @@ export interface TicketDetailDocument {
|
|
|
75
67
|
data?: JsonApiResource;
|
|
76
68
|
included?: JsonApiResource[];
|
|
77
69
|
}
|
|
78
|
-
/** A hosted agent as reported by the injected agent service (herdr-backed in
|
|
79
|
-
* production). `id` is the host-owned stable handle, `group` the project it was
|
|
80
|
-
* launched under, `label` a human tag for the list. */
|
|
81
|
-
export interface HostedAgent {
|
|
82
|
-
id: string;
|
|
83
|
-
group: string;
|
|
84
|
-
label: string;
|
|
85
|
-
}
|
|
86
|
-
/**
|
|
87
|
-
* Intent-level agent hosting the TUI drives (BB-190). The TUI says launch /
|
|
88
|
-
* list / focus / hide / kill by an opaque `group` (the project) + an `id` — it
|
|
89
|
-
* never names panes, tabs, splits or zoom. The host (herdr) owns all layout.
|
|
90
|
-
* We don't know what the next herdr does; this intent contract survives a
|
|
91
|
-
* different pane model unchanged.
|
|
92
|
-
*/
|
|
93
|
-
export interface TuiAgentService {
|
|
94
|
-
/** Start an agent for a group; the host places + shows it. */
|
|
95
|
-
launch(opts: {
|
|
96
|
-
group: string;
|
|
97
|
-
cwd: string;
|
|
98
|
-
prompt: string;
|
|
99
|
-
env: Record<string, string | undefined>;
|
|
100
|
-
isNew?: boolean | undefined;
|
|
101
|
-
label?: string | undefined;
|
|
102
|
-
}): Promise<HostedAgent>;
|
|
103
|
-
/** The live agents of a group (source of truth for the list + restart). */
|
|
104
|
-
list(group: string): Promise<HostedAgent[]>;
|
|
105
|
-
/** Bring an agent to the foreground. */
|
|
106
|
-
focus(id: string): Promise<void>;
|
|
107
|
-
/** Stop showing a group's agents, back to the caller. Durable — never kills. */
|
|
108
|
-
hide(group: string): Promise<void>;
|
|
109
|
-
/** Terminate an agent for good. */
|
|
110
|
-
kill(id: string): Promise<void>;
|
|
111
|
-
}
|
|
112
70
|
/** The dropsh renderer `services` bag the TUI consumes. */
|
|
113
71
|
export interface RendererServices {
|
|
114
72
|
client: DropshClient;
|
|
115
73
|
baseUrl?: string;
|
|
116
74
|
project?: string;
|
|
117
|
-
/**
|
|
118
|
-
agents?: TuiAgentService;
|
|
119
|
-
/** This machine's user id — preselected as the new-ticket assignee. */
|
|
75
|
+
/** The connection's current user (uuid or name) — My work's "me". */
|
|
120
76
|
currentUser?: string;
|
|
121
77
|
/** Fail-closed workspace-lead capability resolved from the active membership. */
|
|
122
78
|
isWorkspaceAdmin?: boolean;
|
|
@@ -129,10 +85,6 @@ export interface RendererServices {
|
|
|
129
85
|
* test flaky.
|
|
130
86
|
*/
|
|
131
87
|
now?: () => number;
|
|
132
|
-
/** This machine's conductor `machine_id` — preselected in the new-ticket form. */
|
|
133
|
-
ownConductorMachineId?: string;
|
|
134
|
-
/** Config override for the ticket-create agent's base prompt. */
|
|
135
|
-
createPrompt?: string;
|
|
136
88
|
/**
|
|
137
89
|
* A WRITE-scoped JSON:API client, when the host resolved a separate one.
|
|
138
90
|
*
|
|
@@ -291,8 +243,8 @@ export interface TuiOptions {
|
|
|
291
243
|
/**
|
|
292
244
|
* BB-232 (D9): the `.bakers` dir the entry is standing in, UNRESOLVED. The
|
|
293
245
|
* plugin's `run()` matches it against each conductor's `workspace_root` and
|
|
294
|
-
* fills `project`
|
|
295
|
-
*
|
|
246
|
+
* fills `project` from the record it finds — the value the deleted
|
|
247
|
+
* `~/.bakers/conductors.json` used to supply. Absent outside
|
|
296
248
|
* any project, and never read by the kernel itself.
|
|
297
249
|
*/
|
|
298
250
|
bakersDir?: string | undefined;
|
|
@@ -309,12 +261,9 @@ export interface TuiOptions {
|
|
|
309
261
|
selectWorkspace?: ((name: string) => Promise<void>) | undefined;
|
|
310
262
|
/** BB-472 — see `RendererServices.configPath`. */
|
|
311
263
|
configPath?: string | undefined;
|
|
312
|
-
agents?: TuiAgentService;
|
|
313
264
|
currentUser?: string;
|
|
314
265
|
/** Workspace-lead capability resolved by the plugin before routing starts. */
|
|
315
266
|
isWorkspaceAdmin?: boolean;
|
|
316
|
-
ownConductorMachineId?: string;
|
|
317
|
-
createPrompt?: string;
|
|
318
267
|
/** BB-223: the unresolved deep-link target, as it arrived from the CLI. */
|
|
319
268
|
initialRoute?: UiInitialRoute | undefined;
|
|
320
269
|
/** BB-223: the RESOLVED route the plugin's `run()` produced. The kernel
|
|
@@ -322,7 +271,7 @@ export interface TuiOptions {
|
|
|
322
271
|
route?: ResolvedRoute | undefined;
|
|
323
272
|
/** The write-scoped client — see `RendererServices.writeClient`, and BB-391
|
|
324
273
|
* for why it no longer names a profile. Optional at every hop, resolved
|
|
325
|
-
* `services?.x ?? options?.x
|
|
274
|
+
* `services?.x ?? options?.x`. */
|
|
326
275
|
writeClient?: DropshClient | undefined;
|
|
327
276
|
/**
|
|
328
277
|
* BB-232: the seam the Conductors screen starts and stops through.
|
|
@@ -346,7 +295,7 @@ export interface TuiOptions {
|
|
|
346
295
|
/**
|
|
347
296
|
* BB-326: a test supplies its own `CliRenderer`; production creates one.
|
|
348
297
|
*
|
|
349
|
-
* The same shape the kernel already takes `writeClient`,
|
|
298
|
+
* The same shape the kernel already takes `writeClient`,
|
|
350
299
|
* `conductorProcess` and `debounce` in — and the only production-code
|
|
351
300
|
* concession the OpenTUI swap makes to the tests. Present ALSO means
|
|
352
301
|
* interactive: `@opentui/core/testing`'s renderer has no TTY behind it, so
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bakers-build/addon-bakers-ui",
|
|
3
|
-
"version": "0.6.1-next.
|
|
3
|
+
"version": "0.6.1-next.7",
|
|
4
4
|
"description": "bakers.build TUI: interactive terminal UI (dashboard, projects, tickets) as a dropsh `tui` renderer plugin.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
"zustand": "^5.0.15"
|
|
31
31
|
},
|
|
32
32
|
"peerDependencies": {
|
|
33
|
-
"@bakers-build/core": "^0.6.1-next.
|
|
34
|
-
"@bakers-build/message": "^0.6.1-next.
|
|
33
|
+
"@bakers-build/core": "^0.6.1-next.7",
|
|
34
|
+
"@bakers-build/message": "^0.6.1-next.7"
|
|
35
35
|
},
|
|
36
36
|
"bakersBuild": {
|
|
37
|
-
"commit": "
|
|
37
|
+
"commit": "b89398b187bf51f4f9ca5bfc1150469f73a879e6",
|
|
38
38
|
"channel": "next"
|
|
39
39
|
}
|
|
40
40
|
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import type { CreateFormPayload } from '../Entity/ticket/Form/create.js';
|
|
2
|
-
import type { TuiAgentService } from '../types.js';
|
|
3
|
-
/** The launch intent passed to {@link TuiAgentService.launch}. */
|
|
4
|
-
export type CreateLaunch = Parameters<TuiAgentService['launch']>[0];
|
|
5
|
-
/**
|
|
6
|
-
* Build the `ticket:create` launch intent for a project. The prompt is a pure
|
|
7
|
-
* pointer to WORKFLOW.md and `bb-create-ticket` (the pre-filled form is passed
|
|
8
|
-
* via `$BB_NEW_TICKET_INPUT`); `BB_ID` is never inherited (a create must not be
|
|
9
|
-
* bound to a claimed ticket).
|
|
10
|
-
*/
|
|
11
|
-
export declare function buildCreateLaunch(opts: {
|
|
12
|
-
project: string;
|
|
13
|
-
cwd: string;
|
|
14
|
-
specPath?: string | undefined;
|
|
15
|
-
workflow?: string | undefined;
|
|
16
|
-
createPrompt?: string | undefined;
|
|
17
|
-
label?: string | undefined;
|
|
18
|
-
}): CreateLaunch;
|
|
19
|
-
/**
|
|
20
|
-
* A short human label for the agent list: the ticket's title, else the
|
|
21
|
-
* description's first line (both capped to 40 incl. the ellipsis), else
|
|
22
|
-
* "New <workflow>". BB-236 AC-8: it builds the `label` `buildCreateLaunch`
|
|
23
|
-
* takes, so it belongs to the module that builds the launch intent.
|
|
24
|
-
*/
|
|
25
|
-
export declare function shortName(payload: CreateFormPayload): string;
|
package/dist/src/Agent/launch.js
DELETED
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
// Ticket-create launch request (AC-3). Pressing `n` starts an embedded agent
|
|
2
|
-
// that follows WORKFLOW.md and `bb-create-ticket`. This module is pure: it builds
|
|
3
|
-
// the launch intent (prompt + env) the TUI hands to the injected agent host
|
|
4
|
-
// (`services.agents.launch`); the host (herdr) owns transport + layout. No
|
|
5
|
-
// node-pty / @xterm, no session object.
|
|
6
|
-
const CREATE_PROMPT = "Read the repository's WORKFLOW.md and follow it, then use the bb-create-ticket " +
|
|
7
|
-
'skill to create a new bakers.build ticket from the intake in ' +
|
|
8
|
-
'$BB_NEW_TICKET_INPUT. Do not start work on the new ticket.';
|
|
9
|
-
/**
|
|
10
|
-
* Build the `ticket:create` launch intent for a project. The prompt is a pure
|
|
11
|
-
* pointer to WORKFLOW.md and `bb-create-ticket` (the pre-filled form is passed
|
|
12
|
-
* via `$BB_NEW_TICKET_INPUT`); `BB_ID` is never inherited (a create must not be
|
|
13
|
-
* bound to a claimed ticket).
|
|
14
|
-
*/
|
|
15
|
-
export function buildCreateLaunch(opts) {
|
|
16
|
-
const env = {
|
|
17
|
-
...process.env,
|
|
18
|
-
TERM: 'xterm-256color',
|
|
19
|
-
BB_PROJECT: opts.project,
|
|
20
|
-
};
|
|
21
|
-
delete env.BB_ID;
|
|
22
|
-
if (opts.specPath)
|
|
23
|
-
env.BB_NEW_TICKET_INPUT = opts.specPath;
|
|
24
|
-
if (opts.workflow)
|
|
25
|
-
env.BB_WORKFLOW = opts.workflow;
|
|
26
|
-
return {
|
|
27
|
-
group: opts.project,
|
|
28
|
-
cwd: opts.cwd,
|
|
29
|
-
prompt: opts.createPrompt?.trim() || CREATE_PROMPT,
|
|
30
|
-
env,
|
|
31
|
-
isNew: true,
|
|
32
|
-
...(opts.label !== undefined ? { label: opts.label } : {}),
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* A short human label for the agent list: the ticket's title, else the
|
|
37
|
-
* description's first line (both capped to 40 incl. the ellipsis), else
|
|
38
|
-
* "New <workflow>". BB-236 AC-8: it builds the `label` `buildCreateLaunch`
|
|
39
|
-
* takes, so it belongs to the module that builds the launch intent.
|
|
40
|
-
*/
|
|
41
|
-
export function shortName(payload) {
|
|
42
|
-
// BB-309 D9: the title is what the operator NAMED the ticket, so it is the
|
|
43
|
-
// better tab label; the description's first line stays the fallback for a
|
|
44
|
-
// payload that has no title yet. This touches the launch intent's `label`
|
|
45
|
-
// ONLY — never `prompt`, never `env`, which is what AC-6 pins.
|
|
46
|
-
const cap = (line) => line.length > 40 ? `${line.slice(0, 39)}…` : line;
|
|
47
|
-
const title = payload.title.trim();
|
|
48
|
-
if (title)
|
|
49
|
-
return cap(title);
|
|
50
|
-
const firstLine = payload.description
|
|
51
|
-
.split('\n')
|
|
52
|
-
.map((l) => l.trim())
|
|
53
|
-
.find((l) => l.length > 0);
|
|
54
|
-
if (firstLine)
|
|
55
|
-
return cap(firstLine);
|
|
56
|
-
return `New ${payload.workflow?.label ?? 'ticket'}`;
|
|
57
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { RGBA, VNode } from '@opentui/core';
|
|
2
|
-
export type BadgeVariant = 'default' | 'success' | 'warning' | 'error' | 'info' | 'secondary';
|
|
3
|
-
/** The unbordered badge — the only form the TUI draws. */
|
|
4
|
-
export interface BadgeProps {
|
|
5
|
-
id: string;
|
|
6
|
-
label: string;
|
|
7
|
-
variant?: BadgeVariant;
|
|
8
|
-
color?: RGBA;
|
|
9
|
-
bold?: boolean;
|
|
10
|
-
}
|
|
11
|
-
export declare const Badge: ({ id, label, variant, color, bold, }: BadgeProps) => VNode;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { FOREGROUND, FOREGROUND_HIGHLIGHT } from '../../lib/theme.js';
|
|
2
|
-
import { BOLD, paragraphNode, plainRun } from '../../lib/vnode.js';
|
|
3
|
-
// Every status variant shares the highlight slot: the palette names roles, not
|
|
4
|
-
// hues (`lib/theme.ts`).
|
|
5
|
-
const variantColor = (variant) => variant === 'secondary' ? FOREGROUND : FOREGROUND_HIGHLIGHT;
|
|
6
|
-
export const Badge = ({ id, label, variant = 'default', color, bold = false, }) => paragraphNode({
|
|
7
|
-
id,
|
|
8
|
-
runs: [plainRun(label, bold ? BOLD : 0)],
|
|
9
|
-
fg: color ?? variantColor(variant),
|
|
10
|
-
});
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { type RGBA, type VNode } from '@opentui/core';
|
|
2
|
-
export interface BarChartItem {
|
|
3
|
-
label: string;
|
|
4
|
-
value: number;
|
|
5
|
-
color?: RGBA;
|
|
6
|
-
}
|
|
7
|
-
/** The horizontal chart — the only direction the TUI draws. */
|
|
8
|
-
export interface BarChartProps {
|
|
9
|
-
id: string;
|
|
10
|
-
data: readonly BarChartItem[];
|
|
11
|
-
width?: number;
|
|
12
|
-
showValues?: boolean;
|
|
13
|
-
title?: string;
|
|
14
|
-
maxValue?: number;
|
|
15
|
-
}
|
|
16
|
-
export declare const BarChart: ({ id, data, width, showValues, title, maxValue: suppliedMax, }: BarChartProps) => VNode;
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { BoxRenderable, h } from '@opentui/core';
|
|
2
|
-
import { FOREGROUND, FOREGROUND_HIGHLIGHT } from '../../lib/theme.js';
|
|
3
|
-
import { BOLD, DIM, paragraphNode, plainRun } from '../../lib/vnode.js';
|
|
4
|
-
const BAR_CHAR = '█';
|
|
5
|
-
const EMPTY_CHAR = '░';
|
|
6
|
-
const pad = (str, length) => {
|
|
7
|
-
if (str.length >= length) {
|
|
8
|
-
return str.slice(0, length);
|
|
9
|
-
}
|
|
10
|
-
return str.padEnd(length);
|
|
11
|
-
};
|
|
12
|
-
const padStart = (str, length) => {
|
|
13
|
-
if (str.length >= length) {
|
|
14
|
-
return str.slice(0, length);
|
|
15
|
-
}
|
|
16
|
-
return ' '.repeat(length - str.length) + str;
|
|
17
|
-
};
|
|
18
|
-
export const BarChart = ({ id, data, width = 30, showValues = true, title, maxValue: suppliedMax, }) => {
|
|
19
|
-
if (data.length === 0)
|
|
20
|
-
return paragraphNode({
|
|
21
|
-
id,
|
|
22
|
-
runs: [plainRun('No data', DIM)],
|
|
23
|
-
fg: FOREGROUND,
|
|
24
|
-
});
|
|
25
|
-
const maxValue = suppliedMax ?? Math.max(...data.map((d) => d.value));
|
|
26
|
-
const maxLabelLen = Math.max(...data.map((d) => d.label.length));
|
|
27
|
-
const maxValLen = Math.max(...data.map((d) => String(d.value).length));
|
|
28
|
-
const barWidth = width - maxLabelLen - maxValLen - 3;
|
|
29
|
-
return h(BoxRenderable, { id, flexDirection: 'column' }, ...(title
|
|
30
|
-
? [
|
|
31
|
-
paragraphNode({
|
|
32
|
-
id: `${id}-title`,
|
|
33
|
-
runs: [plainRun(title, BOLD)],
|
|
34
|
-
fg: FOREGROUND_HIGHLIGHT,
|
|
35
|
-
}),
|
|
36
|
-
]
|
|
37
|
-
: []),
|
|
38
|
-
// One bar per data item, in the caller's order.
|
|
39
|
-
...data.map((item, index) => {
|
|
40
|
-
const row = `${id}-${index}`;
|
|
41
|
-
const filled = maxValue === 0
|
|
42
|
-
? 0
|
|
43
|
-
: Math.round((item.value / maxValue) * Math.max(1, barWidth));
|
|
44
|
-
const empty = Math.max(0, barWidth - filled);
|
|
45
|
-
return h(BoxRenderable, { id: row, flexDirection: 'row', gap: 1 }, paragraphNode({
|
|
46
|
-
id: `${row}-label`,
|
|
47
|
-
runs: [plainRun(pad(item.label, maxLabelLen))],
|
|
48
|
-
fg: FOREGROUND,
|
|
49
|
-
}), paragraphNode({
|
|
50
|
-
id: `${row}-bar`,
|
|
51
|
-
runs: [plainRun(BAR_CHAR.repeat(filled) + EMPTY_CHAR.repeat(empty))],
|
|
52
|
-
fg: item.color ?? FOREGROUND_HIGHLIGHT,
|
|
53
|
-
}), ...(showValues
|
|
54
|
-
? [
|
|
55
|
-
paragraphNode({
|
|
56
|
-
id: `${row}-value`,
|
|
57
|
-
runs: [plainRun(padStart(String(item.value), maxValLen), DIM)],
|
|
58
|
-
fg: FOREGROUND,
|
|
59
|
-
}),
|
|
60
|
-
]
|
|
61
|
-
: []));
|
|
62
|
-
}));
|
|
63
|
-
};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { type RGBA, type VNode } from '@opentui/core';
|
|
2
|
-
export interface HeatMapProps {
|
|
3
|
-
id: string;
|
|
4
|
-
data: number[][];
|
|
5
|
-
rowLabels?: string[];
|
|
6
|
-
colLabels?: string[];
|
|
7
|
-
cellLabels?: string[][];
|
|
8
|
-
/** Low to high; indexed palette slots only. */
|
|
9
|
-
colorScale?: readonly RGBA[];
|
|
10
|
-
cellWidth?: number;
|
|
11
|
-
showValues?: boolean;
|
|
12
|
-
showLegend?: boolean;
|
|
13
|
-
minValue?: number;
|
|
14
|
-
maxValue?: number;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Low → high intensity as three palette slots, so the scale follows the
|
|
18
|
-
* operator's terminal theme like every other colour the cockpit paints.
|
|
19
|
-
*/
|
|
20
|
-
export declare const HEAT_SCALE: readonly RGBA[];
|
|
21
|
-
export declare const HeatMap: ({ id, data, rowLabels, colLabels, cellLabels, colorScale, cellWidth, showValues, showLegend, minValue, maxValue, }: HeatMapProps) => VNode;
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
import { BoxRenderable, h } from '@opentui/core';
|
|
2
|
-
import { FOREGROUND, FOREGROUND_ACTIVE, FOREGROUND_HIGHLIGHT, } from '../../lib/theme.js';
|
|
3
|
-
import { DIM, paragraphNode, plainRun, } from '../../lib/vnode.js';
|
|
4
|
-
/**
|
|
5
|
-
* Low → high intensity as three palette slots, so the scale follows the
|
|
6
|
-
* operator's terminal theme like every other colour the cockpit paints.
|
|
7
|
-
*/
|
|
8
|
-
export const HEAT_SCALE = [
|
|
9
|
-
FOREGROUND,
|
|
10
|
-
FOREGROUND_HIGHLIGHT,
|
|
11
|
-
FOREGROUND_ACTIVE,
|
|
12
|
-
];
|
|
13
|
-
const SHADE_CHARS = [' ', '░', '▒', '▓', '█'];
|
|
14
|
-
const getColorForValue = (value, min, max, scale) => {
|
|
15
|
-
if (max === min)
|
|
16
|
-
return scale[Math.floor(scale.length / 2)] ?? FOREGROUND;
|
|
17
|
-
const t = (value - min) / (max - min);
|
|
18
|
-
const index = Math.min(scale.length - 1, Math.max(0, Math.round(t * (scale.length - 1))));
|
|
19
|
-
return scale[index] ?? scale[0] ?? FOREGROUND;
|
|
20
|
-
};
|
|
21
|
-
const getShadeForValue = (value, min, max) => {
|
|
22
|
-
if (max === min)
|
|
23
|
-
return SHADE_CHARS[2] ?? '▒';
|
|
24
|
-
const t = (value - min) / (max - min);
|
|
25
|
-
const index = Math.min(SHADE_CHARS.length - 1, Math.max(0, Math.round(t * (SHADE_CHARS.length - 1))));
|
|
26
|
-
return SHADE_CHARS[index] ?? SHADE_CHARS[0] ?? ' ';
|
|
27
|
-
};
|
|
28
|
-
const padCenter = (value, width) => {
|
|
29
|
-
if (value.length >= width)
|
|
30
|
-
return value;
|
|
31
|
-
const total = width - value.length;
|
|
32
|
-
const left = Math.floor(total / 2);
|
|
33
|
-
return ' '.repeat(left) + value + ' '.repeat(total - left);
|
|
34
|
-
};
|
|
35
|
-
const padStart = (value, width) => value.length >= width ? value.slice(0, width) : value.padStart(width);
|
|
36
|
-
/** One grid row as one text: the cells touch, so their runs are the row. */
|
|
37
|
-
const gridRow = (id, runs) => paragraphNode({
|
|
38
|
-
id,
|
|
39
|
-
runs,
|
|
40
|
-
fg: FOREGROUND,
|
|
41
|
-
wrapMode: 'none',
|
|
42
|
-
flexShrink: 0,
|
|
43
|
-
});
|
|
44
|
-
export const HeatMap = ({ id, data, rowLabels, colLabels, cellLabels, colorScale = HEAT_SCALE, cellWidth = 5, showValues = false, showLegend = true, minValue, maxValue, }) => {
|
|
45
|
-
const firstRow = data[0];
|
|
46
|
-
if (data.length === 0 || !firstRow || firstRow.length === 0)
|
|
47
|
-
return paragraphNode({
|
|
48
|
-
id,
|
|
49
|
-
runs: [plainRun('No data', DIM)],
|
|
50
|
-
fg: FOREGROUND,
|
|
51
|
-
});
|
|
52
|
-
const numCols = firstRow.length;
|
|
53
|
-
const allValues = data.flat();
|
|
54
|
-
const min = minValue ?? Math.min(...allValues);
|
|
55
|
-
const max = maxValue ?? Math.max(...allValues);
|
|
56
|
-
const rowLabelWidth = rowLabels
|
|
57
|
-
? Math.max(...rowLabels.map((label) => label.length)) + 1
|
|
58
|
-
: 0;
|
|
59
|
-
const rows = [];
|
|
60
|
-
if (colLabels)
|
|
61
|
-
rows.push(gridRow(`${id}-columns`, [
|
|
62
|
-
...(rowLabelWidth > 0
|
|
63
|
-
? [plainRun(' '.repeat(rowLabelWidth + 1), DIM, FOREGROUND)]
|
|
64
|
-
: []),
|
|
65
|
-
...Array.from({ length: numCols }, (_, column) => plainRun(padCenter(colLabels[column] ?? String(column), cellWidth), DIM, FOREGROUND)),
|
|
66
|
-
]));
|
|
67
|
-
data.forEach((row, rowIndex) => {
|
|
68
|
-
rows.push(gridRow(`${id}-row-${rowIndex}`, [
|
|
69
|
-
...(rowLabels
|
|
70
|
-
? [
|
|
71
|
-
plainRun(`${padStart(rowLabels[rowIndex] ?? String(rowIndex), rowLabelWidth)} `, DIM, FOREGROUND),
|
|
72
|
-
]
|
|
73
|
-
: []),
|
|
74
|
-
...row.map((value, column) => plainRun(showValues
|
|
75
|
-
? padCenter(cellLabels?.[rowIndex]?.[column] ?? String(Math.round(value)), cellWidth)
|
|
76
|
-
: getShadeForValue(value, min, max).repeat(cellWidth), 0, getColorForValue(value, min, max, colorScale))),
|
|
77
|
-
]));
|
|
78
|
-
});
|
|
79
|
-
if (showLegend)
|
|
80
|
-
rows.push(h(BoxRenderable, { id: `${id}-legend`, flexDirection: 'row', marginTop: 1 }, gridRow(`${id}-legend-scale`, [
|
|
81
|
-
plainRun('Low ', DIM, FOREGROUND),
|
|
82
|
-
...colorScale.map((colour) => plainRun('█ ', 0, colour)),
|
|
83
|
-
plainRun('High', DIM, FOREGROUND),
|
|
84
|
-
])));
|
|
85
|
-
return h(BoxRenderable, { id, flexDirection: 'column' }, ...rows);
|
|
86
|
-
};
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import type { SectionLine } from '../section-list/index.js';
|
|
2
|
-
/** A filled bar cell. U+2588 FULL BLOCK. */
|
|
3
|
-
export declare const BAR_FULL = "\u2588";
|
|
4
|
-
/** An empty bar cell. U+2591 LIGHT SHADE. */
|
|
5
|
-
export declare const BAR_EMPTY = "\u2591";
|
|
6
|
-
/**
|
|
7
|
-
* The bar's width in display columns.
|
|
8
|
-
*
|
|
9
|
-
* `█`/`░` are narrow per `lib/width-table.ts` — neither is in `WIDE_RANGES` — so
|
|
10
|
-
* the row geometry BB-241's hit testing depends on is unaffected. They are NOT
|
|
11
|
-
* ASCII, though, and both are East-Asian-AMBIGUOUS: a terminal configured
|
|
12
|
-
* ambiguous-as-wide (common in CJK setups) renders them two columns and shifts
|
|
13
|
-
* every number column at runtime while every test here stays green, because the
|
|
14
|
-
* width table deliberately treats Ambiguous as narrow (the frame's box-drawing
|
|
15
|
-
* characters depend on that). Accepted rather than mitigated — spec R9. If it
|
|
16
|
-
* ever bites, the fix is an ASCII bar glyph, never a width-table change.
|
|
17
|
-
*/
|
|
18
|
-
export declare const BAR_WIDTH = 20;
|
|
19
|
-
/** One row of a block: a name and its counts, most-significant number last. */
|
|
20
|
-
export interface StatsPanelRow {
|
|
21
|
-
label: string;
|
|
22
|
-
/**
|
|
23
|
-
* The counts to print, in column order. The LAST one is what the bar
|
|
24
|
-
* measures — for a breakdown row that is the month, so a row whose day count
|
|
25
|
-
* is zero still shows the activity it actually had.
|
|
26
|
-
*/
|
|
27
|
-
numbers: number[];
|
|
28
|
-
}
|
|
29
|
-
export interface StatsPanelOptions {
|
|
30
|
-
/**
|
|
31
|
-
* Column titles, printed as a header row above the numbers. Omitted for a
|
|
32
|
-
* single-number block, where the label already says which window it is.
|
|
33
|
-
*
|
|
34
|
-
* The mock in spec D11 hangs these titles off the block's HEADING line; they
|
|
35
|
-
* are their own row here because the heading belongs to `flattenSections`,
|
|
36
|
-
* which owns the bold-row set. Same information, one row lower, and the two
|
|
37
|
-
* components keep their boundary.
|
|
38
|
-
*/
|
|
39
|
-
columns?: readonly string[] | undefined;
|
|
40
|
-
/**
|
|
41
|
-
* The group's name, printed in the header row's already-empty label field
|
|
42
|
-
* (BB-324 D4). A caller that renders several groups under one heading uses
|
|
43
|
-
* it to say which group each block of bars is.
|
|
44
|
-
*
|
|
45
|
-
* The component stays ENTITY-NEUTRAL: this is a string, and nothing here knows
|
|
46
|
-
* a ticket from a run. It declares exactly the data label's budget, so the
|
|
47
|
-
* title, the labels beneath it and the column titles keep one geometry.
|
|
48
|
-
*/
|
|
49
|
-
title?: string | undefined;
|
|
50
|
-
/** What to render instead of rows when there are none (spec R7). */
|
|
51
|
-
emptyMessage?: string | undefined;
|
|
52
|
-
}
|
|
53
|
-
/**
|
|
54
|
-
* One block's body rows: an optional header row (the group's title, the column
|
|
55
|
-
* titles, or both), then one row per entry.
|
|
56
|
-
*
|
|
57
|
-
* Every row declares the SAME cell budgets in the same order, which is what
|
|
58
|
-
* keeps the header's titles over the columns they name — the structural form of
|
|
59
|
-
* the claim the padded rows used to make by measuring each field.
|
|
60
|
-
*/
|
|
61
|
-
export declare function statsPanelRows(rows: readonly StatsPanelRow[], { columns, title, emptyMessage }?: StatsPanelOptions): SectionLine[];
|