@astrasyncai/verification-gateway 5.4.2 → 5.5.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/README.md +65 -21
- package/dist/adapters/express.d.mts +1 -1
- package/dist/adapters/express.d.ts +1 -1
- package/dist/adapters/express.js +7 -3
- package/dist/adapters/express.js.map +1 -1
- package/dist/adapters/express.mjs +7 -3
- 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 +7 -3
- package/dist/adapters/mcp.js.map +1 -1
- package/dist/adapters/mcp.mjs +7 -3
- package/dist/adapters/mcp.mjs.map +1 -1
- package/dist/adapters/nextjs.d.mts +1 -1
- package/dist/adapters/nextjs.d.ts +1 -1
- package/dist/adapters/nextjs.js +7 -3
- package/dist/adapters/nextjs.js.map +1 -1
- package/dist/adapters/nextjs.mjs +7 -3
- package/dist/adapters/nextjs.mjs.map +1 -1
- package/dist/adapters/sdk.d.mts +30 -1
- package/dist/adapters/sdk.d.ts +30 -1
- package/dist/adapters/sdk.js +40 -3
- package/dist/adapters/sdk.js.map +1 -1
- package/dist/adapters/sdk.mjs +40 -3
- package/dist/adapters/sdk.mjs.map +1 -1
- 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 +7 -3
- package/dist/bin/astrasync-codex-hook.js +7 -3
- package/dist/bin/astrasync-guard.js +7 -3
- package/dist/bin/astrasync.js +8 -3
- package/dist/browser/background.js +7 -3
- package/dist/browser/background.js.map +1 -1
- package/dist/browser/background.mjs +7 -3
- package/dist/browser/background.mjs.map +1 -1
- 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.js +7 -3
- package/dist/codex/index.js.map +1 -1
- package/dist/codex/index.mjs +7 -3
- package/dist/codex/index.mjs.map +1 -1
- package/dist/cursor/extension.js +7 -3
- package/dist/cursor/extension.js.map +1 -1
- package/dist/cursor/extension.mjs +7 -3
- 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 +7 -3
- package/dist/edge-core/index.js.map +1 -1
- package/dist/edge-core/index.mjs +7 -3
- package/dist/edge-core/index.mjs.map +1 -1
- package/dist/gateway/gateway.js +7 -3
- package/dist/gateway/gateway.js.map +1 -1
- package/dist/gateway/gateway.mjs +7 -3
- package/dist/gateway/gateway.mjs.map +1 -1
- package/dist/git-trigger/git-hooks.d.mts +1 -1
- package/dist/git-trigger/git-hooks.d.ts +1 -1
- package/dist/index.d.mts +77 -4
- package/dist/index.d.ts +77 -4
- package/dist/index.js +40 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +40 -3
- package/dist/index.mjs.map +1 -1
- 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.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-Bd2O3eX1.d.mts → types-C-hPsi9M.d.mts} +45 -1
- package/dist/{types-DMChboN_.d.ts → types-CKouL1Tv.d.ts} +45 -1
- package/dist/{types-BU04qAAR.d.mts → types-D8DDG-qK.d.mts} +45 -1
- package/dist/{types-BU04qAAR.d.ts → types-D8DDG-qK.d.ts} +45 -1
- package/dist/ui/index.d.mts +1 -1
- package/dist/ui/index.d.ts +1 -1
- package/dist/verify.d.mts +1 -1
- package/dist/verify.d.ts +1 -1
- package/dist/verify.js +7 -3
- package/dist/verify.js.map +1 -1
- package/dist/verify.mjs +7 -3
- package/dist/verify.mjs.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -99,7 +99,8 @@ const result = await gateway.verify({
|
|
|
99
99
|
purpose: 'data-exchange',
|
|
100
100
|
});
|
|
101
101
|
|
|
102
|
-
|
|
102
|
+
// 5.0.0: the accessLevel band is gone — the decision is the two axes.
|
|
103
|
+
if (result.identityVerified && result.policyAllowed) {
|
|
103
104
|
// Safe to interact with this agent
|
|
104
105
|
console.log(`Trust score: ${result.agent?.trustScore}`);
|
|
105
106
|
}
|
|
@@ -330,16 +331,19 @@ rest.use(
|
|
|
330
331
|
with `X-Astra-Id` so the inner middleware can verify the marker matches
|
|
331
332
|
the claimed agent. The marker only gates the dedupe-skip decision.
|
|
332
333
|
|
|
333
|
-
## Access
|
|
334
|
+
## Access Decision (5.0.0 — two axes, no bands)
|
|
334
335
|
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
|
339
|
-
|
|
|
340
|
-
| `
|
|
341
|
-
| `
|
|
342
|
-
|
|
336
|
+
The graded `accessLevel` band was removed in 5.0.0. A verification is now two
|
|
337
|
+
explicit booleans:
|
|
338
|
+
|
|
339
|
+
| Axis | Question it answers |
|
|
340
|
+
| ------------------ | -------------------------------------------------------- |
|
|
341
|
+
| `identityVerified` | WHO — did the caller resolve to a registered agent? |
|
|
342
|
+
| `policyAllowed` | WHAT — does this request fit the agent's declared PDLSS? |
|
|
343
|
+
|
|
344
|
+
Both true → proceed. Either false → `failures[]` says exactly which dimension
|
|
345
|
+
failed and what fixes it. Value-gating (autonomous limit / hard limit) rides
|
|
346
|
+
`recommendation` + `stepUpApproval`, not an access band.
|
|
343
347
|
|
|
344
348
|
## Trust Levels
|
|
345
349
|
|
|
@@ -394,8 +398,9 @@ Agents can provide credentials via:
|
|
|
394
398
|
|
|
395
399
|
```typescript
|
|
396
400
|
interface VerificationResult {
|
|
397
|
-
|
|
398
|
-
|
|
401
|
+
// 5.0.0: two explicit axes replaced the old verified/accessLevel band.
|
|
402
|
+
identityVerified: boolean; // WHO: the caller resolved to a registered agent
|
|
403
|
+
policyAllowed: boolean; // WHAT: the request fits the agent's PDLSS boundary
|
|
399
404
|
|
|
400
405
|
agent?: {
|
|
401
406
|
astraId: string;
|
|
@@ -463,12 +468,53 @@ When a transaction value is between the agent's Autonomous Limit and Hard Limit,
|
|
|
463
468
|
interface StepUpApprovalInfo {
|
|
464
469
|
approvalId: string; // Capability token (UUID)
|
|
465
470
|
pollUrl: string; // GET /api/step-up-approvals/poll/:approvalId
|
|
466
|
-
expiresAt: string; // ISO-8601,
|
|
471
|
+
expiresAt: string; // ISO-8601 (decision window: 30 min, aligned to the intent mandate)
|
|
467
472
|
}
|
|
468
473
|
```
|
|
469
474
|
|
|
470
475
|
Poll the `pollUrl` (unauthenticated, rate-limited 60 req/min) to check if the owner approved. The `getApprovalPollingInfo(result)` helper extracts it from a `VerificationResult`.
|
|
471
476
|
|
|
477
|
+
## Checkout & settlement (astra-pay)
|
|
478
|
+
|
|
479
|
+
The first-party commerce rail: an agent shops under its ASTRA-id, holds NO
|
|
480
|
+
payment credential, and the platform settles from the owner's saved
|
|
481
|
+
instrument. Two phases discriminate quote from money movement:
|
|
482
|
+
|
|
483
|
+
- `commercePhase: 'quote'` (or unphased) — verification only, never settles.
|
|
484
|
+
- `commercePhase: 'confirm'` — the ONLY leg that can settle. Use
|
|
485
|
+
`client.confirmCheckout({ astraId, transactionValue, currency,
|
|
486
|
+
checkoutSessionId, checkoutItems, counterpartyUrl })`; `checkoutSessionId`
|
|
487
|
+
is the per-cart idempotency key (one order row per session, normative).
|
|
488
|
+
|
|
489
|
+
Read `result.settlementOutcome.status` — never `success` alone:
|
|
490
|
+
|
|
491
|
+
| status | Meaning | Your action |
|
|
492
|
+
| ------------------- | ----------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------- |
|
|
493
|
+
| `settled` | Charged; `orderId` present | Fulfil / mark paid |
|
|
494
|
+
| `requires_approval` | Held for human step-up — not a failure | Record as pending; a re-drive follows approval |
|
|
495
|
+
| `pending_merchant` | 5.5.0 self-settle: YOU charge (see below) | Charge with the `settlementToken`, then report |
|
|
496
|
+
| `failed` | Charge declined (`failureCode`) | Mark failed |
|
|
497
|
+
| `requires_action` | 3DS/SCA needed on the saved card | Per your policy |
|
|
498
|
+
| `no_instrument` | Policy passed, no chargeable card on file | Terminal on autonomous; NON-terminal after approval — the human's approval survives; re-drive the same session once a card exists |
|
|
499
|
+
| _anything else_ | A status newer than your SDK | Treat as PENDING, never failed (open union, 5.5.0) |
|
|
500
|
+
|
|
501
|
+
**Self-settling merchants (5.5.0, `settlement_mode='self_settle'`):** the
|
|
502
|
+
confirm result carries `settlementToken` (agent-blind
|
|
503
|
+
`{ stripeCustomerId, stripePaymentMethodId, amountMinor, currency, sessionId,
|
|
504
|
+
orderId, jti, statementSuffix, expiresAt }`) instead of a completed charge.
|
|
505
|
+
Charge on your own integration with Stripe idempotency key
|
|
506
|
+
`voucher:<token.jti>` and `metadata: { jti, sessionId }`, then call
|
|
507
|
+
`client.reportSettlement({ sessionId, status, amountMinor, currency,
|
|
508
|
+
processorRef })` so the buyer's dashboard and the agent's poll surface
|
|
509
|
+
reconcile. Amounts must match the order exactly; replays are safe. Never
|
|
510
|
+
expose the token to the agent plane or logs.
|
|
511
|
+
|
|
512
|
+
**Fulfilment PII:** the bridge checkout handoff may carry an optional
|
|
513
|
+
`buyerEmail` (transit-only — use for receipts/digital delivery after
|
|
514
|
+
`settled`; AstraSync stores nothing). Shipping addresses never transit
|
|
515
|
+
AstraSync: take them agent → your fulfilment endpoint directly, joined by
|
|
516
|
+
`sessionId`.
|
|
517
|
+
|
|
472
518
|
## Settlement Artifacts
|
|
473
519
|
|
|
474
520
|
On a clean merchant-mediated grant where the owner has a verified payment instrument, verify-access returns a `settlement` object (wire format **v2**, versioned via the `ver: 2` claim — verify/redeem reject other versions):
|
|
@@ -543,7 +589,6 @@ interface GatewayConfig {
|
|
|
543
589
|
|
|
544
590
|
// Optional
|
|
545
591
|
apiKey?: string; // For authenticated requests
|
|
546
|
-
defaultAccessLevel?: string; // Default: 'guidance'
|
|
547
592
|
cacheTtl?: number; // Cache duration in seconds (default: 300)
|
|
548
593
|
debug?: boolean; // Enable debug logging
|
|
549
594
|
|
|
@@ -575,12 +620,11 @@ interface GatewayConfig {
|
|
|
575
620
|
// 404 case). Set true for tests where the extra request is undesirable.
|
|
576
621
|
disableInitChecks?: boolean;
|
|
577
622
|
|
|
578
|
-
// @deprecated — removed as functional config in v2.3.0
|
|
579
|
-
//
|
|
580
|
-
//
|
|
581
|
-
//
|
|
582
|
-
//
|
|
583
|
-
// /api/endpoints registration.
|
|
623
|
+
// @deprecated — removed as functional config in v2.3.0; the accessLevel
|
|
624
|
+
// band itself was removed in 5.0.0 (identityVerified + policyAllowed are
|
|
625
|
+
// the decision axes). Setting these has no effect (a one-shot
|
|
626
|
+
// console.warn fires). To gate access to your endpoint, configure
|
|
627
|
+
// trust_score_requirement server-side via the /api/endpoints registration.
|
|
584
628
|
minTrustScore?: number;
|
|
585
629
|
minTrustScoreForFull?: number;
|
|
586
630
|
}
|
|
@@ -948,7 +992,7 @@ use the upgrade flow (coming soon) or retire-and-re-register.
|
|
|
948
992
|
### v2.4.4 — Round-12 partner integration testing
|
|
949
993
|
|
|
950
994
|
- **F9** — `ExpressMiddlewareOptions.evaluateAlwaysIfCredentialed`: when true + credentials present + route-none, the middleware calls verify-access for the audit trail + `req.agentVerification` population, then proceeds without enforcement. Default false preserves existing behaviour. Use for tiered-response rendering on routes that grant public access but want caller identity visible to the handler.
|
|
951
|
-
- **F12** — `defaultOnDenied` / `defaultMcpDenied` synthesise `access_level.insufficient` failure entry on accessLevel-below-route + trust-score-below-route denials. Guidance text references the step-up verification flow ("coming soon — ships this month") only. Prior denials carried `INSUFFICIENT_ACCESS` with empty `failures[]` / `denialReasons[]` arrays.
|
|
995
|
+
- **F12** — `defaultOnDenied` / `defaultMcpDenied` synthesise `access_level.insufficient` failure entry on accessLevel-below-route + trust-score-below-route denials. _(Historical note: the accessLevel band was removed in 5.0.0 — current denials carry the two-axis `identityVerified`/`policyAllowed` shape.)_ Guidance text references the step-up verification flow ("coming soon — ships this month") only. Prior denials carried `INSUFFICIENT_ACCESS` with empty `failures[]` / `denialReasons[]` arrays.
|
|
952
996
|
- **F16** — `register()` now passes the API response's `warnings[]` through verbatim on both 201 (sync) and 202 (pending-approval) paths. Pre-fix the SDK silently dropped backend advisories like `no_callback_endpoint`. `RegisterResult` + `PendingRegistrationResponse` + `RegistrationResponse` types extended.
|
|
953
997
|
- **F19** — MCP middleware purpose pass-through. The hardcoded `purpose: 'mcp_invoke'` is now a fallback; resolution precedence is `X-Astra-Purpose` header → `params._meta.astrasync.purpose` → `'mcp_invoke'` default. Adds `invocationProtocol: 'mcp'` to the verify-access body so transport is marked separately from intent. Debug-level `purpose_source` log line per call for adoption tracking + support triage.
|
|
954
998
|
- **`mcpToPdlss`** signature extended to accept optional `headerPurpose` + `toolArgumentPurpose` args; return type gains `purposeSource: 'header' | 'tool_argument' | 'default_mcp_invoke'`.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RequestHandler, Request } from 'express';
|
|
2
|
-
import { d as VerificationResult, E as ExpressMiddlewareOptions, a as AstraSyncCredentials } from '../types-
|
|
2
|
+
import { d as VerificationResult, E as ExpressMiddlewareOptions, a as AstraSyncCredentials } from '../types-D8DDG-qK.mjs';
|
|
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 { d as VerificationResult, E as ExpressMiddlewareOptions, a as AstraSyncCredentials } from '../types-
|
|
2
|
+
import { d as VerificationResult, E as ExpressMiddlewareOptions, a as AstraSyncCredentials } from '../types-D8DDG-qK.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* AstraSync Universal Verification Gateway - Express Middleware
|
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.5.0";
|
|
30
30
|
|
|
31
31
|
// src/http.ts
|
|
32
32
|
var SDK_USER_AGENT = `astrasync-sdk/${SDK_VERSION}`;
|
|
@@ -621,7 +621,10 @@ async function verify(config, request, options) {
|
|
|
621
621
|
recommendationReasons: apiResponse.recommendationReasons,
|
|
622
622
|
stepUpApproval: apiResponse.stepUpApproval,
|
|
623
623
|
settlement: apiResponse.settlement,
|
|
624
|
-
settlementOutcome: apiResponse.settlementOutcome
|
|
624
|
+
settlementOutcome: apiResponse.settlementOutcome,
|
|
625
|
+
// 5.5.0 self-settlement: merchant-only material — passes through to the
|
|
626
|
+
// MERCHANT caller only (bridge callers strip it before the agent plane).
|
|
627
|
+
settlementToken: apiResponse.settlementToken
|
|
625
628
|
};
|
|
626
629
|
return result2;
|
|
627
630
|
}
|
|
@@ -679,7 +682,8 @@ async function verify(config, request, options) {
|
|
|
679
682
|
warningHeader: apiResponse.warningHeader,
|
|
680
683
|
stepUpApproval: apiResponse.stepUpApproval,
|
|
681
684
|
settlement: apiResponse.settlement,
|
|
682
|
-
settlementOutcome: apiResponse.settlementOutcome
|
|
685
|
+
settlementOutcome: apiResponse.settlementOutcome,
|
|
686
|
+
settlementToken: apiResponse.settlementToken
|
|
683
687
|
};
|
|
684
688
|
if (result.recommendation === "deny") {
|
|
685
689
|
result.policyAllowed = false;
|