@vorim/sdk 4.4.0 → 4.6.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 +26 -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 +253 -3
  5. package/dist/index.cjs.map +1 -1
  6. package/dist/index.d.cts +219 -3
  7. package/dist/index.d.ts +219 -3
  8. package/dist/index.js +252 -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/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
- import { A as AgentRegistrationResult, R as RuntimeDecision, a as AgentRegistrationInput, T as TrustRecord, b as Agent, S as SuspendPreview, P as PermissionScope, c as PermissionCheckResult, D as DelegationLinkClaims, d as AgentDelegationRecord, W as WorkflowProvenanceGraph, C as CapabilityProfile, e as SharedMemoryWriteInput, f as SharedMemoryEntry, g as SharedMemoryListResult, B as BeforeActionInput, h as TokenBudgetInput, i as TokenBudget, j as BudgetSpend, k as AuditEventInput, l as SwarmView, m as DeclareIntentInput, I as Intent } from './types-BI7fk5gL.cjs';
2
- export { n as AgentStatus, o as ApprovalAttestation, p as AuditEventType, q as AuditResult, r as BudgetEnforcement, s as BudgetScope, t as DecisionVerdict, u as WorkflowGraphEdge, v as WorkflowGraphEvent, w as WorkflowGraphNode } from './types-BI7fk5gL.cjs';
1
+ import { A as AgentRegistrationResult, R as RuntimeDecision, a as AgentRegistrationInput, T as TrustRecord, b as Agent, S as SuspendPreview, P as PermissionScope, c as PermissionCheckResult, D as DelegationLinkClaims, d as AgentDelegationRecord, W as WorkflowProvenanceGraph, C as CapabilityProfile, e as SharedMemoryWriteInput, f as SharedMemoryEntry, g as SharedMemoryListResult, B as BeforeActionInput, h as TokenBudgetInput, i as TokenBudget, j as BudgetSpend, k as AuditEventInput, l as SwarmView, m as DeclareIntentInput, I as Intent, n as CreateMandateInput, o as CustomerSignature, G as GatewayCheckInput } from './types-3hhqtL0W.cjs';
2
+ export { p as AgentStatus, q as ApprovalAttestation, r as AuditEventType, s as AuditResult, t as BudgetEnforcement, u as BudgetScope, v as DecisionVerdict, M as MandateTerms, w as WorkflowGraphEdge, x as WorkflowGraphEvent, y as WorkflowGraphNode } from './types-3hhqtL0W.cjs';
3
3
  import { PortableSignedReceipt } from '@vorim/shared-types';
4
4
  export { PortableSignedReceipt, portableReceiptCanonicalBytes } from '@vorim/shared-types';
5
5
  import { HttpRequestLike, SignHttpRequestOptions, SignHttpRequestResult } from './httpSignatures.cjs';
@@ -1084,6 +1084,219 @@ declare class VorimSDK {
1084
1084
  agentId?: string;
1085
1085
  days?: number;
1086
1086
  }): Promise<any>;
1087
+ /**
1088
+ * Create a pending customer mandate. Returns `signing_input`: the exact text
1089
+ * the customer's device must sign (ES256 raw r||s or DER, base64url) before
1090
+ * `activateMandate`. The private key stays on the customer's device.
1091
+ *
1092
+ * @example
1093
+ * const { mandate, signing_input } = await vorim.createMandate({
1094
+ * agentId, customerRef: 'cust_7731', alg: 'ES256', publicKeyJwk: phoneJwk,
1095
+ * terms: { actionTypes: ['initiate_payment'], maxAmount: 5000, currency: 'GBP', maxTotal: 20000 },
1096
+ * expiresAt: new Date(Date.now() + 30 * 86400e3).toISOString(),
1097
+ * });
1098
+ * // ... the customer's app signs signing_input ...
1099
+ * await vorim.activateMandate(mandate.mandate_id, signatureFromPhone);
1100
+ * await vorim.beforeAction({ agentId, actionType: 'initiate_payment', payload: { amount: 4000, currency: 'GBP' }, mandateId: mandate.mandate_id });
1101
+ */
1102
+ createMandate(input: CreateMandateInput): Promise<{
1103
+ mandate: any;
1104
+ signing_input: string;
1105
+ }>;
1106
+ /**
1107
+ * The mandate as an AP2 (Agent Payments Protocol v0.2) open Payment Mandate:
1108
+ * an SD-JWT signed by Vorim, `vct: "mandate.payment.open.1"`, with the
1109
+ * limits as AP2 constraints. `not_expressed_in_ap2` lists anything AP2
1110
+ * cannot carry.
1111
+ */
1112
+ exportMandateAp2(mandateId: string): Promise<{
1113
+ sd_jwt: string;
1114
+ payload: any;
1115
+ not_expressed_in_ap2: string[];
1116
+ verify_with: any;
1117
+ }>;
1118
+ /**
1119
+ * Import an AP2 open Payment Mandate (SD-JWT, disclosures applied) as a
1120
+ * pending Vorim mandate. The issuer signature must verify against
1121
+ * `issuerJwk`; constraints Vorim cannot enforce are refused. The
1122
+ * customer's key (`cnf.jwk`) still signs `signing_input` to activate it.
1123
+ */
1124
+ importAp2Mandate(input: {
1125
+ sdJwt: string;
1126
+ issuerJwk: Record<string, unknown>;
1127
+ agentId: string;
1128
+ customerRef: string;
1129
+ actionTypes?: string[];
1130
+ }): Promise<any>;
1131
+ /** A one-time challenge (10 minutes) for a hardware key attestation on `createMandate`. */
1132
+ getAttestationChallenge(): Promise<{
1133
+ challenge: string;
1134
+ expires_at: string;
1135
+ }>;
1136
+ /** Activate a mandate with the customer's signature over its `signing_input`. Returns the countersigned record. */
1137
+ activateMandate(mandateId: string, signature: CustomerSignature): Promise<any>;
1138
+ /** The firm revokes a mandate; every later action under it is refused. */
1139
+ revokeMandate(mandateId: string, reason?: string): Promise<any>;
1140
+ getMandate(mandateId: string): Promise<any>;
1141
+ listMandates(params?: {
1142
+ agentId?: string;
1143
+ customerRef?: string;
1144
+ limit?: number;
1145
+ }): Promise<any[]>;
1146
+ /** The countersigned record, every decision taken under the mandate, and a verification result. */
1147
+ getMandateEvidence(mandateId: string): Promise<any>;
1148
+ /**
1149
+ * The customer withdraws a mandate with their own key; no Vorim account
1150
+ * is involved. Sign `mandateWithdrawalLine(mandateId, signedAt)` on the
1151
+ * device (signedAt within 5 minutes of now) and pass the signature here.
1152
+ */
1153
+ withdrawMandate(mandateId: string, signedAt: string, signature: CustomerSignature): Promise<any>;
1154
+ /** Case references seen in the last `days` (default 90). */
1155
+ listCases(params?: {
1156
+ days?: number;
1157
+ }): Promise<any[]>;
1158
+ /** A platform-signed case pack for one case reference: decisions, approvals, intents, outcomes, mandates. */
1159
+ getCasePack(caseRef: string): Promise<any>;
1160
+ /**
1161
+ * Keep a case pack, stamped by an RFC 3161 Time Stamping Authority unless
1162
+ * `timestamp: false`. If the TSA cannot be reached the pack is still kept
1163
+ * and `timestamp.ok` is false with the error.
1164
+ */
1165
+ storeCasePack(caseRef: string, input?: {
1166
+ timestamp?: boolean;
1167
+ }): Promise<any>;
1168
+ listStoredCasePacks(caseRef: string): Promise<any[]>;
1169
+ /** A kept case pack with its timestamp token and the openssl command to verify it. */
1170
+ getStoredCasePack(id: string): Promise<any>;
1171
+ /**
1172
+ * Record what later happened to an action: `complaint`, `chargeback`,
1173
+ * `fraud_confirmed`, `refund_reversed` or `no_issue`. The savings report
1174
+ * uses these to show which bad outcomes a shadow rule would have caught.
1175
+ */
1176
+ recordActionOutcome(input: {
1177
+ decisionId: string;
1178
+ kind: 'complaint' | 'chargeback' | 'fraud_confirmed' | 'refund_reversed' | 'no_issue';
1179
+ amount?: number;
1180
+ currency?: string;
1181
+ occurredAt?: string;
1182
+ note?: string;
1183
+ }): Promise<any>;
1184
+ /** What rules did and shadow rules would have done, costed at your own review assumptions. */
1185
+ getSavingsReport(params?: {
1186
+ days?: number;
1187
+ reviewMinutes?: number;
1188
+ hourlyCost?: number;
1189
+ currency?: string;
1190
+ agentId?: string;
1191
+ }): Promise<any>;
1192
+ /** Consumer Duty outcomes by product, vulnerability and FG21/1 driver. */
1193
+ getConsumerDutyReport(params?: {
1194
+ days?: number;
1195
+ }): Promise<any>;
1196
+ /** Record what a good (and poor) outcome looks like for a product. */
1197
+ setOutcomeDefinition(input: {
1198
+ product: string;
1199
+ good: string;
1200
+ poor?: string;
1201
+ measure?: string;
1202
+ }): Promise<any>;
1203
+ /**
1204
+ * Run a sign-off pack for one agent: scenarios through the real gate in
1205
+ * shadow, answers to the risk committee's questions, signed and stored.
1206
+ */
1207
+ runSignoff(agentId: string, input?: {
1208
+ preset?: 'hazards' | 'fintech' | 'refunds' | 'collections' | 'credit' | 'aml';
1209
+ scenarios?: any[];
1210
+ label?: string;
1211
+ }): Promise<any>;
1212
+ listSignoffs(agentId: string): Promise<any[]>;
1213
+ getSignoff(id: string): Promise<any>;
1214
+ /** What changed between a sign-off pack and the one before it (or `againstId`): verdict, settings, scenarios, answers, permissions. */
1215
+ getSignoffDiff(id: string, againstId?: string): Promise<any>;
1216
+ /**
1217
+ * For a bank's API edge: is this request signed by the agent, is the agent
1218
+ * still allowed to act, and is it inside a mandate for this customer?
1219
+ * Returns a platform-sealed verdict to keep.
1220
+ */
1221
+ gatewayCheck(input: GatewayCheckInput): Promise<any>;
1222
+ /**
1223
+ * AI incidents and near misses (4.6): kill-switch stops, tripwires that
1224
+ * refused, and sign-off packs that got worse, each with Vorim's suggested
1225
+ * classification and the firm's own assessment where recorded.
1226
+ */
1227
+ listIncidents(params?: {
1228
+ days?: number;
1229
+ }): Promise<any[]>;
1230
+ /** One signed incident record, laid out as the FCA's PS26/2 standard template (`payload.ps26_2`). */
1231
+ getIncident(ref: string): Promise<any>;
1232
+ /**
1233
+ * Record the firm's assessment of an incident. `causeType` must be one of
1234
+ * the PS26/2 template's cause types; closing it stamps the resolution time.
1235
+ * Whether it is reportable is the firm's decision.
1236
+ */
1237
+ updateIncident(ref: string, input: {
1238
+ status?: 'open' | 'resolved' | 'closed';
1239
+ classification?: 'incident' | 'near_miss' | 'not_an_incident' | null;
1240
+ reportable?: boolean | null;
1241
+ triggers?: Array<'consumer_harm' | 'market_integrity' | 'safety_soundness'>;
1242
+ incidentType?: 'disruption' | 'data_loss' | 'none' | null;
1243
+ severity?: 'low' | 'medium' | 'high' | null;
1244
+ title?: string | null;
1245
+ description?: string | null;
1246
+ actionsPlanned?: string | null;
1247
+ actionsTaken?: string | null;
1248
+ resolvedAt?: string | null;
1249
+ causeType?: string | null;
1250
+ origin?: 'internal' | 'external' | 'third_party' | 'unknown' | 'other' | null;
1251
+ thirdPartyName?: string | null;
1252
+ }): Promise<any>;
1253
+ /** A signed statement of delegated authority for one agent: identity, authority, accountability, execution, and the gaps a reviewer will ask about. */
1254
+ getAuthorityStatement(agentId: string): Promise<any>;
1255
+ /**
1256
+ * Import a Mastercard Verifiable Intent autonomous mandate (L1 issuer
1257
+ * credential + L2 customer mandate, payment side) as a pending Vorim
1258
+ * mandate. The customer key in L1 still signs `signing_input` to activate it.
1259
+ * Limits Vorim cannot enforce are refused by name (422).
1260
+ */
1261
+ importVerifiableIntent(input: {
1262
+ l1: string;
1263
+ l2: string;
1264
+ issuerJwk: Record<string, unknown>;
1265
+ agentId: string;
1266
+ customerRef: string;
1267
+ actionTypes?: string[];
1268
+ expectedAud?: string;
1269
+ }): Promise<any>;
1270
+ /**
1271
+ * Verify a Visa Trusted Agent Protocol message signature on a request your
1272
+ * site received: the signature over "@authority" and "@path", the 8-minute
1273
+ * window, the tag (`agent-browser-auth` or `agent-payer-auth`) and a nonce
1274
+ * used once. Keys come from the key directory configured on the server, or
1275
+ * pass `keys`. Needs an API key with runtime:decide.
1276
+ */
1277
+ verifyTap(input: {
1278
+ url: string;
1279
+ headers: Record<string, string>;
1280
+ keys?: Record<string, unknown>[];
1281
+ requireTag?: 'agent-browser-auth' | 'agent-payer-auth';
1282
+ }): Promise<{
1283
+ ok: boolean;
1284
+ reasons: string[];
1285
+ tag: string | null;
1286
+ keyid: string | null;
1287
+ alg: string | null;
1288
+ nonce: string | null;
1289
+ }>;
1290
+ /** Check any sealed Vorim document (case pack, sign-off, gateway verdict, mandate record). Public endpoint. */
1291
+ verifyEvidence(doc: {
1292
+ payload: unknown;
1293
+ hash: string;
1294
+ signature: string;
1295
+ }): Promise<{
1296
+ type: string;
1297
+ ok: boolean;
1298
+ reason: string | null;
1299
+ }>;
1087
1300
  /** Close an intent when the job ends. Further actions under it are off intent. */
1088
1301
  completeIntent(intentId: string, status?: 'completed' | 'abandoned', outcome?: string): Promise<any>;
1089
1302
  /** Intents for the org, newest first; filter by agent or status. */
@@ -1351,4 +1564,7 @@ interface DeviceLoginResult {
1351
1564
  */
1352
1565
  declare function deviceLogin(opts: DeviceLoginOptions): Promise<DeviceLoginResult>;
1353
1566
 
1354
- export { Agent, AgentDelegationRecord, AgentRegistrationInput, AgentRegistrationResult, AuditEventInput, BeforeActionInput, BudgetSpend, CANONICAL_TOOL_CATALOGUE_VERSION, type CatalogueTool, type CommitmentKey, DeclareIntentInput, DelegationLinkClaims, type DeviceLoginOptions, type DeviceLoginResult, HMAC_SHA256_PREFIX, HttpRequestLike, type HttpSignatureVerification, Intent, PermissionCheckResult, PermissionScope, type ReplayContext, type ReplayInputs, RuntimeDecision, SHA256_PREFIX, SharedMemoryEntry, SharedMemoryListResult, SharedMemoryWriteInput, SignHttpRequestOptions, SignHttpRequestResult, SuspendPreview, SwarmView, TokenBudget, TokenBudgetInput, TrustRecord, type VorimConfig, VorimDeniedError, VorimError, VorimSDK, WorkflowProvenanceGraph, canonicalIntent, canonicalPayloadV0, canonicalPayloadV1, commitPayload, createVorim as default, deviceLogin, eventDigest, foldTraceparent, hashPayload, hashPreviousEvent, hashSystemPrompt, hashTool, hashToolCatalogue, isDigest, isKeyedCommitment, jcsCanonicalise, prepareReplayContext };
1567
+ /** The exact line a customer signs to withdraw a mandate (signedAt: ISO, within 5 minutes of sending). */
1568
+ declare function mandateWithdrawalLine(mandateId: string, signedAt: string): string;
1569
+
1570
+ export { Agent, AgentDelegationRecord, AgentRegistrationInput, AgentRegistrationResult, AuditEventInput, BeforeActionInput, BudgetSpend, CANONICAL_TOOL_CATALOGUE_VERSION, type CatalogueTool, type CommitmentKey, CreateMandateInput, CustomerSignature, DeclareIntentInput, DelegationLinkClaims, type DeviceLoginOptions, type DeviceLoginResult, GatewayCheckInput, HMAC_SHA256_PREFIX, HttpRequestLike, type HttpSignatureVerification, Intent, PermissionCheckResult, PermissionScope, type ReplayContext, type ReplayInputs, RuntimeDecision, SHA256_PREFIX, SharedMemoryEntry, SharedMemoryListResult, SharedMemoryWriteInput, SignHttpRequestOptions, SignHttpRequestResult, SuspendPreview, SwarmView, TokenBudget, TokenBudgetInput, TrustRecord, type VorimConfig, VorimDeniedError, VorimError, VorimSDK, WorkflowProvenanceGraph, canonicalIntent, canonicalPayloadV0, canonicalPayloadV1, commitPayload, createVorim as default, deviceLogin, eventDigest, foldTraceparent, hashPayload, hashPreviousEvent, hashSystemPrompt, hashTool, hashToolCatalogue, isDigest, isKeyedCommitment, jcsCanonicalise, mandateWithdrawalLine, prepareReplayContext };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { A as AgentRegistrationResult, R as RuntimeDecision, a as AgentRegistrationInput, T as TrustRecord, b as Agent, S as SuspendPreview, P as PermissionScope, c as PermissionCheckResult, D as DelegationLinkClaims, d as AgentDelegationRecord, W as WorkflowProvenanceGraph, C as CapabilityProfile, e as SharedMemoryWriteInput, f as SharedMemoryEntry, g as SharedMemoryListResult, B as BeforeActionInput, h as TokenBudgetInput, i as TokenBudget, j as BudgetSpend, k as AuditEventInput, l as SwarmView, m as DeclareIntentInput, I as Intent } from './types-BI7fk5gL.js';
2
- export { n as AgentStatus, o as ApprovalAttestation, p as AuditEventType, q as AuditResult, r as BudgetEnforcement, s as BudgetScope, t as DecisionVerdict, u as WorkflowGraphEdge, v as WorkflowGraphEvent, w as WorkflowGraphNode } from './types-BI7fk5gL.js';
1
+ import { A as AgentRegistrationResult, R as RuntimeDecision, a as AgentRegistrationInput, T as TrustRecord, b as Agent, S as SuspendPreview, P as PermissionScope, c as PermissionCheckResult, D as DelegationLinkClaims, d as AgentDelegationRecord, W as WorkflowProvenanceGraph, C as CapabilityProfile, e as SharedMemoryWriteInput, f as SharedMemoryEntry, g as SharedMemoryListResult, B as BeforeActionInput, h as TokenBudgetInput, i as TokenBudget, j as BudgetSpend, k as AuditEventInput, l as SwarmView, m as DeclareIntentInput, I as Intent, n as CreateMandateInput, o as CustomerSignature, G as GatewayCheckInput } from './types-3hhqtL0W.js';
2
+ export { p as AgentStatus, q as ApprovalAttestation, r as AuditEventType, s as AuditResult, t as BudgetEnforcement, u as BudgetScope, v as DecisionVerdict, M as MandateTerms, w as WorkflowGraphEdge, x as WorkflowGraphEvent, y as WorkflowGraphNode } from './types-3hhqtL0W.js';
3
3
  import { PortableSignedReceipt } from '@vorim/shared-types';
4
4
  export { PortableSignedReceipt, portableReceiptCanonicalBytes } from '@vorim/shared-types';
5
5
  import { HttpRequestLike, SignHttpRequestOptions, SignHttpRequestResult } from './httpSignatures.js';
@@ -1084,6 +1084,219 @@ declare class VorimSDK {
1084
1084
  agentId?: string;
1085
1085
  days?: number;
1086
1086
  }): Promise<any>;
1087
+ /**
1088
+ * Create a pending customer mandate. Returns `signing_input`: the exact text
1089
+ * the customer's device must sign (ES256 raw r||s or DER, base64url) before
1090
+ * `activateMandate`. The private key stays on the customer's device.
1091
+ *
1092
+ * @example
1093
+ * const { mandate, signing_input } = await vorim.createMandate({
1094
+ * agentId, customerRef: 'cust_7731', alg: 'ES256', publicKeyJwk: phoneJwk,
1095
+ * terms: { actionTypes: ['initiate_payment'], maxAmount: 5000, currency: 'GBP', maxTotal: 20000 },
1096
+ * expiresAt: new Date(Date.now() + 30 * 86400e3).toISOString(),
1097
+ * });
1098
+ * // ... the customer's app signs signing_input ...
1099
+ * await vorim.activateMandate(mandate.mandate_id, signatureFromPhone);
1100
+ * await vorim.beforeAction({ agentId, actionType: 'initiate_payment', payload: { amount: 4000, currency: 'GBP' }, mandateId: mandate.mandate_id });
1101
+ */
1102
+ createMandate(input: CreateMandateInput): Promise<{
1103
+ mandate: any;
1104
+ signing_input: string;
1105
+ }>;
1106
+ /**
1107
+ * The mandate as an AP2 (Agent Payments Protocol v0.2) open Payment Mandate:
1108
+ * an SD-JWT signed by Vorim, `vct: "mandate.payment.open.1"`, with the
1109
+ * limits as AP2 constraints. `not_expressed_in_ap2` lists anything AP2
1110
+ * cannot carry.
1111
+ */
1112
+ exportMandateAp2(mandateId: string): Promise<{
1113
+ sd_jwt: string;
1114
+ payload: any;
1115
+ not_expressed_in_ap2: string[];
1116
+ verify_with: any;
1117
+ }>;
1118
+ /**
1119
+ * Import an AP2 open Payment Mandate (SD-JWT, disclosures applied) as a
1120
+ * pending Vorim mandate. The issuer signature must verify against
1121
+ * `issuerJwk`; constraints Vorim cannot enforce are refused. The
1122
+ * customer's key (`cnf.jwk`) still signs `signing_input` to activate it.
1123
+ */
1124
+ importAp2Mandate(input: {
1125
+ sdJwt: string;
1126
+ issuerJwk: Record<string, unknown>;
1127
+ agentId: string;
1128
+ customerRef: string;
1129
+ actionTypes?: string[];
1130
+ }): Promise<any>;
1131
+ /** A one-time challenge (10 minutes) for a hardware key attestation on `createMandate`. */
1132
+ getAttestationChallenge(): Promise<{
1133
+ challenge: string;
1134
+ expires_at: string;
1135
+ }>;
1136
+ /** Activate a mandate with the customer's signature over its `signing_input`. Returns the countersigned record. */
1137
+ activateMandate(mandateId: string, signature: CustomerSignature): Promise<any>;
1138
+ /** The firm revokes a mandate; every later action under it is refused. */
1139
+ revokeMandate(mandateId: string, reason?: string): Promise<any>;
1140
+ getMandate(mandateId: string): Promise<any>;
1141
+ listMandates(params?: {
1142
+ agentId?: string;
1143
+ customerRef?: string;
1144
+ limit?: number;
1145
+ }): Promise<any[]>;
1146
+ /** The countersigned record, every decision taken under the mandate, and a verification result. */
1147
+ getMandateEvidence(mandateId: string): Promise<any>;
1148
+ /**
1149
+ * The customer withdraws a mandate with their own key; no Vorim account
1150
+ * is involved. Sign `mandateWithdrawalLine(mandateId, signedAt)` on the
1151
+ * device (signedAt within 5 minutes of now) and pass the signature here.
1152
+ */
1153
+ withdrawMandate(mandateId: string, signedAt: string, signature: CustomerSignature): Promise<any>;
1154
+ /** Case references seen in the last `days` (default 90). */
1155
+ listCases(params?: {
1156
+ days?: number;
1157
+ }): Promise<any[]>;
1158
+ /** A platform-signed case pack for one case reference: decisions, approvals, intents, outcomes, mandates. */
1159
+ getCasePack(caseRef: string): Promise<any>;
1160
+ /**
1161
+ * Keep a case pack, stamped by an RFC 3161 Time Stamping Authority unless
1162
+ * `timestamp: false`. If the TSA cannot be reached the pack is still kept
1163
+ * and `timestamp.ok` is false with the error.
1164
+ */
1165
+ storeCasePack(caseRef: string, input?: {
1166
+ timestamp?: boolean;
1167
+ }): Promise<any>;
1168
+ listStoredCasePacks(caseRef: string): Promise<any[]>;
1169
+ /** A kept case pack with its timestamp token and the openssl command to verify it. */
1170
+ getStoredCasePack(id: string): Promise<any>;
1171
+ /**
1172
+ * Record what later happened to an action: `complaint`, `chargeback`,
1173
+ * `fraud_confirmed`, `refund_reversed` or `no_issue`. The savings report
1174
+ * uses these to show which bad outcomes a shadow rule would have caught.
1175
+ */
1176
+ recordActionOutcome(input: {
1177
+ decisionId: string;
1178
+ kind: 'complaint' | 'chargeback' | 'fraud_confirmed' | 'refund_reversed' | 'no_issue';
1179
+ amount?: number;
1180
+ currency?: string;
1181
+ occurredAt?: string;
1182
+ note?: string;
1183
+ }): Promise<any>;
1184
+ /** What rules did and shadow rules would have done, costed at your own review assumptions. */
1185
+ getSavingsReport(params?: {
1186
+ days?: number;
1187
+ reviewMinutes?: number;
1188
+ hourlyCost?: number;
1189
+ currency?: string;
1190
+ agentId?: string;
1191
+ }): Promise<any>;
1192
+ /** Consumer Duty outcomes by product, vulnerability and FG21/1 driver. */
1193
+ getConsumerDutyReport(params?: {
1194
+ days?: number;
1195
+ }): Promise<any>;
1196
+ /** Record what a good (and poor) outcome looks like for a product. */
1197
+ setOutcomeDefinition(input: {
1198
+ product: string;
1199
+ good: string;
1200
+ poor?: string;
1201
+ measure?: string;
1202
+ }): Promise<any>;
1203
+ /**
1204
+ * Run a sign-off pack for one agent: scenarios through the real gate in
1205
+ * shadow, answers to the risk committee's questions, signed and stored.
1206
+ */
1207
+ runSignoff(agentId: string, input?: {
1208
+ preset?: 'hazards' | 'fintech' | 'refunds' | 'collections' | 'credit' | 'aml';
1209
+ scenarios?: any[];
1210
+ label?: string;
1211
+ }): Promise<any>;
1212
+ listSignoffs(agentId: string): Promise<any[]>;
1213
+ getSignoff(id: string): Promise<any>;
1214
+ /** What changed between a sign-off pack and the one before it (or `againstId`): verdict, settings, scenarios, answers, permissions. */
1215
+ getSignoffDiff(id: string, againstId?: string): Promise<any>;
1216
+ /**
1217
+ * For a bank's API edge: is this request signed by the agent, is the agent
1218
+ * still allowed to act, and is it inside a mandate for this customer?
1219
+ * Returns a platform-sealed verdict to keep.
1220
+ */
1221
+ gatewayCheck(input: GatewayCheckInput): Promise<any>;
1222
+ /**
1223
+ * AI incidents and near misses (4.6): kill-switch stops, tripwires that
1224
+ * refused, and sign-off packs that got worse, each with Vorim's suggested
1225
+ * classification and the firm's own assessment where recorded.
1226
+ */
1227
+ listIncidents(params?: {
1228
+ days?: number;
1229
+ }): Promise<any[]>;
1230
+ /** One signed incident record, laid out as the FCA's PS26/2 standard template (`payload.ps26_2`). */
1231
+ getIncident(ref: string): Promise<any>;
1232
+ /**
1233
+ * Record the firm's assessment of an incident. `causeType` must be one of
1234
+ * the PS26/2 template's cause types; closing it stamps the resolution time.
1235
+ * Whether it is reportable is the firm's decision.
1236
+ */
1237
+ updateIncident(ref: string, input: {
1238
+ status?: 'open' | 'resolved' | 'closed';
1239
+ classification?: 'incident' | 'near_miss' | 'not_an_incident' | null;
1240
+ reportable?: boolean | null;
1241
+ triggers?: Array<'consumer_harm' | 'market_integrity' | 'safety_soundness'>;
1242
+ incidentType?: 'disruption' | 'data_loss' | 'none' | null;
1243
+ severity?: 'low' | 'medium' | 'high' | null;
1244
+ title?: string | null;
1245
+ description?: string | null;
1246
+ actionsPlanned?: string | null;
1247
+ actionsTaken?: string | null;
1248
+ resolvedAt?: string | null;
1249
+ causeType?: string | null;
1250
+ origin?: 'internal' | 'external' | 'third_party' | 'unknown' | 'other' | null;
1251
+ thirdPartyName?: string | null;
1252
+ }): Promise<any>;
1253
+ /** A signed statement of delegated authority for one agent: identity, authority, accountability, execution, and the gaps a reviewer will ask about. */
1254
+ getAuthorityStatement(agentId: string): Promise<any>;
1255
+ /**
1256
+ * Import a Mastercard Verifiable Intent autonomous mandate (L1 issuer
1257
+ * credential + L2 customer mandate, payment side) as a pending Vorim
1258
+ * mandate. The customer key in L1 still signs `signing_input` to activate it.
1259
+ * Limits Vorim cannot enforce are refused by name (422).
1260
+ */
1261
+ importVerifiableIntent(input: {
1262
+ l1: string;
1263
+ l2: string;
1264
+ issuerJwk: Record<string, unknown>;
1265
+ agentId: string;
1266
+ customerRef: string;
1267
+ actionTypes?: string[];
1268
+ expectedAud?: string;
1269
+ }): Promise<any>;
1270
+ /**
1271
+ * Verify a Visa Trusted Agent Protocol message signature on a request your
1272
+ * site received: the signature over "@authority" and "@path", the 8-minute
1273
+ * window, the tag (`agent-browser-auth` or `agent-payer-auth`) and a nonce
1274
+ * used once. Keys come from the key directory configured on the server, or
1275
+ * pass `keys`. Needs an API key with runtime:decide.
1276
+ */
1277
+ verifyTap(input: {
1278
+ url: string;
1279
+ headers: Record<string, string>;
1280
+ keys?: Record<string, unknown>[];
1281
+ requireTag?: 'agent-browser-auth' | 'agent-payer-auth';
1282
+ }): Promise<{
1283
+ ok: boolean;
1284
+ reasons: string[];
1285
+ tag: string | null;
1286
+ keyid: string | null;
1287
+ alg: string | null;
1288
+ nonce: string | null;
1289
+ }>;
1290
+ /** Check any sealed Vorim document (case pack, sign-off, gateway verdict, mandate record). Public endpoint. */
1291
+ verifyEvidence(doc: {
1292
+ payload: unknown;
1293
+ hash: string;
1294
+ signature: string;
1295
+ }): Promise<{
1296
+ type: string;
1297
+ ok: boolean;
1298
+ reason: string | null;
1299
+ }>;
1087
1300
  /** Close an intent when the job ends. Further actions under it are off intent. */
1088
1301
  completeIntent(intentId: string, status?: 'completed' | 'abandoned', outcome?: string): Promise<any>;
1089
1302
  /** Intents for the org, newest first; filter by agent or status. */
@@ -1351,4 +1564,7 @@ interface DeviceLoginResult {
1351
1564
  */
1352
1565
  declare function deviceLogin(opts: DeviceLoginOptions): Promise<DeviceLoginResult>;
1353
1566
 
1354
- export { Agent, AgentDelegationRecord, AgentRegistrationInput, AgentRegistrationResult, AuditEventInput, BeforeActionInput, BudgetSpend, CANONICAL_TOOL_CATALOGUE_VERSION, type CatalogueTool, type CommitmentKey, DeclareIntentInput, DelegationLinkClaims, type DeviceLoginOptions, type DeviceLoginResult, HMAC_SHA256_PREFIX, HttpRequestLike, type HttpSignatureVerification, Intent, PermissionCheckResult, PermissionScope, type ReplayContext, type ReplayInputs, RuntimeDecision, SHA256_PREFIX, SharedMemoryEntry, SharedMemoryListResult, SharedMemoryWriteInput, SignHttpRequestOptions, SignHttpRequestResult, SuspendPreview, SwarmView, TokenBudget, TokenBudgetInput, TrustRecord, type VorimConfig, VorimDeniedError, VorimError, VorimSDK, WorkflowProvenanceGraph, canonicalIntent, canonicalPayloadV0, canonicalPayloadV1, commitPayload, createVorim as default, deviceLogin, eventDigest, foldTraceparent, hashPayload, hashPreviousEvent, hashSystemPrompt, hashTool, hashToolCatalogue, isDigest, isKeyedCommitment, jcsCanonicalise, prepareReplayContext };
1567
+ /** The exact line a customer signs to withdraw a mandate (signedAt: ISO, within 5 minutes of sending). */
1568
+ declare function mandateWithdrawalLine(mandateId: string, signedAt: string): string;
1569
+
1570
+ export { Agent, AgentDelegationRecord, AgentRegistrationInput, AgentRegistrationResult, AuditEventInput, BeforeActionInput, BudgetSpend, CANONICAL_TOOL_CATALOGUE_VERSION, type CatalogueTool, type CommitmentKey, CreateMandateInput, CustomerSignature, DeclareIntentInput, DelegationLinkClaims, type DeviceLoginOptions, type DeviceLoginResult, GatewayCheckInput, HMAC_SHA256_PREFIX, HttpRequestLike, type HttpSignatureVerification, Intent, PermissionCheckResult, PermissionScope, type ReplayContext, type ReplayInputs, RuntimeDecision, SHA256_PREFIX, SharedMemoryEntry, SharedMemoryListResult, SharedMemoryWriteInput, SignHttpRequestOptions, SignHttpRequestResult, SuspendPreview, SwarmView, TokenBudget, TokenBudgetInput, TrustRecord, type VorimConfig, VorimDeniedError, VorimError, VorimSDK, WorkflowProvenanceGraph, canonicalIntent, canonicalPayloadV0, canonicalPayloadV1, commitPayload, createVorim as default, deviceLogin, eventDigest, foldTraceparent, hashPayload, hashPreviousEvent, hashSystemPrompt, hashTool, hashToolCatalogue, isDigest, isKeyedCommitment, jcsCanonicalise, mandateWithdrawalLine, prepareReplayContext };