@bakers-build/conductor 0.5.1-next.746 → 0.5.1-next.758

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.
@@ -11,7 +11,6 @@ import { CONDUCTOR_ADDON_SLOTS, validateConfigSources, } from './config-validati
11
11
  import { migrateAddonNames } from './migrate-addon-names.js';
12
12
  const CURRENT = {
13
13
  machine: 3,
14
- 'legacy-machine': 3,
15
14
  // v1 is the first versioned conductor shape: the conductor owns only
16
15
  // remote/executor/workspace and declares no agent addons. Zero was the
17
16
  // implicit pre-versioned state (no @bakers-schema-version marker present).
@@ -68,7 +67,6 @@ export function planConfig(options = {}) {
68
67
  const files = report.files;
69
68
  const machine = files.find((f) => f.kind === 'machine');
70
69
  const connection = files.find((f) => f.kind === 'connection');
71
- const homeLocal = files.find((f) => f.kind === 'home-local');
72
70
  const local = files.find((f) => f.kind === 'local');
73
71
  if (options.operation === 'check') {
74
72
  const validated = validateConfigSources(inventoryOptions, new Map(original), files);
@@ -194,23 +192,6 @@ export function planConfig(options = {}) {
194
192
  : {}),
195
193
  authType,
196
194
  })));
197
- const legacy = files.find((f) => f.kind === 'legacy-machine');
198
- if (legacy?.selected && !protectedFile(legacy) && editors.has(legacy.path)) {
199
- const old = editor(legacy);
200
- const current = editors.get(machine.path);
201
- if (!current)
202
- editors.set(machine.path, new ConfigSourceEditor(old.text));
203
- else
204
- for (const [key, p] of old.source.properties)
205
- if (!key.includes('.') && !key.includes('[')) {
206
- const other = current.property(key);
207
- if (other && !sameValue(p, other))
208
- problem(legacy, 'conflicting_values', key, 'Legacy and canonical machine values agree.', [{ path: machine.path, key }]);
209
- else if (!other)
210
- current.set(key, old.expression(key));
211
- }
212
- editors.delete(legacy.path);
213
- }
214
195
  const machineEditor = editor(machine);
215
196
  const literalSubtreeIssue = (source, key) => {
216
197
  const expression = source.expression(key);
@@ -494,8 +475,7 @@ export function planConfig(options = {}) {
494
475
  migrateStateDefaults(machine, machineEditor);
495
476
  deriveMachineDefault();
496
477
  }
497
- for (const file of files.filter((candidate) => candidate.selected &&
498
- ['conductor', 'local', 'home-local'].includes(candidate.kind))) {
478
+ for (const file of files.filter((candidate) => candidate.selected && ['conductor', 'local'].includes(candidate.kind))) {
499
479
  const source = editors.get(file.path);
500
480
  if (!source || protectedFile(file))
501
481
  continue;
@@ -517,7 +497,7 @@ export function planConfig(options = {}) {
517
497
  connection.selected &&
518
498
  !protectedFile(connection) &&
519
499
  !protectedFile(machine))
520
- replaceGeneratedMachineWiring(editor(connection), editor(machine), connection, homeLocal ? editors.get(homeLocal.path) : undefined, homeLocal, machine.selected, options.inputs, problem);
500
+ replaceGeneratedMachineWiring(editor(connection), editor(machine), connection, options.inputs, problem);
521
501
  // Machine connection values must move atomically with their connection destinations.
522
502
  for (const key of CONNECTION_KEYS) {
523
503
  const target = key === 'base_url'
@@ -553,7 +533,7 @@ export function planConfig(options = {}) {
553
533
  move(machine, key, connection, target);
554
534
  }
555
535
  for (const file of files) {
556
- if (protectedFile(file) || !file.selected || file.kind === 'legacy-machine')
536
+ if (protectedFile(file) || !file.selected)
557
537
  continue;
558
538
  let e = editors.get(file.path);
559
539
  if (e && e.source.shape !== 'object') {
@@ -623,9 +603,7 @@ export function planConfig(options = {}) {
623
603
  if (e)
624
604
  e.stamp(3);
625
605
  }
626
- if (file.kind === 'conductor' ||
627
- file.kind === 'local' ||
628
- file.kind === 'home-local') {
606
+ if (file.kind === 'conductor' || file.kind === 'local') {
629
607
  if ((!e || e.text.trim() === 'export default {};') &&
630
608
  file.required &&
631
609
  options.project) {
@@ -938,7 +916,7 @@ export function planConfig(options = {}) {
938
916
  before_version: file.version.effective,
939
917
  after_version: after === null
940
918
  ? null
941
- : ['machine', 'legacy-machine'].includes(file.kind)
919
+ : file.kind === 'machine'
942
920
  ? 3
943
921
  : ['connection', 'project-connection'].includes(file.kind)
944
922
  ? 4
@@ -1059,7 +1037,7 @@ function oauthPrefix(e) {
1059
1037
  p.value === '@dropsh/plugin-oauth2')?.[0]
1060
1038
  .replace(/\.plugin$/, '');
1061
1039
  }
1062
- function replaceGeneratedMachineWiring(e, machine, file, local, localFile, machineSelected, inputs, problem) {
1040
+ function replaceGeneratedMachineWiring(e, machine, file, inputs, problem) {
1063
1041
  if (!e.text.includes('async function loadMachine()'))
1064
1042
  return;
1065
1043
  const mappings = {
@@ -1077,29 +1055,15 @@ function replaceGeneratedMachineWiring(e, machine, file, local, localFile, machi
1077
1055
  if (literal?.staticallyDetermined && literal.value !== undefined)
1078
1056
  resolved.set(name, JSON.stringify(literal.value));
1079
1057
  else if (new RegExp(`^(?:local\\.[^;]+\\?\\? )?machine\\.${key}(?: \\?\\? 'bakers-agent')?$`).test(declaration[1] ?? '')) {
1080
- const localKey = key.startsWith('client_') ? `oauth.${key}` : key;
1081
- const override = local?.property(localKey);
1082
- const parent = localKey.startsWith('oauth.')
1083
- ? local?.property('oauth')
1084
- : undefined;
1085
- if (local?.source.unknownKeys ||
1086
- (parent && !parent.staticallyDetermined) ||
1087
- (override && !override.staticallyDetermined)) {
1088
- problem(localFile ?? file, 'unknown_value', localKey, 'The generated home-local override is a known literal.');
1089
- continue;
1090
- }
1091
- const p = override?.value != null ? override : machine.property(key);
1058
+ // The retired home-local sibling is absent (inventory refuses otherwise),
1059
+ // so a generated `local.x ??` prefix evaluates to the machine value.
1060
+ const p = machine.property(key);
1092
1061
  const input = key === 'workspace_id' ? inputs?.workspaceId : undefined;
1093
1062
  const value = p?.staticallyDetermined && p.value != null
1094
1063
  ? p.value
1095
1064
  : (input ?? (key === 'client_id' ? 'bakers-agent' : undefined));
1096
- if (value !== undefined) {
1065
+ if (value !== undefined)
1097
1066
  resolved.set(name, JSON.stringify(value));
1098
- // This generated expression proves the override won before migration.
1099
- // Removing the shadowed machine value requires its selected write scope.
1100
- if (override?.value != null && machine.property(key) && machineSelected)
1101
- machine.remove(key);
1102
- }
1103
1067
  }
1104
1068
  }
1105
1069
  for (const key of [...e.source.properties.keys()]) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bakers-build/conductor",
3
- "version": "0.5.1-next.746",
3
+ "version": "0.5.1-next.758",
4
4
  "description": "bakers.build conductor engine + CLI: registers, claims tickets via JSON:API, dispatches agents.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -32,8 +32,8 @@
32
32
  "dependencies": {
33
33
  "@dropsh/plugin-jsonapi-schema": "^0.8.2",
34
34
  "@dropsh/plugin-oauth2": "^0.8.2",
35
- "@bakers-build/core": "^0.5.1-next.746",
36
- "@bakers-build/message": "^0.5.1-next.746",
35
+ "@bakers-build/core": "^0.5.1-next.758",
36
+ "@bakers-build/message": "^0.5.1-next.758",
37
37
  "commander": "^12.1.0",
38
38
  "dropsh": "^0.8.2"
39
39
  }