ai-cli-mcp 2.2.0 → 2.3.1
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/.claude/settings.local.json +4 -2
- package/dist/__tests__/e2e.test.js +32 -38
- package/dist/__tests__/edge-cases.test.js +12 -12
- package/dist/__tests__/error-cases.test.js +17 -22
- package/dist/__tests__/process-management.test.js +46 -48
- package/dist/__tests__/server.test.js +51 -35
- package/dist/__tests__/validation.test.js +48 -25
- package/dist/__tests__/version-print.test.js +5 -5
- package/dist/__tests__/wait.test.js +229 -0
- package/dist/server.js +100 -13
- package/package.json +1 -1
- package/src/__tests__/e2e.test.ts +35 -43
- package/src/__tests__/edge-cases.test.ts +12 -12
- package/src/__tests__/error-cases.test.ts +17 -24
- package/src/__tests__/process-management.test.ts +54 -56
- package/src/__tests__/server.test.ts +44 -32
- package/src/__tests__/validation.test.ts +60 -38
- package/src/__tests__/version-print.test.ts +5 -5
- package/src/__tests__/wait.test.ts +264 -0
- package/src/server.ts +114 -14
- package/data/rooms/refactor-haiku-alias-main/messages.jsonl +0 -5
- package/data/rooms/refactor-haiku-alias-main/presence.json +0 -20
- package/data/rooms.json +0 -10
- package/hello.txt +0 -3
- package/implementation-log.md +0 -110
- package/implementation-plan.md +0 -189
- package/investigation-report.md +0 -135
- package/quality-score.json +0 -47
- package/refactoring-requirements.md +0 -25
- package/review-report.md +0 -132
- package/test-results.md +0 -119
- package/xx.txt +0 -1
|
@@ -39,7 +39,7 @@ describe('Claude Code Edge Cases', () => {
|
|
|
39
39
|
describe('Input Validation', () => {
|
|
40
40
|
it('should reject missing prompt', async () => {
|
|
41
41
|
await expect(
|
|
42
|
-
client.callTool('
|
|
42
|
+
client.callTool('run', {
|
|
43
43
|
workFolder: testDir,
|
|
44
44
|
})
|
|
45
45
|
).rejects.toThrow(/prompt/i);
|
|
@@ -47,7 +47,7 @@ describe('Claude Code Edge Cases', () => {
|
|
|
47
47
|
|
|
48
48
|
it('should reject invalid prompt type', async () => {
|
|
49
49
|
await expect(
|
|
50
|
-
client.callTool('
|
|
50
|
+
client.callTool('run', {
|
|
51
51
|
prompt: 123, // Should be string
|
|
52
52
|
workFolder: testDir,
|
|
53
53
|
})
|
|
@@ -56,7 +56,7 @@ describe('Claude Code Edge Cases', () => {
|
|
|
56
56
|
|
|
57
57
|
it('should reject invalid workFolder type', async () => {
|
|
58
58
|
await expect(
|
|
59
|
-
client.callTool('
|
|
59
|
+
client.callTool('run', {
|
|
60
60
|
prompt: 'Test prompt',
|
|
61
61
|
workFolder: 123, // Should be string
|
|
62
62
|
})
|
|
@@ -65,7 +65,7 @@ describe('Claude Code Edge Cases', () => {
|
|
|
65
65
|
|
|
66
66
|
it('should reject empty prompt', async () => {
|
|
67
67
|
await expect(
|
|
68
|
-
client.callTool('
|
|
68
|
+
client.callTool('run', {
|
|
69
69
|
prompt: '',
|
|
70
70
|
workFolder: testDir,
|
|
71
71
|
})
|
|
@@ -76,7 +76,7 @@ describe('Claude Code Edge Cases', () => {
|
|
|
76
76
|
describe('Special Characters', () => {
|
|
77
77
|
it.skip('should handle prompts with quotes', async () => {
|
|
78
78
|
// Skipping: This test fails in CI when mock is not found at expected path
|
|
79
|
-
const response = await client.callTool('
|
|
79
|
+
const response = await client.callTool('run', {
|
|
80
80
|
prompt: 'Create a file with content "Hello \\"World\\""',
|
|
81
81
|
workFolder: testDir,
|
|
82
82
|
});
|
|
@@ -85,7 +85,7 @@ describe('Claude Code Edge Cases', () => {
|
|
|
85
85
|
});
|
|
86
86
|
|
|
87
87
|
it('should handle prompts with newlines', async () => {
|
|
88
|
-
const response = await client.callTool('
|
|
88
|
+
const response = await client.callTool('run', {
|
|
89
89
|
prompt: 'Create a file with content:\\nLine 1\\nLine 2',
|
|
90
90
|
workFolder: testDir,
|
|
91
91
|
});
|
|
@@ -94,7 +94,7 @@ describe('Claude Code Edge Cases', () => {
|
|
|
94
94
|
});
|
|
95
95
|
|
|
96
96
|
it('should handle prompts with shell special characters', async () => {
|
|
97
|
-
const response = await client.callTool('
|
|
97
|
+
const response = await client.callTool('run', {
|
|
98
98
|
prompt: 'Create a file named test$file.txt',
|
|
99
99
|
workFolder: testDir,
|
|
100
100
|
});
|
|
@@ -113,7 +113,7 @@ describe('Claude Code Edge Cases', () => {
|
|
|
113
113
|
await errorClient.connect();
|
|
114
114
|
|
|
115
115
|
await expect(
|
|
116
|
-
errorClient.callTool('
|
|
116
|
+
errorClient.callTool('run', {
|
|
117
117
|
prompt: 'Test prompt',
|
|
118
118
|
workFolder: testDir,
|
|
119
119
|
})
|
|
@@ -127,7 +127,7 @@ describe('Claude Code Edge Cases', () => {
|
|
|
127
127
|
|
|
128
128
|
// Non-existent directories now throw an error
|
|
129
129
|
await expect(
|
|
130
|
-
client.callTool('
|
|
130
|
+
client.callTool('run', {
|
|
131
131
|
prompt: 'Test prompt',
|
|
132
132
|
workFolder: restrictedDir,
|
|
133
133
|
})
|
|
@@ -138,7 +138,7 @@ describe('Claude Code Edge Cases', () => {
|
|
|
138
138
|
describe('Concurrent Requests', () => {
|
|
139
139
|
it('should handle multiple simultaneous requests', async () => {
|
|
140
140
|
const promises = Array(5).fill(null).map((_, i) =>
|
|
141
|
-
client.callTool('
|
|
141
|
+
client.callTool('run', {
|
|
142
142
|
prompt: `Create file test${i}.txt`,
|
|
143
143
|
workFolder: testDir,
|
|
144
144
|
})
|
|
@@ -155,7 +155,7 @@ describe('Claude Code Edge Cases', () => {
|
|
|
155
155
|
it('should handle very long prompts', async () => {
|
|
156
156
|
const longPrompt = 'Create a file with content: ' + 'x'.repeat(10000);
|
|
157
157
|
|
|
158
|
-
const response = await client.callTool('
|
|
158
|
+
const response = await client.callTool('run', {
|
|
159
159
|
prompt: longPrompt,
|
|
160
160
|
workFolder: testDir,
|
|
161
161
|
});
|
|
@@ -171,7 +171,7 @@ describe('Claude Code Edge Cases', () => {
|
|
|
171
171
|
// Server resolves paths and checks existence
|
|
172
172
|
// The path /etc/passwd may exist but be a file, not a directory
|
|
173
173
|
await expect(
|
|
174
|
-
client.callTool('
|
|
174
|
+
client.callTool('run', {
|
|
175
175
|
prompt: 'Read file',
|
|
176
176
|
workFolder: maliciousPath,
|
|
177
177
|
})
|
|
@@ -33,11 +33,13 @@ vi.mock('@modelcontextprotocol/sdk/types.js', () => ({
|
|
|
33
33
|
MethodNotFound: 'MethodNotFound',
|
|
34
34
|
InvalidParams: 'InvalidParams'
|
|
35
35
|
},
|
|
36
|
-
McpError:
|
|
37
|
-
|
|
38
|
-
(
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
McpError: class extends Error {
|
|
37
|
+
code: any;
|
|
38
|
+
constructor(code: any, message: string) {
|
|
39
|
+
super(message);
|
|
40
|
+
this.code = code;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
41
43
|
}));
|
|
42
44
|
|
|
43
45
|
const mockExistsSync = vi.mocked(existsSync);
|
|
@@ -145,24 +147,15 @@ describe('Error Handling Tests', () => {
|
|
|
145
147
|
});
|
|
146
148
|
|
|
147
149
|
// Call handler
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
workFolder: '/tmp'
|
|
155
|
-
}
|
|
150
|
+
await expect(callToolHandler({
|
|
151
|
+
params: {
|
|
152
|
+
name: 'run',
|
|
153
|
+
arguments: {
|
|
154
|
+
prompt: 'test',
|
|
155
|
+
workFolder: '/tmp'
|
|
156
156
|
}
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
} catch (err: any) {
|
|
160
|
-
// Check if McpError was called with the process start failure message
|
|
161
|
-
expect(McpError).toHaveBeenCalledWith(
|
|
162
|
-
'InternalError',
|
|
163
|
-
'Failed to start Claude CLI process'
|
|
164
|
-
);
|
|
165
|
-
}
|
|
157
|
+
}
|
|
158
|
+
})).rejects.toThrow('Failed to start claude CLI process');
|
|
166
159
|
});
|
|
167
160
|
|
|
168
161
|
it('should handle invalid argument types', async () => {
|
|
@@ -185,7 +178,7 @@ describe('Error Handling Tests', () => {
|
|
|
185
178
|
await expect(
|
|
186
179
|
handler({
|
|
187
180
|
params: {
|
|
188
|
-
name: '
|
|
181
|
+
name: 'run',
|
|
189
182
|
arguments: 'invalid-should-be-object'
|
|
190
183
|
}
|
|
191
184
|
})
|
|
@@ -244,7 +237,7 @@ describe('Error Handling Tests', () => {
|
|
|
244
237
|
await expect(
|
|
245
238
|
handler({
|
|
246
239
|
params: {
|
|
247
|
-
name: '
|
|
240
|
+
name: 'run',
|
|
248
241
|
arguments: {
|
|
249
242
|
prompt: 'test',
|
|
250
243
|
workFolder: '/tmp'
|
|
@@ -88,7 +88,7 @@ describe('Process Management Tests', () => {
|
|
|
88
88
|
return { server, module, handlers };
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
-
describe('
|
|
91
|
+
describe('run tool with PID return', () => {
|
|
92
92
|
it('should return PID immediately when starting a process', async () => {
|
|
93
93
|
const { handlers } = await setupServer();
|
|
94
94
|
|
|
@@ -104,7 +104,7 @@ describe('Process Management Tests', () => {
|
|
|
104
104
|
const callToolHandler = handlers.get('callTool')!;
|
|
105
105
|
const result = await callToolHandler!({
|
|
106
106
|
params: {
|
|
107
|
-
name: '
|
|
107
|
+
name: 'run',
|
|
108
108
|
arguments: {
|
|
109
109
|
prompt: 'test prompt',
|
|
110
110
|
workFolder: '/tmp'
|
|
@@ -115,7 +115,7 @@ describe('Process Management Tests', () => {
|
|
|
115
115
|
const response = JSON.parse(result.content[0].text);
|
|
116
116
|
expect(response.pid).toBe(12345);
|
|
117
117
|
expect(response.status).toBe('started');
|
|
118
|
-
expect(response.message).toBe('
|
|
118
|
+
expect(response.message).toBe('claude process started successfully');
|
|
119
119
|
});
|
|
120
120
|
|
|
121
121
|
it('should handle process with model parameter', async () => {
|
|
@@ -132,7 +132,7 @@ describe('Process Management Tests', () => {
|
|
|
132
132
|
const callToolHandler = handlers.get('callTool')!;
|
|
133
133
|
await callToolHandler!({
|
|
134
134
|
params: {
|
|
135
|
-
name: '
|
|
135
|
+
name: 'run',
|
|
136
136
|
arguments: {
|
|
137
137
|
prompt: 'test prompt',
|
|
138
138
|
workFolder: '/tmp',
|
|
@@ -167,7 +167,7 @@ describe('Process Management Tests', () => {
|
|
|
167
167
|
const callToolHandler = handlers.get('callTool')!;
|
|
168
168
|
const result = await callToolHandler!({
|
|
169
169
|
params: {
|
|
170
|
-
name: '
|
|
170
|
+
name: 'run',
|
|
171
171
|
arguments: {
|
|
172
172
|
prompt: japanesePrompt,
|
|
173
173
|
workFolder: '/tmp'
|
|
@@ -189,7 +189,7 @@ describe('Process Management Tests', () => {
|
|
|
189
189
|
// Verify the prompt is stored correctly in process manager
|
|
190
190
|
const getResult = await callToolHandler!({
|
|
191
191
|
params: {
|
|
192
|
-
name: '
|
|
192
|
+
name: 'get_result',
|
|
193
193
|
arguments: {
|
|
194
194
|
pid: 12360
|
|
195
195
|
}
|
|
@@ -240,7 +240,7 @@ describe('Process Management Tests', () => {
|
|
|
240
240
|
const callToolHandler = handlers.get('callTool')!;
|
|
241
241
|
const result = await callToolHandler!({
|
|
242
242
|
params: {
|
|
243
|
-
name: '
|
|
243
|
+
name: 'run',
|
|
244
244
|
arguments: {
|
|
245
245
|
prompt: longJapanesePrompt,
|
|
246
246
|
workFolder: '/tmp',
|
|
@@ -259,20 +259,20 @@ describe('Process Management Tests', () => {
|
|
|
259
259
|
expect.arrayContaining(['-p', longJapanesePrompt]),
|
|
260
260
|
expect.any(Object)
|
|
261
261
|
);
|
|
262
|
-
|
|
263
|
-
//
|
|
262
|
+
|
|
263
|
+
// Verify list_processes returns basic info
|
|
264
264
|
const listResult = await callToolHandler!({
|
|
265
265
|
params: {
|
|
266
|
-
name: '
|
|
266
|
+
name: 'list_processes',
|
|
267
267
|
arguments: {}
|
|
268
268
|
}
|
|
269
269
|
});
|
|
270
|
-
|
|
270
|
+
|
|
271
271
|
const processes = JSON.parse(listResult.content[0].text);
|
|
272
272
|
const process = processes.find((p: any) => p.pid === 12361);
|
|
273
|
-
expect(process.
|
|
274
|
-
expect(process.
|
|
275
|
-
expect(process.
|
|
273
|
+
expect(process.pid).toBe(12361);
|
|
274
|
+
expect(process.agent).toBe('claude');
|
|
275
|
+
expect(process.status).toBe('running');
|
|
276
276
|
});
|
|
277
277
|
|
|
278
278
|
it('should handle prompts with special characters and escape sequences', async () => {
|
|
@@ -298,7 +298,7 @@ Unicodeテスト: 🎌 🗾 ✨
|
|
|
298
298
|
const callToolHandler = handlers.get('callTool')!;
|
|
299
299
|
const result = await callToolHandler!({
|
|
300
300
|
params: {
|
|
301
|
-
name: '
|
|
301
|
+
name: 'run',
|
|
302
302
|
arguments: {
|
|
303
303
|
prompt: specialPrompt,
|
|
304
304
|
workFolder: '/tmp'
|
|
@@ -331,17 +331,17 @@ Unicodeテスト: 🎌 🗾 ✨
|
|
|
331
331
|
const callToolHandler = handlers.get('callTool')!;
|
|
332
332
|
await expect(callToolHandler!({
|
|
333
333
|
params: {
|
|
334
|
-
name: '
|
|
334
|
+
name: 'run',
|
|
335
335
|
arguments: {
|
|
336
336
|
prompt: 'test prompt',
|
|
337
337
|
workFolder: '/tmp/test'
|
|
338
338
|
}
|
|
339
339
|
}
|
|
340
|
-
})).rejects.toThrow('Failed to start
|
|
340
|
+
})).rejects.toThrow('Failed to start claude CLI process');
|
|
341
341
|
});
|
|
342
342
|
});
|
|
343
343
|
|
|
344
|
-
describe('
|
|
344
|
+
describe('list_processes tool', () => {
|
|
345
345
|
it('should list all processes', async () => {
|
|
346
346
|
const { handlers } = await setupServer();
|
|
347
347
|
|
|
@@ -359,7 +359,7 @@ Unicodeテスト: 🎌 🗾 ✨
|
|
|
359
359
|
// Start a process
|
|
360
360
|
await callToolHandler!({
|
|
361
361
|
params: {
|
|
362
|
-
name: '
|
|
362
|
+
name: 'run',
|
|
363
363
|
arguments: {
|
|
364
364
|
prompt: 'test prompt for listing',
|
|
365
365
|
workFolder: '/tmp',
|
|
@@ -378,7 +378,7 @@ Unicodeテスト: 🎌 🗾 ✨
|
|
|
378
378
|
// List processes
|
|
379
379
|
const listResult = await callToolHandler!({
|
|
380
380
|
params: {
|
|
381
|
-
name: '
|
|
381
|
+
name: 'list_processes',
|
|
382
382
|
arguments: {}
|
|
383
383
|
}
|
|
384
384
|
});
|
|
@@ -387,51 +387,49 @@ Unicodeテスト: 🎌 🗾 ✨
|
|
|
387
387
|
expect(processes).toHaveLength(1);
|
|
388
388
|
expect(processes[0].pid).toBe(12347);
|
|
389
389
|
expect(processes[0].status).toBe('running');
|
|
390
|
-
expect(processes[0].
|
|
391
|
-
expect(processes[0].model).toBe('sonnet');
|
|
392
|
-
expect(processes[0].session_id).toBe('list-test-session-789');
|
|
390
|
+
expect(processes[0].agent).toBe('claude');
|
|
393
391
|
});
|
|
394
392
|
|
|
395
|
-
it('should
|
|
393
|
+
it('should list process with correct agent type', async () => {
|
|
396
394
|
const { handlers } = await setupServer();
|
|
397
|
-
|
|
395
|
+
|
|
398
396
|
const mockProcess = new EventEmitter() as any;
|
|
399
397
|
mockProcess.pid = 12348;
|
|
400
398
|
mockProcess.stdout = new EventEmitter();
|
|
401
399
|
mockProcess.stderr = new EventEmitter();
|
|
402
400
|
mockProcess.kill = vi.fn();
|
|
403
|
-
|
|
401
|
+
|
|
404
402
|
mockSpawn.mockReturnValue(mockProcess);
|
|
405
|
-
|
|
403
|
+
|
|
406
404
|
const callToolHandler = handlers.get('callTool');
|
|
407
|
-
|
|
408
|
-
// Start a process
|
|
409
|
-
const longPrompt = 'a'.repeat(150);
|
|
405
|
+
|
|
406
|
+
// Start a process
|
|
410
407
|
await callToolHandler!({
|
|
411
408
|
params: {
|
|
412
|
-
name: '
|
|
409
|
+
name: 'run',
|
|
413
410
|
arguments: {
|
|
414
|
-
prompt:
|
|
411
|
+
prompt: 'test prompt',
|
|
415
412
|
workFolder: '/tmp'
|
|
416
413
|
}
|
|
417
414
|
}
|
|
418
415
|
});
|
|
419
|
-
|
|
416
|
+
|
|
420
417
|
// List processes
|
|
421
418
|
const listResult = await callToolHandler!({
|
|
422
419
|
params: {
|
|
423
|
-
name: '
|
|
420
|
+
name: 'list_processes',
|
|
424
421
|
arguments: {}
|
|
425
422
|
}
|
|
426
423
|
});
|
|
427
|
-
|
|
424
|
+
|
|
428
425
|
const processes = JSON.parse(listResult.content[0].text);
|
|
429
|
-
expect(processes[0].
|
|
430
|
-
expect(processes[0].
|
|
426
|
+
expect(processes[0].pid).toBe(12348);
|
|
427
|
+
expect(processes[0].agent).toBe('claude');
|
|
428
|
+
expect(processes[0].status).toBe('running');
|
|
431
429
|
});
|
|
432
430
|
});
|
|
433
431
|
|
|
434
|
-
describe('
|
|
432
|
+
describe('get_result tool', () => {
|
|
435
433
|
it('should get process output', async () => {
|
|
436
434
|
const { handlers } = await setupServer();
|
|
437
435
|
|
|
@@ -448,7 +446,7 @@ Unicodeテスト: 🎌 🗾 ✨
|
|
|
448
446
|
// Start a process
|
|
449
447
|
await callToolHandler!({
|
|
450
448
|
params: {
|
|
451
|
-
name: '
|
|
449
|
+
name: 'run',
|
|
452
450
|
arguments: {
|
|
453
451
|
prompt: 'test prompt',
|
|
454
452
|
workFolder: '/tmp'
|
|
@@ -468,7 +466,7 @@ Unicodeテスト: 🎌 🗾 ✨
|
|
|
468
466
|
// Get result
|
|
469
467
|
const result = await callToolHandler!({
|
|
470
468
|
params: {
|
|
471
|
-
name: '
|
|
469
|
+
name: 'get_result',
|
|
472
470
|
arguments: {
|
|
473
471
|
pid: 12349
|
|
474
472
|
}
|
|
@@ -478,7 +476,7 @@ Unicodeテスト: 🎌 🗾 ✨
|
|
|
478
476
|
const processInfo = JSON.parse(result.content[0].text);
|
|
479
477
|
expect(processInfo.pid).toBe(12349);
|
|
480
478
|
expect(processInfo.status).toBe('running');
|
|
481
|
-
expect(processInfo.
|
|
479
|
+
expect(processInfo.agentOutput).toEqual(claudeJsonOutput);
|
|
482
480
|
expect(processInfo.session_id).toBe('test-session-123');
|
|
483
481
|
});
|
|
484
482
|
|
|
@@ -498,7 +496,7 @@ Unicodeテスト: 🎌 🗾 ✨
|
|
|
498
496
|
// Start a process
|
|
499
497
|
await callToolHandler!({
|
|
500
498
|
params: {
|
|
501
|
-
name: '
|
|
499
|
+
name: 'run',
|
|
502
500
|
arguments: {
|
|
503
501
|
prompt: 'test prompt',
|
|
504
502
|
workFolder: '/tmp'
|
|
@@ -519,7 +517,7 @@ Unicodeテスト: 🎌 🗾 ✨
|
|
|
519
517
|
// Get result
|
|
520
518
|
const result = await callToolHandler!({
|
|
521
519
|
params: {
|
|
522
|
-
name: '
|
|
520
|
+
name: 'get_result',
|
|
523
521
|
arguments: {
|
|
524
522
|
pid: 12350
|
|
525
523
|
}
|
|
@@ -529,7 +527,7 @@ Unicodeテスト: 🎌 🗾 ✨
|
|
|
529
527
|
const processInfo = JSON.parse(result.content[0].text);
|
|
530
528
|
expect(processInfo.status).toBe('completed');
|
|
531
529
|
expect(processInfo.exitCode).toBe(0);
|
|
532
|
-
expect(processInfo.
|
|
530
|
+
expect(processInfo.agentOutput).toEqual(completedJsonOutput);
|
|
533
531
|
expect(processInfo.session_id).toBe('completed-session-456');
|
|
534
532
|
});
|
|
535
533
|
|
|
@@ -540,7 +538,7 @@ Unicodeテスト: 🎌 🗾 ✨
|
|
|
540
538
|
|
|
541
539
|
await expect(callToolHandler!({
|
|
542
540
|
params: {
|
|
543
|
-
name: '
|
|
541
|
+
name: 'get_result',
|
|
544
542
|
arguments: {
|
|
545
543
|
pid: 99999
|
|
546
544
|
}
|
|
@@ -555,7 +553,7 @@ Unicodeテスト: 🎌 🗾 ✨
|
|
|
555
553
|
|
|
556
554
|
await expect(callToolHandler!({
|
|
557
555
|
params: {
|
|
558
|
-
name: '
|
|
556
|
+
name: 'get_result',
|
|
559
557
|
arguments: {
|
|
560
558
|
pid: 'not-a-number'
|
|
561
559
|
}
|
|
@@ -579,7 +577,7 @@ Unicodeテスト: 🎌 🗾 ✨
|
|
|
579
577
|
// Start a process
|
|
580
578
|
await callToolHandler!({
|
|
581
579
|
params: {
|
|
582
|
-
name: '
|
|
580
|
+
name: 'run',
|
|
583
581
|
arguments: {
|
|
584
582
|
prompt: 'test prompt',
|
|
585
583
|
workFolder: '/tmp'
|
|
@@ -594,7 +592,7 @@ Unicodeテスト: 🎌 🗾 ✨
|
|
|
594
592
|
// Get result
|
|
595
593
|
const result = await callToolHandler!({
|
|
596
594
|
params: {
|
|
597
|
-
name: '
|
|
595
|
+
name: 'get_result',
|
|
598
596
|
arguments: {
|
|
599
597
|
pid: 12355
|
|
600
598
|
}
|
|
@@ -611,7 +609,7 @@ Unicodeテスト: 🎌 🗾 ✨
|
|
|
611
609
|
});
|
|
612
610
|
});
|
|
613
611
|
|
|
614
|
-
describe('
|
|
612
|
+
describe('kill_process tool', () => {
|
|
615
613
|
it('should kill a running process', async () => {
|
|
616
614
|
const { handlers } = await setupServer();
|
|
617
615
|
|
|
@@ -628,7 +626,7 @@ Unicodeテスト: 🎌 🗾 ✨
|
|
|
628
626
|
// Start a process
|
|
629
627
|
await callToolHandler!({
|
|
630
628
|
params: {
|
|
631
|
-
name: '
|
|
629
|
+
name: 'run',
|
|
632
630
|
arguments: {
|
|
633
631
|
prompt: 'test prompt',
|
|
634
632
|
workFolder: '/tmp'
|
|
@@ -639,7 +637,7 @@ Unicodeテスト: 🎌 🗾 ✨
|
|
|
639
637
|
// Kill the process
|
|
640
638
|
const killResult = await callToolHandler!({
|
|
641
639
|
params: {
|
|
642
|
-
name: '
|
|
640
|
+
name: 'kill_process',
|
|
643
641
|
arguments: {
|
|
644
642
|
pid: 12351
|
|
645
643
|
}
|
|
@@ -668,7 +666,7 @@ Unicodeテスト: 🎌 🗾 ✨
|
|
|
668
666
|
// Start and complete a process
|
|
669
667
|
await callToolHandler!({
|
|
670
668
|
params: {
|
|
671
|
-
name: '
|
|
669
|
+
name: 'run',
|
|
672
670
|
arguments: {
|
|
673
671
|
prompt: 'test prompt',
|
|
674
672
|
workFolder: '/tmp'
|
|
@@ -682,7 +680,7 @@ Unicodeテスト: 🎌 🗾 ✨
|
|
|
682
680
|
// Try to kill the already completed process
|
|
683
681
|
const killResult = await callToolHandler!({
|
|
684
682
|
params: {
|
|
685
|
-
name: '
|
|
683
|
+
name: 'kill_process',
|
|
686
684
|
arguments: {
|
|
687
685
|
pid: 12352
|
|
688
686
|
}
|
|
@@ -702,7 +700,7 @@ Unicodeテスト: 🎌 🗾 ✨
|
|
|
702
700
|
|
|
703
701
|
await expect(callToolHandler!({
|
|
704
702
|
params: {
|
|
705
|
-
name: '
|
|
703
|
+
name: 'kill_process',
|
|
706
704
|
arguments: {
|
|
707
705
|
pid: 99999
|
|
708
706
|
}
|
|
@@ -743,7 +741,7 @@ Unicodeテスト: 🎌 🗾 ✨
|
|
|
743
741
|
// Start a process
|
|
744
742
|
await callToolHandler!({
|
|
745
743
|
params: {
|
|
746
|
-
name: '
|
|
744
|
+
name: 'run',
|
|
747
745
|
arguments: {
|
|
748
746
|
prompt: 'test prompt',
|
|
749
747
|
workFolder: '/tmp'
|
|
@@ -757,7 +755,7 @@ Unicodeテスト: 🎌 🗾 ✨
|
|
|
757
755
|
// Get result to check error was recorded
|
|
758
756
|
const result = await callToolHandler!({
|
|
759
757
|
params: {
|
|
760
|
-
name: '
|
|
758
|
+
name: 'get_result',
|
|
761
759
|
arguments: {
|
|
762
760
|
pid: 12353
|
|
763
761
|
}
|