@wonderwhy-er/desktop-commander 0.1.33 → 0.1.35

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 (50) hide show
  1. package/README.md +105 -36
  2. package/dist/command-manager.d.ts +1 -7
  3. package/dist/command-manager.js +31 -50
  4. package/dist/config-manager.d.ts +27 -16
  5. package/dist/config-manager.js +109 -191
  6. package/dist/config.js +8 -4
  7. package/dist/error-handlers.d.ts +7 -0
  8. package/dist/error-handlers.js +15 -0
  9. package/dist/handlers/command-handlers.d.ts +4 -18
  10. package/dist/handlers/command-handlers.js +15 -3
  11. package/dist/handlers/edit-search-handlers.d.ts +3 -12
  12. package/dist/handlers/edit-search-handlers.js +10 -7
  13. package/dist/handlers/filesystem-handlers.d.ts +9 -66
  14. package/dist/handlers/filesystem-handlers.js +106 -65
  15. package/dist/handlers/index.d.ts +0 -1
  16. package/dist/handlers/index.js +0 -1
  17. package/dist/handlers/process-handlers.d.ts +3 -12
  18. package/dist/handlers/terminal-handlers.d.ts +5 -24
  19. package/dist/index.js +18 -3
  20. package/dist/sandbox/index.d.ts +9 -0
  21. package/dist/sandbox/index.js +50 -0
  22. package/dist/sandbox/mac-sandbox.d.ts +19 -0
  23. package/dist/sandbox/mac-sandbox.js +174 -0
  24. package/dist/server.js +156 -176
  25. package/dist/setup-claude-server.js +98 -49
  26. package/dist/terminal-manager.d.ts +1 -1
  27. package/dist/terminal-manager.js +26 -4
  28. package/dist/tools/config.d.ts +0 -58
  29. package/dist/tools/config.js +44 -107
  30. package/dist/tools/debug-path.d.ts +1 -0
  31. package/dist/tools/debug-path.js +44 -0
  32. package/dist/tools/edit.d.ts +3 -1
  33. package/dist/tools/edit.js +19 -7
  34. package/dist/tools/execute.d.ts +4 -18
  35. package/dist/tools/execute.js +27 -8
  36. package/dist/tools/filesystem-fixed.d.ts +22 -0
  37. package/dist/tools/filesystem-fixed.js +176 -0
  38. package/dist/tools/filesystem.d.ts +4 -6
  39. package/dist/tools/filesystem.js +106 -75
  40. package/dist/tools/process.d.ts +3 -12
  41. package/dist/tools/process.js +12 -3
  42. package/dist/tools/schemas.d.ts +15 -14
  43. package/dist/tools/schemas.js +10 -6
  44. package/dist/tools/search.js +3 -3
  45. package/dist/types.d.ts +12 -0
  46. package/dist/utils.d.ts +5 -0
  47. package/dist/utils.js +92 -32
  48. package/dist/version.d.ts +1 -1
  49. package/dist/version.js +1 -1
  50. package/package.json +1 -2
@@ -1,242 +1,160 @@
1
1
  import fs from 'fs/promises';
2
2
  import path from 'path';
3
- import { CONFIG_FILE } from './config.js';
4
- import * as process from 'process';
3
+ import { existsSync } from 'fs';
4
+ import { mkdir } from 'fs/promises';
5
+ import os from 'os';
5
6
  /**
6
- * Manages reading and writing server configuration
7
+ * Singleton config manager for the server
7
8
  */
8
- export class ConfigManager {
9
+ class ConfigManager {
9
10
  constructor() {
10
11
  this.config = {};
11
12
  this.initialized = false;
13
+ // Get user's home directory
14
+ const homeDir = os.homedir();
15
+ // Define config directory and file paths
16
+ const configDir = path.join(homeDir, '.claude-server-commander');
17
+ this.configPath = path.join(configDir, 'config.json');
12
18
  }
13
19
  /**
14
- * Load configuration from disk
20
+ * Initialize configuration - load from disk or create default
15
21
  */
16
- async loadConfig() {
22
+ async init() {
23
+ if (this.initialized)
24
+ return;
17
25
  try {
18
- console.error(`Loading config from ${CONFIG_FILE}...`);
19
- console.error(`Current working directory: ${process.cwd()}`);
20
- console.error(`Absolute config path: ${path.resolve(CONFIG_FILE)}`);
21
26
  // Ensure config directory exists
22
- const configDir = path.dirname(CONFIG_FILE);
23
- try {
24
- console.error(`Ensuring config directory exists: ${configDir}`);
25
- await fs.mkdir(configDir, { recursive: true });
26
- console.error(`Config directory ready: ${configDir}`);
27
- }
28
- catch (mkdirError) {
29
- console.error(`Error creating config directory: ${mkdirError.message}`);
30
- // Continue if directory already exists
31
- if (mkdirError.code !== 'EEXIST') {
32
- throw mkdirError;
33
- }
34
- }
35
- // Check if the directory exists and is writable
36
- try {
37
- const dirStats = await fs.stat(configDir);
38
- console.error(`Config directory exists: ${dirStats.isDirectory()}`);
39
- await fs.access(configDir, fs.constants.W_OK);
40
- console.error(`Directory ${configDir} is writable`);
41
- }
42
- catch (dirError) {
43
- console.error(`Config directory check error: ${dirError.message}`);
44
- }
45
- // Check file permissions
46
- try {
47
- const fileStats = await fs.stat(CONFIG_FILE).catch(() => null);
48
- if (fileStats) {
49
- console.error(`Config file exists, permissions: ${fileStats.mode.toString(8)}`);
50
- }
51
- else {
52
- console.error('Config file does not exist, will create');
53
- }
54
- }
55
- catch (statError) {
56
- console.error(`Error checking file stats: ${statError.message}`);
27
+ const configDir = path.dirname(this.configPath);
28
+ if (!existsSync(configDir)) {
29
+ await mkdir(configDir, { recursive: true });
57
30
  }
58
- let configData;
31
+ // Check if config file exists
59
32
  try {
60
- configData = await fs.readFile(CONFIG_FILE, 'utf-8');
61
- console.error(`Config file read successfully, content length: ${configData.length}`);
62
- }
63
- catch (readError) {
64
- console.error(`Error reading config file: ${readError.message}, code: ${readError.code}, stack: ${readError.stack}`);
65
- if (readError.code === 'ENOENT') {
66
- console.error('Config file does not exist, will create default');
67
- }
68
- else {
69
- throw readError;
70
- }
71
- }
72
- if (configData) {
73
- try {
74
- this.config = JSON.parse(configData);
75
- console.error(`Config parsed successfully: ${JSON.stringify(this.config, null, 2)}`);
76
- }
77
- catch (parseError) {
78
- console.error(`Failed to parse config JSON: ${parseError.message}`);
79
- // If file exists but has invalid JSON, use default empty config
80
- this.config = {};
81
- }
82
- }
83
- else {
84
- // If file doesn't exist, use default empty config
85
- this.config = {};
86
- }
87
- this.initialized = true;
88
- // Create default config file if it doesn't exist
89
- if (!configData) {
90
- console.error('Creating default config file');
33
+ await fs.access(this.configPath);
34
+ // Load existing config
35
+ const configData = await fs.readFile(this.configPath, 'utf8');
36
+ this.config = JSON.parse(configData);
37
+ }
38
+ catch (error) {
39
+ // Config file doesn't exist, create default
40
+ this.config = this.getDefaultConfig();
91
41
  await this.saveConfig();
92
42
  }
43
+ this.initialized = true;
93
44
  }
94
45
  catch (error) {
95
- console.error(`Unexpected error in loadConfig: ${error instanceof Error ? error.message : String(error)}`);
96
- console.error(error instanceof Error && error.stack ? error.stack : 'No stack trace available');
97
- // Initialize with empty config
98
- this.config = {};
99
- this.initialized = true; // Mark as initialized even with empty config
46
+ console.error('Failed to initialize config:', error);
47
+ // Fall back to default config in memory
48
+ this.config = this.getDefaultConfig();
49
+ this.initialized = true;
100
50
  }
101
- return this.config;
102
51
  }
103
52
  /**
104
- * Save current configuration to disk
53
+ * Alias for init() to maintain backward compatibility
54
+ */
55
+ async loadConfig() {
56
+ return this.init();
57
+ }
58
+ /**
59
+ * Create default configuration
60
+ */
61
+ getDefaultConfig() {
62
+ return {
63
+ blockedCommands: [
64
+ // Disk and partition management
65
+ "mkfs", // Create a filesystem on a device
66
+ "format", // Format a storage device (cross-platform)
67
+ "mount", // Mount a filesystem
68
+ "umount", // Unmount a filesystem
69
+ "fdisk", // Manipulate disk partition tables
70
+ "dd", // Convert and copy files, can write directly to disks
71
+ "parted", // Disk partition manipulator
72
+ "diskpart", // Windows disk partitioning utility
73
+ // System administration and user management
74
+ "sudo", // Execute command as superuser
75
+ "su", // Substitute user identity
76
+ "passwd", // Change user password
77
+ "adduser", // Add a user to the system
78
+ "useradd", // Create a new user
79
+ "usermod", // Modify user account
80
+ "groupadd", // Create a new group
81
+ "chsh", // Change login shell
82
+ "visudo", // Edit the sudoers file
83
+ // System control
84
+ "shutdown", // Shutdown the system
85
+ "reboot", // Restart the system
86
+ "halt", // Stop the system
87
+ "poweroff", // Power off the system
88
+ "init", // Change system runlevel
89
+ // Network and security
90
+ "iptables", // Linux firewall administration
91
+ "firewall", // Generic firewall command
92
+ "netsh", // Windows network configuration
93
+ // Windows system commands
94
+ "sfc", // System File Checker
95
+ "bcdedit", // Boot Configuration Data editor
96
+ "reg", // Windows registry editor
97
+ "net", // Network/user/service management
98
+ "sc", // Service Control manager
99
+ "runas", // Execute command as another user
100
+ "cipher", // Encrypt/decrypt files or wipe data
101
+ "takeown" // Take ownership of files
102
+ ],
103
+ defaultShell: os.platform() === 'win32' ? 'powershell.exe' : 'bash',
104
+ allowedDirectories: []
105
+ };
106
+ }
107
+ /**
108
+ * Save config to disk
105
109
  */
106
110
  async saveConfig() {
107
111
  try {
108
- console.error(`Saving config to ${CONFIG_FILE}...`);
109
- console.error(`Current working directory: ${process.cwd()}`);
110
- console.error(`Absolute config path: ${path.resolve(CONFIG_FILE)}`);
111
- // Always try to create the config directory first
112
- const configDir = path.dirname(CONFIG_FILE);
113
- try {
114
- console.error(`Ensuring config directory exists: ${configDir}`);
115
- await fs.mkdir(configDir, { recursive: true });
116
- console.error(`Config directory ready: ${configDir}`);
117
- }
118
- catch (mkdirError) {
119
- console.error(`Failed to create directory: ${mkdirError.message}`);
120
- if (mkdirError.code !== 'EEXIST') {
121
- throw mkdirError;
122
- }
123
- }
124
- // Check directory permissions
125
- try {
126
- await fs.access(configDir, fs.constants.W_OK);
127
- console.error(`Directory ${configDir} is writable`);
128
- }
129
- catch (accessError) {
130
- console.error(`Directory access error: ${accessError.message}`);
131
- throw new Error(`Config directory is not writable: ${accessError.message}`);
132
- }
133
- const configJson = JSON.stringify(this.config, null, 2);
134
- console.error(`Config to save: ${configJson}`);
135
- try {
136
- // Try to write the file with explicit encoding and permissions
137
- await fs.writeFile(CONFIG_FILE, configJson, {
138
- encoding: 'utf-8',
139
- mode: 0o644 // Readable/writable by owner, readable by others
140
- });
141
- console.error('Config saved successfully');
142
- }
143
- catch (writeError) {
144
- console.error(`Write file error: ${writeError.message}, code: ${writeError.code}, stack: ${writeError.stack}`);
145
- throw writeError;
146
- }
112
+ await fs.writeFile(this.configPath, JSON.stringify(this.config, null, 2), 'utf8');
147
113
  }
148
114
  catch (error) {
149
- console.error(`Failed to save configuration: ${error instanceof Error ? error.message : String(error)}`);
150
- console.error(error instanceof Error && error.stack ? error.stack : 'No stack trace available');
151
- throw new Error(`Failed to save configuration: ${error instanceof Error ? error.message : String(error)}`);
115
+ console.error('Failed to save config:', error);
116
+ throw error;
152
117
  }
153
118
  }
119
+ /**
120
+ * Get the entire config
121
+ */
122
+ async getConfig() {
123
+ await this.init();
124
+ return { ...this.config };
125
+ }
154
126
  /**
155
127
  * Get a specific configuration value
156
128
  */
157
129
  async getValue(key) {
158
- if (!this.initialized) {
159
- console.error(`getValue for key "${key}" - loading config first`);
160
- await this.loadConfig();
161
- }
162
- console.error(`Getting value for key "${key}": ${JSON.stringify(this.config[key])}`);
130
+ await this.init();
163
131
  return this.config[key];
164
132
  }
165
133
  /**
166
134
  * Set a specific configuration value
167
135
  */
168
136
  async setValue(key, value) {
169
- console.error(`Setting value for key "${key}": ${JSON.stringify(value)}`);
170
- if (!this.initialized) {
171
- console.error('setValue - loading config first');
172
- await this.loadConfig();
173
- }
137
+ await this.init();
174
138
  this.config[key] = value;
175
139
  await this.saveConfig();
176
140
  }
177
- /**
178
- * Get the entire configuration object
179
- */
180
- async getConfig() {
181
- if (!this.initialized) {
182
- console.error('getConfig - loading config first');
183
- await this.loadConfig();
184
- }
185
- console.error(`Getting full config: ${JSON.stringify(this.config, null, 2)}`);
186
- return { ...this.config }; // Return a copy to prevent untracked mutations
187
- }
188
141
  /**
189
142
  * Update multiple configuration values at once
190
143
  */
191
- async updateConfig(partialConfig) {
192
- console.error(`Updating config with: ${JSON.stringify(partialConfig, null, 2)}`);
193
- if (!this.initialized) {
194
- console.error('updateConfig - loading config first');
195
- await this.loadConfig();
196
- }
197
- this.config = {
198
- ...this.config,
199
- ...partialConfig
200
- };
144
+ async updateConfig(updates) {
145
+ await this.init();
146
+ this.config = { ...this.config, ...updates };
201
147
  await this.saveConfig();
202
148
  return { ...this.config };
203
149
  }
204
- }
205
- // Memory-only version that doesn't try to save to filesystem
206
- class MemoryConfigManager {
207
- constructor() {
208
- this.config = {};
209
- this.initialized = true;
210
- }
211
- async loadConfig() {
212
- console.error('Using memory-only configuration (no filesystem operations)');
213
- return this.config;
214
- }
215
- async saveConfig() {
216
- console.error('Memory-only configuration - changes will not persist after restart');
217
- // No-op - we don't save to filesystem
218
- return;
219
- }
220
- async getValue(key) {
221
- console.error(`Getting memory value for key "${key}": ${JSON.stringify(this.config[key])}`);
222
- return this.config[key];
223
- }
224
- async setValue(key, value) {
225
- console.error(`Setting memory value for key "${key}": ${JSON.stringify(value)}`);
226
- this.config[key] = value;
227
- }
228
- async getConfig() {
229
- console.error(`Getting full memory config: ${JSON.stringify(this.config, null, 2)}`);
230
- return { ...this.config };
231
- }
232
- async updateConfig(partialConfig) {
233
- console.error(`Updating memory config with: ${JSON.stringify(partialConfig, null, 2)}`);
234
- this.config = {
235
- ...this.config,
236
- ...partialConfig
237
- };
150
+ /**
151
+ * Reset configuration to defaults
152
+ */
153
+ async resetConfig() {
154
+ this.config = this.getDefaultConfig();
155
+ await this.saveConfig();
238
156
  return { ...this.config };
239
157
  }
240
158
  }
241
- // Export the appropriate manager based on the environment
159
+ // Export singleton instance
242
160
  export const configManager = new ConfigManager();
package/dist/config.js CHANGED
@@ -1,6 +1,10 @@
1
1
  import path from 'path';
2
- import process from 'process';
3
- export const CONFIG_FILE = path.join(process.cwd(), 'config.json');
4
- export const LOG_FILE = path.join(process.cwd(), 'server.log');
5
- export const ERROR_LOG_FILE = path.join(process.cwd(), 'error.log');
2
+ import os from 'os';
3
+ // Use user's home directory for configuration files
4
+ const USER_HOME = os.homedir();
5
+ const CONFIG_DIR = path.join(USER_HOME, '.claude-server-commander');
6
+ // Paths relative to the config directory
7
+ export const CONFIG_FILE = path.join(CONFIG_DIR, 'config.json');
8
+ export const LOG_FILE = path.join(CONFIG_DIR, 'server.log');
9
+ export const ERROR_LOG_FILE = path.join(CONFIG_DIR, 'error.log');
6
10
  export const DEFAULT_COMMAND_TIMEOUT = 1000; // milliseconds
@@ -0,0 +1,7 @@
1
+ import { ServerResult } from './types.js';
2
+ /**
3
+ * Creates a standard error response for tools
4
+ * @param message The error message
5
+ * @returns A ServerResult with the error message
6
+ */
7
+ export declare function createErrorResponse(message: string): ServerResult;
@@ -0,0 +1,15 @@
1
+ import { capture } from "./utils.js";
2
+ /**
3
+ * Creates a standard error response for tools
4
+ * @param message The error message
5
+ * @returns A ServerResult with the error message
6
+ */
7
+ export function createErrorResponse(message) {
8
+ capture('server_request_error', {
9
+ error: message
10
+ });
11
+ return {
12
+ content: [{ type: "text", text: `Error: ${message}` }],
13
+ isError: true,
14
+ };
15
+ }
@@ -1,27 +1,13 @@
1
+ import { ServerResult } from '../types.js';
1
2
  /**
2
3
  * Handle block_command command
3
4
  */
4
- export declare function handleBlockCommand(args: unknown): Promise<{
5
- content: {
6
- type: string;
7
- text: boolean;
8
- }[];
9
- }>;
5
+ export declare function handleBlockCommand(args: unknown): Promise<ServerResult>;
10
6
  /**
11
7
  * Handle unblock_command command
12
8
  */
13
- export declare function handleUnblockCommand(args: unknown): Promise<{
14
- content: {
15
- type: string;
16
- text: boolean;
17
- }[];
18
- }>;
9
+ export declare function handleUnblockCommand(args: unknown): Promise<ServerResult>;
19
10
  /**
20
11
  * Handle list_blocked_commands command
21
12
  */
22
- export declare function handleListBlockedCommands(): {
23
- content: {
24
- type: string;
25
- text: string;
26
- }[];
27
- };
13
+ export declare function handleListBlockedCommands(): ServerResult;
@@ -6,8 +6,12 @@ import { BlockCommandArgsSchema, UnblockCommandArgsSchema } from '../tools/schem
6
6
  export async function handleBlockCommand(args) {
7
7
  const parsed = BlockCommandArgsSchema.parse(args);
8
8
  const blockResult = await commandManager.blockCommand(parsed.command);
9
+ // Convert boolean result to appropriate message string
10
+ const message = blockResult
11
+ ? `Successfully blocked command: ${parsed.command}`
12
+ : `Command is already blocked: ${parsed.command}`;
9
13
  return {
10
- content: [{ type: "text", text: blockResult }],
14
+ content: [{ type: "text", text: message }],
11
15
  };
12
16
  }
13
17
  /**
@@ -16,8 +20,12 @@ export async function handleBlockCommand(args) {
16
20
  export async function handleUnblockCommand(args) {
17
21
  const parsed = UnblockCommandArgsSchema.parse(args);
18
22
  const unblockResult = await commandManager.unblockCommand(parsed.command);
23
+ // Convert boolean result to appropriate message string
24
+ const message = unblockResult
25
+ ? `Successfully unblocked command: ${parsed.command}`
26
+ : `Command is not blocked or doesn't exist: ${parsed.command}`;
19
27
  return {
20
- content: [{ type: "text", text: unblockResult }],
28
+ content: [{ type: "text", text: message }],
21
29
  };
22
30
  }
23
31
  /**
@@ -25,7 +33,11 @@ export async function handleUnblockCommand(args) {
25
33
  */
26
34
  export function handleListBlockedCommands() {
27
35
  const blockedCommands = commandManager.listBlockedCommands();
36
+ // Create appropriate message based on whether there are blocked commands
37
+ const message = blockedCommands.length > 0
38
+ ? `Blocked commands:\n${blockedCommands.join('\n')}`
39
+ : "No commands are currently blocked.";
28
40
  return {
29
- content: [{ type: "text", text: blockedCommands.join('\n') }],
41
+ content: [{ type: "text", text: message }],
30
42
  };
31
43
  }
@@ -1,18 +1,9 @@
1
+ import { ServerResult } from '../types.js';
1
2
  /**
2
3
  * Handle edit_block command
3
4
  */
4
- export declare function handleEditBlock(args: unknown): Promise<{
5
- content: {
6
- type: string;
7
- text: string;
8
- }[];
9
- }>;
5
+ export declare function handleEditBlock(args: unknown): Promise<ServerResult>;
10
6
  /**
11
7
  * Handle search_code command
12
8
  */
13
- export declare function handleSearchCode(args: unknown): Promise<{
14
- content: {
15
- type: string;
16
- text: string;
17
- }[];
18
- }>;
9
+ export declare function handleSearchCode(args: unknown): Promise<ServerResult>;
@@ -1,17 +1,18 @@
1
1
  import { parseEditBlock, performSearchReplace } from '../tools/edit.js';
2
2
  import { searchTextInFiles } from '../tools/search.js';
3
3
  import { EditBlockArgsSchema, SearchCodeArgsSchema } from '../tools/schemas.js';
4
- import { withTimeout } from '../utils.js';
4
+ import { capture, withTimeout } from '../utils.js';
5
+ import { createErrorResponse } from '../error-handlers.js';
5
6
  /**
6
7
  * Handle edit_block command
7
8
  */
8
9
  export async function handleEditBlock(args) {
9
10
  const parsed = EditBlockArgsSchema.parse(args);
10
- const { filePath, searchReplace } = await parseEditBlock(parsed.blockContent);
11
- await performSearchReplace(filePath, searchReplace);
12
- return {
13
- content: [{ type: "text", text: `Successfully applied edit to ${filePath}` }],
14
- };
11
+ const { filePath, searchReplace, error } = await parseEditBlock(parsed.blockContent);
12
+ if (error) {
13
+ return createErrorResponse(error);
14
+ }
15
+ return performSearchReplace(filePath, searchReplace);
15
16
  }
16
17
  /**
17
18
  * Handle search_code command
@@ -43,7 +44,9 @@ export async function handleSearchCode(args) {
43
44
  delete globalThis.currentSearchProcess;
44
45
  }
45
46
  catch (error) {
46
- console.error('Error terminating search process:', error);
47
+ capture('server_request_error', {
48
+ error: 'Error terminating search process'
49
+ });
47
50
  }
48
51
  }
49
52
  if (results.length === 0) {
@@ -1,90 +1,33 @@
1
+ import { ServerResult } from '../types.js';
1
2
  /**
2
3
  * Handle read_file command
3
4
  */
4
- export declare function handleReadFile(args: unknown): Promise<{
5
- content: ({
6
- type: string;
7
- text: string;
8
- data?: undefined;
9
- mimeType?: undefined;
10
- } | {
11
- type: string;
12
- data: string;
13
- mimeType: string;
14
- text?: undefined;
15
- })[];
16
- }>;
5
+ export declare function handleReadFile(args: unknown): Promise<ServerResult>;
17
6
  /**
18
7
  * Handle read_multiple_files command
19
8
  */
20
- export declare function handleReadMultipleFiles(args: unknown): Promise<{
21
- content: {
22
- type: string;
23
- text?: string;
24
- data?: string;
25
- mimeType?: string;
26
- }[];
27
- }>;
9
+ export declare function handleReadMultipleFiles(args: unknown): Promise<ServerResult>;
28
10
  /**
29
11
  * Handle write_file command
30
12
  */
31
- export declare function handleWriteFile(args: unknown): Promise<{
32
- content: {
33
- type: string;
34
- text: string;
35
- }[];
36
- }>;
13
+ export declare function handleWriteFile(args: unknown): Promise<ServerResult>;
37
14
  /**
38
15
  * Handle create_directory command
39
16
  */
40
- export declare function handleCreateDirectory(args: unknown): Promise<{
41
- content: {
42
- type: string;
43
- text: string;
44
- }[];
45
- }>;
17
+ export declare function handleCreateDirectory(args: unknown): Promise<ServerResult>;
46
18
  /**
47
19
  * Handle list_directory command
48
20
  */
49
- export declare function handleListDirectory(args: unknown): Promise<{
50
- content: {
51
- type: string;
52
- text: string;
53
- }[];
54
- }>;
21
+ export declare function handleListDirectory(args: unknown): Promise<ServerResult>;
55
22
  /**
56
23
  * Handle move_file command
57
24
  */
58
- export declare function handleMoveFile(args: unknown): Promise<{
59
- content: {
60
- type: string;
61
- text: string;
62
- }[];
63
- }>;
25
+ export declare function handleMoveFile(args: unknown): Promise<ServerResult>;
64
26
  /**
65
27
  * Handle search_files command
66
28
  */
67
- export declare function handleSearchFiles(args: unknown): Promise<{
68
- content: {
69
- type: string;
70
- text: string;
71
- }[];
72
- }>;
29
+ export declare function handleSearchFiles(args: unknown): Promise<ServerResult>;
73
30
  /**
74
31
  * Handle get_file_info command
75
32
  */
76
- export declare function handleGetFileInfo(args: unknown): Promise<{
77
- content: {
78
- type: string;
79
- text: string;
80
- }[];
81
- }>;
82
- /**
83
- * Handle list_allowed_directories command
84
- */
85
- export declare function handleListAllowedDirectories(): {
86
- content: {
87
- type: string;
88
- text: string;
89
- }[];
90
- };
33
+ export declare function handleGetFileInfo(args: unknown): Promise<ServerResult>;