blun-king-cli 9.1.527 → 9.1.550

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.
Files changed (108) hide show
  1. package/LIESMICH.txt +13 -834
  2. package/README.md +41 -799
  3. package/bin/agent-resume-snapshot.cjs +31 -0
  4. package/bin/assistant-message-offload-policy.cjs +23 -2
  5. package/bin/codebase-search-runtime.cjs +23 -0
  6. package/bin/context-performance-policy.cjs +2 -5
  7. package/bin/context-pressure-policy.cjs +20 -0
  8. package/bin/cron-run-output.cjs +45 -0
  9. package/bin/cron-run-store.cjs +145 -0
  10. package/bin/durable-task-resume-policy.cjs +130 -0
  11. package/bin/durable-task-resume-runtime.cjs +117 -0
  12. package/bin/durable-task-resume-store.cjs +88 -0
  13. package/bin/editable-tool-approval-policy.cjs +540 -0
  14. package/bin/editable-tool-approval-runtime.cjs +99 -0
  15. package/bin/empty-response-retry-policy.cjs +29 -0
  16. package/bin/history-offload-pressure-policy.cjs +33 -0
  17. package/bin/html-to-research-markdown.cjs +146 -0
  18. package/bin/programmatic-context-isolation.cjs +25 -0
  19. package/bin/programmatic-tool-runtime.mjs +627 -0
  20. package/bin/read-continuation-policy.cjs +36 -5
  21. package/bin/scoped-cron-run-policy.cjs +358 -0
  22. package/bin/skill-activation-performance-policy.cjs +9 -0
  23. package/bin/startup-preferences.cjs +3 -3
  24. package/bin/structured-agent-swarm-output.cjs +325 -0
  25. package/bin/structured-subagent-output.cjs +252 -0
  26. package/bin/subagent-context-fork-policy.cjs +155 -0
  27. package/bin/subagent-skill-policy.cjs +204 -0
  28. package/bin/telegram-approval-relay.cjs +2 -1
  29. package/bin/telegram-direct-focus-policy.cjs +25 -1
  30. package/bin/todo-list-turn-policy.cjs +111 -1
  31. package/bin/tool-result-offload-policy.cjs +43 -1
  32. package/bin/turn-thinking-policy.cjs +6 -15
  33. package/bin/turn-tool-performance-policy.cjs +5 -4
  34. package/bin/update-notice.js +14 -18
  35. package/bin/user-message-offload-policy.cjs +12 -1
  36. package/blun.mjs +1406 -265
  37. package/codebase-index/README.md +82 -0
  38. package/codebase-index/codebase_index.py +469 -0
  39. package/package.json +24 -38
  40. package/telegram-plugin/bin/telegram-typing-keepalive.cjs +89 -0
  41. package/telegram-plugin/dist/bridge.mjs +8 -1
  42. package/CHANGELOG.md +0 -260
  43. package/agent-spine-plugin/CHANGELOG.md +0 -406
  44. package/agent-spine-plugin/CONTRIBUTING.md +0 -52
  45. package/agent-spine-plugin/README.md +0 -344
  46. package/agent-spine-plugin/SECURITY.md +0 -47
  47. package/agent-spine-plugin/docs/acceptance.md +0 -61
  48. package/agent-spine-plugin/docs/architecture.md +0 -183
  49. package/agent-spine-plugin/docs/attention.md +0 -121
  50. package/agent-spine-plugin/docs/automatic-continuity.md +0 -79
  51. package/agent-spine-plugin/docs/channel-runtime.md +0 -92
  52. package/agent-spine-plugin/docs/coordination.md +0 -138
  53. package/agent-spine-plugin/docs/feed-transport.md +0 -99
  54. package/agent-spine-plugin/docs/gateway-runtime.md +0 -116
  55. package/agent-spine-plugin/docs/harness-reference.md +0 -45
  56. package/agent-spine-plugin/docs/host-integration.md +0 -129
  57. package/agent-spine-plugin/docs/https-transport.md +0 -116
  58. package/agent-spine-plugin/docs/learning.md +0 -133
  59. package/agent-spine-plugin/docs/object-transport.md +0 -93
  60. package/agent-spine-plugin/docs/peer-transport.md +0 -88
  61. package/agent-spine-plugin/docs/preflight-recall.md +0 -69
  62. package/agent-spine-plugin/docs/preservation-contract.md +0 -53
  63. package/agent-spine-plugin/docs/quality-gates.md +0 -50
  64. package/agent-spine-plugin/docs/relationships.md +0 -73
  65. package/agent-spine-plugin/docs/releasing.md +0 -83
  66. package/agent-spine-plugin/docs/roadmap.md +0 -307
  67. package/agent-spine-plugin/docs/selfstarter.md +0 -88
  68. package/agent-spine-plugin/docs/session-briefing.md +0 -74
  69. package/agent-spine-plugin/docs/shared-memory.md +0 -259
  70. package/agent-spine-plugin/docs/source-roots.md +0 -86
  71. package/agent-spine-plugin/docs/sqlite-transport.md +0 -76
  72. package/agent-spine-plugin/scripts/check-hosts.js +0 -195
  73. package/agent-spine-plugin/scripts/check-install.js +0 -569
  74. package/agent-spine-plugin/scripts/check-syntax.js +0 -29
  75. package/agent-spine-plugin/scripts/github-actions.js +0 -11
  76. package/agent-spine-plugin/scripts/release-check.js +0 -128
  77. package/agent-spine-plugin/scripts/run-acceptance.js +0 -19
  78. package/agent-spine-plugin/scripts/run-checks.js +0 -46
  79. package/agent-spine-plugin/scripts/run-tests-hermetic.js +0 -73
  80. package/agent-spine-plugin/spine-example/1-identity.md +0 -12
  81. package/agent-spine-plugin/spine-example/2-voice.md +0 -6
  82. package/agent-spine-plugin/spine-example/3-conduct.md +0 -8
  83. package/agent-spine-plugin/spine-example/4-history.md +0 -4
  84. package/bin/package-regression-policy.cjs +0 -77
  85. package/release-planned-removals.json +0 -15
  86. package/scripts/check-active-profile-plugin-startup.js +0 -36
  87. package/scripts/check-approval-observability-regression.js +0 -111
  88. package/scripts/check-approval-queue-shortcuts-regression.js +0 -65
  89. package/scripts/check-bundled-agent-spine-regression.js +0 -48
  90. package/scripts/check-copy-command-regression.js +0 -74
  91. package/scripts/check-historical-tool-result-preview-regression.js +0 -77
  92. package/scripts/check-mcp-startup-wait-budget.js +0 -48
  93. package/scripts/check-package-regression.js +0 -38
  94. package/scripts/check-plugin-startup-regression.js +0 -53
  95. package/scripts/check-queue-controls-regression.js +0 -189
  96. package/scripts/check-release-metadata.js +0 -103
  97. package/scripts/check-reload-agent-spine-regression.js +0 -76
  98. package/scripts/check-resume-replay-regression.js +0 -100
  99. package/scripts/check-session-cancel-regression.js +0 -43
  100. package/scripts/check-session-picker-resume-metrics-regression.js +0 -97
  101. package/scripts/check-session-start-hook-context-regression.js +0 -228
  102. package/scripts/check-shell-terminal-isolation-regression.js +0 -81
  103. package/scripts/check-slash-escape-regression.js +0 -89
  104. package/scripts/check-telegram-bridge-watchdog.js +0 -60
  105. package/scripts/check-telegram-loop-exactly-once-regression.js +0 -71
  106. package/scripts/check-todo-loop-regression.js +0 -78
  107. package/scripts/check-todo-recovery-catalog-regression.js +0 -50
  108. /package/{scripts → bin}/fix-node-pty-perms.js +0 -0
@@ -1484,20 +1484,6 @@ async function runUpdateFlow(options, explicitUpdate) {
1484
1484
  ? explicitFailure(stderr, 'lease_unavailable', undefined, uiLocale)
1485
1485
  : { kind: 'continue', reason: 'lease_unavailable' };
1486
1486
  }
1487
- if (!options.installVersion) {
1488
- installerSession = await (options.prepareInstaller || preparePinnedInstaller)(
1489
- release.version,
1490
- { blunDir, packageRoot },
1491
- );
1492
- if (!installerSession?.ready) {
1493
- if (explicitUpdate) {
1494
- return explicitFailure(stderr, 'installer_unavailable', undefined, uiLocale);
1495
- }
1496
- return installerSession?.reason === 'failed'
1497
- ? { kind: 'continue', reason: 'installer_unavailable' }
1498
- : { kind: 'update_in_progress' };
1499
- }
1500
- }
1501
1487
  let action;
1502
1488
  if (explicitUpdate || options.autoInstall === true) {
1503
1489
  action = 'install';
@@ -1515,10 +1501,6 @@ async function runUpdateFlow(options, explicitUpdate) {
1515
1501
  }
1516
1502
  }
1517
1503
  if (action !== 'install') {
1518
- if (installerSession?.ready) {
1519
- await installerSession.cancel();
1520
- installerSession = undefined;
1521
- }
1522
1504
  if (action === 'skip-once') {
1523
1505
  return { kind: 'continue', reason: 'skipped_once' };
1524
1506
  }
@@ -1537,6 +1519,20 @@ async function runUpdateFlow(options, explicitUpdate) {
1537
1519
  }
1538
1520
  return { kind: 'continue', reason: 'postponed' };
1539
1521
  }
1522
+ if (!options.installVersion) {
1523
+ installerSession = await (options.prepareInstaller || preparePinnedInstaller)(
1524
+ release.version,
1525
+ { blunDir, packageRoot },
1526
+ );
1527
+ if (!installerSession?.ready) {
1528
+ if (explicitUpdate) {
1529
+ return explicitFailure(stderr, 'installer_unavailable', undefined, uiLocale);
1530
+ }
1531
+ return installerSession?.reason === 'failed'
1532
+ ? { kind: 'continue', reason: 'installer_unavailable' }
1533
+ : { kind: 'update_in_progress' };
1534
+ }
1535
+ }
1540
1536
 
1541
1537
  const updateProgress = createUpdateProgress(stdout);
1542
1538
  updateProgress(1, copy.updateChecked);
@@ -1,5 +1,11 @@
1
1
  'use strict';
2
2
 
3
+ const {
4
+ hasHistoricalOffloadPressure,
5
+ historyTextChars,
6
+ } = require('./history-offload-pressure-policy.cjs');
7
+ const { hasContextPressure } = require('./context-pressure-policy.cjs');
8
+
3
9
  const USER_MESSAGE_MAX_CHARS = 200_000;
4
10
  const HISTORICAL_USER_MESSAGE_MAX_CHARS = 4_000;
5
11
  const USER_MESSAGE_KEEP_RECENT_MESSAGES = 20;
@@ -14,6 +20,7 @@ function shouldOffloadUserMessage(textChars) {
14
20
  function shouldOffloadHistoricalUserMessage(options = {}) {
15
21
  const historyIndex = Number(options.historyIndex);
16
22
  const historyLength = Number(options.historyLength);
23
+ const historyChars = Number(options.historyChars);
17
24
  const textChars = Number(options.textChars);
18
25
  if (
19
26
  !Number.isSafeInteger(historyIndex)
@@ -24,7 +31,10 @@ function shouldOffloadHistoricalUserMessage(options = {}) {
24
31
  || historyIndex >= historyLength
25
32
  ) return false;
26
33
  const cutoff = Math.max(0, historyLength - USER_MESSAGE_KEEP_RECENT_MESSAGES);
27
- return historyIndex < cutoff && textChars > HISTORICAL_USER_MESSAGE_MAX_CHARS;
34
+ return hasContextPressure(options)
35
+ && hasHistoricalOffloadPressure({ historyLength, historyChars })
36
+ && historyIndex < cutoff
37
+ && textChars > HISTORICAL_USER_MESSAGE_MAX_CHARS;
28
38
  }
29
39
 
30
40
  function createUserMessagePreview(text) {
@@ -87,6 +97,7 @@ module.exports = {
87
97
  USER_MESSAGE_PREVIEW_LINE_CHARS,
88
98
  compactHistoricalPersistedUserMessageReferences,
89
99
  createUserMessagePreview,
100
+ historyTextChars,
90
101
  shouldOffloadHistoricalUserMessage,
91
102
  shouldOffloadUserMessage,
92
103
  };