@astrasyncai/verification-gateway 5.14.0 → 5.16.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/README.md +36 -18
- package/dist/adapters/express.d.mts +1 -1
- package/dist/adapters/express.d.ts +1 -1
- package/dist/adapters/express.js +492 -240
- package/dist/adapters/express.js.map +1 -1
- package/dist/adapters/express.mjs +492 -240
- package/dist/adapters/express.mjs.map +1 -1
- package/dist/adapters/mcp.d.mts +1 -1
- package/dist/adapters/mcp.d.ts +1 -1
- package/dist/adapters/mcp.js +23 -6
- package/dist/adapters/mcp.js.map +1 -1
- package/dist/adapters/mcp.mjs +23 -6
- package/dist/adapters/mcp.mjs.map +1 -1
- package/dist/adapters/nextjs.d.mts +1 -1
- package/dist/adapters/nextjs.d.ts +1 -1
- package/dist/adapters/nextjs.js +475 -239
- package/dist/adapters/nextjs.js.map +1 -1
- package/dist/adapters/nextjs.mjs +475 -239
- package/dist/adapters/nextjs.mjs.map +1 -1
- package/dist/adapters/sdk.d.mts +18 -10
- package/dist/adapters/sdk.d.ts +18 -10
- package/dist/adapters/sdk.js +83 -23
- package/dist/adapters/sdk.js.map +1 -1
- package/dist/adapters/sdk.mjs +83 -23
- package/dist/adapters/sdk.mjs.map +1 -1
- package/dist/agent/index.d.mts +69 -54
- package/dist/agent/index.d.ts +69 -54
- package/dist/agent/index.js +24 -14
- package/dist/agent/index.js.map +1 -1
- package/dist/agent/index.mjs +24 -14
- package/dist/agent/index.mjs.map +1 -1
- package/dist/bin/astrasync-claude-hook.js +58 -11
- package/dist/bin/astrasync-codex-hook.js +58 -11
- package/dist/bin/astrasync-guard.js +177 -11
- package/dist/bin/astrasync.js +433 -38
- package/dist/browser/background.js +53 -6
- package/dist/browser/background.js.map +1 -1
- package/dist/browser/background.mjs +63 -6
- package/dist/browser/background.mjs.map +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/index.mjs +1 -1
- package/dist/cli/index.mjs.map +1 -1
- package/dist/codex/index.js +58 -11
- package/dist/codex/index.js.map +1 -1
- package/dist/codex/index.mjs +68 -11
- package/dist/codex/index.mjs.map +1 -1
- package/dist/cursor/extension.js +58 -11
- package/dist/cursor/extension.js.map +1 -1
- package/dist/cursor/extension.mjs +68 -11
- package/dist/cursor/extension.mjs.map +1 -1
- package/dist/edge-config.d.mts +31 -2
- package/dist/edge-config.d.ts +31 -2
- package/dist/edge-config.js +35 -5
- package/dist/edge-config.js.map +1 -1
- package/dist/edge-config.mjs +32 -4
- package/dist/edge-config.mjs.map +1 -1
- package/dist/edge-core/index.d.mts +11 -2
- package/dist/edge-core/index.d.ts +11 -2
- package/dist/edge-core/index.js +97 -11
- package/dist/edge-core/index.js.map +1 -1
- package/dist/edge-core/index.mjs +95 -11
- package/dist/edge-core/index.mjs.map +1 -1
- package/dist/gateway/gateway.js +53 -6
- package/dist/gateway/gateway.js.map +1 -1
- package/dist/gateway/gateway.mjs +63 -6
- package/dist/gateway/gateway.mjs.map +1 -1
- package/dist/git-trigger/git-hooks.d.mts +1 -1
- package/dist/git-trigger/git-hooks.d.ts +1 -1
- package/dist/index.d.mts +1407 -88
- package/dist/index.d.ts +1407 -88
- package/dist/index.js +5148 -2616
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5094 -2618
- package/dist/index.mjs.map +1 -1
- package/dist/registration/index.d.mts +28 -2
- package/dist/registration/index.d.ts +28 -2
- package/dist/registration/index.js +18 -3
- package/dist/registration/index.js.map +1 -1
- package/dist/registration/index.mjs +15 -2
- package/dist/registration/index.mjs.map +1 -1
- package/dist/transport/index.d.mts +7 -5
- package/dist/transport/index.d.ts +7 -5
- package/dist/transport/index.js +61 -5
- package/dist/transport/index.js.map +1 -1
- package/dist/transport/index.mjs +67 -11
- package/dist/transport/index.mjs.map +1 -1
- package/dist/{types-BCkwBA84.d.mts → types-Blz520bR.d.mts} +116 -12
- package/dist/{types-BCkwBA84.d.ts → types-Blz520bR.d.ts} +116 -12
- package/dist/{types-C_b4QTyO.d.ts → types-Bm1QvGqI.d.ts} +114 -10
- package/dist/{types-DlshIIR-.d.mts → types-DBe4hgfT.d.mts} +114 -10
- package/dist/ui/index.d.mts +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/dist/verify.d.mts +1 -1
- package/dist/verify.d.ts +1 -1
- package/dist/verify.js +23 -6
- package/dist/verify.js.map +1 -1
- package/dist/verify.mjs +23 -6
- package/dist/verify.mjs.map +1 -1
- package/package.json +1 -1
package/dist/gateway/gateway.mjs
CHANGED
|
@@ -3722,7 +3722,7 @@ function getTrustLevel(score) {
|
|
|
3722
3722
|
}
|
|
3723
3723
|
|
|
3724
3724
|
// src/version.ts
|
|
3725
|
-
var SDK_VERSION = "5.
|
|
3725
|
+
var SDK_VERSION = "5.16.0";
|
|
3726
3726
|
|
|
3727
3727
|
// src/http.ts
|
|
3728
3728
|
var SDK_USER_AGENT = `astrasync-sdk/${SDK_VERSION}`;
|
|
@@ -3859,6 +3859,8 @@ function getCacheKey(request, counterpartyId) {
|
|
|
3859
3859
|
request.durationRequired ?? "",
|
|
3860
3860
|
request.invocationProtocol || "",
|
|
3861
3861
|
request.enableRuntimeChallenge ? "1" : "0",
|
|
3862
|
+
// 5.16.0: route policy changes the verdict (owners / challenge).
|
|
3863
|
+
request.routePolicy ? JSON.stringify(request.routePolicy) : "",
|
|
3862
3864
|
// callerMetadata fields contribute to risk model; include the ones
|
|
3863
3865
|
// backend reads. sourceIp/userAgent/forwardedFor change per-request
|
|
3864
3866
|
// so their inclusion effectively forces a re-check for any varying
|
|
@@ -4031,6 +4033,7 @@ async function callVerifyAccessAPI(config, request) {
|
|
|
4031
4033
|
if (requestData.subAgentDepth !== void 0) body.subAgentDepth = requestData.subAgentDepth;
|
|
4032
4034
|
if (requestData.enableRuntimeChallenge)
|
|
4033
4035
|
body.enableRuntimeChallenge = requestData.enableRuntimeChallenge;
|
|
4036
|
+
if (requestData.routePolicy) body.routePolicy = requestData.routePolicy;
|
|
4034
4037
|
if (requestData.createSession) body.createSession = requestData.createSession;
|
|
4035
4038
|
if (requestData.durationRequired) body.durationRequired = requestData.durationRequired;
|
|
4036
4039
|
if (requestData.counterpartyType) body.counterpartyType = requestData.counterpartyType;
|
|
@@ -4041,6 +4044,7 @@ async function callVerifyAccessAPI(config, request) {
|
|
|
4041
4044
|
if (requestData.invocationProtocol) body.invocationProtocol = requestData.invocationProtocol;
|
|
4042
4045
|
if (requestData.commercePhase) body.commercePhase = requestData.commercePhase;
|
|
4043
4046
|
if (requestData.checkoutSessionId) body.checkoutSessionId = requestData.checkoutSessionId;
|
|
4047
|
+
if (requestData.checkoutJwt) body.checkoutJwt = requestData.checkoutJwt;
|
|
4044
4048
|
if (requestData.checkoutItems) body.checkoutItems = requestData.checkoutItems;
|
|
4045
4049
|
if (requestData.buyerEmail) body.buyerEmail = requestData.buyerEmail;
|
|
4046
4050
|
if (requestData.commerceArtifacts) body.commerceArtifacts = requestData.commerceArtifacts;
|
|
@@ -4191,7 +4195,8 @@ async function verify(config, request, options) {
|
|
|
4191
4195
|
"[VerificationGateway] minTrustScore / minTrustScoreForFull are deprecated in v2.3.0 and have no effect. Server is now the single source of truth for access decisions (verified ID + runtime challenge + PDLSS + trust score). To gate access to an endpoint, configure the endpoint's trust_score_requirement server-side."
|
|
4192
4196
|
);
|
|
4193
4197
|
}
|
|
4194
|
-
|
|
4198
|
+
const uncacheable = Boolean(request.commerceArtifacts);
|
|
4199
|
+
if (mergedConfig.cacheTtl !== 0 && !options?.bypassCache && !uncacheable) {
|
|
4195
4200
|
const cached = getCachedResult(request, mergedConfig.counterpartyId);
|
|
4196
4201
|
if (cached) {
|
|
4197
4202
|
if (mergedConfig.debug) {
|
|
@@ -4272,7 +4277,10 @@ async function verify(config, request, options) {
|
|
|
4272
4277
|
// MERCHANT caller only (bridge callers strip it before the agent plane).
|
|
4273
4278
|
settlementToken: apiResponse.settlementToken,
|
|
4274
4279
|
// 5.6.0: fulfilment contact — merchant-only lane, same strip rule.
|
|
4275
|
-
fulfilment: apiResponse.fulfilment
|
|
4280
|
+
fulfilment: apiResponse.fulfilment,
|
|
4281
|
+
mandates: apiResponse.mandates,
|
|
4282
|
+
kyaToken: apiResponse.kyaToken,
|
|
4283
|
+
aep: apiResponse.aep
|
|
4276
4284
|
};
|
|
4277
4285
|
return result2;
|
|
4278
4286
|
}
|
|
@@ -4282,7 +4290,10 @@ async function verify(config, request, options) {
|
|
|
4282
4290
|
trustScore: apiResponse.agent.trustScore,
|
|
4283
4291
|
trustLevel: getTrustLevel(apiResponse.agent.trustScore),
|
|
4284
4292
|
blockchainAnchored: apiResponse.agent.blockchainStatus === "anchored",
|
|
4285
|
-
status: apiResponse.agent.agentStatus
|
|
4293
|
+
status: apiResponse.agent.agentStatus,
|
|
4294
|
+
...apiResponse.agent.protocolIdentities && {
|
|
4295
|
+
protocolIdentities: apiResponse.agent.protocolIdentities
|
|
4296
|
+
}
|
|
4286
4297
|
} : void 0;
|
|
4287
4298
|
const developer = apiResponse.developer ? {
|
|
4288
4299
|
astradId: apiResponse.developer.kyaOwnerId,
|
|
@@ -4333,7 +4344,11 @@ async function verify(config, request, options) {
|
|
|
4333
4344
|
settlementOutcome: apiResponse.settlementOutcome,
|
|
4334
4345
|
settlementToken: apiResponse.settlementToken,
|
|
4335
4346
|
// 5.6.0: fulfilment contact — merchant-only lane, same strip rule.
|
|
4336
|
-
fulfilment: apiResponse.fulfilment
|
|
4347
|
+
fulfilment: apiResponse.fulfilment,
|
|
4348
|
+
// 5.15.0: merchant-lane AP2 mandates + KYAPay identity token.
|
|
4349
|
+
mandates: apiResponse.mandates,
|
|
4350
|
+
kyaToken: apiResponse.kyaToken,
|
|
4351
|
+
aep: apiResponse.aep
|
|
4337
4352
|
};
|
|
4338
4353
|
if (result.recommendation === "deny") {
|
|
4339
4354
|
result.policyAllowed = false;
|
|
@@ -4353,7 +4368,9 @@ async function verify(config, request, options) {
|
|
|
4353
4368
|
}
|
|
4354
4369
|
const escalates = result.requiresStepUp === true || result.requiresApproval === true || result.recommendation === "step_up_required";
|
|
4355
4370
|
if (mergedConfig.cacheTtl !== 0 && result.recommendation !== "deny" && !escalates) {
|
|
4356
|
-
|
|
4371
|
+
if (!uncacheable) {
|
|
4372
|
+
cacheResult(request, result, mergedConfig.cacheTtl, mergedConfig.counterpartyId);
|
|
4373
|
+
}
|
|
4357
4374
|
}
|
|
4358
4375
|
return result;
|
|
4359
4376
|
}
|
|
@@ -4364,6 +4381,9 @@ var FALLBACK_MAX_WAIT_MS = 5 * 60 * 1e3;
|
|
|
4364
4381
|
// src/metadata-capture.ts
|
|
4365
4382
|
var MAX_TOTAL_BYTES = 16 * 1024;
|
|
4366
4383
|
|
|
4384
|
+
// src/adapters/commerce-detect.ts
|
|
4385
|
+
var MAX_BODY_BYTES = 64 * 1024;
|
|
4386
|
+
|
|
4367
4387
|
// src/edge-config.ts
|
|
4368
4388
|
var DEFAULT_EDGE_CONFIG = Object.freeze({
|
|
4369
4389
|
version: 1,
|
|
@@ -4676,6 +4696,43 @@ import { createHash as createHash3, webcrypto } from "crypto";
|
|
|
4676
4696
|
// src/transport/registry/visa.ts
|
|
4677
4697
|
import { createRemoteJWKSet } from "jose";
|
|
4678
4698
|
|
|
4699
|
+
// src/ucp/profile.ts
|
|
4700
|
+
var UCP_VERSION = "2026-08-25";
|
|
4701
|
+
var SPEC = `https://ucp.dev/${UCP_VERSION}/specification`;
|
|
4702
|
+
var SCHEMAS = `https://ucp.dev/${UCP_VERSION}/schemas`;
|
|
4703
|
+
|
|
4704
|
+
// src/ucp/signatures.ts
|
|
4705
|
+
import { httpbis as httpbis3, createSigner as createSigner2 } from "http-message-signatures";
|
|
4706
|
+
|
|
4707
|
+
// src/http-signatures/sign.ts
|
|
4708
|
+
import { httpbis as httpbis2, createSigner } from "http-message-signatures";
|
|
4709
|
+
|
|
4710
|
+
// src/ucp/checkout-kit.ts
|
|
4711
|
+
import { CompactSign as CompactSign2 } from "jose";
|
|
4712
|
+
|
|
4713
|
+
// src/mandates/sd-jwt.ts
|
|
4714
|
+
import {
|
|
4715
|
+
CompactSign,
|
|
4716
|
+
compactVerify,
|
|
4717
|
+
importJWK,
|
|
4718
|
+
decodeProtectedHeader
|
|
4719
|
+
} from "jose";
|
|
4720
|
+
|
|
4721
|
+
// src/idempotency/index.ts
|
|
4722
|
+
var DEFAULT_IDEMPOTENCY_TTL_MS = 24 * 60 * 60 * 1e3;
|
|
4723
|
+
|
|
4724
|
+
// src/payments/kyapay.ts
|
|
4725
|
+
import {
|
|
4726
|
+
createLocalJWKSet,
|
|
4727
|
+
createRemoteJWKSet as createRemoteJWKSet2,
|
|
4728
|
+
decodeProtectedHeader as decodeProtectedHeader2,
|
|
4729
|
+
jwtVerify
|
|
4730
|
+
} from "jose";
|
|
4731
|
+
|
|
4732
|
+
// src/aep/core.ts
|
|
4733
|
+
var ED25519_PKCS8_PREFIX = Buffer.from("302e020100300506032b657004220420", "hex");
|
|
4734
|
+
var ED25519_SPKI_PREFIX = Buffer.from("302a300506032b6570032100", "hex");
|
|
4735
|
+
|
|
4679
4736
|
// src/gateway/modes/online.ts
|
|
4680
4737
|
function toGatewayConfig(config) {
|
|
4681
4738
|
return {
|