@lesscap/baton-cli 0.7.4 → 0.7.5
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/baton.mjs +12 -9
- package/package.json +3 -3
package/dist/baton.mjs
CHANGED
|
@@ -5376,6 +5376,17 @@ var labelAttachments = (attachments) => {
|
|
|
5376
5376
|
var isMessageFor = (msg, name) => !msg.to || msg.to.length === 0 || msg.to.includes(name);
|
|
5377
5377
|
|
|
5378
5378
|
// ../shared/src/domain/session-event.ts
|
|
5379
|
+
var agentMessageText = (payload) => {
|
|
5380
|
+
if (typeof payload !== "object" || payload === null) return null;
|
|
5381
|
+
const event = payload;
|
|
5382
|
+
if (!["item.started", "item.updated", "item.completed"].includes(String(event.type))) return null;
|
|
5383
|
+
const item = event.item;
|
|
5384
|
+
if (typeof item !== "object" || item === null) return null;
|
|
5385
|
+
const { type, id, text } = item;
|
|
5386
|
+
if (type !== "agent_message" || typeof id !== "string" || typeof text !== "string") return null;
|
|
5387
|
+
const trimmed = text.trim();
|
|
5388
|
+
return trimmed ? { id, text: trimmed } : null;
|
|
5389
|
+
};
|
|
5379
5390
|
var startedMessageIds = (events) => {
|
|
5380
5391
|
const ids = /* @__PURE__ */ new Set();
|
|
5381
5392
|
for (const e of events) {
|
|
@@ -6494,14 +6505,6 @@ var parseFirstExchange = (content) => {
|
|
|
6494
6505
|
}
|
|
6495
6506
|
return userText || assistantText ? { userText, assistantText } : null;
|
|
6496
6507
|
};
|
|
6497
|
-
var canonicalAgentMessage = (payload) => {
|
|
6498
|
-
if (!isRecord(payload) || !["item.started", "item.updated", "item.completed"].includes(String(payload.type)))
|
|
6499
|
-
return null;
|
|
6500
|
-
const item = payload.item;
|
|
6501
|
-
if (!isRecord(item) || item.type !== "agent_message" || typeof item.id !== "string") return null;
|
|
6502
|
-
const text = textOf(item);
|
|
6503
|
-
return text ? { id: item.id, text } : null;
|
|
6504
|
-
};
|
|
6505
6508
|
var parseFirstExchangeFromEvents = (events) => {
|
|
6506
6509
|
let userText = "";
|
|
6507
6510
|
const itemOrder = [];
|
|
@@ -6514,7 +6517,7 @@ var parseFirstExchangeFromEvents = (events) => {
|
|
|
6514
6517
|
}
|
|
6515
6518
|
if (!userText) continue;
|
|
6516
6519
|
if (event.type === "turn_complete" || event.type === "turn_error") break;
|
|
6517
|
-
const agent = event.type === "agent_event" ?
|
|
6520
|
+
const agent = event.type === "agent_event" ? agentMessageText(event.payload) : null;
|
|
6518
6521
|
if (agent) {
|
|
6519
6522
|
if (!agentText.has(agent.id)) itemOrder.push(agent.id);
|
|
6520
6523
|
agentText.set(agent.id, agent.text);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lesscap/baton-cli",
|
|
3
|
-
"version": "0.7.
|
|
3
|
+
"version": "0.7.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"@baton/shared": "0.0.0"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@anthropic-ai/claude-agent-sdk": "^0.3.
|
|
29
|
-
"@openai/codex-sdk": "^0.
|
|
28
|
+
"@anthropic-ai/claude-agent-sdk": "^0.3.220",
|
|
29
|
+
"@openai/codex-sdk": "^0.146.0",
|
|
30
30
|
"node-pty": "^1.1.0",
|
|
31
31
|
"ws": "^8.21.0"
|
|
32
32
|
},
|