@astrasyncai/verification-gateway 2.4.4 → 2.4.6

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 (80) hide show
  1. package/README.md +160 -0
  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 +4 -0
  7. package/dist/adapters/express.js.map +1 -1
  8. package/dist/adapters/express.mjs +4 -0
  9. package/dist/adapters/express.mjs.map +1 -1
  10. package/dist/adapters/mcp.d.mts +54 -18
  11. package/dist/adapters/mcp.d.ts +54 -18
  12. package/dist/adapters/mcp.js +76 -23
  13. package/dist/adapters/mcp.js.map +1 -1
  14. package/dist/adapters/mcp.mjs +76 -23
  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 +4 -0
  19. package/dist/adapters/nextjs.js.map +1 -1
  20. package/dist/adapters/nextjs.mjs +4 -0
  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 +4 -0
  25. package/dist/adapters/sdk.js.map +1 -1
  26. package/dist/adapters/sdk.mjs +4 -0
  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 +4 -0
  31. package/dist/browser/background.js.map +1 -1
  32. package/dist/browser/background.mjs +4 -0
  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 +4 -0
  43. package/dist/cursor/extension.js.map +1 -1
  44. package/dist/cursor/extension.mjs +4 -0
  45. package/dist/cursor/extension.mjs.map +1 -1
  46. package/dist/{express-Ck2RHZLT.d.mts → express-D5hAJ2Gv.d.mts} +1 -1
  47. package/dist/{express-DZmEzCgo.d.ts → express-XCkk7BsJ.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 +4 -0
  51. package/dist/gateway/gateway.js.map +1 -1
  52. package/dist/gateway/gateway.mjs +4 -0
  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-6Jus6yWU.d.ts → index-Bstl43HI.d.ts} +1 -1
  57. package/dist/{index-BgKghi19.d.ts → index-CH4TfcbL.d.ts} +1 -1
  58. package/dist/{index-D698fDOk.d.mts → index-TS4SGvf4.d.mts} +1 -1
  59. package/dist/{index-BZZTOfrI.d.mts → index-u08qcXq9.d.mts} +1 -1
  60. package/dist/index.d.mts +7 -7
  61. package/dist/index.d.ts +7 -7
  62. package/dist/index.js +4 -0
  63. package/dist/index.js.map +1 -1
  64. package/dist/index.mjs +4 -0
  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-93PHcE-i.d.mts → nextjs-CFA0J_4x.d.mts} +1 -1
  69. package/dist/{nextjs-t_ix2zQZ.d.ts → nextjs-DP2EpI-4.d.ts} +1 -1
  70. package/dist/{sdk-BFwzjYjl.d.mts → sdk-C8W54WZS.d.mts} +1 -1
  71. package/dist/{sdk-Chq02d82.d.ts → sdk-CwwCGDzK.d.ts} +1 -1
  72. package/dist/transport/index.d.mts +2 -2
  73. package/dist/transport/index.d.ts +2 -2
  74. package/dist/{types-CVT-sorC.d.mts → types-CbZOkIr-.d.mts} +21 -15
  75. package/dist/{types-CVT-sorC.d.ts → types-CbZOkIr-.d.ts} +21 -15
  76. package/dist/{types-CLP_TDu5.d.ts → types-DXNkr61h.d.ts} +1 -1
  77. package/dist/{types-y13mmzbA.d.mts → types-tBNFSbw_.d.mts} +1 -1
  78. package/dist/ui/index.d.mts +1 -1
  79. package/dist/ui/index.d.ts +1 -1
  80. package/package.json +1 -1
package/README.md CHANGED
@@ -494,6 +494,166 @@ Pre-v2.4.2 used the value `pass-through` — renamed in v2.4.2 to disambiguate "
494
494
 
495
495
  ## Changelog
496
496
 
497
+ ### v2.4.6 — Round-14 partner integration testing
498
+
499
+ **⚠️ BREAKING CHANGE — `endpointUrl` → `counterpartyUrl` on `POST /api/endpoints` AND `PUT /api/endpoints/{id}`**
500
+
501
+ The body field renamed to align with every other surface (verify-access,
502
+ dashboard policy, SDK config — all use `counterparty*`). Applies to BOTH
503
+ create (POST) and update (PUT) verbs:
504
+
505
+ - `POST /api/endpoints` — request body uses `counterpartyUrl` (was `endpointUrl`).
506
+ - `PUT /api/endpoints/{id}` — same. The strict-mode validator on both
507
+ verbs returns a clean 400 `unrecognized_keys` naming `counterpartyUrl`
508
+ as the expected key when partners send the old field name.
509
+ - Response shape (`GET /api/endpoints/{id}`) also renamed for full symmetry —
510
+ partners receive `counterpartyUrl` on read AND send `counterpartyUrl`
511
+ on write. DB column `endpoint_url` stays as the internal join key; the
512
+ service layer maps the public name to the DB column.
513
+
514
+ **Migration**: if your code posts `endpointUrl` to `POST /api/endpoints`
515
+ OR `PUT /api/endpoints/{id}`, rename to `counterpartyUrl`. If your code
516
+ reads `.endpointUrl` from GET responses, rename to `.counterpartyUrl`.
517
+ No legacy alias is shipped — clean break per the
518
+ `feedback_hard_break_no_legacy_shim` discipline.
519
+
520
+ **Other round-14 items**:
521
+
522
+ - **Item 1 — F8 runtime-challenge gate moved from SEND to RECOMMENDATION**
523
+ (`agents.routes.ts`). Round-12 placed the gate at the SEND
524
+ (`if (data.enableRuntimeChallenge && counterparty.requiresRuntimeChallenge)`)
525
+ which suppressed the challenge entirely on F8=optional, losing the
526
+ trust-scoring data the result feeds. Round-14 moves the gate to the
527
+ recommendation outcome:
528
+ - challenge ALWAYS fires when `enableRuntimeChallenge: true` (captures
529
+ trust-scoring data for every call; the result lands on the response
530
+ body's `runtimeChallenge` block regardless of F8 setting)
531
+ - failure / timeout only escalates `recommendation` (→ `deny` /
532
+ `step_up_required`) when the endpoint declared
533
+ `requiresRuntimeChallenge: true`
534
+
535
+ Extracted into a pure helper `deriveRuntimeChallengeRecommendation` so
536
+ the 6-quadrant truth table is unit-testable without the full verify-access
537
+ stack. See `/docs/agent-access/runtime-challenge` for the partner-facing
538
+ contract page (new in this round).
539
+
540
+ - **New `/docs/agent-access/runtime-challenge` page** documenting the
541
+ agent-side challenge contract — request shape, response shape, HTTP
542
+ status semantics, signing posture (unsigned v1; DPoP RFC 9449 on the
543
+ roadmap as the cryptographic upgrade path), timing, replay semantics.
544
+ Headlines the `ChallengeHandler` drop-in from
545
+ `@astrasyncai/verification-gateway/agent`; curl is the wire-spec
546
+ fallback.
547
+
548
+ - **New `/docs/mcp-integration` "Purpose + action precedence" section**
549
+ documenting the 4-tier chain (`header → _meta → arguments → default`)
550
+ that applies to both purpose and action. Closes the round-13 SDK-README-
551
+ only documentation gap.
552
+
553
+ - **`/docs/agent-access` revisions**: section 4b expanded to a dedicated
554
+ "Headers an integrating agent must send" section covering `X-Astra-Id`,
555
+ `X-Astra-Purpose`, `X-Astra-Action` (the last is new partner-facing
556
+ documentation for the round-13 R13-2 header). Section 5 inverted
557
+ `tokenGuidance` text corrected. New section 5b "What verify-access
558
+ tells you" annotates the full grant payload with cross-links to the
559
+ SDK's exported TypeScript types (`VerificationResult`, `TokenGuidance`,
560
+ `EnhancedVerificationResult`).
561
+
562
+ - **`/docs/merchants` additions**: worked endpoint POST + PUT examples
563
+ using the new `counterpartyUrl` name; per-protocol terminal-status
564
+ table with explicit external-contract preamble (the literals come
565
+ from each protocol's published spec, not from AstraSync's choice) +
566
+ auth/capture two-step callout for agent-pay and TAP; A2A JSON-RPC
567
+ worked example.
568
+
569
+ - **F14 Health Check tooltip reframed** as descriptive-only metadata
570
+ ("active probe on roadmap") — the storage + serializer + dashboard UI
571
+ exist but the active probe pipeline isn't implemented yet (deferred to
572
+ a focused future round). Sets partner expectations correctly while the
573
+ pipeline lands.
574
+
575
+ ### v2.4.5 — Round-13 partner integration testing
576
+
577
+ **⚠️ BREAKING CHANGE — `pdlss_immutable` → `agent_immutable`**
578
+
579
+ The 409 response from `PUT /api/agents/:id` (post-mint mutation attempt)
580
+ now returns `error: 'agent_immutable'` instead of `error: 'pdlss_immutable'`.
581
+ The scope also widened: round-12 rejected only the subset
582
+ `{ pdlss, model, framework, agentType, apiEndpoint }`; round-13 rejects
583
+ ANY field except `agentStatus` (the only allowed lifecycle transition
584
+ post-mint).
585
+
586
+ **Migration**: if your code catches `pdlss_immutable`, update to
587
+ `agent_immutable`. No legacy alias is shipped — clean break prevents
588
+ permanent shim cruft. The new shape:
589
+
590
+ ```json
591
+ {
592
+ "success": false,
593
+ "error": "agent_immutable",
594
+ "message": "Agents are immutable post-approval. ... Attempted immutable fields: <list>. ...",
595
+ "immutableFields": ["name", "description", ...]
596
+ }
597
+ ```
598
+
599
+ **Why**: agents become immutable at approval + mint per the trust-chain
600
+ invariant. Pre-mint owner edits flow through
601
+ `POST /agents/request-registration/:requestId/approve` (dashboard-only,
602
+ accepts a full edit body). Post-mint, the only allowed transition is
603
+ `agentStatus` (e.g. dashboard retire button). For configuration changes,
604
+ use the upgrade flow (coming soon) or retire-and-re-register.
605
+
606
+ **Other round-13 items**:
607
+
608
+ - **R13-1 + R13-2 — MCP middleware: symmetric precedence chain for
609
+ `purpose` and `action`**. Canonical resolution (documented ONCE,
610
+ applies to both):
611
+ 1. `X-Astra-<concept>` HTTP header
612
+ 2. `params._meta.astrasync.<concept>` body field
613
+ 3. `params.arguments.<concept>` body field
614
+ 4. Transport-layer default:
615
+ - `purpose` → `'mcp_invoke'`
616
+ - `action` → `'<method>:<toolName>'` (or `'<method>'` alone)
617
+
618
+ Round-12 F19 shipped purpose with `header → _meta → default`; this
619
+ round closes the `params.arguments.purpose` fallback gap AND ships
620
+ action with the same full chain in one round (not staggered) to
621
+ pre-empt the parallel "I set action in arguments and it didn't take"
622
+ support tickets. Resource string stays `mcp:tool/<name>` regardless.
623
+
624
+ `mcpToPdlss(parsed, headerPurpose, headerAction)` signature.
625
+ `McpPdlssMapping.purposeSource` now `'header' | 'meta' | 'tool_argument' | 'default_mcp_invoke'`
626
+ (round-12 narrower `'header' | 'tool_argument' | 'default_mcp_invoke'`
627
+ widened to split `meta` from `tool_argument`). New companion
628
+ `actionSource: 'header' | 'meta' | 'tool_argument' | 'transport_layer'`.
629
+
630
+ - **R13-5 — MCP `evaluateAlwaysIfCredentialed` parity with F9**. Flag
631
+ moved from `ExpressMiddlewareOptions` to `GatewayConfig` so both
632
+ adapters inherit. MCP middleware now mirrors the express F9 pattern:
633
+ route-none + flag-on + credentialed → run verify-access for the audit
634
+ trail, populate `req.agentVerification`, then proceed without gates
635
+ (`X-Astra-Gateway-Mode: enforced`, `Reason: evaluated-not-enforced`).
636
+ Closes the round-12 deferral.
637
+
638
+ - **F14 closure — `sdkVersion` body field on verify-access**. Replaces
639
+ round-12's User-Agent regex extraction which silently failed because
640
+ Node's undici fetch doesn't ship a usable User-Agent header. The SDK
641
+ now sets `body.sdkVersion = SDK_VERSION` (sourced from
642
+ `packages/verification-gateway/src/version.ts`, bumped alongside
643
+ `package.json` on every release). Backend reads from the body field
644
+ and runs the same forward-only auto-pop into
645
+ `kya_counterparty.sdk_version`. Works in Node, browser, and behind
646
+ CDNs uniformly.
647
+
648
+ - **R13-4 — Branded TypeScript types** (compile-time protection against
649
+ the recurring UUID / public-id string-confusion bug class —
650
+ round-7 #46, round-11 F1, round-12 F15). New `CounterpartyUuid`,
651
+ `AgentUuid`, `OwnerUuid`, `CounterpartyAstraeId`, `AgentAstraId`,
652
+ `OwnerAstradId` branded types in the backend at
653
+ `apps/backend/src/types/branded-ids.ts`. Zero runtime cost; affects
654
+ only compile-time assignment compatibility. Scope intentionally
655
+ narrow — only the conversion-point function signatures.
656
+
497
657
  ### v2.4.4 — Round-12 partner integration testing
498
658
 
499
659
  - **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.
@@ -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-y13mmzbA.mjs';
3
- import '../types-CVT-sorC.mjs';
2
+ import { A as AgentAction, I as InterceptResult, P as PDLSSContext, V as VerificationDecision } from '../types-tBNFSbw_.mjs';
3
+ import '../types-CbZOkIr-.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-CLP_TDu5.js';
3
- import '../types-CVT-sorC.js';
2
+ import { A as AgentAction, I as InterceptResult, P as PDLSSContext, V as VerificationDecision } from '../types-DXNkr61h.js';
3
+ import '../types-CbZOkIr-.js';
4
4
 
5
5
  /**
6
6
  * PlatformAdapter Interface
@@ -1,3 +1,3 @@
1
1
  import 'express';
2
- import '../types-CVT-sorC.mjs';
3
- export { c as createMiddleware, a as extractAstraSyncCredentials } from '../express-Ck2RHZLT.mjs';
2
+ import '../types-CbZOkIr-.mjs';
3
+ export { c as createMiddleware, a as extractAstraSyncCredentials } from '../express-D5hAJ2Gv.mjs';
@@ -1,3 +1,3 @@
1
1
  import 'express';
2
- import '../types-CVT-sorC.js';
3
- export { c as createMiddleware, a as extractAstraSyncCredentials } from '../express-DZmEzCgo.js';
2
+ import '../types-CbZOkIr-.js';
3
+ export { c as createMiddleware, a as extractAstraSyncCredentials } from '../express-XCkk7BsJ.js';
@@ -44,6 +44,9 @@ function hasMinimumAccess(actual, required) {
44
44
  return ACCESS_LEVEL_HIERARCHY[actual] >= ACCESS_LEVEL_HIERARCHY[required];
45
45
  }
46
46
 
47
+ // src/version.ts
48
+ var SDK_VERSION = "2.4.6";
49
+
47
50
  // src/verify.ts
48
51
  var DEFAULT_CONFIG = {
49
52
  apiBaseUrl: "https://astrasync.ai/api",
@@ -202,6 +205,7 @@ async function callVerifyAccessAPI(config, request) {
202
205
  if (requestData.runtimeChallengeOptions)
203
206
  body.runtimeChallengeOptions = requestData.runtimeChallengeOptions;
204
207
  if (requestData.invocationProtocol) body.invocationProtocol = requestData.invocationProtocol;
208
+ body.sdkVersion = SDK_VERSION;
205
209
  if (requestData.callerMetadata || requestData.clientIp || requestData.userAgent) {
206
210
  const meta = {
207
211
  ...requestData.clientIp && { sourceIp: requestData.clientIp },