@gitlab/duo-ui 13.10.8 → 14.1.0
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/CHANGELOG.md +27 -0
- package/dist/components/chat/components/duo_chat_header/web_duo_chat_header.js +3 -3
- package/dist/components/chat/components/duo_chat_message_tool_approval/components/base_tool_params.js +167 -5
- package/dist/components/chat/components/duo_chat_message_tool_approval/components/create_commit_tool_params.js +12 -18
- package/dist/components/chat/components/duo_chat_message_tool_approval/components/default_tool_params.js +89 -0
- package/dist/components/chat/components/duo_chat_message_tool_approval/components/tool_params_json_view.js +63 -0
- package/dist/components/chat/components/duo_chat_message_tool_approval/message_tool_approval.js +8 -40
- package/dist/components/chat/mock_data.js +18 -2
- package/dist/tailwind.css +1 -1
- package/dist/tailwind.css.map +1 -1
- package/package.json +2 -2
- package/src/components/chat/components/duo_chat_header/web_duo_chat_header.vue +25 -24
- package/src/components/chat/components/duo_chat_message_tool_approval/components/base_tool_params.vue +138 -10
- package/src/components/chat/components/duo_chat_message_tool_approval/components/create_commit_tool_params.vue +14 -16
- package/src/components/chat/components/duo_chat_message_tool_approval/components/default_tool_params.vue +72 -0
- package/src/components/chat/components/duo_chat_message_tool_approval/components/tool_params_json_view.vue +42 -0
- package/src/components/chat/components/duo_chat_message_tool_approval/message_tool_approval.vue +7 -99
- package/src/components/chat/mock_data.js +18 -0
- package/translations.js +24 -41
- package/dist/components/chat/components/duo_chat_message_tool_approval/components/issuable_tool_params.js +0 -174
- package/src/components/chat/components/duo_chat_message_tool_approval/components/issuable_tool_params.vue +0 -193
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { sprintf, translate } from '../../../../../utils/i18n';
|
|
3
|
+
import { APPROVAL_TOOL_NAMES } from '../../../constants';
|
|
4
|
+
import BaseToolParams from './base_tool_params.vue';
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
name: 'DefaultToolParams',
|
|
8
|
+
components: {
|
|
9
|
+
BaseToolParams,
|
|
10
|
+
},
|
|
11
|
+
props: {
|
|
12
|
+
toolName: {
|
|
13
|
+
type: String,
|
|
14
|
+
required: false,
|
|
15
|
+
default: '',
|
|
16
|
+
},
|
|
17
|
+
toolParams: {
|
|
18
|
+
type: Object,
|
|
19
|
+
required: true,
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
computed: {
|
|
23
|
+
title() {
|
|
24
|
+
return this.toolParams?.title;
|
|
25
|
+
},
|
|
26
|
+
description() {
|
|
27
|
+
return this.toolParams?.description || this.toolParams?.body || this.toolParams?.comment;
|
|
28
|
+
},
|
|
29
|
+
isNote() {
|
|
30
|
+
return [
|
|
31
|
+
APPROVAL_TOOL_NAMES.createMergeRequestNote,
|
|
32
|
+
APPROVAL_TOOL_NAMES.createWorkItemNote,
|
|
33
|
+
APPROVAL_TOOL_NAMES.createIssueNote,
|
|
34
|
+
].includes(this.toolName);
|
|
35
|
+
},
|
|
36
|
+
message() {
|
|
37
|
+
const message = this.title ? this.$options.i18n.TITLE_MESSAGE : '';
|
|
38
|
+
|
|
39
|
+
return sprintf(message, {
|
|
40
|
+
...this.toolParams,
|
|
41
|
+
});
|
|
42
|
+
},
|
|
43
|
+
accordionTitle() {
|
|
44
|
+
return this.isNote ? this.$options.i18n.NOTE_ACCORDION_TITLE : '';
|
|
45
|
+
},
|
|
46
|
+
displayRawOutput() {
|
|
47
|
+
return !this.message;
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
i18n: {
|
|
51
|
+
TITLE_MESSAGE: translate(
|
|
52
|
+
'IssuableToolParams.TITLE_MESSAGE',
|
|
53
|
+
'Set the title "<em>%{title}</em>".'
|
|
54
|
+
),
|
|
55
|
+
NOTE_ACCORDION_TITLE: translate(
|
|
56
|
+
'IssuableToolParams.NOTE_ACCORDION_TITLE',
|
|
57
|
+
"Read note's content"
|
|
58
|
+
),
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
</script>
|
|
62
|
+
<template>
|
|
63
|
+
<div>
|
|
64
|
+
<base-tool-params
|
|
65
|
+
with-json-view
|
|
66
|
+
:tool-params="toolParams"
|
|
67
|
+
:message="message"
|
|
68
|
+
:description="description"
|
|
69
|
+
:custom-accordion-title="accordionTitle"
|
|
70
|
+
/>
|
|
71
|
+
</div>
|
|
72
|
+
</template>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { translate } from '../../../../../utils/i18n';
|
|
3
|
+
import PreBlock from './pre_block.vue';
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
name: 'ToolParamsJsonView',
|
|
7
|
+
components: {
|
|
8
|
+
PreBlock,
|
|
9
|
+
},
|
|
10
|
+
props: {
|
|
11
|
+
toolParams: {
|
|
12
|
+
type: Object,
|
|
13
|
+
required: true,
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
computed: {
|
|
17
|
+
hasToolParams() {
|
|
18
|
+
return Object.keys(this.toolParams || {}).length > 0;
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
i18n: {
|
|
22
|
+
REQUEST_TEXT: translate('MessageToolApproval.parametersText', 'Request parameters'),
|
|
23
|
+
NO_PARAMETERS_TEXT: translate(
|
|
24
|
+
'MessageToolApproval.noParametersText',
|
|
25
|
+
'No parameters will be sent with this request.'
|
|
26
|
+
),
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
</script>
|
|
30
|
+
<template>
|
|
31
|
+
<figure class="gl-m-0 gl-flex gl-flex-col gl-gap-2">
|
|
32
|
+
<figcaption class="gl-text-subtle">
|
|
33
|
+
{{ $options.i18n.REQUEST_TEXT }}
|
|
34
|
+
</figcaption>
|
|
35
|
+
<pre-block v-if="hasToolParams" class="language-json" data-testid="tool-parameters">{{
|
|
36
|
+
JSON.stringify(toolParams, null, 2)
|
|
37
|
+
}}</pre-block>
|
|
38
|
+
<span v-else class="gl-text-sm gl-text-gray-500" data-testid="no-parameters-message">
|
|
39
|
+
{{ $options.i18n.NO_PARAMETERS_TEXT }}
|
|
40
|
+
</span>
|
|
41
|
+
</figure>
|
|
42
|
+
</template>
|
package/src/components/chat/components/duo_chat_message_tool_approval/message_tool_approval.vue
CHANGED
|
@@ -8,13 +8,14 @@ import {
|
|
|
8
8
|
GlDropdown,
|
|
9
9
|
GlDropdownItem,
|
|
10
10
|
} from '@gitlab/ui';
|
|
11
|
+
import startCase from 'lodash/startCase';
|
|
12
|
+
import capitalize from 'lodash/capitalize';
|
|
11
13
|
import { translate } from '../../../../utils/i18n';
|
|
12
14
|
import { convertKeysToCamelCase } from '../../../../utils/object';
|
|
13
15
|
import { acceptedApproveToolPayloads, APPROVAL_TOOL_NAMES } from '../../constants';
|
|
14
16
|
import CreateCommitToolParams from './components/create_commit_tool_params.vue';
|
|
15
|
-
import
|
|
17
|
+
import DefaultToolParams from './components/default_tool_params.vue';
|
|
16
18
|
import RunCommandToolParams from './components/run_command_tool_params.vue';
|
|
17
|
-
import PreBlock from './components/pre_block.vue';
|
|
18
19
|
|
|
19
20
|
export const PROCESSING_STATE = {
|
|
20
21
|
APPROVING: 'approving',
|
|
@@ -40,71 +41,12 @@ export const i18n = {
|
|
|
40
41
|
APPROVING_TEXT: translate('MessageToolApproval.approvingText', 'Approving...'),
|
|
41
42
|
DENY_TEXT: translate('MessageToolApproval.denyText', 'Deny'),
|
|
42
43
|
DENYING_TEXT: translate('MessageToolApproval.denyingText', 'Denying...'),
|
|
43
|
-
NO_PARAMETERS_TEXT: translate(
|
|
44
|
-
'MessageToolApproval.noParametersText',
|
|
45
|
-
'No parameters will be sent with this request.'
|
|
46
|
-
),
|
|
47
|
-
REQUEST_TEXT: translate('MessageToolApproval.parametersText', 'Request parameters'),
|
|
48
44
|
DENIAL_REASON_LABEL: translate('MessageToolApproval.denialReasonLabel', 'Rejection reason'),
|
|
49
45
|
DENIAL_REASON_PLACEHOLDER: translate(
|
|
50
46
|
'MessageToolApproval.denialReasonPlaceholder',
|
|
51
47
|
"Tell Duo why you're rejecting this tool execution..."
|
|
52
48
|
),
|
|
53
49
|
CANCEL_TEXT: translate('MessageToolApproval.cancelText', 'Cancel'),
|
|
54
|
-
TOOL_APPROVAL_TITLES: {
|
|
55
|
-
[APPROVAL_TOOL_NAMES.createCommit]: translate(
|
|
56
|
-
'MessageToolApproval.createCommit',
|
|
57
|
-
'Duo wants to push a commit.'
|
|
58
|
-
),
|
|
59
|
-
[APPROVAL_TOOL_NAMES.createIssue]: translate(
|
|
60
|
-
'MessageToolApproval.createIssue',
|
|
61
|
-
'Duo wants to open an issue.'
|
|
62
|
-
),
|
|
63
|
-
[APPROVAL_TOOL_NAMES.updateIssue]: translate(
|
|
64
|
-
'MessageToolApproval.updateIssue',
|
|
65
|
-
'Duo wants to update an issue.'
|
|
66
|
-
),
|
|
67
|
-
[APPROVAL_TOOL_NAMES.createEpic]: translate(
|
|
68
|
-
'MessageToolApproval.createEpic',
|
|
69
|
-
'Duo wants to create an epic.'
|
|
70
|
-
),
|
|
71
|
-
[APPROVAL_TOOL_NAMES.updateEpic]: translate(
|
|
72
|
-
'MessageToolApproval.updateEpic',
|
|
73
|
-
'Duo wants to update an epic.'
|
|
74
|
-
),
|
|
75
|
-
[APPROVAL_TOOL_NAMES.createWorkItem]: translate(
|
|
76
|
-
'MessageToolApproval.createWorkItem',
|
|
77
|
-
'Duo wants to create a work item.'
|
|
78
|
-
),
|
|
79
|
-
[APPROVAL_TOOL_NAMES.updateWorkItem]: translate(
|
|
80
|
-
'MessageToolApproval.updateWorkItem',
|
|
81
|
-
'Duo wants to update a work item.'
|
|
82
|
-
),
|
|
83
|
-
[APPROVAL_TOOL_NAMES.createMergeRequest]: translate(
|
|
84
|
-
'MessageToolApproval.createMergeRequest',
|
|
85
|
-
'Duo wants to create a merge request.'
|
|
86
|
-
),
|
|
87
|
-
[APPROVAL_TOOL_NAMES.createIssueNote]: translate(
|
|
88
|
-
'MessageToolApproval.createIssueNote',
|
|
89
|
-
'Duo wants to post a note on an issue.'
|
|
90
|
-
),
|
|
91
|
-
[APPROVAL_TOOL_NAMES.createMergeRequestNote]: translate(
|
|
92
|
-
'MessageToolApproval.createMergeRequestNote',
|
|
93
|
-
'Duo wants to post a note on a merge request.'
|
|
94
|
-
),
|
|
95
|
-
[APPROVAL_TOOL_NAMES.createWorkItemNote]: translate(
|
|
96
|
-
'MessageToolApproval.createWorkItemNote',
|
|
97
|
-
'Duo wants to post a note on a work item.'
|
|
98
|
-
),
|
|
99
|
-
[APPROVAL_TOOL_NAMES.runCommand]: translate(
|
|
100
|
-
'MessageToolApproval.runCommand',
|
|
101
|
-
'Duo wants to run a command.'
|
|
102
|
-
),
|
|
103
|
-
[APPROVAL_TOOL_NAMES.runGitCommand]: translate(
|
|
104
|
-
'MessageToolApproval.runGitCommand',
|
|
105
|
-
'Duo wants to run a git command.'
|
|
106
|
-
),
|
|
107
|
-
},
|
|
108
50
|
[TOOL_STATUS.Pending]: translate('MessageToolApproval.toolStatusPending', 'Pending'),
|
|
109
51
|
[TOOL_STATUS.Approved]: translate('MessageToolApproval.toolStatusApproved', 'Approved'),
|
|
110
52
|
TOGGLE_PARAMS_BUTTON_EXPAND: translate(
|
|
@@ -123,17 +65,6 @@ export const i18n = {
|
|
|
123
65
|
|
|
124
66
|
const TOOL_PARAMS_VIEW_COMPONENTS = {
|
|
125
67
|
[APPROVAL_TOOL_NAMES.createCommit]: 'CreateCommitToolParams',
|
|
126
|
-
[APPROVAL_TOOL_NAMES.createIssue]: 'IssuableToolParams',
|
|
127
|
-
[APPROVAL_TOOL_NAMES.updateIssue]: 'IssuableToolParams',
|
|
128
|
-
[APPROVAL_TOOL_NAMES.createEpic]: 'IssuableToolParams',
|
|
129
|
-
[APPROVAL_TOOL_NAMES.updateEpic]: 'IssuableToolParams',
|
|
130
|
-
[APPROVAL_TOOL_NAMES.createMergeRequest]: 'IssuableToolParams',
|
|
131
|
-
[APPROVAL_TOOL_NAMES.updateMergeRequest]: 'IssuableToolParams',
|
|
132
|
-
[APPROVAL_TOOL_NAMES.createWorkItem]: 'IssuableToolParams',
|
|
133
|
-
[APPROVAL_TOOL_NAMES.updateWorkItem]: 'IssuableToolParams',
|
|
134
|
-
[APPROVAL_TOOL_NAMES.createMergeRequestNote]: 'IssuableToolParams',
|
|
135
|
-
[APPROVAL_TOOL_NAMES.createWorkItemNote]: 'IssuableToolParams',
|
|
136
|
-
[APPROVAL_TOOL_NAMES.createIssueNote]: 'IssuableToolParams',
|
|
137
68
|
[APPROVAL_TOOL_NAMES.runCommand]: 'RunCommandToolParams',
|
|
138
69
|
[APPROVAL_TOOL_NAMES.runGitCommand]: 'RunCommandToolParams',
|
|
139
70
|
};
|
|
@@ -149,9 +80,8 @@ export default {
|
|
|
149
80
|
GlDropdown,
|
|
150
81
|
GlDropdownItem,
|
|
151
82
|
CreateCommitToolParams,
|
|
152
|
-
|
|
83
|
+
DefaultToolParams,
|
|
153
84
|
RunCommandToolParams,
|
|
154
|
-
PreBlock,
|
|
155
85
|
},
|
|
156
86
|
props: {
|
|
157
87
|
messages: {
|
|
@@ -236,7 +166,7 @@ export default {
|
|
|
236
166
|
}
|
|
237
167
|
|
|
238
168
|
// Single tool: show specific tool message
|
|
239
|
-
return
|
|
169
|
+
return capitalize(startCase(this.toolName));
|
|
240
170
|
},
|
|
241
171
|
toolStatusLabel() {
|
|
242
172
|
return i18n[this.approvalStatus];
|
|
@@ -347,7 +277,7 @@ export default {
|
|
|
347
277
|
return convertKeysToCamelCase(obj);
|
|
348
278
|
},
|
|
349
279
|
getToolParamsComponent(toolName) {
|
|
350
|
-
return TOOL_PARAMS_VIEW_COMPONENTS[toolName];
|
|
280
|
+
return TOOL_PARAMS_VIEW_COMPONENTS[toolName] || 'DefaultToolParams';
|
|
351
281
|
},
|
|
352
282
|
},
|
|
353
283
|
i18n,
|
|
@@ -364,7 +294,7 @@ export default {
|
|
|
364
294
|
>
|
|
365
295
|
<template #header>
|
|
366
296
|
<div class="gl-flex gl-items-center gl-justify-between gl-gap-3">
|
|
367
|
-
<span>
|
|
297
|
+
<span class="gl-inline-flex gl-items-center gl-gap-2">
|
|
368
298
|
<gl-button
|
|
369
299
|
v-if="collapsible"
|
|
370
300
|
variant="default"
|
|
@@ -386,7 +316,6 @@ export default {
|
|
|
386
316
|
<div v-for="(toolMsg, index) in messages" :key="toolMsg.id || index">
|
|
387
317
|
<component
|
|
388
318
|
:is="getToolParamsComponent(toolMsg.tool_info && toolMsg.tool_info.name)"
|
|
389
|
-
v-if="getToolParamsComponent(toolMsg.tool_info && toolMsg.tool_info.name)"
|
|
390
319
|
:class="['gl-leading-20', { 'gl-border-t gl-mt-3 gl-border-gray-100 gl-pt-3': index > 0 }]"
|
|
391
320
|
:tool-name="toolMsg.tool_info && toolMsg.tool_info.name"
|
|
392
321
|
:tool-params="convertKeysToCamelCase((toolMsg.tool_info && toolMsg.tool_info.args) || {})"
|
|
@@ -394,27 +323,6 @@ export default {
|
|
|
394
323
|
:tool-response="toolMsg.tool_info && toolMsg.tool_info.tool_response"
|
|
395
324
|
:working-directory="workingDirectory"
|
|
396
325
|
/>
|
|
397
|
-
<figure
|
|
398
|
-
v-else
|
|
399
|
-
class="gl-m-0 gl-flex gl-flex-col gl-gap-2"
|
|
400
|
-
:class="{ 'gl-border-t gl-mt-3 gl-border-gray-100 gl-pt-3': index > 0 }"
|
|
401
|
-
>
|
|
402
|
-
<figcaption class="gl-text-subtle">
|
|
403
|
-
{{ $options.i18n.REQUEST_TEXT }}
|
|
404
|
-
</figcaption>
|
|
405
|
-
<pre-block
|
|
406
|
-
v-if="
|
|
407
|
-
toolMsg.tool_info &&
|
|
408
|
-
toolMsg.tool_info.args &&
|
|
409
|
-
Object.keys(toolMsg.tool_info.args).length > 0
|
|
410
|
-
"
|
|
411
|
-
data-testid="tool-parameters"
|
|
412
|
-
>{{ JSON.stringify(toolMsg.tool_info.args, null, 2) }}</pre-block
|
|
413
|
-
>
|
|
414
|
-
<span v-else class="gl-text-sm gl-text-gray-500" data-testid="no-parameters-message">
|
|
415
|
-
{{ $options.i18n.NO_PARAMETERS_TEXT }}
|
|
416
|
-
</span>
|
|
417
|
-
</figure>
|
|
418
326
|
</div>
|
|
419
327
|
<template v-if="!isApproved" #footer>
|
|
420
328
|
<div v-if="!showDenialReason" class="gl-flex gl-gap-2">
|
|
@@ -209,6 +209,23 @@ export const MOCK_REQUEST_MESSAGE_WITH_TOOL_APPROVAL_CREATE_MERGE_REQUEST = {
|
|
|
209
209
|
role: 'request',
|
|
210
210
|
};
|
|
211
211
|
|
|
212
|
+
export const MOCK_REQUEST_MESSAGE_WITH_TOOL_APPROVAL_UPDATE_MERGE_REQUEST = {
|
|
213
|
+
id: '125',
|
|
214
|
+
content: 'Tool update_merge_request requires approval. Please confirm if you want to proceed.',
|
|
215
|
+
message_type: MESSAGE_MODEL_ROLES.request,
|
|
216
|
+
tool_info: {
|
|
217
|
+
name: 'update_merge_request',
|
|
218
|
+
args: {
|
|
219
|
+
url: 'https://gitlab.com/gitlab-org/editor-extensions/gitlab-language-server/-/merge_requests/123',
|
|
220
|
+
description:
|
|
221
|
+
'## What does this MR do?\n\nThis MR updates the `group` field in the `web_ide_language_server` beta feature flag configuration from `group::remote development` to `group:: editor extensions`.\n\n## Related issues\n\nThis change aligns the feature flag with the correct group ownership.\n\n## Changes made\n\n- Updated `config/feature_flags/beta/web_ide_language_server.yml`\n- Changed group field from `group::remote development` to `group:: editor extensions`\n\n## Checklist\n\n- [x] Feature flag configuration updated\n- [x] Group field correctly set to `group:: editor extensions`',
|
|
222
|
+
},
|
|
223
|
+
},
|
|
224
|
+
timestamp: '2025-06-25T19:22:21.290791+00:00',
|
|
225
|
+
status: 'success',
|
|
226
|
+
role: 'request',
|
|
227
|
+
};
|
|
228
|
+
|
|
212
229
|
export const MOCK_REQUEST_MESSAGE_WITH_TOOL_APPROVAL_RUN_COMMAND = {
|
|
213
230
|
id: '125',
|
|
214
231
|
content: 'Tool run_command requires approval. Please confirm if you want to proceed.',
|
|
@@ -442,6 +459,7 @@ export const MOCK_REQUEST_MESSAGE_WITH_TOOL_APPROVAL_CREATE_WORK_ITEM = {
|
|
|
442
459
|
'## Overview\n\nUsers have requested the ability to toggle between light and dark modes in the chat interface to improve usability in different lighting conditions.\n\n## Requirements\n\n- [ ] Add a toggle button in the chat header\n- [ ] Implement theme switching logic\n- [ ] Persist user preference in localStorage\n- [ ] Ensure all chat components support both themes\n- [ ] Update existing CSS variables for dark mode\n\n## Acceptance Criteria\n\n- Toggle button is visible and accessible\n- Theme changes are applied immediately\n- User preference is remembered across sessions\n- All text remains readable in both modes\n- Icons and UI elements adapt to the selected theme',
|
|
443
460
|
labels: ['enhancement', 'ui', 'accessibility'],
|
|
444
461
|
assignee_ids: [123],
|
|
462
|
+
confidential: true,
|
|
445
463
|
},
|
|
446
464
|
},
|
|
447
465
|
timestamp: '2025-06-25T19:22:21.290791+00:00',
|
package/translations.js
CHANGED
|
@@ -35,14 +35,31 @@ export default {
|
|
|
35
35
|
'AgenticToolRejectionModal.placeholder': "Explain why you're rejecting this tool execution...",
|
|
36
36
|
'AgenticToolRejectionModal.submitText': 'Submit Rejection',
|
|
37
37
|
'AgenticToolRejectionModal.title': 'Provide Rejection Reason',
|
|
38
|
-
'BaseToolParams.
|
|
38
|
+
'BaseToolParams.ExpandDescriptionTitle': 'Read description',
|
|
39
|
+
'BaseToolParams.ExpandJsonViewTitle': 'See request parameters as JSON',
|
|
40
|
+
'BaseToolParams.confidentialLabel': 'Confidential',
|
|
41
|
+
'BaseToolParams.dismissalReasonLabel': 'Dismissal reason',
|
|
42
|
+
'BaseToolParams.dueDateLabel': 'Due date',
|
|
43
|
+
'BaseToolParams.epicLabel': 'Epic',
|
|
44
|
+
'BaseToolParams.groupLabel': 'Group',
|
|
45
|
+
'BaseToolParams.healthStatusLabel': 'Health status',
|
|
46
|
+
'BaseToolParams.issueLabel': 'Issue',
|
|
47
|
+
'BaseToolParams.labelsLabel': 'Labels',
|
|
48
|
+
'BaseToolParams.mergeRequestLabel': 'Merge request',
|
|
49
|
+
'BaseToolParams.projectLabel': 'Project',
|
|
50
|
+
'BaseToolParams.sourceBranchLabel': 'Source branch',
|
|
51
|
+
'BaseToolParams.startDateLabel': 'Start date',
|
|
52
|
+
'BaseToolParams.stateLabel': 'State',
|
|
53
|
+
'BaseToolParams.targetBranchLabel': 'Target branch',
|
|
54
|
+
'BaseToolParams.typeLabel': 'Type',
|
|
55
|
+
'BaseToolParams.vulnerabilityLabel': 'Vulnerability',
|
|
56
|
+
'BaseToolParams.workItemLabel': 'Work item',
|
|
39
57
|
'CreateCommitToolParams.actionWithNoContent': 'This action does not have any content.',
|
|
40
58
|
'CreateCommitToolParams.actionsCountMessage': null,
|
|
41
59
|
'CreateCommitToolParams.chmodFileActionLabel': 'Change permissions for file %{filePath}',
|
|
42
60
|
'CreateCommitToolParams.commitSummaryAutoBranchMessage':
|
|
43
|
-
'Create a commit in a new auto-created branch
|
|
44
|
-
'CreateCommitToolParams.commitSummaryMessage':
|
|
45
|
-
'Create a commit in the branch %{branch} and project %{project}.',
|
|
61
|
+
'Create a commit in a new auto-created branch.',
|
|
62
|
+
'CreateCommitToolParams.commitSummaryMessage': 'Create a commit in the branch %{branch}.',
|
|
46
63
|
'CreateCommitToolParams.createFileActionLabel': 'Create file %{filePath}',
|
|
47
64
|
'CreateCommitToolParams.deleteFileActionLabel': 'Delete file %{filePath}',
|
|
48
65
|
'CreateCommitToolParams.expandFileChanges': 'Expand file changes',
|
|
@@ -119,31 +136,8 @@ export default {
|
|
|
119
136
|
'DuoRecentCollapsable.viewAllText': 'View All',
|
|
120
137
|
'GlDuoChat.chatDisclamer': 'Responses may be inaccurate. Verify before use.',
|
|
121
138
|
'GlDuoChat.chatHistoryTitle': 'Chat history',
|
|
122
|
-
'IssuableToolParams.ASSIGN_LABELS_MESSAGE': 'Assign the labels <code>%{labels}</code>.',
|
|
123
|
-
'IssuableToolParams.BRANCH_MESSAGE':
|
|
124
|
-
'From branch <code>%{sourceBranch}</code> to branch <code>%{targetBranch}</code>.',
|
|
125
|
-
'IssuableToolParams.CONFIDENTIAL_MESSAGE': 'Set as confidential.',
|
|
126
|
-
'IssuableToolParams.CREATE_EPIC': 'Create an epic in group <code>%{groupId}</code>.',
|
|
127
|
-
'IssuableToolParams.CREATE_ISSUE': 'Open an issue in project <code>%{project}</code>.',
|
|
128
|
-
'IssuableToolParams.CREATE_MERGE_REQUEST':
|
|
129
|
-
'Open a merge request in project <code>%{project}</code>.',
|
|
130
|
-
'IssuableToolParams.CREATE_WORK_ITEM':
|
|
131
|
-
'Create a work item with type <em>"%{typeName}"</em> in %{workItemParentType} <code>%{workItemParentId}</code>.',
|
|
132
|
-
'IssuableToolParams.ISSUE_LABEL': 'issue',
|
|
133
|
-
'IssuableToolParams.MERGE_REQUEST_LABEL': 'merge request',
|
|
134
139
|
'IssuableToolParams.NOTE_ACCORDION_TITLE': "Read note's content",
|
|
135
|
-
'IssuableToolParams.NOTE_MESSAGE':
|
|
136
|
-
'Post a note on %{noteParentLabel} <code>%{noteParentIid}</code>.',
|
|
137
140
|
'IssuableToolParams.TITLE_MESSAGE': 'Set the title "<em>%{title}</em>".',
|
|
138
|
-
'IssuableToolParams.UPDATE_EPIC':
|
|
139
|
-
'Update epic <code>%{epicId}</code> in group <code>%{groupId}</code>.',
|
|
140
|
-
'IssuableToolParams.UPDATE_ISSUE':
|
|
141
|
-
'Update issue <code>%{issueIid}</code> in project <code>%{project}</code>.',
|
|
142
|
-
'IssuableToolParams.UPDATE_MERGE_REQUEST':
|
|
143
|
-
'Update merge request <code>%{mergeRequestIid}</code> in project <code>%{project}</code>.',
|
|
144
|
-
'IssuableToolParams.UPDATE_WORK_ITEM':
|
|
145
|
-
'Update work item <code>%{workItemIid}</code> in %{workItemParentType} <code>%{workItemParentId}</code>.',
|
|
146
|
-
'IssuableToolParams.WORK_ITEM_LABEL': 'work item',
|
|
147
141
|
'MessageToolApproval.approveAllText': 'Always approve this tool',
|
|
148
142
|
'MessageToolApproval.approveSessionText': 'Approve for session',
|
|
149
143
|
'MessageToolApproval.approveText': 'Approve',
|
|
@@ -151,14 +145,6 @@ export default {
|
|
|
151
145
|
'MessageToolApproval.cancelText': 'Cancel',
|
|
152
146
|
'MessageToolApproval.collapseButtonCollapsed': 'Display tool details',
|
|
153
147
|
'MessageToolApproval.collapseButtonExpanded': 'Hide tool details',
|
|
154
|
-
'MessageToolApproval.createCommit': 'Duo wants to push a commit.',
|
|
155
|
-
'MessageToolApproval.createEpic': 'Duo wants to create an epic.',
|
|
156
|
-
'MessageToolApproval.createIssue': 'Duo wants to open an issue.',
|
|
157
|
-
'MessageToolApproval.createIssueNote': 'Duo wants to post a note on an issue.',
|
|
158
|
-
'MessageToolApproval.createMergeRequest': 'Duo wants to create a merge request.',
|
|
159
|
-
'MessageToolApproval.createMergeRequestNote': 'Duo wants to post a note on a merge request.',
|
|
160
|
-
'MessageToolApproval.createWorkItem': 'Duo wants to create a work item.',
|
|
161
|
-
'MessageToolApproval.createWorkItemNote': 'Duo wants to post a note on a work item.',
|
|
162
148
|
'MessageToolApproval.denialReasonLabel': 'Rejection reason',
|
|
163
149
|
'MessageToolApproval.denialReasonPlaceholder':
|
|
164
150
|
"Tell Duo why you're rejecting this tool execution...",
|
|
@@ -167,17 +153,13 @@ export default {
|
|
|
167
153
|
'MessageToolApproval.multiToolTitle': 'Duo wants to execute %{count} tools.',
|
|
168
154
|
'MessageToolApproval.noParametersText': 'No parameters will be sent with this request.',
|
|
169
155
|
'MessageToolApproval.parametersText': 'Request parameters',
|
|
170
|
-
'MessageToolApproval.runCommand': 'Duo wants to run a command.',
|
|
171
|
-
'MessageToolApproval.runGitCommand': 'Duo wants to run a git command.',
|
|
172
156
|
'MessageToolApproval.toolApprovalDescription':
|
|
173
157
|
'GitLab Duo Agentic Chat wants to execute a tool. Do you want to proceed?',
|
|
174
158
|
'MessageToolApproval.toolLabel': 'Tool:',
|
|
175
159
|
'MessageToolApproval.toolStatusApproved': 'Approved',
|
|
176
160
|
'MessageToolApproval.toolStatusPending': 'Pending',
|
|
177
161
|
'MessageToolApproval.toolUnknown': 'Unknown',
|
|
178
|
-
|
|
179
|
-
'MessageToolApproval.updateIssue': 'Duo wants to update an issue.',
|
|
180
|
-
'MessageToolApproval.updateWorkItem': 'Duo wants to update a work item.',
|
|
162
|
+
No: 'No',
|
|
181
163
|
'RunCommandToolParams.ACCORDION_TITLE': 'Expand command output',
|
|
182
164
|
'WebAgenticDuoChat.agenticChatEmptyStateGreeting': 'Hello, I’m %{agentName}!',
|
|
183
165
|
'WebAgenticDuoChat.chatCancelLabel': 'Cancel',
|
|
@@ -220,7 +202,8 @@ export default {
|
|
|
220
202
|
'WebDuoChat.closeChatHeaderLabel': 'Close chat',
|
|
221
203
|
'WebDuoChat.copySessionIdFailedToast': 'Could not copy session ID',
|
|
222
204
|
'WebDuoChat.copySessionIdSuccessToast': 'Session ID copied to clipboard',
|
|
223
|
-
'WebDuoChat.copySessionIdTooltip': 'Copy
|
|
205
|
+
'WebDuoChat.copySessionIdTooltip': 'Copy Chat Session ID (%{id})',
|
|
224
206
|
'WebDuoChat.overLimitCharacterCountMessage': null,
|
|
225
207
|
'WebDuoChat.remainingCharacterCountMessage': null,
|
|
208
|
+
Yes: 'Yes',
|
|
226
209
|
};
|
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
import { translate, sprintf } from '../../../../../utils/i18n';
|
|
2
|
-
import { APPROVAL_TOOL_NAMES } from '../../../constants';
|
|
3
|
-
import BaseToolParams from './base_tool_params';
|
|
4
|
-
import __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';
|
|
5
|
-
|
|
6
|
-
const NOTE_MESSAGE = translate('IssuableToolParams.NOTE_MESSAGE', 'Post a note on %{noteParentLabel} <code>%{noteParentIid}</code>.');
|
|
7
|
-
var script = {
|
|
8
|
-
name: 'IssuableToolParams',
|
|
9
|
-
components: {
|
|
10
|
-
BaseToolParams
|
|
11
|
-
},
|
|
12
|
-
props: {
|
|
13
|
-
toolName: {
|
|
14
|
-
type: String,
|
|
15
|
-
required: true,
|
|
16
|
-
validator: toolName => Object.values(APPROVAL_TOOL_NAMES).includes(toolName)
|
|
17
|
-
},
|
|
18
|
-
toolParams: {
|
|
19
|
-
type: Object,
|
|
20
|
-
required: true
|
|
21
|
-
}
|
|
22
|
-
},
|
|
23
|
-
computed: {
|
|
24
|
-
project() {
|
|
25
|
-
var _this$toolParams, _this$toolParams2;
|
|
26
|
-
return ((_this$toolParams = this.toolParams) === null || _this$toolParams === void 0 ? void 0 : _this$toolParams.projectPath) || ((_this$toolParams2 = this.toolParams) === null || _this$toolParams2 === void 0 ? void 0 : _this$toolParams2.projectId);
|
|
27
|
-
},
|
|
28
|
-
title() {
|
|
29
|
-
var _this$toolParams3;
|
|
30
|
-
return (_this$toolParams3 = this.toolParams) === null || _this$toolParams3 === void 0 ? void 0 : _this$toolParams3.title;
|
|
31
|
-
},
|
|
32
|
-
labels() {
|
|
33
|
-
var _this$toolParams4;
|
|
34
|
-
return (_this$toolParams4 = this.toolParams) === null || _this$toolParams4 === void 0 ? void 0 : _this$toolParams4.labels;
|
|
35
|
-
},
|
|
36
|
-
description() {
|
|
37
|
-
var _this$toolParams5, _this$toolParams6;
|
|
38
|
-
return ((_this$toolParams5 = this.toolParams) === null || _this$toolParams5 === void 0 ? void 0 : _this$toolParams5.description) || ((_this$toolParams6 = this.toolParams) === null || _this$toolParams6 === void 0 ? void 0 : _this$toolParams6.body);
|
|
39
|
-
},
|
|
40
|
-
sourceBranch() {
|
|
41
|
-
var _this$toolParams7;
|
|
42
|
-
return (_this$toolParams7 = this.toolParams) === null || _this$toolParams7 === void 0 ? void 0 : _this$toolParams7.sourceBranch;
|
|
43
|
-
},
|
|
44
|
-
targetBranch() {
|
|
45
|
-
var _this$toolParams8;
|
|
46
|
-
return (_this$toolParams8 = this.toolParams) === null || _this$toolParams8 === void 0 ? void 0 : _this$toolParams8.targetBranch;
|
|
47
|
-
},
|
|
48
|
-
confidential() {
|
|
49
|
-
var _this$toolParams9;
|
|
50
|
-
return (_this$toolParams9 = this.toolParams) === null || _this$toolParams9 === void 0 ? void 0 : _this$toolParams9.confidential;
|
|
51
|
-
},
|
|
52
|
-
workItemParentType() {
|
|
53
|
-
var _this$toolParams0, _this$toolParams1;
|
|
54
|
-
if ((_this$toolParams0 = this.toolParams) !== null && _this$toolParams0 !== void 0 && _this$toolParams0.projectId) {
|
|
55
|
-
return 'project';
|
|
56
|
-
}
|
|
57
|
-
if ((_this$toolParams1 = this.toolParams) !== null && _this$toolParams1 !== void 0 && _this$toolParams1.groupId) {
|
|
58
|
-
return 'group';
|
|
59
|
-
}
|
|
60
|
-
return 'resource';
|
|
61
|
-
},
|
|
62
|
-
workItemParentId() {
|
|
63
|
-
var _this$toolParams10, _this$toolParams11, _this$toolParams12;
|
|
64
|
-
return ((_this$toolParams10 = this.toolParams) === null || _this$toolParams10 === void 0 ? void 0 : _this$toolParams10.url) || ((_this$toolParams11 = this.toolParams) === null || _this$toolParams11 === void 0 ? void 0 : _this$toolParams11.groupId) || ((_this$toolParams12 = this.toolParams) === null || _this$toolParams12 === void 0 ? void 0 : _this$toolParams12.projectId);
|
|
65
|
-
},
|
|
66
|
-
noteParentIid() {
|
|
67
|
-
var _this$toolParams13, _this$toolParams14, _this$toolParams15, _this$toolParams16;
|
|
68
|
-
return ((_this$toolParams13 = this.toolParams) === null || _this$toolParams13 === void 0 ? void 0 : _this$toolParams13.issueIid) || ((_this$toolParams14 = this.toolParams) === null || _this$toolParams14 === void 0 ? void 0 : _this$toolParams14.mergeRequestIid) || ((_this$toolParams15 = this.toolParams) === null || _this$toolParams15 === void 0 ? void 0 : _this$toolParams15.workItemIid) || ((_this$toolParams16 = this.toolParams) === null || _this$toolParams16 === void 0 ? void 0 : _this$toolParams16.url);
|
|
69
|
-
},
|
|
70
|
-
noteParentLabel() {
|
|
71
|
-
switch (this.toolName) {
|
|
72
|
-
case APPROVAL_TOOL_NAMES.createMergeRequestNote:
|
|
73
|
-
return this.$options.i18n.MERGE_REQUEST_LABEL;
|
|
74
|
-
case APPROVAL_TOOL_NAMES.createWorkItemNote:
|
|
75
|
-
return this.$options.i18n.WORK_ITEM_LABEL;
|
|
76
|
-
case APPROVAL_TOOL_NAMES.createIssueNote:
|
|
77
|
-
return this.$options.i18n.ISSUE_LABEL;
|
|
78
|
-
default:
|
|
79
|
-
return '';
|
|
80
|
-
}
|
|
81
|
-
},
|
|
82
|
-
isNote() {
|
|
83
|
-
return [APPROVAL_TOOL_NAMES.createMergeRequestNote, APPROVAL_TOOL_NAMES.createWorkItemNote, APPROVAL_TOOL_NAMES.createIssueNote].includes(this.toolName);
|
|
84
|
-
},
|
|
85
|
-
message() {
|
|
86
|
-
let message = this.$options.i18n[this.toolName] || '';
|
|
87
|
-
const labelsMessage = this.$options.i18n.ASSIGN_LABELS_MESSAGE;
|
|
88
|
-
const branchMessage = this.$options.i18n.BRANCH_MESSAGE;
|
|
89
|
-
const confidentialMessage = this.$options.i18n.CONFIDENTIAL_MESSAGE;
|
|
90
|
-
if (this.title) {
|
|
91
|
-
message = `${message} ${this.$options.i18n.TITLE_MESSAGE}`;
|
|
92
|
-
}
|
|
93
|
-
if (this.sourceBranch && this.targetBranch) {
|
|
94
|
-
message = `${message} ${branchMessage}`;
|
|
95
|
-
}
|
|
96
|
-
if (this.labels) {
|
|
97
|
-
message = `${message} ${labelsMessage}`;
|
|
98
|
-
}
|
|
99
|
-
if (this.confidential) {
|
|
100
|
-
message = `${message} ${confidentialMessage}`;
|
|
101
|
-
}
|
|
102
|
-
return sprintf(message, {
|
|
103
|
-
project: this.project,
|
|
104
|
-
workItemParentType: this.workItemParentType,
|
|
105
|
-
workItemParentId: this.workItemParentId,
|
|
106
|
-
noteParentLabel: this.noteParentLabel,
|
|
107
|
-
noteParentIid: this.noteParentIid,
|
|
108
|
-
...this.toolParams
|
|
109
|
-
});
|
|
110
|
-
},
|
|
111
|
-
accordionTitle() {
|
|
112
|
-
return this.isNote ? this.$options.i18n.NOTE_ACCORDION_TITLE : '';
|
|
113
|
-
}
|
|
114
|
-
},
|
|
115
|
-
i18n: {
|
|
116
|
-
[APPROVAL_TOOL_NAMES.createIssue]: translate('IssuableToolParams.CREATE_ISSUE', 'Open an issue in project <code>%{project}</code>.'),
|
|
117
|
-
[APPROVAL_TOOL_NAMES.updateIssue]: translate('IssuableToolParams.UPDATE_ISSUE', 'Update issue <code>%{issueIid}</code> in project <code>%{project}</code>.'),
|
|
118
|
-
[APPROVAL_TOOL_NAMES.createEpic]: translate('IssuableToolParams.CREATE_EPIC', 'Create an epic in group <code>%{groupId}</code>.'),
|
|
119
|
-
[APPROVAL_TOOL_NAMES.updateEpic]: translate('IssuableToolParams.UPDATE_EPIC', 'Update epic <code>%{epicId}</code> in group <code>%{groupId}</code>.'),
|
|
120
|
-
[APPROVAL_TOOL_NAMES.createWorkItem]: translate('IssuableToolParams.CREATE_WORK_ITEM', 'Create a work item with type <em>"%{typeName}"</em> in %{workItemParentType} <code>%{workItemParentId}</code>.'),
|
|
121
|
-
[APPROVAL_TOOL_NAMES.updateWorkItem]: translate('IssuableToolParams.UPDATE_WORK_ITEM', 'Update work item <code>%{workItemIid}</code> in %{workItemParentType} <code>%{workItemParentId}</code>.'),
|
|
122
|
-
[APPROVAL_TOOL_NAMES.createMergeRequest]: translate('IssuableToolParams.CREATE_MERGE_REQUEST', 'Open a merge request in project <code>%{project}</code>.'),
|
|
123
|
-
[APPROVAL_TOOL_NAMES.updateMergeRequest]: translate('IssuableToolParams.UPDATE_MERGE_REQUEST', 'Update merge request <code>%{mergeRequestIid}</code> in project <code>%{project}</code>.'),
|
|
124
|
-
[APPROVAL_TOOL_NAMES.createMergeRequestNote]: NOTE_MESSAGE,
|
|
125
|
-
[APPROVAL_TOOL_NAMES.createWorkItemNote]: NOTE_MESSAGE,
|
|
126
|
-
[APPROVAL_TOOL_NAMES.createIssueNote]: NOTE_MESSAGE,
|
|
127
|
-
TITLE_MESSAGE: translate('IssuableToolParams.TITLE_MESSAGE', 'Set the title "<em>%{title}</em>".'),
|
|
128
|
-
BRANCH_MESSAGE: translate('IssuableToolParams.BRANCH_MESSAGE', 'From branch <code>%{sourceBranch}</code> to branch <code>%{targetBranch}</code>.'),
|
|
129
|
-
ASSIGN_LABELS_MESSAGE: translate('IssuableToolParams.ASSIGN_LABELS_MESSAGE', 'Assign the labels <code>%{labels}</code>.'),
|
|
130
|
-
CONFIDENTIAL_MESSAGE: translate('IssuableToolParams.CONFIDENTIAL_MESSAGE', 'Set as confidential.'),
|
|
131
|
-
MERGE_REQUEST_LABEL: translate('IssuableToolParams.MERGE_REQUEST_LABEL', 'merge request'),
|
|
132
|
-
ISSUE_LABEL: translate('IssuableToolParams.ISSUE_LABEL', 'issue'),
|
|
133
|
-
WORK_ITEM_LABEL: translate('IssuableToolParams.WORK_ITEM_LABEL', 'work item'),
|
|
134
|
-
NOTE_ACCORDION_TITLE: translate('IssuableToolParams.NOTE_ACCORDION_TITLE', "Read note's content")
|
|
135
|
-
}
|
|
136
|
-
};
|
|
137
|
-
|
|
138
|
-
/* script */
|
|
139
|
-
const __vue_script__ = script;
|
|
140
|
-
|
|
141
|
-
/* template */
|
|
142
|
-
var __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('base-tool-params',{attrs:{"message":_vm.message,"description":_vm.description,"custom-accordion-title":_vm.accordionTitle}})};
|
|
143
|
-
var __vue_staticRenderFns__ = [];
|
|
144
|
-
|
|
145
|
-
/* style */
|
|
146
|
-
const __vue_inject_styles__ = undefined;
|
|
147
|
-
/* scoped */
|
|
148
|
-
const __vue_scope_id__ = undefined;
|
|
149
|
-
/* module identifier */
|
|
150
|
-
const __vue_module_identifier__ = undefined;
|
|
151
|
-
/* functional template */
|
|
152
|
-
const __vue_is_functional_template__ = false;
|
|
153
|
-
/* style inject */
|
|
154
|
-
|
|
155
|
-
/* style inject SSR */
|
|
156
|
-
|
|
157
|
-
/* style inject shadow dom */
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
const __vue_component__ = __vue_normalize__(
|
|
162
|
-
{ render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },
|
|
163
|
-
__vue_inject_styles__,
|
|
164
|
-
__vue_script__,
|
|
165
|
-
__vue_scope_id__,
|
|
166
|
-
__vue_is_functional_template__,
|
|
167
|
-
__vue_module_identifier__,
|
|
168
|
-
false,
|
|
169
|
-
undefined,
|
|
170
|
-
undefined,
|
|
171
|
-
undefined
|
|
172
|
-
);
|
|
173
|
-
|
|
174
|
-
export default __vue_component__;
|