@bakers-build/conductor 0.9.1-next.9 → 0.10.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.
|
@@ -312,6 +312,7 @@ export class Conductor {
|
|
|
312
312
|
...(siteTools ? { siteTools } : {}),
|
|
313
313
|
...(hosts.length > 0 ? { hosts } : {}),
|
|
314
314
|
onSiteWrite: (b) => this.signalUi(b.worktreePath),
|
|
315
|
+
readTicket: (uuid) => this.remote.getTicket(uuid),
|
|
315
316
|
});
|
|
316
317
|
this.logger.info({ conductorId: this.config.conductor_id, url: this.toolServer.url }, 'tool server started');
|
|
317
318
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ConductorLogger } from '@bakers-build/core';
|
|
2
2
|
import type { SiteToolClient } from '../plugins/remote.js';
|
|
3
|
-
import type { ToolBinding, ToolRegistry } from '../plugins/tools.js';
|
|
3
|
+
import type { RunTicket, ToolBinding, ToolRegistry } from '../plugins/tools.js';
|
|
4
4
|
export interface ToolServer {
|
|
5
5
|
/** The MCP endpoint. */
|
|
6
6
|
url: string;
|
|
@@ -31,5 +31,7 @@ export interface ToolServerOptions {
|
|
|
31
31
|
openRuns?: string[];
|
|
32
32
|
/** Further addresses to listen on, on the same port (a runtime's container network). */
|
|
33
33
|
hosts?: string[];
|
|
34
|
+
/** Reads a ticket from the server; run calls get it as `currentTicket`. */
|
|
35
|
+
readTicket?: (uuid: string) => Promise<RunTicket>;
|
|
34
36
|
}
|
|
35
37
|
export declare function startToolServer(options: ToolServerOptions): Promise<ToolServer>;
|
|
@@ -108,7 +108,13 @@ export async function startToolServer(options) {
|
|
|
108
108
|
}
|
|
109
109
|
return result;
|
|
110
110
|
}
|
|
111
|
-
const
|
|
111
|
+
const uuid = binding.ticket?.uuid;
|
|
112
|
+
const { readTicket } = options;
|
|
113
|
+
const result = await registry.call(request.params.name, request.params.arguments,
|
|
114
|
+
// Added per call, so the persisted grant never holds it.
|
|
115
|
+
readTicket && uuid
|
|
116
|
+
? { ...binding, currentTicket: () => readTicket(uuid) }
|
|
117
|
+
: binding, { signal: extra.signal, ...(logger ? { logger } : {}) });
|
|
112
118
|
return { content: [{ type: 'text', text: result.text }] };
|
|
113
119
|
}
|
|
114
120
|
catch (err) {
|
|
@@ -24,13 +24,17 @@ export interface ToolDefinition {
|
|
|
24
24
|
export interface ToolResult {
|
|
25
25
|
text: string;
|
|
26
26
|
}
|
|
27
|
+
/** A ticket as a run knows it; an operator call may know only its identifier. */
|
|
28
|
+
export type RunTicket = Partial<Ticket> & {
|
|
29
|
+
identifier: string;
|
|
30
|
+
};
|
|
27
31
|
/** The worktree a call acts on — fixed by the session, never by the tool. */
|
|
28
32
|
export interface ToolBinding {
|
|
29
33
|
worktreePath: string;
|
|
30
|
-
/** The run's ticket
|
|
31
|
-
ticket?:
|
|
32
|
-
|
|
33
|
-
|
|
34
|
+
/** The run's ticket. */
|
|
35
|
+
ticket?: RunTicket;
|
|
36
|
+
/** Reads the run's ticket from the server at call time; never persisted. */
|
|
37
|
+
currentTicket?: () => Promise<RunTicket>;
|
|
34
38
|
}
|
|
35
39
|
export interface ToolRequest extends ToolBinding {
|
|
36
40
|
args: Record<string, unknown>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bakers-build/conductor",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.1-next.1",
|
|
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.
|
|
36
|
-
"@bakers-build/message": "^0.
|
|
35
|
+
"@bakers-build/core": "^0.10.1-next.1",
|
|
36
|
+
"@bakers-build/message": "^0.10.1-next.1",
|
|
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": "
|
|
42
|
+
"commit": "f9cee7721df536cac94906e7278d60a13e202502",
|
|
43
43
|
"channel": "next"
|
|
44
44
|
}
|
|
45
45
|
}
|