robal-framework 0.1.0
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/LICENSE +190 -0
- package/README.md +198 -0
- package/dist/bridge.d.ts +82 -0
- package/dist/bridge.d.ts.map +1 -0
- package/dist/bridge.js +327 -0
- package/dist/bridge.js.map +1 -0
- package/dist/createAgentTeam.d.ts +51 -0
- package/dist/createAgentTeam.d.ts.map +1 -0
- package/dist/createAgentTeam.js +192 -0
- package/dist/createAgentTeam.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +18 -0
- package/dist/index.js.map +1 -0
- package/dist/orchestrator.d.ts +51 -0
- package/dist/orchestrator.d.ts.map +1 -0
- package/dist/orchestrator.js +125 -0
- package/dist/orchestrator.js.map +1 -0
- package/dist/server.d.ts +94 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +334 -0
- package/dist/server.js.map +1 -0
- package/dist/team.d.ts +17 -0
- package/dist/team.d.ts.map +1 -0
- package/dist/team.js +61 -0
- package/dist/team.js.map +1 -0
- package/dist/types.d.ts +215 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +5 -0
- package/dist/types.js.map +1 -0
- package/dist/worker.d.ts +51 -0
- package/dist/worker.d.ts.map +1 -0
- package/dist/worker.js +181 -0
- package/dist/worker.js.map +1 -0
- package/package.json +32 -0
package/dist/bridge.js
ADDED
|
@@ -0,0 +1,327 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.AgentBridge = void 0;
|
|
37
|
+
exports.createBridgedAgent = createBridgedAgent;
|
|
38
|
+
exports.createBridgedReviewer = createBridgedReviewer;
|
|
39
|
+
const http = __importStar(require("http"));
|
|
40
|
+
/**
|
|
41
|
+
* Local HTTP server that exposes framework capabilities to any agent process.
|
|
42
|
+
* Agents call these endpoints via curl, fetch, subprocess — any language.
|
|
43
|
+
*
|
|
44
|
+
* Endpoints:
|
|
45
|
+
* POST /delegate — spawn sub-agents, returns results
|
|
46
|
+
* POST /submit-review — submit review verdict
|
|
47
|
+
* POST /submit-result — submit final task output
|
|
48
|
+
* GET /task — get current task info
|
|
49
|
+
* GET /health — health check
|
|
50
|
+
*/
|
|
51
|
+
class AgentBridge {
|
|
52
|
+
server = null;
|
|
53
|
+
handlers = null;
|
|
54
|
+
currentTask = null;
|
|
55
|
+
reviewResolve = null;
|
|
56
|
+
resultResolve = null;
|
|
57
|
+
port;
|
|
58
|
+
constructor(port = 0) {
|
|
59
|
+
this.port = port;
|
|
60
|
+
}
|
|
61
|
+
async start() {
|
|
62
|
+
return new Promise((resolve) => {
|
|
63
|
+
this.server = http.createServer((req, res) => this.handle(req, res));
|
|
64
|
+
this.server.listen(this.port, '127.0.0.1', () => {
|
|
65
|
+
const addr = this.server.address();
|
|
66
|
+
this.port = addr.port;
|
|
67
|
+
resolve(addr.port);
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
stop() {
|
|
72
|
+
return new Promise((resolve) => {
|
|
73
|
+
if (this.server)
|
|
74
|
+
this.server.close(() => resolve());
|
|
75
|
+
else
|
|
76
|
+
resolve();
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
setHandlers(handlers) { this.handlers = handlers; }
|
|
80
|
+
setTask(task) { this.currentTask = task; }
|
|
81
|
+
waitForReview() {
|
|
82
|
+
return new Promise((resolve) => { this.reviewResolve = resolve; });
|
|
83
|
+
}
|
|
84
|
+
waitForResult() {
|
|
85
|
+
return new Promise((resolve) => { this.resultResolve = resolve; });
|
|
86
|
+
}
|
|
87
|
+
handle(req, res) {
|
|
88
|
+
const url = req.url || '';
|
|
89
|
+
const method = req.method || '';
|
|
90
|
+
res.setHeader('Access-Control-Allow-Origin', '*');
|
|
91
|
+
res.setHeader('Access-Control-Allow-Methods', 'GET,POST,OPTIONS');
|
|
92
|
+
res.setHeader('Access-Control-Allow-Headers', 'Content-Type');
|
|
93
|
+
if (method === 'OPTIONS') {
|
|
94
|
+
res.writeHead(200);
|
|
95
|
+
res.end();
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
if (method === 'GET' && url === '/health') {
|
|
99
|
+
this.json(res, 200, { ok: true });
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
if (method === 'GET' && url === '/task') {
|
|
103
|
+
if (!this.currentTask) {
|
|
104
|
+
this.json(res, 404, { error: 'No active task' });
|
|
105
|
+
return;
|
|
106
|
+
}
|
|
107
|
+
const { delegate, ...safe } = this.currentTask;
|
|
108
|
+
this.json(res, 200, { ...safe, canDelegate: !!delegate });
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
if (method === 'POST' && url === '/delegate') {
|
|
112
|
+
this.readBody(req, async (body) => {
|
|
113
|
+
if (!this.handlers?.delegate) {
|
|
114
|
+
this.json(res, 400, { error: 'Delegation not available' });
|
|
115
|
+
return;
|
|
116
|
+
}
|
|
117
|
+
try {
|
|
118
|
+
const { subtasks } = body;
|
|
119
|
+
if (!Array.isArray(subtasks)) {
|
|
120
|
+
this.json(res, 400, { error: 'subtasks must be an array' });
|
|
121
|
+
return;
|
|
122
|
+
}
|
|
123
|
+
const results = await this.handlers.delegate(subtasks);
|
|
124
|
+
this.json(res, 200, { results });
|
|
125
|
+
}
|
|
126
|
+
catch (err) {
|
|
127
|
+
this.json(res, 500, { error: err.message });
|
|
128
|
+
}
|
|
129
|
+
});
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
if (method === 'POST' && url === '/submit-review') {
|
|
133
|
+
this.readBody(req, (body) => {
|
|
134
|
+
if (!this.reviewResolve) {
|
|
135
|
+
this.json(res, 400, { error: 'No review pending' });
|
|
136
|
+
return;
|
|
137
|
+
}
|
|
138
|
+
const result = {
|
|
139
|
+
approved: !!body.approved,
|
|
140
|
+
confidence: typeof body.confidence === 'number' ? body.confidence : 0.5,
|
|
141
|
+
feedback: body.feedback || '',
|
|
142
|
+
};
|
|
143
|
+
this.reviewResolve(result);
|
|
144
|
+
this.reviewResolve = null;
|
|
145
|
+
this.json(res, 200, { ok: true });
|
|
146
|
+
});
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
if (method === 'POST' && url === '/submit-result') {
|
|
150
|
+
this.readBody(req, (body) => {
|
|
151
|
+
if (!this.resultResolve) {
|
|
152
|
+
this.json(res, 400, { error: 'No result pending' });
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
const result = {
|
|
156
|
+
status: body.status || 'completed',
|
|
157
|
+
output: body.output || '',
|
|
158
|
+
artifacts: body.artifacts,
|
|
159
|
+
usage: body.usage,
|
|
160
|
+
error: body.error,
|
|
161
|
+
};
|
|
162
|
+
this.resultResolve(result);
|
|
163
|
+
this.resultResolve = null;
|
|
164
|
+
this.json(res, 200, { ok: true });
|
|
165
|
+
});
|
|
166
|
+
return;
|
|
167
|
+
}
|
|
168
|
+
this.json(res, 404, { error: 'Not found' });
|
|
169
|
+
}
|
|
170
|
+
json(res, status, body) {
|
|
171
|
+
res.writeHead(status, { 'Content-Type': 'application/json' });
|
|
172
|
+
res.end(JSON.stringify(body));
|
|
173
|
+
}
|
|
174
|
+
readBody(req, cb) {
|
|
175
|
+
let data = '';
|
|
176
|
+
req.on('data', (chunk) => data += chunk);
|
|
177
|
+
req.on('end', () => {
|
|
178
|
+
try {
|
|
179
|
+
cb(JSON.parse(data));
|
|
180
|
+
}
|
|
181
|
+
catch {
|
|
182
|
+
cb({});
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
exports.AgentBridge = AgentBridge;
|
|
188
|
+
/**
|
|
189
|
+
* Builds the capability instructions the framework injects for the agent.
|
|
190
|
+
* The agent receives these so it knows what it can do — delegate, submit results, etc.
|
|
191
|
+
*/
|
|
192
|
+
function buildInstructions(baseUrl, canDelegate, task) {
|
|
193
|
+
const lines = [
|
|
194
|
+
'=== ROBAL FRAMEWORK ===',
|
|
195
|
+
'You are an agent managed by the Robal orchestration framework.',
|
|
196
|
+
'',
|
|
197
|
+
`Your task: ${task.prompt}`,
|
|
198
|
+
];
|
|
199
|
+
if (task.feedback) {
|
|
200
|
+
lines.push('', `Previous attempt was rejected. Feedback: ${task.feedback}`);
|
|
201
|
+
}
|
|
202
|
+
if (task.context?.previousOutputs?.length) {
|
|
203
|
+
lines.push('', 'Context from previous steps:', ...task.context.previousOutputs.map((o, i) => `[Step ${i + 1}]: ${o}`));
|
|
204
|
+
}
|
|
205
|
+
lines.push('', '=== AVAILABLE ACTIONS ===', '', '1. SUBMIT YOUR RESULT (required when done):', ` curl -s -X POST ${baseUrl}/submit-result -H "Content-Type: application/json" -d '{"status":"completed","output":"YOUR_OUTPUT"}'`, ' Replace YOUR_OUTPUT with your final answer/output.');
|
|
206
|
+
if (canDelegate) {
|
|
207
|
+
lines.push('', '2. DELEGATE TO SUB-AGENTS (optional — if the task is complex, break it up):', ` curl -s -X POST ${baseUrl}/delegate -H "Content-Type: application/json" -d '{"subtasks":[{"prompt":"subtask 1"},{"prompt":"subtask 2"}]}'`, ' This returns {"results":["output1","output2"]} with each sub-agent\'s output.', ' You can then use these results to compose your final answer.');
|
|
208
|
+
}
|
|
209
|
+
lines.push('', '3. READ FULL TASK DETAILS (optional):', ` curl -s ${baseUrl}/task`, '', '=== INSTRUCTIONS ===', canDelegate
|
|
210
|
+
? 'Decide: either do the work yourself, or delegate subtasks to sub-agents. Then submit your result.'
|
|
211
|
+
: 'Do the work and submit your result.', '===================');
|
|
212
|
+
return lines.join('\n');
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Wraps any external process as an Agent by exposing the bridge server.
|
|
216
|
+
*
|
|
217
|
+
* Two modes:
|
|
218
|
+
* - **Simple mode**: just pass `command` — the framework builds the full prompt
|
|
219
|
+
* with capability instructions and pipes it to your command.
|
|
220
|
+
* - **Custom mode**: pass `run` for full control over how the agent is invoked.
|
|
221
|
+
*
|
|
222
|
+
* The agent process receives env vars including ROBAL_INSTRUCTIONS which contains
|
|
223
|
+
* the full prompt with task, context, and available actions (delegate, submit, etc).
|
|
224
|
+
* The agent just needs to follow the instructions.
|
|
225
|
+
*
|
|
226
|
+
* @example
|
|
227
|
+
* ```ts
|
|
228
|
+
* // Simple: framework builds prompt, pipes to your CLI
|
|
229
|
+
* const { agent } = await createBridgedAgent({
|
|
230
|
+
* command: 'kiro-cli chat --no-interactive --trust-all-tools',
|
|
231
|
+
* });
|
|
232
|
+
*
|
|
233
|
+
* // Custom: full control
|
|
234
|
+
* const { agent } = await createBridgedAgent({
|
|
235
|
+
* run: async (task, env) => {
|
|
236
|
+
* execSync(`my-agent`, { env: { ...process.env, ...env } });
|
|
237
|
+
* },
|
|
238
|
+
* });
|
|
239
|
+
* ```
|
|
240
|
+
*/
|
|
241
|
+
async function createBridgedAgent(opts) {
|
|
242
|
+
const bridge = new AgentBridge(opts.port || 0);
|
|
243
|
+
const port = await bridge.start();
|
|
244
|
+
const baseUrl = `http://127.0.0.1:${port}`;
|
|
245
|
+
const timeout = opts.timeoutMs ?? 300_000;
|
|
246
|
+
const agent = {
|
|
247
|
+
async execute(task) {
|
|
248
|
+
bridge.setTask(task);
|
|
249
|
+
bridge.setHandlers({
|
|
250
|
+
delegate: task.delegate || (async () => { throw new Error('Delegation not available at this depth'); }),
|
|
251
|
+
submitReview: () => { },
|
|
252
|
+
});
|
|
253
|
+
const canDelegate = !!task.delegate;
|
|
254
|
+
const instructions = buildInstructions(baseUrl, canDelegate, task);
|
|
255
|
+
const env = {
|
|
256
|
+
ROBAL_BRIDGE_URL: baseUrl,
|
|
257
|
+
ROBAL_TASK_URL: `${baseUrl}/task`,
|
|
258
|
+
ROBAL_DELEGATE_URL: `${baseUrl}/delegate`,
|
|
259
|
+
ROBAL_RESULT_URL: `${baseUrl}/submit-result`,
|
|
260
|
+
ROBAL_TASK_ID: task.id,
|
|
261
|
+
ROBAL_TEAM_ID: task.teamId,
|
|
262
|
+
ROBAL_PROMPT: task.prompt,
|
|
263
|
+
ROBAL_CAN_DELEGATE: canDelegate ? 'true' : 'false',
|
|
264
|
+
ROBAL_DEPTH: String(task.depth ?? 0),
|
|
265
|
+
ROBAL_INSTRUCTIONS: instructions,
|
|
266
|
+
...(task.feedback ? { ROBAL_FEEDBACK: task.feedback } : {}),
|
|
267
|
+
};
|
|
268
|
+
try {
|
|
269
|
+
const resultPromise = bridge.waitForResult();
|
|
270
|
+
let runResult;
|
|
271
|
+
if (opts.command) {
|
|
272
|
+
// Command mode: pipe instructions to the command
|
|
273
|
+
// Always wait for bridge result — ignore stdout
|
|
274
|
+
await new Promise((resolve, reject) => {
|
|
275
|
+
const child = require('child_process').spawn('bash', ['-c', opts.command], {
|
|
276
|
+
env: { ...process.env, ...env },
|
|
277
|
+
timeout: timeout,
|
|
278
|
+
});
|
|
279
|
+
child.stdin.write(env.ROBAL_INSTRUCTIONS);
|
|
280
|
+
child.stdin.end();
|
|
281
|
+
child.stdout.on('data', () => { });
|
|
282
|
+
child.stderr.on('data', () => { });
|
|
283
|
+
child.on('close', (code) => code === 0 ? resolve() : reject(new Error(`exit ${code}`)));
|
|
284
|
+
child.on('error', reject);
|
|
285
|
+
});
|
|
286
|
+
runResult = undefined;
|
|
287
|
+
}
|
|
288
|
+
else if (opts.run) {
|
|
289
|
+
runResult = await opts.run(task, env);
|
|
290
|
+
}
|
|
291
|
+
else {
|
|
292
|
+
throw new Error('Either command or run must be provided');
|
|
293
|
+
}
|
|
294
|
+
// If run() returned a string, use it directly (return mode)
|
|
295
|
+
if (typeof runResult === 'string') {
|
|
296
|
+
return { status: 'completed', output: runResult };
|
|
297
|
+
}
|
|
298
|
+
// Otherwise wait for agent to POST to /submit-result (bridge mode)
|
|
299
|
+
const timer = setTimeout(() => {
|
|
300
|
+
// Resolve with timeout error if agent never posts
|
|
301
|
+
bridge.resultResolve?.({ status: 'failed', output: '', error: `Agent did not submit result within ${timeout}ms` });
|
|
302
|
+
}, timeout);
|
|
303
|
+
const result = await resultPromise;
|
|
304
|
+
clearTimeout(timer);
|
|
305
|
+
return result;
|
|
306
|
+
}
|
|
307
|
+
catch (err) {
|
|
308
|
+
return { status: 'failed', output: '', error: err.message };
|
|
309
|
+
}
|
|
310
|
+
},
|
|
311
|
+
};
|
|
312
|
+
return { agent, bridge };
|
|
313
|
+
}
|
|
314
|
+
/**
|
|
315
|
+
* Creates a Reviewer that waits for an external process to POST to /submit-review.
|
|
316
|
+
*/
|
|
317
|
+
function createBridgedReviewer(bridge) {
|
|
318
|
+
return {
|
|
319
|
+
reviewer: {
|
|
320
|
+
async review(task, output) {
|
|
321
|
+
bridge.setTask({ ...task, prompt: `Review: ${task.prompt}\n\nOutput: ${output.output}` });
|
|
322
|
+
return bridge.waitForReview();
|
|
323
|
+
},
|
|
324
|
+
},
|
|
325
|
+
};
|
|
326
|
+
}
|
|
327
|
+
//# sourceMappingURL=bridge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bridge.js","sourceRoot":"","sources":["../src/bridge.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmOA,gDAqFC;AAKD,sDAWC;AAxUD,2CAA6B;AAQ7B;;;;;;;;;;GAUG;AACH,MAAa,WAAW;IACd,MAAM,GAAuB,IAAI,CAAC;IAClC,QAAQ,GAA0B,IAAI,CAAC;IACvC,WAAW,GAAqB,IAAI,CAAC;IACrC,aAAa,GAA4C,IAAI,CAAC;IAC9D,aAAa,GAA0C,IAAI,CAAC;IAC3D,IAAI,CAAS;IAEtB,YAAY,IAAI,GAAG,CAAC;QAClB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;IAED,KAAK,CAAC,KAAK;QACT,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;YAC7B,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,CAAC;YACrE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,WAAW,EAAE,GAAG,EAAE;gBAC9C,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C;gBACnC,YAAY,CAAC,KAAK,CAAC,CAAC;gBACpB,OAAO,MAAM,CAAC;YAChB,CAAC;YAAC,OAAO,GAAQ,EAAE,CAAC;gBAClB,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,GAAG,CAAC,OAAO,EAAE,CAAC;YAC9D,CAAC;QACH,CAAC;KACF,CAAC;IAEF,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AAC3B,CAAC;AAED;;GAEG;AACH,SAAgB,qBAAqB,CAAC,MAAmB;IAGvD,OAAO;QACL,QAAQ,EAAE;YACR,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM;gBACvB,MAAM,CAAC,OAAO,CAAC,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,WAAW,IAAI,CAAC,MAAM,eAAe,MAAM,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;gBAC1F,OAAO,MAAM,CAAC,aAAa,EAAE,CAAC;YAChC,CAAC;SACF;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { TaskOutput } from './types';
|
|
2
|
+
/** An agent available for delegation — name is how the root agent refers to it, agent is the command to start it */
|
|
3
|
+
export interface AgentOption {
|
|
4
|
+
/** Human-readable name the root agent uses to delegate, e.g. "code-agent" */
|
|
5
|
+
name: string;
|
|
6
|
+
/** Description of what this agent does */
|
|
7
|
+
description: string;
|
|
8
|
+
/** Shell command to start this agent. Framework pipes instructions to stdin. */
|
|
9
|
+
agent: string;
|
|
10
|
+
}
|
|
11
|
+
export interface CreateAgentTeamOptions {
|
|
12
|
+
/** Shell command for the root agent, e.g. 'kiro-cli chat --no-interactive --trust-all-tools' */
|
|
13
|
+
rootAgent: string;
|
|
14
|
+
/** The task prompt */
|
|
15
|
+
prompt: string;
|
|
16
|
+
/** Agents available for delegation */
|
|
17
|
+
availableAgents?: AgentOption[];
|
|
18
|
+
/** Max delegation depth (default 3) */
|
|
19
|
+
maxDepth?: number;
|
|
20
|
+
/** Max parallel workers per delegation (default 5) */
|
|
21
|
+
maxWorkers?: number;
|
|
22
|
+
/** Max review-retry cycles (default 3) */
|
|
23
|
+
maxCycles?: number;
|
|
24
|
+
/** Timeout per agent invocation in ms (default 120000) */
|
|
25
|
+
timeoutMs?: number;
|
|
26
|
+
/** Optional reviewer command — if provided, reviews each output */
|
|
27
|
+
reviewer?: string;
|
|
28
|
+
/** Event listener */
|
|
29
|
+
onEvent?: (event: {
|
|
30
|
+
type: string;
|
|
31
|
+
[key: string]: any;
|
|
32
|
+
}) => void;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Create and run an agent team.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts
|
|
39
|
+
* const result = await createAgentTeam({
|
|
40
|
+
* rootAgent: 'kiro-cli chat --no-interactive --trust-all-tools',
|
|
41
|
+
* prompt: 'Build a landing page for our product',
|
|
42
|
+
* availableAgents: [
|
|
43
|
+
* { name: 'code-agent', description: 'Writes code', agent: 'kiro-cli chat --no-interactive --trust-all-tools' },
|
|
44
|
+
* { name: 'design-agent', description: 'Creates designs', agent: 'dalle-cli generate' },
|
|
45
|
+
* ],
|
|
46
|
+
* });
|
|
47
|
+
* console.log(result.output);
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export declare function createAgentTeam(opts: CreateAgentTeamOptions): Promise<TaskOutput>;
|
|
51
|
+
//# sourceMappingURL=createAgentTeam.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createAgentTeam.d.ts","sourceRoot":"","sources":["../src/createAgentTeam.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAM1C,oHAAoH;AACpH,MAAM,WAAW,WAAW;IAC1B,6EAA6E;IAC7E,IAAI,EAAE,MAAM,CAAC;IACb,0CAA0C;IAC1C,WAAW,EAAE,MAAM,CAAC;IACpB,gFAAgF;IAChF,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,sBAAsB;IACrC,gGAAgG;IAChG,SAAS,EAAE,MAAM,CAAC;IAClB,sBAAsB;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,sCAAsC;IACtC,eAAe,CAAC,EAAE,WAAW,EAAE,CAAC;IAChC,uCAAuC;IACvC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sDAAsD;IACtD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,0CAA0C;IAC1C,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,0DAA0D;IAC1D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,mEAAmE;IACnE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qBAAqB;IACrB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;KAAE,KAAK,IAAI,CAAC;CACjE;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAsB,eAAe,CAAC,IAAI,EAAE,sBAAsB,GAAG,OAAO,CAAC,UAAU,CAAC,CAmKvF"}
|
|
@@ -0,0 +1,192 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createAgentTeam = createAgentTeam;
|
|
4
|
+
const server_1 = require("./server");
|
|
5
|
+
const worker_1 = require("./worker");
|
|
6
|
+
const child_process_1 = require("child_process");
|
|
7
|
+
/**
|
|
8
|
+
* Create and run an agent team.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* const result = await createAgentTeam({
|
|
13
|
+
* rootAgent: 'kiro-cli chat --no-interactive --trust-all-tools',
|
|
14
|
+
* prompt: 'Build a landing page for our product',
|
|
15
|
+
* availableAgents: [
|
|
16
|
+
* { name: 'code-agent', description: 'Writes code', agent: 'kiro-cli chat --no-interactive --trust-all-tools' },
|
|
17
|
+
* { name: 'design-agent', description: 'Creates designs', agent: 'dalle-cli generate' },
|
|
18
|
+
* ],
|
|
19
|
+
* });
|
|
20
|
+
* console.log(result.output);
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
async function createAgentTeam(opts) {
|
|
24
|
+
const timeout = opts.timeoutMs ?? 120_000;
|
|
25
|
+
const servers = [];
|
|
26
|
+
// Build agent lookup: name → command
|
|
27
|
+
const agentCommands = new Map();
|
|
28
|
+
const agentDescriptions = [];
|
|
29
|
+
for (const a of opts.availableAgents || []) {
|
|
30
|
+
agentCommands.set(a.name, a.agent);
|
|
31
|
+
agentDescriptions.push({ name: a.name, description: a.description });
|
|
32
|
+
}
|
|
33
|
+
// Root agent is always available for delegation (self-delegation)
|
|
34
|
+
if (!agentCommands.has('root')) {
|
|
35
|
+
agentCommands.set('root', opts.rootAgent);
|
|
36
|
+
agentDescriptions.push({ name: 'root', description: 'Same agent as you — delegate subtasks to yourself' });
|
|
37
|
+
}
|
|
38
|
+
// Create an Agent from a shell command
|
|
39
|
+
function makeAgent(command) {
|
|
40
|
+
const server = new server_1.AgentServer(0);
|
|
41
|
+
servers.push(server);
|
|
42
|
+
let started = false;
|
|
43
|
+
const agent = {
|
|
44
|
+
async execute(task) {
|
|
45
|
+
if (!started) {
|
|
46
|
+
await server.start();
|
|
47
|
+
started = true;
|
|
48
|
+
}
|
|
49
|
+
const port = server.port;
|
|
50
|
+
const baseUrl = `http://127.0.0.1:${port}`;
|
|
51
|
+
server.setTask(task);
|
|
52
|
+
server.setHandlers({
|
|
53
|
+
delegate: task.delegate || (async () => { throw new Error('Delegation not available'); }),
|
|
54
|
+
submitReview: () => { },
|
|
55
|
+
});
|
|
56
|
+
const canDelegate = !!task.delegate;
|
|
57
|
+
const instructions = (0, server_2.buildInstructions)(baseUrl, canDelegate, task, agentDescriptions);
|
|
58
|
+
const env = {
|
|
59
|
+
ROBAL_BRIDGE_URL: baseUrl,
|
|
60
|
+
ROBAL_TASK_URL: `${baseUrl}/task`,
|
|
61
|
+
ROBAL_DELEGATE_URL: `${baseUrl}/delegate`,
|
|
62
|
+
ROBAL_RESULT_URL: `${baseUrl}/submit-result`,
|
|
63
|
+
ROBAL_TASK_ID: task.id,
|
|
64
|
+
ROBAL_TEAM_ID: task.teamId,
|
|
65
|
+
ROBAL_PROMPT: task.prompt,
|
|
66
|
+
ROBAL_CAN_DELEGATE: canDelegate ? 'true' : 'false',
|
|
67
|
+
ROBAL_DEPTH: String(task.depth ?? 0),
|
|
68
|
+
ROBAL_INSTRUCTIONS: instructions,
|
|
69
|
+
...(task.feedback ? { ROBAL_FEEDBACK: task.feedback } : {}),
|
|
70
|
+
};
|
|
71
|
+
try {
|
|
72
|
+
const resultPromise = server.waitForResult();
|
|
73
|
+
await new Promise((resolve, reject) => {
|
|
74
|
+
const child = (0, child_process_1.spawn)('bash', ['-c', command], { env: { ...process.env, ...env }, timeout });
|
|
75
|
+
child.stdin.write(instructions);
|
|
76
|
+
child.stdin.end();
|
|
77
|
+
child.stdout.on('data', () => { });
|
|
78
|
+
child.stderr.on('data', () => { });
|
|
79
|
+
child.on('close', (code) => code === 0 ? resolve() : reject(new Error(`Agent exited with code ${code}`)));
|
|
80
|
+
child.on('error', reject);
|
|
81
|
+
});
|
|
82
|
+
const timer = setTimeout(() => {
|
|
83
|
+
server.resultResolve?.({ status: 'failed', output: '', error: 'Agent did not submit result' });
|
|
84
|
+
}, timeout);
|
|
85
|
+
const result = await resultPromise;
|
|
86
|
+
clearTimeout(timer);
|
|
87
|
+
return result;
|
|
88
|
+
}
|
|
89
|
+
catch (err) {
|
|
90
|
+
return { status: 'failed', output: '', error: err.message };
|
|
91
|
+
}
|
|
92
|
+
},
|
|
93
|
+
};
|
|
94
|
+
return { agent, server };
|
|
95
|
+
}
|
|
96
|
+
// Root agent
|
|
97
|
+
const { agent: rootAgent } = makeAgent(opts.rootAgent);
|
|
98
|
+
// Wrap to resolve child agent names to commands
|
|
99
|
+
const wrappedRoot = {
|
|
100
|
+
async execute(task) {
|
|
101
|
+
const origDelegate = task.delegate;
|
|
102
|
+
if (origDelegate) {
|
|
103
|
+
task = {
|
|
104
|
+
...task,
|
|
105
|
+
delegate: (subtasks) => {
|
|
106
|
+
const resolved = subtasks.map(sub => {
|
|
107
|
+
const cmd = sub.name ? agentCommands.get(sub.name) : undefined;
|
|
108
|
+
const { agent: childAgent } = makeAgent(cmd || opts.rootAgent);
|
|
109
|
+
return { ...sub, agent: childAgent };
|
|
110
|
+
});
|
|
111
|
+
return origDelegate(resolved);
|
|
112
|
+
},
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
return rootAgent.execute(task);
|
|
116
|
+
},
|
|
117
|
+
};
|
|
118
|
+
// Optional reviewer
|
|
119
|
+
let reviewer;
|
|
120
|
+
if (opts.reviewer) {
|
|
121
|
+
reviewer = {
|
|
122
|
+
async review(task, output) {
|
|
123
|
+
const reviewServer = new server_1.AgentServer(0);
|
|
124
|
+
servers.push(reviewServer);
|
|
125
|
+
await reviewServer.start();
|
|
126
|
+
const reviewPort = reviewServer.port;
|
|
127
|
+
const reviewUrl = `http://127.0.0.1:${reviewPort}`;
|
|
128
|
+
const reviewTask = {
|
|
129
|
+
...task,
|
|
130
|
+
prompt: `Review this work.\n\nOriginal task: ${task.prompt}\n\nOutput to review:\n${output.output}`,
|
|
131
|
+
};
|
|
132
|
+
reviewServer.setTask(reviewTask);
|
|
133
|
+
const reviewPromise = reviewServer.waitForReview();
|
|
134
|
+
const instructions = buildReviewInstructions(reviewUrl, reviewTask);
|
|
135
|
+
await new Promise((resolve, reject) => {
|
|
136
|
+
const child = require('child_process').spawn('bash', ['-c', opts.reviewer], {
|
|
137
|
+
env: { ...process.env, ROBAL_BRIDGE_URL: reviewUrl, ROBAL_INSTRUCTIONS: instructions, ROBAL_PROMPT: reviewTask.prompt },
|
|
138
|
+
timeout: timeout,
|
|
139
|
+
});
|
|
140
|
+
child.stdin.write(instructions);
|
|
141
|
+
child.stdin.end();
|
|
142
|
+
child.stdout.on('data', () => { });
|
|
143
|
+
child.stderr.on('data', () => { });
|
|
144
|
+
child.on('close', () => resolve());
|
|
145
|
+
child.on('error', reject);
|
|
146
|
+
});
|
|
147
|
+
const timer = setTimeout(() => {
|
|
148
|
+
reviewServer.reviewResolve?.({ approved: true, confidence: 0.5, feedback: 'Review timed out — auto-approved' });
|
|
149
|
+
}, timeout);
|
|
150
|
+
const result = await reviewPromise;
|
|
151
|
+
clearTimeout(timer);
|
|
152
|
+
return result;
|
|
153
|
+
},
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
try {
|
|
157
|
+
const worker = new worker_1.Worker({
|
|
158
|
+
agent: wrappedRoot,
|
|
159
|
+
reviewer,
|
|
160
|
+
maxDepth: opts.maxDepth ?? 3,
|
|
161
|
+
maxWorkers: opts.maxWorkers ?? 5,
|
|
162
|
+
maxCycles: opts.maxCycles ?? 3,
|
|
163
|
+
timeoutMs: timeout,
|
|
164
|
+
onEvent: opts.onEvent ? (e) => opts.onEvent({ type: 'worker', ...e }) : undefined,
|
|
165
|
+
});
|
|
166
|
+
return await worker.run({ id: `team-${Date.now()}`, prompt: opts.prompt, teamId: 'root' });
|
|
167
|
+
}
|
|
168
|
+
finally {
|
|
169
|
+
for (const s of servers)
|
|
170
|
+
await s.stop().catch(() => { });
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
// Re-use buildInstructions from server.ts — import it
|
|
174
|
+
const server_2 = require("./server");
|
|
175
|
+
function buildReviewInstructions(baseUrl, task) {
|
|
176
|
+
return [
|
|
177
|
+
'=== ROBAL FRAMEWORK — REVIEW MODE ===',
|
|
178
|
+
'You are a reviewer. Evaluate the work below and submit your verdict.',
|
|
179
|
+
'',
|
|
180
|
+
task.prompt,
|
|
181
|
+
'',
|
|
182
|
+
'=== SUBMIT YOUR REVIEW ===',
|
|
183
|
+
'When you have decided, run this command:',
|
|
184
|
+
`curl -s -X POST ${baseUrl}/submit-review -H "Content-Type: application/json" -d '{"approved":true_or_false,"confidence":0.0_to_1.0,"feedback":"YOUR_FEEDBACK"}'`,
|
|
185
|
+
'',
|
|
186
|
+
'- Set "approved" to true if the work is acceptable, false if it needs revision.',
|
|
187
|
+
'- Set "confidence" to a number between 0 and 1 indicating how confident you are.',
|
|
188
|
+
'- Set "feedback" to explain what needs to change (if rejecting) or why it\'s good (if approving).',
|
|
189
|
+
'========================',
|
|
190
|
+
].join('\n');
|
|
191
|
+
}
|
|
192
|
+
//# sourceMappingURL=createAgentTeam.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createAgentTeam.js","sourceRoot":"","sources":["../src/createAgentTeam.ts"],"names":[],"mappings":";;AAqDA,0CAmKC;AAvND,qCAAuC;AACvC,qCAAkC;AAElC,iDAAsC;AAiCtC;;;;;;;;;;;;;;;GAeG;AACI,KAAK,UAAU,eAAe,CAAC,IAA4B;IAChE,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,IAAI,OAAO,CAAC;IAC1C,MAAM,OAAO,GAAkB,EAAE,CAAC;IAElC,qCAAqC;IACrC,MAAM,aAAa,GAAG,IAAI,GAAG,EAAkB,CAAC;IAChD,MAAM,iBAAiB,GAA4C,EAAE,CAAC;IACtE,KAAK,MAAM,CAAC,IAAI,IAAI,CAAC,eAAe,IAAI,EAAE,EAAE,CAAC;QAC3C,aAAa,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC;QACnC,iBAAiB,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,WAAW,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;IACvE,CAAC;IAED,kEAAkE;IAClE,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE,CAAC;QAC/B,aAAa,CAAC,GAAG,CAAC,MAAM,EAAE,IAAI,CAAC,S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C5B,UAAU,EAAE,IAAI,CAAC,UAAU,IAAI,CAAC;YAChC,SAAS,EAAE,IAAI,CAAC,SAAS,IAAI,CAAC;YAC9B,SAAS,EAAE,OAAO;YAClB,OAAO,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,OAAQ,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,SAAS;SACnF,CAAC,CAAC;QAEH,OAAO,MAAM,MAAM,CAAC,GAAG,CAAC,EAAE,EAAE,EAAE,QAAQ,IAAI,CAAC,GAAG,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAC7F,CAAC;YAAS,CAAC;QACT,KAAK,MAAM,CAAC,IAAI,OAAO;YAAE,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IAC1D,CAAC;AACH,CAAC;AAED,sDAAsD;AACtD,qCAA6C;AAE7C,SAAS,uBAAuB,CAAC,OAAe,EAAE,IAAe;IAC/D,OAAO;QACL,uCAAuC;QACvC,sEAAsE;QACtE,EAAE;QACF,IAAI,CAAC,MAAM;QACX,EAAE;QACF,4BAA4B;QAC5B,0CAA0C;QAC1C,mBAAmB,OAAO,uIAAuI;QACjK,EAAE;QACF,iFAAiF;QACjF,kFAAkF;QAClF,mGAAmG;QACnG,0BAA0B;KAC3B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { createAgentTeam } from './createAgentTeam';
|
|
2
|
+
export type { AgentOption, CreateAgentTeamOptions } from './createAgentTeam';
|
|
3
|
+
export { Orchestrator } from './orchestrator';
|
|
4
|
+
export { Team } from './team';
|
|
5
|
+
export { Worker } from './worker';
|
|
6
|
+
export { AgentServer, createAgent, createReviewer } from './server';
|
|
7
|
+
export type { AvailableAgent } from './server';
|
|
8
|
+
export type { Agent, Reviewer, TaskInput, TaskOutput, TaskContext, TaskConstraints, Artifact, UsageReport, ReviewResult, TeamConfig, OrchestratorConfig, Channel, WorkerStatus, WorkerEvent, OrchestratorEvent, } from './types';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AAE7E,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AACpE,YAAY,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAE/C,YAAY,EACV,KAAK,EACL,QAAQ,EACR,SAAS,EACT,UAAU,EACV,WAAW,EACX,eAAe,EACf,QAAQ,EACR,WAAW,EACX,YAAY,EACZ,UAAU,EACV,kBAAkB,EAClB,OAAO,EACP,YAAY,EACZ,WAAW,EACX,iBAAiB,GAClB,MAAM,SAAS,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// robal-framework — Agent orchestration framework
|
|
3
|
+
// Delegate, review, and coordinate any AI agents.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.createReviewer = exports.createAgent = exports.AgentServer = exports.Worker = exports.Team = exports.Orchestrator = exports.createAgentTeam = void 0;
|
|
6
|
+
var createAgentTeam_1 = require("./createAgentTeam");
|
|
7
|
+
Object.defineProperty(exports, "createAgentTeam", { enumerable: true, get: function () { return createAgentTeam_1.createAgentTeam; } });
|
|
8
|
+
var orchestrator_1 = require("./orchestrator");
|
|
9
|
+
Object.defineProperty(exports, "Orchestrator", { enumerable: true, get: function () { return orchestrator_1.Orchestrator; } });
|
|
10
|
+
var team_1 = require("./team");
|
|
11
|
+
Object.defineProperty(exports, "Team", { enumerable: true, get: function () { return team_1.Team; } });
|
|
12
|
+
var worker_1 = require("./worker");
|
|
13
|
+
Object.defineProperty(exports, "Worker", { enumerable: true, get: function () { return worker_1.Worker; } });
|
|
14
|
+
var server_1 = require("./server");
|
|
15
|
+
Object.defineProperty(exports, "AgentServer", { enumerable: true, get: function () { return server_1.AgentServer; } });
|
|
16
|
+
Object.defineProperty(exports, "createAgent", { enumerable: true, get: function () { return server_1.createAgent; } });
|
|
17
|
+
Object.defineProperty(exports, "createReviewer", { enumerable: true, get: function () { return server_1.createReviewer; } });
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA,kDAAkD;AAClD,kDAAkD;;;AAElD,qDAAoD;AAA3C,kHAAA,eAAe,OAAA;AAGxB,+CAA8C;AAArC,4GAAA,YAAY,OAAA;AACrB,+BAA8B;AAArB,4FAAA,IAAI,OAAA;AACb,mCAAkC;AAAzB,gGAAA,MAAM,OAAA;AACf,mCAAoE;AAA3D,qGAAA,WAAW,OAAA;AAAE,qGAAA,WAAW,OAAA;AAAE,wGAAA,cAAc,OAAA"}
|