| 1004 | } |
| 1005 | |
| 1006 | function permLsp(p: ToolPermissionProps<typeof LspTool>): ToolPermissionInfo { |
| 1007 | const file = p.input.filePath || "" |
| 1008 | const line = typeof p.input.line === "number" ? p.input.line : undefined |
| 1009 | const char = typeof p.input.character === "number" ? p.input.character : undefined |
| 1010 | const pos = line !== undefined && char !== undefined ? `${line}:${char}` : undefined |
| 1011 | return { |
| 1012 | icon: "→", |
| 1013 | title: lspTitle(p.input, { home: true }), |
| 1014 | lines: [ |
| 1015 | ...(p.input.operation ? [`Operation: ${p.input.operation}`] : []), |
| 1016 | ...(file ? [`Path: ${toolPath(file, { home: true })}`] : []), |
| 1017 | ...(pos ? [`Position: ${pos}`] : []), |
| 1018 | ], |
| 1019 | } |
| 1020 | } |
| 1021 | |
| 1022 | const TOOL_RULES = { |
| 1023 | invalid: { |