@vorim/sdk 4.5.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 +13 -0
- package/dist/index.cjs +55 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +68 -0
- package/dist/index.d.ts +68 -0
- package/dist/index.js +55 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# Changelog — @vorim/sdk
|
|
2
2
|
|
|
3
|
+
## 4.6.0
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- **AI incidents and near misses.** `listIncidents({ days? })`, `getIncident(ref)` and `updateIncident(ref, {...})`. Kill-switch stops, tripwires that refused and sign-off packs that got worse each become a record; `getIncident` returns it signed and laid out as the FCA's PS26/2 standard reporting template (`payload.ps26_2`, each field marked as filled by Vorim, by you, or still missing). `updateIncident` records your assessment (status, incident or near miss, triggers, type, severity, cause type from the template's own list, origin, recovery actions). Whether an incident is reportable stays your decision.
|
|
8
|
+
- **Statement of delegated authority.** `getAuthorityStatement(agentId)`: one signed page per agent under the four headings the FCA set out on 19 October 2026 (identity, delegated authority, accountability, execution) and the gaps a reviewer will ask about. Set `metadata.model`, `metadata.provider` and `metadata.smf_owner` (the accountable senior manager) with `updateAgent`.
|
|
9
|
+
- **Visa Trusted Agent Protocol.** `verifyTap({ url, headers, keys?, requireTag? })` checks a TAP message signature on a request your site received: the signature over `@authority` and `@path`, the 8-minute window, the tag (`agent-browser-auth` or `agent-payer-auth`) and a one-time nonce. Built from Visa's merchant specification and sample code; keys come from the key directory your Vorim server is configured with, or the ones you pass.
|
|
10
|
+
- **Mastercard Verifiable Intent.** `importVerifiableIntent({ l1, l2, issuerJwk, agentId, customerRef })` checks an autonomous mandate (issuer credential plus the customer's mandate) and creates a pending Vorim mandate from its payment constraints. Limits Vorim cannot enforce are refused by name. Tested against chains produced by Mastercard's open reference implementation; not run against a live Mastercard system.
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- Sign-off packs also re-run when the agent's model or provider changes and every 30 days (`trigger`: `model_change`, `scheduled`).
|
|
15
|
+
|
|
3
16
|
## 4.5.0
|
|
4
17
|
|
|
5
18
|
### Added
|
package/dist/index.cjs
CHANGED
|
@@ -941,7 +941,7 @@ function canonicalIntent(value) {
|
|
|
941
941
|
const keys = Object.keys(obj).filter((k) => obj[k] !== void 0).sort();
|
|
942
942
|
return `{${keys.map((k) => `${JSON.stringify(k)}:${canonicalIntent(obj[k])}`).join(",")}}`;
|
|
943
943
|
}
|
|
944
|
-
var SDK_VERSION = true ? "4.
|
|
944
|
+
var SDK_VERSION = true ? "4.6.0" : "0.0.0";
|
|
945
945
|
var USER_AGENT = `vorim-sdk/${SDK_VERSION}`;
|
|
946
946
|
function sleep(ms) {
|
|
947
947
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
@@ -2310,6 +2310,60 @@ var VorimSDK = class _VorimSDK {
|
|
|
2310
2310
|
max_age_seconds: input.maxAgeSeconds
|
|
2311
2311
|
});
|
|
2312
2312
|
}
|
|
2313
|
+
/**
|
|
2314
|
+
* AI incidents and near misses (4.6): kill-switch stops, tripwires that
|
|
2315
|
+
* refused, and sign-off packs that got worse, each with Vorim's suggested
|
|
2316
|
+
* classification and the firm's own assessment where recorded.
|
|
2317
|
+
*/
|
|
2318
|
+
async listIncidents(params = {}) {
|
|
2319
|
+
return this.get(`/evidence/incidents${params.days ? `?days=${encodeURIComponent(String(params.days))}` : ""}`);
|
|
2320
|
+
}
|
|
2321
|
+
/** One signed incident record, laid out as the FCA's PS26/2 standard template (`payload.ps26_2`). */
|
|
2322
|
+
async getIncident(ref) {
|
|
2323
|
+
return this.get(`/evidence/incidents/${encodeURIComponent(ref)}`);
|
|
2324
|
+
}
|
|
2325
|
+
/**
|
|
2326
|
+
* Record the firm's assessment of an incident. `causeType` must be one of
|
|
2327
|
+
* the PS26/2 template's cause types; closing it stamps the resolution time.
|
|
2328
|
+
* Whether it is reportable is the firm's decision.
|
|
2329
|
+
*/
|
|
2330
|
+
async updateIncident(ref, input) {
|
|
2331
|
+
const map = { incidentType: "incident_type", actionsPlanned: "actions_planned", actionsTaken: "actions_taken", resolvedAt: "resolved_at", causeType: "cause_type", thirdPartyName: "third_party_name" };
|
|
2332
|
+
const body = {};
|
|
2333
|
+
for (const [k, v] of Object.entries(input)) if (v !== void 0) body[map[k] ?? k] = v;
|
|
2334
|
+
return this.patch(`/evidence/incidents/${encodeURIComponent(ref)}`, body);
|
|
2335
|
+
}
|
|
2336
|
+
/** A signed statement of delegated authority for one agent: identity, authority, accountability, execution, and the gaps a reviewer will ask about. */
|
|
2337
|
+
async getAuthorityStatement(agentId) {
|
|
2338
|
+
return this.get(`/evidence/authority/${encodeURIComponent(agentId)}`);
|
|
2339
|
+
}
|
|
2340
|
+
/**
|
|
2341
|
+
* Import a Mastercard Verifiable Intent autonomous mandate (L1 issuer
|
|
2342
|
+
* credential + L2 customer mandate, payment side) as a pending Vorim
|
|
2343
|
+
* mandate. The customer key in L1 still signs `signing_input` to activate it.
|
|
2344
|
+
* Limits Vorim cannot enforce are refused by name (422).
|
|
2345
|
+
*/
|
|
2346
|
+
async importVerifiableIntent(input) {
|
|
2347
|
+
return this.post("/mandates/import-verifiable-intent", {
|
|
2348
|
+
l1: input.l1,
|
|
2349
|
+
l2: input.l2,
|
|
2350
|
+
issuer_jwk: input.issuerJwk,
|
|
2351
|
+
agent_id: input.agentId,
|
|
2352
|
+
customer_ref: input.customerRef,
|
|
2353
|
+
action_types: input.actionTypes,
|
|
2354
|
+
expected_aud: input.expectedAud
|
|
2355
|
+
});
|
|
2356
|
+
}
|
|
2357
|
+
/**
|
|
2358
|
+
* Verify a Visa Trusted Agent Protocol message signature on a request your
|
|
2359
|
+
* site received: the signature over "@authority" and "@path", the 8-minute
|
|
2360
|
+
* window, the tag (`agent-browser-auth` or `agent-payer-auth`) and a nonce
|
|
2361
|
+
* used once. Keys come from the key directory configured on the server, or
|
|
2362
|
+
* pass `keys`. Needs an API key with runtime:decide.
|
|
2363
|
+
*/
|
|
2364
|
+
async verifyTap(input) {
|
|
2365
|
+
return this.post("/gateway/tap/verify", { url: input.url, headers: input.headers, keys: input.keys, require_tag: input.requireTag });
|
|
2366
|
+
}
|
|
2313
2367
|
/** Check any sealed Vorim document (case pack, sign-off, gateway verdict, mandate record). Public endpoint. */
|
|
2314
2368
|
async verifyEvidence(doc) {
|
|
2315
2369
|
return this.post("/evidence/verify", { payload: doc.payload, hash: doc.hash, signature: doc.signature });
|