@astrasyncai/verification-gateway 3.2.0 → 3.3.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.
- 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 +24 -1
- package/dist/adapters/express.js.map +1 -1
- package/dist/adapters/express.mjs +24 -1
- 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 +24 -1
- package/dist/adapters/mcp.js.map +1 -1
- package/dist/adapters/mcp.mjs +24 -1
- 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 +19 -3
- package/dist/adapters/nextjs.js.map +1 -1
- package/dist/adapters/nextjs.mjs +19 -3
- 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 +1 -1
- package/dist/adapters/sdk.js.map +1 -1
- package/dist/adapters/sdk.mjs +1 -1
- 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/browser/background.js +1 -1
- package/dist/browser/background.js.map +1 -1
- package/dist/browser/background.mjs +1 -1
- 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 +1 -1
- package/dist/cursor/extension.js.map +1 -1
- package/dist/cursor/extension.mjs +1 -1
- package/dist/cursor/extension.mjs.map +1 -1
- package/dist/{express-CeoSdOAZ.d.mts → express-DAOTESQo.d.mts} +1 -1
- package/dist/{express-BowlMHQF.d.ts → express-Lb8-Ybio.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 +1 -1
- package/dist/gateway/gateway.js.map +1 -1
- package/dist/gateway/gateway.mjs +1 -1
- 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-DtGziFEm.d.mts → index-BLeiWFLu.d.mts} +1 -1
- package/dist/{index-DBmlycVm.d.ts → index-DFwfHOGj.d.ts} +1 -1
- package/dist/{index-DzXXBuLm.d.ts → index-E3fAidVt.d.ts} +1 -1
- package/dist/{index-B51W8gn8.d.mts → index-kxLJ873R.d.mts} +1 -1
- package/dist/index.d.mts +55 -8
- package/dist/index.d.ts +55 -8
- package/dist/index.js +89 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +88 -3
- 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-V_K0qlAQ.d.ts → nextjs-BXK0nD73.d.ts} +1 -1
- package/dist/{nextjs-BW1rzr1I.d.mts → nextjs-CFQ_KDFf.d.mts} +1 -1
- package/dist/{sdk-ZYgI7G9f.d.ts → sdk-C7qAfpGB.d.ts} +1 -1
- package/dist/{sdk-e5jg7sqW.d.mts → sdk-D1MuiiNz.d.mts} +1 -1
- package/dist/transport/index.d.mts +2 -2
- package/dist/transport/index.d.ts +2 -2
- package/dist/{types-DJi-u3fz.d.ts → types-B6uD4jAI.d.ts} +1 -1
- package/dist/{types-rFh4VMH4.d.mts → types-B_wnd7ZX.d.mts} +1 -1
- package/dist/{types-rFh4VMH4.d.ts → types-B_wnd7ZX.d.ts} +1 -1
- package/dist/{types-BNiLZY0i.d.mts → types-ClvUqrEm.d.mts} +1 -1
- package/dist/ui/index.d.mts +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,6 +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-
|
|
2
|
+
import { A as AgentAction, I as InterceptResult, P as PDLSSContext, V as VerificationDecision } from '../types-ClvUqrEm.mjs';
|
|
3
|
+
import '../types-B_wnd7ZX.mjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* PlatformAdapter Interface
|
|
@@ -1,6 +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-
|
|
2
|
+
import { A as AgentAction, I as InterceptResult, P as PDLSSContext, V as VerificationDecision } from '../types-B6uD4jAI.js';
|
|
3
|
+
import '../types-B_wnd7ZX.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* PlatformAdapter Interface
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import 'express';
|
|
2
|
-
import '../types-
|
|
3
|
-
export { c as createMiddleware, a as extractAstraSyncCredentials } from '../express-
|
|
2
|
+
import '../types-B_wnd7ZX.mjs';
|
|
3
|
+
export { c as createMiddleware, a as extractAstraSyncCredentials } from '../express-DAOTESQo.mjs';
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import 'express';
|
|
2
|
-
import '../types-
|
|
3
|
-
export { c as createMiddleware, a as extractAstraSyncCredentials } from '../express-
|
|
2
|
+
import '../types-B_wnd7ZX.js';
|
|
3
|
+
export { c as createMiddleware, a as extractAstraSyncCredentials } from '../express-Lb8-Ybio.js';
|
package/dist/adapters/express.js
CHANGED
|
@@ -34,7 +34,7 @@ function getTrustLevel(score) {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
// src/version.ts
|
|
37
|
-
var SDK_VERSION = "3.
|
|
37
|
+
var SDK_VERSION = "3.3.0";
|
|
38
38
|
|
|
39
39
|
// src/well-known.ts
|
|
40
40
|
var CACHE_TTL_MS = 60 * 60 * 1e3;
|
|
@@ -691,6 +691,19 @@ function resolveHttpPdlss(input) {
|
|
|
691
691
|
return { purpose, action, purposeSource, actionSource };
|
|
692
692
|
}
|
|
693
693
|
|
|
694
|
+
// src/adapters/approval-gate.ts
|
|
695
|
+
var APPROVAL_REASON = "Transaction is above the autonomous limit and requires human approval, which is not yet available - it cannot be completed automatically.";
|
|
696
|
+
function requiresHumanApproval(result) {
|
|
697
|
+
return result.requiresStepUp === true || result.requiresApproval === true;
|
|
698
|
+
}
|
|
699
|
+
function annotateApprovalRequired(result) {
|
|
700
|
+
result.failures = [
|
|
701
|
+
...result.failures ?? [],
|
|
702
|
+
{ dimension: "commerce.intent.approval_required", message: APPROVAL_REASON }
|
|
703
|
+
];
|
|
704
|
+
result.denialReasons = [APPROVAL_REASON, ...result.denialReasons ?? []];
|
|
705
|
+
}
|
|
706
|
+
|
|
694
707
|
// src/pdlss-pre-check.ts
|
|
695
708
|
function performCounterpartyPreCheck(routeConfig, astraCreds, purpose) {
|
|
696
709
|
const failures = [];
|
|
@@ -998,6 +1011,16 @@ function createMiddleware(options) {
|
|
|
998
1011
|
onDenied(result, req, res);
|
|
999
1012
|
return;
|
|
1000
1013
|
}
|
|
1014
|
+
if (requiresHumanApproval(result)) {
|
|
1015
|
+
annotateApprovalRequired(result);
|
|
1016
|
+
if (shouldRecordDecisions && sessionId) {
|
|
1017
|
+
recordDecision(config, sessionId, "denied", result.denialReasons?.[0]).catch(() => {
|
|
1018
|
+
});
|
|
1019
|
+
}
|
|
1020
|
+
dedupeFailures(result);
|
|
1021
|
+
onDenied(result, req, res);
|
|
1022
|
+
return;
|
|
1023
|
+
}
|
|
1001
1024
|
if (!shouldEnforce) {
|
|
1002
1025
|
if (config.setPassThroughHeader) {
|
|
1003
1026
|
res.setHeader("X-Astra-Gateway-Mode", "enforced");
|