blun-king-cli 9.1.282 → 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 +3 -1
- 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;
|
|
@@ -265265,6 +265265,7 @@ var init_agent = __esmMin((() => {
|
|
|
265265
265265
|
projectedTokenCount: this.fullCompaction.estimateCurrentRequestTokens(),
|
|
265266
265266
|
effectiveMaxContextTokens: this.fullCompaction.getEffectiveMaxContextTokens(),
|
|
265267
265267
|
compactionBudgetTokens: this.fullCompaction.getCompactionBudgetTokens(),
|
|
265268
|
+
systemPromptTokens: estimateTokens$1(this.effectiveSystemPrompt),
|
|
265268
265269
|
conversationTokens: estimateTokensForMessages(this.context.messages),
|
|
265269
265270
|
toolSchemaTokens: estimateTokensForTools(this.tools.loopTools)
|
|
265270
265271
|
}),
|
|
@@ -418113,6 +418114,7 @@ function buildContextInsightLines(insight) {
|
|
|
418113
418114
|
const percentage = `${(insight.ratio * 100).toFixed(1)}%`;
|
|
418114
418115
|
const lines = [
|
|
418115
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))}`,
|
|
418116
418118
|
` ${muted(`${uiText("export.conversation")}:`)} ${value(formatExactTokenCount(insight.conversationTokens, locale))}`,
|
|
418117
418119
|
` ${muted(`${uiText("mcp.capability.tools")}:`)} ${value(formatExactTokenCount(insight.toolSchemaTokens, locale))}`,
|
|
418118
418120
|
` ${muted(`${uiText("command.compact.description")}:`)} ${value(formatExactTokenCount(insight.compactionBudgetTokens, locale))}`,
|