blun-king-cli 9.1.281 → 9.1.283
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/context-insight-policy.cjs +2 -0
- package/blun.mjs +9 -2
- package/package.json +1 -1
|
@@ -7,6 +7,7 @@ function finiteNonNegative(value) {
|
|
|
7
7
|
function buildContextInsight(input = {}) {
|
|
8
8
|
const projectedTokens = finiteNonNegative(input.projectedTokenCount);
|
|
9
9
|
const maxTokens = finiteNonNegative(input.effectiveMaxContextTokens);
|
|
10
|
+
const systemPromptTokens = finiteNonNegative(input.systemPromptTokens);
|
|
10
11
|
const conversationTokens = finiteNonNegative(input.conversationTokens);
|
|
11
12
|
const toolSchemaTokens = finiteNonNegative(input.toolSchemaTokens);
|
|
12
13
|
const compactionBudgetTokens = Math.min(
|
|
@@ -21,6 +22,7 @@ function buildContextInsight(input = {}) {
|
|
|
21
22
|
return {
|
|
22
23
|
projectedTokens,
|
|
23
24
|
maxTokens,
|
|
25
|
+
systemPromptTokens,
|
|
24
26
|
conversationTokens,
|
|
25
27
|
toolSchemaTokens,
|
|
26
28
|
compactionBudgetTokens,
|
package/blun.mjs
CHANGED
|
@@ -75409,7 +75409,7 @@ var init_full = __esmMin((() => {
|
|
|
75409
75409
|
}
|
|
75410
75410
|
estimateProjectedRequestTokens(context = {}) {
|
|
75411
75411
|
const messages = context.messages ?? this.agent.context.messages;
|
|
75412
|
-
return this.estimateRequestTokens(context.additionalMessages === void 0 ? messages : [...messages, ...context.additionalMessages], context.systemPrompt ?? this.agent.
|
|
75412
|
+
return this.estimateRequestTokens(context.additionalMessages === void 0 ? messages : [...messages, ...context.additionalMessages], context.systemPrompt ?? this.agent.effectiveSystemPrompt, context.tools ?? this.agent.tools.loopTools);
|
|
75413
75413
|
}
|
|
75414
75414
|
shouldRecoverFromContextOverflow(error) {
|
|
75415
75415
|
return error instanceof APIContextOverflowError;
|
|
@@ -259054,7 +259054,12 @@ var init_read = __esmMin((() => {
|
|
|
259054
259054
|
MAX_BYTES_KB: MAX_BYTES / 1024,
|
|
259055
259055
|
MAX_LINE_LENGTH
|
|
259056
259056
|
});
|
|
259057
|
-
read_default = "Read a UTF-8 text file
|
|
259057
|
+
read_default = "Read a known UTF-8 text file. Invalid paths error; directories are unsupported. Relative paths use the working directory; outside paths must be absolute. Use Glob for unknown names, Grep for content, and ReadMediaFile for media.\n\nEach call returns at most {{ MAX_LINES }} lines or {{ MAX_BYTES_KB }} KB and truncates lines beyond {{ MAX_LINE_LENGTH }} characters. Page large files with 1-based `line_offset` and `n_lines`; omit `n_lines` for the cap. Negative `line_offset` reads from the end, up to {{ MAX_LINES }} lines. A capped result names the exact next `line_offset`.\n\nSensitive files such as `.env` and credential stores are refused; templates and public keys remain readable. Only UTF-8 text without NUL bytes is accepted; use Bash or an MCP tool for other binaries.\n\nOutput is `<line-number>\\t<content>` per line. The trailing `<system>...</system>` block is status, not file content. Pure CRLF appears as LF and is preserved by Edit. Mixed or lone carriage returns appear as `\\r` and require exact `Edit.old_string` escapes.";
|
|
259058
|
+
READ_DESCRIPTION = renderPrompt(read_default, {
|
|
259059
|
+
MAX_LINES: MAX_LINES$1,
|
|
259060
|
+
MAX_BYTES_KB: MAX_BYTES / 1024,
|
|
259061
|
+
MAX_LINE_LENGTH
|
|
259062
|
+
});
|
|
259058
259063
|
ReadTool = class {
|
|
259059
259064
|
kaos;
|
|
259060
259065
|
workspace;
|
|
@@ -265260,6 +265265,7 @@ var init_agent = __esmMin((() => {
|
|
|
265260
265265
|
projectedTokenCount: this.fullCompaction.estimateCurrentRequestTokens(),
|
|
265261
265266
|
effectiveMaxContextTokens: this.fullCompaction.getEffectiveMaxContextTokens(),
|
|
265262
265267
|
compactionBudgetTokens: this.fullCompaction.getCompactionBudgetTokens(),
|
|
265268
|
+
systemPromptTokens: estimateTokens$1(this.effectiveSystemPrompt),
|
|
265263
265269
|
conversationTokens: estimateTokensForMessages(this.context.messages),
|
|
265264
265270
|
toolSchemaTokens: estimateTokensForTools(this.tools.loopTools)
|
|
265265
265271
|
}),
|
|
@@ -418108,6 +418114,7 @@ function buildContextInsightLines(insight) {
|
|
|
418108
418114
|
const percentage = `${(insight.ratio * 100).toFixed(1)}%`;
|
|
418109
418115
|
const lines = [
|
|
418110
418116
|
` ${barColoured} ${value(percentage.padStart(6, " "))} ${muted(`(${formatExactTokenCount(insight.projectedTokens, locale)} / ${formatExactTokenCount(insight.maxTokens, locale)})`)}`,
|
|
418117
|
+
` ${muted(`${uiText("export.system")}:`)} ${value(formatExactTokenCount(insight.systemPromptTokens, locale))}`,
|
|
418111
418118
|
` ${muted(`${uiText("export.conversation")}:`)} ${value(formatExactTokenCount(insight.conversationTokens, locale))}`,
|
|
418112
418119
|
` ${muted(`${uiText("mcp.capability.tools")}:`)} ${value(formatExactTokenCount(insight.toolSchemaTokens, locale))}`,
|
|
418113
418120
|
` ${muted(`${uiText("command.compact.description")}:`)} ${value(formatExactTokenCount(insight.compactionBudgetTokens, locale))}`,
|