devflare 1.0.0-next.1 → 1.0.0-next.11

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