@bakers-build/conductor 0.8.0 → 0.8.1-next.2
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-plan.js +14 -29
- package/dist/src/cli/config-schema.d.ts +4 -4
- package/dist/src/cli/config-schema.js +5 -5
- package/dist/src/cli/config-templates.js +18 -24
- package/dist/src/cli/config-validation.d.ts +1 -1
- package/dist/src/cli/config-validation.js +27 -131
- package/dist/src/cli/project-context.d.ts +5 -8
- package/dist/src/cli/project-context.js +25 -68
- package/dist/src/commands/conductor.d.ts +2 -2
- package/dist/src/commands/conductor.js +24 -24
- package/dist/src/commands/oven-tools.js +1 -1
- package/dist/src/config.d.ts +8 -17
- package/dist/src/config.js +55 -133
- package/dist/src/core/conductor.d.ts +52 -4
- package/dist/src/core/conductor.js +317 -31
- package/dist/src/core/tool-server.d.ts +1 -1
- package/dist/src/plugins/agent.d.ts +25 -3
- package/dist/src/plugins/agent.js +3 -3
- package/dist/src/plugins/executor.d.ts +8 -1
- package/dist/src/plugins/plugins.d.ts +2 -2
- package/dist/src/plugins/preset.d.ts +5 -5
- package/dist/src/plugins/remote.d.ts +15 -4
- package/dist/src/plugins/tools.js +1 -1
- package/dist/src/plugins/workspace.d.ts +1 -1
- package/dist/src/preset.js +3 -2
- package/dist/src/types.d.ts +4 -4
- package/package.json +5 -5
|
@@ -84,9 +84,9 @@ export interface AgentRunIdentity {
|
|
|
84
84
|
/** The MCP server name agents see for the conductor's addon tools. */
|
|
85
85
|
export declare const CONDUCTOR_TOOLS_SERVER = "bakers";
|
|
86
86
|
/** The run env var holding the run's bearer token for that server. */
|
|
87
|
-
export declare const CONDUCTOR_TOKEN_ENV = "
|
|
88
|
-
/** The run env var holding that server's URL, for `bakers
|
|
89
|
-
export declare const CONDUCTOR_URL_ENV = "
|
|
87
|
+
export declare const CONDUCTOR_TOKEN_ENV = "BAKERS_CONDUCTOR_TOKEN";
|
|
88
|
+
/** The run env var holding that server's URL, for `bakers conductor tools`. */
|
|
89
|
+
export declare const CONDUCTOR_URL_ENV = "BAKERS_CONDUCTOR_URL";
|
|
90
90
|
/** What {@link BbAgent.installPlugins} hands the run's launch. */
|
|
91
91
|
export interface PluginLaunch {
|
|
92
92
|
/** Merged into the run env: the harness's config-dir variable, never `HOME`. */
|
|
@@ -155,6 +155,16 @@ export interface BbAgent {
|
|
|
155
155
|
launchCommand(prompt: string, run?: AgentRunIdentity, workspacePath?: string, tools?: {
|
|
156
156
|
url: string;
|
|
157
157
|
}, env?: Readonly<Record<string, string>>, args?: readonly string[]): string;
|
|
158
|
+
/**
|
|
159
|
+
* The command that continues session `sessionId` in `workspacePath`, with
|
|
160
|
+
* the launch's own flags (see {@link launchCommand} for the other
|
|
161
|
+
* arguments). The conductor uses it after a restart, for a run whose pane
|
|
162
|
+
* is gone. Optional: an agent without it, or one returning undefined for
|
|
163
|
+
* this configuration, has its lost runs failed and retried instead.
|
|
164
|
+
*/
|
|
165
|
+
resumeCommand?(sessionId: string, workspacePath?: string, tools?: {
|
|
166
|
+
url: string;
|
|
167
|
+
}, env?: Readonly<Record<string, string>>, args?: readonly string[]): string | undefined;
|
|
158
168
|
/**
|
|
159
169
|
* Locate and read this agent's run transcript for a run that executed in
|
|
160
170
|
* `worktreePath`. MUST return '' (never throw) when nothing is found.
|
|
@@ -178,6 +188,11 @@ export interface BbAgent {
|
|
|
178
188
|
* `pi`) declares none, and the conductor always pins for it.
|
|
179
189
|
*/
|
|
180
190
|
sessionExists?(worktreePath: string, sessionId: string): Promise<boolean>;
|
|
191
|
+
/**
|
|
192
|
+
* When the run's transcript was last written (epoch ms), from a stat alone;
|
|
193
|
+
* undefined when it has none yet. Optional, like {@link permissionDenials}.
|
|
194
|
+
*/
|
|
195
|
+
runLogModified?(worktreePath: string, run: AgentRunIdentity): Promise<number | undefined>;
|
|
181
196
|
/**
|
|
182
197
|
* Parse this agent's run transcript (as returned by {@link getRunLog}) into
|
|
183
198
|
* a footprint of effort metrics (BB-132). The transcript format is
|
|
@@ -193,4 +208,11 @@ export interface BbAgent {
|
|
|
193
208
|
* agent without it is never checked.
|
|
194
209
|
*/
|
|
195
210
|
sandboxPreflight?(host?: SandboxHost): Promise<SandboxPreflight>;
|
|
211
|
+
/**
|
|
212
|
+
* The actions a permission rule denied in this run's transcript, each as
|
|
213
|
+
* `Tool(argument)`, in order, but only when the run stopped on one: the agent
|
|
214
|
+
* ended its turn after a denial with no call outstanding; [] otherwise. Never
|
|
215
|
+
* throws. Optional: a run of an agent without it is never reported as blocked.
|
|
216
|
+
*/
|
|
217
|
+
permissionDenials?(log: string): string[];
|
|
196
218
|
}
|
|
@@ -40,6 +40,6 @@ export function matchesEnvDeny(name, patterns) {
|
|
|
40
40
|
/** The MCP server name agents see for the conductor's addon tools. */
|
|
41
41
|
export const CONDUCTOR_TOOLS_SERVER = 'bakers';
|
|
42
42
|
/** The run env var holding the run's bearer token for that server. */
|
|
43
|
-
export const CONDUCTOR_TOKEN_ENV = '
|
|
44
|
-
/** The run env var holding that server's URL, for `bakers
|
|
45
|
-
export const CONDUCTOR_URL_ENV = '
|
|
43
|
+
export const CONDUCTOR_TOKEN_ENV = 'BAKERS_CONDUCTOR_TOKEN';
|
|
44
|
+
/** The run env var holding that server's URL, for `bakers conductor tools`. */
|
|
45
|
+
export const CONDUCTOR_URL_ENV = 'BAKERS_CONDUCTOR_URL';
|
|
@@ -34,7 +34,7 @@ export type HookName = 'after_create' | 'before_run' | 'after_run' | 'after_done
|
|
|
34
34
|
* What an addon hook listener receives (BB-599). One context object is
|
|
35
35
|
* shared by every listener of one dispatch, so a key a `before_run` listener
|
|
36
36
|
* adds to `env` reaches the next listener, that slot's shell hook and the
|
|
37
|
-
* agent launch. Reserved keys (`BB_*`, `WORKSPACE_ROOT`, `TICKET_URL`) and
|
|
37
|
+
* agent launch. Reserved keys (`BAKERS_*`, `BB_*`, `WORKSPACE_ROOT`, `TICKET_URL`) and
|
|
38
38
|
* invalid entries are restored after each listener. `env` values may be
|
|
39
39
|
* secret: never log them.
|
|
40
40
|
*
|
|
@@ -160,4 +160,11 @@ export interface BbExecutor {
|
|
|
160
160
|
* non-persistent executors.
|
|
161
161
|
*/
|
|
162
162
|
cleanupRun(branch: string, runId: number): Promise<void>;
|
|
163
|
+
/**
|
|
164
|
+
* Whether ONE run's hosted terminal still lives. `false` only when the
|
|
165
|
+
* executor knows none does (gone, or its process exited); throws when it
|
|
166
|
+
* cannot tell, so the conductor leaves the run alone. Optional: without it
|
|
167
|
+
* the conductor never checks a running run's terminal.
|
|
168
|
+
*/
|
|
169
|
+
runAlive?(branch: string, runId: number): Promise<boolean>;
|
|
163
170
|
}
|
|
@@ -12,7 +12,7 @@ export interface ExecutorDeps {
|
|
|
12
12
|
logger: ConductorLogger;
|
|
13
13
|
}
|
|
14
14
|
export interface RemotePlugin extends DropSHPlugin {
|
|
15
|
-
readonly kind: '
|
|
15
|
+
readonly kind: 'server';
|
|
16
16
|
readonly id: string;
|
|
17
17
|
readonly requiredModules: string[];
|
|
18
18
|
createRemote(config: ConductorFileConfig): Promise<BbRemote>;
|
|
@@ -24,7 +24,7 @@ export interface ExecutorPlugin extends DropSHPlugin {
|
|
|
24
24
|
createExecutor(config: ConductorFileConfig, deps: ExecutorDeps): Promise<BbExecutor>;
|
|
25
25
|
}
|
|
26
26
|
export interface WorkspacePlugin extends DropSHPlugin {
|
|
27
|
-
readonly kind: '
|
|
27
|
+
readonly kind: 'worktree';
|
|
28
28
|
readonly id: string;
|
|
29
29
|
readonly requiredModules: string[];
|
|
30
30
|
/**
|
|
@@ -11,9 +11,9 @@ import type { AddonTools, DiscoveredTools } from './tools.js';
|
|
|
11
11
|
* the discovery call site (see {@link narrowConductorContributions}).
|
|
12
12
|
*/
|
|
13
13
|
export interface ConductorContributions {
|
|
14
|
-
|
|
14
|
+
servers: RemotePlugin[];
|
|
15
15
|
executors: ExecutorPlugin[];
|
|
16
|
-
|
|
16
|
+
worktrees: WorkspacePlugin[];
|
|
17
17
|
agents: AgentCandidate[];
|
|
18
18
|
/** Lifecycle hook listeners, in accumulator order (BB-599). */
|
|
19
19
|
hooks: HookListener[];
|
|
@@ -42,9 +42,9 @@ export type ConductorAddonEntry = string | (Exclude<AddonEntry, string> & {
|
|
|
42
42
|
* silently drifting apart.
|
|
43
43
|
*/
|
|
44
44
|
export interface Preset<O = unknown> extends BbPreset<O> {
|
|
45
|
-
|
|
45
|
+
servers?: (acc: RemotePlugin[], opts: O) => RemotePlugin[] | Promise<RemotePlugin[]>;
|
|
46
46
|
executors?: (acc: ExecutorPlugin[], opts: O) => ExecutorPlugin[] | Promise<ExecutorPlugin[]>;
|
|
47
|
-
|
|
47
|
+
worktrees?: (acc: WorkspacePlugin[], opts: O) => WorkspacePlugin[] | Promise<WorkspacePlugin[]>;
|
|
48
48
|
agents?: (acc: AgentCandidate[], opts: O) => AgentCandidate[] | Promise<AgentCandidate[]>;
|
|
49
49
|
hooks?: (acc: HookListener[], opts: O) => HookListener[] | Promise<HookListener[]>;
|
|
50
50
|
/** Addon inbox messages: contract 2, BB-661. */
|
|
@@ -59,4 +59,4 @@ export interface Preset<O = unknown> extends BbPreset<O> {
|
|
|
59
59
|
* {@link Preset}, and `resolveConductorSlots` still runs the runtime `.kind`
|
|
60
60
|
* guard on whatever actually landed in a singleton slot.
|
|
61
61
|
*/
|
|
62
|
-
export declare function narrowConductorContributions(discovered: Pick<DiscoveredContributions, '
|
|
62
|
+
export declare function narrowConductorContributions(discovered: Pick<DiscoveredContributions, 'servers' | 'executors' | 'worktrees' | 'agents' | 'hooks' | 'addonInbox' | 'addonTools'>): ConductorContributions;
|
|
@@ -31,7 +31,7 @@ export interface ConductorRegistration {
|
|
|
31
31
|
last_pid?: number;
|
|
32
32
|
/**
|
|
33
33
|
* The stem of the config file this conductor was started from (`conductor`
|
|
34
|
-
* for the default, `shop` for `shop.
|
|
34
|
+
* for the default, `shop` for `shop.project.config.js`) — what
|
|
35
35
|
* `--conductor <name>` selects. Together with `workspace` it identifies one
|
|
36
36
|
* conductor in a repo that holds several.
|
|
37
37
|
*/
|
|
@@ -75,7 +75,7 @@ export interface Ticket {
|
|
|
75
75
|
/**
|
|
76
76
|
* Effective environment variables (BB-99), resolved server-side along the
|
|
77
77
|
* parent_id chain (child wins) as canonical `.env`-style `KEY=value` lines.
|
|
78
|
-
* The conductor parses this, strips reserved keys, overlays the core
|
|
78
|
+
* The conductor parses this, strips reserved keys, overlays the core BAKERS_*
|
|
79
79
|
* vars, and injects the result into the agent run env AND the workspace hooks.
|
|
80
80
|
* Omitted when the ticket (and its ancestors) set none. Values may be secret.
|
|
81
81
|
*/
|
|
@@ -104,6 +104,8 @@ export interface Ticket {
|
|
|
104
104
|
}
|
|
105
105
|
export interface ActiveRun {
|
|
106
106
|
runUuid: string;
|
|
107
|
+
/** Numeric run id (drupal_internal__id); names the run's terminal. */
|
|
108
|
+
runId: number;
|
|
107
109
|
ticketUuid: string;
|
|
108
110
|
ticketIdentifier: string;
|
|
109
111
|
branchName: string;
|
|
@@ -111,6 +113,8 @@ export interface ActiveRun {
|
|
|
111
113
|
stateAtStart: string;
|
|
112
114
|
/** Absolute path of the per-run git worktree, or '' when unset. */
|
|
113
115
|
worktreePath: string;
|
|
116
|
+
/** Id of the agent the run was dispatched to, '' / undefined when unset. */
|
|
117
|
+
agent?: string;
|
|
114
118
|
}
|
|
115
119
|
export interface ConductorStatus {
|
|
116
120
|
id: string;
|
|
@@ -365,7 +369,7 @@ export interface BbRemote {
|
|
|
365
369
|
getTicket(ticketUuid: string): Promise<Ticket>;
|
|
366
370
|
/**
|
|
367
371
|
* BB-495: every `bb_workspace` uuid the dispatching identity can reach —
|
|
368
|
-
* dispatch exports this as `
|
|
372
|
+
* dispatch exports this as `BAKERS_WORKSPACE_IDS` so the agent knows the full
|
|
369
373
|
* radius it may name, not only the point it starts standing on.
|
|
370
374
|
*/
|
|
371
375
|
getReachableWorkspaces(): Promise<string[]>;
|
|
@@ -393,6 +397,13 @@ export interface BbRemote {
|
|
|
393
397
|
* failure is visible immediately and its cause is recorded.
|
|
394
398
|
*/
|
|
395
399
|
markFailed(runUuid: string, errorLog: string): Promise<void>;
|
|
400
|
+
/** Publishes one Markdown comment (type `comment`) on the ticket. */
|
|
401
|
+
publishTicketComment(ticketUuid: string, body: string): Promise<void>;
|
|
402
|
+
/**
|
|
403
|
+
* Cancel a live run (`cancel`: claimed/running → cancelled). Finalisation
|
|
404
|
+
* then captures its transcript and stops its agent, as for an operator's cancel.
|
|
405
|
+
*/
|
|
406
|
+
cancelRun(runUuid: string): Promise<void>;
|
|
396
407
|
/**
|
|
397
408
|
* Runs this conductor owns that are state in (done, cancelled) but not yet
|
|
398
409
|
* closed — the conductor's one-shot finalisation work list. Cancelled runs
|
|
@@ -415,7 +426,7 @@ export interface BbRemote {
|
|
|
415
426
|
* tickets assigned to `conductorId` are loaded, so every ticket on the list
|
|
416
427
|
* is unambiguously this conductor's — a missing worktree means "already torn
|
|
417
428
|
* down on this host", not "belongs to another host". The same query backs
|
|
418
|
-
* the live tick and the standalone `bakers
|
|
429
|
+
* the live tick and the standalone `bakers conductor clean`. Empty once every
|
|
419
430
|
* closed ticket this conductor owns is cleaned.
|
|
420
431
|
*/
|
|
421
432
|
fetchUncleanedTickets(conductorId: string): Promise<UncleanTicket[]>;
|
|
@@ -75,7 +75,7 @@ export function provisionTools(hook, runs = provisionRuns()) {
|
|
|
75
75
|
handlers: async () => ({
|
|
76
76
|
provision_up: async (req) => {
|
|
77
77
|
const command = commandFor(req.args.profile);
|
|
78
|
-
// shortcut: inherits the conductor's env, not the run's
|
|
78
|
+
// shortcut: inherits the conductor's env, not the run's BAKERS_* env; pass it through the binding once a hook needs it.
|
|
79
79
|
const { exitCode, output } = await runs.run(req.worktreePath, command);
|
|
80
80
|
const text = `exit ${exitCode}\n${output}`;
|
|
81
81
|
if (exitCode !== 0)
|
|
@@ -16,7 +16,7 @@ export interface EnsuredWorkspace {
|
|
|
16
16
|
created: boolean;
|
|
17
17
|
/**
|
|
18
18
|
* Variables the run needs from its workspace backend (e.g. Git config via
|
|
19
|
-
* `GIT_CONFIG_COUNT`). The conductor adds them to the run env; core `
|
|
19
|
+
* `GIT_CONFIG_COUNT`). The conductor adds them to the run env; core `BAKERS_*`
|
|
20
20
|
* keys still win.
|
|
21
21
|
*/
|
|
22
22
|
env?: Record<string, string>;
|
package/dist/src/preset.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
export const commands = (acc) => [
|
|
2
2
|
...acc,
|
|
3
3
|
{
|
|
4
|
-
name: '
|
|
4
|
+
name: 'conductor',
|
|
5
|
+
aliases: ['oven'],
|
|
5
6
|
plugin: '@bakers-build/conductor/commands/conductor',
|
|
6
|
-
describe: '
|
|
7
|
+
describe: 'conductor lifecycle + local registry',
|
|
7
8
|
},
|
|
8
9
|
];
|
package/dist/src/types.d.ts
CHANGED
|
@@ -18,7 +18,7 @@ export interface ConductorSettings {
|
|
|
18
18
|
* Absent until `bakers init` gave the machine its UUID.
|
|
19
19
|
*/
|
|
20
20
|
conductor_id?: string;
|
|
21
|
-
/** The selected config file's stem: `conductor` for `
|
|
21
|
+
/** The selected config file's stem: `conductor` for `project.config.js`. */
|
|
22
22
|
variant: string;
|
|
23
23
|
/** This machine's display label (`machine.config.js` label). */
|
|
24
24
|
machine_label?: string;
|
|
@@ -87,7 +87,7 @@ export interface ConductorSettings {
|
|
|
87
87
|
dirs: string[];
|
|
88
88
|
};
|
|
89
89
|
}
|
|
90
|
-
/** Whole
|
|
90
|
+
/** Whole project.config.js (dropsh-superset): site + named plugin slots. */
|
|
91
91
|
export interface ConductorFileConfig extends ConductorSettings {
|
|
92
92
|
bakers: BbProjectSelection;
|
|
93
93
|
resolved_bakers?: ResolvedBbProjectContext;
|
|
@@ -124,8 +124,8 @@ export interface ConductorFileConfig extends ConductorSettings {
|
|
|
124
124
|
}
|
|
125
125
|
/**
|
|
126
126
|
* BB-201 split config model: the ENGINE half of a conductor config —
|
|
127
|
-
* everything a `
|
|
128
|
-
* the auth `plugins`, which now live in a separate
|
|
127
|
+
* everything a `project.config.js` carries EXCEPT the connection (`site`) and
|
|
128
|
+
* the auth `plugins`, which now live in a separate connection file
|
|
129
129
|
* (`BbConnectionConfig`). `loadConductorConfig` returns this; the conductor
|
|
130
130
|
* command composes it with the connection (`composeConductorConfig`) into the
|
|
131
131
|
* full `ConductorFileConfig` the engine consumes.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bakers-build/conductor",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.1-next.2",
|
|
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,14 +32,14 @@
|
|
|
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.8.
|
|
36
|
-
"@bakers-build/message": "^0.8.
|
|
35
|
+
"@bakers-build/core": "^0.8.1-next.2",
|
|
36
|
+
"@bakers-build/message": "^0.8.1-next.2",
|
|
37
37
|
"@modelcontextprotocol/sdk": "1.32.1",
|
|
38
38
|
"commander": "^12.1.0",
|
|
39
39
|
"dropsh": "^0.8.2"
|
|
40
40
|
},
|
|
41
41
|
"bakersBuild": {
|
|
42
|
-
"commit": "
|
|
43
|
-
"channel": "
|
|
42
|
+
"commit": "0177880667693d1c36c65ffced82d2f3a17cbf2a",
|
|
43
|
+
"channel": "next"
|
|
44
44
|
}
|
|
45
45
|
}
|