(tool: Tool.Info)
| 72 | } |
| 73 | |
| 74 | export async function register(tool: Tool.Info) { |
| 75 | const { custom } = await state() |
| 76 | const idx = custom.findIndex((t) => t.id === tool.id) |
| 77 | if (idx >= 0) { |
| 78 | custom.splice(idx, 1, tool) |
| 79 | return |
| 80 | } |
| 81 | custom.push(tool) |
| 82 | } |
| 83 | |
| 84 | async function all(): Promise<Tool.Info[]> { |
| 85 | const custom = await state().then((x) => x.custom) |