blun-king-cli 9.1.232 → 9.1.234
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/bin/tool-result-offload-policy.cjs +99 -0
- package/bin/write-continuation-policy.cjs +35 -0
- package/blun.mjs +23 -10
- package/package.json +1 -1
|
@@ -13,6 +13,7 @@ const TOOL_RESULT_HISTORICAL_MIN_ITEM_CHARS = 600;
|
|
|
13
13
|
const TOOL_RESULT_HISTORICAL_REPLACEMENT_BUDGET_CHARS = 600;
|
|
14
14
|
const TOOL_RESULT_SUCCESS_KEEP_RECENT_MESSAGES = 12;
|
|
15
15
|
const TOOL_RESULT_HISTORICAL_SUCCESS_MARKER = '[Old tool result content cleared]';
|
|
16
|
+
const TOOL_RESULT_REPEAT_MARKER = '[Repeated tool result omitted]';
|
|
16
17
|
|
|
17
18
|
function shouldOffloadToolResult(textLength) {
|
|
18
19
|
return Number.isFinite(textLength) && textLength > TOOL_RESULT_MAX_CHARS;
|
|
@@ -102,6 +103,102 @@ function compactHistoricalSuccessfulToolResults(messages) {
|
|
|
102
103
|
return changed ? projected : messages;
|
|
103
104
|
}
|
|
104
105
|
|
|
106
|
+
function toolCallSignaturesById(messages) {
|
|
107
|
+
const signatures = new Map();
|
|
108
|
+
|
|
109
|
+
for (const message of messages) {
|
|
110
|
+
if (!Array.isArray(message?.toolCalls)) continue;
|
|
111
|
+
for (const call of message.toolCalls) {
|
|
112
|
+
const id = call?.id ?? call?.toolCallId;
|
|
113
|
+
if (typeof id !== 'string' || typeof call?.name !== 'string') continue;
|
|
114
|
+
const args = typeof call.arguments === 'string'
|
|
115
|
+
? call.arguments
|
|
116
|
+
: JSON.stringify(call.arguments ?? null);
|
|
117
|
+
signatures.set(id, `${call.name}\n${args}`);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
return signatures;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function repeatedToolResultReference(newestToolCallId) {
|
|
125
|
+
return [
|
|
126
|
+
TOOL_RESULT_REPEAT_MARKER,
|
|
127
|
+
`same_as_tool_call_id: ${newestToolCallId}`,
|
|
128
|
+
'reason: identical successful result for the same tool call arguments',
|
|
129
|
+
].join('\n');
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
function dedupeRepeatedSuccessfulToolResults(sourceMessages, projectedMessages = sourceMessages) {
|
|
133
|
+
if (
|
|
134
|
+
!Array.isArray(sourceMessages)
|
|
135
|
+
|| !Array.isArray(projectedMessages)
|
|
136
|
+
|| sourceMessages.length === 0
|
|
137
|
+
|| sourceMessages.length !== projectedMessages.length
|
|
138
|
+
) return projectedMessages;
|
|
139
|
+
|
|
140
|
+
const callSignatures = toolCallSignaturesById(sourceMessages);
|
|
141
|
+
const seenResultsByCall = new Map();
|
|
142
|
+
let changed = false;
|
|
143
|
+
const projected = projectedMessages.slice();
|
|
144
|
+
|
|
145
|
+
for (let index = sourceMessages.length - 1; index >= 0; index -= 1) {
|
|
146
|
+
const message = sourceMessages[index];
|
|
147
|
+
const toolCallId = message?.toolCallId;
|
|
148
|
+
if (
|
|
149
|
+
message?.role !== 'tool'
|
|
150
|
+
|| message.isError === true
|
|
151
|
+
|| typeof toolCallId !== 'string'
|
|
152
|
+
|| !Array.isArray(message.content)
|
|
153
|
+
|| message.content.length === 0
|
|
154
|
+
|| isPersistedToolResultReference(message.content)
|
|
155
|
+
|| !message.content.every((part) => part?.type === 'text' && typeof part.text === 'string')
|
|
156
|
+
) continue;
|
|
157
|
+
|
|
158
|
+
const callSignature = callSignatures.get(toolCallId);
|
|
159
|
+
if (callSignature === undefined) continue;
|
|
160
|
+
const resultShape = message.content.length;
|
|
161
|
+
const resultSignature = resultShape === 1
|
|
162
|
+
? message.content[0].text
|
|
163
|
+
: JSON.stringify(message.content.map((part) => part.text));
|
|
164
|
+
let seenResults = seenResultsByCall.get(callSignature);
|
|
165
|
+
if (seenResults === undefined) {
|
|
166
|
+
seenResults = new Map();
|
|
167
|
+
seenResultsByCall.set(callSignature, seenResults);
|
|
168
|
+
}
|
|
169
|
+
let seenResultsForShape = seenResults.get(resultShape);
|
|
170
|
+
if (seenResultsForShape === undefined) {
|
|
171
|
+
seenResultsForShape = new Map();
|
|
172
|
+
seenResults.set(resultShape, seenResultsForShape);
|
|
173
|
+
}
|
|
174
|
+
const newest = seenResultsForShape.get(resultSignature);
|
|
175
|
+
if (newest === undefined) {
|
|
176
|
+
seenResultsForShape.set(resultSignature, { toolCallId, index });
|
|
177
|
+
continue;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
const reference = repeatedToolResultReference(newest.toolCallId);
|
|
181
|
+
const textChars = message.content.reduce((total, part) => total + part.text.length, 0);
|
|
182
|
+
const projectedMessage = projected[index];
|
|
183
|
+
if (
|
|
184
|
+
reference.length >= textChars
|
|
185
|
+
|| projectedMessage?.role !== 'tool'
|
|
186
|
+
|| projectedMessage.toolCallId !== toolCallId
|
|
187
|
+
) continue;
|
|
188
|
+
projected[index] = {
|
|
189
|
+
...projectedMessage,
|
|
190
|
+
content: [{ type: 'text', text: reference }],
|
|
191
|
+
};
|
|
192
|
+
projected[newest.index] = {
|
|
193
|
+
...projected[newest.index],
|
|
194
|
+
content: sourceMessages[newest.index].content,
|
|
195
|
+
};
|
|
196
|
+
changed = true;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
return changed ? projected : projectedMessages;
|
|
200
|
+
}
|
|
201
|
+
|
|
105
202
|
function selectToolResultBatchOffloads(textLengths) {
|
|
106
203
|
if (!Array.isArray(textLengths) || textLengths.length < 2) return [];
|
|
107
204
|
|
|
@@ -170,6 +267,7 @@ module.exports = {
|
|
|
170
267
|
TOOL_RESULT_HISTORICAL_MIN_ITEM_CHARS,
|
|
171
268
|
TOOL_RESULT_HISTORICAL_REPLACEMENT_BUDGET_CHARS,
|
|
172
269
|
TOOL_RESULT_HISTORICAL_SUCCESS_MARKER,
|
|
270
|
+
TOOL_RESULT_REPEAT_MARKER,
|
|
173
271
|
TOOL_RESULT_MAX_CHARS,
|
|
174
272
|
TOOL_RESULT_PREVIEW_CHARS,
|
|
175
273
|
TOOL_RESULT_RECOVERY_PAGE_LINES,
|
|
@@ -178,6 +276,7 @@ module.exports = {
|
|
|
178
276
|
compactHistoricalSuccessfulToolResults,
|
|
179
277
|
compactPersistedToolResultReference,
|
|
180
278
|
createToolResultPreview,
|
|
279
|
+
dedupeRepeatedSuccessfulToolResults,
|
|
181
280
|
isPersistedToolResultReference,
|
|
182
281
|
selectHistoricalToolResultOffloads,
|
|
183
282
|
selectToolResultBatchOffloads,
|
|
@@ -15,6 +15,41 @@ function resolveWriteContinuationContract({ continuation, current, mode }) {
|
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
17
|
|
|
18
|
+
function resolvePlainWriteContract({
|
|
19
|
+
contentBytes,
|
|
20
|
+
maxContinuationChunkBytes,
|
|
21
|
+
continuationRequired = false,
|
|
22
|
+
}) {
|
|
23
|
+
if (!Number.isSafeInteger(contentBytes) || contentBytes < 0) {
|
|
24
|
+
throw new TypeError('contentBytes must be a non-negative safe integer');
|
|
25
|
+
}
|
|
26
|
+
if (!Number.isSafeInteger(maxContinuationChunkBytes) || maxContinuationChunkBytes < 1) {
|
|
27
|
+
throw new TypeError('maxContinuationChunkBytes must be a positive safe integer');
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const directWriteLimit = Math.max(4_096, maxContinuationChunkBytes);
|
|
31
|
+
if (continuationRequired) {
|
|
32
|
+
return {
|
|
33
|
+
allowed: false,
|
|
34
|
+
directWriteLimit,
|
|
35
|
+
reason: 'continuation_required',
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
if (contentBytes > directWriteLimit) {
|
|
39
|
+
return {
|
|
40
|
+
allowed: false,
|
|
41
|
+
directWriteLimit,
|
|
42
|
+
reason: 'too_large',
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
return {
|
|
46
|
+
allowed: true,
|
|
47
|
+
directWriteLimit,
|
|
48
|
+
reason: 'direct',
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
18
52
|
module.exports = {
|
|
53
|
+
resolvePlainWriteContract,
|
|
19
54
|
resolveWriteContinuationContract,
|
|
20
55
|
};
|
package/blun.mjs
CHANGED
|
@@ -79000,7 +79000,7 @@ var init_context$2 = __esmMin((() => {
|
|
|
79000
79000
|
const historicalTelegramProjected = projectHistoricalUnaddressedTelegramMessages(duplicateUserMessagesProjected);
|
|
79001
79001
|
const assistantOffloaded = this.agent.assistantMessageOffload.compact(historicalTelegramProjected);
|
|
79002
79002
|
const repeatedAssistantProjected = projectRepeatedAssistantResponses(assistantOffloaded);
|
|
79003
|
-
const result = project(this.agent.microCompaction.compact(compactHistoricalSuccessfulToolResults(this.agent.toolResultBatchOffload.compact(dedupeRecurringCronWakeups(dedupeRepeatedInjections(compactHistoricalSkillActivations(compactBaselineSkillInjections(repeatedAssistantProjected))))))), {
|
|
79003
|
+
const result = project(this.agent.microCompaction.compact(compactHistoricalSuccessfulToolResults(dedupeRepeatedSuccessfulToolResults(repeatedAssistantProjected, this.agent.toolResultBatchOffload.compact(dedupeRecurringCronWakeups(dedupeRepeatedInjections(compactHistoricalSkillActivations(compactBaselineSkillInjections(repeatedAssistantProjected)))))))), {
|
|
79004
79004
|
...options,
|
|
79005
79005
|
onAnomaly: (anomaly) => {
|
|
79006
79006
|
anomalies.push(anomaly);
|
|
@@ -259580,8 +259580,8 @@ var init_write$1 = __esmMin((() => {
|
|
|
259580
259580
|
write_default = "Create, append to, or replace a file entirely.\n\n- Missing parent directories are created automatically (like `mkdir(parents=True, exist_ok=True)`).\n- Mode defaults to overwrite; append adds content at EOF without adding a newline.\n- Write is NOT ALLOWED for incremental changes to existing files, including trivial, one-line, quick, or cosmetic edits. Use Edit instead.\n- Use Write only when the file does not exist, you intend a complete replacement, or the new contents have little continuity with the old contents.\n- Do not create unsolicited documentation files (`*.md` write-ups, `README`s, summaries) just because a task finished — write one only when the user asks for it, or when a task or project instruction requires it (e.g. the plan-mode plan file, created with Write when plan mode directs you to, or a changeset the repo mandates).\n- Read before overwriting an existing file.\n- Write ignores the Read/Edit line-number view. NEVER include line prefixes.\n- Write outputs content literally, including supplied line endings: \\n stays LF, \\r\\n stays CRLF.\n- Source files may contain at most 500 lines. Split larger implementations into focused files; append cannot bypass the limit.\n- Set `single_file_override=true` only when the latest direct user message explicitly requires one single file. The accepted override is reported visibly.\n- For any new or completely replaced file with content too large for one call, use `continuation`. Keep each chunk at or below the configured limit. The default is 2,048 UTF-8 bytes, a conservative safety margin for unstable model output rather than a measured hard model limit; operators can set `BLUN_WRITE_CONTINUATION_MAX_BYTES` from 512 through 16,384. End every chunk on a complete line with `\\n`. Set the exact final `expected_lines`; include `expected_sha256` when a source hash is available. Use overwrite and `start_line=1` for the first chunk, then use append for every later chunk and copy the exact `next_start_line` returned by the previous Write result; never continue from a planned boundary. Use consecutive part numbers. The target file remains unchanged until the final line-count and optional SHA-256 checks pass. To discard an unfinished sequence, restart with part 1, overwrite, `start_line=1`, and `reset=true`.\n- Never use continuation to modify an existing file incrementally. Use Edit for incremental changes.\n- Runaway generated JavaScript/TypeScript identifiers are rejected before disk I/O. Regenerate only the affected section as a smaller focused chunk.\n";
|
|
259581
259581
|
}));
|
|
259582
259582
|
//#endregion
|
|
259583
|
-
write_default = "Create, append to, or completely replace a file. Missing parent directories are created automatically. Overwrite is the default; append adds content at EOF without adding a newline.\n\nUse Write for a new file or a complete replacement. For every incremental change to an existing file, Use Edit instead, even when it is small. Read before overwriting an existing file. Do not create unsolicited documentation, README, summary, or report files unless the user or project instructions require them.\n\nContent is written literally. Never include Read/Edit line prefixes. Supplied LF and CRLF endings are preserved. Source files may contain at most 500 lines; split larger implementations into focused files. Set `single_file_override=true` only when the latest direct user message explicitly requires one source file.\n\
|
|
259584
|
-
write_default = "Create, append to, or replace a whole file. Missing parent directories are created automatically. Overwrite is default; append adds content at EOF without a newline.\n\nUse Write only for new files or complete replacements. Use Edit for every incremental change, even a small one. Read before overwriting an existing file. Do not create unsolicited documentation unless the user or project instructions require it.\n\nContent is literal. Never include line prefixes. Supplied LF and CRLF endings are preserved. Source files may contain at most 500 lines; split larger implementations into focused files. Set `single_file_override=true` only when the latest direct user message explicitly requires one source file.\n\
|
|
259583
|
+
write_default = "Create, append to, or completely replace a file. Missing parent directories are created automatically. Overwrite is the default; append adds content at EOF without adding a newline.\n\nUse Write for a new file or a complete replacement. For every incremental change to an existing file, Use Edit instead, even when it is small. Read before overwriting an existing file. Do not create unsolicited documentation, README, summary, or report files unless the user or project instructions require them.\n\nContent is written literally. Never include Read/Edit line prefixes. Supplied LF and CRLF endings are preserved. Source files may contain at most 500 lines; split larger implementations into focused files. Set `single_file_override=true` only when the latest direct user message explicitly requires one source file.\n\nWrite complete files up to 4,096 UTF-8 bytes atomically. For a larger new or completely replaced file, use `continuation`. Keep each chunk within the configured UTF-8 bytes limit and end it on a complete line with `\\n`. Set exact `expected_lines` and, when available, `expected_sha256`. Part 1 uses overwrite, `part=1`, and `start_line=1`; every later part uses append, the next consecutive part, and the exact `next_start_line` returned by Write. Set `final=true` only on the complete final part. The Target file remains unchanged until final line-count and optional SHA-256 checks pass. After an oversized plain Write is refused, that path accepts only continuation calls until the sequence completes. Restart an unfinished sequence only with part 1, overwrite, `start_line=1`, and `reset=true`. Never use continuation for incremental edits.\n\nRunaway generated JavaScript or TypeScript identifiers are rejected before disk I/O; regenerate only the affected section as a smaller chunk.";
|
|
259584
|
+
write_default = "Create, append to, or replace a whole file. Missing parent directories are created automatically. Overwrite is default; append adds content at EOF without a newline.\n\nUse Write only for new files or complete replacements. Use Edit for every incremental change, even a small one. Read before overwriting an existing file. Do not create unsolicited documentation unless the user or project instructions require it.\n\nContent is literal. Never include line prefixes. Supplied LF and CRLF endings are preserved. Source files may contain at most 500 lines; split larger implementations into focused files. Set `single_file_override=true` only when the latest direct user message explicitly requires one source file.\n\nWrite complete files up to 4,096 UTF-8 bytes atomically. For a larger new or completely replaced file, use `continuation`. Keep each chunk within the configured UTF-8 bytes limit and end it on a complete line with `\\n`. Optionally set exact `expected_lines` and, when available, `expected_sha256`. Part number, start line, and mode are derived from actually staged content when omitted. Set `final=true` only on the complete final part. The Target file remains unchanged until final line-count and optional SHA-256 checks pass. After an oversized plain Write is refused, that path accepts only continuation calls until the sequence completes. Restart an unfinished sequence with `reset=true`. Never use continuation for incremental edits.\n\nRunaway generated JavaScript or TypeScript identifiers are rejected before disk I/O; regenerate only the affected section as a smaller chunk.";
|
|
259585
259585
|
//#region ../../packages/agent-core/src/tools/builtin/file/generated-source-health.ts
|
|
259586
259586
|
/**
|
|
259587
259587
|
* Find runaway generated identifiers while ignoring comments and strings.
|
|
@@ -259704,7 +259704,7 @@ function countCompletedLines(content) {
|
|
|
259704
259704
|
for (const character of content) if (character === "\n") count += 1;
|
|
259705
259705
|
return count;
|
|
259706
259706
|
}
|
|
259707
|
-
var S_IFMT, S_IFDIR, DEFAULT_CONTINUATION_CHUNK_BYTES, MIN_CONTINUATION_CHUNK_BYTES, MAX_CONTINUATION_CHUNK_BYTES, CONTINUATION_CHUNK_BYTES_ENV, WriteContinuationSchema, WriteInputSchema, WriteTool, resolveWriteContinuationContract;
|
|
259707
|
+
var S_IFMT, S_IFDIR, DEFAULT_CONTINUATION_CHUNK_BYTES, MIN_CONTINUATION_CHUNK_BYTES, MAX_CONTINUATION_CHUNK_BYTES, CONTINUATION_CHUNK_BYTES_ENV, WriteContinuationSchema, WriteInputSchema, WriteTool, resolveWriteContinuationContract, resolvePlainWriteContract;
|
|
259708
259708
|
var init_write = __esmMin((() => {
|
|
259709
259709
|
init_dist$6();
|
|
259710
259710
|
init_zod$1();
|
|
@@ -259716,7 +259716,7 @@ var init_write = __esmMin((() => {
|
|
|
259716
259716
|
init_write$1();
|
|
259717
259717
|
init_generated_source_health();
|
|
259718
259718
|
init_lsp_diagnostics();
|
|
259719
|
-
({ resolveWriteContinuationContract } = createRequire(import.meta.url)("./bin/write-continuation-policy.cjs"));
|
|
259719
|
+
({ resolveWriteContinuationContract, resolvePlainWriteContract } = createRequire(import.meta.url)("./bin/write-continuation-policy.cjs"));
|
|
259720
259720
|
S_IFMT = 61440;
|
|
259721
259721
|
S_IFDIR = 16384;
|
|
259722
259722
|
DEFAULT_CONTINUATION_CHUNK_BYTES = 2048;
|
|
@@ -259751,6 +259751,7 @@ bytesWritten: number$1().int().nonnegative() });
|
|
|
259751
259751
|
description = write_default;
|
|
259752
259752
|
parameters = toInputJsonSchema(WriteInputSchema);
|
|
259753
259753
|
pendingContinuations = /* @__PURE__ */ new Map();
|
|
259754
|
+
continuationRequiredPaths = /* @__PURE__ */ new Set();
|
|
259754
259755
|
constructor(kaos, workspace, history, lsp, maxContinuationChunkBytes = resolveWriteContinuationChunkBytes()) {
|
|
259755
259756
|
this.kaos = kaos;
|
|
259756
259757
|
this.workspace = workspace;
|
|
@@ -259872,6 +259873,7 @@ bytesWritten: number$1().int().nonnegative() });
|
|
|
259872
259873
|
...percent === void 0 ? {} : { percent }
|
|
259873
259874
|
});
|
|
259874
259875
|
if (!final) {
|
|
259876
|
+
this.continuationRequiredPaths.delete(safePath);
|
|
259875
259877
|
this.pendingContinuations.set(safePath, staged);
|
|
259876
259878
|
const progress = expectedLines === void 0 ? `${String(completedLines)} lines staged; final count not predeclared` : `${String(completedLines)} of ${String(expectedLines)} lines (${String(percent)}%)`;
|
|
259877
259879
|
return { output: `Write continuation part ${String(part)} staged lines ${boundary} (${progress}, ${String(chunkBytes)} bytes). Target unchanged. Continue with the next chunk; mode=append, part=${String(part + 1)}, and start_line=${String(completedLines + 1)} are inferred when omitted.` };
|
|
@@ -259904,6 +259906,7 @@ bytesWritten: number$1().int().nonnegative() });
|
|
|
259904
259906
|
output: `Write continuation integrity failure for ${args.path}: staged SHA-256 ${actualSha256}, persisted SHA-256 ${persistedSha256}. The target may be incomplete; inspect it before continuing.`
|
|
259905
259907
|
};
|
|
259906
259908
|
this.pendingContinuations.delete(safePath);
|
|
259909
|
+
this.continuationRequiredPaths.delete(safePath);
|
|
259907
259910
|
const writeOutput = typeof result.output === "string" ? result.output : "Write completed.";
|
|
259908
259911
|
return {
|
|
259909
259912
|
...result,
|
|
@@ -259937,10 +259940,19 @@ bytesWritten: number$1().int().nonnegative() });
|
|
|
259937
259940
|
output: lineLimit.error
|
|
259938
259941
|
};
|
|
259939
259942
|
const contentBytes = Buffer.byteLength(args.content, "utf8");
|
|
259940
|
-
|
|
259941
|
-
|
|
259942
|
-
|
|
259943
|
-
|
|
259943
|
+
const plainWrite = resolvePlainWriteContract({
|
|
259944
|
+
contentBytes,
|
|
259945
|
+
maxContinuationChunkBytes: this.maxContinuationChunkBytes,
|
|
259946
|
+
continuationRequired: this.continuationRequiredPaths.has(safePath)
|
|
259947
|
+
});
|
|
259948
|
+
if (!allowLargeContent && !plainWrite.allowed) {
|
|
259949
|
+
if (plainWrite.reason === "too_large") this.continuationRequiredPaths.add(safePath);
|
|
259950
|
+
const reason = plainWrite.reason === "continuation_required" ? "an earlier oversized Write locked this path to the continuation protocol" : `the content is ${String(contentBytes)} UTF-8 bytes, above the ${String(plainWrite.directWriteLimit)}-byte direct-write limit`;
|
|
259951
|
+
return {
|
|
259952
|
+
isError: true,
|
|
259953
|
+
output: `Refused to write ${args.path}: ${reason}. Start or resume continuation with {\"path\":${JSON.stringify(args.path)},\"content\":\"<complete-line chunk ending in \\\\n>\",\"continuation\":{}}. Each chunk may contain at most ${this.maxContinuationChunkBytes.toLocaleString("en-US")} UTF-8 bytes. No file was written.`
|
|
259954
|
+
};
|
|
259955
|
+
}
|
|
259944
259956
|
const parentError = await this.ensureParentDirectory(safePath);
|
|
259945
259957
|
if (parentError !== void 0) return {
|
|
259946
259958
|
isError: true,
|
|
@@ -260541,7 +260553,7 @@ function renderHistoricalToolResultReference(toolName, toolCallId, text, outputP
|
|
|
260541
260553
|
function safeToolResultFileStem(toolName, toolCallId) {
|
|
260542
260554
|
return `${toolName}-${toolCallId}`.replace(/[^a-zA-Z0-9._-]+/g, "_").replace(/^_+|_+$/g, "").slice(0, 80) || "tool-result";
|
|
260543
260555
|
}
|
|
260544
|
-
var TOOL_RESULT_MAX_CHARS, TOOL_RESULT_PREVIEW_CHARS, TOOL_RESULT_RECOVERY_PAGE_LINES, TOOL_RESULT_OFFLOAD_MARKER, TOOL_RESULT_HISTORICAL_KEEP_RECENT_MESSAGES, shouldOffloadToolResult, createToolResultPreview, compactPersistedToolResultReference, compactHistoricalSuccessfulToolResults, selectToolResultBatchOffloads, selectHistoricalToolResultOffloads, buildToolResultOffloadTelemetry;
|
|
260556
|
+
var TOOL_RESULT_MAX_CHARS, TOOL_RESULT_PREVIEW_CHARS, TOOL_RESULT_RECOVERY_PAGE_LINES, TOOL_RESULT_OFFLOAD_MARKER, TOOL_RESULT_HISTORICAL_KEEP_RECENT_MESSAGES, shouldOffloadToolResult, createToolResultPreview, compactPersistedToolResultReference, compactHistoricalSuccessfulToolResults, dedupeRepeatedSuccessfulToolResults, selectToolResultBatchOffloads, selectHistoricalToolResultOffloads, buildToolResultOffloadTelemetry;
|
|
260545
260557
|
var init_tool_result_budget = __esmMin((() => {
|
|
260546
260558
|
init_dist$6();
|
|
260547
260559
|
const toolResultOffloadPolicy = createRequire(import.meta.url)("./bin/tool-result-offload-policy.cjs");
|
|
@@ -260555,6 +260567,7 @@ var init_tool_result_budget = __esmMin((() => {
|
|
|
260555
260567
|
createToolResultPreview = toolResultOffloadPolicy.createToolResultPreview;
|
|
260556
260568
|
compactPersistedToolResultReference = toolResultOffloadPolicy.compactPersistedToolResultReference;
|
|
260557
260569
|
compactHistoricalSuccessfulToolResults = toolResultOffloadPolicy.compactHistoricalSuccessfulToolResults;
|
|
260570
|
+
dedupeRepeatedSuccessfulToolResults = toolResultOffloadPolicy.dedupeRepeatedSuccessfulToolResults;
|
|
260558
260571
|
selectToolResultBatchOffloads = toolResultOffloadPolicy.selectToolResultBatchOffloads;
|
|
260559
260572
|
selectHistoricalToolResultOffloads = toolResultOffloadPolicy.selectHistoricalToolResultOffloads;
|
|
260560
260573
|
}));
|