blun-king-cli 9.1.563 → 9.1.565
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/agent-spine-plugin/.claude-plugin/marketplace.json +20 -20
- package/agent-spine-plugin/.claude-plugin/plugin.json +14 -14
- package/agent-spine-plugin/.codex-plugin/plugin.json +34 -34
- package/agent-spine-plugin/.mcp.json +8 -8
- package/agent-spine-plugin/CONTRIBUTING.md +52 -0
- package/agent-spine-plugin/LICENSE +186 -186
- package/agent-spine-plugin/README.md +394 -0
- package/agent-spine-plugin/SECURITY.md +47 -0
- package/agent-spine-plugin/assets/agentspine-banner.svg +32 -32
- package/agent-spine-plugin/bin/agentspine-mcp.js +4 -4
- package/agent-spine-plugin/bin/agentspine.js +7 -7
- package/agent-spine-plugin/blun.plugin.json +33 -33
- package/agent-spine-plugin/hooks/codex.json +47 -47
- package/agent-spine-plugin/hooks/hooks.json +106 -106
- package/agent-spine-plugin/hooks/version.json +5 -5
- package/agent-spine-plugin/package.json +69 -69
- package/agent-spine-plugin/scripts/check-hosts.js +199 -199
- package/agent-spine-plugin/skill/SKILL.md +76 -76
- package/agent-spine-plugin/skills/agent-spine/SKILL.md +85 -85
- package/agent-spine-plugin/src/cli.js +1488 -1442
- package/agent-spine-plugin/src/hook.js +886 -812
- package/agent-spine-plugin/src/index.js +93 -93
- package/agent-spine-plugin/src/lib/acceptance.js +333 -333
- package/agent-spine-plugin/src/lib/attention.js +755 -755
- package/agent-spine-plugin/src/lib/audit.js +351 -342
- package/agent-spine-plugin/src/lib/authentication.js +515 -515
- package/agent-spine-plugin/src/lib/briefing.js +317 -317
- package/agent-spine-plugin/src/lib/catalog.js +167 -167
- package/agent-spine-plugin/src/lib/channel-runtime.js +665 -665
- package/agent-spine-plugin/src/lib/context.js +154 -154
- package/agent-spine-plugin/src/lib/continuity.js +338 -338
- package/agent-spine-plugin/src/lib/coordination.js +577 -577
- package/agent-spine-plugin/src/lib/documents.js +217 -217
- package/agent-spine-plugin/src/lib/feed-transport.js +499 -499
- package/agent-spine-plugin/src/lib/filesystem-retry.js +32 -32
- package/agent-spine-plugin/src/lib/gateway-runtime.js +1119 -760
- package/agent-spine-plugin/src/lib/graph.js +337 -337
- package/agent-spine-plugin/src/lib/hook-audit.js +29 -0
- package/agent-spine-plugin/src/lib/https-transport.js +392 -392
- package/agent-spine-plugin/src/lib/indexed-memory-offline.js +40 -40
- package/agent-spine-plugin/src/lib/indexed-memory.js +281 -281
- package/agent-spine-plugin/src/lib/learning.js +6923 -6466
- package/agent-spine-plugin/src/lib/object-transport.js +206 -206
- package/agent-spine-plugin/src/lib/owned-file-lock.js +143 -143
- package/agent-spine-plugin/src/lib/paths.js +109 -109
- package/agent-spine-plugin/src/lib/peer-transport.js +283 -283
- package/agent-spine-plugin/src/lib/persona-runtime.js +581 -581
- package/agent-spine-plugin/src/lib/preflight.js +702 -702
- package/agent-spine-plugin/src/lib/runtime.js +13 -13
- package/agent-spine-plugin/src/lib/selfstarter.js +892 -819
- package/agent-spine-plugin/src/lib/sharing.js +969 -969
- package/agent-spine-plugin/src/lib/source-roots.js +529 -482
- package/agent-spine-plugin/src/lib/sqlite-transport.js +501 -501
- package/agent-spine-plugin/src/lib/telegram-adapter.js +119 -119
- package/agent-spine-plugin/src/lib/voice-runtime.js +39 -39
- package/agent-spine-plugin/src/mcp.js +597 -572
- package/agent-spine-plugin/src/version.js +1 -1
- package/agent-spine-plugin/src/worker.js +202 -195
- package/bin/active-steer-priority-policy.cjs +24 -0
- package/bin/launcher-runtime.js +8 -1
- package/bin/mnemo-tool-agent-policy.cjs +22 -0
- package/bin/thinking-activity-status-policy.cjs +132 -0
- package/bin/thinking-only-guard.cjs +75 -0
- package/bin/tool-call-loop-policy.cjs +53 -0
- package/bin/turn-thinking-policy.cjs +25 -1
- package/blun.mjs +554 -64
- package/package.json +4 -1
- package/standard-skills/translate-native/LICENSE +21 -21
- package/standard-skills/translate-native/references/evaluation-protocol.md +95 -95
- package/standard-skills/translate-native/references/native-orthography.md +79 -79
- package/standard-skills/translate-native/references/native-translation-standard.md +94 -94
- package/standard-skills/translate-native/references/structured-content.md +72 -72
- package/standard-skills/translate-native/references/translationese-review.md +77 -77
- package/standard-skills/translate-native/scripts/blun_language_guard.py +697 -697
- package/standard-skills/translate-native/scripts/check_diacritics.py +353 -353
- package/standard-skills/translate-native/scripts/guard_service_client.py +264 -264
- package/standard-skills/translate-native/scripts/language_gateway.py +62 -62
- package/standard-skills/translate-native/scripts/language_quality.py +377 -377
- package/standard-skills/translate-native/scripts/pre_output_guard.py +64 -64
- package/standard-skills/translate-native/scripts/translation_guard.py +916 -916
- package/standard-tools/language-guard/blun_language_guard.py +697 -697
- package/standard-tools/language-guard/check_diacritics.py +353 -353
- package/standard-tools/language-guard/guard_service_client.py +264 -264
- package/standard-tools/language-guard/language_quality.py +377 -377
- package/standard-tools/language-guard/translation_guard.py +916 -916
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const DEFAULT_THINKING_ONLY_LIMIT_MS = 10 * 60 * 1000;
|
|
4
|
+
const FORCE_ANSWER_PROMPT = [
|
|
5
|
+
'Stop hidden thinking now and answer with the concrete finding, blocker, or next action.',
|
|
6
|
+
'Do not call tools and do not ask for another task.',
|
|
7
|
+
].join(' ');
|
|
8
|
+
|
|
9
|
+
function createThinkingOnlyGuard(options = {}) {
|
|
10
|
+
const maxMs = options.maxMs ?? DEFAULT_THINKING_ONLY_LIMIT_MS;
|
|
11
|
+
const now = options.now ?? Date.now;
|
|
12
|
+
const setTimer = options.setTimer ?? setTimeout;
|
|
13
|
+
const clearTimer = options.clearTimer ?? clearTimeout;
|
|
14
|
+
const onTimeout = options.onTimeout ?? (() => {});
|
|
15
|
+
let timer;
|
|
16
|
+
let startedAt;
|
|
17
|
+
let substantiveOutput = false;
|
|
18
|
+
|
|
19
|
+
function disarm() {
|
|
20
|
+
if (timer !== undefined) clearTimer(timer);
|
|
21
|
+
timer = undefined;
|
|
22
|
+
startedAt = undefined;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function beginAttempt() {
|
|
26
|
+
disarm();
|
|
27
|
+
substantiveOutput = false;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function noteThinking() {
|
|
31
|
+
if (substantiveOutput || timer !== undefined) return;
|
|
32
|
+
startedAt = now();
|
|
33
|
+
timer = setTimer(() => {
|
|
34
|
+
timer = undefined;
|
|
35
|
+
const elapsedMs = Math.max(0, now() - startedAt);
|
|
36
|
+
startedAt = undefined;
|
|
37
|
+
onTimeout({ reason: 'thinking_only_timeout', elapsedMs });
|
|
38
|
+
}, maxMs);
|
|
39
|
+
timer?.unref?.();
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function noteSubstantiveOutput() {
|
|
43
|
+
substantiveOutput = true;
|
|
44
|
+
disarm();
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
return {
|
|
48
|
+
beginAttempt,
|
|
49
|
+
noteThinking,
|
|
50
|
+
noteSubstantiveOutput,
|
|
51
|
+
stop: disarm,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
function forceAnswerParams(params) {
|
|
56
|
+
return {
|
|
57
|
+
...params,
|
|
58
|
+
tools: [],
|
|
59
|
+
messages: [
|
|
60
|
+
...params.messages,
|
|
61
|
+
{
|
|
62
|
+
role: 'user',
|
|
63
|
+
content: [{ type: 'text', text: FORCE_ANSWER_PROMPT }],
|
|
64
|
+
toolCalls: [],
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
module.exports = {
|
|
71
|
+
DEFAULT_THINKING_ONLY_LIMIT_MS,
|
|
72
|
+
FORCE_ANSWER_PROMPT,
|
|
73
|
+
createThinkingOnlyGuard,
|
|
74
|
+
forceAnswerParams,
|
|
75
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const { createHash } = require('node:crypto');
|
|
4
|
+
|
|
5
|
+
const FORCE_ANSWER_RESULT_STREAK = 3;
|
|
6
|
+
const NUMBER_VALUE = '<number>';
|
|
7
|
+
const NUMBER_TEXT = /[-+]?(?:\d+(?:\.\d+)?|\.\d+)(?:e[-+]?\d+)?/giu;
|
|
8
|
+
|
|
9
|
+
function normalizeLoopText(value) {
|
|
10
|
+
return String(value).toLowerCase().replace(NUMBER_TEXT, NUMBER_VALUE);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function normalizeLoopValue(value) {
|
|
14
|
+
if (typeof value === 'number' || typeof value === 'bigint') return NUMBER_VALUE;
|
|
15
|
+
if (typeof value === 'string') return normalizeLoopText(value);
|
|
16
|
+
if (Array.isArray(value)) return value.map(normalizeLoopValue);
|
|
17
|
+
if (value === null || typeof value !== 'object') return value;
|
|
18
|
+
|
|
19
|
+
const normalized = {};
|
|
20
|
+
for (const key of Object.keys(value).sort((left, right) => left.localeCompare(right))) {
|
|
21
|
+
normalized[key.toLowerCase()] = normalizeLoopValue(value[key]);
|
|
22
|
+
}
|
|
23
|
+
return normalized;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function createToolCallLoopKey(toolName, args) {
|
|
27
|
+
return `${normalizeLoopText(toolName)} ${JSON.stringify(normalizeLoopValue(args))}`;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function hashToolResult(result) {
|
|
31
|
+
const normalized = normalizeResultValue({
|
|
32
|
+
isError: result?.isError === true,
|
|
33
|
+
output: result?.output,
|
|
34
|
+
});
|
|
35
|
+
return createHash('sha256').update(JSON.stringify(normalized)).digest('hex');
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function normalizeResultValue(value) {
|
|
39
|
+
if (Array.isArray(value)) return value.map(normalizeResultValue);
|
|
40
|
+
if (value === null || typeof value !== 'object') return value;
|
|
41
|
+
const normalized = {};
|
|
42
|
+
for (const key of Object.keys(value).sort((left, right) => left.localeCompare(right))) {
|
|
43
|
+
normalized[key] = normalizeResultValue(value[key]);
|
|
44
|
+
}
|
|
45
|
+
return normalized;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
module.exports = {
|
|
49
|
+
FORCE_ANSWER_RESULT_STREAK,
|
|
50
|
+
createToolCallLoopKey,
|
|
51
|
+
hashToolResult,
|
|
52
|
+
normalizeLoopValue,
|
|
53
|
+
};
|
|
@@ -7,8 +7,27 @@ const BOSNIAN_STANDALONE_CHAT = /^(?:zdravo|pozdrav|hvala|ćao|cao)[.!?]*$/iu;
|
|
|
7
7
|
const IDENTITY_CHAT = /^(?:wer bist du|who are you|wie geht(?: es dir)?|how are you|na|kako si|kako je king|ko si ti|ko stoji iza tebe)[.!?]*$/iu;
|
|
8
8
|
const STATUS_ONLY_CHECK_IN = /(?:\bstandabfrage\b|\bstatusabfrage\b|\bkurzes?\s+update\b|\bwo\s+stehst\s+du\b|\bwie\s+weit\s+bist\s+du\b|\bwhere\s+are\s+you\b|\bquick\s+status\b)/iu;
|
|
9
9
|
const STATUS_FOLLOW_UP_ACTION = /\b(?:aendere|arbeite|baue|build|change|delete|deploy|deploye|fahr|fix|fixe|implement|implementiere|install|installiere|loesche|mach|patch|pruefe|repariere|run|schreibe|setze|start|starte|stop|stoppe|test|teste|write)\b/iu;
|
|
10
|
+
const THINKING_EFFORT_RANK = Object.freeze({
|
|
11
|
+
none: 0,
|
|
12
|
+
off: 0,
|
|
13
|
+
low: 1,
|
|
14
|
+
medium: 2,
|
|
15
|
+
high: 3,
|
|
16
|
+
xhigh: 4,
|
|
17
|
+
max: 5,
|
|
18
|
+
});
|
|
10
19
|
|
|
11
|
-
function
|
|
20
|
+
function keepOnlyEffortIncrease(selectedEffort, profileEffort) {
|
|
21
|
+
if (selectedEffort === undefined || profileEffort === undefined || profileEffort === null) {
|
|
22
|
+
return selectedEffort;
|
|
23
|
+
}
|
|
24
|
+
const selectedRank = THINKING_EFFORT_RANK[selectedEffort];
|
|
25
|
+
const profileRank = THINKING_EFFORT_RANK[profileEffort];
|
|
26
|
+
if (selectedRank === undefined || profileRank === undefined || selectedRank <= profileRank) return undefined;
|
|
27
|
+
return selectedEffort;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function classifyThinkingEffortForTurn(text, originKind) {
|
|
12
31
|
if (originKind !== "user") return undefined;
|
|
13
32
|
|
|
14
33
|
const normalized = String(text ?? "").replace(/\s+/gu, " ").trim();
|
|
@@ -30,6 +49,10 @@ function selectThinkingEffortForTurn(text, originKind) {
|
|
|
30
49
|
return shortQuestion ? "low" : undefined;
|
|
31
50
|
}
|
|
32
51
|
|
|
52
|
+
function selectThinkingEffortForTurn(text, originKind, profileEffort) {
|
|
53
|
+
return keepOnlyEffortIncrease(classifyThinkingEffortForTurn(text, originKind), profileEffort);
|
|
54
|
+
}
|
|
55
|
+
|
|
33
56
|
function shouldEnableThinkingForTurn(text, originKind) {
|
|
34
57
|
return selectThinkingEffortForTurn(text, originKind) !== "off";
|
|
35
58
|
}
|
|
@@ -59,6 +82,7 @@ module.exports = {
|
|
|
59
82
|
ACTIONABLE_PROMPT,
|
|
60
83
|
EXPLICIT_THINKING_INTENT,
|
|
61
84
|
capCompletionBudgetForAdaptiveEffort,
|
|
85
|
+
keepOnlyEffortIncrease,
|
|
62
86
|
selectThinkingEffortForBufferedSteer,
|
|
63
87
|
selectThinkingEffortForWorkStep,
|
|
64
88
|
selectThinkingEffortForTurn,
|