ToolPermissionService imported ALL_BUILT_IN_TOOLS from allBuiltIns.ts, which imports runTerminalCommand.ts, which imports services/index.ts, which imports ToolPermissionService.ts - creating a circular dependency. This caused "ToolPermissionService is not a constructor" errors in tests because the module wasn't fully initialized when services/index.ts tried to instantiate it. Fix: Extract a lightweight builtInToolNames.ts with just the string names (no heavy imports) and use that in ToolPermissionService instead. Also add a vitest resolve alias for "src/" paths to match tsconfig baseUrl. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
25 lines
572 B
TypeScript
25 lines
572 B
TypeScript
/**
|
|
* Static list of built-in tool names.
|
|
* Kept separate from allBuiltIns.ts to avoid circular dependency:
|
|
* ToolPermissionService -> allBuiltIns -> runTerminalCommand -> services/index -> ToolPermissionService
|
|
*
|
|
* When adding a new built-in tool, update both this list and ALL_BUILT_IN_TOOLS in allBuiltIns.ts.
|
|
*/
|
|
export const BUILT_IN_TOOL_NAMES = [
|
|
"Edit",
|
|
"Exit",
|
|
"Fetch",
|
|
"List",
|
|
"MultiEdit",
|
|
"Read",
|
|
"ReportFailure",
|
|
"Bash",
|
|
"Search",
|
|
"Status",
|
|
"Subagent",
|
|
"Skills",
|
|
"UploadArtifact",
|
|
"Diff",
|
|
"Checklist",
|
|
"Write",
|
|
] as const;
|