@crediolabs/policy-synth 0.2.0 → 0.3.0

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.
Files changed (184) hide show
  1. package/README.md +4 -4
  2. package/dist/adapters/interpreter/adapter.d.ts +19 -25
  3. package/dist/adapters/interpreter/adapter.js +54 -487
  4. package/dist/adapters/interpreter/index.d.ts +1 -1
  5. package/dist/adapters/interpreter/index.js +1 -1
  6. package/dist/adapters/oz/adapter.js +1 -15
  7. package/dist/errors.d.ts +1 -1
  8. package/dist/index.d.ts +1 -4
  9. package/dist/index.js +1 -4
  10. package/dist/install/build-add-context-rule.d.ts +3 -19
  11. package/dist/install/build-add-context-rule.js +3 -98
  12. package/dist/install/build-install-policy.d.ts +4 -53
  13. package/dist/install/build-install-policy.js +44 -123
  14. package/dist/install/index.d.ts +0 -2
  15. package/dist/install/index.js +0 -7
  16. package/dist/ir/index.d.ts +1 -1
  17. package/dist/ir/types.d.ts +7 -76
  18. package/dist/ir/types.js +0 -2
  19. package/dist/predicate/decode.d.ts +1 -1
  20. package/dist/predicate/decode.js +2 -70
  21. package/dist/predicate/encode.js +45 -229
  22. package/dist/predicate/from-json.js +1 -42
  23. package/dist/record/decode.js +3 -8
  24. package/dist/review-card/builder.d.ts +4 -3
  25. package/dist/review-card/builder.js +18 -162
  26. package/dist/review-card/cross-check.js +2 -105
  27. package/dist/review-card/render-leaf.d.ts +4 -0
  28. package/dist/review-card/render-leaf.js +47 -0
  29. package/dist/run/index.d.ts +36 -139
  30. package/dist/run/index.js +125 -437
  31. package/dist/run/schemas.d.ts +168 -1929
  32. package/dist/run/schemas.js +40 -269
  33. package/dist/seams/types.d.ts +0 -2
  34. package/dist/simulate/deny-cases.d.ts +26 -0
  35. package/dist/simulate/deny-cases.js +282 -0
  36. package/dist/simulate/evaluate.d.ts +18 -0
  37. package/dist/simulate/evaluate.js +271 -0
  38. package/dist/simulate/index.d.ts +4 -0
  39. package/dist/simulate/index.js +8 -0
  40. package/dist/synth/compose-from-recording.d.ts +24 -51
  41. package/dist/synth/compose-from-recording.js +120 -282
  42. package/dist/synth/deny-cases.d.ts +5 -7
  43. package/dist/synth/deny-cases.js +23 -373
  44. package/dist/synth/evaluate.d.ts +0 -21
  45. package/dist/synth/evaluate.js +56 -336
  46. package/dist/synth/index.d.ts +0 -5
  47. package/dist/synth/index.js +0 -5
  48. package/dist/synth/permit-context.d.ts +2 -9
  49. package/dist/synth/permit-context.js +1 -82
  50. package/dist/synth/synthesize-from-recording.d.ts +1 -29
  51. package/dist/synth/synthesize-from-recording.js +41 -356
  52. package/dist/types.d.ts +8 -60
  53. package/dist/types.js +5 -2
  54. package/dist/verify/simulate.d.ts +1 -14
  55. package/dist/verify/simulate.js +2 -88
  56. package/dist/verify/verify.d.ts +1 -7
  57. package/dist/verify/verify.js +0 -8
  58. package/dist-cjs/adapters/interpreter/adapter.d.ts +19 -25
  59. package/dist-cjs/adapters/interpreter/adapter.js +56 -489
  60. package/dist-cjs/adapters/interpreter/index.d.ts +1 -1
  61. package/dist-cjs/adapters/interpreter/index.js +1 -2
  62. package/dist-cjs/adapters/oz/adapter.js +1 -15
  63. package/dist-cjs/errors.d.ts +1 -1
  64. package/dist-cjs/index.d.ts +1 -4
  65. package/dist-cjs/index.js +1 -4
  66. package/dist-cjs/install/build-add-context-rule.d.ts +3 -19
  67. package/dist-cjs/install/build-add-context-rule.js +1 -97
  68. package/dist-cjs/install/build-install-policy.d.ts +4 -53
  69. package/dist-cjs/install/build-install-policy.js +44 -122
  70. package/dist-cjs/install/index.d.ts +0 -2
  71. package/dist-cjs/install/index.js +2 -23
  72. package/dist-cjs/ir/index.d.ts +1 -1
  73. package/dist-cjs/ir/types.d.ts +7 -76
  74. package/dist-cjs/ir/types.js +0 -2
  75. package/dist-cjs/predicate/decode.d.ts +1 -1
  76. package/dist-cjs/predicate/decode.js +2 -70
  77. package/dist-cjs/predicate/encode.js +45 -229
  78. package/dist-cjs/predicate/from-json.js +1 -42
  79. package/dist-cjs/record/decode.js +3 -8
  80. package/dist-cjs/review-card/builder.d.ts +4 -3
  81. package/dist-cjs/review-card/builder.js +23 -167
  82. package/dist-cjs/review-card/cross-check.js +7 -110
  83. package/dist-cjs/review-card/render-leaf.d.ts +4 -0
  84. package/dist-cjs/review-card/render-leaf.js +52 -0
  85. package/dist-cjs/run/index.d.ts +36 -139
  86. package/dist-cjs/run/index.js +125 -444
  87. package/dist-cjs/run/schemas.d.ts +168 -1929
  88. package/dist-cjs/run/schemas.js +41 -270
  89. package/dist-cjs/seams/types.d.ts +0 -2
  90. package/dist-cjs/simulate/deny-cases.d.ts +26 -0
  91. package/dist-cjs/simulate/deny-cases.js +286 -0
  92. package/dist-cjs/simulate/evaluate.d.ts +18 -0
  93. package/dist-cjs/simulate/evaluate.js +274 -0
  94. package/dist-cjs/simulate/index.d.ts +4 -0
  95. package/dist-cjs/simulate/index.js +13 -0
  96. package/dist-cjs/synth/compose-from-recording.d.ts +24 -51
  97. package/dist-cjs/synth/compose-from-recording.js +120 -282
  98. package/dist-cjs/synth/deny-cases.d.ts +5 -7
  99. package/dist-cjs/synth/deny-cases.js +23 -374
  100. package/dist-cjs/synth/evaluate.d.ts +0 -21
  101. package/dist-cjs/synth/evaluate.js +57 -337
  102. package/dist-cjs/synth/index.d.ts +0 -5
  103. package/dist-cjs/synth/index.js +1 -11
  104. package/dist-cjs/synth/permit-context.d.ts +2 -9
  105. package/dist-cjs/synth/permit-context.js +1 -82
  106. package/dist-cjs/synth/synthesize-from-recording.d.ts +1 -29
  107. package/dist-cjs/synth/synthesize-from-recording.js +39 -354
  108. package/dist-cjs/types.d.ts +8 -60
  109. package/dist-cjs/types.js +6 -3
  110. package/dist-cjs/verify/simulate.d.ts +1 -14
  111. package/dist-cjs/verify/simulate.js +2 -88
  112. package/dist-cjs/verify/verify.d.ts +1 -7
  113. package/dist-cjs/verify/verify.js +0 -8
  114. package/package.json +4 -4
  115. package/src/adapters/interpreter/adapter.ts +76 -572
  116. package/src/errors.ts +0 -19
  117. package/src/index.ts +1 -4
  118. package/src/install/build-add-context-rule.ts +5 -139
  119. package/src/install/build-install-policy.ts +93 -214
  120. package/src/install/index.ts +0 -34
  121. package/src/predicate/decode.ts +2 -70
  122. package/src/predicate/encode.ts +49 -261
  123. package/src/predicate/from-json.ts +1 -43
  124. package/src/record/decode.ts +3 -8
  125. package/src/review-card/builder.ts +19 -168
  126. package/src/review-card/cross-check.ts +3 -105
  127. package/src/review-card/render-leaf.ts +48 -0
  128. package/src/run/index.ts +144 -572
  129. package/src/run/schemas.ts +42 -291
  130. package/src/simulate/deny-cases.ts +334 -0
  131. package/src/simulate/evaluate.ts +284 -0
  132. package/src/simulate/index.ts +11 -0
  133. package/src/synth/compose-from-recording.ts +148 -347
  134. package/src/synth/index.ts +0 -13
  135. package/src/synth/synthesize-from-recording.ts +43 -456
  136. package/src/types.ts +13 -49
  137. package/dist/install/authority-overlap.d.ts +0 -134
  138. package/dist/install/authority-overlap.js +0 -0
  139. package/dist/install/build-install-predicate.d.ts +0 -96
  140. package/dist/install/build-install-predicate.js +0 -444
  141. package/dist/install/build-merge-policy.d.ts +0 -70
  142. package/dist/install/build-merge-policy.js +0 -130
  143. package/dist/install/plan-merge-policy.d.ts +0 -49
  144. package/dist/install/plan-merge-policy.js +0 -86
  145. package/dist/install/read-account-rules.d.ts +0 -100
  146. package/dist/install/read-account-rules.js +0 -283
  147. package/dist-cjs/install/authority-overlap.d.ts +0 -134
  148. package/dist-cjs/install/authority-overlap.js +0 -0
  149. package/dist-cjs/install/build-install-predicate.d.ts +0 -96
  150. package/dist-cjs/install/build-install-predicate.js +0 -479
  151. package/dist-cjs/install/build-merge-policy.d.ts +0 -70
  152. package/dist-cjs/install/build-merge-policy.js +0 -134
  153. package/dist-cjs/install/plan-merge-policy.d.ts +0 -49
  154. package/dist-cjs/install/plan-merge-policy.js +0 -90
  155. package/dist-cjs/install/read-account-rules.d.ts +0 -100
  156. package/dist-cjs/install/read-account-rules.js +0 -296
  157. package/src/adapters/interpreter/index.ts +0 -8
  158. package/src/adapters/oz/adapter.ts +0 -376
  159. package/src/adapters/oz/index.ts +0 -9
  160. package/src/codegen/compile-gate.ts +0 -167
  161. package/src/codegen/index.ts +0 -17
  162. package/src/codegen/template.ts +0 -165
  163. package/src/install/authority-overlap.ts +0 -0
  164. package/src/install/build-merge-policy.ts +0 -219
  165. package/src/install/plan-merge-policy.ts +0 -133
  166. package/src/install/read-account-rules.ts +0 -376
  167. package/src/ir/index.ts +0 -13
  168. package/src/ir/types.ts +0 -132
  169. package/src/mandate/index.ts +0 -4
  170. package/src/mandate/to-ir.ts +0 -71
  171. package/src/mandate/types.ts +0 -21
  172. package/src/seams/index.ts +0 -11
  173. package/src/seams/types.ts +0 -81
  174. package/src/synth/deny-cases.ts +0 -663
  175. package/src/synth/evaluate.ts +0 -613
  176. package/src/synth/harness.ts +0 -68
  177. package/src/synth/minimize.ts +0 -48
  178. package/src/synth/permit-context.ts +0 -136
  179. package/src/synth/predicate-literals.ts +0 -27
  180. package/src/synth/synthesize-from-mandate.ts +0 -82
  181. package/src/verify/envelope.ts +0 -28
  182. package/src/verify/index.ts +0 -5
  183. package/src/verify/simulate.ts +0 -311
  184. package/src/verify/verify.ts +0 -243
@@ -1,11 +1,9 @@
1
1
  import { type ErrorCode, type PredicateNode, type ProposedPolicy, type RecordedTransaction, type ToolError, type ToolResponse } from '../index.ts';
2
- import { type AuthorityOverlap } from '../install/authority-overlap.ts';
3
2
  import { type BuildInstallPolicyResult, type BuildRevokePolicyResult } from '../install/build-install-policy.ts';
4
3
  import { getInterpreterInfo } from '../install/get-interpreter-info.ts';
5
- import type { SimulationResult } from '../verify/envelope.ts';
6
4
  import { type RecordTransactionInput, type SimulatePolicyInput, type SynthesizePolicyInput, type VerifyPolicyInput } from './schemas.ts';
7
5
  export type { GetInterpreterInfoInput, InstallPolicyInput, RecordTransactionInput, RevokePolicyInput, SimulatePolicyInput, SynthesizePolicyInput, VerifyPolicyInput, } from './schemas.ts';
8
- export { ComposeUserResponsesSchema, GetInterpreterInfoInputSchema, InstallPolicyInputSchema, InterpreterOptionsSchema, MAINNET_RPC_URL, MandateSpecSchema, NetworkSchema, OraclePriceFixtureSchema, OzAdapterConfigSchema, PINNED_INTERPRETER_ADDRESS_BY_NETWORK, PINNED_INTERPRETER_GRAMMAR_VERSION, PINNED_INTERPRETER_MAINNET_ADDRESS, PINNED_INTERPRETER_TESTNET_ADDRESS, PINNED_INTERPRETER_WASM_SHA256_BY_NETWORK, PredicateLeafSchema, PredicateNodeSchema, RecordedTransactionSchema, RecordTransactionInputSchema, RevokePolicyInputSchema, RPC_URL_BY_NETWORK, SimulatePolicyInputSchema, SynthesizePolicyInputSchema, TESTNET_RPC_URL, ToolErrorSchema, VerifyPolicyInputSchema, } from './schemas.ts';
6
+ export { ComposeUserResponsesSchema, GetInterpreterInfoInputSchema, InstallPolicyInputSchema, InterpreterOptionsSchema, MAINNET_RPC_URL, NetworkSchema, PINNED_INTERPRETER_ADDRESS_BY_NETWORK, PINNED_INTERPRETER_GRAMMAR_VERSION, PINNED_INTERPRETER_MAINNET_ADDRESS, PINNED_INTERPRETER_TESTNET_ADDRESS, PINNED_INTERPRETER_WASM_SHA256, PredicateLeafSchema, PredicateNodeSchema, RecordedTransactionSchema, RecordTransactionInputSchema, RevokePolicyInputSchema, RPC_URL_BY_NETWORK, SynthesizePolicyInputSchema, TESTNET_RPC_URL, ToolErrorSchema, } from './schemas.ts';
9
7
  export type RunRecordTransactionInput = RecordTransactionInput;
10
8
  export type RunSynthesizePolicyInput = SynthesizePolicyInput;
11
9
  export type RunSimulatePolicyInput = SimulatePolicyInput;
@@ -24,7 +22,6 @@ type RunToolName = 'record_transaction' | 'synthesize_policy' | 'simulate_policy
24
22
  * the agent always sees a machine-readable error code. */
25
23
  export declare function runRecordTransaction(raw: unknown): Promise<ToolResponse<RecordedTransaction>>;
26
24
  /** `synthesize_policy` body - discriminated union on `source`:
27
- * - `mandate` -> synthesizeFromMandate
28
25
  * - `recording` -> synthesizeFromRecording
29
26
  * Exposing BOTH front-ends through ONE tool keeps the MCP surface tiny while
30
27
  * letting the agent pick the deterministic or the inferred path. The CLI
@@ -38,120 +35,9 @@ export declare function runRecordTransaction(raw: unknown): Promise<ToolResponse
38
35
  export declare function runSynthesizePolicy(raw: unknown): Promise<ToolResponse<ProposedPolicy> & {
39
36
  explain?: {
40
37
  predicateTree: PredicateNode | null;
41
- simulation: SimulationResult;
42
38
  };
43
39
  }>;
44
- /** `simulate_policy` body - thin wrapper over `simulatePolicy`. The engine
45
- * already returns fail-closed `{ok:false, error}` for runtime failures
46
- * (SIMULATION_ERROR), so the try/catch envelope is for raw SDK throws
47
- * only - same pattern as the other two wrappers. The predicate is
48
- * passed inline (stateless by design; no `proposed_policy_id` lookup). */
49
- export declare function runSimulatePolicy(raw: unknown): Promise<ToolResponse<SimulationResult>>;
50
- /** `verify_policy` body - thin wrapper over `verifyPolicy`. The engine
51
- * already returns `{ok:false, error}` with code VERIFICATION_FAILED when
52
- * the minimality check fails; the try/catch envelope is for raw SDK
53
- * throws only. Mirrors `runSimulatePolicy` exactly. */
54
- export declare function runVerifyPolicy(raw: unknown): Promise<ToolResponse<true>>;
55
- /** `install_policy` body - thin wrapper over `buildInstallPolicyXdr`.
56
- * Returns the unsigned Soroban transaction envelope (base64 XDR) the
57
- * wallet signs. The wallet signature IS the user-confirmation step - no
58
- * `action_id` two-call pair (the server is stateless, see server.ts:10-12).
59
- * One call installs the policy outright: `add_context_rule` carries the
60
- * predicate to the interpreter in its `policies` install_param, so no
61
- * separate `interpreter.install` call is needed or possible.
62
- *
63
- * Default-deny: an interpreter policy address other than the pinned
64
- * interpreter for the selected network is REFUSED (the smart account
65
- * would delegate to an interpreter the caller controls); the same
66
- * applies to a non-pinned RPC URL (the auth nonce the wallet signs
67
- * comes from the RPC). Both gates accept an explicit opt-in flag.
68
- * Pin selection follows `input.network` (defaults to `testnet` so the
69
- * pre-mainnet callers keep working unchanged). */
70
- export declare function runInstallPolicy(raw: unknown): Promise<ToolResponse<InstallPolicyResult>>;
71
- /** Default-deny on the cross-rule scan.
72
- *
73
- * Refuses whenever the scan cannot establish that this policy binds the calls
74
- * it names. An unpoliced neighbour provably does not constrain them. An
75
- * opaque one, policed by a contract this tool cannot decode, is not KNOWN to,
76
- * and "not known to" is not "safe" - the same posture as the interpreter and
77
- * RPC pins. An incomplete scan is refused for the same reason: the overlap
78
- * list is then a subset of the account, so an empty list proves nothing.
79
- *
80
- * `not-restricting` is reported but does NOT block. Both rules are ours and
81
- * both constrain the calls, and the conjunction remedy is offered; refusing
82
- * there would also block the legitimate act of adding a separate capability,
83
- * which OZ composes correctly as a union.
84
- *
85
- * Returns a ToolError or null, matching `enforceInterpreterPin`. */
86
- export declare function enforceAuthorityScan(scan: AuthorityScanReport | undefined, allowOverlap: boolean | undefined): ToolError | null;
87
- /** The install response, plus what the cross-rule scan found. The scan is
88
- * advisory data about the account, not part of the transaction, so it is
89
- * additive: a caller that ignores it gets exactly the previous shape. */
90
- export type InstallPolicyResult = BuildInstallPolicyResult & {
91
- authorityScan?: AuthorityScanReport;
92
- };
93
- /** What the cross-rule scan found, carried on the install response so the
94
- * review surface can show it alongside the transaction being signed.
95
- *
96
- * SCOPE, and it is narrow: this answers "can a signer OF THIS RULE reach the
97
- * same calls through a different rule". A rule sharing no signer with this
98
- * one cannot be reached by this rule's signers, so it is not a way around
99
- * this policy; it is a different principal's authority, which no policy
100
- * installed here was ever going to constrain. Other rules keep their own
101
- * signers, and an account administrator can add signers or rules afterwards.
102
- *
103
- * An empty `overlaps` is therefore NOT a statement that the account is safe,
104
- * only that this rule's own signers gain no unconstrained path through the
105
- * rules that exist right now. */
106
- export interface AuthorityScanReport {
107
- /** False when the scan did not run. `reason` then says why, and the absence
108
- * of overlaps proves nothing. */
109
- ran: boolean;
110
- /** True when the caller passed `skipAuthorityScan`. Distinguishes a
111
- * deliberate skip from a scan that tried and failed: both carry
112
- * `ran: false`, but only the failure refuses the install. Recorded rather
113
- * than omitted so the response shows that no opinion was formed, instead
114
- * of looking like a version that never had the check. */
115
- skipped?: boolean;
116
- /** True when the account has more rules than the scan accounted for, so the
117
- * overlap list is a subset. */
118
- incomplete?: boolean;
119
- reason?: string;
120
- overlaps: AuthorityOverlap[];
121
- }
122
- /** The merge response: one step's transaction plus what it will cost. */
123
- export interface MergePolicyResult {
124
- unsignedXdr: string;
125
- smartAccount: string;
126
- sourceAccount: string;
127
- step: 'detach' | 'reinstall';
128
- call: {
129
- contract: string;
130
- fn: string;
131
- ruleId: number;
132
- };
133
- authNonce: string;
134
- authValidUntilLedger: number;
135
- rootInvocationXdr: string;
136
- /** sha256 of the merged predicate, so the caller can pin what step 2 will
137
- * install while they are still looking at step 1. */
138
- mergedPredicateHash: string;
139
- mergedPredicateBlobBase64: string;
140
- warnings: string[];
141
- followUp: string;
142
- }
143
- /** `merge_policy` body - the tightening remedy for a cross-rule overlap.
144
- *
145
- * Replaces a rule's predicate with the conjunction of it and a new one. This
146
- * is the action `install_policy` recommends when it reports an overlap
147
- * between two rules our interpreter polices, and it is deliberately NOT
148
- * something `install_policy` does on its own: it detaches a live policy, so
149
- * the operator has to ask for it.
150
- *
151
- * Two transactions in order. `add_policy` refuses a policy already on the
152
- * rule, so the old attachment goes first, and the second transaction cannot
153
- * be simulated until the first confirms. */
154
- export declare function runMergePolicy(raw: unknown): Promise<ToolResponse<MergePolicyResult>>;
40
+ export declare function runInstallPolicy(raw: unknown): Promise<ToolResponse<BuildInstallPolicyResult>>;
155
41
  /** `revoke_policy` body - thin wrapper over `buildRevokePolicyXdr`.
156
42
  * Emits an unsigned XDR for `account.remove_context_rule(ruleId)`; the
157
43
  * smart account itself handles uninstalling each attached policy. Auth
@@ -162,30 +48,41 @@ export declare function runMergePolicy(raw: unknown): Promise<ToolResponse<Merge
162
48
  * policy payload, so the interpreter pin is not re-checked here.
163
49
  * Pin selection follows `input.network` (defaults to `testnet`). */
164
50
  export declare function runRevokePolicy(raw: unknown): Promise<ToolResponse<BuildRevokePolicyResult>>;
165
- /** `get_interpreter_info` body - thin wrapper over `getInterpreterInfo`.
166
- * Returns the pinned deployment fingerprint + an optional live
167
- * `grammar_version()` comparison. The audit field is deliberately
168
- * OMITTED (phase-04's "audit #44" has no source of truth in the repo -
169
- * fabricating it would be a lie on a security surface; the live
170
- * mismatch check is worth MORE).
51
+ /** `simulate_policy` body - evaluate a predicate against one recorded call.
171
52
  *
172
- * Network-aware: `input.network` selects the interpreter address, the RPC
173
- * and the wasm hash. The networks run different binaries - testnet carries
174
- * the selector-leaf minimum and the signer-set cap, mainnet predates both -
175
- * so the hash is read through
176
- * `PINNED_INTERPRETER_WASM_SHA256_BY_NETWORK`. UNAUDITED at the time of
177
- * writing.
53
+ * The evaluator is a second implementation of the on-chain semantics, and the
54
+ * conformance harness asserts it agrees with the Rust interpreter case for
55
+ * case. A verdict here is therefore a claim about what the contract would do,
56
+ * not a guess. */
57
+ export declare function runSimulatePolicy(raw: unknown): ToolResponse<{
58
+ permitted: boolean;
59
+ reason: string | null;
60
+ call: {
61
+ contract: string;
62
+ fn: string;
63
+ argCount: number;
64
+ };
65
+ }>;
66
+ /** `verify_policy` body - the permit case plus a generated deny case per
67
+ * dimension.
178
68
  *
179
- * Same RPC pin as install/revoke: when `verifyLive` triggers an outbound
180
- * call, the auth-digest + the answer bind to whichever RPC answered, so
181
- * a non-pinned `rpcUrl` would silently bind the caller to a host they
182
- * picked. The pin is enforced here too, with the same `allowUnpinnedRpcUrl`
183
- * opt-in as install/revoke. */
69
+ * Two failure modes are being checked, and they are not the same thing. A
70
+ * permit case that denies means the policy is too STRICT: it would refuse the
71
+ * very transaction it was synthesised from. A deny case that permits means it
72
+ * is too LOOSE: some mutation of that transaction still gets through. `ok` is
73
+ * true only when neither holds. */
74
+ export declare function runVerifyPolicy(raw: unknown): ToolResponse<{
75
+ ok: boolean;
76
+ permit: {
77
+ permitted: boolean;
78
+ reason: string | null;
79
+ };
80
+ denies: Array<{
81
+ dimension: string;
82
+ denied: boolean;
83
+ reason: string | null;
84
+ }>;
85
+ dimensionsCovered: number;
86
+ }>;
184
87
  export declare function runGetInterpreterInfo(raw: unknown): Promise<ToolResponse<ReturnType<typeof getInterpreterInfo>>>;
185
- /** Build a canonical ToolError for a thrown exception caught by the tool
186
- * envelope. The MCP SDK stringifies thrown objects as "[object Object]" by
187
- * default, so we extract a string-friendly message and tag the original
188
- * error in `details` for the agent to inspect. Exported as a test-only seam
189
- * so the suite in run/index.test.ts can drive the envelope path without
190
- * standing up a full recordTransaction pipeline. */
191
88
  export declare function caughtError(toolName: RunToolName, code: ErrorCode, e: unknown): ToolError;