@astrasyncai/verification-gateway 5.14.0 → 5.15.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 +27 -17
- package/dist/adapters/express.d.mts +1 -1
- package/dist/adapters/express.d.ts +1 -1
- package/dist/adapters/express.js +477 -240
- package/dist/adapters/express.js.map +1 -1
- package/dist/adapters/express.mjs +477 -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 +20 -6
- package/dist/adapters/mcp.js.map +1 -1
- package/dist/adapters/mcp.mjs +20 -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 +460 -239
- package/dist/adapters/nextjs.js.map +1 -1
- package/dist/adapters/nextjs.mjs +460 -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 +80 -23
- package/dist/adapters/sdk.js.map +1 -1
- package/dist/adapters/sdk.mjs +80 -23
- package/dist/adapters/sdk.mjs.map +1 -1
- package/dist/agent/index.js +1 -1
- package/dist/agent/index.js.map +1 -1
- package/dist/agent/index.mjs +1 -1
- package/dist/agent/index.mjs.map +1 -1
- package/dist/bin/astrasync-claude-hook.js +55 -11
- package/dist/bin/astrasync-codex-hook.js +55 -11
- package/dist/bin/astrasync-guard.js +55 -11
- package/dist/bin/astrasync.js +288 -33
- package/dist/browser/background.js +50 -6
- package/dist/browser/background.js.map +1 -1
- package/dist/browser/background.mjs +60 -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 +55 -11
- package/dist/codex/index.js.map +1 -1
- package/dist/codex/index.mjs +65 -11
- package/dist/codex/index.mjs.map +1 -1
- package/dist/cursor/extension.js +55 -11
- package/dist/cursor/extension.js.map +1 -1
- package/dist/cursor/extension.mjs +65 -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 +93 -10
- package/dist/edge-core/index.js.map +1 -1
- package/dist/edge-core/index.mjs +91 -10
- package/dist/edge-core/index.mjs.map +1 -1
- package/dist/gateway/gateway.js +50 -6
- package/dist/gateway/gateway.js.map +1 -1
- package/dist/gateway/gateway.mjs +60 -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 +1314 -34
- package/dist/index.d.ts +1314 -34
- package/dist/index.js +5116 -2612
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5063 -2614
- 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-C_b4QTyO.d.ts → types-DtJjlW4O.d.ts} +104 -10
- package/dist/{types-BCkwBA84.d.mts → types-Dxf9DBpr.d.mts} +106 -12
- package/dist/{types-BCkwBA84.d.ts → types-Dxf9DBpr.d.ts} +106 -12
- package/dist/{types-DlshIIR-.d.mts → types-Eg6VoBNH.d.mts} +104 -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 +20 -6
- package/dist/verify.js.map +1 -1
- package/dist/verify.mjs +20 -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.15.0";
|
|
3726
3726
|
|
|
3727
3727
|
// src/http.ts
|
|
3728
3728
|
var SDK_USER_AGENT = `astrasync-sdk/${SDK_VERSION}`;
|
|
@@ -4041,6 +4041,7 @@ async function callVerifyAccessAPI(config, request) {
|
|
|
4041
4041
|
if (requestData.invocationProtocol) body.invocationProtocol = requestData.invocationProtocol;
|
|
4042
4042
|
if (requestData.commercePhase) body.commercePhase = requestData.commercePhase;
|
|
4043
4043
|
if (requestData.checkoutSessionId) body.checkoutSessionId = requestData.checkoutSessionId;
|
|
4044
|
+
if (requestData.checkoutJwt) body.checkoutJwt = requestData.checkoutJwt;
|
|
4044
4045
|
if (requestData.checkoutItems) body.checkoutItems = requestData.checkoutItems;
|
|
4045
4046
|
if (requestData.buyerEmail) body.buyerEmail = requestData.buyerEmail;
|
|
4046
4047
|
if (requestData.commerceArtifacts) body.commerceArtifacts = requestData.commerceArtifacts;
|
|
@@ -4191,7 +4192,8 @@ async function verify(config, request, options) {
|
|
|
4191
4192
|
"[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
4193
|
);
|
|
4193
4194
|
}
|
|
4194
|
-
|
|
4195
|
+
const uncacheable = Boolean(request.commerceArtifacts);
|
|
4196
|
+
if (mergedConfig.cacheTtl !== 0 && !options?.bypassCache && !uncacheable) {
|
|
4195
4197
|
const cached = getCachedResult(request, mergedConfig.counterpartyId);
|
|
4196
4198
|
if (cached) {
|
|
4197
4199
|
if (mergedConfig.debug) {
|
|
@@ -4272,7 +4274,10 @@ async function verify(config, request, options) {
|
|
|
4272
4274
|
// MERCHANT caller only (bridge callers strip it before the agent plane).
|
|
4273
4275
|
settlementToken: apiResponse.settlementToken,
|
|
4274
4276
|
// 5.6.0: fulfilment contact — merchant-only lane, same strip rule.
|
|
4275
|
-
fulfilment: apiResponse.fulfilment
|
|
4277
|
+
fulfilment: apiResponse.fulfilment,
|
|
4278
|
+
mandates: apiResponse.mandates,
|
|
4279
|
+
kyaToken: apiResponse.kyaToken,
|
|
4280
|
+
aep: apiResponse.aep
|
|
4276
4281
|
};
|
|
4277
4282
|
return result2;
|
|
4278
4283
|
}
|
|
@@ -4282,7 +4287,10 @@ async function verify(config, request, options) {
|
|
|
4282
4287
|
trustScore: apiResponse.agent.trustScore,
|
|
4283
4288
|
trustLevel: getTrustLevel(apiResponse.agent.trustScore),
|
|
4284
4289
|
blockchainAnchored: apiResponse.agent.blockchainStatus === "anchored",
|
|
4285
|
-
status: apiResponse.agent.agentStatus
|
|
4290
|
+
status: apiResponse.agent.agentStatus,
|
|
4291
|
+
...apiResponse.agent.protocolIdentities && {
|
|
4292
|
+
protocolIdentities: apiResponse.agent.protocolIdentities
|
|
4293
|
+
}
|
|
4286
4294
|
} : void 0;
|
|
4287
4295
|
const developer = apiResponse.developer ? {
|
|
4288
4296
|
astradId: apiResponse.developer.kyaOwnerId,
|
|
@@ -4333,7 +4341,11 @@ async function verify(config, request, options) {
|
|
|
4333
4341
|
settlementOutcome: apiResponse.settlementOutcome,
|
|
4334
4342
|
settlementToken: apiResponse.settlementToken,
|
|
4335
4343
|
// 5.6.0: fulfilment contact — merchant-only lane, same strip rule.
|
|
4336
|
-
fulfilment: apiResponse.fulfilment
|
|
4344
|
+
fulfilment: apiResponse.fulfilment,
|
|
4345
|
+
// 5.15.0: merchant-lane AP2 mandates + KYAPay identity token.
|
|
4346
|
+
mandates: apiResponse.mandates,
|
|
4347
|
+
kyaToken: apiResponse.kyaToken,
|
|
4348
|
+
aep: apiResponse.aep
|
|
4337
4349
|
};
|
|
4338
4350
|
if (result.recommendation === "deny") {
|
|
4339
4351
|
result.policyAllowed = false;
|
|
@@ -4353,7 +4365,9 @@ async function verify(config, request, options) {
|
|
|
4353
4365
|
}
|
|
4354
4366
|
const escalates = result.requiresStepUp === true || result.requiresApproval === true || result.recommendation === "step_up_required";
|
|
4355
4367
|
if (mergedConfig.cacheTtl !== 0 && result.recommendation !== "deny" && !escalates) {
|
|
4356
|
-
|
|
4368
|
+
if (!uncacheable) {
|
|
4369
|
+
cacheResult(request, result, mergedConfig.cacheTtl, mergedConfig.counterpartyId);
|
|
4370
|
+
}
|
|
4357
4371
|
}
|
|
4358
4372
|
return result;
|
|
4359
4373
|
}
|
|
@@ -4364,6 +4378,9 @@ var FALLBACK_MAX_WAIT_MS = 5 * 60 * 1e3;
|
|
|
4364
4378
|
// src/metadata-capture.ts
|
|
4365
4379
|
var MAX_TOTAL_BYTES = 16 * 1024;
|
|
4366
4380
|
|
|
4381
|
+
// src/adapters/commerce-detect.ts
|
|
4382
|
+
var MAX_BODY_BYTES = 64 * 1024;
|
|
4383
|
+
|
|
4367
4384
|
// src/edge-config.ts
|
|
4368
4385
|
var DEFAULT_EDGE_CONFIG = Object.freeze({
|
|
4369
4386
|
version: 1,
|
|
@@ -4676,6 +4693,43 @@ import { createHash as createHash3, webcrypto } from "crypto";
|
|
|
4676
4693
|
// src/transport/registry/visa.ts
|
|
4677
4694
|
import { createRemoteJWKSet } from "jose";
|
|
4678
4695
|
|
|
4696
|
+
// src/ucp/profile.ts
|
|
4697
|
+
var UCP_VERSION = "2026-08-25";
|
|
4698
|
+
var SPEC = `https://ucp.dev/${UCP_VERSION}/specification`;
|
|
4699
|
+
var SCHEMAS = `https://ucp.dev/${UCP_VERSION}/schemas`;
|
|
4700
|
+
|
|
4701
|
+
// src/ucp/signatures.ts
|
|
4702
|
+
import { httpbis as httpbis3, createSigner as createSigner2 } from "http-message-signatures";
|
|
4703
|
+
|
|
4704
|
+
// src/http-signatures/sign.ts
|
|
4705
|
+
import { httpbis as httpbis2, createSigner } from "http-message-signatures";
|
|
4706
|
+
|
|
4707
|
+
// src/ucp/checkout-kit.ts
|
|
4708
|
+
import { CompactSign as CompactSign2 } from "jose";
|
|
4709
|
+
|
|
4710
|
+
// src/mandates/sd-jwt.ts
|
|
4711
|
+
import {
|
|
4712
|
+
CompactSign,
|
|
4713
|
+
compactVerify,
|
|
4714
|
+
importJWK,
|
|
4715
|
+
decodeProtectedHeader
|
|
4716
|
+
} from "jose";
|
|
4717
|
+
|
|
4718
|
+
// src/idempotency/index.ts
|
|
4719
|
+
var DEFAULT_IDEMPOTENCY_TTL_MS = 24 * 60 * 60 * 1e3;
|
|
4720
|
+
|
|
4721
|
+
// src/payments/kyapay.ts
|
|
4722
|
+
import {
|
|
4723
|
+
createLocalJWKSet,
|
|
4724
|
+
createRemoteJWKSet as createRemoteJWKSet2,
|
|
4725
|
+
decodeProtectedHeader as decodeProtectedHeader2,
|
|
4726
|
+
jwtVerify
|
|
4727
|
+
} from "jose";
|
|
4728
|
+
|
|
4729
|
+
// src/aep/core.ts
|
|
4730
|
+
var ED25519_PKCS8_PREFIX = Buffer.from("302e020100300506032b657004220420", "hex");
|
|
4731
|
+
var ED25519_SPKI_PREFIX = Buffer.from("302a300506032b6570032100", "hex");
|
|
4732
|
+
|
|
4679
4733
|
// src/gateway/modes/online.ts
|
|
4680
4734
|
function toGatewayConfig(config) {
|
|
4681
4735
|
return {
|