@astrasyncai/verification-gateway 2.0.0 → 2.0.1

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 (91) 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/browser/background.d.mts +2 -0
  24. package/dist/browser/background.d.ts +2 -0
  25. package/dist/browser/background.js +4090 -0
  26. package/dist/browser/background.js.map +1 -0
  27. package/dist/browser/background.mjs +4088 -0
  28. package/dist/browser/background.mjs.map +1 -0
  29. package/dist/browser/browser-adapter.d.mts +10 -6
  30. package/dist/browser/browser-adapter.d.ts +10 -6
  31. package/dist/browser/browser-adapter.js +16 -5
  32. package/dist/browser/browser-adapter.js.map +1 -1
  33. package/dist/browser/browser-adapter.mjs +14 -4
  34. package/dist/browser/browser-adapter.mjs.map +1 -1
  35. package/dist/cli/index.d.mts +2 -2
  36. package/dist/cli/index.d.ts +2 -2
  37. package/dist/cli/index.js +1 -1
  38. package/dist/cli/index.js.map +1 -1
  39. package/dist/cli/index.mjs +1 -1
  40. package/dist/cli/index.mjs.map +1 -1
  41. package/dist/cursor/cursor-adapter.d.mts +3 -4
  42. package/dist/cursor/cursor-adapter.d.ts +3 -4
  43. package/dist/cursor/cursor-adapter.js.map +1 -1
  44. package/dist/cursor/cursor-adapter.mjs.map +1 -1
  45. package/dist/cursor/extension.d.mts +27 -0
  46. package/dist/cursor/extension.d.ts +27 -0
  47. package/dist/cursor/extension.js +4057 -0
  48. package/dist/cursor/extension.js.map +1 -0
  49. package/dist/cursor/extension.mjs +4029 -0
  50. package/dist/cursor/extension.mjs.map +1 -0
  51. package/dist/{express-DIEyq1Tz.d.ts → express-Bcl-uBUE.d.ts} +1 -1
  52. package/dist/{express-Cp4eg77F.d.mts → express-CtwDIZyF.d.mts} +1 -1
  53. package/dist/gateway/gateway.d.mts +2 -2
  54. package/dist/gateway/gateway.d.ts +2 -2
  55. package/dist/gateway/gateway.js +17 -17
  56. package/dist/gateway/gateway.js.map +1 -1
  57. package/dist/gateway/gateway.mjs +11 -18
  58. package/dist/gateway/gateway.mjs.map +1 -1
  59. package/dist/git-trigger/git-hooks.d.mts +2 -2
  60. package/dist/git-trigger/git-hooks.d.ts +2 -2
  61. package/dist/git-trigger/git-hooks.js +1 -2
  62. package/dist/git-trigger/git-hooks.js.map +1 -1
  63. package/dist/git-trigger/git-hooks.mjs +1 -9
  64. package/dist/git-trigger/git-hooks.mjs.map +1 -1
  65. package/dist/{index-CoLebmwv.d.mts → index-B1ThcGZl.d.mts} +1 -1
  66. package/dist/{index-BhTbGU-o.d.mts → index-BY8yQ8N8.d.mts} +1 -1
  67. package/dist/{index-Bhfxq9xI.d.ts → index-CtYSYwn3.d.ts} +1 -1
  68. package/dist/{index-CNkmHmpi.d.ts → index-DnoXfdFd.d.ts} +1 -1
  69. package/dist/index.d.mts +7 -7
  70. package/dist/index.d.ts +7 -7
  71. package/dist/index.js +201 -14
  72. package/dist/index.js.map +1 -1
  73. package/dist/index.mjs +201 -14
  74. package/dist/index.mjs.map +1 -1
  75. package/dist/local-evaluator/evaluator.d.mts +2 -2
  76. package/dist/local-evaluator/evaluator.d.ts +2 -2
  77. package/dist/local-evaluator/evaluator.js.map +1 -1
  78. package/dist/local-evaluator/evaluator.mjs.map +1 -1
  79. package/dist/{nextjs-_C_FcJY5.d.mts → nextjs-BQyMCSx_.d.mts} +1 -1
  80. package/dist/{nextjs-Cag7libc.d.ts → nextjs-CEldnIJ9.d.ts} +1 -1
  81. package/dist/{sdk-DAJahT3p.d.mts → sdk-BhvuJSrH.d.mts} +1 -1
  82. package/dist/{sdk-CMPDFUjo.d.ts → sdk-BlyVSC_S.d.ts} +1 -1
  83. package/dist/transport/index.d.mts +2 -2
  84. package/dist/transport/index.d.ts +2 -2
  85. package/dist/{types-Ce2mFJkO.d.ts → types-79qS7aON.d.ts} +2 -2
  86. package/dist/{types-Bf8pML07.d.mts → types-CxQwJKbd.d.mts} +17 -2
  87. package/dist/{types-Bf8pML07.d.ts → types-CxQwJKbd.d.ts} +17 -2
  88. package/dist/{types-BvpGdsv1.d.mts → types-jJnPXStc.d.mts} +2 -2
  89. package/dist/ui/index.d.mts +1 -1
  90. package/dist/ui/index.d.ts +1 -1
  91. package/package.json +3 -2
@@ -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;
@@ -3375,6 +3376,8 @@ async function verifyOnline(config, context, astraId) {
3375
3376
  }
3376
3377
 
3377
3378
  // src/gateway/modes/hybrid.ts
3379
+ var import_fs2 = require("fs");
3380
+ var import_path = require("path");
3378
3381
  var MAX_QUEUE_SIZE = 1e3;
3379
3382
  var MAX_RETRIES = 3;
3380
3383
  var HybridSyncQueue = class {
@@ -3462,9 +3465,8 @@ var HybridSyncQueue = class {
3462
3465
  loadFromDisk() {
3463
3466
  if (!this.persistPath) return;
3464
3467
  try {
3465
- const fs = require("fs");
3466
- if (!fs.existsSync(this.persistPath)) return;
3467
- const data = fs.readFileSync(this.persistPath, "utf-8");
3468
+ if (!(0, import_fs2.existsSync)(this.persistPath)) return;
3469
+ const data = (0, import_fs2.readFileSync)(this.persistPath, "utf-8");
3468
3470
  const entries = JSON.parse(data);
3469
3471
  this.queue = entries.filter((e) => e.status === "pending").map((e) => ({ ...e, timestamp: new Date(e.timestamp) }));
3470
3472
  } catch {
@@ -3477,11 +3479,9 @@ var HybridSyncQueue = class {
3477
3479
  saveToDisk() {
3478
3480
  if (!this.persistPath) return;
3479
3481
  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");
3482
+ const dir = (0, import_path.dirname)(this.persistPath);
3483
+ if (!(0, import_fs2.existsSync)(dir)) (0, import_fs2.mkdirSync)(dir, { recursive: true });
3484
+ (0, import_fs2.writeFileSync)(this.persistPath, JSON.stringify(this.queue, null, 2), "utf-8");
3485
3485
  } catch {
3486
3486
  }
3487
3487
  }
@@ -3493,8 +3493,8 @@ function verifyHybrid(evaluator, syncQueue, context) {
3493
3493
  }
3494
3494
 
3495
3495
  // src/gateway/trace-logger.ts
3496
- var import_fs2 = require("fs");
3497
- var import_path = require("path");
3496
+ var import_fs3 = require("fs");
3497
+ var import_path2 = require("path");
3498
3498
  var MAX_FILE_SIZE = 10 * 1024 * 1024;
3499
3499
  var MAX_FILES = 10;
3500
3500
  var TraceLogger = class {
@@ -3502,7 +3502,7 @@ var TraceLogger = class {
3502
3502
  this.tracePath = tracePath;
3503
3503
  this.enabled = enabled;
3504
3504
  if (enabled) {
3505
- (0, import_fs2.mkdirSync)(tracePath, { recursive: true });
3505
+ (0, import_fs3.mkdirSync)(tracePath, { recursive: true });
3506
3506
  }
3507
3507
  }
3508
3508
  /**
@@ -3547,26 +3547,26 @@ var TraceLogger = class {
3547
3547
  try {
3548
3548
  const filePath = this.getCurrentFilePath();
3549
3549
  const line = JSON.stringify(event) + "\n";
3550
- if ((0, import_fs2.existsSync)(filePath)) {
3551
- const stats = (0, import_fs2.statSync)(filePath);
3550
+ if ((0, import_fs3.existsSync)(filePath)) {
3551
+ const stats = (0, import_fs3.statSync)(filePath);
3552
3552
  if (stats.size > MAX_FILE_SIZE) {
3553
3553
  this.rotate();
3554
3554
  }
3555
3555
  }
3556
- (0, import_fs2.appendFileSync)(filePath, line);
3556
+ (0, import_fs3.appendFileSync)(filePath, line);
3557
3557
  } catch {
3558
3558
  }
3559
3559
  }
3560
3560
  getCurrentFilePath() {
3561
3561
  const date = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
3562
- return (0, import_path.join)(this.tracePath, `trace-${date}.jsonl`);
3562
+ return (0, import_path2.join)(this.tracePath, `trace-${date}.jsonl`);
3563
3563
  }
3564
3564
  rotate() {
3565
3565
  try {
3566
- const files = (0, import_fs2.readdirSync)(this.tracePath).filter((f) => f.startsWith("trace-") && f.endsWith(".jsonl")).sort();
3566
+ const files = (0, import_fs3.readdirSync)(this.tracePath).filter((f) => f.startsWith("trace-") && f.endsWith(".jsonl")).sort();
3567
3567
  while (files.length >= MAX_FILES) {
3568
3568
  const oldest = files.shift();
3569
- (0, import_fs2.unlinkSync)((0, import_path.join)(this.tracePath, oldest));
3569
+ (0, import_fs3.unlinkSync)((0, import_path2.join)(this.tracePath, oldest));
3570
3570
  }
3571
3571
  } catch {
3572
3572
  }