@gitlab/duo-ui 15.8.2 → 15.8.3
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 +7 -0
- package/dist/components/chat/components/duo_chat_message/message_types/message_tool.js +14 -2
- package/dist/components/chat/components/duo_chat_message_tool_approval/components/run_command_tool_params.js +13 -3
- package/dist/components/chat/mock_data.js +16 -1
- package/package.json +2 -2
- package/src/components/chat/components/duo_chat_message/message_types/message_tool.vue +15 -1
- package/src/components/chat/components/duo_chat_message_tool_approval/components/run_command_tool_params.vue +14 -2
- package/src/components/chat/mock_data.js +15 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [15.8.3](https://gitlab.com/gitlab-org/duo-ui/compare/v15.8.2...v15.8.3) (2026-02-02)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* Show run command error output ([672bfd2](https://gitlab.com/gitlab-org/duo-ui/commit/672bfd221d1526403a767fa42b79092907b0837d))
|
|
7
|
+
|
|
1
8
|
## [15.8.2](https://gitlab.com/gitlab-org/duo-ui/compare/v15.8.1...v15.8.2) (2026-01-30)
|
|
2
9
|
|
|
3
10
|
|
|
@@ -138,8 +138,20 @@ var script = {
|
|
|
138
138
|
return (_this$message$tool_in4 = this.message.tool_info) === null || _this$message$tool_in4 === void 0 ? void 0 : _this$message$tool_in4.name;
|
|
139
139
|
},
|
|
140
140
|
toolResponseContent() {
|
|
141
|
-
var _this$message$tool_in5
|
|
142
|
-
|
|
141
|
+
var _this$message$tool_in5;
|
|
142
|
+
const toolResponse = (_this$message$tool_in5 = this.message.tool_info) === null || _this$message$tool_in5 === void 0 ? void 0 : _this$message$tool_in5.tool_response;
|
|
143
|
+
if (!toolResponse) return '';
|
|
144
|
+
|
|
145
|
+
// Handle object format with content property
|
|
146
|
+
if (typeof toolResponse === 'object' && toolResponse.content) {
|
|
147
|
+
return toolResponse.content;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
// Handle string format (error case)
|
|
151
|
+
if (typeof toolResponse === 'string') {
|
|
152
|
+
return toolResponse;
|
|
153
|
+
}
|
|
154
|
+
return '';
|
|
143
155
|
},
|
|
144
156
|
collapseIconName() {
|
|
145
157
|
return this.isDetailsOpen ? 'chevron-down' : 'chevron-right';
|
|
@@ -31,7 +31,7 @@ var script = {
|
|
|
31
31
|
default: ''
|
|
32
32
|
},
|
|
33
33
|
toolResponse: {
|
|
34
|
-
type: Object,
|
|
34
|
+
type: [Object, String],
|
|
35
35
|
required: false,
|
|
36
36
|
default: null
|
|
37
37
|
},
|
|
@@ -54,8 +54,18 @@ var script = {
|
|
|
54
54
|
return (_this$workingDirector = this.workingDirectory) !== null && _this$workingDirector !== void 0 && _this$workingDirector.length ? `${this.workingDirectory}> ${this.formattedCommand}` : this.formattedCommand;
|
|
55
55
|
},
|
|
56
56
|
commandOutput() {
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
if (!this.toolResponse) return '';
|
|
58
|
+
|
|
59
|
+
// Handle object format with content property
|
|
60
|
+
if (typeof this.toolResponse === 'object' && this.toolResponse.content) {
|
|
61
|
+
return this.toolResponse.content;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Handle string format (error case)
|
|
65
|
+
if (typeof this.toolResponse === 'string') {
|
|
66
|
+
return this.toolResponse;
|
|
67
|
+
}
|
|
68
|
+
return '';
|
|
59
69
|
}
|
|
60
70
|
},
|
|
61
71
|
i18n: {
|
|
@@ -260,6 +260,21 @@ const MOCK_REQUEST_MESSAGE_WITH_TOOL_APPROVAL_RUN_COMMAND_WITH_RESPONSE = {
|
|
|
260
260
|
status: 'success',
|
|
261
261
|
role: 'request'
|
|
262
262
|
};
|
|
263
|
+
const MOCK_REQUEST_MESSAGE_WITH_TOOL_APPROVAL_RUN_COMMAND_WITH_ERROR_RESPONSE = {
|
|
264
|
+
id: '126',
|
|
265
|
+
content: 'Tool run_command requires approval. Please confirm if you want to proceed.',
|
|
266
|
+
message_type: MESSAGE_MODEL_ROLES.request,
|
|
267
|
+
tool_info: {
|
|
268
|
+
args: {
|
|
269
|
+
program: 'nonexistingcommand'
|
|
270
|
+
},
|
|
271
|
+
name: 'run_command',
|
|
272
|
+
tool_response: 'Tool run_command raised ToolException: Action error: Process exited with code 127 \u001b]633;C\u0007zsh: command not found: nonexistingcommand\r\n\u001b[1m\u001b[7m%\u001b[27m\u001b[1m\u001b[0m'
|
|
273
|
+
},
|
|
274
|
+
timestamp: '2025-06-25T19:22:21.290791+00:00',
|
|
275
|
+
status: 'failure',
|
|
276
|
+
role: 'request'
|
|
277
|
+
};
|
|
263
278
|
const MOCK_REQUEST_MESSAGE_WITH_TOOL_APPROVAL_RUN_GIT_COMMAND = {
|
|
264
279
|
status: 'success',
|
|
265
280
|
content: 'Tool run_git_command requires approval. Please confirm if you want to proceed.',
|
|
@@ -813,4 +828,4 @@ const AGENTIC_THREADLIST = [{
|
|
|
813
828
|
}
|
|
814
829
|
}];
|
|
815
830
|
|
|
816
|
-
export { AGENTIC_THREADLIST, INCLUDE_SLASH_COMMAND, MOCK_AGENT_MESSAGE, MOCK_AGENT_MESSAGE_WITH_LONG_CODE_BLOCK, MOCK_AGENT_MESSAGE_WITH_MARKDOWN, MOCK_REQUEST_MESSAGE, MOCK_REQUEST_MESSAGE_WITH_TOOL_APPROVAL, MOCK_REQUEST_MESSAGE_WITH_TOOL_APPROVAL_CREATE_COMMIT, MOCK_REQUEST_MESSAGE_WITH_TOOL_APPROVAL_CREATE_COMMIT_AUTO_BRANCH, MOCK_REQUEST_MESSAGE_WITH_TOOL_APPROVAL_CREATE_COMMIT_MESSAGE_ONLY, MOCK_REQUEST_MESSAGE_WITH_TOOL_APPROVAL_CREATE_COMMIT_OLD_NEW_CONTENT, MOCK_REQUEST_MESSAGE_WITH_TOOL_APPROVAL_CREATE_EPIC, MOCK_REQUEST_MESSAGE_WITH_TOOL_APPROVAL_CREATE_ISSUE, MOCK_REQUEST_MESSAGE_WITH_TOOL_APPROVAL_CREATE_ISSUE_NOTE, MOCK_REQUEST_MESSAGE_WITH_TOOL_APPROVAL_CREATE_MERGE_REQUEST, MOCK_REQUEST_MESSAGE_WITH_TOOL_APPROVAL_CREATE_MERGE_REQUEST_NOTE, MOCK_REQUEST_MESSAGE_WITH_TOOL_APPROVAL_CREATE_WORK_ITEM, MOCK_REQUEST_MESSAGE_WITH_TOOL_APPROVAL_CREATE_WORK_ITEM_NOTE, MOCK_REQUEST_MESSAGE_WITH_TOOL_APPROVAL_PARAMS, MOCK_REQUEST_MESSAGE_WITH_TOOL_APPROVAL_RUN_COMMAND, MOCK_REQUEST_MESSAGE_WITH_TOOL_APPROVAL_RUN_COMMAND_WITH_RESPONSE, MOCK_REQUEST_MESSAGE_WITH_TOOL_APPROVAL_RUN_GIT_COMMAND, MOCK_REQUEST_MESSAGE_WITH_TOOL_APPROVAL_UPDATE_ISSUE, MOCK_REQUEST_MESSAGE_WITH_TOOL_APPROVAL_UPDATE_MERGE_REQUEST, MOCK_REQUEST_MESSAGE_WITH_TOOL_APPROVAL_UPDATE_WORK_ITEM, MOCK_RESPONSE_MESSAGE, MOCK_RESPONSE_MESSAGE_FOR_STREAMING, MOCK_TOOL_MESSAGE, MOCK_TOOL_MESSAGE_WITH_LINK, MOCK_TOOL_MESSAGE_WITH_REQUEST_AND_RESPONSE_DETAILS, MOCK_USER_PROMPT_MESSAGE, MOCK_WORKFLOW_END_MESSAGE, SLASH_COMMANDS, THREADLIST, generateMockResponseChunks, generateSeparateChunks, renderGFM, renderMarkdown };
|
|
831
|
+
export { AGENTIC_THREADLIST, INCLUDE_SLASH_COMMAND, MOCK_AGENT_MESSAGE, MOCK_AGENT_MESSAGE_WITH_LONG_CODE_BLOCK, MOCK_AGENT_MESSAGE_WITH_MARKDOWN, MOCK_REQUEST_MESSAGE, MOCK_REQUEST_MESSAGE_WITH_TOOL_APPROVAL, MOCK_REQUEST_MESSAGE_WITH_TOOL_APPROVAL_CREATE_COMMIT, MOCK_REQUEST_MESSAGE_WITH_TOOL_APPROVAL_CREATE_COMMIT_AUTO_BRANCH, MOCK_REQUEST_MESSAGE_WITH_TOOL_APPROVAL_CREATE_COMMIT_MESSAGE_ONLY, MOCK_REQUEST_MESSAGE_WITH_TOOL_APPROVAL_CREATE_COMMIT_OLD_NEW_CONTENT, MOCK_REQUEST_MESSAGE_WITH_TOOL_APPROVAL_CREATE_EPIC, MOCK_REQUEST_MESSAGE_WITH_TOOL_APPROVAL_CREATE_ISSUE, MOCK_REQUEST_MESSAGE_WITH_TOOL_APPROVAL_CREATE_ISSUE_NOTE, MOCK_REQUEST_MESSAGE_WITH_TOOL_APPROVAL_CREATE_MERGE_REQUEST, MOCK_REQUEST_MESSAGE_WITH_TOOL_APPROVAL_CREATE_MERGE_REQUEST_NOTE, MOCK_REQUEST_MESSAGE_WITH_TOOL_APPROVAL_CREATE_WORK_ITEM, MOCK_REQUEST_MESSAGE_WITH_TOOL_APPROVAL_CREATE_WORK_ITEM_NOTE, MOCK_REQUEST_MESSAGE_WITH_TOOL_APPROVAL_PARAMS, MOCK_REQUEST_MESSAGE_WITH_TOOL_APPROVAL_RUN_COMMAND, MOCK_REQUEST_MESSAGE_WITH_TOOL_APPROVAL_RUN_COMMAND_WITH_ERROR_RESPONSE, MOCK_REQUEST_MESSAGE_WITH_TOOL_APPROVAL_RUN_COMMAND_WITH_RESPONSE, MOCK_REQUEST_MESSAGE_WITH_TOOL_APPROVAL_RUN_GIT_COMMAND, MOCK_REQUEST_MESSAGE_WITH_TOOL_APPROVAL_UPDATE_ISSUE, MOCK_REQUEST_MESSAGE_WITH_TOOL_APPROVAL_UPDATE_MERGE_REQUEST, MOCK_REQUEST_MESSAGE_WITH_TOOL_APPROVAL_UPDATE_WORK_ITEM, MOCK_RESPONSE_MESSAGE, MOCK_RESPONSE_MESSAGE_FOR_STREAMING, MOCK_TOOL_MESSAGE, MOCK_TOOL_MESSAGE_WITH_LINK, MOCK_TOOL_MESSAGE_WITH_REQUEST_AND_RESPONSE_DETAILS, MOCK_USER_PROMPT_MESSAGE, MOCK_WORKFLOW_END_MESSAGE, SLASH_COMMANDS, THREADLIST, generateMockResponseChunks, generateSeparateChunks, renderGFM, renderMarkdown };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gitlab/duo-ui",
|
|
3
|
-
"version": "15.8.
|
|
3
|
+
"version": "15.8.3",
|
|
4
4
|
"description": "Duo UI Components",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -105,7 +105,7 @@
|
|
|
105
105
|
"@gitlab/fonts": "^1.3.1",
|
|
106
106
|
"@gitlab/stylelint-config": "6.2.2",
|
|
107
107
|
"@gitlab/svgs": "^3.154.0",
|
|
108
|
-
"@gitlab/ui": "^128.
|
|
108
|
+
"@gitlab/ui": "^128.6.0",
|
|
109
109
|
"@jest/test-sequencer": "^29.7.0",
|
|
110
110
|
"@rollup/plugin-commonjs": "^11.1.0",
|
|
111
111
|
"@rollup/plugin-node-resolve": "^7.1.3",
|
|
@@ -134,7 +134,21 @@ export default {
|
|
|
134
134
|
return this.message.tool_info?.name;
|
|
135
135
|
},
|
|
136
136
|
toolResponseContent() {
|
|
137
|
-
|
|
137
|
+
const toolResponse = this.message.tool_info?.tool_response;
|
|
138
|
+
|
|
139
|
+
if (!toolResponse) return '';
|
|
140
|
+
|
|
141
|
+
// Handle object format with content property
|
|
142
|
+
if (typeof toolResponse === 'object' && toolResponse.content) {
|
|
143
|
+
return toolResponse.content;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
// Handle string format (error case)
|
|
147
|
+
if (typeof toolResponse === 'string') {
|
|
148
|
+
return toolResponse;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
return '';
|
|
138
152
|
},
|
|
139
153
|
collapseIconName() {
|
|
140
154
|
return this.isDetailsOpen ? 'chevron-down' : 'chevron-right';
|
|
@@ -31,7 +31,7 @@ export default {
|
|
|
31
31
|
default: '',
|
|
32
32
|
},
|
|
33
33
|
toolResponse: {
|
|
34
|
-
type: Object,
|
|
34
|
+
type: [Object, String],
|
|
35
35
|
required: false,
|
|
36
36
|
default: null,
|
|
37
37
|
},
|
|
@@ -55,7 +55,19 @@ export default {
|
|
|
55
55
|
: this.formattedCommand;
|
|
56
56
|
},
|
|
57
57
|
commandOutput() {
|
|
58
|
-
|
|
58
|
+
if (!this.toolResponse) return '';
|
|
59
|
+
|
|
60
|
+
// Handle object format with content property
|
|
61
|
+
if (typeof this.toolResponse === 'object' && this.toolResponse.content) {
|
|
62
|
+
return this.toolResponse.content;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
// Handle string format (error case)
|
|
66
|
+
if (typeof this.toolResponse === 'string') {
|
|
67
|
+
return this.toolResponse;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
return '';
|
|
59
71
|
},
|
|
60
72
|
},
|
|
61
73
|
i18n: {
|
|
@@ -296,6 +296,21 @@ export const MOCK_REQUEST_MESSAGE_WITH_TOOL_APPROVAL_RUN_COMMAND_WITH_RESPONSE =
|
|
|
296
296
|
role: 'request',
|
|
297
297
|
};
|
|
298
298
|
|
|
299
|
+
export const MOCK_REQUEST_MESSAGE_WITH_TOOL_APPROVAL_RUN_COMMAND_WITH_ERROR_RESPONSE = {
|
|
300
|
+
id: '126',
|
|
301
|
+
content: 'Tool run_command requires approval. Please confirm if you want to proceed.',
|
|
302
|
+
message_type: MESSAGE_MODEL_ROLES.request,
|
|
303
|
+
tool_info: {
|
|
304
|
+
args: { program: 'nonexistingcommand' },
|
|
305
|
+
name: 'run_command',
|
|
306
|
+
tool_response:
|
|
307
|
+
'Tool run_command raised ToolException: Action error: Process exited with code 127 \u001b]633;C\u0007zsh: command not found: nonexistingcommand\r\n\u001b[1m\u001b[7m%\u001b[27m\u001b[1m\u001b[0m',
|
|
308
|
+
},
|
|
309
|
+
timestamp: '2025-06-25T19:22:21.290791+00:00',
|
|
310
|
+
status: 'failure',
|
|
311
|
+
role: 'request',
|
|
312
|
+
};
|
|
313
|
+
|
|
299
314
|
export const MOCK_REQUEST_MESSAGE_WITH_TOOL_APPROVAL_RUN_GIT_COMMAND = {
|
|
300
315
|
status: 'success',
|
|
301
316
|
content: 'Tool run_git_command requires approval. Please confirm if you want to proceed.',
|