@astrasyncai/verification-gateway 5.3.0 → 5.4.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.
- package/dist/adapter-interface/interface.d.mts +2 -3
- package/dist/adapter-interface/interface.d.ts +2 -3
- package/dist/adapters/express.d.mts +63 -4
- package/dist/adapters/express.d.ts +63 -4
- package/dist/adapters/express.js +9 -2
- package/dist/adapters/express.js.map +1 -1
- package/dist/adapters/express.mjs +9 -2
- package/dist/adapters/express.mjs.map +1 -1
- package/dist/adapters/mcp.d.mts +396 -4
- package/dist/adapters/mcp.d.ts +396 -4
- package/dist/adapters/mcp.js +9 -2
- package/dist/adapters/mcp.js.map +1 -1
- package/dist/adapters/mcp.mjs +9 -2
- package/dist/adapters/mcp.mjs.map +1 -1
- package/dist/adapters/nextjs.d.mts +22 -4
- package/dist/adapters/nextjs.d.ts +22 -4
- package/dist/adapters/nextjs.js +9 -2
- package/dist/adapters/nextjs.js.map +1 -1
- package/dist/adapters/nextjs.mjs +9 -2
- package/dist/adapters/nextjs.mjs.map +1 -1
- package/dist/adapters/sdk.d.mts +157 -3
- package/dist/adapters/sdk.d.ts +157 -3
- package/dist/adapters/sdk.js +62 -3
- package/dist/adapters/sdk.js.map +1 -1
- package/dist/adapters/sdk.mjs +62 -3
- package/dist/adapters/sdk.mjs.map +1 -1
- package/dist/agent/index.d.mts +224 -3
- package/dist/agent/index.d.ts +224 -3
- package/dist/agent/index.js +1 -1
- package/dist/agent/index.js.map +1 -1
- package/dist/agent/index.mjs +1 -1
- package/dist/agent/index.mjs.map +1 -1
- package/dist/bin/astrasync-claude-hook.js +9 -2
- package/dist/bin/astrasync-codex-hook.js +9 -2
- package/dist/bin/astrasync-guard.js +9 -2
- package/dist/bin/astrasync.js +9 -2
- package/dist/browser/background.js +9 -2
- package/dist/browser/background.js.map +1 -1
- package/dist/browser/background.mjs +9 -2
- package/dist/browser/background.mjs.map +1 -1
- package/dist/browser/browser-adapter.d.mts +1 -5
- package/dist/browser/browser-adapter.d.ts +1 -5
- package/dist/claude-code/claude-code-adapter.d.mts +1 -5
- package/dist/claude-code/claude-code-adapter.d.ts +1 -5
- package/dist/cli/index.d.mts +1 -5
- package/dist/cli/index.d.ts +1 -5
- 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/codex/index.d.mts +1 -5
- package/dist/codex/index.d.ts +1 -5
- package/dist/codex/index.js +9 -2
- package/dist/codex/index.js.map +1 -1
- package/dist/codex/index.mjs +9 -2
- package/dist/codex/index.mjs.map +1 -1
- package/dist/cursor/cursor-adapter.d.mts +1 -5
- package/dist/cursor/cursor-adapter.d.ts +1 -5
- package/dist/cursor/extension.d.mts +1 -5
- package/dist/cursor/extension.d.ts +1 -5
- package/dist/cursor/extension.js +9 -2
- package/dist/cursor/extension.js.map +1 -1
- package/dist/cursor/extension.mjs +9 -2
- package/dist/cursor/extension.mjs.map +1 -1
- package/dist/edge-config.d.mts +1 -1
- package/dist/edge-config.d.ts +1 -1
- package/dist/edge-config.js +1 -1
- package/dist/edge-config.js.map +1 -1
- package/dist/edge-config.mjs +1 -1
- package/dist/edge-config.mjs.map +1 -1
- package/dist/edge-core/index.d.mts +1 -1
- package/dist/edge-core/index.d.ts +1 -1
- package/dist/edge-core/index.js +9 -2
- package/dist/edge-core/index.js.map +1 -1
- package/dist/edge-core/index.mjs +9 -2
- package/dist/edge-core/index.mjs.map +1 -1
- package/dist/gateway/gateway.d.mts +2 -3
- package/dist/gateway/gateway.d.ts +2 -3
- package/dist/gateway/gateway.js +9 -2
- package/dist/gateway/gateway.js.map +1 -1
- package/dist/gateway/gateway.mjs +9 -2
- package/dist/gateway/gateway.mjs.map +1 -1
- package/dist/git-trigger/git-hooks.d.mts +253 -3
- package/dist/git-trigger/git-hooks.d.ts +253 -3
- package/dist/index.d.mts +4500 -42
- package/dist/index.d.ts +4500 -42
- package/dist/index.js +62 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +62 -3
- package/dist/index.mjs.map +1 -1
- package/dist/interface-q1WrMsB1.d.mts +365 -0
- package/dist/interface-q1WrMsB1.d.ts +365 -0
- package/dist/local-evaluator/evaluator.d.mts +2 -3
- package/dist/local-evaluator/evaluator.d.ts +2 -3
- package/dist/registration/index.js +1 -1
- package/dist/registration/index.js.map +1 -1
- package/dist/registration/index.mjs +1 -1
- package/dist/registration/index.mjs.map +1 -1
- package/dist/transport/index.d.mts +1324 -4
- package/dist/transport/index.d.ts +1324 -4
- package/dist/transport/index.js +1 -1
- package/dist/transport/index.js.map +1 -1
- package/dist/transport/index.mjs +1 -1
- package/dist/transport/index.mjs.map +1 -1
- package/dist/{types-C1s1z0VD.d.ts → types-BRz2U0Pn.d.ts} +2 -2
- package/dist/types-BfILnheI.d.mts +189 -0
- package/dist/types-BfILnheI.d.ts +189 -0
- package/dist/{types-1urxLCZv.d.mts → types-CfBpm3w5.d.mts} +2 -2
- package/dist/types-D28h1384.d.ts +763 -0
- package/dist/types-DJMU5g7Z.d.mts +763 -0
- package/dist/{types-CA1ZhoaJ.d.ts → types-W-A326w3.d.mts} +52 -212
- package/dist/{types-eSqHyFFH.d.mts → types-W-A326w3.d.ts} +52 -212
- package/dist/ui/index.d.mts +1 -2
- package/dist/ui/index.d.ts +1 -2
- package/dist/verify.d.mts +1 -1
- package/dist/verify.d.ts +1 -1
- package/dist/verify.js +9 -2
- package/dist/verify.js.map +1 -1
- package/dist/verify.mjs +9 -2
- package/dist/verify.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/express-DHEz_6Rh.d.ts +0 -69
- package/dist/express-PLYlCd5k.d.mts +0 -69
- package/dist/index-BnrhTsp7.d.ts +0 -1469
- package/dist/index-CdF7L5E0.d.ts +0 -248
- package/dist/index-D6HQmsVV.d.mts +0 -248
- package/dist/index-zD5AaJsO.d.mts +0 -1469
- package/dist/mcp-BuKgYZsC.d.ts +0 -397
- package/dist/mcp-DDcGHRjo.d.mts +0 -397
- package/dist/nextjs-CX9X9okw.d.ts +0 -28
- package/dist/nextjs-w60J62Wj.d.mts +0 -28
- package/dist/sdk-DbY7-3PJ.d.mts +0 -142
- package/dist/sdk-uzuKDTRU.d.ts +0 -142
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { AstraSyncGateway } from '../gateway/gateway.mjs';
|
|
2
|
-
import { A as AgentAction, I as InterceptResult, P as PDLSSContext, V as VerificationDecision } from '../types-
|
|
3
|
-
import '../types-
|
|
4
|
-
import '../metadata-capture.mjs';
|
|
2
|
+
import { A as AgentAction, I as InterceptResult, P as PDLSSContext, V as VerificationDecision } from '../types-CfBpm3w5.mjs';
|
|
3
|
+
import '../types-BfILnheI.mjs';
|
|
5
4
|
|
|
6
5
|
/**
|
|
7
6
|
* PlatformAdapter Interface
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { AstraSyncGateway } from '../gateway/gateway.js';
|
|
2
|
-
import { A as AgentAction, I as InterceptResult, P as PDLSSContext, V as VerificationDecision } from '../types-
|
|
3
|
-
import '../types-
|
|
4
|
-
import '../metadata-capture.js';
|
|
2
|
+
import { A as AgentAction, I as InterceptResult, P as PDLSSContext, V as VerificationDecision } from '../types-BRz2U0Pn.js';
|
|
3
|
+
import '../types-BfILnheI.js';
|
|
5
4
|
|
|
6
5
|
/**
|
|
7
6
|
* PlatformAdapter Interface
|
|
@@ -1,4 +1,63 @@
|
|
|
1
|
-
import 'express';
|
|
2
|
-
import '../types-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { RequestHandler, Request } from 'express';
|
|
2
|
+
import { d as VerificationResult, E as ExpressMiddlewareOptions, a as AstraSyncCredentials } from '../types-W-A326w3.mjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* AstraSync Universal Verification Gateway - Express Middleware
|
|
6
|
+
*
|
|
7
|
+
* Express.js middleware for verifying AI agents on API endpoints.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* import express from 'express';
|
|
12
|
+
* import { createMiddleware } from '@astrasyncai/verification-gateway/express';
|
|
13
|
+
*
|
|
14
|
+
* const app = express();
|
|
15
|
+
*
|
|
16
|
+
* app.use(createMiddleware({
|
|
17
|
+
* apiBaseUrl: 'https://astrasync.ai/api',
|
|
18
|
+
* apiKey: process.env.ASTRASYNC_API_KEY,
|
|
19
|
+
* counterpartyId: 'ASTRAE-...', // your registered endpoint id
|
|
20
|
+
* }));
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* Per-route policy (which paths are gated, trust floors, PDLSS purposes) is
|
|
24
|
+
* configured in the AstraSync dashboard, not in code — the middleware
|
|
25
|
+
* fetches it automatically on init and refreshes periodically. There is no
|
|
26
|
+
* `routes` option; a `routes` key in the config object is ignored (with a
|
|
27
|
+
* warning) since v2.9.7.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Extend Express Request with verification result
|
|
32
|
+
*/
|
|
33
|
+
declare global {
|
|
34
|
+
namespace Express {
|
|
35
|
+
interface Request {
|
|
36
|
+
agentVerification?: VerificationResult;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Extract extended AstraSync credentials (X-Astra-* headers) from Express request.
|
|
42
|
+
* Returns null if no AstraSync headers are present.
|
|
43
|
+
*/
|
|
44
|
+
declare function extractAstraSyncCredentials(req: Request): AstraSyncCredentials | null;
|
|
45
|
+
/**
|
|
46
|
+
* Create Express middleware for agent verification.
|
|
47
|
+
*
|
|
48
|
+
* v2.9.7 moved per-route policy authority out of merchant-side source code
|
|
49
|
+
* into the AstraSync dashboard. `createMiddleware` no longer accepts a
|
|
50
|
+
* `routes` array — it fetches the endpoint's stored policy via
|
|
51
|
+
* `GET /endpoints/:counterpartyId/routes` on init and refreshes
|
|
52
|
+
* periodically. Policy edits in the dashboard take effect on the next
|
|
53
|
+
* refresh (or sooner if the operator manually restarts the SDK).
|
|
54
|
+
*
|
|
55
|
+
* `counterpartyId` is required: the SDK can't know which endpoint's policy
|
|
56
|
+
* to fetch without it. Local-development workflows that don't have an
|
|
57
|
+
* AstraSync endpoint registered can omit it — the middleware logs a
|
|
58
|
+
* one-time warning and falls through (allows all) until a policy is
|
|
59
|
+
* fetchable.
|
|
60
|
+
*/
|
|
61
|
+
declare function createMiddleware(options: ExpressMiddlewareOptions): RequestHandler;
|
|
62
|
+
|
|
63
|
+
export { createMiddleware, extractAstraSyncCredentials };
|
|
@@ -1,4 +1,63 @@
|
|
|
1
|
-
import 'express';
|
|
2
|
-
import '../types-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { RequestHandler, Request } from 'express';
|
|
2
|
+
import { d as VerificationResult, E as ExpressMiddlewareOptions, a as AstraSyncCredentials } from '../types-W-A326w3.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* AstraSync Universal Verification Gateway - Express Middleware
|
|
6
|
+
*
|
|
7
|
+
* Express.js middleware for verifying AI agents on API endpoints.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```typescript
|
|
11
|
+
* import express from 'express';
|
|
12
|
+
* import { createMiddleware } from '@astrasyncai/verification-gateway/express';
|
|
13
|
+
*
|
|
14
|
+
* const app = express();
|
|
15
|
+
*
|
|
16
|
+
* app.use(createMiddleware({
|
|
17
|
+
* apiBaseUrl: 'https://astrasync.ai/api',
|
|
18
|
+
* apiKey: process.env.ASTRASYNC_API_KEY,
|
|
19
|
+
* counterpartyId: 'ASTRAE-...', // your registered endpoint id
|
|
20
|
+
* }));
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* Per-route policy (which paths are gated, trust floors, PDLSS purposes) is
|
|
24
|
+
* configured in the AstraSync dashboard, not in code — the middleware
|
|
25
|
+
* fetches it automatically on init and refreshes periodically. There is no
|
|
26
|
+
* `routes` option; a `routes` key in the config object is ignored (with a
|
|
27
|
+
* warning) since v2.9.7.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Extend Express Request with verification result
|
|
32
|
+
*/
|
|
33
|
+
declare global {
|
|
34
|
+
namespace Express {
|
|
35
|
+
interface Request {
|
|
36
|
+
agentVerification?: VerificationResult;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Extract extended AstraSync credentials (X-Astra-* headers) from Express request.
|
|
42
|
+
* Returns null if no AstraSync headers are present.
|
|
43
|
+
*/
|
|
44
|
+
declare function extractAstraSyncCredentials(req: Request): AstraSyncCredentials | null;
|
|
45
|
+
/**
|
|
46
|
+
* Create Express middleware for agent verification.
|
|
47
|
+
*
|
|
48
|
+
* v2.9.7 moved per-route policy authority out of merchant-side source code
|
|
49
|
+
* into the AstraSync dashboard. `createMiddleware` no longer accepts a
|
|
50
|
+
* `routes` array — it fetches the endpoint's stored policy via
|
|
51
|
+
* `GET /endpoints/:counterpartyId/routes` on init and refreshes
|
|
52
|
+
* periodically. Policy edits in the dashboard take effect on the next
|
|
53
|
+
* refresh (or sooner if the operator manually restarts the SDK).
|
|
54
|
+
*
|
|
55
|
+
* `counterpartyId` is required: the SDK can't know which endpoint's policy
|
|
56
|
+
* to fetch without it. Local-development workflows that don't have an
|
|
57
|
+
* AstraSync endpoint registered can omit it — the middleware logs a
|
|
58
|
+
* one-time warning and falls through (allows all) until a policy is
|
|
59
|
+
* fetchable.
|
|
60
|
+
*/
|
|
61
|
+
declare function createMiddleware(options: ExpressMiddlewareOptions): RequestHandler;
|
|
62
|
+
|
|
63
|
+
export { createMiddleware, extractAstraSyncCredentials };
|
package/dist/adapters/express.js
CHANGED
|
@@ -26,7 +26,7 @@ __export(express_exports, {
|
|
|
26
26
|
module.exports = __toCommonJS(express_exports);
|
|
27
27
|
|
|
28
28
|
// src/version.ts
|
|
29
|
-
var SDK_VERSION = "5.
|
|
29
|
+
var SDK_VERSION = "5.4.1";
|
|
30
30
|
|
|
31
31
|
// src/http.ts
|
|
32
32
|
var SDK_USER_AGENT = `astrasync-sdk/${SDK_VERSION}`;
|
|
@@ -273,7 +273,14 @@ function getCacheKey(request, counterpartyId) {
|
|
|
273
273
|
request.callerMetadata?.sourceIp || "",
|
|
274
274
|
request.callerMetadata?.userAgent || "",
|
|
275
275
|
request.callerMetadata?.forwardedFor || "",
|
|
276
|
-
request.callerMetadata?.agentCardUrl || ""
|
|
276
|
+
request.callerMetadata?.agentCardUrl || "",
|
|
277
|
+
// UAT2 Bug B (5.4.1): the commerce phase and cart identity DO affect the
|
|
278
|
+
// backend verdict — the confirm leg is the ONLY leg that may execute
|
|
279
|
+
// first-party settlement. Without these, a confirm within the cache TTL of
|
|
280
|
+
// its start_checkout quote was served the cached quote-leg grant (no
|
|
281
|
+
// settlementOutcome) and never reached the backend. Same F-A1-07 bug class.
|
|
282
|
+
request.commercePhase || "",
|
|
283
|
+
request.checkoutSessionId || ""
|
|
277
284
|
].join("|");
|
|
278
285
|
}
|
|
279
286
|
function getCachedResult(request, counterpartyId) {
|