codeep 1.2.41 → 1.2.43

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.
@@ -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',
@@ -334,7 +334,7 @@ export function startAcpServer() {
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',
@@ -46,8 +46,10 @@ export async function runAgentSession(opts) {
46
46
  let toolCallCounter = 0;
47
47
  // Maps tool call key → ACP toolCallId so onToolResult can emit finished/error status
48
48
  const toolCallIdMap = new Map();
49
+ let chunksEmitted = 0;
49
50
  const result = await runAgent(opts.prompt, projectContext, {
50
51
  abortSignal: opts.abortSignal,
52
+ onChunk: (text) => { chunksEmitted++; opts.onChunk(text); },
51
53
  onIteration: (_iteration, _message) => {
52
54
  // Intentionally not forwarded — iteration count is internal detail
53
55
  },
@@ -111,8 +113,9 @@ export async function runAgentSession(opts) {
111
113
  }
112
114
  },
113
115
  });
114
- // Emit the final response text if present
115
- if (result.finalResponse) {
116
+ // result.finalResponse is already emitted via onChunk streaming above;
117
+ // only emit it here if nothing was streamed (e.g. non-streaming fallback path)
118
+ if (result.finalResponse && chunksEmitted === 0) {
116
119
  opts.onChunk(result.finalResponse);
117
120
  }
118
121
  // Surface errors as thrown exceptions so index.ts can handle them correctly
@@ -15,6 +15,7 @@ import { TaskPlan, SubTask } from './taskPlanner';
15
15
  export interface AgentOptions {
16
16
  maxIterations: number;
17
17
  maxDuration: number;
18
+ onChunk?: (text: string) => void;
18
19
  onToolCall?: (tool: ToolCall) => void;
19
20
  onToolResult?: (result: ToolResult, toolCall: ToolCall) => void;
20
21
  onIteration?: (iteration: number, message: string) => void;
@@ -165,7 +165,7 @@ export async function runAgent(prompt, projectContext, options = {}) {
165
165
  let retryCount = 0;
166
166
  while (true) {
167
167
  try {
168
- chatResponse = await agentChat(messages, systemPrompt, opts.onThinking, opts.abortSignal, dynamicTimeout * (1 + retryCount * 0.5) // Increase timeout on retry
168
+ chatResponse = await agentChat(messages, systemPrompt, opts.onChunk, opts.abortSignal, dynamicTimeout * (1 + retryCount * 0.5) // Increase timeout on retry
169
169
  );
170
170
  consecutiveTimeouts = 0; // Reset consecutive count on success
171
171
  break;
@@ -365,7 +365,7 @@ export async function runAgent(prompt, projectContext, options = {}) {
365
365
  }
366
366
  // Get AI response to fix errors
367
367
  try {
368
- const fixResponse = await agentChat(messages, systemPrompt, opts.onThinking, opts.abortSignal);
368
+ const fixResponse = await agentChat(messages, systemPrompt, opts.onChunk, opts.abortSignal);
369
369
  const { content: fixContent, toolCalls: fixToolCalls } = fixResponse;
370
370
  if (fixToolCalls.length === 0) {
371
371
  // Agent gave up or thinks it's fixed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeep",
3
- "version": "1.2.41",
3
+ "version": "1.2.43",
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",