wave-agent-sdk 0.6.2 → 0.6.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/dist/agent.d.ts.map +1 -1
- package/dist/agent.js +7 -0
- package/dist/managers/liveConfigManager.d.ts.map +1 -1
- package/dist/managers/liveConfigManager.js +3 -0
- package/dist/managers/permissionManager.js +7 -7
- package/dist/prompts/index.d.ts +3 -2
- package/dist/prompts/index.d.ts.map +1 -1
- package/dist/prompts/index.js +3 -2
- package/dist/tools/bashTool.d.ts.map +1 -1
- package/dist/tools/bashTool.js +28 -27
- package/dist/tools/taskTool.d.ts.map +1 -1
- package/dist/tools/taskTool.js +3 -0
- package/dist/utils/fileSearch.d.ts.map +1 -1
- package/dist/utils/fileSearch.js +11 -4
- package/package.json +1 -1
- package/src/agent.ts +13 -0
- package/src/managers/liveConfigManager.ts +5 -0
- package/src/managers/permissionManager.ts +8 -8
- package/src/prompts/index.ts +4 -1
- package/src/tools/bashTool.ts +29 -28
- package/src/tools/taskTool.ts +3 -0
- package/src/utils/fileSearch.ts +11 -4
package/dist/agent.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agent.d.ts","sourceRoot":"","sources":["../src/agent.ts"],"names":[],"mappings":"AACA,OAAO,EAEL,KAAK,uBAAuB,EAC7B,MAAM,8BAA8B,CAAC;AAGtC,OAAO,EAEL,KAAK,wBAAwB,EAC9B,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAc,KAAK,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAGhF,OAAO,EAEL,KAAK,8BAA8B,EACpC,MAAM,qCAAqC,CAAC;AAQ7C,OAAO,KAAK,EACV,YAAY,EACZ,kBAAkB,EAClB,WAAW,EACX,YAAY,EACb,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EACV,OAAO,EACP,MAAM,EACN,eAAe,EACf,aAAa,EACb,WAAW,EACX,KAAK,EACL,cAAc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;IAMtE,uCAAuC;IAChC,gBAAgB,IAAI,YAAY,EAAE;IAIzC,oCAAoC;IAC7B,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO;IAIlD,6BAA6B;IACtB,oBAAoB,IAAI,IAAI;IAInC,iCAAiC;IAC1B,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,kBAAkB,GAAG,SAAS;IAI1E,8BAA8B;IACvB,iBAAiB,IAAI,kBAAkB,EAAE;IAIhD;;OAEG;IACI,oBAAoB,CAAC,OAAO,EAAE,YAAY,GAAG,IAAI;IAIxD;;OAEG;IACI,iBAAiB,IAAI,cAAc;IAI1C;;;OAGG;IACI,iBAAiB,CAAC,IAAI,EAAE,cAAc,GAAG,IAAI;IASpD;;;OAGG;IACU,eAAe,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAM1D;;OAEG;IACU,oBAAoB,IAAI,OAAO,CAAC;QAC3C,QAAQ,EAAE,OAAO,EAAE,CAAC;QACpB,UAAU,EAAE,MAAM,EAAE,CAAC;KACtB,CAAC;IAIF;;OAEG;IACI,eAAe,IAAI,MAAM,GAAG,SAAS;IAI5C;;OAEG;IACI,eAAe,IAAI,MAAM,EAAE;IAIlC;;OAEG;IACU,eAAe,CAC1B,OAAO,EAAE,OAAO,wBAAwB,EAAE,qBAAqB,GAC9D,OAAO,CAAC,OAAO,wBAAwB,EAAE,kBAAkB,CAAC;IAI/D;;;OAGG;IACU,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAkC3D;;;OAGG;IACH,OAAO,CAAC,wBAAwB;IAgBhC;;OAEG;IACH,IAAW,UAAU,IAAI,MAAM,CAE9B;CACF"}
|
package/dist/agent.js
CHANGED
|
@@ -489,6 +489,13 @@ export class Agent {
|
|
|
489
489
|
});
|
|
490
490
|
this.permissionManager.updateAllowedRules(currentConfig.permissions.allow);
|
|
491
491
|
}
|
|
492
|
+
// Update permission manager with configuration-based denied rules
|
|
493
|
+
if (currentConfig?.permissions?.deny) {
|
|
494
|
+
this.logger?.debug("Applying configured denied rules to PermissionManager", {
|
|
495
|
+
count: currentConfig.permissions.deny.length,
|
|
496
|
+
});
|
|
497
|
+
this.permissionManager.updateDeniedRules(currentConfig.permissions.deny);
|
|
498
|
+
}
|
|
492
499
|
// Update permission manager with configuration-based additionalDirectories
|
|
493
500
|
if (currentConfig?.permissions?.additionalDirectories) {
|
|
494
501
|
this.logger?.debug("Applying configured additionalDirectories to PermissionManager", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"liveConfigManager.d.ts","sourceRoot":"","sources":["../../src/managers/liveConfigManager.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAOhD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACpD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAOhE,OAAO,EAAE,oBAAoB,EAAE,MAAM,qCAAqC,CAAC;AAG3E,OAAO,KAAK,EAEV,iBAAiB,EAClB,MAAM,2BAA2B,CAAC;AAEnC,MAAM,WAAW,wBAAwB;IACvC,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,WAAW,CAAC,EAAE,WAAW,CAAC;IAC1B,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;IACtC,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;CAC7C;AAED,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAc;IAC3C,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAoB;IACvD,OAAO,CAAC,aAAa,CAAkB;IACvC,OAAO,CAAC,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AQ,CAAC,MAAM,CAAC,CAAS;IACjC,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAc;IAC3C,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAC,CAAoB;IACvD,OAAO,CAAC,aAAa,CAAkB;IACvC,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAuB;IAG5D,OAAO,CAAC,oBAAoB,CAAkC;IAC9D,OAAO,CAAC,sBAAsB,CAAkC;IAGhE,OAAO,CAAC,WAAW,CAAqB;IACxC,OAAO,CAAC,eAAe,CAAC,CAAW;IACnC,OAAO,CAAC,kBAAkB,CAAC,CAAW;IACtC,OAAO,CAAC,UAAU,CAAkB;IACpC,OAAO,CAAC,gBAAgB,CAAkB;gBAE9B,OAAO,EAAE,wBAAwB;IAW7C;;;;OAIG;YACW,kBAAkB;IA6DhC;;OAEG;IACH,uBAAuB,IAAI,iBAAiB,GAAG,IAAI;IAInD;;OAEG;IACG,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAuBjC;;OAEG;IACG,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC;IAyB/B;;;OAGG;YACW,mBAAmB;IAwNjC;;OAEG;IACG,MAAM,IAAI,OAAO,CAAC,iBAAiB,CAAC;IAK1C;;OAEG;IACH,gBAAgB,IAAI,OAAO;IAI3B;;OAEG;IACH,gBAAgB;;;;;;;;;;;;IAgBhB,OAAO,CAAC,sBAAsB;YAMhB,gBAAgB;IA8C9B;;OAEG;IACH,OAAO,CAAC,qBAAqB;IA4F7B,OAAO,CAAC,aAAa;IAuDrB;;;OAGG;IACH,OAAO,CAAC,qBAAqB;CAQ9B"}
|
|
@@ -233,6 +233,9 @@ export class LiveConfigManager {
|
|
|
233
233
|
if (this.currentConfiguration.permissions?.allow) {
|
|
234
234
|
this.permissionManager.updateAllowedRules(this.currentConfiguration.permissions.allow);
|
|
235
235
|
}
|
|
236
|
+
if (this.currentConfiguration.permissions?.deny) {
|
|
237
|
+
this.permissionManager.updateDeniedRules(this.currentConfiguration.permissions.deny);
|
|
238
|
+
}
|
|
236
239
|
if (this.currentConfiguration.permissions?.additionalDirectories) {
|
|
237
240
|
this.permissionManager.updateAdditionalDirectories(this.currentConfiguration.permissions.additionalDirectories);
|
|
238
241
|
}
|
|
@@ -246,6 +246,13 @@ export class PermissionManager {
|
|
|
246
246
|
}
|
|
247
247
|
}
|
|
248
248
|
}
|
|
249
|
+
// 1.2 Check if tool call is allowed by persistent or temporary rules
|
|
250
|
+
if (this.isAllowedByRule(context)) {
|
|
251
|
+
this.logger?.debug("Permission allowed by persistent rule", {
|
|
252
|
+
toolName: context.toolName,
|
|
253
|
+
});
|
|
254
|
+
return { behavior: "allow" };
|
|
255
|
+
}
|
|
249
256
|
// 1.3 If plan mode, allow Read-only tools and Edit/Write for plan file
|
|
250
257
|
if (context.permissionMode === "plan") {
|
|
251
258
|
const writeTools = [
|
|
@@ -280,13 +287,6 @@ export class PermissionManager {
|
|
|
280
287
|
};
|
|
281
288
|
}
|
|
282
289
|
}
|
|
283
|
-
// 1.2 Check if tool call matches any allowed rule
|
|
284
|
-
if (this.isAllowedByRule(context)) {
|
|
285
|
-
this.logger?.debug("Permission allowed by persistent rule", {
|
|
286
|
-
toolName: context.toolName,
|
|
287
|
-
});
|
|
288
|
-
return { behavior: "allow" };
|
|
289
|
-
}
|
|
290
290
|
// 2. If not a restricted tool, always allow
|
|
291
291
|
if (!this.isRestrictedTool(context.toolName)) {
|
|
292
292
|
this.logger?.debug("Tool is not restricted, allowing", {
|
package/dist/prompts/index.d.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { ToolPlugin } from "../tools/types.js";
|
|
2
|
-
export declare const BASE_SYSTEM_PROMPT = "You are an interactive CLI tool that helps users with software engineering tasks. Use the instructions below and the tools available to you to assist the user.\n\n# Doing tasks\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\n- NEVER propose changes to code you haven't read. If a user asks about or wants you to modify a file, read it first. Understand existing code before suggesting modifications.\n- Be careful not to introduce security vulnerabilities such as command injection, XSS, SQL injection, and other OWASP top 10 vulnerabilities. If you notice that you wrote insecure code, immediately fix it.\n- Avoid over-engineering. Only make changes that are directly requested or clearly necessary. Keep solutions simple and focused.\n - Don't add features, refactor code, or make \"improvements\" beyond what was asked. A bug fix doesn't need surrounding code cleaned up. A simple feature doesn't need extra configurability. Don't add docstrings, comments, or type annotations to code you didn't change. Only add comments where the logic isn't self-evident.\n - Don't add error handling, fallbacks, or validation for scenarios that can't happen. Trust internal code and framework guarantees. Only validate at system boundaries (user input, external APIs). Don't use feature flags or backwards-compatibility shims when you can just change the code.\n - Don't create helpers, utilities, or abstractions for one-time operations. Don't design for hypothetical future requirements. The right amount of complexity is the minimum needed for the current task\u2014three similar lines of code is better than a premature abstraction.\n- Avoid backwards-compatibility hacks like renaming unused `_vars`, re-exporting types, adding `// removed` comments for removed code, etc. If something is unused, delete it completely
|
|
2
|
+
export declare const BASE_SYSTEM_PROMPT = "You are an interactive CLI tool that helps users with software engineering tasks. Use the instructions below and the tools available to you to assist the user.\n\n# Doing tasks\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\n- NEVER propose changes to code you haven't read. If a user asks about or wants you to modify a file, read it first. Understand existing code before suggesting modifications.\n- Be careful not to introduce security vulnerabilities such as command injection, XSS, SQL injection, and other OWASP top 10 vulnerabilities. If you notice that you wrote insecure code, immediately fix it.\n- Avoid over-engineering. Only make changes that are directly requested or clearly necessary. Keep solutions simple and focused.\n - Don't add features, refactor code, or make \"improvements\" beyond what was asked. A bug fix doesn't need surrounding code cleaned up. A simple feature doesn't need extra configurability. Don't add docstrings, comments, or type annotations to code you didn't change. Only add comments where the logic isn't self-evident.\n - Don't add error handling, fallbacks, or validation for scenarios that can't happen. Trust internal code and framework guarantees. Only validate at system boundaries (user input, external APIs). Don't use feature flags or backwards-compatibility shims when you can just change the code.\n - Don't create helpers, utilities, or abstractions for one-time operations. Don't design for hypothetical future requirements. The right amount of complexity is the minimum needed for the current task\u2014three similar lines of code is better than a premature abstraction.\n- Avoid backwards-compatibility hacks like renaming unused `_vars`, re-exporting types, adding `// removed` comments for removed code, etc. If something is unused, delete it completely.";
|
|
3
|
+
export declare const TOOL_POLICY = "\n# Tool usage policy\n- You can call multiple tools in a single response. If you intend to call multiple tools and there are no dependencies between them, make all independent tool calls in parallel. Maximize use of parallel tool calls where possible to increase efficiency.\n- However, if some tool calls depend on previous calls to inform dependent values, do NOT call these tools in parallel and instead call them sequentially. For instance, if one operation must complete before another starts, run these operations sequentially instead. Never use placeholders or guess missing parameters in tool calls.\n- If the user specifies that they want you to run tools \"in parallel\", you MUST send a single message with multiple tool use content blocks.";
|
|
3
4
|
export declare const TASK_MANAGEMENT_POLICY = "\n# Task Management\nYou have access to the TaskCreate, TaskGet, TaskUpdate, and TaskList tools to help you manage and plan tasks. Use these tools VERY frequently to ensure that you are tracking your tasks and giving the user visibility into your progress.\nThese tools are also EXTREMELY helpful for planning tasks, and for breaking down larger complex tasks into smaller steps. If you do not use this tool when planning, you may forget to do important tasks - and that is unacceptable.\nIt is critical that you mark tasks as completed as soon as you are done with a task. Do not batch up multiple tasks before marking them as completed.";
|
|
4
5
|
export declare function buildPlanModePrompt(planFilePath: string, planExists: boolean, isSubagent?: boolean): string;
|
|
5
|
-
export declare const DEFAULT_SYSTEM_PROMPT = "You are an interactive CLI tool that helps users with software engineering tasks. Use the instructions below and the tools available to you to assist the user.\n\n# Doing tasks\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\n- NEVER propose changes to code you haven't read. If a user asks about or wants you to modify a file, read it first. Understand existing code before suggesting modifications.\n- Be careful not to introduce security vulnerabilities such as command injection, XSS, SQL injection, and other OWASP top 10 vulnerabilities. If you notice that you wrote insecure code, immediately fix it.\n- Avoid over-engineering. Only make changes that are directly requested or clearly necessary. Keep solutions simple and focused.\n - Don't add features, refactor code, or make \"improvements\" beyond what was asked. A bug fix doesn't need surrounding code cleaned up. A simple feature doesn't need extra configurability. Don't add docstrings, comments, or type annotations to code you didn't change. Only add comments where the logic isn't self-evident.\n - Don't add error handling, fallbacks, or validation for scenarios that can't happen. Trust internal code and framework guarantees. Only validate at system boundaries (user input, external APIs). Don't use feature flags or backwards-compatibility shims when you can just change the code.\n - Don't create helpers, utilities, or abstractions for one-time operations. Don't design for hypothetical future requirements. The right amount of complexity is the minimum needed for the current task\u2014three similar lines of code is better than a premature abstraction.\n- Avoid backwards-compatibility hacks like renaming unused `_vars`, re-exporting types, adding `// removed` comments for removed code, etc. If something is unused, delete it completely
|
|
6
|
+
export declare const DEFAULT_SYSTEM_PROMPT = "You are an interactive CLI tool that helps users with software engineering tasks. Use the instructions below and the tools available to you to assist the user.\n\n# Doing tasks\nThe user will primarily request you perform software engineering tasks. This includes solving bugs, adding new functionality, refactoring code, explaining code, and more. For these tasks the following steps are recommended:\n- NEVER propose changes to code you haven't read. If a user asks about or wants you to modify a file, read it first. Understand existing code before suggesting modifications.\n- Be careful not to introduce security vulnerabilities such as command injection, XSS, SQL injection, and other OWASP top 10 vulnerabilities. If you notice that you wrote insecure code, immediately fix it.\n- Avoid over-engineering. Only make changes that are directly requested or clearly necessary. Keep solutions simple and focused.\n - Don't add features, refactor code, or make \"improvements\" beyond what was asked. A bug fix doesn't need surrounding code cleaned up. A simple feature doesn't need extra configurability. Don't add docstrings, comments, or type annotations to code you didn't change. Only add comments where the logic isn't self-evident.\n - Don't add error handling, fallbacks, or validation for scenarios that can't happen. Trust internal code and framework guarantees. Only validate at system boundaries (user input, external APIs). Don't use feature flags or backwards-compatibility shims when you can just change the code.\n - Don't create helpers, utilities, or abstractions for one-time operations. Don't design for hypothetical future requirements. The right amount of complexity is the minimum needed for the current task\u2014three similar lines of code is better than a premature abstraction.\n- Avoid backwards-compatibility hacks like renaming unused `_vars`, re-exporting types, adding `// removed` comments for removed code, etc. If something is unused, delete it completely.";
|
|
6
7
|
export declare const BASH_SUBAGENT_SYSTEM_PROMPT = "You are a command execution specialist. Your role is to execute bash commands efficiently and safely.\n\nGuidelines:\n- Execute commands precisely as instructed\n- For git operations, follow git safety protocols\n- Report command output clearly and concisely\n- If a command fails, explain the error and suggest solutions\n- Use command chaining (&&) for dependent operations\n- Quote paths with spaces properly\n- For clear communication, avoid using emojis\n\nComplete the requested operations efficiently.";
|
|
7
8
|
export declare const GENERAL_PURPOSE_SYSTEM_PROMPT = "You are an agent. Given the user's message, you should use the tools available to complete the task. Do what has been asked; nothing more, nothing less. When you complete the task simply respond with a detailed writeup.\n\nYour strengths:\n- Searching for code, configurations, and patterns across large codebases\n- Analyzing multiple files to understand system architecture\n- Investigating complex questions that require exploring many files\n- Performing multi-step research tasks\n\nGuidelines:\n- For file searches: Use Grep or Glob when you need to search broadly. Use Read when you know the specific file path.\n- For analysis: Start broad and narrow down. Use multiple search strategies if the first doesn't yield results.\n- Be thorough: Check multiple locations, consider different naming conventions, look for related files.\n- NEVER create files unless they're absolutely necessary for achieving your goal. ALWAYS prefer editing an existing file to creating a new one.\n- NEVER proactively create documentation files (*.md) or README files. Only create documentation files if explicitly requested.\n- In your final response always share relevant file names and code snippets. Any file paths you return in your response MUST be absolute. Do NOT use relative paths.\n- For clear communication, avoid using emojis.";
|
|
8
9
|
export declare const EXPLORE_SUBAGENT_SYSTEM_PROMPT = "You are a file search specialist. You excel at thoroughly navigating and exploring codebases.\n\t\n\t=== CRITICAL: READ-ONLY MODE - NO FILE MODIFICATIONS ===\n\tThis is a READ-ONLY exploration task. You are STRICTLY PROHIBITED from:\n\t- Creating new files (no Write, touch, or file creation of any kind)\n\t- Modifying existing files (no Edit operations)\n\t- Deleting files (no rm or deletion)\n\t- Moving or copying files (no mv or cp)\n\t- Creating temporary files anywhere, including /tmp\n\t- Using redirect operators (>, >>, |) or heredocs to write to files\n\t- Running ANY commands that change system state\n\t\n\tYour role is EXCLUSIVELY to search and analyze existing code. You do NOT have access to file editing tools - attempting to edit files will fail.\n\t\n\tYour strengths:\n\t- Rapidly finding files using glob patterns\n\t- Searching code and text with powerful regex patterns\n\t- Reading and analyzing file contents\n\t- Using Language Server Protocol (LSP) for deep code intelligence (definitions, references, etc.)\n\t\n\tGuidelines:\n\t- Use Glob for broad file pattern matching\n\t- Use Grep for searching file contents with regex\n\t- Use Read when you know the specific file path you need to read\n\t- Use LSP for code intelligence features like finding definitions, references, implementations, and symbols. This is especially useful for understanding complex code relationships.\n\t- Use Bash ONLY for read-only operations (ls, git status, git log, git diff, find, cat, head, tail)\n\t- NEVER use Bash for: mkdir, touch, rm, cp, mv, git add, git commit, npm install, pip install, or any file creation/modification\n\t- Adapt your search approach based on the thoroughness level specified by the caller\n\t- Return file paths as absolute paths in your final response\n\t- For clear communication, avoid using emojis\n\t- Communicate your final report directly as a regular message - do NOT attempt to create files\n\t\n\tNOTE: You are meant to be a fast agent that returns output as quickly as possible. In order to achieve this you must:\n\t- Make efficient use of the tools that you have at your disposal: be smart about how you search for files and implementations\n\t- Wherever possible you should try to spawn multiple parallel tool calls for grepping and reading files\n\t\n\tComplete the user's search request efficiently and report your findings clearly.";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAqB/C,eAAO,MAAM,kBAAkB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAqB/C,eAAO,MAAM,kBAAkB,g9DAU+J,CAAC;AAE/L,eAAO,MAAM,WAAW,qvBAIqH,CAAC;AAE9I,eAAO,MAAM,sBAAsB,moBAImH,CAAC;AAEvJ,wBAAgB,mBAAmB,CACjC,YAAY,EAAE,MAAM,EACpB,UAAU,EAAE,OAAO,EACnB,UAAU,GAAE,OAAe,GAC1B,MAAM,CAmFR;AAED,eAAO,MAAM,qBAAqB,g9DAAqB,CAAC;AAExD,eAAO,MAAM,2BAA2B,igBAWO,CAAC;AAEhD,eAAO,MAAM,6BAA6B,izCAeK,CAAC;AAEhD,eAAO,MAAM,8BAA8B,21EAoCuC,CAAC;AAEnF,eAAO,MAAM,2BAA2B,25EAiDyG,CAAC;AAElJ,eAAO,MAAM,WAAW,kkDAoBjB,CAAC;AAER,eAAO,MAAM,+BAA+B,20CAsBG,CAAC;AAEhD,wBAAgB,iBAAiB,CAC/B,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,KAAK,EAAE,UAAU,EAAE,EACnB,OAAO,GAAE;IACP,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,QAAQ,CAAC,EAAE;QACT,YAAY,EAAE,MAAM,CAAC;QACrB,UAAU,EAAE,OAAO,CAAC;KACrB,CAAC;CACE,GACL,MAAM,CAqDR"}
|
package/dist/prompts/index.js
CHANGED
|
@@ -12,8 +12,8 @@ The user will primarily request you perform software engineering tasks. This inc
|
|
|
12
12
|
- Don't add features, refactor code, or make "improvements" beyond what was asked. A bug fix doesn't need surrounding code cleaned up. A simple feature doesn't need extra configurability. Don't add docstrings, comments, or type annotations to code you didn't change. Only add comments where the logic isn't self-evident.
|
|
13
13
|
- Don't add error handling, fallbacks, or validation for scenarios that can't happen. Trust internal code and framework guarantees. Only validate at system boundaries (user input, external APIs). Don't use feature flags or backwards-compatibility shims when you can just change the code.
|
|
14
14
|
- Don't create helpers, utilities, or abstractions for one-time operations. Don't design for hypothetical future requirements. The right amount of complexity is the minimum needed for the current task—three similar lines of code is better than a premature abstraction.
|
|
15
|
-
- Avoid backwards-compatibility hacks like renaming unused \`_vars\`, re-exporting types, adding \`// removed\` comments for removed code, etc. If something is unused, delete it completely
|
|
16
|
-
|
|
15
|
+
- Avoid backwards-compatibility hacks like renaming unused \`_vars\`, re-exporting types, adding \`// removed\` comments for removed code, etc. If something is unused, delete it completely.`;
|
|
16
|
+
export const TOOL_POLICY = `
|
|
17
17
|
# Tool usage policy
|
|
18
18
|
- You can call multiple tools in a single response. If you intend to call multiple tools and there are no dependencies between them, make all independent tool calls in parallel. Maximize use of parallel tool calls where possible to increase efficiency.
|
|
19
19
|
- However, if some tool calls depend on previous calls to inform dependent values, do NOT call these tools in parallel and instead call them sequentially. For instance, if one operation must complete before another starts, run these operations sequentially instead. Never use placeholders or guess missing parameters in tool calls.
|
|
@@ -274,6 +274,7 @@ export function buildSystemPrompt(basePrompt, tools, options = {}) {
|
|
|
274
274
|
toolNames.has(TASK_LIST_TOOL_NAME)) {
|
|
275
275
|
prompt += TASK_MANAGEMENT_POLICY;
|
|
276
276
|
}
|
|
277
|
+
prompt += `\n\n${TOOL_POLICY}`;
|
|
277
278
|
for (const tool of tools) {
|
|
278
279
|
if (tool.prompt) {
|
|
279
280
|
prompt += tool.prompt();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bashTool.d.ts","sourceRoot":"","sources":["../../src/tools/bashTool.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAA2B,MAAM,YAAY,CAAC;AActE;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,
|
|
1
|
+
{"version":3,"file":"bashTool.d.ts","sourceRoot":"","sources":["../../src/tools/bashTool.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,UAAU,EAA2B,MAAM,YAAY,CAAC;AActE;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,UAkXtB,CAAC"}
|
package/dist/tools/bashTool.js
CHANGED
|
@@ -13,7 +13,33 @@ export const bashTool = {
|
|
|
13
13
|
type: "function",
|
|
14
14
|
function: {
|
|
15
15
|
name: BASH_TOOL_NAME,
|
|
16
|
-
description:
|
|
16
|
+
description: "Run shell command",
|
|
17
|
+
parameters: {
|
|
18
|
+
type: "object",
|
|
19
|
+
properties: {
|
|
20
|
+
command: {
|
|
21
|
+
type: "string",
|
|
22
|
+
description: "The command to execute",
|
|
23
|
+
},
|
|
24
|
+
timeout: {
|
|
25
|
+
type: "number",
|
|
26
|
+
description: "Optional timeout in milliseconds (max 600000)",
|
|
27
|
+
},
|
|
28
|
+
description: {
|
|
29
|
+
type: "string",
|
|
30
|
+
description: "Clear, concise description of what this command does in 5-10 words.",
|
|
31
|
+
},
|
|
32
|
+
run_in_background: {
|
|
33
|
+
type: "boolean",
|
|
34
|
+
description: `Set to true to run this command in the background. Use ${TASK_OUTPUT_TOOL_NAME} to read the output later.`,
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
required: ["command"],
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
prompt: () => `
|
|
42
|
+
Executes a given bash command in a persistent shell session with optional timeout, ensuring proper handling and security measures.
|
|
17
43
|
|
|
18
44
|
IMPORTANT: This tool is for terminal operations like git, npm, docker, etc. DO NOT use it for file operations (reading, writing, editing, searching, finding files) - use the specialized tools for this instead.
|
|
19
45
|
|
|
@@ -58,32 +84,7 @@ Usage notes:
|
|
|
58
84
|
<bad-example>
|
|
59
85
|
cd /foo/bar && pytest tests
|
|
60
86
|
</bad-example>
|
|
61
|
-
|
|
62
|
-
parameters: {
|
|
63
|
-
type: "object",
|
|
64
|
-
properties: {
|
|
65
|
-
command: {
|
|
66
|
-
type: "string",
|
|
67
|
-
description: "The command to execute",
|
|
68
|
-
},
|
|
69
|
-
timeout: {
|
|
70
|
-
type: "number",
|
|
71
|
-
description: "Optional timeout in milliseconds (max 600000)",
|
|
72
|
-
},
|
|
73
|
-
description: {
|
|
74
|
-
type: "string",
|
|
75
|
-
description: "Clear, concise description of what this command does in 5-10 words.",
|
|
76
|
-
},
|
|
77
|
-
run_in_background: {
|
|
78
|
-
type: "boolean",
|
|
79
|
-
description: `Set to true to run this command in the background. Use ${TASK_OUTPUT_TOOL_NAME} to read the output later.`,
|
|
80
|
-
},
|
|
81
|
-
},
|
|
82
|
-
required: ["command"],
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
prompt: () => `
|
|
87
|
+
|
|
87
88
|
- Reserve bash tools exclusively for actual system commands and terminal operations that require shell execution. NEVER use bash echo or other command-line tools to communicate thoughts, explanations, or instructions to the user. Output all communication directly in your response text instead.
|
|
88
89
|
- When making multiple bash tool calls, you MUST send a single message with multiple tools calls to run the calls in parallel. For example, if you need to run "git status" and "git diff", send a single message with two tool calls in parallel.`,
|
|
89
90
|
execute: async (args, context) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taskTool.d.ts","sourceRoot":"","sources":["../../src/tools/taskTool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAA2B,MAAM,YAAY,CAAC;AACtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAItE;;;GAGG;AACH,wBAAgB,cAAc,CAAC,eAAe,EAAE,eAAe,GAAG,UAAU,
|
|
1
|
+
{"version":3,"file":"taskTool.d.ts","sourceRoot":"","sources":["../../src/tools/taskTool.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAA2B,MAAM,YAAY,CAAC;AACtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAItE;;;GAGG;AACH,wBAAgB,cAAc,CAAC,eAAe,EAAE,eAAe,GAAG,UAAU,CA2O3E"}
|
package/dist/tools/taskTool.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fileSearch.d.ts","sourceRoot":"","sources":["../../src/utils/fileSearch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,IAAI,EAAE,MAAM,MAAM,CAAC;AAE9C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAEvD;;GAEG;AACH,eAAO,MAAM,uBAAuB,GAAI,OAAO,IAAI,EAAE,KAAG,QAAQ,
|
|
1
|
+
{"version":3,"file":"fileSearch.d.ts","sourceRoot":"","sources":["../../src/utils/fileSearch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,KAAK,IAAI,EAAE,MAAM,MAAM,CAAC;AAE9C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AAEvD;;GAEG;AACH,eAAO,MAAM,uBAAuB,GAAI,OAAO,IAAI,EAAE,KAAG,QAAQ,EAY/D,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,WAAW,GACtB,OAAO,MAAM,EACb,UAAU;IACR,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B,KACA,OAAO,CAAC,QAAQ,EAAE,CAmFpB,CAAC"}
|
package/dist/utils/fileSearch.js
CHANGED
|
@@ -4,10 +4,17 @@ import { getGlobIgnorePatterns } from "./fileFilter.js";
|
|
|
4
4
|
* Convert Path objects to FileItem objects
|
|
5
5
|
*/
|
|
6
6
|
export const convertPathsToFileItems = (paths) => {
|
|
7
|
-
return paths.map((pathObj) =>
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
return paths.map((pathObj) => {
|
|
8
|
+
const isDirectory = pathObj.isDirectory();
|
|
9
|
+
let path = pathObj.relative();
|
|
10
|
+
if (isDirectory && !path.endsWith("/")) {
|
|
11
|
+
path += "/";
|
|
12
|
+
}
|
|
13
|
+
return {
|
|
14
|
+
path,
|
|
15
|
+
type: isDirectory ? "directory" : "file",
|
|
16
|
+
};
|
|
17
|
+
});
|
|
11
18
|
};
|
|
12
19
|
/**
|
|
13
20
|
* Search files and directories using glob patterns
|
package/package.json
CHANGED
package/src/agent.ts
CHANGED
|
@@ -729,6 +729,19 @@ export class Agent {
|
|
|
729
729
|
);
|
|
730
730
|
}
|
|
731
731
|
|
|
732
|
+
// Update permission manager with configuration-based denied rules
|
|
733
|
+
if (currentConfig?.permissions?.deny) {
|
|
734
|
+
this.logger?.debug(
|
|
735
|
+
"Applying configured denied rules to PermissionManager",
|
|
736
|
+
{
|
|
737
|
+
count: currentConfig.permissions.deny.length,
|
|
738
|
+
},
|
|
739
|
+
);
|
|
740
|
+
this.permissionManager.updateDeniedRules(
|
|
741
|
+
currentConfig.permissions.deny,
|
|
742
|
+
);
|
|
743
|
+
}
|
|
744
|
+
|
|
732
745
|
// Update permission manager with configuration-based additionalDirectories
|
|
733
746
|
if (currentConfig?.permissions?.additionalDirectories) {
|
|
734
747
|
this.logger?.debug(
|
|
@@ -362,6 +362,11 @@ export class LiveConfigManager {
|
|
|
362
362
|
this.currentConfiguration.permissions.allow,
|
|
363
363
|
);
|
|
364
364
|
}
|
|
365
|
+
if (this.currentConfiguration.permissions?.deny) {
|
|
366
|
+
this.permissionManager.updateDeniedRules(
|
|
367
|
+
this.currentConfiguration.permissions.deny,
|
|
368
|
+
);
|
|
369
|
+
}
|
|
365
370
|
if (this.currentConfiguration.permissions?.additionalDirectories) {
|
|
366
371
|
this.permissionManager.updateAdditionalDirectories(
|
|
367
372
|
this.currentConfiguration.permissions.additionalDirectories,
|
|
@@ -345,6 +345,14 @@ export class PermissionManager {
|
|
|
345
345
|
}
|
|
346
346
|
}
|
|
347
347
|
|
|
348
|
+
// 1.2 Check if tool call is allowed by persistent or temporary rules
|
|
349
|
+
if (this.isAllowedByRule(context)) {
|
|
350
|
+
this.logger?.debug("Permission allowed by persistent rule", {
|
|
351
|
+
toolName: context.toolName,
|
|
352
|
+
});
|
|
353
|
+
return { behavior: "allow" };
|
|
354
|
+
}
|
|
355
|
+
|
|
348
356
|
// 1.3 If plan mode, allow Read-only tools and Edit/Write for plan file
|
|
349
357
|
if (context.permissionMode === "plan") {
|
|
350
358
|
const writeTools = [
|
|
@@ -384,14 +392,6 @@ export class PermissionManager {
|
|
|
384
392
|
}
|
|
385
393
|
}
|
|
386
394
|
|
|
387
|
-
// 1.2 Check if tool call matches any allowed rule
|
|
388
|
-
if (this.isAllowedByRule(context)) {
|
|
389
|
-
this.logger?.debug("Permission allowed by persistent rule", {
|
|
390
|
-
toolName: context.toolName,
|
|
391
|
-
});
|
|
392
|
-
return { behavior: "allow" };
|
|
393
|
-
}
|
|
394
|
-
|
|
395
395
|
// 2. If not a restricted tool, always allow
|
|
396
396
|
if (!this.isRestrictedTool(context.toolName)) {
|
|
397
397
|
this.logger?.debug("Tool is not restricted, allowing", {
|
package/src/prompts/index.ts
CHANGED
|
@@ -30,8 +30,9 @@ The user will primarily request you perform software engineering tasks. This inc
|
|
|
30
30
|
- Don't add features, refactor code, or make "improvements" beyond what was asked. A bug fix doesn't need surrounding code cleaned up. A simple feature doesn't need extra configurability. Don't add docstrings, comments, or type annotations to code you didn't change. Only add comments where the logic isn't self-evident.
|
|
31
31
|
- Don't add error handling, fallbacks, or validation for scenarios that can't happen. Trust internal code and framework guarantees. Only validate at system boundaries (user input, external APIs). Don't use feature flags or backwards-compatibility shims when you can just change the code.
|
|
32
32
|
- Don't create helpers, utilities, or abstractions for one-time operations. Don't design for hypothetical future requirements. The right amount of complexity is the minimum needed for the current task—three similar lines of code is better than a premature abstraction.
|
|
33
|
-
- Avoid backwards-compatibility hacks like renaming unused \`_vars\`, re-exporting types, adding \`// removed\` comments for removed code, etc. If something is unused, delete it completely
|
|
33
|
+
- Avoid backwards-compatibility hacks like renaming unused \`_vars\`, re-exporting types, adding \`// removed\` comments for removed code, etc. If something is unused, delete it completely.`;
|
|
34
34
|
|
|
35
|
+
export const TOOL_POLICY = `
|
|
35
36
|
# Tool usage policy
|
|
36
37
|
- You can call multiple tools in a single response. If you intend to call multiple tools and there are no dependencies between them, make all independent tool calls in parallel. Maximize use of parallel tool calls where possible to increase efficiency.
|
|
37
38
|
- However, if some tool calls depend on previous calls to inform dependent values, do NOT call these tools in parallel and instead call them sequentially. For instance, if one operation must complete before another starts, run these operations sequentially instead. Never use placeholders or guess missing parameters in tool calls.
|
|
@@ -325,6 +326,8 @@ export function buildSystemPrompt(
|
|
|
325
326
|
prompt += TASK_MANAGEMENT_POLICY;
|
|
326
327
|
}
|
|
327
328
|
|
|
329
|
+
prompt += `\n\n${TOOL_POLICY}`;
|
|
330
|
+
|
|
328
331
|
for (const tool of tools) {
|
|
329
332
|
if (tool.prompt) {
|
|
330
333
|
prompt += tool.prompt();
|
package/src/tools/bashTool.ts
CHANGED
|
@@ -24,7 +24,34 @@ export const bashTool: ToolPlugin = {
|
|
|
24
24
|
type: "function",
|
|
25
25
|
function: {
|
|
26
26
|
name: BASH_TOOL_NAME,
|
|
27
|
-
description:
|
|
27
|
+
description: "Run shell command",
|
|
28
|
+
parameters: {
|
|
29
|
+
type: "object",
|
|
30
|
+
properties: {
|
|
31
|
+
command: {
|
|
32
|
+
type: "string",
|
|
33
|
+
description: "The command to execute",
|
|
34
|
+
},
|
|
35
|
+
timeout: {
|
|
36
|
+
type: "number",
|
|
37
|
+
description: "Optional timeout in milliseconds (max 600000)",
|
|
38
|
+
},
|
|
39
|
+
description: {
|
|
40
|
+
type: "string",
|
|
41
|
+
description:
|
|
42
|
+
"Clear, concise description of what this command does in 5-10 words.",
|
|
43
|
+
},
|
|
44
|
+
run_in_background: {
|
|
45
|
+
type: "boolean",
|
|
46
|
+
description: `Set to true to run this command in the background. Use ${TASK_OUTPUT_TOOL_NAME} to read the output later.`,
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
required: ["command"],
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
prompt: () => `
|
|
54
|
+
Executes a given bash command in a persistent shell session with optional timeout, ensuring proper handling and security measures.
|
|
28
55
|
|
|
29
56
|
IMPORTANT: This tool is for terminal operations like git, npm, docker, etc. DO NOT use it for file operations (reading, writing, editing, searching, finding files) - use the specialized tools for this instead.
|
|
30
57
|
|
|
@@ -69,33 +96,7 @@ Usage notes:
|
|
|
69
96
|
<bad-example>
|
|
70
97
|
cd /foo/bar && pytest tests
|
|
71
98
|
</bad-example>
|
|
72
|
-
|
|
73
|
-
parameters: {
|
|
74
|
-
type: "object",
|
|
75
|
-
properties: {
|
|
76
|
-
command: {
|
|
77
|
-
type: "string",
|
|
78
|
-
description: "The command to execute",
|
|
79
|
-
},
|
|
80
|
-
timeout: {
|
|
81
|
-
type: "number",
|
|
82
|
-
description: "Optional timeout in milliseconds (max 600000)",
|
|
83
|
-
},
|
|
84
|
-
description: {
|
|
85
|
-
type: "string",
|
|
86
|
-
description:
|
|
87
|
-
"Clear, concise description of what this command does in 5-10 words.",
|
|
88
|
-
},
|
|
89
|
-
run_in_background: {
|
|
90
|
-
type: "boolean",
|
|
91
|
-
description: `Set to true to run this command in the background. Use ${TASK_OUTPUT_TOOL_NAME} to read the output later.`,
|
|
92
|
-
},
|
|
93
|
-
},
|
|
94
|
-
required: ["command"],
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
},
|
|
98
|
-
prompt: () => `
|
|
99
|
+
|
|
99
100
|
- Reserve bash tools exclusively for actual system commands and terminal operations that require shell execution. NEVER use bash echo or other command-line tools to communicate thoughts, explanations, or instructions to the user. Output all communication directly in your response text instead.
|
|
100
101
|
- When making multiple bash tool calls, you MUST send a single message with multiple tools calls to run the calls in parallel. For example, if you need to run "git status" and "git diff", send a single message with two tool calls in parallel.`,
|
|
101
102
|
execute: async (
|
package/src/tools/taskTool.ts
CHANGED
|
@@ -138,6 +138,9 @@ export function createTaskTool(subagentManager: SubagentManager): ToolPlugin {
|
|
|
138
138
|
});
|
|
139
139
|
|
|
140
140
|
let shortResult = "";
|
|
141
|
+
if (toolCount > 2) {
|
|
142
|
+
shortResult += "... ";
|
|
143
|
+
}
|
|
141
144
|
if (lastTools.length > 0) {
|
|
142
145
|
shortResult += `${lastTools.join(", ")} `;
|
|
143
146
|
}
|
package/src/utils/fileSearch.ts
CHANGED
|
@@ -6,10 +6,17 @@ import type { FileItem } from "../types/fileSearch.js";
|
|
|
6
6
|
* Convert Path objects to FileItem objects
|
|
7
7
|
*/
|
|
8
8
|
export const convertPathsToFileItems = (paths: Path[]): FileItem[] => {
|
|
9
|
-
return paths.map((pathObj) =>
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
return paths.map((pathObj) => {
|
|
10
|
+
const isDirectory = pathObj.isDirectory();
|
|
11
|
+
let path = pathObj.relative();
|
|
12
|
+
if (isDirectory && !path.endsWith("/")) {
|
|
13
|
+
path += "/";
|
|
14
|
+
}
|
|
15
|
+
return {
|
|
16
|
+
path,
|
|
17
|
+
type: isDirectory ? "directory" : "file",
|
|
18
|
+
};
|
|
19
|
+
});
|
|
13
20
|
};
|
|
14
21
|
|
|
15
22
|
/**
|