@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.
Files changed (101) hide show
  1. package/dist/adapter-interface/interface.d.mts +2 -2
  2. package/dist/adapter-interface/interface.d.ts +2 -2
  3. package/dist/adapters/express.d.mts +2 -2
  4. package/dist/adapters/express.d.ts +2 -2
  5. package/dist/adapters/express.js +118 -5
  6. package/dist/adapters/express.js.map +1 -1
  7. package/dist/adapters/express.mjs +118 -5
  8. package/dist/adapters/express.mjs.map +1 -1
  9. package/dist/adapters/nextjs.d.mts +2 -2
  10. package/dist/adapters/nextjs.d.ts +2 -2
  11. package/dist/adapters/nextjs.js +189 -9
  12. package/dist/adapters/nextjs.js.map +1 -1
  13. package/dist/adapters/nextjs.mjs +189 -9
  14. package/dist/adapters/nextjs.mjs.map +1 -1
  15. package/dist/adapters/sdk.d.mts +2 -2
  16. package/dist/adapters/sdk.d.ts +2 -2
  17. package/dist/adapters/sdk.js +1 -0
  18. package/dist/adapters/sdk.js.map +1 -1
  19. package/dist/adapters/sdk.mjs +1 -0
  20. package/dist/adapters/sdk.mjs.map +1 -1
  21. package/dist/agent/index.d.mts +2 -2
  22. package/dist/agent/index.d.ts +2 -2
  23. package/dist/agent/index.js +33 -0
  24. package/dist/agent/index.js.map +1 -1
  25. package/dist/agent/index.mjs +36 -0
  26. package/dist/agent/index.mjs.map +1 -1
  27. package/dist/browser/background.d.mts +2 -0
  28. package/dist/browser/background.d.ts +2 -0
  29. package/dist/browser/background.js +4123 -0
  30. package/dist/browser/background.js.map +1 -0
  31. package/dist/browser/background.mjs +4124 -0
  32. package/dist/browser/background.mjs.map +1 -0
  33. package/dist/browser/browser-adapter.d.mts +10 -6
  34. package/dist/browser/browser-adapter.d.ts +10 -6
  35. package/dist/browser/browser-adapter.js +16 -5
  36. package/dist/browser/browser-adapter.js.map +1 -1
  37. package/dist/browser/browser-adapter.mjs +14 -4
  38. package/dist/browser/browser-adapter.mjs.map +1 -1
  39. package/dist/cli/index.d.mts +2 -2
  40. package/dist/cli/index.d.ts +2 -2
  41. package/dist/cli/index.js +1 -1
  42. package/dist/cli/index.js.map +1 -1
  43. package/dist/cli/index.mjs +1 -1
  44. package/dist/cli/index.mjs.map +1 -1
  45. package/dist/cursor/cursor-adapter.d.mts +3 -4
  46. package/dist/cursor/cursor-adapter.d.ts +3 -4
  47. package/dist/cursor/cursor-adapter.js.map +1 -1
  48. package/dist/cursor/cursor-adapter.mjs.map +1 -1
  49. package/dist/cursor/extension.d.mts +27 -0
  50. package/dist/cursor/extension.d.ts +27 -0
  51. package/dist/cursor/extension.js +4090 -0
  52. package/dist/cursor/extension.js.map +1 -0
  53. package/dist/cursor/extension.mjs +4065 -0
  54. package/dist/cursor/extension.mjs.map +1 -0
  55. package/dist/{express-DIEyq1Tz.d.ts → express-Bcl-uBUE.d.ts} +1 -1
  56. package/dist/{express-Cp4eg77F.d.mts → express-CtwDIZyF.d.mts} +1 -1
  57. package/dist/gateway/gateway.d.mts +2 -2
  58. package/dist/gateway/gateway.d.ts +2 -2
  59. package/dist/gateway/gateway.js +50 -17
  60. package/dist/gateway/gateway.js.map +1 -1
  61. package/dist/gateway/gateway.mjs +47 -18
  62. package/dist/gateway/gateway.mjs.map +1 -1
  63. package/dist/git-trigger/git-hooks.d.mts +2 -2
  64. package/dist/git-trigger/git-hooks.d.ts +2 -2
  65. package/dist/git-trigger/git-hooks.js +1 -2
  66. package/dist/git-trigger/git-hooks.js.map +1 -1
  67. package/dist/git-trigger/git-hooks.mjs +1 -9
  68. package/dist/git-trigger/git-hooks.mjs.map +1 -1
  69. package/dist/index-3NRaBNvp.d.mts +1397 -0
  70. package/dist/{index-BhTbGU-o.d.mts → index-BY8yQ8N8.d.mts} +1 -1
  71. package/dist/index-CME6r4uH.d.ts +1397 -0
  72. package/dist/{index-Bhfxq9xI.d.ts → index-CtYSYwn3.d.ts} +1 -1
  73. package/dist/index.d.mts +8 -7
  74. package/dist/index.d.ts +8 -7
  75. package/dist/index.js +2525 -15
  76. package/dist/index.js.map +1 -1
  77. package/dist/index.mjs +2528 -15
  78. package/dist/index.mjs.map +1 -1
  79. package/dist/local-evaluator/evaluator.d.mts +2 -2
  80. package/dist/local-evaluator/evaluator.d.ts +2 -2
  81. package/dist/local-evaluator/evaluator.js.map +1 -1
  82. package/dist/local-evaluator/evaluator.mjs.map +1 -1
  83. package/dist/{nextjs-_C_FcJY5.d.mts → nextjs-BQyMCSx_.d.mts} +1 -1
  84. package/dist/{nextjs-Cag7libc.d.ts → nextjs-CEldnIJ9.d.ts} +1 -1
  85. package/dist/{sdk-DAJahT3p.d.mts → sdk-BhvuJSrH.d.mts} +1 -1
  86. package/dist/{sdk-CMPDFUjo.d.ts → sdk-BlyVSC_S.d.ts} +1 -1
  87. package/dist/transport/index.d.mts +3 -2
  88. package/dist/transport/index.d.ts +3 -2
  89. package/dist/transport/index.js +2384 -2
  90. package/dist/transport/index.js.map +1 -1
  91. package/dist/transport/index.mjs +2327 -1
  92. package/dist/transport/index.mjs.map +1 -1
  93. package/dist/{types-Ce2mFJkO.d.ts → types-79qS7aON.d.ts} +2 -2
  94. package/dist/{types-Bf8pML07.d.mts → types-CxQwJKbd.d.mts} +17 -2
  95. package/dist/{types-Bf8pML07.d.ts → types-CxQwJKbd.d.ts} +17 -2
  96. package/dist/{types-BvpGdsv1.d.mts → types-jJnPXStc.d.mts} +2 -2
  97. package/dist/ui/index.d.mts +1 -1
  98. package/dist/ui/index.d.ts +1 -1
  99. package/package.json +18 -3
  100. package/dist/index-CNkmHmpi.d.ts +0 -89
  101. package/dist/index-CoLebmwv.d.mts +0 -89
@@ -1,5 +1,5 @@
1
1
  import { RequestHandler, Request } from 'express';
2
- import { b as VerificationResult, e as ExpressMiddlewareOptions, c as AstraSyncCredentials, a as AccessLevel } from './types-Bf8pML07.js';
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 { b as VerificationResult, e as ExpressMiddlewareOptions, c as AstraSyncCredentials, a as AccessLevel } from './types-Bf8pML07.mjs';
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 { d as AstraSyncGatewayConfig, P as PDLSSContext, V as VerificationDecision } from '../types-BvpGdsv1.mjs';
2
- import '../types-Bf8pML07.mjs';
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 { d as AstraSyncGatewayConfig, P as PDLSSContext, V as VerificationDecision } from '../types-Ce2mFJkO.js';
2
- import '../types-Bf8pML07.js';
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.
@@ -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
- const fs = require("fs");
3466
- if (!fs.existsSync(this.persistPath)) return;
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 fs = require("fs");
3481
- const path = require("path");
3482
- const dir = path.dirname(this.persistPath);
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 import_fs2 = require("fs");
3497
- var import_path = require("path");
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, import_fs2.mkdirSync)(tracePath, { recursive: true });
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, import_fs2.existsSync)(filePath)) {
3551
- const stats = (0, import_fs2.statSync)(filePath);
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, import_fs2.appendFileSync)(filePath, line);
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, import_path.join)(this.tracePath, `trace-${date}.jsonl`);
3595
+ return (0, import_path2.join)(this.tracePath, `trace-${date}.jsonl`);
3563
3596
  }
3564
3597
  rotate() {
3565
3598
  try {
3566
- const files = (0, import_fs2.readdirSync)(this.tracePath).filter((f) => f.startsWith("trace-") && f.endsWith(".jsonl")).sort();
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, import_fs2.unlinkSync)((0, import_path.join)(this.tracePath, oldest));
3602
+ (0, import_fs3.unlinkSync)((0, import_path2.join)(this.tracePath, oldest));
3570
3603
  }
3571
3604
  } catch {
3572
3605
  }