xibecode 1.0.3 → 1.0.6

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.
Files changed (268) hide show
  1. package/dist/commands/chat.d.ts.map +1 -1
  2. package/dist/commands/chat.js +10 -7
  3. package/dist/commands/chat.js.map +1 -1
  4. package/dist/commands/diagnostics.js +1 -1
  5. package/dist/commands/diagnostics.js.map +1 -1
  6. package/dist/commands/mcp.js +1 -1
  7. package/dist/commands/mcp.js.map +1 -1
  8. package/dist/commands/resume.js +1 -1
  9. package/dist/commands/resume.js.map +1 -1
  10. package/dist/commands/run-pr.d.ts.map +1 -1
  11. package/dist/commands/run-pr.js +10 -9
  12. package/dist/commands/run-pr.js.map +1 -1
  13. package/dist/commands/run.d.ts.map +1 -1
  14. package/dist/commands/run.js +14 -13
  15. package/dist/commands/run.js.map +1 -1
  16. package/dist/commands/skills.d.ts.map +1 -1
  17. package/dist/commands/skills.js +3 -2
  18. package/dist/commands/skills.js.map +1 -1
  19. package/dist/components/AssistantMarkdown.js +1 -1
  20. package/dist/components/AssistantMarkdown.js.map +1 -1
  21. package/dist/ui/claude-style-chat.d.ts.map +1 -1
  22. package/dist/ui/claude-style-chat.js +12 -10
  23. package/dist/ui/claude-style-chat.js.map +1 -1
  24. package/dist/utils/built-in-skills-dir.d.ts +7 -0
  25. package/dist/utils/built-in-skills-dir.d.ts.map +1 -0
  26. package/dist/utils/built-in-skills-dir.js +11 -0
  27. package/dist/utils/built-in-skills-dir.js.map +1 -0
  28. package/dist/utils/config.d.ts +2 -119
  29. package/dist/utils/config.d.ts.map +1 -1
  30. package/dist/utils/config.js +3 -88
  31. package/dist/utils/config.js.map +1 -1
  32. package/package.json +11 -17
  33. package/dist/commands/punycode.d.ts +0 -5
  34. package/dist/commands/punycode.d.ts.map +0 -1
  35. package/dist/commands/punycode.js +0 -48
  36. package/dist/commands/punycode.js.map +0 -1
  37. package/dist/commands/tui.d.ts +0 -9
  38. package/dist/commands/tui.d.ts.map +0 -1
  39. package/dist/commands/tui.js +0 -83
  40. package/dist/commands/tui.js.map +0 -1
  41. package/dist/core/agent-tool-policies.d.ts +0 -5
  42. package/dist/core/agent-tool-policies.d.ts.map +0 -1
  43. package/dist/core/agent-tool-policies.js +0 -18
  44. package/dist/core/agent-tool-policies.js.map +0 -1
  45. package/dist/core/agent.d.ts +0 -181
  46. package/dist/core/agent.d.ts.map +0 -1
  47. package/dist/core/agent.js +0 -1777
  48. package/dist/core/agent.js.map +0 -1
  49. package/dist/core/background-agent.d.ts +0 -23
  50. package/dist/core/background-agent.d.ts.map +0 -1
  51. package/dist/core/background-agent.js +0 -175
  52. package/dist/core/background-agent.js.map +0 -1
  53. package/dist/core/code-graph.d.ts +0 -18
  54. package/dist/core/code-graph.d.ts.map +0 -1
  55. package/dist/core/code-graph.js +0 -105
  56. package/dist/core/code-graph.js.map +0 -1
  57. package/dist/core/conflict-solver.d.ts +0 -26
  58. package/dist/core/conflict-solver.d.ts.map +0 -1
  59. package/dist/core/conflict-solver.js +0 -108
  60. package/dist/core/conflict-solver.js.map +0 -1
  61. package/dist/core/context-compactor.d.ts +0 -10
  62. package/dist/core/context-compactor.d.ts.map +0 -1
  63. package/dist/core/context-compactor.js +0 -158
  64. package/dist/core/context-compactor.js.map +0 -1
  65. package/dist/core/context-pruner.d.ts +0 -19
  66. package/dist/core/context-pruner.d.ts.map +0 -1
  67. package/dist/core/context-pruner.js +0 -103
  68. package/dist/core/context-pruner.js.map +0 -1
  69. package/dist/core/context.d.ts +0 -82
  70. package/dist/core/context.d.ts.map +0 -1
  71. package/dist/core/context.js +0 -273
  72. package/dist/core/context.js.map +0 -1
  73. package/dist/core/conversation-recovery.d.ts +0 -9
  74. package/dist/core/conversation-recovery.d.ts.map +0 -1
  75. package/dist/core/conversation-recovery.js +0 -15
  76. package/dist/core/conversation-recovery.js.map +0 -1
  77. package/dist/core/debug-workflow.d.ts +0 -9
  78. package/dist/core/debug-workflow.d.ts.map +0 -1
  79. package/dist/core/debug-workflow.js +0 -19
  80. package/dist/core/debug-workflow.js.map +0 -1
  81. package/dist/core/docs-scraper.d.ts +0 -40
  82. package/dist/core/docs-scraper.d.ts.map +0 -1
  83. package/dist/core/docs-scraper.js +0 -386
  84. package/dist/core/docs-scraper.js.map +0 -1
  85. package/dist/core/editor.d.ts +0 -87
  86. package/dist/core/editor.d.ts.map +0 -1
  87. package/dist/core/editor.js +0 -377
  88. package/dist/core/editor.js.map +0 -1
  89. package/dist/core/export.d.ts +0 -11
  90. package/dist/core/export.d.ts.map +0 -1
  91. package/dist/core/export.js +0 -54
  92. package/dist/core/export.js.map +0 -1
  93. package/dist/core/history-manager.d.ts +0 -75
  94. package/dist/core/history-manager.d.ts.map +0 -1
  95. package/dist/core/history-manager.js +0 -146
  96. package/dist/core/history-manager.js.map +0 -1
  97. package/dist/core/marketplace-client.d.ts +0 -52
  98. package/dist/core/marketplace-client.d.ts.map +0 -1
  99. package/dist/core/marketplace-client.js +0 -71
  100. package/dist/core/marketplace-client.js.map +0 -1
  101. package/dist/core/mcp/mcp-config.d.ts +0 -10
  102. package/dist/core/mcp/mcp-config.d.ts.map +0 -1
  103. package/dist/core/mcp/mcp-config.js +0 -70
  104. package/dist/core/mcp/mcp-config.js.map +0 -1
  105. package/dist/core/mcp/mcp-policy.d.ts +0 -17
  106. package/dist/core/mcp/mcp-policy.d.ts.map +0 -1
  107. package/dist/core/mcp/mcp-policy.js +0 -56
  108. package/dist/core/mcp/mcp-policy.js.map +0 -1
  109. package/dist/core/mcp/oauth-flow.d.ts +0 -30
  110. package/dist/core/mcp/oauth-flow.d.ts.map +0 -1
  111. package/dist/core/mcp/oauth-flow.js +0 -230
  112. package/dist/core/mcp/oauth-flow.js.map +0 -1
  113. package/dist/core/mcp/oauth-store.d.ts +0 -13
  114. package/dist/core/mcp/oauth-store.d.ts.map +0 -1
  115. package/dist/core/mcp/oauth-store.js +0 -68
  116. package/dist/core/mcp/oauth-store.js.map +0 -1
  117. package/dist/core/mcp/resolve-mcp-servers.d.ts +0 -16
  118. package/dist/core/mcp/resolve-mcp-servers.d.ts.map +0 -1
  119. package/dist/core/mcp/resolve-mcp-servers.js +0 -83
  120. package/dist/core/mcp/resolve-mcp-servers.js.map +0 -1
  121. package/dist/core/mcp-client.d.ts +0 -99
  122. package/dist/core/mcp-client.d.ts.map +0 -1
  123. package/dist/core/mcp-client.js +0 -317
  124. package/dist/core/mcp-client.js.map +0 -1
  125. package/dist/core/memory-promotions.d.ts +0 -15
  126. package/dist/core/memory-promotions.d.ts.map +0 -1
  127. package/dist/core/memory-promotions.js +0 -38
  128. package/dist/core/memory-promotions.js.map +0 -1
  129. package/dist/core/memory.d.ts +0 -32
  130. package/dist/core/memory.d.ts.map +0 -1
  131. package/dist/core/memory.js +0 -121
  132. package/dist/core/memory.js.map +0 -1
  133. package/dist/core/modes.d.ts +0 -432
  134. package/dist/core/modes.d.ts.map +0 -1
  135. package/dist/core/modes.js +0 -1094
  136. package/dist/core/modes.js.map +0 -1
  137. package/dist/core/pattern-miner.d.ts +0 -43
  138. package/dist/core/pattern-miner.d.ts.map +0 -1
  139. package/dist/core/pattern-miner.js +0 -123
  140. package/dist/core/pattern-miner.js.map +0 -1
  141. package/dist/core/permission-store.d.ts +0 -15
  142. package/dist/core/permission-store.d.ts.map +0 -1
  143. package/dist/core/permission-store.js +0 -30
  144. package/dist/core/permission-store.js.map +0 -1
  145. package/dist/core/permissions.d.ts +0 -33
  146. package/dist/core/permissions.d.ts.map +0 -1
  147. package/dist/core/permissions.js +0 -141
  148. package/dist/core/permissions.js.map +0 -1
  149. package/dist/core/plan-artifacts.d.ts +0 -10
  150. package/dist/core/plan-artifacts.d.ts.map +0 -1
  151. package/dist/core/plan-artifacts.js +0 -60
  152. package/dist/core/plan-artifacts.js.map +0 -1
  153. package/dist/core/plan-session.d.ts +0 -25
  154. package/dist/core/plan-session.d.ts.map +0 -1
  155. package/dist/core/plan-session.js +0 -99
  156. package/dist/core/plan-session.js.map +0 -1
  157. package/dist/core/planMode.d.ts +0 -51
  158. package/dist/core/planMode.d.ts.map +0 -1
  159. package/dist/core/planMode.js +0 -245
  160. package/dist/core/planMode.js.map +0 -1
  161. package/dist/core/plugins.d.ts +0 -96
  162. package/dist/core/plugins.d.ts.map +0 -1
  163. package/dist/core/plugins.js +0 -204
  164. package/dist/core/plugins.js.map +0 -1
  165. package/dist/core/session-bridge.d.ts +0 -128
  166. package/dist/core/session-bridge.d.ts.map +0 -1
  167. package/dist/core/session-bridge.js +0 -328
  168. package/dist/core/session-bridge.js.map +0 -1
  169. package/dist/core/session-manager.d.ts +0 -80
  170. package/dist/core/session-manager.d.ts.map +0 -1
  171. package/dist/core/session-manager.js +0 -166
  172. package/dist/core/session-manager.js.map +0 -1
  173. package/dist/core/session-memory.d.ts +0 -45
  174. package/dist/core/session-memory.d.ts.map +0 -1
  175. package/dist/core/session-memory.js +0 -103
  176. package/dist/core/session-memory.js.map +0 -1
  177. package/dist/core/skill-selection.d.ts +0 -36
  178. package/dist/core/skill-selection.d.ts.map +0 -1
  179. package/dist/core/skill-selection.js +0 -172
  180. package/dist/core/skill-selection.js.map +0 -1
  181. package/dist/core/skills-sh-client.d.ts +0 -19
  182. package/dist/core/skills-sh-client.d.ts.map +0 -1
  183. package/dist/core/skills-sh-client.js +0 -75
  184. package/dist/core/skills-sh-client.js.map +0 -1
  185. package/dist/core/skills.d.ts +0 -97
  186. package/dist/core/skills.d.ts.map +0 -1
  187. package/dist/core/skills.js +0 -339
  188. package/dist/core/skills.js.map +0 -1
  189. package/dist/core/swarm.d.ts +0 -34
  190. package/dist/core/swarm.d.ts.map +0 -1
  191. package/dist/core/swarm.js +0 -111
  192. package/dist/core/swarm.js.map +0 -1
  193. package/dist/core/task-status.d.ts +0 -13
  194. package/dist/core/task-status.d.ts.map +0 -1
  195. package/dist/core/task-status.js +0 -17
  196. package/dist/core/task-status.js.map +0 -1
  197. package/dist/core/tool-orchestrator.d.ts +0 -30
  198. package/dist/core/tool-orchestrator.d.ts.map +0 -1
  199. package/dist/core/tool-orchestrator.js +0 -89
  200. package/dist/core/tool-orchestrator.js.map +0 -1
  201. package/dist/core/tools.d.ts +0 -462
  202. package/dist/core/tools.d.ts.map +0 -1
  203. package/dist/core/tools.js +0 -2916
  204. package/dist/core/tools.js.map +0 -1
  205. package/dist/core/transcript-cleanup.d.ts +0 -8
  206. package/dist/core/transcript-cleanup.d.ts.map +0 -1
  207. package/dist/core/transcript-cleanup.js +0 -52
  208. package/dist/core/transcript-cleanup.js.map +0 -1
  209. package/dist/core/visual-feedback.d.ts +0 -20
  210. package/dist/core/visual-feedback.d.ts.map +0 -1
  211. package/dist/core/visual-feedback.js +0 -117
  212. package/dist/core/visual-feedback.js.map +0 -1
  213. package/dist/tools/browser.d.ts +0 -120
  214. package/dist/tools/browser.d.ts.map +0 -1
  215. package/dist/tools/browser.js +0 -439
  216. package/dist/tools/browser.js.map +0 -1
  217. package/dist/tools/test-generator.d.ts +0 -157
  218. package/dist/tools/test-generator.d.ts.map +0 -1
  219. package/dist/tools/test-generator.js +0 -893
  220. package/dist/tools/test-generator.js.map +0 -1
  221. package/dist/tui/InkApp.d.ts +0 -21
  222. package/dist/tui/InkApp.d.ts.map +0 -1
  223. package/dist/tui/InkApp.js +0 -146
  224. package/dist/tui/InkApp.js.map +0 -1
  225. package/dist/tui/MarkdownMessage.d.ts +0 -16
  226. package/dist/tui/MarkdownMessage.d.ts.map +0 -1
  227. package/dist/tui/MarkdownMessage.js +0 -63
  228. package/dist/tui/MarkdownMessage.js.map +0 -1
  229. package/dist/tui/blessed-chat.d.ts +0 -9
  230. package/dist/tui/blessed-chat.d.ts.map +0 -1
  231. package/dist/tui/blessed-chat.js +0 -887
  232. package/dist/tui/blessed-chat.js.map +0 -1
  233. package/dist/tui/markdown-to-blessed.d.ts +0 -6
  234. package/dist/tui/markdown-to-blessed.d.ts.map +0 -1
  235. package/dist/tui/markdown-to-blessed.js +0 -26
  236. package/dist/tui/markdown-to-blessed.js.map +0 -1
  237. package/dist/ui/ink/App.d.ts +0 -25
  238. package/dist/ui/ink/App.d.ts.map +0 -1
  239. package/dist/ui/ink/App.js +0 -372
  240. package/dist/ui/ink/App.js.map +0 -1
  241. package/dist/utils/at-references.d.ts +0 -14
  242. package/dist/utils/at-references.d.ts.map +0 -1
  243. package/dist/utils/at-references.js +0 -47
  244. package/dist/utils/at-references.js.map +0 -1
  245. package/dist/utils/auto-memory.d.ts +0 -24
  246. package/dist/utils/auto-memory.d.ts.map +0 -1
  247. package/dist/utils/auto-memory.js +0 -153
  248. package/dist/utils/auto-memory.js.map +0 -1
  249. package/dist/utils/git.d.ts +0 -89
  250. package/dist/utils/git.d.ts.map +0 -1
  251. package/dist/utils/git.js +0 -444
  252. package/dist/utils/git.js.map +0 -1
  253. package/dist/utils/mcp-servers-file.d.ts +0 -46
  254. package/dist/utils/mcp-servers-file.d.ts.map +0 -1
  255. package/dist/utils/mcp-servers-file.js +0 -212
  256. package/dist/utils/mcp-servers-file.js.map +0 -1
  257. package/dist/utils/safety.d.ts +0 -60
  258. package/dist/utils/safety.d.ts.map +0 -1
  259. package/dist/utils/safety.js +0 -254
  260. package/dist/utils/safety.js.map +0 -1
  261. package/dist/utils/smithery.d.ts +0 -25
  262. package/dist/utils/smithery.d.ts.map +0 -1
  263. package/dist/utils/smithery.js +0 -50
  264. package/dist/utils/smithery.js.map +0 -1
  265. package/dist/utils/testRunner.d.ts +0 -44
  266. package/dist/utils/testRunner.d.ts.map +0 -1
  267. package/dist/utils/testRunner.js +0 -270
  268. package/dist/utils/testRunner.js.map +0 -1
@@ -1,462 +0,0 @@
1
- import type { Tool } from '@anthropic-ai/sdk/resources/messages';
2
- import { AgentMode } from './modes.js';
3
- import { PluginManager } from './plugins.js';
4
- import { MCPClientManager } from './mcp-client.js';
5
- import { NeuralMemory } from './memory.js';
6
- import { SkillManager } from './skills.js';
7
- import { PermissionManager, type PermissionMode } from './permissions.js';
8
- declare function compactCommandOutput(value: string, maxChars: number): {
9
- output: string;
10
- truncated: boolean;
11
- originalLength: number;
12
- };
13
- /** Returned by former Playwright-backed browser tools; XibeCode does not bundle browsers. */
14
- export declare const NO_EMBEDDED_BROWSER_MESSAGE = "XibeCode does not bundle Playwright, Chromium, or agent-browser. Install agent-browser globally on supported OS/arch if you want it, or use your environment browser MCP / fetch_url. For Playwright E2E in a repo, add @playwright/test there and run it via run_command.";
15
- /**
16
- * Interface for tool executors
17
- *
18
- * @category Tool Execution
19
- * @since 0.1.0
20
- */
21
- export interface ToolExecutor {
22
- /**
23
- * Execute a tool with given input
24
- *
25
- * @param toolName - Name of the tool to execute
26
- * @param input - Tool input parameters
27
- * @returns Tool execution result
28
- */
29
- execute(toolName: string, input: any): Promise<any>;
30
- /**
31
- * Get all available tools
32
- *
33
- * @returns Array of tool definitions
34
- */
35
- getTools(): Tool[];
36
- }
37
- export declare const __testing: {
38
- compactCommandOutput: typeof compactCommandOutput;
39
- };
40
- /**
41
- * Main tool executor for XibeCode agent
42
- *
43
- * Provides 95+ tools across 8 categories for autonomous coding operations:
44
- * - File Operations: read, write, edit, delete files
45
- * - Git Operations: status, diff, commit, reset
46
- * - Shell Commands: run commands, interactive shell
47
- * - Web Operations: search, fetch URLs, HTTP requests
48
- * - Context Operations: code search, file finding, context discovery
49
- * - Test Operations: run tests, get results
50
- * - Memory Operations: update neural memory
51
- * - Browser guidance: use run_command + agent-browser (no bundled browser)
52
- *
53
- * Features:
54
- * - Mode-based tool permissions
55
- * - Safety checking for dangerous operations
56
- * - Plugin support for custom tools
57
- * - MCP integration for external tools
58
- * - Dry-run mode for safe previews
59
- * - Backup system for file operations
60
- *
61
- * @example
62
- * ```typescript
63
- * const executor = new CodingToolExecutor('/project', {
64
- * dryRun: false,
65
- * pluginManager,
66
- * memory
67
- * });
68
- *
69
- * executor.setMode('agent');
70
- *
71
- * // Read a file
72
- * const result = await executor.execute('read_file', { path: 'src/app.ts' });
73
- *
74
- * // Edit a file
75
- * await executor.execute('edit_file', {
76
- * path: 'src/app.ts',
77
- * search: 'old code',
78
- * replace: 'new code'
79
- * });
80
- * ```
81
- *
82
- * @category Tool Execution
83
- * @since 0.1.0
84
- */
85
- export declare class CodingToolExecutor implements ToolExecutor {
86
- private workingDir;
87
- private contextManager;
88
- private fileEditor;
89
- private gitUtils;
90
- private testRunner;
91
- private safetyChecker;
92
- private pluginManager;
93
- private mcpClientManager?;
94
- private memory?;
95
- private skillManager;
96
- private patternMiner;
97
- private backgroundAgent;
98
- private codeGraph;
99
- private conflictSolver;
100
- private swarmOrchestrator;
101
- private platform;
102
- private dryRun;
103
- private testCommandOverride?;
104
- private permissionManager;
105
- /** Session-scoped tools synthesized by the agent (meta-agent). Execution is sandboxed via run_command. */
106
- private dynamicTools;
107
- private mcpOAuth;
108
- /**
109
- * Creates a new CodingToolExecutor instance
110
- *
111
- * Initializes all tool subsystems including file operations, git utilities,
112
- * test runner, safety checker, plugin manager, and optional MCP integration.
113
- *
114
- * @example
115
- * ```typescript
116
- * // Basic usage
117
- * const executor = new CodingToolExecutor('/project');
118
- *
119
- * // With options
120
- * const executor = new CodingToolExecutor('/project', {
121
- * dryRun: true,
122
- * pluginManager: new PluginManager(),
123
- * memory: new NeuralMemory('./.xibecode/memory.json')
124
- * });
125
- * ```
126
- *
127
- * @param workingDir - Working directory for file operations (default: process.cwd())
128
- * @param options - Configuration options
129
- * @param options.dryRun - Enable dry-run mode (preview changes without executing)
130
- * @param options.testCommandOverride - Override test command detection
131
- * @param options.pluginManager - Plugin manager instance for custom tools
132
- * @param options.mcpClientManager - MCP client manager for external tool integration
133
- * @param options.memory - Neural memory instance for persistent learning
134
- * @param options.skillManager - Skill manager for loading custom workflows
135
- *
136
- * @category Constructor
137
- * @since 0.1.0
138
- */
139
- constructor(workingDir?: string, options?: {
140
- dryRun?: boolean;
141
- testCommandOverride?: string;
142
- pluginManager?: PluginManager;
143
- mcpClientManager?: MCPClientManager;
144
- memory?: NeuralMemory;
145
- skillManager?: SkillManager;
146
- permissionManager?: PermissionManager;
147
- });
148
- private currentMode;
149
- /**
150
- * Set the current agent mode
151
- *
152
- * Changes the tool executor's operating mode, which affects:
153
- * - Tool permissions (what tools are available)
154
- * - Dry-run default (some modes preview changes by default)
155
- * - Risk tolerance for operations
156
- *
157
- * @example
158
- * ```typescript
159
- * executor.setMode('plan'); // Read-only mode
160
- * executor.setMode('agent'); // Full capabilities
161
- * executor.setMode('security'); // Security-focused mode
162
- * ```
163
- *
164
- * @param mode - Agent mode to switch to
165
- *
166
- * @category Mode Management
167
- * @since 0.1.0
168
- */
169
- setMode(mode: AgentMode): void;
170
- setPermissionMode(permissionMode: PermissionMode): void;
171
- getPermissionContext(): import("./permissions.js").ToolPermissionContext;
172
- /**
173
- * Safely parse tool input - handles string JSON, null, undefined
174
- *
175
- * @param input - Raw tool input (string, object, null, or undefined)
176
- * @returns Parsed input as object
177
- *
178
- * @internal
179
- */
180
- private parseInput;
181
- private resolveToolCategory;
182
- /**
183
- * Execute a tool with given input
184
- *
185
- * Main tool execution pipeline that:
186
- * 1. Checks tool permissions for current mode
187
- * 2. Routes MCP tools to external servers
188
- * 3. Routes plugin tools to plugin manager
189
- * 4. Performs safety assessment for risky operations
190
- * 5. Executes the tool implementation
191
- * 6. Returns structured result
192
- *
193
- * @example
194
- * ```typescript
195
- * // Read a file
196
- * const result = await executor.execute('read_file', {
197
- * path: 'src/app.ts'
198
- * });
199
- *
200
- * if (result.success) {
201
- * console.log(result.content);
202
- * }
203
- *
204
- * // Edit a file
205
- * await executor.execute('edit_file', {
206
- * path: 'src/app.ts',
207
- * search: 'const old = 1;',
208
- * replace: 'const new = 2;'
209
- * });
210
- *
211
- * // Run a command
212
- * await executor.execute('run_command', {
213
- * command: 'npm test'
214
- * });
215
- * ```
216
- *
217
- * @param toolName - Name of the tool to execute (e.g., 'read_file', 'edit_file')
218
- * @param input - Tool input parameters (varies by tool)
219
- * @returns Tool execution result with success/error status
220
- *
221
- * @see {@link getTools} for list of available tools
222
- * @category Tool Execution
223
- * @since 0.1.0
224
- */
225
- execute(toolName: string, input: any): Promise<any>;
226
- /**
227
- * Get all available tools for the agent
228
- *
229
- * Returns an array of tool definitions including core tools, plugin tools,
230
- * and MCP tools. Each tool includes:
231
- * - name: Tool identifier
232
- * - description: What the tool does (for Claude AI)
233
- * - input_schema: JSON Schema for input validation
234
- *
235
- * Tools are grouped by category:
236
- * - File Operations: read_file, write_file, edit_file, etc.
237
- * - Git Operations: get_git_status, git_commit, etc.
238
- * - Shell Commands: run_command, interactive_shell
239
- * - Web Operations: web_search, fetch_url, http_request
240
- * - Context Operations: grep_code, search_files, get_context
241
- * - Test Operations: run_tests, get_test_status
242
- * - Memory Operations: update_memory
243
- * - Browser Operations: open_browser, browser_click, etc.
244
- *
245
- * @example
246
- * ```typescript
247
- * const tools = executor.getTools();
248
- * console.log(`${tools.length} tools available`);
249
- *
250
- * // Find a specific tool
251
- * const readFile = tools.find(t => t.name === 'read_file');
252
- * console.log(readFile.description);
253
- * ```
254
- *
255
- * @returns Array of tool definitions with schemas
256
- *
257
- * @category Tool Management
258
- * @since 0.1.0
259
- */
260
- getTools(): Tool[];
261
- /**
262
- * Resolve relative file path to absolute path
263
- *
264
- * @param filePath - Relative or absolute file path
265
- * @returns Absolute path resolved against working directory
266
- *
267
- * @internal
268
- */
269
- private resolvePath;
270
- /**
271
- * Read file contents
272
- *
273
- * Reads a file from the filesystem. Supports partial reading by line range
274
- * to avoid token limits for large files. Always returns UTF-8 encoded text.
275
- *
276
- * @example
277
- * ```typescript
278
- * // Read entire file
279
- * const result = await executor.execute('read_file', {
280
- * path: 'src/app.ts'
281
- * });
282
- *
283
- * // Read specific line range
284
- * const partial = await executor.execute('read_file', {
285
- * path: 'src/large-file.ts',
286
- * start_line: 100,
287
- * end_line: 200
288
- * });
289
- * ```
290
- *
291
- * @param filePath - Path to file (relative to working directory)
292
- * @param startLine - Optional start line for partial read (1-indexed)
293
- * @param endLine - Optional end line for partial read (inclusive)
294
- * @returns Object with path, content, and line info
295
- *
296
- * @throws {FileNotFoundError} If file doesn't exist
297
- * @throws {PermissionError} If file is not readable
298
- *
299
- * @category File Operations
300
- * @mode All modes
301
- * @since 0.1.0
302
- */
303
- private readFile;
304
- private readMultipleFiles;
305
- /**
306
- * Write content to file
307
- *
308
- * Creates or overwrites a file with the given content. Automatically creates
309
- * parent directories if they don't exist. Creates a backup before overwriting
310
- * existing files.
311
- *
312
- * In dry-run mode, shows what would be written without making changes.
313
- *
314
- * @example
315
- * ```typescript
316
- * await executor.execute('write_file', {
317
- * path: 'src/new-file.ts',
318
- * content: 'export const hello = "world";'
319
- * });
320
- * ```
321
- *
322
- * @param filePath - Path to file (relative to working directory)
323
- * @param content - File content to write
324
- * @returns Object with success status, path, and file info
325
- *
326
- * @throws {PermissionError} If directory is not writable
327
- *
328
- * @category File Operations
329
- * @mode Write modes (agent, engineer, architect)
330
- * @since 0.1.0
331
- */
332
- private writeFile;
333
- /**
334
- * Edit file using search and replace
335
- *
336
- * Performs intelligent search-and-replace editing using the FileEditor's
337
- * smart edit strategy. Searches for exact string matches and replaces them.
338
- * Automatically handles multi-line strings and special characters.
339
- *
340
- * Creates a backup before editing. In dry-run mode, shows what would be
341
- * changed without modifying the file.
342
- *
343
- * @example
344
- * ```typescript
345
- * // Replace first occurrence
346
- * await executor.execute('edit_file', {
347
- * path: 'src/app.ts',
348
- * search: 'const oldValue = 1;',
349
- * replace: 'const newValue = 2;'
350
- * });
351
- *
352
- * // Replace all occurrences
353
- * await executor.execute('edit_file', {
354
- * path: 'src/app.ts',
355
- * search: 'oldName',
356
- * replace: 'newName',
357
- * all: true
358
- * });
359
- * ```
360
- *
361
- * @param filePath - Path to file (relative to working directory)
362
- * @param search - Exact string to search for (can be multi-line)
363
- * @param replace - Replacement string
364
- * @param all - Replace all occurrences (default: false, replaces first only)
365
- * @returns Object with success status, changes made, and diff
366
- *
367
- * @throws {FileNotFoundError} If file doesn't exist
368
- * @throws {SearchNotFoundError} If search string not found
369
- *
370
- * @category File Operations
371
- * @mode Write modes (agent, engineer, architect)
372
- * @since 0.1.0
373
- */
374
- private editFile;
375
- private editLines;
376
- private verifiedEditFile;
377
- private insertAtLine;
378
- private listDirectory;
379
- private searchFiles;
380
- /**
381
- * Execute a shell command
382
- *
383
- * Runs a command in a shell (bash on Unix, PowerShell on Windows).
384
- * Captures stdout and stderr. Supports stdin input for interactive commands.
385
- * Automatically times out after 120 seconds (configurable).
386
- *
387
- * Safety checks are performed before execution to block dangerous commands
388
- * like `rm -rf /`, malicious scripts, and other high-risk operations.
389
- *
390
- * @example
391
- * ```typescript
392
- * // Run a simple command
393
- * const result = await executor.execute('run_command', {
394
- * command: 'npm test'
395
- * });
396
- *
397
- * // Run with specific working directory
398
- * await executor.execute('run_command', {
399
- * command: 'ls -la',
400
- * cwd: './src'
401
- * });
402
- *
403
- * // Run with stdin input
404
- * await executor.execute('run_command', {
405
- * command: 'cat > output.txt',
406
- * input: 'Hello World'
407
- * });
408
- *
409
- * // Run with custom timeout
410
- * await executor.execute('run_command', {
411
- * command: 'npm install',
412
- * timeout: 300 // 5 minutes
413
- * });
414
- * ```
415
- *
416
- * @param command - Shell command to execute
417
- * @param cwd - Working directory (default: executor's working directory)
418
- * @param input - Optional stdin input for interactive commands
419
- * @param timeout - Timeout in seconds (default: 120)
420
- * @returns Object with stdout, stderr, exit code, and execution time
421
- *
422
- * @throws {SafetyError} If command is blocked by safety checker
423
- * @throws {TimeoutError} If command exceeds timeout
424
- *
425
- * @category Shell Commands
426
- * @mode Command modes (agent, engineer, debugger, tester)
427
- * @risk-level High
428
- * @since 0.1.0
429
- */
430
- private runDynamicTool;
431
- private runCommand;
432
- private createDirectory;
433
- private deleteFile;
434
- private moveFile;
435
- private getContext;
436
- private revertFile;
437
- private lastTestResult;
438
- private runTests;
439
- private getTestStatus;
440
- private testGenerator;
441
- private getTestGenerator;
442
- private generateTests;
443
- private analyzeCodeForTests;
444
- private getGitStatus;
445
- private getGitDiffSummary;
446
- private getGitChangedFiles;
447
- private gitCommit;
448
- private gitBlameAi;
449
- private createGitCheckpoint;
450
- private revertToGitCheckpoint;
451
- private gitShowDiff;
452
- private mcpAuth;
453
- private getMCPStatus;
454
- private searchSkillsSh;
455
- private installSkillFromSkillsSh;
456
- private grepCode;
457
- private webSearch;
458
- private fetchUrl;
459
- private updateMemory;
460
- }
461
- export {};
462
- //# sourceMappingURL=tools.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../src/core/tools.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sCAAsC,CAAC;AAEjE,OAAO,EAAE,SAAS,EAA4D,MAAM,YAAY,CAAC;AAKjG,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAO3C,OAAO,EAAE,iBAAiB,EAAsB,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAO9F,iBAAS,oBAAoB,CAAC,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,OAAO,CAAC;IAAC,cAAc,EAAE,MAAM,CAAA;CAAE,CAe7H;AAED,6FAA6F;AAC7F,eAAO,MAAM,2BAA2B,+QACsO,CAAC;AAE/Q;;;;;GAKG;AACH,MAAM,WAAW,YAAY;IAC3B;;;;;;OAMG;IACH,OAAO,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;IAEpD;;;;OAIG;IACH,QAAQ,IAAI,IAAI,EAAE,CAAC;CACpB;AAED,eAAO,MAAM,SAAS;;CAErB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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