(toolName: string, args: any)
| 32 | private misses = 0; |
| 33 | |
| 34 | private keyFor(toolName: string, args: any): string { |
| 35 | if (args === null || args === undefined) return toolName; |
| 36 | if (typeof args !== 'object') return `${toolName}:${String(args)}`; |
| 37 | const sortedKeys = Object.keys(args).sort(); |
| 38 | const ordered: any = {}; |
| 39 | for (const k of sortedKeys) ordered[k] = args[k]; |
| 40 | return `${toolName}:${JSON.stringify(ordered)}`; |
| 41 | } |
| 42 | |
| 43 | get(toolName: string, args: any): string | null { |
| 44 | const key = this.keyFor(toolName, args); |