@bakers-build/bakers 0.7.1-next.7 → 0.8.1-next.1
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/README.md +3 -3
- package/dist/src/config.js +14 -21
- package/dist/src/host.d.ts +2 -2
- package/dist/src/host.js +20 -14
- package/package.json +31 -31
package/README.md
CHANGED
|
@@ -23,8 +23,8 @@ bakers --help
|
|
|
23
23
|
`bakers` is the conductor node and client for a bakers.build network: it registers with a
|
|
24
24
|
Drupal control plane, claims tickets over JSON:API, and runs agents through
|
|
25
25
|
spawn plugins (Claude, Codex, herdr, and a deterministic fake for tests). Point
|
|
26
|
-
it at a control plane with a
|
|
27
|
-
`bakers init`).
|
|
26
|
+
it at a control plane with a `.bakers/project.config.js` (scaffold one with
|
|
27
|
+
`bakers config init`).
|
|
28
28
|
|
|
29
29
|
## `bakers ui` deep links
|
|
30
30
|
|
|
@@ -46,7 +46,7 @@ claimants open a picker. `bakers ui --help` lists every form.
|
|
|
46
46
|
## Plugins
|
|
47
47
|
|
|
48
48
|
The four spawn plugins ship **inside** this package — nothing extra to install.
|
|
49
|
-
Import them from the `@bakers-build/bakers/plugins` entry in your
|
|
49
|
+
Import them from the `@bakers-build/bakers/plugins` entry in your `.bakers/project.config.js`:
|
|
50
50
|
|
|
51
51
|
```js
|
|
52
52
|
import {
|
package/dist/src/config.js
CHANGED
|
@@ -34,7 +34,7 @@ async function promptInput(label, secret = false) {
|
|
|
34
34
|
}
|
|
35
35
|
const SCOPE_FILE = {
|
|
36
36
|
machine: '~/.bakers/machine.config.js',
|
|
37
|
-
project: '.bakers/
|
|
37
|
+
project: '.bakers/project.config.js',
|
|
38
38
|
};
|
|
39
39
|
/**
|
|
40
40
|
* Report each machine/project `addons[]` entry listed in a scope its addon
|
|
@@ -44,7 +44,7 @@ const SCOPE_FILE = {
|
|
|
44
44
|
async function checkAddonScopes(report, online, cwd) {
|
|
45
45
|
const files = report.files.filter((f) => f.selected &&
|
|
46
46
|
f.state !== 'absent' &&
|
|
47
|
-
(f.kind === 'machine' || f.kind === '
|
|
47
|
+
(f.kind === 'machine' || f.kind === 'project'));
|
|
48
48
|
if (files.length === 0)
|
|
49
49
|
return;
|
|
50
50
|
const base = {
|
|
@@ -79,20 +79,6 @@ async function checkAddonScopes(report, online, cwd) {
|
|
|
79
79
|
],
|
|
80
80
|
}))), { unresolved: 'skip', logger: { warn: () => { } } });
|
|
81
81
|
for (const finding of findings) {
|
|
82
|
-
if (finding.code === 'addon_with_invalid') {
|
|
83
|
-
report.findings.push({
|
|
84
|
-
...base,
|
|
85
|
-
code: 'addon_with_invalid',
|
|
86
|
-
severity: 'error',
|
|
87
|
-
path: finding.path,
|
|
88
|
-
key: `addons[${finding.index}].with${finding.key ? `.${finding.key}` : ''}`,
|
|
89
|
-
expected: `'${finding.spec}' setting ${finding.key || 'with'} ${finding.message}.`,
|
|
90
|
-
observed: finding.spec,
|
|
91
|
-
owner: finding.scope,
|
|
92
|
-
remediation: `Fix addons[${finding.index}].with${finding.key ? `.${finding.key}` : ''} of ${finding.path}; see the addon's documentation.`,
|
|
93
|
-
});
|
|
94
|
-
continue;
|
|
95
|
-
}
|
|
96
82
|
const allowed = finding.allowed.map((s) => SCOPE_FILE[s]).join(' or ');
|
|
97
83
|
report.findings.push({
|
|
98
84
|
...base,
|
|
@@ -108,9 +94,14 @@ async function checkAddonScopes(report, online, cwd) {
|
|
|
108
94
|
if (findings.length > 0 && report.result !== 'failed')
|
|
109
95
|
report.result = 'blocked';
|
|
110
96
|
}
|
|
97
|
+
/** `, N values not checked`: a passing result never hides what it skipped. */
|
|
98
|
+
function notCheckedSummary(report) {
|
|
99
|
+
const count = report.findings.filter((f) => f.code === 'not_checked' || f.code === 'options_not_checked').length;
|
|
100
|
+
return count ? `, ${count} value${count === 1 ? '' : 's'} not checked` : '';
|
|
101
|
+
}
|
|
111
102
|
export function renderConfigReport(report, dryRun = false) {
|
|
112
103
|
const lines = [
|
|
113
|
-
`bakers config ${report.operation}: ${report.result}${dryRun ? ' (dry run; no files written)' : ''}`,
|
|
104
|
+
`bakers config ${report.operation}: ${report.result}${notCheckedSummary(report)}${dryRun ? ' (dry run; no files written)' : ''}`,
|
|
114
105
|
`Scope: ${report.resolved_scopes.join(', ')}`,
|
|
115
106
|
`Machine root: ${report.roots.machine}`,
|
|
116
107
|
`Connection root: ${report.roots.connection}`,
|
|
@@ -190,7 +181,7 @@ function buildConfigCommand(parent, operation, deps, hiddenScope, description) {
|
|
|
190
181
|
options.scope = hiddenScope;
|
|
191
182
|
const { applyConfigPlan, planConfig } = await import('@bakers-build/conductor/config');
|
|
192
183
|
if (options.projectConnection !== undefined)
|
|
193
|
-
throw new Error('--project-connection is retired; use --connection <id>
|
|
184
|
+
throw new Error('--project-connection is retired; use --connection <id> or BAKERS_CONNECTION.');
|
|
194
185
|
const cwd = deps.cwd ?? process.cwd();
|
|
195
186
|
const env = deps.env ?? process.env;
|
|
196
187
|
const interactive = (deps.isTTY ?? Boolean(process.stdin.isTTY && process.stdout.isTTY)) &&
|
|
@@ -241,9 +232,11 @@ function buildConfigCommand(parent, operation, deps, hiddenScope, description) {
|
|
|
241
232
|
operation,
|
|
242
233
|
cwd,
|
|
243
234
|
// Only forward an explicitly injected home; absent, core resolves the
|
|
244
|
-
// `.bakers` root itself and honours
|
|
235
|
+
// `.bakers` root itself and honours BAKERS_HOME.
|
|
245
236
|
...(deps.home !== undefined ? { home: deps.home } : {}),
|
|
246
237
|
inputs,
|
|
238
|
+
// Addon option schemas resolve from this CLI install, as the loader's do.
|
|
239
|
+
addonBases: [import.meta.url],
|
|
247
240
|
// `bakers init` (hiddenScope !== undefined) never pulls the project
|
|
248
241
|
// layer in, even inside a project checkout (BB-496 finding 1).
|
|
249
242
|
...(hiddenScope !== undefined ? { excludeProjectLayer: true } : {}),
|
|
@@ -268,7 +261,7 @@ function buildConfigCommand(parent, operation, deps, hiddenScope, description) {
|
|
|
268
261
|
selectedConnection = await resolveBbConnectionSelection({
|
|
269
262
|
cwd,
|
|
270
263
|
// Only forward an explicitly injected home; absent, core resolves
|
|
271
|
-
// the `.bakers` root itself and honours
|
|
264
|
+
// the `.bakers` root itself and honours BAKERS_HOME (same rule as the
|
|
272
265
|
// `planning` object above — a stray `?? homedir()` here would
|
|
273
266
|
// resolve this command's connection selection under `~/.bakers` while
|
|
274
267
|
// the rest of it honours the override).
|
|
@@ -318,7 +311,7 @@ function buildConfigCommand(parent, operation, deps, hiddenScope, description) {
|
|
|
318
311
|
['clientId', 'client_id', 'OAuth client identifier'],
|
|
319
312
|
['secret', 'client_secret', 'OAuth client secret'],
|
|
320
313
|
['workspaceId', 'workspace_id', 'Workspace UUID'],
|
|
321
|
-
['workspace', '
|
|
314
|
+
['workspace', 'project.workspace', 'Workspace name'],
|
|
322
315
|
].filter(([input]) => !(deviceCode && input === 'secret'));
|
|
323
316
|
for (const [input, key, label] of fields) {
|
|
324
317
|
const requiredForFreshConnection = freshConnection &&
|
package/dist/src/host.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type CommandDescriptor } from '@bakers-build/core';
|
|
2
2
|
import { Command } from 'commander';
|
|
3
|
-
/** The built-in command registry. `$
|
|
3
|
+
/** The built-in command registry. `$BAKERS_COMMANDS` (JSON array of descriptors)
|
|
4
4
|
* overrides it wholesale. */
|
|
5
5
|
export declare const DEFAULT_COMMANDS: CommandDescriptor[];
|
|
6
|
-
/** Resolve the registry: `$
|
|
6
|
+
/** Resolve the registry: `$BAKERS_COMMANDS` override else the built-in set. */
|
|
7
7
|
export declare function resolveCommands(): CommandDescriptor[];
|
|
8
8
|
export { resolveCliVersion } from '@bakers-build/core';
|
|
9
9
|
/** Host bases for ESLint-style sibling resolution: the meta install → cwd. */
|
package/dist/src/host.js
CHANGED
|
@@ -16,12 +16,12 @@ import { registerUpdate } from './update.js';
|
|
|
16
16
|
// ESLint-style resolved, LAZILY mounted command plugins (AC-2). The host
|
|
17
17
|
// discovers + mounts; it hard-wires nothing. Only the invoked subcommand's module
|
|
18
18
|
// is imported — `bakers --help` lists all four via describe-only stubs and imports
|
|
19
|
-
// none; `bakers
|
|
19
|
+
// none; `bakers conductor …` imports only the conductor module.
|
|
20
20
|
//
|
|
21
21
|
// BB-215: the registry is DERIVED from the command surface — the command
|
|
22
22
|
// addons' preset `commands` accumulators — rather than a hand-written list.
|
|
23
23
|
// Those presets are LIGHT (they import no runtime, only return descriptors), so
|
|
24
|
-
// composing them at boot keeps `bakers --help` import-light. `$
|
|
24
|
+
// composing them at boot keeps `bakers --help` import-light. `$BAKERS_COMMANDS`
|
|
25
25
|
// still overrides the whole registry. BB-224 (Finding 7) added the fourth
|
|
26
26
|
// command surface, `@bakers-build/addon-deployment` (`bakers deployment …`), which the
|
|
27
27
|
// `conductor` command plugin used to register as a side effect.
|
|
@@ -46,16 +46,16 @@ function composeCommandSurface() {
|
|
|
46
46
|
}
|
|
47
47
|
return acc;
|
|
48
48
|
}
|
|
49
|
-
/** The built-in command registry. `$
|
|
49
|
+
/** The built-in command registry. `$BAKERS_COMMANDS` (JSON array of descriptors)
|
|
50
50
|
* overrides it wholesale. */
|
|
51
51
|
export const DEFAULT_COMMANDS = composeCommandSurface();
|
|
52
|
-
/** Resolve the registry: `$
|
|
52
|
+
/** Resolve the registry: `$BAKERS_COMMANDS` override else the built-in set. */
|
|
53
53
|
export function resolveCommands() {
|
|
54
|
-
const override = process.env.
|
|
54
|
+
const override = process.env.BAKERS_COMMANDS;
|
|
55
55
|
if (override && override.trim() !== '') {
|
|
56
56
|
const parsed = JSON.parse(override);
|
|
57
57
|
if (!Array.isArray(parsed)) {
|
|
58
|
-
throw new Error('$
|
|
58
|
+
throw new Error('$BAKERS_COMMANDS must be a JSON array of command descriptors');
|
|
59
59
|
}
|
|
60
60
|
return parsed;
|
|
61
61
|
}
|
|
@@ -120,14 +120,14 @@ function addStub(program, entry, bases, argv) {
|
|
|
120
120
|
}
|
|
121
121
|
/** Best-effort describe text for a stub without importing the plugin. BB-215:
|
|
122
122
|
* the descriptor now carries its own `describe` (from the addon's preset); this
|
|
123
|
-
* falls back only for a `$
|
|
123
|
+
* falls back only for a `$BAKERS_COMMANDS` entry that omits it. */
|
|
124
124
|
function pluginDescribe(entry) {
|
|
125
125
|
if (typeof entry.describe === 'string' && entry.describe.trim() !== '') {
|
|
126
126
|
return entry.describe;
|
|
127
127
|
}
|
|
128
128
|
switch (entry.name) {
|
|
129
|
-
case '
|
|
130
|
-
return '
|
|
129
|
+
case 'conductor':
|
|
130
|
+
return 'conductor lifecycle + local registry';
|
|
131
131
|
case 'ui':
|
|
132
132
|
return 'interactive terminal UI: dashboard, projects, tickets';
|
|
133
133
|
case 'dropsh':
|
|
@@ -166,7 +166,7 @@ export async function buildHostProgram(argv, opts = {}) {
|
|
|
166
166
|
return resolveBbProjectContext(await createBbConnectionClient(connection), selection);
|
|
167
167
|
},
|
|
168
168
|
writeWorkspace: async (configPath, name) => {
|
|
169
|
-
await projectContext.writeBbWorkspaceSelection(projectContext.bakersProjectOwner(configPath), name, `Set
|
|
169
|
+
await projectContext.writeBbWorkspaceSelection(projectContext.bakersProjectOwner(configPath), name, `Set project.workspace in ${configPath} to switch manually.`);
|
|
170
170
|
},
|
|
171
171
|
},
|
|
172
172
|
}
|
|
@@ -180,13 +180,13 @@ export async function buildHostProgram(argv, opts = {}) {
|
|
|
180
180
|
program
|
|
181
181
|
.name('bakers')
|
|
182
182
|
.description('bakers.build conductor + client CLI')
|
|
183
|
-
.option('--conductor <name>', 'select a conductor
|
|
184
|
-
// The global --conductor flag threads into $
|
|
183
|
+
.option('--conductor <name>', 'select a conductor variant (default → project.config.js, else project.<name>.config.js; env $BAKERS_CONDUCTOR)');
|
|
184
|
+
// The global --conductor flag threads into $BAKERS_CONDUCTOR (flag wins over env)
|
|
185
185
|
// so every command selects the named engine config without per-command wiring.
|
|
186
186
|
program.hook('preAction', () => {
|
|
187
187
|
const name = program.opts().conductor;
|
|
188
188
|
if (typeof name === 'string' && name !== '') {
|
|
189
|
-
process.env.
|
|
189
|
+
process.env.BAKERS_CONDUCTOR = name;
|
|
190
190
|
}
|
|
191
191
|
});
|
|
192
192
|
const cliVersion = resolveCliVersion();
|
|
@@ -212,8 +212,14 @@ export async function buildHostProgram(argv, opts = {}) {
|
|
|
212
212
|
}
|
|
213
213
|
/** Parse argv against the host program, mapping commander's clean exits. */
|
|
214
214
|
export async function runHost(argv, opts = {}) {
|
|
215
|
-
//
|
|
215
|
+
// A hidden alias (`oven` for `conductor`) runs as its command: the argv
|
|
216
|
+
// names the command, so help, dispatch and the plugin see one name.
|
|
216
217
|
const index = firstPositionalIndex(argv);
|
|
218
|
+
const at = argv[index] === 'help' ? index + 1 : index;
|
|
219
|
+
const canonical = resolveCommands().find((c) => c.aliases?.includes(argv[at]));
|
|
220
|
+
if (canonical)
|
|
221
|
+
argv = [...argv.slice(0, at), canonical.name, ...argv.slice(at + 1)];
|
|
222
|
+
// Forward help to plugins that render their own complete option list.
|
|
217
223
|
if (argv[index] === 'help' &&
|
|
218
224
|
resolveCommands().some((c) => c.forwardHelp && c.name === argv[index + 1])) {
|
|
219
225
|
argv = [...argv.slice(0, index), ...argv.slice(index + 1), '--help'];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bakers-build/bakers",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.1-next.1",
|
|
4
4
|
"description": "bakers.build meta package: the `bakers` plugin-host CLI + all runtime plugins. Global install target.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -38,39 +38,39 @@
|
|
|
38
38
|
"jsonapi"
|
|
39
39
|
],
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@bakers-build/addon-agents": "^0.
|
|
42
|
-
"@bakers-build/addon-auth-basic": "^0.
|
|
43
|
-
"@bakers-build/addon-claude": "^0.
|
|
44
|
-
"@bakers-build/addon-codex": "^0.
|
|
45
|
-
"@bakers-build/addon-ddev": "^0.
|
|
46
|
-
"@bakers-build/addon-deployment": "^0.
|
|
47
|
-
"@bakers-build/addon-dropsh": "^0.
|
|
48
|
-
"@bakers-build/addon-essentials": "^0.
|
|
49
|
-
"@bakers-build/addon-bakers-ui": "^0.
|
|
50
|
-
"@bakers-build/addon-bakers-ui-artifacts": "^0.
|
|
51
|
-
"@bakers-build/addon-grok": "^0.
|
|
52
|
-
"@bakers-build/addon-herdr": "^0.
|
|
53
|
-
"@bakers-build/addon-herdr-core": "^0.
|
|
54
|
-
"@bakers-build/addon-info": "^0.
|
|
55
|
-
"@bakers-build/addon-kimi": "^0.
|
|
56
|
-
"@bakers-build/addon-opencode": "^0.
|
|
57
|
-
"@bakers-build/addon-orca": "^0.
|
|
58
|
-
"@bakers-build/addon-pi": "^0.
|
|
59
|
-
"@bakers-build/addon-ports": "^0.
|
|
60
|
-
"@bakers-build/addon-ports-cloudflare": "^0.
|
|
61
|
-
"@bakers-build/addon-ports-cloudflare-quick": "^0.
|
|
62
|
-
"@bakers-build/addon-ports-frp": "^0.
|
|
63
|
-
"@bakers-build/addon-remote-drupal": "^0.
|
|
64
|
-
"@bakers-build/addon-track": "^0.
|
|
65
|
-
"@bakers-build/addon-workspace": "^0.
|
|
66
|
-
"@bakers-build/addon-workspace-git": "^0.
|
|
67
|
-
"@bakers-build/conductor": "^0.
|
|
68
|
-
"@bakers-build/core": "^0.
|
|
69
|
-
"@bakers-build/ui": "^0.
|
|
41
|
+
"@bakers-build/addon-agents": "^0.8.1-next.1",
|
|
42
|
+
"@bakers-build/addon-auth-basic": "^0.8.1-next.1",
|
|
43
|
+
"@bakers-build/addon-claude": "^0.8.1-next.1",
|
|
44
|
+
"@bakers-build/addon-codex": "^0.8.1-next.1",
|
|
45
|
+
"@bakers-build/addon-ddev": "^0.8.1-next.1",
|
|
46
|
+
"@bakers-build/addon-deployment": "^0.8.1-next.1",
|
|
47
|
+
"@bakers-build/addon-dropsh": "^0.8.1-next.1",
|
|
48
|
+
"@bakers-build/addon-essentials": "^0.8.1-next.1",
|
|
49
|
+
"@bakers-build/addon-bakers-ui": "^0.8.1-next.1",
|
|
50
|
+
"@bakers-build/addon-bakers-ui-artifacts": "^0.8.1-next.1",
|
|
51
|
+
"@bakers-build/addon-grok": "^0.8.1-next.1",
|
|
52
|
+
"@bakers-build/addon-herdr": "^0.8.1-next.1",
|
|
53
|
+
"@bakers-build/addon-herdr-core": "^0.8.1-next.1",
|
|
54
|
+
"@bakers-build/addon-info": "^0.8.1-next.1",
|
|
55
|
+
"@bakers-build/addon-kimi": "^0.8.1-next.1",
|
|
56
|
+
"@bakers-build/addon-opencode": "^0.8.1-next.1",
|
|
57
|
+
"@bakers-build/addon-orca": "^0.8.1-next.1",
|
|
58
|
+
"@bakers-build/addon-pi": "^0.8.1-next.1",
|
|
59
|
+
"@bakers-build/addon-ports": "^0.8.1-next.1",
|
|
60
|
+
"@bakers-build/addon-ports-cloudflare": "^0.8.1-next.1",
|
|
61
|
+
"@bakers-build/addon-ports-cloudflare-quick": "^0.8.1-next.1",
|
|
62
|
+
"@bakers-build/addon-ports-frp": "^0.8.1-next.1",
|
|
63
|
+
"@bakers-build/addon-remote-drupal": "^0.8.1-next.1",
|
|
64
|
+
"@bakers-build/addon-track": "^0.8.1-next.1",
|
|
65
|
+
"@bakers-build/addon-workspace": "^0.8.1-next.1",
|
|
66
|
+
"@bakers-build/addon-workspace-git": "^0.8.1-next.1",
|
|
67
|
+
"@bakers-build/conductor": "^0.8.1-next.1",
|
|
68
|
+
"@bakers-build/core": "^0.8.1-next.1",
|
|
69
|
+
"@bakers-build/ui": "^0.8.1-next.1",
|
|
70
70
|
"commander": "^12.1.0"
|
|
71
71
|
},
|
|
72
72
|
"bakersBuild": {
|
|
73
|
-
"commit": "
|
|
73
|
+
"commit": "c4a887bee37bb2fed14bb9ba15ad0aacf0e26f7e",
|
|
74
74
|
"channel": "next"
|
|
75
75
|
}
|
|
76
76
|
}
|