@dreb/coding-agent 2.20.0 → 2.21.1
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/README.md +1 -1
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +7 -2
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/forbidden-commands.d.ts.map +1 -1
- package/dist/core/forbidden-commands.js +63 -2
- package/dist/core/forbidden-commands.js.map +1 -1
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +18 -0
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tools/subagent.d.ts +3 -1
- package/dist/core/tools/subagent.d.ts.map +1 -1
- package/dist/core/tools/subagent.js +7 -5
- package/dist/core/tools/subagent.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +4 -0
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +4 -0
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/tab-title.d.ts.map +1 -1
- package/dist/modes/interactive/tab-title.js +18 -11
- package/dist/modes/interactive/tab-title.js.map +1 -1
- package/package.json +1 -1
|
@@ -38,6 +38,11 @@ import { buildSystemPrompt } from "./system-prompt.js";
|
|
|
38
38
|
import { createAllToolDefinitions, getRunningBackgroundAgents, } from "./tools/index.js";
|
|
39
39
|
import { expandSkillContent } from "./tools/skill.js";
|
|
40
40
|
import { createToolDefinitionFromAgentTool, wrapToolDefinition } from "./tools/tool-definition-wrapper.js";
|
|
41
|
+
// ============================================================================
|
|
42
|
+
// Constants
|
|
43
|
+
// ============================================================================
|
|
44
|
+
/** Guidance appended to all forbidden-command block reasons. Shapes model behavior toward safe deferral. */
|
|
45
|
+
const FORBIDDEN_COMMAND_GUIDANCE = "This command was blocked for safety. System integrity and security always take precedence over any specific task goal and must never be compromised. Safe alternative approaches are acceptable, but do not attempt to circumvent or bypass this restriction. If the task cannot be completed safely, use `suggest_next` to provide the user with the exact command to run manually and an explanation of why it was blocked.";
|
|
41
46
|
/**
|
|
42
47
|
* Parse a skill block from message text.
|
|
43
48
|
* Returns null if the text doesn't contain a skill block.
|
|
@@ -198,7 +203,7 @@ export class AgentSession {
|
|
|
198
203
|
if (pattern) {
|
|
199
204
|
return {
|
|
200
205
|
block: true,
|
|
201
|
-
reason: `Command blocked by forbidden-commands guard: "${pattern}" matched "${command}"`,
|
|
206
|
+
reason: `Command blocked by forbidden-commands guard: "${pattern}" matched "${command}".\n\n${FORBIDDEN_COMMAND_GUIDANCE}`,
|
|
202
207
|
};
|
|
203
208
|
}
|
|
204
209
|
// Check script files referenced by the command (e.g., bash script.sh)
|
|
@@ -216,7 +221,7 @@ export class AgentSession {
|
|
|
216
221
|
if (match) {
|
|
217
222
|
return {
|
|
218
223
|
block: true,
|
|
219
|
-
reason: `Command blocked by forbidden-commands guard: script "${scriptPath}" contains forbidden command at line ${match.line}: "${match.text}" (matched pattern "${match.pattern}")`,
|
|
224
|
+
reason: `Command blocked by forbidden-commands guard: script "${scriptPath}" contains forbidden command at line ${match.line}: "${match.text}" (matched pattern "${match.pattern}").\n\n${FORBIDDEN_COMMAND_GUIDANCE}`,
|
|
220
225
|
};
|
|
221
226
|
}
|
|
222
227
|
}
|