chore: fix choose provder id

This commit is contained in:
Joel
2026-01-16 11:30:42 +08:00
parent c7bca6a3fb
commit 64ddcc8960
2 changed files with 5 additions and 5 deletions

View File

@ -46,7 +46,7 @@ const ToolPickerBlock: FC<ToolPickerBlockProps> = ({ scope = 'all' }) => {
tools.forEach((tool, index) => {
nodes.push(
$createToolBlockNode({
provider: tool.provider_name,
provider: tool.provider_id, // TODO: not sure use which tool.plugin_id ask
tool: tool.tool_name,
configId: uuid(),
label: tool.tool_label,
@ -104,8 +104,8 @@ const ToolPickerBlock: FC<ToolPickerBlockProps> = ({ scope = 'all' }) => {
return (
<LexicalTypeaheadMenuPlugin
options={options}
onSelectOption={() => {}}
onQueryChange={() => {}}
onSelectOption={() => { }}
onQueryChange={() => { }}
menuRenderFn={renderMenu}
triggerFn={checkForTriggerMatch}
anchorClassName="z-[999999] translate-y-[calc(-100%-3px)]"

View File

@ -1,9 +1,9 @@
export const getToolTokenRegexString = (): string => {
return '§tool\\.[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-]+)\.([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 {