blun-king-cli 9.1.441 → 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.
@@ -84,6 +84,16 @@ function buildCognitiveWorkFocus(goal) {
84
84
  const epistemicState = hasCheckpoint && EPISTEMIC_STATES.has(checkpointEpistemicState)
85
85
  ? checkpointEpistemicState : hasCheckpoint ? 'legacy_unknown' : 'verified';
86
86
  const knowledgeGapValue = hasProblemFrame ? frameMissingKnowledge.join(' | ') : 'none';
87
+ const decisionThread = hasProblemFrame ? [
88
+ `Goal is ${status}`,
89
+ `Phase ${checkpointPhase}`,
90
+ `Last verified: ${bounded(lastVerified, 80)}`,
91
+ `Decision: ${bounded(frameSelectedAction, 64)}`,
92
+ `Why: ${bounded(frameSelectionReason, 64)}`,
93
+ `Support: ${bounded(frameSupportChoice, 64)}`,
94
+ `Risk: ${bounded(frameRisk, 64)}`,
95
+ `Reversible: ${bounded(frameReversibility, 64)}`,
96
+ ].join('; ') : '';
87
97
  const digest = crypto.createHash('sha256')
88
98
  .update([
89
99
  goalId, objective, completionCriterion, status, String(turnsUsed),
@@ -113,12 +123,10 @@ function buildCognitiveWorkFocus(goal) {
113
123
  {
114
124
  domain: 'open_thread', key: `${keyRoot}:status`,
115
125
  value: bounded(hasCheckpoint
116
- ? [
126
+ ? hasProblemFrame ? decisionThread : [
117
127
  `Goal is ${status}. Phase ${checkpointPhase}. Last verified: ${lastVerified}`,
118
128
  `Next action: ${nextAction}`,
119
- hasProblemFrame ? `Risk: ${frameRisk}` : '',
120
- hasProblemFrame ? `Selected action: ${frameSelectedAction}` : '',
121
- ].filter(Boolean).join(' ')
129
+ ].join(' ')
122
130
  : `Goal is ${status}.`),
123
131
  confidence: 1, epistemicState, scope: focusScope,
124
132
  },
@@ -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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "blun-king-cli",
3
- "version": "9.1.441",
3
+ "version": "9.1.443",
4
4
  "description": "BLUN CLI - your own AI agent with a Telegram channel. Get it done. With BLUN.",
5
5
  "license": "MIT",
6
6
  "bin": {