@vorim/sdk 4.4.0 → 4.5.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 (120) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/{_commerce-core-B800cza0.d.cts → _commerce-core-QF7IKCKQ.d.cts} +1 -1
  3. package/dist/{_commerce-core-Bv_2hfKP.d.ts → _commerce-core-jih7k4hQ.d.ts} +1 -1
  4. package/dist/index.cjs +199 -3
  5. package/dist/index.cjs.map +1 -1
  6. package/dist/index.d.cts +151 -3
  7. package/dist/index.d.ts +151 -3
  8. package/dist/index.js +198 -3
  9. package/dist/index.js.map +1 -1
  10. package/dist/integrations/amazon.d.cts +2 -2
  11. package/dist/integrations/amazon.d.ts +2 -2
  12. package/dist/integrations/anthropic.d.cts +1 -1
  13. package/dist/integrations/anthropic.d.ts +1 -1
  14. package/dist/integrations/ap2.d.cts +1 -1
  15. package/dist/integrations/ap2.d.ts +1 -1
  16. package/dist/integrations/aws-iam.d.cts +1 -1
  17. package/dist/integrations/aws-iam.d.ts +1 -1
  18. package/dist/integrations/bank-rails.d.cts +1 -1
  19. package/dist/integrations/bank-rails.d.ts +1 -1
  20. package/dist/integrations/circle.d.cts +1 -1
  21. package/dist/integrations/circle.d.ts +1 -1
  22. package/dist/integrations/cloudflare.d.cts +1 -1
  23. package/dist/integrations/cloudflare.d.ts +1 -1
  24. package/dist/integrations/coinbase-cdp.d.cts +1 -1
  25. package/dist/integrations/coinbase-cdp.d.ts +1 -1
  26. package/dist/integrations/commerce-agents.d.cts +1 -1
  27. package/dist/integrations/commerce-agents.d.ts +1 -1
  28. package/dist/integrations/crewai.d.cts +1 -1
  29. package/dist/integrations/crewai.d.ts +1 -1
  30. package/dist/integrations/delivery.d.cts +2 -2
  31. package/dist/integrations/delivery.d.ts +2 -2
  32. package/dist/integrations/ebay.d.cts +2 -2
  33. package/dist/integrations/ebay.d.ts +2 -2
  34. package/dist/integrations/entra.d.cts +1 -1
  35. package/dist/integrations/entra.d.ts +1 -1
  36. package/dist/integrations/etsy.d.cts +2 -2
  37. package/dist/integrations/etsy.d.ts +2 -2
  38. package/dist/integrations/eu-providers.d.cts +1 -1
  39. package/dist/integrations/eu-providers.d.ts +1 -1
  40. package/dist/integrations/fhir.d.cts +1 -1
  41. package/dist/integrations/fhir.d.ts +1 -1
  42. package/dist/integrations/google-merchant.d.cts +2 -2
  43. package/dist/integrations/google-merchant.d.ts +2 -2
  44. package/dist/integrations/grok.d.cts +1 -1
  45. package/dist/integrations/grok.d.ts +1 -1
  46. package/dist/integrations/guidewire.d.cts +1 -1
  47. package/dist/integrations/guidewire.d.ts +1 -1
  48. package/dist/integrations/hermes.d.cts +1 -1
  49. package/dist/integrations/hermes.d.ts +1 -1
  50. package/dist/integrations/jira.d.cts +1 -1
  51. package/dist/integrations/jira.d.ts +1 -1
  52. package/dist/integrations/langchain.d.cts +1 -1
  53. package/dist/integrations/langchain.d.ts +1 -1
  54. package/dist/integrations/langgraph.d.cts +1 -1
  55. package/dist/integrations/langgraph.d.ts +1 -1
  56. package/dist/integrations/legal.d.cts +1 -1
  57. package/dist/integrations/legal.d.ts +1 -1
  58. package/dist/integrations/life-sciences.d.cts +1 -1
  59. package/dist/integrations/life-sciences.d.ts +1 -1
  60. package/dist/integrations/linear.d.cts +1 -1
  61. package/dist/integrations/linear.d.ts +1 -1
  62. package/dist/integrations/lithic.d.cts +1 -1
  63. package/dist/integrations/lithic.d.ts +1 -1
  64. package/dist/integrations/llamaindex.d.cts +1 -1
  65. package/dist/integrations/llamaindex.d.ts +1 -1
  66. package/dist/integrations/marqeta.d.cts +1 -1
  67. package/dist/integrations/marqeta.d.ts +1 -1
  68. package/dist/integrations/meta.d.cts +2 -2
  69. package/dist/integrations/meta.d.ts +2 -2
  70. package/dist/integrations/mistral.d.cts +1 -1
  71. package/dist/integrations/mistral.d.ts +1 -1
  72. package/dist/integrations/modern-treasury.d.cts +1 -1
  73. package/dist/integrations/modern-treasury.d.ts +1 -1
  74. package/dist/integrations/muse.d.cts +1 -1
  75. package/dist/integrations/muse.d.ts +1 -1
  76. package/dist/integrations/nekuda.d.cts +1 -1
  77. package/dist/integrations/nekuda.d.ts +1 -1
  78. package/dist/integrations/okta.d.cts +1 -1
  79. package/dist/integrations/okta.d.ts +1 -1
  80. package/dist/integrations/openai.d.cts +1 -1
  81. package/dist/integrations/openai.d.ts +1 -1
  82. package/dist/integrations/openrouter.d.cts +1 -1
  83. package/dist/integrations/openrouter.d.ts +1 -1
  84. package/dist/integrations/paypal-agent.d.cts +1 -1
  85. package/dist/integrations/paypal-agent.d.ts +1 -1
  86. package/dist/integrations/perplexity.d.cts +1 -1
  87. package/dist/integrations/perplexity.d.ts +1 -1
  88. package/dist/integrations/plaid.d.cts +1 -1
  89. package/dist/integrations/plaid.d.ts +1 -1
  90. package/dist/integrations/ramp.d.cts +1 -1
  91. package/dist/integrations/ramp.d.ts +1 -1
  92. package/dist/integrations/shopify.d.cts +1 -1
  93. package/dist/integrations/shopify.d.ts +1 -1
  94. package/dist/integrations/siem.d.cts +1 -1
  95. package/dist/integrations/siem.d.ts +1 -1
  96. package/dist/integrations/skyfire.d.cts +1 -1
  97. package/dist/integrations/skyfire.d.ts +1 -1
  98. package/dist/integrations/social-ads.d.cts +2 -2
  99. package/dist/integrations/social-ads.d.ts +2 -2
  100. package/dist/integrations/stripe-acp.d.cts +1 -1
  101. package/dist/integrations/stripe-acp.d.ts +1 -1
  102. package/dist/integrations/stripe-issuing.d.cts +1 -1
  103. package/dist/integrations/stripe-issuing.d.ts +1 -1
  104. package/dist/integrations/tiktok-shop.d.cts +2 -2
  105. package/dist/integrations/tiktok-shop.d.ts +2 -2
  106. package/dist/integrations/truanon.d.cts +1 -1
  107. package/dist/integrations/truanon.d.ts +1 -1
  108. package/dist/integrations/typesafe.d.cts +1 -1
  109. package/dist/integrations/typesafe.d.ts +1 -1
  110. package/dist/integrations/ucp.d.cts +1 -1
  111. package/dist/integrations/ucp.d.ts +1 -1
  112. package/dist/integrations/vercel-ai.d.cts +1 -1
  113. package/dist/integrations/vercel-ai.d.ts +1 -1
  114. package/dist/integrations/walmart.d.cts +2 -2
  115. package/dist/integrations/walmart.d.ts +2 -2
  116. package/dist/integrations/x402.d.cts +1 -1
  117. package/dist/integrations/x402.d.ts +1 -1
  118. package/dist/{types-BI7fk5gL.d.cts → types-3hhqtL0W.d.cts} +98 -1
  119. package/dist/{types-BI7fk5gL.d.ts → types-3hhqtL0W.d.ts} +98 -1
  120. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # Changelog — @vorim/sdk
2
2
 
3
+ ## 4.5.0
4
+
5
+ ### Added
6
+
7
+ - **Proven savings and timestamped case packs.** `recordActionOutcome({ decisionId, kind })` records what later happened (complaint, chargeback, confirmed fraud, reversed refund, no issue); `getSavingsReport()` gains `outcomes` (bad outcomes a shadow rule would have caught, ones no rule touched, refusals that drew complaints). `storeCasePack(caseRef)` keeps a pack stamped by an RFC 3161 TSA (DigiCert's public TSA by default), with `listStoredCasePacks` and `getStoredCasePack` (token plus the `openssl ts -verify` command).
8
+ - **Sign-off packs that keep themselves current.** Presets `refunds`, `collections`, `credit` and `aml` beside `hazards` and `fintech`; packs carry a PRA SS1/23 evidence mapping; the server re-runs an agent's latest pack when the rules change and raises `signoff.regressed` if the verdict got worse; `getSignoffDiff(id, againstId?)` lists what changed.
9
+ - **AP2 interop.** `exportMandateAp2(id)` returns the mandate as an Agent Payments Protocol v0.2 open Payment Mandate (SD-JWT, `vct: mandate.payment.open.1`, limits as `payment.amount_range`, `payment.budget`, `payment.agent_recurrence`, `payment.allowed_payees`); `importAp2Mandate({ sdJwt, issuerJwk, agentId, customerRef })` turns one into a pending Vorim mandate after checking the issuer signature and applying disclosures. Constraints Vorim cannot enforce are refused.
10
+ - **Hardware proof for mandate keys.** `getAttestationChallenge()`; `createMandate({ keyAttestation })` takes an Android Key Attestation chain or an Apple App Attest attestation, and `createMandate({ webauthn: { rpId, origin } })` makes a passkey mandate. `activateMandate` and `withdrawMandate` take a passkey assertion (`{ format: 'webauthn', ... }`) or an App Attest assertion (`{ format: 'app-attest', assertion }`) as well as a plain signature. The signed record says what was proven (`key_attestation`, `signature_assurance`: `passkey-synced` or `passkey-device-bound`, never conflated).
11
+ - **Case references.** `beforeAction()` and `declareIntent()` take `caseRef`, your case or customer reference (opaque: letters, digits, `. _ : @ -`, never a name). `getCasePack(caseRef)` returns a platform-signed case pack: every decision with its rule and signed approval lines, every intent and recorded outcome, and any customer mandate, in one timeline. `listCases({ days? })` lists the references seen.
12
+ - **Customer mandates.** `createMandate({ agentId, customerRef, alg: 'ES256' | 'EdDSA', publicKeyJwk, terms, expiresAt })` returns the `signing_input` the customer's device signs (ES256 for a phone's secure hardware: raw r||s or DER); `activateMandate(id, signature)` verifies it and returns the countersigned record. Pass `mandateId` on `beforeAction()`: an action outside the mandate's limits is refused with the term it broke, and an allowed or escalated amount is charged against it (given back if a person refuses it or it times out). Also `revokeMandate`, `getMandate`, `listMandates`, `getMandateEvidence`, and `withdrawMandate(id, signedAt, signature)` with the exported `mandateWithdrawalLine()` for a customer withdrawing with their own key.
13
+ - **Consumer Duty tags.** `declareIntent()` takes `product`, `vulnerableCustomer` and `vulnerabilityDrivers` (the FCA's FG21/1 four: `health`, `life_events`, `resilience`, `capability`), sent beside the signed bytes. `getConsumerDutyReport({ days? })` and `setOutcomeDefinition({ product, good, poor?, measure? })`.
14
+ - **Evidence.** `getSavingsReport({ days?, reviewMinutes?, hourlyCost?, currency?, agentId? })`, `runSignoff(agentId, { preset?: 'hazards' | 'fintech', scenarios?, label? })`, `listSignoffs`, `getSignoff`, `gatewayCheck({...})` for a bank's API edge, and `verifyEvidence(doc)` for any sealed Vorim document.
15
+
3
16
  ## 4.4.0
4
17
 
5
18
  ### Added
@@ -1,5 +1,5 @@
1
1
  import { VorimSDK } from './index.cjs';
2
- import { P as PermissionScope } from './types-BI7fk5gL.cjs';
2
+ import { P as PermissionScope } from './types-3hhqtL0W.cjs';
3
3
  import { E as EscalationPolicy } from './_runtime-gate-DOJUKJBu.cjs';
4
4
 
5
5
  /** What a ceiling an operation is measured against. */
@@ -1,5 +1,5 @@
1
1
  import { VorimSDK } from './index.js';
2
- import { P as PermissionScope } from './types-BI7fk5gL.js';
2
+ import { P as PermissionScope } from './types-3hhqtL0W.js';
3
3
  import { E as EscalationPolicy } from './_runtime-gate-DOJUKJBu.js';
4
4
 
5
5
  /** What a ceiling an operation is measured against. */
package/dist/index.cjs CHANGED
@@ -56,6 +56,7 @@ __export(index_exports, {
56
56
  isDigest: () => isDigest,
57
57
  isKeyedCommitment: () => isKeyedCommitment,
58
58
  jcsCanonicalise: () => jcsCanonicalise,
59
+ mandateWithdrawalLine: () => mandateWithdrawalLine,
59
60
  portableReceiptCanonicalBytes: () => portableReceiptCanonicalBytes,
60
61
  prepareReplayContext: () => prepareReplayContext,
61
62
  signHttpRequest: () => signHttpRequest,
@@ -940,7 +941,7 @@ function canonicalIntent(value) {
940
941
  const keys = Object.keys(obj).filter((k) => obj[k] !== void 0).sort();
941
942
  return `{${keys.map((k) => `${JSON.stringify(k)}:${canonicalIntent(obj[k])}`).join(",")}}`;
942
943
  }
943
- var SDK_VERSION = true ? "4.4.0" : "0.0.0";
944
+ var SDK_VERSION = true ? "4.5.0" : "0.0.0";
944
945
  var USER_AGENT = `vorim-sdk/${SDK_VERSION}`;
945
946
  function sleep(ms) {
946
947
  return new Promise((resolve) => setTimeout(resolve, ms));
@@ -1562,7 +1563,9 @@ var VorimSDK = class _VorimSDK {
1562
1563
  trace_id: input.traceId,
1563
1564
  span_id: input.spanId,
1564
1565
  traceparent: input.traceparent,
1565
- intent_id: input.intentId
1566
+ intent_id: input.intentId,
1567
+ case_ref: input.caseRef,
1568
+ mandate_id: input.mandateId
1566
1569
  };
1567
1570
  let raw;
1568
1571
  try {
@@ -2098,7 +2101,11 @@ var VorimSDK = class _VorimSDK {
2098
2101
  workflow_id: input.workflowId,
2099
2102
  ...signed,
2100
2103
  expected_outcome: input.expectedOutcome,
2101
- review_at: input.reviewAt
2104
+ review_at: input.reviewAt,
2105
+ case_ref: input.caseRef,
2106
+ product: input.product,
2107
+ vulnerable_customer: input.vulnerableCustomer,
2108
+ vulnerability_drivers: input.vulnerabilityDrivers
2102
2109
  });
2103
2110
  }
2104
2111
  /**
@@ -2122,6 +2129,191 @@ var VorimSDK = class _VorimSDK {
2122
2129
  const s = q.toString();
2123
2130
  return this.get(`/intents/ledger${s ? `?${s}` : ""}`);
2124
2131
  }
2132
+ // ─── Customer mandates ──────────────────────────────────────────────────
2133
+ /**
2134
+ * Create a pending customer mandate. Returns `signing_input`: the exact text
2135
+ * the customer's device must sign (ES256 raw r||s or DER, base64url) before
2136
+ * `activateMandate`. The private key stays on the customer's device.
2137
+ *
2138
+ * @example
2139
+ * const { mandate, signing_input } = await vorim.createMandate({
2140
+ * agentId, customerRef: 'cust_7731', alg: 'ES256', publicKeyJwk: phoneJwk,
2141
+ * terms: { actionTypes: ['initiate_payment'], maxAmount: 5000, currency: 'GBP', maxTotal: 20000 },
2142
+ * expiresAt: new Date(Date.now() + 30 * 86400e3).toISOString(),
2143
+ * });
2144
+ * // ... the customer's app signs signing_input ...
2145
+ * await vorim.activateMandate(mandate.mandate_id, signatureFromPhone);
2146
+ * await vorim.beforeAction({ agentId, actionType: 'initiate_payment', payload: { amount: 4000, currency: 'GBP' }, mandateId: mandate.mandate_id });
2147
+ */
2148
+ async createMandate(input) {
2149
+ const t = input.terms;
2150
+ return this.post("/mandates", {
2151
+ agent_id: input.agentId,
2152
+ customer_ref: input.customerRef,
2153
+ alg: input.alg,
2154
+ public_key_jwk: input.publicKeyJwk,
2155
+ terms: {
2156
+ action_types: t.actionTypes,
2157
+ targets: t.targets,
2158
+ max_amount: t.maxAmount,
2159
+ currency: t.currency,
2160
+ max_total: t.maxTotal,
2161
+ max_uses: t.maxUses,
2162
+ read_only: t.readOnly,
2163
+ amount_field: t.amountField
2164
+ },
2165
+ expires_at: input.expiresAt,
2166
+ key_attestation: !input.keyAttestation ? void 0 : input.keyAttestation.format === "android-key" ? { format: "android-key", certificate_chain: input.keyAttestation.certificateChain, challenge: input.keyAttestation.challenge } : {
2167
+ format: "apple-app-attest",
2168
+ attestation_object: input.keyAttestation.attestationObject,
2169
+ key_id: input.keyAttestation.keyId,
2170
+ app_id: input.keyAttestation.appId,
2171
+ environment: input.keyAttestation.environment,
2172
+ challenge: input.keyAttestation.challenge
2173
+ },
2174
+ webauthn: input.webauthn ? { rp_id: input.webauthn.rpId, origin: input.webauthn.origin } : void 0
2175
+ });
2176
+ }
2177
+ /**
2178
+ * The mandate as an AP2 (Agent Payments Protocol v0.2) open Payment Mandate:
2179
+ * an SD-JWT signed by Vorim, `vct: "mandate.payment.open.1"`, with the
2180
+ * limits as AP2 constraints. `not_expressed_in_ap2` lists anything AP2
2181
+ * cannot carry.
2182
+ */
2183
+ async exportMandateAp2(mandateId) {
2184
+ return this.get(`/mandates/${encodeURIComponent(mandateId)}/ap2`);
2185
+ }
2186
+ /**
2187
+ * Import an AP2 open Payment Mandate (SD-JWT, disclosures applied) as a
2188
+ * pending Vorim mandate. The issuer signature must verify against
2189
+ * `issuerJwk`; constraints Vorim cannot enforce are refused. The
2190
+ * customer's key (`cnf.jwk`) still signs `signing_input` to activate it.
2191
+ */
2192
+ async importAp2Mandate(input) {
2193
+ return this.post("/mandates/import-ap2", { sd_jwt: input.sdJwt, issuer_jwk: input.issuerJwk, agent_id: input.agentId, customer_ref: input.customerRef, action_types: input.actionTypes });
2194
+ }
2195
+ /** A one-time challenge (10 minutes) for a hardware key attestation on `createMandate`. */
2196
+ async getAttestationChallenge() {
2197
+ return this.post("/mandates/attestation-challenge", {});
2198
+ }
2199
+ /** Activate a mandate with the customer's signature over its `signing_input`. Returns the countersigned record. */
2200
+ async activateMandate(mandateId, signature) {
2201
+ return this.post(`/mandates/${encodeURIComponent(mandateId)}/activate`, { signature });
2202
+ }
2203
+ /** The firm revokes a mandate; every later action under it is refused. */
2204
+ async revokeMandate(mandateId, reason) {
2205
+ return this.post(`/mandates/${encodeURIComponent(mandateId)}/revoke`, { reason });
2206
+ }
2207
+ async getMandate(mandateId) {
2208
+ return this.get(`/mandates/${encodeURIComponent(mandateId)}`);
2209
+ }
2210
+ async listMandates(params = {}) {
2211
+ const q = new URLSearchParams();
2212
+ if (params.agentId) q.set("agent_id", params.agentId);
2213
+ if (params.customerRef) q.set("customer_ref", params.customerRef);
2214
+ if (params.limit) q.set("limit", String(params.limit));
2215
+ const s = q.toString();
2216
+ return this.get(`/mandates${s ? `?${s}` : ""}`);
2217
+ }
2218
+ /** The countersigned record, every decision taken under the mandate, and a verification result. */
2219
+ async getMandateEvidence(mandateId) {
2220
+ return this.get(`/mandates/${encodeURIComponent(mandateId)}/evidence`);
2221
+ }
2222
+ /**
2223
+ * The customer withdraws a mandate with their own key; no Vorim account
2224
+ * is involved. Sign `mandateWithdrawalLine(mandateId, signedAt)` on the
2225
+ * device (signedAt within 5 minutes of now) and pass the signature here.
2226
+ */
2227
+ async withdrawMandate(mandateId, signedAt, signature) {
2228
+ return this.post(`/mandates/${encodeURIComponent(mandateId)}/withdraw`, { signed_at: signedAt, signature });
2229
+ }
2230
+ // ─── Evidence ───────────────────────────────────────────────────────────
2231
+ /** Case references seen in the last `days` (default 90). */
2232
+ async listCases(params = {}) {
2233
+ return this.get(`/evidence/cases${params.days ? `?days=${encodeURIComponent(String(params.days))}` : ""}`);
2234
+ }
2235
+ /** A platform-signed case pack for one case reference: decisions, approvals, intents, outcomes, mandates. */
2236
+ async getCasePack(caseRef) {
2237
+ return this.get(`/evidence/cases/${encodeURIComponent(caseRef)}/pack`);
2238
+ }
2239
+ /**
2240
+ * Keep a case pack, stamped by an RFC 3161 Time Stamping Authority unless
2241
+ * `timestamp: false`. If the TSA cannot be reached the pack is still kept
2242
+ * and `timestamp.ok` is false with the error.
2243
+ */
2244
+ async storeCasePack(caseRef, input = {}) {
2245
+ return this.post(`/evidence/cases/${encodeURIComponent(caseRef)}/packs`, input);
2246
+ }
2247
+ async listStoredCasePacks(caseRef) {
2248
+ return this.get(`/evidence/cases/${encodeURIComponent(caseRef)}/packs`);
2249
+ }
2250
+ /** A kept case pack with its timestamp token and the openssl command to verify it. */
2251
+ async getStoredCasePack(id) {
2252
+ return this.get(`/evidence/case-pack/${encodeURIComponent(id)}`);
2253
+ }
2254
+ /**
2255
+ * Record what later happened to an action: `complaint`, `chargeback`,
2256
+ * `fraud_confirmed`, `refund_reversed` or `no_issue`. The savings report
2257
+ * uses these to show which bad outcomes a shadow rule would have caught.
2258
+ */
2259
+ async recordActionOutcome(input) {
2260
+ return this.post("/evidence/outcomes", { decision_id: input.decisionId, kind: input.kind, amount: input.amount, currency: input.currency, occurred_at: input.occurredAt, note: input.note });
2261
+ }
2262
+ /** What rules did and shadow rules would have done, costed at your own review assumptions. */
2263
+ async getSavingsReport(params = {}) {
2264
+ const q = new URLSearchParams();
2265
+ if (params.days) q.set("days", String(params.days));
2266
+ if (params.reviewMinutes) q.set("review_minutes", String(params.reviewMinutes));
2267
+ if (params.hourlyCost !== void 0) q.set("hourly_cost", String(params.hourlyCost));
2268
+ if (params.currency) q.set("currency", params.currency);
2269
+ if (params.agentId) q.set("agent_id", params.agentId);
2270
+ return this.get(`/evidence/savings?${q.toString()}`);
2271
+ }
2272
+ /** Consumer Duty outcomes by product, vulnerability and FG21/1 driver. */
2273
+ async getConsumerDutyReport(params = {}) {
2274
+ return this.get(`/evidence/consumer-duty${params.days ? `?days=${encodeURIComponent(String(params.days))}` : ""}`);
2275
+ }
2276
+ /** Record what a good (and poor) outcome looks like for a product. */
2277
+ async setOutcomeDefinition(input) {
2278
+ return this.put("/evidence/outcome-definitions", input);
2279
+ }
2280
+ /**
2281
+ * Run a sign-off pack for one agent: scenarios through the real gate in
2282
+ * shadow, answers to the risk committee's questions, signed and stored.
2283
+ */
2284
+ async runSignoff(agentId, input = {}) {
2285
+ return this.post(`/evidence/signoffs/${encodeURIComponent(agentId)}`, input);
2286
+ }
2287
+ async listSignoffs(agentId) {
2288
+ return this.get(`/evidence/signoffs/${encodeURIComponent(agentId)}`);
2289
+ }
2290
+ async getSignoff(id) {
2291
+ return this.get(`/evidence/signoff/${encodeURIComponent(id)}`);
2292
+ }
2293
+ /** What changed between a sign-off pack and the one before it (or `againstId`): verdict, settings, scenarios, answers, permissions. */
2294
+ async getSignoffDiff(id, againstId) {
2295
+ return this.get(`/evidence/signoff/${encodeURIComponent(id)}/diff${againstId ? `?against=${encodeURIComponent(againstId)}` : ""}`);
2296
+ }
2297
+ /**
2298
+ * For a bank's API edge: is this request signed by the agent, is the agent
2299
+ * still allowed to act, and is it inside a mandate for this customer?
2300
+ * Returns a platform-sealed verdict to keep.
2301
+ */
2302
+ async gatewayCheck(input) {
2303
+ return this.post("/gateway/check", {
2304
+ request: input.request,
2305
+ mandate_id: input.mandateId,
2306
+ customer_ref: input.customerRef,
2307
+ action_type: input.actionType,
2308
+ amount: input.amount,
2309
+ currency: input.currency,
2310
+ max_age_seconds: input.maxAgeSeconds
2311
+ });
2312
+ }
2313
+ /** Check any sealed Vorim document (case pack, sign-off, gateway verdict, mandate record). Public endpoint. */
2314
+ async verifyEvidence(doc) {
2315
+ return this.post("/evidence/verify", { payload: doc.payload, hash: doc.hash, signature: doc.signature });
2316
+ }
2125
2317
  /** Close an intent when the job ends. Further actions under it are off intent. */
2126
2318
  async completeIntent(intentId, status = "completed", outcome) {
2127
2319
  return this.post(`/intents/${encodeURIComponent(intentId)}/complete`, { status, outcome });
@@ -2536,6 +2728,9 @@ async function deviceLogin(opts) {
2536
2728
  wait = intervalMs;
2537
2729
  }
2538
2730
  }
2731
+ function mandateWithdrawalLine(mandateId, signedAt) {
2732
+ return `vorim-mandate-withdraw|v1|${mandateId}|${signedAt}`;
2733
+ }
2539
2734
  // Annotate the CommonJS export names for ESM import in node:
2540
2735
  0 && (module.exports = {
2541
2736
  CANONICAL_TOOL_CATALOGUE_VERSION,
@@ -2563,6 +2758,7 @@ async function deviceLogin(opts) {
2563
2758
  isDigest,
2564
2759
  isKeyedCommitment,
2565
2760
  jcsCanonicalise,
2761
+ mandateWithdrawalLine,
2566
2762
  portableReceiptCanonicalBytes,
2567
2763
  prepareReplayContext,
2568
2764
  signHttpRequest,