* Compute a stable hash for (toolName, args). Uses sorted JSON to be * insensitive to argument-key order.
(name, args)
| 82 | * insensitive to argument-key order. |
| 83 | */ |
| 84 | _hash(name, args) { |
| 85 | const norm = JSON.stringify(args || {}, Object.keys(args || {}).sort()); |
| 86 | return crypto.createHash('sha1').update(name + '|' + norm).digest('hex').slice(0, 16); |
| 87 | } |
| 88 | |
| 89 | /** |
| 90 | * Check whether (name, args) was just executed. Returns the cached result |