codeep 1.2.43 → 1.2.44
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 +1 -1
- package/dist/acp/server.js +1 -9
- package/dist/acp/session.d.ts +0 -2
- package/dist/acp/session.js +2 -17
- package/package.json +1 -1
package/dist/acp/protocol.d.ts
CHANGED
package/dist/acp/server.js
CHANGED
|
@@ -327,7 +327,7 @@ export function startAcpServer() {
|
|
|
327
327
|
kind: kind || 'other',
|
|
328
328
|
status: 'in_progress',
|
|
329
329
|
...(locations && locations.length > 0
|
|
330
|
-
? { locations: locations.map(
|
|
330
|
+
? { locations: locations.map(path => ({ path })) }
|
|
331
331
|
: {}),
|
|
332
332
|
},
|
|
333
333
|
});
|
|
@@ -344,14 +344,6 @@ export function startAcpServer() {
|
|
|
344
344
|
});
|
|
345
345
|
}
|
|
346
346
|
},
|
|
347
|
-
onFileEdit: (uri, newText) => {
|
|
348
|
-
transport.notify('file/edit', {
|
|
349
|
-
uri,
|
|
350
|
-
textChanges: newText
|
|
351
|
-
? [{ range: { start: { line: 0, character: 0 }, end: { line: 999999, character: 0 } }, text: newText }]
|
|
352
|
-
: [],
|
|
353
|
-
});
|
|
354
|
-
},
|
|
355
347
|
}).then(() => {
|
|
356
348
|
session.history.push({ role: 'user', content: prompt });
|
|
357
349
|
const agentResponse = agentResponseChunks.join('');
|
package/dist/acp/session.d.ts
CHANGED
|
@@ -7,7 +7,6 @@ export interface AgentSessionOptions {
|
|
|
7
7
|
onChunk: (text: string) => void;
|
|
8
8
|
onThought?: (text: string) => void;
|
|
9
9
|
onToolCall?: (toolCallId: string, toolName: string, kind: string, title: string, status: 'pending' | 'running' | 'finished' | 'error', locations?: string[]) => void;
|
|
10
|
-
onFileEdit: (uri: string, newText: string) => void;
|
|
11
10
|
}
|
|
12
11
|
/**
|
|
13
12
|
* Build a ProjectContext from a workspace root directory.
|
|
@@ -15,4 +14,3 @@ export interface AgentSessionOptions {
|
|
|
15
14
|
*/
|
|
16
15
|
export declare function buildProjectContext(workspaceRoot: string): ProjectContext;
|
|
17
16
|
export declare function runAgentSession(opts: AgentSessionOptions): Promise<void>;
|
|
18
|
-
export declare function pathToUri(absolutePath: string): string;
|
package/dist/acp/session.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
// acp/session.ts
|
|
2
2
|
// Bridges ACP parameters to the Codeep agent loop.
|
|
3
|
-
import { pathToFileURL } from 'url';
|
|
4
3
|
import { join, isAbsolute } from 'path';
|
|
5
4
|
import { runAgent } from '../utils/agent.js';
|
|
6
5
|
import { getProjectContext } from '../utils/project.js';
|
|
@@ -64,29 +63,20 @@ export async function runAgentSession(opts) {
|
|
|
64
63
|
const { kind, title } = toolCallMeta(name, params);
|
|
65
64
|
const toolCallId = `tc_${++toolCallCounter}`;
|
|
66
65
|
// Resolve file locations for edit/read/delete/move tools
|
|
66
|
+
// ToolCallLocation.path expects a filesystem path, not a file:// URI
|
|
67
67
|
const locations = [];
|
|
68
68
|
const filePath = params.path ?? params.file ?? '';
|
|
69
69
|
if (filePath) {
|
|
70
70
|
const absPath = isAbsolute(filePath)
|
|
71
71
|
? filePath
|
|
72
72
|
: join(opts.workspaceRoot, filePath);
|
|
73
|
-
locations.push(
|
|
73
|
+
locations.push(absPath);
|
|
74
74
|
}
|
|
75
75
|
// Track this tool call so onToolResult can emit finished/error
|
|
76
76
|
const mapKey = toolCall.id ?? `${name}_${toolCallCounter}`;
|
|
77
77
|
toolCallIdMap.set(mapKey, { toolCallId, kind, locations: locations.length ? locations : undefined });
|
|
78
78
|
// Emit tool_call notification (running state)
|
|
79
79
|
opts.onToolCall?.(toolCallId, name, kind, title, 'running', locations.length ? locations : undefined);
|
|
80
|
-
// For file edits, also send structured file/edit notification
|
|
81
|
-
if (name === 'write_file' || name === 'edit_file') {
|
|
82
|
-
if (filePath) {
|
|
83
|
-
const absPath = isAbsolute(filePath)
|
|
84
|
-
? filePath
|
|
85
|
-
: join(opts.workspaceRoot, filePath);
|
|
86
|
-
const newText = params.content ?? params.new_text ?? '';
|
|
87
|
-
opts.onFileEdit(pathToFileURL(absPath).href, newText);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
80
|
},
|
|
91
81
|
onToolResult: (toolResult, toolCall) => {
|
|
92
82
|
// Find the tracked entry: prefer exact id match, then first FIFO entry for same tool name
|
|
@@ -128,8 +118,3 @@ export async function runAgentSession(opts) {
|
|
|
128
118
|
throw abortError;
|
|
129
119
|
}
|
|
130
120
|
}
|
|
131
|
-
// Utility: convert an absolute file-system path to a file:// URI string.
|
|
132
|
-
// Exported for use by callers that need to construct applyEdit URIs.
|
|
133
|
-
export function pathToUri(absolutePath) {
|
|
134
|
-
return pathToFileURL(absolutePath).href;
|
|
135
|
-
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codeep",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.44",
|
|
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",
|