@lunora/config 1.0.0-alpha.284 → 1.0.0-alpha.286

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 (24) hide show
  1. package/dist/cloudflare/index.d.mts +8 -3
  2. package/dist/cloudflare/index.d.ts +8 -3
  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/COMPOSED_WORKER_ENTRY-C69wqbSP.mjs +1 -0
  8. package/dist/packem_shared/{LUNORA_IGNORED_PATHS-BHABA9u-.mjs → LUNORA_IGNORED_PATHS-B0-PPvRp.mjs} +1 -1
  9. package/dist/packem_shared/REMOTE_ELIGIBLE_KEYS-D72UkJEq.mjs +1 -0
  10. package/dist/packem_shared/{UNEXPORTED_CLASS_MARKER-Bc302QS4.mjs → UNEXPORTED_CLASS_MARKER-D3aUWNly.mjs} +1 -1
  11. package/dist/packem_shared/applyModify-DKP2l6S9.mjs +1 -0
  12. package/dist/packem_shared/{assertWranglerSatisfiesSchema-B24XPKq7.mjs → assertWranglerSatisfiesSchema-c7577QR3.mjs} +1 -1
  13. package/dist/packem_shared/{collectExportGaps-BmEGzQQc.mjs → collectExportGaps-DUaEyDNw.mjs} +1 -1
  14. package/dist/packem_shared/inferLunoraBindings-DTiYSVS2.mjs +1 -0
  15. package/dist/packem_shared/{reconcileBindingsSafely-DOqY2zb2.mjs → reconcileBindingsSafely-BYFuD4MB.mjs} +1 -1
  16. package/dist/packem_shared/reconcileWranglerCompatibilityDate-hocXEuRA.mjs +1 -0
  17. package/dist/packem_shared/{schema-info.d-C3DeuUmC.d.mts → schema-info.d-DamDrltc.d.mts} +1 -1
  18. package/dist/packem_shared/{schema-info.d-C3DeuUmC.d.ts → schema-info.d-DamDrltc.d.ts} +1 -1
  19. package/package.json +3 -3
  20. package/dist/packem_shared/COMPOSED_WORKER_ENTRY-5R-BECOC.mjs +0 -1
  21. package/dist/packem_shared/REMOTE_ELIGIBLE_KEYS-D-edJjVY.mjs +0 -1
  22. package/dist/packem_shared/inferLunoraBindings-GaAITuz-.mjs +0 -1
  23. package/dist/packem_shared/jsonc-edit-BZgQIdAH.mjs +0 -1
  24. package/dist/packem_shared/reconcileWranglerCompatibilityDate-7OO_xaKR.mjs +0 -1
@@ -1,5 +1,7 @@
1
- import { D as DeployDriver, G as GeneratedClassModule, I as InferredBindings, S as SchemaInfo } from "../packem_shared/schema-info.d-C3DeuUmC.mjs";
1
+ import { D as DeployDriver, G as GeneratedClassModule, I as InferredBindings, S as SchemaInfo } from "../packem_shared/schema-info.d-DamDrltc.mjs";
2
2
  import { WranglerVariableIR } from '@lunora/codegen';
3
+ /** Apply one structural jsonc edit and return the rewritten text (a no-op edit returns the input). */
4
+ declare const applyModify: (text: string, path: ReadonlyArray<number | string>, value: unknown) => string;
3
5
  /** The project coordinates the validator needs. */
4
6
  interface AssertWranglerOptions {
5
7
  /** Absolute path to the project root holding `wrangler.jsonc`. */
@@ -683,6 +685,9 @@ interface WranglerQueueConsumer {
683
685
  type?: string;
684
686
  }
685
687
  interface WranglerConfig {
688
+ ai?: {
689
+ binding?: unknown;
690
+ } | null;
686
691
  analytics_engine_datasets?: ReadonlyArray<{
687
692
  binding?: string;
688
693
  dataset?: string;
@@ -964,7 +969,7 @@ declare const validateWranglerConfig: (wranglerInput: WranglerConfig | undefined
964
969
  * `{ valid, errors, warnings }`.
965
970
  */
966
971
  declare const validateWrangler: typeof validateWranglerConfig;
967
- export { type AlchemyTranslation,
972
+ 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 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,
968
973
  /**
969
974
  * `@lunora/config/cloudflare` — the wrangler layer.
970
975
  *
@@ -980,4 +985,4 @@ export { type AlchemyTranslation,
980
985
  * Plan 114 §5.3 (D6): a package carrying real provider code isolates it behind a
981
986
  * subpath rather than relocating wholesale.
982
987
  */
983
- 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 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, assertWranglerSatisfiesSchema, buildBindingManifest, collectExportGaps, collectWranglerSecretVariables, describePreservedCrons, findWranglerFile, injectRemoteFlags, isCacheEnabled, isRemoteEnvEnabled, materializeRemoteWranglerConfig, mergeWranglerEnvironment, planRemoteBindings, readWranglerJsonc, reconcileBindingsSafely, reconcileWranglerBindings, reconcileWranglerCompatibilityDate, reconcileWranglerCrons, reconcileWranglerExtras, resolveRemoteEnabled, scanWranglerVariablesForSecrets, validateWrangler, validateWranglerConfig, validateWranglerProject, withTailConsumer, wranglerToAlchemy };
988
+ applyModify, assertWranglerSatisfiesSchema, buildBindingManifest, collectExportGaps, collectWranglerSecretVariables, describePreservedCrons, findWranglerFile, injectRemoteFlags, isCacheEnabled, isRemoteEnvEnabled, materializeRemoteWranglerConfig, mergeWranglerEnvironment, planRemoteBindings, readWranglerJsonc, reconcileBindingsSafely, reconcileWranglerBindings, reconcileWranglerCompatibilityDate, reconcileWranglerCrons, reconcileWranglerExtras, resolveRemoteEnabled, scanWranglerVariablesForSecrets, validateWrangler, validateWranglerConfig, validateWranglerProject, withTailConsumer, wranglerToAlchemy };
@@ -1,5 +1,7 @@
1
- import { D as DeployDriver, G as GeneratedClassModule, I as InferredBindings, S as SchemaInfo } from "../packem_shared/schema-info.d-C3DeuUmC.js";
1
+ import { D as DeployDriver, G as GeneratedClassModule, I as InferredBindings, S as SchemaInfo } from "../packem_shared/schema-info.d-DamDrltc.js";
2
2
  import { WranglerVariableIR } from '@lunora/codegen';
3
+ /** Apply one structural jsonc edit and return the rewritten text (a no-op edit returns the input). */
4
+ declare const applyModify: (text: string, path: ReadonlyArray<number | string>, value: unknown) => string;
3
5
  /** The project coordinates the validator needs. */
4
6
  interface AssertWranglerOptions {
5
7
  /** Absolute path to the project root holding `wrangler.jsonc`. */
@@ -683,6 +685,9 @@ interface WranglerQueueConsumer {
683
685
  type?: string;
684
686
  }
685
687
  interface WranglerConfig {
688
+ ai?: {
689
+ binding?: unknown;
690
+ } | null;
686
691
  analytics_engine_datasets?: ReadonlyArray<{
687
692
  binding?: string;
688
693
  dataset?: string;
@@ -964,7 +969,7 @@ declare const validateWranglerConfig: (wranglerInput: WranglerConfig | undefined
964
969
  * `{ valid, errors, warnings }`.
965
970
  */
966
971
  declare const validateWrangler: typeof validateWranglerConfig;
967
- export { type AlchemyTranslation,
972
+ 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 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,
968
973
  /**
969
974
  * `@lunora/config/cloudflare` — the wrangler layer.
970
975
  *
@@ -980,4 +985,4 @@ export { type AlchemyTranslation,
980
985
  * Plan 114 §5.3 (D6): a package carrying real provider code isolates it behind a
981
986
  * subpath rather than relocating wholesale.
982
987
  */
983
- 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 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, assertWranglerSatisfiesSchema, buildBindingManifest, collectExportGaps, collectWranglerSecretVariables, describePreservedCrons, findWranglerFile, injectRemoteFlags, isCacheEnabled, isRemoteEnvEnabled, materializeRemoteWranglerConfig, mergeWranglerEnvironment, planRemoteBindings, readWranglerJsonc, reconcileBindingsSafely, reconcileWranglerBindings, reconcileWranglerCompatibilityDate, reconcileWranglerCrons, reconcileWranglerExtras, resolveRemoteEnabled, scanWranglerVariablesForSecrets, validateWrangler, validateWranglerConfig, validateWranglerProject, withTailConsumer, wranglerToAlchemy };
988
+ applyModify, assertWranglerSatisfiesSchema, buildBindingManifest, collectExportGaps, collectWranglerSecretVariables, describePreservedCrons, findWranglerFile, injectRemoteFlags, isCacheEnabled, isRemoteEnvEnabled, materializeRemoteWranglerConfig, mergeWranglerEnvironment, planRemoteBindings, readWranglerJsonc, reconcileBindingsSafely, reconcileWranglerBindings, reconcileWranglerCompatibilityDate, reconcileWranglerCrons, reconcileWranglerExtras, resolveRemoteEnabled, scanWranglerVariablesForSecrets, validateWrangler, validateWranglerConfig, validateWranglerProject, withTailConsumer, wranglerToAlchemy };
@@ -1 +1 @@
1
- import{assertWranglerSatisfiesSchema as o}from"../packem_shared/assertWranglerSatisfiesSchema-B24XPKq7.mjs";import{BINDING_MANIFEST_VERSION as n,buildBindingManifest as l}from"../packem_shared/BINDING_MANIFEST_VERSION-B4Tu8Ytd.mjs";import{default as i}from"../packem_shared/CLOUDFLARE_DRIVER-DUE6r-Pg.mjs";import{collectExportGaps as m,reconcileWranglerBindings as s}from"../packem_shared/collectExportGaps-BmEGzQQc.mjs";import{reconcileWranglerCompatibilityDate as f}from"../packem_shared/reconcileWranglerCompatibilityDate-7OO_xaKR.mjs";import{describePreservedCrons as R,reconcileWranglerCrons as p}from"../packem_shared/describePreservedCrons-Ci5r2aph.mjs";import{reconcileBindingsSafely as d,reconcileWranglerExtras as W}from"../packem_shared/reconcileBindingsSafely-DOqY2zb2.mjs";import{REMOTE_ELIGIBLE_KEYS as _,injectRemoteFlags as C,isRemoteEnvEnabled as S,materializeRemoteWranglerConfig as A,planRemoteBindings as D,resolveRemoteEnabled as L}from"../packem_shared/REMOTE_ELIGIBLE_KEYS-D-edJjVY.mjs";import{withTailConsumer as b}from"../packem_shared/withTailConsumer-DaP3r6ia.mjs";import{WORKERS_CACHE_MIN_DATE as B,isCacheEnabled as F}from"../packem_shared/WORKERS_CACHE_MIN_DATE-0k9ABJtF.mjs";import{mergeWranglerEnvironment as M}from"../packem_shared/mergeWranglerEnvironment-BIcLqPfv.mjs";import{WRANGLER_FILES as G,findWranglerFile as h,readWranglerJsonc as P}from"../packem_shared/WRANGLER_FILES-UNW-xY5u.mjs";import{UNEXPORTED_CLASS_MARKER as V,validateWranglerProject as u}from"../packem_shared/UNEXPORTED_CLASS_MARKER-Bc302QS4.mjs";import{collectWranglerSecretVariables as K,scanWranglerVariablesForSecrets as j}from"../packem_shared/collectWranglerSecretVariables-D-usPfT8.mjs";import{wranglerToAlchemy as Q}from"../packem_shared/wranglerToAlchemy-DZOim9As.mjs";import{REQUIRED_COMPATIBILITY_DATE as z,REQUIRED_FLAG as H,validateWrangler as J,validateWranglerConfig as X}from"../packem_shared/REQUIRED_COMPATIBILITY_DATE-g_1F-n2X.mjs";export{n as BINDING_MANIFEST_VERSION,i as CLOUDFLARE_DRIVER,_ as REMOTE_ELIGIBLE_KEYS,z as REQUIRED_COMPATIBILITY_DATE,H as REQUIRED_FLAG,V as UNEXPORTED_CLASS_MARKER,B as WORKERS_CACHE_MIN_DATE,G as WRANGLER_FILES,o as assertWranglerSatisfiesSchema,l as buildBindingManifest,m as collectExportGaps,K as collectWranglerSecretVariables,R as describePreservedCrons,h as findWranglerFile,C as injectRemoteFlags,F as isCacheEnabled,S as isRemoteEnvEnabled,A as materializeRemoteWranglerConfig,M as mergeWranglerEnvironment,D as planRemoteBindings,P as readWranglerJsonc,d as reconcileBindingsSafely,s as reconcileWranglerBindings,f as reconcileWranglerCompatibilityDate,p as reconcileWranglerCrons,W as reconcileWranglerExtras,L as resolveRemoteEnabled,j as scanWranglerVariablesForSecrets,J as validateWrangler,X as validateWranglerConfig,u as validateWranglerProject,b as withTailConsumer,Q as wranglerToAlchemy};
1
+ import{applyModify as o}from"../packem_shared/applyModify-DKP2l6S9.mjs";import{assertWranglerSatisfiesSchema as n}from"../packem_shared/assertWranglerSatisfiesSchema-c7577QR3.mjs";import{BINDING_MANIFEST_VERSION as t,buildBindingManifest as i}from"../packem_shared/BINDING_MANIFEST_VERSION-B4Tu8Ytd.mjs";import{default as E}from"../packem_shared/CLOUDFLARE_DRIVER-DUE6r-Pg.mjs";import{collectExportGaps as s,reconcileWranglerBindings as c}from"../packem_shared/collectExportGaps-DUaEyDNw.mjs";import{reconcileWranglerCompatibilityDate as p}from"../packem_shared/reconcileWranglerCompatibilityDate-hocXEuRA.mjs";import{describePreservedCrons as x,reconcileWranglerCrons as d}from"../packem_shared/describePreservedCrons-Ci5r2aph.mjs";import{reconcileBindingsSafely as I,reconcileWranglerExtras as _}from"../packem_shared/reconcileBindingsSafely-BYFuD4MB.mjs";import{REMOTE_ELIGIBLE_KEYS as S,injectRemoteFlags as A,isRemoteEnvEnabled as D,materializeRemoteWranglerConfig as L,planRemoteBindings as T,resolveRemoteEnabled as b}from"../packem_shared/REMOTE_ELIGIBLE_KEYS-D72UkJEq.mjs";import{withTailConsumer as B}from"../packem_shared/withTailConsumer-DaP3r6ia.mjs";import{WORKERS_CACHE_MIN_DATE as M,isCacheEnabled as N}from"../packem_shared/WORKERS_CACHE_MIN_DATE-0k9ABJtF.mjs";import{mergeWranglerEnvironment as y}from"../packem_shared/mergeWranglerEnvironment-BIcLqPfv.mjs";import{WRANGLER_FILES as h,findWranglerFile as P,readWranglerJsonc as U}from"../packem_shared/WRANGLER_FILES-UNW-xY5u.mjs";import{UNEXPORTED_CLASS_MARKER as u,validateWranglerProject as K}from"../packem_shared/UNEXPORTED_CLASS_MARKER-D3aUWNly.mjs";import{collectWranglerSecretVariables as w,scanWranglerVariablesForSecrets as Q}from"../packem_shared/collectWranglerSecretVariables-D-usPfT8.mjs";import{wranglerToAlchemy as z}from"../packem_shared/wranglerToAlchemy-DZOim9As.mjs";import{REQUIRED_COMPATIBILITY_DATE as J,REQUIRED_FLAG as X,validateWrangler as k,validateWranglerConfig as q}from"../packem_shared/REQUIRED_COMPATIBILITY_DATE-g_1F-n2X.mjs";export{t as BINDING_MANIFEST_VERSION,E as CLOUDFLARE_DRIVER,S as REMOTE_ELIGIBLE_KEYS,J as REQUIRED_COMPATIBILITY_DATE,X as REQUIRED_FLAG,u as UNEXPORTED_CLASS_MARKER,M as WORKERS_CACHE_MIN_DATE,h as WRANGLER_FILES,o as applyModify,n as assertWranglerSatisfiesSchema,i as buildBindingManifest,s as collectExportGaps,w as collectWranglerSecretVariables,x as describePreservedCrons,P as findWranglerFile,A as injectRemoteFlags,N as isCacheEnabled,D as isRemoteEnvEnabled,L as materializeRemoteWranglerConfig,y as mergeWranglerEnvironment,T as planRemoteBindings,U as readWranglerJsonc,I as reconcileBindingsSafely,c as reconcileWranglerBindings,p as reconcileWranglerCompatibilityDate,d as reconcileWranglerCrons,_ as reconcileWranglerExtras,b as resolveRemoteEnabled,Q as scanWranglerVariablesForSecrets,k as validateWrangler,q as validateWranglerConfig,K as validateWranglerProject,B as withTailConsumer,z as wranglerToAlchemy};
package/dist/index.d.mts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { AgentIR, ContainerIR, WorkflowIR, CodegenResult } from '@lunora/codegen';
2
2
  export type { AgentIR, ContainerIR, WorkflowIR } from '@lunora/codegen';
3
3
  import { Writable } from 'node:stream';
4
- import { T as ToolchainCommand, D as DeployDriver, P as ProjectionPurpose } from "./packem_shared/schema-info.d-C3DeuUmC.mjs";
5
- 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-C3DeuUmC.mjs";
4
+ import { T as ToolchainCommand, D as DeployDriver, P as ProjectionPurpose } from "./packem_shared/schema-info.d-DamDrltc.mjs";
5
+ 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-DamDrltc.mjs";
6
6
  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";
7
7
  interface DiscoverAgentInfoResult {
8
8
  /** Discovered agent definitions; `[]` when none are declared or parsing failed. */
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { AgentIR, ContainerIR, WorkflowIR, CodegenResult } from '@lunora/codegen';
2
2
  export type { AgentIR, ContainerIR, WorkflowIR } from '@lunora/codegen';
3
3
  import { Writable } from 'node:stream';
4
- import { T as ToolchainCommand, D as DeployDriver, P as ProjectionPurpose } from "./packem_shared/schema-info.d-C3DeuUmC.js";
5
- 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-C3DeuUmC.js";
4
+ import { T as ToolchainCommand, D as DeployDriver, P as ProjectionPurpose } from "./packem_shared/schema-info.d-DamDrltc.js";
5
+ 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-DamDrltc.js";
6
6
  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";
7
7
  interface DiscoverAgentInfoResult {
8
8
  /** 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 E}from"./packem_shared/discoverAgentInfo-CTdCSfYM.mjs";import{AGENT_RULES_DIR as s,AGENT_RULES_HINT as n,AGENT_RULES_HINT_ENV as l,LUNORA_SKILL_NAMES as _,ROOT_SKILL_NAME as p,claimAgentRulesHint as c,detectAgentRules as d}from"./packem_shared/AGENT_RULES_DIR-C54Ta_vz.mjs";import{CODEGEN_ENV as D,isCodegenDisabled as m}from"./packem_shared/CODEGEN_ENV-ZsCxV1kP.mjs";import{discoverContainerInfo as f}from"./packem_shared/discoverContainerInfo-EhZtEBQs.mjs";import{streamContainerLogs as v}from"./packem_shared/streamContainerLogs-0nko1qpv.mjs";import{detectFramework as R,projectUsesUmbrella as g,readProjectDependencyNames as T}from"./packem_shared/detectFramework-CUiVEHDQ.mjs";import{DEV_BINDINGS_FILE as x,DEV_DAEMON_ENV as I,DEV_HANDOFF_ENV as u,DEV_LOG_FILE as O,DEV_LOG_FILE_ENV as P,DEV_STATE_DIR as F,DEV_STATE_FILE as C,claimDevServerState as U,clearDevServerState as G,isDevServerReady as b,isProcessAlive as M,isRecordedProcessCurrent as y,readDevServerState as k,readLiveDevServerState as B,updateDevServerState as K,writeDevServerState as w}from"./packem_shared/DEV_BINDINGS_FILE-pyOiNLP4.mjs";import{DEV_VARS_EXAMPLE_FILE as j,DEV_VARS_FILE as H,DEV_VARS_KEY_PATTERN as W,escapeRegExp as Y,parseDevVariableEntries as J,removeDevVariableLine as q,upsertDevVariableLine as X}from"./packem_shared/DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";import{DEV_WORKER_ENV_VALUE as Q,DEV_WORKER_ENV_VAR as Z,ensureDevWorkerEnv as $}from"./packem_shared/DEV_WORKER_ENV_VALUE-DwGANZVw.mjs";import{DEFAULT_DEPLOY_TARGET as re,deployTargetIds as oe,isRunnableTarget as te,planToolchainInvocation as ae,resolveDeployDriver as Ee,runnableTargetIds as ie,targetRunsOwnDevServer as se}from"./packem_shared/DEFAULT_DEPLOY_TARGET-CtEZtsUF.mjs";import{inferLunoraBindings as le,packageNamesFromBindings as _e}from"./packem_shared/inferLunoraBindings-GaAITuz-.mjs";import{LINKED_PROJECT_DIR as ce,LINKED_PROJECT_FILE as de,readLinkedProject as Ae,writeLinkedProject as De}from"./packem_shared/LINKED_PROJECT_DIR-Ba5qPEwo.mjs";import{LUNORA_IGNORED_PATHS as Se,applyLintIgnores as fe,detectLintTools as Le}from"./packem_shared/LUNORA_IGNORED_PATHS-BHABA9u-.mjs";import{LUNORA_TAG as Ne,advisoryLine as Re,blockingFindingsMessage as ge,lunoraLine as Te,reportCodegenFindings as Ve}from"./packem_shared/LUNORA_TAG-CiQM3BkI.mjs";import{LUNORA_EVENT_SOURCE as Ie,formatLunoraEvent as ue}from"./packem_shared/LUNORA_EVENT_SOURCE-DYdcDU9G.mjs";import{default as Pe}from"./packem_shared/LunoraReporter-f277GLNT.mjs";import{addArgsFor as Ce,detectInstalledManagers as Ue,detectPackageManager as Ge,execArgsFor as be,installArgsFor as Me,runScriptArgsFor as ye,runScriptCommand as ke,toolchainExecArgs as Be}from"./packem_shared/addArgsFor-CYZKhNIo.mjs";import{P as we,s as he}from"./packem_shared/package-secrets-registry-DvtTiK4b.mjs";import{runPostCodegenHook as He}from"./packem_shared/runPostCodegenHook-B0T1q2YI.mjs";import{interpretRemote as Ye,readProjectRemotePreference as Je,readProjectTarget as qe,resolveProjectTarget as Xe,resolveTargetOrThrow as ze}from"./packem_shared/interpretRemote-Da32GcUi.mjs";import{createConfirm as Ze,isInteractive as $e,promptMultiSelect as er,promptSelect as rr,promptText as or,promptYesNo as tr}from"./packem_shared/createConfirm-D5mKTMHj.mjs";import{buildPackageSecretsBlock as Er,ensureDevVariables as ir,ensureDevVarsExample as sr,fillDevSecrets as nr,generateSecretValue as lr,isMintableSecretKey as _r,isPlaceholderValue as pr,planDevSecretsFill as cr,planDevVariablesAugment as dr,planDevVariablesScaffold as Ar,requiredSecrets as Dr,writeDevVariablesFileAtomically as mr}from"./packem_shared/buildPackageSecretsBlock-yv9mjKEW.mjs";import{applyAdditiveEdit as fr,classifyEdit as Lr}from"./packem_shared/applyAdditiveEdit-CH0VhMJ2.mjs";import{parseSchema as Nr}from"./packem_shared/parseSchema-D1Wbr1qv.mjs";import{classifyPolicyEdit as gr,resolveServerModule as Tr,scaffoldPolicyFile as Vr,wireRlsIntoProcedure as xr}from"./packem_shared/classifyPolicyEdit-D8NwrHxR.mjs";import{discoverSchemaInfo as ur}from"./packem_shared/discoverSchemaInfo-DJvevsCm.mjs";import{ACCENT as Pr,BADGES as Fr,BADGE_COLUMN_WIDTH as Cr,LUNA_ART as Ur,LUNA_BUNNY as Gr,LUNA_NAME as br,LUNA_SIGNOFF as Mr,STEP_BADGE_NAMES as yr,badgeLead as kr,badgeWidth as Br,padBadge as Kr,paintAnswer as wr,paintBadge as hr}from"./packem_shared/ACCENT-CotPTfv7.mjs";import{COMPOSED_WORKER_ENTRY as Hr,GENERATED_CLASS_MODULES as Wr}from"./packem_shared/COMPOSED_WORKER_ENTRY-5R-BECOC.mjs";import{discoverWorkflowInfo as Jr}from"./packem_shared/discoverWorkflowInfo-BsPvlo6O.mjs";export{Pr as ACCENT,o as AGENT_MODE_ENV,s as AGENT_RULES_DIR,n as AGENT_RULES_HINT,l as AGENT_RULES_HINT_ENV,Fr as BADGES,Cr as BADGE_COLUMN_WIDTH,D as CODEGEN_ENV,Hr as COMPOSED_WORKER_ENTRY,re as DEFAULT_DEPLOY_TARGET,x as DEV_BINDINGS_FILE,I as DEV_DAEMON_ENV,u as DEV_HANDOFF_ENV,O as DEV_LOG_FILE,P as DEV_LOG_FILE_ENV,F as DEV_STATE_DIR,C as DEV_STATE_FILE,j as DEV_VARS_EXAMPLE_FILE,H as DEV_VARS_FILE,W as DEV_VARS_KEY_PATTERN,Q as DEV_WORKER_ENV_VALUE,Z as DEV_WORKER_ENV_VAR,Wr as GENERATED_CLASS_MODULES,ce as LINKED_PROJECT_DIR,de as LINKED_PROJECT_FILE,Ur as LUNA_ART,Gr as LUNA_BUNNY,br as LUNA_NAME,Mr as LUNA_SIGNOFF,Ie as LUNORA_EVENT_SOURCE,Se as LUNORA_IGNORED_PATHS,_ as LUNORA_SKILL_NAMES,Ne as LUNORA_TAG,Pe as LunoraReporter,we as PACKAGE_SECRETS_REGISTRY,p as ROOT_SKILL_NAME,yr as STEP_BADGE_NAMES,Ce as addArgsFor,Re as advisoryLine,fr as applyAdditiveEdit,fe as applyLintIgnores,kr as badgeLead,Br as badgeWidth,ge as blockingFindingsMessage,Er as buildPackageSecretsBlock,c as claimAgentRulesHint,U as claimDevServerState,Lr as classifyEdit,gr as classifyPolicyEdit,G as clearDevServerState,Ze as createConfirm,oe as deployTargetIds,d as detectAgentRules,t as detectAiAgent,R as detectFramework,Ue as detectInstalledManagers,Le as detectLintTools,Ge as detectPackageManager,E as discoverAgentInfo,f as discoverContainerInfo,ur as discoverSchemaInfo,Jr as discoverWorkflowInfo,ir as ensureDevVariables,sr as ensureDevVarsExample,$ as ensureDevWorkerEnv,Y as escapeRegExp,be as execArgsFor,nr as fillDevSecrets,ue as formatLunoraEvent,lr as generateSecretValue,le as inferLunoraBindings,Me as installArgsFor,Ye as interpretRemote,m as isCodegenDisabled,b as isDevServerReady,$e as isInteractive,_r as isMintableSecretKey,pr as isPlaceholderValue,M as isProcessAlive,y as isRecordedProcessCurrent,te as isRunnableTarget,Te as lunoraLine,_e as packageNamesFromBindings,Kr as padBadge,wr as paintAnswer,hr as paintBadge,J as parseDevVariableEntries,Nr as parseSchema,cr as planDevSecretsFill,dr as planDevVariablesAugment,Ar as planDevVariablesScaffold,ae as planToolchainInvocation,g as projectUsesUmbrella,er as promptMultiSelect,rr as promptSelect,or as promptText,tr as promptYesNo,k as readDevServerState,Ae as readLinkedProject,B as readLiveDevServerState,T as readProjectDependencyNames,Je as readProjectRemotePreference,qe as readProjectTarget,q as removeDevVariableLine,Ve as reportCodegenFindings,Dr as requiredSecrets,Ee as resolveDeployDriver,Xe as resolveProjectTarget,Tr as resolveServerModule,ze as resolveTargetOrThrow,He as runPostCodegenHook,ye as runScriptArgsFor,ke as runScriptCommand,ie as runnableTargetIds,Vr as scaffoldPolicyFile,he as secretsForPackages,v as streamContainerLogs,se as targetRunsOwnDevServer,Be as toolchainExecArgs,K as updateDevServerState,X as upsertDevVariableLine,xr as wireRlsIntoProcedure,w as writeDevServerState,mr as writeDevVariablesFileAtomically,De as writeLinkedProject};
1
+ import{AGENT_MODE_ENV as o,detectAiAgent as t}from"./packem_shared/AGENT_MODE_ENV-D8MvSwPE.mjs";import{discoverAgentInfo as E}from"./packem_shared/discoverAgentInfo-CTdCSfYM.mjs";import{AGENT_RULES_DIR as s,AGENT_RULES_HINT as n,AGENT_RULES_HINT_ENV as l,LUNORA_SKILL_NAMES as _,ROOT_SKILL_NAME as p,claimAgentRulesHint as c,detectAgentRules as d}from"./packem_shared/AGENT_RULES_DIR-C54Ta_vz.mjs";import{CODEGEN_ENV as D,isCodegenDisabled as m}from"./packem_shared/CODEGEN_ENV-ZsCxV1kP.mjs";import{discoverContainerInfo as f}from"./packem_shared/discoverContainerInfo-EhZtEBQs.mjs";import{streamContainerLogs as v}from"./packem_shared/streamContainerLogs-0nko1qpv.mjs";import{detectFramework as R,projectUsesUmbrella as g,readProjectDependencyNames as T}from"./packem_shared/detectFramework-CUiVEHDQ.mjs";import{DEV_BINDINGS_FILE as x,DEV_DAEMON_ENV as I,DEV_HANDOFF_ENV as u,DEV_LOG_FILE as O,DEV_LOG_FILE_ENV as P,DEV_STATE_DIR as F,DEV_STATE_FILE as C,claimDevServerState as U,clearDevServerState as G,isDevServerReady as b,isProcessAlive as M,isRecordedProcessCurrent as y,readDevServerState as k,readLiveDevServerState as B,updateDevServerState as K,writeDevServerState as w}from"./packem_shared/DEV_BINDINGS_FILE-pyOiNLP4.mjs";import{DEV_VARS_EXAMPLE_FILE as j,DEV_VARS_FILE as H,DEV_VARS_KEY_PATTERN as W,escapeRegExp as Y,parseDevVariableEntries as J,removeDevVariableLine as q,upsertDevVariableLine as X}from"./packem_shared/DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";import{DEV_WORKER_ENV_VALUE as Q,DEV_WORKER_ENV_VAR as Z,ensureDevWorkerEnv as $}from"./packem_shared/DEV_WORKER_ENV_VALUE-DwGANZVw.mjs";import{DEFAULT_DEPLOY_TARGET as re,deployTargetIds as oe,isRunnableTarget as te,planToolchainInvocation as ae,resolveDeployDriver as Ee,runnableTargetIds as ie,targetRunsOwnDevServer as se}from"./packem_shared/DEFAULT_DEPLOY_TARGET-CtEZtsUF.mjs";import{inferLunoraBindings as le,packageNamesFromBindings as _e}from"./packem_shared/inferLunoraBindings-DTiYSVS2.mjs";import{LINKED_PROJECT_DIR as ce,LINKED_PROJECT_FILE as de,readLinkedProject as Ae,writeLinkedProject as De}from"./packem_shared/LINKED_PROJECT_DIR-Ba5qPEwo.mjs";import{LUNORA_IGNORED_PATHS as Se,applyLintIgnores as fe,detectLintTools as Le}from"./packem_shared/LUNORA_IGNORED_PATHS-B0-PPvRp.mjs";import{LUNORA_TAG as Ne,advisoryLine as Re,blockingFindingsMessage as ge,lunoraLine as Te,reportCodegenFindings as Ve}from"./packem_shared/LUNORA_TAG-CiQM3BkI.mjs";import{LUNORA_EVENT_SOURCE as Ie,formatLunoraEvent as ue}from"./packem_shared/LUNORA_EVENT_SOURCE-DYdcDU9G.mjs";import{default as Pe}from"./packem_shared/LunoraReporter-f277GLNT.mjs";import{addArgsFor as Ce,detectInstalledManagers as Ue,detectPackageManager as Ge,execArgsFor as be,installArgsFor as Me,runScriptArgsFor as ye,runScriptCommand as ke,toolchainExecArgs as Be}from"./packem_shared/addArgsFor-CYZKhNIo.mjs";import{P as we,s as he}from"./packem_shared/package-secrets-registry-DvtTiK4b.mjs";import{runPostCodegenHook as He}from"./packem_shared/runPostCodegenHook-B0T1q2YI.mjs";import{interpretRemote as Ye,readProjectRemotePreference as Je,readProjectTarget as qe,resolveProjectTarget as Xe,resolveTargetOrThrow as ze}from"./packem_shared/interpretRemote-Da32GcUi.mjs";import{createConfirm as Ze,isInteractive as $e,promptMultiSelect as er,promptSelect as rr,promptText as or,promptYesNo as tr}from"./packem_shared/createConfirm-D5mKTMHj.mjs";import{buildPackageSecretsBlock as Er,ensureDevVariables as ir,ensureDevVarsExample as sr,fillDevSecrets as nr,generateSecretValue as lr,isMintableSecretKey as _r,isPlaceholderValue as pr,planDevSecretsFill as cr,planDevVariablesAugment as dr,planDevVariablesScaffold as Ar,requiredSecrets as Dr,writeDevVariablesFileAtomically as mr}from"./packem_shared/buildPackageSecretsBlock-yv9mjKEW.mjs";import{applyAdditiveEdit as fr,classifyEdit as Lr}from"./packem_shared/applyAdditiveEdit-CH0VhMJ2.mjs";import{parseSchema as Nr}from"./packem_shared/parseSchema-D1Wbr1qv.mjs";import{classifyPolicyEdit as gr,resolveServerModule as Tr,scaffoldPolicyFile as Vr,wireRlsIntoProcedure as xr}from"./packem_shared/classifyPolicyEdit-D8NwrHxR.mjs";import{discoverSchemaInfo as ur}from"./packem_shared/discoverSchemaInfo-DJvevsCm.mjs";import{ACCENT as Pr,BADGES as Fr,BADGE_COLUMN_WIDTH as Cr,LUNA_ART as Ur,LUNA_BUNNY as Gr,LUNA_NAME as br,LUNA_SIGNOFF as Mr,STEP_BADGE_NAMES as yr,badgeLead as kr,badgeWidth as Br,padBadge as Kr,paintAnswer as wr,paintBadge as hr}from"./packem_shared/ACCENT-CotPTfv7.mjs";import{COMPOSED_WORKER_ENTRY as Hr,GENERATED_CLASS_MODULES as Wr}from"./packem_shared/COMPOSED_WORKER_ENTRY-C69wqbSP.mjs";import{discoverWorkflowInfo as Jr}from"./packem_shared/discoverWorkflowInfo-BsPvlo6O.mjs";export{Pr as ACCENT,o as AGENT_MODE_ENV,s as AGENT_RULES_DIR,n as AGENT_RULES_HINT,l as AGENT_RULES_HINT_ENV,Fr as BADGES,Cr as BADGE_COLUMN_WIDTH,D as CODEGEN_ENV,Hr as COMPOSED_WORKER_ENTRY,re as DEFAULT_DEPLOY_TARGET,x as DEV_BINDINGS_FILE,I as DEV_DAEMON_ENV,u as DEV_HANDOFF_ENV,O as DEV_LOG_FILE,P as DEV_LOG_FILE_ENV,F as DEV_STATE_DIR,C as DEV_STATE_FILE,j as DEV_VARS_EXAMPLE_FILE,H as DEV_VARS_FILE,W as DEV_VARS_KEY_PATTERN,Q as DEV_WORKER_ENV_VALUE,Z as DEV_WORKER_ENV_VAR,Wr as GENERATED_CLASS_MODULES,ce as LINKED_PROJECT_DIR,de as LINKED_PROJECT_FILE,Ur as LUNA_ART,Gr as LUNA_BUNNY,br as LUNA_NAME,Mr as LUNA_SIGNOFF,Ie as LUNORA_EVENT_SOURCE,Se as LUNORA_IGNORED_PATHS,_ as LUNORA_SKILL_NAMES,Ne as LUNORA_TAG,Pe as LunoraReporter,we as PACKAGE_SECRETS_REGISTRY,p as ROOT_SKILL_NAME,yr as STEP_BADGE_NAMES,Ce as addArgsFor,Re as advisoryLine,fr as applyAdditiveEdit,fe as applyLintIgnores,kr as badgeLead,Br as badgeWidth,ge as blockingFindingsMessage,Er as buildPackageSecretsBlock,c as claimAgentRulesHint,U as claimDevServerState,Lr as classifyEdit,gr as classifyPolicyEdit,G as clearDevServerState,Ze as createConfirm,oe as deployTargetIds,d as detectAgentRules,t as detectAiAgent,R as detectFramework,Ue as detectInstalledManagers,Le as detectLintTools,Ge as detectPackageManager,E as discoverAgentInfo,f as discoverContainerInfo,ur as discoverSchemaInfo,Jr as discoverWorkflowInfo,ir as ensureDevVariables,sr as ensureDevVarsExample,$ as ensureDevWorkerEnv,Y as escapeRegExp,be as execArgsFor,nr as fillDevSecrets,ue as formatLunoraEvent,lr as generateSecretValue,le as inferLunoraBindings,Me as installArgsFor,Ye as interpretRemote,m as isCodegenDisabled,b as isDevServerReady,$e as isInteractive,_r as isMintableSecretKey,pr as isPlaceholderValue,M as isProcessAlive,y as isRecordedProcessCurrent,te as isRunnableTarget,Te as lunoraLine,_e as packageNamesFromBindings,Kr as padBadge,wr as paintAnswer,hr as paintBadge,J as parseDevVariableEntries,Nr as parseSchema,cr as planDevSecretsFill,dr as planDevVariablesAugment,Ar as planDevVariablesScaffold,ae as planToolchainInvocation,g as projectUsesUmbrella,er as promptMultiSelect,rr as promptSelect,or as promptText,tr as promptYesNo,k as readDevServerState,Ae as readLinkedProject,B as readLiveDevServerState,T as readProjectDependencyNames,Je as readProjectRemotePreference,qe as readProjectTarget,q as removeDevVariableLine,Ve as reportCodegenFindings,Dr as requiredSecrets,Ee as resolveDeployDriver,Xe as resolveProjectTarget,Tr as resolveServerModule,ze as resolveTargetOrThrow,He as runPostCodegenHook,ye as runScriptArgsFor,ke as runScriptCommand,ie as runnableTargetIds,Vr as scaffoldPolicyFile,he as secretsForPackages,v as streamContainerLogs,se as targetRunsOwnDevServer,Be as toolchainExecArgs,K as updateDevServerState,X as upsertDevVariableLine,xr as wireRlsIntoProcedure,w as writeDevServerState,mr as writeDevVariablesFileAtomically,De as writeLinkedProject};
@@ -0,0 +1 @@
1
+ import{readFileSync as i,existsSync as E}from"node:fs";import{parse as u}from"es-module-lexer";import{WRANGLER_FILES as m,readWranglerJsonc as f}from"./WRANGLER_FILES-UNW-xY5u.mjs";import{escapeRegExp as R}from"./DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";import{join as p}from"node:path";const x="_generated",_=["src/server.ts","src/server/index.ts","src/server/index.tsx","src/index.ts","src/worker.ts"],g=new Set(["build","coverage","dist",x,"node_modules","out","target"]),h=new Set([".client",".server"]),D=/[/\\]/u,b=t=>{const e=[];for(const r of t.split(D))r===""||r==="."||(r===".."&&e.length>0&&e.at(-1)!==".."?e.pop():e.push(r));return e},w=t=>b(t).slice(0,-1).some(e=>g.has(e)||e.startsWith(".")&&!h.has(e)),l={SchedulerDO:"SCHEDULER",SessionDO:"SESSION",ShardDO:"SHARD",ShardRegistryDO:"SHARD_REGISTRY"},S=Object.keys(l),k=t=>Object.hasOwn(l,t),T="virtual:lunora/worker",B=["ShardDO"],v=["agents","containers","scheduler","shardRegistry","workflows"],P={scheduler:"SchedulerDO",shardRegistry:"ShardRegistryDO"},A="src/worker.ts",G=t=>{for(const e of m){const r=p(t,e);if(!E(r))continue;const{parsed:s}=f(r),o=s?.main;if(o===T)return{composed:!0};const a=p(t,A);if(E(a))return{composed:!1,path:a};if(typeof o=="string"&&!w(o)&&E(p(t,o)))return{composed:!1,path:p(t,o)};break}for(const e of _){const r=p(t,e);if(E(r))return{composed:!1,path:r}}return{composed:!1}},L=/(?:^|[\s,{])type$/u,d=(t,e)=>{const r=e.ls>=0?e.ls:e.s;return L.test(t.slice(0,r).trimEnd())},O=(t,e)=>{const r=R(e);return new RegExp(String.raw`\bexport\s+type\s+${r}\b`,"u").test(t)||new RegExp(String.raw`\bexport\s+type\s*\{[^}]*\b${r}\b`,"u").test(t)||new RegExp(String.raw`\bexport\s+\{[^}]*\btype\s+${r}\b`,"u").test(t)},W=t=>{const e=i(t,"utf8");let r;try{const[,s]=u(e);r=new Set(s.filter(o=>!d(e,o)).map(o=>o.n))}catch{r=new Set(S.filter(s=>new RegExp(String.raw`\bexport\b[^\n;]*\b${s}\b`,"u").test(e)&&!O(e,s)))}return S.filter(s=>r.has(s)).map(s=>({binding:l[s],className:s}))},$=(t,e,r)=>{if(e.length===0)return[];if(t.composed)return e.map(n=>({...n,exported:!0}));if(t.path===void 0)return e.map(n=>({...n,exported:!1}));const s=i(t.path,"utf8"),o=new RegExp(String.raw`\bexport\s*\*\s*from\s*["'][^"']*_generated\/${r}(?:\.js)?["']`).test(s);let a;try{const[,n]=u(s);a=new Set(n.filter(c=>!d(s,c)).map(c=>c.n))}catch{a=new Set(e.map(n=>n.className).filter(n=>new RegExp(String.raw`\bexport\b[^\n;]*\b${R(n)}\b`,"u").test(s)&&!O(s,n)))}return e.map(n=>{const c=o||a.has(n.className);return{...n,exported:c}})};export{B as COMPOSED_ENTRY_DURABLE_OBJECTS,A as COMPOSED_WORKER_ENTRY,l as DURABLE_OBJECT_BINDINGS,v as GENERATED_CLASS_MODULES,x as GENERATED_DIRECTORY,P as GENERATED_MODULE_DURABLE_OBJECTS,T as LUNORA_WORKER_VIRTUAL_ID,g as NON_SOURCE_DIRECTORIES,h as SOURCE_DOT_DIRECTORIES,_ as WORKER_ENTRY_FALLBACKS,$ as detectClassExports,W as detectExportedDurableObjects,k as isFrameworkDurableObject,w as isGeneratedOutput,G as resolveWorkerEntry};
@@ -1,4 +1,4 @@
1
- import{existsSync as g,readFileSync as m,writeFileSync as d}from"node:fs";import{join as l,dirname as x}from"node:path";import{parse as v}from"jsonc-parser";import{readProjectDependencyNames as F}from"./detectFramework-CUiVEHDQ.mjs";import{a as $}from"./jsonc-edit-BZgQIdAH.mjs";const c=["lunora/_generated/","lunora/.lunora-schema.json","lunora.advisor.map.json",".lunora/",".wrangler/"],f={biome:{configFiles:["biome.json","biome.jsonc"],packages:["@biomejs/biome"],shadowable:!0},eslint:{configFiles:["eslint.config.js","eslint.config.mjs","eslint.config.cjs","eslint.config.ts","eslint.config.mts","eslint.config.cts"],packages:["eslint"],shadowable:!0},oxlint:{configFiles:[".oxlintrc.json"],packages:["oxlint"],shadowable:!0},prettier:{configFiles:[".prettierrc",".prettierrc.json",".prettierrc.js",".prettierrc.mjs",".prettierrc.cjs","prettier.config.js","prettier.config.mjs","prettier.config.cjs"],packages:["prettier"],shadowable:!1}},k=Object.keys(f),y=(e,n)=>f[n].configFiles.map(t=>l(e,t)).find(t=>g(t)),w=(e,n)=>{let t=e;for(;;){const s=y(t,n);if(s!==void 0)return s;if(g(l(t,".git")))return;const i=x(t);if(i===t)return;t=i}},j=(e,n)=>{const t=y(e,n);if(t!==void 0)return{action:"extend",path:t};const s=g(l(e,".git")),i=f[n].shadowable&&!s?w(x(e),n):void 0,[a=""]=f[n].configFiles;return i===void 0?{action:"create",path:l(e,a)}:{action:"report",path:i}},J=e=>{const n=F(e),t=()=>{try{return JSON.parse(m(l(e,"package.json"),"utf8")).prettier!==void 0}catch{return!1}};return k.filter(s=>f[s].packages.some(i=>n.has(i))||y(e,s)!==void 0||s==="prettier"&&t())},L="# Lunora generated + derived artifacts",O=e=>{const n=l(e,".prettierignore"),t=g(n)?m(n,"utf8"):void 0,s=t===void 0?[]:t.split(`
1
+ import{existsSync as g,readFileSync as m,writeFileSync as d}from"node:fs";import{join as l,dirname as x}from"node:path";import{parse as v}from"jsonc-parser";import{readProjectDependencyNames as F}from"./detectFramework-CUiVEHDQ.mjs";import{applyModify as $}from"./applyModify-DKP2l6S9.mjs";const c=["lunora/_generated/","lunora/.lunora-schema.json","lunora.advisor.map.json",".lunora/",".wrangler/"],f={biome:{configFiles:["biome.json","biome.jsonc"],packages:["@biomejs/biome"],shadowable:!0},eslint:{configFiles:["eslint.config.js","eslint.config.mjs","eslint.config.cjs","eslint.config.ts","eslint.config.mts","eslint.config.cts"],packages:["eslint"],shadowable:!0},oxlint:{configFiles:[".oxlintrc.json"],packages:["oxlint"],shadowable:!0},prettier:{configFiles:[".prettierrc",".prettierrc.json",".prettierrc.js",".prettierrc.mjs",".prettierrc.cjs","prettier.config.js","prettier.config.mjs","prettier.config.cjs"],packages:["prettier"],shadowable:!1}},k=Object.keys(f),y=(e,n)=>f[n].configFiles.map(t=>l(e,t)).find(t=>g(t)),w=(e,n)=>{let t=e;for(;;){const s=y(t,n);if(s!==void 0)return s;if(g(l(t,".git")))return;const i=x(t);if(i===t)return;t=i}},j=(e,n)=>{const t=y(e,n);if(t!==void 0)return{action:"extend",path:t};const s=g(l(e,".git")),i=f[n].shadowable&&!s?w(x(e),n):void 0,[a=""]=f[n].configFiles;return i===void 0?{action:"create",path:l(e,a)}:{action:"report",path:i}},J=e=>{const n=F(e),t=()=>{try{return JSON.parse(m(l(e,"package.json"),"utf8")).prettier!==void 0}catch{return!1}};return k.filter(s=>f[s].packages.some(i=>n.has(i))||y(e,s)!==void 0||s==="prettier"&&t())},L="# Lunora generated + derived artifacts",O=e=>{const n=l(e,".prettierignore"),t=g(n)?m(n,"utf8"):void 0,s=t===void 0?[]:t.split(`
2
2
  `).map(o=>o.trim()),i=c.filter(o=>!s.includes(o));if(i.length===0)return{path:n,status:t===void 0?"created":"unchanged",tool:"prettier"};const a=`${L}
3
3
  ${i.join(`
4
4
  `)}
@@ -0,0 +1 @@
1
+ import{writeFileSync as d,rmSync as f}from"node:fs";import{applyModify as g}from"./applyModify-DKP2l6S9.mjs";import{findWranglerFile as m,readWranglerJsonc as b}from"./WRANGLER_FILES-UNW-xY5u.mjs";import{join as y}from"node:path";const u={ai:{label:"AI",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"}},h=Object.keys(u),p=(e,r)=>typeof e.binding=="string"?e.binding:r,l=(e,r,n,a)=>{const t=[];for(const[o,s]of r.entries())s!=null&&t.push({binding:p(s,`#${String(o)}`),kind:n,path:[...a,o],section:e});return t},E=(e,r)=>{const{label:n,shape:a}=u[e];if(a==="array"){const o=r[e]??[];return l(e,o,n,[])}if(a==="producers")return l(e,r.queues?.producers??[],n,["producers"]);const t=r.ai;return t==null?[]:[{binding:p(t,e),kind:n,path:[],section:e}]},v=e=>h.flatMap(r=>E(r,e)),R=(e,r)=>{let n=e;for(const a of r)n=g(n,[a.section,...a.path,"remote"],!0);return n},i=()=>{},S=e=>{let r=!1;return()=>{if(!r){r=!0;try{f(e,{force:!0,recursive:!0})}catch{}}}};let c=0;const B=()=>(c+=1,`.wrangler.lunora-remote.${String(process.pid)}.${String(c)}.jsonc`),w=e=>{if(!e.enabled)return{cleanup:i,enabled:!1,remoteBindings:[]};const r=m(e.projectRoot);if(!r)return{cleanup:i,enabled:!0,reason:"wrangler.jsonc not found",remoteBindings:[]};const{parsed:n,text:a}=b(r);if(n===void 0)return{cleanup:i,enabled:!0,reason:`failed to parse ${r} as JSONC`,remoteBindings:[]};const t=v(n);if(t.length===0)return{cleanup:i,enabled:!0,reason:"no remote-eligible bindings to proxy",remoteBindings:[]};const o=y(e.projectRoot,B());return d(o,R(a,t),"utf8"),{cleanup:S(o),configPath:o,enabled:!0,remoteBindings:t}},j=e=>{if(e===void 0)return!1;const r=e.trim().toLowerCase();return r==="1"||r==="true"},x=e=>e.flag===!0||j(e.envValue)?!0:e.configPreference??!1;export{u as REMOTE_ELIGIBLE_KEYS,R as injectRemoteFlags,j as isRemoteEnvEnabled,w as materializeRemoteWranglerConfig,v as planRemoteBindings,x as resolveRemoteEnabled};
@@ -1 +1 @@
1
- import{existsSync as f,readFileSync as O,readdirSync as W}from"node:fs";import{join as p,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-5R-BECOC.mjs";import{o as K}from"./validate-bindings-D6-vb6if.mjs";import{Project as X,Node as l}from"ts-morph";import{mergeWranglerEnvironment as J}from"./mergeWranglerEnvironment-BIcLqPfv.mjs";import{findWranglerFile as V,readWranglerJsonc as q}from"./WRANGLER_FILES-UNW-xY5u.mjs";import{validateWranglerConfig as z}from"./REQUIRED_COMPATIBILITY_DATE-g_1F-n2X.mjs";const E=[".ts",".tsx",".mts",".cts"],b=new Set(E),H=new Set([".cjs",".js",".mjs"]),v="default",x={".cjs":[".cts"],".js":[".ts",".tsx"],".mjs":[".mts"]},Q=250,Z=(e,s,t)=>{const r=p(s,L);if(f(r))return{origin:"declared",path:r};if(e===g)return{origin:"composed"};const n=()=>{const i=M.map(a=>p(s,a)).find(a=>f(a));return i===void 0?void 0:{origin:"probed",path:i}};if(typeof e!="string"||e.length===0||F(e))return n();const o=p(y(t),e),c=w(o);if(!(!b.has(c)&&!H.has(c)))return f(o)?{origin:"declared",path:o}:{origin:"absent",path:o}},T=(e,s)=>{if(l.isIdentifier(e)){s.add(e.getText());return}if(l.isObjectBindingPattern(e)||l.isArrayBindingPattern(e))for(const t of e.getElements())l.isBindingElement(t)&&T(t.getNameNode(),s)},ee=(e,s)=>{const t=[];for(const r of e.getExportDeclarations())if(!r.isTypeOnly()){if(r.isNamespaceExport()){const n=r.getNamespaceExport();n===void 0?t.push(r.getModuleSpecifierValue()??""):s.add(n.getName());continue}for(const n of r.getNamedExports())n.isTypeOnly()||s.add(n.getAliasNode()?.getText()??n.getName())}return t},te=(e,s)=>{for(const t of e.getVariableStatements().filter(r=>r.getExportKeyword()!==void 0))for(const r of t.getDeclarations())T(r.getNameNode(),s);for(const t of[...e.getClasses(),...e.getFunctions(),...e.getEnums()]){if(t.getExportKeyword()===void 0)continue;const r=t.isDefaultExport()?v:t.getName();r!==void 0&&s.add(r)}e.getExportAssignments().length>0&&s.add(v)},$=(e,s)=>{const t=new X({compilerOptions:{allowJs:!0},skipFileDependencyResolution:!0,skipLoadingLibFiles:!0,useInMemoryFileSystem:!0}),r=t.createSourceFile(e,s,{overwrite:!0});return t.getProgram().compilerObject.getSyntacticDiagnostics(r.compilerNode).length>0?void 0:r},re=(e,s)=>{if(!s.startsWith("./")&&!s.startsWith("../"))return;const t=p(y(e),s),r=w(t),n=b.has(r)||x[r]!==void 0,o=n?t.slice(0,-r.length):t;return[...b.has(r)?[t]:[],...(x[r]??[]).map(i=>`${o}${i}`),...n?[]:E.map(i=>`${t}${i}`),...n||r.length===0?E.map(i=>p(o,`index${i}`)):[]].find(i=>f(i))},j=e=>{const s=new Set,t=new Set([e]),r=[e];for(;r.length>0;){if(t.size-1>Q)return;const n=r.pop();let o;try{o=O(n,"utf8")}catch{return}const c=$(_(n),o);if(c===void 0)return;const i=ee(c,s);te(c,s);for(const a of i){const d=re(n,a);if(d===void 0)return;t.has(d)||(t.add(d),r.push(d))}}return s},oe=(e,s)=>{const t={exports:void 0,kind:"composed",path:g},r=p(e,s,U);if(!f(r))return t;const n=new Set(D);for(const o of A){const c=p(r,`${o}.ts`);if(!f(c))continue;const i=j(c);if(i===void 0)return t;for(const a of i)n.add(a)}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 r=j(e.path);if(!(e.origin==="probed"&&r!==void 0&&!r.has(v)))return{exports:r,kind:"authored",path:e.path}},ne=new Set([".cjs",".cts",".js",".jsx",".mjs",".mts",".ts",".tsx"]),ie=2e3,R="defineTable",N="defineApp",ae=e=>{const s=[],t=[];let r;try{r=W(e,{withFileTypes:!0})}catch{return{files:s,subdirectories:t}}for(const n of r)n.isDirectory()?n.name.startsWith(".")&&!B.has(n.name)||G.has(n.name)||t.push(p(e,n.name)):ne.has(w(n.name))&&s.push(p(e,n.name));return{files:s,subdirectories:t}},k=(e,s)=>{const t=new Set;for(const r of e.getImportDeclarations())for(const n of r.getNamedImports())!n.isTypeOnly()&&n.getName()===s&&t.add(n.getAliasNode()?.getText()??n.getName());return t},ce=(e,s)=>{let t=!1;return e.forEachDescendant((r,n)=>{if(!l.isCallExpression(r))return;const o=r.getExpression();l.isIdentifier(o)&&s.has(o.getText())&&(t=!0,n.stop())}),t},de=e=>{let s=e;for(;l.isCallExpression(s)||l.isPropertyAccessExpression(s);)s=s.getExpression();return s},le=(e,s)=>{const t=de(e);return l.isIdentifier(t)&&s.has(t.getText())},C={global:/\.\s*global\s*\(/u,hyperdriveGlobal:/\.\s*hyperdriveGlobal\s*\(/u,vectors:/\.\s*vectors\s*\(/u},pe=e=>Object.hasOwn(C,e),fe=(e,s)=>{const t=new Set,r=new Set([R,...k(e,R)]);return e.forEachDescendant(n=>{if(!l.isCallExpression(n))return;const o=n.getExpression();if(!l.isPropertyAccessExpression(o)||le(o,r))return;const c=o.getName();pe(c)&&s.has(c)&&t.add(c)}),t},he=(e,s)=>{let t;try{t=O(e,"utf8")}catch{return}const r=new Set([...s].filter(o=>C[o].test(t)));if(r.size===0&&!t.includes(N))return;const n=$(_(e),t);return n===void 0?{chained:r,composes:!1}:{chained:fe(n,r),composes:ce(n,k(n,N))}},ue=(e,s)=>{const t=[e],r=new Set;let n=0,o;const c=i=>{if(n+=1,n>ie)return!1;const a=he(i,s);for(const d of a?.chained??[])r.add(d);return a?.composes&&(o??=i),!0};for(;t.length>0;){const i=t.pop(),{files:a,subdirectories:d}=ae(i);t.push(...d);for(const m of a){if(!c(m))return;if(o!==void 0&&r.size===s.size)return{chained:r,site:o}}}return o===void 0?void 0:{chained:r,site:o}},I=e=>Array.isArray(e)?e:[],me=(e,s,t)=>{const r=[];for(const n of I(e)){const o=n?.image;typeof o!="string"||!(o.startsWith("./")||o.startsWith("../")||o.startsWith("/")||o.includes("Dockerfile"))||f(o.startsWith("/")?o:p(s,o))||r.push(`containers image "${o}" does not exist (resolved relative to ${t}); create the Dockerfile or point image at a registry reference`)}return r},ge=(e,s)=>{const t=e?.vectorIndexNames??[],r=[];if(t.length>0&&r.push({message:o=>`schema declares vector index(es) ${t.map(c=>`"${c}"`).join(", ")} but nothing chains .vectors(...) onto defineApp() (composed in: ${o}) — \`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&&r.push({message:o=>`schema declares .global() table(s) but nothing chains .global(...) onto defineApp() (composed in: ${o}) — 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&&r.push({message:o=>`schema declares .global({ backend: "hyperdrive" }) table(s) but nothing chains .hyperdriveGlobal(...) onto defineApp() (composed in: ${o}) — 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"}),r.length===0)return[];const n=ue(s,new Set(r.map(o=>o.method)));return n===void 0?[]:r.filter(o=>!n.chained.has(o.method)).map(o=>o.message(n.site))},Ee="does not export it",be=(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(r=>`${r}.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.`},ve=(e,s)=>{const t=s.exports;if(t===void 0)return[];const r=[];for(const o of K(e.durable_objects?.bindings))typeof o.class_name=="string"&&o.class_name.length>0&&o.script_name===void 0&&r.push({className:o.class_name,label:"durable_objects.bindings"});for(const o of I(e.workflows))typeof o?.class_name=="string"&&o.class_name.length>0&&o.script_name===void 0&&r.push({className:o.class_name,label:"workflows"});return r.filter(o=>!t.has(o.className)).map(o=>`${o.label} declares class "${o.className}" but the ${s.kind==="composed"?"composed class-A worker entry":"worker entry"} (${s.path}) ${Ee} — wrangler refuses to bundle a Worker whose ${o.label==="workflows"?"Workflow":"Durable Object"} classes are not exported. ${be(o.className,s.kind)}`)},ye=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.`],Te=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:r}=q(t);if(r===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:o}=J(r,e.environment);if(n!==void 0)return{problems:[n],report:{errors:[n],valid:!1,warnings:[]},wranglerPath:t};const{error:c,info:i}=P(e.projectRoot,s),a=z(r,i,e.environment);c!==void 0&&a.warnings.push(`schema parse failed in ${s}/schema.ts: ${c}`);const d=y(t),m=Z(o.main,e.projectRoot,t),S=se(m,e.projectRoot,s);a.errors.push(...me(o.containers??[],d,t)),a.warnings.push(...ye(m)),S!==void 0&&a.errors.push(...ve(o,S)),a.errors.push(...ge(i,e.projectRoot));const u=o.assets?.directory;if(typeof u=="string"&&u.length>0){const h=u.startsWith("/")?u:p(d,u);f(h)||a.warnings.push(`assets.directory "${u}" does not exist yet — it is created by the client build; run the build before deploy`)}return a.valid=a.errors.length===0,{problems:a.errors,report:a,wranglerPath:t}};export{Ee as UNEXPORTED_CLASS_MARKER,Te as validateWranglerProject};
1
+ import{existsSync as f,readFileSync as O,readdirSync as W}from"node:fs";import{join as p,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-D6-vb6if.mjs";import{Project as X,Node as l}from"ts-morph";import{mergeWranglerEnvironment as J}from"./mergeWranglerEnvironment-BIcLqPfv.mjs";import{findWranglerFile as V,readWranglerJsonc as q}from"./WRANGLER_FILES-UNW-xY5u.mjs";import{validateWranglerConfig as z}from"./REQUIRED_COMPATIBILITY_DATE-g_1F-n2X.mjs";const E=[".ts",".tsx",".mts",".cts"],b=new Set(E),H=new Set([".cjs",".js",".mjs"]),v="default",x={".cjs":[".cts"],".js":[".ts",".tsx"],".mjs":[".mts"]},Q=250,Z=(e,s,t)=>{const r=p(s,L);if(f(r))return{origin:"declared",path:r};if(e===g)return{origin:"composed"};const n=()=>{const i=M.map(a=>p(s,a)).find(a=>f(a));return i===void 0?void 0:{origin:"probed",path:i}};if(typeof e!="string"||e.length===0||F(e))return n();const o=p(y(t),e),c=w(o);if(!(!b.has(c)&&!H.has(c)))return f(o)?{origin:"declared",path:o}:{origin:"absent",path:o}},T=(e,s)=>{if(l.isIdentifier(e)){s.add(e.getText());return}if(l.isObjectBindingPattern(e)||l.isArrayBindingPattern(e))for(const t of e.getElements())l.isBindingElement(t)&&T(t.getNameNode(),s)},ee=(e,s)=>{const t=[];for(const r of e.getExportDeclarations())if(!r.isTypeOnly()){if(r.isNamespaceExport()){const n=r.getNamespaceExport();n===void 0?t.push(r.getModuleSpecifierValue()??""):s.add(n.getName());continue}for(const n of r.getNamedExports())n.isTypeOnly()||s.add(n.getAliasNode()?.getText()??n.getName())}return t},te=(e,s)=>{for(const t of e.getVariableStatements().filter(r=>r.getExportKeyword()!==void 0))for(const r of t.getDeclarations())T(r.getNameNode(),s);for(const t of[...e.getClasses(),...e.getFunctions(),...e.getEnums()]){if(t.getExportKeyword()===void 0)continue;const r=t.isDefaultExport()?v:t.getName();r!==void 0&&s.add(r)}e.getExportAssignments().length>0&&s.add(v)},$=(e,s)=>{const t=new X({compilerOptions:{allowJs:!0},skipFileDependencyResolution:!0,skipLoadingLibFiles:!0,useInMemoryFileSystem:!0}),r=t.createSourceFile(e,s,{overwrite:!0});return t.getProgram().compilerObject.getSyntacticDiagnostics(r.compilerNode).length>0?void 0:r},re=(e,s)=>{if(!s.startsWith("./")&&!s.startsWith("../"))return;const t=p(y(e),s),r=w(t),n=b.has(r)||x[r]!==void 0,o=n?t.slice(0,-r.length):t;return[...b.has(r)?[t]:[],...(x[r]??[]).map(i=>`${o}${i}`),...n?[]:E.map(i=>`${t}${i}`),...n||r.length===0?E.map(i=>p(o,`index${i}`)):[]].find(i=>f(i))},j=e=>{const s=new Set,t=new Set([e]),r=[e];for(;r.length>0;){if(t.size-1>Q)return;const n=r.pop();let o;try{o=O(n,"utf8")}catch{return}const c=$(_(n),o);if(c===void 0)return;const i=ee(c,s);te(c,s);for(const a of i){const d=re(n,a);if(d===void 0)return;t.has(d)||(t.add(d),r.push(d))}}return s},oe=(e,s)=>{const t={exports:void 0,kind:"composed",path:g},r=p(e,s,U);if(!f(r))return t;const n=new Set(D);for(const o of A){const c=p(r,`${o}.ts`);if(!f(c))continue;const i=j(c);if(i===void 0)return t;for(const a of i)n.add(a)}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 r=j(e.path);if(!(e.origin==="probed"&&r!==void 0&&!r.has(v)))return{exports:r,kind:"authored",path:e.path}},ne=new Set([".cjs",".cts",".js",".jsx",".mjs",".mts",".ts",".tsx"]),ie=2e3,R="defineTable",N="defineApp",ae=e=>{const s=[],t=[];let r;try{r=W(e,{withFileTypes:!0})}catch{return{files:s,subdirectories:t}}for(const n of r)n.isDirectory()?n.name.startsWith(".")&&!B.has(n.name)||G.has(n.name)||t.push(p(e,n.name)):ne.has(w(n.name))&&s.push(p(e,n.name));return{files:s,subdirectories:t}},k=(e,s)=>{const t=new Set;for(const r of e.getImportDeclarations())for(const n of r.getNamedImports())!n.isTypeOnly()&&n.getName()===s&&t.add(n.getAliasNode()?.getText()??n.getName());return t},ce=(e,s)=>{let t=!1;return e.forEachDescendant((r,n)=>{if(!l.isCallExpression(r))return;const o=r.getExpression();l.isIdentifier(o)&&s.has(o.getText())&&(t=!0,n.stop())}),t},de=e=>{let s=e;for(;l.isCallExpression(s)||l.isPropertyAccessExpression(s);)s=s.getExpression();return s},le=(e,s)=>{const t=de(e);return l.isIdentifier(t)&&s.has(t.getText())},C={global:/\.\s*global\s*\(/u,hyperdriveGlobal:/\.\s*hyperdriveGlobal\s*\(/u,vectors:/\.\s*vectors\s*\(/u},pe=e=>Object.hasOwn(C,e),fe=(e,s)=>{const t=new Set,r=new Set([R,...k(e,R)]);return e.forEachDescendant(n=>{if(!l.isCallExpression(n))return;const o=n.getExpression();if(!l.isPropertyAccessExpression(o)||le(o,r))return;const c=o.getName();pe(c)&&s.has(c)&&t.add(c)}),t},he=(e,s)=>{let t;try{t=O(e,"utf8")}catch{return}const r=new Set([...s].filter(o=>C[o].test(t)));if(r.size===0&&!t.includes(N))return;const n=$(_(e),t);return n===void 0?{chained:r,composes:!1}:{chained:fe(n,r),composes:ce(n,k(n,N))}},ue=(e,s)=>{const t=[e],r=new Set;let n=0,o;const c=i=>{if(n+=1,n>ie)return!1;const a=he(i,s);for(const d of a?.chained??[])r.add(d);return a?.composes&&(o??=i),!0};for(;t.length>0;){const i=t.pop(),{files:a,subdirectories:d}=ae(i);t.push(...d);for(const m of a){if(!c(m))return;if(o!==void 0&&r.size===s.size)return{chained:r,site:o}}}return o===void 0?void 0:{chained:r,site:o}},I=e=>Array.isArray(e)?e:[],me=(e,s,t)=>{const r=[];for(const n of I(e)){const o=n?.image;typeof o!="string"||!(o.startsWith("./")||o.startsWith("../")||o.startsWith("/")||o.includes("Dockerfile"))||f(o.startsWith("/")?o:p(s,o))||r.push(`containers image "${o}" does not exist (resolved relative to ${t}); create the Dockerfile or point image at a registry reference`)}return r},ge=(e,s)=>{const t=e?.vectorIndexNames??[],r=[];if(t.length>0&&r.push({message:o=>`schema declares vector index(es) ${t.map(c=>`"${c}"`).join(", ")} but nothing chains .vectors(...) onto defineApp() (composed in: ${o}) — \`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&&r.push({message:o=>`schema declares .global() table(s) but nothing chains .global(...) onto defineApp() (composed in: ${o}) — 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&&r.push({message:o=>`schema declares .global({ backend: "hyperdrive" }) table(s) but nothing chains .hyperdriveGlobal(...) onto defineApp() (composed in: ${o}) — 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"}),r.length===0)return[];const n=ue(s,new Set(r.map(o=>o.method)));return n===void 0?[]:r.filter(o=>!n.chained.has(o.method)).map(o=>o.message(n.site))},Ee="does not export it",be=(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(r=>`${r}.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.`},ve=(e,s)=>{const t=s.exports;if(t===void 0)return[];const r=[];for(const o of K(e.durable_objects?.bindings))typeof o.class_name=="string"&&o.class_name.length>0&&o.script_name===void 0&&r.push({className:o.class_name,label:"durable_objects.bindings"});for(const o of I(e.workflows))typeof o?.class_name=="string"&&o.class_name.length>0&&o.script_name===void 0&&r.push({className:o.class_name,label:"workflows"});return r.filter(o=>!t.has(o.className)).map(o=>`${o.label} declares class "${o.className}" but the ${s.kind==="composed"?"composed class-A worker entry":"worker entry"} (${s.path}) ${Ee} — wrangler refuses to bundle a Worker whose ${o.label==="workflows"?"Workflow":"Durable Object"} classes are not exported. ${be(o.className,s.kind)}`)},ye=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.`],Te=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:r}=q(t);if(r===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:o}=J(r,e.environment);if(n!==void 0)return{problems:[n],report:{errors:[n],valid:!1,warnings:[]},wranglerPath:t};const{error:c,info:i}=P(e.projectRoot,s),a=z(r,i,e.environment);c!==void 0&&a.warnings.push(`schema parse failed in ${s}/schema.ts: ${c}`);const d=y(t),m=Z(o.main,e.projectRoot,t),S=se(m,e.projectRoot,s);a.errors.push(...me(o.containers??[],d,t)),a.warnings.push(...ye(m)),S!==void 0&&a.errors.push(...ve(o,S)),a.errors.push(...ge(i,e.projectRoot));const u=o.assets?.directory;if(typeof u=="string"&&u.length>0){const h=u.startsWith("/")?u:p(d,u);f(h)||a.warnings.push(`assets.directory "${u}" does not exist yet — it is created by the client build; run the build before deploy`)}return a.valid=a.errors.length===0,{problems:a.errors,report:a,wranglerPath:t}};export{Ee as UNEXPORTED_CLASS_MARKER,Te as validateWranglerProject};
@@ -0,0 +1 @@
1
+ import{modify as p,applyEdits as r}from"jsonc-parser";const s={formattingOptions:{insertSpaces:!0,tabSize:4}},a=(t,i,n)=>{const o=p(t,[...i],n,s);return o.length>0?r(t,o):t};export{s as FORMATTING,a as applyModify};
@@ -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-Bc302QS4.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-D3aUWNly.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};
@@ -1,2 +1,2 @@
1
- import{readFileSync as R,writeFileSync as T}from"node:fs";import{containerBuildTag as M}from"@lunora/container";import{a as _}from"./jsonc-edit-BZgQIdAH.mjs";import{a as W,r as L}from"./lunora-manifest-V77OcyFC.mjs";import{parseTree as Q,findNodeAtLocation as K}from"jsonc-parser";import{join as U}from"node:path";import{DEV_VARS_FILE as Y,parseDevVariableEntries as F}from"./DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";import{o as q,s as k}from"./validate-bindings-D6-vb6if.mjs";import{findWranglerFile as G,readWranglerJsonc as H}from"./WRANGLER_FILES-UNW-xY5u.mjs";const J=[["maxBatchSize","max_batch_size"],["maxBatchTimeout","max_batch_timeout"],["maxRetries","max_retries"],["deadLetterQueue","dead_letter_queue"],["retryDelay","retry_delay"]],D=e=>Object.fromEntries(J.filter(([n])=>e.tuning[n]!==void 0).map(([n,s])=>[s,e.tuning[n]])),A="queueTuning",V=/^[\t ]*(?:,[\t ]*)?(?:\/\/[^\n\r]*)?\r?\n/u,z=/^[\t ]*,/u,X=(e,n)=>{const s=Q(e),t=s===void 0?void 0:K(s,[...n])?.parent;if(t?.type==="property"){const a=t.offset+t.length,o=e.lastIndexOf(`
1
+ import{readFileSync as R,writeFileSync as T}from"node:fs";import{containerBuildTag as M}from"@lunora/container";import{applyModify as _}from"./applyModify-DKP2l6S9.mjs";import{a as W,r as L}from"./lunora-manifest-V77OcyFC.mjs";import{parseTree as Q,findNodeAtLocation as K}from"jsonc-parser";import{join as U}from"node:path";import{DEV_VARS_FILE as Y,parseDevVariableEntries as F}from"./DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";import{o as q,s as k}from"./validate-bindings-D6-vb6if.mjs";import{findWranglerFile as G,readWranglerJsonc as H}from"./WRANGLER_FILES-UNW-xY5u.mjs";const J=[["maxBatchSize","max_batch_size"],["maxBatchTimeout","max_batch_timeout"],["maxRetries","max_retries"],["deadLetterQueue","dead_letter_queue"],["retryDelay","retry_delay"]],D=e=>Object.fromEntries(J.filter(([n])=>e.tuning[n]!==void 0).map(([n,s])=>[s,e.tuning[n]])),A="queueTuning",V=/^[\t ]*(?:,[\t ]*)?(?:\/\/[^\n\r]*)?\r?\n/u,z=/^[\t ]*,/u,X=(e,n)=>{const s=Q(e),t=s===void 0?void 0:K(s,[...n])?.parent;if(t?.type==="property"){const a=t.offset+t.length,o=e.lastIndexOf(`
2
2
  `,t.offset-1)+1,c=V.exec(e.slice(a));if(c!==null&&e.slice(o,t.offset).trim()===""){const d=t.parent?.children??[],p=d.indexOf(t),r=p===d.length-1&&p>0?d[p-1]:void 0,l=r===void 0?void 0:z.exec(e.slice(r.offset+r.length))??void 0;return(l===void 0||r===void 0?e.slice(0,o):e.slice(0,r.offset+r.length)+e.slice(r.offset+r.length+l[0].length,o))+e.slice(a+c[0].length)}}return _(e,n,void 0)},I=(e,n,s,t,a,o=new Set)=>{const c=s.join("."),d={},p=[],r=[];let l=e;return{entries:n.map((u,f)=>{const g=t(u);if(g===void 0||u.queue===void 0)return u;const v=Object.fromEntries(Object.entries(D(g)).filter(([m])=>!o.has(m))),w=Object.entries(a[u.queue]??{}).filter(([m])=>!Object.hasOwn(v,m)),x=Object.entries(v).filter(([m,i])=>u[m]!==i),y=w.filter(([m,i])=>u[m]===i).map(([m])=>m),E=Object.fromEntries(Object.entries({...u,...v}).filter(([m])=>!y.includes(m)));for(const[m,i]of x)l=_(l,[...s,f,m],i);for(const m of y)l=X(l,[...s,f,m]);for(const[m,i]of w){const h=u[m];h!==void 0&&h!==i&&r.push(`${c}/${u.queue}: ${m} is no longer declared by defineQueue, but it was changed by hand to ${JSON.stringify(h)} from the declared ${JSON.stringify(i)}, so it was kept. Delete it from wrangler.jsonc if it should go.`)}return(x.length>0||y.length>0)&&p.push(`${c}/${u.queue} (${[...x.map(([m])=>m),...y.map(m=>`removed ${m}`)].join(", ")})`),Object.keys(v).length>0&&(d[u.queue]=v),E}),owned:d,text:l,updated:p,warnings:r}},Z=(e,n,s,t)=>{const a=n.queues??{},o=a.producers??[],c=a.consumers??[],d=new Set(o.map(g=>g.binding)),p=new Set(c.map(g=>g.queue)),r=s.filter(g=>!d.has(g.bindingName)),l=s.filter(g=>!p.has(g.name)),b=I(e,c,["queues","consumers"],g=>s.find(v=>v.name===g.queue),t);let u=b.text;const f={...b.owned};if(r.length>0||l.length>0){const g=[...o,...r.map(w=>({binding:w.bindingName,queue:w.name}))],v=[...b.entries,...l.map(w=>({queue:w.name,...w.mode==="pull"?{type:"http_pull"}:{},...D(w)}))];for(const w of l){const x=D(w);Object.keys(x).length>0&&(f[w.name]=x)}u=_(u,["queues"],{consumers:v,producers:g})}return{added:[...r.map(g=>`queues.producers/${g.bindingName}`),...l.map(g=>`queues.consumers/${g.name}`)],owned:f,text:u,updated:b.updated,warnings:b.warnings}},ee=(e,n,s,t,a)=>{const o=n.env?.[t],c=o?.queues?.consumers??[],d=o?.queues?.producers??[],p=u=>{const f=d.find(g=>g.queue===u.queue)?.binding;return f!==void 0?s.find(g=>g.bindingName===f):s.find(g=>g.name===u.queue&&!d.some(v=>v.binding===g.bindingName))},r=I(e,c,["env",t,"queues","consumers"],p,a,new Set(["dead_letter_queue"])),l=c.filter(u=>u.queue!==void 0&&p(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.`),b=c.flatMap(u=>{const f=p(u)?.tuning.deadLetterQueue;return f===void 0||u.dead_letter_queue!==void 0?[]:[`env.${t}.queues.consumers/${String(u.queue)}: defineQueue declares deadLetterQueue "${f}", 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:r.owned,text:r.text,updated:r.updated,warnings:[...r.warnings,...b,...l]}},ne=(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?.[A],t=a=>typeof a=="object"&&a!==null&&!Array.isArray(a);return s===void 0?{}:!t(s)||!Object.values(s).every(a=>t(a)&&Object.values(a).every(o=>t(o)))?(n.push(`${e?.path??"package.json"}: \`lunora.${A}\` 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(([,a])=>Object.keys(a).length>0));W(e,A,Object.keys(t).length===0?void 0:t)},S="PIPELINES",te=(e,n)=>{const s=e.flagshipBinding!==void 0&&!(n?.flagship??[]).some(o=>o.binding===e.flagshipBinding),t=e.usesPipelines&&!(n?.pipelines??[]).some(o=>o.binding===S);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 "${S}" pipelines binding exists; run 'wrangler pipelines create <name>' and add a 'pipelines' binding ({ binding: "${S}", pipeline }) — codegen resolves this one name, and the pipeline resource can't be auto-provisioned.`],[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(([o])=>o).map(([,o])=>o)},oe=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),O=(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.`),ae=(e,n)=>{const s=new Set([...e.workflows,...e.agents].map(t=>t.className));return s.size===0?[]:(n.workflows??[]).flatMap(t=>{const a=t.class_name;return a===void 0||s.has(a)?[]:[`wrangler.jsonc declares workflows[] entry "${a}" but no defineWorkflow/defineAgent export generates that class — a leftover from a rename will fail the deploy (wrangler rejects a class_name the worker does not export). Remove it if it is not hand-wired.`]})},ie=(e,n)=>{if(e.queues.length===0)return[];const s=new Set(e.queues.map(a=>a.name)),t=new Set(e.queues.map(a=>a.bindingName));return[...(n.queues?.consumers??[]).flatMap(a=>{const{queue:o}=a;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(a=>{const{binding:o}=a;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.`]})]},re=(e,n)=>[...ae(e,n),...ie(e,n)],j=[{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"}],de=()=>j.map(({keys:e,label:n})=>`${e[0]} + ${e[1]} (${n})`).join(" or "),ce=e=>{let n;try{n=R(U(e,Y),"utf8")}catch{return!1}const s=new Map(F(n).map(t=>[t.key,t.value]));return j.some(({keys:t})=>t.every(a=>(s.get(a)??"")!==""))},N=(e,n,s)=>{const t=new Set(e.durableObjects.map(d=>d.className)),a=[],o=(s?.r2_buckets?.length??0)>0,c=(s?.d1_databases?.some(d=>d.binding==="DB")??!1)||e.needsD1;return e.usesStorage&&!o&&a.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")&&!c&&a.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")&&a.push("@lunora/scheduler is used but the worker entry exports no SchedulerDO; export it so the SCHEDULER binding can be provisioned."),a.push(...O("container","containers",e.containers),...O("workflow","workflows",e.workflows),...O("agent","agents",e.agents)),e.containers.length>0&&s?.observability?.enabled===!1&&a.push("containers are declared but observability is explicitly disabled in wrangler.jsonc — container logs will not be captured."),e.usesPayment&&!ce(n)&&a.push(`@lunora/payment is used; set one provider's secret pair in .dev.vars — ${de()}.`),a.push(...oe(e),...te(e,s)),s!==void 0&&a.push(...re(e,s)),a},P="<replace-with-d1-create-id>",ue=e=>[["container","containers",e.containers],["workflow","workflows",e.workflows],["agent","agents",e.agents]].flatMap(([s,t,a])=>a.filter(o=>!o.exported).map(({className:o,exportName:c})=>({className:o,exportName:c,kind:s,module:t}))),le=e=>{const n=new Set(q(e).map(t=>t.tag));let s=1;for(;n.has(`v${String(s)}`);)s+=1;return`v${String(s)}`},ge=e=>{const n=new Set;for(const s of q(e)){for(const t of k(s.deleted_classes))n.delete(t);for(const{from:t,to:a}of q(s.renamed_classes))t!==void 0&&n.delete(t),a!==void 0&&n.add(a);for(const t of[...k(s.new_classes),...k(s.new_sqlite_classes)])n.add(t)}return n},me=(e,n,s)=>{const t=n.durable_objects?.bindings??[],a=new Set(t.map(l=>l.name)),o=s.filter(l=>!a.has(l.binding));let c=e;const d=[];if(o.length>0){const l=[...t,...o.map(b=>({class_name:b.className,name:b.binding}))];c=_(c,["durable_objects","bindings"],l),d.push(...o.map(b=>`${b.binding}/${b.className}`))}const p=n.migrations??[],r=s.map(l=>l.className).filter(l=>!ge(p).has(l));if(r.length>0){const l=[...p,{new_sqlite_classes:r,tag:le(p)}];c=_(c,["migrations"],l)}return{added:d,text:c}},pe=(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",a=[...s,{binding:"DB",database_id:P,database_name:t}];return{added:["DB (D1)"],text:_(e,["d1_databases"],a)}},$=(e,n,s,t,a)=>{const o=n[s]?.binding;return typeof o=="string"&&o.length>0?{added:[],text:e}:{added:[a],text:_(e,[s],{binding:t})}},be=(e,n)=>(n.analytics_engine_datasets?.length??0)>0?{added:[],text:e}:{added:["ANALYTICS (Analytics Engine)"],text:_(e,["analytics_engine_datasets"],[{binding:"ANALYTICS",dataset:"ANALYTICS"}])},he=(e,n)=>{const s=n.worker_loaders??[];return s.some(t=>t.binding==="LOADER")?{added:[],text:e}:{added:["LOADER (Worker Loader)"],text:_(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},ve=e=>e.image.kind==="dockerfile"?e.image.dockerfilePath:e.image.kind==="registry"?e.image.reference:M(e.exportName),we=e=>{const n={class_name:e.className,image:ve(e)};return e.image.kind==="dockerfile"&&(n.image_build_context=e.image.buildContext),e.buildArgs!==void 0&&e.image.kind!=="registry"&&(n.image_vars=e.buildArgs),e.instanceType!==void 0&&(n.instance_type=fe(e.instanceType)),e.maxInstances!==void 0&&(n.max_instances=e.maxInstances),e.name!==void 0&&(n.name=e.name),e.rollout?.stepPercentage!==void 0&&(n.rollout_step_percentage=e.rollout.stepPercentage),e.rollout?.gracePeriodSeconds!==void 0&&(n.rollout_active_grace_period=e.rollout.gracePeriodSeconds),n},_e=(e,n,s)=>{const t=n.containers??[],a=new Set(t.map(d=>d.class_name)),o=s.filter(d=>!a.has(d.className));if(o.length===0)return{added:[],text:e};const c=_(e,["containers"],[...t,...o.map(d=>we(d))]);return{added:o.map(d=>`containers/${d.className}`),text:c}},xe=(e,n)=>{if(n.observability!==void 0)return{added:[],text:e};const s=_(e,["observability"],{enabled:!0,head_sampling_rate:1});return{added:["observability"],text:s}},B=e=>({binding:e.bindingName,class_name:e.className,name:e.name}),ye=(e,n,s,t=[])=>{const a=n.workflows??[],o=new Set(a.map(r=>r.class_name)),c=s.filter(r=>!o.has(r.className)),d=t.filter(r=>!o.has(r.className));if(c.length===0&&d.length===0)return{added:[],text:e};const p=_(e,["workflows"],[...a,...c.map(r=>B(r)),...d.map(r=>B(r))]);return{added:[...c.map(r=>`workflows/${r.className}`),...d.map(r=>`workflows/${r.className}`)],text:p}},Ce=(e,n,s)=>{const t=G(e),a=ue(n);if(!t)return{added:[],changed:!1,exportGaps:a,reason:"wrangler.jsonc not found",updated:[],warnings:N(n,e)};const{parsed:o,text:c}=H(t);if(o===void 0)return{added:[],changed:!1,exportGaps:a,reason:`failed to parse ${t} as JSONC`,updated:[],warnings:N(n,e),wranglerPath:t};const d=N(n,e,o);if(s!==void 0){const i=o.env?.[s]!==void 0;d.push(i?`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 p=n.containers.filter(i=>i.exported),r=n.agents.filter(i=>i.exported&&i.voice===!0&&i.voiceBindingName!==void 0&&i.voiceClassName!==void 0),l=[...n.durableObjects,...p.map(i=>({binding:i.bindingName,className:i.className})),...r.map(i=>({binding:i.voiceBindingName,className:i.voiceClassName}))],b=n.workflows.filter(i=>i.exported),u=n.agents.filter(i=>i.exported),f=L(e),g=ne(f,d),v={},w=[{enabled:!0,run:i=>me(i,o,l)},{enabled:n.needsD1,run:i=>pe(i,o)},{enabled:n.usesAi,run:i=>$(i,o,"ai","AI","AI (Workers AI)")},{enabled:n.usesBrowser,run:i=>$(i,o,"browser","BROWSER","BROWSER (Browser Rendering)")},{enabled:n.usesImages,run:i=>$(i,o,"images","IMAGES","IMAGES (Cloudflare Images)")},{enabled:n.usesAnalytics,run:i=>be(i,o)},{enabled:n.usesWorkerLoader,run:i=>he(i,o)},{enabled:!0,run:i=>xe(i,o)},{enabled:p.length>0,run:i=>_e(i,o,p)},{enabled:b.length>0||u.length>0,run:i=>ye(i,o,b,u)},{enabled:n.queues.length>0,run:i=>{const h=Z(i,o,n.queues,g.queues??{});return v.queues=h.owned,h}},...s===void 0||o.env?.[s]===void 0?[]:[{enabled:n.queues.length>0,run:i=>{const h=`env.${s}.queues`,C=ee(i,o,n.queues,s,g[h]??{});return v[h]=C.owned,C}}]];let x=c;const y=[],E=[];for(const i of w){if(!i.enabled)continue;const h=i.run(x);x=h.text,y.push(...h.added),E.push(...h.updated??[]),d.push(...h.warnings??[])}const m=i=>{if(!(f===void 0||Object.keys(v).length===0))try{se(f,g,v)}catch(h){d.push(`${i?"wrangler.jsonc was updated, but ":""}recording the queue tuning reconcile owns in ${f.path} (lunora.queueTuning) failed: ${h instanceof Error?h.message:String(h)}. Until it is recorded, an option removed from defineQueue stays deployed.`)}};return y.includes("DB (D1)")&&d.push(`wrote a DB binding with a placeholder database_id ("${P}") — run \`wrangler d1 create <name>\` and replace it before deploying.`),x===c?(m(!1),{added:[],changed:!1,exportGaps:a,reason:"bindings already in sync",updated:[],warnings:d,wranglerPath:t}):(T(t,x,"utf8"),m(!0),{added:y,changed:!0,exportGaps:a,updated:E,warnings:d,wranglerPath:t})};export{ue as collectExportGaps,Ce as reconcileWranglerBindings};
@@ -0,0 +1 @@
1
+ import{existsSync as S,statSync as T,readFileSync as O,readdirSync as $}from"node:fs";import{parse as D,init as F}from"es-module-lexer";import{discoverAgentInfo as U}from"./discoverAgentInfo-CTdCSfYM.mjs";import{discoverContainerInfo as Y}from"./discoverContainerInfo-EhZtEBQs.mjs";import{discoverFlags as M,FLAGS_FILENAME as W,discoverQueues as G,QUEUES_FILENAME as K}from"@lunora/codegen";import{d as C}from"./discover-info-Vj9d4qYt.mjs";import{escapeRegExp as X}from"./DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";import{discoverSchemaInfo as q}from"./discoverSchemaInfo-DJvevsCm.mjs";import{resolveWorkerEntry as H,COMPOSED_ENTRY_DURABLE_OBJECTS as Q,GENERATED_MODULE_DURABLE_OBJECTS as V,GENERATED_DIRECTORY as w,DURABLE_OBJECT_BINDINGS as J,detectExportedDurableObjects as z,detectClassExports as E}from"./COMPOSED_WORKER_ENTRY-C69wqbSP.mjs";import{discoverWorkflowInfo as Z}from"./discoverWorkflowInfo-BsPvlo6O.mjs";import{join as l}from"node:path";const ee=(e,s)=>{const{error:t,value:r}=C(e,s,W,M);return t===void 0?{flags:r}:{error:t}},L=/^\s*import\s+type\b/,se=new Set(["@lunora/agent","@lunora/agent/sandbox"]),f=["browserTool","jsCodeTool"],y=Object.fromEntries(f.map(e=>{const s=X(e);return[e,{fallback:new RegExp(String.raw`import\s+\{[^}]*\b${s}\b[^}]*\}\s+from\s+["']@lunora\/agent(?:\/sandbox)?["']`,"u"),name:new RegExp(String.raw`\b${s}\b`,"u"),typeSpecifier:new RegExp(String.raw`\btype\s+${s}\b`,"u")}]})),re=e=>{const s=e.indexOf("{");if(s===-1)return"";const t=e.indexOf("}",s+1);return t===-1?e.slice(s+1):e.slice(s+1,t)},te=(e,s)=>{if(L.test(e))return!1;const t=re(e);return y[s].name.test(t)&&!y[s].typeSpecifier.test(t)},oe=e=>{let s;try{const[t]=D(e);s=t.filter(r=>r.n!==void 0&&se.has(r.n)).map(r=>e.slice(r.ss,r.se))}catch{s=void 0}return Object.fromEntries(f.map(t=>[t,s===void 0?y[t].fallback.test(e):s.some(r=>te(r,t))]))},ne=(e,s)=>{const{error:t,value:r}=C(e,s,K,G);return t===void 0?{queues:r??[]}:{error:t,queues:[]}},ae=new Set([".cjs",".cts",".js",".jsx",".mjs",".mts",".ts",".tsx"]),ie=new Set([".git",".lunora-cache",".wrangler","dist",w,"node_modules"]),ce=["lunora","src"],de=/\benv\s*\.\s*DB\b/,ue=/\benv\s*\.\s*AI\b/,k=/\bctx\s*\.\s*pipelines\b/,P=/\bctx\s*\.\s*r2sql\b/,b={usesAi:{pattern:/\bfrom\s+["']@lunora\/ai["']/,source:"@lunora/ai"},usesAnalytics:{pattern:/\bfrom\s+["']@lunora\/bindings\/analytics["']/,source:"@lunora/bindings/analytics"},usesAuth:{pattern:/\bfrom\s+["']@lunora\/auth["']/,source:"@lunora/auth"},usesBrowser:{pattern:/\bfrom\s+["']@lunora\/browser["']/,source:"@lunora/browser"},usesHyperdrive:{pattern:/\bfrom\s+["']@lunora\/hyperdrive["']/,source:"@lunora/hyperdrive"},usesImages:{pattern:/\bfrom\s+["']@lunora\/bindings\/images["']/,source:"@lunora/bindings/images"},usesKv:{pattern:/\bfrom\s+["']@lunora\/bindings\/kv["']/,source:"@lunora/bindings/kv"},usesMail:{pattern:/\bfrom\s+["']@lunora\/mail["']/,source:"@lunora/mail"},usesNotify:{pattern:/\bfrom\s+["']@lunora\/notify["']/,source:"@lunora/notify"},usesPayment:{pattern:/\bfrom\s+["']@lunora\/payment["']/,source:"@lunora/payment"},usesPipelines:{pattern:k,source:"@lunora/bindings/pipelines"},usesR2sql:{pattern:P,source:"@lunora/bindings/r2sql"},usesScheduler:{pattern:/\bfrom\s+["']@lunora\/scheduler["']/,source:"@lunora/scheduler"},usesStorage:{pattern:/\bfrom\s+["']@lunora\/storage["']/,source:"@lunora/storage"},usesX402Charge:{pattern:/\bfrom\s+["']@lunora\/x402\/charge["']/,source:"@lunora/x402/charge"},usesX402Pay:{pattern:/\bfrom\s+["']@lunora\/x402\/pay["']/,source:"@lunora/x402/pay"}},p=Object.keys(b),le="STRIPE_SECRET_KEY + STRIPE_WEBHOOK_SECRET (Stripe) or POLAR_ACCESS_TOKEN + POLAR_WEBHOOK_SECRET (Polar)",B=[...p,"needsD1","usesWorkerLoader"],pe=()=>{const e={};for(const s of B)e[s]=!1;return e},u=Object.freeze(pe()),_=(e,s)=>{const t={};for(const r of B)t[r]=e[r]||s[r];return t},me=e=>{for(const s of p)if(b[s].source===e)return{...u,[s]:!0};return u},fe=e=>{const[s]=D(e);let t=u;for(const r of s){const o=r.n;!o||L.test(e.slice(r.ss,r.se))||(t=_(t,me(o)))}return t},be=e=>{const s={...u};for(const t of p)s[t]=b[t].pattern.test(e);return s},ge=e=>{let s;try{s=fe(e)}catch{s=be(e)}return _(s,{...u,needsD1:de.test(e),usesAi:ue.test(e),usesPipelines:k.test(e),usesR2sql:P.test(e)})},v=(e,s)=>{let t;try{t=$(e,{withFileTypes:!0})}catch{return}for(const r of t){if(r.isDirectory()){ie.has(r.name)||v(l(e,r.name),s);continue}const o=r.name.lastIndexOf(".");o!==-1&&ae.has(r.name.slice(o))&&s.push(l(e,r.name))}},he=(e,s)=>q(e,s).info?.hasD1GlobalTable??!1,Ee=(e,s)=>{let t=u;for(const r of s){const o=l(e,r);if(!S(o)||!T(o).isDirectory())continue;const n=[];v(o,n);for(const a of n)t=_(t,ge(O(a,"utf8")))}return t},ye=(e,s)=>{const t=l(e,s),r=Object.fromEntries(f.map(n=>[n,!1]));if(!S(t)||!T(t).isDirectory())return r;const o=[];v(t,o);for(const n of o){const a=oe(O(n,"utf8"));for(const i of f)r[i]||=a[i]}return r},Se=(e,s,t)=>[...e.map(r=>r.exported?`${r.bindingName}/${r.className} (container "${r.exportName}" declared and exported)`:`hint: container "${r.exportName}" is declared but ${r.className} is not exported by the worker entry — add \`export * from "./lunora/_generated/containers"\``),...s.map(r=>r.exported?`${r.bindingName}/${r.className} (workflow "${r.exportName}" declared and exported)`:`hint: workflow "${r.exportName}" is declared but ${r.className} is not exported by the worker entry — add \`export * from "./lunora/_generated/workflows"\``),...t.map(r=>r.exported?`${r.bindingName}/${r.className} (agent "${r.exportName}" declared and exported)`:`hint: agent "${r.exportName}" is declared but ${r.className} is not exported by the worker entry — add \`export * from "./lunora/_generated/agents"\``)],_e=(e,s)=>[[e.usesAi,"AI (@lunora/ai imported or env.AI used)"],[e.usesAuth&&!s.has("SessionDO"),"hint: @lunora/auth is imported; its tables are D1-backed by default. For DO-backed auth (what @better-auth/scim needs), pass `namespace` to .auth() and export the generated auth DO class"],[e.usesScheduler&&!s.has("SchedulerDO"),"hint: @lunora/scheduler is imported but no SchedulerDO is exported by the worker entry"],[e.usesStorage,"hint: @lunora/storage is imported; add an r2_buckets binding (bucket binding names are user-defined)"],[e.usesMail,"hint: @lunora/mail is imported; set RESEND_API_KEY in .dev.vars (obtain at https://resend.com/api-keys)"],[e.usesPayment,`hint: @lunora/payment is imported; set the provider secrets in .dev.vars — ${le}`],[e.usesBrowser,"browser (@lunora/browser imported) — self-describing { binding: BROWSER }"],[e.usesImages,"images (@lunora/bindings/images imported) — self-describing { binding: IMAGES }"],[e.usesAnalytics,"analytics_engine_datasets (@lunora/bindings/analytics imported) — self-describing { binding: ANALYTICS, dataset }"],[e.usesWorkerLoader,"worker_loaders (jsCodeTool imported in lunora/) — self-describing { binding: LOADER }"],[e.usesKv,"hint: @lunora/bindings/kv is imported; add a kv_namespaces binding ({ binding, id }) and pass env.<BINDING> to createKv() — the namespace id can't be auto-provisioned"],[e.usesHyperdrive,"hint: @lunora/hyperdrive is imported; run 'wrangler hyperdrive create' and add a 'hyperdrive' binding ({ binding, id }) — the id can't be auto-provisioned"],[e.usesPipelines,"hint: ctx.pipelines is used; run 'wrangler pipelines create <name>' and add a 'pipelines' binding ({ binding, pipeline }) — the pipeline resource can't be auto-provisioned"],[e.usesX402Charge,"hint: @lunora/x402/charge is imported; set the recipient wallet address as a [vars] entry (the var name is yours to choose) and pass it to the charge config — the x402 facilitator settles USDC to that address"],[e.usesX402Pay,"hint: @lunora/x402/pay is imported (ActionCtx-only, spends real funds); add a secrets_store_secrets[] binding for the agent wallet key (name it to match signer.secretName) and pair the pay rail with a spend policy — ctx.secrets reads a Secrets Store binding, not .dev.vars, so the key can't be auto-provisioned"]].filter(([r])=>r).map(([,r])=>r),ve=(e,s,t,r=[],o=[],n=[])=>{const a=new Set(e.map(c=>c.className)),i=e.map(c=>`${c.binding}/${c.className} (exported by worker entry)`);return s&&i.push("DB (.global() table declared)"),i.push(...Se(r,o,n),..._e(t,a)),i},ke=async e=>{await F;const s=e.schemaDir??"lunora",t=e.scanDirs??ce,r=Ee(e.projectRoot,t),o=ye(e.projectRoot,s),n={...r,usesBrowser:r.usesBrowser||o.browserTool,usesWorkerLoader:o.jsCodeTool},a=H(e.projectRoot);let i;a.composed?i=[...Q,...Object.entries(V).filter(([d])=>S(l(e.projectRoot,s,w,`${d}.ts`))).map(([,d])=>d)].map(d=>({binding:J[d],className:d})):i=a.path===void 0?[]:z(a.path);const c=n.needsD1||he(e.projectRoot,s),x=E(a,Y(e.projectRoot,s).containers,"containers"),I=E(a,Z(e.projectRoot,s).workflows,"workflows"),R=E(a,U(e.projectRoot,s).agents,"agents"),j=[...ne(e.projectRoot,s).queues],{flags:m}=ee(e.projectRoot,s),g=m?.provider==="flagship"&&m.mode==="binding"?m.bindingName:void 0,N={};for(const h of p)N[h]=n[h];const A=ve(i,c,n,x,I,R);return g!==void 0&&A.push(`hint: lunora/flags.ts uses Flagship in binding mode; add a flagship binding ({ binding: "${g}", app_id }) — the app_id can't be auto-provisioned`),{agents:R,containers:x,durableObjects:i,flagshipBinding:g,needsD1:c,queues:j,signals:A,usesFlags:m!==void 0,usesWorkerLoader:n.usesWorkerLoader,workflows:I,...N}},Pe=e=>{const s=[];for(const t of p)e[t]&&s.push(b[t].source);return s};export{ke as inferLunoraBindings,Pe as packageNamesFromBindings};
@@ -1 +1 @@
1
- import{inferLunoraBindings as d}from"./inferLunoraBindings-GaAITuz-.mjs";import{LUNORA_TAG as r}from"./LUNORA_TAG-CiQM3BkI.mjs";import{reconcileWranglerBindings as f}from"./collectExportGaps-BmEGzQQc.mjs";import{reconcileWranglerCompatibilityDate as p}from"./reconcileWranglerCompatibilityDate-7OO_xaKR.mjs";import{reconcileWranglerCrons as g,describePreservedCrons as $}from"./describePreservedCrons-Ci5r2aph.mjs";const b=async(i,a,t)=>{try{const n=await d({projectRoot:i.projectRoot,schemaDir:i.schemaDir}),e=f(i.projectRoot,n),o=e.wranglerPath??"wrangler.jsonc";e.added.length>0&&a.info?.(`${r} inferred bindings → ${e.added.join(", ")} (written to ${o})`),e.updated.length>0&&a.info?.(`${r} updated bindings → ${e.updated.join(", ")} (written to ${o})`);for(const s of e.warnings)a.warn(`${r} ${s}`);e.exportGaps.length>0&&t?.(e.exportGaps)}catch(n){const e=n instanceof Error?n.message:String(n);a.warn(`${r} binding inference skipped: ${e}`)}},c=new Map,j=(i,a,t)=>{try{const n=g(i,a);n.changed&&t.info?.(`${r} synced ${a.length.toFixed(0)} cron trigger(s) into ${n.wranglerPath??"wrangler.jsonc"}`);for(const s of n.warnings)t.warn(`${r} ${s}`);const e=n.preserved.join("\0"),o=$(n.preserved);o!==void 0&&(n.changed||c.get(i)!==e)&&t.info?.(`${r} ${o}`),c.set(i,e)}catch(n){const e=n instanceof Error?n.message:String(n);t.warn(`${r} cron trigger sync skipped: ${e}`)}try{const n=p(i);n.changed&&t.info?.(`${r} bumped compatibility_date to ${n.date??"unknown"} (Workers Cache enabled) → ${n.wranglerPath??"wrangler.jsonc"}`)}catch(n){const e=n instanceof Error?n.message:String(n);t.warn(`${r} compatibility date sync skipped: ${e}`)}};export{b as reconcileBindingsSafely,j as reconcileWranglerExtras};
1
+ import{inferLunoraBindings as d}from"./inferLunoraBindings-DTiYSVS2.mjs";import{LUNORA_TAG as r}from"./LUNORA_TAG-CiQM3BkI.mjs";import{reconcileWranglerBindings as f}from"./collectExportGaps-DUaEyDNw.mjs";import{reconcileWranglerCompatibilityDate as p}from"./reconcileWranglerCompatibilityDate-hocXEuRA.mjs";import{reconcileWranglerCrons as g,describePreservedCrons as $}from"./describePreservedCrons-Ci5r2aph.mjs";const b=async(i,a,t)=>{try{const n=await d({projectRoot:i.projectRoot,schemaDir:i.schemaDir}),e=f(i.projectRoot,n),o=e.wranglerPath??"wrangler.jsonc";e.added.length>0&&a.info?.(`${r} inferred bindings → ${e.added.join(", ")} (written to ${o})`),e.updated.length>0&&a.info?.(`${r} updated bindings → ${e.updated.join(", ")} (written to ${o})`);for(const s of e.warnings)a.warn(`${r} ${s}`);e.exportGaps.length>0&&t?.(e.exportGaps)}catch(n){const e=n instanceof Error?n.message:String(n);a.warn(`${r} binding inference skipped: ${e}`)}},c=new Map,j=(i,a,t)=>{try{const n=g(i,a);n.changed&&t.info?.(`${r} synced ${a.length.toFixed(0)} cron trigger(s) into ${n.wranglerPath??"wrangler.jsonc"}`);for(const s of n.warnings)t.warn(`${r} ${s}`);const e=n.preserved.join("\0"),o=$(n.preserved);o!==void 0&&(n.changed||c.get(i)!==e)&&t.info?.(`${r} ${o}`),c.set(i,e)}catch(n){const e=n instanceof Error?n.message:String(n);t.warn(`${r} cron trigger sync skipped: ${e}`)}try{const n=p(i);n.changed&&t.info?.(`${r} bumped compatibility_date to ${n.date??"unknown"} (Workers Cache enabled) → ${n.wranglerPath??"wrangler.jsonc"}`)}catch(n){const e=n instanceof Error?n.message:String(n);t.warn(`${r} compatibility date sync skipped: ${e}`)}};export{b as reconcileBindingsSafely,j as reconcileWranglerExtras};
@@ -0,0 +1 @@
1
+ import{writeFileSync as d}from"node:fs";import{modify as c,applyEdits as l}from"jsonc-parser";import{FORMATTING as s}from"./applyModify-DKP2l6S9.mjs";import{isCacheEnabled as f,WORKERS_CACHE_MIN_DATE as a}from"./WORKERS_CACHE_MIN_DATE-0k9ABJtF.mjs";import{findWranglerFile as m,readWranglerJsonc as p}from"./WRANGLER_FILES-UNW-xY5u.mjs";const _=i=>{const e=m(i);if(!e)return{changed:!1,date:void 0,reason:"wrangler.jsonc not found"};const{parsed:r,text:n}=p(e);if(r===void 0)return{changed:!1,date:void 0,reason:`failed to parse ${e} as JSONC`,wranglerPath:e};const t=r.compatibility_date??"";if(!f(r))return{changed:!1,date:t||void 0,reason:"cache not enabled",wranglerPath:e};if(t>=a)return{changed:!1,date:t,reason:`compatibility_date already >= ${a}`,wranglerPath:e};const o=c(n,["compatibility_date"],a,s);return o.length===0?{changed:!1,date:t||void 0,reason:"no structural edit produced",wranglerPath:e}:(d(e,l(n,o),"utf8"),{changed:!0,date:a,wranglerPath:e})};export{_ as reconcileWranglerCompatibilityDate};
@@ -204,7 +204,7 @@ interface DurableObjectSpec {
204
204
  * has a `.scheduler()` method at all. `@lunora/vite` depends on `@lunora/config`, so config
205
205
  * owning it is the direction the dependency graph allows.
206
206
  */
207
- declare const GENERATED_CLASS_MODULES: readonly ["agents", "containers", "scheduler", "workflows"];
207
+ declare const GENERATED_CLASS_MODULES: readonly ["agents", "containers", "scheduler", "shardRegistry", "workflows"];
208
208
  /** One {@link GENERATED_CLASS_MODULES} entry. */
209
209
  type GeneratedClassModule = (typeof GENERATED_CLASS_MODULES)[number];
210
210
  /**
@@ -204,7 +204,7 @@ interface DurableObjectSpec {
204
204
  * has a `.scheduler()` method at all. `@lunora/vite` depends on `@lunora/config`, so config
205
205
  * owning it is the direction the dependency graph allows.
206
206
  */
207
- declare const GENERATED_CLASS_MODULES: readonly ["agents", "containers", "scheduler", "workflows"];
207
+ declare const GENERATED_CLASS_MODULES: readonly ["agents", "containers", "scheduler", "shardRegistry", "workflows"];
208
208
  /** One {@link GENERATED_CLASS_MODULES} entry. */
209
209
  type GeneratedClassModule = (typeof GENERATED_CLASS_MODULES)[number];
210
210
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lunora/config",
3
- "version": "1.0.0-alpha.284",
3
+ "version": "1.0.0-alpha.286",
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.239",
57
+ "@lunora/codegen": "1.0.0-alpha.241",
58
58
  "@lunora/container": "1.0.0-alpha.63",
59
59
  "@lunora/errors": "1.0.0-alpha.47",
60
- "@lunora/seed": "1.0.0-alpha.169",
60
+ "@lunora/seed": "1.0.0-alpha.171",
61
61
  "@visulima/colorize": "2.1.1",
62
62
  "@visulima/find-ai-runner": "1.0.2",
63
63
  "@visulima/package": "5.0.20",
@@ -1 +0,0 @@
1
- import{readFileSync as i,existsSync as E}from"node:fs";import{parse as S}from"es-module-lexer";import{WRANGLER_FILES as O,readWranglerJsonc as d}from"./WRANGLER_FILES-UNW-xY5u.mjs";import{escapeRegExp as R}from"./DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";import{join as p}from"node:path";const x="_generated",b=["src/server.ts","src/server/index.ts","src/server/index.tsx","src/index.ts","src/worker.ts"],_=new Set(["build","coverage","dist",x,"node_modules","out","target"]),g=new Set([".client",".server"]),w=/[/\\]/u,h=t=>{const e=[];for(const r of t.split(w))r===""||r==="."||(r===".."&&e.length>0&&e.at(-1)!==".."?e.pop():e.push(r));return e},D=t=>h(t).slice(0,-1).some(e=>_.has(e)||e.startsWith(".")&&!g.has(e)),l={SchedulerDO:"SCHEDULER",SessionDO:"SESSION",ShardDO:"SHARD"},u=Object.keys(l),U=t=>Object.hasOwn(l,t),T="virtual:lunora/worker",v=["ShardDO"],B=["agents","containers","scheduler","workflows"],A="src/worker.ts",P=t=>{for(const e of O){const r=p(t,e);if(!E(r))continue;const{parsed:s}=d(r),o=s?.main;if(o===T)return{composed:!0};const a=p(t,A);if(E(a))return{composed:!1,path:a};if(typeof o=="string"&&!D(o)&&E(p(t,o)))return{composed:!1,path:p(t,o)};break}for(const e of b){const r=p(t,e);if(E(r))return{composed:!1,path:r}}return{composed:!1}},C=/(?:^|[\s,{])type$/u,m=(t,e)=>{const r=e.ls>=0?e.ls:e.s;return C.test(t.slice(0,r).trimEnd())},f=(t,e)=>{const r=R(e);return new RegExp(String.raw`\bexport\s+type\s+${r}\b`,"u").test(t)||new RegExp(String.raw`\bexport\s+type\s*\{[^}]*\b${r}\b`,"u").test(t)||new RegExp(String.raw`\bexport\s+\{[^}]*\btype\s+${r}\b`,"u").test(t)},W=t=>{const e=i(t,"utf8");let r;try{const[,s]=S(e);r=new Set(s.filter(o=>!m(e,o)).map(o=>o.n))}catch{r=new Set(u.filter(s=>new RegExp(String.raw`\bexport\b[^\n;]*\b${s}\b`,"u").test(e)&&!f(e,s)))}return u.filter(s=>r.has(s)).map(s=>({binding:l[s],className:s}))},$=(t,e,r)=>{if(e.length===0)return[];if(t.composed)return e.map(n=>({...n,exported:!0}));if(t.path===void 0)return e.map(n=>({...n,exported:!1}));const s=i(t.path,"utf8"),o=new RegExp(String.raw`\bexport\s*\*\s*from\s*["'][^"']*_generated\/${r}(?:\.js)?["']`).test(s);let a;try{const[,n]=S(s);a=new Set(n.filter(c=>!m(s,c)).map(c=>c.n))}catch{a=new Set(e.map(n=>n.className).filter(n=>new RegExp(String.raw`\bexport\b[^\n;]*\b${R(n)}\b`,"u").test(s)&&!f(s,n)))}return e.map(n=>{const c=o||a.has(n.className);return{...n,exported:c}})};export{v as COMPOSED_ENTRY_DURABLE_OBJECTS,A as COMPOSED_WORKER_ENTRY,l as DURABLE_OBJECT_BINDINGS,B as GENERATED_CLASS_MODULES,x as GENERATED_DIRECTORY,T as LUNORA_WORKER_VIRTUAL_ID,_ as NON_SOURCE_DIRECTORIES,g as SOURCE_DOT_DIRECTORIES,b as WORKER_ENTRY_FALLBACKS,$ as detectClassExports,W as detectExportedDurableObjects,U as isFrameworkDurableObject,D as isGeneratedOutput,P as resolveWorkerEntry};
@@ -1 +0,0 @@
1
- import{writeFileSync as d,rmSync as f}from"node:fs";import{a as g}from"./jsonc-edit-BZgQIdAH.mjs";import{findWranglerFile as m,readWranglerJsonc as b}from"./WRANGLER_FILES-UNW-xY5u.mjs";import{join as y}from"node:path";const u={ai:{label:"AI",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"}},h=Object.keys(u),p=(e,r)=>typeof e.binding=="string"?e.binding:r,l=(e,r,n,a)=>{const t=[];for(const[o,s]of r.entries())s!=null&&t.push({binding:p(s,`#${String(o)}`),kind:n,path:[...a,o],section:e});return t},E=(e,r)=>{const{label:n,shape:a}=u[e];if(a==="array"){const o=r[e]??[];return l(e,o,n,[])}if(a==="producers")return l(e,r.queues?.producers??[],n,["producers"]);const t=r.ai;return t==null?[]:[{binding:p(t,e),kind:n,path:[],section:e}]},v=e=>h.flatMap(r=>E(r,e)),R=(e,r)=>{let n=e;for(const a of r)n=g(n,[a.section,...a.path,"remote"],!0);return n},i=()=>{},S=e=>{let r=!1;return()=>{if(!r){r=!0;try{f(e,{force:!0,recursive:!0})}catch{}}}};let c=0;const B=()=>(c+=1,`.wrangler.lunora-remote.${String(process.pid)}.${String(c)}.jsonc`),w=e=>{if(!e.enabled)return{cleanup:i,enabled:!1,remoteBindings:[]};const r=m(e.projectRoot);if(!r)return{cleanup:i,enabled:!0,reason:"wrangler.jsonc not found",remoteBindings:[]};const{parsed:n,text:a}=b(r);if(n===void 0)return{cleanup:i,enabled:!0,reason:`failed to parse ${r} as JSONC`,remoteBindings:[]};const t=v(n);if(t.length===0)return{cleanup:i,enabled:!0,reason:"no remote-eligible bindings to proxy",remoteBindings:[]};const o=y(e.projectRoot,B());return d(o,R(a,t),"utf8"),{cleanup:S(o),configPath:o,enabled:!0,remoteBindings:t}},j=e=>{if(e===void 0)return!1;const r=e.trim().toLowerCase();return r==="1"||r==="true"},x=e=>e.flag===!0||j(e.envValue)?!0:e.configPreference??!1;export{u as REMOTE_ELIGIBLE_KEYS,R as injectRemoteFlags,j as isRemoteEnvEnabled,w as materializeRemoteWranglerConfig,v as planRemoteBindings,x as resolveRemoteEnabled};
@@ -1 +0,0 @@
1
- import{existsSync as y,statSync as T,readFileSync as O,readdirSync as $}from"node:fs";import{parse as D,init as F}from"es-module-lexer";import{discoverAgentInfo as Y}from"./discoverAgentInfo-CTdCSfYM.mjs";import{discoverContainerInfo as U}from"./discoverContainerInfo-EhZtEBQs.mjs";import{discoverFlags as W,FLAGS_FILENAME as K,discoverQueues as M,QUEUES_FILENAME as X}from"@lunora/codegen";import{d as C}from"./discover-info-Vj9d4qYt.mjs";import{escapeRegExp as q}from"./DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";import{discoverSchemaInfo as G}from"./discoverSchemaInfo-DJvevsCm.mjs";import{resolveWorkerEntry as H,COMPOSED_ENTRY_DURABLE_OBJECTS as Q,GENERATED_DIRECTORY as w,DURABLE_OBJECT_BINDINGS as V,detectExportedDurableObjects as J,detectClassExports as h}from"./COMPOSED_WORKER_ENTRY-5R-BECOC.mjs";import{discoverWorkflowInfo as z}from"./discoverWorkflowInfo-BsPvlo6O.mjs";import{join as u}from"node:path";const Z=(e,s)=>{const{error:o,value:r}=C(e,s,K,W);return o===void 0?{flags:r}:{error:o}},k=/^\s*import\s+type\b/,ee=new Set(["@lunora/agent","@lunora/agent/sandbox"]),m=["browserTool","jsCodeTool"],E=Object.fromEntries(m.map(e=>{const s=q(e);return[e,{fallback:new RegExp(String.raw`import\s+\{[^}]*\b${s}\b[^}]*\}\s+from\s+["']@lunora\/agent(?:\/sandbox)?["']`,"u"),name:new RegExp(String.raw`\b${s}\b`,"u"),typeSpecifier:new RegExp(String.raw`\btype\s+${s}\b`,"u")}]})),se=e=>{const s=e.indexOf("{");if(s===-1)return"";const o=e.indexOf("}",s+1);return o===-1?e.slice(s+1):e.slice(s+1,o)},re=(e,s)=>{if(k.test(e))return!1;const o=se(e);return E[s].name.test(o)&&!E[s].typeSpecifier.test(o)},oe=e=>{let s;try{const[o]=D(e);s=o.filter(r=>r.n!==void 0&&ee.has(r.n)).map(r=>e.slice(r.ss,r.se))}catch{s=void 0}return Object.fromEntries(m.map(o=>[o,s===void 0?E[o].fallback.test(e):s.some(r=>re(r,o))]))},te=(e,s)=>{const{error:o,value:r}=C(e,s,X,M);return o===void 0?{queues:r??[]}:{error:o,queues:[]}},ne=new Set([".cjs",".cts",".js",".jsx",".mjs",".mts",".ts",".tsx"]),ae=new Set([".git",".lunora-cache",".wrangler","dist",w,"node_modules"]),ie=["lunora","src"],ce=/\benv\s*\.\s*DB\b/,de=/\benv\s*\.\s*AI\b/,L=/\bctx\s*\.\s*pipelines\b/,P=/\bctx\s*\.\s*r2sql\b/,f={usesAi:{pattern:/\bfrom\s+["']@lunora\/ai["']/,source:"@lunora/ai"},usesAnalytics:{pattern:/\bfrom\s+["']@lunora\/bindings\/analytics["']/,source:"@lunora/bindings/analytics"},usesAuth:{pattern:/\bfrom\s+["']@lunora\/auth["']/,source:"@lunora/auth"},usesBrowser:{pattern:/\bfrom\s+["']@lunora\/browser["']/,source:"@lunora/browser"},usesHyperdrive:{pattern:/\bfrom\s+["']@lunora\/hyperdrive["']/,source:"@lunora/hyperdrive"},usesImages:{pattern:/\bfrom\s+["']@lunora\/bindings\/images["']/,source:"@lunora/bindings/images"},usesKv:{pattern:/\bfrom\s+["']@lunora\/bindings\/kv["']/,source:"@lunora/bindings/kv"},usesMail:{pattern:/\bfrom\s+["']@lunora\/mail["']/,source:"@lunora/mail"},usesNotify:{pattern:/\bfrom\s+["']@lunora\/notify["']/,source:"@lunora/notify"},usesPayment:{pattern:/\bfrom\s+["']@lunora\/payment["']/,source:"@lunora/payment"},usesPipelines:{pattern:L,source:"@lunora/bindings/pipelines"},usesR2sql:{pattern:P,source:"@lunora/bindings/r2sql"},usesScheduler:{pattern:/\bfrom\s+["']@lunora\/scheduler["']/,source:"@lunora/scheduler"},usesStorage:{pattern:/\bfrom\s+["']@lunora\/storage["']/,source:"@lunora/storage"},usesX402Charge:{pattern:/\bfrom\s+["']@lunora\/x402\/charge["']/,source:"@lunora/x402/charge"},usesX402Pay:{pattern:/\bfrom\s+["']@lunora\/x402\/pay["']/,source:"@lunora/x402/pay"}},l=Object.keys(f),ue="STRIPE_SECRET_KEY + STRIPE_WEBHOOK_SECRET (Stripe) or POLAR_ACCESS_TOKEN + POLAR_WEBHOOK_SECRET (Polar)",B=[...l,"needsD1","usesWorkerLoader"],le=()=>{const e={};for(const s of B)e[s]=!1;return e},d=Object.freeze(le()),S=(e,s)=>{const o={};for(const r of B)o[r]=e[r]||s[r];return o},pe=e=>{for(const s of l)if(f[s].source===e)return{...d,[s]:!0};return d},me=e=>{const[s]=D(e);let o=d;for(const r of s){const t=r.n;!t||k.test(e.slice(r.ss,r.se))||(o=S(o,pe(t)))}return o},fe=e=>{const s={...d};for(const o of l)s[o]=f[o].pattern.test(e);return s},be=e=>{let s;try{s=me(e)}catch{s=fe(e)}return S(s,{...d,needsD1:ce.test(e),usesAi:de.test(e),usesPipelines:L.test(e),usesR2sql:P.test(e)})},_=(e,s)=>{let o;try{o=$(e,{withFileTypes:!0})}catch{return}for(const r of o){if(r.isDirectory()){ae.has(r.name)||_(u(e,r.name),s);continue}const t=r.name.lastIndexOf(".");t!==-1&&ne.has(r.name.slice(t))&&s.push(u(e,r.name))}},ge=(e,s)=>G(e,s).info?.hasD1GlobalTable??!1,he=(e,s)=>{let o=d;for(const r of s){const t=u(e,r);if(!y(t)||!T(t).isDirectory())continue;const n=[];_(t,n);for(const a of n)o=S(o,be(O(a,"utf8")))}return o},Ee=(e,s)=>{const o=u(e,s),r=Object.fromEntries(m.map(n=>[n,!1]));if(!y(o)||!T(o).isDirectory())return r;const t=[];_(o,t);for(const n of t){const a=oe(O(n,"utf8"));for(const i of m)r[i]||=a[i]}return r},ye=(e,s,o)=>[...e.map(r=>r.exported?`${r.bindingName}/${r.className} (container "${r.exportName}" declared and exported)`:`hint: container "${r.exportName}" is declared but ${r.className} is not exported by the worker entry — add \`export * from "./lunora/_generated/containers"\``),...s.map(r=>r.exported?`${r.bindingName}/${r.className} (workflow "${r.exportName}" declared and exported)`:`hint: workflow "${r.exportName}" is declared but ${r.className} is not exported by the worker entry — add \`export * from "./lunora/_generated/workflows"\``),...o.map(r=>r.exported?`${r.bindingName}/${r.className} (agent "${r.exportName}" declared and exported)`:`hint: agent "${r.exportName}" is declared but ${r.className} is not exported by the worker entry — add \`export * from "./lunora/_generated/agents"\``)],Se=(e,s)=>[[e.usesAi,"AI (@lunora/ai imported or env.AI used)"],[e.usesAuth&&!s.has("SessionDO"),"hint: @lunora/auth is imported; its tables are D1-backed by default. For DO-backed auth (what @better-auth/scim needs), pass `namespace` to .auth() and export the generated auth DO class"],[e.usesScheduler&&!s.has("SchedulerDO"),"hint: @lunora/scheduler is imported but no SchedulerDO is exported by the worker entry"],[e.usesStorage,"hint: @lunora/storage is imported; add an r2_buckets binding (bucket binding names are user-defined)"],[e.usesMail,"hint: @lunora/mail is imported; set RESEND_API_KEY in .dev.vars (obtain at https://resend.com/api-keys)"],[e.usesPayment,`hint: @lunora/payment is imported; set the provider secrets in .dev.vars — ${ue}`],[e.usesBrowser,"browser (@lunora/browser imported) — self-describing { binding: BROWSER }"],[e.usesImages,"images (@lunora/bindings/images imported) — self-describing { binding: IMAGES }"],[e.usesAnalytics,"analytics_engine_datasets (@lunora/bindings/analytics imported) — self-describing { binding: ANALYTICS, dataset }"],[e.usesWorkerLoader,"worker_loaders (jsCodeTool imported in lunora/) — self-describing { binding: LOADER }"],[e.usesKv,"hint: @lunora/bindings/kv is imported; add a kv_namespaces binding ({ binding, id }) and pass env.<BINDING> to createKv() — the namespace id can't be auto-provisioned"],[e.usesHyperdrive,"hint: @lunora/hyperdrive is imported; run 'wrangler hyperdrive create' and add a 'hyperdrive' binding ({ binding, id }) — the id can't be auto-provisioned"],[e.usesPipelines,"hint: ctx.pipelines is used; run 'wrangler pipelines create <name>' and add a 'pipelines' binding ({ binding, pipeline }) — the pipeline resource can't be auto-provisioned"],[e.usesX402Charge,"hint: @lunora/x402/charge is imported; set the recipient wallet address as a [vars] entry (the var name is yours to choose) and pass it to the charge config — the x402 facilitator settles USDC to that address"],[e.usesX402Pay,"hint: @lunora/x402/pay is imported (ActionCtx-only, spends real funds); add a secrets_store_secrets[] binding for the agent wallet key (name it to match signer.secretName) and pair the pay rail with a spend policy — ctx.secrets reads a Secrets Store binding, not .dev.vars, so the key can't be auto-provisioned"]].filter(([r])=>r).map(([,r])=>r),_e=(e,s,o,r=[],t=[],n=[])=>{const a=new Set(e.map(c=>c.className)),i=e.map(c=>`${c.binding}/${c.className} (exported by worker entry)`);return s&&i.push("DB (.global() table declared)"),i.push(...ye(r,t,n),...Se(o,a)),i},ke=async e=>{await F;const s=e.schemaDir??"lunora",o=e.scanDirs??ie,r=he(e.projectRoot,o),t=Ee(e.projectRoot,s),n={...r,usesBrowser:r.usesBrowser||t.browserTool,usesWorkerLoader:t.jsCodeTool},a=H(e.projectRoot);let i;a.composed?i=[...Q,...y(u(e.projectRoot,s,w,"scheduler.ts"))?["SchedulerDO"]:[]].map(A=>({binding:V[A],className:A})):i=a.path===void 0?[]:J(a.path);const c=n.needsD1||ge(e.projectRoot,s),v=h(a,U(e.projectRoot,s).containers,"containers"),x=h(a,z(e.projectRoot,s).workflows,"workflows"),I=h(a,Y(e.projectRoot,s).agents,"agents"),j=[...te(e.projectRoot,s).queues],{flags:p}=Z(e.projectRoot,s),b=p?.provider==="flagship"&&p.mode==="binding"?p.bindingName:void 0,R={};for(const g of l)R[g]=n[g];const N=_e(i,c,n,v,x,I);return b!==void 0&&N.push(`hint: lunora/flags.ts uses Flagship in binding mode; add a flagship binding ({ binding: "${b}", app_id }) — the app_id can't be auto-provisioned`),{agents:I,containers:v,durableObjects:i,flagshipBinding:b,needsD1:c,queues:j,signals:N,usesFlags:p!==void 0,usesWorkerLoader:n.usesWorkerLoader,workflows:x,...R}},Le=e=>{const s=[];for(const o of l)e[o]&&s.push(f[o].source);return s};export{ke as inferLunoraBindings,Le as packageNamesFromBindings};
@@ -1 +0,0 @@
1
- import{modify as a,applyEdits as n}from"jsonc-parser";const p={formattingOptions:{insertSpaces:!0,tabSize:4}},e=(t,s,i)=>{const o=a(t,[...s],i,p);return o.length>0?n(t,o):t};export{p as F,e as a};
@@ -1 +0,0 @@
1
- import{writeFileSync as d}from"node:fs";import{modify as c,applyEdits as s}from"jsonc-parser";import{F as l}from"./jsonc-edit-BZgQIdAH.mjs";import{isCacheEnabled as f,WORKERS_CACHE_MIN_DATE as a}from"./WORKERS_CACHE_MIN_DATE-0k9ABJtF.mjs";import{findWranglerFile as m,readWranglerJsonc as p}from"./WRANGLER_FILES-UNW-xY5u.mjs";const _=i=>{const e=m(i);if(!e)return{changed:!1,date:void 0,reason:"wrangler.jsonc not found"};const{parsed:r,text:n}=p(e);if(r===void 0)return{changed:!1,date:void 0,reason:`failed to parse ${e} as JSONC`,wranglerPath:e};const t=r.compatibility_date??"";if(!f(r))return{changed:!1,date:t||void 0,reason:"cache not enabled",wranglerPath:e};if(t>=a)return{changed:!1,date:t,reason:`compatibility_date already >= ${a}`,wranglerPath:e};const o=c(n,["compatibility_date"],a,l);return o.length===0?{changed:!1,date:t||void 0,reason:"no structural edit produced",wranglerPath:e}:(d(e,s(n,o),"utf8"),{changed:!0,date:a,wranglerPath:e})};export{_ as reconcileWranglerCompatibilityDate};