@astrasyncai/verification-gateway 3.4.0 → 3.5.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 +86 -0
- package/dist/adapter-interface/interface.d.mts +2 -2
- package/dist/adapter-interface/interface.d.ts +2 -2
- package/dist/adapters/express.d.mts +2 -2
- package/dist/adapters/express.d.ts +2 -2
- package/dist/adapters/express.js +18 -1
- package/dist/adapters/express.js.map +1 -1
- package/dist/adapters/express.mjs +18 -1
- 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 +1 -1
- package/dist/adapters/mcp.js.map +1 -1
- package/dist/adapters/mcp.mjs +1 -1
- package/dist/adapters/mcp.mjs.map +1 -1
- package/dist/adapters/nextjs.d.mts +2 -2
- package/dist/adapters/nextjs.d.ts +2 -2
- package/dist/adapters/nextjs.js +1 -1
- package/dist/adapters/nextjs.js.map +1 -1
- package/dist/adapters/nextjs.mjs +1 -1
- package/dist/adapters/nextjs.mjs.map +1 -1
- package/dist/adapters/sdk.d.mts +2 -2
- package/dist/adapters/sdk.d.ts +2 -2
- package/dist/adapters/sdk.js +1 -1
- package/dist/adapters/sdk.js.map +1 -1
- package/dist/adapters/sdk.mjs +1 -1
- package/dist/adapters/sdk.mjs.map +1 -1
- package/dist/agent/index.d.mts +2 -2
- package/dist/agent/index.d.ts +2 -2
- package/dist/browser/background.js +1 -1
- package/dist/browser/background.js.map +1 -1
- package/dist/browser/background.mjs +1 -1
- package/dist/browser/background.mjs.map +1 -1
- package/dist/browser/browser-adapter.d.mts +2 -2
- package/dist/browser/browser-adapter.d.ts +2 -2
- package/dist/cli/index.d.mts +2 -2
- package/dist/cli/index.d.ts +2 -2
- package/dist/cursor/cursor-adapter.d.mts +2 -2
- package/dist/cursor/cursor-adapter.d.ts +2 -2
- package/dist/cursor/extension.d.mts +2 -2
- package/dist/cursor/extension.d.ts +2 -2
- package/dist/cursor/extension.js +1 -1
- package/dist/cursor/extension.js.map +1 -1
- package/dist/cursor/extension.mjs +1 -1
- package/dist/cursor/extension.mjs.map +1 -1
- package/dist/{express-CeFvNWDD.d.mts → express-BH5ADAyb.d.mts} +1 -1
- package/dist/{express-RIh05wW2.d.ts → express-jUzLIoep.d.ts} +1 -1
- package/dist/gateway/gateway.d.mts +2 -2
- package/dist/gateway/gateway.d.ts +2 -2
- package/dist/gateway/gateway.js +1 -1
- package/dist/gateway/gateway.js.map +1 -1
- package/dist/gateway/gateway.mjs +1 -1
- package/dist/gateway/gateway.mjs.map +1 -1
- package/dist/git-trigger/git-hooks.d.mts +2 -2
- package/dist/git-trigger/git-hooks.d.ts +2 -2
- package/dist/{index-Bw4FeHMY.d.mts → index-BR2nmxBU.d.mts} +5 -1
- package/dist/{index-C-K0WCrk.d.ts → index-DEixUCu0.d.ts} +5 -1
- package/dist/{index-BYu1FKMy.d.ts → index-DlCnmpJH.d.ts} +1 -1
- package/dist/{index-DgVBEiwI.d.mts → index-aZHAWujT.d.mts} +1 -1
- package/dist/index.d.mts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +40 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +40 -5
- package/dist/index.mjs.map +1 -1
- package/dist/local-evaluator/evaluator.d.mts +2 -2
- package/dist/local-evaluator/evaluator.d.ts +2 -2
- package/dist/{nextjs--xR9zbSJ.d.ts → nextjs-DfXOd0Au.d.ts} +1 -1
- package/dist/{nextjs-xciaMpsZ.d.mts → nextjs-LTeoPqMH.d.mts} +1 -1
- package/dist/{sdk-CJYCLMI0.d.mts → sdk-DKhwVL9X.d.mts} +1 -1
- package/dist/{sdk-FP7xT9F8.d.ts → sdk-LmvyDVpL.d.ts} +1 -1
- package/dist/transport/index.d.mts +2 -2
- package/dist/transport/index.d.ts +2 -2
- package/dist/transport/index.js +22 -4
- package/dist/transport/index.js.map +1 -1
- package/dist/transport/index.mjs +22 -4
- package/dist/transport/index.mjs.map +1 -1
- package/dist/{types-Cj92yKeA.d.mts → types-C8HyQEaz.d.mts} +1 -1
- package/dist/{types-Cwrvo30g.d.mts → types-DrDIouvO.d.mts} +24 -2
- package/dist/{types-Cwrvo30g.d.ts → types-DrDIouvO.d.ts} +24 -2
- package/dist/{types-DOeL-dIw.d.ts → types-xofemo0G.d.ts} +1 -1
- package/dist/ui/index.d.mts +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AstraSyncGateway } from '../gateway/gateway.mjs';
|
|
2
|
-
import { V as VerificationDecision, P as PDLSSContext } from '../types-
|
|
3
|
-
import '../types-
|
|
2
|
+
import { V as VerificationDecision, P as PDLSSContext } from '../types-C8HyQEaz.mjs';
|
|
3
|
+
import '../types-DrDIouvO.mjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Git Trigger — Enterprise git push / PR verification
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AstraSyncGateway } from '../gateway/gateway.js';
|
|
2
|
-
import { V as VerificationDecision, P as PDLSSContext } from '../types-
|
|
3
|
-
import '../types-
|
|
2
|
+
import { V as VerificationDecision, P as PDLSSContext } from '../types-xofemo0G.js';
|
|
3
|
+
import '../types-DrDIouvO.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Git Trigger — Enterprise git push / PR verification
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as AstraSyncCredentials, g as ProtocolTransport } from './types-
|
|
1
|
+
import { c as AstraSyncCredentials, g as ProtocolTransport } from './types-DrDIouvO.mjs';
|
|
2
2
|
import { JWK } from 'jose';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -96,6 +96,10 @@ interface TransactionValueContext {
|
|
|
96
96
|
amount: number;
|
|
97
97
|
currency: string;
|
|
98
98
|
source: string;
|
|
99
|
+
/** When true, the amount is in raw atomic/minor units and could NOT be
|
|
100
|
+
* converted to major units (unknown token decimals). The limit engine
|
|
101
|
+
* must fail-closed — never compare raw units against major-unit limits. */
|
|
102
|
+
rawUnits?: boolean;
|
|
99
103
|
}
|
|
100
104
|
declare function extractUCPTransactionValue(input: {
|
|
101
105
|
totals?: Array<{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { c as AstraSyncCredentials, g as ProtocolTransport } from './types-
|
|
1
|
+
import { c as AstraSyncCredentials, g as ProtocolTransport } from './types-DrDIouvO.js';
|
|
2
2
|
import { JWK } from 'jose';
|
|
3
3
|
|
|
4
4
|
/**
|
|
@@ -96,6 +96,10 @@ interface TransactionValueContext {
|
|
|
96
96
|
amount: number;
|
|
97
97
|
currency: string;
|
|
98
98
|
source: string;
|
|
99
|
+
/** When true, the amount is in raw atomic/minor units and could NOT be
|
|
100
|
+
* converted to major units (unknown token decimals). The limit engine
|
|
101
|
+
* must fail-closed — never compare raw units against major-unit limits. */
|
|
102
|
+
rawUnits?: boolean;
|
|
99
103
|
}
|
|
100
104
|
declare function extractUCPTransactionValue(input: {
|
|
101
105
|
totals?: Array<{
|
package/dist/index.d.mts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { b as AgentCredentials, G as GatewayConfig, a as AccessLevel, V as VerificationRequest, l as VerificationResult, E as EnhancedVerificationResult, A as AccessFailure, j as StepUpApprovalInfo } from './types-
|
|
2
|
-
export { c as AstraSyncCredentials, C as CommerceShieldProps, d as CounterpartyType, e as ExpressMiddlewareOptions, f as GuidanceInfo, N as NextJsMiddlewareOptions, P as PDLSSInfo, g as ProtocolTransport, R as RouteAccessConfig, h as RuntimeChallengeResult, S as SDKOptions, i as SettlementArtifact, T as TokenGuidance, k as TrustLevel, m as VerifiedAgent, n as VerifiedDeveloper, o as VerifiedOrganization } from './types-
|
|
3
|
-
export { A as ACCESS_LEVEL_DESCRIPTIONS, a as ACCESS_LEVEL_HIERARCHY, b as AccessCapabilities, D as DEFAULT_TRUST_THRESHOLDS, T as TRUST_LEVEL_RANGES, d as determineAccessLevel, g as getAccessLevelForScore, e as getCapabilities, f as getTrustLevel, h as hasMinimumAccess, s as sdk } from './sdk-
|
|
4
|
-
export { e as express } from './express-
|
|
5
|
-
export { n as nextjs } from './nextjs-
|
|
6
|
-
export { aR as extractMcpCredentials, bg as setMcpMeta, b1 as transport } from './index-
|
|
1
|
+
import { b as AgentCredentials, G as GatewayConfig, a as AccessLevel, V as VerificationRequest, l as VerificationResult, E as EnhancedVerificationResult, A as AccessFailure, j as StepUpApprovalInfo } from './types-DrDIouvO.mjs';
|
|
2
|
+
export { c as AstraSyncCredentials, C as CommerceShieldProps, d as CounterpartyType, e as ExpressMiddlewareOptions, f as GuidanceInfo, N as NextJsMiddlewareOptions, P as PDLSSInfo, g as ProtocolTransport, R as RouteAccessConfig, h as RuntimeChallengeResult, S as SDKOptions, i as SettlementArtifact, T as TokenGuidance, k as TrustLevel, m as VerifiedAgent, n as VerifiedDeveloper, o as VerifiedOrganization } from './types-DrDIouvO.mjs';
|
|
3
|
+
export { A as ACCESS_LEVEL_DESCRIPTIONS, a as ACCESS_LEVEL_HIERARCHY, b as AccessCapabilities, D as DEFAULT_TRUST_THRESHOLDS, T as TRUST_LEVEL_RANGES, d as determineAccessLevel, g as getAccessLevelForScore, e as getCapabilities, f as getTrustLevel, h as hasMinimumAccess, s as sdk } from './sdk-DKhwVL9X.mjs';
|
|
4
|
+
export { e as express } from './express-BH5ADAyb.mjs';
|
|
5
|
+
export { n as nextjs } from './nextjs-LTeoPqMH.mjs';
|
|
6
|
+
export { aR as extractMcpCredentials, bg as setMcpMeta, b1 as transport } from './index-BR2nmxBU.mjs';
|
|
7
7
|
export { McpMiddlewareOptions, ToolGateConfig, createMcpMiddleware } from './adapters/mcp.mjs';
|
|
8
8
|
export { AgentProtocol, AgentRecord, AstraSync, AstraSyncConfig, AstraSyncError, AuthenticationError, BuildGuidanceParams, FrameworkConfig, GuidanceEnvelope, HealthResponse, KYDRequiredError, ModelConfig, PDLSSConfig, PDLSSDuration, PDLSSLimits, PDLSSPurpose, PDLSSScope, PDLSSSelfInstantiation, PendingRegistrationResponse, PollRegistrationResult, RegisterOptions, RegisterResult, RegistrationDeniedError, RegistrationExpiredError, RegistrationResponse, RegistrationTimeoutError, VerifyResponse, WaitForApprovalOptions, buildGuidance } from './registration/index.mjs';
|
|
9
|
-
export { A as AgentClient, C as ChallengeHandler, i as agent, r as recordDecision } from './index-
|
|
9
|
+
export { A as AgentClient, C as ChallengeHandler, i as agent, r as recordDecision } from './index-aZHAWujT.mjs';
|
|
10
10
|
import 'express';
|
|
11
11
|
import 'next/server';
|
|
12
12
|
import 'jose';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { b as AgentCredentials, G as GatewayConfig, a as AccessLevel, V as VerificationRequest, l as VerificationResult, E as EnhancedVerificationResult, A as AccessFailure, j as StepUpApprovalInfo } from './types-
|
|
2
|
-
export { c as AstraSyncCredentials, C as CommerceShieldProps, d as CounterpartyType, e as ExpressMiddlewareOptions, f as GuidanceInfo, N as NextJsMiddlewareOptions, P as PDLSSInfo, g as ProtocolTransport, R as RouteAccessConfig, h as RuntimeChallengeResult, S as SDKOptions, i as SettlementArtifact, T as TokenGuidance, k as TrustLevel, m as VerifiedAgent, n as VerifiedDeveloper, o as VerifiedOrganization } from './types-
|
|
3
|
-
export { A as ACCESS_LEVEL_DESCRIPTIONS, a as ACCESS_LEVEL_HIERARCHY, b as AccessCapabilities, D as DEFAULT_TRUST_THRESHOLDS, T as TRUST_LEVEL_RANGES, d as determineAccessLevel, g as getAccessLevelForScore, e as getCapabilities, f as getTrustLevel, h as hasMinimumAccess, s as sdk } from './sdk-
|
|
4
|
-
export { e as express } from './express-
|
|
5
|
-
export { n as nextjs } from './nextjs
|
|
6
|
-
export { aR as extractMcpCredentials, bg as setMcpMeta, b1 as transport } from './index-
|
|
1
|
+
import { b as AgentCredentials, G as GatewayConfig, a as AccessLevel, V as VerificationRequest, l as VerificationResult, E as EnhancedVerificationResult, A as AccessFailure, j as StepUpApprovalInfo } from './types-DrDIouvO.js';
|
|
2
|
+
export { c as AstraSyncCredentials, C as CommerceShieldProps, d as CounterpartyType, e as ExpressMiddlewareOptions, f as GuidanceInfo, N as NextJsMiddlewareOptions, P as PDLSSInfo, g as ProtocolTransport, R as RouteAccessConfig, h as RuntimeChallengeResult, S as SDKOptions, i as SettlementArtifact, T as TokenGuidance, k as TrustLevel, m as VerifiedAgent, n as VerifiedDeveloper, o as VerifiedOrganization } from './types-DrDIouvO.js';
|
|
3
|
+
export { A as ACCESS_LEVEL_DESCRIPTIONS, a as ACCESS_LEVEL_HIERARCHY, b as AccessCapabilities, D as DEFAULT_TRUST_THRESHOLDS, T as TRUST_LEVEL_RANGES, d as determineAccessLevel, g as getAccessLevelForScore, e as getCapabilities, f as getTrustLevel, h as hasMinimumAccess, s as sdk } from './sdk-LmvyDVpL.js';
|
|
4
|
+
export { e as express } from './express-jUzLIoep.js';
|
|
5
|
+
export { n as nextjs } from './nextjs-DfXOd0Au.js';
|
|
6
|
+
export { aR as extractMcpCredentials, bg as setMcpMeta, b1 as transport } from './index-DEixUCu0.js';
|
|
7
7
|
export { McpMiddlewareOptions, ToolGateConfig, createMcpMiddleware } from './adapters/mcp.js';
|
|
8
8
|
export { AgentProtocol, AgentRecord, AstraSync, AstraSyncConfig, AstraSyncError, AuthenticationError, BuildGuidanceParams, FrameworkConfig, GuidanceEnvelope, HealthResponse, KYDRequiredError, ModelConfig, PDLSSConfig, PDLSSDuration, PDLSSLimits, PDLSSPurpose, PDLSSScope, PDLSSSelfInstantiation, PendingRegistrationResponse, PollRegistrationResult, RegisterOptions, RegisterResult, RegistrationDeniedError, RegistrationExpiredError, RegistrationResponse, RegistrationTimeoutError, VerifyResponse, WaitForApprovalOptions, buildGuidance } from './registration/index.js';
|
|
9
|
-
export { A as AgentClient, C as ChallengeHandler, i as agent, r as recordDecision } from './index-
|
|
9
|
+
export { A as AgentClient, C as ChallengeHandler, i as agent, r as recordDecision } from './index-DlCnmpJH.js';
|
|
10
10
|
import 'express';
|
|
11
11
|
import 'next/server';
|
|
12
12
|
import 'jose';
|
package/dist/index.js
CHANGED
|
@@ -193,7 +193,7 @@ function getCapabilities(accessLevel) {
|
|
|
193
193
|
}
|
|
194
194
|
|
|
195
195
|
// src/version.ts
|
|
196
|
-
var SDK_VERSION = "3.
|
|
196
|
+
var SDK_VERSION = "3.5.0";
|
|
197
197
|
|
|
198
198
|
// src/well-known.ts
|
|
199
199
|
var CACHE_TTL_MS = 60 * 60 * 1e3;
|
|
@@ -1243,6 +1243,21 @@ function createMiddleware(options) {
|
|
|
1243
1243
|
);
|
|
1244
1244
|
}
|
|
1245
1245
|
const agentCardUrl = typeof req.headers["x-astrasync-agent-card"] === "string" ? req.headers["x-astrasync-agent-card"] : void 0;
|
|
1246
|
+
let txValue;
|
|
1247
|
+
let txCurrency;
|
|
1248
|
+
if (config.extractTransactionValue) {
|
|
1249
|
+
try {
|
|
1250
|
+
const extracted = config.extractTransactionValue(req);
|
|
1251
|
+
if (extracted) {
|
|
1252
|
+
txValue = extracted.value;
|
|
1253
|
+
txCurrency = extracted.currency;
|
|
1254
|
+
}
|
|
1255
|
+
} catch (e) {
|
|
1256
|
+
if (config.debug) {
|
|
1257
|
+
console.warn("[VerificationGateway] extractTransactionValue threw:", e);
|
|
1258
|
+
}
|
|
1259
|
+
}
|
|
1260
|
+
}
|
|
1246
1261
|
const result = await verify(config, {
|
|
1247
1262
|
credentials,
|
|
1248
1263
|
purpose,
|
|
@@ -1253,6 +1268,8 @@ function createMiddleware(options) {
|
|
|
1253
1268
|
counterpartyType: config.counterpartyType || "api",
|
|
1254
1269
|
enableRuntimeChallenge,
|
|
1255
1270
|
durationRequired: astraCreds?.pdlss?.duration?.maxSessionDuration,
|
|
1271
|
+
...txValue !== void 0 && { transactionValue: txValue },
|
|
1272
|
+
...txCurrency && { currency: txCurrency },
|
|
1256
1273
|
callerMetadata: {
|
|
1257
1274
|
sourceIp: originalClientIp,
|
|
1258
1275
|
userAgent: req.headers["user-agent"],
|
|
@@ -2233,15 +2250,33 @@ function extractMPPTransactionValue(challenge) {
|
|
|
2233
2250
|
source: `challenge.request.amount (method=${challenge.method ?? "unknown"})`
|
|
2234
2251
|
};
|
|
2235
2252
|
}
|
|
2253
|
+
var KNOWN_TOKEN_DECIMALS = {
|
|
2254
|
+
USDC: 6,
|
|
2255
|
+
USDT: 6,
|
|
2256
|
+
DAI: 18,
|
|
2257
|
+
ETH: 18,
|
|
2258
|
+
WETH: 18
|
|
2259
|
+
};
|
|
2236
2260
|
function extractX402TransactionValue(req) {
|
|
2237
|
-
const
|
|
2261
|
+
const rawAmount = req.maxAmountRequired ?? req.amount;
|
|
2238
2262
|
const currency = req.currency ?? req.asset;
|
|
2239
|
-
if (typeof
|
|
2263
|
+
if (typeof rawAmount !== "number" || !currency) return null;
|
|
2264
|
+
const source = req.maxAmountRequired !== void 0 ? "maxAmountRequired" : "amount";
|
|
2265
|
+
const decimals = KNOWN_TOKEN_DECIMALS[currency.toUpperCase()];
|
|
2266
|
+
if (decimals !== void 0) {
|
|
2267
|
+
return {
|
|
2268
|
+
protocol: "x402",
|
|
2269
|
+
amount: rawAmount / Math.pow(10, decimals),
|
|
2270
|
+
currency,
|
|
2271
|
+
source
|
|
2272
|
+
};
|
|
2273
|
+
}
|
|
2240
2274
|
return {
|
|
2241
2275
|
protocol: "x402",
|
|
2242
|
-
amount,
|
|
2276
|
+
amount: rawAmount,
|
|
2243
2277
|
currency,
|
|
2244
|
-
source
|
|
2278
|
+
source,
|
|
2279
|
+
rawUnits: true
|
|
2245
2280
|
};
|
|
2246
2281
|
}
|
|
2247
2282
|
|