@xiuper/cli 0.0.2 → 3.0.0-alpha4
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/dist/jsMain/typescript/agents/acp/AcpAgentServer.d.ts +18 -0
- package/dist/jsMain/typescript/agents/acp/AcpAgentServer.d.ts.map +1 -0
- package/dist/jsMain/typescript/agents/acp/AcpAgentServer.js +255 -0
- package/dist/jsMain/typescript/agents/acp/AcpAgentServer.js.map +1 -0
- package/dist/jsMain/typescript/agents/acp/AcpClientConnection.d.ts +96 -0
- package/dist/jsMain/typescript/agents/acp/AcpClientConnection.d.ts.map +1 -0
- package/dist/jsMain/typescript/agents/acp/AcpClientConnection.js +356 -0
- package/dist/jsMain/typescript/agents/acp/AcpClientConnection.js.map +1 -0
- package/dist/jsMain/typescript/agents/acp/index.d.ts +10 -0
- package/dist/jsMain/typescript/agents/acp/index.d.ts.map +1 -0
- package/dist/jsMain/typescript/agents/acp/index.js +10 -0
- package/dist/jsMain/typescript/agents/acp/index.js.map +1 -0
- package/dist/jsMain/typescript/agents/render/BaseRenderer.d.ts +39 -5
- package/dist/jsMain/typescript/agents/render/BaseRenderer.d.ts.map +1 -1
- package/dist/jsMain/typescript/agents/render/BaseRenderer.js +85 -0
- package/dist/jsMain/typescript/agents/render/BaseRenderer.js.map +1 -1
- package/dist/jsMain/typescript/agents/render/CliRenderer.d.ts +9 -4
- package/dist/jsMain/typescript/agents/render/CliRenderer.d.ts.map +1 -1
- package/dist/jsMain/typescript/agents/render/CliRenderer.js +65 -4
- package/dist/jsMain/typescript/agents/render/CliRenderer.js.map +1 -1
- package/dist/jsMain/typescript/agents/render/ServerRenderer.d.ts.map +1 -1
- package/dist/jsMain/typescript/agents/render/ServerRenderer.js +4 -1
- package/dist/jsMain/typescript/agents/render/ServerRenderer.js.map +1 -1
- package/dist/jsMain/typescript/config/ConfigManager.d.ts.map +1 -1
- package/dist/jsMain/typescript/config/ConfigManager.js +4 -2
- package/dist/jsMain/typescript/config/ConfigManager.js.map +1 -1
- package/dist/jsMain/typescript/index.js +59 -1
- package/dist/jsMain/typescript/index.js.map +1 -1
- package/dist/jsMain/typescript/modes/AgentMode.d.ts.map +1 -1
- package/dist/jsMain/typescript/modes/AgentMode.js +2 -0
- package/dist/jsMain/typescript/modes/AgentMode.js.map +1 -1
- package/dist/jsMain/typescript/modes/ChatMode.d.ts.map +1 -1
- package/dist/jsMain/typescript/modes/ChatMode.js +2 -0
- package/dist/jsMain/typescript/modes/ChatMode.js.map +1 -1
- package/dist/jsMain/typescript/modes/CodexMode.d.ts +39 -0
- package/dist/jsMain/typescript/modes/CodexMode.d.ts.map +1 -0
- package/dist/jsMain/typescript/modes/CodexMode.js +285 -0
- package/dist/jsMain/typescript/modes/CodexMode.js.map +1 -0
- package/dist/jsMain/typescript/modes/index.d.ts +1 -0
- package/dist/jsMain/typescript/modes/index.d.ts.map +1 -1
- package/dist/jsMain/typescript/modes/index.js +1 -0
- package/dist/jsMain/typescript/modes/index.js.map +1 -1
- package/dist/jsMain/typescript/processors/ModeCommandProcessor.d.ts.map +1 -1
- package/dist/jsMain/typescript/processors/ModeCommandProcessor.js +18 -1
- package/dist/jsMain/typescript/processors/ModeCommandProcessor.js.map +1 -1
- package/dist/jsMain/typescript/processors/SkillCommandProcessor.d.ts +31 -0
- package/dist/jsMain/typescript/processors/SkillCommandProcessor.d.ts.map +1 -0
- package/dist/jsMain/typescript/processors/SkillCommandProcessor.js +153 -0
- package/dist/jsMain/typescript/processors/SkillCommandProcessor.js.map +1 -0
- package/dist/jsMain/typescript/processors/SlashCommandProcessor.d.ts +12 -0
- package/dist/jsMain/typescript/processors/SlashCommandProcessor.d.ts.map +1 -1
- package/dist/jsMain/typescript/processors/SlashCommandProcessor.js +40 -0
- package/dist/jsMain/typescript/processors/SlashCommandProcessor.js.map +1 -1
- package/dist/jsMain/typescript/ui/App.d.ts.map +1 -1
- package/dist/jsMain/typescript/ui/App.js +3 -1
- package/dist/jsMain/typescript/ui/App.js.map +1 -1
- package/package.json +4 -3
|
@@ -0,0 +1,356 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ACP Client Connection for the JS/Node.js CLI.
|
|
3
|
+
*
|
|
4
|
+
* This allows our CLI to connect to external ACP agents (e.g., Claude CLI, Gemini CLI, Codex)
|
|
5
|
+
* and interact with them through the standardized ACP protocol.
|
|
6
|
+
*
|
|
7
|
+
* Features:
|
|
8
|
+
* - Process lifecycle management with graceful shutdown
|
|
9
|
+
* - fs capabilities (readTextFile/writeTextFile) for agent file access
|
|
10
|
+
* - Terminal capability for agent shell execution
|
|
11
|
+
* - Session reuse for multi-turn prompts
|
|
12
|
+
* - Tool call deduplication (ACP streams many IN_PROGRESS updates)
|
|
13
|
+
*
|
|
14
|
+
* Usage:
|
|
15
|
+
* const client = new AcpClientConnection('codex', ['--acp']);
|
|
16
|
+
* await client.connect('/path/to/project');
|
|
17
|
+
* const result = await client.prompt('Fix the bug in main.ts');
|
|
18
|
+
* // Multi-turn: send another prompt in the same session
|
|
19
|
+
* const result2 = await client.prompt('Now add tests');
|
|
20
|
+
* await client.disconnect();
|
|
21
|
+
*/
|
|
22
|
+
import * as acp from '@agentclientprotocol/sdk';
|
|
23
|
+
import { spawn } from 'node:child_process';
|
|
24
|
+
import { Readable, Writable } from 'node:stream';
|
|
25
|
+
import * as fs from 'node:fs';
|
|
26
|
+
import * as path from 'node:path';
|
|
27
|
+
/**
|
|
28
|
+
* ACP Client that connects to an external ACP agent process.
|
|
29
|
+
*
|
|
30
|
+
* Supports process reuse, multi-turn prompts, and tool call dedup.
|
|
31
|
+
*/
|
|
32
|
+
export class AcpClientConnection {
|
|
33
|
+
command;
|
|
34
|
+
args;
|
|
35
|
+
env;
|
|
36
|
+
clientCapabilities;
|
|
37
|
+
connection = null;
|
|
38
|
+
agentProcess = null;
|
|
39
|
+
callbacks = {};
|
|
40
|
+
currentSessionId = null;
|
|
41
|
+
currentCwd = null;
|
|
42
|
+
promptCount = 0;
|
|
43
|
+
constructor(command, args = [], env = {}, capabilities = { fs: true, terminal: true }) {
|
|
44
|
+
this.command = command;
|
|
45
|
+
this.args = args;
|
|
46
|
+
this.env = env;
|
|
47
|
+
this.clientCapabilities = capabilities;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Set callbacks for receiving updates from the agent.
|
|
51
|
+
*/
|
|
52
|
+
setCallbacks(callbacks) {
|
|
53
|
+
this.callbacks = callbacks;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Connect to the ACP agent: spawn the process, initialize protocol, create session.
|
|
57
|
+
*/
|
|
58
|
+
async connect(cwd) {
|
|
59
|
+
// If already connected to the same cwd, reuse the session
|
|
60
|
+
if (this.isConnected && this.currentCwd === cwd) {
|
|
61
|
+
console.error(`[ACP Client] Reusing existing connection for ${cwd}`);
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
// Disconnect existing connection if switching cwd
|
|
65
|
+
if (this.isConnected) {
|
|
66
|
+
await this.disconnect();
|
|
67
|
+
}
|
|
68
|
+
this.currentCwd = cwd;
|
|
69
|
+
// Spawn the agent process
|
|
70
|
+
console.error(`[ACP Client] Spawning agent: ${this.command} ${this.args.join(' ')}`);
|
|
71
|
+
this.agentProcess = spawn(this.command, this.args, {
|
|
72
|
+
stdio: ['pipe', 'pipe', 'inherit'],
|
|
73
|
+
cwd,
|
|
74
|
+
env: { ...process.env, ...this.env },
|
|
75
|
+
});
|
|
76
|
+
// Handle process exit
|
|
77
|
+
this.agentProcess.on('exit', (code, signal) => {
|
|
78
|
+
console.error(`[ACP Client] Agent process exited (code=${code}, signal=${signal})`);
|
|
79
|
+
this.connection = null;
|
|
80
|
+
this.currentSessionId = null;
|
|
81
|
+
});
|
|
82
|
+
if (!this.agentProcess.stdin || !this.agentProcess.stdout) {
|
|
83
|
+
throw new Error('Failed to get stdio handles from agent process');
|
|
84
|
+
}
|
|
85
|
+
// Create ACP stream from agent's stdio
|
|
86
|
+
const output = Writable.toWeb(this.agentProcess.stdin);
|
|
87
|
+
const input = Readable.toWeb(this.agentProcess.stdout);
|
|
88
|
+
const stream = acp.ndJsonStream(output, input);
|
|
89
|
+
// Create the client-side connection with capabilities
|
|
90
|
+
const enableFs = this.clientCapabilities.fs ?? true;
|
|
91
|
+
const enableTerminal = this.clientCapabilities.terminal ?? true;
|
|
92
|
+
this.connection = new acp.ClientSideConnection((agent) => new AutoDevAcpClient(agent, this.callbacks, cwd, enableFs), stream);
|
|
93
|
+
// Initialize the connection
|
|
94
|
+
const initResult = await this.connection.initialize({
|
|
95
|
+
protocolVersion: acp.PROTOCOL_VERSION,
|
|
96
|
+
clientInfo: {
|
|
97
|
+
name: 'autodev-xiuper',
|
|
98
|
+
version: '3.0.0',
|
|
99
|
+
title: 'AutoDev Xiuper CLI (ACP Client)',
|
|
100
|
+
},
|
|
101
|
+
clientCapabilities: {
|
|
102
|
+
fs: {
|
|
103
|
+
readTextFile: enableFs,
|
|
104
|
+
writeTextFile: enableFs,
|
|
105
|
+
},
|
|
106
|
+
terminal: enableTerminal,
|
|
107
|
+
},
|
|
108
|
+
});
|
|
109
|
+
console.error(`[ACP Client] Connected to agent: ${initResult.agentInfo?.name} v${initResult.agentInfo?.version}`);
|
|
110
|
+
// Create a session
|
|
111
|
+
const sessionResult = await this.connection.newSession({
|
|
112
|
+
cwd,
|
|
113
|
+
mcpServers: [],
|
|
114
|
+
});
|
|
115
|
+
this.currentSessionId = sessionResult.sessionId;
|
|
116
|
+
this.promptCount = 0;
|
|
117
|
+
console.error(`[ACP Client] Session created: ${this.currentSessionId}`);
|
|
118
|
+
}
|
|
119
|
+
/**
|
|
120
|
+
* Send a prompt to the agent and wait for completion.
|
|
121
|
+
* Supports multi-turn: call this multiple times within the same session.
|
|
122
|
+
*/
|
|
123
|
+
async prompt(text) {
|
|
124
|
+
if (!this.connection || !this.currentSessionId) {
|
|
125
|
+
throw new Error('ACP client not connected');
|
|
126
|
+
}
|
|
127
|
+
this.promptCount++;
|
|
128
|
+
try {
|
|
129
|
+
const result = await this.connection.prompt({
|
|
130
|
+
sessionId: this.currentSessionId,
|
|
131
|
+
prompt: [
|
|
132
|
+
{
|
|
133
|
+
type: 'text',
|
|
134
|
+
text,
|
|
135
|
+
},
|
|
136
|
+
],
|
|
137
|
+
});
|
|
138
|
+
return { stopReason: result.stopReason };
|
|
139
|
+
}
|
|
140
|
+
catch (e) {
|
|
141
|
+
const error = e instanceof Error ? e : new Error(String(e));
|
|
142
|
+
console.error(`[ACP Client] Prompt failed: ${error.message}`);
|
|
143
|
+
this.callbacks.onError?.(`ACP prompt failed: ${error.message}`);
|
|
144
|
+
throw error;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Cancel the current prompt.
|
|
149
|
+
*/
|
|
150
|
+
async cancel() {
|
|
151
|
+
if (this.connection && this.currentSessionId) {
|
|
152
|
+
try {
|
|
153
|
+
await this.connection.cancel({
|
|
154
|
+
sessionId: this.currentSessionId,
|
|
155
|
+
});
|
|
156
|
+
}
|
|
157
|
+
catch (e) {
|
|
158
|
+
console.error(`[ACP Client] Cancel failed: ${e}`);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Disconnect from the agent and clean up the process.
|
|
164
|
+
*/
|
|
165
|
+
async disconnect() {
|
|
166
|
+
if (this.agentProcess) {
|
|
167
|
+
// Graceful shutdown: SIGTERM first
|
|
168
|
+
this.agentProcess.kill('SIGTERM');
|
|
169
|
+
// Wait briefly for graceful exit, then force kill
|
|
170
|
+
await new Promise((resolve) => {
|
|
171
|
+
const timeout = setTimeout(() => {
|
|
172
|
+
if (this.agentProcess) {
|
|
173
|
+
this.agentProcess.kill('SIGKILL');
|
|
174
|
+
}
|
|
175
|
+
resolve();
|
|
176
|
+
}, 3000);
|
|
177
|
+
if (this.agentProcess) {
|
|
178
|
+
this.agentProcess.on('exit', () => {
|
|
179
|
+
clearTimeout(timeout);
|
|
180
|
+
resolve();
|
|
181
|
+
});
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
clearTimeout(timeout);
|
|
185
|
+
resolve();
|
|
186
|
+
}
|
|
187
|
+
});
|
|
188
|
+
this.agentProcess = null;
|
|
189
|
+
}
|
|
190
|
+
this.connection = null;
|
|
191
|
+
this.currentSessionId = null;
|
|
192
|
+
this.currentCwd = null;
|
|
193
|
+
this.promptCount = 0;
|
|
194
|
+
console.error('[ACP Client] Disconnected.');
|
|
195
|
+
}
|
|
196
|
+
/**
|
|
197
|
+
* Check if the client is connected and the process is alive.
|
|
198
|
+
*/
|
|
199
|
+
get isConnected() {
|
|
200
|
+
return (this.connection !== null &&
|
|
201
|
+
this.currentSessionId !== null &&
|
|
202
|
+
this.agentProcess !== null &&
|
|
203
|
+
!this.agentProcess.killed);
|
|
204
|
+
}
|
|
205
|
+
/**
|
|
206
|
+
* Get the number of prompts sent in the current session.
|
|
207
|
+
*/
|
|
208
|
+
get currentPromptCount() {
|
|
209
|
+
return this.promptCount;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Internal ACP Client implementation that receives updates from the agent.
|
|
214
|
+
*
|
|
215
|
+
* Implements tool call dedup: ACP sends many IN_PROGRESS updates per tool call
|
|
216
|
+
* (title grows char-by-char). We only forward the first and terminal events.
|
|
217
|
+
*/
|
|
218
|
+
class AutoDevAcpClient {
|
|
219
|
+
callbacks;
|
|
220
|
+
cwd;
|
|
221
|
+
enableFs;
|
|
222
|
+
/** Tool call title tracking for deduplication */
|
|
223
|
+
toolCallTitles = new Map();
|
|
224
|
+
startedToolCallIds = new Set();
|
|
225
|
+
constructor(_agent, callbacks, cwd, enableFs) {
|
|
226
|
+
this.callbacks = callbacks;
|
|
227
|
+
this.cwd = cwd;
|
|
228
|
+
this.enableFs = enableFs;
|
|
229
|
+
}
|
|
230
|
+
async requestPermission(params) {
|
|
231
|
+
const toolTitle = params.toolCall?.title || 'tool';
|
|
232
|
+
const optionNames = (params.options || []).map((o) => o.name || o.kind || 'unknown');
|
|
233
|
+
// If a callback is set, let the host decide
|
|
234
|
+
if (this.callbacks.onPermissionRequest) {
|
|
235
|
+
const approved = await this.callbacks.onPermissionRequest(toolTitle, optionNames);
|
|
236
|
+
if (approved) {
|
|
237
|
+
const allowOption = params.options?.find((o) => o.kind === 'allow_once' || o.kind === 'allow_always');
|
|
238
|
+
if (allowOption) {
|
|
239
|
+
return {
|
|
240
|
+
outcome: { outcome: 'selected', optionId: allowOption.optionId },
|
|
241
|
+
};
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
return { outcome: { outcome: 'cancelled' } };
|
|
245
|
+
}
|
|
246
|
+
// Default: auto-approve the first allow option
|
|
247
|
+
const firstAllowOption = params.options?.find((o) => o.kind === 'allow_once' || o.kind === 'allow_always');
|
|
248
|
+
const firstOption = firstAllowOption || params.options?.[0];
|
|
249
|
+
return {
|
|
250
|
+
outcome: firstOption
|
|
251
|
+
? { outcome: 'selected', optionId: firstOption.optionId }
|
|
252
|
+
: { outcome: 'cancelled' },
|
|
253
|
+
};
|
|
254
|
+
}
|
|
255
|
+
async sessionUpdate(params) {
|
|
256
|
+
const update = params.update;
|
|
257
|
+
if (!update)
|
|
258
|
+
return;
|
|
259
|
+
switch (update.sessionUpdate) {
|
|
260
|
+
case 'agent_message_chunk': {
|
|
261
|
+
const content = update.content;
|
|
262
|
+
if (content?.type === 'text' && content.text) {
|
|
263
|
+
this.callbacks.onTextChunk?.(content.text);
|
|
264
|
+
}
|
|
265
|
+
break;
|
|
266
|
+
}
|
|
267
|
+
case 'agent_thought_chunk': {
|
|
268
|
+
const content = update.content;
|
|
269
|
+
if (content?.type === 'text' && content.text) {
|
|
270
|
+
this.callbacks.onThoughtChunk?.(content.text);
|
|
271
|
+
}
|
|
272
|
+
break;
|
|
273
|
+
}
|
|
274
|
+
case 'tool_call':
|
|
275
|
+
case 'tool_call_update': {
|
|
276
|
+
const toolCallId = update.toolCallId || '';
|
|
277
|
+
const title = update.title || '';
|
|
278
|
+
const status = update.status || 'unknown';
|
|
279
|
+
// Track best title (grows char-by-char in ACP streaming)
|
|
280
|
+
if (toolCallId && title) {
|
|
281
|
+
this.toolCallTitles.set(toolCallId, title);
|
|
282
|
+
}
|
|
283
|
+
const isTerminal = status === 'completed' || status === 'failed';
|
|
284
|
+
const isRunning = status === 'in_progress' || status === 'pending';
|
|
285
|
+
if (isRunning && toolCallId && !this.startedToolCallIds.has(toolCallId)) {
|
|
286
|
+
// First event for this tool call - render it
|
|
287
|
+
this.startedToolCallIds.add(toolCallId);
|
|
288
|
+
this.callbacks.onToolCall?.(this.toolCallTitles.get(toolCallId) || title || 'tool', status, update.rawInput?.toString(), update.rawOutput?.toString());
|
|
289
|
+
}
|
|
290
|
+
else if (isTerminal) {
|
|
291
|
+
// Terminal event - render result with best-known title
|
|
292
|
+
const bestTitle = (toolCallId ? this.toolCallTitles.get(toolCallId) : null) || title || 'tool';
|
|
293
|
+
this.callbacks.onToolCall?.(bestTitle, status, update.rawInput?.toString(), update.rawOutput?.toString());
|
|
294
|
+
// Clean up tracking
|
|
295
|
+
if (toolCallId) {
|
|
296
|
+
this.toolCallTitles.delete(toolCallId);
|
|
297
|
+
this.startedToolCallIds.delete(toolCallId);
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
// Skip intermediate IN_PROGRESS updates (title streaming) to avoid spam
|
|
301
|
+
break;
|
|
302
|
+
}
|
|
303
|
+
case 'plan': {
|
|
304
|
+
const entries = update.entries || [];
|
|
305
|
+
this.callbacks.onPlanUpdate?.(entries);
|
|
306
|
+
break;
|
|
307
|
+
}
|
|
308
|
+
case 'current_mode': {
|
|
309
|
+
const modeId = update.currentModeId;
|
|
310
|
+
if (modeId) {
|
|
311
|
+
this.callbacks.onModeUpdate?.(String(modeId));
|
|
312
|
+
}
|
|
313
|
+
break;
|
|
314
|
+
}
|
|
315
|
+
default:
|
|
316
|
+
// Ignore unknown update types
|
|
317
|
+
break;
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
// ── File System Operations ──────────────────────────────────────
|
|
321
|
+
async readTextFile(params) {
|
|
322
|
+
if (!this.enableFs) {
|
|
323
|
+
throw new Error('fs.readTextFile is disabled');
|
|
324
|
+
}
|
|
325
|
+
const resolved = this.resolvePath(params.path);
|
|
326
|
+
console.error(`[ACP Client] fs.readTextFile: ${resolved}`);
|
|
327
|
+
const content = fs.readFileSync(resolved, 'utf-8');
|
|
328
|
+
const lines = content.split('\n');
|
|
329
|
+
const startLine = Math.max(0, (params.line ?? 1) - 1);
|
|
330
|
+
const lineLimit = params.limit ?? lines.length - startLine;
|
|
331
|
+
const sliced = lines.slice(startLine, startLine + lineLimit).join('\n');
|
|
332
|
+
return { content: sliced };
|
|
333
|
+
}
|
|
334
|
+
async writeTextFile(params) {
|
|
335
|
+
if (!this.enableFs) {
|
|
336
|
+
throw new Error('fs.writeTextFile is disabled');
|
|
337
|
+
}
|
|
338
|
+
const resolved = this.resolvePath(params.path);
|
|
339
|
+
console.error(`[ACP Client] fs.writeTextFile: ${resolved} (${params.content.length} chars)`);
|
|
340
|
+
// Ensure parent directory exists
|
|
341
|
+
const dir = path.dirname(resolved);
|
|
342
|
+
if (!fs.existsSync(dir)) {
|
|
343
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
344
|
+
}
|
|
345
|
+
fs.writeFileSync(resolved, params.content, 'utf-8');
|
|
346
|
+
return {};
|
|
347
|
+
}
|
|
348
|
+
// ── Helpers ─────────────────────────────────────────────────────
|
|
349
|
+
resolvePath(filePath) {
|
|
350
|
+
if (path.isAbsolute(filePath)) {
|
|
351
|
+
return filePath;
|
|
352
|
+
}
|
|
353
|
+
return path.resolve(this.cwd, filePath);
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
//# sourceMappingURL=AcpClientConnection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AcpClientConnection.js","sourceRoot":"","sources":["../../../../../src/jsMain/typescript/agents/acp/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AAI,EAAE,CAAC,CAAC;QACzC,CAAC;QAED,EAAE,CAAC,aAAa,CAAC,QAAQ,EAAE,MAAM,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;QACpD,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,mEAAmE;IAE3D,WAAW,CAAC,QAAgB;QAClC,IAAI,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;YAC9B,OAAO,QAAQ,CAAC;QAClB,CAAC;QACD,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;IAC1C,CAAC;CACF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ACP (Agent Client Protocol) module for the JS CLI.
|
|
3
|
+
*
|
|
4
|
+
* Provides both:
|
|
5
|
+
* - AcpAgentServer: Exposes our CodingAgent as an ACP agent (other editors connect to us)
|
|
6
|
+
* - AcpClientConnection: Connects to external ACP agents (we connect to them)
|
|
7
|
+
*/
|
|
8
|
+
export { startAcpAgentServer } from './AcpAgentServer.js';
|
|
9
|
+
export { AcpClientConnection, type AcpClientCallbacks } from './AcpClientConnection.js';
|
|
10
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/jsMain/typescript/agents/acp/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAAE,KAAK,kBAAkB,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ACP (Agent Client Protocol) module for the JS CLI.
|
|
3
|
+
*
|
|
4
|
+
* Provides both:
|
|
5
|
+
* - AcpAgentServer: Exposes our CodingAgent as an ACP agent (other editors connect to us)
|
|
6
|
+
* - AcpClientConnection: Connects to external ACP agents (we connect to them)
|
|
7
|
+
*/
|
|
8
|
+
export { startAcpAgentServer } from './AcpAgentServer.js';
|
|
9
|
+
export { AcpClientConnection } from './AcpClientConnection.js';
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/jsMain/typescript/agents/acp/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,mBAAmB,EAA2B,MAAM,0BAA0B,CAAC"}
|
|
@@ -8,16 +8,15 @@
|
|
|
8
8
|
* @see mpp-core/src/commonMain/kotlin/cc/unitmesh/agent/render/BaseRenderer.kt
|
|
9
9
|
* @see mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/RendererExports.kt - JsCodingAgentRenderer interface
|
|
10
10
|
*/
|
|
11
|
-
|
|
12
|
-
import JsCodingAgentRenderer = cc.unitmesh.agent.JsCodingAgentRenderer;
|
|
13
|
-
import JsPlanSummaryData = cc.unitmesh.agent.JsPlanSummaryData;
|
|
14
|
-
export declare abstract class BaseRenderer implements JsCodingAgentRenderer {
|
|
11
|
+
export declare abstract class BaseRenderer {
|
|
15
12
|
readonly __doNotUseOrImplementIt: any;
|
|
16
13
|
protected reasoningBuffer: string;
|
|
17
14
|
protected isInDevinBlock: boolean;
|
|
15
|
+
protected isInThinkBlock: boolean;
|
|
18
16
|
protected lastIterationReasoning: string;
|
|
19
17
|
protected consecutiveRepeats: number;
|
|
20
18
|
protected lastOutputLength: number;
|
|
19
|
+
protected thinkingBuffer: string;
|
|
21
20
|
/**
|
|
22
21
|
* Filter out devin blocks and thinking blocks from content
|
|
23
22
|
*/
|
|
@@ -34,10 +33,34 @@ export declare abstract class BaseRenderer implements JsCodingAgentRenderer {
|
|
|
34
33
|
* Clean up excessive newlines in content
|
|
35
34
|
*/
|
|
36
35
|
protected cleanNewlines(content: string): string;
|
|
36
|
+
/**
|
|
37
|
+
* Determine whether a tool call is primarily a retrieval (read-only / search / context-gathering) operation.
|
|
38
|
+
* Used by renderers to de-emphasize noisy tool calls (e.g. find files / read file) while keeping details accessible.
|
|
39
|
+
*/
|
|
40
|
+
protected isRetrievalToolCall(toolName: string): boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Extract thinking content from the buffer.
|
|
43
|
+
* Returns an object with content separated from thinking blocks.
|
|
44
|
+
*/
|
|
45
|
+
protected extractThinkingContent(content: string): ThinkingExtractionResult;
|
|
37
46
|
abstract renderIterationHeader(current: number, max: number): void;
|
|
38
47
|
abstract renderLLMResponseStart(): void;
|
|
39
48
|
abstract renderLLMResponseChunk(chunk: string): void;
|
|
40
49
|
abstract renderLLMResponseEnd(): void;
|
|
50
|
+
/**
|
|
51
|
+
* Render a thinking/reasoning chunk from the LLM.
|
|
52
|
+
* This is called when the LLM outputs thinking content (e.g., wrapped in <think> tags).
|
|
53
|
+
*
|
|
54
|
+
* Thinking content should be displayed differently from regular content:
|
|
55
|
+
* - Use a muted/gray color
|
|
56
|
+
* - Display in a compact, scrolling area (showing only last few lines)
|
|
57
|
+
* - Can be collapsed/expanded by the user
|
|
58
|
+
*
|
|
59
|
+
* @param chunk The thinking content chunk
|
|
60
|
+
* @param isStart Whether this is the start of a new thinking block
|
|
61
|
+
* @param isEnd Whether this is the end of the current thinking block
|
|
62
|
+
*/
|
|
63
|
+
renderThinkingChunk(chunk: string, isStart: boolean, isEnd: boolean): void;
|
|
41
64
|
abstract renderToolCall(toolName: string, paramsStr: string): void;
|
|
42
65
|
abstract renderToolResult(toolName: string, success: boolean, output: string | null, fullOutput?: string | null, metadata?: Record<string, string>): void;
|
|
43
66
|
abstract renderTaskComplete(executionTimeMs?: number, toolsUsedCount?: number): void;
|
|
@@ -60,7 +83,7 @@ export declare abstract class BaseRenderer implements JsCodingAgentRenderer {
|
|
|
60
83
|
*
|
|
61
84
|
* @param summary The plan summary data
|
|
62
85
|
*/
|
|
63
|
-
renderPlanSummary(summary:
|
|
86
|
+
renderPlanSummary(summary: any): void;
|
|
64
87
|
/**
|
|
65
88
|
* Render an Agent-generated sketch block (chart, nanodsl, mermaid, etc.)
|
|
66
89
|
* Called when a SubAgent returns content containing special code blocks.
|
|
@@ -84,4 +107,15 @@ export declare abstract class BaseRenderer implements JsCodingAgentRenderer {
|
|
|
84
107
|
*/
|
|
85
108
|
protected abstract outputNewline(): void;
|
|
86
109
|
}
|
|
110
|
+
/**
|
|
111
|
+
* Result of thinking content extraction
|
|
112
|
+
*/
|
|
113
|
+
export interface ThinkingExtractionResult {
|
|
114
|
+
contentWithoutThinking: string;
|
|
115
|
+
thinkingContent: string;
|
|
116
|
+
hasCompleteThinkBlock: boolean;
|
|
117
|
+
hasIncompleteThinkBlock: boolean;
|
|
118
|
+
hasPartialTag: boolean;
|
|
119
|
+
hasThinking: boolean;
|
|
120
|
+
}
|
|
87
121
|
//# sourceMappingURL=BaseRenderer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseRenderer.d.ts","sourceRoot":"","sources":["../../../../../src/jsMain/typescript/agents/render/BaseRenderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,
|
|
1
|
+
{"version":3,"file":"BaseRenderer.d.ts","sourceRoot":"","sources":["../../../../../src/jsMain/typescript/agents/render/BaseRenderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,8BAAsB,YAAY;IAEhC,QAAQ,CAAC,uBAAuB,EAAE,GAAG,CAAM;IAE3C,SAAS,CAAC,eAAe,EAAE,MAAM,CAAM;IACvC,SAAS,CAAC,cAAc,EAAE,OAAO,CAAS;IAC1C,SAAS,CAAC,cAAc,EAAE,OAAO,CAAS;IAC1C,SAAS,CAAC,sBAAsB,EAAE,MAAM,CAAM;IAC9C,SAAS,CAAC,kBAAkB,EAAE,MAAM,CAAK;IACzC,SAAS,CAAC,gBAAgB,EA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MAAM,CAAC;IACxB,qBAAqB,EAAE,OAAO,CAAC;IAC/B,uBAAuB,EAAE,OAAO,CAAC;IACjC,aAAa,EAAE,OAAO,CAAC;IACvB,WAAW,EAAE,OAAO,CAAC;CACtB"}
|
|
@@ -13,9 +13,11 @@ export class BaseRenderer {
|
|
|
13
13
|
__doNotUseOrImplementIt = {};
|
|
14
14
|
reasoningBuffer = '';
|
|
15
15
|
isInDevinBlock = false;
|
|
16
|
+
isInThinkBlock = false;
|
|
16
17
|
lastIterationReasoning = '';
|
|
17
18
|
consecutiveRepeats = 0;
|
|
18
19
|
lastOutputLength = 0;
|
|
20
|
+
thinkingBuffer = '';
|
|
19
21
|
/**
|
|
20
22
|
* Filter out devin blocks and thinking blocks from content
|
|
21
23
|
*/
|
|
@@ -82,6 +84,89 @@ export class BaseRenderer {
|
|
|
82
84
|
cleanNewlines(content) {
|
|
83
85
|
return content.replace(/\n{3,}/g, '\n\n');
|
|
84
86
|
}
|
|
87
|
+
/**
|
|
88
|
+
* Determine whether a tool call is primarily a retrieval (read-only / search / context-gathering) operation.
|
|
89
|
+
* Used by renderers to de-emphasize noisy tool calls (e.g. find files / read file) while keeping details accessible.
|
|
90
|
+
*/
|
|
91
|
+
isRetrievalToolCall(toolName) {
|
|
92
|
+
const normalized = (toolName || '').trim().toLowerCase();
|
|
93
|
+
return (normalized === 'glob' ||
|
|
94
|
+
normalized === 'glob_file_search' ||
|
|
95
|
+
normalized === 'grep' ||
|
|
96
|
+
normalized === 'codebase_search' ||
|
|
97
|
+
normalized === 'read-file' ||
|
|
98
|
+
normalized === 'read_file' ||
|
|
99
|
+
normalized === 'list-files' ||
|
|
100
|
+
normalized === 'list_dir' ||
|
|
101
|
+
normalized === 'docql' ||
|
|
102
|
+
// Friendly names (some renderers use display names)
|
|
103
|
+
normalized === 'find files' ||
|
|
104
|
+
normalized === 'read file' ||
|
|
105
|
+
normalized === 'list files' ||
|
|
106
|
+
normalized === 'search content' ||
|
|
107
|
+
normalized.includes('search') ||
|
|
108
|
+
normalized.includes('find file'));
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Extract thinking content from the buffer.
|
|
112
|
+
* Returns an object with content separated from thinking blocks.
|
|
113
|
+
*/
|
|
114
|
+
extractThinkingContent(content) {
|
|
115
|
+
const result = {
|
|
116
|
+
contentWithoutThinking: '',
|
|
117
|
+
thinkingContent: '',
|
|
118
|
+
hasCompleteThinkBlock: false,
|
|
119
|
+
hasIncompleteThinkBlock: false,
|
|
120
|
+
hasPartialTag: false,
|
|
121
|
+
hasThinking: false
|
|
122
|
+
};
|
|
123
|
+
let remaining = content;
|
|
124
|
+
// Handle complete <think>...</think> blocks
|
|
125
|
+
const completeThinkPattern = /<think>([\s\S]*?)<\/think>/g;
|
|
126
|
+
let match;
|
|
127
|
+
while ((match = completeThinkPattern.exec(remaining)) !== null) {
|
|
128
|
+
result.thinkingContent += match[1];
|
|
129
|
+
result.hasCompleteThinkBlock = true;
|
|
130
|
+
}
|
|
131
|
+
remaining = remaining.replace(/<think>[\s\S]*?<\/think>/g, '');
|
|
132
|
+
// Check for incomplete <think> block at the end
|
|
133
|
+
const openThinkIndex = remaining.lastIndexOf('<think>');
|
|
134
|
+
if (openThinkIndex !== -1) {
|
|
135
|
+
const closeThinkIndex = remaining.indexOf('</think>', openThinkIndex);
|
|
136
|
+
if (closeThinkIndex === -1) {
|
|
137
|
+
// Incomplete think block - extract content after <think>
|
|
138
|
+
const thinkContent = remaining.substring(openThinkIndex + 7);
|
|
139
|
+
result.thinkingContent += thinkContent;
|
|
140
|
+
result.hasIncompleteThinkBlock = true;
|
|
141
|
+
remaining = remaining.substring(0, openThinkIndex);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
// Check for partial <think or </think tags
|
|
145
|
+
const partialThinkPattern = /<(?:t(?:h(?:i(?:n(?:k)?)?)?)?)?$|<\/(?:t(?:h(?:i(?:n(?:k)?)?)?)?)?$/;
|
|
146
|
+
if (partialThinkPattern.test(remaining)) {
|
|
147
|
+
result.hasPartialTag = true;
|
|
148
|
+
remaining = remaining.replace(partialThinkPattern, '');
|
|
149
|
+
}
|
|
150
|
+
result.contentWithoutThinking = remaining;
|
|
151
|
+
result.hasThinking = result.thinkingContent.length > 0;
|
|
152
|
+
return result;
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Render a thinking/reasoning chunk from the LLM.
|
|
156
|
+
* This is called when the LLM outputs thinking content (e.g., wrapped in <think> tags).
|
|
157
|
+
*
|
|
158
|
+
* Thinking content should be displayed differently from regular content:
|
|
159
|
+
* - Use a muted/gray color
|
|
160
|
+
* - Display in a compact, scrolling area (showing only last few lines)
|
|
161
|
+
* - Can be collapsed/expanded by the user
|
|
162
|
+
*
|
|
163
|
+
* @param chunk The thinking content chunk
|
|
164
|
+
* @param isStart Whether this is the start of a new thinking block
|
|
165
|
+
* @param isEnd Whether this is the end of the current thinking block
|
|
166
|
+
*/
|
|
167
|
+
renderThinkingChunk(chunk, isStart, isEnd) {
|
|
168
|
+
// Default: no-op, subclasses can override to display thinking content
|
|
169
|
+
}
|
|
85
170
|
/**
|
|
86
171
|
* Optional policy/permission prompt. Default: no-op; subclasses can override.
|
|
87
172
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseRenderer.js","sourceRoot":"","sources":["../../../../../src/jsMain/typescript/agents/render/BaseRenderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;
|
|
1
|
+
{"version":3,"file":"BaseRenderer.js","sourceRoot":"","sources":["../../../../../src/jsMain/typescript/agents/render/BaseRenderer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,MAAM,OAAgB,YAAY;IAChC,yCAAyC;IAChC,uBAAuB,GAAQ,EAAE,CAAC;IAEjC,eAAe,GAAW,EAAE,CAAC;IAC7B,cAAc,GAAY,KAAK,CAAC;IAChC,cAAc,GAAY,KAAK,CAAC;IAChC,sBAAsB,GAAW,EAAE,CAAC;IACpC,kBAAkB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C;IASD;;OAEG;IACH,6BAA6B,CAAC,QAAgB,EAAE,MAA2B;QACzE,sGAAsG;IACxG,CAAC;IAED;;;OAGG;IACH,eAAe,CAAC,SAAiB,EAAE,OAAe,EAAE,gBAAgC,EAAE,SAAe;QACnG,mBAAmB;IACrB,CAAC;IAED;;;;;OAKG;IACH,iBAAiB,CAAC,OAAY;QAC5B,0CAA0C;IAC5C,CAAC;IAED;;;;;;;;OAQG;IACH,sBAAsB,CACpB,SAAiB,EACjB,QAAgB,EAChB,IAAY,EACZ,QAAgC;QAEhC,oEAAoE;IACtE,CAAC;IAED;;OAEG;IACO,oBAAoB;QAC5B,IAAI,CAAC,eAAe,GAAG,EAAE,CAAC;QAC1B,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;QAC5B,IAAI,CAAC,gBAAgB,GAAG,CAAC,CAAC;IAC5B,CAAC;CAUF"}
|
|
@@ -7,8 +7,6 @@
|
|
|
7
7
|
* @see mpp-core/src/jsMain/kotlin/cc/unitmesh/agent/RendererExports.kt - Interface definition
|
|
8
8
|
*/
|
|
9
9
|
import { BaseRenderer } from './BaseRenderer.js';
|
|
10
|
-
import { cc } from 'autodev-mpp-core/autodev-mpp-core';
|
|
11
|
-
import JsPlanSummaryData = cc.unitmesh.agent.JsPlanSummaryData;
|
|
12
10
|
/**
|
|
13
11
|
* CliRenderer extends BaseRenderer and implements the unified JsCodingAgentRenderer interface
|
|
14
12
|
*/
|
|
@@ -18,11 +16,18 @@ export declare class CliRenderer extends BaseRenderer {
|
|
|
18
16
|
renderIterationHeader(current: number, max: number): void;
|
|
19
17
|
/**
|
|
20
18
|
* Render a compact plan summary bar
|
|
21
|
-
* Example:
|
|
19
|
+
* Example: Plan: Create Tag System (3/5 steps, 60%)
|
|
22
20
|
*/
|
|
23
|
-
renderPlanSummary(summary:
|
|
21
|
+
renderPlanSummary(summary: any): void;
|
|
22
|
+
private thinkingLines;
|
|
23
|
+
private currentThinkingLine;
|
|
24
|
+
private readonly maxThinkingLines;
|
|
24
25
|
renderLLMResponseStart(): void;
|
|
25
26
|
renderLLMResponseChunk(chunk: string): void;
|
|
27
|
+
/**
|
|
28
|
+
* Render thinking content in a compact, scrolling format with gray color
|
|
29
|
+
*/
|
|
30
|
+
renderThinkingChunk(chunk: string, isStart: boolean, isEnd: boolean): void;
|
|
26
31
|
renderLLMResponseEnd(): void;
|
|
27
32
|
renderToolCall(toolName: string, paramsStr: string): void;
|
|
28
33
|
private formatToolCallDisplay;
|