codeep 1.2.55 → 1.2.57
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/acp/protocol.d.ts +4 -0
- package/dist/acp/server.js +2 -1
- package/dist/acp/session.d.ts +4 -1
- package/dist/acp/session.js +30 -7
- package/package.json +1 -1
package/dist/acp/protocol.d.ts
CHANGED
|
@@ -144,6 +144,10 @@ export interface SessionUpdateToolCall {
|
|
|
144
144
|
locations?: {
|
|
145
145
|
path: string;
|
|
146
146
|
}[];
|
|
147
|
+
content?: {
|
|
148
|
+
oldText?: string;
|
|
149
|
+
newText?: string;
|
|
150
|
+
};
|
|
147
151
|
}
|
|
148
152
|
export interface SessionUpdateToolCallUpdate {
|
|
149
153
|
sessionUpdate: 'tool_call_update';
|
package/dist/acp/server.js
CHANGED
|
@@ -440,7 +440,7 @@ export function startAcpServer() {
|
|
|
440
440
|
},
|
|
441
441
|
});
|
|
442
442
|
},
|
|
443
|
-
onToolCall: (toolCallId, toolName, kind, title, status, locations, rawOutput) => {
|
|
443
|
+
onToolCall: (toolCallId, toolName, kind, title, status, locations, rawOutput, content) => {
|
|
444
444
|
if (status === 'running') {
|
|
445
445
|
// Initial tool_call notification: spec ToolCall shape
|
|
446
446
|
transport.notify('session/update', {
|
|
@@ -454,6 +454,7 @@ export function startAcpServer() {
|
|
|
454
454
|
...(locations && locations.length > 0
|
|
455
455
|
? { locations: locations.map(path => ({ path })) }
|
|
456
456
|
: {}),
|
|
457
|
+
...(content ? { content } : {}),
|
|
457
458
|
},
|
|
458
459
|
});
|
|
459
460
|
}
|
package/dist/acp/session.d.ts
CHANGED
|
@@ -6,7 +6,10 @@ export interface AgentSessionOptions {
|
|
|
6
6
|
abortSignal: AbortSignal;
|
|
7
7
|
onChunk: (text: string) => void;
|
|
8
8
|
onThought?: (text: string) => void;
|
|
9
|
-
onToolCall?: (toolCallId: string, toolName: string, kind: string, title: string, status: 'pending' | 'running' | 'finished' | 'error', locations?: string[], rawOutput?: string
|
|
9
|
+
onToolCall?: (toolCallId: string, toolName: string, kind: string, title: string, status: 'pending' | 'running' | 'finished' | 'error', locations?: string[], rawOutput?: string, content?: {
|
|
10
|
+
oldText?: string;
|
|
11
|
+
newText?: string;
|
|
12
|
+
}) => void;
|
|
10
13
|
}
|
|
11
14
|
/**
|
|
12
15
|
* Build a ProjectContext from a workspace root directory.
|
package/dist/acp/session.js
CHANGED
|
@@ -37,13 +37,35 @@ function toolCallMeta(toolName, params, workspaceRoot) {
|
|
|
37
37
|
case 'edit_file': return { kind: 'edit', title: absFile ? `Edit ${absFile}` : 'Editing file' };
|
|
38
38
|
case 'delete_file': return { kind: 'delete', title: `Deleting ${basename}` };
|
|
39
39
|
case 'move_file': return { kind: 'move', title: `Moving ${basename}` };
|
|
40
|
-
case 'list_files': return { kind: 'read', title: `Listing
|
|
41
|
-
case '
|
|
42
|
-
case '
|
|
43
|
-
case '
|
|
40
|
+
case 'list_files': return { kind: 'read', title: `Listing ${basename || 'files'}` };
|
|
41
|
+
case 'create_directory': return { kind: 'edit', title: `Creating dir ${basename}` };
|
|
42
|
+
case 'search_code': return { kind: 'search', title: `Searching ${params.pattern ?? 'code'}` };
|
|
43
|
+
case 'find_files': return { kind: 'search', title: `Finding ${params.pattern ?? 'files'}` };
|
|
44
|
+
case 'execute_command': return { kind: 'execute', title: params.command ?? 'Running command' };
|
|
45
|
+
case 'fetch_url': return { kind: 'fetch', title: `Fetching ${params.url ?? ''}` };
|
|
46
|
+
case 'web_search': return { kind: 'fetch', title: `Searching ${params.query ?? ''}` };
|
|
47
|
+
case 'web_read': return { kind: 'fetch', title: `Reading ${params.url ?? ''}` };
|
|
44
48
|
default: return { kind: 'other', title: toolName };
|
|
45
49
|
}
|
|
46
50
|
}
|
|
51
|
+
// Builds ToolCallContent (oldText/newText) for Zed's diff view in the tool_call card.
|
|
52
|
+
function buildToolCallContent(toolName, params) {
|
|
53
|
+
switch (toolName) {
|
|
54
|
+
case 'write_file': {
|
|
55
|
+
const content = params.content ?? '';
|
|
56
|
+
return content ? { newText: content } : undefined;
|
|
57
|
+
}
|
|
58
|
+
case 'edit_file': {
|
|
59
|
+
const oldText = params.old_text ?? '';
|
|
60
|
+
const newText = params.new_text ?? '';
|
|
61
|
+
if (!oldText && !newText)
|
|
62
|
+
return undefined;
|
|
63
|
+
return { oldText: oldText || undefined, newText: newText || undefined };
|
|
64
|
+
}
|
|
65
|
+
default:
|
|
66
|
+
return undefined;
|
|
67
|
+
}
|
|
68
|
+
}
|
|
47
69
|
// Builds rawOutput content to display inside tool call cards.
|
|
48
70
|
// For write/edit operations, returns the code content or diff.
|
|
49
71
|
// For command execution, returns the command output.
|
|
@@ -63,7 +85,7 @@ function buildRawOutput(toolName, params, toolResult) {
|
|
|
63
85
|
const newLines = newText.split('\n').map(l => `+ ${l}`).join('\n');
|
|
64
86
|
return `${oldLines}\n${newLines}`;
|
|
65
87
|
}
|
|
66
|
-
case '
|
|
88
|
+
case 'execute_command': {
|
|
67
89
|
return toolResult.output || toolResult.error || undefined;
|
|
68
90
|
}
|
|
69
91
|
case 'read_file': {
|
|
@@ -108,8 +130,9 @@ export async function runAgentSession(opts) {
|
|
|
108
130
|
// Track this tool call so onToolResult can emit finished/error
|
|
109
131
|
const mapKey = toolCall.id ?? `${name}_${toolCallCounter}`;
|
|
110
132
|
toolCallIdMap.set(mapKey, { toolCallId, kind, locations: locations.length ? locations : undefined });
|
|
111
|
-
// Emit tool_call notification (running state)
|
|
112
|
-
|
|
133
|
+
// Emit tool_call notification (running state) with optional diff content
|
|
134
|
+
const toolContent = buildToolCallContent(name, params);
|
|
135
|
+
opts.onToolCall?.(toolCallId, name, kind, title, 'running', locations.length ? locations : undefined, undefined, toolContent);
|
|
113
136
|
},
|
|
114
137
|
onToolResult: (toolResult, toolCall) => {
|
|
115
138
|
// Find the tracked entry: prefer exact id match, then first FIFO entry for same tool name
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codeep",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.57",
|
|
4
4
|
"description": "AI-powered coding assistant built for the terminal. Multiple LLM providers, project-aware context, and a seamless development workflow.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|