linkshell-cli 0.5.4 → 0.5.6

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.
@@ -16,6 +16,7 @@ export declare class AgentWorkspaceProxy {
16
16
  private conversations;
17
17
  private conversationByAgentSessionId;
18
18
  private timelines;
19
+ private deletedAgentSessionIds;
19
20
  private historyCursors;
20
21
  private toolOutputBuffers;
21
22
  private pendingPermissions;
@@ -1338,6 +1338,11 @@ export class AgentWorkspaceProxy {
1338
1338
  conversations = new Map();
1339
1339
  conversationByAgentSessionId = new Map();
1340
1340
  timelines = new Map();
1341
+ // Conversations the user "deleted" (forgot). We never touch the agent's
1342
+ // on-disk transcript, so syncProviderSessions would otherwise re-list and
1343
+ // resurrect them. Tombstone by agentSessionId (the stable provider key) so a
1344
+ // forgotten conversation stays gone for the life of this workspace process.
1345
+ deletedAgentSessionIds = new Set();
1341
1346
  // Opaque codex turns cursor per conversation, pointing at OLDER history to
1342
1347
  // page through (captured at hydration, advanced on each history.request).
1343
1348
  historyCursors = new Map();
@@ -1363,6 +1368,43 @@ export class AgentWorkspaceProxy {
1363
1368
  await this.openConversation(payload);
1364
1369
  break;
1365
1370
  }
1371
+ case "agent.v2.conversation.update": {
1372
+ const payload = parseTypedPayload("agent.v2.conversation.update", envelope.payload);
1373
+ const conversation = this.conversations.get(payload.conversationId);
1374
+ if (!conversation)
1375
+ break;
1376
+ if (payload.title !== undefined) {
1377
+ const trimmed = payload.title.trim();
1378
+ conversation.title = trimmed === "" ? undefined : trimmed;
1379
+ }
1380
+ if (payload.archived !== undefined)
1381
+ conversation.archived = payload.archived;
1382
+ conversation.lastActivityAt = Date.now();
1383
+ // Echo the updated record so every client refreshes (the web store
1384
+ // force-replaces by id on any event carrying `conversation`).
1385
+ this.emitConversation(conversation);
1386
+ break;
1387
+ }
1388
+ case "agent.v2.conversation.delete": {
1389
+ const payload = parseTypedPayload("agent.v2.conversation.delete", envelope.payload);
1390
+ const conversation = this.conversations.get(payload.conversationId);
1391
+ // Forget the conversation from the workspace's tracked set. We do NOT
1392
+ // delete the provider's on-disk transcript — only stop tracking it and
1393
+ // tombstone its session id so syncProviderSessions won't re-add it.
1394
+ if (conversation?.agentSessionId) {
1395
+ this.deletedAgentSessionIds.add(conversation.agentSessionId);
1396
+ this.conversationByAgentSessionId.delete(conversation.agentSessionId);
1397
+ }
1398
+ this.conversations.delete(payload.conversationId);
1399
+ this.timelines.delete(payload.conversationId);
1400
+ this.historyCursors.delete(payload.conversationId);
1401
+ this.input.send(createEnvelope({
1402
+ type: "agent.v2.conversation.deleted",
1403
+ sessionId: this.input.sessionId,
1404
+ payload: { conversationId: payload.conversationId },
1405
+ }));
1406
+ break;
1407
+ }
1366
1408
  case "agent.v2.conversation.list": {
1367
1409
  const payload = parseTypedPayload("agent.v2.conversation.list", envelope.payload);
1368
1410
  await this.syncProviderSessions();
@@ -1630,6 +1672,9 @@ export class AgentWorkspaceProxy {
1630
1672
  }
1631
1673
  for (const remote of parseRemoteSessions(result)) {
1632
1674
  const agentSessionId = remote.id;
1675
+ // Skip conversations the user explicitly forgot — don't resurrect them.
1676
+ if (this.deletedAgentSessionIds.has(agentSessionId))
1677
+ continue;
1633
1678
  const existingId = this.conversationByAgentSessionId.get(agentSessionId);
1634
1679
  const now = Date.now();
1635
1680
  const conversationId = existingId ?? makeAgentV2RemoteConversationId(provider, agentSessionId);