blun-king-cli 9.1.536 → 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.
- package/LIESMICH.txt +13 -869
- package/README.md +41 -833
- package/bin/assistant-message-offload-policy.cjs +3 -1
- package/bin/context-performance-policy.cjs +2 -5
- package/bin/context-pressure-policy.cjs +20 -0
- package/bin/cron-run-output.cjs +45 -0
- package/bin/cron-run-store.cjs +145 -0
- package/bin/durable-task-resume-policy.cjs +130 -0
- package/bin/durable-task-resume-runtime.cjs +117 -0
- package/bin/durable-task-resume-store.cjs +88 -0
- package/bin/editable-tool-approval-policy.cjs +540 -0
- package/bin/editable-tool-approval-runtime.cjs +99 -0
- package/bin/html-to-research-markdown.cjs +146 -0
- package/bin/programmatic-tool-runtime.mjs +330 -4
- package/bin/read-continuation-policy.cjs +36 -5
- package/bin/scoped-cron-run-policy.cjs +358 -0
- package/bin/startup-preferences.cjs +3 -3
- package/bin/structured-agent-swarm-output.cjs +325 -0
- package/bin/subagent-context-fork-policy.cjs +155 -0
- package/bin/subagent-skill-policy.cjs +204 -0
- package/bin/telegram-approval-relay.cjs +2 -1
- package/bin/tool-result-offload-policy.cjs +14 -1
- package/bin/update-notice.js +14 -18
- package/bin/user-message-offload-policy.cjs +3 -1
- package/blun.mjs +1089 -477
- package/codebase-index/README.md +12 -0
- package/codebase-index/codebase_index.py +129 -18
- package/package.json +23 -58
- package/telegram-plugin/bin/telegram-typing-keepalive.cjs +89 -0
- package/telegram-plugin/dist/bridge.mjs +8 -1
- package/CHANGELOG.md +0 -321
- package/agent-spine-plugin/CHANGELOG.md +0 -406
- package/agent-spine-plugin/CONTRIBUTING.md +0 -52
- package/agent-spine-plugin/README.md +0 -344
- package/agent-spine-plugin/SECURITY.md +0 -47
- package/agent-spine-plugin/docs/acceptance.md +0 -61
- package/agent-spine-plugin/docs/architecture.md +0 -183
- package/agent-spine-plugin/docs/attention.md +0 -121
- package/agent-spine-plugin/docs/automatic-continuity.md +0 -79
- package/agent-spine-plugin/docs/channel-runtime.md +0 -92
- package/agent-spine-plugin/docs/coordination.md +0 -138
- package/agent-spine-plugin/docs/feed-transport.md +0 -99
- package/agent-spine-plugin/docs/gateway-runtime.md +0 -116
- package/agent-spine-plugin/docs/harness-reference.md +0 -45
- package/agent-spine-plugin/docs/host-integration.md +0 -129
- package/agent-spine-plugin/docs/https-transport.md +0 -116
- package/agent-spine-plugin/docs/learning.md +0 -133
- package/agent-spine-plugin/docs/object-transport.md +0 -93
- package/agent-spine-plugin/docs/peer-transport.md +0 -88
- package/agent-spine-plugin/docs/preflight-recall.md +0 -69
- package/agent-spine-plugin/docs/preservation-contract.md +0 -53
- package/agent-spine-plugin/docs/quality-gates.md +0 -50
- package/agent-spine-plugin/docs/relationships.md +0 -73
- package/agent-spine-plugin/docs/releasing.md +0 -83
- package/agent-spine-plugin/docs/roadmap.md +0 -307
- package/agent-spine-plugin/docs/selfstarter.md +0 -88
- package/agent-spine-plugin/docs/session-briefing.md +0 -74
- package/agent-spine-plugin/docs/shared-memory.md +0 -259
- package/agent-spine-plugin/docs/source-roots.md +0 -86
- package/agent-spine-plugin/docs/sqlite-transport.md +0 -76
- package/agent-spine-plugin/scripts/check-hosts.js +0 -195
- package/agent-spine-plugin/scripts/check-install.js +0 -569
- package/agent-spine-plugin/scripts/check-syntax.js +0 -29
- package/agent-spine-plugin/scripts/github-actions.js +0 -11
- package/agent-spine-plugin/scripts/release-check.js +0 -128
- package/agent-spine-plugin/scripts/run-acceptance.js +0 -19
- package/agent-spine-plugin/scripts/run-checks.js +0 -46
- package/agent-spine-plugin/scripts/run-tests-hermetic.js +0 -73
- package/agent-spine-plugin/spine-example/1-identity.md +0 -12
- package/agent-spine-plugin/spine-example/2-voice.md +0 -6
- package/agent-spine-plugin/spine-example/3-conduct.md +0 -8
- package/agent-spine-plugin/spine-example/4-history.md +0 -4
- package/bin/fredrik-glm-provider.cjs +0 -256
- package/bin/package-regression-policy.cjs +0 -77
- package/fredrik-glm-profile.toml.example +0 -26
- package/release-planned-removals.json +0 -15
- package/scripts/check-active-profile-plugin-startup.js +0 -36
- package/scripts/check-active-work-steer-regression.js +0 -46
- package/scripts/check-approval-observability-regression.js +0 -111
- package/scripts/check-approval-queue-shortcuts-regression.js +0 -65
- package/scripts/check-bundled-agent-spine-regression.js +0 -48
- package/scripts/check-codebase-search-packaging-regression.js +0 -92
- package/scripts/check-copy-command-regression.js +0 -74
- package/scripts/check-current-turn-read-pin-mutation-regression.js +0 -72
- package/scripts/check-current-turn-read-pin-regression.js +0 -94
- package/scripts/check-deepseek-native-max-regression.js +0 -49
- package/scripts/check-empty-response-effort-downgrade-regression.js +0 -48
- package/scripts/check-fredrik-glm-mutation-regression.js +0 -18
- package/scripts/check-fredrik-glm-regression.js +0 -169
- package/scripts/check-historical-tool-result-preview-regression.js +0 -77
- package/scripts/check-history-pressure-offload-regression.js +0 -77
- package/scripts/check-mcp-startup-wait-budget.js +0 -48
- package/scripts/check-package-regression.js +0 -38
- package/scripts/check-plugin-startup-regression.js +0 -53
- package/scripts/check-programmatic-context-isolation-regression.js +0 -193
- package/scripts/check-programmatic-tool-regression.js +0 -294
- package/scripts/check-queue-controls-regression.js +0 -189
- package/scripts/check-release-metadata.js +0 -103
- package/scripts/check-reload-agent-spine-regression.js +0 -76
- package/scripts/check-resume-replay-regression.js +0 -102
- package/scripts/check-session-cancel-regression.js +0 -43
- package/scripts/check-session-picker-resume-metrics-regression.js +0 -97
- package/scripts/check-session-start-hook-context-regression.js +0 -228
- package/scripts/check-shell-terminal-isolation-regression.js +0 -81
- package/scripts/check-slash-escape-regression.js +0 -89
- package/scripts/check-startup-swarm-command-regression.js +0 -24
- package/scripts/check-structured-subagent-output-regression.js +0 -331
- package/scripts/check-telegram-bridge-watchdog.js +0 -60
- package/scripts/check-telegram-direct-work-resume-regression.js +0 -53
- package/scripts/check-telegram-loop-exactly-once-regression.js +0 -71
- package/scripts/check-todo-loop-regression.js +0 -78
- package/scripts/check-todo-progress-regression.js +0 -416
- package/scripts/check-todo-recovery-catalog-regression.js +0 -50
- package/scripts/check-tool-schema-capacity-regression.js +0 -40
- package/scripts/programmatic-tool-runtime.test.mjs +0 -365
- package/scripts/structured-subagent-output.test.cjs +0 -170
- /package/{scripts → bin}/fix-node-pty-perms.js +0 -0
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
const {
|
|
4
|
+
DEFAULT_CONTEXT_PRESSURE_RATIO,
|
|
5
|
+
hasContextPressure,
|
|
6
|
+
} = require('./context-pressure-policy.cjs');
|
|
7
|
+
|
|
3
8
|
const TOOL_RESULT_MAX_CHARS = 12_000;
|
|
4
9
|
const TOOL_RESULT_PREVIEW_CHARS = 2_000;
|
|
5
10
|
const TOOL_RESULT_HISTORICAL_PREVIEW_CHARS = 400;
|
|
@@ -16,8 +21,13 @@ const TOOL_RESULT_HISTORICAL_REPLACEMENT_BUDGET_CHARS = 1_000;
|
|
|
16
21
|
const TOOL_RESULT_SUCCESS_KEEP_RECENT_MESSAGES = 12;
|
|
17
22
|
const TOOL_RESULT_HISTORICAL_SUCCESS_MARKER = '[Old tool result content cleared]';
|
|
18
23
|
const TOOL_RESULT_REPEAT_MARKER = '[Repeated tool result omitted]';
|
|
24
|
+
const TOOL_RESULT_OFFLOAD_PRESSURE_RATIO = DEFAULT_CONTEXT_PRESSURE_RATIO;
|
|
19
25
|
const READ_CONTINUATION_LINE_OFFSET_RE = /^Continue reading with line_offset=(\d+)\. Do not assume you have reached the end of the file\.$/mu;
|
|
20
26
|
|
|
27
|
+
function hasToolResultOffloadPressure(options = {}) {
|
|
28
|
+
return hasContextPressure(options);
|
|
29
|
+
}
|
|
30
|
+
|
|
21
31
|
function shouldOffloadToolResult(textLength) {
|
|
22
32
|
return Number.isFinite(textLength) && textLength > TOOL_RESULT_MAX_CHARS;
|
|
23
33
|
}
|
|
@@ -154,8 +164,9 @@ function compactPersistedToolResultReference(content) {
|
|
|
154
164
|
return changed ? compacted : content;
|
|
155
165
|
}
|
|
156
166
|
|
|
157
|
-
function compactHistoricalSuccessfulToolResults(messages) {
|
|
167
|
+
function compactHistoricalSuccessfulToolResults(messages, options = {}) {
|
|
158
168
|
if (!Array.isArray(messages) || messages.length === 0) return messages;
|
|
169
|
+
if (!hasToolResultOffloadPressure(options)) return messages;
|
|
159
170
|
|
|
160
171
|
const recentStart = Math.max(0, messages.length - TOOL_RESULT_SUCCESS_KEEP_RECENT_MESSAGES);
|
|
161
172
|
const freshIds = freshToolResultIds(messages);
|
|
@@ -326,6 +337,7 @@ function selectHistoricalToolResultOffloads(textLengths) {
|
|
|
326
337
|
}
|
|
327
338
|
|
|
328
339
|
module.exports = {
|
|
340
|
+
TOOL_RESULT_OFFLOAD_PRESSURE_RATIO,
|
|
329
341
|
TOOL_RESULT_BATCH_MAX_CHARS,
|
|
330
342
|
TOOL_RESULT_BATCH_MIN_ITEM_CHARS,
|
|
331
343
|
TOOL_RESULT_BATCH_REPLACEMENT_BUDGET_CHARS,
|
|
@@ -349,6 +361,7 @@ module.exports = {
|
|
|
349
361
|
currentUserTurnStartIndex,
|
|
350
362
|
dedupeRepeatedSuccessfulToolResults,
|
|
351
363
|
freshToolResultIds,
|
|
364
|
+
hasToolResultOffloadPressure,
|
|
352
365
|
isPersistedToolResultReference,
|
|
353
366
|
readContinuationLineOffset,
|
|
354
367
|
selectHistoricalToolResultOffloads,
|
package/bin/update-notice.js
CHANGED
|
@@ -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);
|
|
@@ -4,6 +4,7 @@ const {
|
|
|
4
4
|
hasHistoricalOffloadPressure,
|
|
5
5
|
historyTextChars,
|
|
6
6
|
} = require('./history-offload-pressure-policy.cjs');
|
|
7
|
+
const { hasContextPressure } = require('./context-pressure-policy.cjs');
|
|
7
8
|
|
|
8
9
|
const USER_MESSAGE_MAX_CHARS = 200_000;
|
|
9
10
|
const HISTORICAL_USER_MESSAGE_MAX_CHARS = 4_000;
|
|
@@ -30,7 +31,8 @@ function shouldOffloadHistoricalUserMessage(options = {}) {
|
|
|
30
31
|
|| historyIndex >= historyLength
|
|
31
32
|
) return false;
|
|
32
33
|
const cutoff = Math.max(0, historyLength - USER_MESSAGE_KEEP_RECENT_MESSAGES);
|
|
33
|
-
return
|
|
34
|
+
return hasContextPressure(options)
|
|
35
|
+
&& hasHistoricalOffloadPressure({ historyLength, historyChars })
|
|
34
36
|
&& historyIndex < cutoff
|
|
35
37
|
&& textChars > HISTORICAL_USER_MESSAGE_MAX_CHARS;
|
|
36
38
|
}
|