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.
- package/dist/cli/src/runtime/acp/agent-workspace.d.ts +1 -0
- package/dist/cli/src/runtime/acp/agent-workspace.js +45 -0
- package/dist/cli/src/runtime/acp/agent-workspace.js.map +1 -1
- package/dist/cli/src/runtime/bridge-session.d.ts +5 -0
- package/dist/cli/src/runtime/bridge-session.js +119 -16
- package/dist/cli/src/runtime/bridge-session.js.map +1 -1
- package/dist/cli/tsconfig.tsbuildinfo +1 -1
- package/dist/shared-protocol/src/index.d.ts +56 -2
- package/dist/shared-protocol/src/index.js +25 -0
- package/dist/shared-protocol/src/index.js.map +1 -1
- package/package.json +3 -3
- package/src/runtime/acp/agent-workspace.ts +42 -0
- package/src/runtime/bridge-session.ts +119 -25
|
@@ -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);
|