codeep 1.2.42 → 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.
@@ -142,7 +142,7 @@ export interface SessionUpdateToolCall {
142
142
  kind?: string;
143
143
  status: 'pending' | 'in_progress';
144
144
  locations?: {
145
- uri: string;
145
+ path: string;
146
146
  }[];
147
147
  }
148
148
  export interface SessionUpdateToolCallUpdate {
@@ -161,7 +161,7 @@ export function startAcpServer() {
161
161
  };
162
162
  transport.respond(msg.id, result);
163
163
  // Advertise slash commands
164
- transport.notify('sessionUpdate', {
164
+ transport.notify('session/update', {
165
165
  sessionId: acpSessionId,
166
166
  update: {
167
167
  sessionUpdate: 'available_commands_update',
@@ -169,7 +169,7 @@ export function startAcpServer() {
169
169
  },
170
170
  });
171
171
  // Send welcome message
172
- transport.notify('sessionUpdate', {
172
+ transport.notify('session/update', {
173
173
  sessionId: acpSessionId,
174
174
  update: {
175
175
  sessionUpdate: 'agent_message_chunk',
@@ -209,7 +209,7 @@ export function startAcpServer() {
209
209
  };
210
210
  transport.respond(msg.id, result);
211
211
  // Send restored session welcome
212
- transport.notify('sessionUpdate', {
212
+ transport.notify('session/update', {
213
213
  sessionId: params.sessionId,
214
214
  update: {
215
215
  sessionUpdate: 'agent_message_chunk',
@@ -235,7 +235,7 @@ export function startAcpServer() {
235
235
  config.set('agentConfirmation', modeId === 'manual' ? 'dangerous' : 'never');
236
236
  transport.respond(msg.id, {});
237
237
  // Notify Zed of the mode change
238
- transport.notify('sessionUpdate', {
238
+ transport.notify('session/update', {
239
239
  sessionId,
240
240
  update: {
241
241
  sessionUpdate: 'current_mode_update',
@@ -274,7 +274,7 @@ export function startAcpServer() {
274
274
  const agentResponseChunks = [];
275
275
  const sendChunk = (text) => {
276
276
  agentResponseChunks.push(text);
277
- transport.notify('sessionUpdate', {
277
+ transport.notify('session/update', {
278
278
  sessionId: params.sessionId,
279
279
  update: {
280
280
  sessionUpdate: 'agent_message_chunk',
@@ -307,7 +307,7 @@ export function startAcpServer() {
307
307
  abortSignal: abortController.signal,
308
308
  onChunk: sendChunk,
309
309
  onThought: (text) => {
310
- transport.notify('sessionUpdate', {
310
+ transport.notify('session/update', {
311
311
  sessionId: params.sessionId,
312
312
  update: {
313
313
  sessionUpdate: 'agent_thought_chunk',
@@ -318,7 +318,7 @@ export function startAcpServer() {
318
318
  onToolCall: (toolCallId, toolName, kind, title, status, locations) => {
319
319
  if (status === 'running') {
320
320
  // Initial tool_call notification: spec ToolCall shape
321
- transport.notify('sessionUpdate', {
321
+ transport.notify('session/update', {
322
322
  sessionId: params.sessionId,
323
323
  update: {
324
324
  sessionUpdate: 'tool_call',
@@ -327,14 +327,14 @@ export function startAcpServer() {
327
327
  kind: kind || 'other',
328
328
  status: 'in_progress',
329
329
  ...(locations && locations.length > 0
330
- ? { locations: locations.map(uri => ({ uri })) }
330
+ ? { locations: locations.map(path => ({ path })) }
331
331
  : {}),
332
332
  },
333
333
  });
334
334
  }
335
335
  else {
336
336
  // tool_call_update: update status to completed/failed
337
- transport.notify('sessionUpdate', {
337
+ transport.notify('session/update', {
338
338
  sessionId: params.sessionId,
339
339
  update: {
340
340
  sessionUpdate: 'tool_call_update',
@@ -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('');
@@ -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;
@@ -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(pathToFileURL(absPath).href);
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.42",
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",