-
Notifications
You must be signed in to change notification settings - Fork 309
fix(robot): add the API tab of the MCP and adjust the display control of the robot. #3485
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThis update removes the AI Agent grid demo, its documentation, and related menu entries. The base grid demo is refactored to integrate a city filter, MCP server/client setup, and removes boolean editing. The UI adapts to show MCP documentation and floating robot controls only for relevant routes, with new components and state properties added to manage these features. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant VueApp
participant Router
participant appData
participant MCPServer
participant MCPClient
participant SSEProxy
User->>VueApp: Navigates to grid component
VueApp->>Router: Route change
Router->>appData: Set hasFloatRobot (true if grid route)
alt hasFloatRobot is true
VueApp->>MCPServer: Initialize server
VueApp->>MCPClient: Initialize client
VueApp->>SSEProxy: Connect via SSE, get sessionID
SSEProxy-->>VueApp: Return sessionID
VueApp->>MCPServer: Connect server with transport
VueApp->>UI: Show city filter, MCP tab, robot chat
else hasFloatRobot is false
VueApp->>UI: Hide MCP tab and robot chat
end
Poem
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
examples/sites/src/views/components-doc/tiny-robot-chat.vueOops! Something went wrong! :( ESLint: 8.57.1 ESLint couldn't find the plugin "eslint-plugin-vue". (The package "eslint-plugin-vue" was not found when loaded as a Node module from the directory "".) It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:
The plugin "eslint-plugin-vue" was referenced from the config file in ".eslintrc.js » @antfu/eslint-config » @antfu/eslint-config-vue". If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team. 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
border-top-right-radius: 0; | ||
border-bottom-right-radius: 0; | ||
// .tr-toggle { | ||
// position: absolute; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
注释的代码要去掉,后面可以用历史记录找到
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
已删除
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 7
🔭 Outside diff range comments (1)
examples/sites/demos/pc/app/grid/base/basic-usage-composition-api.vue (1)
1-101
:⚠️ Potential issueCritical: This file is identical to basic-usage.vue
This file is named
basic-usage-composition-api.vue
but:
- It uses Options API instead of Composition API
- It's completely identical to
basic-usage.vue
This appears to be a copy-paste error during refactoring.
Either:
- Refactor this file to actually use Composition API with
<script setup>
orsetup()
function- Remove this file if only one implementation is needed
Example Composition API structure:
<script setup> import { ref, onMounted } from 'vue' // ... imports const server = new McpServer({ name: 'base-config', version: '1.0.0' }, {}) const sessionID = ref('') const queryCity = ref('') // ... other refs onMounted(async () => { // ... initialization logic }) </script>
🧹 Nitpick comments (7)
examples/sites/src/views/components-doc/tiny-robot-chat.vue (1)
42-48
: Consider removing commented code instead of leaving it in place.While the functionality is correct, leaving large blocks of commented code can lead to maintenance overhead and confusion. If this toggle button is no longer needed, consider removing it entirely rather than commenting it out.
If you plan to restore this functionality later, consider using a feature flag or documenting the intention:
- <!-- <div class="tr-toggle" v-if="!appData.showTinyRobot" title="AI智能助手" @click="appData.showTinyRobot = true"> + <!-- TODO: Restore toggle button functionality if needed + <div class="tr-toggle" v-if="!appData.showTinyRobot" title="AI智能助手" @click="appData.showTinyRobot = true">Also applies to: 134-157
examples/sites/src/router.js (1)
61-62
: Consider making the route check more flexible.The logic correctly updates the hasFloatRobot flag based on the route, but the hard-coded string 'components/grid' could be brittle if route structures change.
Consider extracting the route pattern to a constant:
+const ROBOT_ENABLED_ROUTES = ['components/grid'] // tiny-robot 通过路由,确定浮动区,是否显示AI按钮 -appData.hasFloatRobot = to.path.endsWith('components/grid') +appData.hasFloatRobot = ROBOT_ENABLED_ROUTES.some(route => to.path.endsWith(route))examples/sites/src/views/components-doc/components/mcp-docs.vue (3)
42-42
: Remove empty onMounted hook.The empty
onMounted(() => {})
hook serves no purpose and should be removed to keep the code clean.-onMounted(() => {})
20-22
: Add prop validation for better type safety.Consider adding validation to ensure the name prop is provided since the component depends on it.
const props = defineProps({ - name: String + name: { + type: String, + required: true + } })
24-24
: Add error handling for MCP configuration loading.Consider wrapping the
getTinyVueMcpConfig
call in a try-catch block to handle potential errors gracefully.+let mcpTools +try { -const mcpTools = getTinyVueMcpConfig({ t: null }) + mcpTools = getTinyVueMcpConfig({ t: null }) +} catch (error) { + console.warn('Failed to load MCP configuration:', error) + mcpTools = { components: {} } +}examples/sites/src/views/components-doc/components/float-settings.vue (1)
62-77
: Consider the button layout and spacing consistency.The new button structure creates a wrapper div that contains both the AI button and the style settings button. Ensure this doesn't affect the intended layout or spacing.
You might want to add specific styling for the button container to maintain consistent spacing:
<template #reference> <div> + <div class="settings-buttons-container"> <div v-if="appData.hasFloatRobot" class="settings-btn style-settings-btn" @click="appData.showTinyRobot = true" > <IconAi class="settings-icon style-settings-icon"></IconAi> </div> <div class="settings-btn style-settings-btn" @click="demoStyleVisible = !demoStyleVisible" @blur="demoStyleVisible = false" > <style-settings-icon class="settings-icon style-settings-icon"></style-settings-icon> </div> + </div> </div> </template>And add corresponding CSS:
.settings-buttons-container { display: flex; flex-direction: column; gap: 8px; }examples/sites/demos/pc/app/grid/base/basic-usage.vue (1)
82-82
: Replace numbered comments with descriptive ones.The comments
// 1、
,// 2、
,// 3、
are not descriptive and don't help understand the code flow.- // 1、 + // Create transport pair for client-server communication const [transport, clientTransport] = createTransportPair() - // 2、 + // Initialize client and establish SSE proxy connection const client = new Client({ name: 'ai-agent', version: '1.0.0' }, {}) - // 3、 + // Connect MCP server to transport await this.server.connect(transport)Also applies to: 85-85, 96-96
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (15)
examples/sites/demos/pc/app/grid/ai-agent/basic-usage-composition-api.vue
(0 hunks)examples/sites/demos/pc/app/grid/ai-agent/basic-usage.vue
(0 hunks)examples/sites/demos/pc/app/grid/base/basic-usage-composition-api.vue
(1 hunks)examples/sites/demos/pc/app/grid/base/basic-usage.spec.js
(1 hunks)examples/sites/demos/pc/app/grid/base/basic-usage.vue
(1 hunks)examples/sites/demos/pc/app/grid/webdoc/grid-ai-agent.cn.md
(0 hunks)examples/sites/demos/pc/app/grid/webdoc/grid-ai-agent.en.md
(0 hunks)examples/sites/demos/pc/menus.js
(0 hunks)examples/sites/package.json
(1 hunks)examples/sites/src/router.js
(2 hunks)examples/sites/src/tools/appData.js
(1 hunks)examples/sites/src/views/components-doc/common.vue
(5 hunks)examples/sites/src/views/components-doc/components/float-settings.vue
(4 hunks)examples/sites/src/views/components-doc/components/mcp-docs.vue
(1 hunks)examples/sites/src/views/components-doc/tiny-robot-chat.vue
(2 hunks)
💤 Files with no reviewable changes (5)
- examples/sites/demos/pc/app/grid/webdoc/grid-ai-agent.en.md
- examples/sites/demos/pc/menus.js
- examples/sites/demos/pc/app/grid/webdoc/grid-ai-agent.cn.md
- examples/sites/demos/pc/app/grid/ai-agent/basic-usage.vue
- examples/sites/demos/pc/app/grid/ai-agent/basic-usage-composition-api.vue
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: PR E2E Test (pnpm test:e2e3)
🔇 Additional comments (6)
examples/sites/src/tools/appData.js (1)
13-13
: LGTM! Property addition follows existing patterns.The new
hasFloatRobot
boolean property is correctly added to the reactive appData object and follows the same pattern as existing properties.examples/sites/src/router.js (1)
4-4
: LGTM! Import is correctly added.The appData import is properly added and will be used in the router logic.
examples/sites/src/views/components-doc/common.vue (3)
91-91
: Good logical improvement for robot chat visibility.The updated condition ensures the robot chat only appears when both conditions are met, which aligns well with the broader feature integration.
178-181
: Good practice: Defer footer rendering to nextTick.Moving the footer rendering inside
nextTick
ensures the DOM is fully ready before rendering, which is a best practice.
65-67
:✅ Verification successful
Verify the McpDocs component exists and add prop validation.
The new MCP tab conditionally renders the
McpDocs
component, but there's no guarantee this component exists or handles thename
prop correctly.
🏁 Script executed:
#!/bin/bash # Description: Verify that McpDocs component exists and check its prop definitions # Expected: Component file exists and accepts 'name' prop # Check if McpDocs component file exists fd -t f "mcp-docs.vue" examples/sites/src/views/components-doc/components/ # Look for prop definitions in the component if [ -f "examples/sites/src/views/components-doc/components/mcp-docs.vue" ]; then echo "=== McpDocs component prop definitions ===" rg -A 10 -B 2 "props|defineProps" examples/sites/src/views/components-doc/components/mcp-docs.vue fiLength of output: 941
McpDocs component exists and correctly defines
name
propThe
examples/sites/src/views/components-doc/components/mcp-docs.vue
file uses:
defineProps({ name: String })
which matches the usage in the new MCP tab. No further prop validation or changes are needed.
examples/sites/package.json (1)
59-59
: Dependency addition looks good.The addition of
@vue/shared
aligns with the existing Vue version and supports the MCP integration features.
const mcpInfo = computed(() => { | ||
const schema = mcpTools.components[capName.value]?.paramsSchema | ||
if (schema) { | ||
return Object.keys(schema).map((name) => { | ||
const item = schema[name] | ||
return { | ||
name, | ||
param: item._def?.innerType?._def?.typeName || '', | ||
desc: item._def?.description || '' | ||
} | ||
}) | ||
} | ||
return null | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Improve error handling and null safety.
The current implementation has several potential issues:
- Deep property access without null checking could cause runtime errors
- No error handling if
getTinyVueMcpConfig
fails - The logic assumes a specific schema structure
const mcpInfo = computed(() => {
+ if (!capName.value || !mcpTools?.components) {
+ return []
+ }
+
const schema = mcpTools.components[capName.value]?.paramsSchema
if (schema) {
return Object.keys(schema).map((name) => {
const item = schema[name]
return {
name,
- param: item._def?.innerType?._def?.typeName || '',
- desc: item._def?.description || ''
+ param: item?._def?.innerType?._def?.typeName || item?._def?.typeName || 'unknown',
+ desc: item?._def?.description || 'No description available'
}
})
}
- return null
+ return []
})
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
const mcpInfo = computed(() => { | |
const schema = mcpTools.components[capName.value]?.paramsSchema | |
if (schema) { | |
return Object.keys(schema).map((name) => { | |
const item = schema[name] | |
return { | |
name, | |
param: item._def?.innerType?._def?.typeName || '', | |
desc: item._def?.description || '' | |
} | |
}) | |
} | |
return null | |
}) | |
const mcpInfo = computed(() => { | |
// Early guard for missing capName or components | |
if (!capName.value || !mcpTools?.components) { | |
return [] | |
} | |
const schema = mcpTools.components[capName.value]?.paramsSchema | |
if (schema) { | |
return Object.keys(schema).map((name) => { | |
const item = schema[name] | |
return { | |
name, | |
param: item?._def?.innerType?._def?.typeName | |
|| item?._def?.typeName | |
|| 'unknown', | |
desc: item?._def?.description | |
|| 'No description available' | |
} | |
}) | |
} | |
return [] | |
}) |
🤖 Prompt for AI Agents
In examples/sites/src/views/components-doc/components/mcp-docs.vue around lines
27 to 40, improve null safety by adding checks before accessing deep nested
properties like _def and innerType to avoid runtime errors. Wrap the logic in a
try-catch block to handle potential errors from getTinyVueMcpConfig or other
calls gracefully. Also, add validation to confirm the schema structure matches
expectations before processing it, returning null or a safe default if not.
v-if="appData.hasFloatRobot" | ||
class="settings-btn style-settings-btn" | ||
@click="appData.showTinyRobot = true" | ||
> | ||
<IconAi class="settings-icon style-settings-icon"></IconAi> | ||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Avoid direct state mutation in template and add accessibility attributes.
The button directly mutates appData.showTinyRobot
in the template, which is not a best practice. Also, the button lacks accessibility attributes.
<div
v-if="appData.hasFloatRobot"
class="settings-btn style-settings-btn"
- @click="appData.showTinyRobot = true"
+ @click="showRobot"
+ :title="i18nByKey('showAIAssistant')"
+ aria-label="Show AI Assistant"
>
<IconAi class="settings-icon style-settings-icon"></IconAi>
</div>
Add the method to the setup function:
const funcs = {
showRobot() {
appData.showTinyRobot = true
},
// ... existing methods
}
🤖 Prompt for AI Agents
In examples/sites/src/views/components-doc/components/float-settings.vue around
lines 64 to 69, avoid directly mutating the reactive state appData.showTinyRobot
in the template. Instead, create a method named showRobot inside the setup
function that sets appData.showTinyRobot to true, and call this method on the
button's click event. Additionally, add appropriate accessibility attributes
such as aria-label or role to the button element to improve accessibility.
import { router } from '@/router' | ||
import useStyleSettings from '@/tools/useStyleSettings' | ||
import { IconAi } from '@opentiny/tiny-robot-svgs' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Verification agent
🧩 Analysis chain
Verify the IconAi import path and component availability.
Ensure the IconAi
component is available from the specified package.
🏁 Script executed:
#!/bin/bash
# Description: Verify IconAi component exists in the specified package
# Expected: IconAi should be available from @opentiny/tiny-robot-svgs
# Check if the package is installed and contains IconAi
if [ -f "package.json" ]; then
echo "=== Checking if @opentiny/tiny-robot-svgs package is installed ==="
jq '.dependencies["@opentiny/tiny-robot-svgs"], .devDependencies["@opentiny/tiny-robot-svgs"]' package.json
fi
# Search for IconAi usage in other files to verify the import pattern
echo "=== Other IconAi imports in the codebase ==="
rg -B 2 -A 2 "IconAi.*@opentiny/tiny-robot-svgs"
Length of output: 1651
Fix missing @opentiny/tiny-robot-svgs
dependency
The import in
examples/sites/src/views/components-doc/components/float-settings.vue
(line 107):
import { IconAi } from '@opentiny/tiny-robot-svgs'
will fail because @opentiny/tiny-robot-svgs
is not listed in your package.json
. To address this:
- Add
@opentiny/tiny-robot-svgs
to your dependencies (e.g. runnpm install @opentiny/tiny-robot-svgs --save
). - Confirm that
IconAi
is indeed exported by that package (inspect its entry point innode_modules/@opentiny/tiny-robot-svgs
).
This will ensure both your examples and any other imports (e.g. in useTinyRobot.ts
) resolve correctly.
🤖 Prompt for AI Agents
In examples/sites/src/views/components-doc/components/float-settings.vue at line
107, the import of IconAi from '@opentiny/tiny-robot-svgs' will fail because the
package is not listed in package.json dependencies. Fix this by adding
'@opentiny/tiny-robot-svgs' to your dependencies using npm or yarn (e.g., npm
install @opentiny/tiny-robot-svgs --save). Also verify that IconAi is exported
by this package by checking its entry point in node_modules. This ensures the
import resolves correctly.
@@ -4,5 +4,5 @@ test('标签式表格', async ({ page }) => { | |||
page.on('pageerror', (exception) => expect(exception).toBeNull()) | |||
await page.goto('grid#base-basic-usage') | |||
|
|||
await expect(page.getByRole('row', { name: '1 800 2014-04-30 00:56:00 福州' })).toBeVisible() | |||
// await expect(page.getByRole('row', { name: '1 800 2014-04-30 00:56:00 福州' })).toBeVisible() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Update or remove the test instead of commenting it out.
Instead of commenting out the assertion, either:
- Update it to test the new grid structure with company information
- Remove it entirely if this test is no longer applicable
Apply this diff to update the test to match the new data structure:
- // await expect(page.getByRole('row', { name: '1 800 2014-04-30 00:56:00 福州' })).toBeVisible()
+ await expect(page.getByRole('row', { name: /GFD 有限责任公司.*广州.*800.*2014-04-30/ })).toBeVisible()
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
// await expect(page.getByRole('row', { name: '1 800 2014-04-30 00:56:00 福州' })).toBeVisible() | |
await expect(page.getByRole('row', { name: /GFD 有限责任公司.*广州.*800.*2014-04-30/ })).toBeVisible() |
🤖 Prompt for AI Agents
In examples/sites/demos/pc/app/grid/base/basic-usage.spec.js at line 7, the test
assertion is commented out instead of being updated or removed. Review the
current grid structure and either update the expect statement to match the new
company information format or remove the test if it no longer applies. Replace
the commented line with a valid assertion reflecting the new data or delete it
entirely.
await client.connect(clientTransport) | ||
const { sessionId } = await createSseProxy({ | ||
client, | ||
url: 'https://39.108.160.245/sse' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Move hardcoded URL to configuration.
The hardcoded SSE proxy URL 'https://39.108.160.245/sse'
should be externalized for better maintainability and security.
Consider moving this URL to an environment variable or configuration file. This allows different URLs for development, staging, and production environments.
🤖 Prompt for AI Agents
In examples/sites/demos/pc/app/grid/base/basic-usage.vue at line 90, the SSE
proxy URL is hardcoded as 'https://39.108.160.245/sse'. To improve
maintainability and security, move this URL to a configuration source such as an
environment variable or a config file. Replace the hardcoded string with a
reference to this external configuration so that different environments can use
different URLs without code changes.
const [transport, clientTransport] = createTransportPair() | ||
|
||
// 2、 | ||
const client = new Client({ name: 'ai-agent', version: '1.0.0' }, {}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🛠️ Refactor suggestion
Update the client name to match the component context.
The client name 'ai-agent'
is misleading since this is a base example, not an AI agent demo.
- const client = new Client({ name: 'ai-agent', version: '1.0.0' }, {})
+ const client = new Client({ name: 'grid-base-example', version: '1.0.0' }, {})
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
const client = new Client({ name: 'ai-agent', version: '1.0.0' }, {}) | |
const client = new Client({ name: 'grid-base-example', version: '1.0.0' }, {}) |
🤖 Prompt for AI Agents
In examples/sites/demos/pc/app/grid/base/basic-usage.vue at line 86, update the
client name from 'ai-agent' to a name that reflects the base example context,
such as 'basic-usage-client', to accurately represent the component's purpose.
async mounted() { | ||
// 1、 | ||
const [transport, clientTransport] = createTransportPair() | ||
|
||
// 2、 | ||
const client = new Client({ name: 'ai-agent', version: '1.0.0' }, {}) | ||
await client.connect(clientTransport) | ||
const { sessionId } = await createSseProxy({ | ||
client, | ||
url: 'https://39.108.160.245/sse' | ||
}) | ||
|
||
this.sessionID = sessionId | ||
window.$sessionId = this.sessionID | ||
|
||
// 3、 | ||
await this.server.connect(transport) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add error handling for async operations in mounted().
The async operations in mounted()
lack error handling. Network failures or connection issues could cause unhandled promise rejections.
Wrap the async operations in a try-catch block:
async mounted() {
+ try {
// 1、
const [transport, clientTransport] = createTransportPair()
// 2、
const client = new Client({ name: 'ai-agent', version: '1.0.0' }, {})
await client.connect(clientTransport)
const { sessionId } = await createSseProxy({
client,
url: 'https://39.108.160.245/sse'
})
this.sessionID = sessionId
window.$sessionId = this.sessionID
// 3、
await this.server.connect(transport)
+ } catch (error) {
+ console.error('Failed to initialize MCP connection:', error)
+ // Consider showing user-friendly error message
+ }
}
📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
async mounted() { | |
// 1、 | |
const [transport, clientTransport] = createTransportPair() | |
// 2、 | |
const client = new Client({ name: 'ai-agent', version: '1.0.0' }, {}) | |
await client.connect(clientTransport) | |
const { sessionId } = await createSseProxy({ | |
client, | |
url: 'https://39.108.160.245/sse' | |
}) | |
this.sessionID = sessionId | |
window.$sessionId = this.sessionID | |
// 3、 | |
await this.server.connect(transport) | |
} | |
async mounted() { | |
try { | |
// 1、 | |
const [transport, clientTransport] = createTransportPair() | |
// 2、 | |
const client = new Client({ name: 'ai-agent', version: '1.0.0' }, {}) | |
await client.connect(clientTransport) | |
const { sessionId } = await createSseProxy({ | |
client, | |
url: 'https://39.108.160.245/sse' | |
}) | |
this.sessionID = sessionId | |
window.$sessionId = this.sessionID | |
// 3、 | |
await this.server.connect(transport) | |
} catch (error) { | |
console.error('Failed to initialize MCP connection:', error) | |
// Consider showing user-friendly error message | |
} | |
} |
🤖 Prompt for AI Agents
In examples/sites/demos/pc/app/grid/base/basic-usage.vue around lines 81 to 98,
the async operations in the mounted() lifecycle method lack error handling,
which can lead to unhandled promise rejections on network or connection
failures. Wrap the entire async code inside mounted() in a try-catch block to
catch and handle any errors that occur during the creation of transports, client
connection, SSE proxy creation, and server connection. In the catch block, log
or handle the error appropriately to ensure the app remains stable.
PR
fix(robot): 添加MCP 的api 页签,调整robot的显示控制
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information
Summary by CodeRabbit
New Features
Refactor
Bug Fixes
Chores
@vue/shared
.Documentation
Style