|
| 1 | +/*--------------------------------------------------------------------------------------------- |
| 2 | + * Copyright (c) Microsoft Corporation. All rights reserved. |
| 3 | + * Licensed under the MIT License. See License.txt in the project root for license information. |
| 4 | + *--------------------------------------------------------------------------------------------*/ |
| 5 | + |
| 6 | +import { Codicon } from '../../../../../base/common/codicons.js'; |
| 7 | +import { localize } from '../../../../../nls.js'; |
| 8 | +import { ChatInputNotificationActionKind, IChatInputNotificationCommandAction } from '../widget/input/chatInputNotificationService.js'; |
| 9 | + |
| 10 | +export const copilotHarnessIntroductionCopyVariants = ['current', 'capabilities', 'agent', 'original'] as const; |
| 11 | +export type CopilotHarnessIntroductionCopyVariant = typeof copilotHarnessIntroductionCopyVariants[number]; |
| 12 | + |
| 13 | +export const copilotHarnessIntroductionButtonVariants = ['dismiss', 'feedback'] as const; |
| 14 | +export type CopilotHarnessIntroductionButtonVariant = typeof copilotHarnessIntroductionButtonVariants[number]; |
| 15 | + |
| 16 | +export const copilotHarnessIntroductionLearnMoreCommandId = 'workbench.action.chat.agentsParallelWork.learnMore'; |
| 17 | +export const copilotHarnessIntroductionFeedbackCommandId = 'workbench.action.chat.agentsParallelWork.feedback'; |
| 18 | + |
| 19 | +export function getCopilotHarnessIntroductionContent( |
| 20 | + copy: CopilotHarnessIntroductionCopyVariant = 'current', |
| 21 | + buttons: CopilotHarnessIntroductionButtonVariant = 'dismiss', |
| 22 | +): { title: string; description: string; actions: IChatInputNotificationCommandAction[]; dismissible: boolean } { |
| 23 | + const feedbackUrl = 'https://github.com/microsoft/vscode/issues'; |
| 24 | + let title = localize('copilotHarnessTitle', "You're using a new Copilot experience"); |
| 25 | + let description: string; |
| 26 | + switch (copy) { |
| 27 | + case 'current': |
| 28 | + description = localize('copilotHarnessDescription', "This agent harness opens up new ways to work across windows and apps. Continue as usual, and [let us know]({0}) how it goes.", feedbackUrl); |
| 29 | + break; |
| 30 | + case 'capabilities': |
| 31 | + description = localize('copilotHarnessCapabilitiesDescription', "This agent harness brings new capabilities to the way you already work. If anything seems off, [let us know]({0}).", feedbackUrl); |
| 32 | + break; |
| 33 | + case 'agent': |
| 34 | + title = localize('copilotHarnessAgentTitle', "You're using a new Copilot agent"); |
| 35 | + description = localize('copilotHarnessAgentDescription', "Continue your sessions across windows and apps, without changing how you work. [Let us know]({0}) how it goes.", feedbackUrl); |
| 36 | + break; |
| 37 | + case 'original': |
| 38 | + description = localize('copilotHarnessOriginalDescription', "This new implementation unlocks exciting new capabilities, while previous agent harnesses remain available. If anything seems off, [let us know]({0}).", feedbackUrl); |
| 39 | + break; |
| 40 | + } |
| 41 | + |
| 42 | + const feedbackButtons = buttons === 'feedback'; |
| 43 | + const actions: IChatInputNotificationCommandAction[] = [{ |
| 44 | + kind: ChatInputNotificationActionKind.Command, |
| 45 | + label: localize('learnMore', "Learn More"), |
| 46 | + telemetryActionId: 'docsLink', |
| 47 | + commandId: copilotHarnessIntroductionLearnMoreCommandId, |
| 48 | + primary: false, |
| 49 | + ...(feedbackButtons ? { leading: true, outlined: true } : { filled: true }), |
| 50 | + keepOpen: true, |
| 51 | + }, { |
| 52 | + kind: ChatInputNotificationActionKind.Command, |
| 53 | + label: localize('gotIt', "{0} Got it!", `$(${Codicon.thumbsup.id})`), |
| 54 | + ariaLabel: localize('gotItAriaLabel', "Got it!"), |
| 55 | + telemetryActionId: 'thumbsUp', |
| 56 | + commandId: copilotHarnessIntroductionFeedbackCommandId, |
| 57 | + commandArgs: [true], |
| 58 | + primary: true, |
| 59 | + keepOpen: true, |
| 60 | + }]; |
| 61 | + if (feedbackButtons) { |
| 62 | + actions.push({ |
| 63 | + kind: ChatInputNotificationActionKind.Command, |
| 64 | + label: `$(${Codicon.thumbsdown.id})`, |
| 65 | + ariaLabel: localize('unhelpful', "Not Helpful"), |
| 66 | + iconOnly: true, |
| 67 | + tooltip: localize('unhelpfulTooltip', "Not Helpful"), |
| 68 | + telemetryActionId: 'thumbsDown', |
| 69 | + commandId: copilotHarnessIntroductionFeedbackCommandId, |
| 70 | + commandArgs: [false], |
| 71 | + primary: false, |
| 72 | + keepOpen: true, |
| 73 | + }); |
| 74 | + } |
| 75 | + |
| 76 | + return { title, description, actions, dismissible: !feedbackButtons }; |
| 77 | +} |
0 commit comments