From 18c934b9838a62b71955c118e101c883f390c99d Mon Sep 17 00:00:00 2001
From: Kirigaya <1193466151@qq.com>
Date: Thu, 3 Jul 2025 19:59:55 +0800
Subject: [PATCH] fix issue
---
.../components/main-panel/tool/tool-executor.vue | 16 ++++++++++++++--
renderer/src/hook/mcp.ts | 4 ++++
2 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/renderer/src/components/main-panel/tool/tool-executor.vue b/renderer/src/components/main-panel/tool/tool-executor.vue
index 58cdb8d..0b52e2d 100644
--- a/renderer/src/components/main-panel/tool/tool-executor.vue
+++ b/renderer/src/components/main-panel/tool/tool-executor.vue
@@ -20,9 +20,16 @@
+
+
+
@@ -38,7 +45,6 @@
{{ 'mook' }}
-
@@ -150,7 +156,8 @@ const initFormData = () => {
Object.entries(currentTool.value.inputSchema.properties).forEach(([name, property]) => {
newSchemaDataForm[name] = getDefaultValue(property);
- const originType = normaliseJavascriptType(typeof tabStorage.formData[name]);
+ const rawType = Array.isArray(tabStorage.formData[name]) ? 'array' : typeof tabStorage.formData[name];
+ const originType = normaliseJavascriptType(rawType);
if (tabStorage.formData[name] !== undefined && originType === property.type) {
newSchemaDataForm[name] = tabStorage.formData[name];
@@ -300,4 +307,9 @@ watch(() => tabStorage.currentToolName, () => {
transform: scale(0.95);
transition: transform 0.08s;
}
+
+.el-tag.el-tag--info {
+ background-color: var(--main-color);
+}
+
\ No newline at end of file
diff --git a/renderer/src/hook/mcp.ts b/renderer/src/hook/mcp.ts
index baf3337..faaf178 100644
--- a/renderer/src/hook/mcp.ts
+++ b/renderer/src/hook/mcp.ts
@@ -11,6 +11,8 @@ export function getDefaultValue(property: TypeAble): any {
return false;
} else if (property.type === 'object') {
return {};
+ } else if (property.type === 'array') {
+ return [];
} else {
return '';
}
@@ -26,6 +28,8 @@ export function normaliseJavascriptType(type: string) {
return 'boolean';
case 'string':
return 'string';
+ case 'array':
+ return 'array';
default:
return type;
}