codeep 1.2.43 → 1.2.45

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.
@@ -19,6 +19,8 @@ export interface CommandResult {
19
19
  response: string;
20
20
  /** If true, server should stream response chunks as they arrive (skills) */
21
21
  streaming?: boolean;
22
+ /** If true, server should re-send configOptions to client (provider/model changed) */
23
+ configOptionsChanged?: boolean;
22
24
  }
23
25
  /**
24
26
  * Ensure workspace has a .codeep folder, initialise it as a project if needed,
@@ -135,12 +135,12 @@ export async function handleCommand(input, session, onChunk, abortSignal) {
135
135
  case 'provider': {
136
136
  if (!args.length)
137
137
  return { handled: true, response: buildProviderList() };
138
- return { handled: true, response: setProviderCmd(args[0]) };
138
+ return { handled: true, response: setProviderCmd(args[0]), configOptionsChanged: true };
139
139
  }
140
140
  case 'model': {
141
141
  if (!args.length)
142
142
  return { handled: true, response: buildModelList() };
143
- return { handled: true, response: setModelCmd(args[0]) };
143
+ return { handled: true, response: setModelCmd(args[0]), configOptionsChanged: true };
144
144
  }
145
145
  case 'apikey': {
146
146
  if (!args.length)
@@ -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 {
@@ -165,7 +165,11 @@ export interface SessionUpdateCurrentMode {
165
165
  sessionUpdate: 'current_mode_update';
166
166
  currentModeId: string;
167
167
  }
168
- export type SessionUpdateInner = SessionUpdateAgentMessageChunk | SessionUpdateAgentThoughtChunk | SessionUpdateToolCall | SessionUpdateToolCallUpdate | SessionUpdateAvailableCommands | SessionUpdateCurrentMode;
168
+ export interface SessionUpdateConfigOption {
169
+ sessionUpdate: 'config_option_update';
170
+ configOptions: SessionConfigOption[];
171
+ }
172
+ export type SessionUpdateInner = SessionUpdateAgentMessageChunk | SessionUpdateAgentThoughtChunk | SessionUpdateToolCall | SessionUpdateToolCallUpdate | SessionUpdateAvailableCommands | SessionUpdateCurrentMode | SessionUpdateConfigOption;
169
173
  export interface SessionUpdateParams {
170
174
  sessionId: string;
171
175
  update: SessionUpdateInner;
@@ -288,6 +288,16 @@ export function startAcpServer() {
288
288
  if (cmd.handled) {
289
289
  if (cmd.response)
290
290
  sendChunk(cmd.response);
291
+ // If provider or model changed, push updated config options to Zed
292
+ if (cmd.configOptionsChanged) {
293
+ transport.notify('session/update', {
294
+ sessionId: params.sessionId,
295
+ update: {
296
+ sessionUpdate: 'config_option_update',
297
+ configOptions: buildConfigOptions(),
298
+ },
299
+ });
300
+ }
291
301
  transport.respond(msg.id, { stopReason: 'end_turn' });
292
302
  return;
293
303
  }
@@ -327,7 +337,7 @@ export function startAcpServer() {
327
337
  kind: kind || 'other',
328
338
  status: 'in_progress',
329
339
  ...(locations && locations.length > 0
330
- ? { locations: locations.map(uri => ({ uri })) }
340
+ ? { locations: locations.map(path => ({ path })) }
331
341
  : {}),
332
342
  },
333
343
  });
@@ -344,14 +354,6 @@ export function startAcpServer() {
344
354
  });
345
355
  }
346
356
  },
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
357
  }).then(() => {
356
358
  session.history.push({ role: 'user', content: prompt });
357
359
  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.43",
3
+ "version": "1.2.45",
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",