442
}
443
case deleteCommentsToolName: {
444
>
const ids = getUniqueCommentIds((rawArgs as IDeleteCommentsArgs)?.commentIds, deleteCommentsToolName);
agentFeedbackServerTools.ts
445
>
const listable = listableAnnotations(state);
446
>
const existing = new Map(listable.map(a => [a.id, a]));
447
>
const actions: AnnotationsAction[] = [];
448
>
const deleted: string[] = [];
449
>
const notFound: string[] = [];
450
>
for (const id of ids) {
451
>
if (existing.has(id)) {
452
actions.push({ type: ActionType.AnnotationsRemoved, annotationId: id });
453
deleted.push(id);
455
>
notFound.push(id);
456
>
}
457
>
}
458
>
const remaining = listable.filter(a => !deleted.includes(a.id)).map(serializeComment);
459
>
return {
460
>
actions,
461
>
result: JSON.stringify({ deletedCommentIds: deleted, notFoundCommentIds: notFound, remainingComments: remaining }, undefined, 2),
462
>
};
463
>
}
464
case resolveCommentsToolName: {
465
const args = (rawArgs ?? {}) as IResolveCommentsArgs;