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
@@ -1,60 +0,0 @@
1
- #!/usr/bin/env node
2
- 'use strict';
3
-
4
- const assert = require('node:assert/strict');
5
- const fs = require('node:fs');
6
- const path = require('node:path');
7
-
8
- const bundle = fs.readFileSync(path.join(__dirname, '..', 'blun.mjs'), 'utf8');
9
-
10
- function between(start, end) {
11
- const startIndex = bundle.indexOf(start);
12
- assert.notEqual(startIndex, -1, `missing bundle marker: ${start}`);
13
- const endIndex = bundle.indexOf(end, startIndex + start.length);
14
- assert.notEqual(endIndex, -1, `missing bundle marker: ${end}`);
15
- return bundle.slice(startIndex, endIndex);
16
- }
17
-
18
- function method(name, nextName) {
19
- const source = between(`\n\t${name}(`, `\n\t${nextName}(`).trim();
20
- return Function(`"use strict"; return ({${source}}).${name};`)();
21
- }
22
-
23
- async function main() {
24
- const scheduleBridgeRestart = method('scheduleBridgeRestart', 'ensureBridgeRunning');
25
- const host = {
26
- stopped: false,
27
- activeOwner: true,
28
- bridgeRestartTimer: undefined,
29
- bridgeRestartDelayMs: 5,
30
- ownsChannel() { return true; },
31
- starts: 0,
32
- ensureBridgeRunning() { this.starts += 1; },
33
- };
34
-
35
- scheduleBridgeRestart.call(host);
36
- const firstTimer = host.bridgeRestartTimer;
37
- assert.notEqual(firstTimer, undefined);
38
- scheduleBridgeRestart.call(host);
39
- assert.equal(host.bridgeRestartTimer, firstTimer, 'restart scheduling must be deduplicated');
40
- await new Promise((resolve) => setTimeout(resolve, 25));
41
- assert.equal(host.starts, 1, 'a dead owned bridge must be restarted once');
42
- assert.equal(host.bridgeRestartTimer, undefined);
43
-
44
- host.stopped = true;
45
- scheduleBridgeRestart.call(host);
46
- assert.equal(host.bridgeRestartTimer, undefined, 'stopped controllers must not restart bridges');
47
-
48
- const ensureBridgeRunning = between('\n\tensureBridgeRunning() {', '\n\tresolveBridgeEntry() {');
49
- assert.match(ensureBridgeRunning, /child\.once\("exit",[\s\S]*this\.scheduleBridgeRestart\(\)/);
50
- assert.match(ensureBridgeRunning, /child\.once\("error",[\s\S]*this\.scheduleBridgeRestart\(\)/);
51
- const beginStop = between('\n\tbeginStop() {', '\n\tasync stopOwnedBridge(');
52
- assert.match(beginStop, /clearTimeout\(this\.bridgeRestartTimer\)/);
53
-
54
- process.stdout.write('telegram-bridge-watchdog PASS\n');
55
- }
56
-
57
- main().catch((error) => {
58
- console.error(error);
59
- process.exitCode = 1;
60
- });
@@ -1,71 +0,0 @@
1
- const assert = require('node:assert/strict');
2
- const fs = require('node:fs');
3
- const path = require('node:path');
4
-
5
- const bundlePath = process.env.BLUN_BUNDLE_UNDER_TEST
6
- ? path.resolve(process.env.BLUN_BUNDLE_UNDER_TEST)
7
- : path.join(__dirname, '..', 'blun.mjs');
8
- const bundle = fs.readFileSync(bundlePath, 'utf8');
9
- const match = /async function handleLoopCommand\(host, args\) \{([\s\S]*?)\n\}\nfunction hasRunnableSession/.exec(bundle);
10
- assert(match, 'TELEGRAM_LOOP_EXACTLY_ONCE: handleLoopCommand is missing');
11
-
12
- const handleLoopCommand = Function(
13
- 'parseLoopCommand',
14
- 'hasRunnableSession',
15
- 'llmNotSetMessage',
16
- 'isStreaming',
17
- `return async function handleLoopCommand(host, args) {${match[1]}\n};`,
18
- )(
19
- () => ({ kind: 'create', interval: '*/5 * * * *', prompt: 'work once' }),
20
- () => true,
21
- () => 'missing model',
22
- (host) => host.streaming,
23
- );
24
-
25
- function createHost({ telegram = false, streaming = true } = {}) {
26
- const calls = { send: [], enqueue: [] };
27
- const session = {
28
- async createLoop({ interval, prompt }) {
29
- return { interval, prompt, status: 'active' };
30
- },
31
- };
32
- const host = {
33
- streaming,
34
- session,
35
- telegramRemoteCommandContext: telegram ? { item: { telegramCommandName: 'loop' } } : undefined,
36
- state: { appState: { isCompacting: false, model: 'blun/king' } },
37
- requireSession() { return session; },
38
- setAppState() {},
39
- track() {},
40
- showStatus() {},
41
- showError(message) { throw new Error(message); },
42
- sendNormalUserInput(text) { calls.send.push(text); },
43
- enqueueNormalUserInput(text) { calls.enqueue.push(text); },
44
- };
45
- return { host, calls };
46
- }
47
-
48
- (async () => {
49
- const telegram = createHost({ telegram: true, streaming: true });
50
- await handleLoopCommand(telegram.host, '5 min work once');
51
- assert.deepEqual(telegram.calls.send, ['work once']);
52
- assert.deepEqual(
53
- telegram.calls.enqueue,
54
- [],
55
- 'TELEGRAM_LOOP_EXACTLY_ONCE: Telegram loop payload must not survive in the normal queue',
56
- );
57
-
58
- const local = createHost({ telegram: false, streaming: true });
59
- await handleLoopCommand(local.host, '5 min work once');
60
- assert.deepEqual(local.calls.send, []);
61
- assert.deepEqual(
62
- local.calls.enqueue,
63
- ['work once'],
64
- 'TELEGRAM_LOOP_EXACTLY_ONCE: local busy-loop behavior must stay queued',
65
- );
66
-
67
- console.log('telegram-loop-exactly-once-regression PASS');
68
- })().catch((error) => {
69
- console.error(error);
70
- process.exitCode = 1;
71
- });
@@ -1,78 +0,0 @@
1
- #!/usr/bin/env node
2
- 'use strict';
3
-
4
- const fs = require('node:fs');
5
- const path = require('node:path');
6
- const { enforceSingleTodoWritePerStep } = require('../bin/todo-list-turn-policy.cjs');
7
-
8
- const bundlePath = process.env.BLUN_BUNDLE_UNDER_TEST
9
- ? path.resolve(process.env.BLUN_BUNDLE_UNDER_TEST)
10
- : path.resolve(__dirname, '..', 'blun.mjs');
11
- const bundle = fs.readFileSync(bundlePath, 'utf8');
12
-
13
- function assert(condition, message) {
14
- if (!condition) throw new Error(message);
15
- }
16
-
17
- assert(
18
- !bundle.includes('TodoList is unchanged after extended work'),
19
- 'TODO_LOOP_REGRESSION: unchanged truthful TodoList refreshes must remain accepted',
20
- );
21
- assert(
22
- !/isIdle:\s*\(task\)\s*=>[\s\S]{0,240}owner\s*!==\s*["']session-loop["']/.test(bundle),
23
- 'TODO_LOOP_REGRESSION: unfinished TodoList work must not suppress an idle session loop',
24
- );
25
- assert(
26
- /isIdle:\s*\(\)\s*=>\s*!agent\.turn\.hasActiveTurn/.test(bundle),
27
- 'TODO_LOOP_REGRESSION: expected idle-only session loop scheduler wiring is missing',
28
- );
29
- assert(
30
- /todos\.filter\(\(todo\)\s*=>\s*todo\.status\s*!==\s*["']done["']\)/.test(bundle),
31
- 'TODO_LIFECYCLE_REGRESSION: completed items must be pruned from the stored visible list',
32
- );
33
- assert(
34
- /const PENDING_TEXT\s*=\s*["']#aeb8c6["']/.test(bundle)
35
- && !/const PENDING_TEXT\s*=\s*["']#2a3550["']/.test(bundle),
36
- 'TODO_UI_REGRESSION: pending markers must remain visible on ANSI16 terminals',
37
- );
38
- assert(
39
- /activeGoal\s*===\s*null\s*&&\s*!startsTrackedList/.test(bundle)
40
- && /The first TodoList must contain at least one item, exactly one in_progress item/.test(bundle),
41
- 'TODO_INITIAL_STATE_REGRESSION: a new non-goal TodoList must not accept an all-pending list',
42
- );
43
- assert(
44
- /enforceSingleTodoWritePerStep\(ctx\)/.test(bundle),
45
- 'TODO_PARALLEL_REGRESSION: per-step TodoList write guard is not wired',
46
- );
47
-
48
- const calls = [
49
- { id: 'todo-first', name: 'TodoList' },
50
- { id: 'todo-second', name: 'TodoList' },
51
- ];
52
- assert(
53
- enforceSingleTodoWritePerStep({
54
- toolCall: calls[0],
55
- toolCalls: calls,
56
- args: { todos: [{ title: 'first', status: 'in_progress' }] },
57
- }) === undefined,
58
- 'TODO_PARALLEL_REGRESSION: first TodoList write must remain executable',
59
- );
60
- const duplicateWrite = enforceSingleTodoWritePerStep({
61
- toolCall: calls[1],
62
- toolCalls: calls,
63
- args: { todos: [{ title: 'second', status: 'in_progress' }] },
64
- });
65
- assert(
66
- duplicateWrite?.block === true,
67
- 'TODO_PARALLEL_REGRESSION: later TodoList writes in the same step must be blocked',
68
- );
69
- assert(
70
- enforceSingleTodoWritePerStep({
71
- toolCall: { id: 'todo-read', name: 'TodoList' },
72
- toolCalls: calls,
73
- args: {},
74
- }) === undefined,
75
- 'TODO_PARALLEL_REGRESSION: read-only TodoList queries must not be blocked',
76
- );
77
-
78
- process.stdout.write('todo-loop-regression PASS\n');
@@ -1,50 +0,0 @@
1
- #!/usr/bin/env node
2
- 'use strict';
3
-
4
- const fs = require('node:fs');
5
- const path = require('node:path');
6
-
7
- const bundlePath = process.env.BLUN_BUNDLE_UNDER_TEST
8
- ? path.resolve(process.env.BLUN_BUNDLE_UNDER_TEST)
9
- : path.resolve(__dirname, '..', 'blun.mjs');
10
- const bundle = fs.readFileSync(bundlePath, 'utf8');
11
-
12
- function assert(condition, message) {
13
- if (!condition) throw new Error(message);
14
- }
15
-
16
- const namesMatch = bundle.match(
17
- /const TODO_MAINTENANCE_RECOVERY_TOOL_NAMES = new Set\(\[([\s\S]*?)\]\);/,
18
- );
19
- const functionMatch = bundle.match(
20
- /function goalTodoMaintenanceTools\(eligibleTools, selectedTools\) \{[\s\S]*?\n\}/,
21
- );
22
-
23
- assert(
24
- !/proactive TodoList maintenance step[\s\S]{0,900}tools:\s*\[todoTool\]/.test(bundle),
25
- 'TODO_RECOVERY_CATALOG_REGRESSION: proactive maintenance still switches to TodoList-only',
26
- );
27
- assert(namesMatch, 'TODO_RECOVERY_CATALOG_REGRESSION: recovery tool names are missing');
28
- assert(functionMatch, 'TODO_RECOVERY_CATALOG_REGRESSION: recovery catalogue selector is missing');
29
- assert(
30
- /proactive TodoList maintenance step[\s\S]{0,1100}tools:\s*todoMaintenanceTools/.test(bundle),
31
- 'TODO_RECOVERY_CATALOG_REGRESSION: proactive maintenance is not wired to the recovery catalogue',
32
- );
33
-
34
- const selectMaintenanceTools = Function(
35
- `const TODO_MAINTENANCE_RECOVERY_TOOL_NAMES = new Set([${namesMatch[1]}]); return (${functionMatch[0]});`,
36
- )();
37
- const tools = ['TodoList', 'Read', 'Write', 'Edit', 'Bash', 'WebSearch'].map((name) => ({ name }));
38
- const selected = [tools[5], tools[1]];
39
- const actual = selectMaintenanceTools(tools, selected).map((tool) => tool.name);
40
-
41
- assert(
42
- actual.join(',') === 'WebSearch,Read,TodoList,Write,Edit,Bash',
43
- `TODO_RECOVERY_CATALOG_REGRESSION: unexpected catalogue ${actual.join(',')}`,
44
- );
45
- assert(
46
- new Set(actual).size === actual.length,
47
- 'TODO_RECOVERY_CATALOG_REGRESSION: recovery catalogue contains duplicates',
48
- );
49
-
50
- process.stdout.write('todo-recovery-catalog-regression PASS\n');
File without changes