baro-ai 0.33.0 → 0.34.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/dist/cli.mjs +19 -12
- package/dist/cli.mjs.map +1 -1
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -8169,7 +8169,7 @@ var ClaudeSystemItem = class extends BusEvent {
|
|
|
8169
8169
|
};
|
|
8170
8170
|
}
|
|
8171
8171
|
};
|
|
8172
|
-
var
|
|
8172
|
+
var AgentResultItem = class extends BusEvent {
|
|
8173
8173
|
constructor(agentId, subtype, sessionId, isError, resultText, usage, totalCostUsd, numTurns, durationMs, raw) {
|
|
8174
8174
|
super();
|
|
8175
8175
|
this.agentId = agentId;
|
|
@@ -8662,7 +8662,7 @@ function mapClaudeEvent(agentId, event) {
|
|
|
8662
8662
|
}
|
|
8663
8663
|
case "result": {
|
|
8664
8664
|
items.push(
|
|
8665
|
-
new
|
|
8665
|
+
new AgentResultItem(
|
|
8666
8666
|
agentId,
|
|
8667
8667
|
typeof event.subtype === "string" ? event.subtype : "unknown",
|
|
8668
8668
|
sessionId,
|
|
@@ -8904,7 +8904,7 @@ var ClaudeCliParticipant = class _ClaudeCliParticipant extends BaroParticipant {
|
|
|
8904
8904
|
this.transition("running", "claude init received");
|
|
8905
8905
|
this.resolveReady();
|
|
8906
8906
|
}
|
|
8907
|
-
if (item instanceof
|
|
8907
|
+
if (item instanceof AgentResultItem) {
|
|
8908
8908
|
this.lastResult = item;
|
|
8909
8909
|
this.transition(item.isError ? "failed" : "done", `result:${item.subtype}`);
|
|
8910
8910
|
}
|
|
@@ -9038,7 +9038,7 @@ var StoryAgent = class extends BaroParticipant {
|
|
|
9038
9038
|
if (event instanceof AgentTargetedMessageItem && event.recipientId === this.spec.id) {
|
|
9039
9039
|
this.notifyStoryMessage?.();
|
|
9040
9040
|
}
|
|
9041
|
-
if (event instanceof
|
|
9041
|
+
if (event instanceof AgentResultItem && event.agentId === this.spec.id) {
|
|
9042
9042
|
this.notifyStoryResult?.();
|
|
9043
9043
|
}
|
|
9044
9044
|
}
|
|
@@ -9734,7 +9734,7 @@ var Critic = class extends BaroParticipant {
|
|
|
9734
9734
|
await Promise.allSettled([...this.pending]);
|
|
9735
9735
|
}
|
|
9736
9736
|
async onExternalBusEvent(_source, event) {
|
|
9737
|
-
if (!(event instanceof
|
|
9737
|
+
if (!(event instanceof AgentResultItem)) return;
|
|
9738
9738
|
if (event.isError || !event.resultText) return;
|
|
9739
9739
|
const criteria = this.opts.targets.get(event.agentId);
|
|
9740
9740
|
if (!criteria || criteria.length === 0) return;
|
|
@@ -9914,7 +9914,7 @@ var CriticOpenAI = class extends BaroParticipant {
|
|
|
9914
9914
|
await Promise.allSettled([...this.pending]);
|
|
9915
9915
|
}
|
|
9916
9916
|
async onExternalBusEvent(_source, event) {
|
|
9917
|
-
if (!(event instanceof
|
|
9917
|
+
if (!(event instanceof AgentResultItem)) return;
|
|
9918
9918
|
if (event.isError || !event.resultText) return;
|
|
9919
9919
|
const criteria = this.opts.targets.get(event.agentId);
|
|
9920
9920
|
if (!criteria || criteria.length === 0) return;
|
|
@@ -11383,7 +11383,7 @@ var OpenAIStoryAgent = class extends BaroParticipant {
|
|
|
11383
11383
|
context = turnResult.context;
|
|
11384
11384
|
this.envRef?.deliverBusEvent(
|
|
11385
11385
|
this,
|
|
11386
|
-
new
|
|
11386
|
+
new AgentResultItem(
|
|
11387
11387
|
this.spec.id,
|
|
11388
11388
|
turnResult.success ? "success" : "error",
|
|
11389
11389
|
null,
|
|
@@ -11591,6 +11591,8 @@ var StoryFactory = class extends BaroParticipant {
|
|
|
11591
11591
|
if (!this.envRef) return;
|
|
11592
11592
|
if (this.active.has(req.storyId)) return;
|
|
11593
11593
|
const llm = this.opts.llm ?? "claude";
|
|
11594
|
+
const claudeModel = this.opts.storyModelOverride ?? req.model;
|
|
11595
|
+
const openaiModel = this.opts.storyModelOverride ?? this.opts.openaiModel ?? "gpt-5.5";
|
|
11594
11596
|
const agent = llm === "openai" ? new OpenAIStoryAgent(
|
|
11595
11597
|
{
|
|
11596
11598
|
id: req.storyId,
|
|
@@ -11600,12 +11602,12 @@ var StoryFactory = class extends BaroParticipant {
|
|
|
11600
11602
|
retries: req.retries,
|
|
11601
11603
|
timeoutSecs: req.timeoutSecs
|
|
11602
11604
|
},
|
|
11603
|
-
{ model:
|
|
11605
|
+
{ model: openaiModel }
|
|
11604
11606
|
) : new StoryAgent({
|
|
11605
11607
|
id: req.storyId,
|
|
11606
11608
|
prompt: req.prompt,
|
|
11607
11609
|
cwd: this.opts.cwd,
|
|
11608
|
-
model:
|
|
11610
|
+
model: claudeModel,
|
|
11609
11611
|
retries: req.retries,
|
|
11610
11612
|
timeoutSecs: req.timeoutSecs
|
|
11611
11613
|
});
|
|
@@ -12082,7 +12084,8 @@ async function orchestrate(config) {
|
|
|
12082
12084
|
const storyFactory = new StoryFactory({
|
|
12083
12085
|
cwd: config.cwd,
|
|
12084
12086
|
llm,
|
|
12085
|
-
openaiModel: "gpt-5.5"
|
|
12087
|
+
openaiModel: config.storyModel ?? "gpt-5.5",
|
|
12088
|
+
storyModelOverride: config.storyModel
|
|
12086
12089
|
});
|
|
12087
12090
|
storyFactory.setEnvironment(env);
|
|
12088
12091
|
storyFactory.join(env);
|
|
@@ -12160,7 +12163,7 @@ var BaroEventForwarder = class extends BaroParticipant {
|
|
|
12160
12163
|
this.handleStoryResult(event);
|
|
12161
12164
|
return;
|
|
12162
12165
|
}
|
|
12163
|
-
if (event instanceof
|
|
12166
|
+
if (event instanceof AgentResultItem) {
|
|
12164
12167
|
this.handleClaudeResult(event);
|
|
12165
12168
|
return;
|
|
12166
12169
|
}
|
|
@@ -12375,6 +12378,9 @@ function parseArgs(argv) {
|
|
|
12375
12378
|
10
|
|
12376
12379
|
);
|
|
12377
12380
|
break;
|
|
12381
|
+
case "--story-model":
|
|
12382
|
+
args.storyModel = required(argv, ++i, "--story-model");
|
|
12383
|
+
break;
|
|
12378
12384
|
case "--llm": {
|
|
12379
12385
|
const v = required(argv, ++i, "--llm");
|
|
12380
12386
|
if (v !== "claude" && v !== "openai") {
|
|
@@ -12463,7 +12469,8 @@ async function main() {
|
|
|
12463
12469
|
surgeonUseLlm: args.surgeonUseLlm,
|
|
12464
12470
|
surgeonModel: args.surgeonModel,
|
|
12465
12471
|
intraLevelDelaySecs: args.intraLevelDelaySecs,
|
|
12466
|
-
llm: args.llm
|
|
12472
|
+
llm: args.llm,
|
|
12473
|
+
storyModel: args.storyModel
|
|
12467
12474
|
};
|
|
12468
12475
|
if (args.llm === "openai" && !process.env.OPENAI_API_KEY) {
|
|
12469
12476
|
process.stderr.write(
|