openfox 2.0.146 → 2.0.148
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/CHANGELOG.md +22 -0
- package/dist/CHANGELOG.md +22 -0
- package/dist/{auto-continue-IENGLXVQ.js → auto-continue-NODN37EK.js} +2 -2
- package/dist/{chat-handler-RJUJHVOX.js → chat-handler-PETIVNGQ.js} +4 -4
- package/dist/{chunk-EZEFBLPY.js → chunk-6UU3W3XO.js} +3 -3
- package/dist/{chunk-7IETJ4D4.js → chunk-772W5PF7.js} +37 -29
- package/dist/chunk-DKHY5UNR.js +7 -0
- package/dist/{chunk-QR6FIHIP.js → chunk-EJKAN7HK.js} +23 -16
- package/dist/{chunk-5D4MQG7P.js → chunk-F6QMFCHQ.js} +4 -4
- package/dist/{chunk-L43S7FJM.js → chunk-LNJOQAXT.js} +2 -2
- package/dist/{chunk-7BIGFGU5.js → chunk-NELDQCPC.js} +285 -115
- package/dist/{chunk-OS4P2KQJ.js → chunk-V4BEYGBJ.js} +7 -7
- package/dist/cli/dev.js +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/{dynamic-context-IQUBKUCX.js → dynamic-context-CM3M2EJC.js} +2 -2
- package/dist/{export-import-NAQDPRET.js → export-import-UITAIBU5.js} +2 -2
- package/dist/{launch-EUU25RFE.js → launch-E6SDDTHE.js} +5 -5
- package/dist/{orchestrator-PPAIE2UH.js → orchestrator-MVQIPITF.js} +4 -4
- package/dist/package.json +1 -1
- package/dist/{processor-7XMJPNCD.js → processor-UTBTJVV5.js} +3 -3
- package/dist/{serve-3GNQNYG6.js → serve-XGIHFEC6.js} +8 -8
- package/dist/server/index.d.ts +3 -0
- package/dist/server/index.js +7 -7
- package/dist/{server-C4LB436R.js → server-F66GXJUS.js} +6 -6
- package/dist/skill-defaults/workflows/SKILL.md +149 -16
- package/dist/{tools-OH3WW6Q4.js → tools-NIOESJYT.js} +2 -2
- package/dist/{update-PG63SDV3.js → update-X6BS6MUF.js} +2 -2
- package/dist/web/assets/{index-jXXIgPm-.js → index-CkVmYTBd.js} +82 -82
- package/dist/web/index.html +1 -1
- package/dist/web/sw.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-EABIZXTG.js +0 -7
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runAgentTurn
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-F6QMFCHQ.js";
|
|
4
4
|
import {
|
|
5
|
+
buildAgentOverrideStatsIdentity,
|
|
5
6
|
executeSubAgent,
|
|
6
|
-
getToolRegistryForAgent
|
|
7
|
-
|
|
7
|
+
getToolRegistryForAgent,
|
|
8
|
+
resolveLLMClientForAgent
|
|
9
|
+
} from "./chunk-EJKAN7HK.js";
|
|
8
10
|
import {
|
|
9
11
|
gitSpawnEnv
|
|
10
12
|
} from "./chunk-J7GAZGZT.js";
|
|
@@ -204,13 +206,13 @@ function executeShellCommand(command, cwd, timeout, signal) {
|
|
|
204
206
|
});
|
|
205
207
|
}
|
|
206
208
|
|
|
207
|
-
// src/server/workflows/
|
|
209
|
+
// src/server/workflows/template.ts
|
|
208
210
|
var TEMPLATE_VARIABLES = [
|
|
209
211
|
{ name: "workdir", description: "Working directory of the session" },
|
|
210
212
|
{ name: "reason", description: 'Human-readable reason (e.g. "2 criteria remaining")' },
|
|
211
213
|
{
|
|
212
214
|
name: "stepOutput",
|
|
213
|
-
description: "Structured output from the previous step (content, stdout, stderr, exitCode, etc.)"
|
|
215
|
+
description: "Structured output from the previous step (content, stdout, stderr, exitCode, etc.); parallel steps expose per-child keys <childId>.<key> and a summary"
|
|
214
216
|
},
|
|
215
217
|
{
|
|
216
218
|
name: "verifierFindings",
|
|
@@ -225,16 +227,6 @@ var TEMPLATE_VARIABLES = [
|
|
|
225
227
|
{ name: "criteriaList", description: "Formatted list of all criteria with status" },
|
|
226
228
|
{ name: "modifiedFiles", description: "List of modified files" }
|
|
227
229
|
];
|
|
228
|
-
function formatCriteriaList(entries) {
|
|
229
|
-
if (entries.length === 0) return "(none)";
|
|
230
|
-
return entries.map((e) => {
|
|
231
|
-
const status = e.status === "passed" ? "[PASSED]" : e.status === "completed" ? "[NEEDS VERIFICATION]" : e.status === "failed" ? "[FAILED]" : "[NOT COMPLETED]";
|
|
232
|
-
return `- **${e.id}** ${status}: ${e.description}`;
|
|
233
|
-
}).join("\n");
|
|
234
|
-
}
|
|
235
|
-
async function formatModifiedFiles(workdir) {
|
|
236
|
-
return formatGitDiffFiles(workdir);
|
|
237
|
-
}
|
|
238
230
|
function resolveTemplate(template, ctx) {
|
|
239
231
|
let result = template;
|
|
240
232
|
for (const { name } of TEMPLATE_VARIABLES) {
|
|
@@ -242,7 +234,7 @@ function resolveTemplate(template, ctx) {
|
|
|
242
234
|
const value = String(ctx[name]);
|
|
243
235
|
result = result.replace(new RegExp(`\\{\\{${name}\\}\\}`, "g"), value);
|
|
244
236
|
}
|
|
245
|
-
result = result.replace(/\{\{stepOutput\.(\w+)\}\}/g, (_, key) => ctx.stepOutput[key] ?? "");
|
|
237
|
+
result = result.replace(/\{\{stepOutput\.([\w.-]+)\}\}/g, (_, key) => ctx.stepOutput[key] ?? "");
|
|
246
238
|
result = result.replace(/\{\{verifierFindings\}\}/g, ctx.stepOutput["content"] ?? "");
|
|
247
239
|
result = result.replace(/\{\{previousStepOutput\}\}/g, ctx.stepOutput["stdout"] ?? "");
|
|
248
240
|
for (const [key, value] of Object.entries(ctx.params)) {
|
|
@@ -250,6 +242,196 @@ function resolveTemplate(template, ctx) {
|
|
|
250
242
|
}
|
|
251
243
|
return result;
|
|
252
244
|
}
|
|
245
|
+
|
|
246
|
+
// src/server/workflows/parallel.ts
|
|
247
|
+
async function mapPool(items, limit, task) {
|
|
248
|
+
const results = new Array(items.length);
|
|
249
|
+
let firstError = null;
|
|
250
|
+
let next = 0;
|
|
251
|
+
const workers = Array.from({ length: Math.min(Math.max(limit, 1), items.length) }, async () => {
|
|
252
|
+
while (next < items.length) {
|
|
253
|
+
const index = next++;
|
|
254
|
+
try {
|
|
255
|
+
results[index] = await task(items[index]);
|
|
256
|
+
} catch (error) {
|
|
257
|
+
if (firstError === null) {
|
|
258
|
+
firstError = error;
|
|
259
|
+
}
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
});
|
|
263
|
+
await Promise.all(workers);
|
|
264
|
+
if (firstError !== null) {
|
|
265
|
+
throw firstError;
|
|
266
|
+
}
|
|
267
|
+
return results;
|
|
268
|
+
}
|
|
269
|
+
function aggregateParallel(outcomes) {
|
|
270
|
+
const successCount = outcomes.filter((o) => o.result === "success").length;
|
|
271
|
+
const result = outcomes.length === 0 ? "failure" : successCount === outcomes.length ? "success" : successCount === 0 ? "failure" : "partial";
|
|
272
|
+
const output = {
|
|
273
|
+
result,
|
|
274
|
+
summary: outcomes.map((o) => `- ${o.id}: ${o.result}`).join("\n")
|
|
275
|
+
};
|
|
276
|
+
for (const o of outcomes) {
|
|
277
|
+
output[`${o.id}.result`] = o.result;
|
|
278
|
+
for (const [key, value] of Object.entries(o.output)) {
|
|
279
|
+
output[`${o.id}.${key}`] = value;
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
return { result, output };
|
|
283
|
+
}
|
|
284
|
+
function isAbortError(error) {
|
|
285
|
+
return error instanceof Error && error.message === "Aborted";
|
|
286
|
+
}
|
|
287
|
+
function failureOutcome(id, error) {
|
|
288
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
289
|
+
logger.warn("Workflow child step failed", { child: id, error: message });
|
|
290
|
+
return { id, result: "failure", output: { error: message } };
|
|
291
|
+
}
|
|
292
|
+
async function runSubAgentChild(child, deps) {
|
|
293
|
+
const { sessionManager, sessionId, llmClient, ctx, signal, onMessage } = deps;
|
|
294
|
+
try {
|
|
295
|
+
const turnMetrics = new TurnMetrics();
|
|
296
|
+
const promptTemplate = child.prompt ?? "Perform your task.";
|
|
297
|
+
const resolvedPrompt = resolveTemplate(promptTemplate, ctx);
|
|
298
|
+
const allAgents = deps.agents ?? await loadAllAgentsDefault(sessionManager.getProjectWorkdir(sessionId));
|
|
299
|
+
const agentDef = findAgentById(child.subAgentType, allAgents);
|
|
300
|
+
if (!agentDef) {
|
|
301
|
+
logger.error("Sub-agent definition not found", { subAgentType: child.subAgentType });
|
|
302
|
+
return { id: child.id, result: "error", output: { error: `Unknown sub-agent type: ${child.subAgentType}` } };
|
|
303
|
+
}
|
|
304
|
+
const toolRegistry = getToolRegistryForAgent(agentDef);
|
|
305
|
+
const filteredToolRegistry = {
|
|
306
|
+
tools: toolRegistry.tools.filter((t) => t.name !== "step_done"),
|
|
307
|
+
definitions: toolRegistry.definitions.filter((d) => d.type === "function" && d.function.name !== "step_done"),
|
|
308
|
+
execute: toolRegistry.execute
|
|
309
|
+
};
|
|
310
|
+
const result = await executeSubAgent({
|
|
311
|
+
subAgentType: child.subAgentType,
|
|
312
|
+
prompt: resolvedPrompt,
|
|
313
|
+
sessionManager,
|
|
314
|
+
sessionId,
|
|
315
|
+
llmClient,
|
|
316
|
+
toolRegistry: filteredToolRegistry,
|
|
317
|
+
turnMetrics,
|
|
318
|
+
providerManager: sessionManager.getProviderManager?.(),
|
|
319
|
+
statsIdentity: deps.statsIdentity ?? {
|
|
320
|
+
providerId: "",
|
|
321
|
+
providerName: "",
|
|
322
|
+
backend: "unknown",
|
|
323
|
+
model: llmClient.getModel()
|
|
324
|
+
},
|
|
325
|
+
...signal ? { signal } : {},
|
|
326
|
+
...onMessage ? { onMessage } : {}
|
|
327
|
+
});
|
|
328
|
+
return {
|
|
329
|
+
id: child.id,
|
|
330
|
+
result: result.result ?? "success",
|
|
331
|
+
output: { content: result.content ?? "", ...result.result ? { result: result.result } : {} }
|
|
332
|
+
};
|
|
333
|
+
} catch (error) {
|
|
334
|
+
if (isAbortError(error)) {
|
|
335
|
+
throw error;
|
|
336
|
+
}
|
|
337
|
+
return failureOutcome(child.id, error);
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
async function runShellChild(child, deps) {
|
|
341
|
+
const { sessionManager, sessionId, ctx, label, signal, onMessage, eventStore, windowOptions } = deps;
|
|
342
|
+
if (child.command === void 0) {
|
|
343
|
+
logger.warn("Shell child has no command", { child: child.id });
|
|
344
|
+
return { id: child.id, result: "error", output: { error: "Missing command" } };
|
|
345
|
+
}
|
|
346
|
+
const command = resolveTemplate(child.command, ctx);
|
|
347
|
+
const timeout = child.timeout ?? 6e4;
|
|
348
|
+
const successCodes = child.successExitCodes ?? [0];
|
|
349
|
+
const runningContent = label ? serverT(
|
|
350
|
+
{ en: "Running ({{label}}): `{{command}}`", fr: "Ex\xE9cution ({{label}}) : `{{command}}`" },
|
|
351
|
+
{ label, command }
|
|
352
|
+
) : serverT({ en: "Running: `{{command}}`", fr: "Ex\xE9cution : `{{command}}`" }, { command });
|
|
353
|
+
const shellMsgId = crypto.randomUUID();
|
|
354
|
+
eventStore.append(
|
|
355
|
+
sessionId,
|
|
356
|
+
createMessageStartEvent(shellMsgId, "user", runningContent, {
|
|
357
|
+
...windowOptions ?? {},
|
|
358
|
+
isSystemGenerated: true,
|
|
359
|
+
messageKind: "auto-prompt",
|
|
360
|
+
metadata: { type: "workflow", name: "Workflow", color: "#f59e0b" }
|
|
361
|
+
})
|
|
362
|
+
);
|
|
363
|
+
if (onMessage) {
|
|
364
|
+
onMessage(
|
|
365
|
+
createChatMessageMessage({
|
|
366
|
+
id: shellMsgId,
|
|
367
|
+
role: "user",
|
|
368
|
+
content: runningContent,
|
|
369
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
370
|
+
isSystemGenerated: true,
|
|
371
|
+
messageKind: "auto-prompt",
|
|
372
|
+
metadata: { type: "workflow", name: "Workflow", color: "#f59e0b" }
|
|
373
|
+
})
|
|
374
|
+
);
|
|
375
|
+
}
|
|
376
|
+
const result = await executeShellCommand(command, sessionManager.getEffectiveWorkdir(sessionId), timeout, signal);
|
|
377
|
+
const output = [result.stdout, result.stderr].filter(Boolean).join("\n").trim();
|
|
378
|
+
const outputContent = output ? label ? serverT(
|
|
379
|
+
{
|
|
380
|
+
en: "Exit code ({{label}}): {{code}}\n```\n{{output}}\n```",
|
|
381
|
+
fr: "Code de sortie ({{label}}) : {{code}}\n```\n{{output}}\n```"
|
|
382
|
+
},
|
|
383
|
+
{ label, code: result.exitCode, output: output.slice(0, 1e4) }
|
|
384
|
+
) : serverT(
|
|
385
|
+
{ en: "Exit code: {{code}}\n```\n{{output}}\n```", fr: "Code de sortie : {{code}}\n```\n{{output}}\n```" },
|
|
386
|
+
{ code: result.exitCode, output: output.slice(0, 1e4) }
|
|
387
|
+
) : label ? serverT(
|
|
388
|
+
{ en: "Exit code ({{label}}): {{code}}", fr: "Code de sortie ({{label}}) : {{code}}" },
|
|
389
|
+
{ label, code: result.exitCode }
|
|
390
|
+
) : serverT({ en: "Exit code: {{code}}", fr: "Code de sortie : {{code}}" }, { code: result.exitCode });
|
|
391
|
+
eventStore.append(sessionId, { type: "message.done", data: { messageId: shellMsgId } });
|
|
392
|
+
const outputMsgId = crypto.randomUUID();
|
|
393
|
+
eventStore.append(
|
|
394
|
+
sessionId,
|
|
395
|
+
createMessageStartEvent(outputMsgId, "user", outputContent, {
|
|
396
|
+
...windowOptions ?? {},
|
|
397
|
+
isSystemGenerated: true,
|
|
398
|
+
messageKind: "correction"
|
|
399
|
+
})
|
|
400
|
+
);
|
|
401
|
+
eventStore.append(sessionId, { type: "message.done", data: { messageId: outputMsgId } });
|
|
402
|
+
if (onMessage) {
|
|
403
|
+
onMessage(
|
|
404
|
+
createChatMessageMessage({
|
|
405
|
+
id: outputMsgId,
|
|
406
|
+
role: "user",
|
|
407
|
+
content: outputContent,
|
|
408
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
409
|
+
isSystemGenerated: true,
|
|
410
|
+
messageKind: "correction"
|
|
411
|
+
})
|
|
412
|
+
);
|
|
413
|
+
}
|
|
414
|
+
return {
|
|
415
|
+
id: child.id,
|
|
416
|
+
result: successCodes.includes(result.exitCode) ? "success" : "failure",
|
|
417
|
+
output: { stdout: result.stdout ?? "", stderr: result.stderr ?? "", exitCode: String(result.exitCode) }
|
|
418
|
+
};
|
|
419
|
+
}
|
|
420
|
+
async function runChild(child, deps) {
|
|
421
|
+
return child.type === "sub_agent" ? runSubAgentChild(child, deps) : runShellChild(child, deps);
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
// src/server/workflows/executor.ts
|
|
425
|
+
function formatCriteriaList(entries) {
|
|
426
|
+
if (entries.length === 0) return "(none)";
|
|
427
|
+
return entries.map((e) => {
|
|
428
|
+
const status = e.status === "passed" ? "[PASSED]" : e.status === "completed" ? "[NEEDS VERIFICATION]" : e.status === "failed" ? "[FAILED]" : "[NOT COMPLETED]";
|
|
429
|
+
return `- **${e.id}** ${status}: ${e.description}`;
|
|
430
|
+
}).join("\n");
|
|
431
|
+
}
|
|
432
|
+
async function formatModifiedFiles(workdir) {
|
|
433
|
+
return formatGitDiffFiles(workdir);
|
|
434
|
+
}
|
|
253
435
|
function evaluateCondition(condition, stepOutcome, metadataEntries) {
|
|
254
436
|
switch (condition.type) {
|
|
255
437
|
case "step_result":
|
|
@@ -364,6 +546,20 @@ function buildReason(metadataEntries) {
|
|
|
364
546
|
const remaining = entries.filter((e) => e.status !== "passed");
|
|
365
547
|
return `${remaining.length} criteria remaining`;
|
|
366
548
|
}
|
|
549
|
+
function buildStepChildDeps(options, templateCtx, eventStore, windowOptions) {
|
|
550
|
+
const { sessionManager, sessionId, llmClient, statsIdentity, signal, onMessage } = options;
|
|
551
|
+
return {
|
|
552
|
+
sessionManager,
|
|
553
|
+
sessionId,
|
|
554
|
+
llmClient,
|
|
555
|
+
ctx: templateCtx,
|
|
556
|
+
...signal ? { signal } : {},
|
|
557
|
+
...onMessage ? { onMessage } : {},
|
|
558
|
+
...statsIdentity !== void 0 ? { statsIdentity } : {},
|
|
559
|
+
eventStore,
|
|
560
|
+
windowOptions
|
|
561
|
+
};
|
|
562
|
+
}
|
|
367
563
|
async function executeWorkflow(workflow, options, subGroup) {
|
|
368
564
|
const { sessionManager, sessionId, llmClient, signal, onMessage } = options;
|
|
369
565
|
const eventStore = getEventStore();
|
|
@@ -582,22 +778,45 @@ async function executeWorkflow(workflow, options, subGroup) {
|
|
|
582
778
|
const es = getEventStore();
|
|
583
779
|
const append = (event) => es.append(sessionId, event);
|
|
584
780
|
let stepDoneCalled = false;
|
|
781
|
+
const stepAgentId = agentStep.agentId ?? resolveDefaultAgentId();
|
|
782
|
+
const effectiveProviderManager = sessionManager.getProviderManager?.();
|
|
783
|
+
let stepLlmClient = llmClient;
|
|
784
|
+
let stepStatsIdentity = options.statsIdentity;
|
|
785
|
+
let stepGetSessionLLMClient = options.getSessionLLMClient;
|
|
786
|
+
if (effectiveProviderManager) {
|
|
787
|
+
const pinnedEffort = session.providerPinnedEffort ?? void 0;
|
|
788
|
+
const resolved = resolveLLMClientForAgent(stepAgentId, llmClient, effectiveProviderManager, pinnedEffort);
|
|
789
|
+
if (resolved.usedOverride && resolved.override) {
|
|
790
|
+
stepLlmClient = resolved.client;
|
|
791
|
+
stepStatsIdentity = buildAgentOverrideStatsIdentity(
|
|
792
|
+
effectiveProviderManager,
|
|
793
|
+
resolved.client,
|
|
794
|
+
resolved.override
|
|
795
|
+
);
|
|
796
|
+
stepGetSessionLLMClient = void 0;
|
|
797
|
+
} else if (resolved.warning) {
|
|
798
|
+
logger.warn("Agent step model override unavailable, falling back", {
|
|
799
|
+
agentId: stepAgentId,
|
|
800
|
+
warning: resolved.warning
|
|
801
|
+
});
|
|
802
|
+
}
|
|
803
|
+
}
|
|
585
804
|
let agentResult;
|
|
586
805
|
try {
|
|
587
806
|
agentResult = await runAgentTurn(
|
|
588
807
|
{
|
|
589
808
|
sessionManager,
|
|
590
809
|
sessionId,
|
|
591
|
-
llmClient,
|
|
592
|
-
...
|
|
593
|
-
...
|
|
810
|
+
llmClient: stepLlmClient,
|
|
811
|
+
...stepGetSessionLLMClient ? { getSessionLLMClient: stepGetSessionLLMClient } : {},
|
|
812
|
+
...stepStatsIdentity ? { statsIdentity: stepStatsIdentity } : {},
|
|
594
813
|
...signal ? { signal } : {},
|
|
595
814
|
...onMessage ? { onMessage } : {},
|
|
596
815
|
...options.llmRetryPolicy ? { llmRetryPolicy: options.llmRetryPolicy } : {},
|
|
597
816
|
...isResumingCurrentStep ? { skipAgentReminder: true } : {}
|
|
598
817
|
},
|
|
599
818
|
turnMetrics,
|
|
600
|
-
|
|
819
|
+
stepAgentId,
|
|
601
820
|
append,
|
|
602
821
|
{
|
|
603
822
|
...!firstEntryForStep.has(step.id) && !agentStep.prompt && !isResumingCurrentStep ? { injectKickoff: () => injectGenericKickoff(sessionId) } : {},
|
|
@@ -641,112 +860,63 @@ async function executeWorkflow(workflow, options, subGroup) {
|
|
|
641
860
|
}
|
|
642
861
|
case "sub_agent": {
|
|
643
862
|
const subStep = step;
|
|
644
|
-
const
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
863
|
+
const outcome = await runSubAgentChild(
|
|
864
|
+
subStep,
|
|
865
|
+
buildStepChildDeps(options, templateCtx, eventStore, currentWindowMessageOptions)
|
|
866
|
+
);
|
|
867
|
+
lastStepOutput = outcome.output;
|
|
868
|
+
stepOutcome = { result: outcome.result, output: lastStepOutput };
|
|
869
|
+
break;
|
|
870
|
+
}
|
|
871
|
+
case "shell": {
|
|
872
|
+
const shellStep = step;
|
|
873
|
+
const outcome = await runShellChild(
|
|
874
|
+
shellStep,
|
|
875
|
+
buildStepChildDeps(options, templateCtx, eventStore, currentWindowMessageOptions)
|
|
876
|
+
);
|
|
877
|
+
lastStepOutput = outcome.output;
|
|
878
|
+
stepOutcome = { result: outcome.result, output: lastStepOutput };
|
|
879
|
+
break;
|
|
880
|
+
}
|
|
881
|
+
case "parallel": {
|
|
882
|
+
const parallelStep = step;
|
|
883
|
+
if (parallelStep.children.length === 0) {
|
|
884
|
+
logger.warn("Parallel step has no children", { sessionId, stepId: step.id });
|
|
653
885
|
}
|
|
654
|
-
const
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
const result = await executeSubAgent({
|
|
661
|
-
subAgentType: subStep.subAgentType,
|
|
662
|
-
prompt: resolvedPrompt,
|
|
886
|
+
const childIds = parallelStep.children.map((c) => c.id);
|
|
887
|
+
if (new Set(childIds).size !== childIds.length) {
|
|
888
|
+
logger.warn("Parallel step has duplicate child ids", { sessionId, stepId: step.id, ids: childIds });
|
|
889
|
+
}
|
|
890
|
+
const allAgents = await loadAllAgentsDefault(sessionManager.getProjectWorkdir(sessionId));
|
|
891
|
+
const baseDeps = {
|
|
663
892
|
sessionManager,
|
|
664
893
|
sessionId,
|
|
665
894
|
llmClient,
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
895
|
+
ctx: templateCtx,
|
|
896
|
+
...signal ? { signal } : {},
|
|
897
|
+
...onMessage ? { onMessage } : {},
|
|
898
|
+
eventStore,
|
|
899
|
+
windowOptions: currentWindowMessageOptions,
|
|
669
900
|
statsIdentity: options.statsIdentity ?? {
|
|
670
901
|
providerId: "",
|
|
671
902
|
providerName: "",
|
|
672
903
|
backend: "unknown",
|
|
673
904
|
model: llmClient.getModel()
|
|
674
905
|
},
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
break;
|
|
681
|
-
}
|
|
682
|
-
case "shell": {
|
|
683
|
-
const shellStep = step;
|
|
684
|
-
const command = resolveTemplate(shellStep.command, templateCtx);
|
|
685
|
-
const timeout = shellStep.timeout ?? 6e4;
|
|
686
|
-
const successCodes = shellStep.successExitCodes ?? [0];
|
|
687
|
-
const shellMsgId = crypto.randomUUID();
|
|
688
|
-
const runningContent = serverT({ en: "Running: `{{command}}`", fr: "Ex\xE9cution : `{{command}}`" }, { command });
|
|
689
|
-
eventStore.append(
|
|
690
|
-
sessionId,
|
|
691
|
-
createMessageStartEvent(shellMsgId, "user", runningContent, {
|
|
692
|
-
...currentWindowMessageOptions ?? {},
|
|
693
|
-
isSystemGenerated: true,
|
|
694
|
-
messageKind: "auto-prompt",
|
|
695
|
-
metadata: { type: "workflow", name: "Workflow", color: "#f59e0b" }
|
|
696
|
-
})
|
|
697
|
-
);
|
|
698
|
-
if (onMessage) {
|
|
699
|
-
onMessage(
|
|
700
|
-
createChatMessageMessage({
|
|
701
|
-
id: shellMsgId,
|
|
702
|
-
role: "user",
|
|
703
|
-
content: runningContent,
|
|
704
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
705
|
-
isSystemGenerated: true,
|
|
706
|
-
messageKind: "auto-prompt",
|
|
707
|
-
metadata: { type: "workflow", name: "Workflow", color: "#f59e0b" }
|
|
708
|
-
})
|
|
709
|
-
);
|
|
710
|
-
}
|
|
711
|
-
const result = await executeShellCommand(
|
|
712
|
-
command,
|
|
713
|
-
sessionManager.getEffectiveWorkdir(sessionId),
|
|
714
|
-
timeout,
|
|
715
|
-
signal
|
|
906
|
+
agents: allAgents
|
|
907
|
+
};
|
|
908
|
+
const limit = Math.min(
|
|
909
|
+
Math.max(Math.floor(parallelStep.maxConcurrency ?? parallelStep.children.length), 1),
|
|
910
|
+
parallelStep.children.length
|
|
716
911
|
);
|
|
717
|
-
const
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
{
|
|
721
|
-
en: "Exit code: {{code}}\n```\n{{output}}\n```",
|
|
722
|
-
fr: "Code de sortie : {{code}}\n```\n{{output}}\n```"
|
|
723
|
-
},
|
|
724
|
-
{ code: result.exitCode, output: output.slice(0, 1e4) }
|
|
725
|
-
) : serverT({ en: "Exit code: {{code}}", fr: "Code de sortie : {{code}}" }, { code: result.exitCode });
|
|
726
|
-
eventStore.append(sessionId, { type: "message.done", data: { messageId: shellMsgId } });
|
|
727
|
-
const outputMsgId = crypto.randomUUID();
|
|
728
|
-
eventStore.append(
|
|
729
|
-
sessionId,
|
|
730
|
-
createMessageStartEvent(outputMsgId, "user", outputContent, {
|
|
731
|
-
...currentWindowMessageOptions ?? {},
|
|
732
|
-
isSystemGenerated: true,
|
|
733
|
-
messageKind: "correction"
|
|
734
|
-
})
|
|
912
|
+
const outcomes = await mapPool(
|
|
913
|
+
parallelStep.children,
|
|
914
|
+
limit,
|
|
915
|
+
(child) => runChild(child, { ...baseDeps, label: child.id })
|
|
735
916
|
);
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
createChatMessageMessage({
|
|
740
|
-
id: outputMsgId,
|
|
741
|
-
role: "user",
|
|
742
|
-
content: outputContent,
|
|
743
|
-
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
744
|
-
isSystemGenerated: true,
|
|
745
|
-
messageKind: "correction"
|
|
746
|
-
})
|
|
747
|
-
);
|
|
748
|
-
}
|
|
749
|
-
stepOutcome = { result: successCodes.includes(result.exitCode) ? "success" : "failure", output: lastStepOutput };
|
|
917
|
+
const aggregate = aggregateParallel(outcomes);
|
|
918
|
+
lastStepOutput = aggregate.output;
|
|
919
|
+
stepOutcome = { result: aggregate.result, output: lastStepOutput };
|
|
750
920
|
break;
|
|
751
921
|
}
|
|
752
922
|
case "user": {
|
|
@@ -1026,4 +1196,4 @@ export {
|
|
|
1026
1196
|
abortRunnerRun,
|
|
1027
1197
|
launchWorkflowRun
|
|
1028
1198
|
};
|
|
1029
|
-
//# sourceMappingURL=chunk-
|
|
1199
|
+
//# sourceMappingURL=chunk-NELDQCPC.js.map
|
|
@@ -5,18 +5,18 @@ import {
|
|
|
5
5
|
} from "./chunk-ORIPUMOQ.js";
|
|
6
6
|
import {
|
|
7
7
|
launchWorkflowRun
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-NELDQCPC.js";
|
|
9
9
|
import {
|
|
10
10
|
runChatTurn
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-F6QMFCHQ.js";
|
|
12
12
|
import {
|
|
13
13
|
applyDynamicContext,
|
|
14
14
|
computeSessionHash,
|
|
15
15
|
computeUnifiedDiff
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-LNJOQAXT.js";
|
|
17
17
|
import {
|
|
18
18
|
devServerManager
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-EJKAN7HK.js";
|
|
20
20
|
import {
|
|
21
21
|
gitSpawnEnv
|
|
22
22
|
} from "./chunk-J7GAZGZT.js";
|
|
@@ -1358,7 +1358,7 @@ async function handleClientMessage(ws, client, message, _getLLMClient, _getActiv
|
|
|
1358
1358
|
}
|
|
1359
1359
|
const session = sessionManager.requireSession(sessionId);
|
|
1360
1360
|
try {
|
|
1361
|
-
const { buildCachedPrompt, computePreviewToolDiff } = await import("./dynamic-context-
|
|
1361
|
+
const { buildCachedPrompt, computePreviewToolDiff } = await import("./dynamic-context-CM3M2EJC.js");
|
|
1362
1362
|
const allAgents = await import("./registry-24U5BZAJ.js");
|
|
1363
1363
|
const agentDef = allAgents.findAgentById(session.mode, await allAgents.loadAllAgentsDefault()) ?? allAgents.findAgentById("planner", await allAgents.loadAllAgentsDefault());
|
|
1364
1364
|
const modelName = session.providerModel ?? _providerManager?.getCurrentModel();
|
|
@@ -1370,7 +1370,7 @@ async function handleClientMessage(ws, client, message, _getLLMClient, _getActiv
|
|
|
1370
1370
|
const oldCached = sessionManager.getCachedPrompt(sessionId);
|
|
1371
1371
|
const oldPrompt = oldCached?.systemPrompt;
|
|
1372
1372
|
const diff = oldPrompt ? computeUnifiedDiff(oldPrompt, newPrompt) : [];
|
|
1373
|
-
const { getToolRegistryForAgent } = await import("./tools-
|
|
1373
|
+
const { getToolRegistryForAgent } = await import("./tools-NIOESJYT.js");
|
|
1374
1374
|
const unfilteredTools = getToolRegistryForAgent(agentDef).definitions;
|
|
1375
1375
|
const toolDiff = computePreviewToolDiff(oldCached?.tools, unfilteredTools, newTools);
|
|
1376
1376
|
send({
|
|
@@ -1743,4 +1743,4 @@ export {
|
|
|
1743
1743
|
signalMcpReady,
|
|
1744
1744
|
createWebSocketServer
|
|
1745
1745
|
};
|
|
1746
|
-
//# sourceMappingURL=chunk-
|
|
1746
|
+
//# sourceMappingURL=chunk-V4BEYGBJ.js.map
|
package/dist/cli/dev.js
CHANGED
package/dist/cli/index.js
CHANGED
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
injectContextDriftRemindersForSessions,
|
|
17
17
|
renderSystemPromptDiff,
|
|
18
18
|
renderToolChangeReminder
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-LNJOQAXT.js";
|
|
20
20
|
import "./chunk-DJH6LMBT.js";
|
|
21
21
|
import "./chunk-ZONLEX2F.js";
|
|
22
22
|
import "./chunk-5JGRKNMS.js";
|
|
@@ -52,4 +52,4 @@ export {
|
|
|
52
52
|
renderSystemPromptDiff,
|
|
53
53
|
renderToolChangeReminder
|
|
54
54
|
};
|
|
55
|
-
//# sourceMappingURL=dynamic-context-
|
|
55
|
+
//# sourceMappingURL=dynamic-context-CM3M2EJC.js.map
|
|
@@ -11,7 +11,7 @@ import "./chunk-OSXPQSLW.js";
|
|
|
11
11
|
import "./chunk-LCLH6ZUL.js";
|
|
12
12
|
import {
|
|
13
13
|
VERSION
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-DKHY5UNR.js";
|
|
15
15
|
import {
|
|
16
16
|
getProject
|
|
17
17
|
} from "./chunk-JYYBSODN.js";
|
|
@@ -136,4 +136,4 @@ export {
|
|
|
136
136
|
buildSessionExport,
|
|
137
137
|
parseSessionExport
|
|
138
138
|
};
|
|
139
|
-
//# sourceMappingURL=export-import-
|
|
139
|
+
//# sourceMappingURL=export-import-UITAIBU5.js.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
abortRunnerRun,
|
|
3
3
|
launchWorkflowRun
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
7
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-NELDQCPC.js";
|
|
5
|
+
import "./chunk-F6QMFCHQ.js";
|
|
6
|
+
import "./chunk-LNJOQAXT.js";
|
|
7
|
+
import "./chunk-EJKAN7HK.js";
|
|
8
8
|
import "./chunk-OAN4BXEW.js";
|
|
9
9
|
import "./chunk-DJH6LMBT.js";
|
|
10
10
|
import "./chunk-PHR64A6U.js";
|
|
@@ -56,4 +56,4 @@ export {
|
|
|
56
56
|
abortRunnerRun,
|
|
57
57
|
launchWorkflowRun
|
|
58
58
|
};
|
|
59
|
-
//# sourceMappingURL=launch-
|
|
59
|
+
//# sourceMappingURL=launch-E6SDDTHE.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runAgentTurn,
|
|
3
3
|
runChatTurn
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-F6QMFCHQ.js";
|
|
5
|
+
import "./chunk-LNJOQAXT.js";
|
|
6
|
+
import "./chunk-EJKAN7HK.js";
|
|
7
7
|
import "./chunk-OAN4BXEW.js";
|
|
8
8
|
import "./chunk-DJH6LMBT.js";
|
|
9
9
|
import "./chunk-PHR64A6U.js";
|
|
@@ -67,4 +67,4 @@ export {
|
|
|
67
67
|
runAgentTurn,
|
|
68
68
|
runChatTurn
|
|
69
69
|
};
|
|
70
|
-
//# sourceMappingURL=orchestrator-
|
|
70
|
+
//# sourceMappingURL=orchestrator-MVQIPITF.js.map
|
package/dist/package.json
CHANGED
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
finalizeTurnCompletion,
|
|
4
4
|
generateSessionNameForSession
|
|
5
5
|
} from "./chunk-ORIPUMOQ.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-EJKAN7HK.js";
|
|
7
7
|
import "./chunk-OAN4BXEW.js";
|
|
8
8
|
import "./chunk-DJH6LMBT.js";
|
|
9
9
|
import "./chunk-PHR64A6U.js";
|
|
@@ -229,7 +229,7 @@ var QueueProcessor = class {
|
|
|
229
229
|
model: sessionClient.getModel(),
|
|
230
230
|
...sessionEffort ? { reasoningEffort: sessionEffort } : {}
|
|
231
231
|
};
|
|
232
|
-
const { runChatTurn } = await import("./orchestrator-
|
|
232
|
+
const { runChatTurn } = await import("./orchestrator-MVQIPITF.js");
|
|
233
233
|
const runChatTurnParams = buildRunChatTurnParams({
|
|
234
234
|
sessionManager,
|
|
235
235
|
sessionId,
|
|
@@ -278,4 +278,4 @@ var QueueProcessor = class {
|
|
|
278
278
|
export {
|
|
279
279
|
QueueProcessor
|
|
280
280
|
};
|
|
281
|
-
//# sourceMappingURL=processor-
|
|
281
|
+
//# sourceMappingURL=processor-UTBTJVV5.js.map
|