diff --git a/web/app/components/workflow/skill/editor/skill-editor/plugins/tool-block/utils.ts b/web/app/components/workflow/skill/editor/skill-editor/plugins/tool-block/utils.ts index 6c00ce42f5..78af716add 100644 --- a/web/app/components/workflow/skill/editor/skill-editor/plugins/tool-block/utils.ts +++ b/web/app/components/workflow/skill/editor/skill-editor/plugins/tool-block/utils.ts @@ -1,9 +1,9 @@ export const getToolTokenRegexString = (): string => { - return '§tool\\.[a-zA-Z0-9_-]+(?:\\/[a-zA-Z0-9_-]+)*\\.[a-zA-Z0-9_-]+\\.[a-fA-F0-9-]{36}§' + return '§\\[tool\\]\\.\\[[a-zA-Z0-9_-]+(?:\\/[a-zA-Z0-9_-]+)*\\]\\.\\[[a-zA-Z0-9_-]+\\]\\.\\[[a-fA-F0-9-]{36}\\]§' } export const parseToolToken = (text: string) => { - const match = /^§tool\.([\w-]+(?:\/[\w-]+)*)\.([\w-]+)\.([a-fA-F0-9-]{36})§$/.exec(text) + const match = /^§\[tool\]\.\[([\w-]+(?:\/[\w-]+)*)\]\.\[([\w-]+)\]\.\[([a-fA-F0-9-]{36})\]§$/.exec(text) if (!match) return null return { @@ -14,5 +14,5 @@ export const parseToolToken = (text: string) => { } export const buildToolToken = (payload: { provider: string, tool: string, configId: string }) => { - return `§tool.${payload.provider}.${payload.tool}.${payload.configId}§` + return `§[tool].[${payload.provider}].[${payload.tool}].[${payload.configId}]§` } diff --git a/web/app/components/workflow/skill/skill-doc-editor.tsx b/web/app/components/workflow/skill/skill-doc-editor.tsx index 8d64d9868b..62c21ac746 100644 --- a/web/app/components/workflow/skill/skill-doc-editor.tsx +++ b/web/app/components/workflow/skill/skill-doc-editor.tsx @@ -157,6 +157,7 @@ const SkillDocEditor: FC = () => {