blun-king-cli 9.1.442 → 9.1.443
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/turn-tool-performance-policy.cjs +12 -0
- package/blun.mjs +4 -2
- package/package.json +1 -1
|
@@ -266,6 +266,17 @@ function rankedToolNamesForTurnText(tools, value, options = {}) {
|
|
|
266
266
|
return new Set(ranked.slice(0, maxTools).map((entry) => entry.name));
|
|
267
267
|
}
|
|
268
268
|
|
|
269
|
+
function rankedSupportToolNamesForGoal(tools, goal, origin) {
|
|
270
|
+
if (origin?.kind !== 'system_trigger' || origin?.name !== 'goal_continuation') return new Set();
|
|
271
|
+
if (goal?.status !== 'active') return new Set();
|
|
272
|
+
const checkpoint = goal.actionCheckpoint;
|
|
273
|
+
if (checkpoint?.phase === 'wait' || checkpoint?.nextTrigger?.kind !== 'immediate') return new Set();
|
|
274
|
+
const supportChoice = String(checkpoint?.problemFrame?.supportChoice ?? '').trim();
|
|
275
|
+
const explicitSupport = supportChoice.match(/^(?:tool|skill)\s*:\s*(.+)$/iu);
|
|
276
|
+
if (!explicitSupport?.[1]) return new Set();
|
|
277
|
+
return rankedToolNamesForTurnText(tools, supportChoice, { maxTools: 1 });
|
|
278
|
+
}
|
|
279
|
+
|
|
269
280
|
function searchRelatedDeferredTools(tools, query, options = {}) {
|
|
270
281
|
const normalized = normalizeDeferredToolQuery(query).toLowerCase();
|
|
271
282
|
if (!normalized || normalized.startsWith('select:')) return [];
|
|
@@ -452,6 +463,7 @@ module.exports = {
|
|
|
452
463
|
mediaGenerationToolNamesForText,
|
|
453
464
|
mediaToolNamesForTurnText,
|
|
454
465
|
normalizeDeferredToolQuery,
|
|
466
|
+
rankedSupportToolNamesForGoal,
|
|
455
467
|
rankedToolNamesForTurnText,
|
|
456
468
|
rememberDeferredToolAfterNotFound,
|
|
457
469
|
toolSchemaBudgetTokens,
|
package/blun.mjs
CHANGED
|
@@ -261646,7 +261646,7 @@ function toolResultText(result) {
|
|
|
261646
261646
|
function abandonedToolResultOutput(ended) {
|
|
261647
261647
|
return `Tool call did not complete: ${ended.reason === "cancelled" ? "the turn was cancelled" : ended.reason === "failed" ? `the turn failed${ended.error !== void 0 ? ` (${ended.error.message})` : ""}` : "the turn ended"} before its result was recorded. Do not assume the tool completed successfully.`;
|
|
261648
261648
|
}
|
|
261649
|
-
var BLUN_CORE_TOOL_NAMES, BLUN_LEAN_TOOL_NAMES, BLUN_ATTACHMENT_MARKER_RE, BLUN_TELEGRAM_OUTBOUND_TOOL_RE, BLUN_TELEGRAM_CHANNEL_RE, BLUN_TOOL_BUDGET_RATIO, createDeferredToolLoader, mediaToolNamesForTurnText, rankedToolNamesForTurnText, rememberDeferredToolAfterNotFound, toolSchemaBudgetTokens, projectRecurringCronHistory, TelegramDeliveryLedger, createRuntimeCognitiveTurnLifecycle, cognitiveFocusScopesForTurn, buildCognitiveWorkFocus, buildAttentionQueueItem, LLM_NOT_SET_MESSAGE, GOAL_CONTINUATION_ORIGIN, GOAL_COMPLETION_REMINDER_NAME, GOAL_BLOCKED_REMINDER_NAME, GOAL_RATE_LIMIT_PAUSE_REASON, GOAL_PROVIDER_CONNECTION_PAUSE_PREFIX, GOAL_PROVIDER_AUTH_PAUSE_PREFIX, GOAL_PROVIDER_API_PAUSE_PREFIX, GOAL_MODEL_CONFIG_PAUSE_PREFIX, GOAL_RUNTIME_PAUSE_PREFIX, GOAL_PROVIDER_FILTERED_PAUSE_REASON, GOAL_CONTINUATION_PROMPT, TurnFlow;
|
|
261649
|
+
var BLUN_CORE_TOOL_NAMES, BLUN_LEAN_TOOL_NAMES, BLUN_ATTACHMENT_MARKER_RE, BLUN_TELEGRAM_OUTBOUND_TOOL_RE, BLUN_TELEGRAM_CHANNEL_RE, BLUN_TOOL_BUDGET_RATIO, createDeferredToolLoader, mediaToolNamesForTurnText, rankedSupportToolNamesForGoal, rankedToolNamesForTurnText, rememberDeferredToolAfterNotFound, toolSchemaBudgetTokens, projectRecurringCronHistory, TelegramDeliveryLedger, createRuntimeCognitiveTurnLifecycle, cognitiveFocusScopesForTurn, buildCognitiveWorkFocus, buildAttentionQueueItem, LLM_NOT_SET_MESSAGE, GOAL_CONTINUATION_ORIGIN, GOAL_COMPLETION_REMINDER_NAME, GOAL_BLOCKED_REMINDER_NAME, GOAL_RATE_LIMIT_PAUSE_REASON, GOAL_PROVIDER_CONNECTION_PAUSE_PREFIX, GOAL_PROVIDER_AUTH_PAUSE_PREFIX, GOAL_PROVIDER_API_PAUSE_PREFIX, GOAL_MODEL_CONFIG_PAUSE_PREFIX, GOAL_RUNTIME_PAUSE_PREFIX, GOAL_PROVIDER_FILTERED_PAUSE_REASON, GOAL_CONTINUATION_PROMPT, TurnFlow;
|
|
261650
261650
|
var init_turn = __esmMin((() => {
|
|
261651
261651
|
init_dist$4();
|
|
261652
261652
|
init_src$4();
|
|
@@ -261663,7 +261663,7 @@ var init_turn = __esmMin((() => {
|
|
|
261663
261663
|
init_tool_result_budget();
|
|
261664
261664
|
init_user_message_offload();
|
|
261665
261665
|
init_assistant_message_offload();
|
|
261666
|
-
({ CORE_TOOL_NAMES: BLUN_CORE_TOOL_NAMES, createDeferredToolLoader, mediaToolNamesForTurnText, rankedToolNamesForTurnText, rememberDeferredToolAfterNotFound, toolSchemaBudgetTokens } = createRequire(import.meta.url)("./bin/turn-tool-performance-policy.cjs"));
|
|
261666
|
+
({ CORE_TOOL_NAMES: BLUN_CORE_TOOL_NAMES, createDeferredToolLoader, mediaToolNamesForTurnText, rankedSupportToolNamesForGoal, rankedToolNamesForTurnText, rememberDeferredToolAfterNotFound, toolSchemaBudgetTokens } = createRequire(import.meta.url)("./bin/turn-tool-performance-policy.cjs"));
|
|
261667
261667
|
({ projectRecurringCronHistory } = createRequire(import.meta.url)("./bin/recurring-cron-history-policy.cjs"));
|
|
261668
261668
|
({ TelegramDeliveryLedger } = createRequire(import.meta.url)("./bin/repeated-user-message-projection.cjs"));
|
|
261669
261669
|
({ createRuntimeCognitiveTurnLifecycle } = createRequire(import.meta.url)("./bin/cognitive-turn-lifecycle.cjs"));
|
|
@@ -262422,6 +262422,8 @@ var init_turn = __esmMin((() => {
|
|
|
262422
262422
|
const turnRequiredToolNames = new Set(requiredToolNames);
|
|
262423
262423
|
const rankedToolNames = rankedToolNamesForTurnText(eligibleTools, turnText);
|
|
262424
262424
|
for (const name of rankedToolNames) turnRequiredToolNames.add(name);
|
|
262425
|
+
const supportToolNames = rankedSupportToolNamesForGoal(eligibleTools, this.agent.goal.getGoal().goal, origin);
|
|
262426
|
+
for (const name of supportToolNames) turnRequiredToolNames.add(name);
|
|
262425
262427
|
const toolSelection = fastConversation ? {
|
|
262426
262428
|
tools: [...blunFastConversationTools(eligibleTools, input, pendingMediaJobIds, turnRequiredToolNames)],
|
|
262427
262429
|
deferredToolCount: 0
|