@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.
- package/CHANGELOG.md +26 -0
- package/dist/{_commerce-core-B800cza0.d.cts → _commerce-core-QF7IKCKQ.d.cts} +1 -1
- package/dist/{_commerce-core-Bv_2hfKP.d.ts → _commerce-core-jih7k4hQ.d.ts} +1 -1
- package/dist/index.cjs +253 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +219 -3
- package/dist/index.d.ts +219 -3
- package/dist/index.js +252 -3
- package/dist/index.js.map +1 -1
- package/dist/integrations/amazon.d.cts +2 -2
- package/dist/integrations/amazon.d.ts +2 -2
- package/dist/integrations/anthropic.d.cts +1 -1
- package/dist/integrations/anthropic.d.ts +1 -1
- package/dist/integrations/ap2.d.cts +1 -1
- package/dist/integrations/ap2.d.ts +1 -1
- package/dist/integrations/aws-iam.d.cts +1 -1
- package/dist/integrations/aws-iam.d.ts +1 -1
- package/dist/integrations/bank-rails.d.cts +1 -1
- package/dist/integrations/bank-rails.d.ts +1 -1
- package/dist/integrations/circle.d.cts +1 -1
- package/dist/integrations/circle.d.ts +1 -1
- package/dist/integrations/cloudflare.d.cts +1 -1
- package/dist/integrations/cloudflare.d.ts +1 -1
- package/dist/integrations/coinbase-cdp.d.cts +1 -1
- package/dist/integrations/coinbase-cdp.d.ts +1 -1
- package/dist/integrations/commerce-agents.d.cts +1 -1
- package/dist/integrations/commerce-agents.d.ts +1 -1
- package/dist/integrations/crewai.d.cts +1 -1
- package/dist/integrations/crewai.d.ts +1 -1
- package/dist/integrations/delivery.d.cts +2 -2
- package/dist/integrations/delivery.d.ts +2 -2
- package/dist/integrations/ebay.d.cts +2 -2
- package/dist/integrations/ebay.d.ts +2 -2
- package/dist/integrations/entra.d.cts +1 -1
- package/dist/integrations/entra.d.ts +1 -1
- package/dist/integrations/etsy.d.cts +2 -2
- package/dist/integrations/etsy.d.ts +2 -2
- package/dist/integrations/eu-providers.d.cts +1 -1
- package/dist/integrations/eu-providers.d.ts +1 -1
- package/dist/integrations/fhir.d.cts +1 -1
- package/dist/integrations/fhir.d.ts +1 -1
- package/dist/integrations/google-merchant.d.cts +2 -2
- package/dist/integrations/google-merchant.d.ts +2 -2
- package/dist/integrations/grok.d.cts +1 -1
- package/dist/integrations/grok.d.ts +1 -1
- package/dist/integrations/guidewire.d.cts +1 -1
- package/dist/integrations/guidewire.d.ts +1 -1
- package/dist/integrations/hermes.d.cts +1 -1
- package/dist/integrations/hermes.d.ts +1 -1
- package/dist/integrations/jira.d.cts +1 -1
- package/dist/integrations/jira.d.ts +1 -1
- package/dist/integrations/langchain.d.cts +1 -1
- package/dist/integrations/langchain.d.ts +1 -1
- package/dist/integrations/langgraph.d.cts +1 -1
- package/dist/integrations/langgraph.d.ts +1 -1
- package/dist/integrations/legal.d.cts +1 -1
- package/dist/integrations/legal.d.ts +1 -1
- package/dist/integrations/life-sciences.d.cts +1 -1
- package/dist/integrations/life-sciences.d.ts +1 -1
- package/dist/integrations/linear.d.cts +1 -1
- package/dist/integrations/linear.d.ts +1 -1
- package/dist/integrations/lithic.d.cts +1 -1
- package/dist/integrations/lithic.d.ts +1 -1
- package/dist/integrations/llamaindex.d.cts +1 -1
- package/dist/integrations/llamaindex.d.ts +1 -1
- package/dist/integrations/marqeta.d.cts +1 -1
- package/dist/integrations/marqeta.d.ts +1 -1
- package/dist/integrations/meta.d.cts +2 -2
- package/dist/integrations/meta.d.ts +2 -2
- package/dist/integrations/mistral.d.cts +1 -1
- package/dist/integrations/mistral.d.ts +1 -1
- package/dist/integrations/modern-treasury.d.cts +1 -1
- package/dist/integrations/modern-treasury.d.ts +1 -1
- package/dist/integrations/muse.d.cts +1 -1
- package/dist/integrations/muse.d.ts +1 -1
- package/dist/integrations/nekuda.d.cts +1 -1
- package/dist/integrations/nekuda.d.ts +1 -1
- package/dist/integrations/okta.d.cts +1 -1
- package/dist/integrations/okta.d.ts +1 -1
- package/dist/integrations/openai.d.cts +1 -1
- package/dist/integrations/openai.d.ts +1 -1
- package/dist/integrations/openrouter.d.cts +1 -1
- package/dist/integrations/openrouter.d.ts +1 -1
- package/dist/integrations/paypal-agent.d.cts +1 -1
- package/dist/integrations/paypal-agent.d.ts +1 -1
- package/dist/integrations/perplexity.d.cts +1 -1
- package/dist/integrations/perplexity.d.ts +1 -1
- package/dist/integrations/plaid.d.cts +1 -1
- package/dist/integrations/plaid.d.ts +1 -1
- package/dist/integrations/ramp.d.cts +1 -1
- package/dist/integrations/ramp.d.ts +1 -1
- package/dist/integrations/shopify.d.cts +1 -1
- package/dist/integrations/shopify.d.ts +1 -1
- package/dist/integrations/siem.d.cts +1 -1
- package/dist/integrations/siem.d.ts +1 -1
- package/dist/integrations/skyfire.d.cts +1 -1
- package/dist/integrations/skyfire.d.ts +1 -1
- package/dist/integrations/social-ads.d.cts +2 -2
- package/dist/integrations/social-ads.d.ts +2 -2
- package/dist/integrations/stripe-acp.d.cts +1 -1
- package/dist/integrations/stripe-acp.d.ts +1 -1
- package/dist/integrations/stripe-issuing.d.cts +1 -1
- package/dist/integrations/stripe-issuing.d.ts +1 -1
- package/dist/integrations/tiktok-shop.d.cts +2 -2
- package/dist/integrations/tiktok-shop.d.ts +2 -2
- package/dist/integrations/truanon.d.cts +1 -1
- package/dist/integrations/truanon.d.ts +1 -1
- package/dist/integrations/typesafe.d.cts +1 -1
- package/dist/integrations/typesafe.d.ts +1 -1
- package/dist/integrations/ucp.d.cts +1 -1
- package/dist/integrations/ucp.d.ts +1 -1
- package/dist/integrations/vercel-ai.d.cts +1 -1
- package/dist/integrations/vercel-ai.d.ts +1 -1
- package/dist/integrations/walmart.d.cts +2 -2
- package/dist/integrations/walmart.d.ts +2 -2
- package/dist/integrations/x402.d.cts +1 -1
- package/dist/integrations/x402.d.ts +1 -1
- package/dist/{types-BI7fk5gL.d.cts → types-3hhqtL0W.d.cts} +98 -1
- package/dist/{types-BI7fk5gL.d.ts → types-3hhqtL0W.d.ts} +98 -1
- 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-
|
|
2
|
-
export {
|
|
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
|
-
|
|
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-
|
|
2
|
-
export {
|
|
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
|
-
|
|
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 };
|