@ljwei-stak/dsh-model-route-bot 0.65.0 → 0.66.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2699,10 +2699,20 @@ import { fileURLToPath as fileURLToPath2 } from "node:url";
2699
2699
 
2700
2700
  // ../packages/capability-broker/src/authority.mjs
2701
2701
  var PolicyError = class extends Error {
2702
- constructor(code) {
2702
+ /**
2703
+ * `detail.gate` names the checkpoint that refused, and `detail.rule` the rule
2704
+ * text when one matched. A refusal that only says "TOOL_DENIED" leaves the
2705
+ * reader to guess which of several gates stopped it, and support then runs on
2706
+ * pasted logs.
2707
+ */
2708
+ constructor(code, detail = {}) {
2703
2709
  super(`Capability refused: ${code}`);
2704
2710
  this.name = "PolicyError";
2705
2711
  this.code = code;
2712
+ if (detail && typeof detail === "object") {
2713
+ if (typeof detail.gate === "string" && detail.gate) this.gate = detail.gate;
2714
+ if (typeof detail.rule === "string" && detail.rule) this.rule = detail.rule;
2715
+ }
2706
2716
  }
2707
2717
  };
2708
2718