@astrasyncai/verification-gateway 2.4.0 → 2.4.2
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 +137 -22
- 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 +37 -7
- package/dist/adapters/express.js.map +1 -1
- package/dist/adapters/express.mjs +37 -7
- 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 +37 -7
- package/dist/adapters/mcp.js.map +1 -1
- package/dist/adapters/mcp.mjs +37 -7
- 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 +30 -4
- package/dist/adapters/nextjs.js.map +1 -1
- package/dist/adapters/nextjs.mjs +30 -4
- 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 +30 -4
- package/dist/adapters/sdk.js.map +1 -1
- package/dist/adapters/sdk.mjs +30 -4
- 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/bin/astrasync.js +163 -4
- package/dist/browser/background.js +30 -4
- package/dist/browser/background.js.map +1 -1
- package/dist/browser/background.mjs +30 -4
- 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 +30 -4
- package/dist/cursor/extension.js.map +1 -1
- package/dist/cursor/extension.mjs +30 -4
- package/dist/cursor/extension.mjs.map +1 -1
- package/dist/{express-4Vau6x6X.d.mts → express-DneHiMhu.d.mts} +1 -1
- package/dist/{express-Nq-wWICa.d.ts → express-DsiaQRFt.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 +30 -4
- package/dist/gateway/gateway.js.map +1 -1
- package/dist/gateway/gateway.mjs +30 -4
- 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-DkyPV14Y.d.mts → index-C9yWlQ2Y.d.mts} +1 -1
- package/dist/{index-DiToN8gh.d.mts → index-DAGm-Sgf.d.mts} +1 -1
- package/dist/{index-B-EovXnY.d.ts → index-Dd4alF0l.d.ts} +1 -1
- package/dist/{index-CxwCN7AC.d.ts → index-NZiKvrtE.d.ts} +1 -1
- package/dist/index.d.mts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +37 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +37 -7
- 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-DO_4crcp.d.ts → nextjs-B4WmoiVm.d.ts} +1 -1
- package/dist/{nextjs-BTR7Oix-.d.mts → nextjs-vUuVCaBP.d.mts} +1 -1
- package/dist/registration/index.d.mts +174 -7
- package/dist/registration/index.d.ts +174 -7
- package/dist/registration/index.js +171 -6
- package/dist/registration/index.js.map +1 -1
- package/dist/registration/index.mjs +167 -5
- package/dist/registration/index.mjs.map +1 -1
- package/dist/{sdk-TnHXD-Oh.d.ts → sdk-BvWp4q2q.d.ts} +1 -1
- package/dist/{sdk-DSLCyXIX.d.mts → sdk-Cixo6pTV.d.mts} +1 -1
- package/dist/transport/index.d.mts +2 -2
- package/dist/transport/index.d.ts +2 -2
- package/dist/{types-pU2O0BFq.d.mts → types-C_e1IZdU.d.mts} +1 -1
- package/dist/{types-BVp22KkN.d.mts → types-DLai3jly.d.mts} +16 -13
- package/dist/{types-BVp22KkN.d.ts → types-DLai3jly.d.ts} +16 -13
- package/dist/{types-DVCWReEN.d.ts → types-IUzu-A4u.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,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-
|
|
2
|
+
import { P as PDLSSContext, V as VerificationDecision, A as AgentAction, I as InterceptResult } from '../types-C_e1IZdU.mjs';
|
|
3
3
|
import '../gateway/gateway.mjs';
|
|
4
|
-
import '../types-
|
|
4
|
+
import '../types-DLai3jly.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-
|
|
2
|
+
import { P as PDLSSContext, V as VerificationDecision, A as AgentAction, I as InterceptResult } from '../types-IUzu-A4u.js';
|
|
3
3
|
import '../gateway/gateway.js';
|
|
4
|
-
import '../types-
|
|
4
|
+
import '../types-DLai3jly.js';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* @astrasyncai/adapter-openclaw-browser
|
package/dist/cli/index.d.mts
CHANGED
|
@@ -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-
|
|
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-C_e1IZdU.mjs';
|
|
2
2
|
import { PlatformAdapter, AdapterConfig } from '../adapter-interface/interface.mjs';
|
|
3
|
-
import '../types-
|
|
3
|
+
import '../types-DLai3jly.mjs';
|
|
4
4
|
import '../gateway/gateway.mjs';
|
|
5
5
|
|
|
6
6
|
/**
|
package/dist/cli/index.d.ts
CHANGED
|
@@ -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-
|
|
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-IUzu-A4u.js';
|
|
2
2
|
import { PlatformAdapter, AdapterConfig } from '../adapter-interface/interface.js';
|
|
3
|
-
import '../types-
|
|
3
|
+
import '../types-DLai3jly.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-
|
|
2
|
+
import { P as PDLSSContext, V as VerificationDecision, A as AgentAction, I as InterceptResult } from '../types-C_e1IZdU.mjs';
|
|
3
3
|
import '../gateway/gateway.mjs';
|
|
4
|
-
import '../types-
|
|
4
|
+
import '../types-DLai3jly.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-
|
|
2
|
+
import { P as PDLSSContext, V as VerificationDecision, A as AgentAction, I as InterceptResult } from '../types-IUzu-A4u.js';
|
|
3
3
|
import '../gateway/gateway.js';
|
|
4
|
-
import '../types-
|
|
4
|
+
import '../types-DLai3jly.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-
|
|
5
|
-
import '../types-
|
|
4
|
+
import '../types-C_e1IZdU.mjs';
|
|
5
|
+
import '../types-DLai3jly.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-
|
|
5
|
-
import '../types-
|
|
4
|
+
import '../types-IUzu-A4u.js';
|
|
5
|
+
import '../types-DLai3jly.js';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* VS Code Extension entry point for AstraSync Local Guard (Cursor/VS Code).
|
package/dist/cursor/extension.js
CHANGED
|
@@ -3356,8 +3356,18 @@ function cacheResult(credentials, result, ttlSeconds) {
|
|
|
3356
3356
|
expiresAt: Date.now() + ttlSeconds * 1e3
|
|
3357
3357
|
});
|
|
3358
3358
|
}
|
|
3359
|
-
function createGuidanceResponse(config, reason) {
|
|
3360
|
-
const
|
|
3359
|
+
function createGuidanceResponse(config, reason, options = {}) {
|
|
3360
|
+
const source = options.source ?? "no_credentials";
|
|
3361
|
+
const isApiError = source === "api_error";
|
|
3362
|
+
const guidance = isApiError ? {
|
|
3363
|
+
message: "Verification is temporarily unavailable. Retry with exponential backoff; if the issue persists, contact support with the correlationId.",
|
|
3364
|
+
registrationUrl: `${config.apiBaseUrl.replace("/api", "")}/register`,
|
|
3365
|
+
documentationUrl: `${config.apiBaseUrl.replace("/api", "")}/docs/agent-access`,
|
|
3366
|
+
steps: [
|
|
3367
|
+
"Retry the request with exponential backoff",
|
|
3368
|
+
"If failures persist, share the correlationId with support"
|
|
3369
|
+
]
|
|
3370
|
+
} : {
|
|
3361
3371
|
message: "This service verifies AI agents before granting access. Please register your agent with AstraSync.",
|
|
3362
3372
|
registrationUrl: `${config.apiBaseUrl.replace("/api", "")}/register`,
|
|
3363
3373
|
documentationUrl: `${config.apiBaseUrl.replace("/api", "")}/docs/agent-access`,
|
|
@@ -3378,6 +3388,18 @@ function createGuidanceResponse(config, reason) {
|
|
|
3378
3388
|
accessLevel: "none",
|
|
3379
3389
|
guidance,
|
|
3380
3390
|
denialReasons: reason ? [reason] : ["No valid agent credentials provided"],
|
|
3391
|
+
// Round-10 (#47, O5): on API-error fallback, surface a typed failure so
|
|
3392
|
+
// partners (and their custom onDenied handlers) can branch on
|
|
3393
|
+
// dimension. Without this, the synthesised stub was indistinguishable
|
|
3394
|
+
// from a real policy deny.
|
|
3395
|
+
failures: isApiError ? [
|
|
3396
|
+
{
|
|
3397
|
+
dimension: "verify_access.api_error",
|
|
3398
|
+
message: reason ?? "Verification temporarily unavailable",
|
|
3399
|
+
guidance: guidance.message
|
|
3400
|
+
}
|
|
3401
|
+
] : void 0,
|
|
3402
|
+
correlationId: options.correlationId,
|
|
3381
3403
|
verifiedAt: /* @__PURE__ */ new Date()
|
|
3382
3404
|
};
|
|
3383
3405
|
}
|
|
@@ -3452,7 +3474,8 @@ async function callVerifyAccessAPI(config, request) {
|
|
|
3452
3474
|
if (!response.ok) {
|
|
3453
3475
|
return {
|
|
3454
3476
|
success: false,
|
|
3455
|
-
error: data.message || data.error || `API returned ${response.status}
|
|
3477
|
+
error: data.message || data.error || `API returned ${response.status}`,
|
|
3478
|
+
correlationId: typeof data?.correlationId === "string" ? data.correlationId : void 0
|
|
3456
3479
|
};
|
|
3457
3480
|
}
|
|
3458
3481
|
return data;
|
|
@@ -3496,7 +3519,10 @@ async function verify(config, request) {
|
|
|
3496
3519
|
}
|
|
3497
3520
|
const apiResponse = await callVerifyAccessAPI(mergedConfig, enrichedRequest);
|
|
3498
3521
|
if (!apiResponse.success) {
|
|
3499
|
-
return createGuidanceResponse(mergedConfig, apiResponse.error
|
|
3522
|
+
return createGuidanceResponse(mergedConfig, apiResponse.error, {
|
|
3523
|
+
source: "api_error",
|
|
3524
|
+
correlationId: apiResponse.correlationId
|
|
3525
|
+
});
|
|
3500
3526
|
}
|
|
3501
3527
|
if (!apiResponse.access?.allowed) {
|
|
3502
3528
|
const aggregatedFailures = apiResponse.access?.failures;
|