diff --git a/apps/x/packages/core/src/application/assistant/instructions.ts b/apps/x/packages/core/src/application/assistant/instructions.ts index b6e49cf0..d3ac9da9 100644 --- a/apps/x/packages/core/src/application/assistant/instructions.ts +++ b/apps/x/packages/core/src/application/assistant/instructions.ts @@ -42,13 +42,14 @@ When a user asks for ANY task that might require external capabilities (web sear ## Workspace access & scope - You have full read/write access inside \`${BASE_DIR}\` (this resolves to the user's \`~/.rowboat\` directory). Create folders, files, and agents there using builtin tools or allowed shell commands—don't wait for the user to do it manually. - If a user mentions a different root (e.g., \`~/.rowboatx\` or another path), clarify whether they meant the Rowboat workspace and propose the equivalent path you can act on. Only refuse if they explicitly insist on an inaccessible location. -- Prefer builtin file tools (\`createFile\`, \`updateFile\`, \`deleteFile\`, \`exploreDirectory\`) for workspace changes. Reserve refusal or "you do it" responses for cases that are truly outside the Rowboat sandbox. +- Prefer builtin file tools (\`workspace-writeFile\`, \`workspace-remove\`, \`workspace-readdir\`) for workspace changes. Reserve refusal or "you do it" responses for cases that are truly outside the Rowboat sandbox. ## Builtin Tools vs Shell Commands **IMPORTANT**: Rowboat provides builtin tools that are internal and do NOT require security allowlist entries: -- \`deleteFile\`, \`createFile\`, \`updateFile\`, \`readFile\` - File operations -- \`listFiles\`, \`exploreDirectory\` - Directory exploration +- \`workspace-readFile\`, \`workspace-writeFile\`, \`workspace-remove\` - File operations +- \`workspace-readdir\`, \`workspace-exists\`, \`workspace-stat\` - Directory exploration +- \`workspace-mkdir\`, \`workspace-rename\`, \`workspace-copy\` - File/directory management - \`analyzeAgent\` - Agent analysis - \`addMcpServer\`, \`listMcpServers\`, \`listMcpTools\`, \`executeMcpTool\` - MCP server management and execution - \`loadSkill\` - Skill loading @@ -57,10 +58,10 @@ These tools work directly and are NOT filtered by \`.rowboat/config/security.jso **CRITICAL: MCP Server Configuration** - ALWAYS use the \`addMcpServer\` builtin tool to add or update MCP servers—it validates the configuration before saving -- NEVER manually edit \`config/mcp.json\` using \`createFile\` or \`updateFile\` for MCP servers +- NEVER manually edit \`config/mcp.json\` using \`workspace-writeFile\` for MCP servers - Invalid MCP configs will prevent the agent from starting with validation errors -**Only \`executeCommand\` (shell/bash commands) is filtered** by the security allowlist. If you need to delete a file, use the \`deleteFile\` builtin tool, not \`executeCommand\` with \`rm\`. If you need to create a file, use \`createFile\`, not \`executeCommand\` with \`touch\` or \`echo >\`. +**Only \`executeCommand\` (shell/bash commands) is filtered** by the security allowlist. If you need to delete a file, use the \`workspace-remove\` builtin tool, not \`executeCommand\` with \`rm\`. If you need to create a file, use \`workspace-writeFile\`, not \`executeCommand\` with \`touch\` or \`echo >\`. The security allowlist in \`security.json\` only applies to shell commands executed via \`executeCommand\`, not to Rowboat's internal builtin tools. `; diff --git a/apps/x/packages/core/src/application/assistant/skills/builtin-tools/skill.ts b/apps/x/packages/core/src/application/assistant/skills/builtin-tools/skill.ts index 492d017e..7a777ee9 100644 --- a/apps/x/packages/core/src/application/assistant/skills/builtin-tools/skill.ts +++ b/apps/x/packages/core/src/application/assistant/skills/builtin-tools/skill.ts @@ -155,12 +155,16 @@ While \`executeCommand\` is the most versatile, other builtin tools exist for sp The Rowboat copilot has access to special builtin tools that regular agents don't typically use. These tools help the copilot assist users with workspace management and MCP integration: #### File & Directory Operations -- \`exploreDirectory\` - Recursively explore directory structure -- \`readFile\` - Read and parse file contents -- \`createFile\` - Create a new file with content -- \`updateFile\` - Update or overwrite existing file contents -- \`deleteFile\` - Delete a file -- \`listFiles\` - List all files and directories +- \`workspace-readdir\` - List directory contents (supports recursive exploration) +- \`workspace-readFile\` - Read file contents +- \`workspace-writeFile\` - Create or update file contents +- \`workspace-remove\` - Remove files or directories +- \`workspace-exists\` - Check if a file or directory exists +- \`workspace-stat\` - Get file/directory statistics +- \`workspace-mkdir\` - Create directories +- \`workspace-rename\` - Rename or move files/directories +- \`workspace-copy\` - Copy files +- \`workspace-getRoot\` - Get workspace root directory path #### Agent Operations - \`analyzeAgent\` - Read and analyze an agent file structure diff --git a/apps/x/packages/core/src/application/assistant/skills/mcp-integration/skill.ts b/apps/x/packages/core/src/application/assistant/skills/mcp-integration/skill.ts index ffbe7a21..6478f1bd 100644 --- a/apps/x/packages/core/src/application/assistant/skills/mcp-integration/skill.ts +++ b/apps/x/packages/core/src/application/assistant/skills/mcp-integration/skill.ts @@ -36,7 +36,7 @@ export const skill = String.raw` **ALWAYS use the \`addMcpServer\` builtin tool** to add or update MCP server configurations. This tool validates the configuration before saving and prevents startup errors. -**NEVER manually create or edit \`config/mcp.json\`** using \`createFile\` or \`updateFile\` for MCP servers—this bypasses validation and will cause errors. +**NEVER manually create or edit \`config/mcp.json\`** using \`workspace-writeFile\` for MCP servers—this bypasses validation and will cause errors. ### MCP Server Configuration Schema diff --git a/apps/x/packages/core/src/application/assistant/skills/workflow-authoring/skill.ts b/apps/x/packages/core/src/application/assistant/skills/workflow-authoring/skill.ts index 098b39ae..85bb113e 100644 --- a/apps/x/packages/core/src/application/assistant/skills/workflow-authoring/skill.ts +++ b/apps/x/packages/core/src/application/assistant/skills/workflow-authoring/skill.ts @@ -110,8 +110,9 @@ Internal Rowboat tools (executeCommand, file operations, MCP queries, etc.) **Available builtin tools:** - \`executeCommand\` - Execute shell commands -- \`readFile\`, \`createFile\`, \`updateFile\`, \`deleteFile\` - File operations -- \`listFiles\`, \`exploreDirectory\` - Directory operations +- \`workspace-readFile\`, \`workspace-writeFile\`, \`workspace-remove\` - File operations +- \`workspace-readdir\`, \`workspace-exists\`, \`workspace-stat\` - Directory operations +- \`workspace-mkdir\`, \`workspace-rename\`, \`workspace-copy\` - File/directory management - \`analyzeAgent\` - Analyze agent structure - \`addMcpServer\`, \`listMcpServers\`, \`listMcpTools\` - MCP management - \`loadSkill\` - Load skill guidance @@ -280,8 +281,8 @@ Reference other agents as tools to build multi-agent workflows - Invalid agents will fail to load and prevent workflow execution ### File Creation/Update Process -1. When creating an agent, use \`createFile\` with complete, valid JSON -2. When updating an agent, read it first with \`readFile\`, modify, then use \`updateFile\` +1. When creating an agent, use \`workspace-writeFile\` with complete, valid JSON +2. When updating an agent, read it first with \`workspace-readFile\`, modify, then use \`workspace-writeFile\` 3. Validate JSON syntax before writing—malformed JSON breaks the agent 4. Test agent loading after creation/update by using \`analyzeAgent\`