baro-ai 0.42.1 → 0.42.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/cli.mjs +45 -4
- package/dist/cli.mjs.map +1 -1
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -11932,7 +11932,7 @@ var CodexCliParticipant = class _CodexCliParticipant extends BaseObserver {
|
|
|
11932
11932
|
this.agentId = agentId;
|
|
11933
11933
|
this.options = {
|
|
11934
11934
|
codexBin: "codex",
|
|
11935
|
-
|
|
11935
|
+
bypassSandbox: false,
|
|
11936
11936
|
skipGitRepoCheck: false,
|
|
11937
11937
|
...opts
|
|
11938
11938
|
};
|
|
@@ -12048,7 +12048,9 @@ var CodexCliParticipant = class _CodexCliParticipant extends BaseObserver {
|
|
|
12048
12048
|
buildArgs() {
|
|
12049
12049
|
const args = ["exec", "--json"];
|
|
12050
12050
|
if (this.options.skipGitRepoCheck) args.push("--skip-git-repo-check");
|
|
12051
|
-
if (this.options.
|
|
12051
|
+
if (this.options.bypassSandbox) {
|
|
12052
|
+
args.push("--dangerously-bypass-approvals-and-sandbox");
|
|
12053
|
+
}
|
|
12052
12054
|
if (this.options.model) args.push("--model", this.options.model);
|
|
12053
12055
|
if (this.options.extraArgs?.length) args.push(...this.options.extraArgs);
|
|
12054
12056
|
args.push(this.options.prompt);
|
|
@@ -12153,7 +12155,7 @@ var CodexStoryAgent = class extends BaseObserver {
|
|
|
12153
12155
|
timeoutSecs: 600,
|
|
12154
12156
|
retryDelayMs: 1500,
|
|
12155
12157
|
hardTimeoutSecs: 0,
|
|
12156
|
-
|
|
12158
|
+
bypassSandbox: true,
|
|
12157
12159
|
skipGitRepoCheck: false,
|
|
12158
12160
|
...spec
|
|
12159
12161
|
};
|
|
@@ -12275,7 +12277,7 @@ var CodexStoryAgent = class extends BaseObserver {
|
|
|
12275
12277
|
cwd: this.spec.cwd,
|
|
12276
12278
|
prompt: this.spec.prompt,
|
|
12277
12279
|
model: this.spec.model,
|
|
12278
|
-
|
|
12280
|
+
bypassSandbox: this.spec.bypassSandbox,
|
|
12279
12281
|
skipGitRepoCheck: this.spec.skipGitRepoCheck
|
|
12280
12282
|
});
|
|
12281
12283
|
this.currentCodex = codex;
|
|
@@ -14397,6 +14399,10 @@ var BaroEventForwarder = class extends BaseObserver {
|
|
|
14397
14399
|
this.handleClaudeResult(event.data);
|
|
14398
14400
|
return;
|
|
14399
14401
|
}
|
|
14402
|
+
if (CodexTurnEvent.is(event)) {
|
|
14403
|
+
this.handleCodexTurnEvent(event.data);
|
|
14404
|
+
return;
|
|
14405
|
+
}
|
|
14400
14406
|
if (AgentState.is(event)) {
|
|
14401
14407
|
this.handleAgentState(event.data);
|
|
14402
14408
|
return;
|
|
@@ -14481,6 +14487,41 @@ var BaroEventForwarder = class extends BaseObserver {
|
|
|
14481
14487
|
output_tokens: outputTokens
|
|
14482
14488
|
});
|
|
14483
14489
|
}
|
|
14490
|
+
/**
|
|
14491
|
+
* Codex emits its usage stats inside `turn.completed` envelopes
|
|
14492
|
+
* (shape: `{type:"turn.completed", usage:{input_tokens,
|
|
14493
|
+
* cached_input_tokens, output_tokens, reasoning_output_tokens}}`).
|
|
14494
|
+
* Translate to the same `token_usage` BaroEvent shape Claude uses
|
|
14495
|
+
* so the TUI's existing counter works without backend-specific
|
|
14496
|
+
* branching. `cached_input_tokens` is rolled into `input_tokens`
|
|
14497
|
+
* (Codex reports both — Claude only reports the combined total —
|
|
14498
|
+
* so we surface the same number here for parity). Reasoning
|
|
14499
|
+
* tokens are billed as output tokens by OpenAI so we lump them
|
|
14500
|
+
* with output_tokens.
|
|
14501
|
+
*/
|
|
14502
|
+
handleCodexTurnEvent(item) {
|
|
14503
|
+
if (item.phase !== "completed") return;
|
|
14504
|
+
const raw = item.raw;
|
|
14505
|
+
const usage = raw.usage;
|
|
14506
|
+
if (!usage) return;
|
|
14507
|
+
const inputTokens = typeof usage.input_tokens === "number" ? usage.input_tokens : 0;
|
|
14508
|
+
const outputBase = typeof usage.output_tokens === "number" ? usage.output_tokens : 0;
|
|
14509
|
+
const reasoning = typeof usage.reasoning_output_tokens === "number" ? usage.reasoning_output_tokens : 0;
|
|
14510
|
+
const outputTokens = outputBase + reasoning;
|
|
14511
|
+
const tally = this.tokensByStory.get(item.agentId) ?? {
|
|
14512
|
+
input: 0,
|
|
14513
|
+
output: 0
|
|
14514
|
+
};
|
|
14515
|
+
tally.input += inputTokens;
|
|
14516
|
+
tally.output += outputTokens;
|
|
14517
|
+
this.tokensByStory.set(item.agentId, tally);
|
|
14518
|
+
emit({
|
|
14519
|
+
type: "token_usage",
|
|
14520
|
+
id: item.agentId,
|
|
14521
|
+
input_tokens: inputTokens,
|
|
14522
|
+
output_tokens: outputTokens
|
|
14523
|
+
});
|
|
14524
|
+
}
|
|
14484
14525
|
handleAgentState(item) {
|
|
14485
14526
|
if (item.phase === "running" && !this.startedStories.has(item.agentId)) {
|
|
14486
14527
|
this.startedStories.add(item.agentId);
|