@bakers-build/core 0.16.0 → 0.16.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/dist/src/cli/config-validate.d.ts +7 -0
- package/dist/src/cli/config-validate.js +33 -0
- package/dist/src/cli/machine-context.d.ts +4 -0
- package/dist/src/config-types.generated.d.ts +75 -2
- package/dist/src/index.d.ts +3 -2
- package/dist/src/index.js +3 -2
- package/dist/src/plugins/preset.d.ts +2 -0
- package/dist/src/plugins/scoped-addons.js +2 -0
- package/dist/src/plugins/slot-options.d.ts +24 -0
- package/dist/src/plugins/slot-options.js +45 -0
- package/package.json +3 -3
- package/schema/harness-options.schema.json +1 -6
- package/schema/machine.schema.json +26 -4
- package/schema/project.schema.json +16 -27
- package/schema/runtime-options.schema.json +19 -0
|
@@ -36,6 +36,13 @@ export interface StaticConfig {
|
|
|
36
36
|
}
|
|
37
37
|
/** Read the default-export object literal without evaluating anything. */
|
|
38
38
|
export declare function staticConfig(text: string): StaticConfig | undefined;
|
|
39
|
+
/** A slot's keys, those of its schema in core, each with its `default`. */
|
|
40
|
+
export declare function slotKeys(slot: 'agent' | 'runtime'): Map<string, unknown>;
|
|
41
|
+
/**
|
|
42
|
+
* The keys an addon's options schema declares, a `$ref`'d slot schema's
|
|
43
|
+
* included, each with its schema `default`; undefined without a schema.
|
|
44
|
+
*/
|
|
45
|
+
export declare function addonOptionKeys(spec: string, bases: string[]): Map<string, unknown> | undefined;
|
|
39
46
|
/**
|
|
40
47
|
* Check each literal `with` of the `addons[]` entries (and, on a machine, the
|
|
41
48
|
* `agents.catalog[]` entries) against the addon's own options schema. Addon
|
|
@@ -31,6 +31,7 @@ export function configAjv() {
|
|
|
31
31
|
'machine.schema.json',
|
|
32
32
|
'connection.schema.json',
|
|
33
33
|
'harness-options.schema.json',
|
|
34
|
+
'runtime-options.schema.json',
|
|
34
35
|
])
|
|
35
36
|
ajv.addSchema(readSchema(name));
|
|
36
37
|
ajvInstance = ajv;
|
|
@@ -319,6 +320,38 @@ function addonOptionsValidator(spec, bases) {
|
|
|
319
320
|
const existing = schema.$id ? ajv.getSchema(schema.$id) : undefined;
|
|
320
321
|
return existing ?? ajv.compile(schema);
|
|
321
322
|
}
|
|
323
|
+
/** A slot's keys, those of its schema in core, each with its `default`. */
|
|
324
|
+
export function slotKeys(slot) {
|
|
325
|
+
const schema = readSchema(slot === 'agent'
|
|
326
|
+
? 'harness-options.schema.json'
|
|
327
|
+
: 'runtime-options.schema.json');
|
|
328
|
+
return new Map(Object.entries(schema.properties).map(([key, p]) => [key, p.default]));
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* The keys an addon's options schema declares, a `$ref`'d slot schema's
|
|
332
|
+
* included, each with its schema `default`; undefined without a schema.
|
|
333
|
+
*/
|
|
334
|
+
export function addonOptionKeys(spec, bases) {
|
|
335
|
+
const path = resolveModuleEslintStyle(`${spec}/options.schema.json`, bases);
|
|
336
|
+
if (!path)
|
|
337
|
+
return undefined;
|
|
338
|
+
const keys = new Map();
|
|
339
|
+
const collect = (schema) => {
|
|
340
|
+
for (const [key, property] of Object.entries(schema.properties ?? {}))
|
|
341
|
+
if (!keys.has(key))
|
|
342
|
+
keys.set(key, property?.default ??
|
|
343
|
+
(property?.$ref
|
|
344
|
+
? configAjv().getSchema(property.$ref)?.schema?.default
|
|
345
|
+
: undefined));
|
|
346
|
+
const ref = schema.$ref
|
|
347
|
+
? configAjv().getSchema(schema.$ref)?.schema
|
|
348
|
+
: undefined;
|
|
349
|
+
if (ref && typeof ref === 'object')
|
|
350
|
+
collect(ref);
|
|
351
|
+
};
|
|
352
|
+
collect(JSON.parse(readFileSync(path, 'utf8')));
|
|
353
|
+
return keys;
|
|
354
|
+
}
|
|
322
355
|
/**
|
|
323
356
|
* Check each literal `with` of the `addons[]` entries (and, on a machine, the
|
|
324
357
|
* `agents.catalog[]` entries) against the addon's own options schema. Addon
|
|
@@ -8,6 +8,8 @@ export interface MachineAgentEntry {
|
|
|
8
8
|
export type AgentRoutes = Record<string, Record<string, string>>;
|
|
9
9
|
/** Optional host-local overlays and selection policy for addon-derived agents. */
|
|
10
10
|
export interface MachineAgentPolicy {
|
|
11
|
+
/** Agent slot keys the project's `agents` block may set. */
|
|
12
|
+
allow?: string[];
|
|
11
13
|
catalog?: MachineAgentEntry[];
|
|
12
14
|
enabled?: string[];
|
|
13
15
|
disabled?: string[];
|
|
@@ -17,6 +19,8 @@ export interface MachineAgentPolicy {
|
|
|
17
19
|
}
|
|
18
20
|
/** Where runs start: runtime entries chosen per ticket. */
|
|
19
21
|
export interface MachineRuntimePolicy {
|
|
22
|
+
/** Runtime slot keys the project's `runtime` block may set. */
|
|
23
|
+
allow?: string[];
|
|
20
24
|
catalog?: {
|
|
21
25
|
alias: string;
|
|
22
26
|
use: string;
|
|
@@ -106,6 +106,10 @@ export interface ProjectConfig {
|
|
|
106
106
|
/** Function choosing the agent for a ticket; replaces the shipped selection. */
|
|
107
107
|
select_agent?: (...args: never[]) => unknown;
|
|
108
108
|
runtime?: {
|
|
109
|
+
/** Your container image, used for every agent and never built. Default: the shipped image, built on first use. */
|
|
110
|
+
image?: string;
|
|
111
|
+
/** Run clones borrow the parent repository's objects (git clone --shared) instead of copying them, for every workspace addon. Faster and smaller, but never prune or repack the parent with -d while a run is open. */
|
|
112
|
+
shared?: boolean;
|
|
109
113
|
/** Machine runtime aliases this project may use; absent allows all. */
|
|
110
114
|
enabled?: Array<string>;
|
|
111
115
|
/** Runtime alias for tickets no label or machine route places. */
|
|
@@ -113,6 +117,38 @@ export interface ProjectConfig {
|
|
|
113
117
|
/** Under an isolating runtime: worktree-relative paths the run sees read-only and may not change in a commit. Host commands must start in one of them. .bakers is always protected. */
|
|
114
118
|
read_only?: Array<string>;
|
|
115
119
|
};
|
|
120
|
+
/** Agent slot keys for every agent addon; a value applies only for a key in the machine's agents.allow. */
|
|
121
|
+
agents?: {
|
|
122
|
+
/** Extra command-line arguments appended to the agent launch, each shell-quoted. */
|
|
123
|
+
args?: Array<string>;
|
|
124
|
+
/** Model the agent runs. */
|
|
125
|
+
model?: string;
|
|
126
|
+
/** Reasoning effort the agent runs at. */
|
|
127
|
+
effort?: string;
|
|
128
|
+
/** Permission mode: how strictly a run starts; see the addon's Security section. */
|
|
129
|
+
permissions?: "sandbox" | "system" | "yolo" | "custom";
|
|
130
|
+
/** Sandbox lists; only valid with `permissions: 'sandbox'`. Each key set replaces its default; lists are not merged. */
|
|
131
|
+
sandbox?: {
|
|
132
|
+
/** Commands that run outside the sandbox. */
|
|
133
|
+
trusted_commands?: Array<string>;
|
|
134
|
+
/** Paths the agent may not read. */
|
|
135
|
+
deny_read?: Array<string>;
|
|
136
|
+
/** Paths the agent may write besides the worktree and the temporary directory. */
|
|
137
|
+
allow_write?: Array<string>;
|
|
138
|
+
/** Hosts the agent may reach; `*` allows every host. */
|
|
139
|
+
network?: Array<string>;
|
|
140
|
+
/** MCP servers of a sandboxed run, in the agent's own shape; the `bakers` server is always added. */
|
|
141
|
+
mcp_servers?: {
|
|
142
|
+
[key: string]: unknown;
|
|
143
|
+
};
|
|
144
|
+
};
|
|
145
|
+
/** The agent's own permission configuration; required with, and only valid with, `permissions: 'custom'`. */
|
|
146
|
+
config?: {
|
|
147
|
+
[key: string]: unknown;
|
|
148
|
+
};
|
|
149
|
+
/** Ticket environment variable names (`*` globs) removed from the run environment; replaces the default list. */
|
|
150
|
+
env_deny?: Array<string>;
|
|
151
|
+
};
|
|
116
152
|
}
|
|
117
153
|
/** This machine's private configuration: ~/.bakers/machine.config.js. */
|
|
118
154
|
export interface MachineConfig {
|
|
@@ -124,8 +160,39 @@ export interface MachineConfig {
|
|
|
124
160
|
label: string;
|
|
125
161
|
/** Public SSH or HTTPS connection address; null clears it at the next conductor start. */
|
|
126
162
|
connection_url?: string | null;
|
|
127
|
-
/** Selection policy for the agents the addons contribute. */
|
|
163
|
+
/** Selection policy for the agents the addons contribute, and the agent slot keys every agent addon reads. */
|
|
128
164
|
agents?: {
|
|
165
|
+
/** Extra command-line arguments appended to the agent launch, each shell-quoted. */
|
|
166
|
+
args?: Array<string>;
|
|
167
|
+
/** Model the agent runs. */
|
|
168
|
+
model?: string;
|
|
169
|
+
/** Reasoning effort the agent runs at. */
|
|
170
|
+
effort?: string;
|
|
171
|
+
/** Permission mode: how strictly a run starts; see the addon's Security section. */
|
|
172
|
+
permissions?: "sandbox" | "system" | "yolo" | "custom";
|
|
173
|
+
/** Sandbox lists; only valid with `permissions: 'sandbox'`. Each key set replaces its default; lists are not merged. */
|
|
174
|
+
sandbox?: {
|
|
175
|
+
/** Commands that run outside the sandbox. */
|
|
176
|
+
trusted_commands?: Array<string>;
|
|
177
|
+
/** Paths the agent may not read. */
|
|
178
|
+
deny_read?: Array<string>;
|
|
179
|
+
/** Paths the agent may write besides the worktree and the temporary directory. */
|
|
180
|
+
allow_write?: Array<string>;
|
|
181
|
+
/** Hosts the agent may reach; `*` allows every host. */
|
|
182
|
+
network?: Array<string>;
|
|
183
|
+
/** MCP servers of a sandboxed run, in the agent's own shape; the `bakers` server is always added. */
|
|
184
|
+
mcp_servers?: {
|
|
185
|
+
[key: string]: unknown;
|
|
186
|
+
};
|
|
187
|
+
};
|
|
188
|
+
/** The agent's own permission configuration; required with, and only valid with, `permissions: 'custom'`. */
|
|
189
|
+
config?: {
|
|
190
|
+
[key: string]: unknown;
|
|
191
|
+
};
|
|
192
|
+
/** Ticket environment variable names (`*` globs) removed from the run environment; replaces the default list. */
|
|
193
|
+
env_deny?: Array<string>;
|
|
194
|
+
/** Agent slot keys the project's agents block may set; absent: none. */
|
|
195
|
+
allow?: Array<"args" | "model" | "effort" | "permissions" | "sandbox" | "config" | "env_deny">;
|
|
129
196
|
/** Extra agent variants built from installed harnesses. */
|
|
130
197
|
catalog?: Array<{
|
|
131
198
|
harness: string;
|
|
@@ -144,8 +211,14 @@ export interface MachineConfig {
|
|
|
144
211
|
/** Function (aliases, ticket) => alias replacing the default agent order. */
|
|
145
212
|
select?: (...args: never[]) => unknown;
|
|
146
213
|
};
|
|
147
|
-
/** Where agent runs start, chosen per ticket. Absent: the addon runtime, else the host (system). */
|
|
214
|
+
/** Where agent runs start, chosen per ticket. Absent: the addon runtime, else the host (system). Also the runtime slot keys every runtime addon reads. */
|
|
148
215
|
runtime?: {
|
|
216
|
+
/** Your container image, used for every agent and never built. Default: the shipped image, built on first use. */
|
|
217
|
+
image?: string;
|
|
218
|
+
/** Run clones borrow the parent repository's objects (git clone --shared) instead of copying them, for every workspace addon. Faster and smaller, but never prune or repack the parent with -d while a run is open. */
|
|
219
|
+
shared?: boolean;
|
|
220
|
+
/** Runtime slot keys the project's runtime block may set; absent: none. */
|
|
221
|
+
allow?: Array<"image" | "shared">;
|
|
149
222
|
/** Runtime entries; the alias system is the host and always present. */
|
|
150
223
|
catalog?: Array<{
|
|
151
224
|
alias: string;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export { type ConfigOnlineOptions, createBbConnectionClient, createBbConnectionC
|
|
|
6
6
|
export type { ConfigChange, ConfigFileKind, ConfigFileReport, ConfigFinding, ConfigFindingCode, ConfigLayer, ConfigLocation, ConfigOperation, ConfigReport, ConfigScope, } from './cli/config-report.js';
|
|
7
7
|
export { configRecheckCommand, finalizeConfigReport, } from './cli/config-report.js';
|
|
8
8
|
export { type ConfigSourceInspection, type ConfigSourceProperty, declaresTopLevelKey, findDefaultExportObject, inspectConfigSource, matchDelimiter, type PropEntry, readKey, scanTopLevelProperties, scanToTopLevelComma, skipBlockComment, skipLineComment, skipString, skipTrivia, } from './cli/config-source.js';
|
|
9
|
-
export { addonOptionProblems, assertValidConfig, type ConfigKind, checkConfigText, configAjv, coreSchemaPath, type SchemaProblem, type StaticConfig, staticConfig, validateConfig, } from './cli/config-validate.js';
|
|
9
|
+
export { addonOptionKeys, addonOptionProblems, assertValidConfig, type ConfigKind, checkConfigText, configAjv, coreSchemaPath, type SchemaProblem, type StaticConfig, slotKeys, staticConfig, validateConfig, } from './cli/config-validate.js';
|
|
10
10
|
export { HOME_IMPORT_EXPRESSION_PATTERN, importConfig, } from './cli/import-config.js';
|
|
11
11
|
export { type LayeredUiEntryLayer, machineUiConfigPath, projectConductorConfigPath, readUiEntryLayers, } from './cli/layered-ui-entries.js';
|
|
12
12
|
export { type BbConnectionConfig, BbConnectionConfigError, type BbConnectionGlobals, type BbConnectionLoadOptions, type BbConnectionSelection, type EffectiveConnectionField, loadBbConfig, loadBbConnectionBootstrap, reportLoadedBbConfigFields, resolveBbConnectionSelection, } from './cli/load-bakers-config.js';
|
|
@@ -33,6 +33,7 @@ export { loadSecretsFile, parseSecretsFile, pickSecrets, type Secrets, secretsFi
|
|
|
33
33
|
export { shellQuote } from './core/shell.js';
|
|
34
34
|
export { DEFAULT_SLUG_MAX_LENGTH, slugify } from './core/slug.js';
|
|
35
35
|
export { bumpUiRefresh, UI_REFRESH_FILE } from './core/ui-refresh.js';
|
|
36
|
-
export { AddonUnresolvedError, discoverAddons, loadAddonPreset, type ResolvedConductorSlots, resolveConductorSlots, } from './plugins/discover-addons.js';
|
|
36
|
+
export { AddonUnresolvedError, discoverAddons, loadAddonPreset, normalizeEntry, type ResolvedConductorSlots, resolveConductorSlots, } from './plugins/discover-addons.js';
|
|
37
37
|
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';
|
|
38
38
|
export { type AddonCapabilities, type AddonCapability, type AddonScopeFinding, type AddonScopeInput, discoverScoped, type EffectiveAddon, readAddonCapabilities, readConfigAddons, readEffectiveAddon, scopeAddons, } from './plugins/scoped-addons.js';
|
|
39
|
+
export { type SlotOptions, type SlotOptionsInput, type SlotSource, type SlotValues, slotOptions, } from './plugins/slot-options.js';
|
package/dist/src/index.js
CHANGED
|
@@ -8,7 +8,7 @@ export { configRecheckCommand, finalizeConfigReport, } from './cli/config-report
|
|
|
8
8
|
// BB-218 strip pass share one answer to "which top-level properties does this
|
|
9
9
|
// config source declare?" — core is layer 0 and cannot import the conductor's copy.
|
|
10
10
|
export { declaresTopLevelKey, findDefaultExportObject, inspectConfigSource, matchDelimiter, readKey, scanTopLevelProperties, scanToTopLevelComma, skipBlockComment, skipLineComment, skipString, skipTrivia, } from './cli/config-source.js';
|
|
11
|
-
export { addonOptionProblems, assertValidConfig, checkConfigText, configAjv, coreSchemaPath, staticConfig, validateConfig, } from './cli/config-validate.js';
|
|
11
|
+
export { addonOptionKeys, addonOptionProblems, assertValidConfig, checkConfigText, configAjv, coreSchemaPath, slotKeys, staticConfig, validateConfig, } from './cli/config-validate.js';
|
|
12
12
|
export { HOME_IMPORT_EXPRESSION_PATTERN, importConfig, } from './cli/import-config.js';
|
|
13
13
|
export { machineUiConfigPath, projectConductorConfigPath, readUiEntryLayers, } from './cli/layered-ui-entries.js';
|
|
14
14
|
export { BbConnectionConfigError, loadBbConfig, loadBbConnectionBootstrap, reportLoadedBbConfigFields, resolveBbConnectionSelection, } from './cli/load-bakers-config.js';
|
|
@@ -45,6 +45,7 @@ export { bumpUiRefresh, UI_REFRESH_FILE } from './core/ui-refresh.js';
|
|
|
45
45
|
// (`@bakers-build/addon-remote-drupal`, `@bakers-build/addon-workspace-git`,
|
|
46
46
|
// `@bakers-build/addon-auth-basic`, `@bakers-build/addon-fake`). `loadInstructions` moved to
|
|
47
47
|
// `@bakers-build/addon-workspace-git`. Core ships NO plugin implementations.
|
|
48
|
-
export { AddonUnresolvedError, discoverAddons, loadAddonPreset, resolveConductorSlots, } from './plugins/discover-addons.js';
|
|
48
|
+
export { AddonUnresolvedError, discoverAddons, loadAddonPreset, normalizeEntry, resolveConductorSlots, } from './plugins/discover-addons.js';
|
|
49
49
|
export { emptyContributions, PRESET_FUNCTION_KEYS, SURFACE_KEYS, } from './plugins/preset.js';
|
|
50
50
|
export { discoverScoped, readAddonCapabilities, readConfigAddons, readEffectiveAddon, scopeAddons, } from './plugins/scoped-addons.js';
|
|
51
|
+
export { slotOptions, } from './plugins/slot-options.js';
|
|
@@ -134,6 +134,8 @@ export interface BbPreset<O = unknown> {
|
|
|
134
134
|
* Merge the entry's `with` when the addon is listed in both scopes (each
|
|
135
135
|
* argument `undefined` when that entry has none). Absent: the machine
|
|
136
136
|
* `with`, when given, replaces the project `with` whole.
|
|
137
|
+
* @deprecated A merge warns at load; slot keys with the machine's `allow`
|
|
138
|
+
* replace it for agent and runtime options.
|
|
137
139
|
*/
|
|
138
140
|
mergeWith?: (project: unknown, machine: unknown) => unknown;
|
|
139
141
|
commands?: (acc: CommandDescriptor[], opts: O) => CommandDescriptor[] | Promise<CommandDescriptor[]>;
|
|
@@ -120,6 +120,8 @@ export async function scopeAddons(inputs, opts = {}) {
|
|
|
120
120
|
}
|
|
121
121
|
const project = entryWith(entry);
|
|
122
122
|
const machine = entryWith(winner.entry);
|
|
123
|
+
if (loaded.preset.mergeWith)
|
|
124
|
+
warn(`warning: '${spec}' is listed in both ${winner.path} and ${input.path}; merging their with through the addon's mergeWith is deprecated and will be removed — set each option in one file`);
|
|
123
125
|
const merged = loaded.preset.mergeWith
|
|
124
126
|
? loaded.preset.mergeWith(project, machine)
|
|
125
127
|
: machine !== undefined
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export type SlotValues = Record<string, unknown>;
|
|
2
|
+
export type SlotSource = 'machine' | 'entry' | 'project';
|
|
3
|
+
export interface SlotOptionsInput {
|
|
4
|
+
/** The keys the addon reads. */
|
|
5
|
+
keys: readonly string[];
|
|
6
|
+
machine?: SlotValues | undefined;
|
|
7
|
+
/** The instance's own `with` (machine `addons[]` or catalog entry). */
|
|
8
|
+
entry?: unknown;
|
|
9
|
+
project?: SlotValues | undefined;
|
|
10
|
+
/** The machine's `allow` for this slot; absent: no project key applies. */
|
|
11
|
+
allow?: readonly string[];
|
|
12
|
+
}
|
|
13
|
+
export interface SlotOptions {
|
|
14
|
+
/** The instance's `with`; undefined when nothing is set. */
|
|
15
|
+
value: SlotValues | undefined;
|
|
16
|
+
/** Where each slot key the instance reads came from. */
|
|
17
|
+
sources: Record<string, SlotSource>;
|
|
18
|
+
/** Project keys the machine's `allow` does not list. */
|
|
19
|
+
rejected: {
|
|
20
|
+
key: string;
|
|
21
|
+
value: unknown;
|
|
22
|
+
}[];
|
|
23
|
+
}
|
|
24
|
+
export declare function slotOptions(input: SlotOptionsInput): SlotOptions;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
// Slot keys: the machine's `runtime`/`agents` block sets them for every addon
|
|
2
|
+
// of that slot that reads them (its options schema declares the key). Per
|
|
3
|
+
// addon instance, weakest first: machine slot keys → the instance's own `with`
|
|
4
|
+
// → the project's slot keys the machine lists in that slot's `allow`. Plain
|
|
5
|
+
// objects merge per key; lists and scalars replace.
|
|
6
|
+
const isPlain = (value) => typeof value === 'object' &&
|
|
7
|
+
value !== null &&
|
|
8
|
+
!Array.isArray(value) &&
|
|
9
|
+
Object.getPrototypeOf(value) === Object.prototype;
|
|
10
|
+
const merge = (lower, higher) => isPlain(lower) && isPlain(higher)
|
|
11
|
+
? Object.fromEntries([...new Set([...Object.keys(lower), ...Object.keys(higher)])].map((key) => [
|
|
12
|
+
key,
|
|
13
|
+
higher[key] === undefined
|
|
14
|
+
? lower[key]
|
|
15
|
+
: merge(lower[key], higher[key]),
|
|
16
|
+
]))
|
|
17
|
+
: higher;
|
|
18
|
+
export function slotOptions(input) {
|
|
19
|
+
const allow = new Set(input.allow ?? []);
|
|
20
|
+
const reads = new Set(input.keys);
|
|
21
|
+
const value = isPlain(input.entry) ? { ...input.entry } : {};
|
|
22
|
+
const sources = {};
|
|
23
|
+
for (const [key, given] of Object.entries(input.machine ?? {}))
|
|
24
|
+
if (reads.has(key) && given !== undefined) {
|
|
25
|
+
const own = value[key];
|
|
26
|
+
value[key] = own === undefined ? given : merge(given, own);
|
|
27
|
+
sources[key] = own === undefined ? 'machine' : 'entry';
|
|
28
|
+
}
|
|
29
|
+
const rejected = [];
|
|
30
|
+
for (const [key, given] of Object.entries(input.project ?? {})) {
|
|
31
|
+
if (given === undefined)
|
|
32
|
+
continue;
|
|
33
|
+
if (!allow.has(key))
|
|
34
|
+
rejected.push({ key, value: given });
|
|
35
|
+
else if (reads.has(key)) {
|
|
36
|
+
value[key] = merge(value[key], given);
|
|
37
|
+
sources[key] = 'project';
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
value: Object.keys(value).length > 0 ? value : undefined,
|
|
42
|
+
sources,
|
|
43
|
+
rejected,
|
|
44
|
+
};
|
|
45
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bakers-build/core",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.1-next.1",
|
|
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",
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"yaml": "^2.7.0"
|
|
41
41
|
},
|
|
42
42
|
"bakersBuild": {
|
|
43
|
-
"commit": "
|
|
44
|
-
"channel": "
|
|
43
|
+
"commit": "8a21f62acefc94300e5729e85d28d9155b4ca221",
|
|
44
|
+
"channel": "next"
|
|
45
45
|
}
|
|
46
46
|
}
|
|
@@ -22,12 +22,7 @@
|
|
|
22
22
|
"description": "Reasoning effort the agent runs at."
|
|
23
23
|
},
|
|
24
24
|
"permissions": {
|
|
25
|
-
"enum": [
|
|
26
|
-
"sandbox",
|
|
27
|
-
"system",
|
|
28
|
-
"yolo",
|
|
29
|
-
"custom"
|
|
30
|
-
],
|
|
25
|
+
"enum": ["sandbox", "system", "yolo", "custom"],
|
|
31
26
|
"description": "Permission mode: how strictly a run starts; see the addon's Security section.",
|
|
32
27
|
"default": "system"
|
|
33
28
|
},
|
|
@@ -23,8 +23,24 @@
|
|
|
23
23
|
},
|
|
24
24
|
"agents": {
|
|
25
25
|
"type": "object",
|
|
26
|
-
"description": "Selection policy for the agents the addons contribute.",
|
|
26
|
+
"description": "Selection policy for the agents the addons contribute, and the agent slot keys every agent addon reads.",
|
|
27
|
+
"$ref": "harness-options.schema.json",
|
|
27
28
|
"properties": {
|
|
29
|
+
"allow": {
|
|
30
|
+
"type": "array",
|
|
31
|
+
"description": "Agent slot keys the project's agents block may set; absent: none.",
|
|
32
|
+
"items": {
|
|
33
|
+
"enum": [
|
|
34
|
+
"args",
|
|
35
|
+
"model",
|
|
36
|
+
"effort",
|
|
37
|
+
"permissions",
|
|
38
|
+
"sandbox",
|
|
39
|
+
"config",
|
|
40
|
+
"env_deny"
|
|
41
|
+
]
|
|
42
|
+
}
|
|
43
|
+
},
|
|
28
44
|
"catalog": {
|
|
29
45
|
"type": "array",
|
|
30
46
|
"description": "Extra agent variants built from installed harnesses.",
|
|
@@ -50,12 +66,18 @@
|
|
|
50
66
|
"description": "Function (aliases, ticket) => alias replacing the default agent order."
|
|
51
67
|
}
|
|
52
68
|
},
|
|
53
|
-
"
|
|
69
|
+
"unevaluatedProperties": false
|
|
54
70
|
},
|
|
55
71
|
"runtime": {
|
|
56
72
|
"type": "object",
|
|
57
|
-
"description": "Where agent runs start, chosen per ticket. Absent: the addon runtime, else the host (system).",
|
|
73
|
+
"description": "Where agent runs start, chosen per ticket. Absent: the addon runtime, else the host (system). Also the runtime slot keys every runtime addon reads.",
|
|
74
|
+
"$ref": "runtime-options.schema.json",
|
|
58
75
|
"properties": {
|
|
76
|
+
"allow": {
|
|
77
|
+
"type": "array",
|
|
78
|
+
"description": "Runtime slot keys the project's runtime block may set; absent: none.",
|
|
79
|
+
"items": { "enum": ["image", "shared"] }
|
|
80
|
+
},
|
|
59
81
|
"catalog": {
|
|
60
82
|
"type": "array",
|
|
61
83
|
"description": "Runtime entries; the alias system is the host and always present.",
|
|
@@ -83,7 +105,7 @@
|
|
|
83
105
|
"description": "Let a runtime:<alias> label choose a runtime that does not isolate. Default false."
|
|
84
106
|
}
|
|
85
107
|
},
|
|
86
|
-
"
|
|
108
|
+
"unevaluatedProperties": false
|
|
87
109
|
},
|
|
88
110
|
"addons": {
|
|
89
111
|
"type": "array",
|
|
@@ -22,9 +22,7 @@
|
|
|
22
22
|
"description": "Team workspace the project belongs to."
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
|
-
"required": [
|
|
26
|
-
"name"
|
|
27
|
-
],
|
|
25
|
+
"required": ["name"],
|
|
28
26
|
"additionalProperties": false
|
|
29
27
|
},
|
|
30
28
|
"permissions": {
|
|
@@ -196,11 +194,7 @@
|
|
|
196
194
|
}
|
|
197
195
|
}
|
|
198
196
|
},
|
|
199
|
-
"required": [
|
|
200
|
-
"url",
|
|
201
|
-
"ref",
|
|
202
|
-
"plugins"
|
|
203
|
-
],
|
|
197
|
+
"required": ["url", "ref", "plugins"],
|
|
204
198
|
"additionalProperties": false
|
|
205
199
|
}
|
|
206
200
|
},
|
|
@@ -210,11 +204,15 @@
|
|
|
210
204
|
},
|
|
211
205
|
"runtime": {
|
|
212
206
|
"$ref": "#/$defs/runtime"
|
|
207
|
+
},
|
|
208
|
+
"agents": {
|
|
209
|
+
"type": "object",
|
|
210
|
+
"description": "Agent slot keys for every agent addon; a value applies only for a key in the machine's agents.allow.",
|
|
211
|
+
"$ref": "harness-options.schema.json",
|
|
212
|
+
"unevaluatedProperties": false
|
|
213
213
|
}
|
|
214
214
|
},
|
|
215
|
-
"required": [
|
|
216
|
-
"project"
|
|
217
|
-
],
|
|
215
|
+
"required": ["project"],
|
|
218
216
|
"additionalProperties": false,
|
|
219
217
|
"$defs": {
|
|
220
218
|
"nonempty": {
|
|
@@ -227,11 +225,7 @@
|
|
|
227
225
|
"description": "Shared run permissions for every agent.",
|
|
228
226
|
"properties": {
|
|
229
227
|
"mode": {
|
|
230
|
-
"enum": [
|
|
231
|
-
"sandbox",
|
|
232
|
-
"system",
|
|
233
|
-
"yolo"
|
|
234
|
-
]
|
|
228
|
+
"enum": ["sandbox", "system", "yolo"]
|
|
235
229
|
},
|
|
236
230
|
"sandbox": {
|
|
237
231
|
"type": "object",
|
|
@@ -281,9 +275,7 @@
|
|
|
281
275
|
"function": true
|
|
282
276
|
}
|
|
283
277
|
},
|
|
284
|
-
"required": [
|
|
285
|
-
"use"
|
|
286
|
-
],
|
|
278
|
+
"required": ["use"],
|
|
287
279
|
"additionalProperties": false
|
|
288
280
|
}
|
|
289
281
|
},
|
|
@@ -291,9 +283,7 @@
|
|
|
291
283
|
"description": "{ use, export?, with? }, or a constructed plugin carrying its kind.",
|
|
292
284
|
"if": {
|
|
293
285
|
"type": "object",
|
|
294
|
-
"required": [
|
|
295
|
-
"kind"
|
|
296
|
-
]
|
|
286
|
+
"required": ["kind"]
|
|
297
287
|
},
|
|
298
288
|
"then": {
|
|
299
289
|
"type": "object"
|
|
@@ -311,14 +301,13 @@
|
|
|
311
301
|
"description": "Options passed to the factory."
|
|
312
302
|
}
|
|
313
303
|
},
|
|
314
|
-
"required": [
|
|
315
|
-
"use"
|
|
316
|
-
],
|
|
304
|
+
"required": ["use"],
|
|
317
305
|
"additionalProperties": false
|
|
318
306
|
}
|
|
319
307
|
},
|
|
320
308
|
"runtime": {
|
|
321
309
|
"type": "object",
|
|
310
|
+
"$ref": "runtime-options.schema.json",
|
|
322
311
|
"properties": {
|
|
323
312
|
"enabled": {
|
|
324
313
|
"type": "array",
|
|
@@ -340,8 +329,8 @@
|
|
|
340
329
|
}
|
|
341
330
|
}
|
|
342
331
|
},
|
|
343
|
-
"
|
|
344
|
-
"description": "The project's runtime restrictions and
|
|
332
|
+
"unevaluatedProperties": false,
|
|
333
|
+
"description": "The project's runtime restrictions, protected paths and runtime slot keys; a slot key applies only when the machine's runtime.allow lists it."
|
|
345
334
|
}
|
|
346
335
|
}
|
|
347
336
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://json-schema.org/draft/2020-12/schema",
|
|
3
|
+
"$id": "https://bakers.build/schema/runtime-options.schema.json",
|
|
4
|
+
"title": "Runtime slot keys",
|
|
5
|
+
"description": "The keys the `runtime` block of machine.config.js and project.config.js sets for every runtime addon that reads them. A runtime addon's options.schema.json declares the keys it reads by $ref.",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"image": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"minLength": 1,
|
|
11
|
+
"description": "Your container image, used for every agent and never built. Default: the shipped image, built on first use."
|
|
12
|
+
},
|
|
13
|
+
"shared": {
|
|
14
|
+
"type": "boolean",
|
|
15
|
+
"default": false,
|
|
16
|
+
"description": "Run clones borrow the parent repository's objects (git clone --shared) instead of copying them, for every workspace addon. Faster and smaller, but never prune or repack the parent with -d while a run is open."
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|