@bakers-build/addon-bakers-ui 0.5.1-next.850 → 0.5.1-next.851

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.
@@ -5,9 +5,9 @@ import { type ConductorStatus } from './liveness.js';
5
5
  /** One conductor of the control plane, as this renderer needs it. */
6
6
  export interface Conductor {
7
7
  id: string;
8
- /** Never empty — the uuid is the last fallback, so nothing renders as blank. */
8
+ /** Never empty and never an id: a blank label reads `(unnamed)`. */
9
9
  label: string;
10
- /** The machine the conductor runs on. */
10
+ /** The registration key (`<machine uuid>-<project>-<variant>`); never displayed. */
11
11
  machineId: string | undefined;
12
12
  /** Liveness, as the control plane reports it. */
13
13
  status: string | undefined;
@@ -64,6 +64,8 @@ export interface ConductorRow extends Conductor {
64
64
  * itself.
65
65
  */
66
66
  hostKey: string | undefined;
67
+ /** The sideloaded machine's name — its display label. */
68
+ machineLabel: string | undefined;
67
69
  /** Liveness, derived — never the raw `status`. */
68
70
  derivedStatus: ConductorStatus;
69
71
  /**
@@ -71,8 +73,7 @@ export interface ConductorRow extends Conductor {
71
73
  *
72
74
  * The control plane is user-scoped, not machine-scoped, so a user's other
73
75
  * machines' conductors appear in this list. They are shown rather than
74
- * hidden — filtering by machine_id would mean substring-matching a composed
75
- * string. This is a FILESYSTEM fact only (used to decide whether the log
76
+ * hidden. This is a FILESYSTEM fact only (used to decide whether the log
76
77
  * tail can read a local file); it is not an identity gate — see {@link mine}
77
78
  * for that.
78
79
  */
@@ -167,13 +168,13 @@ export declare const CONDUCTOR_TABLE: {
167
168
  readonly width: 0;
168
169
  readonly min: 20;
169
170
  readonly grow: 2;
170
- readonly fields: readonly ["label", "machine_id"];
171
+ readonly fields: readonly ["label"];
171
172
  readonly get: (row: ConductorRow) => string;
172
173
  }, {
173
174
  readonly key: "machine";
174
175
  readonly label: "MACHINE";
175
176
  readonly width: 20;
176
- readonly fields: readonly ["machine_id"];
177
+ readonly fields: readonly ["machine"];
177
178
  readonly get: (row: ConductorRow) => string;
178
179
  }, {
179
180
  /**
@@ -300,13 +301,13 @@ export declare const PROJECT_CONDUCTOR_TABLE: {
300
301
  readonly width: 0;
301
302
  readonly min: 20;
302
303
  readonly grow: 2;
303
- readonly fields: readonly ["label", "machine_id"];
304
+ readonly fields: readonly ["label"];
304
305
  readonly get: (row: ConductorRow) => string;
305
306
  } | {
306
307
  readonly key: "machine";
307
308
  readonly label: "MACHINE";
308
309
  readonly width: 20;
309
- readonly fields: readonly ["machine_id"];
310
+ readonly fields: readonly ["machine"];
310
311
  readonly get: (row: ConductorRow) => string;
311
312
  } | {
312
313
  /** A CLOSED VOCABULARY. `ConductorStatus`'s reachable members here are
@@ -391,7 +392,7 @@ export interface ConductorRowContext {
391
392
  /**
392
393
  * THIS machine's own `host_key` (BB-450 B10), resolved once by the caller
393
394
  * before the read — the same MachineContext value `signalVerifiedProcess`
394
- * and the CLI's `hostKeyOf(config)` compare against. Compared against each
395
+ * and the CLI's `config.host_key` compare against. Compared against each
395
396
  * row's own `hostKey` to derive {@link ConductorRow.mine}.
396
397
  */
397
398
  thisHostKey: string;
@@ -13,11 +13,7 @@ import { deriveConductorStatus } from './liveness.js';
13
13
  const str = (v) => typeof v === 'string' && v.length > 0 ? v : undefined;
14
14
  const toConductor = (r) => ({
15
15
  id: r.id,
16
- label: str(r.attr('label')) ??
17
- str(r.attr('conductor_id')) ??
18
- str(r.attr('machine_id')) ??
19
- r.id,
20
- // Registration key (BB-353 renamed machine_id → conductor_id).
16
+ label: str(r.attr('label')) ?? '(unnamed)',
21
17
  machineId: str(r.attr('conductor_id')) ?? str(r.attr('machine_id')),
22
18
  status: str(r.attr('status')),
23
19
  active: r.attr('active') !== false,
@@ -66,10 +62,9 @@ export const listConductorsPreferringWrite = (clients) => listPreferringWrite(cl
66
62
  *
67
63
  * A CONTENT decision, which is why it is a cell accessor and not a layout
68
64
  * member: a cell's `truncate` can only drop the RIGHT, and both values it is
69
- * applied to carry their distinguishing part in the TAIL. A composed
70
- * `machine_id` is `${user_id}-${machine_id}-${project}`, so every row of a
71
- * user-scoped control plane repeats the same user uuid at the head; conductor
72
- * workspaces all share `/home/<user>/projects/…`. Eliding the right would leave
65
+ * applied to carry their distinguishing part in the TAIL: conductor
66
+ * workspaces all share `/home/<user>/projects/…`, and a machine label is cut
67
+ * the same way for one column budget. Eliding the right would leave
73
68
  * every row looking identical.
74
69
  *
75
70
  * THAT IS WHY `MACHINE` AND `WORKSPACE` KEEP FIXED BUDGETS while `NAME` grows.
@@ -81,7 +76,7 @@ export const listConductorsPreferringWrite = (clients) => listPreferringWrite(cl
81
76
  * columns it has.
82
77
  */
83
78
  const elideLeft = (value, width) => value.length <= width ? value : `…${value.slice(value.length - (width - 1))}`;
84
- /** How much width the machine_id column gets before {@link elideLeft} cuts it. */
79
+ /** How much width the machine label column gets before {@link elideLeft} cuts it. */
85
80
  const MACHINE_ID_WIDTH = 20;
86
81
  /**
87
82
  * The same, for the workspace path column — and the column that PAYS for this
@@ -183,18 +178,17 @@ export const CONDUCTOR_TABLE = {
183
178
  width: 0,
184
179
  min: 20,
185
180
  grow: 2,
186
- fields: ['label', 'machine_id'],
187
- get: (row) => row.label !== '' ? row.label : (row.machineId ?? ''),
181
+ fields: ['label'],
182
+ get: (row) => row.label,
188
183
  },
189
184
  {
190
- // Its OWN column, not merely the label's fallback (BB-232 AC-1): two
191
- // conductors of one repo share a project and a workspace_root, and the
192
- // machine_id is the only thing that separates them.
185
+ // Its OWN column (BB-232 AC-1): two conductors of one repo share a
186
+ // project and a workspace_root; the machine's label separates them.
193
187
  key: 'machine',
194
188
  label: 'MACHINE',
195
189
  width: MACHINE_ID_WIDTH,
196
- fields: ['machine_id'],
197
- get: (row) => elideLeft(row.machineId ?? '', MACHINE_ID_WIDTH),
190
+ fields: ['machine'],
191
+ get: (row) => elideLeft(row.machineLabel ?? '', MACHINE_ID_WIDTH),
198
192
  },
199
193
  {
200
194
  /**
@@ -365,10 +359,13 @@ function capacityOf(raw, machinesById) {
365
359
  * exact defect the CLI's `listConductors()` had: always `undefined` in
366
360
  * reality, present only in a fixture that hand-writes it on the wrong entity.
367
361
  */
368
- function hostKeyOf(raw, machinesById) {
362
+ function machineOf(raw, machinesById) {
369
363
  const machineId = singleRelId(raw.relationships?.machine);
370
364
  const machine = machineId ? machinesById.get(machineId) : undefined;
371
- return str(machine?.attributes?.host_key);
365
+ return {
366
+ hostKey: str(machine?.attributes?.host_key),
367
+ machineLabel: str(machine?.attributes?.name),
368
+ };
372
369
  }
373
370
  const toConductorRow = (raw, ctx, machinesById) => {
374
371
  const r = asResource(raw);
@@ -378,7 +375,7 @@ const toConductorRow = (raw, ctx, machinesById) => {
378
375
  const lastSeen = toUnixSeconds(r.attr('last_seen')) ?? 0;
379
376
  const leaseExpiresAt = toUnixSeconds(r.attr('lease_expires_at')) ?? 0;
380
377
  const { currentLoad, maxParallel } = capacityOf(raw, machinesById);
381
- const hostKey = hostKeyOf(raw, machinesById);
378
+ const { hostKey, machineLabel } = machineOf(raw, machinesById);
382
379
  return {
383
380
  ...toConductor(r),
384
381
  workspaceRoot,
@@ -389,6 +386,7 @@ const toConductorRow = (raw, ctx, machinesById) => {
389
386
  lastPid: num(r.attr('last_pid')),
390
387
  conductorName: str(r.attr('conductor_name')),
391
388
  hostKey,
389
+ machineLabel,
392
390
  // `present: true` because the row IS a control-plane record — which is why
393
391
  // `registry-only` can never come out of this screen.
394
392
  derivedStatus: deriveConductorStatus({
@@ -8,7 +8,7 @@ export interface ConductorDetail {
8
8
  label: string;
9
9
  /** The `--conductor <name>` stem it was started from, if reported. */
10
10
  conductorName: string | undefined;
11
- /** The sideloaded machine's own label, or its host_key, or ''. */
11
+ /** The sideloaded machine's name (its label), or ''. */
12
12
  machineLabel: string;
13
13
  /** The linked project's uuid, or '' when unlinked — no project read here. */
14
14
  projectLabel: string;
@@ -33,7 +33,7 @@ export async function loadConductorDetail(client, conductorId, nowSeconds) {
33
33
  raw.id ??
34
34
  conductorId,
35
35
  conductorName: str(attrs.conductor_name),
36
- machineLabel: str(machineAttrs.label) ?? hostKey ?? '',
36
+ machineLabel: str(machineAttrs.name) ?? '',
37
37
  projectLabel: singleRelId(raw, 'project_id') ?? '',
38
38
  workspaceRoot: str(attrs.workspace_root) ?? '',
39
39
  lastPid: num(attrs.last_pid),
@@ -34,13 +34,13 @@ export declare class ConductorsScreen extends ListScreen<ConductorRow, Conductor
34
34
  readonly width: 0;
35
35
  readonly min: 20;
36
36
  readonly grow: 2;
37
- readonly fields: readonly ["label", "machine_id"];
37
+ readonly fields: readonly ["label"];
38
38
  readonly get: (row: ConductorRow) => string;
39
39
  }, {
40
40
  readonly key: "machine";
41
41
  readonly label: "MACHINE";
42
42
  readonly width: 20;
43
- readonly fields: readonly ["machine_id"];
43
+ readonly fields: readonly ["machine"];
44
44
  readonly get: (row: ConductorRow) => string;
45
45
  }, {
46
46
  readonly key: "project";
@@ -34,13 +34,13 @@ export declare class ProjectConductorsScreen extends ListScreen<ConductorRow, Co
34
34
  readonly width: 0;
35
35
  readonly min: 20;
36
36
  readonly grow: 2;
37
- readonly fields: readonly ["label", "machine_id"];
37
+ readonly fields: readonly ["label"];
38
38
  readonly get: (row: ConductorRow) => string;
39
39
  } | {
40
40
  readonly key: "machine";
41
41
  readonly label: "MACHINE";
42
42
  readonly width: 20;
43
- readonly fields: readonly ["machine_id"];
43
+ readonly fields: readonly ["machine"];
44
44
  readonly get: (row: ConductorRow) => string;
45
45
  } | {
46
46
  readonly key: "status";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bakers-build/addon-bakers-ui",
3
- "version": "0.5.1-next.850",
3
+ "version": "0.5.1-next.851",
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.5.1-next.850",
34
- "@bakers-build/message": "^0.5.1-next.850"
33
+ "@bakers-build/core": "^0.5.1-next.851",
34
+ "@bakers-build/message": "^0.5.1-next.851"
35
35
  },
36
36
  "bakersBuild": {
37
- "commit": "5f928492b2ed78efe1f782a9618ecf8bde49be3d",
37
+ "commit": "9547fdedfc72a8623ba101d72a39c20a9fef5a8e",
38
38
  "channel": "next"
39
39
  }
40
40
  }