@veloxts/mcp 0.6.68 → 0.6.70

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 (2) hide show
  1. package/CHANGELOG.md +89 -0
  2. package/package.json +4 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,94 @@
1
1
  # @veloxts/mcp
2
2
 
3
+ ## 0.6.70
4
+
5
+ ### Patch Changes
6
+
7
+ - ### feat(auth): Unified Adapter-Only Architecture
8
+
9
+ **New Features:**
10
+
11
+ - Add `JwtAdapter` implementing the `AuthAdapter` interface for unified JWT authentication
12
+ - Add `jwtAuth()` convenience function for direct adapter usage with optional built-in routes (`/api/auth/refresh`, `/api/auth/logout`)
13
+ - Add `AuthContext` discriminated union (`NativeAuthContext | AdapterAuthContext`) for type-safe auth mode handling
14
+ - Add double-registration protection to prevent conflicting auth system setups
15
+ - Add shared decoration utilities (`decorateAuth`, `setRequestAuth`, `checkDoubleRegistration`)
16
+
17
+ **Architecture Changes:**
18
+
19
+ - `authPlugin` now uses `JwtAdapter` internally - all authentication flows through the adapter pattern
20
+ - Single code path for authentication (no more dual native/adapter modes)
21
+ - `authContext.authMode` is now always `'adapter'` with `providerId='jwt'` when using `authPlugin`
22
+
23
+ **Breaking Changes:**
24
+
25
+ - Remove deprecated `LegacySessionConfig` interface (use `sessionMiddleware` instead)
26
+ - Remove deprecated `session` field from `AuthConfig`
27
+ - `User` interface no longer has index signature (extend via declaration merging)
28
+
29
+ **Type Safety Improvements:**
30
+
31
+ - `AuthContext` discriminated union enables exhaustive type narrowing based on `authMode`
32
+ - Export `NativeAuthContext` and `AdapterAuthContext` types for explicit typing
33
+
34
+ **Migration:**
35
+
36
+ - Existing `authPlugin` usage remains backward-compatible
37
+ - If checking `authContext.token`, use `authContext.session` instead (token stored in session for adapter mode)
38
+
39
+ - Updated dependencies
40
+ - @veloxts/cli@0.6.70
41
+ - @veloxts/router@0.6.70
42
+ - @veloxts/validation@0.6.70
43
+
44
+ ## 0.6.69
45
+
46
+ ### Patch Changes
47
+
48
+ - implement user feedback improvements across packages
49
+
50
+ ## Summary
51
+
52
+ Addresses 9 user feedback items to improve DX, reduce boilerplate, and eliminate template duplications.
53
+
54
+ ### Phase 1: Validation Helpers (`@veloxts/validation`)
55
+
56
+ - Add `prismaDecimal()`, `prismaDecimalNullable()`, `prismaDecimalOptional()` for Prisma Decimal → number conversion
57
+ - Add `dateToIso`, `dateToIsoNullable`, `dateToIsoOptional` aliases for consistency
58
+
59
+ ### Phase 2: Template Deduplication (`@veloxts/auth`)
60
+
61
+ - Export `createEnhancedTokenStore()` with token revocation and refresh token reuse detection
62
+ - Export `parseUserRoles()` and `DEFAULT_ALLOWED_ROLES`
63
+ - Fix memory leak: track pending timeouts for proper cleanup on `destroy()`
64
+ - Update templates to import from `@veloxts/auth` instead of duplicating code
65
+ - Fix jwtManager singleton pattern in templates
66
+
67
+ ### Phase 3: Router Helpers (`@veloxts/router`)
68
+
69
+ - Add `createRouter()` returning `{ collections, router }` for DRY setup
70
+ - Add `toRouter()` for router-only use cases
71
+ - Update all router templates to use `createRouter()`
72
+
73
+ ### Phase 4: Guard Type Narrowing - Experimental (`@veloxts/auth`, `@veloxts/router`)
74
+
75
+ - Add `NarrowingGuard` interface with phantom `_narrows` type
76
+ - Add `authenticatedNarrow` and `hasRoleNarrow()` guards
77
+ - Add `guardNarrow()` method to `ProcedureBuilder` for context narrowing
78
+ - Enables `ctx.user` to be non-null after guard passes
79
+
80
+ ### Phase 5: Documentation (`@veloxts/router`)
81
+
82
+ - Document `.rest()` override patterns
83
+ - Document `createRouter()` helper usage
84
+ - Document `guardNarrow()` experimental API
85
+ - Add schema browser-safety patterns for RSC apps
86
+
87
+ - Updated dependencies
88
+ - @veloxts/cli@0.6.69
89
+ - @veloxts/router@0.6.69
90
+ - @veloxts/validation@0.6.69
91
+
3
92
  ## 0.6.68
4
93
 
5
94
  ### Patch Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@veloxts/mcp",
3
- "version": "0.6.68",
3
+ "version": "0.6.70",
4
4
  "description": "Model Context Protocol server for VeloxTS - expose project context to AI tools",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -24,9 +24,9 @@
24
24
  "dependencies": {
25
25
  "@modelcontextprotocol/sdk": "1.25.1",
26
26
  "typescript": "5.9.3",
27
- "@veloxts/cli": "0.6.68",
28
- "@veloxts/router": "0.6.68",
29
- "@veloxts/validation": "0.6.68"
27
+ "@veloxts/router": "0.6.70",
28
+ "@veloxts/validation": "0.6.70",
29
+ "@veloxts/cli": "0.6.70"
30
30
  },
31
31
  "peerDependencies": {
32
32
  "zod": ">=3.25.0"