@astrasyncai/verification-gateway 2.0.0 → 2.1.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/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 +118 -5
- package/dist/adapters/express.js.map +1 -1
- package/dist/adapters/express.mjs +118 -5
- package/dist/adapters/express.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 +189 -9
- package/dist/adapters/nextjs.js.map +1 -1
- package/dist/adapters/nextjs.mjs +189 -9
- 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 -0
- package/dist/adapters/sdk.js.map +1 -1
- package/dist/adapters/sdk.mjs +1 -0
- 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/agent/index.js +33 -0
- package/dist/agent/index.js.map +1 -1
- package/dist/agent/index.mjs +36 -0
- package/dist/agent/index.mjs.map +1 -1
- package/dist/browser/background.d.mts +2 -0
- package/dist/browser/background.d.ts +2 -0
- package/dist/browser/background.js +4123 -0
- package/dist/browser/background.js.map +1 -0
- package/dist/browser/background.mjs +4124 -0
- package/dist/browser/background.mjs.map +1 -0
- package/dist/browser/browser-adapter.d.mts +10 -6
- package/dist/browser/browser-adapter.d.ts +10 -6
- package/dist/browser/browser-adapter.js +16 -5
- package/dist/browser/browser-adapter.js.map +1 -1
- package/dist/browser/browser-adapter.mjs +14 -4
- package/dist/browser/browser-adapter.mjs.map +1 -1
- package/dist/cli/index.d.mts +2 -2
- package/dist/cli/index.d.ts +2 -2
- 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/cursor/cursor-adapter.d.mts +3 -4
- package/dist/cursor/cursor-adapter.d.ts +3 -4
- package/dist/cursor/cursor-adapter.js.map +1 -1
- package/dist/cursor/cursor-adapter.mjs.map +1 -1
- package/dist/cursor/extension.d.mts +27 -0
- package/dist/cursor/extension.d.ts +27 -0
- package/dist/cursor/extension.js +4090 -0
- package/dist/cursor/extension.js.map +1 -0
- package/dist/cursor/extension.mjs +4065 -0
- package/dist/cursor/extension.mjs.map +1 -0
- package/dist/{express-DIEyq1Tz.d.ts → express-Bcl-uBUE.d.ts} +1 -1
- package/dist/{express-Cp4eg77F.d.mts → express-CtwDIZyF.d.mts} +1 -1
- package/dist/gateway/gateway.d.mts +2 -2
- package/dist/gateway/gateway.d.ts +2 -2
- package/dist/gateway/gateway.js +50 -17
- package/dist/gateway/gateway.js.map +1 -1
- package/dist/gateway/gateway.mjs +47 -18
- 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/git-trigger/git-hooks.js +1 -2
- package/dist/git-trigger/git-hooks.js.map +1 -1
- package/dist/git-trigger/git-hooks.mjs +1 -9
- package/dist/git-trigger/git-hooks.mjs.map +1 -1
- package/dist/index-3NRaBNvp.d.mts +1397 -0
- package/dist/{index-BhTbGU-o.d.mts → index-BY8yQ8N8.d.mts} +1 -1
- package/dist/index-CME6r4uH.d.ts +1397 -0
- package/dist/{index-Bhfxq9xI.d.ts → index-CtYSYwn3.d.ts} +1 -1
- package/dist/index.d.mts +8 -7
- package/dist/index.d.ts +8 -7
- package/dist/index.js +2525 -15
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2528 -15
- 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/local-evaluator/evaluator.js.map +1 -1
- package/dist/local-evaluator/evaluator.mjs.map +1 -1
- package/dist/{nextjs-_C_FcJY5.d.mts → nextjs-BQyMCSx_.d.mts} +1 -1
- package/dist/{nextjs-Cag7libc.d.ts → nextjs-CEldnIJ9.d.ts} +1 -1
- package/dist/{sdk-DAJahT3p.d.mts → sdk-BhvuJSrH.d.mts} +1 -1
- package/dist/{sdk-CMPDFUjo.d.ts → sdk-BlyVSC_S.d.ts} +1 -1
- package/dist/transport/index.d.mts +3 -2
- package/dist/transport/index.d.ts +3 -2
- package/dist/transport/index.js +2384 -2
- package/dist/transport/index.js.map +1 -1
- package/dist/transport/index.mjs +2327 -1
- package/dist/transport/index.mjs.map +1 -1
- package/dist/{types-Ce2mFJkO.d.ts → types-79qS7aON.d.ts} +2 -2
- package/dist/{types-Bf8pML07.d.mts → types-CxQwJKbd.d.mts} +17 -2
- package/dist/{types-Bf8pML07.d.ts → types-CxQwJKbd.d.ts} +17 -2
- package/dist/{types-BvpGdsv1.d.mts → types-jJnPXStc.d.mts} +2 -2
- package/dist/ui/index.d.mts +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/package.json +18 -3
- package/dist/index-CNkmHmpi.d.ts +0 -89
- package/dist/index-CoLebmwv.d.mts +0 -89
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RequestHandler, Request } from 'express';
|
|
2
|
-
import {
|
|
2
|
+
import { V as VerificationResult, E as ExpressMiddlewareOptions, A as AstraSyncCredentials, a as AccessLevel } from './types-CxQwJKbd.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* AstraSync Universal Verification Gateway - Express Middleware
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RequestHandler, Request } from 'express';
|
|
2
|
-
import {
|
|
2
|
+
import { V as VerificationResult, E as ExpressMiddlewareOptions, A as AstraSyncCredentials, a as AccessLevel } from './types-CxQwJKbd.mjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* AstraSync Universal Verification Gateway - Express Middleware
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import '../types-
|
|
1
|
+
import { b as AstraSyncGatewayConfig, P as PDLSSContext, V as VerificationDecision } from '../types-jJnPXStc.mjs';
|
|
2
|
+
import '../types-CxQwJKbd.mjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* AstraSyncGateway — Primary API surface for agent verification.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import '../types-
|
|
1
|
+
import { b as AstraSyncGatewayConfig, P as PDLSSContext, V as VerificationDecision } from '../types-79qS7aON.js';
|
|
2
|
+
import '../types-CxQwJKbd.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* AstraSyncGateway — Primary API surface for agent verification.
|
package/dist/gateway/gateway.js
CHANGED
|
@@ -3154,6 +3154,7 @@ async function callVerifyAccessAPI(config, request) {
|
|
|
3154
3154
|
if (requestData.subAgentDepth !== void 0) body.subAgentDepth = requestData.subAgentDepth;
|
|
3155
3155
|
if (requestData.enableRuntimeChallenge) body.enableRuntimeChallenge = requestData.enableRuntimeChallenge;
|
|
3156
3156
|
if (requestData.createSession) body.createSession = requestData.createSession;
|
|
3157
|
+
if (requestData.durationRequired) body.durationRequired = requestData.durationRequired;
|
|
3157
3158
|
if (requestData.counterpartyType) body.counterpartyType = requestData.counterpartyType;
|
|
3158
3159
|
if (requestData.counterpartyUrl) body.counterpartyUrl = requestData.counterpartyUrl;
|
|
3159
3160
|
if (requestData.runtimeChallengeOptions) body.runtimeChallengeOptions = requestData.runtimeChallengeOptions;
|
|
@@ -3318,6 +3319,39 @@ async function verify(config, request) {
|
|
|
3318
3319
|
return result;
|
|
3319
3320
|
}
|
|
3320
3321
|
|
|
3322
|
+
// src/transport/rfc9421.ts
|
|
3323
|
+
var import_structured_headers = require("structured-headers");
|
|
3324
|
+
|
|
3325
|
+
// src/transport/rfc9421-verify.ts
|
|
3326
|
+
var import_http_message_signatures = require("http-message-signatures");
|
|
3327
|
+
|
|
3328
|
+
// src/transport/vi.ts
|
|
3329
|
+
var import_decode = require("@sd-jwt/decode");
|
|
3330
|
+
var import_node_crypto = require("crypto");
|
|
3331
|
+
|
|
3332
|
+
// src/transport/stripe-webhook.ts
|
|
3333
|
+
var import_node_crypto2 = require("crypto");
|
|
3334
|
+
|
|
3335
|
+
// src/transport/ap2.ts
|
|
3336
|
+
var import_decode2 = require("@sd-jwt/decode");
|
|
3337
|
+
var import_node_crypto3 = require("crypto");
|
|
3338
|
+
|
|
3339
|
+
// src/transport/mpp.ts
|
|
3340
|
+
var import_mppx = require("mppx");
|
|
3341
|
+
|
|
3342
|
+
// src/transport/mpp-verify.ts
|
|
3343
|
+
var import_mppx2 = require("mppx");
|
|
3344
|
+
|
|
3345
|
+
// src/transport/x402.ts
|
|
3346
|
+
var import_schemas = require("@x402/core/schemas");
|
|
3347
|
+
var import_utils = require("@x402/core/utils");
|
|
3348
|
+
|
|
3349
|
+
// src/transport/vi-verify.ts
|
|
3350
|
+
var import_node_crypto4 = require("crypto");
|
|
3351
|
+
|
|
3352
|
+
// src/transport/registry/visa.ts
|
|
3353
|
+
var import_jose = require("jose");
|
|
3354
|
+
|
|
3321
3355
|
// src/gateway/modes/online.ts
|
|
3322
3356
|
function toGatewayConfig(config) {
|
|
3323
3357
|
return {
|
|
@@ -3375,6 +3409,8 @@ async function verifyOnline(config, context, astraId) {
|
|
|
3375
3409
|
}
|
|
3376
3410
|
|
|
3377
3411
|
// src/gateway/modes/hybrid.ts
|
|
3412
|
+
var import_fs2 = require("fs");
|
|
3413
|
+
var import_path = require("path");
|
|
3378
3414
|
var MAX_QUEUE_SIZE = 1e3;
|
|
3379
3415
|
var MAX_RETRIES = 3;
|
|
3380
3416
|
var HybridSyncQueue = class {
|
|
@@ -3462,9 +3498,8 @@ var HybridSyncQueue = class {
|
|
|
3462
3498
|
loadFromDisk() {
|
|
3463
3499
|
if (!this.persistPath) return;
|
|
3464
3500
|
try {
|
|
3465
|
-
|
|
3466
|
-
|
|
3467
|
-
const data = fs.readFileSync(this.persistPath, "utf-8");
|
|
3501
|
+
if (!(0, import_fs2.existsSync)(this.persistPath)) return;
|
|
3502
|
+
const data = (0, import_fs2.readFileSync)(this.persistPath, "utf-8");
|
|
3468
3503
|
const entries = JSON.parse(data);
|
|
3469
3504
|
this.queue = entries.filter((e) => e.status === "pending").map((e) => ({ ...e, timestamp: new Date(e.timestamp) }));
|
|
3470
3505
|
} catch {
|
|
@@ -3477,11 +3512,9 @@ var HybridSyncQueue = class {
|
|
|
3477
3512
|
saveToDisk() {
|
|
3478
3513
|
if (!this.persistPath) return;
|
|
3479
3514
|
try {
|
|
3480
|
-
const
|
|
3481
|
-
|
|
3482
|
-
|
|
3483
|
-
if (!fs.existsSync(dir)) fs.mkdirSync(dir, { recursive: true });
|
|
3484
|
-
fs.writeFileSync(this.persistPath, JSON.stringify(this.queue, null, 2), "utf-8");
|
|
3515
|
+
const dir = (0, import_path.dirname)(this.persistPath);
|
|
3516
|
+
if (!(0, import_fs2.existsSync)(dir)) (0, import_fs2.mkdirSync)(dir, { recursive: true });
|
|
3517
|
+
(0, import_fs2.writeFileSync)(this.persistPath, JSON.stringify(this.queue, null, 2), "utf-8");
|
|
3485
3518
|
} catch {
|
|
3486
3519
|
}
|
|
3487
3520
|
}
|
|
@@ -3493,8 +3526,8 @@ function verifyHybrid(evaluator, syncQueue, context) {
|
|
|
3493
3526
|
}
|
|
3494
3527
|
|
|
3495
3528
|
// src/gateway/trace-logger.ts
|
|
3496
|
-
var
|
|
3497
|
-
var
|
|
3529
|
+
var import_fs3 = require("fs");
|
|
3530
|
+
var import_path2 = require("path");
|
|
3498
3531
|
var MAX_FILE_SIZE = 10 * 1024 * 1024;
|
|
3499
3532
|
var MAX_FILES = 10;
|
|
3500
3533
|
var TraceLogger = class {
|
|
@@ -3502,7 +3535,7 @@ var TraceLogger = class {
|
|
|
3502
3535
|
this.tracePath = tracePath;
|
|
3503
3536
|
this.enabled = enabled;
|
|
3504
3537
|
if (enabled) {
|
|
3505
|
-
(0,
|
|
3538
|
+
(0, import_fs3.mkdirSync)(tracePath, { recursive: true });
|
|
3506
3539
|
}
|
|
3507
3540
|
}
|
|
3508
3541
|
/**
|
|
@@ -3547,26 +3580,26 @@ var TraceLogger = class {
|
|
|
3547
3580
|
try {
|
|
3548
3581
|
const filePath = this.getCurrentFilePath();
|
|
3549
3582
|
const line = JSON.stringify(event) + "\n";
|
|
3550
|
-
if ((0,
|
|
3551
|
-
const stats = (0,
|
|
3583
|
+
if ((0, import_fs3.existsSync)(filePath)) {
|
|
3584
|
+
const stats = (0, import_fs3.statSync)(filePath);
|
|
3552
3585
|
if (stats.size > MAX_FILE_SIZE) {
|
|
3553
3586
|
this.rotate();
|
|
3554
3587
|
}
|
|
3555
3588
|
}
|
|
3556
|
-
(0,
|
|
3589
|
+
(0, import_fs3.appendFileSync)(filePath, line);
|
|
3557
3590
|
} catch {
|
|
3558
3591
|
}
|
|
3559
3592
|
}
|
|
3560
3593
|
getCurrentFilePath() {
|
|
3561
3594
|
const date = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
|
|
3562
|
-
return (0,
|
|
3595
|
+
return (0, import_path2.join)(this.tracePath, `trace-${date}.jsonl`);
|
|
3563
3596
|
}
|
|
3564
3597
|
rotate() {
|
|
3565
3598
|
try {
|
|
3566
|
-
const files = (0,
|
|
3599
|
+
const files = (0, import_fs3.readdirSync)(this.tracePath).filter((f) => f.startsWith("trace-") && f.endsWith(".jsonl")).sort();
|
|
3567
3600
|
while (files.length >= MAX_FILES) {
|
|
3568
3601
|
const oldest = files.shift();
|
|
3569
|
-
(0,
|
|
3602
|
+
(0, import_fs3.unlinkSync)((0, import_path2.join)(this.tracePath, oldest));
|
|
3570
3603
|
}
|
|
3571
3604
|
} catch {
|
|
3572
3605
|
}
|