devflare 1.0.0-next.1 → 1.0.0-next.10

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 (123) hide show
  1. package/LLM.md +775 -637
  2. package/R2.md +200 -0
  3. package/README.md +285 -514
  4. package/bin/devflare.js +8 -8
  5. package/dist/{account-rvrj687w.js → account-8psavtg6.js} +27 -4
  6. package/dist/bridge/miniflare.d.ts +6 -0
  7. package/dist/bridge/miniflare.d.ts.map +1 -1
  8. package/dist/bridge/proxy.d.ts +5 -6
  9. package/dist/bridge/proxy.d.ts.map +1 -1
  10. package/dist/bridge/server.d.ts.map +1 -1
  11. package/dist/browser.d.ts +50 -0
  12. package/dist/browser.d.ts.map +1 -0
  13. package/dist/{build-mnf6v8gd.js → build-k36xrzvy.js} +26 -7
  14. package/dist/bundler/do-bundler.d.ts +7 -0
  15. package/dist/bundler/do-bundler.d.ts.map +1 -1
  16. package/dist/cli/commands/account.d.ts.map +1 -1
  17. package/dist/cli/commands/build.d.ts.map +1 -1
  18. package/dist/cli/commands/deploy.d.ts.map +1 -1
  19. package/dist/cli/commands/dev.d.ts.map +1 -1
  20. package/dist/cli/commands/doctor.d.ts.map +1 -1
  21. package/dist/cli/commands/init.d.ts.map +1 -1
  22. package/dist/cli/commands/types.d.ts.map +1 -1
  23. package/dist/cli/config-path.d.ts +5 -0
  24. package/dist/cli/config-path.d.ts.map +1 -0
  25. package/dist/cli/index.d.ts.map +1 -1
  26. package/dist/cli/package-metadata.d.ts +16 -0
  27. package/dist/cli/package-metadata.d.ts.map +1 -0
  28. package/dist/config/compiler.d.ts +7 -0
  29. package/dist/config/compiler.d.ts.map +1 -1
  30. package/dist/config/index.d.ts +1 -1
  31. package/dist/config/index.d.ts.map +1 -1
  32. package/dist/config/schema.d.ts +2575 -1221
  33. package/dist/config/schema.d.ts.map +1 -1
  34. package/dist/{deploy-nhceck39.js → deploy-dbvfq8vq.js} +33 -15
  35. package/dist/{dev-qnxet3j9.js → dev-rk8p6pse.js} +900 -234
  36. package/dist/dev-server/miniflare-log.d.ts +12 -0
  37. package/dist/dev-server/miniflare-log.d.ts.map +1 -0
  38. package/dist/dev-server/runtime-stdio.d.ts +8 -0
  39. package/dist/dev-server/runtime-stdio.d.ts.map +1 -0
  40. package/dist/dev-server/server.d.ts +2 -0
  41. package/dist/dev-server/server.d.ts.map +1 -1
  42. package/dist/dev-server/vite-utils.d.ts +37 -0
  43. package/dist/dev-server/vite-utils.d.ts.map +1 -0
  44. package/dist/{doctor-e8fy6fj5.js → doctor-06y8nxd4.js} +73 -50
  45. package/dist/{durable-object-t4kbb0yt.js → durable-object-yt8v1dyn.js} +1 -1
  46. package/dist/index-05fyzwne.js +195 -0
  47. package/dist/index-1p814k7s.js +227 -0
  48. package/dist/{index-hcex3rgh.js → index-1phx14av.js} +84 -7
  49. package/dist/{index-tk6ej9dj.js → index-2q3pmzrx.js} +12 -16
  50. package/dist/{index-pf5s73n9.js → index-59df49vn.js} +11 -281
  51. package/dist/index-5yxg30va.js +304 -0
  52. package/dist/index-62b3gt2g.js +12 -0
  53. package/dist/index-6h8xbs75.js +44 -0
  54. package/dist/{index-67qcae0f.js → index-6v3wjg1r.js} +16 -1
  55. package/dist/index-8gtqgb3q.js +529 -0
  56. package/dist/{index-gz1gndna.js → index-9wt9x09k.js} +42 -62
  57. package/dist/index-fef08w43.js +231 -0
  58. package/dist/{index-ep3445yc.js → index-jht2j546.js} +393 -170
  59. package/dist/index-k7r18na8.js +0 -0
  60. package/dist/{index-m2q41jwa.js → index-n932ytmq.js} +9 -1
  61. package/dist/index-pwgyy2q9.js +39 -0
  62. package/dist/{index-07q6yxyc.js → index-v8vvsn9x.js} +1 -0
  63. package/dist/index-vky23txa.js +70 -0
  64. package/dist/index-vs49yxn4.js +322 -0
  65. package/dist/{index-z14anrqp.js → index-wfbfz02q.js} +14 -15
  66. package/dist/index-ws68xvq2.js +311 -0
  67. package/dist/index-y1d8za14.js +196 -0
  68. package/dist/{init-f9mgmew3.js → init-na2atvz2.js} +42 -55
  69. package/dist/router/types.d.ts +24 -0
  70. package/dist/router/types.d.ts.map +1 -0
  71. package/dist/runtime/context.d.ts +249 -8
  72. package/dist/runtime/context.d.ts.map +1 -1
  73. package/dist/runtime/exports.d.ts +50 -55
  74. package/dist/runtime/exports.d.ts.map +1 -1
  75. package/dist/runtime/index.d.ts +8 -1
  76. package/dist/runtime/index.d.ts.map +1 -1
  77. package/dist/runtime/middleware.d.ts +77 -60
  78. package/dist/runtime/middleware.d.ts.map +1 -1
  79. package/dist/runtime/router.d.ts +7 -0
  80. package/dist/runtime/router.d.ts.map +1 -0
  81. package/dist/runtime/validation.d.ts +1 -1
  82. package/dist/runtime/validation.d.ts.map +1 -1
  83. package/dist/src/browser.js +150 -0
  84. package/dist/src/cli/index.js +10 -0
  85. package/dist/{cloudflare → src/cloudflare}/index.js +3 -3
  86. package/dist/{decorators → src/decorators}/index.js +2 -2
  87. package/dist/src/index.js +132 -0
  88. package/dist/src/runtime/index.js +111 -0
  89. package/dist/{sveltekit → src/sveltekit}/index.js +14 -6
  90. package/dist/{test → src/test}/index.js +22 -13
  91. package/dist/{vite → src/vite}/index.js +128 -59
  92. package/dist/sveltekit/platform.d.ts.map +1 -1
  93. package/dist/test/bridge-context.d.ts +5 -2
  94. package/dist/test/bridge-context.d.ts.map +1 -1
  95. package/dist/test/cf.d.ts +25 -11
  96. package/dist/test/cf.d.ts.map +1 -1
  97. package/dist/test/email.d.ts +16 -7
  98. package/dist/test/email.d.ts.map +1 -1
  99. package/dist/test/queue.d.ts.map +1 -1
  100. package/dist/test/resolve-service-bindings.d.ts.map +1 -1
  101. package/dist/test/scheduled.d.ts.map +1 -1
  102. package/dist/test/simple-context.d.ts +1 -1
  103. package/dist/test/simple-context.d.ts.map +1 -1
  104. package/dist/test/tail.d.ts +2 -1
  105. package/dist/test/tail.d.ts.map +1 -1
  106. package/dist/test/worker.d.ts +6 -0
  107. package/dist/test/worker.d.ts.map +1 -1
  108. package/dist/transform/durable-object.d.ts.map +1 -1
  109. package/dist/transform/worker-entrypoint.d.ts.map +1 -1
  110. package/dist/{types-5nyrz1sz.js → types-x9q7t491.js} +30 -16
  111. package/dist/utils/entrypoint-discovery.d.ts +6 -3
  112. package/dist/utils/entrypoint-discovery.d.ts.map +1 -1
  113. package/dist/utils/send-email.d.ts +15 -0
  114. package/dist/utils/send-email.d.ts.map +1 -0
  115. package/dist/vite/plugin.d.ts.map +1 -1
  116. package/dist/worker-entry/composed-worker.d.ts +13 -0
  117. package/dist/worker-entry/composed-worker.d.ts.map +1 -0
  118. package/dist/worker-entry/routes.d.ts +22 -0
  119. package/dist/worker-entry/routes.d.ts.map +1 -0
  120. package/dist/{worker-entrypoint-m9th0rg0.js → worker-entrypoint-c259fmfs.js} +1 -1
  121. package/package.json +21 -19
  122. package/dist/index.js +0 -298
  123. package/dist/runtime/index.js +0 -111
@@ -1,3 +1,4 @@
1
+ import type { OutputOptions, RolldownOptions } from 'rolldown';
1
2
  import { z } from 'zod';
2
3
  /**
3
4
  * Durable Object binding input type.
@@ -272,36 +273,95 @@ declare const assetsConfigSchema: z.ZodOptional<z.ZodObject<{
272
273
  directory: string;
273
274
  binding?: string | undefined;
274
275
  }>>;
276
+ export type DevflareRolldownOutputOptions = Omit<OutputOptions, 'codeSplitting' | 'dir' | 'file' | 'format' | 'inlineDynamicImports'>;
277
+ export interface DevflareRolldownOptions extends Omit<RolldownOptions, 'cwd' | 'input' | 'output' | 'platform' | 'watch'> {
278
+ output?: DevflareRolldownOutputOptions;
279
+ }
275
280
  /**
276
- * Build configuration for worker bundling.
277
- * Controls esbuild/rolldown options for worker compilation.
281
+ * Rolldown configuration for Durable Object bundling.
282
+ * Controls Devflare's Rolldown-based DO bundler in local development.
278
283
  */
279
- declare const buildConfigSchema: z.ZodOptional<z.ZodObject<{
284
+ declare const rolldownConfigSchema: z.ZodOptional<z.ZodObject<{
280
285
  /**
281
- * Build target environment.
286
+ * Bundle target environment.
282
287
  * @example 'es2022'
283
288
  */
284
289
  target: z.ZodOptional<z.ZodString>;
285
- /** Enable minification for smaller bundle size */
290
+ /** Enable minification for emitted DO bundles */
286
291
  minify: z.ZodOptional<z.ZodBoolean>;
287
- /** Generate source maps for debugging */
292
+ /** Generate source maps for emitted DO bundles */
288
293
  sourcemap: z.ZodOptional<z.ZodBoolean>;
289
294
  /**
290
- * Additional Rolldown bundler options.
295
+ * Additional raw Rolldown options.
291
296
  * @see https://rolldown.rs/
292
297
  */
293
- rolldownOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
298
+ options: z.ZodOptional<z.ZodType<DevflareRolldownOptions, z.ZodTypeDef, DevflareRolldownOptions>>;
299
+ }, "strip", z.ZodTypeAny, {
300
+ target?: string | undefined;
301
+ minify?: boolean | undefined;
302
+ sourcemap?: boolean | undefined;
303
+ options?: DevflareRolldownOptions | undefined;
304
+ }, {
305
+ target?: string | undefined;
306
+ minify?: boolean | undefined;
307
+ sourcemap?: boolean | undefined;
308
+ options?: DevflareRolldownOptions | undefined;
309
+ }>>;
310
+ /**
311
+ * Vite-related configuration namespace.
312
+ * This keeps Vite-specific configuration distinct from Rolldown/DO bundling.
313
+ *
314
+ * Note: raw Vite build/server configuration still belongs in `vite.config.*`.
315
+ * Devflare currently models `plugins` here and leaves room for future Vite-side
316
+ * config without overloading the root config shape.
317
+ */
318
+ declare const viteConfigSchema: z.ZodOptional<z.ZodObject<{
319
+ /**
320
+ * Devflare-level Vite plugin metadata sourced from devflare.config.ts.
321
+ * Raw Vite plugin wiring still belongs in `vite.config.*`.
322
+ */
323
+ plugins: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
324
+ }, "strip", z.ZodUnknown, z.objectOutputType<{
325
+ /**
326
+ * Devflare-level Vite plugin metadata sourced from devflare.config.ts.
327
+ * Raw Vite plugin wiring still belongs in `vite.config.*`.
328
+ */
329
+ plugins: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
330
+ }, z.ZodUnknown, "strip">, z.objectInputType<{
331
+ /**
332
+ * Devflare-level Vite plugin metadata sourced from devflare.config.ts.
333
+ * Raw Vite plugin wiring still belongs in `vite.config.*`.
334
+ */
335
+ plugins: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
336
+ }, z.ZodUnknown, "strip">>>;
337
+ /**
338
+ * Legacy build alias for backward compatibility.
339
+ * Prefer top-level `rolldown` in new configs.
340
+ */
341
+ declare const buildConfigSchema: z.ZodOptional<z.ZodObject<{
342
+ /**
343
+ * Legacy alias for `rolldown.target`.
344
+ * @example 'es2022'
345
+ */
346
+ target: z.ZodOptional<z.ZodString>;
347
+ /** Legacy alias for `rolldown.minify`. */
348
+ minify: z.ZodOptional<z.ZodBoolean>;
349
+ /** Legacy alias for `rolldown.sourcemap`. */
350
+ sourcemap: z.ZodOptional<z.ZodBoolean>;
351
+ /** Legacy alias for `rolldown.options`. */
352
+ rolldownOptions: z.ZodOptional<z.ZodType<DevflareRolldownOptions, z.ZodTypeDef, DevflareRolldownOptions>>;
294
353
  }, "strip", z.ZodTypeAny, {
295
354
  target?: string | undefined;
296
355
  minify?: boolean | undefined;
297
356
  sourcemap?: boolean | undefined;
298
- rolldownOptions?: Record<string, unknown> | undefined;
357
+ rolldownOptions?: DevflareRolldownOptions | undefined;
299
358
  }, {
300
359
  target?: string | undefined;
301
360
  minify?: boolean | undefined;
302
361
  sourcemap?: boolean | undefined;
303
- rolldownOptions?: Record<string, unknown> | undefined;
362
+ rolldownOptions?: DevflareRolldownOptions | undefined;
304
363
  }>>;
364
+ type LegacyBuildConfig = z.infer<typeof buildConfigSchema>;
305
365
  /**
306
366
  * Durable Object migration configuration.
307
367
  * Required when changing DO class names or storage backends.
@@ -362,25 +422,7 @@ declare const migrationSchema: z.ZodObject<{
362
422
  deleted_classes?: string[] | undefined;
363
423
  new_sqlite_classes?: string[] | undefined;
364
424
  }>;
365
- /**
366
- * Environment-specific configuration overrides.
367
- * Allows different settings per deployment environment (staging, production, etc.).
368
- *
369
- * All fields are optional — only specify what differs from the base config.
370
- *
371
- * @example
372
- * ```ts
373
- * env: {
374
- * production: {
375
- * vars: { LOG_LEVEL: 'error' }
376
- * },
377
- * staging: {
378
- * vars: { LOG_LEVEL: 'debug' }
379
- * }
380
- * }
381
- * ```
382
- */
383
- declare const envConfigSchemaInner: z.ZodObject<{
425
+ declare const envConfigSchemaInner: z.ZodEffects<z.ZodObject<{
384
426
  name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
385
427
  compatibilityDate: z.ZodOptional<z.ZodOptional<z.ZodString>>;
386
428
  compatibilityFlags: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
@@ -467,32 +509,41 @@ declare const envConfigSchemaInner: z.ZodObject<{
467
509
  */
468
510
  workflows: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>>;
469
511
  /**
470
- * File-based routing configuration.
471
- * Enables automatic route discovery from a directory.
512
+ * Built-in file router configuration.
513
+ * Use this to customize or disable the route tree rooted at `src/routes/**`.
472
514
  *
473
- * Directory structure maps to URL paths:
515
+ * When omitted, Devflare automatically discovers `src/routes` if that
516
+ * directory exists.
517
+ *
518
+ * When set:
519
+ * - `dir` changes the route root directory
520
+ * - `prefix` mounts the route tree under a fixed prefix such as `/api`
521
+ * - `false` disables route discovery entirely
522
+ *
523
+ * Route filename conventions:
474
524
  * ```
475
525
  * src/routes/
476
- * ├── index.ts → GET /
526
+ * ├── index.ts
477
527
  * ├── users/
478
- * │ ├── index.ts → GET /users POST /users
479
- * │ ├── [id].ts → GET /users/:id
528
+ * │ ├── index.ts
529
+ * │ ├── [id].ts
530
+ * │ ├── [...slug].ts
480
531
  * │ └── [id]/
481
- * │ └── posts.ts → GET /users/:id/posts
532
+ * │ └── posts.ts
482
533
  * └── api/
483
- * └── health.ts → GET /api/health
534
+ * └── health.ts
484
535
  * ```
485
536
  *
486
- * Each file exports HTTP method handlers:
487
- * ```ts
488
- * export function GET(req: Request, env: Env) { ... }
489
- * export function POST(req: Request, env: Env) { ... }
490
- * ```
537
+ * Files or directories prefixed with `_` are ignored so route-local helpers
538
+ * can live beside handlers.
491
539
  */
492
540
  routes: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
493
541
  /** Directory containing route files (e.g., 'src/routes') */
494
542
  dir: z.ZodString;
495
- /** Optional URL prefix for all routes (e.g., '/api') */
543
+ /**
544
+ * Optional route prefix (e.g., '/api').
545
+ * Devflare mounts the discovered route tree under this static pathname prefix.
546
+ */
496
547
  prefix: z.ZodOptional<z.ZodString>;
497
548
  }, "strip", z.ZodTypeAny, {
498
549
  dir: string;
@@ -503,8 +554,12 @@ declare const envConfigSchemaInner: z.ZodObject<{
503
554
  }>, z.ZodLiteral<false>]>>;
504
555
  /**
505
556
  * Transport file for custom RPC serialization.
506
- * Implements SvelteKit-style encode/decode for complex types.
507
- * @default 'src/transport.ts'
557
+ * Opt-in only: Devflare loads this file only when `files.transport` is
558
+ * explicitly set.
559
+ *
560
+ * Today this is primarily used by the test/bridge serialization path.
561
+ *
562
+ * The file must export a named `transport` object.
508
563
  * @example 'src/transport.ts'
509
564
  */
510
565
  transport: z.ZodOptional<z.ZodString>;
@@ -725,14 +780,31 @@ declare const envConfigSchemaInner: z.ZodObject<{
725
780
  /**
726
781
  * Email sending bindings.
727
782
  * @example { EMAIL: { destinationAddress: 'admin@example.com' } }
783
+ * @example { BULK_EMAIL: { allowedDestinationAddresses: ['ops@example.com'], allowedSenderAddresses: ['noreply@example.com'] } }
728
784
  */
729
- sendEmail: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
730
- /** Default destination address (can be overridden per-send) */
785
+ sendEmail: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodObject<{
786
+ /** Restrict this binding to a specific verified destination address */
731
787
  destinationAddress: z.ZodOptional<z.ZodString>;
788
+ /** Restrict this binding to a set of verified destination addresses */
789
+ allowedDestinationAddresses: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
790
+ /** Restrict this binding to a set of verified sender addresses */
791
+ allowedSenderAddresses: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
732
792
  }, "strip", z.ZodTypeAny, {
733
793
  destinationAddress?: string | undefined;
794
+ allowedDestinationAddresses?: string[] | undefined;
795
+ allowedSenderAddresses?: string[] | undefined;
734
796
  }, {
735
797
  destinationAddress?: string | undefined;
798
+ allowedDestinationAddresses?: string[] | undefined;
799
+ allowedSenderAddresses?: string[] | undefined;
800
+ }>, {
801
+ destinationAddress?: string | undefined;
802
+ allowedDestinationAddresses?: string[] | undefined;
803
+ allowedSenderAddresses?: string[] | undefined;
804
+ }, {
805
+ destinationAddress?: string | undefined;
806
+ allowedDestinationAddresses?: string[] | undefined;
807
+ allowedSenderAddresses?: string[] | undefined;
736
808
  }>>>;
737
809
  }, "strip", z.ZodTypeAny, {
738
810
  kv?: Record<string, string> | undefined;
@@ -778,6 +850,8 @@ declare const envConfigSchemaInner: z.ZodObject<{
778
850
  }> | undefined;
779
851
  sendEmail?: Record<string, {
780
852
  destinationAddress?: string | undefined;
853
+ allowedDestinationAddresses?: string[] | undefined;
854
+ allowedSenderAddresses?: string[] | undefined;
781
855
  }> | undefined;
782
856
  }, {
783
857
  kv?: Record<string, string> | undefined;
@@ -823,6 +897,8 @@ declare const envConfigSchemaInner: z.ZodObject<{
823
897
  }> | undefined;
824
898
  sendEmail?: Record<string, {
825
899
  destinationAddress?: string | undefined;
900
+ allowedDestinationAddresses?: string[] | undefined;
901
+ allowedSenderAddresses?: string[] | undefined;
826
902
  }> | undefined;
827
903
  }>>>;
828
904
  triggers: z.ZodOptional<z.ZodOptional<z.ZodObject<{
@@ -972,32 +1048,51 @@ declare const envConfigSchemaInner: z.ZodObject<{
972
1048
  deleted_classes?: string[] | undefined;
973
1049
  new_sqlite_classes?: string[] | undefined;
974
1050
  }>, "many">>>;
975
- build: z.ZodOptional<z.ZodOptional<z.ZodObject<{
1051
+ rolldown: z.ZodOptional<z.ZodOptional<z.ZodObject<{
976
1052
  /**
977
- * Build target environment.
1053
+ * Bundle target environment.
978
1054
  * @example 'es2022'
979
1055
  */
980
1056
  target: z.ZodOptional<z.ZodString>;
981
- /** Enable minification for smaller bundle size */
1057
+ /** Enable minification for emitted DO bundles */
982
1058
  minify: z.ZodOptional<z.ZodBoolean>;
983
- /** Generate source maps for debugging */
1059
+ /** Generate source maps for emitted DO bundles */
984
1060
  sourcemap: z.ZodOptional<z.ZodBoolean>;
985
1061
  /**
986
- * Additional Rolldown bundler options.
1062
+ * Additional raw Rolldown options.
987
1063
  * @see https://rolldown.rs/
988
1064
  */
989
- rolldownOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1065
+ options: z.ZodOptional<z.ZodType<DevflareRolldownOptions, z.ZodTypeDef, DevflareRolldownOptions>>;
990
1066
  }, "strip", z.ZodTypeAny, {
991
1067
  target?: string | undefined;
992
1068
  minify?: boolean | undefined;
993
1069
  sourcemap?: boolean | undefined;
994
- rolldownOptions?: Record<string, unknown> | undefined;
1070
+ options?: DevflareRolldownOptions | undefined;
995
1071
  }, {
996
1072
  target?: string | undefined;
997
1073
  minify?: boolean | undefined;
998
1074
  sourcemap?: boolean | undefined;
999
- rolldownOptions?: Record<string, unknown> | undefined;
1075
+ options?: DevflareRolldownOptions | undefined;
1000
1076
  }>>>;
1077
+ vite: z.ZodOptional<z.ZodOptional<z.ZodObject<{
1078
+ /**
1079
+ * Devflare-level Vite plugin metadata sourced from devflare.config.ts.
1080
+ * Raw Vite plugin wiring still belongs in `vite.config.*`.
1081
+ */
1082
+ plugins: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
1083
+ }, "strip", z.ZodUnknown, z.objectOutputType<{
1084
+ /**
1085
+ * Devflare-level Vite plugin metadata sourced from devflare.config.ts.
1086
+ * Raw Vite plugin wiring still belongs in `vite.config.*`.
1087
+ */
1088
+ plugins: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
1089
+ }, z.ZodUnknown, "strip">, z.objectInputType<{
1090
+ /**
1091
+ * Devflare-level Vite plugin metadata sourced from devflare.config.ts.
1092
+ * Raw Vite plugin wiring still belongs in `vite.config.*`.
1093
+ */
1094
+ plugins: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
1095
+ }, z.ZodUnknown, "strip">>>>;
1001
1096
  wrangler: z.ZodOptional<z.ZodOptional<z.ZodObject<{
1002
1097
  /**
1003
1098
  * Arbitrary key-value pairs passed directly to wrangler.jsonc.
@@ -1009,6 +1104,33 @@ declare const envConfigSchemaInner: z.ZodObject<{
1009
1104
  }, {
1010
1105
  passthrough?: Record<string, unknown> | undefined;
1011
1106
  }>>>;
1107
+ } & {
1108
+ /** @deprecated Use `rolldown` instead. */
1109
+ build: z.ZodOptional<z.ZodObject<{
1110
+ /**
1111
+ * Legacy alias for `rolldown.target`.
1112
+ * @example 'es2022'
1113
+ */
1114
+ target: z.ZodOptional<z.ZodString>;
1115
+ /** Legacy alias for `rolldown.minify`. */
1116
+ minify: z.ZodOptional<z.ZodBoolean>;
1117
+ /** Legacy alias for `rolldown.sourcemap`. */
1118
+ sourcemap: z.ZodOptional<z.ZodBoolean>;
1119
+ /** Legacy alias for `rolldown.options`. */
1120
+ rolldownOptions: z.ZodOptional<z.ZodType<DevflareRolldownOptions, z.ZodTypeDef, DevflareRolldownOptions>>;
1121
+ }, "strip", z.ZodTypeAny, {
1122
+ target?: string | undefined;
1123
+ minify?: boolean | undefined;
1124
+ sourcemap?: boolean | undefined;
1125
+ rolldownOptions?: DevflareRolldownOptions | undefined;
1126
+ }, {
1127
+ target?: string | undefined;
1128
+ minify?: boolean | undefined;
1129
+ sourcemap?: boolean | undefined;
1130
+ rolldownOptions?: DevflareRolldownOptions | undefined;
1131
+ }>>;
1132
+ /** @deprecated Use `vite.plugins` instead. */
1133
+ plugins: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
1012
1134
  }, "strip", z.ZodTypeAny, {
1013
1135
  name?: string | undefined;
1014
1136
  compatibilityDate?: string | undefined;
@@ -1071,6 +1193,8 @@ declare const envConfigSchemaInner: z.ZodObject<{
1071
1193
  }> | undefined;
1072
1194
  sendEmail?: Record<string, {
1073
1195
  destinationAddress?: string | undefined;
1196
+ allowedDestinationAddresses?: string[] | undefined;
1197
+ allowedSenderAddresses?: string[] | undefined;
1074
1198
  }> | undefined;
1075
1199
  } | undefined;
1076
1200
  triggers?: {
@@ -1107,15 +1231,29 @@ declare const envConfigSchemaInner: z.ZodObject<{
1107
1231
  deleted_classes?: string[] | undefined;
1108
1232
  new_sqlite_classes?: string[] | undefined;
1109
1233
  }[] | undefined;
1110
- build?: {
1234
+ rolldown?: {
1111
1235
  target?: string | undefined;
1112
1236
  minify?: boolean | undefined;
1113
1237
  sourcemap?: boolean | undefined;
1114
- rolldownOptions?: Record<string, unknown> | undefined;
1238
+ options?: DevflareRolldownOptions | undefined;
1115
1239
  } | undefined;
1240
+ vite?: z.objectOutputType<{
1241
+ /**
1242
+ * Devflare-level Vite plugin metadata sourced from devflare.config.ts.
1243
+ * Raw Vite plugin wiring still belongs in `vite.config.*`.
1244
+ */
1245
+ plugins: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
1246
+ }, z.ZodUnknown, "strip"> | undefined;
1116
1247
  wrangler?: {
1117
1248
  passthrough?: Record<string, unknown> | undefined;
1118
1249
  } | undefined;
1250
+ build?: {
1251
+ target?: string | undefined;
1252
+ minify?: boolean | undefined;
1253
+ sourcemap?: boolean | undefined;
1254
+ rolldownOptions?: DevflareRolldownOptions | undefined;
1255
+ } | undefined;
1256
+ plugins?: unknown[] | undefined;
1119
1257
  }, {
1120
1258
  name?: string | undefined;
1121
1259
  compatibilityDate?: string | undefined;
@@ -1178,6 +1316,8 @@ declare const envConfigSchemaInner: z.ZodObject<{
1178
1316
  }> | undefined;
1179
1317
  sendEmail?: Record<string, {
1180
1318
  destinationAddress?: string | undefined;
1319
+ allowedDestinationAddresses?: string[] | undefined;
1320
+ allowedSenderAddresses?: string[] | undefined;
1181
1321
  }> | undefined;
1182
1322
  } | undefined;
1183
1323
  triggers?: {
@@ -1214,211 +1354,34 @@ declare const envConfigSchemaInner: z.ZodObject<{
1214
1354
  deleted_classes?: string[] | undefined;
1215
1355
  new_sqlite_classes?: string[] | undefined;
1216
1356
  }[] | undefined;
1217
- build?: {
1357
+ rolldown?: {
1218
1358
  target?: string | undefined;
1219
1359
  minify?: boolean | undefined;
1220
1360
  sourcemap?: boolean | undefined;
1221
- rolldownOptions?: Record<string, unknown> | undefined;
1361
+ options?: DevflareRolldownOptions | undefined;
1222
1362
  } | undefined;
1363
+ vite?: z.objectInputType<{
1364
+ /**
1365
+ * Devflare-level Vite plugin metadata sourced from devflare.config.ts.
1366
+ * Raw Vite plugin wiring still belongs in `vite.config.*`.
1367
+ */
1368
+ plugins: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
1369
+ }, z.ZodUnknown, "strip"> | undefined;
1223
1370
  wrangler?: {
1224
1371
  passthrough?: Record<string, unknown> | undefined;
1225
1372
  } | undefined;
1226
- }>;
1227
- /**
1228
- * Main devflare configuration schema.
1229
- *
1230
- * This is the complete schema for `devflare.config.ts` files.
1231
- * Use `defineConfig()` for type-safe configuration with autocompletion.
1232
- *
1233
- * @example Minimal configuration
1234
- * ```ts
1235
- * import { defineConfig } from 'devflare'
1236
- *
1237
- * export default defineConfig({
1238
- * name: 'my-worker'
1239
- * })
1240
- * ```
1241
- *
1242
- * @example Full configuration
1243
- * ```ts
1244
- * export default defineConfig({
1245
- * name: 'api-worker',
1246
- * files: { fetch: 'src/fetch.ts' },
1247
- * bindings: {
1248
- * kv: { CACHE: 'cache-id' },
1249
- * d1: { DB: 'database-id' },
1250
- * durableObjects: { COUNTER: 'Counter' }
1251
- * }
1252
- * })
1253
- * ```
1254
- */
1255
- export declare const configSchema: z.ZodObject<{
1256
- /**
1257
- * Worker name (required).
1258
- * Used as the deployment target and in URLs.
1259
- * @example 'my-api-worker'
1260
- */
1261
- name: z.ZodString;
1262
- /**
1263
- * Cloudflare account ID.
1264
- * Required for remote bindings (AI, Vectorize, etc.).
1265
- * Can also be set via CLOUDFLARE_ACCOUNT_ID environment variable.
1266
- */
1267
- accountId: z.ZodOptional<z.ZodString>;
1268
- /**
1269
- * Cloudflare Workers compatibility date.
1270
- * @default Current date (YYYY-MM-DD)
1271
- * @see https://developers.cloudflare.com/workers/configuration/compatibility-dates/
1272
- */
1273
- compatibilityDate: z.ZodDefault<z.ZodOptional<z.ZodString>>;
1274
- /**
1275
- * Compatibility flags to enable additional features.
1276
- * @default ['nodejs_compat', 'nodejs_als'] (always included)
1277
- * @see https://developers.cloudflare.com/workers/configuration/compatibility-dates/#compatibility-flags
1278
- */
1279
- compatibilityFlags: z.ZodEffects<z.ZodOptional<z.ZodArray<z.ZodString, "many">>, string[], string[] | undefined>;
1280
- /**
1281
- * File handlers configuration.
1282
- * Maps handler types to source file paths.
1283
- */
1284
- files: z.ZodOptional<z.ZodObject<{
1285
- /**
1286
- * Main fetch handler file path.
1287
- * This handles HTTP requests to your worker.
1288
- * @default 'src/fetch.{ts,js}'
1289
- * @example 'src/fetch.ts'
1290
- */
1291
- fetch: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>>;
1292
- /**
1293
- * Queue consumer handler file path.
1294
- * Handles messages from Cloudflare Queues.
1295
- * @default 'src/queue.ts'
1296
- * @example 'src/queue.ts'
1297
- */
1298
- queue: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>>;
1299
- /**
1300
- * Scheduled (cron) handler file path.
1301
- * Handles cron trigger invocations.
1302
- * @default 'src/scheduled.ts'
1303
- * @example 'src/scheduled.ts'
1304
- */
1305
- scheduled: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>>;
1306
- /**
1307
- * Email handler file path.
1308
- * Handles incoming emails via Email Routing.
1309
- * @default 'src/email.ts'
1310
- * @example 'src/email.ts'
1311
- */
1312
- email: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>>;
1313
- /**
1314
- * Durable Object class discovery glob pattern.
1315
- * Files matching this pattern are scanned for DO classes.
1316
- * Respects `.gitignore` automatically.
1317
- *
1318
- * @default `**​/do.*.{ts,js}` (recursive)
1319
- * @example `**​/do.*.{ts,js}` — Matches src/do.counter.ts, lib/do.chat.ts
1320
- * @example `src/do.*.ts` — Legacy single-directory pattern
1321
- */
1322
- durableObjects: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>>;
1323
- /**
1324
- * WorkerEntrypoint class discovery glob pattern.
1325
- * Files matching this pattern are scanned for named entrypoint classes.
1326
- * Respects `.gitignore` automatically.
1327
- *
1328
- * Entrypoints enable typed cross-worker RPC via service bindings:
1329
- * ```ts
1330
- * // ep.admin.ts
1331
- * export class AdminEntrypoint extends WorkerEntrypoint {
1332
- * async getStats() { return { users: 100 } }
1333
- * }
1334
- *
1335
- * // Consumer worker
1336
- * const stats = await env.ADMIN_SERVICE.getStats()
1337
- * ```
1338
- *
1339
- * @default `**​/ep.*.{ts,js}` (recursive)
1340
- * @example `**​/ep.*.{ts,js}` — Matches src/ep.admin.ts, lib/ep.auth.ts
1341
- * @example `src/ep.*.ts` — Legacy single-directory pattern
1342
- */
1343
- entrypoints: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>>;
1344
- /**
1345
- * Workflow class discovery glob pattern.
1346
- * Files matching this pattern are scanned for Workflow classes.
1347
- * Respects `.gitignore` automatically.
1348
- *
1349
- * Workflows enable durable multi-step execution with automatic retries:
1350
- * ```ts
1351
- * // wf.order-processor.ts
1352
- * export class OrderProcessingWorkflow extends Workflow {
1353
- * async run(event, step) {
1354
- * const validated = await step.do('validate', () => validate(event.payload))
1355
- * const charged = await step.do('charge', () => charge(validated))
1356
- * return { orderId: charged.id }
1357
- * }
1358
- * }
1359
- * ```
1360
- *
1361
- * @default `**​/wf.*.{ts,js}` (recursive)
1362
- * @example `**​/wf.*.{ts,js}` — Matches src/wf.order.ts, lib/wf.pipeline.ts
1363
- * @example `src/wf.*.ts` — Legacy single-directory pattern
1364
- */
1365
- workflows: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>>;
1366
- /**
1367
- * File-based routing configuration.
1368
- * Enables automatic route discovery from a directory.
1369
- *
1370
- * Directory structure maps to URL paths:
1371
- * ```
1372
- * src/routes/
1373
- * ├── index.ts → GET /
1374
- * ├── users/
1375
- * │ ├── index.ts → GET /users POST /users
1376
- * │ ├── [id].ts → GET /users/:id
1377
- * │ └── [id]/
1378
- * │ └── posts.ts → GET /users/:id/posts
1379
- * └── api/
1380
- * └── health.ts → GET /api/health
1381
- * ```
1382
- *
1383
- * Each file exports HTTP method handlers:
1384
- * ```ts
1385
- * export function GET(req: Request, env: Env) { ... }
1386
- * export function POST(req: Request, env: Env) { ... }
1387
- * ```
1388
- */
1389
- routes: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
1390
- /** Directory containing route files (e.g., 'src/routes') */
1391
- dir: z.ZodString;
1392
- /** Optional URL prefix for all routes (e.g., '/api') */
1393
- prefix: z.ZodOptional<z.ZodString>;
1394
- }, "strip", z.ZodTypeAny, {
1395
- dir: string;
1396
- prefix?: string | undefined;
1397
- }, {
1398
- dir: string;
1399
- prefix?: string | undefined;
1400
- }>, z.ZodLiteral<false>]>>;
1401
- /**
1402
- * Transport file for custom RPC serialization.
1403
- * Implements SvelteKit-style encode/decode for complex types.
1404
- * @default 'src/transport.ts'
1405
- * @example 'src/transport.ts'
1406
- */
1407
- transport: z.ZodOptional<z.ZodString>;
1408
- }, "strip", z.ZodTypeAny, {
1409
- fetch?: string | false | undefined;
1410
- queue?: string | false | undefined;
1411
- scheduled?: string | false | undefined;
1412
- email?: string | false | undefined;
1413
- durableObjects?: string | false | undefined;
1414
- entrypoints?: string | false | undefined;
1415
- workflows?: string | false | undefined;
1416
- routes?: false | {
1417
- dir: string;
1418
- prefix?: string | undefined;
1419
- } | undefined;
1420
- transport?: string | undefined;
1421
- }, {
1373
+ build?: {
1374
+ target?: string | undefined;
1375
+ minify?: boolean | undefined;
1376
+ sourcemap?: boolean | undefined;
1377
+ rolldownOptions?: DevflareRolldownOptions | undefined;
1378
+ } | undefined;
1379
+ plugins?: unknown[] | undefined;
1380
+ }>, {
1381
+ name?: string | undefined;
1382
+ compatibilityDate?: string | undefined;
1383
+ compatibilityFlags?: string[] | undefined;
1384
+ files?: {
1422
1385
  fetch?: string | false | undefined;
1423
1386
  queue?: string | false | undefined;
1424
1387
  scheduled?: string | false | undefined;
@@ -1431,256 +1394,8 @@ export declare const configSchema: z.ZodObject<{
1431
1394
  prefix?: string | undefined;
1432
1395
  } | undefined;
1433
1396
  transport?: string | undefined;
1434
- }>>;
1435
- /**
1436
- * Bindings to Cloudflare services.
1437
- * KV, D1, R2, Durable Objects, Queues, Services, and more.
1438
- */
1439
- bindings: z.ZodOptional<z.ZodObject<{
1440
- /**
1441
- * KV Namespace bindings.
1442
- * Maps binding name to KV namespace ID.
1443
- * @example { CACHE: 'cache-kv-namespace-id' }
1444
- */
1445
- kv: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1446
- /**
1447
- * D1 Database bindings.
1448
- * Maps binding name to D1 database ID.
1449
- * @example { DB: 'main-database-id' }
1450
- */
1451
- d1: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1452
- /**
1453
- * R2 Bucket bindings.
1454
- * Maps binding name to R2 bucket name.
1455
- * @example { IMAGES: 'images-bucket' }
1456
- */
1457
- r2: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1458
- /**
1459
- * Durable Object bindings.
1460
- * Maps binding name to DO class configuration.
1461
- * @example { COUNTER: 'Counter' } or { COUNTER: { className: 'Counter' } }
1462
- */
1463
- durableObjects: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<DurableObjectBindingInput, z.ZodTypeDef, DurableObjectBindingInput>>>;
1464
- /**
1465
- * Queue bindings for producers and consumers.
1466
- */
1467
- queues: z.ZodOptional<z.ZodObject<{
1468
- /**
1469
- * Queue producer bindings.
1470
- * Maps binding name to queue name.
1471
- * @example { TASK_QUEUE: 'task-queue' }
1472
- */
1473
- producers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1474
- /**
1475
- * Queue consumer configurations.
1476
- * Array of consumer configs for processing queue messages.
1477
- */
1478
- consumers: z.ZodOptional<z.ZodArray<z.ZodObject<{
1479
- /** Queue name to consume from */
1480
- queue: z.ZodString;
1481
- /**
1482
- * Maximum messages per batch (1-100).
1483
- * @default 10
1484
- */
1485
- maxBatchSize: z.ZodOptional<z.ZodNumber>;
1486
- /**
1487
- * Maximum seconds to wait for a full batch.
1488
- * @default 5
1489
- */
1490
- maxBatchTimeout: z.ZodOptional<z.ZodNumber>;
1491
- /**
1492
- * Maximum retry attempts for failed messages.
1493
- * @default 3
1494
- */
1495
- maxRetries: z.ZodOptional<z.ZodNumber>;
1496
- /** Queue name to send failed messages after max retries */
1497
- deadLetterQueue: z.ZodOptional<z.ZodString>;
1498
- /** Maximum concurrent batch invocations */
1499
- maxConcurrency: z.ZodOptional<z.ZodNumber>;
1500
- /** Delay in seconds between retries */
1501
- retryDelay: z.ZodOptional<z.ZodNumber>;
1502
- }, "strip", z.ZodTypeAny, {
1503
- queue: string;
1504
- maxBatchSize?: number | undefined;
1505
- maxBatchTimeout?: number | undefined;
1506
- maxRetries?: number | undefined;
1507
- deadLetterQueue?: string | undefined;
1508
- maxConcurrency?: number | undefined;
1509
- retryDelay?: number | undefined;
1510
- }, {
1511
- queue: string;
1512
- maxBatchSize?: number | undefined;
1513
- maxBatchTimeout?: number | undefined;
1514
- maxRetries?: number | undefined;
1515
- deadLetterQueue?: string | undefined;
1516
- maxConcurrency?: number | undefined;
1517
- retryDelay?: number | undefined;
1518
- }>, "many">>;
1519
- }, "strip", z.ZodTypeAny, {
1520
- producers?: Record<string, string> | undefined;
1521
- consumers?: {
1522
- queue: string;
1523
- maxBatchSize?: number | undefined;
1524
- maxBatchTimeout?: number | undefined;
1525
- maxRetries?: number | undefined;
1526
- deadLetterQueue?: string | undefined;
1527
- maxConcurrency?: number | undefined;
1528
- retryDelay?: number | undefined;
1529
- }[] | undefined;
1530
- }, {
1531
- producers?: Record<string, string> | undefined;
1532
- consumers?: {
1533
- queue: string;
1534
- maxBatchSize?: number | undefined;
1535
- maxBatchTimeout?: number | undefined;
1536
- maxRetries?: number | undefined;
1537
- deadLetterQueue?: string | undefined;
1538
- maxConcurrency?: number | undefined;
1539
- retryDelay?: number | undefined;
1540
- }[] | undefined;
1541
- }>>;
1542
- /**
1543
- * Service bindings to other Workers.
1544
- * Enables RPC-style communication between workers.
1545
- * @example { MATH: mathWorker.worker }
1546
- */
1547
- services: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<{
1548
- /** Target worker/service name */
1549
- service: string;
1550
- /** Optional environment (staging, production, etc.) */
1551
- environment?: string | undefined;
1552
- /** Optional entrypoint class name for named exports */
1553
- entrypoint?: string | undefined;
1554
- /** @internal Reference marker for ref() bindings */
1555
- __ref?: unknown;
1556
- }, z.ZodTypeDef, {
1557
- /** Target worker/service name */
1558
- service: string;
1559
- /** Optional environment (staging, production, etc.) */
1560
- environment?: string | undefined;
1561
- /** Optional entrypoint class name for named exports */
1562
- entrypoint?: string | undefined;
1563
- /** @internal Reference marker for ref() bindings */
1564
- __ref?: unknown;
1565
- }>>>;
1566
- /**
1567
- * Workers AI binding for ML inference.
1568
- * @example { binding: 'AI' }
1569
- */
1570
- ai: z.ZodOptional<z.ZodObject<{
1571
- /** Binding name exposed in env (e.g., 'AI') */
1572
- binding: z.ZodString;
1573
- }, "strip", z.ZodTypeAny, {
1574
- binding: string;
1575
- }, {
1576
- binding: string;
1577
- }>>;
1578
- /**
1579
- * Vectorize index bindings for vector similarity search.
1580
- * @example { EMBEDDINGS: { indexName: 'my-index' } }
1581
- */
1582
- vectorize: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1583
- /** Name of the Vectorize index */
1584
- indexName: z.ZodString;
1585
- }, "strip", z.ZodTypeAny, {
1586
- indexName: string;
1587
- }, {
1588
- indexName: string;
1589
- }>>>;
1590
- /**
1591
- * Hyperdrive bindings for accelerated PostgreSQL.
1592
- * @example { DB: { id: 'hyperdrive-config-id' } }
1593
- */
1594
- hyperdrive: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1595
- /** Hyperdrive configuration ID */
1596
- id: z.ZodString;
1597
- }, "strip", z.ZodTypeAny, {
1598
- id: string;
1599
- }, {
1600
- id: string;
1601
- }>>>;
1602
- /**
1603
- * Browser Rendering binding for headless browser access.
1604
- * @example { binding: 'BROWSER' }
1605
- */
1606
- browser: z.ZodOptional<z.ZodObject<{
1607
- /** Binding name exposed in env (e.g., 'BROWSER') */
1608
- binding: z.ZodString;
1609
- }, "strip", z.ZodTypeAny, {
1610
- binding: string;
1611
- }, {
1612
- binding: string;
1613
- }>>;
1614
- /**
1615
- * Analytics Engine bindings for event logging.
1616
- * @example { ANALYTICS: { dataset: 'my-dataset' } }
1617
- */
1618
- analyticsEngine: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1619
- /** Analytics Engine dataset name */
1620
- dataset: z.ZodString;
1621
- }, "strip", z.ZodTypeAny, {
1622
- dataset: string;
1623
- }, {
1624
- dataset: string;
1625
- }>>>;
1626
- /**
1627
- * Email sending bindings.
1628
- * @example { EMAIL: { destinationAddress: 'admin@example.com' } }
1629
- */
1630
- sendEmail: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1631
- /** Default destination address (can be overridden per-send) */
1632
- destinationAddress: z.ZodOptional<z.ZodString>;
1633
- }, "strip", z.ZodTypeAny, {
1634
- destinationAddress?: string | undefined;
1635
- }, {
1636
- destinationAddress?: string | undefined;
1637
- }>>>;
1638
- }, "strip", z.ZodTypeAny, {
1639
- kv?: Record<string, string> | undefined;
1640
- d1?: Record<string, string> | undefined;
1641
- r2?: Record<string, string> | undefined;
1642
- durableObjects?: Record<string, DurableObjectBindingInput> | undefined;
1643
- queues?: {
1644
- producers?: Record<string, string> | undefined;
1645
- consumers?: {
1646
- queue: string;
1647
- maxBatchSize?: number | undefined;
1648
- maxBatchTimeout?: number | undefined;
1649
- maxRetries?: number | undefined;
1650
- deadLetterQueue?: string | undefined;
1651
- maxConcurrency?: number | undefined;
1652
- retryDelay?: number | undefined;
1653
- }[] | undefined;
1654
- } | undefined;
1655
- services?: Record<string, {
1656
- /** Target worker/service name */
1657
- service: string;
1658
- /** Optional environment (staging, production, etc.) */
1659
- environment?: string | undefined;
1660
- /** Optional entrypoint class name for named exports */
1661
- entrypoint?: string | undefined;
1662
- /** @internal Reference marker for ref() bindings */
1663
- __ref?: unknown;
1664
- }> | undefined;
1665
- ai?: {
1666
- binding: string;
1667
- } | undefined;
1668
- vectorize?: Record<string, {
1669
- indexName: string;
1670
- }> | undefined;
1671
- hyperdrive?: Record<string, {
1672
- id: string;
1673
- }> | undefined;
1674
- browser?: {
1675
- binding: string;
1676
- } | undefined;
1677
- analyticsEngine?: Record<string, {
1678
- dataset: string;
1679
- }> | undefined;
1680
- sendEmail?: Record<string, {
1681
- destinationAddress?: string | undefined;
1682
- }> | undefined;
1683
- }, {
1397
+ } | undefined;
1398
+ bindings?: {
1684
1399
  kv?: Record<string, string> | undefined;
1685
1400
  d1?: Record<string, string> | undefined;
1686
1401
  r2?: Record<string, string> | undefined;
@@ -1724,211 +1439,35 @@ export declare const configSchema: z.ZodObject<{
1724
1439
  }> | undefined;
1725
1440
  sendEmail?: Record<string, {
1726
1441
  destinationAddress?: string | undefined;
1442
+ allowedDestinationAddresses?: string[] | undefined;
1443
+ allowedSenderAddresses?: string[] | undefined;
1727
1444
  }> | undefined;
1728
- }>>;
1729
- /**
1730
- * Trigger configuration (cron schedules).
1731
- */
1732
- triggers: z.ZodOptional<z.ZodObject<{
1733
- /**
1734
- * Array of cron expressions for scheduled execution.
1735
- *
1736
- * Examples:
1737
- * - `'0 0 * * *'` — Daily at midnight
1738
- * - `'0/5 * * * *'` — Every 5 minutes
1739
- * - `'0 9 * * 1'` — Every Monday at 9am
1740
- */
1741
- crons: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1742
- }, "strip", z.ZodTypeAny, {
1743
- crons?: string[] | undefined;
1744
- }, {
1445
+ } | undefined;
1446
+ triggers?: {
1745
1447
  crons?: string[] | undefined;
1746
- }>>;
1747
- /**
1748
- * Environment variables.
1749
- * Exposed via env.VAR_NAME in the worker.
1750
- */
1751
- vars: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1752
- /**
1753
- * Secret configuration.
1754
- * Secrets are like vars but encrypted and not logged.
1755
- */
1756
- secrets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1757
- /**
1758
- * Whether this secret is required for the worker to run.
1759
- * If true, worker will fail to start if secret is missing.
1760
- * @default true
1761
- */
1762
- required: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
1763
- }, "strip", z.ZodTypeAny, {
1448
+ } | undefined;
1449
+ vars?: Record<string, string> | undefined;
1450
+ secrets?: Record<string, {
1764
1451
  required: boolean;
1765
- }, {
1766
- required?: boolean | undefined;
1767
- }>>>;
1768
- /**
1769
- * Deployment routes.
1770
- * URL patterns that trigger this worker.
1771
- */
1772
- routes: z.ZodOptional<z.ZodArray<z.ZodObject<{
1773
- /**
1774
- * URL pattern to match (e.g., 'example.com/*').
1775
- * Supports wildcards (*) for path matching.
1776
- */
1777
- pattern: z.ZodString;
1778
- /** Zone name to associate the route with */
1779
- zone_name: z.ZodOptional<z.ZodString>;
1780
- /** Zone ID to associate the route with (alternative to zone_name) */
1781
- zone_id: z.ZodOptional<z.ZodString>;
1782
- /** Whether this is a custom domain route */
1783
- custom_domain: z.ZodOptional<z.ZodBoolean>;
1784
- }, "strip", z.ZodTypeAny, {
1785
- pattern: string;
1786
- zone_name?: string | undefined;
1787
- zone_id?: string | undefined;
1788
- custom_domain?: boolean | undefined;
1789
- }, {
1452
+ }> | undefined;
1453
+ routes?: {
1790
1454
  pattern: string;
1791
1455
  zone_name?: string | undefined;
1792
1456
  zone_id?: string | undefined;
1793
1457
  custom_domain?: boolean | undefined;
1794
- }>, "many">>;
1795
- /**
1796
- * WebSocket routes for dev mode DO proxying.
1797
- * Enables WebSocket connections to Durable Objects locally.
1798
- */
1799
- wsRoutes: z.ZodOptional<z.ZodArray<z.ZodObject<{
1800
- /**
1801
- * URL pattern to match for WebSocket upgrade requests.
1802
- * @example '/chat/api'
1803
- */
1804
- pattern: z.ZodString;
1805
- /**
1806
- * Durable Object namespace binding name to route to.
1807
- * Must match a binding name in bindings.durableObjects.
1808
- */
1809
- doNamespace: z.ZodString;
1810
- /**
1811
- * Query parameter name used to identify DO instances.
1812
- * @default 'id'
1813
- * @example `/chat/api?roomId=room123`
1814
- */
1815
- idParam: z.ZodDefault<z.ZodString>;
1816
- /**
1817
- * Path to forward within the Durable Object.
1818
- * @default '/websocket'
1819
- */
1820
- forwardPath: z.ZodDefault<z.ZodString>;
1821
- }, "strip", z.ZodTypeAny, {
1822
- pattern: string;
1823
- doNamespace: string;
1824
- idParam: string;
1825
- forwardPath: string;
1826
- }, {
1827
- pattern: string;
1828
- doNamespace: string;
1829
- idParam?: string | undefined;
1830
- forwardPath?: string | undefined;
1831
- }>, "many">>;
1832
- /**
1833
- * Static assets configuration.
1834
- */
1835
- assets: z.ZodOptional<z.ZodObject<{
1836
- /** Directory containing static assets (relative to config file) */
1837
- directory: z.ZodString;
1838
- /**
1839
- * Optional binding name to access assets programmatically.
1840
- * If provided, assets can be fetched via env[binding].fetch()
1841
- */
1842
- binding: z.ZodOptional<z.ZodString>;
1843
- }, "strip", z.ZodTypeAny, {
1844
- directory: string;
1845
- binding?: string | undefined;
1846
- }, {
1458
+ }[] | undefined;
1459
+ assets?: {
1847
1460
  directory: string;
1848
1461
  binding?: string | undefined;
1849
- }>>;
1850
- /**
1851
- * Resource limits (CPU time).
1852
- */
1853
- limits: z.ZodOptional<z.ZodObject<{
1854
- /**
1855
- * Maximum CPU time in milliseconds.
1856
- * Only applicable to Workers with Usage Model set to Unbound.
1857
- */
1858
- cpu_ms: z.ZodOptional<z.ZodNumber>;
1859
- }, "strip", z.ZodTypeAny, {
1860
- cpu_ms?: number | undefined;
1861
- }, {
1462
+ } | undefined;
1463
+ limits?: {
1862
1464
  cpu_ms?: number | undefined;
1863
- }>>;
1864
- /**
1865
- * Observability settings (logging, tracing).
1866
- */
1867
- observability: z.ZodOptional<z.ZodObject<{
1868
- /** Enable Worker Logs */
1869
- enabled: z.ZodOptional<z.ZodBoolean>;
1870
- /**
1871
- * Head sampling rate for logs (0-1).
1872
- * 1.0 = log all requests, 0.1 = log 10% of requests.
1873
- */
1874
- head_sampling_rate: z.ZodOptional<z.ZodNumber>;
1875
- }, "strip", z.ZodTypeAny, {
1876
- enabled?: boolean | undefined;
1877
- head_sampling_rate?: number | undefined;
1878
- }, {
1465
+ } | undefined;
1466
+ observability?: {
1879
1467
  enabled?: boolean | undefined;
1880
1468
  head_sampling_rate?: number | undefined;
1881
- }>>;
1882
- /**
1883
- * Durable Object migrations.
1884
- * Required when changing DO class names or storage backends.
1885
- */
1886
- migrations: z.ZodOptional<z.ZodArray<z.ZodObject<{
1887
- /**
1888
- * Migration tag (version identifier).
1889
- * Must be unique and in chronological order.
1890
- * @example 'v1', 'v2'
1891
- */
1892
- tag: z.ZodString;
1893
- /**
1894
- * New DO classes introduced in this migration.
1895
- * Classes that didn't exist before.
1896
- */
1897
- new_classes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1898
- /**
1899
- * Classes being renamed.
1900
- * State is preserved during rename.
1901
- */
1902
- renamed_classes: z.ZodOptional<z.ZodArray<z.ZodObject<{
1903
- from: z.ZodString;
1904
- to: z.ZodString;
1905
- }, "strip", z.ZodTypeAny, {
1906
- from: string;
1907
- to: string;
1908
- }, {
1909
- from: string;
1910
- to: string;
1911
- }>, "many">>;
1912
- /**
1913
- * Classes being deleted.
1914
- * ⚠️ All state in these classes will be lost!
1915
- */
1916
- deleted_classes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1917
- /**
1918
- * Classes migrating to SQLite storage backend.
1919
- * Enables SQL API for these DO classes.
1920
- */
1921
- new_sqlite_classes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
1922
- }, "strip", z.ZodTypeAny, {
1923
- tag: string;
1924
- new_classes?: string[] | undefined;
1925
- renamed_classes?: {
1926
- from: string;
1927
- to: string;
1928
- }[] | undefined;
1929
- deleted_classes?: string[] | undefined;
1930
- new_sqlite_classes?: string[] | undefined;
1931
- }, {
1469
+ } | undefined;
1470
+ migrations?: {
1932
1471
  tag: string;
1933
1472
  new_classes?: string[] | undefined;
1934
1473
  renamed_classes?: {
@@ -1937,186 +1476,1639 @@ export declare const configSchema: z.ZodObject<{
1937
1476
  }[] | undefined;
1938
1477
  deleted_classes?: string[] | undefined;
1939
1478
  new_sqlite_classes?: string[] | undefined;
1940
- }>, "many">>;
1941
- /**
1942
- * Build configuration for bundling.
1943
- */
1944
- build: z.ZodOptional<z.ZodObject<{
1945
- /**
1946
- * Build target environment.
1947
- * @example 'es2022'
1948
- */
1949
- target: z.ZodOptional<z.ZodString>;
1950
- /** Enable minification for smaller bundle size */
1951
- minify: z.ZodOptional<z.ZodBoolean>;
1952
- /** Generate source maps for debugging */
1953
- sourcemap: z.ZodOptional<z.ZodBoolean>;
1954
- /**
1955
- * Additional Rolldown bundler options.
1956
- * @see https://rolldown.rs/
1957
- */
1958
- rolldownOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
1959
- }, "strip", z.ZodTypeAny, {
1960
- target?: string | undefined;
1961
- minify?: boolean | undefined;
1962
- sourcemap?: boolean | undefined;
1963
- rolldownOptions?: Record<string, unknown> | undefined;
1964
- }, {
1479
+ }[] | undefined;
1480
+ rolldown?: {
1965
1481
  target?: string | undefined;
1966
1482
  minify?: boolean | undefined;
1967
1483
  sourcemap?: boolean | undefined;
1968
- rolldownOptions?: Record<string, unknown> | undefined;
1969
- }>>;
1970
- /**
1971
- * Vite plugins to apply during build.
1972
- */
1973
- plugins: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
1974
- /**
1975
- * Environment-specific configuration overrides.
1976
- * @example { staging: { vars: { DEBUG: 'true' } } }
1977
- */
1978
- env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1979
- name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1980
- compatibilityDate: z.ZodOptional<z.ZodOptional<z.ZodString>>;
1981
- compatibilityFlags: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
1982
- files: z.ZodOptional<z.ZodOptional<z.ZodObject<{
1983
- /**
1984
- * Main fetch handler file path.
1985
- * This handles HTTP requests to your worker.
1986
- * @default 'src/fetch.{ts,js}'
1987
- * @example 'src/fetch.ts'
1988
- */
1989
- fetch: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>>;
1990
- /**
1991
- * Queue consumer handler file path.
1992
- * Handles messages from Cloudflare Queues.
1993
- * @default 'src/queue.ts'
1994
- * @example 'src/queue.ts'
1995
- */
1996
- queue: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>>;
1997
- /**
1998
- * Scheduled (cron) handler file path.
1999
- * Handles cron trigger invocations.
2000
- * @default 'src/scheduled.ts'
2001
- * @example 'src/scheduled.ts'
2002
- */
2003
- scheduled: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>>;
2004
- /**
2005
- * Email handler file path.
2006
- * Handles incoming emails via Email Routing.
2007
- * @default 'src/email.ts'
2008
- * @example 'src/email.ts'
1484
+ options?: DevflareRolldownOptions | undefined;
1485
+ } | undefined;
1486
+ vite?: z.objectOutputType<{
1487
+ /**
1488
+ * Devflare-level Vite plugin metadata sourced from devflare.config.ts.
1489
+ * Raw Vite plugin wiring still belongs in `vite.config.*`.
1490
+ */
1491
+ plugins: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
1492
+ }, z.ZodUnknown, "strip"> | undefined;
1493
+ wrangler?: {
1494
+ passthrough?: Record<string, unknown> | undefined;
1495
+ } | undefined;
1496
+ }, {
1497
+ name?: string | undefined;
1498
+ compatibilityDate?: string | undefined;
1499
+ compatibilityFlags?: string[] | undefined;
1500
+ files?: {
1501
+ fetch?: string | false | undefined;
1502
+ queue?: string | false | undefined;
1503
+ scheduled?: string | false | undefined;
1504
+ email?: string | false | undefined;
1505
+ durableObjects?: string | false | undefined;
1506
+ entrypoints?: string | false | undefined;
1507
+ workflows?: string | false | undefined;
1508
+ routes?: false | {
1509
+ dir: string;
1510
+ prefix?: string | undefined;
1511
+ } | undefined;
1512
+ transport?: string | undefined;
1513
+ } | undefined;
1514
+ bindings?: {
1515
+ kv?: Record<string, string> | undefined;
1516
+ d1?: Record<string, string> | undefined;
1517
+ r2?: Record<string, string> | undefined;
1518
+ durableObjects?: Record<string, DurableObjectBindingInput> | undefined;
1519
+ queues?: {
1520
+ producers?: Record<string, string> | undefined;
1521
+ consumers?: {
1522
+ queue: string;
1523
+ maxBatchSize?: number | undefined;
1524
+ maxBatchTimeout?: number | undefined;
1525
+ maxRetries?: number | undefined;
1526
+ deadLetterQueue?: string | undefined;
1527
+ maxConcurrency?: number | undefined;
1528
+ retryDelay?: number | undefined;
1529
+ }[] | undefined;
1530
+ } | undefined;
1531
+ services?: Record<string, {
1532
+ /** Target worker/service name */
1533
+ service: string;
1534
+ /** Optional environment (staging, production, etc.) */
1535
+ environment?: string | undefined;
1536
+ /** Optional entrypoint class name for named exports */
1537
+ entrypoint?: string | undefined;
1538
+ /** @internal Reference marker for ref() bindings */
1539
+ __ref?: unknown;
1540
+ }> | undefined;
1541
+ ai?: {
1542
+ binding: string;
1543
+ } | undefined;
1544
+ vectorize?: Record<string, {
1545
+ indexName: string;
1546
+ }> | undefined;
1547
+ hyperdrive?: Record<string, {
1548
+ id: string;
1549
+ }> | undefined;
1550
+ browser?: {
1551
+ binding: string;
1552
+ } | undefined;
1553
+ analyticsEngine?: Record<string, {
1554
+ dataset: string;
1555
+ }> | undefined;
1556
+ sendEmail?: Record<string, {
1557
+ destinationAddress?: string | undefined;
1558
+ allowedDestinationAddresses?: string[] | undefined;
1559
+ allowedSenderAddresses?: string[] | undefined;
1560
+ }> | undefined;
1561
+ } | undefined;
1562
+ triggers?: {
1563
+ crons?: string[] | undefined;
1564
+ } | undefined;
1565
+ vars?: Record<string, string> | undefined;
1566
+ secrets?: Record<string, {
1567
+ required?: boolean | undefined;
1568
+ }> | undefined;
1569
+ routes?: {
1570
+ pattern: string;
1571
+ zone_name?: string | undefined;
1572
+ zone_id?: string | undefined;
1573
+ custom_domain?: boolean | undefined;
1574
+ }[] | undefined;
1575
+ assets?: {
1576
+ directory: string;
1577
+ binding?: string | undefined;
1578
+ } | undefined;
1579
+ limits?: {
1580
+ cpu_ms?: number | undefined;
1581
+ } | undefined;
1582
+ observability?: {
1583
+ enabled?: boolean | undefined;
1584
+ head_sampling_rate?: number | undefined;
1585
+ } | undefined;
1586
+ migrations?: {
1587
+ tag: string;
1588
+ new_classes?: string[] | undefined;
1589
+ renamed_classes?: {
1590
+ from: string;
1591
+ to: string;
1592
+ }[] | undefined;
1593
+ deleted_classes?: string[] | undefined;
1594
+ new_sqlite_classes?: string[] | undefined;
1595
+ }[] | undefined;
1596
+ rolldown?: {
1597
+ target?: string | undefined;
1598
+ minify?: boolean | undefined;
1599
+ sourcemap?: boolean | undefined;
1600
+ options?: DevflareRolldownOptions | undefined;
1601
+ } | undefined;
1602
+ vite?: z.objectInputType<{
1603
+ /**
1604
+ * Devflare-level Vite plugin metadata sourced from devflare.config.ts.
1605
+ * Raw Vite plugin wiring still belongs in `vite.config.*`.
1606
+ */
1607
+ plugins: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
1608
+ }, z.ZodUnknown, "strip"> | undefined;
1609
+ wrangler?: {
1610
+ passthrough?: Record<string, unknown> | undefined;
1611
+ } | undefined;
1612
+ build?: {
1613
+ target?: string | undefined;
1614
+ minify?: boolean | undefined;
1615
+ sourcemap?: boolean | undefined;
1616
+ rolldownOptions?: DevflareRolldownOptions | undefined;
1617
+ } | undefined;
1618
+ plugins?: unknown[] | undefined;
1619
+ }>;
1620
+ export declare const configSchema: z.ZodEffects<z.ZodObject<{
1621
+ /**
1622
+ * Worker name (required).
1623
+ * Used as the deployment target and in URLs.
1624
+ * @example 'my-api-worker'
1625
+ */
1626
+ name: z.ZodString;
1627
+ /**
1628
+ * Cloudflare account ID.
1629
+ * Required for remote bindings (AI, Vectorize, etc.).
1630
+ * Can also be set via CLOUDFLARE_ACCOUNT_ID environment variable.
1631
+ */
1632
+ accountId: z.ZodOptional<z.ZodString>;
1633
+ /**
1634
+ * Cloudflare Workers compatibility date.
1635
+ * @default Current date (YYYY-MM-DD)
1636
+ * @see https://developers.cloudflare.com/workers/configuration/compatibility-dates/
1637
+ */
1638
+ compatibilityDate: z.ZodDefault<z.ZodOptional<z.ZodString>>;
1639
+ /**
1640
+ * Compatibility flags to enable additional features.
1641
+ * @default ['nodejs_compat', 'nodejs_als'] (always included)
1642
+ * @see https://developers.cloudflare.com/workers/configuration/compatibility-dates/#compatibility-flags
1643
+ */
1644
+ compatibilityFlags: z.ZodEffects<z.ZodOptional<z.ZodArray<z.ZodString, "many">>, string[], string[] | undefined>;
1645
+ /**
1646
+ * File handlers configuration.
1647
+ * Maps handler types to source file paths.
1648
+ */
1649
+ files: z.ZodOptional<z.ZodObject<{
1650
+ /**
1651
+ * Main fetch handler file path.
1652
+ * This handles HTTP requests to your worker.
1653
+ * @default 'src/fetch.{ts,js}'
1654
+ * @example 'src/fetch.ts'
1655
+ */
1656
+ fetch: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>>;
1657
+ /**
1658
+ * Queue consumer handler file path.
1659
+ * Handles messages from Cloudflare Queues.
1660
+ * @default 'src/queue.ts'
1661
+ * @example 'src/queue.ts'
1662
+ */
1663
+ queue: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>>;
1664
+ /**
1665
+ * Scheduled (cron) handler file path.
1666
+ * Handles cron trigger invocations.
1667
+ * @default 'src/scheduled.ts'
1668
+ * @example 'src/scheduled.ts'
1669
+ */
1670
+ scheduled: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>>;
1671
+ /**
1672
+ * Email handler file path.
1673
+ * Handles incoming emails via Email Routing.
1674
+ * @default 'src/email.ts'
1675
+ * @example 'src/email.ts'
1676
+ */
1677
+ email: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>>;
1678
+ /**
1679
+ * Durable Object class discovery glob pattern.
1680
+ * Files matching this pattern are scanned for DO classes.
1681
+ * Respects `.gitignore` automatically.
1682
+ *
1683
+ * @default `**​/do.*.{ts,js}` (recursive)
1684
+ * @example `**​/do.*.{ts,js}` — Matches src/do.counter.ts, lib/do.chat.ts
1685
+ * @example `src/do.*.ts` — Legacy single-directory pattern
1686
+ */
1687
+ durableObjects: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>>;
1688
+ /**
1689
+ * WorkerEntrypoint class discovery glob pattern.
1690
+ * Files matching this pattern are scanned for named entrypoint classes.
1691
+ * Respects `.gitignore` automatically.
1692
+ *
1693
+ * Entrypoints enable typed cross-worker RPC via service bindings:
1694
+ * ```ts
1695
+ * // ep.admin.ts
1696
+ * export class AdminEntrypoint extends WorkerEntrypoint {
1697
+ * async getStats() { return { users: 100 } }
1698
+ * }
1699
+ *
1700
+ * // Consumer worker
1701
+ * const stats = await env.ADMIN_SERVICE.getStats()
1702
+ * ```
1703
+ *
1704
+ * @default `**​/ep.*.{ts,js}` (recursive)
1705
+ * @example `**​/ep.*.{ts,js}` — Matches src/ep.admin.ts, lib/ep.auth.ts
1706
+ * @example `src/ep.*.ts` — Legacy single-directory pattern
1707
+ */
1708
+ entrypoints: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>>;
1709
+ /**
1710
+ * Workflow class discovery glob pattern.
1711
+ * Files matching this pattern are scanned for Workflow classes.
1712
+ * Respects `.gitignore` automatically.
1713
+ *
1714
+ * Workflows enable durable multi-step execution with automatic retries:
1715
+ * ```ts
1716
+ * // wf.order-processor.ts
1717
+ * export class OrderProcessingWorkflow extends Workflow {
1718
+ * async run(event, step) {
1719
+ * const validated = await step.do('validate', () => validate(event.payload))
1720
+ * const charged = await step.do('charge', () => charge(validated))
1721
+ * return { orderId: charged.id }
1722
+ * }
1723
+ * }
1724
+ * ```
1725
+ *
1726
+ * @default `**​/wf.*.{ts,js}` (recursive)
1727
+ * @example `**​/wf.*.{ts,js}` — Matches src/wf.order.ts, lib/wf.pipeline.ts
1728
+ * @example `src/wf.*.ts` — Legacy single-directory pattern
1729
+ */
1730
+ workflows: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>>;
1731
+ /**
1732
+ * Built-in file router configuration.
1733
+ * Use this to customize or disable the route tree rooted at `src/routes/**`.
1734
+ *
1735
+ * When omitted, Devflare automatically discovers `src/routes` if that
1736
+ * directory exists.
1737
+ *
1738
+ * When set:
1739
+ * - `dir` changes the route root directory
1740
+ * - `prefix` mounts the route tree under a fixed prefix such as `/api`
1741
+ * - `false` disables route discovery entirely
1742
+ *
1743
+ * Route filename conventions:
1744
+ * ```
1745
+ * src/routes/
1746
+ * ├── index.ts
1747
+ * ├── users/
1748
+ * │ ├── index.ts
1749
+ * │ ├── [id].ts
1750
+ * │ ├── [...slug].ts
1751
+ * │ └── [id]/
1752
+ * │ └── posts.ts
1753
+ * └── api/
1754
+ * └── health.ts
1755
+ * ```
1756
+ *
1757
+ * Files or directories prefixed with `_` are ignored so route-local helpers
1758
+ * can live beside handlers.
1759
+ */
1760
+ routes: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
1761
+ /** Directory containing route files (e.g., 'src/routes') */
1762
+ dir: z.ZodString;
1763
+ /**
1764
+ * Optional route prefix (e.g., '/api').
1765
+ * Devflare mounts the discovered route tree under this static pathname prefix.
1766
+ */
1767
+ prefix: z.ZodOptional<z.ZodString>;
1768
+ }, "strip", z.ZodTypeAny, {
1769
+ dir: string;
1770
+ prefix?: string | undefined;
1771
+ }, {
1772
+ dir: string;
1773
+ prefix?: string | undefined;
1774
+ }>, z.ZodLiteral<false>]>>;
1775
+ /**
1776
+ * Transport file for custom RPC serialization.
1777
+ * Opt-in only: Devflare loads this file only when `files.transport` is
1778
+ * explicitly set.
1779
+ *
1780
+ * Today this is primarily used by the test/bridge serialization path.
1781
+ *
1782
+ * The file must export a named `transport` object.
1783
+ * @example 'src/transport.ts'
1784
+ */
1785
+ transport: z.ZodOptional<z.ZodString>;
1786
+ }, "strip", z.ZodTypeAny, {
1787
+ fetch?: string | false | undefined;
1788
+ queue?: string | false | undefined;
1789
+ scheduled?: string | false | undefined;
1790
+ email?: string | false | undefined;
1791
+ durableObjects?: string | false | undefined;
1792
+ entrypoints?: string | false | undefined;
1793
+ workflows?: string | false | undefined;
1794
+ routes?: false | {
1795
+ dir: string;
1796
+ prefix?: string | undefined;
1797
+ } | undefined;
1798
+ transport?: string | undefined;
1799
+ }, {
1800
+ fetch?: string | false | undefined;
1801
+ queue?: string | false | undefined;
1802
+ scheduled?: string | false | undefined;
1803
+ email?: string | false | undefined;
1804
+ durableObjects?: string | false | undefined;
1805
+ entrypoints?: string | false | undefined;
1806
+ workflows?: string | false | undefined;
1807
+ routes?: false | {
1808
+ dir: string;
1809
+ prefix?: string | undefined;
1810
+ } | undefined;
1811
+ transport?: string | undefined;
1812
+ }>>;
1813
+ /**
1814
+ * Bindings to Cloudflare services.
1815
+ * KV, D1, R2, Durable Objects, Queues, Services, and more.
1816
+ */
1817
+ bindings: z.ZodOptional<z.ZodObject<{
1818
+ /**
1819
+ * KV Namespace bindings.
1820
+ * Maps binding name to KV namespace ID.
1821
+ * @example { CACHE: 'cache-kv-namespace-id' }
1822
+ */
1823
+ kv: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1824
+ /**
1825
+ * D1 Database bindings.
1826
+ * Maps binding name to D1 database ID.
1827
+ * @example { DB: 'main-database-id' }
1828
+ */
1829
+ d1: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1830
+ /**
1831
+ * R2 Bucket bindings.
1832
+ * Maps binding name to R2 bucket name.
1833
+ * @example { IMAGES: 'images-bucket' }
1834
+ */
1835
+ r2: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1836
+ /**
1837
+ * Durable Object bindings.
1838
+ * Maps binding name to DO class configuration.
1839
+ * @example { COUNTER: 'Counter' } or { COUNTER: { className: 'Counter' } }
1840
+ */
1841
+ durableObjects: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<DurableObjectBindingInput, z.ZodTypeDef, DurableObjectBindingInput>>>;
1842
+ /**
1843
+ * Queue bindings for producers and consumers.
1844
+ */
1845
+ queues: z.ZodOptional<z.ZodObject<{
1846
+ /**
1847
+ * Queue producer bindings.
1848
+ * Maps binding name to queue name.
1849
+ * @example { TASK_QUEUE: 'task-queue' }
1850
+ */
1851
+ producers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
1852
+ /**
1853
+ * Queue consumer configurations.
1854
+ * Array of consumer configs for processing queue messages.
1855
+ */
1856
+ consumers: z.ZodOptional<z.ZodArray<z.ZodObject<{
1857
+ /** Queue name to consume from */
1858
+ queue: z.ZodString;
1859
+ /**
1860
+ * Maximum messages per batch (1-100).
1861
+ * @default 10
1862
+ */
1863
+ maxBatchSize: z.ZodOptional<z.ZodNumber>;
1864
+ /**
1865
+ * Maximum seconds to wait for a full batch.
1866
+ * @default 5
1867
+ */
1868
+ maxBatchTimeout: z.ZodOptional<z.ZodNumber>;
1869
+ /**
1870
+ * Maximum retry attempts for failed messages.
1871
+ * @default 3
1872
+ */
1873
+ maxRetries: z.ZodOptional<z.ZodNumber>;
1874
+ /** Queue name to send failed messages after max retries */
1875
+ deadLetterQueue: z.ZodOptional<z.ZodString>;
1876
+ /** Maximum concurrent batch invocations */
1877
+ maxConcurrency: z.ZodOptional<z.ZodNumber>;
1878
+ /** Delay in seconds between retries */
1879
+ retryDelay: z.ZodOptional<z.ZodNumber>;
1880
+ }, "strip", z.ZodTypeAny, {
1881
+ queue: string;
1882
+ maxBatchSize?: number | undefined;
1883
+ maxBatchTimeout?: number | undefined;
1884
+ maxRetries?: number | undefined;
1885
+ deadLetterQueue?: string | undefined;
1886
+ maxConcurrency?: number | undefined;
1887
+ retryDelay?: number | undefined;
1888
+ }, {
1889
+ queue: string;
1890
+ maxBatchSize?: number | undefined;
1891
+ maxBatchTimeout?: number | undefined;
1892
+ maxRetries?: number | undefined;
1893
+ deadLetterQueue?: string | undefined;
1894
+ maxConcurrency?: number | undefined;
1895
+ retryDelay?: number | undefined;
1896
+ }>, "many">>;
1897
+ }, "strip", z.ZodTypeAny, {
1898
+ producers?: Record<string, string> | undefined;
1899
+ consumers?: {
1900
+ queue: string;
1901
+ maxBatchSize?: number | undefined;
1902
+ maxBatchTimeout?: number | undefined;
1903
+ maxRetries?: number | undefined;
1904
+ deadLetterQueue?: string | undefined;
1905
+ maxConcurrency?: number | undefined;
1906
+ retryDelay?: number | undefined;
1907
+ }[] | undefined;
1908
+ }, {
1909
+ producers?: Record<string, string> | undefined;
1910
+ consumers?: {
1911
+ queue: string;
1912
+ maxBatchSize?: number | undefined;
1913
+ maxBatchTimeout?: number | undefined;
1914
+ maxRetries?: number | undefined;
1915
+ deadLetterQueue?: string | undefined;
1916
+ maxConcurrency?: number | undefined;
1917
+ retryDelay?: number | undefined;
1918
+ }[] | undefined;
1919
+ }>>;
1920
+ /**
1921
+ * Service bindings to other Workers.
1922
+ * Enables RPC-style communication between workers.
1923
+ * @example { MATH: mathWorker.worker }
1924
+ */
1925
+ services: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<{
1926
+ /** Target worker/service name */
1927
+ service: string;
1928
+ /** Optional environment (staging, production, etc.) */
1929
+ environment?: string | undefined;
1930
+ /** Optional entrypoint class name for named exports */
1931
+ entrypoint?: string | undefined;
1932
+ /** @internal Reference marker for ref() bindings */
1933
+ __ref?: unknown;
1934
+ }, z.ZodTypeDef, {
1935
+ /** Target worker/service name */
1936
+ service: string;
1937
+ /** Optional environment (staging, production, etc.) */
1938
+ environment?: string | undefined;
1939
+ /** Optional entrypoint class name for named exports */
1940
+ entrypoint?: string | undefined;
1941
+ /** @internal Reference marker for ref() bindings */
1942
+ __ref?: unknown;
1943
+ }>>>;
1944
+ /**
1945
+ * Workers AI binding for ML inference.
1946
+ * @example { binding: 'AI' }
1947
+ */
1948
+ ai: z.ZodOptional<z.ZodObject<{
1949
+ /** Binding name exposed in env (e.g., 'AI') */
1950
+ binding: z.ZodString;
1951
+ }, "strip", z.ZodTypeAny, {
1952
+ binding: string;
1953
+ }, {
1954
+ binding: string;
1955
+ }>>;
1956
+ /**
1957
+ * Vectorize index bindings for vector similarity search.
1958
+ * @example { EMBEDDINGS: { indexName: 'my-index' } }
1959
+ */
1960
+ vectorize: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1961
+ /** Name of the Vectorize index */
1962
+ indexName: z.ZodString;
1963
+ }, "strip", z.ZodTypeAny, {
1964
+ indexName: string;
1965
+ }, {
1966
+ indexName: string;
1967
+ }>>>;
1968
+ /**
1969
+ * Hyperdrive bindings for accelerated PostgreSQL.
1970
+ * @example { DB: { id: 'hyperdrive-config-id' } }
1971
+ */
1972
+ hyperdrive: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1973
+ /** Hyperdrive configuration ID */
1974
+ id: z.ZodString;
1975
+ }, "strip", z.ZodTypeAny, {
1976
+ id: string;
1977
+ }, {
1978
+ id: string;
1979
+ }>>>;
1980
+ /**
1981
+ * Browser Rendering binding for headless browser access.
1982
+ * @example { binding: 'BROWSER' }
1983
+ */
1984
+ browser: z.ZodOptional<z.ZodObject<{
1985
+ /** Binding name exposed in env (e.g., 'BROWSER') */
1986
+ binding: z.ZodString;
1987
+ }, "strip", z.ZodTypeAny, {
1988
+ binding: string;
1989
+ }, {
1990
+ binding: string;
1991
+ }>>;
1992
+ /**
1993
+ * Analytics Engine bindings for event logging.
1994
+ * @example { ANALYTICS: { dataset: 'my-dataset' } }
1995
+ */
1996
+ analyticsEngine: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
1997
+ /** Analytics Engine dataset name */
1998
+ dataset: z.ZodString;
1999
+ }, "strip", z.ZodTypeAny, {
2000
+ dataset: string;
2001
+ }, {
2002
+ dataset: string;
2003
+ }>>>;
2004
+ /**
2005
+ * Email sending bindings.
2006
+ * @example { EMAIL: { destinationAddress: 'admin@example.com' } }
2007
+ * @example { BULK_EMAIL: { allowedDestinationAddresses: ['ops@example.com'], allowedSenderAddresses: ['noreply@example.com'] } }
2008
+ */
2009
+ sendEmail: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodObject<{
2010
+ /** Restrict this binding to a specific verified destination address */
2011
+ destinationAddress: z.ZodOptional<z.ZodString>;
2012
+ /** Restrict this binding to a set of verified destination addresses */
2013
+ allowedDestinationAddresses: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2014
+ /** Restrict this binding to a set of verified sender addresses */
2015
+ allowedSenderAddresses: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2016
+ }, "strip", z.ZodTypeAny, {
2017
+ destinationAddress?: string | undefined;
2018
+ allowedDestinationAddresses?: string[] | undefined;
2019
+ allowedSenderAddresses?: string[] | undefined;
2020
+ }, {
2021
+ destinationAddress?: string | undefined;
2022
+ allowedDestinationAddresses?: string[] | undefined;
2023
+ allowedSenderAddresses?: string[] | undefined;
2024
+ }>, {
2025
+ destinationAddress?: string | undefined;
2026
+ allowedDestinationAddresses?: string[] | undefined;
2027
+ allowedSenderAddresses?: string[] | undefined;
2028
+ }, {
2029
+ destinationAddress?: string | undefined;
2030
+ allowedDestinationAddresses?: string[] | undefined;
2031
+ allowedSenderAddresses?: string[] | undefined;
2032
+ }>>>;
2033
+ }, "strip", z.ZodTypeAny, {
2034
+ kv?: Record<string, string> | undefined;
2035
+ d1?: Record<string, string> | undefined;
2036
+ r2?: Record<string, string> | undefined;
2037
+ durableObjects?: Record<string, DurableObjectBindingInput> | undefined;
2038
+ queues?: {
2039
+ producers?: Record<string, string> | undefined;
2040
+ consumers?: {
2041
+ queue: string;
2042
+ maxBatchSize?: number | undefined;
2043
+ maxBatchTimeout?: number | undefined;
2044
+ maxRetries?: number | undefined;
2045
+ deadLetterQueue?: string | undefined;
2046
+ maxConcurrency?: number | undefined;
2047
+ retryDelay?: number | undefined;
2048
+ }[] | undefined;
2049
+ } | undefined;
2050
+ services?: Record<string, {
2051
+ /** Target worker/service name */
2052
+ service: string;
2053
+ /** Optional environment (staging, production, etc.) */
2054
+ environment?: string | undefined;
2055
+ /** Optional entrypoint class name for named exports */
2056
+ entrypoint?: string | undefined;
2057
+ /** @internal Reference marker for ref() bindings */
2058
+ __ref?: unknown;
2059
+ }> | undefined;
2060
+ ai?: {
2061
+ binding: string;
2062
+ } | undefined;
2063
+ vectorize?: Record<string, {
2064
+ indexName: string;
2065
+ }> | undefined;
2066
+ hyperdrive?: Record<string, {
2067
+ id: string;
2068
+ }> | undefined;
2069
+ browser?: {
2070
+ binding: string;
2071
+ } | undefined;
2072
+ analyticsEngine?: Record<string, {
2073
+ dataset: string;
2074
+ }> | undefined;
2075
+ sendEmail?: Record<string, {
2076
+ destinationAddress?: string | undefined;
2077
+ allowedDestinationAddresses?: string[] | undefined;
2078
+ allowedSenderAddresses?: string[] | undefined;
2079
+ }> | undefined;
2080
+ }, {
2081
+ kv?: Record<string, string> | undefined;
2082
+ d1?: Record<string, string> | undefined;
2083
+ r2?: Record<string, string> | undefined;
2084
+ durableObjects?: Record<string, DurableObjectBindingInput> | undefined;
2085
+ queues?: {
2086
+ producers?: Record<string, string> | undefined;
2087
+ consumers?: {
2088
+ queue: string;
2089
+ maxBatchSize?: number | undefined;
2090
+ maxBatchTimeout?: number | undefined;
2091
+ maxRetries?: number | undefined;
2092
+ deadLetterQueue?: string | undefined;
2093
+ maxConcurrency?: number | undefined;
2094
+ retryDelay?: number | undefined;
2095
+ }[] | undefined;
2096
+ } | undefined;
2097
+ services?: Record<string, {
2098
+ /** Target worker/service name */
2099
+ service: string;
2100
+ /** Optional environment (staging, production, etc.) */
2101
+ environment?: string | undefined;
2102
+ /** Optional entrypoint class name for named exports */
2103
+ entrypoint?: string | undefined;
2104
+ /** @internal Reference marker for ref() bindings */
2105
+ __ref?: unknown;
2106
+ }> | undefined;
2107
+ ai?: {
2108
+ binding: string;
2109
+ } | undefined;
2110
+ vectorize?: Record<string, {
2111
+ indexName: string;
2112
+ }> | undefined;
2113
+ hyperdrive?: Record<string, {
2114
+ id: string;
2115
+ }> | undefined;
2116
+ browser?: {
2117
+ binding: string;
2118
+ } | undefined;
2119
+ analyticsEngine?: Record<string, {
2120
+ dataset: string;
2121
+ }> | undefined;
2122
+ sendEmail?: Record<string, {
2123
+ destinationAddress?: string | undefined;
2124
+ allowedDestinationAddresses?: string[] | undefined;
2125
+ allowedSenderAddresses?: string[] | undefined;
2126
+ }> | undefined;
2127
+ }>>;
2128
+ /**
2129
+ * Trigger configuration (cron schedules).
2130
+ */
2131
+ triggers: z.ZodOptional<z.ZodObject<{
2132
+ /**
2133
+ * Array of cron expressions for scheduled execution.
2134
+ *
2135
+ * Examples:
2136
+ * - `'0 0 * * *'` — Daily at midnight
2137
+ * - `'0/5 * * * *'` — Every 5 minutes
2138
+ * - `'0 9 * * 1'` — Every Monday at 9am
2139
+ */
2140
+ crons: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2141
+ }, "strip", z.ZodTypeAny, {
2142
+ crons?: string[] | undefined;
2143
+ }, {
2144
+ crons?: string[] | undefined;
2145
+ }>>;
2146
+ /**
2147
+ * Environment variables.
2148
+ * Exposed via env.VAR_NAME in the worker.
2149
+ */
2150
+ vars: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2151
+ /**
2152
+ * Secret declarations.
2153
+ * Use this to declare expected runtime secret bindings and validation rules.
2154
+ * Secret values are supplied by Wrangler/Cloudflare runtime configuration.
2155
+ */
2156
+ secrets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
2157
+ /**
2158
+ * Whether this secret is required for the worker to run.
2159
+ * If true, worker will fail to start if secret is missing.
2160
+ * @default true
2161
+ */
2162
+ required: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
2163
+ }, "strip", z.ZodTypeAny, {
2164
+ required: boolean;
2165
+ }, {
2166
+ required?: boolean | undefined;
2167
+ }>>>;
2168
+ /**
2169
+ * Deployment routes.
2170
+ * URL patterns that trigger this worker.
2171
+ */
2172
+ routes: z.ZodOptional<z.ZodArray<z.ZodObject<{
2173
+ /**
2174
+ * URL pattern to match (e.g., 'example.com/*').
2175
+ * Supports wildcards (*) for path matching.
2176
+ */
2177
+ pattern: z.ZodString;
2178
+ /** Zone name to associate the route with */
2179
+ zone_name: z.ZodOptional<z.ZodString>;
2180
+ /** Zone ID to associate the route with (alternative to zone_name) */
2181
+ zone_id: z.ZodOptional<z.ZodString>;
2182
+ /** Whether this is a custom domain route */
2183
+ custom_domain: z.ZodOptional<z.ZodBoolean>;
2184
+ }, "strip", z.ZodTypeAny, {
2185
+ pattern: string;
2186
+ zone_name?: string | undefined;
2187
+ zone_id?: string | undefined;
2188
+ custom_domain?: boolean | undefined;
2189
+ }, {
2190
+ pattern: string;
2191
+ zone_name?: string | undefined;
2192
+ zone_id?: string | undefined;
2193
+ custom_domain?: boolean | undefined;
2194
+ }>, "many">>;
2195
+ /**
2196
+ * WebSocket routes for dev mode DO proxying.
2197
+ * Enables WebSocket connections to Durable Objects locally.
2198
+ */
2199
+ wsRoutes: z.ZodOptional<z.ZodArray<z.ZodObject<{
2200
+ /**
2201
+ * URL pattern to match for WebSocket upgrade requests.
2202
+ * @example '/chat/api'
2203
+ */
2204
+ pattern: z.ZodString;
2205
+ /**
2206
+ * Durable Object namespace binding name to route to.
2207
+ * Must match a binding name in bindings.durableObjects.
2208
+ */
2209
+ doNamespace: z.ZodString;
2210
+ /**
2211
+ * Query parameter name used to identify DO instances.
2212
+ * @default 'id'
2213
+ * @example `/chat/api?roomId=room123`
2214
+ */
2215
+ idParam: z.ZodDefault<z.ZodString>;
2216
+ /**
2217
+ * Path to forward within the Durable Object.
2218
+ * @default '/websocket'
2219
+ */
2220
+ forwardPath: z.ZodDefault<z.ZodString>;
2221
+ }, "strip", z.ZodTypeAny, {
2222
+ pattern: string;
2223
+ doNamespace: string;
2224
+ idParam: string;
2225
+ forwardPath: string;
2226
+ }, {
2227
+ pattern: string;
2228
+ doNamespace: string;
2229
+ idParam?: string | undefined;
2230
+ forwardPath?: string | undefined;
2231
+ }>, "many">>;
2232
+ /**
2233
+ * Static assets configuration.
2234
+ */
2235
+ assets: z.ZodOptional<z.ZodObject<{
2236
+ /** Directory containing static assets (relative to config file) */
2237
+ directory: z.ZodString;
2238
+ /**
2239
+ * Optional binding name to access assets programmatically.
2240
+ * If provided, assets can be fetched via env[binding].fetch()
2241
+ */
2242
+ binding: z.ZodOptional<z.ZodString>;
2243
+ }, "strip", z.ZodTypeAny, {
2244
+ directory: string;
2245
+ binding?: string | undefined;
2246
+ }, {
2247
+ directory: string;
2248
+ binding?: string | undefined;
2249
+ }>>;
2250
+ /**
2251
+ * Resource limits (CPU time).
2252
+ */
2253
+ limits: z.ZodOptional<z.ZodObject<{
2254
+ /**
2255
+ * Maximum CPU time in milliseconds.
2256
+ * Only applicable to Workers with Usage Model set to Unbound.
2257
+ */
2258
+ cpu_ms: z.ZodOptional<z.ZodNumber>;
2259
+ }, "strip", z.ZodTypeAny, {
2260
+ cpu_ms?: number | undefined;
2261
+ }, {
2262
+ cpu_ms?: number | undefined;
2263
+ }>>;
2264
+ /**
2265
+ * Observability settings (logging, tracing).
2266
+ */
2267
+ observability: z.ZodOptional<z.ZodObject<{
2268
+ /** Enable Worker Logs */
2269
+ enabled: z.ZodOptional<z.ZodBoolean>;
2270
+ /**
2271
+ * Head sampling rate for logs (0-1).
2272
+ * 1.0 = log all requests, 0.1 = log 10% of requests.
2273
+ */
2274
+ head_sampling_rate: z.ZodOptional<z.ZodNumber>;
2275
+ }, "strip", z.ZodTypeAny, {
2276
+ enabled?: boolean | undefined;
2277
+ head_sampling_rate?: number | undefined;
2278
+ }, {
2279
+ enabled?: boolean | undefined;
2280
+ head_sampling_rate?: number | undefined;
2281
+ }>>;
2282
+ /**
2283
+ * Durable Object migrations.
2284
+ * Required when changing DO class names or storage backends.
2285
+ */
2286
+ migrations: z.ZodOptional<z.ZodArray<z.ZodObject<{
2287
+ /**
2288
+ * Migration tag (version identifier).
2289
+ * Must be unique and in chronological order.
2290
+ * @example 'v1', 'v2'
2291
+ */
2292
+ tag: z.ZodString;
2293
+ /**
2294
+ * New DO classes introduced in this migration.
2295
+ * Classes that didn't exist before.
2296
+ */
2297
+ new_classes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2298
+ /**
2299
+ * Classes being renamed.
2300
+ * State is preserved during rename.
2301
+ */
2302
+ renamed_classes: z.ZodOptional<z.ZodArray<z.ZodObject<{
2303
+ from: z.ZodString;
2304
+ to: z.ZodString;
2305
+ }, "strip", z.ZodTypeAny, {
2306
+ from: string;
2307
+ to: string;
2308
+ }, {
2309
+ from: string;
2310
+ to: string;
2311
+ }>, "many">>;
2312
+ /**
2313
+ * Classes being deleted.
2314
+ * ⚠️ All state in these classes will be lost!
2315
+ */
2316
+ deleted_classes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2317
+ /**
2318
+ * Classes migrating to SQLite storage backend.
2319
+ * Enables SQL API for these DO classes.
2320
+ */
2321
+ new_sqlite_classes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2322
+ }, "strip", z.ZodTypeAny, {
2323
+ tag: string;
2324
+ new_classes?: string[] | undefined;
2325
+ renamed_classes?: {
2326
+ from: string;
2327
+ to: string;
2328
+ }[] | undefined;
2329
+ deleted_classes?: string[] | undefined;
2330
+ new_sqlite_classes?: string[] | undefined;
2331
+ }, {
2332
+ tag: string;
2333
+ new_classes?: string[] | undefined;
2334
+ renamed_classes?: {
2335
+ from: string;
2336
+ to: string;
2337
+ }[] | undefined;
2338
+ deleted_classes?: string[] | undefined;
2339
+ new_sqlite_classes?: string[] | undefined;
2340
+ }>, "many">>;
2341
+ /**
2342
+ * Rolldown configuration for Durable Object bundling.
2343
+ */
2344
+ rolldown: z.ZodOptional<z.ZodObject<{
2345
+ /**
2346
+ * Bundle target environment.
2347
+ * @example 'es2022'
2348
+ */
2349
+ target: z.ZodOptional<z.ZodString>;
2350
+ /** Enable minification for emitted DO bundles */
2351
+ minify: z.ZodOptional<z.ZodBoolean>;
2352
+ /** Generate source maps for emitted DO bundles */
2353
+ sourcemap: z.ZodOptional<z.ZodBoolean>;
2354
+ /**
2355
+ * Additional raw Rolldown options.
2356
+ * @see https://rolldown.rs/
2357
+ */
2358
+ options: z.ZodOptional<z.ZodType<DevflareRolldownOptions, z.ZodTypeDef, DevflareRolldownOptions>>;
2359
+ }, "strip", z.ZodTypeAny, {
2360
+ target?: string | undefined;
2361
+ minify?: boolean | undefined;
2362
+ sourcemap?: boolean | undefined;
2363
+ options?: DevflareRolldownOptions | undefined;
2364
+ }, {
2365
+ target?: string | undefined;
2366
+ minify?: boolean | undefined;
2367
+ sourcemap?: boolean | undefined;
2368
+ options?: DevflareRolldownOptions | undefined;
2369
+ }>>;
2370
+ /**
2371
+ * Vite-related configuration namespace.
2372
+ * Use `vite.config.*` for raw Vite config, and this field for Devflare-level
2373
+ * Vite-side metadata and extension points.
2374
+ */
2375
+ vite: z.ZodOptional<z.ZodObject<{
2376
+ /**
2377
+ * Devflare-level Vite plugin metadata sourced from devflare.config.ts.
2378
+ * Raw Vite plugin wiring still belongs in `vite.config.*`.
2379
+ */
2380
+ plugins: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
2381
+ }, "strip", z.ZodUnknown, z.objectOutputType<{
2382
+ /**
2383
+ * Devflare-level Vite plugin metadata sourced from devflare.config.ts.
2384
+ * Raw Vite plugin wiring still belongs in `vite.config.*`.
2385
+ */
2386
+ plugins: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
2387
+ }, z.ZodUnknown, "strip">, z.objectInputType<{
2388
+ /**
2389
+ * Devflare-level Vite plugin metadata sourced from devflare.config.ts.
2390
+ * Raw Vite plugin wiring still belongs in `vite.config.*`.
2391
+ */
2392
+ plugins: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
2393
+ }, z.ZodUnknown, "strip">>>;
2394
+ /**
2395
+ * Environment-specific configuration overrides.
2396
+ * @example { staging: { vars: { DEBUG: 'true' } } }
2397
+ */
2398
+ env: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodObject<{
2399
+ name: z.ZodOptional<z.ZodOptional<z.ZodString>>;
2400
+ compatibilityDate: z.ZodOptional<z.ZodOptional<z.ZodString>>;
2401
+ compatibilityFlags: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodString, "many">>>;
2402
+ files: z.ZodOptional<z.ZodOptional<z.ZodObject<{
2403
+ /**
2404
+ * Main fetch handler file path.
2405
+ * This handles HTTP requests to your worker.
2406
+ * @default 'src/fetch.{ts,js}'
2407
+ * @example 'src/fetch.ts'
2408
+ */
2409
+ fetch: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>>;
2410
+ /**
2411
+ * Queue consumer handler file path.
2412
+ * Handles messages from Cloudflare Queues.
2413
+ * @default 'src/queue.ts'
2414
+ * @example 'src/queue.ts'
2415
+ */
2416
+ queue: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>>;
2417
+ /**
2418
+ * Scheduled (cron) handler file path.
2419
+ * Handles cron trigger invocations.
2420
+ * @default 'src/scheduled.ts'
2421
+ * @example 'src/scheduled.ts'
2422
+ */
2423
+ scheduled: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>>;
2424
+ /**
2425
+ * Email handler file path.
2426
+ * Handles incoming emails via Email Routing.
2427
+ * @default 'src/email.ts'
2428
+ * @example 'src/email.ts'
2429
+ */
2430
+ email: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>>;
2431
+ /**
2432
+ * Durable Object class discovery glob pattern.
2433
+ * Files matching this pattern are scanned for DO classes.
2434
+ * Respects `.gitignore` automatically.
2435
+ *
2436
+ * @default `**​/do.*.{ts,js}` (recursive)
2437
+ * @example `**​/do.*.{ts,js}` — Matches src/do.counter.ts, lib/do.chat.ts
2438
+ * @example `src/do.*.ts` — Legacy single-directory pattern
2439
+ */
2440
+ durableObjects: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>>;
2441
+ /**
2442
+ * WorkerEntrypoint class discovery glob pattern.
2443
+ * Files matching this pattern are scanned for named entrypoint classes.
2444
+ * Respects `.gitignore` automatically.
2445
+ *
2446
+ * Entrypoints enable typed cross-worker RPC via service bindings:
2447
+ * ```ts
2448
+ * // ep.admin.ts
2449
+ * export class AdminEntrypoint extends WorkerEntrypoint {
2450
+ * async getStats() { return { users: 100 } }
2451
+ * }
2452
+ *
2453
+ * // Consumer worker
2454
+ * const stats = await env.ADMIN_SERVICE.getStats()
2455
+ * ```
2456
+ *
2457
+ * @default `**​/ep.*.{ts,js}` (recursive)
2458
+ * @example `**​/ep.*.{ts,js}` — Matches src/ep.admin.ts, lib/ep.auth.ts
2459
+ * @example `src/ep.*.ts` — Legacy single-directory pattern
2460
+ */
2461
+ entrypoints: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>>;
2462
+ /**
2463
+ * Workflow class discovery glob pattern.
2464
+ * Files matching this pattern are scanned for Workflow classes.
2465
+ * Respects `.gitignore` automatically.
2466
+ *
2467
+ * Workflows enable durable multi-step execution with automatic retries:
2468
+ * ```ts
2469
+ * // wf.order-processor.ts
2470
+ * export class OrderProcessingWorkflow extends Workflow {
2471
+ * async run(event, step) {
2472
+ * const validated = await step.do('validate', () => validate(event.payload))
2473
+ * const charged = await step.do('charge', () => charge(validated))
2474
+ * return { orderId: charged.id }
2475
+ * }
2476
+ * }
2477
+ * ```
2478
+ *
2479
+ * @default `**​/wf.*.{ts,js}` (recursive)
2480
+ * @example `**​/wf.*.{ts,js}` — Matches src/wf.order.ts, lib/wf.pipeline.ts
2481
+ * @example `src/wf.*.ts` — Legacy single-directory pattern
2482
+ */
2483
+ workflows: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>>;
2484
+ /**
2485
+ * Built-in file router configuration.
2486
+ * Use this to customize or disable the route tree rooted at `src/routes/**`.
2487
+ *
2488
+ * When omitted, Devflare automatically discovers `src/routes` if that
2489
+ * directory exists.
2490
+ *
2491
+ * When set:
2492
+ * - `dir` changes the route root directory
2493
+ * - `prefix` mounts the route tree under a fixed prefix such as `/api`
2494
+ * - `false` disables route discovery entirely
2495
+ *
2496
+ * Route filename conventions:
2497
+ * ```
2498
+ * src/routes/
2499
+ * ├── index.ts
2500
+ * ├── users/
2501
+ * │ ├── index.ts
2502
+ * │ ├── [id].ts
2503
+ * │ ├── [...slug].ts
2504
+ * │ └── [id]/
2505
+ * │ └── posts.ts
2506
+ * └── api/
2507
+ * └── health.ts
2508
+ * ```
2509
+ *
2510
+ * Files or directories prefixed with `_` are ignored so route-local helpers
2511
+ * can live beside handlers.
2009
2512
  */
2010
- email: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>>;
2513
+ routes: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
2514
+ /** Directory containing route files (e.g., 'src/routes') */
2515
+ dir: z.ZodString;
2516
+ /**
2517
+ * Optional route prefix (e.g., '/api').
2518
+ * Devflare mounts the discovered route tree under this static pathname prefix.
2519
+ */
2520
+ prefix: z.ZodOptional<z.ZodString>;
2521
+ }, "strip", z.ZodTypeAny, {
2522
+ dir: string;
2523
+ prefix?: string | undefined;
2524
+ }, {
2525
+ dir: string;
2526
+ prefix?: string | undefined;
2527
+ }>, z.ZodLiteral<false>]>>;
2528
+ /**
2529
+ * Transport file for custom RPC serialization.
2530
+ * Opt-in only: Devflare loads this file only when `files.transport` is
2531
+ * explicitly set.
2532
+ *
2533
+ * Today this is primarily used by the test/bridge serialization path.
2534
+ *
2535
+ * The file must export a named `transport` object.
2536
+ * @example 'src/transport.ts'
2537
+ */
2538
+ transport: z.ZodOptional<z.ZodString>;
2539
+ }, "strip", z.ZodTypeAny, {
2540
+ fetch?: string | false | undefined;
2541
+ queue?: string | false | undefined;
2542
+ scheduled?: string | false | undefined;
2543
+ email?: string | false | undefined;
2544
+ durableObjects?: string | false | undefined;
2545
+ entrypoints?: string | false | undefined;
2546
+ workflows?: string | false | undefined;
2547
+ routes?: false | {
2548
+ dir: string;
2549
+ prefix?: string | undefined;
2550
+ } | undefined;
2551
+ transport?: string | undefined;
2552
+ }, {
2553
+ fetch?: string | false | undefined;
2554
+ queue?: string | false | undefined;
2555
+ scheduled?: string | false | undefined;
2556
+ email?: string | false | undefined;
2557
+ durableObjects?: string | false | undefined;
2558
+ entrypoints?: string | false | undefined;
2559
+ workflows?: string | false | undefined;
2560
+ routes?: false | {
2561
+ dir: string;
2562
+ prefix?: string | undefined;
2563
+ } | undefined;
2564
+ transport?: string | undefined;
2565
+ }>>>;
2566
+ bindings: z.ZodOptional<z.ZodOptional<z.ZodObject<{
2567
+ /**
2568
+ * KV Namespace bindings.
2569
+ * Maps binding name to KV namespace ID.
2570
+ * @example { CACHE: 'cache-kv-namespace-id' }
2571
+ */
2572
+ kv: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2573
+ /**
2574
+ * D1 Database bindings.
2575
+ * Maps binding name to D1 database ID.
2576
+ * @example { DB: 'main-database-id' }
2577
+ */
2578
+ d1: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2579
+ /**
2580
+ * R2 Bucket bindings.
2581
+ * Maps binding name to R2 bucket name.
2582
+ * @example { IMAGES: 'images-bucket' }
2583
+ */
2584
+ r2: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2585
+ /**
2586
+ * Durable Object bindings.
2587
+ * Maps binding name to DO class configuration.
2588
+ * @example { COUNTER: 'Counter' } or { COUNTER: { className: 'Counter' } }
2589
+ */
2590
+ durableObjects: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<DurableObjectBindingInput, z.ZodTypeDef, DurableObjectBindingInput>>>;
2591
+ /**
2592
+ * Queue bindings for producers and consumers.
2593
+ */
2594
+ queues: z.ZodOptional<z.ZodObject<{
2595
+ /**
2596
+ * Queue producer bindings.
2597
+ * Maps binding name to queue name.
2598
+ * @example { TASK_QUEUE: 'task-queue' }
2599
+ */
2600
+ producers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2601
+ /**
2602
+ * Queue consumer configurations.
2603
+ * Array of consumer configs for processing queue messages.
2604
+ */
2605
+ consumers: z.ZodOptional<z.ZodArray<z.ZodObject<{
2606
+ /** Queue name to consume from */
2607
+ queue: z.ZodString;
2608
+ /**
2609
+ * Maximum messages per batch (1-100).
2610
+ * @default 10
2611
+ */
2612
+ maxBatchSize: z.ZodOptional<z.ZodNumber>;
2613
+ /**
2614
+ * Maximum seconds to wait for a full batch.
2615
+ * @default 5
2616
+ */
2617
+ maxBatchTimeout: z.ZodOptional<z.ZodNumber>;
2618
+ /**
2619
+ * Maximum retry attempts for failed messages.
2620
+ * @default 3
2621
+ */
2622
+ maxRetries: z.ZodOptional<z.ZodNumber>;
2623
+ /** Queue name to send failed messages after max retries */
2624
+ deadLetterQueue: z.ZodOptional<z.ZodString>;
2625
+ /** Maximum concurrent batch invocations */
2626
+ maxConcurrency: z.ZodOptional<z.ZodNumber>;
2627
+ /** Delay in seconds between retries */
2628
+ retryDelay: z.ZodOptional<z.ZodNumber>;
2629
+ }, "strip", z.ZodTypeAny, {
2630
+ queue: string;
2631
+ maxBatchSize?: number | undefined;
2632
+ maxBatchTimeout?: number | undefined;
2633
+ maxRetries?: number | undefined;
2634
+ deadLetterQueue?: string | undefined;
2635
+ maxConcurrency?: number | undefined;
2636
+ retryDelay?: number | undefined;
2637
+ }, {
2638
+ queue: string;
2639
+ maxBatchSize?: number | undefined;
2640
+ maxBatchTimeout?: number | undefined;
2641
+ maxRetries?: number | undefined;
2642
+ deadLetterQueue?: string | undefined;
2643
+ maxConcurrency?: number | undefined;
2644
+ retryDelay?: number | undefined;
2645
+ }>, "many">>;
2646
+ }, "strip", z.ZodTypeAny, {
2647
+ producers?: Record<string, string> | undefined;
2648
+ consumers?: {
2649
+ queue: string;
2650
+ maxBatchSize?: number | undefined;
2651
+ maxBatchTimeout?: number | undefined;
2652
+ maxRetries?: number | undefined;
2653
+ deadLetterQueue?: string | undefined;
2654
+ maxConcurrency?: number | undefined;
2655
+ retryDelay?: number | undefined;
2656
+ }[] | undefined;
2657
+ }, {
2658
+ producers?: Record<string, string> | undefined;
2659
+ consumers?: {
2660
+ queue: string;
2661
+ maxBatchSize?: number | undefined;
2662
+ maxBatchTimeout?: number | undefined;
2663
+ maxRetries?: number | undefined;
2664
+ deadLetterQueue?: string | undefined;
2665
+ maxConcurrency?: number | undefined;
2666
+ retryDelay?: number | undefined;
2667
+ }[] | undefined;
2668
+ }>>;
2669
+ /**
2670
+ * Service bindings to other Workers.
2671
+ * Enables RPC-style communication between workers.
2672
+ * @example { MATH: mathWorker.worker }
2673
+ */
2674
+ services: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<{
2675
+ /** Target worker/service name */
2676
+ service: string;
2677
+ /** Optional environment (staging, production, etc.) */
2678
+ environment?: string | undefined;
2679
+ /** Optional entrypoint class name for named exports */
2680
+ entrypoint?: string | undefined;
2681
+ /** @internal Reference marker for ref() bindings */
2682
+ __ref?: unknown;
2683
+ }, z.ZodTypeDef, {
2684
+ /** Target worker/service name */
2685
+ service: string;
2686
+ /** Optional environment (staging, production, etc.) */
2687
+ environment?: string | undefined;
2688
+ /** Optional entrypoint class name for named exports */
2689
+ entrypoint?: string | undefined;
2690
+ /** @internal Reference marker for ref() bindings */
2691
+ __ref?: unknown;
2692
+ }>>>;
2693
+ /**
2694
+ * Workers AI binding for ML inference.
2695
+ * @example { binding: 'AI' }
2696
+ */
2697
+ ai: z.ZodOptional<z.ZodObject<{
2698
+ /** Binding name exposed in env (e.g., 'AI') */
2699
+ binding: z.ZodString;
2700
+ }, "strip", z.ZodTypeAny, {
2701
+ binding: string;
2702
+ }, {
2703
+ binding: string;
2704
+ }>>;
2705
+ /**
2706
+ * Vectorize index bindings for vector similarity search.
2707
+ * @example { EMBEDDINGS: { indexName: 'my-index' } }
2708
+ */
2709
+ vectorize: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
2710
+ /** Name of the Vectorize index */
2711
+ indexName: z.ZodString;
2712
+ }, "strip", z.ZodTypeAny, {
2713
+ indexName: string;
2714
+ }, {
2715
+ indexName: string;
2716
+ }>>>;
2717
+ /**
2718
+ * Hyperdrive bindings for accelerated PostgreSQL.
2719
+ * @example { DB: { id: 'hyperdrive-config-id' } }
2720
+ */
2721
+ hyperdrive: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
2722
+ /** Hyperdrive configuration ID */
2723
+ id: z.ZodString;
2724
+ }, "strip", z.ZodTypeAny, {
2725
+ id: string;
2726
+ }, {
2727
+ id: string;
2728
+ }>>>;
2729
+ /**
2730
+ * Browser Rendering binding for headless browser access.
2731
+ * @example { binding: 'BROWSER' }
2732
+ */
2733
+ browser: z.ZodOptional<z.ZodObject<{
2734
+ /** Binding name exposed in env (e.g., 'BROWSER') */
2735
+ binding: z.ZodString;
2736
+ }, "strip", z.ZodTypeAny, {
2737
+ binding: string;
2738
+ }, {
2739
+ binding: string;
2740
+ }>>;
2741
+ /**
2742
+ * Analytics Engine bindings for event logging.
2743
+ * @example { ANALYTICS: { dataset: 'my-dataset' } }
2744
+ */
2745
+ analyticsEngine: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
2746
+ /** Analytics Engine dataset name */
2747
+ dataset: z.ZodString;
2748
+ }, "strip", z.ZodTypeAny, {
2749
+ dataset: string;
2750
+ }, {
2751
+ dataset: string;
2752
+ }>>>;
2753
+ /**
2754
+ * Email sending bindings.
2755
+ * @example { EMAIL: { destinationAddress: 'admin@example.com' } }
2756
+ * @example { BULK_EMAIL: { allowedDestinationAddresses: ['ops@example.com'], allowedSenderAddresses: ['noreply@example.com'] } }
2757
+ */
2758
+ sendEmail: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodEffects<z.ZodObject<{
2759
+ /** Restrict this binding to a specific verified destination address */
2760
+ destinationAddress: z.ZodOptional<z.ZodString>;
2761
+ /** Restrict this binding to a set of verified destination addresses */
2762
+ allowedDestinationAddresses: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2763
+ /** Restrict this binding to a set of verified sender addresses */
2764
+ allowedSenderAddresses: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2765
+ }, "strip", z.ZodTypeAny, {
2766
+ destinationAddress?: string | undefined;
2767
+ allowedDestinationAddresses?: string[] | undefined;
2768
+ allowedSenderAddresses?: string[] | undefined;
2769
+ }, {
2770
+ destinationAddress?: string | undefined;
2771
+ allowedDestinationAddresses?: string[] | undefined;
2772
+ allowedSenderAddresses?: string[] | undefined;
2773
+ }>, {
2774
+ destinationAddress?: string | undefined;
2775
+ allowedDestinationAddresses?: string[] | undefined;
2776
+ allowedSenderAddresses?: string[] | undefined;
2777
+ }, {
2778
+ destinationAddress?: string | undefined;
2779
+ allowedDestinationAddresses?: string[] | undefined;
2780
+ allowedSenderAddresses?: string[] | undefined;
2781
+ }>>>;
2782
+ }, "strip", z.ZodTypeAny, {
2783
+ kv?: Record<string, string> | undefined;
2784
+ d1?: Record<string, string> | undefined;
2785
+ r2?: Record<string, string> | undefined;
2786
+ durableObjects?: Record<string, DurableObjectBindingInput> | undefined;
2787
+ queues?: {
2788
+ producers?: Record<string, string> | undefined;
2789
+ consumers?: {
2790
+ queue: string;
2791
+ maxBatchSize?: number | undefined;
2792
+ maxBatchTimeout?: number | undefined;
2793
+ maxRetries?: number | undefined;
2794
+ deadLetterQueue?: string | undefined;
2795
+ maxConcurrency?: number | undefined;
2796
+ retryDelay?: number | undefined;
2797
+ }[] | undefined;
2798
+ } | undefined;
2799
+ services?: Record<string, {
2800
+ /** Target worker/service name */
2801
+ service: string;
2802
+ /** Optional environment (staging, production, etc.) */
2803
+ environment?: string | undefined;
2804
+ /** Optional entrypoint class name for named exports */
2805
+ entrypoint?: string | undefined;
2806
+ /** @internal Reference marker for ref() bindings */
2807
+ __ref?: unknown;
2808
+ }> | undefined;
2809
+ ai?: {
2810
+ binding: string;
2811
+ } | undefined;
2812
+ vectorize?: Record<string, {
2813
+ indexName: string;
2814
+ }> | undefined;
2815
+ hyperdrive?: Record<string, {
2816
+ id: string;
2817
+ }> | undefined;
2818
+ browser?: {
2819
+ binding: string;
2820
+ } | undefined;
2821
+ analyticsEngine?: Record<string, {
2822
+ dataset: string;
2823
+ }> | undefined;
2824
+ sendEmail?: Record<string, {
2825
+ destinationAddress?: string | undefined;
2826
+ allowedDestinationAddresses?: string[] | undefined;
2827
+ allowedSenderAddresses?: string[] | undefined;
2828
+ }> | undefined;
2829
+ }, {
2830
+ kv?: Record<string, string> | undefined;
2831
+ d1?: Record<string, string> | undefined;
2832
+ r2?: Record<string, string> | undefined;
2833
+ durableObjects?: Record<string, DurableObjectBindingInput> | undefined;
2834
+ queues?: {
2835
+ producers?: Record<string, string> | undefined;
2836
+ consumers?: {
2837
+ queue: string;
2838
+ maxBatchSize?: number | undefined;
2839
+ maxBatchTimeout?: number | undefined;
2840
+ maxRetries?: number | undefined;
2841
+ deadLetterQueue?: string | undefined;
2842
+ maxConcurrency?: number | undefined;
2843
+ retryDelay?: number | undefined;
2844
+ }[] | undefined;
2845
+ } | undefined;
2846
+ services?: Record<string, {
2847
+ /** Target worker/service name */
2848
+ service: string;
2849
+ /** Optional environment (staging, production, etc.) */
2850
+ environment?: string | undefined;
2851
+ /** Optional entrypoint class name for named exports */
2852
+ entrypoint?: string | undefined;
2853
+ /** @internal Reference marker for ref() bindings */
2854
+ __ref?: unknown;
2855
+ }> | undefined;
2856
+ ai?: {
2857
+ binding: string;
2858
+ } | undefined;
2859
+ vectorize?: Record<string, {
2860
+ indexName: string;
2861
+ }> | undefined;
2862
+ hyperdrive?: Record<string, {
2863
+ id: string;
2864
+ }> | undefined;
2865
+ browser?: {
2866
+ binding: string;
2867
+ } | undefined;
2868
+ analyticsEngine?: Record<string, {
2869
+ dataset: string;
2870
+ }> | undefined;
2871
+ sendEmail?: Record<string, {
2872
+ destinationAddress?: string | undefined;
2873
+ allowedDestinationAddresses?: string[] | undefined;
2874
+ allowedSenderAddresses?: string[] | undefined;
2875
+ }> | undefined;
2876
+ }>>>;
2877
+ triggers: z.ZodOptional<z.ZodOptional<z.ZodObject<{
2011
2878
  /**
2012
- * Durable Object class discovery glob pattern.
2013
- * Files matching this pattern are scanned for DO classes.
2014
- * Respects `.gitignore` automatically.
2879
+ * Array of cron expressions for scheduled execution.
2015
2880
  *
2016
- * @default `**​/do.*.{ts,js}` (recursive)
2017
- * @example `**​/do.*.{ts,js}` — Matches src/do.counter.ts, lib/do.chat.ts
2018
- * @example `src/do.*.ts` — Legacy single-directory pattern
2881
+ * Examples:
2882
+ * - `'0 0 * * *'` Daily at midnight
2883
+ * - `'0/5 * * * *'` — Every 5 minutes
2884
+ * - `'0 9 * * 1'` — Every Monday at 9am
2019
2885
  */
2020
- durableObjects: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>>;
2886
+ crons: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2887
+ }, "strip", z.ZodTypeAny, {
2888
+ crons?: string[] | undefined;
2889
+ }, {
2890
+ crons?: string[] | undefined;
2891
+ }>>>;
2892
+ vars: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>>;
2893
+ secrets: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
2894
+ /**
2895
+ * Whether this secret is required for the worker to run.
2896
+ * If true, worker will fail to start if secret is missing.
2897
+ * @default true
2898
+ */
2899
+ required: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
2900
+ }, "strip", z.ZodTypeAny, {
2901
+ required: boolean;
2902
+ }, {
2903
+ required?: boolean | undefined;
2904
+ }>>>>;
2905
+ routes: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodObject<{
2906
+ /**
2907
+ * URL pattern to match (e.g., 'example.com/*').
2908
+ * Supports wildcards (*) for path matching.
2909
+ */
2910
+ pattern: z.ZodString;
2911
+ /** Zone name to associate the route with */
2912
+ zone_name: z.ZodOptional<z.ZodString>;
2913
+ /** Zone ID to associate the route with (alternative to zone_name) */
2914
+ zone_id: z.ZodOptional<z.ZodString>;
2915
+ /** Whether this is a custom domain route */
2916
+ custom_domain: z.ZodOptional<z.ZodBoolean>;
2917
+ }, "strip", z.ZodTypeAny, {
2918
+ pattern: string;
2919
+ zone_name?: string | undefined;
2920
+ zone_id?: string | undefined;
2921
+ custom_domain?: boolean | undefined;
2922
+ }, {
2923
+ pattern: string;
2924
+ zone_name?: string | undefined;
2925
+ zone_id?: string | undefined;
2926
+ custom_domain?: boolean | undefined;
2927
+ }>, "many">>>;
2928
+ assets: z.ZodOptional<z.ZodOptional<z.ZodObject<{
2929
+ /** Directory containing static assets (relative to config file) */
2930
+ directory: z.ZodString;
2931
+ /**
2932
+ * Optional binding name to access assets programmatically.
2933
+ * If provided, assets can be fetched via env[binding].fetch()
2934
+ */
2935
+ binding: z.ZodOptional<z.ZodString>;
2936
+ }, "strip", z.ZodTypeAny, {
2937
+ directory: string;
2938
+ binding?: string | undefined;
2939
+ }, {
2940
+ directory: string;
2941
+ binding?: string | undefined;
2942
+ }>>>;
2943
+ limits: z.ZodOptional<z.ZodOptional<z.ZodObject<{
2944
+ /**
2945
+ * Maximum CPU time in milliseconds.
2946
+ * Only applicable to Workers with Usage Model set to Unbound.
2947
+ */
2948
+ cpu_ms: z.ZodOptional<z.ZodNumber>;
2949
+ }, "strip", z.ZodTypeAny, {
2950
+ cpu_ms?: number | undefined;
2951
+ }, {
2952
+ cpu_ms?: number | undefined;
2953
+ }>>>;
2954
+ observability: z.ZodOptional<z.ZodOptional<z.ZodObject<{
2955
+ /** Enable Worker Logs */
2956
+ enabled: z.ZodOptional<z.ZodBoolean>;
2957
+ /**
2958
+ * Head sampling rate for logs (0-1).
2959
+ * 1.0 = log all requests, 0.1 = log 10% of requests.
2960
+ */
2961
+ head_sampling_rate: z.ZodOptional<z.ZodNumber>;
2962
+ }, "strip", z.ZodTypeAny, {
2963
+ enabled?: boolean | undefined;
2964
+ head_sampling_rate?: number | undefined;
2965
+ }, {
2966
+ enabled?: boolean | undefined;
2967
+ head_sampling_rate?: number | undefined;
2968
+ }>>>;
2969
+ migrations: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodObject<{
2970
+ /**
2971
+ * Migration tag (version identifier).
2972
+ * Must be unique and in chronological order.
2973
+ * @example 'v1', 'v2'
2974
+ */
2975
+ tag: z.ZodString;
2976
+ /**
2977
+ * New DO classes introduced in this migration.
2978
+ * Classes that didn't exist before.
2979
+ */
2980
+ new_classes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2981
+ /**
2982
+ * Classes being renamed.
2983
+ * State is preserved during rename.
2984
+ */
2985
+ renamed_classes: z.ZodOptional<z.ZodArray<z.ZodObject<{
2986
+ from: z.ZodString;
2987
+ to: z.ZodString;
2988
+ }, "strip", z.ZodTypeAny, {
2989
+ from: string;
2990
+ to: string;
2991
+ }, {
2992
+ from: string;
2993
+ to: string;
2994
+ }>, "many">>;
2995
+ /**
2996
+ * Classes being deleted.
2997
+ * ⚠️ All state in these classes will be lost!
2998
+ */
2999
+ deleted_classes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
3000
+ /**
3001
+ * Classes migrating to SQLite storage backend.
3002
+ * Enables SQL API for these DO classes.
3003
+ */
3004
+ new_sqlite_classes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
3005
+ }, "strip", z.ZodTypeAny, {
3006
+ tag: string;
3007
+ new_classes?: string[] | undefined;
3008
+ renamed_classes?: {
3009
+ from: string;
3010
+ to: string;
3011
+ }[] | undefined;
3012
+ deleted_classes?: string[] | undefined;
3013
+ new_sqlite_classes?: string[] | undefined;
3014
+ }, {
3015
+ tag: string;
3016
+ new_classes?: string[] | undefined;
3017
+ renamed_classes?: {
3018
+ from: string;
3019
+ to: string;
3020
+ }[] | undefined;
3021
+ deleted_classes?: string[] | undefined;
3022
+ new_sqlite_classes?: string[] | undefined;
3023
+ }>, "many">>>;
3024
+ rolldown: z.ZodOptional<z.ZodOptional<z.ZodObject<{
3025
+ /**
3026
+ * Bundle target environment.
3027
+ * @example 'es2022'
3028
+ */
3029
+ target: z.ZodOptional<z.ZodString>;
3030
+ /** Enable minification for emitted DO bundles */
3031
+ minify: z.ZodOptional<z.ZodBoolean>;
3032
+ /** Generate source maps for emitted DO bundles */
3033
+ sourcemap: z.ZodOptional<z.ZodBoolean>;
3034
+ /**
3035
+ * Additional raw Rolldown options.
3036
+ * @see https://rolldown.rs/
3037
+ */
3038
+ options: z.ZodOptional<z.ZodType<DevflareRolldownOptions, z.ZodTypeDef, DevflareRolldownOptions>>;
3039
+ }, "strip", z.ZodTypeAny, {
3040
+ target?: string | undefined;
3041
+ minify?: boolean | undefined;
3042
+ sourcemap?: boolean | undefined;
3043
+ options?: DevflareRolldownOptions | undefined;
3044
+ }, {
3045
+ target?: string | undefined;
3046
+ minify?: boolean | undefined;
3047
+ sourcemap?: boolean | undefined;
3048
+ options?: DevflareRolldownOptions | undefined;
3049
+ }>>>;
3050
+ vite: z.ZodOptional<z.ZodOptional<z.ZodObject<{
3051
+ /**
3052
+ * Devflare-level Vite plugin metadata sourced from devflare.config.ts.
3053
+ * Raw Vite plugin wiring still belongs in `vite.config.*`.
3054
+ */
3055
+ plugins: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
3056
+ }, "strip", z.ZodUnknown, z.objectOutputType<{
2021
3057
  /**
2022
- * WorkerEntrypoint class discovery glob pattern.
2023
- * Files matching this pattern are scanned for named entrypoint classes.
2024
- * Respects `.gitignore` automatically.
2025
- *
2026
- * Entrypoints enable typed cross-worker RPC via service bindings:
2027
- * ```ts
2028
- * // ep.admin.ts
2029
- * export class AdminEntrypoint extends WorkerEntrypoint {
2030
- * async getStats() { return { users: 100 } }
2031
- * }
2032
- *
2033
- * // Consumer worker
2034
- * const stats = await env.ADMIN_SERVICE.getStats()
2035
- * ```
2036
- *
2037
- * @default `**​/ep.*.{ts,js}` (recursive)
2038
- * @example `**​/ep.*.{ts,js}` — Matches src/ep.admin.ts, lib/ep.auth.ts
2039
- * @example `src/ep.*.ts` — Legacy single-directory pattern
3058
+ * Devflare-level Vite plugin metadata sourced from devflare.config.ts.
3059
+ * Raw Vite plugin wiring still belongs in `vite.config.*`.
2040
3060
  */
2041
- entrypoints: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>>;
3061
+ plugins: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
3062
+ }, z.ZodUnknown, "strip">, z.objectInputType<{
2042
3063
  /**
2043
- * Workflow class discovery glob pattern.
2044
- * Files matching this pattern are scanned for Workflow classes.
2045
- * Respects `.gitignore` automatically.
2046
- *
2047
- * Workflows enable durable multi-step execution with automatic retries:
2048
- * ```ts
2049
- * // wf.order-processor.ts
2050
- * export class OrderProcessingWorkflow extends Workflow {
2051
- * async run(event, step) {
2052
- * const validated = await step.do('validate', () => validate(event.payload))
2053
- * const charged = await step.do('charge', () => charge(validated))
2054
- * return { orderId: charged.id }
2055
- * }
2056
- * }
2057
- * ```
2058
- *
2059
- * @default `**​/wf.*.{ts,js}` (recursive)
2060
- * @example `**​/wf.*.{ts,js}` — Matches src/wf.order.ts, lib/wf.pipeline.ts
2061
- * @example `src/wf.*.ts` — Legacy single-directory pattern
3064
+ * Devflare-level Vite plugin metadata sourced from devflare.config.ts.
3065
+ * Raw Vite plugin wiring still belongs in `vite.config.*`.
2062
3066
  */
2063
- workflows: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodLiteral<false>]>>;
3067
+ plugins: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
3068
+ }, z.ZodUnknown, "strip">>>>;
3069
+ wrangler: z.ZodOptional<z.ZodOptional<z.ZodObject<{
2064
3070
  /**
2065
- * File-based routing configuration.
2066
- * Enables automatic route discovery from a directory.
2067
- *
2068
- * Directory structure maps to URL paths:
2069
- * ```
2070
- * src/routes/
2071
- * ├── index.ts → GET /
2072
- * ├── users/
2073
- * │ ├── index.ts → GET /users POST /users
2074
- * │ ├── [id].ts → GET /users/:id
2075
- * │ └── [id]/
2076
- * │ └── posts.ts → GET /users/:id/posts
2077
- * └── api/
2078
- * └── health.ts → GET /api/health
2079
- * ```
2080
- *
2081
- * Each file exports HTTP method handlers:
2082
- * ```ts
2083
- * export function GET(req: Request, env: Env) { ... }
2084
- * export function POST(req: Request, env: Env) { ... }
2085
- * ```
3071
+ * Arbitrary key-value pairs passed directly to wrangler.jsonc.
3072
+ * @example { placement: { mode: 'smart' } }
2086
3073
  */
2087
- routes: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
2088
- /** Directory containing route files (e.g., 'src/routes') */
2089
- dir: z.ZodString;
2090
- /** Optional URL prefix for all routes (e.g., '/api') */
2091
- prefix: z.ZodOptional<z.ZodString>;
2092
- }, "strip", z.ZodTypeAny, {
2093
- dir: string;
2094
- prefix?: string | undefined;
2095
- }, {
2096
- dir: string;
2097
- prefix?: string | undefined;
2098
- }>, z.ZodLiteral<false>]>>;
3074
+ passthrough: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
3075
+ }, "strip", z.ZodTypeAny, {
3076
+ passthrough?: Record<string, unknown> | undefined;
3077
+ }, {
3078
+ passthrough?: Record<string, unknown> | undefined;
3079
+ }>>>;
3080
+ } & {
3081
+ /** @deprecated Use `rolldown` instead. */
3082
+ build: z.ZodOptional<z.ZodObject<{
2099
3083
  /**
2100
- * Transport file for custom RPC serialization.
2101
- * Implements SvelteKit-style encode/decode for complex types.
2102
- * @default 'src/transport.ts'
2103
- * @example 'src/transport.ts'
3084
+ * Legacy alias for `rolldown.target`.
3085
+ * @example 'es2022'
2104
3086
  */
2105
- transport: z.ZodOptional<z.ZodString>;
3087
+ target: z.ZodOptional<z.ZodString>;
3088
+ /** Legacy alias for `rolldown.minify`. */
3089
+ minify: z.ZodOptional<z.ZodBoolean>;
3090
+ /** Legacy alias for `rolldown.sourcemap`. */
3091
+ sourcemap: z.ZodOptional<z.ZodBoolean>;
3092
+ /** Legacy alias for `rolldown.options`. */
3093
+ rolldownOptions: z.ZodOptional<z.ZodType<DevflareRolldownOptions, z.ZodTypeDef, DevflareRolldownOptions>>;
2106
3094
  }, "strip", z.ZodTypeAny, {
2107
- fetch?: string | false | undefined;
2108
- queue?: string | false | undefined;
2109
- scheduled?: string | false | undefined;
2110
- email?: string | false | undefined;
2111
- durableObjects?: string | false | undefined;
2112
- entrypoints?: string | false | undefined;
2113
- workflows?: string | false | undefined;
2114
- routes?: false | {
2115
- dir: string;
2116
- prefix?: string | undefined;
2117
- } | undefined;
2118
- transport?: string | undefined;
3095
+ target?: string | undefined;
3096
+ minify?: boolean | undefined;
3097
+ sourcemap?: boolean | undefined;
3098
+ rolldownOptions?: DevflareRolldownOptions | undefined;
2119
3099
  }, {
3100
+ target?: string | undefined;
3101
+ minify?: boolean | undefined;
3102
+ sourcemap?: boolean | undefined;
3103
+ rolldownOptions?: DevflareRolldownOptions | undefined;
3104
+ }>>;
3105
+ /** @deprecated Use `vite.plugins` instead. */
3106
+ plugins: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
3107
+ }, "strip", z.ZodTypeAny, {
3108
+ name?: string | undefined;
3109
+ compatibilityDate?: string | undefined;
3110
+ compatibilityFlags?: string[] | undefined;
3111
+ files?: {
2120
3112
  fetch?: string | false | undefined;
2121
3113
  queue?: string | false | undefined;
2122
3114
  scheduled?: string | false | undefined;
@@ -2129,88 +3121,13 @@ export declare const configSchema: z.ZodObject<{
2129
3121
  prefix?: string | undefined;
2130
3122
  } | undefined;
2131
3123
  transport?: string | undefined;
2132
- }>>>;
2133
- bindings: z.ZodOptional<z.ZodOptional<z.ZodObject<{
2134
- /**
2135
- * KV Namespace bindings.
2136
- * Maps binding name to KV namespace ID.
2137
- * @example { CACHE: 'cache-kv-namespace-id' }
2138
- */
2139
- kv: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2140
- /**
2141
- * D1 Database bindings.
2142
- * Maps binding name to D1 database ID.
2143
- * @example { DB: 'main-database-id' }
2144
- */
2145
- d1: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2146
- /**
2147
- * R2 Bucket bindings.
2148
- * Maps binding name to R2 bucket name.
2149
- * @example { IMAGES: 'images-bucket' }
2150
- */
2151
- r2: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2152
- /**
2153
- * Durable Object bindings.
2154
- * Maps binding name to DO class configuration.
2155
- * @example { COUNTER: 'Counter' } or { COUNTER: { className: 'Counter' } }
2156
- */
2157
- durableObjects: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<DurableObjectBindingInput, z.ZodTypeDef, DurableObjectBindingInput>>>;
2158
- /**
2159
- * Queue bindings for producers and consumers.
2160
- */
2161
- queues: z.ZodOptional<z.ZodObject<{
2162
- /**
2163
- * Queue producer bindings.
2164
- * Maps binding name to queue name.
2165
- * @example { TASK_QUEUE: 'task-queue' }
2166
- */
2167
- producers: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
2168
- /**
2169
- * Queue consumer configurations.
2170
- * Array of consumer configs for processing queue messages.
2171
- */
2172
- consumers: z.ZodOptional<z.ZodArray<z.ZodObject<{
2173
- /** Queue name to consume from */
2174
- queue: z.ZodString;
2175
- /**
2176
- * Maximum messages per batch (1-100).
2177
- * @default 10
2178
- */
2179
- maxBatchSize: z.ZodOptional<z.ZodNumber>;
2180
- /**
2181
- * Maximum seconds to wait for a full batch.
2182
- * @default 5
2183
- */
2184
- maxBatchTimeout: z.ZodOptional<z.ZodNumber>;
2185
- /**
2186
- * Maximum retry attempts for failed messages.
2187
- * @default 3
2188
- */
2189
- maxRetries: z.ZodOptional<z.ZodNumber>;
2190
- /** Queue name to send failed messages after max retries */
2191
- deadLetterQueue: z.ZodOptional<z.ZodString>;
2192
- /** Maximum concurrent batch invocations */
2193
- maxConcurrency: z.ZodOptional<z.ZodNumber>;
2194
- /** Delay in seconds between retries */
2195
- retryDelay: z.ZodOptional<z.ZodNumber>;
2196
- }, "strip", z.ZodTypeAny, {
2197
- queue: string;
2198
- maxBatchSize?: number | undefined;
2199
- maxBatchTimeout?: number | undefined;
2200
- maxRetries?: number | undefined;
2201
- deadLetterQueue?: string | undefined;
2202
- maxConcurrency?: number | undefined;
2203
- retryDelay?: number | undefined;
2204
- }, {
2205
- queue: string;
2206
- maxBatchSize?: number | undefined;
2207
- maxBatchTimeout?: number | undefined;
2208
- maxRetries?: number | undefined;
2209
- deadLetterQueue?: string | undefined;
2210
- maxConcurrency?: number | undefined;
2211
- retryDelay?: number | undefined;
2212
- }>, "many">>;
2213
- }, "strip", z.ZodTypeAny, {
3124
+ } | undefined;
3125
+ bindings?: {
3126
+ kv?: Record<string, string> | undefined;
3127
+ d1?: Record<string, string> | undefined;
3128
+ r2?: Record<string, string> | undefined;
3129
+ durableObjects?: Record<string, DurableObjectBindingInput> | undefined;
3130
+ queues?: {
2214
3131
  producers?: Record<string, string> | undefined;
2215
3132
  consumers?: {
2216
3133
  queue: string;
@@ -2221,7 +3138,119 @@ export declare const configSchema: z.ZodObject<{
2221
3138
  maxConcurrency?: number | undefined;
2222
3139
  retryDelay?: number | undefined;
2223
3140
  }[] | undefined;
2224
- }, {
3141
+ } | undefined;
3142
+ services?: Record<string, {
3143
+ /** Target worker/service name */
3144
+ service: string;
3145
+ /** Optional environment (staging, production, etc.) */
3146
+ environment?: string | undefined;
3147
+ /** Optional entrypoint class name for named exports */
3148
+ entrypoint?: string | undefined;
3149
+ /** @internal Reference marker for ref() bindings */
3150
+ __ref?: unknown;
3151
+ }> | undefined;
3152
+ ai?: {
3153
+ binding: string;
3154
+ } | undefined;
3155
+ vectorize?: Record<string, {
3156
+ indexName: string;
3157
+ }> | undefined;
3158
+ hyperdrive?: Record<string, {
3159
+ id: string;
3160
+ }> | undefined;
3161
+ browser?: {
3162
+ binding: string;
3163
+ } | undefined;
3164
+ analyticsEngine?: Record<string, {
3165
+ dataset: string;
3166
+ }> | undefined;
3167
+ sendEmail?: Record<string, {
3168
+ destinationAddress?: string | undefined;
3169
+ allowedDestinationAddresses?: string[] | undefined;
3170
+ allowedSenderAddresses?: string[] | undefined;
3171
+ }> | undefined;
3172
+ } | undefined;
3173
+ triggers?: {
3174
+ crons?: string[] | undefined;
3175
+ } | undefined;
3176
+ vars?: Record<string, string> | undefined;
3177
+ secrets?: Record<string, {
3178
+ required: boolean;
3179
+ }> | undefined;
3180
+ routes?: {
3181
+ pattern: string;
3182
+ zone_name?: string | undefined;
3183
+ zone_id?: string | undefined;
3184
+ custom_domain?: boolean | undefined;
3185
+ }[] | undefined;
3186
+ assets?: {
3187
+ directory: string;
3188
+ binding?: string | undefined;
3189
+ } | undefined;
3190
+ limits?: {
3191
+ cpu_ms?: number | undefined;
3192
+ } | undefined;
3193
+ observability?: {
3194
+ enabled?: boolean | undefined;
3195
+ head_sampling_rate?: number | undefined;
3196
+ } | undefined;
3197
+ migrations?: {
3198
+ tag: string;
3199
+ new_classes?: string[] | undefined;
3200
+ renamed_classes?: {
3201
+ from: string;
3202
+ to: string;
3203
+ }[] | undefined;
3204
+ deleted_classes?: string[] | undefined;
3205
+ new_sqlite_classes?: string[] | undefined;
3206
+ }[] | undefined;
3207
+ rolldown?: {
3208
+ target?: string | undefined;
3209
+ minify?: boolean | undefined;
3210
+ sourcemap?: boolean | undefined;
3211
+ options?: DevflareRolldownOptions | undefined;
3212
+ } | undefined;
3213
+ vite?: z.objectOutputType<{
3214
+ /**
3215
+ * Devflare-level Vite plugin metadata sourced from devflare.config.ts.
3216
+ * Raw Vite plugin wiring still belongs in `vite.config.*`.
3217
+ */
3218
+ plugins: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
3219
+ }, z.ZodUnknown, "strip"> | undefined;
3220
+ wrangler?: {
3221
+ passthrough?: Record<string, unknown> | undefined;
3222
+ } | undefined;
3223
+ build?: {
3224
+ target?: string | undefined;
3225
+ minify?: boolean | undefined;
3226
+ sourcemap?: boolean | undefined;
3227
+ rolldownOptions?: DevflareRolldownOptions | undefined;
3228
+ } | undefined;
3229
+ plugins?: unknown[] | undefined;
3230
+ }, {
3231
+ name?: string | undefined;
3232
+ compatibilityDate?: string | undefined;
3233
+ compatibilityFlags?: string[] | undefined;
3234
+ files?: {
3235
+ fetch?: string | false | undefined;
3236
+ queue?: string | false | undefined;
3237
+ scheduled?: string | false | undefined;
3238
+ email?: string | false | undefined;
3239
+ durableObjects?: string | false | undefined;
3240
+ entrypoints?: string | false | undefined;
3241
+ workflows?: string | false | undefined;
3242
+ routes?: false | {
3243
+ dir: string;
3244
+ prefix?: string | undefined;
3245
+ } | undefined;
3246
+ transport?: string | undefined;
3247
+ } | undefined;
3248
+ bindings?: {
3249
+ kv?: Record<string, string> | undefined;
3250
+ d1?: Record<string, string> | undefined;
3251
+ r2?: Record<string, string> | undefined;
3252
+ durableObjects?: Record<string, DurableObjectBindingInput> | undefined;
3253
+ queues?: {
2225
3254
  producers?: Record<string, string> | undefined;
2226
3255
  consumers?: {
2227
3256
  queue: string;
@@ -2232,22 +3261,8 @@ export declare const configSchema: z.ZodObject<{
2232
3261
  maxConcurrency?: number | undefined;
2233
3262
  retryDelay?: number | undefined;
2234
3263
  }[] | undefined;
2235
- }>>;
2236
- /**
2237
- * Service bindings to other Workers.
2238
- * Enables RPC-style communication between workers.
2239
- * @example { MATH: mathWorker.worker }
2240
- */
2241
- services: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodType<{
2242
- /** Target worker/service name */
2243
- service: string;
2244
- /** Optional environment (staging, production, etc.) */
2245
- environment?: string | undefined;
2246
- /** Optional entrypoint class name for named exports */
2247
- entrypoint?: string | undefined;
2248
- /** @internal Reference marker for ref() bindings */
2249
- __ref?: unknown;
2250
- }, z.ZodTypeDef, {
3264
+ } | undefined;
3265
+ services?: Record<string, {
2251
3266
  /** Target worker/service name */
2252
3267
  service: string;
2253
3268
  /** Optional environment (staging, production, etc.) */
@@ -2256,80 +3271,104 @@ export declare const configSchema: z.ZodObject<{
2256
3271
  entrypoint?: string | undefined;
2257
3272
  /** @internal Reference marker for ref() bindings */
2258
3273
  __ref?: unknown;
2259
- }>>>;
2260
- /**
2261
- * Workers AI binding for ML inference.
2262
- * @example { binding: 'AI' }
2263
- */
2264
- ai: z.ZodOptional<z.ZodObject<{
2265
- /** Binding name exposed in env (e.g., 'AI') */
2266
- binding: z.ZodString;
2267
- }, "strip", z.ZodTypeAny, {
2268
- binding: string;
2269
- }, {
3274
+ }> | undefined;
3275
+ ai?: {
2270
3276
  binding: string;
2271
- }>>;
2272
- /**
2273
- * Vectorize index bindings for vector similarity search.
2274
- * @example { EMBEDDINGS: { indexName: 'my-index' } }
2275
- */
2276
- vectorize: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
2277
- /** Name of the Vectorize index */
2278
- indexName: z.ZodString;
2279
- }, "strip", z.ZodTypeAny, {
2280
- indexName: string;
2281
- }, {
3277
+ } | undefined;
3278
+ vectorize?: Record<string, {
2282
3279
  indexName: string;
2283
- }>>>;
2284
- /**
2285
- * Hyperdrive bindings for accelerated PostgreSQL.
2286
- * @example { DB: { id: 'hyperdrive-config-id' } }
2287
- */
2288
- hyperdrive: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
2289
- /** Hyperdrive configuration ID */
2290
- id: z.ZodString;
2291
- }, "strip", z.ZodTypeAny, {
2292
- id: string;
2293
- }, {
3280
+ }> | undefined;
3281
+ hyperdrive?: Record<string, {
2294
3282
  id: string;
2295
- }>>>;
2296
- /**
2297
- * Browser Rendering binding for headless browser access.
2298
- * @example { binding: 'BROWSER' }
2299
- */
2300
- browser: z.ZodOptional<z.ZodObject<{
2301
- /** Binding name exposed in env (e.g., 'BROWSER') */
2302
- binding: z.ZodString;
2303
- }, "strip", z.ZodTypeAny, {
2304
- binding: string;
2305
- }, {
3283
+ }> | undefined;
3284
+ browser?: {
2306
3285
  binding: string;
2307
- }>>;
2308
- /**
2309
- * Analytics Engine bindings for event logging.
2310
- * @example { ANALYTICS: { dataset: 'my-dataset' } }
2311
- */
2312
- analyticsEngine: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
2313
- /** Analytics Engine dataset name */
2314
- dataset: z.ZodString;
2315
- }, "strip", z.ZodTypeAny, {
2316
- dataset: string;
2317
- }, {
3286
+ } | undefined;
3287
+ analyticsEngine?: Record<string, {
2318
3288
  dataset: string;
2319
- }>>>;
3289
+ }> | undefined;
3290
+ sendEmail?: Record<string, {
3291
+ destinationAddress?: string | undefined;
3292
+ allowedDestinationAddresses?: string[] | undefined;
3293
+ allowedSenderAddresses?: string[] | undefined;
3294
+ }> | undefined;
3295
+ } | undefined;
3296
+ triggers?: {
3297
+ crons?: string[] | undefined;
3298
+ } | undefined;
3299
+ vars?: Record<string, string> | undefined;
3300
+ secrets?: Record<string, {
3301
+ required?: boolean | undefined;
3302
+ }> | undefined;
3303
+ routes?: {
3304
+ pattern: string;
3305
+ zone_name?: string | undefined;
3306
+ zone_id?: string | undefined;
3307
+ custom_domain?: boolean | undefined;
3308
+ }[] | undefined;
3309
+ assets?: {
3310
+ directory: string;
3311
+ binding?: string | undefined;
3312
+ } | undefined;
3313
+ limits?: {
3314
+ cpu_ms?: number | undefined;
3315
+ } | undefined;
3316
+ observability?: {
3317
+ enabled?: boolean | undefined;
3318
+ head_sampling_rate?: number | undefined;
3319
+ } | undefined;
3320
+ migrations?: {
3321
+ tag: string;
3322
+ new_classes?: string[] | undefined;
3323
+ renamed_classes?: {
3324
+ from: string;
3325
+ to: string;
3326
+ }[] | undefined;
3327
+ deleted_classes?: string[] | undefined;
3328
+ new_sqlite_classes?: string[] | undefined;
3329
+ }[] | undefined;
3330
+ rolldown?: {
3331
+ target?: string | undefined;
3332
+ minify?: boolean | undefined;
3333
+ sourcemap?: boolean | undefined;
3334
+ options?: DevflareRolldownOptions | undefined;
3335
+ } | undefined;
3336
+ vite?: z.objectInputType<{
2320
3337
  /**
2321
- * Email sending bindings.
2322
- * @example { EMAIL: { destinationAddress: 'admin@example.com' } }
3338
+ * Devflare-level Vite plugin metadata sourced from devflare.config.ts.
3339
+ * Raw Vite plugin wiring still belongs in `vite.config.*`.
2323
3340
  */
2324
- sendEmail: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
2325
- /** Default destination address (can be overridden per-send) */
2326
- destinationAddress: z.ZodOptional<z.ZodString>;
2327
- }, "strip", z.ZodTypeAny, {
2328
- destinationAddress?: string | undefined;
2329
- }, {
2330
- destinationAddress?: string | undefined;
2331
- }>>>;
2332
- }, "strip", z.ZodTypeAny, {
3341
+ plugins: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
3342
+ }, z.ZodUnknown, "strip"> | undefined;
3343
+ wrangler?: {
3344
+ passthrough?: Record<string, unknown> | undefined;
3345
+ } | undefined;
3346
+ build?: {
3347
+ target?: string | undefined;
3348
+ minify?: boolean | undefined;
3349
+ sourcemap?: boolean | undefined;
3350
+ rolldownOptions?: DevflareRolldownOptions | undefined;
3351
+ } | undefined;
3352
+ plugins?: unknown[] | undefined;
3353
+ }>, {
3354
+ name?: string | undefined;
3355
+ compatibilityDate?: string | undefined;
3356
+ compatibilityFlags?: string[] | undefined;
3357
+ files?: {
3358
+ fetch?: string | false | undefined;
3359
+ queue?: string | false | undefined;
3360
+ scheduled?: string | false | undefined;
3361
+ email?: string | false | undefined;
3362
+ durableObjects?: string | false | undefined;
3363
+ entrypoints?: string | false | undefined;
3364
+ workflows?: string | false | undefined;
3365
+ routes?: false | {
3366
+ dir: string;
3367
+ prefix?: string | undefined;
3368
+ } | undefined;
3369
+ transport?: string | undefined;
3370
+ } | undefined;
3371
+ bindings?: {
2333
3372
  kv?: Record<string, string> | undefined;
2334
3373
  d1?: Record<string, string> | undefined;
2335
3374
  r2?: Record<string, string> | undefined;
@@ -2373,8 +3412,79 @@ export declare const configSchema: z.ZodObject<{
2373
3412
  }> | undefined;
2374
3413
  sendEmail?: Record<string, {
2375
3414
  destinationAddress?: string | undefined;
3415
+ allowedDestinationAddresses?: string[] | undefined;
3416
+ allowedSenderAddresses?: string[] | undefined;
2376
3417
  }> | undefined;
2377
- }, {
3418
+ } | undefined;
3419
+ triggers?: {
3420
+ crons?: string[] | undefined;
3421
+ } | undefined;
3422
+ vars?: Record<string, string> | undefined;
3423
+ secrets?: Record<string, {
3424
+ required: boolean;
3425
+ }> | undefined;
3426
+ routes?: {
3427
+ pattern: string;
3428
+ zone_name?: string | undefined;
3429
+ zone_id?: string | undefined;
3430
+ custom_domain?: boolean | undefined;
3431
+ }[] | undefined;
3432
+ assets?: {
3433
+ directory: string;
3434
+ binding?: string | undefined;
3435
+ } | undefined;
3436
+ limits?: {
3437
+ cpu_ms?: number | undefined;
3438
+ } | undefined;
3439
+ observability?: {
3440
+ enabled?: boolean | undefined;
3441
+ head_sampling_rate?: number | undefined;
3442
+ } | undefined;
3443
+ migrations?: {
3444
+ tag: string;
3445
+ new_classes?: string[] | undefined;
3446
+ renamed_classes?: {
3447
+ from: string;
3448
+ to: string;
3449
+ }[] | undefined;
3450
+ deleted_classes?: string[] | undefined;
3451
+ new_sqlite_classes?: string[] | undefined;
3452
+ }[] | undefined;
3453
+ rolldown?: {
3454
+ target?: string | undefined;
3455
+ minify?: boolean | undefined;
3456
+ sourcemap?: boolean | undefined;
3457
+ options?: DevflareRolldownOptions | undefined;
3458
+ } | undefined;
3459
+ vite?: z.objectOutputType<{
3460
+ /**
3461
+ * Devflare-level Vite plugin metadata sourced from devflare.config.ts.
3462
+ * Raw Vite plugin wiring still belongs in `vite.config.*`.
3463
+ */
3464
+ plugins: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
3465
+ }, z.ZodUnknown, "strip"> | undefined;
3466
+ wrangler?: {
3467
+ passthrough?: Record<string, unknown> | undefined;
3468
+ } | undefined;
3469
+ }, {
3470
+ name?: string | undefined;
3471
+ compatibilityDate?: string | undefined;
3472
+ compatibilityFlags?: string[] | undefined;
3473
+ files?: {
3474
+ fetch?: string | false | undefined;
3475
+ queue?: string | false | undefined;
3476
+ scheduled?: string | false | undefined;
3477
+ email?: string | false | undefined;
3478
+ durableObjects?: string | false | undefined;
3479
+ entrypoints?: string | false | undefined;
3480
+ workflows?: string | false | undefined;
3481
+ routes?: false | {
3482
+ dir: string;
3483
+ prefix?: string | undefined;
3484
+ } | undefined;
3485
+ transport?: string | undefined;
3486
+ } | undefined;
3487
+ bindings?: {
2378
3488
  kv?: Record<string, string> | undefined;
2379
3489
  d1?: Record<string, string> | undefined;
2380
3490
  r2?: Record<string, string> | undefined;
@@ -2418,146 +3528,35 @@ export declare const configSchema: z.ZodObject<{
2418
3528
  }> | undefined;
2419
3529
  sendEmail?: Record<string, {
2420
3530
  destinationAddress?: string | undefined;
3531
+ allowedDestinationAddresses?: string[] | undefined;
3532
+ allowedSenderAddresses?: string[] | undefined;
2421
3533
  }> | undefined;
2422
- }>>>;
2423
- triggers: z.ZodOptional<z.ZodOptional<z.ZodObject<{
2424
- /**
2425
- * Array of cron expressions for scheduled execution.
2426
- *
2427
- * Examples:
2428
- * - `'0 0 * * *'` — Daily at midnight
2429
- * - `'0/5 * * * *'` — Every 5 minutes
2430
- * - `'0 9 * * 1'` — Every Monday at 9am
2431
- */
2432
- crons: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2433
- }, "strip", z.ZodTypeAny, {
2434
- crons?: string[] | undefined;
2435
- }, {
3534
+ } | undefined;
3535
+ triggers?: {
2436
3536
  crons?: string[] | undefined;
2437
- }>>>;
2438
- vars: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>>;
2439
- secrets: z.ZodOptional<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
2440
- /**
2441
- * Whether this secret is required for the worker to run.
2442
- * If true, worker will fail to start if secret is missing.
2443
- * @default true
2444
- */
2445
- required: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
2446
- }, "strip", z.ZodTypeAny, {
2447
- required: boolean;
2448
- }, {
3537
+ } | undefined;
3538
+ vars?: Record<string, string> | undefined;
3539
+ secrets?: Record<string, {
2449
3540
  required?: boolean | undefined;
2450
- }>>>>;
2451
- routes: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodObject<{
2452
- /**
2453
- * URL pattern to match (e.g., 'example.com/*').
2454
- * Supports wildcards (*) for path matching.
2455
- */
2456
- pattern: z.ZodString;
2457
- /** Zone name to associate the route with */
2458
- zone_name: z.ZodOptional<z.ZodString>;
2459
- /** Zone ID to associate the route with (alternative to zone_name) */
2460
- zone_id: z.ZodOptional<z.ZodString>;
2461
- /** Whether this is a custom domain route */
2462
- custom_domain: z.ZodOptional<z.ZodBoolean>;
2463
- }, "strip", z.ZodTypeAny, {
2464
- pattern: string;
2465
- zone_name?: string | undefined;
2466
- zone_id?: string | undefined;
2467
- custom_domain?: boolean | undefined;
2468
- }, {
3541
+ }> | undefined;
3542
+ routes?: {
2469
3543
  pattern: string;
2470
3544
  zone_name?: string | undefined;
2471
3545
  zone_id?: string | undefined;
2472
3546
  custom_domain?: boolean | undefined;
2473
- }>, "many">>>;
2474
- assets: z.ZodOptional<z.ZodOptional<z.ZodObject<{
2475
- /** Directory containing static assets (relative to config file) */
2476
- directory: z.ZodString;
2477
- /**
2478
- * Optional binding name to access assets programmatically.
2479
- * If provided, assets can be fetched via env[binding].fetch()
2480
- */
2481
- binding: z.ZodOptional<z.ZodString>;
2482
- }, "strip", z.ZodTypeAny, {
2483
- directory: string;
2484
- binding?: string | undefined;
2485
- }, {
3547
+ }[] | undefined;
3548
+ assets?: {
2486
3549
  directory: string;
2487
3550
  binding?: string | undefined;
2488
- }>>>;
2489
- limits: z.ZodOptional<z.ZodOptional<z.ZodObject<{
2490
- /**
2491
- * Maximum CPU time in milliseconds.
2492
- * Only applicable to Workers with Usage Model set to Unbound.
2493
- */
2494
- cpu_ms: z.ZodOptional<z.ZodNumber>;
2495
- }, "strip", z.ZodTypeAny, {
2496
- cpu_ms?: number | undefined;
2497
- }, {
3551
+ } | undefined;
3552
+ limits?: {
2498
3553
  cpu_ms?: number | undefined;
2499
- }>>>;
2500
- observability: z.ZodOptional<z.ZodOptional<z.ZodObject<{
2501
- /** Enable Worker Logs */
2502
- enabled: z.ZodOptional<z.ZodBoolean>;
2503
- /**
2504
- * Head sampling rate for logs (0-1).
2505
- * 1.0 = log all requests, 0.1 = log 10% of requests.
2506
- */
2507
- head_sampling_rate: z.ZodOptional<z.ZodNumber>;
2508
- }, "strip", z.ZodTypeAny, {
2509
- enabled?: boolean | undefined;
2510
- head_sampling_rate?: number | undefined;
2511
- }, {
3554
+ } | undefined;
3555
+ observability?: {
2512
3556
  enabled?: boolean | undefined;
2513
3557
  head_sampling_rate?: number | undefined;
2514
- }>>>;
2515
- migrations: z.ZodOptional<z.ZodOptional<z.ZodArray<z.ZodObject<{
2516
- /**
2517
- * Migration tag (version identifier).
2518
- * Must be unique and in chronological order.
2519
- * @example 'v1', 'v2'
2520
- */
2521
- tag: z.ZodString;
2522
- /**
2523
- * New DO classes introduced in this migration.
2524
- * Classes that didn't exist before.
2525
- */
2526
- new_classes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2527
- /**
2528
- * Classes being renamed.
2529
- * State is preserved during rename.
2530
- */
2531
- renamed_classes: z.ZodOptional<z.ZodArray<z.ZodObject<{
2532
- from: z.ZodString;
2533
- to: z.ZodString;
2534
- }, "strip", z.ZodTypeAny, {
2535
- from: string;
2536
- to: string;
2537
- }, {
2538
- from: string;
2539
- to: string;
2540
- }>, "many">>;
2541
- /**
2542
- * Classes being deleted.
2543
- * ⚠️ All state in these classes will be lost!
2544
- */
2545
- deleted_classes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2546
- /**
2547
- * Classes migrating to SQLite storage backend.
2548
- * Enables SQL API for these DO classes.
2549
- */
2550
- new_sqlite_classes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
2551
- }, "strip", z.ZodTypeAny, {
2552
- tag: string;
2553
- new_classes?: string[] | undefined;
2554
- renamed_classes?: {
2555
- from: string;
2556
- to: string;
2557
- }[] | undefined;
2558
- deleted_classes?: string[] | undefined;
2559
- new_sqlite_classes?: string[] | undefined;
2560
- }, {
3558
+ } | undefined;
3559
+ migrations?: {
2561
3560
  tag: string;
2562
3561
  new_classes?: string[] | undefined;
2563
3562
  renamed_classes?: {
@@ -2566,45 +3565,197 @@ export declare const configSchema: z.ZodObject<{
2566
3565
  }[] | undefined;
2567
3566
  deleted_classes?: string[] | undefined;
2568
3567
  new_sqlite_classes?: string[] | undefined;
2569
- }>, "many">>>;
2570
- build: z.ZodOptional<z.ZodOptional<z.ZodObject<{
2571
- /**
2572
- * Build target environment.
2573
- * @example 'es2022'
2574
- */
2575
- target: z.ZodOptional<z.ZodString>;
2576
- /** Enable minification for smaller bundle size */
2577
- minify: z.ZodOptional<z.ZodBoolean>;
2578
- /** Generate source maps for debugging */
2579
- sourcemap: z.ZodOptional<z.ZodBoolean>;
2580
- /**
2581
- * Additional Rolldown bundler options.
2582
- * @see https://rolldown.rs/
2583
- */
2584
- rolldownOptions: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2585
- }, "strip", z.ZodTypeAny, {
2586
- target?: string | undefined;
2587
- minify?: boolean | undefined;
2588
- sourcemap?: boolean | undefined;
2589
- rolldownOptions?: Record<string, unknown> | undefined;
2590
- }, {
3568
+ }[] | undefined;
3569
+ rolldown?: {
2591
3570
  target?: string | undefined;
2592
3571
  minify?: boolean | undefined;
2593
3572
  sourcemap?: boolean | undefined;
2594
- rolldownOptions?: Record<string, unknown> | undefined;
2595
- }>>>;
2596
- wrangler: z.ZodOptional<z.ZodOptional<z.ZodObject<{
3573
+ options?: DevflareRolldownOptions | undefined;
3574
+ } | undefined;
3575
+ vite?: z.objectInputType<{
2597
3576
  /**
2598
- * Arbitrary key-value pairs passed directly to wrangler.jsonc.
2599
- * @example { placement: { mode: 'smart' } }
3577
+ * Devflare-level Vite plugin metadata sourced from devflare.config.ts.
3578
+ * Raw Vite plugin wiring still belongs in `vite.config.*`.
2600
3579
  */
2601
- passthrough: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2602
- }, "strip", z.ZodTypeAny, {
2603
- passthrough?: Record<string, unknown> | undefined;
2604
- }, {
3580
+ plugins: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
3581
+ }, z.ZodUnknown, "strip"> | undefined;
3582
+ wrangler?: {
2605
3583
  passthrough?: Record<string, unknown> | undefined;
2606
- }>>>;
3584
+ } | undefined;
3585
+ build?: {
3586
+ target?: string | undefined;
3587
+ minify?: boolean | undefined;
3588
+ sourcemap?: boolean | undefined;
3589
+ rolldownOptions?: DevflareRolldownOptions | undefined;
3590
+ } | undefined;
3591
+ plugins?: unknown[] | undefined;
3592
+ }>>>;
3593
+ /**
3594
+ * Wrangler passthrough for unsupported options.
3595
+ */
3596
+ wrangler: z.ZodOptional<z.ZodObject<{
3597
+ /**
3598
+ * Arbitrary key-value pairs passed directly to wrangler.jsonc.
3599
+ * @example { placement: { mode: 'smart' } }
3600
+ */
3601
+ passthrough: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2607
3602
  }, "strip", z.ZodTypeAny, {
3603
+ passthrough?: Record<string, unknown> | undefined;
3604
+ }, {
3605
+ passthrough?: Record<string, unknown> | undefined;
3606
+ }>>;
3607
+ } & {
3608
+ /**
3609
+ * @deprecated Use `rolldown` instead.
3610
+ */
3611
+ build: z.ZodOptional<z.ZodObject<{
3612
+ /**
3613
+ * Legacy alias for `rolldown.target`.
3614
+ * @example 'es2022'
3615
+ */
3616
+ target: z.ZodOptional<z.ZodString>;
3617
+ /** Legacy alias for `rolldown.minify`. */
3618
+ minify: z.ZodOptional<z.ZodBoolean>;
3619
+ /** Legacy alias for `rolldown.sourcemap`. */
3620
+ sourcemap: z.ZodOptional<z.ZodBoolean>;
3621
+ /** Legacy alias for `rolldown.options`. */
3622
+ rolldownOptions: z.ZodOptional<z.ZodType<DevflareRolldownOptions, z.ZodTypeDef, DevflareRolldownOptions>>;
3623
+ }, "strip", z.ZodTypeAny, {
3624
+ target?: string | undefined;
3625
+ minify?: boolean | undefined;
3626
+ sourcemap?: boolean | undefined;
3627
+ rolldownOptions?: DevflareRolldownOptions | undefined;
3628
+ }, {
3629
+ target?: string | undefined;
3630
+ minify?: boolean | undefined;
3631
+ sourcemap?: boolean | undefined;
3632
+ rolldownOptions?: DevflareRolldownOptions | undefined;
3633
+ }>>;
3634
+ /**
3635
+ * @deprecated Use `vite.plugins` instead.
3636
+ */
3637
+ plugins: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
3638
+ }, "strip", z.ZodTypeAny, {
3639
+ name: string;
3640
+ accountId?: string | undefined;
3641
+ compatibilityDate: string;
3642
+ compatibilityFlags: string[];
3643
+ files?: {
3644
+ fetch?: string | false | undefined;
3645
+ queue?: string | false | undefined;
3646
+ scheduled?: string | false | undefined;
3647
+ email?: string | false | undefined;
3648
+ durableObjects?: string | false | undefined;
3649
+ entrypoints?: string | false | undefined;
3650
+ workflows?: string | false | undefined;
3651
+ routes?: false | {
3652
+ dir: string;
3653
+ prefix?: string | undefined;
3654
+ } | undefined;
3655
+ transport?: string | undefined;
3656
+ } | undefined;
3657
+ bindings?: {
3658
+ kv?: Record<string, string> | undefined;
3659
+ d1?: Record<string, string> | undefined;
3660
+ r2?: Record<string, string> | undefined;
3661
+ durableObjects?: Record<string, DurableObjectBindingInput> | undefined;
3662
+ queues?: {
3663
+ producers?: Record<string, string> | undefined;
3664
+ consumers?: {
3665
+ queue: string;
3666
+ maxBatchSize?: number | undefined;
3667
+ maxBatchTimeout?: number | undefined;
3668
+ maxRetries?: number | undefined;
3669
+ deadLetterQueue?: string | undefined;
3670
+ maxConcurrency?: number | undefined;
3671
+ retryDelay?: number | undefined;
3672
+ }[] | undefined;
3673
+ } | undefined;
3674
+ services?: Record<string, {
3675
+ /** Target worker/service name */
3676
+ service: string;
3677
+ /** Optional environment (staging, production, etc.) */
3678
+ environment?: string | undefined;
3679
+ /** Optional entrypoint class name for named exports */
3680
+ entrypoint?: string | undefined;
3681
+ /** @internal Reference marker for ref() bindings */
3682
+ __ref?: unknown;
3683
+ }> | undefined;
3684
+ ai?: {
3685
+ binding: string;
3686
+ } | undefined;
3687
+ vectorize?: Record<string, {
3688
+ indexName: string;
3689
+ }> | undefined;
3690
+ hyperdrive?: Record<string, {
3691
+ id: string;
3692
+ }> | undefined;
3693
+ browser?: {
3694
+ binding: string;
3695
+ } | undefined;
3696
+ analyticsEngine?: Record<string, {
3697
+ dataset: string;
3698
+ }> | undefined;
3699
+ sendEmail?: Record<string, {
3700
+ destinationAddress?: string | undefined;
3701
+ allowedDestinationAddresses?: string[] | undefined;
3702
+ allowedSenderAddresses?: string[] | undefined;
3703
+ }> | undefined;
3704
+ } | undefined;
3705
+ triggers?: {
3706
+ crons?: string[] | undefined;
3707
+ } | undefined;
3708
+ vars?: Record<string, string> | undefined;
3709
+ secrets?: Record<string, {
3710
+ required: boolean;
3711
+ }> | undefined;
3712
+ routes?: {
3713
+ pattern: string;
3714
+ zone_name?: string | undefined;
3715
+ zone_id?: string | undefined;
3716
+ custom_domain?: boolean | undefined;
3717
+ }[] | undefined;
3718
+ wsRoutes?: {
3719
+ pattern: string;
3720
+ doNamespace: string;
3721
+ idParam: string;
3722
+ forwardPath: string;
3723
+ }[] | undefined;
3724
+ assets?: {
3725
+ directory: string;
3726
+ binding?: string | undefined;
3727
+ } | undefined;
3728
+ limits?: {
3729
+ cpu_ms?: number | undefined;
3730
+ } | undefined;
3731
+ observability?: {
3732
+ enabled?: boolean | undefined;
3733
+ head_sampling_rate?: number | undefined;
3734
+ } | undefined;
3735
+ migrations?: {
3736
+ tag: string;
3737
+ new_classes?: string[] | undefined;
3738
+ renamed_classes?: {
3739
+ from: string;
3740
+ to: string;
3741
+ }[] | undefined;
3742
+ deleted_classes?: string[] | undefined;
3743
+ new_sqlite_classes?: string[] | undefined;
3744
+ }[] | undefined;
3745
+ rolldown?: {
3746
+ target?: string | undefined;
3747
+ minify?: boolean | undefined;
3748
+ sourcemap?: boolean | undefined;
3749
+ options?: DevflareRolldownOptions | undefined;
3750
+ } | undefined;
3751
+ vite?: z.objectOutputType<{
3752
+ /**
3753
+ * Devflare-level Vite plugin metadata sourced from devflare.config.ts.
3754
+ * Raw Vite plugin wiring still belongs in `vite.config.*`.
3755
+ */
3756
+ plugins: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
3757
+ }, z.ZodUnknown, "strip"> | undefined;
3758
+ env?: Record<string, {
2608
3759
  name?: string | undefined;
2609
3760
  compatibilityDate?: string | undefined;
2610
3761
  compatibilityFlags?: string[] | undefined;
@@ -2666,6 +3817,8 @@ export declare const configSchema: z.ZodObject<{
2666
3817
  }> | undefined;
2667
3818
  sendEmail?: Record<string, {
2668
3819
  destinationAddress?: string | undefined;
3820
+ allowedDestinationAddresses?: string[] | undefined;
3821
+ allowedSenderAddresses?: string[] | undefined;
2669
3822
  }> | undefined;
2670
3823
  } | undefined;
2671
3824
  triggers?: {
@@ -2702,16 +3855,154 @@ export declare const configSchema: z.ZodObject<{
2702
3855
  deleted_classes?: string[] | undefined;
2703
3856
  new_sqlite_classes?: string[] | undefined;
2704
3857
  }[] | undefined;
2705
- build?: {
3858
+ rolldown?: {
2706
3859
  target?: string | undefined;
2707
3860
  minify?: boolean | undefined;
2708
3861
  sourcemap?: boolean | undefined;
2709
- rolldownOptions?: Record<string, unknown> | undefined;
3862
+ options?: DevflareRolldownOptions | undefined;
2710
3863
  } | undefined;
3864
+ vite?: z.objectOutputType<{
3865
+ /**
3866
+ * Devflare-level Vite plugin metadata sourced from devflare.config.ts.
3867
+ * Raw Vite plugin wiring still belongs in `vite.config.*`.
3868
+ */
3869
+ plugins: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
3870
+ }, z.ZodUnknown, "strip"> | undefined;
2711
3871
  wrangler?: {
2712
3872
  passthrough?: Record<string, unknown> | undefined;
2713
3873
  } | undefined;
2714
- }, {
3874
+ }> | undefined;
3875
+ wrangler?: {
3876
+ passthrough?: Record<string, unknown> | undefined;
3877
+ } | undefined;
3878
+ build?: {
3879
+ target?: string | undefined;
3880
+ minify?: boolean | undefined;
3881
+ sourcemap?: boolean | undefined;
3882
+ rolldownOptions?: DevflareRolldownOptions | undefined;
3883
+ } | undefined;
3884
+ plugins?: unknown[] | undefined;
3885
+ }, {
3886
+ name: string;
3887
+ accountId?: string | undefined;
3888
+ compatibilityDate?: string | undefined;
3889
+ compatibilityFlags?: string[] | undefined;
3890
+ files?: {
3891
+ fetch?: string | false | undefined;
3892
+ queue?: string | false | undefined;
3893
+ scheduled?: string | false | undefined;
3894
+ email?: string | false | undefined;
3895
+ durableObjects?: string | false | undefined;
3896
+ entrypoints?: string | false | undefined;
3897
+ workflows?: string | false | undefined;
3898
+ routes?: false | {
3899
+ dir: string;
3900
+ prefix?: string | undefined;
3901
+ } | undefined;
3902
+ transport?: string | undefined;
3903
+ } | undefined;
3904
+ bindings?: {
3905
+ kv?: Record<string, string> | undefined;
3906
+ d1?: Record<string, string> | undefined;
3907
+ r2?: Record<string, string> | undefined;
3908
+ durableObjects?: Record<string, DurableObjectBindingInput> | undefined;
3909
+ queues?: {
3910
+ producers?: Record<string, string> | undefined;
3911
+ consumers?: {
3912
+ queue: string;
3913
+ maxBatchSize?: number | undefined;
3914
+ maxBatchTimeout?: number | undefined;
3915
+ maxRetries?: number | undefined;
3916
+ deadLetterQueue?: string | undefined;
3917
+ maxConcurrency?: number | undefined;
3918
+ retryDelay?: number | undefined;
3919
+ }[] | undefined;
3920
+ } | undefined;
3921
+ services?: Record<string, {
3922
+ /** Target worker/service name */
3923
+ service: string;
3924
+ /** Optional environment (staging, production, etc.) */
3925
+ environment?: string | undefined;
3926
+ /** Optional entrypoint class name for named exports */
3927
+ entrypoint?: string | undefined;
3928
+ /** @internal Reference marker for ref() bindings */
3929
+ __ref?: unknown;
3930
+ }> | undefined;
3931
+ ai?: {
3932
+ binding: string;
3933
+ } | undefined;
3934
+ vectorize?: Record<string, {
3935
+ indexName: string;
3936
+ }> | undefined;
3937
+ hyperdrive?: Record<string, {
3938
+ id: string;
3939
+ }> | undefined;
3940
+ browser?: {
3941
+ binding: string;
3942
+ } | undefined;
3943
+ analyticsEngine?: Record<string, {
3944
+ dataset: string;
3945
+ }> | undefined;
3946
+ sendEmail?: Record<string, {
3947
+ destinationAddress?: string | undefined;
3948
+ allowedDestinationAddresses?: string[] | undefined;
3949
+ allowedSenderAddresses?: string[] | undefined;
3950
+ }> | undefined;
3951
+ } | undefined;
3952
+ triggers?: {
3953
+ crons?: string[] | undefined;
3954
+ } | undefined;
3955
+ vars?: Record<string, string> | undefined;
3956
+ secrets?: Record<string, {
3957
+ required?: boolean | undefined;
3958
+ }> | undefined;
3959
+ routes?: {
3960
+ pattern: string;
3961
+ zone_name?: string | undefined;
3962
+ zone_id?: string | undefined;
3963
+ custom_domain?: boolean | undefined;
3964
+ }[] | undefined;
3965
+ wsRoutes?: {
3966
+ pattern: string;
3967
+ doNamespace: string;
3968
+ idParam?: string | undefined;
3969
+ forwardPath?: string | undefined;
3970
+ }[] | undefined;
3971
+ assets?: {
3972
+ directory: string;
3973
+ binding?: string | undefined;
3974
+ } | undefined;
3975
+ limits?: {
3976
+ cpu_ms?: number | undefined;
3977
+ } | undefined;
3978
+ observability?: {
3979
+ enabled?: boolean | undefined;
3980
+ head_sampling_rate?: number | undefined;
3981
+ } | undefined;
3982
+ migrations?: {
3983
+ tag: string;
3984
+ new_classes?: string[] | undefined;
3985
+ renamed_classes?: {
3986
+ from: string;
3987
+ to: string;
3988
+ }[] | undefined;
3989
+ deleted_classes?: string[] | undefined;
3990
+ new_sqlite_classes?: string[] | undefined;
3991
+ }[] | undefined;
3992
+ rolldown?: {
3993
+ target?: string | undefined;
3994
+ minify?: boolean | undefined;
3995
+ sourcemap?: boolean | undefined;
3996
+ options?: DevflareRolldownOptions | undefined;
3997
+ } | undefined;
3998
+ vite?: z.objectInputType<{
3999
+ /**
4000
+ * Devflare-level Vite plugin metadata sourced from devflare.config.ts.
4001
+ * Raw Vite plugin wiring still belongs in `vite.config.*`.
4002
+ */
4003
+ plugins: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
4004
+ }, z.ZodUnknown, "strip"> | undefined;
4005
+ env?: Record<string, {
2715
4006
  name?: string | undefined;
2716
4007
  compatibilityDate?: string | undefined;
2717
4008
  compatibilityFlags?: string[] | undefined;
@@ -2773,6 +4064,8 @@ export declare const configSchema: z.ZodObject<{
2773
4064
  }> | undefined;
2774
4065
  sendEmail?: Record<string, {
2775
4066
  destinationAddress?: string | undefined;
4067
+ allowedDestinationAddresses?: string[] | undefined;
4068
+ allowedSenderAddresses?: string[] | undefined;
2776
4069
  }> | undefined;
2777
4070
  } | undefined;
2778
4071
  triggers?: {
@@ -2809,31 +4102,41 @@ export declare const configSchema: z.ZodObject<{
2809
4102
  deleted_classes?: string[] | undefined;
2810
4103
  new_sqlite_classes?: string[] | undefined;
2811
4104
  }[] | undefined;
2812
- build?: {
4105
+ rolldown?: {
2813
4106
  target?: string | undefined;
2814
4107
  minify?: boolean | undefined;
2815
4108
  sourcemap?: boolean | undefined;
2816
- rolldownOptions?: Record<string, unknown> | undefined;
4109
+ options?: DevflareRolldownOptions | undefined;
2817
4110
  } | undefined;
4111
+ vite?: z.objectInputType<{
4112
+ /**
4113
+ * Devflare-level Vite plugin metadata sourced from devflare.config.ts.
4114
+ * Raw Vite plugin wiring still belongs in `vite.config.*`.
4115
+ */
4116
+ plugins: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
4117
+ }, z.ZodUnknown, "strip"> | undefined;
2818
4118
  wrangler?: {
2819
4119
  passthrough?: Record<string, unknown> | undefined;
2820
4120
  } | undefined;
2821
- }>>>;
2822
- /**
2823
- * Wrangler passthrough for unsupported options.
2824
- */
2825
- wrangler: z.ZodOptional<z.ZodObject<{
2826
- /**
2827
- * Arbitrary key-value pairs passed directly to wrangler.jsonc.
2828
- * @example { placement: { mode: 'smart' } }
2829
- */
2830
- passthrough: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
2831
- }, "strip", z.ZodTypeAny, {
2832
- passthrough?: Record<string, unknown> | undefined;
2833
- }, {
4121
+ build?: {
4122
+ target?: string | undefined;
4123
+ minify?: boolean | undefined;
4124
+ sourcemap?: boolean | undefined;
4125
+ rolldownOptions?: DevflareRolldownOptions | undefined;
4126
+ } | undefined;
4127
+ plugins?: unknown[] | undefined;
4128
+ }> | undefined;
4129
+ wrangler?: {
2834
4130
  passthrough?: Record<string, unknown> | undefined;
2835
- }>>;
2836
- }, "strip", z.ZodTypeAny, {
4131
+ } | undefined;
4132
+ build?: {
4133
+ target?: string | undefined;
4134
+ minify?: boolean | undefined;
4135
+ sourcemap?: boolean | undefined;
4136
+ rolldownOptions?: DevflareRolldownOptions | undefined;
4137
+ } | undefined;
4138
+ plugins?: unknown[] | undefined;
4139
+ }>, {
2837
4140
  name: string;
2838
4141
  accountId?: string | undefined;
2839
4142
  compatibilityDate: string;
@@ -2896,6 +4199,8 @@ export declare const configSchema: z.ZodObject<{
2896
4199
  }> | undefined;
2897
4200
  sendEmail?: Record<string, {
2898
4201
  destinationAddress?: string | undefined;
4202
+ allowedDestinationAddresses?: string[] | undefined;
4203
+ allowedSenderAddresses?: string[] | undefined;
2899
4204
  }> | undefined;
2900
4205
  } | undefined;
2901
4206
  triggers?: {
@@ -2938,13 +4243,19 @@ export declare const configSchema: z.ZodObject<{
2938
4243
  deleted_classes?: string[] | undefined;
2939
4244
  new_sqlite_classes?: string[] | undefined;
2940
4245
  }[] | undefined;
2941
- build?: {
4246
+ rolldown?: {
2942
4247
  target?: string | undefined;
2943
4248
  minify?: boolean | undefined;
2944
4249
  sourcemap?: boolean | undefined;
2945
- rolldownOptions?: Record<string, unknown> | undefined;
4250
+ options?: DevflareRolldownOptions | undefined;
2946
4251
  } | undefined;
2947
- plugins?: unknown[] | undefined;
4252
+ vite?: z.objectOutputType<{
4253
+ /**
4254
+ * Devflare-level Vite plugin metadata sourced from devflare.config.ts.
4255
+ * Raw Vite plugin wiring still belongs in `vite.config.*`.
4256
+ */
4257
+ plugins: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
4258
+ }, z.ZodUnknown, "strip"> | undefined;
2948
4259
  env?: Record<string, {
2949
4260
  name?: string | undefined;
2950
4261
  compatibilityDate?: string | undefined;
@@ -3007,6 +4318,8 @@ export declare const configSchema: z.ZodObject<{
3007
4318
  }> | undefined;
3008
4319
  sendEmail?: Record<string, {
3009
4320
  destinationAddress?: string | undefined;
4321
+ allowedDestinationAddresses?: string[] | undefined;
4322
+ allowedSenderAddresses?: string[] | undefined;
3010
4323
  }> | undefined;
3011
4324
  } | undefined;
3012
4325
  triggers?: {
@@ -3043,12 +4356,19 @@ export declare const configSchema: z.ZodObject<{
3043
4356
  deleted_classes?: string[] | undefined;
3044
4357
  new_sqlite_classes?: string[] | undefined;
3045
4358
  }[] | undefined;
3046
- build?: {
4359
+ rolldown?: {
3047
4360
  target?: string | undefined;
3048
4361
  minify?: boolean | undefined;
3049
4362
  sourcemap?: boolean | undefined;
3050
- rolldownOptions?: Record<string, unknown> | undefined;
4363
+ options?: DevflareRolldownOptions | undefined;
3051
4364
  } | undefined;
4365
+ vite?: z.objectOutputType<{
4366
+ /**
4367
+ * Devflare-level Vite plugin metadata sourced from devflare.config.ts.
4368
+ * Raw Vite plugin wiring still belongs in `vite.config.*`.
4369
+ */
4370
+ plugins: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
4371
+ }, z.ZodUnknown, "strip"> | undefined;
3052
4372
  wrangler?: {
3053
4373
  passthrough?: Record<string, unknown> | undefined;
3054
4374
  } | undefined;
@@ -3119,6 +4439,8 @@ export declare const configSchema: z.ZodObject<{
3119
4439
  }> | undefined;
3120
4440
  sendEmail?: Record<string, {
3121
4441
  destinationAddress?: string | undefined;
4442
+ allowedDestinationAddresses?: string[] | undefined;
4443
+ allowedSenderAddresses?: string[] | undefined;
3122
4444
  }> | undefined;
3123
4445
  } | undefined;
3124
4446
  triggers?: {
@@ -3161,13 +4483,19 @@ export declare const configSchema: z.ZodObject<{
3161
4483
  deleted_classes?: string[] | undefined;
3162
4484
  new_sqlite_classes?: string[] | undefined;
3163
4485
  }[] | undefined;
3164
- build?: {
4486
+ rolldown?: {
3165
4487
  target?: string | undefined;
3166
4488
  minify?: boolean | undefined;
3167
4489
  sourcemap?: boolean | undefined;
3168
- rolldownOptions?: Record<string, unknown> | undefined;
4490
+ options?: DevflareRolldownOptions | undefined;
3169
4491
  } | undefined;
3170
- plugins?: unknown[] | undefined;
4492
+ vite?: z.objectInputType<{
4493
+ /**
4494
+ * Devflare-level Vite plugin metadata sourced from devflare.config.ts.
4495
+ * Raw Vite plugin wiring still belongs in `vite.config.*`.
4496
+ */
4497
+ plugins: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
4498
+ }, z.ZodUnknown, "strip"> | undefined;
3171
4499
  env?: Record<string, {
3172
4500
  name?: string | undefined;
3173
4501
  compatibilityDate?: string | undefined;
@@ -3230,6 +4558,8 @@ export declare const configSchema: z.ZodObject<{
3230
4558
  }> | undefined;
3231
4559
  sendEmail?: Record<string, {
3232
4560
  destinationAddress?: string | undefined;
4561
+ allowedDestinationAddresses?: string[] | undefined;
4562
+ allowedSenderAddresses?: string[] | undefined;
3233
4563
  }> | undefined;
3234
4564
  } | undefined;
3235
4565
  triggers?: {
@@ -3266,25 +4596,46 @@ export declare const configSchema: z.ZodObject<{
3266
4596
  deleted_classes?: string[] | undefined;
3267
4597
  new_sqlite_classes?: string[] | undefined;
3268
4598
  }[] | undefined;
3269
- build?: {
4599
+ rolldown?: {
3270
4600
  target?: string | undefined;
3271
4601
  minify?: boolean | undefined;
3272
4602
  sourcemap?: boolean | undefined;
3273
- rolldownOptions?: Record<string, unknown> | undefined;
4603
+ options?: DevflareRolldownOptions | undefined;
3274
4604
  } | undefined;
4605
+ vite?: z.objectInputType<{
4606
+ /**
4607
+ * Devflare-level Vite plugin metadata sourced from devflare.config.ts.
4608
+ * Raw Vite plugin wiring still belongs in `vite.config.*`.
4609
+ */
4610
+ plugins: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
4611
+ }, z.ZodUnknown, "strip"> | undefined;
3275
4612
  wrangler?: {
3276
4613
  passthrough?: Record<string, unknown> | undefined;
3277
4614
  } | undefined;
4615
+ build?: {
4616
+ target?: string | undefined;
4617
+ minify?: boolean | undefined;
4618
+ sourcemap?: boolean | undefined;
4619
+ rolldownOptions?: DevflareRolldownOptions | undefined;
4620
+ } | undefined;
4621
+ plugins?: unknown[] | undefined;
3278
4622
  }> | undefined;
3279
4623
  wrangler?: {
3280
4624
  passthrough?: Record<string, unknown> | undefined;
3281
4625
  } | undefined;
4626
+ build?: {
4627
+ target?: string | undefined;
4628
+ minify?: boolean | undefined;
4629
+ sourcemap?: boolean | undefined;
4630
+ rolldownOptions?: DevflareRolldownOptions | undefined;
4631
+ } | undefined;
4632
+ plugins?: unknown[] | undefined;
3282
4633
  }>;
3283
4634
  /** Output type after Zod validation and transforms */
3284
- export type DevflareConfig = z.infer<typeof configSchema>;
4635
+ export type DevflareConfig = z.output<typeof configSchema>;
3285
4636
  /** Input type for defineConfig - before Zod transforms apply defaults */
3286
4637
  export type DevflareConfigInput = z.input<typeof configSchema>;
3287
- export type DevflareEnvConfig = z.infer<typeof envConfigSchemaInner>;
4638
+ export type DevflareEnvConfig = z.output<typeof envConfigSchemaInner>;
3288
4639
  export type DurableObjectBinding = z.infer<typeof durableObjectBindingSchema>;
3289
4640
  export type QueueConsumer = z.infer<typeof queueConsumerSchema>;
3290
4641
  export type QueuesConfig = z.infer<typeof queuesConfigSchema>;
@@ -3292,7 +4643,10 @@ export type ServiceBinding = z.infer<typeof serviceBindingSchema>;
3292
4643
  export type RouteConfig = z.infer<typeof routeConfigSchema>;
3293
4644
  export type WsRouteConfig = z.infer<typeof wsRouteConfigSchema>;
3294
4645
  export type AssetsConfig = z.infer<typeof assetsConfigSchema>;
3295
- export type BuildConfig = z.infer<typeof buildConfigSchema>;
4646
+ export type ViteConfig = z.output<typeof viteConfigSchema>;
4647
+ export type RolldownConfig = z.output<typeof rolldownConfigSchema>;
4648
+ /** @deprecated Use `RolldownConfig` instead. This matches the legacy `build` shape. */
4649
+ export type BuildConfig = LegacyBuildConfig;
3296
4650
  export type MigrationConfig = z.infer<typeof migrationSchema>;
3297
4651
  /**
3298
4652
  * Normalized DO binding shape — consistent representation for all DO binding variants.