@gitlab/duo-ui 8.13.2 → 8.14.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 +7 -0
- package/dist/components/chat/components/duo_chat_conversation/duo_chat_conversation.js +4 -1
- package/dist/components/chat/components/duo_chat_message/duo_chat_message.js +30 -10
- package/dist/components/chat/components/duo_chat_message/message_types/index.js +13 -0
- package/dist/components/chat/components/duo_chat_message/message_types/message_agent.js +61 -0
- package/dist/components/chat/components/duo_chat_message/message_types/message_base.js +103 -0
- package/dist/components/chat/components/duo_chat_message/message_types/message_input_requested.js +53 -0
- package/dist/components/chat/components/duo_chat_message/message_types/message_tool.js +77 -0
- package/dist/components/chat/components/duo_chat_message/message_types/message_workflow_end.js +59 -0
- package/dist/components/chat/constants.js +4 -1
- package/dist/components/chat/duo_chat.js +8 -1
- package/dist/components/chat/mock_data.js +26 -1
- package/dist/tailwind.css +1 -1
- package/dist/tailwind.css.map +1 -1
- package/package.json +1 -1
- package/src/components/chat/components/duo_chat_conversation/duo_chat_conversation.vue +4 -0
- package/src/components/chat/components/duo_chat_message/duo_chat_message.vue +129 -93
- package/src/components/chat/components/duo_chat_message/message_types/index.js +11 -0
- package/src/components/chat/components/duo_chat_message/message_types/message_agent.vue +34 -0
- package/src/components/chat/components/duo_chat_message/message_types/message_base.vue +84 -0
- package/src/components/chat/components/duo_chat_message/message_types/message_input_requested.vue +19 -0
- package/src/components/chat/components/duo_chat_message/message_types/message_tool.vue +52 -0
- package/src/components/chat/components/duo_chat_message/message_types/message_workflow_end.vue +32 -0
- package/src/components/chat/constants.js +3 -0
- package/src/components/chat/duo_chat.vue +8 -0
- package/src/components/chat/mock_data.js +30 -0
package/src/components/chat/components/duo_chat_message/message_types/message_workflow_end.vue
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script>
|
|
2
|
+
import { GlButton } from '@gitlab/ui';
|
|
3
|
+
import AgentMessage from './message_agent.vue';
|
|
4
|
+
|
|
5
|
+
export const WORKFLOW_NEW_APP = 'workflow-new';
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
name: 'DuoChatWorkflowEndMessage',
|
|
9
|
+
components: {
|
|
10
|
+
AgentMessage,
|
|
11
|
+
GlButton,
|
|
12
|
+
},
|
|
13
|
+
workflowEndMessage: {
|
|
14
|
+
content:
|
|
15
|
+
"Review the changes. To improve the implementation, create another workflow and describe the specific changes you'd like to see.",
|
|
16
|
+
},
|
|
17
|
+
newRoute: {
|
|
18
|
+
name: WORKFLOW_NEW_APP,
|
|
19
|
+
},
|
|
20
|
+
};
|
|
21
|
+
</script>
|
|
22
|
+
<template>
|
|
23
|
+
<agent-message :message="$options.workflowEndMessage">
|
|
24
|
+
<template #message="{ content }">
|
|
25
|
+
<p>
|
|
26
|
+
{{ content }}
|
|
27
|
+
</p>
|
|
28
|
+
|
|
29
|
+
<gl-button :to="$options.newRoute" class="gl-mt-4">New workflow</gl-button>
|
|
30
|
+
</template>
|
|
31
|
+
</agent-message>
|
|
32
|
+
</template>
|
|
@@ -678,6 +678,13 @@ export default {
|
|
|
678
678
|
*/
|
|
679
679
|
this.$emit('delete-thread', threadId);
|
|
680
680
|
},
|
|
681
|
+
onOpenFilePath(filePath) {
|
|
682
|
+
/**
|
|
683
|
+
* Emitted when a file path link is clicked in a chat message.
|
|
684
|
+
* @param {String} filePath The file path to open
|
|
685
|
+
*/
|
|
686
|
+
this.$emit('open-file-path', filePath);
|
|
687
|
+
},
|
|
681
688
|
},
|
|
682
689
|
i18n,
|
|
683
690
|
};
|
|
@@ -767,6 +774,7 @@ export default {
|
|
|
767
774
|
@copy-code-snippet="onCopyCodeSnippet"
|
|
768
775
|
@copy-message="onCopyMessage"
|
|
769
776
|
@get-context-item-content="onGetContextItemContent"
|
|
777
|
+
@open-file-path="onOpenFilePath"
|
|
770
778
|
/>
|
|
771
779
|
<template v-if="!hasMessages && !isLoading">
|
|
772
780
|
<div
|
|
@@ -44,6 +44,36 @@ export const MOCK_RESPONSE_MESSAGE = {
|
|
|
44
44
|
timestamp: '2021-04-21T12:00:00.000Z',
|
|
45
45
|
};
|
|
46
46
|
|
|
47
|
+
export const MOCK_TOOL_MESSAGE = {
|
|
48
|
+
id: '123',
|
|
49
|
+
content: "Search for 'duo.*chat.*message' in directory",
|
|
50
|
+
message_type: MESSAGE_MODEL_ROLES.tool,
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export const MOCK_TOOL_MESSAGE_WITH_LINK = {
|
|
54
|
+
id: '123',
|
|
55
|
+
content: "Search for 'duo.*chat.*message' in directory",
|
|
56
|
+
message_type: MESSAGE_MODEL_ROLES.tool,
|
|
57
|
+
tool_info: {
|
|
58
|
+
args: {
|
|
59
|
+
file_path: '/path/to/file.js',
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export const MOCK_REQUEST_MESSAGE = {
|
|
65
|
+
id: '123',
|
|
66
|
+
content:
|
|
67
|
+
'On the left, review the proposed plan. Then ask questions or request changes. To execute the plan, select Approve plan.',
|
|
68
|
+
message_type: MESSAGE_MODEL_ROLES.request,
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export const MOCK_WORKFLOW_END_MESSAGE = {
|
|
72
|
+
id: '123',
|
|
73
|
+
content: "Search for 'duo.*chat.*message' in directory",
|
|
74
|
+
message_type: MESSAGE_MODEL_ROLES.workflow_end,
|
|
75
|
+
};
|
|
76
|
+
|
|
47
77
|
export const generateSeparateChunks = (n) => {
|
|
48
78
|
const res = [];
|
|
49
79
|
for (let i = 1; i <= n; i += 1) {
|