veryfront 0.1.635 → 0.1.636

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 (70) hide show
  1. package/esm/cli/commands/serve/command.d.ts.map +1 -1
  2. package/esm/cli/commands/serve/command.js +2 -1
  3. package/esm/deno.js +1 -1
  4. package/esm/src/cache/distributed-cache-init.d.ts +11 -2
  5. package/esm/src/cache/distributed-cache-init.d.ts.map +1 -1
  6. package/esm/src/cache/distributed-cache-init.js +2 -14
  7. package/esm/src/channels/control-plane.d.ts +5 -5
  8. package/esm/src/embedding/chunk.js +4 -2
  9. package/esm/src/errors/error-registry/agent.d.ts +16 -0
  10. package/esm/src/errors/error-registry/agent.d.ts.map +1 -0
  11. package/esm/src/errors/error-registry/agent.js +52 -0
  12. package/esm/src/errors/error-registry/boundary.d.ts +16 -0
  13. package/esm/src/errors/error-registry/boundary.d.ts.map +1 -0
  14. package/esm/src/errors/error-registry/boundary.js +52 -0
  15. package/esm/src/errors/error-registry/build.d.ts +20 -0
  16. package/esm/src/errors/error-registry/build.d.ts.map +1 -0
  17. package/esm/src/errors/error-registry/build.js +68 -0
  18. package/esm/src/errors/error-registry/config.d.ts +22 -0
  19. package/esm/src/errors/error-registry/config.d.ts.map +1 -0
  20. package/esm/src/errors/error-registry/config.js +70 -0
  21. package/esm/src/errors/error-registry/deploy.d.ts +12 -0
  22. package/esm/src/errors/error-registry/deploy.d.ts.map +1 -0
  23. package/esm/src/errors/error-registry/deploy.js +36 -0
  24. package/esm/src/errors/error-registry/dev.d.ts +14 -0
  25. package/esm/src/errors/error-registry/dev.d.ts.map +1 -0
  26. package/esm/src/errors/error-registry/dev.js +44 -0
  27. package/esm/src/errors/error-registry/general.d.ts +29 -0
  28. package/esm/src/errors/error-registry/general.d.ts.map +1 -0
  29. package/esm/src/errors/error-registry/general.js +92 -0
  30. package/esm/src/errors/error-registry/module.d.ts +16 -0
  31. package/esm/src/errors/error-registry/module.d.ts.map +1 -0
  32. package/esm/src/errors/error-registry/module.js +52 -0
  33. package/esm/src/errors/error-registry/route.d.ts +16 -0
  34. package/esm/src/errors/error-registry/route.d.ts.map +1 -0
  35. package/esm/src/errors/error-registry/route.js +52 -0
  36. package/esm/src/errors/error-registry/runtime.d.ts +18 -0
  37. package/esm/src/errors/error-registry/runtime.d.ts.map +1 -0
  38. package/esm/src/errors/error-registry/runtime.js +60 -0
  39. package/esm/src/errors/error-registry/server.d.ts +39 -0
  40. package/esm/src/errors/error-registry/server.d.ts.map +1 -0
  41. package/esm/src/errors/error-registry/server.js +129 -0
  42. package/esm/src/errors/error-registry.d.ts +79 -157
  43. package/esm/src/errors/error-registry.d.ts.map +1 -1
  44. package/esm/src/errors/error-registry.js +37 -706
  45. package/esm/src/integrations/schema.d.ts +4 -4
  46. package/esm/src/internal-agents/control-plane-auth.d.ts +1 -1
  47. package/esm/src/internal-agents/run-stream.d.ts.map +1 -1
  48. package/esm/src/internal-agents/run-stream.js +15 -1
  49. package/esm/src/security/sandbox/project-worker.d.ts.map +1 -1
  50. package/esm/src/security/sandbox/project-worker.js +0 -1
  51. package/esm/src/server/dev-server/server.d.ts.map +1 -1
  52. package/esm/src/server/dev-server/server.js +2 -1
  53. package/esm/src/server/distributed-cache-initializers.d.ts +13 -0
  54. package/esm/src/server/distributed-cache-initializers.d.ts.map +1 -0
  55. package/esm/src/server/distributed-cache-initializers.js +22 -0
  56. package/esm/src/server/handlers/request/agent-stream.handler.d.ts.map +1 -1
  57. package/esm/src/server/handlers/request/agent-stream.handler.js +56 -16
  58. package/esm/src/server/index.d.ts +1 -0
  59. package/esm/src/server/index.d.ts.map +1 -1
  60. package/esm/src/server/index.js +1 -0
  61. package/esm/src/server/production-server.d.ts.map +1 -1
  62. package/esm/src/server/production-server.js +2 -1
  63. package/esm/src/server/services/rsc/endpoints/rsc-bundles.generated.d.ts.map +1 -1
  64. package/esm/src/server/services/rsc/endpoints/rsc-bundles.generated.js +2 -2
  65. package/esm/src/utils/redis-client.d.ts.map +1 -1
  66. package/esm/src/utils/redis-client.js +0 -3
  67. package/esm/src/utils/version-constant.d.ts +1 -1
  68. package/esm/src/utils/version-constant.js +1 -1
  69. package/esm/src/workflow/schemas/workflow.schema.d.ts +4 -4
  70. package/package.json +1 -1
@@ -1,713 +1,44 @@
1
1
  import { getRegistryEntriesByCategory, getRegistryEntry, getRegistrySlugs, } from "./error-registry-helpers.js";
2
- import { defineError } from "./types.js";
3
- // =============================================================================
4
- // CONFIG - Configuration & environment errors
5
- // =============================================================================
6
- export const CONFIG_NOT_FOUND = defineError({
7
- slug: "config-not-found",
8
- category: "CONFIG",
9
- status: 404,
10
- title: "Configuration file not found",
11
- suggestion: "Run 'vf init' to create a configuration file",
12
- });
13
- export const CONFIG_INVALID = defineError({
14
- slug: "config-invalid",
15
- category: "CONFIG",
16
- status: 400,
17
- title: "Invalid configuration format",
18
- suggestion: "Check your veryfront.config.ts for syntax errors",
19
- });
20
- export const CONFIG_PARSE_ERROR = defineError({
21
- slug: "config-parse-error",
22
- category: "CONFIG",
23
- status: 400,
24
- title: "Failed to parse configuration",
25
- suggestion: "Ensure your configuration file is valid TypeScript/JSON",
26
- });
27
- /** Schema-level config validation (e.g. Zod schema mismatch at runtime) */
28
- export const CONFIG_VALIDATION_ERROR = defineError({
29
- slug: "config-validation-error",
30
- category: "CONFIG",
31
- status: 422,
32
- title: "Configuration validation failed",
33
- suggestion: "Check the configuration against the schema requirements",
34
- });
35
- export const CONFIG_TYPE_ERROR = defineError({
36
- slug: "config-type-error",
37
- category: "CONFIG",
38
- status: 400,
39
- title: "Configuration type mismatch",
40
- suggestion: "Ensure configuration values match expected types",
41
- });
42
- export const IMPORT_MAP_INVALID = defineError({
43
- slug: "import-map-invalid",
44
- category: "CONFIG",
45
- status: 400,
46
- title: "Invalid import map configuration",
47
- suggestion: "Check your import map syntax and paths",
48
- });
49
- export const CORS_CONFIG_INVALID = defineError({
50
- slug: "cors-config-invalid",
51
- category: "CONFIG",
52
- status: 400,
53
- title: "Invalid CORS configuration",
54
- suggestion: "Review CORS settings in your configuration",
55
- });
56
- /** Config file validation failures (replaces ConfigValidationError) */
57
- export const CONFIG_VALIDATION_FAILED = defineError({
58
- slug: "config-validation-failed",
59
- category: "CONFIG",
60
- status: 400,
61
- title: "Configuration validation failed",
62
- suggestion: "Check configuration values against requirements",
63
- });
64
- // =============================================================================
65
- // BUILD - Build & compilation errors
66
- // =============================================================================
67
- export const BUILD_FAILED = defineError({
68
- slug: "build-failed",
69
- category: "BUILD",
70
- status: 500,
71
- title: "Build process failed",
72
- suggestion: "Check the build output for specific errors",
73
- });
74
- export const BUNDLE_ERROR = defineError({
75
- slug: "bundle-error",
76
- category: "BUILD",
77
- status: 500,
78
- title: "Bundle generation failed",
79
- suggestion: "Review bundler output for details",
80
- });
81
- export const TYPESCRIPT_ERROR = defineError({
82
- slug: "typescript-error",
83
- category: "BUILD",
84
- status: 500,
85
- title: "TypeScript compilation error",
86
- suggestion: "Fix TypeScript errors shown in the output",
87
- });
88
- export const MDX_COMPILE_ERROR = defineError({
89
- slug: "mdx-compile-error",
90
- category: "BUILD",
91
- status: 500,
92
- title: "MDX compilation failed",
93
- suggestion: "Check your MDX file syntax",
94
- });
95
- export const ASSET_OPTIMIZATION_ERROR = defineError({
96
- slug: "asset-optimization-error",
97
- category: "BUILD",
98
- status: 500,
99
- title: "Asset optimization failed",
100
- suggestion: "Check asset file formats and paths",
101
- });
102
- export const SSG_GENERATION_ERROR = defineError({
103
- slug: "ssg-generation-error",
104
- category: "BUILD",
105
- status: 500,
106
- title: "Static site generation failed",
107
- suggestion: "Review SSG configuration and data fetching",
108
- });
109
- export const SOURCEMAP_ERROR = defineError({
110
- slug: "sourcemap-error",
111
- category: "BUILD",
112
- status: 500,
113
- title: "Source map generation failed",
114
- suggestion: "Check source map configuration",
115
- });
116
- export const COMPILATION_ERROR = defineError({
117
- slug: "compilation-error",
118
- category: "BUILD",
119
- status: 500,
120
- title: "Compilation failed",
121
- suggestion: "Review compiler output for specific errors",
122
- });
123
- // =============================================================================
124
- // RUNTIME - Runtime execution & rendering errors
125
- // =============================================================================
126
- export const HYDRATION_MISMATCH = defineError({
127
- slug: "hydration-mismatch",
128
- category: "RUNTIME",
129
- status: 500,
130
- title: "Client/server hydration mismatch",
131
- suggestion: "Ensure server and client render the same content",
132
- });
133
- export const RENDER_ERROR = defineError({
134
- slug: "render-error",
135
- category: "RUNTIME",
136
- status: 500,
137
- title: "Component render failed",
138
- suggestion: "Check component for runtime errors",
139
- });
140
- export const COMPONENT_ERROR = defineError({
141
- slug: "component-error",
142
- category: "RUNTIME",
143
- status: 500,
144
- title: "Component execution error",
145
- suggestion: "Review component logic and props",
146
- });
147
- export const LAYOUT_NOT_FOUND = defineError({
148
- slug: "layout-not-found",
149
- category: "RUNTIME",
150
- status: 404,
151
- title: "Layout component not found",
152
- suggestion: "Ensure layout file exists at the expected path",
153
- });
154
- export const PAGE_NOT_FOUND = defineError({
155
- slug: "page-not-found",
156
- category: "RUNTIME",
157
- status: 404,
158
- title: "Page component not found",
159
- suggestion: "Check that the page file exists in the routes directory",
160
- });
161
- export const API_ERROR = defineError({
162
- slug: "api-error",
163
- category: "RUNTIME",
164
- status: 500,
165
- title: "API route handler error",
166
- suggestion: "Review API route handler for errors",
167
- });
168
- export const MIDDLEWARE_ERROR = defineError({
169
- slug: "middleware-error",
170
- category: "RUNTIME",
171
- status: 500,
172
- title: "Middleware execution error",
173
- suggestion: "Check middleware function for errors",
174
- });
175
- // =============================================================================
176
- // ROUTE - Route definition & resolution errors
177
- // =============================================================================
178
- export const ROUTE_CONFLICT = defineError({
179
- slug: "route-conflict",
180
- category: "ROUTE",
181
- status: 409,
182
- title: "Conflicting route definitions",
183
- suggestion: "Rename or reorganize conflicting route files",
184
- });
185
- export const INVALID_ROUTE_FILE = defineError({
186
- slug: "invalid-route-file",
187
- category: "ROUTE",
188
- status: 400,
189
- title: "Invalid route file structure",
190
- suggestion: "Ensure route file exports required functions",
191
- });
192
- export const ROUTE_HANDLER_INVALID = defineError({
193
- slug: "route-handler-invalid",
194
- category: "ROUTE",
195
- status: 400,
196
- title: "Invalid route handler export",
197
- suggestion: "Export a valid handler function from the route file",
198
- });
199
- export const DYNAMIC_ROUTE_ERROR = defineError({
200
- slug: "dynamic-route-error",
201
- category: "ROUTE",
202
- status: 500,
203
- title: "Dynamic route parsing failed",
204
- suggestion: "Check dynamic route segment syntax",
205
- });
206
- export const ROUTE_PARAMS_ERROR = defineError({
207
- slug: "route-params-error",
208
- category: "ROUTE",
209
- status: 400,
210
- title: "Route parameters invalid",
211
- suggestion: "Validate route parameter values",
212
- });
213
- export const API_ROUTE_ERROR = defineError({
214
- slug: "api-route-error",
215
- category: "ROUTE",
216
- status: 500,
217
- title: "API route definition error",
218
- suggestion: "Review API route configuration",
219
- });
220
- // =============================================================================
221
- // MODULE - Module & import resolution errors
222
- // =============================================================================
223
- export const MODULE_NOT_FOUND = defineError({
224
- slug: "module-not-found",
225
- category: "MODULE",
226
- status: 404,
227
- title: "Module could not be resolved",
228
- suggestion: "Check the import path and ensure the module is installed",
229
- });
230
- export const IMPORT_RESOLUTION_ERROR = defineError({
231
- slug: "import-resolution-error",
232
- category: "MODULE",
233
- status: 500,
234
- title: "Import path resolution failed",
235
- suggestion: "Verify import paths and module configuration",
236
- });
237
- export const CIRCULAR_DEPENDENCY = defineError({
238
- slug: "circular-dependency",
239
- category: "MODULE",
240
- status: 500,
241
- title: "Circular dependency detected",
242
- suggestion: "Refactor imports to break the circular dependency",
243
- });
244
- export const INVALID_IMPORT = defineError({
245
- slug: "invalid-import",
246
- category: "MODULE",
247
- status: 400,
248
- title: "Invalid import statement",
249
- suggestion: "Fix import syntax or path",
250
- });
251
- export const DEPENDENCY_MISSING = defineError({
252
- slug: "dependency-missing",
253
- category: "MODULE",
254
- status: 404,
255
- title: "Required dependency not installed",
256
- suggestion: "Install the missing dependency with your package manager",
257
- });
258
- export const VERSION_MISMATCH = defineError({
259
- slug: "version-mismatch",
260
- category: "MODULE",
261
- status: 409,
262
- title: "Dependency version mismatch",
263
- suggestion: "Update dependencies to compatible versions",
264
- });
265
- // =============================================================================
266
- // SERVER - Server, infrastructure & network errors
267
- // =============================================================================
268
- export const PORT_IN_USE = defineError({
269
- slug: "port-in-use",
270
- category: "SERVER",
271
- status: 409,
272
- title: "Server port already in use",
273
- suggestion: "Use a different port or stop the process using this port",
274
- });
275
- export const SERVER_START_ERROR = defineError({
276
- slug: "server-start-error",
277
- category: "SERVER",
278
- status: 500,
279
- title: "Server failed to start",
280
- suggestion: "Check server configuration and port availability",
281
- });
282
- export const CACHE_ERROR = defineError({
283
- slug: "cache-error",
284
- category: "SERVER",
285
- status: 500,
286
- title: "Cache operation failed",
287
- suggestion: "Clear the cache and try again",
288
- });
289
- export const FILE_WATCH_ERROR = defineError({
290
- slug: "file-watch-error",
291
- category: "SERVER",
292
- status: 500,
293
- title: "File watcher error",
294
- suggestion: "Restart the development server",
295
- });
296
- export const REQUEST_ERROR = defineError({
297
- slug: "request-error",
298
- category: "SERVER",
299
- status: 500,
300
- title: "HTTP request handling error",
301
- suggestion: "Check request handler and middleware",
302
- });
303
- export const SERVICE_OVERLOADED = defineError({
304
- slug: "service-overloaded",
305
- category: "SERVER",
306
- status: 503,
307
- title: "Service overloaded",
308
- suggestion: "Reduce load or scale up resources",
309
- });
310
- export const SEMAPHORE_TIMEOUT = defineError({
311
- slug: "semaphore-timeout",
312
- category: "SERVER",
313
- status: 503,
314
- title: "Semaphore acquire timeout",
315
- suggestion: "Reduce concurrency or increase the semaphore acquire timeout",
316
- });
317
- export const CIRCUIT_BREAKER_OPEN = defineError({
318
- slug: "circuit-breaker-open",
319
- category: "SERVER",
320
- status: 503,
321
- title: "Circuit breaker is open",
322
- suggestion: "Wait for the breaker reset timeout before retrying",
323
- });
324
- export const CACHE_PATH_MISMATCH = defineError({
325
- slug: "cache-path-mismatch",
326
- category: "SERVER",
327
- status: 500,
328
- title: "Cache path mismatch",
329
- suggestion: "Clear the cache directory and rebuild",
330
- });
331
- export const NETWORK_ERROR = defineError({
332
- slug: "network-error",
333
- category: "SERVER",
334
- status: 502,
335
- title: "Network operation failed",
336
- suggestion: "Check network connectivity and retry",
337
- });
338
- /** API client request/response errors (replaces VeryfrontAPIError) */
339
- export const API_CLIENT_ERROR = defineError({
340
- slug: "api-client-error",
341
- category: "SERVER",
342
- status: 500,
343
- title: "API client request failed",
344
- suggestion: "Check API connectivity and authentication",
345
- });
346
- /** Token storage adapter failures (replaces TokenStorageError) */
347
- export const TOKEN_STORAGE_ERROR = defineError({
348
- slug: "token-storage-error",
349
- category: "SERVER",
350
- status: 500,
351
- title: "Token storage operation failed",
352
- suggestion: "Check token storage backend and credentials",
353
- });
354
- /** Cache path invariant violations (replaces CacheInvariantError) */
355
- export const CACHE_INVARIANT_VIOLATION = defineError({
356
- slug: "cache-invariant-violation",
357
- category: "SERVER",
358
- status: 500,
359
- title: "Cache path invariant violated",
360
- suggestion: "Clear the cache and rebuild",
361
- });
362
- /** Production domain resolved but no active release found */
363
- export const RELEASE_NOT_FOUND = defineError({
364
- slug: "release-not-found",
365
- category: "SERVER",
366
- status: 404,
367
- title: "No active release found",
368
- suggestion: "Deploy the project to create a release for this environment",
369
- });
370
- /** Both primary and fallback operations failed (replaces FallbackExecutionError) */
371
- export const FALLBACK_EXHAUSTED = defineError({
372
- slug: "fallback-exhausted",
373
- category: "SERVER",
374
- status: 500,
375
- title: "Primary and fallback operations both failed",
376
- suggestion: "Check service availability and connectivity",
377
- });
378
- // =============================================================================
379
- // BOUNDARY - RSC/client boundary violations
380
- // =============================================================================
381
- export const CLIENT_BOUNDARY_VIOLATION = defineError({
382
- slug: "client-boundary-violation",
383
- category: "BOUNDARY",
384
- status: 400,
385
- title: "Client boundary rule violation",
386
- suggestion: "Add 'use client' directive or move code to a client component",
387
- });
388
- export const SERVER_ONLY_IN_CLIENT = defineError({
389
- slug: "server-only-in-client",
390
- category: "BOUNDARY",
391
- status: 400,
392
- title: "Server-only code in client component",
393
- suggestion: "Move server-only code to a server component",
394
- });
395
- export const CLIENT_ONLY_IN_SERVER = defineError({
396
- slug: "client-only-in-server",
397
- category: "BOUNDARY",
398
- status: 400,
399
- title: "Client-only code in server component",
400
- suggestion: "Move client-only code to a client component",
401
- });
402
- export const INVALID_USE_CLIENT = defineError({
403
- slug: "invalid-use-client",
404
- category: "BOUNDARY",
405
- status: 400,
406
- title: "Invalid 'use client' directive",
407
- suggestion: "Place 'use client' at the top of the file",
408
- });
409
- export const INVALID_USE_SERVER = defineError({
410
- slug: "invalid-use-server",
411
- category: "BOUNDARY",
412
- status: 400,
413
- title: "Invalid 'use server' directive",
414
- suggestion: "Place 'use server' at the top of the file or function",
415
- });
416
- export const RSC_PAYLOAD_ERROR = defineError({
417
- slug: "rsc-payload-error",
418
- category: "BOUNDARY",
419
- status: 500,
420
- title: "RSC payload serialization error",
421
- suggestion: "Ensure props are serializable (no functions, symbols, etc.)",
422
- });
423
- // =============================================================================
424
- // DEV - Development-only tooling errors
425
- // =============================================================================
426
- export const HMR_ERROR = defineError({
427
- slug: "hmr-error",
428
- category: "DEV",
429
- status: 500,
430
- title: "Hot module replacement error",
431
- suggestion: "Restart the development server",
432
- });
433
- export const DEV_SERVER_ERROR = defineError({
434
- slug: "dev-server-error",
435
- category: "DEV",
436
- status: 500,
437
- title: "Development server error",
438
- suggestion: "Check the dev server logs and restart",
439
- });
440
- export const FAST_REFRESH_ERROR = defineError({
441
- slug: "fast-refresh-error",
442
- category: "DEV",
443
- status: 500,
444
- title: "Fast refresh failed",
445
- suggestion: "Save the file again or restart the dev server",
446
- });
447
- export const ERROR_OVERLAY_ERROR = defineError({
448
- slug: "error-overlay-error",
449
- category: "DEV",
450
- status: 500,
451
- title: "Error overlay failed",
452
- suggestion: "Check browser console for details",
453
- });
454
- export const SOURCE_MAP_ERROR = defineError({
455
- slug: "source-map-error",
456
- category: "DEV",
457
- status: 500,
458
- title: "Source map loading error",
459
- suggestion: "Rebuild or clear cache",
460
- });
461
- // =============================================================================
462
- // DEPLOY - Deployment & release errors
463
- // =============================================================================
464
- export const DEPLOYMENT_ERROR = defineError({
465
- slug: "deployment-error",
466
- category: "DEPLOY",
467
- status: 500,
468
- title: "Deployment process failed",
469
- suggestion: "Check deployment logs for details",
470
- });
471
- export const PLATFORM_ERROR = defineError({
472
- slug: "platform-error",
473
- category: "DEPLOY",
474
- status: 500,
475
- title: "Platform-specific error",
476
- suggestion: "Check platform documentation and requirements",
477
- });
478
- export const ENV_VAR_MISSING = defineError({
479
- slug: "env-var-missing",
480
- category: "DEPLOY",
481
- status: 500,
482
- title: "Required environment variable missing",
483
- suggestion: "Set the required environment variable",
484
- });
485
- export const PRODUCTION_BUILD_REQUIRED = defineError({
486
- slug: "production-build-required",
487
- category: "DEPLOY",
488
- status: 400,
489
- title: "Production build required",
490
- suggestion: "Run 'vf build' before deploying",
491
- });
492
- // =============================================================================
493
- // AGENT - AI agent & orchestration errors
494
- // =============================================================================
495
- export const AGENT_ERROR = defineError({
496
- slug: "agent-error",
497
- category: "AGENT",
498
- status: 500,
499
- title: "Agent operation error",
500
- suggestion: "Check agent configuration and logs",
501
- });
502
- export const AGENT_NOT_FOUND = defineError({
503
- slug: "agent-not-found",
504
- category: "AGENT",
505
- status: 404,
506
- title: "Agent not found",
507
- suggestion: "Verify the agent ID exists",
508
- });
509
- export const AGENT_TIMEOUT = defineError({
510
- slug: "agent-timeout",
511
- category: "AGENT",
512
- status: 408,
513
- title: "Agent operation timed out",
514
- suggestion: "Increase timeout or simplify the request",
515
- });
516
- export const AGENT_INTENT_ERROR = defineError({
517
- slug: "agent-intent-error",
518
- category: "AGENT",
519
- status: 400,
520
- title: "Agent intent parsing error",
521
- suggestion: "Rephrase the request more clearly",
522
- });
523
- export const ORCHESTRATION_ERROR = defineError({
524
- slug: "orchestration-error",
525
- category: "AGENT",
526
- status: 500,
527
- title: "Multi-agent orchestration error",
528
- suggestion: "Check agent coordination logic",
529
- });
530
- export const COST_LIMIT_EXCEEDED = defineError({
531
- slug: "cost-limit-exceeded",
532
- category: "AGENT",
533
- status: 429,
534
- title: "Cost limit exceeded",
535
- suggestion: "Wait for the budget period to reset or increase the limit",
536
- });
537
- // =============================================================================
538
- // GENERAL - Cross-cutting errors
539
- // =============================================================================
540
- export const UNKNOWN_ERROR = defineError({
541
- slug: "unknown-error",
542
- category: "GENERAL",
543
- status: 500,
544
- title: "Unknown/unclassified error",
545
- suggestion: "Check logs for more details",
546
- });
547
- export const PERMISSION_DENIED = defineError({
548
- slug: "permission-denied",
549
- category: "GENERAL",
550
- status: 403,
551
- title: "File/resource permission denied",
552
- suggestion: "Check file permissions and access rights",
553
- });
554
- export const FILE_NOT_FOUND = defineError({
555
- slug: "file-not-found",
556
- category: "GENERAL",
557
- status: 404,
558
- title: "File not found",
559
- suggestion: "Verify the file path exists",
560
- });
561
- export const RESOURCE_NOT_FOUND = defineError({
562
- slug: "resource-not-found",
563
- category: "GENERAL",
564
- status: 404,
565
- title: "Requested resource not found",
566
- suggestion: "Verify the referenced resource ID or name exists",
567
- });
568
- export const INVALID_ARGUMENT = defineError({
569
- slug: "invalid-argument",
570
- category: "GENERAL",
571
- status: 400,
572
- title: "Invalid function argument",
573
- suggestion: "Check argument types and values",
574
- });
575
- export const TIMEOUT_ERROR = defineError({
576
- slug: "timeout-error",
577
- category: "GENERAL",
578
- status: 408,
579
- title: "Operation timed out",
580
- suggestion: "Increase timeout or optimize the operation",
581
- });
582
- export const INITIALIZATION_ERROR = defineError({
583
- slug: "initialization-error",
584
- category: "GENERAL",
585
- status: 500,
586
- title: "Initialization failed",
587
- suggestion: "Check initialization requirements and dependencies",
588
- });
589
- export const NOT_SUPPORTED = defineError({
590
- slug: "not-supported",
591
- category: "GENERAL",
592
- status: 501,
593
- title: "Feature not supported",
594
- suggestion: "Check documentation for supported features",
595
- });
596
- /** Path traversal / secure-fs violations (replaces SecurityError) */
597
- export const SECURITY_VIOLATION = defineError({
598
- slug: "security-violation",
599
- category: "GENERAL",
600
- status: 403,
601
- title: "Security violation detected",
602
- suggestion: "Check for path traversal or unauthorized access attempts",
603
- });
604
- /** HTTP request input validation failures (replaces ValidationError) */
605
- export const INPUT_VALIDATION_FAILED = defineError({
606
- slug: "input-validation-failed",
607
- category: "GENERAL",
608
- status: 400,
609
- title: "Input validation failed",
610
- suggestion: "Check request input against validation rules",
611
- });
612
- // =============================================================================
613
- // Registry exports
614
- // =============================================================================
2
+ // Error definitions live in per-category modules under ./error-registry/.
3
+ // This barrel re-exports them and assembles the slug → definition registry.
4
+ import { CONFIG_REGISTRY } from "./error-registry/config.js";
5
+ import { BUILD_REGISTRY } from "./error-registry/build.js";
6
+ import { RUNTIME_REGISTRY } from "./error-registry/runtime.js";
7
+ import { ROUTE_REGISTRY } from "./error-registry/route.js";
8
+ import { MODULE_REGISTRY } from "./error-registry/module.js";
9
+ import { SERVER_REGISTRY } from "./error-registry/server.js";
10
+ import { BOUNDARY_REGISTRY } from "./error-registry/boundary.js";
11
+ import { DEV_REGISTRY } from "./error-registry/dev.js";
12
+ import { DEPLOY_REGISTRY } from "./error-registry/deploy.js";
13
+ import { AGENT_REGISTRY } from "./error-registry/agent.js";
14
+ import { GENERAL_REGISTRY } from "./error-registry/general.js";
15
+ export * from "./error-registry/config.js";
16
+ export * from "./error-registry/build.js";
17
+ export * from "./error-registry/runtime.js";
18
+ export * from "./error-registry/route.js";
19
+ export * from "./error-registry/module.js";
20
+ export * from "./error-registry/server.js";
21
+ export * from "./error-registry/boundary.js";
22
+ export * from "./error-registry/dev.js";
23
+ export * from "./error-registry/deploy.js";
24
+ export * from "./error-registry/agent.js";
25
+ export * from "./error-registry/general.js";
615
26
  /**
616
- * All registered errors for lookup by slug
27
+ * Central registry mapping every error slug to its definition. Assembled from
28
+ * the per-category registry fragments.
617
29
  */
618
30
  export const ERROR_REGISTRY = {
619
- // CONFIG
620
- "config-not-found": CONFIG_NOT_FOUND,
621
- "config-invalid": CONFIG_INVALID,
622
- "config-parse-error": CONFIG_PARSE_ERROR,
623
- "config-validation-error": CONFIG_VALIDATION_ERROR,
624
- "config-type-error": CONFIG_TYPE_ERROR,
625
- "import-map-invalid": IMPORT_MAP_INVALID,
626
- "cors-config-invalid": CORS_CONFIG_INVALID,
627
- "config-validation-failed": CONFIG_VALIDATION_FAILED,
628
- // BUILD
629
- "build-failed": BUILD_FAILED,
630
- "bundle-error": BUNDLE_ERROR,
631
- "typescript-error": TYPESCRIPT_ERROR,
632
- "mdx-compile-error": MDX_COMPILE_ERROR,
633
- "asset-optimization-error": ASSET_OPTIMIZATION_ERROR,
634
- "ssg-generation-error": SSG_GENERATION_ERROR,
635
- "sourcemap-error": SOURCEMAP_ERROR,
636
- "compilation-error": COMPILATION_ERROR,
637
- // RUNTIME
638
- "hydration-mismatch": HYDRATION_MISMATCH,
639
- "render-error": RENDER_ERROR,
640
- "component-error": COMPONENT_ERROR,
641
- "layout-not-found": LAYOUT_NOT_FOUND,
642
- "page-not-found": PAGE_NOT_FOUND,
643
- "api-error": API_ERROR,
644
- "middleware-error": MIDDLEWARE_ERROR,
645
- // ROUTE
646
- "route-conflict": ROUTE_CONFLICT,
647
- "invalid-route-file": INVALID_ROUTE_FILE,
648
- "route-handler-invalid": ROUTE_HANDLER_INVALID,
649
- "dynamic-route-error": DYNAMIC_ROUTE_ERROR,
650
- "route-params-error": ROUTE_PARAMS_ERROR,
651
- "api-route-error": API_ROUTE_ERROR,
652
- // MODULE
653
- "module-not-found": MODULE_NOT_FOUND,
654
- "import-resolution-error": IMPORT_RESOLUTION_ERROR,
655
- "circular-dependency": CIRCULAR_DEPENDENCY,
656
- "invalid-import": INVALID_IMPORT,
657
- "dependency-missing": DEPENDENCY_MISSING,
658
- "version-mismatch": VERSION_MISMATCH,
659
- // SERVER
660
- "port-in-use": PORT_IN_USE,
661
- "server-start-error": SERVER_START_ERROR,
662
- "cache-error": CACHE_ERROR,
663
- "file-watch-error": FILE_WATCH_ERROR,
664
- "request-error": REQUEST_ERROR,
665
- "service-overloaded": SERVICE_OVERLOADED,
666
- "semaphore-timeout": SEMAPHORE_TIMEOUT,
667
- "circuit-breaker-open": CIRCUIT_BREAKER_OPEN,
668
- "cache-path-mismatch": CACHE_PATH_MISMATCH,
669
- "network-error": NETWORK_ERROR,
670
- "api-client-error": API_CLIENT_ERROR,
671
- "token-storage-error": TOKEN_STORAGE_ERROR,
672
- "cache-invariant-violation": CACHE_INVARIANT_VIOLATION,
673
- "release-not-found": RELEASE_NOT_FOUND,
674
- "fallback-exhausted": FALLBACK_EXHAUSTED,
675
- // BOUNDARY
676
- "client-boundary-violation": CLIENT_BOUNDARY_VIOLATION,
677
- "server-only-in-client": SERVER_ONLY_IN_CLIENT,
678
- "client-only-in-server": CLIENT_ONLY_IN_SERVER,
679
- "invalid-use-client": INVALID_USE_CLIENT,
680
- "invalid-use-server": INVALID_USE_SERVER,
681
- "rsc-payload-error": RSC_PAYLOAD_ERROR,
682
- // DEV
683
- "hmr-error": HMR_ERROR,
684
- "dev-server-error": DEV_SERVER_ERROR,
685
- "fast-refresh-error": FAST_REFRESH_ERROR,
686
- "error-overlay-error": ERROR_OVERLAY_ERROR,
687
- "source-map-error": SOURCE_MAP_ERROR,
688
- // DEPLOY
689
- "deployment-error": DEPLOYMENT_ERROR,
690
- "platform-error": PLATFORM_ERROR,
691
- "env-var-missing": ENV_VAR_MISSING,
692
- "production-build-required": PRODUCTION_BUILD_REQUIRED,
693
- // AGENT
694
- "agent-error": AGENT_ERROR,
695
- "agent-not-found": AGENT_NOT_FOUND,
696
- "agent-timeout": AGENT_TIMEOUT,
697
- "agent-intent-error": AGENT_INTENT_ERROR,
698
- "orchestration-error": ORCHESTRATION_ERROR,
699
- "cost-limit-exceeded": COST_LIMIT_EXCEEDED,
700
- // GENERAL
701
- "unknown-error": UNKNOWN_ERROR,
702
- "permission-denied": PERMISSION_DENIED,
703
- "file-not-found": FILE_NOT_FOUND,
704
- "resource-not-found": RESOURCE_NOT_FOUND,
705
- "invalid-argument": INVALID_ARGUMENT,
706
- "timeout-error": TIMEOUT_ERROR,
707
- "initialization-error": INITIALIZATION_ERROR,
708
- "not-supported": NOT_SUPPORTED,
709
- "security-violation": SECURITY_VIOLATION,
710
- "input-validation-failed": INPUT_VALIDATION_FAILED,
31
+ ...CONFIG_REGISTRY,
32
+ ...BUILD_REGISTRY,
33
+ ...RUNTIME_REGISTRY,
34
+ ...ROUTE_REGISTRY,
35
+ ...MODULE_REGISTRY,
36
+ ...SERVER_REGISTRY,
37
+ ...BOUNDARY_REGISTRY,
38
+ ...DEV_REGISTRY,
39
+ ...DEPLOY_REGISTRY,
40
+ ...AGENT_REGISTRY,
41
+ ...GENERAL_REGISTRY,
711
42
  };
712
43
  /**
713
44
  * Get an error definition by slug