@astrasyncai/verification-gateway 2.3.7 → 2.3.9

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 (84) hide show
  1. package/README.md +93 -10
  2. package/dist/adapter-interface/interface.d.mts +2 -2
  3. package/dist/adapter-interface/interface.d.ts +2 -2
  4. package/dist/adapters/express.d.mts +2 -2
  5. package/dist/adapters/express.d.ts +2 -2
  6. package/dist/adapters/express.js +81 -7
  7. package/dist/adapters/express.js.map +1 -1
  8. package/dist/adapters/express.mjs +81 -7
  9. package/dist/adapters/express.mjs.map +1 -1
  10. package/dist/adapters/mcp.d.mts +1 -1
  11. package/dist/adapters/mcp.d.ts +1 -1
  12. package/dist/adapters/mcp.js +84 -12
  13. package/dist/adapters/mcp.js.map +1 -1
  14. package/dist/adapters/mcp.mjs +84 -12
  15. package/dist/adapters/mcp.mjs.map +1 -1
  16. package/dist/adapters/nextjs.d.mts +2 -2
  17. package/dist/adapters/nextjs.d.ts +2 -2
  18. package/dist/adapters/nextjs.js +40 -6
  19. package/dist/adapters/nextjs.js.map +1 -1
  20. package/dist/adapters/nextjs.mjs +40 -6
  21. package/dist/adapters/nextjs.mjs.map +1 -1
  22. package/dist/adapters/sdk.d.mts +2 -2
  23. package/dist/adapters/sdk.d.ts +2 -2
  24. package/dist/adapters/sdk.js +40 -6
  25. package/dist/adapters/sdk.js.map +1 -1
  26. package/dist/adapters/sdk.mjs +40 -6
  27. package/dist/adapters/sdk.mjs.map +1 -1
  28. package/dist/agent/index.d.mts +2 -2
  29. package/dist/agent/index.d.ts +2 -2
  30. package/dist/browser/background.js +39 -5
  31. package/dist/browser/background.js.map +1 -1
  32. package/dist/browser/background.mjs +39 -5
  33. package/dist/browser/background.mjs.map +1 -1
  34. package/dist/browser/browser-adapter.d.mts +2 -2
  35. package/dist/browser/browser-adapter.d.ts +2 -2
  36. package/dist/cli/index.d.mts +2 -2
  37. package/dist/cli/index.d.ts +2 -2
  38. package/dist/cursor/cursor-adapter.d.mts +2 -2
  39. package/dist/cursor/cursor-adapter.d.ts +2 -2
  40. package/dist/cursor/extension.d.mts +2 -2
  41. package/dist/cursor/extension.d.ts +2 -2
  42. package/dist/cursor/extension.js +39 -5
  43. package/dist/cursor/extension.js.map +1 -1
  44. package/dist/cursor/extension.mjs +39 -5
  45. package/dist/cursor/extension.mjs.map +1 -1
  46. package/dist/{express-D9oRsseg.d.mts → express-BiB51d5t.d.mts} +1 -1
  47. package/dist/{express-DMSIl20m.d.ts → express-D6tEDU08.d.ts} +1 -1
  48. package/dist/gateway/gateway.d.mts +2 -2
  49. package/dist/gateway/gateway.d.ts +2 -2
  50. package/dist/gateway/gateway.js +39 -5
  51. package/dist/gateway/gateway.js.map +1 -1
  52. package/dist/gateway/gateway.mjs +39 -5
  53. package/dist/gateway/gateway.mjs.map +1 -1
  54. package/dist/git-trigger/git-hooks.d.mts +2 -2
  55. package/dist/git-trigger/git-hooks.d.ts +2 -2
  56. package/dist/{index-EwUWXC5T.d.ts → index-8DFMpITk.d.ts} +1 -1
  57. package/dist/{index-YNPs800Z.d.mts → index-B--6fiDp.d.mts} +1 -1
  58. package/dist/{index-Bn_7eGjb.d.mts → index-CAykfMWK.d.mts} +1 -1
  59. package/dist/{index-BtU9yFda.d.ts → index-Yt02MRyu.d.ts} +1 -1
  60. package/dist/index.d.mts +7 -7
  61. package/dist/index.d.ts +7 -7
  62. package/dist/index.js +87 -13
  63. package/dist/index.js.map +1 -1
  64. package/dist/index.mjs +87 -13
  65. package/dist/index.mjs.map +1 -1
  66. package/dist/local-evaluator/evaluator.d.mts +2 -2
  67. package/dist/local-evaluator/evaluator.d.ts +2 -2
  68. package/dist/{nextjs-B5ZBpHra.d.ts → nextjs-CK5F_tVZ.d.ts} +1 -1
  69. package/dist/{nextjs-BLtjRbc-.d.mts → nextjs-CpxqfQqD.d.mts} +1 -1
  70. package/dist/{sdk-BhkxvqnK.d.mts → sdk-BMvauMgP.d.ts} +9 -2
  71. package/dist/{sdk-YmE3RG8n.d.ts → sdk-yJjO7yzn.d.mts} +9 -2
  72. package/dist/transport/index.d.mts +2 -2
  73. package/dist/transport/index.d.ts +2 -2
  74. package/dist/{types-DxY5zt4z.d.mts → types-CKafuHDn.d.mts} +1 -1
  75. package/dist/{types-Bxqj1sKY.d.mts → types-UYT4GdPW.d.mts} +42 -4
  76. package/dist/{types-Bxqj1sKY.d.ts → types-UYT4GdPW.d.ts} +42 -4
  77. package/dist/{types-BecRpozv.d.ts → types-ppkhdldJ.d.ts} +1 -1
  78. package/dist/ui/index.d.mts +1 -1
  79. package/dist/ui/index.d.ts +1 -1
  80. package/dist/ui/index.js +3 -3
  81. package/dist/ui/index.js.map +1 -1
  82. package/dist/ui/index.mjs +3 -3
  83. package/dist/ui/index.mjs.map +1 -1
  84. package/package.json +1 -1
@@ -1,7 +1,7 @@
1
1
  import { PlatformAdapter, AdapterConfig } from '../adapter-interface/interface.mjs';
2
- import { P as PDLSSContext, V as VerificationDecision, A as AgentAction, I as InterceptResult } from '../types-DxY5zt4z.mjs';
2
+ import { P as PDLSSContext, V as VerificationDecision, A as AgentAction, I as InterceptResult } from '../types-CKafuHDn.mjs';
3
3
  import '../gateway/gateway.mjs';
4
- import '../types-Bxqj1sKY.mjs';
4
+ import '../types-UYT4GdPW.mjs';
5
5
 
6
6
  /**
7
7
  * @astrasyncai/adapter-openclaw-browser
@@ -1,7 +1,7 @@
1
1
  import { PlatformAdapter, AdapterConfig } from '../adapter-interface/interface.js';
2
- import { P as PDLSSContext, V as VerificationDecision, A as AgentAction, I as InterceptResult } from '../types-BecRpozv.js';
2
+ import { P as PDLSSContext, V as VerificationDecision, A as AgentAction, I as InterceptResult } from '../types-ppkhdldJ.js';
3
3
  import '../gateway/gateway.js';
4
- import '../types-Bxqj1sKY.js';
4
+ import '../types-UYT4GdPW.js';
5
5
 
6
6
  /**
7
7
  * @astrasyncai/adapter-openclaw-browser
@@ -1,6 +1,6 @@
1
- import { a as LocalPurposeRule, c as LocalScope, d as LocalRiskThresholds, L as LocalPolicy, P as PDLSSContext, V as VerificationDecision, A as AgentAction, I as InterceptResult } from '../types-DxY5zt4z.mjs';
1
+ import { a as LocalPurposeRule, c as LocalScope, d as LocalRiskThresholds, L as LocalPolicy, P as PDLSSContext, V as VerificationDecision, A as AgentAction, I as InterceptResult } from '../types-CKafuHDn.mjs';
2
2
  import { PlatformAdapter, AdapterConfig } from '../adapter-interface/interface.mjs';
3
- import '../types-Bxqj1sKY.mjs';
3
+ import '../types-UYT4GdPW.mjs';
4
4
  import '../gateway/gateway.mjs';
5
5
 
6
6
  /**
@@ -1,6 +1,6 @@
1
- import { a as LocalPurposeRule, c as LocalScope, d as LocalRiskThresholds, L as LocalPolicy, P as PDLSSContext, V as VerificationDecision, A as AgentAction, I as InterceptResult } from '../types-BecRpozv.js';
1
+ import { a as LocalPurposeRule, c as LocalScope, d as LocalRiskThresholds, L as LocalPolicy, P as PDLSSContext, V as VerificationDecision, A as AgentAction, I as InterceptResult } from '../types-ppkhdldJ.js';
2
2
  import { PlatformAdapter, AdapterConfig } from '../adapter-interface/interface.js';
3
- import '../types-Bxqj1sKY.js';
3
+ import '../types-UYT4GdPW.js';
4
4
  import '../gateway/gateway.js';
5
5
 
6
6
  /**
@@ -1,7 +1,7 @@
1
1
  import { PlatformAdapter, AdapterConfig } from '../adapter-interface/interface.mjs';
2
- import { P as PDLSSContext, V as VerificationDecision, A as AgentAction, I as InterceptResult } from '../types-DxY5zt4z.mjs';
2
+ import { P as PDLSSContext, V as VerificationDecision, A as AgentAction, I as InterceptResult } from '../types-CKafuHDn.mjs';
3
3
  import '../gateway/gateway.mjs';
4
- import '../types-Bxqj1sKY.mjs';
4
+ import '../types-UYT4GdPW.mjs';
5
5
 
6
6
  /**
7
7
  * @astrasyncai/adapter-cursor
@@ -1,7 +1,7 @@
1
1
  import { PlatformAdapter, AdapterConfig } from '../adapter-interface/interface.js';
2
- import { P as PDLSSContext, V as VerificationDecision, A as AgentAction, I as InterceptResult } from '../types-BecRpozv.js';
2
+ import { P as PDLSSContext, V as VerificationDecision, A as AgentAction, I as InterceptResult } from '../types-ppkhdldJ.js';
3
3
  import '../gateway/gateway.js';
4
- import '../types-Bxqj1sKY.js';
4
+ import '../types-UYT4GdPW.js';
5
5
 
6
6
  /**
7
7
  * @astrasyncai/adapter-cursor
@@ -1,8 +1,8 @@
1
1
  import { VSCodeAPI } from './cursor-adapter.mjs';
2
2
  import '../adapter-interface/interface.mjs';
3
3
  import '../gateway/gateway.mjs';
4
- import '../types-DxY5zt4z.mjs';
5
- import '../types-Bxqj1sKY.mjs';
4
+ import '../types-CKafuHDn.mjs';
5
+ import '../types-UYT4GdPW.mjs';
6
6
 
7
7
  /**
8
8
  * VS Code Extension entry point for AstraSync Local Guard (Cursor/VS Code).
@@ -1,8 +1,8 @@
1
1
  import { VSCodeAPI } from './cursor-adapter.js';
2
2
  import '../adapter-interface/interface.js';
3
3
  import '../gateway/gateway.js';
4
- import '../types-BecRpozv.js';
5
- import '../types-Bxqj1sKY.js';
4
+ import '../types-ppkhdldJ.js';
5
+ import '../types-UYT4GdPW.js';
6
6
 
7
7
  /**
8
8
  * VS Code Extension entry point for AstraSync Local Guard (Cursor/VS Code).
@@ -3285,7 +3285,7 @@ function verifyLocal(evaluator, context) {
3285
3285
  // src/access-levels.ts
3286
3286
  var ACCESS_LEVEL_HIERARCHY = {
3287
3287
  none: 0,
3288
- guidance: 1,
3288
+ restricted: 1,
3289
3289
  "read-only": 2,
3290
3290
  standard: 3,
3291
3291
  full: 4,
@@ -3301,7 +3301,11 @@ function getTrustLevel(score) {
3301
3301
  // src/verify.ts
3302
3302
  var DEFAULT_CONFIG = {
3303
3303
  apiBaseUrl: "https://astrasync.ai/api",
3304
- defaultAccessLevel: "guidance",
3304
+ // v2.3.9 (defect #30): default for unconfigured callers is `'none'` (no
3305
+ // access). Pre-rename this defaulted to `'guidance'`, which combined with
3306
+ // a route gated at `'guidance'` to silently let unverified traffic
3307
+ // through (`hasMinimumAccess('guidance', 'guidance') === true`).
3308
+ defaultAccessLevel: "none",
3305
3309
  // minTrustScore + minTrustScoreForFull deprecated in v2.3.0 — server decides.
3306
3310
  cacheTtl: 300,
3307
3311
  // 5 minutes
@@ -3366,7 +3370,12 @@ function createGuidanceResponse(config, reason) {
3366
3370
  };
3367
3371
  return {
3368
3372
  verified: false,
3369
- accessLevel: "guidance",
3373
+ // v2.3.9 (defect #30): denials grant `'none'`, NEVER a positive band.
3374
+ // Adapters additionally short-circuit on `verified === false` before
3375
+ // the gate check, but the access level still has to be honest at the
3376
+ // data layer so downstream consumers (SDK adapters in other languages,
3377
+ // custom integrations) inherit the correct semantics.
3378
+ accessLevel: "none",
3370
3379
  guidance,
3371
3380
  denialReasons: reason ? [reason] : ["No valid agent credentials provided"],
3372
3381
  verifiedAt: /* @__PURE__ */ new Date()
@@ -3423,6 +3432,23 @@ async function callVerifyAccessAPI(config, request) {
3423
3432
  body: JSON.stringify(body)
3424
3433
  });
3425
3434
  const data = await response.json();
3435
+ if (response.status === 410) {
3436
+ return {
3437
+ success: true,
3438
+ access: {
3439
+ allowed: false,
3440
+ accessLevel: "none",
3441
+ reason: "endpoint_deactivated",
3442
+ failures: [
3443
+ {
3444
+ dimension: "endpoint.deactivated",
3445
+ message: typeof data?.message === "string" ? data.message : "Endpoint has been deactivated",
3446
+ guidance: typeof data?.guidance === "string" ? data.guidance : "Reactivate via POST /api/endpoints/{id}/reactivate, or update the URL on the calling agent."
3447
+ }
3448
+ ]
3449
+ }
3450
+ };
3451
+ }
3426
3452
  if (!response.ok) {
3427
3453
  return {
3428
3454
  success: false,
@@ -3476,7 +3502,14 @@ async function verify(config, request) {
3476
3502
  const aggregatedFailures = apiResponse.access?.failures;
3477
3503
  const result2 = {
3478
3504
  verified: false,
3479
- accessLevel: "guidance",
3505
+ // v2.3.9 (defect #30): denials grant `'none'`, NEVER a positive band.
3506
+ // Pre-rename this hardcoded `'guidance'`, which conflated with the
3507
+ // colocated `guidance: {...}` help-payload object below and let
3508
+ // denied requests pass any route gated at `'guidance'` because
3509
+ // `hasMinimumAccess('guidance', 'guidance') === true`. Adapters now
3510
+ // ALSO short-circuit on `verified === false` before the gate check —
3511
+ // belt-and-braces.
3512
+ accessLevel: "none",
3480
3513
  denialReasons: aggregatedFailures && aggregatedFailures.length > 0 ? aggregatedFailures.map((f) => f.message) : apiResponse.access?.reason ? [apiResponse.access.reason] : ["Access denied"],
3481
3514
  failures: aggregatedFailures,
3482
3515
  requiresStepUp: apiResponse.access?.requiresStepUp,
@@ -3532,7 +3565,8 @@ async function verify(config, request) {
3532
3565
  runtimeChallenge: apiResponse.runtimeChallenge,
3533
3566
  tokenGuidance: apiResponse.tokenGuidance,
3534
3567
  recommendation: apiResponse.recommendation,
3535
- recommendationReasons: apiResponse.recommendationReasons
3568
+ recommendationReasons: apiResponse.recommendationReasons,
3569
+ warningHeader: apiResponse.warningHeader
3536
3570
  };
3537
3571
  if (result.recommendation === "deny") {
3538
3572
  result.verified = false;