@bakers-build/core 0.6.1-next.6 → 0.6.1-next.8

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.
@@ -226,6 +226,12 @@ export function inventoryConfig(options = {}) {
226
226
  return;
227
227
  }
228
228
  file.state = 'valid';
229
+ // An explicit executor slot: the machine's wins over the project's.
230
+ if (selected &&
231
+ source.properties.get('executor') &&
232
+ (kind === 'machine' ||
233
+ (kind === 'conductor' && report.executor_source === undefined)))
234
+ report.executor_source = path;
229
235
  const startFindings = report.findings.length;
230
236
  const field = source.properties.get('schema_version');
231
237
  file.version.header = source.headerVersions[0] ?? null;
@@ -74,6 +74,12 @@ export interface ConfigReport {
74
74
  tunnel: boolean | null;
75
75
  source: string;
76
76
  };
77
+ /**
78
+ * The file whose explicit `executor` slot the conductor uses: the machine
79
+ * file overrides the project's. Absent when neither sets one (the executor
80
+ * is then discovered from `addons[]`).
81
+ */
82
+ executor_source?: string;
77
83
  verification: {
78
84
  offline: {
79
85
  status: 'passed' | 'blocked' | 'incomplete';
@@ -36,6 +36,12 @@ export interface MachineContext {
36
36
  tunnel?: boolean;
37
37
  /** Shared run security for every agent; the conductor validates it. */
38
38
  security?: unknown;
39
+ /**
40
+ * This machine's executor, an `executor` slot value as in a conductor
41
+ * config. It overrides every project's executor on this machine; the
42
+ * workspace and remote stay project-owned.
43
+ */
44
+ executor?: unknown;
39
45
  }
40
46
  /**
41
47
  * Warn once that a leftover `max_parallel` in a config file is ignored: the
@@ -0,0 +1,8 @@
1
+ /** The `bakers ui` refresh signal's basename inside a `.bakers` dir; the UI watches it. */
2
+ export declare const UI_REFRESH_FILE = "ui-refresh";
3
+ /**
4
+ * Tell any `bakers ui` watching `bakersDir` that its data may be stale: set the
5
+ * signal file's mtime, creating it if needed. A missing dir is skipped and
6
+ * nothing throws, because a failed signal must never fail its caller (a run).
7
+ */
8
+ export declare function bumpUiRefresh(bakersDir: string): void;
@@ -0,0 +1,26 @@
1
+ import { existsSync, utimesSync, writeFileSync } from 'node:fs';
2
+ import { join } from 'node:path';
3
+ /** The `bakers ui` refresh signal's basename inside a `.bakers` dir; the UI watches it. */
4
+ export const UI_REFRESH_FILE = 'ui-refresh';
5
+ /**
6
+ * Tell any `bakers ui` watching `bakersDir` that its data may be stale: set the
7
+ * signal file's mtime, creating it if needed. A missing dir is skipped and
8
+ * nothing throws, because a failed signal must never fail its caller (a run).
9
+ */
10
+ export function bumpUiRefresh(bakersDir) {
11
+ if (!existsSync(bakersDir))
12
+ return;
13
+ const file = join(bakersDir, UI_REFRESH_FILE);
14
+ try {
15
+ const now = new Date();
16
+ utimesSync(file, now, now);
17
+ }
18
+ catch {
19
+ try {
20
+ writeFileSync(file, '');
21
+ }
22
+ catch {
23
+ // Unwritable `.bakers`: the UI just stays on `R`.
24
+ }
25
+ }
26
+ }
@@ -23,6 +23,7 @@ export { defaultProcProbe, defaultRunProcessProbe, killRunProcesses, type ProcPr
23
23
  export { normalizeRepoUrl } from './core/repo-url.js';
24
24
  export { shellQuote } from './core/shell.js';
25
25
  export { DEFAULT_SLUG_MAX_LENGTH, slugify } from './core/slug.js';
26
+ export { bumpUiRefresh, UI_REFRESH_FILE } from './core/ui-refresh.js';
26
27
  export { AddonUnresolvedError, discoverAddons, loadAddonPreset, type ResolvedConductorSlots, resolveConductorSlots, } from './plugins/discover-addons.js';
27
28
  export { type AddonEntry, type AddonScope, type BbPreset, type BbSurface, type CommandDescriptor, type DiscoveredContributions, emptyContributions, type OpaqueAccumulator, PRESET_FUNCTION_KEYS, SURFACE_KEYS, } from './plugins/preset.js';
28
29
  export { type AddonScopeFinding, type AddonScopeInput, discoverScoped, type EffectiveAddon, readConfigAddons, readEffectiveAddon, scopeAddons, } from './plugins/scoped-addons.js';
package/dist/src/index.js CHANGED
@@ -25,6 +25,7 @@ export { defaultProcProbe, defaultRunProcessProbe, killRunProcesses, signalVerif
25
25
  export { normalizeRepoUrl } from './core/repo-url.js';
26
26
  export { shellQuote } from './core/shell.js';
27
27
  export { DEFAULT_SLUG_MAX_LENGTH, slugify } from './core/slug.js';
28
+ export { bumpUiRefresh, UI_REFRESH_FILE } from './core/ui-refresh.js';
28
29
  // BB-215: the Storybook-style preset contract + the shared addon discovery.
29
30
  // BB-224 (Finding 6): SURFACE-AGNOSTIC only. The conductor-surface interfaces
30
31
  // (`BbRemote`/`BbExecutor`/`BbWorkspace`/`BbAgent`, the four `*Plugin`
@@ -71,8 +71,6 @@ export interface DiscoveredContributions {
71
71
  agents: unknown[];
72
72
  /** Opaque: `HookListener[]` on the conductor surface (BB-599). */
73
73
  hooks: unknown[];
74
- /** Opaque: `HerdrHost[]` on the conductor surface. */
75
- processHosts: unknown[];
76
74
  connectionPlugins: DropSHPlugin[];
77
75
  /**
78
76
  * BB-373: UI extension entry MODULES — specifiers, never constructed
@@ -153,7 +151,6 @@ export interface BbPreset<O = unknown> {
153
151
  workspaces?: OpaqueAccumulator<O>;
154
152
  agents?: OpaqueAccumulator<O>;
155
153
  hooks?: OpaqueAccumulator<O>;
156
- processHosts?: OpaqueAccumulator<O>;
157
154
  connectionPlugins?: (acc: DropSHPlugin[], opts: O) => DropSHPlugin[] | Promise<DropSHPlugin[]>;
158
155
  uiEntries?: (acc: string[], opts: O) => string[] | Promise<string[]>;
159
156
  inbox?: unknown;
@@ -28,14 +28,7 @@
28
28
  /** The extension points each surface runs (the preset function names to call). */
29
29
  export const SURFACE_KEYS = {
30
30
  command: ['commands'],
31
- conductor: [
32
- 'remotes',
33
- 'executors',
34
- 'workspaces',
35
- 'agents',
36
- 'hooks',
37
- 'processHosts',
38
- ],
31
+ conductor: ['remotes', 'executors', 'workspaces', 'agents', 'hooks'],
39
32
  connection: ['connectionPlugins', 'uiEntries'],
40
33
  };
41
34
  /** The preset function keys, for shape-detection during discovery. */
@@ -46,7 +39,6 @@ export const PRESET_FUNCTION_KEYS = [
46
39
  'workspaces',
47
40
  'agents',
48
41
  'hooks',
49
- 'processHosts',
50
42
  'connectionPlugins',
51
43
  'uiEntries',
52
44
  ];
@@ -59,7 +51,6 @@ export function emptyContributions() {
59
51
  workspaces: [],
60
52
  agents: [],
61
53
  hooks: [],
62
- processHosts: [],
63
54
  connectionPlugins: [],
64
55
  uiEntries: [],
65
56
  addonInbox: [],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bakers-build/core",
3
- "version": "0.6.1-next.6",
3
+ "version": "0.6.1-next.8",
4
4
  "description": "bakers.build surface-agnostic kernel: host contract, split-config helpers, addon preset/discovery machinery, shared primitives.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -38,7 +38,7 @@
38
38
  "yaml": "^2.7.0"
39
39
  },
40
40
  "bakersBuild": {
41
- "commit": "12b97ff4aa2422d69dab286141f3234609f32351",
41
+ "commit": "a39a1b099521005460e4f9d9534aa7935ed88e91",
42
42
  "channel": "next"
43
43
  }
44
44
  }