create-fluxstack 1.16.0 → 1.17.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.
Files changed (119) hide show
  1. package/CHANGELOG.md +80 -0
  2. package/app/client/src/App.tsx +8 -0
  3. package/app/client/src/live/AuthDemo.tsx +4 -4
  4. package/core/build/bundler.ts +40 -26
  5. package/core/build/flux-plugins-generator.ts +325 -325
  6. package/core/build/index.ts +92 -21
  7. package/core/cli/command-registry.ts +44 -46
  8. package/core/cli/commands/build.ts +11 -6
  9. package/core/cli/commands/create.ts +7 -5
  10. package/core/cli/commands/dev.ts +6 -5
  11. package/core/cli/commands/help.ts +3 -2
  12. package/core/cli/commands/make-plugin.ts +8 -7
  13. package/core/cli/commands/plugin-add.ts +60 -43
  14. package/core/cli/commands/plugin-deps.ts +73 -57
  15. package/core/cli/commands/plugin-list.ts +44 -41
  16. package/core/cli/commands/plugin-remove.ts +33 -22
  17. package/core/cli/generators/component.ts +770 -769
  18. package/core/cli/generators/controller.ts +9 -8
  19. package/core/cli/generators/index.ts +148 -146
  20. package/core/cli/generators/interactive.ts +228 -227
  21. package/core/cli/generators/plugin.ts +11 -10
  22. package/core/cli/generators/prompts.ts +83 -82
  23. package/core/cli/generators/route.ts +7 -6
  24. package/core/cli/generators/service.ts +10 -9
  25. package/core/cli/generators/template-engine.ts +2 -1
  26. package/core/cli/generators/types.ts +7 -7
  27. package/core/cli/generators/utils.ts +191 -191
  28. package/core/cli/index.ts +9 -8
  29. package/core/cli/plugin-discovery.ts +2 -2
  30. package/core/client/hooks/useAuth.ts +48 -48
  31. package/core/client/standalone.ts +18 -17
  32. package/core/client/state/createStore.ts +192 -192
  33. package/core/client/state/index.ts +14 -14
  34. package/core/config/index.ts +1 -0
  35. package/core/framework/client.ts +131 -131
  36. package/core/framework/index.ts +7 -7
  37. package/core/framework/server.ts +73 -113
  38. package/core/framework/types.ts +2 -2
  39. package/core/plugins/built-in/live-components/commands/create-live-component.ts +6 -3
  40. package/core/plugins/built-in/monitoring/index.ts +110 -68
  41. package/core/plugins/built-in/static/index.ts +2 -2
  42. package/core/plugins/built-in/swagger/index.ts +9 -9
  43. package/core/plugins/built-in/vite/index.ts +3 -3
  44. package/core/plugins/built-in/vite/vite-dev.ts +3 -3
  45. package/core/plugins/config.ts +50 -47
  46. package/core/plugins/discovery.ts +10 -4
  47. package/core/plugins/executor.ts +2 -2
  48. package/core/plugins/index.ts +206 -203
  49. package/core/plugins/manager.ts +21 -20
  50. package/core/plugins/registry.ts +76 -12
  51. package/core/plugins/types.ts +14 -14
  52. package/core/server/framework.ts +3 -189
  53. package/core/server/live/auto-generated-components.ts +11 -29
  54. package/core/server/live/index.ts +41 -31
  55. package/core/server/live/websocket-plugin.ts +11 -1
  56. package/core/server/middleware/elysia-helpers.ts +16 -15
  57. package/core/server/middleware/errorHandling.ts +14 -14
  58. package/core/server/middleware/index.ts +31 -31
  59. package/core/server/plugins/database.ts +181 -180
  60. package/core/server/plugins/static-files-plugin.ts +4 -3
  61. package/core/server/plugins/swagger.ts +11 -8
  62. package/core/server/rooms/RoomBroadcaster.ts +11 -10
  63. package/core/server/rooms/RoomSystem.ts +14 -11
  64. package/core/server/services/BaseService.ts +7 -7
  65. package/core/server/services/ServiceContainer.ts +5 -5
  66. package/core/server/services/index.ts +8 -8
  67. package/core/templates/create-project.ts +28 -27
  68. package/core/testing/index.ts +9 -9
  69. package/core/testing/setup.ts +73 -73
  70. package/core/types/api.ts +168 -168
  71. package/core/types/config.ts +5 -5
  72. package/core/types/index.ts +1 -1
  73. package/core/types/plugin.ts +2 -2
  74. package/core/types/types.ts +3 -3
  75. package/core/utils/build-logger.ts +324 -324
  76. package/core/utils/config-schema.ts +480 -480
  77. package/core/utils/env.ts +10 -8
  78. package/core/utils/errors/codes.ts +114 -114
  79. package/core/utils/errors/handlers.ts +30 -20
  80. package/core/utils/errors/index.ts +54 -46
  81. package/core/utils/errors/middleware.ts +113 -113
  82. package/core/utils/helpers.ts +19 -16
  83. package/core/utils/logger/colors.ts +114 -114
  84. package/core/utils/logger/config.ts +2 -2
  85. package/core/utils/logger/formatter.ts +82 -82
  86. package/core/utils/logger/group-logger.ts +101 -101
  87. package/core/utils/logger/index.ts +13 -3
  88. package/core/utils/logger/startup-banner.ts +2 -2
  89. package/core/utils/logger/winston-logger.ts +152 -152
  90. package/core/utils/monitoring/index.ts +211 -211
  91. package/core/utils/sync-version.ts +67 -66
  92. package/core/utils/version.ts +1 -1
  93. package/package.json +104 -100
  94. package/playwright-report/index.html +85 -0
  95. package/playwright.config.ts +31 -0
  96. package/plugins/crypto-auth/client/CryptoAuthClient.ts +302 -302
  97. package/plugins/crypto-auth/client/components/index.ts +11 -11
  98. package/plugins/crypto-auth/client/index.ts +11 -11
  99. package/plugins/crypto-auth/package.json +65 -65
  100. package/plugins/crypto-auth/server/CryptoAuthService.ts +185 -185
  101. package/plugins/crypto-auth/server/middlewares/cryptoAuthAdmin.ts +6 -5
  102. package/plugins/crypto-auth/server/middlewares/cryptoAuthPermissions.ts +6 -5
  103. package/plugins/crypto-auth/server/middlewares/cryptoAuthRequired.ts +3 -3
  104. package/plugins/crypto-auth/server/middlewares/index.ts +22 -22
  105. package/plugins/crypto-auth/server/middlewares.ts +19 -19
  106. package/vite.config.ts +13 -0
  107. package/app/client/.live-stubs/LiveAdminPanel.js +0 -5
  108. package/app/client/.live-stubs/LiveCounter.js +0 -9
  109. package/app/client/.live-stubs/LiveForm.js +0 -11
  110. package/app/client/.live-stubs/LiveLocalCounter.js +0 -8
  111. package/app/client/.live-stubs/LivePingPong.js +0 -10
  112. package/app/client/.live-stubs/LiveRoomChat.js +0 -11
  113. package/app/client/.live-stubs/LiveSharedCounter.js +0 -10
  114. package/app/client/.live-stubs/LiveUpload.js +0 -15
  115. package/app/server/live/register-components.ts +0 -19
  116. package/core/build/live-components-generator.ts +0 -321
  117. package/core/live/ComponentRegistry.ts +0 -403
  118. package/core/live/types.ts +0 -241
  119. package/workspace.json +0 -6
@@ -1,204 +1,207 @@
1
- /**
2
- * Enhanced Plugin System
3
- * Comprehensive plugin system with lifecycle hooks, dependency management, and configuration
4
- */
5
-
6
- // Core plugin types and interfaces
7
- export type {
8
- FluxStack,
9
- PluginContext,
10
- PluginHook,
11
- PluginPriority,
12
- PluginManifest,
13
- PluginLoadResult,
14
- PluginRegistryState,
15
- PluginHookResult,
16
- PluginMetrics,
17
- PluginDiscoveryOptions,
18
- PluginInstallOptions,
19
- PluginExecutionContext,
20
- PluginValidationResult,
21
- HookExecutionOptions,
22
- PluginLifecycleEvent,
23
- PluginConfigSchema,
24
- RequestContext,
25
- ResponseContext,
26
- ErrorContext,
27
- BuildContext
28
- } from './types'
29
-
30
- export type Plugin = FluxStack.Plugin
31
-
32
- // Plugin registry
33
- export { PluginRegistry } from './registry'
34
- export type { PluginRegistryConfig } from './registry'
35
-
36
- // Plugin discovery
37
- export { PluginDiscovery, pluginDiscovery } from './discovery'
38
- export type { PluginDiscoveryConfig } from './discovery'
39
-
40
- // Plugin configuration management
41
- export {
42
- DefaultPluginConfigManager,
43
- createPluginUtils
44
- } from './config'
45
- export type { PluginConfigManager } from './config'
46
-
47
- // Plugin manager
48
- export {
49
- PluginManager,
50
- createRequestContext,
51
- createResponseContext,
52
- createErrorContext,
53
- createBuildContext
54
- } from './manager'
55
- export type { PluginManagerConfig } from './manager'
56
-
57
- // Module resolver for plugins
58
- export { PluginModuleResolver } from './module-resolver'
59
- export type { ModuleResolverConfig } from './module-resolver'
60
-
61
- // Plugin executor
62
- export {
63
- PluginExecutor,
64
- calculateExecutionStats
65
- } from './executor'
66
- export type {
67
- PluginExecutionPlan,
68
- PluginExecutionStep,
69
- PluginExecutionStats
70
- } from './executor'
71
-
72
- // Utility functions for plugin development
73
- export const PluginUtils = {
74
- /**
75
- * Create a simple plugin
76
- */
77
- createPlugin: (config: {
78
- name: string
79
- version?: string
80
- description?: string
81
- dependencies?: string[]
82
- priority?: number | PluginPriority
83
- setup?: (context: PluginContext) => void | Promise<void>
84
- onServerStart?: (context: PluginContext) => void | Promise<void>
85
- onServerStop?: (context: PluginContext) => void | Promise<void>
86
- onRequest?: (context: RequestContext) => void | Promise<void>
87
- onBeforeRoute?: (context: RequestContext) => void | Promise<void>
88
- onResponse?: (context: ResponseContext) => void | Promise<void>
89
- onError?: (context: ErrorContext) => void | Promise<void>
90
- configSchema?: any
91
- defaultConfig?: any
92
- }): Plugin => {
93
- const plugin = {
94
- name: config.name,
95
- ...(config.version && { version: config.version }),
96
- ...(config.description && { description: config.description }),
97
- ...(config.dependencies && { dependencies: config.dependencies }),
98
- ...(config.priority !== undefined && { priority: config.priority }),
99
- ...(config.setup && { setup: config.setup }),
100
- ...(config.onServerStart && { onServerStart: config.onServerStart }),
101
- ...(config.onServerStop && { onServerStop: config.onServerStop }),
102
- ...(config.onRequest && { onRequest: config.onRequest }),
103
- ...(config.onBeforeRoute && { onBeforeRoute: config.onBeforeRoute }),
104
- ...(config.onResponse && { onResponse: config.onResponse }),
105
- ...(config.onError && { onError: config.onError }),
106
- ...(config.configSchema && { configSchema: config.configSchema }),
107
- ...(config.defaultConfig && { defaultConfig: config.defaultConfig })
108
- } as Plugin
109
- return plugin
110
- },
111
-
112
- /**
113
- * Create a plugin manifest
114
- */
115
- createManifest: (config: {
116
- name: string
117
- version: string
118
- description: string
119
- author: string
120
- license: string
121
- homepage?: string
122
- repository?: string
123
- keywords?: string[]
124
- dependencies?: Record<string, string>
125
- peerDependencies?: Record<string, string>
126
- fluxstack: {
127
- version: string
128
- hooks: PluginHook[]
129
- config?: any
130
- category?: string
131
- tags?: string[]
132
- }
133
- }): any => {
134
- return {
135
- name: config.name,
136
- version: config.version || '1.0.0',
137
- description: config.description,
138
- author: config.author,
139
- license: config.license,
140
- homepage: config.homepage,
141
- repository: config.repository,
142
- keywords: config.keywords || [],
143
- dependencies: config.dependencies || {},
144
- peerDependencies: config.peerDependencies,
145
- fluxstack: config.fluxstack
146
- }
147
- },
148
-
149
- /**
150
- * Validate plugin structure
151
- */
152
- validatePlugin: (plugin: any): plugin is Plugin => {
153
- return (
154
- plugin &&
155
- typeof plugin === 'object' &&
156
- typeof plugin.name === 'string' &&
157
- plugin.name.length > 0
158
- )
159
- },
160
-
161
- /**
162
- * Check if plugin implements hook
163
- */
164
- implementsHook: (plugin: Plugin, hook: PluginHook): boolean => {
165
- const hookFunction = (plugin as any)[hook]
166
- return hookFunction && typeof hookFunction === 'function'
167
- },
168
-
169
- /**
170
- * Get plugin hooks
171
- */
172
- getPluginHooks: (plugin: Plugin): PluginHook[] => {
173
- const hooks: PluginHook[] = []
174
- const possibleHooks: PluginHook[] = [
175
- 'setup',
176
- 'onServerStart',
177
- 'onServerStop',
178
- 'onRequest',
179
- 'onResponse',
180
- 'onError',
181
- 'onBuild',
182
- 'onBuildComplete'
183
- ]
184
-
185
- for (const hook of possibleHooks) {
186
- if (PluginUtils.implementsHook(plugin, hook)) {
187
- hooks.push(hook)
188
- }
189
- }
190
-
191
- return hooks
192
- }
193
- }
194
-
195
- // Re-export types for convenience
196
- import type {
197
- PluginContext,
198
- PluginHook,
199
- PluginPriority,
200
- RequestContext,
201
- ResponseContext,
202
- ErrorContext,
203
- FluxStack
1
+ /**
2
+ * Enhanced Plugin System
3
+ * Comprehensive plugin system with lifecycle hooks, dependency management, and configuration
4
+ */
5
+
6
+ // Core plugin types and interfaces
7
+ export type {
8
+ FluxStack,
9
+ PluginContext,
10
+ PluginHook,
11
+ PluginPriority,
12
+ PluginManifest,
13
+ PluginLoadResult,
14
+ PluginRegistryState,
15
+ PluginHookResult,
16
+ PluginMetrics,
17
+ PluginDiscoveryOptions,
18
+ PluginInstallOptions,
19
+ PluginExecutionContext,
20
+ PluginValidationResult,
21
+ HookExecutionOptions,
22
+ PluginLifecycleEvent,
23
+ PluginConfigSchema,
24
+ RequestContext,
25
+ ResponseContext,
26
+ ErrorContext,
27
+ BuildContext
28
+ } from './types'
29
+
30
+ export type Plugin = FluxStack.Plugin
31
+
32
+ // Plugin registry
33
+ export { PluginRegistry } from './registry'
34
+ export type { PluginRegistryConfig } from './registry'
35
+
36
+ // Plugin discovery
37
+ export { PluginDiscovery, pluginDiscovery } from './discovery'
38
+ export type { PluginDiscoveryConfig } from './discovery'
39
+
40
+ // Plugin configuration management
41
+ export {
42
+ DefaultPluginConfigManager,
43
+ createPluginUtils
44
+ } from './config'
45
+ export type { PluginConfigManager } from './config'
46
+
47
+ // Plugin manager
48
+ export {
49
+ PluginManager,
50
+ createRequestContext,
51
+ createResponseContext,
52
+ createErrorContext,
53
+ createBuildContext
54
+ } from './manager'
55
+ export type { PluginManagerConfig } from './manager'
56
+
57
+ // Module resolver for plugins
58
+ export { PluginModuleResolver } from './module-resolver'
59
+ export type { ModuleResolverConfig } from './module-resolver'
60
+
61
+ // Plugin executor
62
+ export {
63
+ PluginExecutor,
64
+ calculateExecutionStats
65
+ } from './executor'
66
+ export type {
67
+ PluginExecutionPlan,
68
+ PluginExecutionStep,
69
+ PluginExecutionStats
70
+ } from './executor'
71
+
72
+ // Utility functions for plugin development
73
+ export const PluginUtils = {
74
+ /**
75
+ * Create a simple plugin
76
+ */
77
+ createPlugin: (config: {
78
+ name: string
79
+ version?: string
80
+ description?: string
81
+ dependencies?: string[]
82
+ priority?: number | PluginPriority
83
+ setup?: (context: PluginContext) => void | Promise<void>
84
+ onServerStart?: (context: PluginContext) => void | Promise<void>
85
+ onServerStop?: (context: PluginContext) => void | Promise<void>
86
+ onRequest?: (context: RequestContext) => void | Promise<void>
87
+ onBeforeRoute?: (context: RequestContext) => void | Promise<void>
88
+ onResponse?: (context: ResponseContext) => void | Promise<void>
89
+ onError?: (context: ErrorContext) => void | Promise<void>
90
+ configSchema?: PluginConfigSchema
91
+ defaultConfig?: unknown
92
+ }): Plugin => {
93
+ const plugin = {
94
+ name: config.name,
95
+ ...(config.version && { version: config.version }),
96
+ ...(config.description && { description: config.description }),
97
+ ...(config.dependencies && { dependencies: config.dependencies }),
98
+ ...(config.priority !== undefined && { priority: config.priority }),
99
+ ...(config.setup && { setup: config.setup }),
100
+ ...(config.onServerStart && { onServerStart: config.onServerStart }),
101
+ ...(config.onServerStop && { onServerStop: config.onServerStop }),
102
+ ...(config.onRequest && { onRequest: config.onRequest }),
103
+ ...(config.onBeforeRoute && { onBeforeRoute: config.onBeforeRoute }),
104
+ ...(config.onResponse && { onResponse: config.onResponse }),
105
+ ...(config.onError && { onError: config.onError }),
106
+ ...(config.configSchema && { configSchema: config.configSchema }),
107
+ ...(config.defaultConfig !== undefined ? { defaultConfig: config.defaultConfig } : {})
108
+ } as Plugin
109
+ return plugin
110
+ },
111
+
112
+ /**
113
+ * Create a plugin manifest
114
+ */
115
+ createManifest: (config: {
116
+ name: string
117
+ version: string
118
+ description: string
119
+ author: string
120
+ license: string
121
+ homepage?: string
122
+ repository?: string
123
+ keywords?: string[]
124
+ dependencies?: Record<string, string>
125
+ peerDependencies?: Record<string, string>
126
+ fluxstack: {
127
+ version: string
128
+ hooks: PluginHook[]
129
+ config?: PluginConfigSchema
130
+ category?: string
131
+ tags?: string[]
132
+ }
133
+ }): PluginManifest => {
134
+ return {
135
+ name: config.name,
136
+ version: config.version || '1.0.0',
137
+ description: config.description,
138
+ author: config.author,
139
+ license: config.license,
140
+ homepage: config.homepage,
141
+ repository: config.repository,
142
+ keywords: config.keywords || [],
143
+ dependencies: config.dependencies || {},
144
+ peerDependencies: config.peerDependencies,
145
+ fluxstack: config.fluxstack
146
+ }
147
+ },
148
+
149
+ /**
150
+ * Validate plugin structure
151
+ */
152
+ validatePlugin: (plugin: unknown): plugin is Plugin => {
153
+ return (
154
+ !!plugin &&
155
+ typeof plugin === 'object' &&
156
+ 'name' in plugin &&
157
+ typeof (plugin as Record<string, unknown>).name === 'string' &&
158
+ ((plugin as Record<string, unknown>).name as string).length > 0
159
+ )
160
+ },
161
+
162
+ /**
163
+ * Check if plugin implements hook
164
+ */
165
+ implementsHook: (plugin: Plugin, hook: PluginHook): boolean => {
166
+ const hookFunction = plugin[hook]
167
+ return !!hookFunction && typeof hookFunction === 'function'
168
+ },
169
+
170
+ /**
171
+ * Get plugin hooks
172
+ */
173
+ getPluginHooks: (plugin: Plugin): PluginHook[] => {
174
+ const hooks: PluginHook[] = []
175
+ const possibleHooks: PluginHook[] = [
176
+ 'setup',
177
+ 'onServerStart',
178
+ 'onServerStop',
179
+ 'onRequest',
180
+ 'onResponse',
181
+ 'onError',
182
+ 'onBuild',
183
+ 'onBuildComplete'
184
+ ]
185
+
186
+ for (const hook of possibleHooks) {
187
+ if (PluginUtils.implementsHook(plugin, hook)) {
188
+ hooks.push(hook)
189
+ }
190
+ }
191
+
192
+ return hooks
193
+ }
194
+ }
195
+
196
+ // Re-export types for convenience
197
+ import type {
198
+ PluginContext,
199
+ PluginConfigSchema,
200
+ PluginHook,
201
+ PluginManifest,
202
+ PluginPriority,
203
+ RequestContext,
204
+ ResponseContext,
205
+ ErrorContext,
206
+ FluxStack
204
207
  } from './types'
@@ -3,11 +3,12 @@
3
3
  * Handles plugin lifecycle, execution, and context management
4
4
  */
5
5
 
6
- import type {
6
+ import type {
7
7
  FluxStack,
8
- PluginContext,
9
- PluginHook,
10
- PluginHookResult,
8
+ PluginContext,
9
+ PluginHook,
10
+ PluginHookResult,
11
+ PluginLoadResult,
11
12
  PluginMetrics,
12
13
  PluginExecutionContext,
13
14
  HookExecutionOptions,
@@ -43,14 +44,14 @@ function parseRequestURL(request: Request): URL {
43
44
  export interface PluginManagerConfig {
44
45
  config: FluxStackConfig
45
46
  logger: Logger
46
- app?: any
47
+ app?: unknown
47
48
  }
48
49
 
49
50
  export class PluginManager extends EventEmitter {
50
51
  private registry: PluginRegistry
51
52
  private config: FluxStackConfig
52
53
  private logger: Logger
53
- private app?: any
54
+ private app?: unknown
54
55
  private metrics: Map<string, PluginMetrics> = new Map()
55
56
  private contexts: Map<string, PluginContext> = new Map()
56
57
  private initialized = false
@@ -163,8 +164,8 @@ export class PluginManager extends EventEmitter {
163
164
  * Execute a hook on all plugins
164
165
  */
165
166
  async executeHook(
166
- hook: PluginHook,
167
- context?: any,
167
+ hook: PluginHook,
168
+ context?: unknown,
168
169
  options: HookExecutionOptions = {}
169
170
  ): Promise<PluginHookResult[]> {
170
171
  const {
@@ -259,7 +260,7 @@ export class PluginManager extends EventEmitter {
259
260
  async executePluginHook(
260
261
  plugin: Plugin,
261
262
  hook: PluginHook,
262
- context?: any,
263
+ context?: unknown,
263
264
  options: { timeout?: number; retries?: number } = {}
264
265
  ): Promise<PluginHookResult> {
265
266
  const { timeout = 30000, retries = 0 } = options
@@ -305,25 +306,25 @@ export class PluginManager extends EventEmitter {
305
306
  })
306
307
 
307
308
  // Execute the hook with appropriate context
308
- let hookPromise: Promise<any>
309
+ let hookPromise: Promise<unknown>
309
310
 
310
311
  switch (hook) {
311
312
  case 'setup':
312
313
  case 'onServerStart':
313
314
  case 'onServerStop':
314
- hookPromise = Promise.resolve(hookFunction(pluginContext as any))
315
+ hookPromise = Promise.resolve((hookFunction as Function)(pluginContext))
315
316
  break
316
317
  case 'onRequest':
317
318
  case 'onResponse':
318
319
  case 'onError':
319
- hookPromise = Promise.resolve(hookFunction(context as any))
320
+ hookPromise = Promise.resolve((hookFunction as Function)(context))
320
321
  break
321
322
  case 'onBuild':
322
323
  case 'onBuildComplete':
323
- hookPromise = Promise.resolve(hookFunction(context as any))
324
+ hookPromise = Promise.resolve((hookFunction as Function)(context))
324
325
  break
325
326
  default:
326
- hookPromise = Promise.resolve(hookFunction(context || pluginContext))
327
+ hookPromise = Promise.resolve((hookFunction as Function)(context || pluginContext))
327
328
  }
328
329
 
329
330
  // Race between hook execution and timeout
@@ -408,8 +409,8 @@ export class PluginManager extends EventEmitter {
408
409
  */
409
410
  private getEnabledPlugins(): Plugin[] {
410
411
  const allPlugins = this.registry.getAll()
411
- const enabledNames = this.config.plugins.enabled ?? []
412
- const disabledNames = this.config.plugins.disabled ?? []
412
+ const enabledNames = (this.config.plugins.enabled ?? []) as string[]
413
+ const disabledNames = (this.config.plugins.disabled ?? []) as string[]
413
414
 
414
415
  return allPlugins.filter(plugin => {
415
416
  // If explicitly disabled, exclude
@@ -435,7 +436,7 @@ export class PluginManager extends EventEmitter {
435
436
  // ⚠️ Built-in plugins are now registered manually via .use()
436
437
  // No auto-discovery for core/plugins/built-in - developer chooses which to use
437
438
 
438
- const results: any[] = []
439
+ const results: PluginLoadResult[] = []
439
440
 
440
441
  // 1. Discover project plugins (plugins/ directory)
441
442
  this.logger.debug('Discovering project plugins in directory: plugins')
@@ -566,7 +567,7 @@ export class PluginManager extends EventEmitter {
566
567
  /**
567
568
  * Create request context from HTTP request
568
569
  */
569
- export function createRequestContext(request: Request, additionalData: any = {}): RequestContext {
570
+ export function createRequestContext(request: Request, additionalData: Record<string, unknown> = {}): RequestContext {
570
571
  const url = parseRequestURL(request)
571
572
 
572
573
  return {
@@ -593,7 +594,7 @@ export function createRequestContext(request: Request, additionalData: any = {})
593
594
  export function createResponseContext(
594
595
  requestContext: RequestContext,
595
596
  response: Response,
596
- additionalData: any = {}
597
+ additionalData: Record<string, unknown> = {}
597
598
  ): ResponseContext {
598
599
  return {
599
600
  ...requestContext,
@@ -611,7 +612,7 @@ export function createResponseContext(
611
612
  export function createErrorContext(
612
613
  requestContext: RequestContext,
613
614
  error: Error,
614
- additionalData: any = {}
615
+ additionalData: Record<string, unknown> = {}
615
616
  ): ErrorContext {
616
617
  return {
617
618
  ...requestContext,