* Compute a stable hash for (toolName, args). Same scheme used by lookup() * — sorted-keys JSON so callers can re-derive the key without instantiating * a ToolDedup.
(name, args)
| 62 | * a ToolDedup. |
| 63 | */ |
| 64 | function idempotentWriteKey(name, args) { |
| 65 | const norm = JSON.stringify(args || {}, Object.keys(args || {}).sort()); |
| 66 | return crypto.createHash('sha1').update(name + '|' + norm).digest('hex').slice(0, 16); |
| 67 | } |
| 68 | |
| 69 | class ToolDedup { |
| 70 | constructor(options = {}) { |
no outgoing calls
no test coverage detected