@lunora/config 1.0.0-alpha.335 → 1.0.0-alpha.336

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.
@@ -321,6 +321,25 @@ declare const CLOUDFLARE_DRIVER: DeployDriver;
321
321
  * without it, and `lunora doctor` checks for it wherever that transport is imported.
322
322
  */
323
323
  declare const GLOBAL_FETCH_STRICTLY_PUBLIC_FLAG = "global_fetch_strictly_public";
324
+ /** Inputs, injectable so tests never read the real home directory or env. */
325
+ interface CloudflareCredentialProbe {
326
+ env?: Record<string, string | undefined>;
327
+ home?: string;
328
+ /** Project whose `.env` files are read; omit to skip them. */
329
+ projectRoot?: string;
330
+ }
331
+ declare const hasCloudflareCredentials: (probe?: CloudflareCredentialProbe) => boolean;
332
+ /** Which kind of temp config a file is, in its name. */
333
+ type DevConfigKind = "dev" | "service";
334
+ /**
335
+ * The binding name to withhold from a logged-out dev session, or `undefined` to keep
336
+ * it. The credential probe runs only when an `ai` binding is declared at all.
337
+ */
338
+ declare const withheldWorkersAi: (ai: {
339
+ binding?: string;
340
+ } | null | undefined, hasCredentials: () => boolean) => string | undefined;
341
+ /** The one dev warning for a withheld Workers AI binding, shared by `lunora dev` and `@lunora/vite`. */
342
+ declare const describeWithheldWorkersAi: (binding: string) => string;
324
343
  /**
325
344
  * A container/workflow that is declared (so codegen emits its class) but the
326
345
  * worker entry never re-exports — the one wiring step the generators can't always
@@ -655,48 +674,37 @@ declare const planRemoteBindings: (parsed: RemoteWranglerShape) => RemoteBinding
655
674
  * `queues.producers[i]` entry, or the single `ai` object as the plan demands.
656
675
  */
657
676
  declare const injectRemoteFlags: (text: string, plans: ReadonlyArray<RemoteBindingPlan>) => string;
658
- interface MaterializeOptions {
659
- /** When `false`, the call is a no-op (returns `enabled: false`). */
660
- enabled: boolean;
677
+ interface MaterializeDevOptions {
678
+ /** Whether wrangler can authenticate; defaults to a probe of `projectRoot`. */
679
+ hasCredentials?: () => boolean;
661
680
  projectRoot: string;
681
+ /** Proxy the eligible bindings to the deployed resources (`--remote` / `LUNORA_REMOTE`). Off, only the logged-out `ai` withholding applies. */
682
+ remote: boolean;
662
683
  }
663
- interface MaterializeResult {
664
- /**
665
- * Removes the generated temp config file. Always present and always safe to
666
- * call: it is idempotent, a no-op when nothing was written (disabled /
667
- * fall-through cases), and never throws if the path is already gone. The dev
668
- * command calls this on every exit path (normal, signal, error).
669
- */
684
+ interface MaterializeDevResult {
685
+ /** Removes the temp config. Always safe to call: idempotent, and a no-op when nothing was written. */
670
686
  cleanup: () => void;
671
- /**
672
- * Absolute path to the generated temp config to pass to
673
- * `wrangler dev --config`. `undefined` when remote mode is disabled, no
674
- * wrangler config was found, it failed to parse, or it declared no eligible
675
- * binding (nothing to remote — run plain local dev).
676
- */
687
+ /** The temp config to pass to `wrangler dev --config`, or `undefined` to run the user's file unchanged. */
677
688
  configPath?: string;
678
- /** Whether remote mode was requested at all. */
679
- enabled: boolean;
680
- /** Why no temp config was produced, for logging (only set when none was). */
689
+ /** Why remote mode produced no temp config, for the dev log. Only set when nothing was written. */
681
690
  reason?: string;
682
691
  /** The bindings flipped to remote, for the dev banner. */
683
692
  remoteBindings: RemoteBindingPlan[];
693
+ /** The `ai` binding name left out for lack of Cloudflare credentials, for the dev warning. */
694
+ withheld: string[];
684
695
  }
685
696
  /**
686
- * Produce a temporary wrangler config with `"remote": true` on every eligible
687
- * binding, so `lunora dev` can run `wrangler dev --config <temp>` against the
688
- * deployed D1/KV/R2 without touching the user's file.
697
+ * Write the temp wrangler config a dev session runs with: the user's file with any
698
+ * eligible bindings flipped to `"remote": true` (when `remote` is set), and the
699
+ * `ai` binding removed when the session has no Cloudflare login. See `dev-config.ts`
700
+ * for why the `ai` removal exists.
689
701
  *
690
- * The temp file is written as a sibling of the source `wrangler.jsonc` (in the
691
- * project root), NOT an OS temp dir: wrangler resolves a config's relative paths
692
- * (`main`, `assets`, `migrations_dir`, …) against the **config file's own
693
- * directory**, so a temp config in `/tmp` would make wrangler look for
694
- * `/tmp/src/server.ts` and fail to start the worker. Keeping it beside the real
695
- * config preserves those relative paths. Returns `configPath: undefined` (with a
696
- * `reason`) for every fall-through case so the caller degrades to plain local
697
- * dev instead of failing.
702
+ * The temp file sits beside the source `wrangler.jsonc`, not in an OS temp dir,
703
+ * because wrangler resolves a config's relative `main`/`assets`/`migrations_dir`
704
+ * paths against the config file's own directory. Returns no `configPath` when there
705
+ * is nothing to change, so the caller runs the user's file unchanged.
698
706
  */
699
- declare const materializeRemoteWranglerConfig: (options: MaterializeOptions) => MaterializeResult;
707
+ declare const materializeDevWranglerConfig: (options: MaterializeDevOptions) => MaterializeDevResult;
700
708
  /**
701
709
  * Parse a `LUNORA_REMOTE` env value into the on/off decision. Truthy when set to
702
710
  * `"1"` or `"true"` (case-insensitive); anything else — unset, `"0"`, `"false"`,
@@ -729,18 +737,25 @@ interface RemoteEnableInputs {
729
737
  * is still overridable per-run by `--remote` or `LUNORA_REMOTE=1`.
730
738
  */
731
739
  declare const resolveRemoteEnabled: (inputs: RemoteEnableInputs) => boolean;
732
- /** The configs to pass as `--config`, in input order, and a disposer for the copies written. */
740
+ /** The configs to pass as `--config`, in input order, and what was done to them. */
733
741
  interface ServiceDevConfigs {
734
742
  /** Unlinks every copy written. Idempotent, never throws — a no-op when none was. */
735
743
  cleanup: () => void;
736
744
  configPaths: string[];
745
+ /** The `ai` binding names left out of a service copy for lack of Cloudflare credentials, for the dev warning. */
746
+ withheld: string[];
747
+ }
748
+ interface ServiceMaterializeOptions {
749
+ /** Whether wrangler can authenticate; defaults to a probe of `projectRoot`. */
750
+ hasCredentials?: () => boolean;
751
+ /** The app's folder, where `wrangler dev` runs and whose `.env` files it reads. */
752
+ projectRoot: string;
737
753
  }
738
754
  /**
739
755
  * Resolve the `--config` path of each service the shared `wrangler dev` session
740
- * runs, writing a copy only for a service whose custom build would otherwise run
741
- * in the app's folder (see the module doc).
756
+ * runs, writing a copy only for a service that needs one (see the module doc).
742
757
  */
743
- declare const materializeServiceDevConfigs: (wranglerPaths: ReadonlyArray<string>) => ServiceDevConfigs;
758
+ declare const materializeServiceDevConfigs: (wranglerPaths: ReadonlyArray<string>, options: ServiceMaterializeOptions) => ServiceDevConfigs;
744
759
  /**
745
760
  * The Cloudflare toolchain ranges a scaffolded Lunora app declares — the one
746
761
  * source for `lunora init`'s overlay. The `templates/*` starters are fetched at
@@ -1218,7 +1233,7 @@ declare const validateWranglerConfig: (wranglerInput: WranglerConfig | undefined
1218
1233
  * `{ valid, errors, warnings }`.
1219
1234
  */
1220
1235
  declare const validateWrangler: typeof validateWranglerConfig;
1221
- export { type AlchemyTranslation, type AssertWranglerOptions, BINDING_MANIFEST_VERSION, type BindingManifest, type BindingRequirement, CLOUDFLARE_CLI_CONFIG_WARNING_ENV, CLOUDFLARE_DRIVER, CLOUDFLARE_TOOLCHAIN_VERSIONS, type CloudflareCliConfigFinding, DEFAULT_OBSERVABILITY, type ExportGap, GLOBAL_FETCH_STRICTLY_PUBLIC_FLAG, type ManifestConfigShape, type MaterializeOptions, type MaterializeResult, type ObservabilitySignalSampling, 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 WranglerCodegenInputs, type WranglerConfig, type WranglerConfigShape, type WranglerContainerEntry, type WranglerEnvironmentMerge, type WranglerObservability, type WranglerObservabilityLogs, type WranglerObservabilityTraces, type WranglerProjectValidationOptions, type WranglerProjectValidationResult, type WranglerValidationReport, type WranglerWorkflowEntry,
1236
+ export { type AlchemyTranslation, type AssertWranglerOptions, BINDING_MANIFEST_VERSION, type BindingManifest, type BindingRequirement, CLOUDFLARE_CLI_CONFIG_WARNING_ENV, CLOUDFLARE_DRIVER, CLOUDFLARE_TOOLCHAIN_VERSIONS, type CloudflareCliConfigFinding, type CloudflareCredentialProbe, DEFAULT_OBSERVABILITY, type DevConfigKind, type ExportGap, GLOBAL_FETCH_STRICTLY_PUBLIC_FLAG, type ManifestConfigShape, type MaterializeDevOptions, type MaterializeDevResult, type ObservabilitySignalSampling, 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 WranglerCodegenInputs, type WranglerConfig, type WranglerConfigShape, type WranglerContainerEntry, type WranglerEnvironmentMerge, type WranglerObservability, type WranglerObservabilityLogs, type WranglerObservabilityTraces, type WranglerProjectValidationOptions, type WranglerProjectValidationResult, type WranglerValidationReport, type WranglerWorkflowEntry,
1222
1237
  /**
1223
1238
  * `@lunora/config/cloudflare` — the wrangler layer.
1224
1239
  *
@@ -1234,4 +1249,4 @@ export { type AlchemyTranslation, type AssertWranglerOptions, BINDING_MANIFEST_V
1234
1249
  * Plan 114 §5.3 (D6): a package carrying real provider code isolates it behind a
1235
1250
  * subpath rather than relocating wholesale.
1236
1251
  */
1237
- applyModify, assertWranglerSatisfiesSchema, buildBindingManifest, collectExportGaps, describePreservedCrons, detectCloudflareCliConfig, findWranglerFile, injectRemoteFlags, isCacheEnabled, isRemoteEnvEnabled, materializeRemoteWranglerConfig, materializeServiceDevConfigs, mergeWranglerEnvironment, planRemoteBindings, readWranglerJsonc, reconcileBindingsSafely, reconcileWranglerBindings, reconcileWranglerCompatibilityDate, reconcileWranglerCrons, reconcileWranglerExtras, resolveObservabilitySampling, resolveRemoteEnabled, scanWranglerVariablesForSecrets, validateWrangler, validateWranglerConfig, validateWranglerProject, warnCloudflareCliConfigOnce, withTailConsumer, wranglerCodegenInputs, wranglerToAlchemy };
1252
+ applyModify, assertWranglerSatisfiesSchema, buildBindingManifest, collectExportGaps, describePreservedCrons, describeWithheldWorkersAi, detectCloudflareCliConfig, findWranglerFile, hasCloudflareCredentials, injectRemoteFlags, isCacheEnabled, isRemoteEnvEnabled, materializeDevWranglerConfig, materializeServiceDevConfigs, mergeWranglerEnvironment, planRemoteBindings, readWranglerJsonc, reconcileBindingsSafely, reconcileWranglerBindings, reconcileWranglerCompatibilityDate, reconcileWranglerCrons, reconcileWranglerExtras, resolveObservabilitySampling, resolveRemoteEnabled, scanWranglerVariablesForSecrets, validateWrangler, validateWranglerConfig, validateWranglerProject, warnCloudflareCliConfigOnce, withTailConsumer, withheldWorkersAi, wranglerCodegenInputs, wranglerToAlchemy };
@@ -321,6 +321,25 @@ declare const CLOUDFLARE_DRIVER: DeployDriver;
321
321
  * without it, and `lunora doctor` checks for it wherever that transport is imported.
322
322
  */
323
323
  declare const GLOBAL_FETCH_STRICTLY_PUBLIC_FLAG = "global_fetch_strictly_public";
324
+ /** Inputs, injectable so tests never read the real home directory or env. */
325
+ interface CloudflareCredentialProbe {
326
+ env?: Record<string, string | undefined>;
327
+ home?: string;
328
+ /** Project whose `.env` files are read; omit to skip them. */
329
+ projectRoot?: string;
330
+ }
331
+ declare const hasCloudflareCredentials: (probe?: CloudflareCredentialProbe) => boolean;
332
+ /** Which kind of temp config a file is, in its name. */
333
+ type DevConfigKind = "dev" | "service";
334
+ /**
335
+ * The binding name to withhold from a logged-out dev session, or `undefined` to keep
336
+ * it. The credential probe runs only when an `ai` binding is declared at all.
337
+ */
338
+ declare const withheldWorkersAi: (ai: {
339
+ binding?: string;
340
+ } | null | undefined, hasCredentials: () => boolean) => string | undefined;
341
+ /** The one dev warning for a withheld Workers AI binding, shared by `lunora dev` and `@lunora/vite`. */
342
+ declare const describeWithheldWorkersAi: (binding: string) => string;
324
343
  /**
325
344
  * A container/workflow that is declared (so codegen emits its class) but the
326
345
  * worker entry never re-exports — the one wiring step the generators can't always
@@ -655,48 +674,37 @@ declare const planRemoteBindings: (parsed: RemoteWranglerShape) => RemoteBinding
655
674
  * `queues.producers[i]` entry, or the single `ai` object as the plan demands.
656
675
  */
657
676
  declare const injectRemoteFlags: (text: string, plans: ReadonlyArray<RemoteBindingPlan>) => string;
658
- interface MaterializeOptions {
659
- /** When `false`, the call is a no-op (returns `enabled: false`). */
660
- enabled: boolean;
677
+ interface MaterializeDevOptions {
678
+ /** Whether wrangler can authenticate; defaults to a probe of `projectRoot`. */
679
+ hasCredentials?: () => boolean;
661
680
  projectRoot: string;
681
+ /** Proxy the eligible bindings to the deployed resources (`--remote` / `LUNORA_REMOTE`). Off, only the logged-out `ai` withholding applies. */
682
+ remote: boolean;
662
683
  }
663
- interface MaterializeResult {
664
- /**
665
- * Removes the generated temp config file. Always present and always safe to
666
- * call: it is idempotent, a no-op when nothing was written (disabled /
667
- * fall-through cases), and never throws if the path is already gone. The dev
668
- * command calls this on every exit path (normal, signal, error).
669
- */
684
+ interface MaterializeDevResult {
685
+ /** Removes the temp config. Always safe to call: idempotent, and a no-op when nothing was written. */
670
686
  cleanup: () => void;
671
- /**
672
- * Absolute path to the generated temp config to pass to
673
- * `wrangler dev --config`. `undefined` when remote mode is disabled, no
674
- * wrangler config was found, it failed to parse, or it declared no eligible
675
- * binding (nothing to remote — run plain local dev).
676
- */
687
+ /** The temp config to pass to `wrangler dev --config`, or `undefined` to run the user's file unchanged. */
677
688
  configPath?: string;
678
- /** Whether remote mode was requested at all. */
679
- enabled: boolean;
680
- /** Why no temp config was produced, for logging (only set when none was). */
689
+ /** Why remote mode produced no temp config, for the dev log. Only set when nothing was written. */
681
690
  reason?: string;
682
691
  /** The bindings flipped to remote, for the dev banner. */
683
692
  remoteBindings: RemoteBindingPlan[];
693
+ /** The `ai` binding name left out for lack of Cloudflare credentials, for the dev warning. */
694
+ withheld: string[];
684
695
  }
685
696
  /**
686
- * Produce a temporary wrangler config with `"remote": true` on every eligible
687
- * binding, so `lunora dev` can run `wrangler dev --config <temp>` against the
688
- * deployed D1/KV/R2 without touching the user's file.
697
+ * Write the temp wrangler config a dev session runs with: the user's file with any
698
+ * eligible bindings flipped to `"remote": true` (when `remote` is set), and the
699
+ * `ai` binding removed when the session has no Cloudflare login. See `dev-config.ts`
700
+ * for why the `ai` removal exists.
689
701
  *
690
- * The temp file is written as a sibling of the source `wrangler.jsonc` (in the
691
- * project root), NOT an OS temp dir: wrangler resolves a config's relative paths
692
- * (`main`, `assets`, `migrations_dir`, …) against the **config file's own
693
- * directory**, so a temp config in `/tmp` would make wrangler look for
694
- * `/tmp/src/server.ts` and fail to start the worker. Keeping it beside the real
695
- * config preserves those relative paths. Returns `configPath: undefined` (with a
696
- * `reason`) for every fall-through case so the caller degrades to plain local
697
- * dev instead of failing.
702
+ * The temp file sits beside the source `wrangler.jsonc`, not in an OS temp dir,
703
+ * because wrangler resolves a config's relative `main`/`assets`/`migrations_dir`
704
+ * paths against the config file's own directory. Returns no `configPath` when there
705
+ * is nothing to change, so the caller runs the user's file unchanged.
698
706
  */
699
- declare const materializeRemoteWranglerConfig: (options: MaterializeOptions) => MaterializeResult;
707
+ declare const materializeDevWranglerConfig: (options: MaterializeDevOptions) => MaterializeDevResult;
700
708
  /**
701
709
  * Parse a `LUNORA_REMOTE` env value into the on/off decision. Truthy when set to
702
710
  * `"1"` or `"true"` (case-insensitive); anything else — unset, `"0"`, `"false"`,
@@ -729,18 +737,25 @@ interface RemoteEnableInputs {
729
737
  * is still overridable per-run by `--remote` or `LUNORA_REMOTE=1`.
730
738
  */
731
739
  declare const resolveRemoteEnabled: (inputs: RemoteEnableInputs) => boolean;
732
- /** The configs to pass as `--config`, in input order, and a disposer for the copies written. */
740
+ /** The configs to pass as `--config`, in input order, and what was done to them. */
733
741
  interface ServiceDevConfigs {
734
742
  /** Unlinks every copy written. Idempotent, never throws — a no-op when none was. */
735
743
  cleanup: () => void;
736
744
  configPaths: string[];
745
+ /** The `ai` binding names left out of a service copy for lack of Cloudflare credentials, for the dev warning. */
746
+ withheld: string[];
747
+ }
748
+ interface ServiceMaterializeOptions {
749
+ /** Whether wrangler can authenticate; defaults to a probe of `projectRoot`. */
750
+ hasCredentials?: () => boolean;
751
+ /** The app's folder, where `wrangler dev` runs and whose `.env` files it reads. */
752
+ projectRoot: string;
737
753
  }
738
754
  /**
739
755
  * Resolve the `--config` path of each service the shared `wrangler dev` session
740
- * runs, writing a copy only for a service whose custom build would otherwise run
741
- * in the app's folder (see the module doc).
756
+ * runs, writing a copy only for a service that needs one (see the module doc).
742
757
  */
743
- declare const materializeServiceDevConfigs: (wranglerPaths: ReadonlyArray<string>) => ServiceDevConfigs;
758
+ declare const materializeServiceDevConfigs: (wranglerPaths: ReadonlyArray<string>, options: ServiceMaterializeOptions) => ServiceDevConfigs;
744
759
  /**
745
760
  * The Cloudflare toolchain ranges a scaffolded Lunora app declares — the one
746
761
  * source for `lunora init`'s overlay. The `templates/*` starters are fetched at
@@ -1218,7 +1233,7 @@ declare const validateWranglerConfig: (wranglerInput: WranglerConfig | undefined
1218
1233
  * `{ valid, errors, warnings }`.
1219
1234
  */
1220
1235
  declare const validateWrangler: typeof validateWranglerConfig;
1221
- export { type AlchemyTranslation, type AssertWranglerOptions, BINDING_MANIFEST_VERSION, type BindingManifest, type BindingRequirement, CLOUDFLARE_CLI_CONFIG_WARNING_ENV, CLOUDFLARE_DRIVER, CLOUDFLARE_TOOLCHAIN_VERSIONS, type CloudflareCliConfigFinding, DEFAULT_OBSERVABILITY, type ExportGap, GLOBAL_FETCH_STRICTLY_PUBLIC_FLAG, type ManifestConfigShape, type MaterializeOptions, type MaterializeResult, type ObservabilitySignalSampling, 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 WranglerCodegenInputs, type WranglerConfig, type WranglerConfigShape, type WranglerContainerEntry, type WranglerEnvironmentMerge, type WranglerObservability, type WranglerObservabilityLogs, type WranglerObservabilityTraces, type WranglerProjectValidationOptions, type WranglerProjectValidationResult, type WranglerValidationReport, type WranglerWorkflowEntry,
1236
+ export { type AlchemyTranslation, type AssertWranglerOptions, BINDING_MANIFEST_VERSION, type BindingManifest, type BindingRequirement, CLOUDFLARE_CLI_CONFIG_WARNING_ENV, CLOUDFLARE_DRIVER, CLOUDFLARE_TOOLCHAIN_VERSIONS, type CloudflareCliConfigFinding, type CloudflareCredentialProbe, DEFAULT_OBSERVABILITY, type DevConfigKind, type ExportGap, GLOBAL_FETCH_STRICTLY_PUBLIC_FLAG, type ManifestConfigShape, type MaterializeDevOptions, type MaterializeDevResult, type ObservabilitySignalSampling, 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 WranglerCodegenInputs, type WranglerConfig, type WranglerConfigShape, type WranglerContainerEntry, type WranglerEnvironmentMerge, type WranglerObservability, type WranglerObservabilityLogs, type WranglerObservabilityTraces, type WranglerProjectValidationOptions, type WranglerProjectValidationResult, type WranglerValidationReport, type WranglerWorkflowEntry,
1222
1237
  /**
1223
1238
  * `@lunora/config/cloudflare` — the wrangler layer.
1224
1239
  *
@@ -1234,4 +1249,4 @@ export { type AlchemyTranslation, type AssertWranglerOptions, BINDING_MANIFEST_V
1234
1249
  * Plan 114 §5.3 (D6): a package carrying real provider code isolates it behind a
1235
1250
  * subpath rather than relocating wholesale.
1236
1251
  */
1237
- applyModify, assertWranglerSatisfiesSchema, buildBindingManifest, collectExportGaps, describePreservedCrons, detectCloudflareCliConfig, findWranglerFile, injectRemoteFlags, isCacheEnabled, isRemoteEnvEnabled, materializeRemoteWranglerConfig, materializeServiceDevConfigs, mergeWranglerEnvironment, planRemoteBindings, readWranglerJsonc, reconcileBindingsSafely, reconcileWranglerBindings, reconcileWranglerCompatibilityDate, reconcileWranglerCrons, reconcileWranglerExtras, resolveObservabilitySampling, resolveRemoteEnabled, scanWranglerVariablesForSecrets, validateWrangler, validateWranglerConfig, validateWranglerProject, warnCloudflareCliConfigOnce, withTailConsumer, wranglerCodegenInputs, wranglerToAlchemy };
1252
+ applyModify, assertWranglerSatisfiesSchema, buildBindingManifest, collectExportGaps, describePreservedCrons, describeWithheldWorkersAi, detectCloudflareCliConfig, findWranglerFile, hasCloudflareCredentials, injectRemoteFlags, isCacheEnabled, isRemoteEnvEnabled, materializeDevWranglerConfig, materializeServiceDevConfigs, mergeWranglerEnvironment, planRemoteBindings, readWranglerJsonc, reconcileBindingsSafely, reconcileWranglerBindings, reconcileWranglerCompatibilityDate, reconcileWranglerCrons, reconcileWranglerExtras, resolveObservabilitySampling, resolveRemoteEnabled, scanWranglerVariablesForSecrets, validateWrangler, validateWranglerConfig, validateWranglerProject, warnCloudflareCliConfigOnce, withTailConsumer, withheldWorkersAi, wranglerCodegenInputs, wranglerToAlchemy };
@@ -1 +1 @@
1
- import{applyModify as o}from"../packem_shared/applyModify-DKP2l6S9.mjs";import{assertWranglerSatisfiesSchema as n}from"../packem_shared/assertWranglerSatisfiesSchema-Dy0WXvP8.mjs";import{BINDING_MANIFEST_VERSION as l,buildBindingManifest as i}from"../packem_shared/BINDING_MANIFEST_VERSION-CfXEYG8e.mjs";import{CLOUDFLARE_CLI_CONFIG_WARNING_ENV as m,detectCloudflareCliConfig as E,warnCloudflareCliConfigOnce as p}from"../packem_shared/CLOUDFLARE_CLI_CONFIG_WARNING_ENV-BKMrOuXV.mjs";import{default as g}from"../packem_shared/CLOUDFLARE_DRIVER-Ci3VIqnk.mjs";import{default as R}from"../packem_shared/GLOBAL_FETCH_STRICTLY_PUBLIC_FLAG-f8CnJha3.mjs";import{collectExportGaps as _,reconcileWranglerBindings as c}from"../packem_shared/collectExportGaps-BVb5JlSY.mjs";import{reconcileWranglerCompatibilityDate as d}from"../packem_shared/reconcileWranglerCompatibilityDate-hocXEuRA.mjs";import{describePreservedCrons as A,reconcileWranglerCrons as S}from"../packem_shared/describePreservedCrons-C5KPuPy3.mjs";import{reconcileBindingsSafely as W,reconcileWranglerExtras as T}from"../packem_shared/reconcileBindingsSafely-Cj6LlUTQ.mjs";import{REMOTE_ELIGIBLE_KEYS as F,injectRemoteFlags as N,isRemoteEnvEnabled as v,materializeRemoteWranglerConfig as B,planRemoteBindings as b,resolveRemoteEnabled as G}from"../packem_shared/REMOTE_ELIGIBLE_KEYS-BrOO_a0V.mjs";import{materializeServiceDevConfigs as U}from"../packem_shared/materializeServiceDevConfigs-KfEZ8o__.mjs";import{default as y}from"../packem_shared/CLOUDFLARE_TOOLCHAIN_VERSIONS-DV5E_f_q.mjs";import{withTailConsumer as P}from"../packem_shared/withTailConsumer-DngzpJMK.mjs";import{WORKERS_CACHE_MIN_DATE as w,isCacheEnabled as Y}from"../packem_shared/WORKERS_CACHE_MIN_DATE-0k9ABJtF.mjs";import{wranglerCodegenInputs as K}from"../packem_shared/wranglerCodegenInputs-DBtq3faO.mjs";import{DEFAULT_OBSERVABILITY as z,resolveObservabilitySampling as Q}from"../packem_shared/DEFAULT_OBSERVABILITY-bN6UkTMx.mjs";import{mergeWranglerEnvironment as X}from"../packem_shared/mergeWranglerEnvironment-DXiB-HcS.mjs";import{WRANGLER_FILES as q,findWranglerFile as Z,readWranglerJsonc as $}from"../packem_shared/WRANGLER_FILES-UNW-xY5u.mjs";import{UNEXPORTED_CLASS_MARKER as re,validateWranglerProject as oe}from"../packem_shared/UNEXPORTED_CLASS_MARKER-IAK9PiDz.mjs";import{scanWranglerVariablesForSecrets as ne}from"../packem_shared/scanWranglerVariablesForSecrets-BF-791aw.mjs";import{wranglerToAlchemy as le}from"../packem_shared/wranglerToAlchemy-CBO2ucRm.mjs";import{REQUIRED_COMPATIBILITY_DATE as fe,REQUIRED_FLAG as me,validateWrangler as Ee,validateWranglerConfig as pe}from"../packem_shared/REQUIRED_COMPATIBILITY_DATE-OLQlG0oj.mjs";export{l as BINDING_MANIFEST_VERSION,m as CLOUDFLARE_CLI_CONFIG_WARNING_ENV,g as CLOUDFLARE_DRIVER,y as CLOUDFLARE_TOOLCHAIN_VERSIONS,z as DEFAULT_OBSERVABILITY,R as GLOBAL_FETCH_STRICTLY_PUBLIC_FLAG,F as REMOTE_ELIGIBLE_KEYS,fe as REQUIRED_COMPATIBILITY_DATE,me as REQUIRED_FLAG,re as UNEXPORTED_CLASS_MARKER,w as WORKERS_CACHE_MIN_DATE,q as WRANGLER_FILES,o as applyModify,n as assertWranglerSatisfiesSchema,i as buildBindingManifest,_ as collectExportGaps,A as describePreservedCrons,E as detectCloudflareCliConfig,Z as findWranglerFile,N as injectRemoteFlags,Y as isCacheEnabled,v as isRemoteEnvEnabled,B as materializeRemoteWranglerConfig,U as materializeServiceDevConfigs,X as mergeWranglerEnvironment,b as planRemoteBindings,$ as readWranglerJsonc,W as reconcileBindingsSafely,c as reconcileWranglerBindings,d as reconcileWranglerCompatibilityDate,S as reconcileWranglerCrons,T as reconcileWranglerExtras,Q as resolveObservabilitySampling,G as resolveRemoteEnabled,ne as scanWranglerVariablesForSecrets,Ee as validateWrangler,pe as validateWranglerConfig,oe as validateWranglerProject,p as warnCloudflareCliConfigOnce,P as withTailConsumer,K as wranglerCodegenInputs,le as wranglerToAlchemy};
1
+ import{applyModify as o}from"../packem_shared/applyModify-DKP2l6S9.mjs";import{assertWranglerSatisfiesSchema as l}from"../packem_shared/assertWranglerSatisfiesSchema-Dy0WXvP8.mjs";import{BINDING_MANIFEST_VERSION as i,buildBindingManifest as n}from"../packem_shared/BINDING_MANIFEST_VERSION-CfXEYG8e.mjs";import{CLOUDFLARE_CLI_CONFIG_WARNING_ENV as m,detectCloudflareCliConfig as E,warnCloudflareCliConfigOnce as s}from"../packem_shared/CLOUDFLARE_CLI_CONFIG_WARNING_ENV-BKMrOuXV.mjs";import{default as C}from"../packem_shared/CLOUDFLARE_DRIVER-Ci3VIqnk.mjs";import{default as g}from"../packem_shared/GLOBAL_FETCH_STRICTLY_PUBLIC_FLAG-f8CnJha3.mjs";import{hasCloudflareCredentials as R}from"../packem_shared/hasCloudflareCredentials-byvHpEiD.mjs";import{describeWithheldWorkersAi as _,withheldWorkersAi as I}from"../packem_shared/describeWithheldWorkersAi-IIxe3TuI.mjs";import{collectExportGaps as A,reconcileWranglerBindings as W}from"../packem_shared/collectExportGaps-BVb5JlSY.mjs";import{reconcileWranglerCompatibilityDate as O}from"../packem_shared/reconcileWranglerCompatibilityDate-hocXEuRA.mjs";import{describePreservedCrons as D,reconcileWranglerCrons as F}from"../packem_shared/describePreservedCrons-C5KPuPy3.mjs";import{reconcileBindingsSafely as v,reconcileWranglerExtras as B}from"../packem_shared/reconcileBindingsSafely-Cj6LlUTQ.mjs";import{REMOTE_ELIGIBLE_KEYS as h,injectRemoteFlags as u,isRemoteEnvEnabled as G,materializeDevWranglerConfig as U,planRemoteBindings as M,resolveRemoteEnabled as y}from"../packem_shared/REMOTE_ELIGIBLE_KEYS-PLeh_74E.mjs";import{materializeServiceDevConfigs as w}from"../packem_shared/materializeServiceDevConfigs-DLUHefD-.mjs";import{default as Y}from"../packem_shared/CLOUDFLARE_TOOLCHAIN_VERSIONS-DV5E_f_q.mjs";import{withTailConsumer as K}from"../packem_shared/withTailConsumer-DngzpJMK.mjs";import{WORKERS_CACHE_MIN_DATE as k,isCacheEnabled as z}from"../packem_shared/WORKERS_CACHE_MIN_DATE-0k9ABJtF.mjs";import{wranglerCodegenInputs as J}from"../packem_shared/wranglerCodegenInputs-DBtq3faO.mjs";import{DEFAULT_OBSERVABILITY as q,resolveObservabilitySampling as Z}from"../packem_shared/DEFAULT_OBSERVABILITY-bN6UkTMx.mjs";import{mergeWranglerEnvironment as ee}from"../packem_shared/mergeWranglerEnvironment-DXiB-HcS.mjs";import{WRANGLER_FILES as oe,findWranglerFile as ae,readWranglerJsonc as le}from"../packem_shared/WRANGLER_FILES-UNW-xY5u.mjs";import{UNEXPORTED_CLASS_MARKER as ie,validateWranglerProject as ne}from"../packem_shared/UNEXPORTED_CLASS_MARKER-IAK9PiDz.mjs";import{scanWranglerVariablesForSecrets as me}from"../packem_shared/scanWranglerVariablesForSecrets-BF-791aw.mjs";import{wranglerToAlchemy as se}from"../packem_shared/wranglerToAlchemy-CBO2ucRm.mjs";import{REQUIRED_COMPATIBILITY_DATE as Ce,REQUIRED_FLAG as de,validateWrangler as ge,validateWranglerConfig as xe}from"../packem_shared/REQUIRED_COMPATIBILITY_DATE-OLQlG0oj.mjs";export{i as BINDING_MANIFEST_VERSION,m as CLOUDFLARE_CLI_CONFIG_WARNING_ENV,C as CLOUDFLARE_DRIVER,Y as CLOUDFLARE_TOOLCHAIN_VERSIONS,q as DEFAULT_OBSERVABILITY,g as GLOBAL_FETCH_STRICTLY_PUBLIC_FLAG,h as REMOTE_ELIGIBLE_KEYS,Ce as REQUIRED_COMPATIBILITY_DATE,de as REQUIRED_FLAG,ie as UNEXPORTED_CLASS_MARKER,k as WORKERS_CACHE_MIN_DATE,oe as WRANGLER_FILES,o as applyModify,l as assertWranglerSatisfiesSchema,n as buildBindingManifest,A as collectExportGaps,D as describePreservedCrons,_ as describeWithheldWorkersAi,E as detectCloudflareCliConfig,ae as findWranglerFile,R as hasCloudflareCredentials,u as injectRemoteFlags,z as isCacheEnabled,G as isRemoteEnvEnabled,U as materializeDevWranglerConfig,w as materializeServiceDevConfigs,ee as mergeWranglerEnvironment,M as planRemoteBindings,le as readWranglerJsonc,v as reconcileBindingsSafely,W as reconcileWranglerBindings,O as reconcileWranglerCompatibilityDate,F as reconcileWranglerCrons,B as reconcileWranglerExtras,Z as resolveObservabilitySampling,y as resolveRemoteEnabled,me as scanWranglerVariablesForSecrets,ge as validateWrangler,xe as validateWranglerConfig,ne as validateWranglerProject,s as warnCloudflareCliConfigOnce,K as withTailConsumer,I as withheldWorkersAi,J as wranglerCodegenInputs,se as wranglerToAlchemy};
@@ -0,0 +1 @@
1
+ import{applyModify as m}from"./applyModify-DKP2l6S9.mjs";import{hasCloudflareCredentials as y}from"./hasCloudflareCredentials-byvHpEiD.mjs";import{withheldWorkersAi as E,writeDevConfig as R,noopCleanup as S}from"./describeWithheldWorkersAi-IIxe3TuI.mjs";import{r as j}from"./lunora-manifest-DuH_Cmyu.mjs";import{o as w}from"./reconcile-services-DFqH4eMQ.mjs";import{findWranglerFile as _,readWranglerJsonc as C}from"./WRANGLER_FILES-UNW-xY5u.mjs";const h={ai:{label:"AI",shape:"object"},ai_search:{label:"AI Search",shape:"array"},ai_search_namespaces:{label:"AI Search namespace",shape:"array"},analytics:{label:"Analytics SQL",shape:"object"},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"}},I=Object.keys(h),b=(e,r)=>typeof e.binding=="string"?e.binding:r,f=(e,r,t,n)=>{const i=[];for(const[s,a]of r.entries())a!=null&&i.push({binding:b(a,`#${String(s)}`),kind:t,path:[...n,s],section:e});return i},g=(e,r)=>h[e].shape===r,A=(e,r)=>{const{label:t}=h[e];if(g(e,"array"))return f(e,r[e]??[],t,[]);if(g(e,"object")){const n=r[e];return n==null?[]:[{binding:b(n,e),kind:t,path:[],section:e}]}return f(e,r.queues?.producers??[],t,["producers"])},B=e=>I.flatMap(r=>A(r,e)),L=(e,r)=>{let t=e;for(const n of r)t=m(t,[n.section,...n.path,"remote"],!0);return t},D=e=>{const r=o=>({cleanup:S,reason:o,remoteBindings:[],withheld:[]}),t=_(e.projectRoot);if(!t)return r("wrangler.jsonc not found");const{parsed:n,text:i}=C(t);if(n===void 0)return r(`failed to parse ${t} as JSONC`);const s=w(j(e.projectRoot)),a=e.remote?B(n).filter(o=>o.section!=="services"||!s.has(o.binding)):[],c=E(n.ai,e.hasCredentials??(()=>y({projectRoot:e.projectRoot}))),d=c===void 0?[]:[c],l=c===void 0?a:a.filter(o=>o.section!=="ai");if(l.length===0&&d.length===0)return r(e.remote?"no remote-eligible bindings to proxy":void 0);const p=d.length>0?m(i,["ai"],void 0):i,v=l.length>0?L(p,l):p,u=R(e.projectRoot,"dev",v);return{cleanup:u.cleanup,configPath:u.configPath,remoteBindings:l,withheld:d}},k=e=>{if(e===void 0)return!1;const r=e.trim().toLowerCase();return r==="1"||r==="true"},K=e=>e.flag===!0||k(e.envValue)?!0:e.configPreference??!1;export{h as REMOTE_ELIGIBLE_KEYS,L as injectRemoteFlags,k as isRemoteEnvEnabled,D as materializeDevWranglerConfig,B as planRemoteBindings,K as resolveRemoteEnabled};
@@ -0,0 +1 @@
1
+ import{rmSync as s,readdirSync as c,writeFileSync as l}from"node:fs";import{join as i}from"node:path";const u=/^\.wrangler\.lunora-(?:dev|service)\.(\d+)\.\d+\.jsonc$/;let t=0;const a=e=>(t+=1,`.wrangler.lunora-${e}.${String(process.pid)}.${String(t)}.jsonc`),d=e=>{try{return process.kill(e,0),!0}catch(r){return r.code==="EPERM"}},f=e=>{let r;try{r=c(e)}catch{return}for(const o of r){const n=u.exec(o);if(!(n===null||Number(n[1])===process.pid||d(Number(n[1]))))try{s(i(e,o),{force:!0})}catch{}}},h=()=>{},g=e=>{let r=!1;return()=>{if(!r){r=!0;try{s(e,{force:!0})}catch{}}}},A=(e,r,o)=>{f(e);const n=i(e,a(r));return l(n,o,"utf8"),{cleanup:g(n),configPath:n}},w=(e,r)=>{if(!(e==null||r()))return typeof e.binding=="string"?e.binding:"AI"},v=e=>`Workers AI is off in this dev session (${e} binding left out): no Cloudflare login found, and Workers AI only runs remotely. \`@cf/…\` models will throw; AI SDK models and \`LUNORA_AI_PROXY_URL\` slugs still work. Run \`wrangler login\` or set CLOUDFLARE_API_TOKEN to turn it on.`;export{u as STALE_DEV_CONFIG,g as createCleanup,v as describeWithheldWorkersAi,a as devConfigBasename,h as noopCleanup,f as sweepStaleDevConfigs,w as withheldWorkersAi,A as writeDevConfig};
@@ -0,0 +1 @@
1
+ import{readFileSync as d,readdirSync as m}from"node:fs";import{homedir as L}from"node:os";import{join as r}from"node:path";const u=[".env",".env.local",".env.development",".env.development.local"],l=["CLOUDFLARE_API_TOKEN","CF_API_TOKEN"],f=["CLOUDFLARE_API_KEY","CF_API_KEY"],A=["CLOUDFLARE_EMAIL","CF_EMAIL"],v=new Set([...l,...f,...A]),O=/^export\s+/u,S=/\r?\n/u,p=/^(["'])(.*)\1$/u,E=t=>t!==void 0&&t.trim()!=="",C=(t,o)=>[o,t.XDG_CONFIG_HOME,r(o,"Library","Preferences"),r(o,".config"),t.APPDATA===void 0?void 0:r(t.APPDATA,"xdg.config"),r(o,"AppData","Roaming","xdg.config")].filter(s=>E(s)),I=t=>{try{return m(t).length>0}catch{return!1}},K=t=>{const o=new Set;for(const s of u){let n;try{n=d(r(t,s),"utf8")}catch{continue}for(const e of n.split(S)){const c=e.trim().replace(O,""),i=c.indexOf("=");if(c.startsWith("#")||i===-1)continue;const a=c.slice(0,i).trim(),_=c.slice(i+1).trim().replace(p,"$2");v.has(a)&&E(_)&&o.add(a)}}return o},F=(t={})=>{const o=t.env??process.env,s=t.projectRoot===void 0?new Set:K(t.projectRoot),n=e=>E(o[e])||s.has(e);return l.some(e=>n(e))||f.some(e=>n(e))&&A.some(e=>n(e))?!0:C(o,t.home??L()).some(e=>I(r(e,".wrangler","config")))};export{F as hasCloudflareCredentials};
@@ -0,0 +1 @@
1
+ import{isAbsolute as f,dirname as p,resolve as m}from"node:path";import{applyModify as l}from"./applyModify-DKP2l6S9.mjs";import{hasCloudflareCredentials as h}from"./hasCloudflareCredentials-byvHpEiD.mjs";import{withheldWorkersAi as u,writeDevConfig as v}from"./describeWithheldWorkersAi-IIxe3TuI.mjs";import{readWranglerJsonc as w}from"./WRANGLER_FILES-UNW-xY5u.mjs";const g=(t,r)=>{const{parsed:e,text:n}=w(t),o=e?.build,c=u(e?.ai,r.hasCredentials??(()=>h({projectRoot:r.projectRoot}))),d=typeof o?.command=="string"&&o.command!==""&&!(typeof o.cwd=="string"&&f(o.cwd));if(!d&&c===void 0)return{configPath:t};const s=p(t);let i=n;c!==void 0&&(i=l(i,["ai"],void 0)),d&&(i=l(i,["build","cwd"],m(s,typeof o.cwd=="string"?o.cwd:".")));const a=v(s,"service",i);return{cleanup:a.cleanup,configPath:a.configPath,withheld:c}},j=(t,r)=>{const e=t.map(o=>g(o,r)),n=e.flatMap(o=>o.cleanup===void 0?[]:[o.cleanup]);return{cleanup:()=>{for(const o of n)o()},configPaths:e.map(o=>o.configPath),withheld:e.flatMap(o=>o.withheld===void 0?[]:[o.withheld])}};export{j as materializeServiceDevConfigs};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lunora/config",
3
- "version": "1.0.0-alpha.335",
3
+ "version": "1.0.0-alpha.336",
4
4
  "description": "Internal shared CLI + Vite config layer for Lunora: wrangler.jsonc validation, binding inference, and .dev.vars scaffolding",
5
5
  "keywords": [
6
6
  "bindings",
@@ -54,10 +54,10 @@
54
54
  "access": "public"
55
55
  },
56
56
  "dependencies": {
57
- "@lunora/codegen": "1.0.0-alpha.290",
57
+ "@lunora/codegen": "1.0.0-alpha.291",
58
58
  "@lunora/container": "1.0.0-alpha.72",
59
59
  "@lunora/errors": ">=1.0.0-alpha.51 <2.0.0-0",
60
- "@lunora/seed": "1.0.0-alpha.208",
60
+ "@lunora/seed": "1.0.0-alpha.209",
61
61
  "@visulima/colorize": "2.1.1",
62
62
  "@visulima/find-ai-runner": "1.0.2",
63
63
  "@visulima/fs": "6.0.29",
@@ -1 +0,0 @@
1
- import{writeFileSync as m,rmSync as b}from"node:fs";import{applyModify as g}from"./applyModify-DKP2l6S9.mjs";import{r as h}from"./lunora-manifest-DuH_Cmyu.mjs";import{o as y}from"./reconcile-services-DFqH4eMQ.mjs";import{findWranglerFile as S,readWranglerJsonc as v}from"./WRANGLER_FILES-UNW-xY5u.mjs";import{join as E}from"node:path";const l={ai:{label:"AI",shape:"object"},ai_search:{label:"AI Search",shape:"array"},ai_search_namespaces:{label:"AI Search namespace",shape:"array"},analytics:{label:"Analytics SQL",shape:"object"},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"}},j=Object.keys(l),d=(e,r)=>typeof e.binding=="string"?e.binding:r,u=(e,r,n,a)=>{const s=[];for(const[o,t]of r.entries())t!=null&&s.push({binding:d(t,`#${String(o)}`),kind:n,path:[...a,o],section:e});return s},p=(e,r)=>l[e].shape===r,R=(e,r)=>{const{label:n}=l[e];if(p(e,"array"))return u(e,r[e]??[],n,[]);if(p(e,"object")){const a=r[e];return a==null?[]:[{binding:d(a,e),kind:n,path:[],section:e}]}return u(e,r.queues?.producers??[],n,["producers"])},_=e=>j.flatMap(r=>R(r,e)),B=(e,r)=>{let n=e;for(const a of r)n=g(n,[a.section,...a.path,"remote"],!0);return n},i=()=>{},I=e=>{let r=!1;return()=>{if(!r){r=!0;try{b(e,{force:!0,recursive:!0})}catch{}}}};let f=0;const C=()=>(f+=1,`.wrangler.lunora-remote.${String(process.pid)}.${String(f)}.jsonc`),O=e=>{if(!e.enabled)return{cleanup:i,enabled:!1,remoteBindings:[]};const r=S(e.projectRoot);if(!r)return{cleanup:i,enabled:!0,reason:"wrangler.jsonc not found",remoteBindings:[]};const{parsed:n,text:a}=v(r);if(n===void 0)return{cleanup:i,enabled:!0,reason:`failed to parse ${r} as JSONC`,remoteBindings:[]};const s=y(h(e.projectRoot)),o=_(n).filter(c=>c.section!=="services"||!s.has(c.binding));if(o.length===0)return{cleanup:i,enabled:!0,reason:"no remote-eligible bindings to proxy",remoteBindings:[]};const t=E(e.projectRoot,C());return m(t,B(a,o),"utf8"),{cleanup:I(t),configPath:t,enabled:!0,remoteBindings:o}},L=e=>{if(e===void 0)return!1;const r=e.trim().toLowerCase();return r==="1"||r==="true"},$=e=>e.flag===!0||L(e.envValue)?!0:e.configPreference??!1;export{l as REMOTE_ELIGIBLE_KEYS,I as createCleanup,B as injectRemoteFlags,L as isRemoteEnvEnabled,O as materializeRemoteWranglerConfig,_ as planRemoteBindings,$ as resolveRemoteEnabled};
@@ -1 +0,0 @@
1
- import{writeFileSync as a}from"node:fs";import{isAbsolute as p,dirname as d,resolve as f,join as m}from"node:path";import{applyModify as l}from"./applyModify-DKP2l6S9.mjs";import{createCleanup as u}from"./REMOTE_ELIGIBLE_KEYS-BrOO_a0V.mjs";import{readWranglerJsonc as g}from"./WRANGLER_FILES-UNW-xY5u.mjs";let c=0;const v=e=>{const{parsed:t,text:r}=g(e),o=t?.build;if(typeof o?.command!="string"||o.command===""||typeof o.cwd=="string"&&p(o.cwd))return{configPath:e};const i=d(e),s=f(i,typeof o.cwd=="string"?o.cwd:".");c+=1;const n=m(i,`.wrangler.lunora-service.${String(process.pid)}.${String(c)}.jsonc`);return a(n,l(r,["build","cwd"],s),"utf8"),{cleanup:u(n),configPath:n}},j=e=>{const t=e.map(o=>v(o)),r=t.flatMap(o=>o.cleanup===void 0?[]:[o.cleanup]);return{cleanup:()=>{for(const o of r)o()},configPaths:t.map(o=>o.configPath)}};export{j as materializeServiceDevConfigs};