修复剪贴板的问题
This commit is contained in:
parent
a132fd41fe
commit
fed2e6d27c
@ -6,12 +6,12 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { computed, defineProps, type PropType } from 'vue';
|
||||
import { defineProps, type PropType } from 'vue';
|
||||
import { renderJson } from '../main-panel/chat/markdown/markdown';
|
||||
|
||||
const props = defineProps({
|
||||
json: {
|
||||
type: Object as PropType<string | object | undefined>,
|
||||
type: Object as PropType<any>,
|
||||
required: true
|
||||
}
|
||||
});
|
||||
|
@ -66,7 +66,7 @@ export default function highlight(option: HighlightOption = {}) {
|
||||
return;
|
||||
}
|
||||
|
||||
window.navigator.clipboard.writeText(code).then(() => {
|
||||
navigator.clipboard.writeText(code).then(() => {
|
||||
const originalText = button.textContent;
|
||||
button.textContent = '已复制';
|
||||
setTimeout(() => {
|
||||
|
@ -83,20 +83,7 @@ const handleKeydown = (event: KeyboardEvent) => {
|
||||
|
||||
const copy = async () => {
|
||||
try {
|
||||
if (navigator.clipboard) {
|
||||
await navigator.clipboard.write([
|
||||
new ClipboardItem({
|
||||
'text/plain': new Blob([userInput.value], { type: 'text/plain' })
|
||||
})
|
||||
]);
|
||||
} else {
|
||||
const textarea = document.createElement('textarea');
|
||||
textarea.value = userInput.value;
|
||||
document.body.appendChild(textarea);
|
||||
textarea.select();
|
||||
document.execCommand('copy');
|
||||
document.body.removeChild(textarea);
|
||||
}
|
||||
await navigator.clipboard.writeText(props.message.content.trim());
|
||||
ElMessage.success('内容已复制到剪贴板');
|
||||
} catch (err) {
|
||||
console.error('无法复制内容: ', err);
|
||||
|
@ -5,7 +5,7 @@
|
||||
<!-- header -->
|
||||
<template #title>
|
||||
<h3 class="resource-template">
|
||||
<code>prompts/list</code>
|
||||
<span>prompts/list</span>
|
||||
<span @click.stop="reloadPrompts(client, { first: false })" class="iconfont icon-restart"></span>
|
||||
</h3>
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<!-- header -->
|
||||
<template #title>
|
||||
<h3 class="resource-template">
|
||||
<code>resources/templates/list</code>
|
||||
<span>resources/templates/list</span>
|
||||
<span class="iconfont icon-restart" @click="reloadResources(client, { first: false })"></span>
|
||||
</h3>
|
||||
</template>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<!-- header -->
|
||||
<template #title>
|
||||
<h3 class="resource-template">
|
||||
<code>resources/list</code>
|
||||
<span>resources/list</span>
|
||||
<span class="iconfont icon-restart" @click="reloadResources(client, { first: false })"></span>
|
||||
</h3>
|
||||
</template>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<!-- header -->
|
||||
<template #title>
|
||||
<h3 class="resource-template">
|
||||
<code>tools/list</code>
|
||||
<span>tools/list</span>
|
||||
<span class="iconfont icon-restart" @click.stop="reloadTools(client, { first: false })"></span>
|
||||
</h3>
|
||||
</template>
|
||||
|
@ -1,4 +1,5 @@
|
||||
import { useMessageBridge } from "@/api/message-bridge";
|
||||
import { getPlatform } from "@/api/platform";
|
||||
|
||||
export function getCurrentTime() {
|
||||
// 创建一个Date对象
|
||||
|
@ -116,6 +116,7 @@ const validateForm = async () => {
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
padding: 16px;
|
||||
height: fit-content;
|
||||
background-color: var(--el-bg-color);
|
||||
border-radius: 4px;
|
||||
margin-bottom: 16px;
|
||||
|
@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div class="connection-option">
|
||||
<div class="connection-log">
|
||||
<div class="header">
|
||||
<span>{{ t('log') }}</span>
|
||||
<span class="iconfont icon-delete" @click="clearLogs"></span>
|
||||
@ -51,15 +51,23 @@ function clearLogs() {
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.connection-option {
|
||||
|
||||
.connection-log {
|
||||
height: 90vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
gap: 12px;
|
||||
padding: 16px;
|
||||
background-color: var(--el-bg-color);
|
||||
border-radius: 4px;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
|
||||
.connection-option .el-scrollbar__view {
|
||||
.connection-log .el-scrollbar__view {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.connection-option .output-content {
|
||||
.connection-log .output-content {
|
||||
border-radius: .5em;
|
||||
padding: 12px 16px;
|
||||
min-height: 300px;
|
||||
|
@ -36,12 +36,29 @@ export function tryGetRunCommandError(command: string, args: string[] = [], cwd?
|
||||
}
|
||||
|
||||
function getCWD(option: McpOptions) {
|
||||
if (option.cwd) {
|
||||
return option.cwd;
|
||||
}
|
||||
// if (option.cwd) {
|
||||
// return option.cwd;
|
||||
// }
|
||||
const file = option.args?.at(-1);
|
||||
if (file) {
|
||||
return path.dirname(file);
|
||||
// 如果是绝对路径,直接返回目录
|
||||
if (path.isAbsolute(file)) {
|
||||
// 如果是是文件,则返回文件所在的目录
|
||||
if (fs.statSync(file).isDirectory()) {
|
||||
return file;
|
||||
} else {
|
||||
return path.dirname(file);
|
||||
}
|
||||
} else {
|
||||
// 如果是相对路径,根据 cwd 获取真实路径
|
||||
const absPath = path.resolve(option.cwd || process.cwd(), file);
|
||||
// 如果是是文件,则返回文件所在的目录
|
||||
if (fs.statSync(absPath).isDirectory()) {
|
||||
return absPath;
|
||||
} else {
|
||||
return path.dirname(absPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
return undefined;
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"clientId": "3e33bc4d-bc4d-53bc4d856bb-83bc4d856bbb1ac-bb1acc2e",
|
||||
"currentIndex": 0,
|
||||
"clientId": "83313e18-3e18-513e1883c06-813e1883c060a6b-60a6b641",
|
||||
"currentIndex": 1,
|
||||
"tabs": [
|
||||
{
|
||||
"name": "交互测试",
|
||||
@ -612,884 +612,6 @@
|
||||
"properties": {}
|
||||
},
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"name": "create_document",
|
||||
"description": "Create a new Word document with optional metadata.\n\nArgs:\n filename: Name of the document to create (with or without .docx extension)\n title: Optional title for the document metadata\n author: Optional author for the document metadata\n",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"filename": {
|
||||
"title": "Filename",
|
||||
"type": "string"
|
||||
},
|
||||
"title": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"default": null,
|
||||
"title": "Title"
|
||||
},
|
||||
"author": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"default": null,
|
||||
"title": "Author"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"filename"
|
||||
],
|
||||
"title": "create_documentArguments"
|
||||
},
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"name": "copy_document",
|
||||
"description": "Create a copy of a Word document.\n\nArgs:\n source_filename: Path to the source document\n destination_filename: Optional path for the copy. If not provided, a default name will be generated.\n",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"source_filename": {
|
||||
"title": "Source Filename",
|
||||
"type": "string"
|
||||
},
|
||||
"destination_filename": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"default": null,
|
||||
"title": "Destination Filename"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"source_filename"
|
||||
],
|
||||
"title": "copy_documentArguments"
|
||||
},
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"name": "get_document_info",
|
||||
"description": "Get information about a Word document.\n\nArgs:\n filename: Path to the Word document\n",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"filename": {
|
||||
"title": "Filename",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"filename"
|
||||
],
|
||||
"title": "get_document_infoArguments"
|
||||
},
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"name": "get_document_text",
|
||||
"description": "Extract all text from a Word document.\n\nArgs:\n filename: Path to the Word document\n",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"filename": {
|
||||
"title": "Filename",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"filename"
|
||||
],
|
||||
"title": "get_document_textArguments"
|
||||
},
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"name": "get_document_outline",
|
||||
"description": "Get the structure of a Word document.\n\nArgs:\n filename: Path to the Word document\n",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"filename": {
|
||||
"title": "Filename",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"filename"
|
||||
],
|
||||
"title": "get_document_outlineArguments"
|
||||
},
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"name": "list_available_documents",
|
||||
"description": "List all .docx files in the specified directory.\n\nArgs:\n directory: Directory to search for Word documents\n",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"directory": {
|
||||
"default": ".",
|
||||
"title": "Directory",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"title": "list_available_documentsArguments"
|
||||
},
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"name": "add_paragraph",
|
||||
"description": "Add a paragraph to a Word document.\n\nArgs:\n filename: Path to the Word document\n text: Paragraph text\n style: Optional paragraph style name\n",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"filename": {
|
||||
"title": "Filename",
|
||||
"type": "string"
|
||||
},
|
||||
"text": {
|
||||
"title": "Text",
|
||||
"type": "string"
|
||||
},
|
||||
"style": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"default": null,
|
||||
"title": "Style"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"filename",
|
||||
"text"
|
||||
],
|
||||
"title": "add_paragraphArguments"
|
||||
},
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"name": "add_heading",
|
||||
"description": "Add a heading to a Word document.\n\nArgs:\n filename: Path to the Word document\n text: Heading text\n level: Heading level (1-9, where 1 is the highest level)\n",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"filename": {
|
||||
"title": "Filename",
|
||||
"type": "string"
|
||||
},
|
||||
"text": {
|
||||
"title": "Text",
|
||||
"type": "string"
|
||||
},
|
||||
"level": {
|
||||
"default": 1,
|
||||
"title": "Level",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"filename",
|
||||
"text"
|
||||
],
|
||||
"title": "add_headingArguments"
|
||||
},
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"name": "add_picture",
|
||||
"description": "Add an image to a Word document.\n\nArgs:\n filename: Path to the Word document\n image_path: Path to the image file\n width: Optional width in inches (proportional scaling)\n",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"filename": {
|
||||
"title": "Filename",
|
||||
"type": "string"
|
||||
},
|
||||
"image_path": {
|
||||
"title": "Image Path",
|
||||
"type": "string"
|
||||
},
|
||||
"width": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "number"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"default": null,
|
||||
"title": "Width"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"filename",
|
||||
"image_path"
|
||||
],
|
||||
"title": "add_pictureArguments"
|
||||
},
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"name": "add_table",
|
||||
"description": "Add a table to a Word document.\n\nArgs:\n filename: Path to the Word document\n rows: Number of rows in the table\n cols: Number of columns in the table\n data: Optional 2D array of data to fill the table\n",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"filename": {
|
||||
"title": "Filename",
|
||||
"type": "string"
|
||||
},
|
||||
"rows": {
|
||||
"title": "Rows",
|
||||
"type": "integer"
|
||||
},
|
||||
"cols": {
|
||||
"title": "Cols",
|
||||
"type": "integer"
|
||||
},
|
||||
"data": {
|
||||
"anyOf": [
|
||||
{
|
||||
"items": {
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"default": null,
|
||||
"title": "Data"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"filename",
|
||||
"rows",
|
||||
"cols"
|
||||
],
|
||||
"title": "add_tableArguments"
|
||||
},
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"name": "add_page_break",
|
||||
"description": "Add a page break to the document.\n\nArgs:\n filename: Path to the Word document\n",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"filename": {
|
||||
"title": "Filename",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"filename"
|
||||
],
|
||||
"title": "add_page_breakArguments"
|
||||
},
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"name": "delete_paragraph",
|
||||
"description": "Delete a paragraph from a document.\n\nArgs:\n filename: Path to the Word document\n paragraph_index: Index of the paragraph to delete (0-based)\n",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"filename": {
|
||||
"title": "Filename",
|
||||
"type": "string"
|
||||
},
|
||||
"paragraph_index": {
|
||||
"title": "Paragraph Index",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"filename",
|
||||
"paragraph_index"
|
||||
],
|
||||
"title": "delete_paragraphArguments"
|
||||
},
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"name": "search_and_replace",
|
||||
"description": "Search for text and replace all occurrences.\n\nArgs:\n filename: Path to the Word document\n find_text: Text to search for\n replace_text: Text to replace with\n",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"filename": {
|
||||
"title": "Filename",
|
||||
"type": "string"
|
||||
},
|
||||
"find_text": {
|
||||
"title": "Find Text",
|
||||
"type": "string"
|
||||
},
|
||||
"replace_text": {
|
||||
"title": "Replace Text",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"filename",
|
||||
"find_text",
|
||||
"replace_text"
|
||||
],
|
||||
"title": "search_and_replaceArguments"
|
||||
},
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"name": "create_custom_style",
|
||||
"description": "Create a custom style in the document.\n\nArgs:\n filename: Path to the Word document\n style_name: Name for the new style\n bold: Set text bold (True/False)\n italic: Set text italic (True/False)\n font_size: Font size in points\n font_name: Font name/family\n color: Text color (e.g., 'red', 'blue')\n base_style: Optional existing style to base this on\n",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"filename": {
|
||||
"title": "Filename",
|
||||
"type": "string"
|
||||
},
|
||||
"style_name": {
|
||||
"title": "Style Name",
|
||||
"type": "string"
|
||||
},
|
||||
"bold": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"default": null,
|
||||
"title": "Bold"
|
||||
},
|
||||
"italic": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"default": null,
|
||||
"title": "Italic"
|
||||
},
|
||||
"font_size": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "integer"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"default": null,
|
||||
"title": "Font Size"
|
||||
},
|
||||
"font_name": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"default": null,
|
||||
"title": "Font Name"
|
||||
},
|
||||
"color": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"default": null,
|
||||
"title": "Color"
|
||||
},
|
||||
"base_style": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"default": null,
|
||||
"title": "Base Style"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"filename",
|
||||
"style_name"
|
||||
],
|
||||
"title": "create_custom_styleArguments"
|
||||
},
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"name": "format_text",
|
||||
"description": "Format a specific range of text within a paragraph.\n\nArgs:\n filename: Path to the Word document\n paragraph_index: Index of the paragraph (0-based)\n start_pos: Start position within the paragraph text\n end_pos: End position within the paragraph text\n bold: Set text bold (True/False)\n italic: Set text italic (True/False)\n underline: Set text underlined (True/False)\n color: Text color (e.g., 'red', 'blue', etc.)\n font_size: Font size in points\n font_name: Font name/family\n",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"filename": {
|
||||
"title": "Filename",
|
||||
"type": "string"
|
||||
},
|
||||
"paragraph_index": {
|
||||
"title": "Paragraph Index",
|
||||
"type": "integer"
|
||||
},
|
||||
"start_pos": {
|
||||
"title": "Start Pos",
|
||||
"type": "integer"
|
||||
},
|
||||
"end_pos": {
|
||||
"title": "End Pos",
|
||||
"type": "integer"
|
||||
},
|
||||
"bold": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"default": null,
|
||||
"title": "Bold"
|
||||
},
|
||||
"italic": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"default": null,
|
||||
"title": "Italic"
|
||||
},
|
||||
"underline": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"default": null,
|
||||
"title": "Underline"
|
||||
},
|
||||
"color": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"default": null,
|
||||
"title": "Color"
|
||||
},
|
||||
"font_size": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "integer"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"default": null,
|
||||
"title": "Font Size"
|
||||
},
|
||||
"font_name": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"default": null,
|
||||
"title": "Font Name"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"filename",
|
||||
"paragraph_index",
|
||||
"start_pos",
|
||||
"end_pos"
|
||||
],
|
||||
"title": "format_textArguments"
|
||||
},
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"name": "format_table",
|
||||
"description": "Format a table with borders, shading, and structure.\n\nArgs:\n filename: Path to the Word document\n table_index: Index of the table (0-based)\n has_header_row: If True, formats the first row as a header\n border_style: Style for borders ('none', 'single', 'double', 'thick')\n shading: 2D list of cell background colors (by row and column)\n",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"filename": {
|
||||
"title": "Filename",
|
||||
"type": "string"
|
||||
},
|
||||
"table_index": {
|
||||
"title": "Table Index",
|
||||
"type": "integer"
|
||||
},
|
||||
"has_header_row": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "boolean"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"default": null,
|
||||
"title": "Has Header Row"
|
||||
},
|
||||
"border_style": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"default": null,
|
||||
"title": "Border Style"
|
||||
},
|
||||
"shading": {
|
||||
"anyOf": [
|
||||
{
|
||||
"items": {
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
"type": "array"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"default": null,
|
||||
"title": "Shading"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"filename",
|
||||
"table_index"
|
||||
],
|
||||
"title": "format_tableArguments"
|
||||
},
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"name": "protect_document",
|
||||
"description": "Add password protection to a Word document.\n\nArgs:\n filename: Path to the Word document\n password: Password to protect the document with\n",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"filename": {
|
||||
"title": "Filename",
|
||||
"type": "string"
|
||||
},
|
||||
"password": {
|
||||
"title": "Password",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"filename",
|
||||
"password"
|
||||
],
|
||||
"title": "protect_documentArguments"
|
||||
},
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"name": "unprotect_document",
|
||||
"description": "Remove password protection from a Word document.\n\nArgs:\n filename: Path to the Word document\n password: Password that was used to protect the document\n",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"filename": {
|
||||
"title": "Filename",
|
||||
"type": "string"
|
||||
},
|
||||
"password": {
|
||||
"title": "Password",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"filename",
|
||||
"password"
|
||||
],
|
||||
"title": "unprotect_documentArguments"
|
||||
},
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"name": "add_footnote_to_document",
|
||||
"description": "Add a footnote to a specific paragraph in a Word document.\n\nArgs:\n filename: Path to the Word document\n paragraph_index: Index of the paragraph to add footnote to (0-based)\n footnote_text: Text content of the footnote\n",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"filename": {
|
||||
"title": "Filename",
|
||||
"type": "string"
|
||||
},
|
||||
"paragraph_index": {
|
||||
"title": "Paragraph Index",
|
||||
"type": "integer"
|
||||
},
|
||||
"footnote_text": {
|
||||
"title": "Footnote Text",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"filename",
|
||||
"paragraph_index",
|
||||
"footnote_text"
|
||||
],
|
||||
"title": "add_footnote_to_documentArguments"
|
||||
},
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"name": "add_endnote_to_document",
|
||||
"description": "Add an endnote to a specific paragraph in a Word document.\n\nArgs:\n filename: Path to the Word document\n paragraph_index: Index of the paragraph to add endnote to (0-based)\n endnote_text: Text content of the endnote\n",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"filename": {
|
||||
"title": "Filename",
|
||||
"type": "string"
|
||||
},
|
||||
"paragraph_index": {
|
||||
"title": "Paragraph Index",
|
||||
"type": "integer"
|
||||
},
|
||||
"endnote_text": {
|
||||
"title": "Endnote Text",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"filename",
|
||||
"paragraph_index",
|
||||
"endnote_text"
|
||||
],
|
||||
"title": "add_endnote_to_documentArguments"
|
||||
},
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"name": "convert_footnotes_to_endnotes_in_document",
|
||||
"description": "Convert all footnotes to endnotes in a Word document.\n\nArgs:\n filename: Path to the Word document\n",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"filename": {
|
||||
"title": "Filename",
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"filename"
|
||||
],
|
||||
"title": "convert_footnotes_to_endnotes_in_documentArguments"
|
||||
},
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"name": "customize_footnote_style",
|
||||
"description": "Customize footnote numbering and formatting in a Word document.\n\nArgs:\n filename: Path to the Word document\n numbering_format: Format for footnote numbers (e.g., \"1, 2, 3\", \"i, ii, iii\", \"a, b, c\")\n start_number: Number to start footnote numbering from\n font_name: Optional font name for footnotes\n font_size: Optional font size for footnotes (in points)\n",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"filename": {
|
||||
"title": "Filename",
|
||||
"type": "string"
|
||||
},
|
||||
"numbering_format": {
|
||||
"default": "1, 2, 3",
|
||||
"title": "Numbering Format",
|
||||
"type": "string"
|
||||
},
|
||||
"start_number": {
|
||||
"default": 1,
|
||||
"title": "Start Number",
|
||||
"type": "integer"
|
||||
},
|
||||
"font_name": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"default": null,
|
||||
"title": "Font Name"
|
||||
},
|
||||
"font_size": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "integer"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"default": null,
|
||||
"title": "Font Size"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"filename"
|
||||
],
|
||||
"title": "customize_footnote_styleArguments"
|
||||
},
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"name": "get_paragraph_text_from_document",
|
||||
"description": "Get text from a specific paragraph in a Word document.\n\nArgs:\n filename: Path to the Word document\n paragraph_index: Index of the paragraph to retrieve (0-based)\n",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"filename": {
|
||||
"title": "Filename",
|
||||
"type": "string"
|
||||
},
|
||||
"paragraph_index": {
|
||||
"title": "Paragraph Index",
|
||||
"type": "integer"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"filename",
|
||||
"paragraph_index"
|
||||
],
|
||||
"title": "get_paragraph_text_from_documentArguments"
|
||||
},
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"name": "find_text_in_document",
|
||||
"description": "Find occurrences of specific text in a Word document.\n\nArgs:\n filename: Path to the Word document\n text_to_find: Text to search for in the document\n match_case: Whether to match case (True) or ignore case (False)\n whole_word: Whether to match whole words only (True) or substrings (False)\n",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"filename": {
|
||||
"title": "Filename",
|
||||
"type": "string"
|
||||
},
|
||||
"text_to_find": {
|
||||
"title": "Text To Find",
|
||||
"type": "string"
|
||||
},
|
||||
"match_case": {
|
||||
"default": true,
|
||||
"title": "Match Case",
|
||||
"type": "boolean"
|
||||
},
|
||||
"whole_word": {
|
||||
"default": false,
|
||||
"title": "Whole Word",
|
||||
"type": "boolean"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"filename",
|
||||
"text_to_find"
|
||||
],
|
||||
"title": "find_text_in_documentArguments"
|
||||
},
|
||||
"enabled": true
|
||||
},
|
||||
{
|
||||
"name": "convert_to_pdf",
|
||||
"description": "Convert a Word document to PDF format.\n\nArgs:\n filename: Path to the Word document\n output_filename: Optional path for the output PDF. If not provided, \n will use the same name with .pdf extension\n",
|
||||
"inputSchema": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"filename": {
|
||||
"title": "Filename",
|
||||
"type": "string"
|
||||
},
|
||||
"output_filename": {
|
||||
"anyOf": [
|
||||
{
|
||||
"type": "string"
|
||||
},
|
||||
{
|
||||
"type": "null"
|
||||
}
|
||||
],
|
||||
"default": null,
|
||||
"title": "Output Filename"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"filename"
|
||||
],
|
||||
"title": "convert_to_pdfArguments"
|
||||
},
|
||||
"enabled": true
|
||||
}
|
||||
],
|
||||
"enableWebSearch": false,
|
||||
@ -1499,6 +621,23 @@
|
||||
"parallelToolCalls": true
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "工具",
|
||||
"icon": "icon-tool",
|
||||
"type": "blank",
|
||||
"componentIndex": 2,
|
||||
"storage": {
|
||||
"activeNames": [
|
||||
0
|
||||
],
|
||||
"formData": {
|
||||
"url": "",
|
||||
"launchOptions": {},
|
||||
"allowDangerous": false
|
||||
},
|
||||
"currentToolName": "k_navigate"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
@ -116,14 +116,18 @@ export function getWorkspaceConnectionConfig() {
|
||||
|
||||
const workspacePath = getWorkspacePath();
|
||||
for (let item of connection.items) {
|
||||
item = Array.isArray(item) ? item[0] : item;
|
||||
const itemType = item.type || item.connectionType;
|
||||
const connections = Array.isArray(item) ? item : [item];
|
||||
for (let connection of connections) {
|
||||
const connectionType = (connection.type || connection.connectionType).toUpperCase() as ConnectionType;
|
||||
connection.type = undefined;
|
||||
connection.connectionType = connectionType;
|
||||
|
||||
if (item.filePath && item.filePath.startsWith('{workspace}')) {
|
||||
item.filePath = item.filePath.replace('{workspace}', workspacePath).replace(/\\/g, '/');
|
||||
}
|
||||
if (itemType === 'STDIO' && item.cwd && item.cwd.startsWith('{workspace}')) {
|
||||
item.cwd = item.cwd.replace('{workspace}', workspacePath).replace(/\\/g, '/');
|
||||
if (connection.filePath && connection.filePath.startsWith('{workspace}')) {
|
||||
connection.filePath = connection.filePath.replace('{workspace}', workspacePath).replace(/\\/g, '/');
|
||||
}
|
||||
if (connectionType === 'STDIO' && connection.cwd && connection.cwd.startsWith('{workspace}')) {
|
||||
connection.cwd = connection.cwd.replace('{workspace}', workspacePath).replace(/\\/g, '/');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -165,16 +169,18 @@ export function saveWorkspaceConnectionConfig(workspace: string) {
|
||||
|
||||
const workspacePath = getWorkspacePath();
|
||||
for (let item of connectionConfig.items) {
|
||||
const connections = Array.isArray(item)? item : [item];
|
||||
for (let connection of connections) {
|
||||
const connectionType = (connection.type || connection.connectionType).toUpperCase() as ConnectionType;
|
||||
connection.type = undefined;
|
||||
connection.connectionType = connectionType;
|
||||
|
||||
item = Array.isArray(item) ? item[0] : item;
|
||||
const itemType = item.type || item.connectionType;
|
||||
item.type = undefined;
|
||||
|
||||
if (item.filePath && item.filePath.replace(/\\/g, '/').startsWith(workspacePath)) {
|
||||
item.filePath = item.filePath.replace(workspacePath, '{workspace}').replace(/\\/g, '/');
|
||||
}
|
||||
if (item.type === 'STDIO' && item.cwd && item.cwd.replace(/\\/g, '/').startsWith(workspacePath)) {
|
||||
item.cwd = item.cwd.replace(workspacePath, '{workspace}').replace(/\\/g, '/');
|
||||
if (connection.filePath && connection.filePath.replace(/\\/g, '/').startsWith(workspacePath)) {
|
||||
connection.filePath = connection.filePath.replace(workspacePath, '{workspace}').replace(/\\/g, '/');
|
||||
}
|
||||
if (connectionType === 'STDIO' && connection.cwd && connection.cwd.replace(/\\/g, '/').startsWith(workspacePath)) {
|
||||
connection.cwd = connection.cwd.replace(workspacePath, '{workspace}').replace(/\\/g, '/');
|
||||
}
|
||||
}
|
||||
}
|
||||
fs.writeFileSync(connectionConfigPath, JSON.stringify(connectionConfig, null, 2), 'utf-8');
|
||||
|
@ -101,6 +101,10 @@ export function revealOpenMcpWebviewPanel(
|
||||
}
|
||||
break;
|
||||
|
||||
case 'vscode/clipboard/writeText':
|
||||
vscode.env.clipboard.writeText(data.text);
|
||||
break;
|
||||
|
||||
default:
|
||||
routeMessage(command, data, panel.webview);
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user