@burtson-labs/agent-core 1.6.103 → 1.6.105
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/tools/core-tools.d.ts +60 -4
- package/dist/tools/core-tools.d.ts.map +1 -1
- package/dist/tools/core-tools.js +377 -66
- package/dist/tools/core-tools.js.map +1 -1
- package/dist/tools/loop/editClaims.d.ts +30 -0
- package/dist/tools/loop/editClaims.d.ts.map +1 -0
- package/dist/tools/loop/editClaims.js +183 -0
- package/dist/tools/loop/editClaims.js.map +1 -0
- package/dist/tools/loop/finalAnswerNudges.d.ts +9 -0
- package/dist/tools/loop/finalAnswerNudges.d.ts.map +1 -1
- package/dist/tools/loop/finalAnswerNudges.js +46 -3
- package/dist/tools/loop/finalAnswerNudges.js.map +1 -1
- package/dist/tools/loop/renameLeftovers.d.ts +34 -0
- package/dist/tools/loop/renameLeftovers.d.ts.map +1 -0
- package/dist/tools/loop/renameLeftovers.js +124 -0
- package/dist/tools/loop/renameLeftovers.js.map +1 -0
- package/dist/tools/tool-types.d.ts +15 -0
- package/dist/tools/tool-types.d.ts.map +1 -1
- package/dist/tools/tool-use-loop.d.ts +22 -0
- package/dist/tools/tool-use-loop.d.ts.map +1 -1
- package/dist/tools/tool-use-loop.js +90 -20
- package/dist/tools/tool-use-loop.js.map +1 -1
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* All tools delegate to the injected ToolExecutionContext — no direct
|
|
5
5
|
* dependency on Node.js APIs, VS Code, or any specific host.
|
|
6
6
|
*/
|
|
7
|
-
import type { AgentTool } from './tool-types';
|
|
7
|
+
import type { AgentTool, ToolExecutionContext } from './tool-types';
|
|
8
8
|
import { ToolRegistry } from './tool-registry';
|
|
9
9
|
/**
|
|
10
10
|
* File text whose escapes were written twice: `\n`, `\t`, `\"`, `\'` and
|
|
@@ -62,6 +62,23 @@ export declare function resolvePatchHunk(hunk: PatchHunkItem[], file: string): R
|
|
|
62
62
|
*/
|
|
63
63
|
export declare function reindentToFile(findLines: string[], fileLines: string[], replace: string): string;
|
|
64
64
|
declare const applyPatchTool: AgentTool;
|
|
65
|
+
/**
|
|
66
|
+
* The file's leading comment block (license, module doc, shebang): the run
|
|
67
|
+
* of blank and comment lines before the first line of code. Block comments
|
|
68
|
+
* (`/* … *\/`, `<!-- … -->`, Python `"""` docstrings) count whole. Markdown,
|
|
69
|
+
* plain text, JSON and the like have no comment syntax here, so they return
|
|
70
|
+
* nothing (`#` is a heading in Markdown).
|
|
71
|
+
*/
|
|
72
|
+
export declare function leadingCommentBlock(text: string, path?: string): string[];
|
|
73
|
+
/**
|
|
74
|
+
* A note when an edit threw away the file's header comment. bandit-core:31b
|
|
75
|
+
* (2026-11-28 bench, ag-holdout-09 and go-locate-ninja-comment) replaced a
|
|
76
|
+
* file's license/doc header while editing the code right under it; the task
|
|
77
|
+
* never mentioned the header and nothing told the model. The edit is not
|
|
78
|
+
* blocked — a task can legitimately change a header — but the model is told
|
|
79
|
+
* exactly what disappeared so it can put it back in the same turn.
|
|
80
|
+
*/
|
|
81
|
+
export declare function headerCommentRemovedNote(before: string, after: string, path: string): string | undefined;
|
|
65
82
|
declare const listFilesTool: AgentTool;
|
|
66
83
|
/**
|
|
67
84
|
* A path as the model should see it: relative to the workspace root when it
|
|
@@ -81,13 +98,52 @@ declare const findDirectoryTool: AgentTool;
|
|
|
81
98
|
*/
|
|
82
99
|
export declare function noMatchHint(pattern: string, fileGlob?: string, cwd?: string): string;
|
|
83
100
|
declare const searchCodeTool: AgentTool;
|
|
101
|
+
export declare const FORBIDDEN_COMMANDS: ReadonlySet<string>;
|
|
102
|
+
/** Bare program name (`/usr/bin/git` → `git`, `git.exe` → `git`). */
|
|
103
|
+
export declare function commandBaseName(cmd: string): string;
|
|
104
|
+
/** True for a program run_command runs on its own, with no host approval. */
|
|
105
|
+
export declare function isBuiltinCommand(cmd: string): boolean;
|
|
106
|
+
/**
|
|
107
|
+
* The refusal for a program no approval can admit, or null. Hosts call this
|
|
108
|
+
* BEFORE their permission gate so a forbidden program never reaches a card
|
|
109
|
+
* ("approve sudo?" is not a question Bandit asks).
|
|
110
|
+
*/
|
|
111
|
+
export declare function forbiddenCommandReason(cmd: string): string | null;
|
|
84
112
|
/**
|
|
85
|
-
* The
|
|
113
|
+
* The refusal for an argv that needs a shell (`… | tail -20`, `a && b`,
|
|
114
|
+
* `> out.txt`), or null. Checked before anything runs — and by hosts before
|
|
115
|
+
* their permission card, so a command that cannot run is not something the
|
|
116
|
+
* user is asked to approve (overnight 2026-11-29: seven such cards).
|
|
117
|
+
*/
|
|
118
|
+
export declare function shellOperatorRefusal(argv: readonly string[], program?: string): string | null;
|
|
119
|
+
/**
|
|
120
|
+
* The run_command program check and blocked patterns, as one check other
|
|
86
121
|
* command-running tools can apply before they call `ctx.runCommand`. Returns
|
|
87
122
|
* the refusal message, or null when the command may run. A workspace skill's
|
|
88
|
-
* `command` used to bypass both — `sh`, `bash` and friends included.
|
|
123
|
+
* `command` used to bypass both — `sh`, `bash` and friends included. With a
|
|
124
|
+
* `ctx`, a program the host admits (`ctx.commandAllowed`) passes too.
|
|
89
125
|
*/
|
|
90
|
-
export declare function runCommandRefusal(cmd: string, args: string[]): string | null;
|
|
126
|
+
export declare function runCommandRefusal(cmd: string, args: string[], ctx?: Pick<ToolExecutionContext, 'commandAllowed'>): string | null;
|
|
127
|
+
/** The built-in programs, grouped for the tool description and `stealth_about`. */
|
|
128
|
+
export declare const BUILTIN_COMMAND_GROUPS: ReadonlyArray<{
|
|
129
|
+
group: string;
|
|
130
|
+
programs: readonly string[];
|
|
131
|
+
}>;
|
|
132
|
+
/** The in-process stdout filters run_command offers instead of a pipe. */
|
|
133
|
+
interface OutputFilters {
|
|
134
|
+
grep?: RegExp;
|
|
135
|
+
head?: number;
|
|
136
|
+
tail?: number;
|
|
137
|
+
}
|
|
138
|
+
/** Read grep/head/tail params; `{ error }` names a bad value with the fix. */
|
|
139
|
+
export declare function parseOutputFilters(params: Record<string, string | undefined>): OutputFilters | {
|
|
140
|
+
error: string;
|
|
141
|
+
};
|
|
142
|
+
/** grep, then head, then tail — the order a pipeline would usually apply them. */
|
|
143
|
+
export declare function applyOutputFilters(stdout: string, filters: OutputFilters): {
|
|
144
|
+
text: string;
|
|
145
|
+
note: string;
|
|
146
|
+
};
|
|
91
147
|
declare const runCommandTool: AgentTool;
|
|
92
148
|
/**
|
|
93
149
|
* Directive hint for a failed run_command, or '' when nothing recognized.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core-tools.d.ts","sourceRoot":"","sources":["../../src/tools/core-tools.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"core-tools.d.ts","sourceRoot":"","sources":["../../src/tools/core-tools.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,oBAAoB,EAAc,MAAM,cAAc,CAAC;AAEhF,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAkG/C;;;;;;;;;;GAUG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAK7D;AA8BD,QAAA,MAAM,YAAY,EAAE,SAuGnB,CAAC;AAIF,QAAA,MAAM,aAAa,EAAE,SA+GpB,CAAC;AAYF,QAAA,MAAM,cAAc,EAAE,SAgDrB,CAAC;AAoBF,QAAA,MAAM,aAAa,EAAE,SAyZpB,CAAC;AAQF,QAAA,MAAM,gBAAgB,EAAE,SAuLvB,CAAC;AAwCF,KAAK,aAAa,GAAG;IAAE,IAAI,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAsB7E,mEAAmE;AACnE,wBAAgB,YAAY,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,CAMzD;AAED,MAAM,WAAW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