codeep 1.2.49 → 1.2.51

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.
@@ -169,7 +169,12 @@ export interface SessionUpdateConfigOption {
169
169
  sessionUpdate: 'config_option_update';
170
170
  configOptions: SessionConfigOption[];
171
171
  }
172
- export type SessionUpdateInner = SessionUpdateAgentMessageChunk | SessionUpdateAgentThoughtChunk | SessionUpdateToolCall | SessionUpdateToolCallUpdate | SessionUpdateAvailableCommands | SessionUpdateCurrentMode | SessionUpdateConfigOption;
172
+ export interface SessionUpdateSessionInfo {
173
+ sessionUpdate: 'session_info_update';
174
+ title: string;
175
+ updatedAt?: string;
176
+ }
177
+ export type SessionUpdateInner = SessionUpdateAgentMessageChunk | SessionUpdateAgentThoughtChunk | SessionUpdateToolCall | SessionUpdateToolCallUpdate | SessionUpdateAvailableCommands | SessionUpdateCurrentMode | SessionUpdateConfigOption | SessionUpdateSessionInfo;
173
178
  export interface SessionUpdateParams {
174
179
  sessionId: string;
175
180
  update: SessionUpdateInner;
@@ -199,6 +204,25 @@ export interface RequestPermissionResult {
199
204
  optionId: string;
200
205
  };
201
206
  }
207
+ export interface ListSessionsParams {
208
+ cwd?: string;
209
+ cursor?: string;
210
+ }
211
+ export interface AcpSessionInfo {
212
+ sessionId: string;
213
+ cwd: string;
214
+ title?: string | null;
215
+ updatedAt?: string | null;
216
+ }
217
+ export interface ListSessionsResult {
218
+ sessions: AcpSessionInfo[];
219
+ nextCursor?: string | null;
220
+ }
221
+ export interface DeleteSessionParams {
222
+ sessionId: string;
223
+ }
224
+ export interface DeleteSessionResult {
225
+ }
202
226
  export interface FsReadTextFileParams {
203
227
  sessionId: string;
204
228
  path: string;
@@ -4,7 +4,7 @@ import { randomUUID } from 'crypto';
4
4
  import { StdioTransport } from './transport.js';
5
5
  import { runAgentSession } from './session.js';
6
6
  import { initWorkspace, loadWorkspace, handleCommand } from './commands.js';
7
- import { autoSaveSession, config, setProvider } from '../config/index.js';
7
+ import { autoSaveSession, config, setProvider, listSessionsWithInfo, deleteSession as deleteSessionFile } from '../config/index.js';
8
8
  import { PROVIDERS } from '../config/providers.js';
9
9
  import { getCurrentVersion } from '../utils/update.js';
10
10
  // ─── Slash commands advertised to Zed ────────────────────────────────────────
@@ -140,6 +140,12 @@ export function startAcpServer() {
140
140
  case 'session/set_config_option':
141
141
  handleSetConfigOption(req);
142
142
  break;
143
+ case 'session/list':
144
+ handleSessionList(req);
145
+ break;
146
+ case 'session/delete':
147
+ handleSessionDelete(req);
148
+ break;
143
149
  default:
144
150
  transport.error(req.id, -32601, `Method not found: ${req.method}`);
145
151
  }
@@ -158,6 +164,7 @@ export function startAcpServer() {
158
164
  protocolVersion: 1,
159
165
  agentCapabilities: {
160
166
  loadSession: true,
167
+ sessionCapabilities: { list: {} },
161
168
  },
162
169
  agentInfo: {
163
170
  name: 'codeep',
@@ -180,6 +187,7 @@ export function startAcpServer() {
180
187
  addedFiles: new Map(),
181
188
  abortController: null,
182
189
  currentModeId: 'auto',
190
+ titleSent: false,
183
191
  });
184
192
  const result = {
185
193
  sessionId: acpSessionId,
@@ -228,6 +236,7 @@ export function startAcpServer() {
228
236
  codeepSessionId,
229
237
  addedFiles: new Map(),
230
238
  abortController: null,
239
+ titleSent: false,
231
240
  currentModeId: 'auto',
232
241
  });
233
242
  const result = {
@@ -301,6 +310,40 @@ export function startAcpServer() {
301
310
  },
302
311
  });
303
312
  }
313
+ // ── session/list ─────────────────────────────────────────────────────────────
314
+ function handleSessionList(msg) {
315
+ const params = (msg.params ?? {});
316
+ // Collect local (project-scoped) sessions and global sessions, deduplicated by name
317
+ const seen = new Set();
318
+ const merged = [
319
+ ...listSessionsWithInfo(params.cwd), // project-local first
320
+ ...listSessionsWithInfo(), // global fallback
321
+ ].filter(s => {
322
+ if (seen.has(s.name))
323
+ return false;
324
+ seen.add(s.name);
325
+ return true;
326
+ });
327
+ // Sort newest first
328
+ merged.sort((a, b) => new Date(b.createdAt).getTime() - new Date(a.createdAt).getTime());
329
+ const acpSessions = merged.map(s => ({
330
+ sessionId: s.name,
331
+ cwd: params.cwd ?? '',
332
+ title: s.name,
333
+ updatedAt: s.createdAt,
334
+ }));
335
+ const result = { sessions: acpSessions };
336
+ transport.respond(msg.id, result);
337
+ }
338
+ // ── session/delete ───────────────────────────────────────────────────────────
339
+ function handleSessionDelete(msg) {
340
+ const { sessionId } = (msg.params ?? {});
341
+ // Remove from in-memory sessions map if present
342
+ sessions.delete(sessionId);
343
+ // Delete from disk — sessionId is used as the session file name
344
+ deleteSessionFile(sessionId);
345
+ transport.respond(msg.id, {});
346
+ }
304
347
  // ── session/prompt ──────────────────────────────────────────────────────────
305
348
  function handleSessionPrompt(msg) {
306
349
  const params = msg.params;
@@ -343,6 +386,19 @@ export function startAcpServer() {
343
386
  },
344
387
  });
345
388
  }
389
+ // Send title on first interaction (commands count too)
390
+ if (!session.titleSent) {
391
+ session.titleSent = true;
392
+ const title = prompt.slice(0, 60).replace(/\n/g, ' ').trim();
393
+ transport.notify('session/update', {
394
+ sessionId: params.sessionId,
395
+ update: {
396
+ sessionUpdate: 'session_info_update',
397
+ title,
398
+ updatedAt: new Date().toISOString(),
399
+ },
400
+ });
401
+ }
346
402
  transport.respond(msg.id, { stopReason: 'end_turn' });
347
403
  return;
348
404
  }
@@ -406,6 +462,19 @@ export function startAcpServer() {
406
462
  session.history.push({ role: 'assistant', content: agentResponse });
407
463
  }
408
464
  autoSaveSession(session.history, session.workspaceRoot);
465
+ // Send session title on first completed prompt (so Zed shows something useful)
466
+ if (!session.titleSent) {
467
+ session.titleSent = true;
468
+ const title = prompt.slice(0, 60).replace(/\n/g, ' ').trim();
469
+ transport.notify('session/update', {
470
+ sessionId: params.sessionId,
471
+ update: {
472
+ sessionUpdate: 'session_info_update',
473
+ title,
474
+ updatedAt: new Date().toISOString(),
475
+ },
476
+ });
477
+ }
409
478
  transport.respond(msg.id, { stopReason: 'end_turn' });
410
479
  }).catch((err) => {
411
480
  if (err.name === 'AbortError') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeep",
3
- "version": "1.2.49",
3
+ "version": "1.2.51",
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",