@lunora/config 1.0.0-alpha.293 → 1.0.0-alpha.294

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 (36) hide show
  1. package/dist/cloudflare/index.d.mts +73 -13
  2. package/dist/cloudflare/index.d.ts +73 -13
  3. package/dist/cloudflare/index.mjs +1 -1
  4. package/dist/index.d.mts +2 -2
  5. package/dist/index.d.ts +2 -2
  6. package/dist/index.mjs +1 -1
  7. package/dist/packem_shared/BINDING_MANIFEST_VERSION-CFVuo3vP.mjs +1 -0
  8. package/dist/packem_shared/GLOBAL_FETCH_STRICTLY_PUBLIC_FLAG-f8CnJha3.mjs +1 -0
  9. package/dist/packem_shared/REMOTE_ELIGIBLE_KEYS-BYnYe4el.mjs +1 -0
  10. package/dist/packem_shared/REQUIRED_COMPATIBILITY_DATE-lONKS1B6.mjs +1 -0
  11. package/dist/packem_shared/{UNEXPORTED_CLASS_MARKER-CugcZbPf.mjs → UNEXPORTED_CLASS_MARKER-D9ZP8mPA.mjs} +1 -1
  12. package/dist/packem_shared/{assertWranglerSatisfiesSchema-BiABHeMv.mjs → assertWranglerSatisfiesSchema-B-hQPnhP.mjs} +1 -1
  13. package/dist/packem_shared/collectExportGaps-BRITqV5h.mjs +2 -0
  14. package/dist/packem_shared/discoverSchemaInfo-BguahM6z.mjs +1 -0
  15. package/dist/packem_shared/infer-bindings-B3rsAmY_.mjs +1 -0
  16. package/dist/packem_shared/{schema-info.d-fEhxTb9k.d.mts → infer-bindings.d-Bay0cm0d.d.mts} +76 -54
  17. package/dist/packem_shared/{schema-info.d-fEhxTb9k.d.ts → infer-bindings.d-Bay0cm0d.d.ts} +76 -54
  18. package/dist/packem_shared/inferLunoraBindings-QvG5WKjF.mjs +1 -0
  19. package/dist/packem_shared/{materializeServiceDevConfigs-Cjk9uh9u.mjs → materializeServiceDevConfigs-BYuEQ5X3.mjs} +1 -1
  20. package/dist/packem_shared/mergeWranglerEnvironment-CTh4zkEL.mjs +1 -0
  21. package/dist/packem_shared/reconcileBindingsSafely-DJgj_7Pl.mjs +1 -0
  22. package/dist/packem_shared/validate-bindings-TA4ZqC4j.mjs +1 -0
  23. package/dist/packem_shared/withTailConsumer-BK5uzf1W.mjs +1 -0
  24. package/dist/packem_shared/wranglerToAlchemy-D8bWeHhd.mjs +6 -0
  25. package/package.json +5 -5
  26. package/dist/packem_shared/BINDING_MANIFEST_VERSION-BHfXhS_-.mjs +0 -1
  27. package/dist/packem_shared/REMOTE_ELIGIBLE_KEYS-CBKtw0E-.mjs +0 -1
  28. package/dist/packem_shared/REQUIRED_COMPATIBILITY_DATE-jTnj2MPJ.mjs +0 -1
  29. package/dist/packem_shared/collectExportGaps-CIYe_DRY.mjs +0 -2
  30. package/dist/packem_shared/discoverSchemaInfo-DJvevsCm.mjs +0 -1
  31. package/dist/packem_shared/inferLunoraBindings-DXLEJY9w.mjs +0 -1
  32. package/dist/packem_shared/mergeWranglerEnvironment-DOKJUNH8.mjs +0 -1
  33. package/dist/packem_shared/reconcileBindingsSafely-VBbLYoAx.mjs +0 -1
  34. package/dist/packem_shared/validate-bindings-Dnf1t0SY.mjs +0 -1
  35. package/dist/packem_shared/withTailConsumer-B1NoKIsj.mjs +0 -1
  36. package/dist/packem_shared/wranglerToAlchemy-BMOQYRyw.mjs +0 -6
@@ -1,4 +1,4 @@
1
- import { D as DeployDriver, G as GeneratedClassModule, I as InferredBindings, S as SchemaInfo } from "../packem_shared/schema-info.d-fEhxTb9k.mjs";
1
+ import { D as DeployDriver, G as GeneratedClassModule, I as InferredBindings, S as SchemaInfo } from "../packem_shared/infer-bindings.d-Bay0cm0d.mjs";
2
2
  import { WranglerVariableIR } from '@lunora/codegen';
3
3
  /** Apply one structural jsonc edit and return the rewritten text (a no-op edit returns the input). */
4
4
  declare const applyModify: (text: string, path: ReadonlyArray<number | string>, value: unknown) => string;
@@ -144,14 +144,14 @@ interface BindingRequirement {
144
144
  * exports it before publishing.
145
145
  */
146
146
  className?: string;
147
- /** Bucket name (`r2`), database name (`d1`), dataset (`analytics_engine`), queue name (`queue`), index (`vectorize`), stream (`pipeline`), namespace (`artifacts`), Worker name (`service`). */
147
+ /** Bucket name (`r2`), database name (`d1`), dataset (`analytics_engine`), queue name (`queue`), index (`vectorize`), stream (`pipeline`), namespace (`artifacts`, `ai_search_namespace`), instance (`ai_search`), Worker name (`service`). */
148
148
  resource?: string;
149
149
  /** Remote resource id, when the config declares one (`d1`, `kv`, `hyperdrive`, `vpc_service`, `vpc_network`). */
150
150
  resourceId?: string;
151
151
  /** For `durable_object`: whether the class uses SQLite storage (`new_sqlite_classes`). */
152
152
  sqlite?: boolean;
153
153
  /** The kind of resource, keyed to the wrangler section it came from. */
154
- type: "ai" | "analytics_engine" | "artifacts" | "assets" | "browser" | "container" | "d1" | "durable_object" | "hyperdrive" | "images" | "kv" | "media" | "pipeline" | "queue_consumer" | "queue_producer" | "r2" | "service" | "stream" | "vectorize" | "vpc_network" | "vpc_service" | "workflow";
154
+ type: "ai" | "ai_search" | "ai_search_namespace" | "analytics_engine" | "artifacts" | "assets" | "browser" | "container" | "d1" | "durable_object" | "hyperdrive" | "images" | "kv" | "media" | "pipeline" | "queue_consumer" | "queue_producer" | "r2" | "service" | "stream" | "vectorize" | "vpc_network" | "vpc_service" | "workflow";
155
155
  }
156
156
  /** The document the `lunora build --emit-bindings` flag writes. */
157
157
  interface BindingManifest {
@@ -186,6 +186,14 @@ interface ManifestConfigShape extends WranglerConfigShape {
186
186
  ai?: {
187
187
  binding?: string;
188
188
  };
189
+ ai_search?: ReadonlyArray<{
190
+ binding?: string;
191
+ instance_name?: string;
192
+ }>;
193
+ ai_search_namespaces?: ReadonlyArray<{
194
+ binding?: string;
195
+ namespace?: string;
196
+ }>;
189
197
  analytics_engine_datasets?: ReadonlyArray<{
190
198
  binding?: string;
191
199
  dataset?: string;
@@ -277,6 +285,13 @@ interface ManifestConfigShape extends WranglerConfigShape {
277
285
  declare const buildBindingManifest: (config: ManifestConfigShape) => BindingManifest;
278
286
  /** The Cloudflare deploy driver. */
279
287
  declare const CLOUDFLARE_DRIVER: DeployDriver;
288
+ /**
289
+ * The `global_fetch_strictly_public` compatibility flag: every global `fetch` from
290
+ * the Worker goes out to the public internet, never to a private or special-use
291
+ * address. `workersCimdFetch()` from `@lunora/auth/cimd/workers` refuses to build
292
+ * without it, and `lunora doctor` checks for it wherever that transport is imported.
293
+ */
294
+ declare const GLOBAL_FETCH_STRICTLY_PUBLIC_FLAG = "global_fetch_strictly_public";
280
295
  /**
281
296
  * A container/workflow that is declared (so codegen emits its class) but the
282
297
  * worker entry never re-exports — the one wiring step the generators can't always
@@ -517,6 +532,14 @@ declare const REMOTE_ELIGIBLE_KEYS: {
517
532
  readonly label: "AI";
518
533
  readonly shape: "object";
519
534
  };
535
+ readonly ai_search: {
536
+ readonly label: "AI Search";
537
+ readonly shape: "array";
538
+ };
539
+ readonly ai_search_namespaces: {
540
+ readonly label: "AI Search namespace";
541
+ readonly shape: "array";
542
+ };
520
543
  readonly d1_databases: {
521
544
  readonly label: "D1";
522
545
  readonly shape: "array";
@@ -567,6 +590,8 @@ interface RemoteBindingPlan {
567
590
  /** The structural slice of a wrangler config the remote planner reads. */
568
591
  interface RemoteWranglerShape {
569
592
  ai?: BindingEntry | null;
593
+ ai_search?: ReadonlyArray<BindingEntry | null | undefined>;
594
+ ai_search_namespaces?: ReadonlyArray<BindingEntry | null | undefined>;
570
595
  d1_databases?: ReadonlyArray<BindingEntry | null | undefined>;
571
596
  kv_namespaces?: ReadonlyArray<BindingEntry | null | undefined>;
572
597
  queues?: {
@@ -695,6 +720,38 @@ interface TailConsumer {
695
720
  /** Name of the Worker that consumes tail events. */
696
721
  service?: string;
697
722
  }
723
+ /**
724
+ * `observability.traces` — Workers Traces. `destinations` names OpenTelemetry
725
+ * export destinations configured in the dashboard; `persist: false` exports
726
+ * without also storing in Cloudflare (default `true`).
727
+ * https://developers.cloudflare.com/workers/observability/opentelemetry-export/
728
+ */
729
+ interface WranglerObservabilityTraces {
730
+ destinations?: ReadonlyArray<string>;
731
+ enabled?: boolean;
732
+ /** Fraction of requests traced, 0–1. */
733
+ head_sampling_rate?: number;
734
+ persist?: boolean;
735
+ }
736
+ /**
737
+ * `observability.logs` — Workers Logs. Same export knobs as traces, plus
738
+ * `invocation_logs` (the per-invocation summary line; default `true`).
739
+ */
740
+ interface WranglerObservabilityLogs extends WranglerObservabilityTraces {
741
+ invocation_logs?: boolean;
742
+ }
743
+ /** The wrangler `observability` block (Workers Logs + Traces). */
744
+ interface WranglerObservability {
745
+ enabled?: boolean;
746
+ /** Fraction of requests logged, 0–1 (wrangler's default is 1: every request). */
747
+ head_sampling_rate?: number;
748
+ /** Workers Issues — detects and groups production failures. */
749
+ issues?: {
750
+ enabled?: boolean;
751
+ };
752
+ logs?: WranglerObservabilityLogs;
753
+ traces?: WranglerObservabilityTraces;
754
+ }
698
755
  /** A wrangler `containers[]` entry (parsed from untrusted JSONC). */
699
756
  interface WranglerContainerEntry {
700
757
  class_name?: string;
@@ -752,6 +809,16 @@ interface WranglerConfig {
752
809
  ai?: {
753
810
  binding?: unknown;
754
811
  } | null;
812
+ ai_search?: ReadonlyArray<{
813
+ binding?: string;
814
+ instance_name?: string;
815
+ remote?: boolean;
816
+ } | null | undefined>;
817
+ ai_search_namespaces?: ReadonlyArray<{
818
+ binding?: string;
819
+ namespace?: string;
820
+ remote?: boolean;
821
+ } | null | undefined>;
755
822
  analytics_engine_datasets?: ReadonlyArray<{
756
823
  binding?: string;
757
824
  dataset?: string;
@@ -839,15 +906,7 @@ interface WranglerConfig {
839
906
  binding?: string;
840
907
  certificate_id?: string;
841
908
  } | null | undefined>;
842
- observability?: {
843
- enabled?: boolean;
844
- head_sampling_rate?: number;
845
- logs?: {
846
- enabled?: boolean;
847
- head_sampling_rate?: number;
848
- invocation_logs?: boolean;
849
- };
850
- };
909
+ observability?: WranglerObservability;
851
910
  pipelines?: ReadonlyArray<{
852
911
  binding?: string;
853
912
  pipeline?: string;
@@ -866,6 +925,7 @@ interface WranglerConfig {
866
925
  r2_buckets?: ReadonlyArray<{
867
926
  binding?: string;
868
927
  bucket_name?: string;
928
+ jurisdiction?: string;
869
929
  } | null | undefined>;
870
930
  secrets?: {
871
931
  required?: unknown;
@@ -1064,7 +1124,7 @@ declare const validateWranglerConfig: (wranglerInput: WranglerConfig | undefined
1064
1124
  * `{ valid, errors, warnings }`.
1065
1125
  */
1066
1126
  declare const validateWrangler: typeof validateWranglerConfig;
1067
- export { type AlchemyTranslation, type AssertWranglerOptions, BINDING_MANIFEST_VERSION, type BindingManifest, type BindingRequirement, CLOUDFLARE_DRIVER, type ExportGap, type ManifestConfigShape, type MaterializeOptions, type MaterializeResult, REMOTE_ELIGIBLE_KEYS, REQUIRED_COMPATIBILITY_DATE, REQUIRED_FLAG, type ReadWranglerResult, type ReconcileBindingsResult, type ReconcileCompatibilityDateResult, type ReconcileResult as ReconcileCronsResult, type ReconcileProject, type RemoteBindingPlan, type RemoteEnableInputs, type RemoteWranglerShape, type ServiceDevConfigs, type TailConsumer, UNEXPORTED_CLASS_MARKER, WORKERS_CACHE_MIN_DATE, WRANGLER_FILES, type WranglerCacheShape, type WranglerConfig, type WranglerConfigShape, type WranglerContainerEntry, type WranglerEnvironmentMerge, type WranglerProjectValidationOptions, type WranglerProjectValidationResult, type WranglerValidationReport, type WranglerWorkflowEntry,
1127
+ export { type AlchemyTranslation, type AssertWranglerOptions, BINDING_MANIFEST_VERSION, type BindingManifest, type BindingRequirement, CLOUDFLARE_DRIVER, type ExportGap, GLOBAL_FETCH_STRICTLY_PUBLIC_FLAG, type ManifestConfigShape, type MaterializeOptions, type MaterializeResult, REMOTE_ELIGIBLE_KEYS, REQUIRED_COMPATIBILITY_DATE, REQUIRED_FLAG, type ReadWranglerResult, type ReconcileBindingsResult, type ReconcileCompatibilityDateResult, type ReconcileResult as ReconcileCronsResult, type ReconcileProject, type RemoteBindingPlan, type RemoteEnableInputs, type RemoteWranglerShape, type ServiceDevConfigs, type TailConsumer, UNEXPORTED_CLASS_MARKER, WORKERS_CACHE_MIN_DATE, WRANGLER_FILES, type WranglerCacheShape, type WranglerConfig, type WranglerConfigShape, type WranglerContainerEntry, type WranglerEnvironmentMerge, type WranglerObservability, type WranglerObservabilityLogs, type WranglerObservabilityTraces, type WranglerProjectValidationOptions, type WranglerProjectValidationResult, type WranglerValidationReport, type WranglerWorkflowEntry,
1068
1128
  /**
1069
1129
  * `@lunora/config/cloudflare` — the wrangler layer.
1070
1130
  *
@@ -1,4 +1,4 @@
1
- import { D as DeployDriver, G as GeneratedClassModule, I as InferredBindings, S as SchemaInfo } from "../packem_shared/schema-info.d-fEhxTb9k.js";
1
+ import { D as DeployDriver, G as GeneratedClassModule, I as InferredBindings, S as SchemaInfo } from "../packem_shared/infer-bindings.d-Bay0cm0d.js";
2
2
  import { WranglerVariableIR } from '@lunora/codegen';
3
3
  /** Apply one structural jsonc edit and return the rewritten text (a no-op edit returns the input). */
4
4
  declare const applyModify: (text: string, path: ReadonlyArray<number | string>, value: unknown) => string;
@@ -144,14 +144,14 @@ interface BindingRequirement {
144
144
  * exports it before publishing.
145
145
  */
146
146
  className?: string;
147
- /** Bucket name (`r2`), database name (`d1`), dataset (`analytics_engine`), queue name (`queue`), index (`vectorize`), stream (`pipeline`), namespace (`artifacts`), Worker name (`service`). */
147
+ /** Bucket name (`r2`), database name (`d1`), dataset (`analytics_engine`), queue name (`queue`), index (`vectorize`), stream (`pipeline`), namespace (`artifacts`, `ai_search_namespace`), instance (`ai_search`), Worker name (`service`). */
148
148
  resource?: string;
149
149
  /** Remote resource id, when the config declares one (`d1`, `kv`, `hyperdrive`, `vpc_service`, `vpc_network`). */
150
150
  resourceId?: string;
151
151
  /** For `durable_object`: whether the class uses SQLite storage (`new_sqlite_classes`). */
152
152
  sqlite?: boolean;
153
153
  /** The kind of resource, keyed to the wrangler section it came from. */
154
- type: "ai" | "analytics_engine" | "artifacts" | "assets" | "browser" | "container" | "d1" | "durable_object" | "hyperdrive" | "images" | "kv" | "media" | "pipeline" | "queue_consumer" | "queue_producer" | "r2" | "service" | "stream" | "vectorize" | "vpc_network" | "vpc_service" | "workflow";
154
+ type: "ai" | "ai_search" | "ai_search_namespace" | "analytics_engine" | "artifacts" | "assets" | "browser" | "container" | "d1" | "durable_object" | "hyperdrive" | "images" | "kv" | "media" | "pipeline" | "queue_consumer" | "queue_producer" | "r2" | "service" | "stream" | "vectorize" | "vpc_network" | "vpc_service" | "workflow";
155
155
  }
156
156
  /** The document the `lunora build --emit-bindings` flag writes. */
157
157
  interface BindingManifest {
@@ -186,6 +186,14 @@ interface ManifestConfigShape extends WranglerConfigShape {
186
186
  ai?: {
187
187
  binding?: string;
188
188
  };
189
+ ai_search?: ReadonlyArray<{
190
+ binding?: string;
191
+ instance_name?: string;
192
+ }>;
193
+ ai_search_namespaces?: ReadonlyArray<{
194
+ binding?: string;
195
+ namespace?: string;
196
+ }>;
189
197
  analytics_engine_datasets?: ReadonlyArray<{
190
198
  binding?: string;
191
199
  dataset?: string;
@@ -277,6 +285,13 @@ interface ManifestConfigShape extends WranglerConfigShape {
277
285
  declare const buildBindingManifest: (config: ManifestConfigShape) => BindingManifest;
278
286
  /** The Cloudflare deploy driver. */
279
287
  declare const CLOUDFLARE_DRIVER: DeployDriver;
288
+ /**
289
+ * The `global_fetch_strictly_public` compatibility flag: every global `fetch` from
290
+ * the Worker goes out to the public internet, never to a private or special-use
291
+ * address. `workersCimdFetch()` from `@lunora/auth/cimd/workers` refuses to build
292
+ * without it, and `lunora doctor` checks for it wherever that transport is imported.
293
+ */
294
+ declare const GLOBAL_FETCH_STRICTLY_PUBLIC_FLAG = "global_fetch_strictly_public";
280
295
  /**
281
296
  * A container/workflow that is declared (so codegen emits its class) but the
282
297
  * worker entry never re-exports — the one wiring step the generators can't always
@@ -517,6 +532,14 @@ declare const REMOTE_ELIGIBLE_KEYS: {
517
532
  readonly label: "AI";
518
533
  readonly shape: "object";
519
534
  };
535
+ readonly ai_search: {
536
+ readonly label: "AI Search";
537
+ readonly shape: "array";
538
+ };
539
+ readonly ai_search_namespaces: {
540
+ readonly label: "AI Search namespace";
541
+ readonly shape: "array";
542
+ };
520
543
  readonly d1_databases: {
521
544
  readonly label: "D1";
522
545
  readonly shape: "array";
@@ -567,6 +590,8 @@ interface RemoteBindingPlan {
567
590
  /** The structural slice of a wrangler config the remote planner reads. */
568
591
  interface RemoteWranglerShape {
569
592
  ai?: BindingEntry | null;
593
+ ai_search?: ReadonlyArray<BindingEntry | null | undefined>;
594
+ ai_search_namespaces?: ReadonlyArray<BindingEntry | null | undefined>;
570
595
  d1_databases?: ReadonlyArray<BindingEntry | null | undefined>;
571
596
  kv_namespaces?: ReadonlyArray<BindingEntry | null | undefined>;
572
597
  queues?: {
@@ -695,6 +720,38 @@ interface TailConsumer {
695
720
  /** Name of the Worker that consumes tail events. */
696
721
  service?: string;
697
722
  }
723
+ /**
724
+ * `observability.traces` — Workers Traces. `destinations` names OpenTelemetry
725
+ * export destinations configured in the dashboard; `persist: false` exports
726
+ * without also storing in Cloudflare (default `true`).
727
+ * https://developers.cloudflare.com/workers/observability/opentelemetry-export/
728
+ */
729
+ interface WranglerObservabilityTraces {
730
+ destinations?: ReadonlyArray<string>;
731
+ enabled?: boolean;
732
+ /** Fraction of requests traced, 0–1. */
733
+ head_sampling_rate?: number;
734
+ persist?: boolean;
735
+ }
736
+ /**
737
+ * `observability.logs` — Workers Logs. Same export knobs as traces, plus
738
+ * `invocation_logs` (the per-invocation summary line; default `true`).
739
+ */
740
+ interface WranglerObservabilityLogs extends WranglerObservabilityTraces {
741
+ invocation_logs?: boolean;
742
+ }
743
+ /** The wrangler `observability` block (Workers Logs + Traces). */
744
+ interface WranglerObservability {
745
+ enabled?: boolean;
746
+ /** Fraction of requests logged, 0–1 (wrangler's default is 1: every request). */
747
+ head_sampling_rate?: number;
748
+ /** Workers Issues — detects and groups production failures. */
749
+ issues?: {
750
+ enabled?: boolean;
751
+ };
752
+ logs?: WranglerObservabilityLogs;
753
+ traces?: WranglerObservabilityTraces;
754
+ }
698
755
  /** A wrangler `containers[]` entry (parsed from untrusted JSONC). */
699
756
  interface WranglerContainerEntry {
700
757
  class_name?: string;
@@ -752,6 +809,16 @@ interface WranglerConfig {
752
809
  ai?: {
753
810
  binding?: unknown;
754
811
  } | null;
812
+ ai_search?: ReadonlyArray<{
813
+ binding?: string;
814
+ instance_name?: string;
815
+ remote?: boolean;
816
+ } | null | undefined>;
817
+ ai_search_namespaces?: ReadonlyArray<{
818
+ binding?: string;
819
+ namespace?: string;
820
+ remote?: boolean;
821
+ } | null | undefined>;
755
822
  analytics_engine_datasets?: ReadonlyArray<{
756
823
  binding?: string;
757
824
  dataset?: string;
@@ -839,15 +906,7 @@ interface WranglerConfig {
839
906
  binding?: string;
840
907
  certificate_id?: string;
841
908
  } | null | undefined>;
842
- observability?: {
843
- enabled?: boolean;
844
- head_sampling_rate?: number;
845
- logs?: {
846
- enabled?: boolean;
847
- head_sampling_rate?: number;
848
- invocation_logs?: boolean;
849
- };
850
- };
909
+ observability?: WranglerObservability;
851
910
  pipelines?: ReadonlyArray<{
852
911
  binding?: string;
853
912
  pipeline?: string;
@@ -866,6 +925,7 @@ interface WranglerConfig {
866
925
  r2_buckets?: ReadonlyArray<{
867
926
  binding?: string;
868
927
  bucket_name?: string;
928
+ jurisdiction?: string;
869
929
  } | null | undefined>;
870
930
  secrets?: {
871
931
  required?: unknown;
@@ -1064,7 +1124,7 @@ declare const validateWranglerConfig: (wranglerInput: WranglerConfig | undefined
1064
1124
  * `{ valid, errors, warnings }`.
1065
1125
  */
1066
1126
  declare const validateWrangler: typeof validateWranglerConfig;
1067
- export { type AlchemyTranslation, type AssertWranglerOptions, BINDING_MANIFEST_VERSION, type BindingManifest, type BindingRequirement, CLOUDFLARE_DRIVER, type ExportGap, type ManifestConfigShape, type MaterializeOptions, type MaterializeResult, REMOTE_ELIGIBLE_KEYS, REQUIRED_COMPATIBILITY_DATE, REQUIRED_FLAG, type ReadWranglerResult, type ReconcileBindingsResult, type ReconcileCompatibilityDateResult, type ReconcileResult as ReconcileCronsResult, type ReconcileProject, type RemoteBindingPlan, type RemoteEnableInputs, type RemoteWranglerShape, type ServiceDevConfigs, type TailConsumer, UNEXPORTED_CLASS_MARKER, WORKERS_CACHE_MIN_DATE, WRANGLER_FILES, type WranglerCacheShape, type WranglerConfig, type WranglerConfigShape, type WranglerContainerEntry, type WranglerEnvironmentMerge, type WranglerProjectValidationOptions, type WranglerProjectValidationResult, type WranglerValidationReport, type WranglerWorkflowEntry,
1127
+ export { type AlchemyTranslation, type AssertWranglerOptions, BINDING_MANIFEST_VERSION, type BindingManifest, type BindingRequirement, CLOUDFLARE_DRIVER, type ExportGap, GLOBAL_FETCH_STRICTLY_PUBLIC_FLAG, type ManifestConfigShape, type MaterializeOptions, type MaterializeResult, REMOTE_ELIGIBLE_KEYS, REQUIRED_COMPATIBILITY_DATE, REQUIRED_FLAG, type ReadWranglerResult, type ReconcileBindingsResult, type ReconcileCompatibilityDateResult, type ReconcileResult as ReconcileCronsResult, type ReconcileProject, type RemoteBindingPlan, type RemoteEnableInputs, type RemoteWranglerShape, type ServiceDevConfigs, type TailConsumer, UNEXPORTED_CLASS_MARKER, WORKERS_CACHE_MIN_DATE, WRANGLER_FILES, type WranglerCacheShape, type WranglerConfig, type WranglerConfigShape, type WranglerContainerEntry, type WranglerEnvironmentMerge, type WranglerObservability, type WranglerObservabilityLogs, type WranglerObservabilityTraces, type WranglerProjectValidationOptions, type WranglerProjectValidationResult, type WranglerValidationReport, type WranglerWorkflowEntry,
1068
1128
  /**
1069
1129
  * `@lunora/config/cloudflare` — the wrangler layer.
1070
1130
  *
@@ -1 +1 @@
1
- import{applyModify as o}from"../packem_shared/applyModify-DKP2l6S9.mjs";import{assertWranglerSatisfiesSchema as n}from"../packem_shared/assertWranglerSatisfiesSchema-BiABHeMv.mjs";import{BINDING_MANIFEST_VERSION as t,buildBindingManifest as i}from"../packem_shared/BINDING_MANIFEST_VERSION-BHfXhS_-.mjs";import{default as E}from"../packem_shared/CLOUDFLARE_DRIVER-Ci3VIqnk.mjs";import{collectExportGaps as s,reconcileWranglerBindings as c}from"../packem_shared/collectExportGaps-CIYe_DRY.mjs";import{reconcileWranglerCompatibilityDate as p}from"../packem_shared/reconcileWranglerCompatibilityDate-hocXEuRA.mjs";import{describePreservedCrons as x,reconcileWranglerCrons as d}from"../packem_shared/describePreservedCrons-7gaDLxWx.mjs";import{reconcileBindingsSafely as I,reconcileWranglerExtras as _}from"../packem_shared/reconcileBindingsSafely-VBbLYoAx.mjs";import{REMOTE_ELIGIBLE_KEYS as S,injectRemoteFlags as A,isRemoteEnvEnabled as D,materializeRemoteWranglerConfig as v,planRemoteBindings as L,resolveRemoteEnabled as T}from"../packem_shared/REMOTE_ELIGIBLE_KEYS-CBKtw0E-.mjs";import{materializeServiceDevConfigs as B}from"../packem_shared/materializeServiceDevConfigs-Cjk9uh9u.mjs";import{withTailConsumer as M}from"../packem_shared/withTailConsumer-B1NoKIsj.mjs";import{WORKERS_CACHE_MIN_DATE as O,isCacheEnabled as y}from"../packem_shared/WORKERS_CACHE_MIN_DATE-0k9ABJtF.mjs";import{mergeWranglerEnvironment as h}from"../packem_shared/mergeWranglerEnvironment-DOKJUNH8.mjs";import{WRANGLER_FILES as U,findWranglerFile as V,readWranglerJsonc as u}from"../packem_shared/WRANGLER_FILES-UNW-xY5u.mjs";import{UNEXPORTED_CLASS_MARKER as j,validateWranglerProject as w}from"../packem_shared/UNEXPORTED_CLASS_MARKER-CugcZbPf.mjs";import{collectWranglerSecretVariables as Q,scanWranglerVariablesForSecrets as Y}from"../packem_shared/collectWranglerSecretVariables-D-usPfT8.mjs";import{wranglerToAlchemy as J}from"../packem_shared/wranglerToAlchemy-BMOQYRyw.mjs";import{REQUIRED_COMPATIBILITY_DATE as k,REQUIRED_FLAG as q,validateWrangler as Z,validateWranglerConfig as $}from"../packem_shared/REQUIRED_COMPATIBILITY_DATE-jTnj2MPJ.mjs";export{t as BINDING_MANIFEST_VERSION,E as CLOUDFLARE_DRIVER,S as REMOTE_ELIGIBLE_KEYS,k as REQUIRED_COMPATIBILITY_DATE,q as REQUIRED_FLAG,j as UNEXPORTED_CLASS_MARKER,O as WORKERS_CACHE_MIN_DATE,U as WRANGLER_FILES,o as applyModify,n as assertWranglerSatisfiesSchema,i as buildBindingManifest,s as collectExportGaps,Q as collectWranglerSecretVariables,x as describePreservedCrons,V as findWranglerFile,A as injectRemoteFlags,y as isCacheEnabled,D as isRemoteEnvEnabled,v as materializeRemoteWranglerConfig,B as materializeServiceDevConfigs,h as mergeWranglerEnvironment,L as planRemoteBindings,u as readWranglerJsonc,I as reconcileBindingsSafely,c as reconcileWranglerBindings,p as reconcileWranglerCompatibilityDate,d as reconcileWranglerCrons,_ as reconcileWranglerExtras,T as resolveRemoteEnabled,Y as scanWranglerVariablesForSecrets,Z as validateWrangler,$ as validateWranglerConfig,w as validateWranglerProject,M as withTailConsumer,J as wranglerToAlchemy};
1
+ import{applyModify as o}from"../packem_shared/applyModify-DKP2l6S9.mjs";import{assertWranglerSatisfiesSchema as n}from"../packem_shared/assertWranglerSatisfiesSchema-B-hQPnhP.mjs";import{BINDING_MANIFEST_VERSION as l,buildBindingManifest as i}from"../packem_shared/BINDING_MANIFEST_VERSION-CFVuo3vP.mjs";import{default as E}from"../packem_shared/CLOUDFLARE_DRIVER-Ci3VIqnk.mjs";import{default as s}from"../packem_shared/GLOBAL_FETCH_STRICTLY_PUBLIC_FLAG-f8CnJha3.mjs";import{collectExportGaps as p,reconcileWranglerBindings as g}from"../packem_shared/collectExportGaps-BRITqV5h.mjs";import{reconcileWranglerCompatibilityDate as x}from"../packem_shared/reconcileWranglerCompatibilityDate-hocXEuRA.mjs";import{describePreservedCrons as _,reconcileWranglerCrons as C}from"../packem_shared/describePreservedCrons-7gaDLxWx.mjs";import{reconcileBindingsSafely as W,reconcileWranglerExtras as L}from"../packem_shared/reconcileBindingsSafely-DJgj_7Pl.mjs";import{REMOTE_ELIGIBLE_KEYS as A,injectRemoteFlags as T,isRemoteEnvEnabled as D,materializeRemoteWranglerConfig as v,planRemoteBindings as B,resolveRemoteEnabled as F}from"../packem_shared/REMOTE_ELIGIBLE_KEYS-BYnYe4el.mjs";import{materializeServiceDevConfigs as G}from"../packem_shared/materializeServiceDevConfigs-BYuEQ5X3.mjs";import{withTailConsumer as N}from"../packem_shared/withTailConsumer-BK5uzf1W.mjs";import{WORKERS_CACHE_MIN_DATE as y,isCacheEnabled as P}from"../packem_shared/WORKERS_CACHE_MIN_DATE-0k9ABJtF.mjs";import{mergeWranglerEnvironment as h}from"../packem_shared/mergeWranglerEnvironment-CTh4zkEL.mjs";import{WRANGLER_FILES as V,findWranglerFile as K,readWranglerJsonc as Y}from"../packem_shared/WRANGLER_FILES-UNW-xY5u.mjs";import{UNEXPORTED_CLASS_MARKER as w,validateWranglerProject as z}from"../packem_shared/UNEXPORTED_CLASS_MARKER-D9ZP8mPA.mjs";import{collectWranglerSecretVariables as Q,scanWranglerVariablesForSecrets as J}from"../packem_shared/collectWranglerSecretVariables-D-usPfT8.mjs";import{wranglerToAlchemy as k}from"../packem_shared/wranglerToAlchemy-D8bWeHhd.mjs";import{REQUIRED_COMPATIBILITY_DATE as Z,REQUIRED_FLAG as $,validateWrangler as ee,validateWranglerConfig as re}from"../packem_shared/REQUIRED_COMPATIBILITY_DATE-lONKS1B6.mjs";export{l as BINDING_MANIFEST_VERSION,E as CLOUDFLARE_DRIVER,s as GLOBAL_FETCH_STRICTLY_PUBLIC_FLAG,A as REMOTE_ELIGIBLE_KEYS,Z as REQUIRED_COMPATIBILITY_DATE,$ as REQUIRED_FLAG,w as UNEXPORTED_CLASS_MARKER,y as WORKERS_CACHE_MIN_DATE,V as WRANGLER_FILES,o as applyModify,n as assertWranglerSatisfiesSchema,i as buildBindingManifest,p as collectExportGaps,Q as collectWranglerSecretVariables,_ as describePreservedCrons,K as findWranglerFile,T as injectRemoteFlags,P as isCacheEnabled,D as isRemoteEnvEnabled,v as materializeRemoteWranglerConfig,G as materializeServiceDevConfigs,h as mergeWranglerEnvironment,B as planRemoteBindings,Y as readWranglerJsonc,W as reconcileBindingsSafely,g as reconcileWranglerBindings,x as reconcileWranglerCompatibilityDate,C as reconcileWranglerCrons,L as reconcileWranglerExtras,F as resolveRemoteEnabled,J as scanWranglerVariablesForSecrets,ee as validateWrangler,re as validateWranglerConfig,z as validateWranglerProject,N as withTailConsumer,k as wranglerToAlchemy};
package/dist/index.d.mts CHANGED
@@ -2,8 +2,8 @@ import { AgentIR, ContainerIR, WorkflowIR, CodegenResult } from '@lunora/codegen
2
2
  export type { AgentIR, ContainerIR, WorkflowIR } from '@lunora/codegen';
3
3
  import { ChildProcess } from 'node:child_process';
4
4
  import { Writable } from 'node:stream';
5
- import { T as ToolchainCommand, D as DeployDriver, P as ProjectionPurpose } from "./packem_shared/schema-info.d-fEhxTb9k.mjs";
6
- export { C as COMPOSED_WORKER_ENTRY, type a as DeployRequest, type b as DevRequest, type c as DiscoverSchemaInfoResult, type d as DriverToolchain, e as GENERATED_CLASS_MODULES, type G as GeneratedClassModule, type f as InferOptions, type g as InferredAgent, type I as InferredBindings, type h as InferredContainer, type i as InferredWorkflow, type j as ProjectedConfig, type S as SchemaInfo, type k as SecretRequest, type l as TailRequest, m as discoverSchemaInfo, n as inferLunoraBindings, p as packageNamesFromBindings } from "./packem_shared/schema-info.d-fEhxTb9k.mjs";
5
+ import { T as ToolchainCommand, D as DeployDriver, P as ProjectionPurpose } from "./packem_shared/infer-bindings.d-Bay0cm0d.mjs";
6
+ export { C as COMPOSED_WORKER_ENTRY, type a as DeployRequest, type b as DevRequest, type c as DiscoverSchemaInfoResult, type d as DriverToolchain, e as GENERATED_CLASS_MODULES, type G as GeneratedClassModule, type f as InferOptions, type g as InferredAgent, type I as InferredBindings, type h as InferredContainer, type i as InferredWorkflow, type j as ProjectedConfig, type S as SchemaInfo, type k as SecretRequest, type l as TailRequest, m as discoverSchemaInfo, n as inferLunoraBindings, p as packageNamesFromBindings } from "./packem_shared/infer-bindings.d-Bay0cm0d.mjs";
7
7
  export { type A as AdditivePolicyEdit, type D as DestructivePolicyEdit, type P as PolicyEdit, type a as PolicyScaffoldFailureReason, type b as ScaffoldFileResult, type S as ScaffoldPolicyEdit, type c as WireResult, type W as WireRlsEdit, d as classifyPolicyEdit, r as resolveServerModule, s as scaffoldPolicyFile, w as wireRlsIntoProcedure } from "./packem_shared/policy-scaffold.d-D2H4_G01.mjs";
8
8
  interface DiscoverAgentInfoResult {
9
9
  /** Discovered agent definitions; `[]` when none are declared or parsing failed. */
package/dist/index.d.ts CHANGED
@@ -2,8 +2,8 @@ import { AgentIR, ContainerIR, WorkflowIR, CodegenResult } from '@lunora/codegen
2
2
  export type { AgentIR, ContainerIR, WorkflowIR } from '@lunora/codegen';
3
3
  import { ChildProcess } from 'node:child_process';
4
4
  import { Writable } from 'node:stream';
5
- import { T as ToolchainCommand, D as DeployDriver, P as ProjectionPurpose } from "./packem_shared/schema-info.d-fEhxTb9k.js";
6
- export { C as COMPOSED_WORKER_ENTRY, type a as DeployRequest, type b as DevRequest, type c as DiscoverSchemaInfoResult, type d as DriverToolchain, e as GENERATED_CLASS_MODULES, type G as GeneratedClassModule, type f as InferOptions, type g as InferredAgent, type I as InferredBindings, type h as InferredContainer, type i as InferredWorkflow, type j as ProjectedConfig, type S as SchemaInfo, type k as SecretRequest, type l as TailRequest, m as discoverSchemaInfo, n as inferLunoraBindings, p as packageNamesFromBindings } from "./packem_shared/schema-info.d-fEhxTb9k.js";
5
+ import { T as ToolchainCommand, D as DeployDriver, P as ProjectionPurpose } from "./packem_shared/infer-bindings.d-Bay0cm0d.js";
6
+ export { C as COMPOSED_WORKER_ENTRY, type a as DeployRequest, type b as DevRequest, type c as DiscoverSchemaInfoResult, type d as DriverToolchain, e as GENERATED_CLASS_MODULES, type G as GeneratedClassModule, type f as InferOptions, type g as InferredAgent, type I as InferredBindings, type h as InferredContainer, type i as InferredWorkflow, type j as ProjectedConfig, type S as SchemaInfo, type k as SecretRequest, type l as TailRequest, m as discoverSchemaInfo, n as inferLunoraBindings, p as packageNamesFromBindings } from "./packem_shared/infer-bindings.d-Bay0cm0d.js";
7
7
  export { type A as AdditivePolicyEdit, type D as DestructivePolicyEdit, type P as PolicyEdit, type a as PolicyScaffoldFailureReason, type b as ScaffoldFileResult, type S as ScaffoldPolicyEdit, type c as WireResult, type W as WireRlsEdit, d as classifyPolicyEdit, r as resolveServerModule, s as scaffoldPolicyFile, w as wireRlsIntoProcedure } from "./packem_shared/policy-scaffold.d-D2H4_G01.js";
8
8
  interface DiscoverAgentInfoResult {
9
9
  /** Discovered agent definitions; `[]` when none are declared or parsing failed. */
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{AGENT_MODE_ENV as o,detectAiAgent as t}from"./packem_shared/AGENT_MODE_ENV-D8MvSwPE.mjs";import{discoverAgentInfo as s}from"./packem_shared/discoverAgentInfo-CTdCSfYM.mjs";import{AGENT_RULES_DIR as i,AGENT_RULES_HINT as n,AGENT_RULES_HINT_ENV as l,LUNORA_SKILL_NAMES as p,ROOT_SKILL_NAME as _,claimAgentRulesHint as c,detectAgentRules as d}from"./packem_shared/AGENT_RULES_DIR-C54Ta_vz.mjs";import{startCelldDevSession as m}from"./packem_shared/startCelldDevSession-BLFsd6jG.mjs";import{CODEGEN_ENV as S,isCodegenDisabled as f}from"./packem_shared/CODEGEN_ENV-ZsCxV1kP.mjs";import{discoverContainerInfo as L}from"./packem_shared/discoverContainerInfo-EhZtEBQs.mjs";import{streamContainerLogs as R}from"./packem_shared/streamContainerLogs-0nko1qpv.mjs";import{detectFramework as T,projectUsesUmbrella as x,readProjectDependencyNames as V}from"./packem_shared/detectFramework-CUiVEHDQ.mjs";import{acceptsConnection as P,startDevProcess as u}from"./packem_shared/acceptsConnection-DHhUYGjT.mjs";import{DEV_BINDINGS_FILE as F,DEV_DAEMON_ENV as C,DEV_HANDOFF_ENV as U,DEV_LOG_FILE as G,DEV_LOG_FILE_ENV as b,DEV_STATE_DIR as M,DEV_STATE_FILE as y,claimDevServerState as k,clearDevServerState as B,isDevServerReady as K,isProcessAlive as w,isRecordedProcessCurrent as h,readDevServerState as j,readLiveDevServerState as H,updateDevServerState as W,writeDevServerState as Y}from"./packem_shared/DEV_BINDINGS_FILE-pyOiNLP4.mjs";import{DEV_VARS_EXAMPLE_FILE as q,DEV_VARS_FILE as X,DEV_VARS_KEY_PATTERN as z,escapeRegExp as Q,parseDevVariableEntries as Z,removeDevVariableLine as $,upsertDevVariableLine as ee}from"./packem_shared/DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";import{DEV_WORKER_ENV_VALUE as oe,DEV_WORKER_ENV_VAR as te,ensureDevWorkerEnv as ae}from"./packem_shared/DEV_WORKER_ENV_VALUE-DwGANZVw.mjs";import{DEFAULT_DEPLOY_TARGET as Ee,deployTargetIds as ie,isRunnableTarget as ne,planToolchainInvocation as le,resolveDeployDriver as pe,runnableTargetIds as _e,targetRunsOwnDevServer as ce}from"./packem_shared/DEFAULT_DEPLOY_TARGET-CfoV0tDu.mjs";import{inferLunoraBindings as De,packageNamesFromBindings as me}from"./packem_shared/inferLunoraBindings-DXLEJY9w.mjs";import{LINKED_PROJECT_DIR as Se,LINKED_PROJECT_FILE as fe,readLinkedProject as ve,writeLinkedProject as Le}from"./packem_shared/LINKED_PROJECT_DIR-Ba5qPEwo.mjs";import{LUNORA_IGNORED_PATHS as Re,applyLintIgnores as ge,detectLintTools as Te}from"./packem_shared/LUNORA_IGNORED_PATHS-B0-PPvRp.mjs";import{LUNORA_TAG as Ve,advisoryLine as Ie,blockingFindingsMessage as Pe,lunoraLine as ue,reportCodegenFindings as Oe}from"./packem_shared/LUNORA_TAG-CiQM3BkI.mjs";import{LUNORA_EVENT_SOURCE as Ce,formatLunoraEvent as Ue}from"./packem_shared/LUNORA_EVENT_SOURCE-DYdcDU9G.mjs";import{default as be}from"./packem_shared/LunoraReporter-f277GLNT.mjs";import{addArgsFor as ye,detectInstalledManagers as ke,detectPackageManager as Be,execArgsFor as Ke,installArgsFor as we,runScriptArgsFor as he,runScriptCommand as je,toolchainExecArgs as He}from"./packem_shared/addArgsFor-CYZKhNIo.mjs";import{P as Ye,s as Je}from"./packem_shared/package-secrets-registry-DvtTiK4b.mjs";import{runPostCodegenHook as Xe}from"./packem_shared/runPostCodegenHook-B0T1q2YI.mjs";import{interpretRemote as Qe,readProjectRemotePreference as Ze,readProjectTarget as $e,resolveProjectTarget as er,resolveTargetOrThrow as rr}from"./packem_shared/interpretRemote-C9yJC_ZK.mjs";import{createConfirm as tr,isInteractive as ar,promptMultiSelect as sr,promptSelect as Er,promptText as ir,promptYesNo as nr}from"./packem_shared/createConfirm-D5mKTMHj.mjs";import{buildPackageSecretsBlock as pr,ensureDevVariables as _r,ensureDevVarsExample as cr,fillDevSecrets as dr,generateSecretValue as Dr,isMintableSecretKey as mr,isPlaceholderValue as Ar,planDevSecretsFill as Sr,planDevVariablesAugment as fr,planDevVariablesScaffold as vr,requiredSecrets as Lr,writeDevVariablesFileAtomically as Nr}from"./packem_shared/buildPackageSecretsBlock-yv9mjKEW.mjs";import{applyAdditiveEdit as gr,classifyEdit as Tr}from"./packem_shared/applyAdditiveEdit-CH0VhMJ2.mjs";import{parseSchema as Vr}from"./packem_shared/parseSchema-D1Wbr1qv.mjs";import{classifyPolicyEdit as Pr,resolveServerModule as ur,scaffoldPolicyFile as Or,wireRlsIntoProcedure as Fr}from"./packem_shared/classifyPolicyEdit-D8NwrHxR.mjs";import{discoverSchemaInfo as Ur}from"./packem_shared/discoverSchemaInfo-DJvevsCm.mjs";import{ACCENT as br,BADGES as Mr,BADGE_COLUMN_WIDTH as yr,LUNA_ART as kr,LUNA_BUNNY as Br,LUNA_NAME as Kr,LUNA_SIGNOFF as wr,STEP_BADGE_NAMES as hr,badgeLead as jr,badgeWidth as Hr,padBadge as Wr,paintAnswer as Yr,paintBadge as Jr}from"./packem_shared/ACCENT-CotPTfv7.mjs";import{COMPOSED_WORKER_ENTRY as Xr,GENERATED_CLASS_MODULES as zr}from"./packem_shared/COMPOSED_WORKER_ENTRY-C69wqbSP.mjs";import{discoverWorkflowInfo as Zr}from"./packem_shared/discoverWorkflowInfo-BsPvlo6O.mjs";export{br as ACCENT,o as AGENT_MODE_ENV,i as AGENT_RULES_DIR,n as AGENT_RULES_HINT,l as AGENT_RULES_HINT_ENV,Mr as BADGES,yr as BADGE_COLUMN_WIDTH,S as CODEGEN_ENV,Xr as COMPOSED_WORKER_ENTRY,Ee as DEFAULT_DEPLOY_TARGET,F as DEV_BINDINGS_FILE,C as DEV_DAEMON_ENV,U as DEV_HANDOFF_ENV,G as DEV_LOG_FILE,b as DEV_LOG_FILE_ENV,M as DEV_STATE_DIR,y as DEV_STATE_FILE,q as DEV_VARS_EXAMPLE_FILE,X as DEV_VARS_FILE,z as DEV_VARS_KEY_PATTERN,oe as DEV_WORKER_ENV_VALUE,te as DEV_WORKER_ENV_VAR,zr as GENERATED_CLASS_MODULES,Se as LINKED_PROJECT_DIR,fe as LINKED_PROJECT_FILE,kr as LUNA_ART,Br as LUNA_BUNNY,Kr as LUNA_NAME,wr as LUNA_SIGNOFF,Ce as LUNORA_EVENT_SOURCE,Re as LUNORA_IGNORED_PATHS,p as LUNORA_SKILL_NAMES,Ve as LUNORA_TAG,be as LunoraReporter,Ye as PACKAGE_SECRETS_REGISTRY,_ as ROOT_SKILL_NAME,hr as STEP_BADGE_NAMES,P as acceptsConnection,ye as addArgsFor,Ie as advisoryLine,gr as applyAdditiveEdit,ge as applyLintIgnores,jr as badgeLead,Hr as badgeWidth,Pe as blockingFindingsMessage,pr as buildPackageSecretsBlock,c as claimAgentRulesHint,k as claimDevServerState,Tr as classifyEdit,Pr as classifyPolicyEdit,B as clearDevServerState,tr as createConfirm,ie as deployTargetIds,d as detectAgentRules,t as detectAiAgent,T as detectFramework,ke as detectInstalledManagers,Te as detectLintTools,Be as detectPackageManager,s as discoverAgentInfo,L as discoverContainerInfo,Ur as discoverSchemaInfo,Zr as discoverWorkflowInfo,_r as ensureDevVariables,cr as ensureDevVarsExample,ae as ensureDevWorkerEnv,Q as escapeRegExp,Ke as execArgsFor,dr as fillDevSecrets,Ue as formatLunoraEvent,Dr as generateSecretValue,De as inferLunoraBindings,we as installArgsFor,Qe as interpretRemote,f as isCodegenDisabled,K as isDevServerReady,ar as isInteractive,mr as isMintableSecretKey,Ar as isPlaceholderValue,w as isProcessAlive,h as isRecordedProcessCurrent,ne as isRunnableTarget,ue as lunoraLine,me as packageNamesFromBindings,Wr as padBadge,Yr as paintAnswer,Jr as paintBadge,Z as parseDevVariableEntries,Vr as parseSchema,Sr as planDevSecretsFill,fr as planDevVariablesAugment,vr as planDevVariablesScaffold,le as planToolchainInvocation,x as projectUsesUmbrella,sr as promptMultiSelect,Er as promptSelect,ir as promptText,nr as promptYesNo,j as readDevServerState,ve as readLinkedProject,H as readLiveDevServerState,V as readProjectDependencyNames,Ze as readProjectRemotePreference,$e as readProjectTarget,$ as removeDevVariableLine,Oe as reportCodegenFindings,Lr as requiredSecrets,pe as resolveDeployDriver,er as resolveProjectTarget,ur as resolveServerModule,rr as resolveTargetOrThrow,Xe as runPostCodegenHook,he as runScriptArgsFor,je as runScriptCommand,_e as runnableTargetIds,Or as scaffoldPolicyFile,Je as secretsForPackages,m as startCelldDevSession,u as startDevProcess,R as streamContainerLogs,ce as targetRunsOwnDevServer,He as toolchainExecArgs,W as updateDevServerState,ee as upsertDevVariableLine,Fr as wireRlsIntoProcedure,Y as writeDevServerState,Nr as writeDevVariablesFileAtomically,Le as writeLinkedProject};
1
+ import{AGENT_MODE_ENV as o,detectAiAgent as t}from"./packem_shared/AGENT_MODE_ENV-D8MvSwPE.mjs";import{discoverAgentInfo as s}from"./packem_shared/discoverAgentInfo-CTdCSfYM.mjs";import{AGENT_RULES_DIR as i,AGENT_RULES_HINT as n,AGENT_RULES_HINT_ENV as l,LUNORA_SKILL_NAMES as p,ROOT_SKILL_NAME as _,claimAgentRulesHint as c,detectAgentRules as d}from"./packem_shared/AGENT_RULES_DIR-C54Ta_vz.mjs";import{startCelldDevSession as m}from"./packem_shared/startCelldDevSession-BLFsd6jG.mjs";import{CODEGEN_ENV as S,isCodegenDisabled as f}from"./packem_shared/CODEGEN_ENV-ZsCxV1kP.mjs";import{discoverContainerInfo as L}from"./packem_shared/discoverContainerInfo-EhZtEBQs.mjs";import{streamContainerLogs as R}from"./packem_shared/streamContainerLogs-0nko1qpv.mjs";import{detectFramework as T,projectUsesUmbrella as x,readProjectDependencyNames as V}from"./packem_shared/detectFramework-CUiVEHDQ.mjs";import{acceptsConnection as P,startDevProcess as u}from"./packem_shared/acceptsConnection-DHhUYGjT.mjs";import{DEV_BINDINGS_FILE as F,DEV_DAEMON_ENV as C,DEV_HANDOFF_ENV as U,DEV_LOG_FILE as G,DEV_LOG_FILE_ENV as b,DEV_STATE_DIR as M,DEV_STATE_FILE as y,claimDevServerState as k,clearDevServerState as B,isDevServerReady as K,isProcessAlive as w,isRecordedProcessCurrent as h,readDevServerState as j,readLiveDevServerState as H,updateDevServerState as W,writeDevServerState as Y}from"./packem_shared/DEV_BINDINGS_FILE-pyOiNLP4.mjs";import{DEV_VARS_EXAMPLE_FILE as q,DEV_VARS_FILE as X,DEV_VARS_KEY_PATTERN as z,escapeRegExp as Q,parseDevVariableEntries as Z,removeDevVariableLine as $,upsertDevVariableLine as ee}from"./packem_shared/DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";import{DEV_WORKER_ENV_VALUE as oe,DEV_WORKER_ENV_VAR as te,ensureDevWorkerEnv as ae}from"./packem_shared/DEV_WORKER_ENV_VALUE-DwGANZVw.mjs";import{DEFAULT_DEPLOY_TARGET as Ee,deployTargetIds as ie,isRunnableTarget as ne,planToolchainInvocation as le,resolveDeployDriver as pe,runnableTargetIds as _e,targetRunsOwnDevServer as ce}from"./packem_shared/DEFAULT_DEPLOY_TARGET-CfoV0tDu.mjs";import{i as De,p as me}from"./packem_shared/infer-bindings-B3rsAmY_.mjs";import{LINKED_PROJECT_DIR as Se,LINKED_PROJECT_FILE as fe,readLinkedProject as ve,writeLinkedProject as Le}from"./packem_shared/LINKED_PROJECT_DIR-Ba5qPEwo.mjs";import{LUNORA_IGNORED_PATHS as Re,applyLintIgnores as ge,detectLintTools as Te}from"./packem_shared/LUNORA_IGNORED_PATHS-B0-PPvRp.mjs";import{LUNORA_TAG as Ve,advisoryLine as Ie,blockingFindingsMessage as Pe,lunoraLine as ue,reportCodegenFindings as Oe}from"./packem_shared/LUNORA_TAG-CiQM3BkI.mjs";import{LUNORA_EVENT_SOURCE as Ce,formatLunoraEvent as Ue}from"./packem_shared/LUNORA_EVENT_SOURCE-DYdcDU9G.mjs";import{default as be}from"./packem_shared/LunoraReporter-f277GLNT.mjs";import{addArgsFor as ye,detectInstalledManagers as ke,detectPackageManager as Be,execArgsFor as Ke,installArgsFor as we,runScriptArgsFor as he,runScriptCommand as je,toolchainExecArgs as He}from"./packem_shared/addArgsFor-CYZKhNIo.mjs";import{P as Ye,s as Je}from"./packem_shared/package-secrets-registry-DvtTiK4b.mjs";import{runPostCodegenHook as Xe}from"./packem_shared/runPostCodegenHook-B0T1q2YI.mjs";import{interpretRemote as Qe,readProjectRemotePreference as Ze,readProjectTarget as $e,resolveProjectTarget as er,resolveTargetOrThrow as rr}from"./packem_shared/interpretRemote-C9yJC_ZK.mjs";import{createConfirm as tr,isInteractive as ar,promptMultiSelect as sr,promptSelect as Er,promptText as ir,promptYesNo as nr}from"./packem_shared/createConfirm-D5mKTMHj.mjs";import{buildPackageSecretsBlock as pr,ensureDevVariables as _r,ensureDevVarsExample as cr,fillDevSecrets as dr,generateSecretValue as Dr,isMintableSecretKey as mr,isPlaceholderValue as Ar,planDevSecretsFill as Sr,planDevVariablesAugment as fr,planDevVariablesScaffold as vr,requiredSecrets as Lr,writeDevVariablesFileAtomically as Nr}from"./packem_shared/buildPackageSecretsBlock-yv9mjKEW.mjs";import{applyAdditiveEdit as gr,classifyEdit as Tr}from"./packem_shared/applyAdditiveEdit-CH0VhMJ2.mjs";import{parseSchema as Vr}from"./packem_shared/parseSchema-D1Wbr1qv.mjs";import{classifyPolicyEdit as Pr,resolveServerModule as ur,scaffoldPolicyFile as Or,wireRlsIntoProcedure as Fr}from"./packem_shared/classifyPolicyEdit-D8NwrHxR.mjs";import{discoverSchemaInfo as Ur}from"./packem_shared/discoverSchemaInfo-BguahM6z.mjs";import{ACCENT as br,BADGES as Mr,BADGE_COLUMN_WIDTH as yr,LUNA_ART as kr,LUNA_BUNNY as Br,LUNA_NAME as Kr,LUNA_SIGNOFF as wr,STEP_BADGE_NAMES as hr,badgeLead as jr,badgeWidth as Hr,padBadge as Wr,paintAnswer as Yr,paintBadge as Jr}from"./packem_shared/ACCENT-CotPTfv7.mjs";import{COMPOSED_WORKER_ENTRY as Xr,GENERATED_CLASS_MODULES as zr}from"./packem_shared/COMPOSED_WORKER_ENTRY-C69wqbSP.mjs";import{discoverWorkflowInfo as Zr}from"./packem_shared/discoverWorkflowInfo-BsPvlo6O.mjs";export{br as ACCENT,o as AGENT_MODE_ENV,i as AGENT_RULES_DIR,n as AGENT_RULES_HINT,l as AGENT_RULES_HINT_ENV,Mr as BADGES,yr as BADGE_COLUMN_WIDTH,S as CODEGEN_ENV,Xr as COMPOSED_WORKER_ENTRY,Ee as DEFAULT_DEPLOY_TARGET,F as DEV_BINDINGS_FILE,C as DEV_DAEMON_ENV,U as DEV_HANDOFF_ENV,G as DEV_LOG_FILE,b as DEV_LOG_FILE_ENV,M as DEV_STATE_DIR,y as DEV_STATE_FILE,q as DEV_VARS_EXAMPLE_FILE,X as DEV_VARS_FILE,z as DEV_VARS_KEY_PATTERN,oe as DEV_WORKER_ENV_VALUE,te as DEV_WORKER_ENV_VAR,zr as GENERATED_CLASS_MODULES,Se as LINKED_PROJECT_DIR,fe as LINKED_PROJECT_FILE,kr as LUNA_ART,Br as LUNA_BUNNY,Kr as LUNA_NAME,wr as LUNA_SIGNOFF,Ce as LUNORA_EVENT_SOURCE,Re as LUNORA_IGNORED_PATHS,p as LUNORA_SKILL_NAMES,Ve as LUNORA_TAG,be as LunoraReporter,Ye as PACKAGE_SECRETS_REGISTRY,_ as ROOT_SKILL_NAME,hr as STEP_BADGE_NAMES,P as acceptsConnection,ye as addArgsFor,Ie as advisoryLine,gr as applyAdditiveEdit,ge as applyLintIgnores,jr as badgeLead,Hr as badgeWidth,Pe as blockingFindingsMessage,pr as buildPackageSecretsBlock,c as claimAgentRulesHint,k as claimDevServerState,Tr as classifyEdit,Pr as classifyPolicyEdit,B as clearDevServerState,tr as createConfirm,ie as deployTargetIds,d as detectAgentRules,t as detectAiAgent,T as detectFramework,ke as detectInstalledManagers,Te as detectLintTools,Be as detectPackageManager,s as discoverAgentInfo,L as discoverContainerInfo,Ur as discoverSchemaInfo,Zr as discoverWorkflowInfo,_r as ensureDevVariables,cr as ensureDevVarsExample,ae as ensureDevWorkerEnv,Q as escapeRegExp,Ke as execArgsFor,dr as fillDevSecrets,Ue as formatLunoraEvent,Dr as generateSecretValue,De as inferLunoraBindings,we as installArgsFor,Qe as interpretRemote,f as isCodegenDisabled,K as isDevServerReady,ar as isInteractive,mr as isMintableSecretKey,Ar as isPlaceholderValue,w as isProcessAlive,h as isRecordedProcessCurrent,ne as isRunnableTarget,ue as lunoraLine,me as packageNamesFromBindings,Wr as padBadge,Yr as paintAnswer,Jr as paintBadge,Z as parseDevVariableEntries,Vr as parseSchema,Sr as planDevSecretsFill,fr as planDevVariablesAugment,vr as planDevVariablesScaffold,le as planToolchainInvocation,x as projectUsesUmbrella,sr as promptMultiSelect,Er as promptSelect,ir as promptText,nr as promptYesNo,j as readDevServerState,ve as readLinkedProject,H as readLiveDevServerState,V as readProjectDependencyNames,Ze as readProjectRemotePreference,$e as readProjectTarget,$ as removeDevVariableLine,Oe as reportCodegenFindings,Lr as requiredSecrets,pe as resolveDeployDriver,er as resolveProjectTarget,ur as resolveServerModule,rr as resolveTargetOrThrow,Xe as runPostCodegenHook,he as runScriptArgsFor,je as runScriptCommand,_e as runnableTargetIds,Or as scaffoldPolicyFile,Je as secretsForPackages,m as startCelldDevSession,u as startDevProcess,R as streamContainerLogs,ce as targetRunsOwnDevServer,He as toolchainExecArgs,W as updateDevServerState,ee as upsertDevVariableLine,Fr as wireRlsIntoProcedure,Y as writeDevServerState,Nr as writeDevVariablesFileAtomically,Le as writeLinkedProject};
@@ -0,0 +1 @@
1
+ import{sqliteClasses as u}from"./wranglerToAlchemy-D8bWeHhd.mjs";const l=1,p=new Set(["$schema","account_id","compatibility_date","compatibility_flags","keep_vars","main","migrations","minify","name","observability","placement","routes","rules","secrets","triggers","upload_source_maps","vars","workers_dev"]),y=e=>Object.fromEntries(Object.entries(e).filter(([,n])=>n!==void 0)),d=[{bindingKey:"binding",field:"ai_search",resourceKey:"instance_name",type:"ai_search"},{bindingKey:"binding",field:"ai_search_namespaces",resourceKey:"namespace",type:"ai_search_namespace"},{bindingKey:"binding",field:"analytics_engine_datasets",resourceKey:"dataset",type:"analytics_engine"},{bindingKey:"binding",field:"artifacts",resourceKey:"namespace",type:"artifacts"},{bindingKey:"class_name",field:"containers",resourceKey:"image",type:"container"},{bindingKey:"binding",field:"d1_databases",resourceIdKey:"database_id",resourceKey:"database_name",type:"d1"},{bindingKey:"binding",field:"hyperdrive",resourceIdKey:"id",type:"hyperdrive"},{bindingKey:"binding",field:"kv_namespaces",resourceIdKey:"id",type:"kv"},{bindingKey:"binding",field:"pipelines",resourceKey:["stream","pipeline"],type:"pipeline"},{bindingKey:"binding",field:"r2_buckets",resourceKey:"bucket_name",type:"r2"},{bindingKey:"binding",field:"services",resourceKey:"service",type:"service"},{bindingKey:"binding",field:"vectorize",resourceKey:"index_name",type:"vectorize"},{bindingKey:"binding",field:"vpc_networks",resourceIdKey:["tunnel_id","network_id"],type:"vpc_network"},{bindingKey:"binding",field:"vpc_services",resourceIdKey:"service_id",type:"vpc_service"},{bindingKey:"binding",field:"workflows",resourceKey:"name",type:"workflow"}],c=[{field:"ai",type:"ai"},{field:"assets",type:"assets"},{field:"browser",type:"browser"},{field:"images",type:"images"},{field:"media",type:"media"},{field:"stream",type:"stream"}],b=new Set([...d.map(e=>e.field),...c.map(e=>e.field),"durable_objects","exports","queues"]),a=(e,n)=>(typeof n=="string"?[n]:n??[]).map(i=>e[i]).find(i=>typeof i=="string"&&i!==""),m=(e,n)=>{const s=[];for(const i of d)for(const r of e[i.field]??[]){const t=a(r,i.bindingKey);if(t===void 0){n.push(i.field);continue}s.push({binding:t,className:a(r,"class_name"),resource:a(r,i.resourceKey),resourceId:a(r,i.resourceIdKey),type:i.type})}return s},_=(e,n)=>{const s=u(e),i=[];for(const r of e.durable_objects?.bindings??[]){if(r.name===void 0||r.name===""){n.push("durable_objects");continue}i.push({binding:r.name,className:r.class_name,sqlite:r.script_name===void 0&&r.class_name!==void 0?s.has(r.class_name):void 0,type:"durable_object"})}return i},g=(e,n)=>{const s=[];for(const i of e.queues?.producers??[]){if(i.binding===void 0||i.binding===""){n.push("queues.producers");continue}s.push({binding:i.binding,resource:i.queue,type:"queue_producer"})}for(const i of e.queues?.consumers??[]){if(i.queue===void 0||i.queue===""){n.push("queues.consumers");continue}s.push({binding:i.queue,resource:i.queue,type:"queue_consumer"})}return s},f=(e,n)=>Object.entries(e.exports??{}).flatMap(([s,i])=>i?.type!=="workflow"?(n.push(`exports.${s}`),[]):[{binding:s,className:s,resource:i.name,type:"workflow"}]),v=(e,n,s)=>[...f(e,s),...m(e,n),..._(e,n),...g(e,n),...c.filter(i=>e[i.field]?.binding!==void 0).map(i=>({binding:e[i.field]?.binding,type:i.type}))],h=e=>{const n=[],s=[],i=v(e,n,s).map(t=>y(t)).toSorted((t,o)=>t.type.localeCompare(o.type)||t.binding.localeCompare(o.binding)),r=[...Object.keys(e).filter(t=>!p.has(t)&&!b.has(t)),...n.map(t=>`${t} (entry with no binding name)`),...s].toSorted((t,o)=>t.localeCompare(o));return{bindings:i,...e.compatibility_date===void 0?{}:{compatibilityDate:e.compatibility_date},...e.compatibility_flags===void 0?{}:{compatibilityFlags:e.compatibility_flags},crons:e.triggers?.crons??[],...e.name===void 0?{}:{name:e.name},unknown:r,vars:Object.keys(e.vars??{}).toSorted((t,o)=>t.localeCompare(o)),version:l}};export{l as BINDING_MANIFEST_VERSION,h as buildBindingManifest};
@@ -0,0 +1 @@
1
+ const _="global_fetch_strictly_public";export{_ as default};
@@ -0,0 +1 @@
1
+ import{writeFileSync as f,rmSync as m}from"node:fs";import{applyModify as g}from"./applyModify-DKP2l6S9.mjs";import{r as b}from"./lunora-manifest-v90ZUbVp.mjs";import{o as h}from"./reconcile-services-3dn35zgy.mjs";import{findWranglerFile as y,readWranglerJsonc as v}from"./WRANGLER_FILES-UNW-xY5u.mjs";import{join as E}from"node:path";const p={ai:{label:"AI",shape:"object"},ai_search:{label:"AI Search",shape:"array"},ai_search_namespaces:{label:"AI Search namespace",shape:"array"},d1_databases:{label:"D1",shape:"array"},kv_namespaces:{label:"KV",shape:"array"},queues:{label:"Queue",shape:"producers"},r2_buckets:{label:"R2",shape:"array"},services:{label:"Service",shape:"array"},vectorize:{label:"Vectorize",shape:"array"}},S=Object.keys(p),d=(e,r)=>typeof e.binding=="string"?e.binding:r,c=(e,r,n,t)=>{const a=[];for(const[o,s]of r.entries())s!=null&&a.push({binding:d(s,`#${String(o)}`),kind:n,path:[...t,o],section:e});return a},R=(e,r)=>{const{label:n,shape:t}=p[e];if(t==="array"){const o=r[e]??[];return c(e,o,n,[])}if(t==="producers")return c(e,r.queues?.producers??[],n,["producers"]);const a=r.ai;return a==null?[]:[{binding:d(a,e),kind:n,path:[],section:e}]},_=e=>S.flatMap(r=>R(r,e)),B=(e,r)=>{let n=e;for(const t of r)n=g(n,[t.section,...t.path,"remote"],!0);return n},i=()=>{},j=e=>{let r=!1;return()=>{if(!r){r=!0;try{m(e,{force:!0,recursive:!0})}catch{}}}};let u=0;const I=()=>(u+=1,`.wrangler.lunora-remote.${String(process.pid)}.${String(u)}.jsonc`),A=e=>{if(!e.enabled)return{cleanup:i,enabled:!1,remoteBindings:[]};const r=y(e.projectRoot);if(!r)return{cleanup:i,enabled:!0,reason:"wrangler.jsonc not found",remoteBindings:[]};const{parsed:n,text:t}=v(r);if(n===void 0)return{cleanup:i,enabled:!0,reason:`failed to parse ${r} as JSONC`,remoteBindings:[]};const a=h(b(e.projectRoot)),o=_(n).filter(l=>l.section!=="services"||!a.has(l.binding));if(o.length===0)return{cleanup:i,enabled:!0,reason:"no remote-eligible bindings to proxy",remoteBindings:[]};const s=E(e.projectRoot,I());return f(s,B(t,o),"utf8"),{cleanup:j(s),configPath:s,enabled:!0,remoteBindings:o}},C=e=>{if(e===void 0)return!1;const r=e.trim().toLowerCase();return r==="1"||r==="true"},O=e=>e.flag===!0||C(e.envValue)?!0:e.configPreference??!1;export{p as REMOTE_ELIGIBLE_KEYS,j as createCleanup,B as injectRemoteFlags,C as isRemoteEnvEnabled,A as materializeRemoteWranglerConfig,_ as planRemoteBindings,O as resolveRemoteEnabled};
@@ -0,0 +1 @@
1
+ import{o as m,v as h,a as E,b as p,c as D,d as y,e as l,f as I,g as O,H as R,h as S,R as $,S as j,i as A,j as k,W as L,k as w}from"./validate-bindings-TA4ZqC4j.mjs";import{validateTailConsumers as B,validateSendEmail as T,validateSecretsRequired as N,validateLogpush as C,validateLimits as U,validatePlacement as P,validateObservability as G,validateAssets as K,validateCache as V,validateExports as W,validateCorsVariables as x,validateSchedulerOrigin as F}from"./withTailConsumer-BK5uzf1W.mjs";import{isCacheEnabled as H,WORKERS_CACHE_MIN_DATE as _}from"./WORKERS_CACHE_MIN_DATE-0k9ABJtF.mjs";import{mergeWranglerEnvironment as M}from"./mergeWranglerEnvironment-CTh4zkEL.mjs";const Y=i=>typeof i=="object"&&i!==null&&!Array.isArray(i),f=i=>Array.isArray(i)?i.flatMap((a,n)=>Y(a)?[[n,a]]:[]):[],g=i=>typeof i.binding=="string"?i.binding:"",q=(i,a,n)=>{for(const[e,s]of f(i.kv_namespaces))typeof s.id=="string"&&s.id!==""||n.push(`kv_namespaces[${String(e)}] ("${g(s)}") is not created yet and the schema pins data to "${a}" — create it with \`wrangler kv namespace create <name> --jurisdiction=${a}\`; a namespace's jurisdiction cannot be changed afterwards`)},Q=(i,a,n)=>{for(const[e,s]of f(i.r2_buckets)){const r=s.jurisdiction;if(r===a)continue;const t=typeof r=="string"?`names the "${r}" jurisdiction`:"names no jurisdiction";n.push(`r2_buckets[${String(e)}] ("${g(s)}") ${t}, but the schema pins data to "${a}" — create the bucket with \`wrangler r2 bucket create <name> --jurisdiction=${a}\` and set "jurisdiction": "${a}" on the binding`)}},J=(i,a,n)=>{const e=a?.jurisdiction;e!==void 0&&(q(i,e,n),Q(i,e,n))},b="2026-04-07",de="web_socket_auto_reply_to_close",u="2026-10-01",v="durable_object_io_tasks_prevent_eviction",z="durable_object_io_tasks_do_not_prevent_eviction",X=/^\d{4}-\d{2}-\d{2}$/,Z=(i,a,n)=>{i>=u||a.includes(v)||a.includes(z)||n.push(`compatibility_date "${i}" predates "${u}", so pending I/O (waitUntil, cross-Durable-Object RPC, service-binding calls, timers) does not keep a Durable Object alive once its last client disconnects — live-query refreshes and durable streams can be cut off mid-flight. Set compatibility_date >= "${u}" or add the "${v}" compatibility flag`)},ee=(i,a,n)=>{const{error:e,merged:s,unverifiedKeys:r}=M(i,a);return e!==void 0?{error:e,wrangler:s}:(r.length>0&&n.push(`env.${String(a)} overrides ${r.join(", ")}, which this validator doesn't have a verified inheritance rule for — validated against the TOP-LEVEL value only. Double-check ${r.length===1?"it":"them"} by hand for "${String(a)}".`),{wrangler:s})},te=(i,a,n)=>{const e=[],s=[];if(!i||typeof i!="object")return e.push("wrangler config is not a valid object"),{errors:e,valid:!1,warnings:s};const{error:r,wrangler:t}=ee(i,n,s);if(r!==void 0)return e.push(r),{errors:e,valid:!1,warnings:s};m(t.durable_objects?.bindings).find(o=>o.name==="SHARD"&&o.class_name==="ShardDO")||e.push('durable_objects.bindings must include { "name": "SHARD", "class_name": "ShardDO" } — your dev server auto-reconciles this on startup, or add the binding manually'),h(t,e);const d=t.compatibility_date??"",c=X.test(d);d&&!c?e.push(`compatibility_date must be in YYYY-MM-DD format (got "${d}")`):d<b&&e.push(`compatibility_date must be >= "${b}" (got "${d||"<missing>"}")`),H(t)&&c&&d<_&&e.push(`cache.enabled requires compatibility_date >= "${_}" (got "${d||"<missing>"}")`),c&&Z(d,t.compatibility_flags??[],s),E(t,a,e),J(t,a,s),p(t,e),D(t,a?.vectorIndexNames??[],e),B(t,e),y(t,e,s),l(t.workflows,"workflows",L,e),I(t,e),O(t,e),l(t.secrets_store_secrets,"secrets_store_secrets",w,e);for(const o of R)S(t,o,e,s);for(const o of $)l(t[o.key],o.key,o,e);for(const o of j)A(t,o,e);return k(t,e),T(t,e,s),N(t,e),C(t,e),U(t,e),P(t,e),G(t,e,s),K(t,e),V(t,e),W(t,e),x(t,e),F(t,n,s),{errors:e,valid:e.length===0,warnings:s}},ce=te;export{b as REQUIRED_COMPATIBILITY_DATE,de as REQUIRED_FLAG,ce as validateWrangler,te as validateWranglerConfig};
@@ -1 +1 @@
1
- import{existsSync as f,readFileSync as N,readdirSync as W}from"node:fs";import{join as l,dirname as y,extname as w,basename as _}from"node:path";import{discoverSchemaInfo as P}from"./discoverSchemaInfo-DJvevsCm.mjs";import{COMPOSED_WORKER_ENTRY as L,LUNORA_WORKER_VIRTUAL_ID as g,isGeneratedOutput as F,WORKER_ENTRY_FALLBACKS as M,GENERATED_DIRECTORY as U,COMPOSED_ENTRY_DURABLE_OBJECTS as D,GENERATED_CLASS_MODULES as A,SOURCE_DOT_DIRECTORIES as B,NON_SOURCE_DIRECTORIES as G,isFrameworkDurableObject as Y}from"./COMPOSED_WORKER_ENTRY-C69wqbSP.mjs";import{o as K}from"./validate-bindings-Dnf1t0SY.mjs";import{Project as X,Node as p}from"ts-morph";import{mergeWranglerEnvironment as J}from"./mergeWranglerEnvironment-DOKJUNH8.mjs";import{findWranglerFile as V,readWranglerJsonc as q}from"./WRANGLER_FILES-UNW-xY5u.mjs";import{validateWranglerConfig as z}from"./REQUIRED_COMPATIBILITY_DATE-jTnj2MPJ.mjs";const E=[".ts",".tsx",".mts",".cts"],b=new Set(E),H=new Set([".cjs",".js",".mjs"]),v="default",S={".cjs":[".cts"],".js":[".ts",".tsx"],".mjs":[".mts"]},Q=250,Z=(e,s,t)=>{const o=l(s,L);if(f(o))return{origin:"declared",path:o};if(e===g)return{origin:"composed"};const n=()=>{const a=M.map(c=>l(s,c)).find(c=>f(c));return a===void 0?void 0:{origin:"probed",path:a}};if(typeof e!="string"||e.length===0||F(e))return n();const r=l(y(t),e),i=w(r);if(!(!b.has(i)&&!H.has(i)))return f(r)?{origin:"declared",path:r}:{origin:"absent",path:r}},T=(e,s)=>{if(p.isIdentifier(e)){s.add(e.getText());return}if(p.isObjectBindingPattern(e)||p.isArrayBindingPattern(e))for(const t of e.getElements())p.isBindingElement(t)&&T(t.getNameNode(),s)},ee=(e,s)=>{const t=[];for(const o of e.getExportDeclarations())if(!o.isTypeOnly()){if(o.isNamespaceExport()){const n=o.getNamespaceExport();n===void 0?t.push(o.getModuleSpecifierValue()??""):s.add(n.getName());continue}for(const n of o.getNamedExports())n.isTypeOnly()||s.add(n.getAliasNode()?.getText()??n.getName())}return t},te=(e,s)=>{for(const t of e.getVariableStatements().filter(o=>o.getExportKeyword()!==void 0))for(const o of t.getDeclarations())T(o.getNameNode(),s);for(const t of[...e.getClasses(),...e.getFunctions(),...e.getEnums()]){if(t.getExportKeyword()===void 0)continue;const o=t.isDefaultExport()?v:t.getName();o!==void 0&&s.add(o)}e.getExportAssignments().length>0&&s.add(v)},$=(e,s)=>{const t=new X({compilerOptions:{allowJs:!0},skipFileDependencyResolution:!0,skipLoadingLibFiles:!0,useInMemoryFileSystem:!0}),o=t.createSourceFile(e,s,{overwrite:!0});return t.getProgram().compilerObject.getSyntacticDiagnostics(o.compilerNode).length>0?void 0:o},re=(e,s)=>{if(!s.startsWith("./")&&!s.startsWith("../"))return;const t=l(y(e),s),o=w(t),n=b.has(o)||S[o]!==void 0,r=n?t.slice(0,-o.length):t;return[...b.has(o)?[t]:[],...(S[o]??[]).map(a=>`${r}${a}`),...n?[]:E.map(a=>`${t}${a}`),...n||o.length===0?E.map(a=>l(r,`index${a}`)):[]].find(a=>f(a))},k=e=>{const s=new Set,t=new Set([e]),o=[e];for(;o.length>0;){if(t.size-1>Q)return;const n=o.pop();let r;try{r=N(n,"utf8")}catch{return}const i=$(_(n),r);if(i===void 0)return;const a=ee(i,s);te(i,s);for(const c of a){const d=re(n,c);if(d===void 0)return;t.has(d)||(t.add(d),o.push(d))}}return s},oe=(e,s)=>{const t={exports:void 0,kind:"composed",path:g},o=l(e,s,U);if(!f(o))return t;const n=new Set(D);for(const r of A){const i=l(o,`${r}.ts`);if(!f(i))continue;const a=k(i);if(a===void 0)return t;for(const c of a)n.add(c)}return{exports:n,kind:"composed",path:g}},se=(e,s,t)=>{if(e===void 0||e.origin==="absent")return;if(e.origin==="composed")return oe(s,t);const o=k(e.path);if(!(e.origin==="probed"&&o!==void 0&&!o.has(v)))return{exports:o,kind:"authored",path:e.path}},ne=new Set([".cjs",".cts",".js",".jsx",".mjs",".mts",".ts",".tsx"]),ie=2e3,R="defineTable",O="defineApp",ae=e=>{const s=[],t=[];let o;try{o=W(e,{withFileTypes:!0})}catch{return{files:s,subdirectories:t}}for(const n of o)n.isDirectory()?n.name.startsWith(".")&&!B.has(n.name)||G.has(n.name)||t.push(l(e,n.name)):ne.has(w(n.name))&&s.push(l(e,n.name));return{files:s,subdirectories:t}},j=(e,s)=>{const t=new Set;for(const o of e.getImportDeclarations())for(const n of o.getNamedImports())!n.isTypeOnly()&&n.getName()===s&&t.add(n.getAliasNode()?.getText()??n.getName());return t},ce=(e,s)=>{let t=!1;return e.forEachDescendant((o,n)=>{if(!p.isCallExpression(o))return;const r=o.getExpression();p.isIdentifier(r)&&s.has(r.getText())&&(t=!0,n.stop())}),t},le=e=>{let s=e;for(;p.isCallExpression(s)||p.isPropertyAccessExpression(s);)s=s.getExpression();return s},de=(e,s)=>{const t=le(e);return p.isIdentifier(t)&&s.has(t.getText())},I={global:/\.\s*global\s*\(/u,hyperdriveGlobal:/\.\s*hyperdriveGlobal\s*\(/u,vectors:/\.\s*vectors\s*\(/u},pe=e=>Object.hasOwn(I,e),fe=(e,s)=>{const t=new Set,o=new Set([R,...j(e,R)]);return e.forEachDescendant(n=>{if(!p.isCallExpression(n))return;const r=n.getExpression();if(!p.isPropertyAccessExpression(r)||de(r,o))return;const i=r.getName();pe(i)&&s.has(i)&&t.add(i)}),t},he=(e,s)=>{let t;try{t=N(e,"utf8")}catch{return}const o=new Set([...s].filter(r=>I[r].test(t)));if(o.size===0&&!t.includes(O))return;const n=$(_(e),t);return n===void 0?{chained:o,composes:!1}:{chained:fe(n,o),composes:ce(n,j(n,O))}},ue=(e,s)=>{const t=[e],o=new Set;let n=0,r;const i=a=>{if(n+=1,n>ie)return!1;const c=he(a,s);for(const d of c?.chained??[])o.add(d);return c?.composes&&(r??=a),!0};for(;t.length>0;){const a=t.pop(),{files:c,subdirectories:d}=ae(a);t.push(...d);for(const m of c){if(!i(m))return;if(r!==void 0&&o.size===s.size)return{chained:o,site:r}}}return r===void 0?void 0:{chained:o,site:r}},C=e=>Array.isArray(e)?e:[],me=(e,s,t)=>Object.entries(e?.images??{}).flatMap(([o,n])=>{const r=n?.dockerfile;return typeof r!="string"||f(r.startsWith("/")?r:l(s,r))?[]:[`containers images["${o}"] dockerfile "${r}" does not exist (resolved relative to ${t}); create the Dockerfile`]}),ge=(e,s,t)=>{const o=[];for(const n of C(e)){const r=n?.image;typeof r=="string"&&(r.startsWith("./")||r.startsWith("../")||r.startsWith("/")||r.includes("Dockerfile"))&&!f(r.startsWith("/")?r:l(s,r))&&o.push(`containers image "${r}" does not exist (resolved relative to ${t}); create the Dockerfile or point image at a registry reference`),o.push(...me(n,s,t))}return o},Ee=(e,s)=>{const t=e?.vectorIndexNames??[],o=[];if(t.length>0&&o.push({message:r=>`schema declares vector index(es) ${t.map(i=>`"${i}"`).join(", ")} but nothing chains .vectors(...) onto defineApp() (composed in: ${r}) — \`ctx.vectors\` is then a throwing stub and buildWorkerOptions rejects EVERY request, /_lunora/health included. Add \`.vectors((env) => ({ ${String(t[0])}: env.<BINDING> }))\` to the chain.`,method:"vectors"}),e?.hasD1GlobalTable&&o.push({message:r=>`schema declares .global() table(s) but nothing chains .global(...) onto defineApp() (composed in: ${r}) — the shard then has no global writer, so every read or write of a global table throws INTERNAL ("requires a globalDb writer"). Add \`.global({ d1: (env) => env.DB })\` to the chain.`,method:"global"}),e?.hasHyperdriveGlobalTable&&o.push({message:r=>`schema declares .global({ backend: "hyperdrive" }) table(s) but nothing chains .hyperdriveGlobal(...) onto defineApp() (composed in: ${r}) — the shard then has no global writer, so every read or write of those tables throws INTERNAL. Add \`.hyperdriveGlobal({ engine: "postgres", exec: (env) => buildPgExec(fromPostgresJs(postgres(env.HYPERDRIVE.connectionString))) })\` to the chain (\`buildPgExec\` from \`@lunora/hyperdrive/global\`, \`fromPostgresJs\` from \`@lunora/hyperdrive\`).`,method:"hyperdriveGlobal"}),o.length===0)return[];const n=ue(s,new Set(o.map(r=>r.method)));return n===void 0?[]:o.filter(r=>!n.chained.has(r.method)).map(r=>r.message(n.site))},be="does not export it",ve=(e,s)=>{if(s!=="composed")return`Re-export it from the module that defines it (\`export { ${e} } from "./…";\`), or add it to the app builder's own export (\`export const { ${e} } = app;\`).`;const t=`it exports ${D.join(", ")}, SchedulerDO when its binding is declared, and every class codegen emits from your ${A.map(o=>`${o}.ts`).join(" / ")} declarations`;return Y(e)?`\`@lunora/vite\` generates that entry — ${t}, and ${e} is not among them. Class-A composition does not carry ${e}, so drop the binding; a project that needs it has to own its worker entry (add \`src/worker.ts\`, which \`lunora deploy\` bundles in place of \`main\`, and compose \`defineApp()\` there).`:`\`@lunora/vite\` generates that entry, so there is no file to add a re-export to: ${t}. Declare "${e}" in one of those and re-run \`lunora codegen\`, or drop the binding.`},ye=(e,s)=>{const t=s.exports;if(t===void 0)return[];const o=[];for(const r of K(e.durable_objects?.bindings))typeof r.class_name=="string"&&r.class_name.length>0&&r.script_name===void 0&&o.push({className:r.class_name,label:"durable_objects.bindings"});for(const r of C(e.workflows))typeof r?.class_name=="string"&&r.class_name.length>0&&r.script_name===void 0&&o.push({className:r.class_name,label:"workflows"});for(const[r,i]of Object.entries(e.exports??{}))i?.type==="workflow"&&o.push({className:r,label:"workflows"});return o.filter(r=>!t.has(r.className)).map(r=>`${r.label} declares class "${r.className}" but the ${s.kind==="composed"?"composed class-A worker entry":"worker entry"} (${s.path}) ${be} — wrangler refuses to bundle a Worker whose ${r.label==="workflows"?"Workflow":"Durable Object"} classes are not exported. ${ve(r.className,s.kind)}`)},we=e=>e?.origin!=="absent"?[]:[`main is set but no readable file is there (looked in ${e.path}) — wrangler cannot resolve the worker entry, so a deploy will fail there. Point main at the entry that composes your app, or remove it to fall back to the conventional locations.`],$e=e=>{const s=e.schemaDir??"lunora",t=V(e.projectRoot);if(!t){const h=`wrangler.jsonc not found in ${e.projectRoot}; create one declaring at least the SHARD durable object binding.`;return{problems:[h],report:{errors:[h],valid:!1,warnings:[]},wranglerPath:void 0}}const{parsed:o}=q(t);if(o===void 0){const h=`failed to parse ${t} as JSONC.`;return{problems:[h],report:{errors:[h],valid:!1,warnings:[]},wranglerPath:t}}const{error:n,merged:r}=J(o,e.environment);if(n!==void 0)return{problems:[n],report:{errors:[n],valid:!1,warnings:[]},wranglerPath:t};const{error:i,info:a}=P(e.projectRoot,s),c=z(o,a,e.environment);i!==void 0&&c.warnings.push(`schema parse failed in ${s}/schema.ts: ${i}`);const d=y(t),m=Z(r.main,e.projectRoot,t),x=se(m,e.projectRoot,s);c.errors.push(...ge(r.containers??[],d,t)),c.warnings.push(...we(m)),x!==void 0&&c.errors.push(...ye(r,x)),c.errors.push(...Ee(a,e.projectRoot));const u=r.assets?.directory;if(typeof u=="string"&&u.length>0){const h=u.startsWith("/")?u:l(d,u);f(h)||c.warnings.push(`assets.directory "${u}" does not exist yet — it is created by the client build; run the build before deploy`)}return c.valid=c.errors.length===0,{problems:c.errors,report:c,wranglerPath:t}};export{be as UNEXPORTED_CLASS_MARKER,$e as validateWranglerProject};
1
+ import{existsSync as f,readFileSync as N,readdirSync as W}from"node:fs";import{join as l,dirname as y,extname as w,basename as _}from"node:path";import{discoverSchemaInfo as P}from"./discoverSchemaInfo-BguahM6z.mjs";import{COMPOSED_WORKER_ENTRY as L,LUNORA_WORKER_VIRTUAL_ID as g,isGeneratedOutput as F,WORKER_ENTRY_FALLBACKS as M,GENERATED_DIRECTORY as U,COMPOSED_ENTRY_DURABLE_OBJECTS as D,GENERATED_CLASS_MODULES as A,SOURCE_DOT_DIRECTORIES as B,NON_SOURCE_DIRECTORIES as G,isFrameworkDurableObject as Y}from"./COMPOSED_WORKER_ENTRY-C69wqbSP.mjs";import{o as K}from"./validate-bindings-TA4ZqC4j.mjs";import{Project as X,Node as p}from"ts-morph";import{mergeWranglerEnvironment as J}from"./mergeWranglerEnvironment-CTh4zkEL.mjs";import{findWranglerFile as V,readWranglerJsonc as q}from"./WRANGLER_FILES-UNW-xY5u.mjs";import{validateWranglerConfig as z}from"./REQUIRED_COMPATIBILITY_DATE-lONKS1B6.mjs";const E=[".ts",".tsx",".mts",".cts"],b=new Set(E),H=new Set([".cjs",".js",".mjs"]),v="default",S={".cjs":[".cts"],".js":[".ts",".tsx"],".mjs":[".mts"]},Q=250,Z=(e,s,t)=>{const o=l(s,L);if(f(o))return{origin:"declared",path:o};if(e===g)return{origin:"composed"};const n=()=>{const a=M.map(c=>l(s,c)).find(c=>f(c));return a===void 0?void 0:{origin:"probed",path:a}};if(typeof e!="string"||e.length===0||F(e))return n();const r=l(y(t),e),i=w(r);if(!(!b.has(i)&&!H.has(i)))return f(r)?{origin:"declared",path:r}:{origin:"absent",path:r}},T=(e,s)=>{if(p.isIdentifier(e)){s.add(e.getText());return}if(p.isObjectBindingPattern(e)||p.isArrayBindingPattern(e))for(const t of e.getElements())p.isBindingElement(t)&&T(t.getNameNode(),s)},ee=(e,s)=>{const t=[];for(const o of e.getExportDeclarations())if(!o.isTypeOnly()){if(o.isNamespaceExport()){const n=o.getNamespaceExport();n===void 0?t.push(o.getModuleSpecifierValue()??""):s.add(n.getName());continue}for(const n of o.getNamedExports())n.isTypeOnly()||s.add(n.getAliasNode()?.getText()??n.getName())}return t},te=(e,s)=>{for(const t of e.getVariableStatements().filter(o=>o.getExportKeyword()!==void 0))for(const o of t.getDeclarations())T(o.getNameNode(),s);for(const t of[...e.getClasses(),...e.getFunctions(),...e.getEnums()]){if(t.getExportKeyword()===void 0)continue;const o=t.isDefaultExport()?v:t.getName();o!==void 0&&s.add(o)}e.getExportAssignments().length>0&&s.add(v)},$=(e,s)=>{const t=new X({compilerOptions:{allowJs:!0},skipFileDependencyResolution:!0,skipLoadingLibFiles:!0,useInMemoryFileSystem:!0}),o=t.createSourceFile(e,s,{overwrite:!0});return t.getProgram().compilerObject.getSyntacticDiagnostics(o.compilerNode).length>0?void 0:o},re=(e,s)=>{if(!s.startsWith("./")&&!s.startsWith("../"))return;const t=l(y(e),s),o=w(t),n=b.has(o)||S[o]!==void 0,r=n?t.slice(0,-o.length):t;return[...b.has(o)?[t]:[],...(S[o]??[]).map(a=>`${r}${a}`),...n?[]:E.map(a=>`${t}${a}`),...n||o.length===0?E.map(a=>l(r,`index${a}`)):[]].find(a=>f(a))},k=e=>{const s=new Set,t=new Set([e]),o=[e];for(;o.length>0;){if(t.size-1>Q)return;const n=o.pop();let r;try{r=N(n,"utf8")}catch{return}const i=$(_(n),r);if(i===void 0)return;const a=ee(i,s);te(i,s);for(const c of a){const d=re(n,c);if(d===void 0)return;t.has(d)||(t.add(d),o.push(d))}}return s},oe=(e,s)=>{const t={exports:void 0,kind:"composed",path:g},o=l(e,s,U);if(!f(o))return t;const n=new Set(D);for(const r of A){const i=l(o,`${r}.ts`);if(!f(i))continue;const a=k(i);if(a===void 0)return t;for(const c of a)n.add(c)}return{exports:n,kind:"composed",path:g}},se=(e,s,t)=>{if(e===void 0||e.origin==="absent")return;if(e.origin==="composed")return oe(s,t);const o=k(e.path);if(!(e.origin==="probed"&&o!==void 0&&!o.has(v)))return{exports:o,kind:"authored",path:e.path}},ne=new Set([".cjs",".cts",".js",".jsx",".mjs",".mts",".ts",".tsx"]),ie=2e3,R="defineTable",O="defineApp",ae=e=>{const s=[],t=[];let o;try{o=W(e,{withFileTypes:!0})}catch{return{files:s,subdirectories:t}}for(const n of o)n.isDirectory()?n.name.startsWith(".")&&!B.has(n.name)||G.has(n.name)||t.push(l(e,n.name)):ne.has(w(n.name))&&s.push(l(e,n.name));return{files:s,subdirectories:t}},j=(e,s)=>{const t=new Set;for(const o of e.getImportDeclarations())for(const n of o.getNamedImports())!n.isTypeOnly()&&n.getName()===s&&t.add(n.getAliasNode()?.getText()??n.getName());return t},ce=(e,s)=>{let t=!1;return e.forEachDescendant((o,n)=>{if(!p.isCallExpression(o))return;const r=o.getExpression();p.isIdentifier(r)&&s.has(r.getText())&&(t=!0,n.stop())}),t},le=e=>{let s=e;for(;p.isCallExpression(s)||p.isPropertyAccessExpression(s);)s=s.getExpression();return s},de=(e,s)=>{const t=le(e);return p.isIdentifier(t)&&s.has(t.getText())},I={global:/\.\s*global\s*\(/u,hyperdriveGlobal:/\.\s*hyperdriveGlobal\s*\(/u,vectors:/\.\s*vectors\s*\(/u},pe=e=>Object.hasOwn(I,e),fe=(e,s)=>{const t=new Set,o=new Set([R,...j(e,R)]);return e.forEachDescendant(n=>{if(!p.isCallExpression(n))return;const r=n.getExpression();if(!p.isPropertyAccessExpression(r)||de(r,o))return;const i=r.getName();pe(i)&&s.has(i)&&t.add(i)}),t},he=(e,s)=>{let t;try{t=N(e,"utf8")}catch{return}const o=new Set([...s].filter(r=>I[r].test(t)));if(o.size===0&&!t.includes(O))return;const n=$(_(e),t);return n===void 0?{chained:o,composes:!1}:{chained:fe(n,o),composes:ce(n,j(n,O))}},ue=(e,s)=>{const t=[e],o=new Set;let n=0,r;const i=a=>{if(n+=1,n>ie)return!1;const c=he(a,s);for(const d of c?.chained??[])o.add(d);return c?.composes&&(r??=a),!0};for(;t.length>0;){const a=t.pop(),{files:c,subdirectories:d}=ae(a);t.push(...d);for(const m of c){if(!i(m))return;if(r!==void 0&&o.size===s.size)return{chained:o,site:r}}}return r===void 0?void 0:{chained:o,site:r}},C=e=>Array.isArray(e)?e:[],me=(e,s,t)=>Object.entries(e?.images??{}).flatMap(([o,n])=>{const r=n?.dockerfile;return typeof r!="string"||f(r.startsWith("/")?r:l(s,r))?[]:[`containers images["${o}"] dockerfile "${r}" does not exist (resolved relative to ${t}); create the Dockerfile`]}),ge=(e,s,t)=>{const o=[];for(const n of C(e)){const r=n?.image;typeof r=="string"&&(r.startsWith("./")||r.startsWith("../")||r.startsWith("/")||r.includes("Dockerfile"))&&!f(r.startsWith("/")?r:l(s,r))&&o.push(`containers image "${r}" does not exist (resolved relative to ${t}); create the Dockerfile or point image at a registry reference`),o.push(...me(n,s,t))}return o},Ee=(e,s)=>{const t=e?.vectorIndexNames??[],o=[];if(t.length>0&&o.push({message:r=>`schema declares vector index(es) ${t.map(i=>`"${i}"`).join(", ")} but nothing chains .vectors(...) onto defineApp() (composed in: ${r}) — \`ctx.vectors\` is then a throwing stub and buildWorkerOptions rejects EVERY request, /_lunora/health included. Add \`.vectors((env) => ({ ${String(t[0])}: env.<BINDING> }))\` to the chain.`,method:"vectors"}),e?.hasD1GlobalTable&&o.push({message:r=>`schema declares .global() table(s) but nothing chains .global(...) onto defineApp() (composed in: ${r}) — the shard then has no global writer, so every read or write of a global table throws INTERNAL ("requires a globalDb writer"). Add \`.global({ d1: (env) => env.DB })\` to the chain.`,method:"global"}),e?.hasHyperdriveGlobalTable&&o.push({message:r=>`schema declares .global({ backend: "hyperdrive" }) table(s) but nothing chains .hyperdriveGlobal(...) onto defineApp() (composed in: ${r}) — the shard then has no global writer, so every read or write of those tables throws INTERNAL. Add \`.hyperdriveGlobal({ engine: "postgres", exec: (env) => buildPgExec(fromPostgresJs(postgres(env.HYPERDRIVE.connectionString))) })\` to the chain (\`buildPgExec\` from \`@lunora/hyperdrive/global\`, \`fromPostgresJs\` from \`@lunora/hyperdrive\`).`,method:"hyperdriveGlobal"}),o.length===0)return[];const n=ue(s,new Set(o.map(r=>r.method)));return n===void 0?[]:o.filter(r=>!n.chained.has(r.method)).map(r=>r.message(n.site))},be="does not export it",ve=(e,s)=>{if(s!=="composed")return`Re-export it from the module that defines it (\`export { ${e} } from "./…";\`), or add it to the app builder's own export (\`export const { ${e} } = app;\`).`;const t=`it exports ${D.join(", ")}, SchedulerDO when its binding is declared, and every class codegen emits from your ${A.map(o=>`${o}.ts`).join(" / ")} declarations`;return Y(e)?`\`@lunora/vite\` generates that entry — ${t}, and ${e} is not among them. Class-A composition does not carry ${e}, so drop the binding; a project that needs it has to own its worker entry (add \`src/worker.ts\`, which \`lunora deploy\` bundles in place of \`main\`, and compose \`defineApp()\` there).`:`\`@lunora/vite\` generates that entry, so there is no file to add a re-export to: ${t}. Declare "${e}" in one of those and re-run \`lunora codegen\`, or drop the binding.`},ye=(e,s)=>{const t=s.exports;if(t===void 0)return[];const o=[];for(const r of K(e.durable_objects?.bindings))typeof r.class_name=="string"&&r.class_name.length>0&&r.script_name===void 0&&o.push({className:r.class_name,label:"durable_objects.bindings"});for(const r of C(e.workflows))typeof r?.class_name=="string"&&r.class_name.length>0&&r.script_name===void 0&&o.push({className:r.class_name,label:"workflows"});for(const[r,i]of Object.entries(e.exports??{}))i?.type==="workflow"&&o.push({className:r,label:"workflows"});return o.filter(r=>!t.has(r.className)).map(r=>`${r.label} declares class "${r.className}" but the ${s.kind==="composed"?"composed class-A worker entry":"worker entry"} (${s.path}) ${be} — wrangler refuses to bundle a Worker whose ${r.label==="workflows"?"Workflow":"Durable Object"} classes are not exported. ${ve(r.className,s.kind)}`)},we=e=>e?.origin!=="absent"?[]:[`main is set but no readable file is there (looked in ${e.path}) — wrangler cannot resolve the worker entry, so a deploy will fail there. Point main at the entry that composes your app, or remove it to fall back to the conventional locations.`],$e=e=>{const s=e.schemaDir??"lunora",t=V(e.projectRoot);if(!t){const h=`wrangler.jsonc not found in ${e.projectRoot}; create one declaring at least the SHARD durable object binding.`;return{problems:[h],report:{errors:[h],valid:!1,warnings:[]},wranglerPath:void 0}}const{parsed:o}=q(t);if(o===void 0){const h=`failed to parse ${t} as JSONC.`;return{problems:[h],report:{errors:[h],valid:!1,warnings:[]},wranglerPath:t}}const{error:n,merged:r}=J(o,e.environment);if(n!==void 0)return{problems:[n],report:{errors:[n],valid:!1,warnings:[]},wranglerPath:t};const{error:i,info:a}=P(e.projectRoot,s),c=z(o,a,e.environment);i!==void 0&&c.warnings.push(`schema parse failed in ${s}/schema.ts: ${i}`);const d=y(t),m=Z(r.main,e.projectRoot,t),x=se(m,e.projectRoot,s);c.errors.push(...ge(r.containers??[],d,t)),c.warnings.push(...we(m)),x!==void 0&&c.errors.push(...ye(r,x)),c.errors.push(...Ee(a,e.projectRoot));const u=r.assets?.directory;if(typeof u=="string"&&u.length>0){const h=u.startsWith("/")?u:l(d,u);f(h)||c.warnings.push(`assets.directory "${u}" does not exist yet — it is created by the client build; run the build before deploy`)}return c.valid=c.errors.length===0,{problems:c.errors,report:c,wranglerPath:t}};export{be as UNEXPORTED_CLASS_MARKER,$e as validateWranglerProject};
@@ -1,3 +1,3 @@
1
- import{LunoraError as n}from"@lunora/errors";import{lunoraLine as i}from"./LUNORA_TAG-CiQM3BkI.mjs";import{validateWranglerProject as l}from"./UNEXPORTED_CLASS_MARKER-CugcZbPf.mjs";const m=(e,a,t)=>{const r=l({projectRoot:e.projectRoot,schemaDir:e.schemaDir});if(!r.wranglerPath)throw new n("INTERNAL",["[lunora] wrangler.jsonc not found.",` searched in: ${e.projectRoot}`," create a wrangler.jsonc declaring at least the SHARD durable object binding."].join(`
1
+ import{LunoraError as n}from"@lunora/errors";import{lunoraLine as i}from"./LUNORA_TAG-CiQM3BkI.mjs";import{validateWranglerProject as l}from"./UNEXPORTED_CLASS_MARKER-D9ZP8mPA.mjs";const m=(e,a,t)=>{const r=l({projectRoot:e.projectRoot,schemaDir:e.schemaDir});if(!r.wranglerPath)throw new n("INTERNAL",["[lunora] wrangler.jsonc not found.",` searched in: ${e.projectRoot}`," create a wrangler.jsonc declaring at least the SHARD durable object binding."].join(`
2
2
  `));for(const o of r.report.warnings)a(i(`wrangler validator: ${o}`));if(r.problems.length>0)throw new n("INTERNAL",["[lunora] wrangler configuration is missing bindings required by your schema.",` file: ${r.wranglerPath}`,"",...r.problems.map(o=>` - ${o}`),"",` ${t}`].join(`
3
3
  `))};export{m as assertWranglerSatisfiesSchema};
@@ -0,0 +1,2 @@
1
+ import{readFileSync as F,writeFileSync as V}from"node:fs";import{createRequire as X}from"node:module";import{join as Q}from"node:path";import{containerBuildTag as z}from"@lunora/container";import{applyModify as x}from"./applyModify-DKP2l6S9.mjs";import{a as Z,r as L}from"./lunora-manifest-v90ZUbVp.mjs";import{parseTree as ee,findNodeAtLocation as ne}from"jsonc-parser";import{r as se,a as te,b as oe,c as ie}from"./reconcile-services-3dn35zgy.mjs";import{a as re,p as ae}from"./infer-bindings-B3rsAmY_.mjs";import{DEV_VARS_FILE as de,parseDevVariableEntries as ce}from"./DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";import{requiredSecrets as le}from"./buildPackageSecretsBlock-yv9mjKEW.mjs";import{w as ue,n as ge,s as Y,o as R,p as q,q as me}from"./validate-bindings-TA4ZqC4j.mjs";import{findWranglerFile as pe,readWranglerJsonc as fe}from"./WRANGLER_FILES-UNW-xY5u.mjs";const be=[["maxBatchSize","max_batch_size"],["maxBatchTimeout","max_batch_timeout"],["maxRetries","max_retries"],["deadLetterQueue","dead_letter_queue"],["retryDelay","retry_delay"]],B=e=>Object.fromEntries(be.filter(([n])=>e.tuning[n]!==void 0).map(([n,s])=>[s,e.tuning[n]])),P="queueTuning",he=/^[\t ]*(?:,[\t ]*)?(?:\/\/[^\n\r]*)?\r?\n/u,we=/^[\t ]*,/u,ve=(e,n)=>{const s=ee(e),t=s===void 0?void 0:ne(s,[...n])?.parent;if(t?.type==="property"){const i=t.offset+t.length,o=e.lastIndexOf(`
2
+ `,t.offset-1)+1,d=he.exec(e.slice(i));if(d!==null&&e.slice(o,t.offset).trim()===""){const a=t.parent?.children??[],b=a.indexOf(t),c=b===a.length-1&&b>0?a[b-1]:void 0,l=c===void 0?void 0:we.exec(e.slice(c.offset+c.length))??void 0;return(l===void 0||c===void 0?e.slice(0,o):e.slice(0,c.offset+c.length)+e.slice(c.offset+c.length+l[0].length,o))+e.slice(i+d[0].length)}}return x(e,n,void 0)},G=(e,n,s,t,i,o=new Set)=>{const d=s.join("."),a={},b=[],c=[];let l=e;return{entries:n.map((u,w)=>{const g=t(u);if(g===void 0||u.queue===void 0)return u;const p=Object.fromEntries(Object.entries(B(g)).filter(([f])=>!o.has(f))),h=Object.entries(i[u.queue]??{}).filter(([f])=>!Object.hasOwn(p,f)),v=Object.entries(p).filter(([f,y])=>u[f]!==y),S=h.filter(([f,y])=>u[f]===y).map(([f])=>f),k=Object.fromEntries(Object.entries({...u,...p}).filter(([f])=>!S.includes(f)));for(const[f,y]of v)l=x(l,[...s,w,f],y);for(const f of S)l=ve(l,[...s,w,f]);for(const[f,y]of h){const O=u[f];O!==void 0&&O!==y&&c.push(`${d}/${u.queue}: ${f} is no longer declared by defineQueue, but it was changed by hand to ${JSON.stringify(O)} from the declared ${JSON.stringify(y)}, so it was kept. Delete it from wrangler.jsonc if it should go.`)}return(v.length>0||S.length>0)&&b.push(`${d}/${u.queue} (${[...v.map(([f])=>f),...S.map(f=>`removed ${f}`)].join(", ")})`),Object.keys(p).length>0&&(a[u.queue]=p),k}),owned:a,text:l,updated:b,warnings:c}},_e=(e,n,s,t)=>{const i=n.queues??{},o=i.producers??[],d=i.consumers??[],a=new Set(o.map(g=>g.binding)),b=new Set(d.map(g=>g.queue)),c=s.filter(g=>!a.has(g.bindingName)),l=s.filter(g=>!b.has(g.name)),m=G(e,d,["queues","consumers"],g=>s.find(p=>p.name===g.queue),t);let u=m.text;const w={...m.owned};if(c.length>0||l.length>0){const g=[...o,...c.map(h=>({binding:h.bindingName,queue:h.name}))],p=[...m.entries,...l.map(h=>({queue:h.name,...h.mode==="pull"?{type:"http_pull"}:{},...B(h)}))];for(const h of l){const v=B(h);Object.keys(v).length>0&&(w[h.name]=v)}u=x(u,["queues"],{consumers:p,producers:g})}return{added:[...c.map(g=>`queues.producers/${g.bindingName}`),...l.map(g=>`queues.consumers/${g.name}`)],owned:w,text:u,updated:m.updated,warnings:m.warnings}},ye=(e,n,s,t,i)=>{const o=n.env?.[t],d=o?.queues?.consumers??[],a=o?.queues?.producers??[],b=u=>{const w=a.find(g=>g.queue===u.queue)?.binding;return w!==void 0?s.find(g=>g.bindingName===w):s.find(g=>g.name===u.queue&&!a.some(p=>p.binding===g.bindingName))},c=G(e,d,["env",t,"queues","consumers"],b,i,new Set(["dead_letter_queue"])),l=d.filter(u=>u.queue!==void 0&&b(u)===void 0).map(u=>`env.${t}.queues.consumers/${String(u.queue)}: no defineQueue export matches it — this block declares no producer mapping one of their bindings to "${String(u.queue)}", and no export is named that — so it was not retuned. A consumer for a queue another worker produces is skipped the same way.`),m=d.flatMap(u=>{const w=b(u)?.tuning.deadLetterQueue;return w===void 0||u.dead_letter_queue!==void 0?[]:[`env.${t}.queues.consumers/${String(u.queue)}: defineQueue declares deadLetterQueue "${w}", but this consumer has no dead_letter_queue, so its exhausted messages are dropped. Queue names differ per environment, so reconcile does not write it here; add it by hand.`]});return{added:[],owned:c.owned,text:c.text,updated:c.updated,warnings:[...c.warnings,...m,...l]}},xe=(e,n)=>{if(e?.lunoraIsForeign===!0)return n.push(`${e.path}: \`lunora\` is not an object, so the queue tuning ownership record cannot be read or written — an option removed from defineQueue stays deployed.`),{};const s=e?.lunora?.[P],t=i=>typeof i=="object"&&i!==null&&!Array.isArray(i);return s===void 0?{}:!t(s)||!Object.values(s).every(i=>t(i)&&Object.values(i).every(o=>t(o)))?(n.push(`${e?.path??"package.json"}: \`lunora.${P}\` is not a map of scope → queue → fields, so it is ignored — an option removed from defineQueue stays deployed until the next pass records it again.`),{}):s},Se=(e,n,s)=>{const t=Object.fromEntries(Object.entries({...n,...s}).filter(([,i])=>Object.keys(i).length>0));Z(e,P,Object.keys(t).length===0?void 0:t)},j="PIPELINES",C="ARTIFACTS",ke=(e,n)=>{const s=e.flagshipBinding!==void 0&&!(n?.flagship??[]).some(a=>a.binding===e.flagshipBinding),t=e.usesPipelines&&!(n?.pipelines??[]).some(a=>a.binding===j),i=e.usesArtifacts?n?.artifacts??[]:[],o=i.some(a=>a.binding===C)?[]:i.flatMap(a=>a.binding===void 0?[]:[a.binding]);return[[e.usesKv&&(n?.kv_namespaces?.length??0)===0,"@lunora/bindings/kv is used but no kv_namespaces binding exists; add a kv_namespaces entry ({ binding, id }) and pass env.<BINDING> to createKv() — the namespace id can't be auto-provisioned."],[e.usesHyperdrive&&(n?.hyperdrive?.length??0)===0,"@lunora/hyperdrive is used but no hyperdrive binding exists; run 'wrangler hyperdrive create' and add a 'hyperdrive' binding ({ binding, id }) — the id can't be auto-provisioned."],[t,`ctx.pipelines is used but no "${j}" pipelines binding exists; run 'wrangler pipelines create <name>' and add a 'pipelines' binding ({ binding: "${j}", stream }) — codegen resolves this one name, and the pipeline resource can't be auto-provisioned.`],[e.usesArtifacts&&i.length===0,re(e.jurisdiction)],[o.length>0,`ctx.artifacts is used and ${o.map(a=>`"${a}"`).join(", ")} ${o.length===1?"is":"are"} bound, but none is named "${C}"; make sure \`.artifacts()\` on defineApp points ctx.artifacts at it — otherwise it reads env.${C} and throws.`],[s,`lunora/flags.ts uses Flagship in binding mode but no flagship binding "${e.flagshipBinding??""}" exists; add a flagship entry ({ binding: "${e.flagshipBinding??""}", app_id }) — the app_id can't be auto-provisioned.`]].filter(([a])=>a).map(([,a])=>a)},Ne=e=>[[e.usesX402Charge,"@lunora/x402/charge is used; set the recipient wallet address as a [vars] entry (the var name is your choice) and pass it to the charge config — the x402 facilitator settles USDC to that address."],[e.usesX402Pay,"@lunora/x402/pay is used (ActionCtx-only, spends real funds); add a secrets_store_secrets[] binding holding the agent wallet key (binding name == signer.secretName) and pair the pay rail with a spend policy — ctx.secrets reads a Secrets Store binding, not .dev.vars."]].filter(([s])=>s).map(([,s])=>s),D=(e,n,s)=>s.filter(t=>!t.exported).map(t=>`${e} "${t.exportName}" is declared but ${t.className} is not exported by the worker entry; add \`export * from "./lunora/_generated/${n}"\` so its binding can be provisioned.`),Oe=(e,n)=>{const s=new Set([...e.workflows,...e.agents].map(o=>o.className));if(s.size===0)return[];const t=Object.entries(n.exports??{}).flatMap(([o,d])=>d?.type==="workflow"?[o]:[]),i=(n.workflows??[]).flatMap(o=>o.class_name===void 0||o.script_name!==void 0?[]:[o.class_name]);return[...new Set([...t,...i])].filter(o=>!s.has(o)).map(o=>`wrangler.jsonc declares workflow "${o}" but no defineWorkflow/defineAgent export generates that class — a leftover from a rename will fail the deploy (wrangler rejects a class the worker does not export). Remove it if it is not hand-wired.`)},Ee=(e,n)=>{if(e.queues.length===0)return[];const s=new Set(e.queues.map(i=>i.name)),t=new Set(e.queues.map(i=>i.bindingName));return[...(n.queues?.consumers??[]).flatMap(i=>{const{queue:o}=i;return o===void 0||s.has(o)?[]:[`wrangler.jsonc subscribes queues.consumers[] to "${o}" but no defineQueue export declares that queue — a leftover from a rename keeps delivering batches this worker has no handler for (they retry to exhaustion, then drop or dead-letter). Remove it if it is not hand-wired.`]}),...(n.queues?.producers??[]).flatMap(i=>{const{binding:o}=i;return o===void 0||t.has(o)?[]:[`wrangler.jsonc declares queues.producers[] binding "${o}" but no defineQueue export declares it — a leftover from a rename. Remove it if it is not hand-wired.`]})]},$e=(e,n)=>[...Oe(e,n),...Ee(e,n)],H=[{keys:["STRIPE_SECRET_KEY","STRIPE_WEBHOOK_SECRET"],label:"Stripe"},{keys:["POLAR_ACCESS_TOKEN","POLAR_WEBHOOK_SECRET"],label:"Polar"},{keys:["CREEM_API_KEY","CREEM_WEBHOOK_SECRET"],label:"Creem"},{keys:["AUTUMN_SECRET_KEY","AUTUMN_WEBHOOK_SECRET"],label:"Autumn"},{keys:["DODO_PAYMENTS_API_KEY","DODO_PAYMENTS_WEBHOOK_KEY"],label:"Dodo Payments"}],Ae=()=>H.map(({keys:e,label:n})=>`${e[0]} + ${e[1]} (${n})`).join(" or "),qe=e=>{let n;try{n=F(Q(e,de),"utf8")}catch{return!1}const s=new Map(ce(n).map(t=>[t.key,t.value]));return H.some(({keys:t})=>t.every(i=>(s.get(i)??"")!==""))},je=(e,n)=>{const s=n?.secrets?.required;if(!Array.isArray(s))return[];const t=new Set(s),i=le(ae(e)).map(o=>o.key).filter(o=>!t.has(o));return i.length===0?[]:[`wrangler.jsonc declares secrets.required without ${i.join(", ")}, which this app needs — wrangler dev loads only the listed keys from .dev.vars, so add ${i.length===1?"it":"them"} to secrets.required.`]},I=(e,n,s)=>{const t=new Set(e.durableObjects.map(a=>a.className)),i=[],o=(s?.r2_buckets?.length??0)>0,d=(s?.d1_databases?.some(a=>a.binding==="DB")??!1)||e.needsD1;return e.usesStorage&&!o&&i.push("@lunora/storage is used but R2 bucket bindings have user-defined names; add an r2_buckets entry and pass env.<BINDING> to createStorage()."),e.usesAuth&&!t.has("SessionDO")&&!d&&i.push("@lunora/auth is used but the worker entry exports no SessionDO; sessions are D1-backed, or export SessionDO to enable DO-backed sessions."),e.usesScheduler&&!t.has("SchedulerDO")&&i.push("@lunora/scheduler is used but the worker entry exports no SchedulerDO; export it so the SCHEDULER binding can be provisioned."),i.push(...D("container","containers",e.containers),...D("workflow","workflows",e.workflows),...D("agent","agents",e.agents)),e.containers.length>0&&s?.observability?.enabled===!1&&i.push("containers are declared but observability is explicitly disabled in wrangler.jsonc — container logs will not be captured."),e.usesPayment&&!qe(n)&&i.push(`@lunora/payment is used; set one provider's secret pair in .dev.vars — ${Ae()}.`),i.push(...Ne(e),...ke(e,s),...je(e,s)),s!==void 0&&i.push(...$e(e,s)),i},U="<replace-with-d1-create-id>",Ce=e=>[["container","containers",e.containers],["workflow","workflows",e.workflows],["agent","agents",e.agents]].flatMap(([s,t,i])=>i.filter(o=>!o.exported).map(({className:o,exportName:d})=>({className:o,exportName:d,kind:s,module:t}))),De=e=>{const n=new Set(R(e).map(t=>t.tag));let s=1;for(;n.has(`v${String(s)}`);)s+=1;return`v${String(s)}`},Ie=e=>{const n=new Set;for(const s of R(e)){for(const t of q(s.deleted_classes))n.delete(t);for(const{from:t,to:i}of R(s.renamed_classes))t!==void 0&&n.delete(t),i!==void 0&&n.add(i);for(const t of[...q(s.new_classes),...q(s.new_sqlite_classes)])n.add(t)}return n},Te=(e,n,s)=>{const t=n.durable_objects?.bindings??[],i=new Set(t.map(l=>l.name)),o=s.filter(l=>!i.has(l.binding));let d=e;const a=[];if(o.length>0){const l=[...t,...o.map(m=>({class_name:m.className,name:m.binding}))];d=x(d,["durable_objects","bindings"],l),a.push(...o.map(m=>`${m.binding}/${m.className}`))}const b=n.migrations??[],c=s.map(l=>l.className).filter(l=>!Ie(b).has(l));if(c.length>0){const l=[...b,{new_sqlite_classes:c,tag:De(b)}];d=x(d,["migrations"],l)}return{added:a,text:d}},Re=(e,n)=>{const s=n.d1_databases??[];if(s.some(o=>o.binding==="DB"))return{added:[],text:e};const t=typeof n.name=="string"&&n.name.length>0?n.name:"lunora",i=[...s,{binding:"DB",database_id:U,database_name:t}];return{added:["DB (D1)"],text:x(e,["d1_databases"],i)}},T=(e,n,s,t,i)=>{const o=n[s]?.binding;return typeof o=="string"&&o.length>0?{added:[],text:e}:{added:[i],text:x(e,[s],{binding:t})}},Be=new Set(["ratelimits","send_email"]),Pe=["durable_objects","logfwdr","unsafe"],Me=new Set(["data_blobs","text_blobs","vars","wasm_modules"]),W=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),M=(e,n,s)=>W(e)&&e[n]===s,We=(e,n,s)=>{if(Me.has(e))return W(n)&&Object.hasOwn(n,s);const t=Be.has(e)?"name":"binding";return Array.isArray(n)?n.some(i=>M(i,t,s)):M(n,"binding",s)},Le=(e,n)=>{const s=e,t=Object.entries(s).find(([o,d])=>o!=="env"&&We(o,d,n));if(t!==void 0)return t[0];for(const o of Pe){const d=s[o];if(W(d)&&Array.isArray(d.bindings)&&d.bindings.some(a=>M(a,"name",n)))return`${o}.bindings`}if(e.queues?.producers?.some(o=>o.binding===n)===!0)return"queues.producers";const i=e.secrets?.required;if(Array.isArray(i)&&i.includes(n))return"secrets.required"},K=(e,n,s,t,i)=>{if((n[s]?.length??0)>0)return{added:[],text:e};const o=Le(n,t.binding);return o!==void 0?{added:[],text:e,warnings:[`${s}: not adding ${JSON.stringify(t)} — the name "${t.binding}" is already bound by \`${o}\` in wrangler.jsonc. Add a ${s} entry under another binding name and point the matching \`defineApp()\` override at it.`]}:{added:[i],text:x(e,[s],[t])}},Ke=(e,n)=>{const s=n.worker_loaders??[];return s.some(t=>t.binding==="LOADER")?{added:[],text:e}:{added:["LOADER (Worker Loader)"],text:x(e,["worker_loaders"],[...s,{binding:"LOADER"}])}},Fe=e=>{if(typeof e=="string")return e;const n={};return e.diskMb!==void 0&&(n.disk_mb=e.diskMb),e.memoryMib!==void 0&&(n.memory_mib=e.memoryMib),e.vcpu!==void 0&&(n.vcpu=e.vcpu),n},Qe=e=>{const{image:n}=e;return n.kind==="dockerfile"?n.dockerfilePath:n.kind==="registry"?n.reference:z(e.exportName)},J=e=>{const n={};for(const[s,t]of Object.entries(e.images??{}))n[s]=t.kind==="registry"?{image:t.reference}:{build_context:t.buildContext,dockerfile:t.dockerfilePath,...e.buildArgs===void 0?{}:{build_vars:e.buildArgs}};return{class_name:e.className,scheduling_policy:"durable_object",...Object.keys(n).length>0?{images:n}:{},...e.name===void 0?{}:{name:e.name}}},Ye=e=>{if(e.schedulingPolicy==="durable_object")return J(e);const{image:n}=e,s={class_name:e.className,image:Qe(e)};return n.kind==="dockerfile"&&(s.image_build_context=n.buildContext),e.buildArgs!==void 0&&n.kind!=="registry"&&(s.image_vars=e.buildArgs),e.instanceType!==void 0&&(s.instance_type=Fe(e.instanceType)),e.maxInstances!==void 0&&(s.max_instances=e.maxInstances),e.name!==void 0&&(s.name=e.name),e.rollout?.stepPercentage!==void 0&&(s.rollout_step_percentage=e.rollout.stepPercentage),e.rollout?.gracePeriodSeconds!==void 0&&(s.rollout_active_grace_period=e.rollout.gracePeriodSeconds),s},Ge=(e,n,s)=>{const t=n.containers??[],i=new Set(t.map(c=>c.class_name)),o=s.filter(c=>!i.has(c.className));let d=o.length===0?e:x(e,["containers"],[...t,...o.map(c=>Ye(c))]);const a=[],b=[];for(const[c,l]of t.entries()){const m=s.find(g=>g.className===l.class_name);if(m===void 0)continue;const u=m.schedulingPolicy??"default";if((l.scheduling_policy??"default")!==u){b.push(`containers/${m.className} has scheduling_policy "${l.scheduling_policy??"default"}" in wrangler.jsonc but defineContainer "${m.exportName}" declares "${u}" — the policy is immutable, so replace the entry (and its container application) by hand.`);continue}const w=m.schedulingPolicy==="durable_object"?J(m).images:void 0;w!==void 0&&JSON.stringify(l.images)!==JSON.stringify(w)&&(d=x(d,["containers",c,"images"],w),a.push(`containers/${m.className}.images`))}return{added:o.map(c=>`containers/${c.className}`),text:d,updated:a,warnings:b}},He=(e,n)=>{if(n.observability!==void 0)return{added:[],text:e};const s=x(e,["observability"],{enabled:!0,head_sampling_rate:1});return{added:["observability"],text:s}},Ue=[{minimum:[4,142],name:"wrangler"},{minimum:[1,61],name:"@cloudflare/vite-plugin"}],Je=(e,n)=>{try{const s=X(Q(e,"package.json")).resolve(`${n}/package.json`),[t=0,i=0]=String(JSON.parse(F(s,"utf8")).version).split(".").map(Number);return[t,i]}catch{return}},Ve=e=>{const n=Ue.flatMap(({minimum:s,name:t})=>{const i=Je(e,t);return i!==void 0&&(i[0]<s[0]||i[0]===s[0]&&i[1]<s[1])?[`${t} ${i.join(".")} (needs >= ${s.join(".")})`]:[]});return n.length===0?void 0:`workflows are declared in wrangler \`exports\`, which ${n.join(" and ")} cannot run — reconcile left workflows[] untouched. Upgrade (\`pnpm add -D wrangler@^4.143.1 @cloudflare/vite-plugin@^1.62.1\`) and re-run.`},Xe=e=>Object.entries(e.env??{}).flatMap(([n,s])=>Array.isArray(s?.workflows)?[`env.${n}.workflows declares workflow bindings, but Lunora now declares workflows in \`exports\` and resolves them on ctx.exports — move them to that environment's own \`exports\` by hand.`]:[]),ze=(e,n,s)=>{let t=e;const i=[],o=[];for(const d of s){const a=n[d.className];if(a?.type==="workflow")for(const{of:b,path:c}of me){const l=b(d),m=Y(a,c),u=`exports/${d.className}.${c.join(".")}`;if(l===void 0){m!==void 0&&o.push(`${u} is set in wrangler.jsonc but defineWorkflow "${d.exportName}" does not declare it — reconcile leaves it in place. Remove it by hand if it was dropped from the definition.`);continue}JSON.stringify(m)!==JSON.stringify(l)&&(t=x(t,["exports",d.className,...c],l),i.push(u))}}return{text:t,updated:i,warnings:o}},Ze=(e,n,s,t,i)=>{if(i!==void 0)return{added:[],text:e,warnings:[i]};const o=[...s.map(p=>({settings:ue(p),workflow:p})),...t.map(p=>({settings:{},workflow:p}))],d=new Set(o.map(({workflow:p})=>p.className)),a=n.workflows??[],b=a.filter(p=>p.script_name===void 0&&p.class_name!==void 0&&d.has(p.class_name)),c=n.exports??{},l=[],m=[],u=[];let w=e;for(const{settings:p,workflow:h}of o){if(c[h.className]!==void 0&&c[h.className]!==null)continue;const v=b.find(f=>f.class_name===h.className),S=Object.fromEntries(ge.flatMap(f=>{const y=Y(v,[f]);return y===void 0?[]:[[f,y]]})),k=v?.name??h.name;v?.name!==void 0&&v.name!==h.name&&u.push(`workflows/${h.className} is deployed as "${v.name}" but declared as "${h.name}" — its export keeps "${v.name}" so running instances survive. Change the declaration to match, or rename deliberately (it starts a new, empty workflow).`),w=x(w,["exports",h.className],{type:"workflow",...S,...p,name:k}),(v===void 0?l:m).push(`exports/${h.className}`)}if(b.length>0){const p=a.filter(h=>!b.includes(h));w=x(w,["workflows"],p.length===0?void 0:p),m.push(...b.map(h=>`workflows/${String(h.class_name)} → exports`))}u.push(...Xe(n));const g=ze(w,c,s);return{added:l,text:g.text,updated:[...m,...g.updated],warnings:[...u,...g.warnings]}},pn=(e,n,s)=>{const t=pe(e),i=Ce(n);if(!t)return{added:[],changed:!1,exportGaps:i,reason:"wrangler.jsonc not found",updated:[],warnings:I(n,e)};const{parsed:o,text:d}=fe(t);if(o===void 0)return{added:[],changed:!1,exportGaps:i,reason:`failed to parse ${t} as JSONC`,updated:[],warnings:I(n,e),wranglerPath:t};const a=I(n,e,o);if(s!==void 0){const r=o.env?.[s]!==void 0;a.push(r?`auto-provisioned bindings are written to the top level of wrangler.jsonc only (queue consumers "env.${s}" already declares are retuned, nothing is added) — "env.${s}" has its own (non-inheritable) bindings and must be reconciled by hand; \`lunora deploy --env ${s}\` now validates them, so a gap here will be reported at deploy time.`:`--env "${s}" was requested but wrangler.jsonc declares no "env.${s}" block — auto-provisioned bindings are written to the top level only and will not apply to that environment.`)}const b=n.containers.filter(r=>r.exported),c=n.agents.filter(r=>r.exported&&r.voice===!0&&r.voiceBindingName!==void 0&&r.voiceClassName!==void 0),l=[...n.durableObjects,...b.map(r=>({binding:r.bindingName,className:r.className})),...c.map(r=>({binding:r.voiceBindingName,className:r.voiceClassName}))],m=n.workflows.filter(r=>r.exported),u=n.agents.filter(r=>r.exported),w=L(e),g=xe(w,a),p={},h=se(w);let v;const S=[{enabled:!0,run:r=>Te(r,o,l)},{enabled:n.needsD1,run:r=>Re(r,o)},{enabled:n.usesAi,run:r=>T(r,o,"ai","AI","AI (Workers AI)")},{enabled:n.usesAiSearch,run:r=>K(r,o,"ai_search_namespaces",{binding:"AI_SEARCH",namespace:"default"},"AI_SEARCH (AI Search namespace)")},{enabled:n.usesBrowser,run:r=>T(r,o,"browser","BROWSER","BROWSER (Browser Rendering)")},{enabled:n.usesImages,run:r=>T(r,o,"images","IMAGES","IMAGES (Cloudflare Images)")},{enabled:n.usesAnalytics,run:r=>K(r,o,"analytics_engine_datasets",{binding:"ANALYTICS",dataset:"ANALYTICS"},"ANALYTICS (Analytics Engine)")},{enabled:n.usesWorkerLoader,run:r=>Ke(r,o)},{enabled:!0,run:r=>He(r,o)},{enabled:b.length>0,run:r=>Ge(r,o,b)},{enabled:m.length>0||u.length>0,run:r=>Ze(r,o,m,u,Ve(e))},{enabled:n.queues.length>0,run:r=>{const _=_e(r,o,n.queues,g.queues??{});return p.queues=_.owned,_}},{enabled:n.services!==void 0&&(n.services.length>0||Object.keys(h).length>0),run:r=>{const _=te(r,o,n.services??[],h);return v=_.owned,_}},...s===void 0||o.env?.[s]===void 0?[]:[{enabled:n.queues.length>0,run:r=>{const _=`env.${s}.queues`,E=ye(r,o,n.queues,s,g[_]??{});return p[_]=E.owned,E}}]];let k=d;const f=[],y=[];for(const r of S){if(!r.enabled)continue;const _=r.run(k);k=_.text,f.push(..._.added),y.push(..._.updated??[]),a.push(..._.warnings??[])}const O=r=>{if(w===void 0)return;const _=v,E=[...Object.keys(p).length>0?[{consequence:"an option removed from defineQueue stays deployed",key:"queueTuning",label:"queue tuning",write:N=>{Se(N,g,p)}}]:[],..._===void 0?[]:[{consequence:"a service removed from lunora.config stays bound",key:"services",label:"service bindings",write:N=>{ie(N,_)}}]];for(const N of E)try{N.write(L(e)??w)}catch(A){a.push(`${r?"wrangler.jsonc was updated, but ":""}recording the ${N.label} reconcile owns in ${w.path} (lunora.${N.key}) failed: ${A instanceof Error?A.message:String(A)}. Until it is recorded, ${N.consequence}.`)}};let $;if(n.services!==void 0){const r=oe(e,n.services,h);a.push(...r.warnings),v={...v,...r.owned},$=r.added.length>0||r.updated.length>0?{added:r.added,path:r.path,updated:r.updated}:void 0}return f.includes("DB (D1)")&&a.push(`wrote a DB binding with a placeholder database_id ("${U}") — run \`wrangler d1 create <name>\` and replace it before deploying.`),k===d?(O(!1),{added:f,changed:!1,devConfig:$,exportGaps:i,reason:"bindings already in sync",updated:y,warnings:a,wranglerPath:t}):(V(t,k,"utf8"),O(!0),{added:f,changed:!0,devConfig:$,exportGaps:i,updated:y,warnings:a,wranglerPath:t})};export{Ce as collectExportGaps,pn as reconcileWranglerBindings};
@@ -0,0 +1 @@
1
+ import{existsSync as m}from"node:fs";import{discoverSchema as c,isHyperdriveGlobalTable as l,isD1GlobalTable as d}from"@lunora/codegen";import{Project as f}from"ts-morph";import{join as b}from"node:path";const j=(s,i)=>{const t=b(s,i,"schema.ts");if(!m(t))return{info:void 0};try{const o=new f({skipAddingFilesFromTsConfig:!0,useInMemoryFileSystem:!1}),r=c(o,t,s),n=e=>r.tables.find(a=>a.name===e)?.shape??{};return{info:{hasD1GlobalTable:r.tables.some(e=>d(e)),hasHyperdriveGlobalTable:r.tables.some(e=>l(e)),...r.jurisdiction===void 0?{}:{jurisdiction:r.jurisdiction},vectorIndexNames:r.vectorIndexes.map(e=>e.name),vectorMetadata:r.vectorIndexes.flatMap(e=>(e.metadata??[]).map(a=>({index:e.name,kind:n(e.table)[a]?.kind,property:a})))}}}catch(o){return{error:o instanceof Error?o.message:String(o),info:void 0}}};export{j as discoverSchemaInfo};