396
switch (toolName) {
397
case addCommentToolName: {
399
>
const id = generateUuid();
400
>
// The agent adds comments in the `created` state; the user accepts
401
>
// them before they are acted upon.
402
>
const meta: IFeedbackAnnotationMeta = { kind: 'codeReview', state: 'created', sessionResource };
403
>
const annotation: Annotation = {
404
>
id,
405
>
turnId: '',
406
>
resource: resourceUri,
407
>
range: toTextRange(range),
408
>
resolved: false,
409
>
entries: [{ id: `${id}:0`, text }],
410
>
_meta: { [FEEDBACK_ANNOTATION_META_KEY]: meta },
411
>
};
412
>
return {
413
>
actions: [{ type: ActionType.AnnotationsSet, annotation }],
414
>
result: 'Comment added.',
415
>
};
416
>
}
417
case listCommentsToolName: {
418
const payload: { comments: ISerializedComment[]; note?: string } = {