@bolt-cli/cli 0.15.2 → 0.15.4
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/lib/agent.js +14 -4
- package/lib/toolparse.js +9 -3
- package/package.json +36 -36
package/lib/agent.js
CHANGED
|
@@ -43,8 +43,9 @@ you to restate the intent with these tools (usually bash).
|
|
|
43
43
|
|
|
44
44
|
Call format is strict: emit every tool call ONLY as a fenced \`\`\`tool
|
|
45
45
|
block. Never as XML or chat-template syntax (<tool>, <tool_call>,
|
|
46
|
-
<function>, <function_calls>, <invoke>
|
|
47
|
-
|
|
46
|
+
<function>, <function_calls>, <invoke>, <dots_function_call> or any other
|
|
47
|
+
relay-native call tag), never as bare JSON outside a fence, and never
|
|
48
|
+
wrapped in 自知 or similar markup - the operator-visible
|
|
48
49
|
channel reads fenced blocks, and anything else reaches them as raw garbage.
|
|
49
50
|
Never send an empty reply: if you have nothing to add, state in one
|
|
50
51
|
sentence that the task is complete.
|
|
@@ -109,8 +110,17 @@ function summarizeDetail(detail, seenDetails = null) {
|
|
|
109
110
|
return s;
|
|
110
111
|
}
|
|
111
112
|
|
|
113
|
+
// The reply-discipline line sits at the VERY END of the first prompt, after
|
|
114
|
+
// the ~12KB protocol. Every saved session showed the same failure: turn 1
|
|
115
|
+
// returned zero tokens, then the empty-reply nudge (also at the end) made the
|
|
116
|
+
// model work immediately. The relay runs a reasoning model whose hidden
|
|
117
|
+
// thinking is not streamed; with the task buried mid-prompt it spent the whole
|
|
118
|
+
// reply there and emitted nothing. This says, in the position that demonstrably
|
|
119
|
+
// works, to answer visibly now - removing the wasted ~30s inference entirely.
|
|
120
|
+
const OUTPUT_DIRECTIVE = `The operator's task above is still active - do it in THIS reply. Emit operator-visible text only: either plain prose or a fenced tool block. Internal reasoning and hidden thinking are NOT delivered to the operator and leave them staring at an empty screen - do not spend the reply on them. If you need to think, first emit a short visible progress line, then continue. Never end a turn with no visible output.`;
|
|
121
|
+
|
|
112
122
|
function buildAgentPrompt({ target, objective, evidence, history, memory, session, account }) {
|
|
113
|
-
return `${api.buildPrompt({ target, objective, evidence, history, memory, session, account })}\n\n${TOOL_PROTOCOL}`;
|
|
123
|
+
return `${api.buildPrompt({ target, objective, evidence, history, memory, session, account })}\n\n${TOOL_PROTOCOL}\n\n${OUTPUT_DIRECTIVE}`;
|
|
114
124
|
}
|
|
115
125
|
|
|
116
126
|
const EMPTY_REPLY_NUDGE = `Your previous reply arrived at this terminal empty - no prose and no tool block. That is a protocol failure, not an answer. The ORIGINAL TASK is still in this message, above this note: do it now. Do not ask what the task is, do not ask for a target, and do not describe what you could do. Do not re-send internal reasoning, 自知 blocks or tool call syntax in any other shape. Either continue the task with one or more \`\`\`tool blocks, or give the finished answer in plain prose.`;
|
|
@@ -366,4 +376,4 @@ function toolFenceWriter(write) {
|
|
|
366
376
|
return toolparse.createMarkupFilter(write);
|
|
367
377
|
}
|
|
368
378
|
|
|
369
|
-
module.exports = { TOOL_PROTOCOL, TOOL_PROTOCOL_BODY, TERMINAL_BEGIN, TERMINAL_END, DEFAULT_MAX_ITERS, buildAgentPrompt, buildFollowup, runAgentLoop, truncateResult, summarizeDetail, toolFenceWriter, scrubOutbound };
|
|
379
|
+
module.exports = { TOOL_PROTOCOL, TOOL_PROTOCOL_BODY, TERMINAL_BEGIN, TERMINAL_END, OUTPUT_DIRECTIVE, DEFAULT_MAX_ITERS, buildAgentPrompt, buildFollowup, runAgentLoop, truncateResult, summarizeDetail, toolFenceWriter, scrubOutbound };
|
package/lib/toolparse.js
CHANGED
|
@@ -48,8 +48,14 @@ const RESERVED_ATTR_KEYS = new Set(["id", "type", "index", "session"]);
|
|
|
48
48
|
const THINK_TAGS = ["thinking", "thought", "scratchpad", "reasoning", "think"];
|
|
49
49
|
|
|
50
50
|
// XML-family tags that carry one call each. "function_calls" is a wrapper
|
|
51
|
-
// whose children are parsed recursively.
|
|
52
|
-
|
|
51
|
+
// whose children are parsed recursively. Some relays emit their native call
|
|
52
|
+
// tag instead of the instructed fence (e.g. <dots_function_call>); those are
|
|
53
|
+
// part of the same family — parse them as calls and keep them off the
|
|
54
|
+
// operator's screen, including when the call body is empty.
|
|
55
|
+
const XML_TAGS = [
|
|
56
|
+
"dots_function_calls", "dots_function_call", "dots_tool_call", "dots_tool_use", "dots_invoke",
|
|
57
|
+
"function_calls", "tool_call", "tool_use", "function_call", "function", "tool", "invoke",
|
|
58
|
+
];
|
|
53
59
|
|
|
54
60
|
const str = (v) => (typeof v === "string" && v.trim() ? v.trim() : null);
|
|
55
61
|
const firstOf = (obj, keys) => {
|
|
@@ -302,7 +308,7 @@ function xmlToCall(attrs, body) {
|
|
|
302
308
|
}
|
|
303
309
|
// No name but a nested call block (or nothing at all): recurse — the
|
|
304
310
|
// parameters collected here belong to the inner call, parsed whole.
|
|
305
|
-
const hasNestedCall = /<(?:antml:)?(?:function_calls|tool_call|tool_use|function_call|function|tool|invoke)\b/.test(trimmed);
|
|
311
|
+
const hasNestedCall = /<(?:antml:)?(?:dots_function_calls|dots_function_call|dots_tool_call|dots_tool_use|dots_invoke|function_calls|tool_call|tool_use|function_call|function|tool|invoke)\b/.test(trimmed);
|
|
306
312
|
if (!name && (hasNestedCall || !found)) return { recurse: true };
|
|
307
313
|
if (!name) return { ok: false, error: "no tool name in block" };
|
|
308
314
|
// Name without parameters while a nested call block sits inside: the real
|
package/package.json
CHANGED
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@bolt-cli/cli",
|
|
3
|
-
"version": "0.15.
|
|
4
|
-
"description": "Bolt terminal CLI — authorized testing and tool-building from your terminal or VS Code.",
|
|
5
|
-
"license": "SEE LICENSE IN LICENSE",
|
|
6
|
-
"type": "commonjs",
|
|
7
|
-
"engines": {
|
|
8
|
-
"node": ">=18"
|
|
9
|
-
},
|
|
10
|
-
"bin": {
|
|
11
|
-
"bolt": "bin/bolt.js"
|
|
12
|
-
},
|
|
13
|
-
"files": [
|
|
14
|
-
"bin/",
|
|
15
|
-
"lib/",
|
|
16
|
-
"templates/",
|
|
17
|
-
"README.md",
|
|
18
|
-
"LICENSE"
|
|
19
|
-
],
|
|
20
|
-
"keywords": [
|
|
21
|
-
"security",
|
|
22
|
-
"pentest",
|
|
23
|
-
"red-team",
|
|
24
|
-
"nmap",
|
|
25
|
-
"bolt"
|
|
26
|
-
],
|
|
27
|
-
"repository": {
|
|
28
|
-
"type": "git",
|
|
29
|
-
"url": "git+https://github.com/WarrenMu/Beera-Cyber-new-.git",
|
|
30
|
-
"directory": "cli"
|
|
31
|
-
},
|
|
32
|
-
"homepage": "https://github.com/WarrenMu/Beera-Cyber-new-#readme",
|
|
33
|
-
"publishConfig": {
|
|
34
|
-
"access": "public"
|
|
35
|
-
}
|
|
36
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@bolt-cli/cli",
|
|
3
|
+
"version": "0.15.4",
|
|
4
|
+
"description": "Bolt terminal CLI — authorized testing and tool-building from your terminal or VS Code.",
|
|
5
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
6
|
+
"type": "commonjs",
|
|
7
|
+
"engines": {
|
|
8
|
+
"node": ">=18"
|
|
9
|
+
},
|
|
10
|
+
"bin": {
|
|
11
|
+
"bolt": "bin/bolt.js"
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"bin/",
|
|
15
|
+
"lib/",
|
|
16
|
+
"templates/",
|
|
17
|
+
"README.md",
|
|
18
|
+
"LICENSE"
|
|
19
|
+
],
|
|
20
|
+
"keywords": [
|
|
21
|
+
"security",
|
|
22
|
+
"pentest",
|
|
23
|
+
"red-team",
|
|
24
|
+
"nmap",
|
|
25
|
+
"bolt"
|
|
26
|
+
],
|
|
27
|
+
"repository": {
|
|
28
|
+
"type": "git",
|
|
29
|
+
"url": "git+https://github.com/WarrenMu/Beera-Cyber-new-.git",
|
|
30
|
+
"directory": "cli"
|
|
31
|
+
},
|
|
32
|
+
"homepage": "https://github.com/WarrenMu/Beera-Cyber-new-#readme",
|
|
33
|
+
"publishConfig": {
|
|
34
|
+
"access": "public"
|
|
35
|
+
}
|
|
36
|
+
}
|