blun-king-cli 9.1.188 → 9.1.190
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/loop-event-record-policy.cjs +14 -0
- package/bin/turn-thinking-policy.cjs +12 -5
- package/blun.mjs +6 -4
- package/package.json +1 -1
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
function projectLoopEventForRecord(event) {
|
|
4
|
+
if (
|
|
5
|
+
event?.type !== 'tool.call'
|
|
6
|
+
|| (!Object.prototype.hasOwnProperty.call(event, 'display')
|
|
7
|
+
&& !Object.prototype.hasOwnProperty.call(event, 'description'))
|
|
8
|
+
) return event;
|
|
9
|
+
|
|
10
|
+
const { display: _display, description: _description, ...recordedEvent } = event;
|
|
11
|
+
return recordedEvent;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
module.exports = { projectLoopEventForRecord };
|
|
@@ -3,10 +3,12 @@
|
|
|
3
3
|
const EXPLICIT_THINKING_INTENT = /\b(?:analy[sz](?:e|ing|is)|root\s+cause|investigat(?:e|ion)|debug(?:ging)?|architect(?:ure|ural)|plan(?:ning)?|review|audit|threat\s+model|refactor|optim(?:ize|ise|ization)|migration|complex|thorough|deep(?:ly)?|untersuch(?:e|ung)|analysier(?:e|en)?|ursachenanalyse|architektur|plan(?:e|ung)|pruef(?:e|ung)|sicherheit|migration|komplex|gruendlich|analiz(?:a|iraj)|istrazi|arhitektur|planiraj|sigurnost|duboko)\b/iu;
|
|
4
4
|
const ACTIONABLE_PROMPT = /\b(?:aender|analys|apply|bau|build|check|commit|cop(?:y|ier)|create|debug|delete|deploy|edit|entfern|erstelle|find|fix|implement|install|lad|loesch|merge|mess|move|napravi|oeffne|open|patch|pruef|publish|push|read|reparier|restart|run|schreib|search|starte?|stop|such|test|update|verschieb|write|zieh)\w*\b/iu;
|
|
5
5
|
const STANDALONE_CHAT = /^(?:hi|hallo|hey|hello|hoi|moin|servus|yo|danke|thanks|thx|bye|tschau|ciao)[.!?]*$/iu;
|
|
6
|
-
const
|
|
6
|
+
const BOSNIAN_STANDALONE_CHAT = /^(?:zdravo|pozdrav|hvala|ćao|cao)[.!?]*$/iu;
|
|
7
|
+
const IDENTITY_CHAT = /^(?:wer bist du|who are you|wie geht(?: es dir)?|how are you|na|kako si|kako je king|ko si ti|ko stoji iza tebe)[.!?]*$/iu;
|
|
7
8
|
const STATUS_ONLY_CHECK_IN = /(?:\bstandabfrage\b|\bstatusabfrage\b|\bkurzes?\s+update\b|\bwo\s+stehst\s+du\b|\bwie\s+weit\s+bist\s+du\b|\bwhere\s+are\s+you\b|\bquick\s+status\b)/iu;
|
|
8
9
|
const STATUS_FOLLOW_UP_ACTION = /\b(?:aendere|arbeite|baue|build|change|delete|deploy|deploye|fahr|fix|fixe|implement|implementiere|install|installiere|loesche|mach|patch|pruefe|repariere|run|schreibe|setze|start|starte|stop|stoppe|test|teste|write)\b/iu;
|
|
9
10
|
const LIGHTWEIGHT_STEER = /\b(?:cool|danke|dankeschoen|gute arbeit|passt|perfekt|stolz|super|freut mich)\b/iu;
|
|
11
|
+
const STANDALONE_CHAT_COMPLETION_TOKENS = 1024;
|
|
10
12
|
const ADAPTIVE_LOW_COMPLETION_TOKENS = 8192;
|
|
11
13
|
const STANDARD_TURN_MAX_COMPLETION_TOKENS = 24_576;
|
|
12
14
|
|
|
@@ -17,7 +19,8 @@ function selectThinkingEffortForTurn(text, originKind) {
|
|
|
17
19
|
if (!normalized) return "low";
|
|
18
20
|
|
|
19
21
|
const lower = normalized.toLowerCase();
|
|
20
|
-
if (
|
|
22
|
+
if (IDENTITY_CHAT.test(lower) || BOSNIAN_STANDALONE_CHAT.test(lower)) return "off";
|
|
23
|
+
if (STANDALONE_CHAT.test(lower)) return "low";
|
|
21
24
|
if (
|
|
22
25
|
STATUS_ONLY_CHECK_IN.test(normalized)
|
|
23
26
|
&& !STATUS_FOLLOW_UP_ACTION.test(normalized)
|
|
@@ -42,13 +45,16 @@ function selectThinkingEffortForWorkStep(stepNumber, previousToolOutcome) {
|
|
|
42
45
|
}
|
|
43
46
|
|
|
44
47
|
function capCompletionBudgetForAdaptiveEffort(budget, thinkingEffort) {
|
|
45
|
-
if (thinkingEffort !== "low" || budget === undefined) return budget;
|
|
48
|
+
if ((thinkingEffort !== "off" && thinkingEffort !== "low") || budget === undefined) return budget;
|
|
46
49
|
const configuredCap = budget.hardCap ?? budget.fallback;
|
|
50
|
+
const adaptiveCap = thinkingEffort === "off"
|
|
51
|
+
? STANDALONE_CHAT_COMPLETION_TOKENS
|
|
52
|
+
: ADAPTIVE_LOW_COMPLETION_TOKENS;
|
|
47
53
|
return {
|
|
48
54
|
...budget,
|
|
49
55
|
hardCap: Math.min(
|
|
50
|
-
configuredCap ??
|
|
51
|
-
|
|
56
|
+
configuredCap ?? adaptiveCap,
|
|
57
|
+
adaptiveCap,
|
|
52
58
|
),
|
|
53
59
|
};
|
|
54
60
|
}
|
|
@@ -81,6 +87,7 @@ module.exports = {
|
|
|
81
87
|
ACTIONABLE_PROMPT,
|
|
82
88
|
ADAPTIVE_LOW_COMPLETION_TOKENS,
|
|
83
89
|
EXPLICIT_THINKING_INTENT,
|
|
90
|
+
STANDALONE_CHAT_COMPLETION_TOKENS,
|
|
84
91
|
STANDARD_TURN_MAX_COMPLETION_TOKENS,
|
|
85
92
|
capCompletionBudgetForAdaptiveEffort,
|
|
86
93
|
capTurnCompletionTokens,
|
package/blun.mjs
CHANGED
|
@@ -28236,9 +28236,10 @@ function personaSystemBlock(env = process.env) {
|
|
|
28236
28236
|
}
|
|
28237
28237
|
}
|
|
28238
28238
|
if (language !== void 0 && language.length > 0) {
|
|
28239
|
+
const requestedLanguage = language === "Bosnian" ? "Bosnian (bosanski; not Slovenian or slovenski)" : language;
|
|
28239
28240
|
if (lines.length > 0) lines.push("");
|
|
28240
|
-
lines.push(`## Language — HARD OVERRIDE (${
|
|
28241
|
-
lines.push(`Write EVERYTHING you output in ${
|
|
28241
|
+
lines.push(`## Language — HARD OVERRIDE (${requestedLanguage})`, "");
|
|
28242
|
+
lines.push(`Write EVERYTHING you output in ${requestedLanguage}: your reasoning and thinking, your progress notes, and every reply to the user. This rule is ABSOLUTE and OVERRIDES the "# Language" section elsewhere in this prompt and any instinct to mirror the user's language. Even when the user writes to you in English or any other language, you still think and answer in ${requestedLanguage}. The only things that stay verbatim are code, shell commands, file paths, and identifiers. Do not switch away from ${requestedLanguage} unless the user explicitly changes the language with a command.`);
|
|
28242
28243
|
}
|
|
28243
28244
|
return lines.join("\n");
|
|
28244
28245
|
}
|
|
@@ -75985,7 +75986,7 @@ var init_full = __esmMin((() => {
|
|
|
75985
75986
|
}));
|
|
75986
75987
|
//#endregion
|
|
75987
75988
|
//#region ../../packages/agent-core/src/agent/compaction/micro.ts
|
|
75988
|
-
var selectMicroCompactionCutoff, MICRO_COMPACTION_RECENT_MESSAGES, MICRO_COMPACTION_TOOL_ARGUMENTS_ENABLED, MICRO_COMPACTION_TOOL_ARGUMENT_MIN_TOKENS, isPersistedToolResultReference, projectHistoricalUnaddressedTelegramMessages, dedupeRepeatedUserMessages, projectRepeatedAssistantResponses, compactHistoricalSkillActivations, dedupeRecurringCronWakeups, dedupeRepeatedInjections, DEFAULT_CONFIG, MicroCompaction;
|
|
75989
|
+
var selectMicroCompactionCutoff, MICRO_COMPACTION_RECENT_MESSAGES, MICRO_COMPACTION_TOOL_ARGUMENTS_ENABLED, MICRO_COMPACTION_TOOL_ARGUMENT_MIN_TOKENS, isPersistedToolResultReference, projectHistoricalUnaddressedTelegramMessages, dedupeRepeatedUserMessages, projectRepeatedAssistantResponses, compactHistoricalSkillActivations, dedupeRecurringCronWakeups, dedupeRepeatedInjections, projectLoopEventForRecord, DEFAULT_CONFIG, MicroCompaction;
|
|
75989
75990
|
var init_micro = __esmMin((() => {
|
|
75990
75991
|
({ selectMicroCompactionCutoff, MICRO_COMPACTION_RECENT_MESSAGES, MICRO_COMPACTION_TOOL_ARGUMENTS_ENABLED, MICRO_COMPACTION_TOOL_ARGUMENT_MIN_TOKENS } = createRequire(import.meta.url)("./bin/micro-compaction-policy.cjs"));
|
|
75991
75992
|
({ isPersistedToolResultReference } = createRequire(import.meta.url)("./bin/tool-result-offload-policy.cjs"));
|
|
@@ -75994,6 +75995,7 @@ var init_micro = __esmMin((() => {
|
|
|
75994
75995
|
({ projectRepeatedAssistantResponses } = createRequire(import.meta.url)("./bin/repeated-assistant-response-policy.cjs"));
|
|
75995
75996
|
({ compactHistoricalSkillActivations } = createRequire(import.meta.url)("./bin/skill-activation-performance-policy.cjs"));
|
|
75996
75997
|
({ dedupeRecurringCronWakeups, dedupeRepeatedInjections } = createRequire(import.meta.url)("./bin/repeated-injection-projection.cjs"));
|
|
75998
|
+
({ projectLoopEventForRecord } = createRequire(import.meta.url)("./bin/loop-event-record-policy.cjs"));
|
|
75997
75999
|
init_tokens();
|
|
75998
76000
|
DEFAULT_CONFIG = {
|
|
75999
76001
|
keepRecentMessages: MICRO_COMPACTION_RECENT_MESSAGES,
|
|
@@ -79083,7 +79085,7 @@ var init_context$2 = __esmMin((() => {
|
|
|
79083
79085
|
appendLoopEvent(event) {
|
|
79084
79086
|
this.agent.records.logRecord({
|
|
79085
79087
|
type: "context.append_loop_event",
|
|
79086
|
-
event
|
|
79088
|
+
event: projectLoopEventForRecord(event)
|
|
79087
79089
|
});
|
|
79088
79090
|
switch (event.type) {
|
|
79089
79091
|
case "step.begin": {
|