@burtson-labs/agent-core 1.6.95 → 1.6.97
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/dist/graph/routing.d.ts +1 -1
- package/dist/graph/routing.d.ts.map +1 -1
- package/dist/graph/routing.js +6 -2
- package/dist/graph/routing.js.map +1 -1
- package/dist/mcp/clientPool.d.ts.map +1 -1
- package/dist/mcp/clientPool.js +13 -2
- package/dist/mcp/clientPool.js.map +1 -1
- package/dist/mcp/server.d.ts +28 -1
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +39 -5
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/toolAdapter.d.ts +43 -1
- package/dist/mcp/toolAdapter.d.ts.map +1 -1
- package/dist/mcp/toolAdapter.js +49 -8
- package/dist/mcp/toolAdapter.js.map +1 -1
- package/dist/mcp/types.d.ts +9 -0
- package/dist/mcp/types.d.ts.map +1 -1
- package/dist/tools/core-tools.d.ts +7 -0
- package/dist/tools/core-tools.d.ts.map +1 -1
- package/dist/tools/core-tools.js +25 -1
- package/dist/tools/core-tools.js.map +1 -1
- package/dist/tools/git-tools.js +2 -2
- package/dist/tools/git-tools.js.map +1 -1
- package/dist/tools/loop/singleToolExecute.d.ts +4 -0
- package/dist/tools/loop/singleToolExecute.d.ts.map +1 -1
- package/dist/tools/loop/singleToolExecute.js +13 -2
- package/dist/tools/loop/singleToolExecute.js.map +1 -1
- package/dist/tools/loop/toolErrorAcknowledged.d.ts +20 -0
- package/dist/tools/loop/toolErrorAcknowledged.d.ts.map +1 -0
- package/dist/tools/loop/toolErrorAcknowledged.js +38 -0
- package/dist/tools/loop/toolErrorAcknowledged.js.map +1 -0
- package/dist/tools/skills/git-skill.js +1 -1
- package/dist/tools/skills/git-skill.js.map +1 -1
- package/dist/tools/skills/test-gen-skill.d.ts +11 -0
- package/dist/tools/skills/test-gen-skill.d.ts.map +1 -1
- package/dist/tools/skills/test-gen-skill.js +40 -6
- package/dist/tools/skills/test-gen-skill.js.map +1 -1
- package/dist/tools/skills/web-artifact-skill.d.ts +6 -6
- package/dist/tools/skills/web-artifact-skill.d.ts.map +1 -1
- package/dist/tools/skills/web-artifact-skill.js +11 -6
- package/dist/tools/skills/web-artifact-skill.js.map +1 -1
- package/dist/tools/tool-types.d.ts +51 -0
- package/dist/tools/tool-types.d.ts.map +1 -1
- package/dist/tools/tool-use-loop.d.ts.map +1 -1
- package/dist/tools/tool-use-loop.js +13 -2
- package/dist/tools/tool-use-loop.js.map +1 -1
- package/dist/tools/tool-use-parser.d.ts +14 -1
- package/dist/tools/tool-use-parser.d.ts.map +1 -1
- package/dist/tools/tool-use-parser.js +45 -3
- package/dist/tools/tool-use-parser.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Does a final answer already explain the tool error it follows?
|
|
3
|
+
*
|
|
4
|
+
* The tool-error recovery nudge exists for one failure: a tool call
|
|
5
|
+
* errors, and the model's next reply quietly drops the task without a
|
|
6
|
+
* retry or an explanation. It must NOT fire when the reply already says
|
|
7
|
+
* why the task cannot go on. Observed live (CLI 1.7.515, 2026-11-13):
|
|
8
|
+
* web_fetch on burtson.ai returned "Blocked: burtson.ai resolves to the
|
|
9
|
+
* private ... address 192.168.1.44. Set BANDIT_ALLOW_PRIVATE_WEB_FETCH=1
|
|
10
|
+
* ...", the model answered with exactly that explanation plus what it
|
|
11
|
+
* knew, the nudge fired anyway, and the model restated the same answer,
|
|
12
|
+
* so the terminal showed it twice under a wall of "automated harness
|
|
13
|
+
* check" reasoning.
|
|
14
|
+
*
|
|
15
|
+
* An answer counts as acknowledging the error when it has real prose and
|
|
16
|
+
* EITHER repeats a distinctive token from the error output (a hostname,
|
|
17
|
+
* an address, an env var, a path) OR plainly says the step failed.
|
|
18
|
+
*/
|
|
19
|
+
export declare function answerAcknowledgesToolError(answer: string, errorOutputs: readonly string[]): boolean;
|
|
20
|
+
//# sourceMappingURL=toolErrorAcknowledged.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolErrorAcknowledged.d.ts","sourceRoot":"","sources":["../../../src/tools/loop/toolErrorAcknowledged.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAWH,wBAAgB,2BAA2B,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAMpG"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Does a final answer already explain the tool error it follows?
|
|
4
|
+
*
|
|
5
|
+
* The tool-error recovery nudge exists for one failure: a tool call
|
|
6
|
+
* errors, and the model's next reply quietly drops the task without a
|
|
7
|
+
* retry or an explanation. It must NOT fire when the reply already says
|
|
8
|
+
* why the task cannot go on. Observed live (CLI 1.7.515, 2026-11-13):
|
|
9
|
+
* web_fetch on burtson.ai returned "Blocked: burtson.ai resolves to the
|
|
10
|
+
* private ... address 192.168.1.44. Set BANDIT_ALLOW_PRIVATE_WEB_FETCH=1
|
|
11
|
+
* ...", the model answered with exactly that explanation plus what it
|
|
12
|
+
* knew, the nudge fired anyway, and the model restated the same answer,
|
|
13
|
+
* so the terminal showed it twice under a wall of "automated harness
|
|
14
|
+
* check" reasoning.
|
|
15
|
+
*
|
|
16
|
+
* An answer counts as acknowledging the error when it has real prose and
|
|
17
|
+
* EITHER repeats a distinctive token from the error output (a hostname,
|
|
18
|
+
* an address, an env var, a path) OR plainly says the step failed.
|
|
19
|
+
*/
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.answerAcknowledgesToolError = answerAcknowledgesToolError;
|
|
22
|
+
const FAILURE_LANGUAGE = /\b(?:cannot|can't|can not|couldn't|could not|unable|not able|blocked|failed|fails|denied|refused|not allowed|not permitted|doesn't exist|does not exist|not found|no such|error)\b/i;
|
|
23
|
+
/** Tokens that identify THIS error rather than errors in general. */
|
|
24
|
+
function distinctiveTokens(errorOutput) {
|
|
25
|
+
const tokens = errorOutput.match(/[A-Za-z0-9][A-Za-z0-9._:/-]{4,}[A-Za-z0-9]/g) ?? [];
|
|
26
|
+
const common = /^(?:error|failed|blocked|address|private|loopback|local|allow|fetch|fetches|against|internal|networks|resolves|because|returned|request|unknown|invalid|missing|parameter|please)$/i;
|
|
27
|
+
return [...new Set(tokens.filter((t) => !common.test(t) && (/[._:/-]/.test(t) || /\d/.test(t) || /[A-Z]{3,}/.test(t))))];
|
|
28
|
+
}
|
|
29
|
+
function answerAcknowledgesToolError(answer, errorOutputs) {
|
|
30
|
+
const prose = answer.trim();
|
|
31
|
+
if (prose.length < 40)
|
|
32
|
+
return false;
|
|
33
|
+
if (FAILURE_LANGUAGE.test(prose))
|
|
34
|
+
return true;
|
|
35
|
+
const lower = prose.toLowerCase();
|
|
36
|
+
return errorOutputs.some((out) => distinctiveTokens(out).some((t) => lower.includes(t.toLowerCase())));
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=toolErrorAcknowledged.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolErrorAcknowledged.js","sourceRoot":"","sources":["../../../src/tools/loop/toolErrorAcknowledged.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;AAWH,kEAMC;AAfD,MAAM,gBAAgB,GAAG,qLAAqL,CAAC;AAE/M,qEAAqE;AACrE,SAAS,iBAAiB,CAAC,WAAmB;IAC5C,MAAM,MAAM,GAAG,WAAW,CAAC,KAAK,CAAC,6CAA6C,CAAC,IAAI,EAAE,CAAC;IACtF,MAAM,MAAM,GAAG,qLAAqL,CAAC;IACrM,OAAO,CAAC,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,WAAW,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AAC3H,CAAC;AAED,SAAgB,2BAA2B,CAAC,MAAc,EAAE,YAA+B;IACzF,MAAM,KAAK,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC;IAC5B,IAAI,KAAK,CAAC,MAAM,GAAG,EAAE;QAAE,OAAO,KAAK,CAAC;IACpC,IAAI,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IAC9C,MAAM,KAAK,GAAG,KAAK,CAAC,WAAW,EAAE,CAAC;IAClC,OAAO,YAAY,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC,CAAC,CAAC;AACzG,CAAC"}
|
|
@@ -13,7 +13,7 @@ exports.gitSkill = {
|
|
|
13
13
|
id: 'core/git',
|
|
14
14
|
name: 'Git',
|
|
15
15
|
version: '1.1.0',
|
|
16
|
-
description: 'Check status, view diffs, read commit history, create commits, manage branches and
|
|
16
|
+
description: 'Check status, view diffs, read commit history, create commits, manage branches and git stash entries (uncommitted changes, not the Bandit Stash), pull/push to remotes.',
|
|
17
17
|
activation: 'always',
|
|
18
18
|
tools: [
|
|
19
19
|
git_tools_1.gitStatusTool,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"git-skill.js","sourceRoot":"","sources":["../../../src/tools/skills/git-skill.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAGH,4CAUsB;AAET,QAAA,QAAQ,GAAkB;IACrC,EAAE,EAAE,UAAU;IACd,IAAI,EAAE,KAAK;IACX,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,
|
|
1
|
+
{"version":3,"file":"git-skill.js","sourceRoot":"","sources":["../../../src/tools/skills/git-skill.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAGH,4CAUsB;AAET,QAAA,QAAQ,GAAkB;IACrC,EAAE,EAAE,UAAU;IACd,IAAI,EAAE,KAAK;IACX,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,yKAAyK;IACtL,UAAU,EAAE,QAAQ;IACpB,KAAK,EAAE;QACL,yBAAa;QACb,uBAAW;QACX,sBAAU;QACV,yBAAa;QACb,yBAAa;QACb,2BAAe;QACf,wBAAY;QACZ,uBAAW;QACX,uBAAW;KACZ;CACF,CAAC"}
|
|
@@ -5,5 +5,16 @@
|
|
|
5
5
|
* giving the model the context it needs to generate or fix tests.
|
|
6
6
|
*/
|
|
7
7
|
import type { SkillManifest } from '../skill-types';
|
|
8
|
+
/**
|
|
9
|
+
* The command run_tests runs for a runner and optional filter, or null for a
|
|
10
|
+
* runner it has no test command for. npx never installs. Every runner used to
|
|
11
|
+
* get `<runner> run [filter]`: `deno run x.ts` and `bun run x.ts` execute a
|
|
12
|
+
* script under a tool name the gates treat as a test run, and `jest run`,
|
|
13
|
+
* `mocha run`, `pytest run` and `playwright run` are not test commands.
|
|
14
|
+
*/
|
|
15
|
+
export declare function runnerCommand(runner: string, filter?: string): {
|
|
16
|
+
cmd: string;
|
|
17
|
+
args: string[];
|
|
18
|
+
} | null;
|
|
8
19
|
export declare const testGenSkill: SkillManifest;
|
|
9
20
|
//# sourceMappingURL=test-gen-skill.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-gen-skill.d.ts","sourceRoot":"","sources":["../../../src/tools/skills/test-gen-skill.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"test-gen-skill.d.ts","sourceRoot":"","sources":["../../../src/tools/skills/test-gen-skill.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAMpD;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,EAAE,CAAA;CAAE,GAAG,IAAI,CAqBrG;AA2HD,eAAO,MAAM,YAAY,EAAE,aAS1B,CAAC"}
|
|
@@ -7,14 +7,44 @@
|
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.testGenSkill = void 0;
|
|
10
|
-
|
|
10
|
+
exports.runnerCommand = runnerCommand;
|
|
11
|
+
/** Runners the `runner` override may name: exactly the ones runnerCommand has a test command for. */
|
|
11
12
|
const KNOWN_TEST_RUNNERS = new Set(['vitest', 'jest', 'mocha', 'pytest', 'playwright', 'bun', 'deno']);
|
|
13
|
+
/**
|
|
14
|
+
* The command run_tests runs for a runner and optional filter, or null for a
|
|
15
|
+
* runner it has no test command for. npx never installs. Every runner used to
|
|
16
|
+
* get `<runner> run [filter]`: `deno run x.ts` and `bun run x.ts` execute a
|
|
17
|
+
* script under a tool name the gates treat as a test run, and `jest run`,
|
|
18
|
+
* `mocha run`, `pytest run` and `playwright run` are not test commands.
|
|
19
|
+
*/
|
|
20
|
+
function runnerCommand(runner, filter) {
|
|
21
|
+
const f = filter ? [filter] : [];
|
|
22
|
+
switch (runner.toLowerCase()) {
|
|
23
|
+
case 'vitest':
|
|
24
|
+
return { cmd: 'npx', args: ['--no-install', 'vitest', 'run', ...f] };
|
|
25
|
+
case 'jest':
|
|
26
|
+
return { cmd: 'npx', args: ['--no-install', 'jest', '--ci', ...f] };
|
|
27
|
+
case 'mocha':
|
|
28
|
+
return { cmd: 'npx', args: ['--no-install', 'mocha', ...f] };
|
|
29
|
+
case 'playwright':
|
|
30
|
+
return { cmd: 'npx', args: ['--no-install', 'playwright', 'test', ...f] };
|
|
31
|
+
case 'deno':
|
|
32
|
+
return { cmd: 'deno', args: ['test', ...f] };
|
|
33
|
+
case 'bun':
|
|
34
|
+
return { cmd: 'bun', args: ['test', ...f] };
|
|
35
|
+
case 'pytest':
|
|
36
|
+
return { cmd: 'python3', args: ['-m', 'pytest', '-q', ...f] };
|
|
37
|
+
default:
|
|
38
|
+
// Never guess a command for a runner it does not know.
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
12
42
|
const runTestsTool = {
|
|
13
43
|
name: 'run_tests',
|
|
14
44
|
description: 'Run the project test suite and return results. Auto-detects the test runner (vitest, jest, mocha, pytest, cargo test).',
|
|
15
45
|
parameters: [
|
|
16
46
|
{ name: 'filter', description: 'Optional test name or file pattern to filter (e.g. "auth", "src/utils/*.test.ts")' },
|
|
17
|
-
{ name: 'runner', description: 'Override the test runner (
|
|
47
|
+
{ name: 'runner', description: 'Override the test runner (vitest, jest, mocha, playwright, pytest, deno, bun). Auto-detected if omitted.' }
|
|
18
48
|
],
|
|
19
49
|
async execute(params, ctx) {
|
|
20
50
|
const runner = params.runner?.trim();
|
|
@@ -30,11 +60,15 @@ const runTestsTool = {
|
|
|
30
60
|
isError: true
|
|
31
61
|
};
|
|
32
62
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
63
|
+
const command = runnerCommand(runner, params.filter);
|
|
64
|
+
if (!command) {
|
|
65
|
+
return {
|
|
66
|
+
output: `run_tests: no test command for "${runner}". Omit \`runner\` to auto-detect, or use run_command for anything else.`,
|
|
67
|
+
isError: true
|
|
68
|
+
};
|
|
37
69
|
}
|
|
70
|
+
cmd = command.cmd;
|
|
71
|
+
args = command.args;
|
|
38
72
|
}
|
|
39
73
|
else {
|
|
40
74
|
// Auto-detect: check for common test runner config files
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-gen-skill.js","sourceRoot":"","sources":["../../../src/tools/skills/test-gen-skill.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;
|
|
1
|
+
{"version":3,"file":"test-gen-skill.js","sourceRoot":"","sources":["../../../src/tools/skills/test-gen-skill.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAeH,sCAqBC;AA/BD,qGAAqG;AACrG,MAAM,kBAAkB,GAAwB,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,CAAC,CAAC,CAAC;AAE5H;;;;;;GAMG;AACH,SAAgB,aAAa,CAAC,MAAc,EAAE,MAAe;IAC3D,MAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;IACjC,QAAQ,MAAM,CAAC,WAAW,EAAE,EAAE,CAAC;QAC7B,KAAK,QAAQ;YACX,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,cAAc,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC;QACvE,KAAK,MAAM;YACT,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,cAAc,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC;QACtE,KAAK,OAAO;YACV,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,cAAc,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC;QAC/D,KAAK,YAAY;YACf,OAAO,EAAE,GAAG,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,cAAc,EAAE,YAAY,EAAE,MAAM,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC;QAC5E,KAAK,MAAM;YACT,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,MAAM,EAAE,GAAG,CAAC,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EAAE,CAAC;QAC5C,CAAC;QAED,OAAO,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,MAAM,2BAA2B,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,EAAE,CAAC;IACpF,CAAC;CACF,CAAC;AAEW,QAAA,YAAY,GAAkB;IACzC,EAAE,EAAE,kBAAkB;IACtB,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,8DAA8D;IAC3E,YAAY,EAAE,wKAAwK;IACtL,UAAU,EAAE,MAAM;IAClB,eAAe,EAAE,CAAC,SAAS,EAAE,WAAW,EAAE,eAAe,EAAE,gBAAgB,CAAC;IAC5E,KAAK,EAAE,CAAC,YAAY,EAAE,iBAAiB,CAAC;CACzC,CAAC"}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Web
|
|
3
|
-
*
|
|
2
|
+
* Web Page skill (id `web/artifact`) — auto-activated when the task is to build an
|
|
3
|
+
* HTML page / report / dashboard the user will view or save to their Bandit Stash.
|
|
4
4
|
*
|
|
5
5
|
* It ships NO tools; its whole job is to inject quality guidance into the system
|
|
6
|
-
* prompt so self-contained HTML
|
|
6
|
+
* prompt so self-contained HTML pages come out looking like real product
|
|
7
7
|
* design — mobile-friendly, theme-aware, Lucide-iconed — instead of a raw dump.
|
|
8
8
|
* The same guidance (HTML_ARTIFACT_GUIDANCE) is reused by the CLI graph sink node
|
|
9
|
-
* so a
|
|
9
|
+
* so a page a graph saves to Bandit Stash hits the same bar.
|
|
10
10
|
*/
|
|
11
11
|
import type { SkillManifest } from '../skill-types';
|
|
12
12
|
/**
|
|
13
|
-
* The house style for any self-contained HTML
|
|
13
|
+
* The house style for any self-contained HTML page Bandit produces. Kept as a
|
|
14
14
|
* standalone export so both this skill (normal turns) and the graph sink node
|
|
15
|
-
* (research→
|
|
15
|
+
* (research→save-to-Stash turns) advise the model identically.
|
|
16
16
|
*/
|
|
17
17
|
export declare const HTML_ARTIFACT_GUIDANCE: string;
|
|
18
18
|
export declare const webArtifactSkill: SkillManifest;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web-artifact-skill.d.ts","sourceRoot":"","sources":["../../../src/tools/skills/web-artifact-skill.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,
|
|
1
|
+
{"version":3,"file":"web-artifact-skill.d.ts","sourceRoot":"","sources":["../../../src/tools/skills/web-artifact-skill.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAEpD;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,QASvB,CAAC;AAEb,eAAO,MAAM,gBAAgB,EAAE,aA0B9B,CAAC"}
|
|
@@ -2,29 +2,34 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.webArtifactSkill = exports.HTML_ARTIFACT_GUIDANCE = void 0;
|
|
4
4
|
/**
|
|
5
|
-
* The house style for any self-contained HTML
|
|
5
|
+
* The house style for any self-contained HTML page Bandit produces. Kept as a
|
|
6
6
|
* standalone export so both this skill (normal turns) and the graph sink node
|
|
7
|
-
* (research→
|
|
7
|
+
* (research→save-to-Stash turns) advise the model identically.
|
|
8
8
|
*/
|
|
9
9
|
exports.HTML_ARTIFACT_GUIDANCE = [
|
|
10
|
-
'When you build a self-contained HTML
|
|
10
|
+
'When you build a self-contained HTML page (a report, dashboard, briefing, or any HTML you will save to the user\'s Bandit Stash or share), treat it as real product design, not a raw document. Deliver these by DEFAULT:',
|
|
11
11
|
'- Self-contained + CSP-safe: ALL CSS in a <style> tag and ALL JS in a <script> tag — no external stylesheets, fonts, scripts, or CDNs (they are blocked). Embed images as data: URIs. Use a system font stack, no web fonts.',
|
|
12
12
|
'- Mobile-first & responsive: design for a phone first, then scale up. Relative units, flexbox/grid, max-width on content, images max-width:100%. The page body must NEVER scroll horizontally — wide tables/code/diagrams scroll inside their own overflow-x:auto container. Comfortable tap targets and spacing.',
|
|
13
13
|
'- Light AND dark theme: style BOTH. Default to the viewer’s system preference with @media (prefers-color-scheme: dark), drive every color from CSS variables, and add a small theme toggle that flips them. Never hard-code one background/text color that breaks in the other mode.',
|
|
14
14
|
'- Lucide icons, inlined as SVG: use Lucide-style icons inlined directly as <svg> (never a CDN or icon font). Lucide convention: viewBox="0 0 24 24", fill="none", stroke="currentColor", stroke-width="2", stroke-linecap="round", stroke-linejoin="round" — currentColor makes them follow the theme automatically. Size with width/height or CSS.',
|
|
15
|
+
'- Title and summary: give the page a specific <title> (under 90 characters, no file extension) and a one-sentence <meta name="description"> (under 200 characters) saying what it shows. They are what people see when the link is pasted into Slack, Teams or iMessage; when you publish, pass the same text as the title and description.',
|
|
15
16
|
'- Polished by default: clear visual hierarchy, generous whitespace, one coherent accent color, subtle borders/shadows, and a readable line length (~60-75ch) for prose.',
|
|
16
17
|
'These rules ARE Bandit’s house UX standard. When the user says "make it nice", "polish it", or "follow our UX guidelines", just APPLY them — do NOT ask what the guidelines are; you already have them. Reserve a brief ask_user only for something you genuinely cannot infer and that would materially change the result — a brand logo, specific brand colors, or particular imagery — and only when building something substantial from scratch. Even then, prefer to ship a strong default and offer to refine afterward. On a revision or a quick turn, do not ask — apply the guidelines and show the result.',
|
|
17
18
|
].join('\n');
|
|
18
19
|
exports.webArtifactSkill = {
|
|
19
20
|
id: 'web/artifact',
|
|
20
|
-
name: 'Web
|
|
21
|
+
name: 'Web Page',
|
|
21
22
|
version: '1.0.0',
|
|
22
|
-
description: 'Build self-contained HTML
|
|
23
|
+
description: 'Build self-contained HTML pages with excellent, mobile-friendly, theme-aware UX.',
|
|
23
24
|
instructions: exports.HTML_ARTIFACT_GUIDANCE,
|
|
24
25
|
activation: 'auto',
|
|
25
26
|
triggerPatterns: [
|
|
26
27
|
/\bhtml\b/i,
|
|
27
28
|
/\bartifact\b/i,
|
|
29
|
+
// The feature is now "Bandit Stash": "save this page to my Stash". Not a bare
|
|
30
|
+
// "stash", which usually means `git stash`.
|
|
31
|
+
/\bbandit\s+stash\b/i,
|
|
32
|
+
/\b(save|put|add)\b[\s\S]{0,40}\b(to|in|into)\s+(my|the|your)\s+stash\b/i,
|
|
28
33
|
/\bweb\s?page\b/i,
|
|
29
34
|
/\blanding page\b/i,
|
|
30
35
|
/\bstatic site\b/i,
|
|
@@ -34,7 +39,7 @@ exports.webArtifactSkill = {
|
|
|
34
39
|
// "build/make/create/design a <deliverable>" — a page-shaped deliverable, not code.
|
|
35
40
|
/\b(build|make|create|generate|design)\b[\s\S]{0,30}\b(page|site|report|briefing|dashboard|deck|flyer|poster|resume|cv|portfolio|invoice|newsletter)\b/i,
|
|
36
41
|
// "publish/share this as a <page/site/report/...>"
|
|
37
|
-
/\b(publish|share)\b[\s\S]{0,40}\b(page|site|report|briefing|dashboard|deck|artifact)\b/i,
|
|
42
|
+
/\b(publish|share|save)\b[\s\S]{0,40}\b(page|site|report|briefing|dashboard|deck|artifact)\b/i,
|
|
38
43
|
],
|
|
39
44
|
tools: [],
|
|
40
45
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web-artifact-skill.js","sourceRoot":"","sources":["../../../src/tools/skills/web-artifact-skill.ts"],"names":[],"mappings":";;;AAYA;;;;GAIG;AACU,QAAA,sBAAsB,GAAG;IACpC,
|
|
1
|
+
{"version":3,"file":"web-artifact-skill.js","sourceRoot":"","sources":["../../../src/tools/skills/web-artifact-skill.ts"],"names":[],"mappings":";;;AAYA;;;;GAIG;AACU,QAAA,sBAAsB,GAAG;IACpC,2NAA2N;IAC3N,8NAA8N;IAC9N,mTAAmT;IACnT,sRAAsR;IACtR,qVAAqV;IACrV,6UAA6U;IAC7U,yKAAyK;IACzK,slBAAslB;CACvlB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAEA,QAAA,gBAAgB,GAAkB;IAC7C,EAAE,EAAE,cAAc;IAClB,IAAI,EAAE,UAAU;IAChB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,kFAAkF;IAC/F,YAAY,EAAE,8BAAsB;IACpC,UAAU,EAAE,MAAM;IAClB,eAAe,EAAE;QACf,WAAW;QACX,eAAe;QACf,8EAA8E;QAC9E,4CAA4C;QAC5C,qBAAqB;QACrB,yEAAyE;QACzE,iBAAiB;QACjB,mBAAmB;QACnB,kBAAkB;QAClB,gBAAgB;QAChB,qBAAqB;QACrB,0BAA0B;QAC1B,oFAAoF;QACpF,wJAAwJ;QACxJ,mDAAmD;QACnD,8FAA8F;KAC/F;IACD,KAAK,EAAE,EAAE;CACV,CAAC"}
|
|
@@ -9,6 +9,44 @@ export interface ToolResult {
|
|
|
9
9
|
output: string;
|
|
10
10
|
/** True when the tool encountered an error (output contains the error message). */
|
|
11
11
|
isError?: boolean;
|
|
12
|
+
/**
|
|
13
|
+
* Images the result carries (data: URLs, or bare base64 PNG/JPEG). The
|
|
14
|
+
* loop attaches them to the results message so a vision-capable model
|
|
15
|
+
* sees the picture itself, not a path to it. A screenshot tool (the IDE's
|
|
16
|
+
* Browser preview, the Chrome extension) is the motivating case: until
|
|
17
|
+
* this field existed the model received "saved to /tmp/x.png" and could
|
|
18
|
+
* not look at it. Hosts without a vision model may drop them.
|
|
19
|
+
*/
|
|
20
|
+
images?: string[];
|
|
21
|
+
/**
|
|
22
|
+
* Where the output came from, when it is not the workspace: a URL origin
|
|
23
|
+
* (`https://example.com`) for a web page, a server name for an MCP
|
|
24
|
+
* result. The loop writes it on the result envelope
|
|
25
|
+
* (`<tool_result name="browser_read_page" origin="https://example.com">`)
|
|
26
|
+
* so the model, the permission card and the audit log give one answer to
|
|
27
|
+
* "where did this text come from". Untrusted content stays labelled as
|
|
28
|
+
* such however many times it is quoted.
|
|
29
|
+
*/
|
|
30
|
+
origin?: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Risk a tool declares about itself, so hosts stop classifying tools by
|
|
34
|
+
* name. The tiers are host-kit's: `routine` runs unattended in auto mode,
|
|
35
|
+
* `elevated` asks, `critical` always asks and no saved grant covers it.
|
|
36
|
+
* `readOnly` is the strict subset plan mode allows through; `network` says
|
|
37
|
+
* the call contacts another host (its arguments leave the machine).
|
|
38
|
+
*
|
|
39
|
+
* A declaration is a floor for the tool's own behaviour, not a ceiling on
|
|
40
|
+
* the host's judgement: a host may still raise the tier from the call's
|
|
41
|
+
* arguments (a click on "Pay now" is critical however the click tool
|
|
42
|
+
* declares itself), never lower it.
|
|
43
|
+
*/
|
|
44
|
+
export interface DeclaredToolRisk {
|
|
45
|
+
tier: 'routine' | 'elevated' | 'critical';
|
|
46
|
+
readOnly?: boolean;
|
|
47
|
+
network?: boolean;
|
|
48
|
+
/** One sentence for the permission card's risk line. */
|
|
49
|
+
why?: string;
|
|
12
50
|
}
|
|
13
51
|
/**
|
|
14
52
|
* Host-provided execution environment for tools.
|
|
@@ -214,6 +252,12 @@ export interface AgentTool {
|
|
|
214
252
|
* registered, so a repository cannot stand in for `read_file`.
|
|
215
253
|
*/
|
|
216
254
|
origin?: 'manifest';
|
|
255
|
+
/**
|
|
256
|
+
* What the tool says about its own risk (see DeclaredToolRisk). Hosts
|
|
257
|
+
* consult it before falling back to name-based classification; MCP
|
|
258
|
+
* adapters fill it from the server's tool annotations.
|
|
259
|
+
*/
|
|
260
|
+
risk?: DeclaredToolRisk;
|
|
217
261
|
}
|
|
218
262
|
/**
|
|
219
263
|
* A chat message as seen by the tool use loop.
|
|
@@ -222,6 +266,13 @@ export interface AgentTool {
|
|
|
222
266
|
export interface ToolLoopMessage {
|
|
223
267
|
role: 'system' | 'user' | 'assistant';
|
|
224
268
|
content: string;
|
|
269
|
+
/**
|
|
270
|
+
* Images attached to this message (data: URLs or bare base64). Set by the
|
|
271
|
+
* loop on a tool-results message when a result carried `images`; hosts'
|
|
272
|
+
* chat adapters forward them as image content parts. Absent on messages
|
|
273
|
+
* that have none, so adapters that ignore the field see no change.
|
|
274
|
+
*/
|
|
275
|
+
images?: string[];
|
|
225
276
|
}
|
|
226
277
|
/**
|
|
227
278
|
* JSON-Schema-shaped tool definition used by Ollama's native tool-calling
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-types.d.ts","sourceRoot":"","sources":["../../src/tools/tool-types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,mFAAmF;IACnF,OAAO,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"tool-types.d.ts","sourceRoot":"","sources":["../../src/tools/tool-types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,WAAW,UAAU;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,mFAAmF;IACnF,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAClB;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,SAAS,GAAG,UAAU,GAAG,UAAU,CAAC;IAC1C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,wDAAwD;IACxD,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,gDAAgD;IAChD,aAAa,EAAE,MAAM,CAAC;IACtB,4CAA4C;IAC5C,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAChD,0CAA0C;IAC1C,SAAS,CAAC,YAAY,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAChE;;;;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AE,CAAC;SACpB,CAAC;KACH,CAAC;CACH;AAED;;;;GAIG;AACH,MAAM,WAAW,eAAe;IAC9B;;;;;;;;;OASG;IACH,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB;;;;;OAKG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,mFAAmF;IACnF,QAAQ,CAAC,EAAE,aAAa,CAAC;CAC1B;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,MAAM,GAAG,CACnB,QAAQ,EAAE,eAAe,EAAE,EAC3B,KAAK,CAAC,EAAE,gBAAgB,EAAE,EAC1B,OAAO,CAAC,EAAE,eAAe,KACtB,aAAa,CAAC,MAAM,CAAC,CAAC;AAE3B,+CAA+C;AAC/C,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,OAAO,CAAC;IACZ,qFAAqF;IACrF,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;GAIG;AACH,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,oBAAoB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAAC;CACnG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-use-loop.d.ts","sourceRoot":"","sources":["../../src/tools/tool-use-loop.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAClF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"tool-use-loop.d.ts","sourceRoot":"","sources":["../../src/tools/tool-use-loop.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAClF,OA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B,OAAO,CAAC,EAAE,kBAAkB,GAC3B,OAAO,CAAC,aAAa,CAAC;IASzB;;;;;OAKG;IACG,eAAe,CACnB,YAAY,EAAE,eAAe,EAAE,EAC/B,IAAI,EAAE,MAAM,EACZ,YAAY,CAAC,EAAE,MAAM,EACrB,OAAO,CAAC,EAAE,kBAAkB,GAC3B,OAAO,CAAC,aAAa,CAAC;CA8mE1B;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,YAAY,EACtB,GAAG,EAAE,oBAAoB,EACzB,OAAO,CAAC,EAAE,kBAAkB,GAC3B,WAAW,CAEb"}
|
|
@@ -32,6 +32,7 @@ const goalAnchor_1 = require("./loop/goalAnchor");
|
|
|
32
32
|
const finalAnswerNudges_1 = require("./loop/finalAnswerNudges");
|
|
33
33
|
const toolAvailabilityDetector_1 = require("./toolAvailabilityDetector");
|
|
34
34
|
const authFailure_1 = require("../mcp/authFailure");
|
|
35
|
+
const toolErrorAcknowledged_1 = require("./loop/toolErrorAcknowledged");
|
|
35
36
|
const loopShared_1 = require("./loop/loopShared");
|
|
36
37
|
Object.defineProperty(exports, "sleep", { enumerable: true, get: function () { return loopShared_1.sleep; } });
|
|
37
38
|
Object.defineProperty(exports, "isRetryableLlmError", { enumerable: true, get: function () { return loopShared_1.isRetryableLlmError; } });
|
|
@@ -267,6 +268,7 @@ class ToolUseLoop {
|
|
|
267
268
|
const attemptedShellCommands = new Set();
|
|
268
269
|
let toolErrorRecoveryFired = 0;
|
|
269
270
|
let lastIterationHadToolError = false;
|
|
271
|
+
let lastToolErrorOutputs = [];
|
|
270
272
|
// Set when a tool result carried MCP auth-recovery guidance this turn —
|
|
271
273
|
// exempts the model's "I can't reach X until you re-authorize" answer from
|
|
272
274
|
// the false-tool-absence detector. See the setter below for the trace.
|
|
@@ -1098,7 +1100,10 @@ class ToolUseLoop {
|
|
|
1098
1100
|
// the model re-state its answer, so the "run /login" reply appeared
|
|
1099
1101
|
// twice in the transcript. Same flag that gates the false-tool-absence
|
|
1100
1102
|
// detector below.
|
|
1101
|
-
&& !authRecoveryObservedThisTurn
|
|
1103
|
+
&& !authRecoveryObservedThisTurn
|
|
1104
|
+
// A reply that already explains the failure is the (b) answer the
|
|
1105
|
+
// nudge asks for; nudging again only makes the model restate it.
|
|
1106
|
+
&& !(0, toolErrorAcknowledged_1.answerAcknowledgesToolError)((0, tool_use_parser_1.stripReasoningChannels)(response), lastToolErrorOutputs)) {
|
|
1102
1107
|
toolErrorRecoveryFired++;
|
|
1103
1108
|
emit('tool_loop:tool_error_recovery', {
|
|
1104
1109
|
iteration: iterations,
|
|
@@ -2042,6 +2047,7 @@ class ToolUseLoop {
|
|
|
2042
2047
|
}
|
|
2043
2048
|
}
|
|
2044
2049
|
lastIterationHadToolError = toolResults.some((r) => r.isError === true);
|
|
2050
|
+
lastToolErrorOutputs = toolResults.filter((r) => r.isError === true).map((r) => String(r.output ?? ''));
|
|
2045
2051
|
// An auth-recovery guidance result means the correct next move is the
|
|
2046
2052
|
// model REPORTING an unavailability — "the connection expired, run X" —
|
|
2047
2053
|
// which is precisely the phrasing the false-tool-absence detector calls
|
|
@@ -2090,7 +2096,12 @@ class ToolUseLoop {
|
|
|
2090
2096
|
`For repo overviews, synthesize from direct reads/searches first. For truly parallel audits, re-issue extra ` +
|
|
2091
2097
|
`subagents with run_in_background="true" so the parent can keep responding.]`;
|
|
2092
2098
|
}
|
|
2093
|
-
|
|
2099
|
+
// Pictures a result carried (a screenshot) go on the same message as
|
|
2100
|
+
// the text that describes them, so a vision model sees both together.
|
|
2101
|
+
const resultImages = (0, tool_use_parser_1.collectToolResultImages)(toolResults);
|
|
2102
|
+
messages.push(resultImages
|
|
2103
|
+
? { role: 'user', content: resultsMessage, images: resultImages }
|
|
2104
|
+
: { role: 'user', content: resultsMessage });
|
|
2094
2105
|
// Mid-turn persistence hook. This iteration's assistant turn and tool
|
|
2095
2106
|
// results are now committed to `messages`, so hand a copy to the host to
|
|
2096
2107
|
// journal. Filtering system messages keeps the snapshot aligned with what
|