apiblaze 0.19.25 → 0.19.26
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/index.js +9 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -932,7 +932,7 @@ var import_commander = require("commander");
|
|
|
932
932
|
var import_chalk44 = __toESM(require("chalk"));
|
|
933
933
|
|
|
934
934
|
// package.json
|
|
935
|
-
var version = "0.19.
|
|
935
|
+
var version = "0.19.26";
|
|
936
936
|
|
|
937
937
|
// src/index.ts
|
|
938
938
|
init_types();
|
|
@@ -6343,9 +6343,10 @@ function renderToolEvents(events, cred) {
|
|
|
6343
6343
|
}
|
|
6344
6344
|
}
|
|
6345
6345
|
}
|
|
6346
|
-
function
|
|
6347
|
-
const
|
|
6348
|
-
if (
|
|
6346
|
+
function renderToolResults(delta, events) {
|
|
6347
|
+
const anyFailed = (events ?? []).some((e) => e.status === "error");
|
|
6348
|
+
if (!anyFailed && !isVerbose()) return;
|
|
6349
|
+
const cap = anyFailed ? 24 : 12;
|
|
6349
6350
|
for (const m of delta ?? []) {
|
|
6350
6351
|
if (!m || m.role !== "tool" || typeof m.content !== "string") continue;
|
|
6351
6352
|
const body = m.content.trim();
|
|
@@ -6357,10 +6358,12 @@ function renderFailedToolResults(delta, events) {
|
|
|
6357
6358
|
return body;
|
|
6358
6359
|
}
|
|
6359
6360
|
})();
|
|
6361
|
+
const lines = pretty.split("\n");
|
|
6360
6362
|
console.log(import_chalk39.default.dim(" response:"));
|
|
6361
|
-
for (const line of
|
|
6363
|
+
for (const line of lines.slice(0, cap)) {
|
|
6362
6364
|
console.log(import_chalk39.default.dim(` ${line}`));
|
|
6363
6365
|
}
|
|
6366
|
+
if (lines.length > cap) console.log(import_chalk39.default.dim(` \u2026${lines.length - cap} more lines`));
|
|
6364
6367
|
}
|
|
6365
6368
|
}
|
|
6366
6369
|
function billingLine(billing) {
|
|
@@ -6458,7 +6461,7 @@ async function replTurn(p, messages, userText) {
|
|
|
6458
6461
|
return t ? { header: "Authorization", value: `Bearer ${t}` } : void 0;
|
|
6459
6462
|
})() : p.dpKey ? { header: "X-API-Key", value: p.dpKey } : void 0
|
|
6460
6463
|
);
|
|
6461
|
-
|
|
6464
|
+
renderToolResults(data.delta, data.tool_events);
|
|
6462
6465
|
for (const m of data.delta) messages.push(m);
|
|
6463
6466
|
printAssistant(data.delta);
|
|
6464
6467
|
}
|