blun-king-cli 9.1.197 → 9.1.198
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/blun.mjs +7 -4
- package/package.json +1 -1
package/blun.mjs
CHANGED
|
@@ -260297,7 +260297,7 @@ async function budgetToolResultForModel(options) {
|
|
|
260297
260297
|
return persistToolResultForModel(options, text);
|
|
260298
260298
|
}
|
|
260299
260299
|
function reusableReadSourcePath(options) {
|
|
260300
|
-
if (options.toolName !== "Read" || options.result.isError === true
|
|
260300
|
+
if (options.toolName !== "Read" || options.result.isError === true) return;
|
|
260301
260301
|
const path = options.toolArgs?.path;
|
|
260302
260302
|
if (typeof path !== "string" || path.trim().length === 0) return;
|
|
260303
260303
|
return path;
|
|
@@ -260319,7 +260319,6 @@ function referenceReadSourceForModel(options, text, outputPath) {
|
|
|
260319
260319
|
async function persistToolResultForModel(options, knownText) {
|
|
260320
260320
|
const text = knownText ?? persistableToolResultText(options.result.output);
|
|
260321
260321
|
if (text === void 0) return options.result;
|
|
260322
|
-
if (options.result.truncated === true) return options.result;
|
|
260323
260322
|
if (options.homedir === void 0) return options.result;
|
|
260324
260323
|
const outputPath = await saveToolResult({
|
|
260325
260324
|
homedir: options.homedir,
|
|
@@ -260332,7 +260331,7 @@ async function persistToolResultForModel(options, knownText) {
|
|
|
260332
260331
|
text,
|
|
260333
260332
|
previewChars: TOOL_RESULT_PREVIEW_CHARS
|
|
260334
260333
|
}));
|
|
260335
|
-
const output = renderPersistedToolResult(options.toolName, options.toolCallId, text, outputPath);
|
|
260334
|
+
const output = renderPersistedToolResult(options.toolName, options.toolCallId, text, outputPath, options.result.truncated === true);
|
|
260336
260335
|
return options.result.isError === true ? {
|
|
260337
260336
|
...options.result,
|
|
260338
260337
|
output,
|
|
@@ -260365,10 +260364,14 @@ async function saveToolResult(options, text) {
|
|
|
260365
260364
|
return;
|
|
260366
260365
|
}
|
|
260367
260366
|
}
|
|
260368
|
-
function renderPersistedToolResult(toolName, toolCallId, text, outputPath) {
|
|
260367
|
+
function renderPersistedToolResult(toolName, toolCallId, text, outputPath, toolTruncated = false) {
|
|
260369
260368
|
const lines = [
|
|
260370
260369
|
TOOL_RESULT_OFFLOAD_MARKER,
|
|
260371
260370
|
`Tool output exceeded ${String(TOOL_RESULT_MAX_CHARS)} characters; showing a preview only.`,
|
|
260371
|
+
...(toolTruncated ? [
|
|
260372
|
+
"The tool had already truncated its raw output; the complete returned result was stored.",
|
|
260373
|
+
"stored_result_scope: tool_truncated_output"
|
|
260374
|
+
] : []),
|
|
260372
260375
|
`tool_name: ${toolName}`,
|
|
260373
260376
|
`tool_call_id: ${toolCallId}`,
|
|
260374
260377
|
`output_size_chars: ${String(text.length)}`,
|