From f198428eb472f0f4f678d4cca390359c30901d03 Mon Sep 17 00:00:00 2001 From: Nemo Godebski-Pedersen Date: Fri, 23 May 2025 11:46:41 +0700 Subject: [PATCH 1/6] simplify json editor --- src/components/Preview.vue | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/Preview.vue b/src/components/Preview.vue index 76fbb9d..cf8f081 100644 --- a/src/components/Preview.vue +++ b/src/components/Preview.vue @@ -296,9 +296,10 @@ const onError = (error) => { From d3f51a9716f075c46c7c11e513f2ef70c639592d Mon Sep 17 00:00:00 2001 From: Hongwei Date: Thu, 7 Aug 2025 12:58:53 +0200 Subject: [PATCH 2/6] Remove 'kafka_vSept2018' connector from StatusController and message-docs --- server/controllers/StatusController.ts | 1 - src/obp/message-docs.ts | 1 - 2 files changed, 2 deletions(-) diff --git a/server/controllers/StatusController.ts b/server/controllers/StatusController.ts index 5bc2133..22018db 100644 --- a/server/controllers/StatusController.ts +++ b/server/controllers/StatusController.ts @@ -38,7 +38,6 @@ import { commitId } from '../app' export class StatusController { private obpExplorerHome = process.env.VITE_OBP_API_EXPLORER_HOST private connectors = [ - 'kafka_vSept2018', 'akka_vDec2018', 'rest_vMar2019', 'stored_procedure_vDec2019', diff --git a/src/obp/message-docs.ts b/src/obp/message-docs.ts index c78c260..b67c6ec 100644 --- a/src/obp/message-docs.ts +++ b/src/obp/message-docs.ts @@ -29,7 +29,6 @@ import { OBP_API_VERSION, get, isServerUp } from '../obp' import { updateLoadingInfoMessage } from './common-functions' export const connectors = [ - 'kafka_vSept2018', 'akka_vDec2018', 'rest_vMar2019', 'stored_procedure_vDec2019', From e9c6de110553795eb11e09e90607ffd2c1d1fa84 Mon Sep 17 00:00:00 2001 From: Hongwei Date: Mon, 11 Aug 2025 17:23:50 +0200 Subject: [PATCH 3/6] Enhance chat store to support new API message types and improve legacy handling. Added support for assistant token streaming, tool lifecycle events, and approval requests. --- src/stores/chat.ts | 45 ++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 3 deletions(-) diff --git a/src/stores/chat.ts b/src/stores/chat.ts index 44a62af..5f03ebe 100644 --- a/src/stores/chat.ts +++ b/src/stores/chat.ts @@ -284,7 +284,8 @@ export const useChat = defineStore('chat', { // This is where we process different types of messages from Opey by their 'type' field - // Process pending tool calls + // Support both legacy ('message','tool','token') and new streaming types + // Pending tool calls (legacy) if (data.type === 'message') { if (content.tool_approval_request) { @@ -310,7 +311,7 @@ export const useChat = defineStore('chat', { } } - // Now we handle the actual messages from the completed/ failed tool calls + // Now we handle the actual messages from the completed/ failed tool calls (legacy) if (data.type === 'tool') { const toolCallId = content.tool_call_id; if (!toolCallId) { @@ -336,13 +337,51 @@ export const useChat = defineStore('chat', { } - if (data.type === 'token' && data.content) { + // Assistant token streaming (legacy and new) + if ((data.type === 'token' || data.type === 'assistant_token') && data.content) { this.currentAssistantMessage.loading = false; // Append content to the current assistant message this.currentAssistantMessage.content += data.content; // Force Vue to detect the change this.messages = [...this.messages]; } + + // Assistant final content (new API emits assistant_complete) + if (data.type === 'assistant_complete' && data.content) { + this.currentAssistantMessage.loading = false; + this.currentAssistantMessage.content += data.content; + this.messages = [...this.messages]; + } + + // New API: Tool lifecycle events mapping to UI model + if (data.type === 'tool_start') { + const toolMessage: OpeyToolCall = { + status: 'pending', + toolCall: { + id: data.tool_call_id, + name: data.tool_name, + args: data.tool_input, + } + } as unknown as OpeyToolCall; + this.currentAssistantMessage.toolCalls.push(toolMessage) + this.messages = [...this.messages]; + } + if (data.type === 'tool_end') { + const toolMessage = this.getToolCallById(data.tool_call_id) + if (toolMessage) { + toolMessage.status = data.status === 'error' ? 'error' : 'success' + toolMessage.output = data.tool_output + this.messages = [...this.messages]; + } + } + if (data.type === 'approval_request') { + // Mark awaiting approval on matched tool call if present + const toolMessage = this.getToolCallById(data.tool_call_id) + if (toolMessage) { + toolMessage.status = 'awaiting_approval' + this.messages = [...this.messages]; + } + } } catch (e) { throw new Error(`${e}`); } From cd1d5c8ec39b60dbfe7d8f93893cae76fe7bdc29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marko=20Mili=C4=87?= Date: Mon, 11 Aug 2025 15:36:23 +0200 Subject: [PATCH 4/6] bugfix/MAke Opey widget recevite responses at GUI --- src/stores/chat.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/stores/chat.ts b/src/stores/chat.ts index 5f03ebe..3ba8256 100644 --- a/src/stores/chat.ts +++ b/src/stores/chat.ts @@ -337,8 +337,7 @@ export const useChat = defineStore('chat', { } - // Assistant token streaming (legacy and new) - if ((data.type === 'token' || data.type === 'assistant_token') && data.content) { + if (data.type === 'assistant_complete' && data.content) { this.currentAssistantMessage.loading = false; // Append content to the current assistant message this.currentAssistantMessage.content += data.content; From 7487c89d6e978e22a6f115dec7574c347d4ecde5 Mon Sep 17 00:00:00 2001 From: Nemo Godebski-Pedersen Date: Tue, 30 Sep 2025 19:56:00 +0700 Subject: [PATCH 5/6] fix message docs WIP --- components.d.ts | 4 + src/components/CodeBlock.vue | 149 +++++++++++++++++++++++++++++++ src/router/index.ts | 3 +- src/views/MessageDocsView.vue | 161 +++++++++++++++++++++++----------- 4 files changed, 267 insertions(+), 50 deletions(-) create mode 100644 src/components/CodeBlock.vue diff --git a/components.d.ts b/components.d.ts index 1813313..680c1d0 100644 --- a/components.d.ts +++ b/components.d.ts @@ -11,6 +11,7 @@ declare module 'vue' { ChatMessage: typeof import('./src/components/ChatMessage.vue')['default'] ChatWidget: typeof import('./src/components/ChatWidget.vue')['default'] ChatWidgetOld: typeof import('./src/components/ChatWidgetOld.vue')['default'] + CodeBlock: typeof import('./src/components/CodeBlock.vue')['default'] Collections: typeof import('./src/components/Collections.vue')['default'] Content: typeof import('./src/components/Content.vue')['default'] ElAlert: typeof import('element-plus/es')['ElAlert'] @@ -21,6 +22,7 @@ declare module 'vue' { ElCollapse: typeof import('element-plus/es')['ElCollapse'] ElCollapseItem: typeof import('element-plus/es')['ElCollapseItem'] ElContainer: typeof import('element-plus/es')['ElContainer'] + ElContainter: typeof import('element-plus/es')['ElContainter'] ElDescriptions: typeof import('element-plus/es')['ElDescriptions'] ElDescriptionsItem: typeof import('element-plus/es')['ElDescriptionsItem'] ElDivider: typeof import('element-plus/es')['ElDivider'] @@ -38,10 +40,12 @@ declare module 'vue' { ElMenuItem: typeof import('element-plus/es')['ElMenuItem'] ElRow: typeof import('element-plus/es')['ElRow'] ElScrollbar: typeof import('element-plus/es')['ElScrollbar'] + ElTag: typeof import('element-plus/es')['ElTag'] ElTooltip: typeof import('element-plus/es')['ElTooltip'] GlossarySearchNav: typeof import('./src/components/GlossarySearchNav.vue')['default'] HeaderNav: typeof import('./src/components/HeaderNav.vue')['default'] Menu: typeof import('./src/components/Menu.vue')['default'] + MessageDocsContent: typeof import('./src/components/MessageDocsContent.vue')['default'] MessageDocsSearchNav: typeof import('./src/components/MessageDocsSearchNav.vue')['default'] Preview: typeof import('./src/components/Preview.vue')['default'] RouterLink: typeof import('vue-router')['RouterLink'] diff --git a/src/components/CodeBlock.vue b/src/components/CodeBlock.vue new file mode 100644 index 0000000..50183c0 --- /dev/null +++ b/src/components/CodeBlock.vue @@ -0,0 +1,149 @@ + + + + + + + \ No newline at end of file diff --git a/src/router/index.ts b/src/router/index.ts index 8675f9b..07cf1c0 100644 --- a/src/router/index.ts +++ b/src/router/index.ts @@ -36,6 +36,7 @@ import InternalServerErrorView from '../views/InternalServerErrorView.vue' import APIServerErrorView from '../views/APIServerErrorView.vue' import APIServerStatusView from '../views/APIServerStatusView.vue' import { isServerUp } from '../obp' +import MessageDocsContent from '@/components/CodeBlock.vue' export default async function router(): Promise { const isServerActive = await isServerUp() @@ -60,7 +61,7 @@ export default async function router(): Promise { { path: '/message-docs/:id', name: 'message-docs', - component: isServerActive ? MessageDocsView : InternalServerErrorView + component: isServerActive ? MessageDocsView : InternalServerErrorView, }, { path: '/operationid', diff --git a/src/views/MessageDocsView.vue b/src/views/MessageDocsView.vue index 20b5659..8895f04 100644 --- a/src/views/MessageDocsView.vue +++ b/src/views/MessageDocsView.vue @@ -31,12 +31,16 @@ import { useRoute } from 'vue-router' import SearchNav from '../components/MessageDocsSearchNav.vue' import { connectors } from '../obp/message-docs' import { obpGroupedMessageDocsKey } from '@/obp/keys'; +import MessageDocsSearchNav from '../components/MessageDocsSearchNav.vue'; +import CodeBlock from '../components/CodeBlock.vue'; let connector = connectors[0] const route = useRoute() const groupedMessageDocs = ref(inject(obpGroupedMessageDocsKey)!) const messageDocs = ref({}) +const activeNames = ref(['1', '2', '3', '4', '5', '6']) + onBeforeMount(() => { setDoc() }) @@ -64,68 +68,126 @@ function showDependentEndpoints(value: any) {