@lunora/config 1.0.0-alpha.445 → 1.0.0-alpha.446

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 (30) hide show
  1. package/dist/cli/index.d.mts +2 -2
  2. package/dist/cli/index.d.ts +2 -2
  3. package/dist/cli/index.mjs +1 -1
  4. package/dist/cloudflare/index.d.mts +3 -3
  5. package/dist/cloudflare/index.d.ts +3 -3
  6. package/dist/cloudflare/index.mjs +1 -1
  7. package/dist/index.d.mts +4 -4
  8. package/dist/index.d.ts +4 -4
  9. package/dist/index.mjs +1 -1
  10. package/dist/packem_shared/CLOUDFLARE_DRIVER-DbmpoIcg.mjs +1 -0
  11. package/dist/packem_shared/COMPOSED_WORKER_ENTRY-BcFt6ts5.mjs +1 -0
  12. package/dist/packem_shared/DEFAULT_DEPLOY_TARGET-DllYb7Tj.mjs +1 -0
  13. package/dist/packem_shared/{REQUIRED_COMPATIBILITY_DATE-D4UcOP_t.mjs → REQUIRED_COMPATIBILITY_DATE-C8qfwbaA.mjs} +1 -1
  14. package/dist/packem_shared/{UNEXPORTED_CLASS_MARKER-CntuT4Ck.mjs → UNEXPORTED_CLASS_MARKER-07SNQ0rP.mjs} +1 -1
  15. package/dist/packem_shared/{assertBuildTargetMatches-t0UvJp_O.mjs → assertBuildTargetMatches-CqrrwiQ-.mjs} +1 -1
  16. package/dist/packem_shared/{assertWranglerSatisfiesSchema-DGXrk16q.mjs → assertWranglerSatisfiesSchema-DmkdB-OW.mjs} +1 -1
  17. package/dist/packem_shared/{collectExportGaps-B53R2mba.mjs → collectExportGaps-CLrCQp09.mjs} +1 -1
  18. package/dist/packem_shared/{deploy-driver.d-BqO40t1Q.d.mts → deploy-driver.d-CHVNQFV2.d.mts} +4 -0
  19. package/dist/packem_shared/{deploy-driver.d-BqO40t1Q.d.ts → deploy-driver.d-CHVNQFV2.d.ts} +4 -0
  20. package/dist/packem_shared/{index.d-CGlT0loP.d.mts → index.d-BoUSSRrk.d.mts} +1 -1
  21. package/dist/packem_shared/{index.d-BuYbPa9W.d.ts → index.d-C1nVDcie.d.ts} +1 -1
  22. package/dist/packem_shared/{infer-bindings.d-BUdWC3tw.d.ts → infer-bindings.d-BKaqvxUQ.d.mts} +2 -1
  23. package/dist/packem_shared/{infer-bindings.d-BUdWC3tw.d.mts → infer-bindings.d-BKaqvxUQ.d.ts} +2 -1
  24. package/dist/packem_shared/{inferLunoraBindings-DvB8IpbN.mjs → inferLunoraBindings-BiRE_Jh9.mjs} +1 -1
  25. package/dist/packem_shared/{reconcileBindingsSafely-t02cOkaF.mjs → reconcileBindingsSafely-CSov1jsv.mjs} +1 -1
  26. package/dist/packem_shared/{worker-entry-checks-AIASCYl7.mjs → worker-entry-checks-CHrum2AN.mjs} +1 -1
  27. package/package.json +3 -3
  28. package/dist/packem_shared/CLOUDFLARE_DRIVER-DJwtY5NT.mjs +0 -1
  29. package/dist/packem_shared/COMPOSED_WORKER_ENTRY-Ciiba5g_.mjs +0 -1
  30. package/dist/packem_shared/DEFAULT_DEPLOY_TARGET-D_krePy-.mjs +0 -1
@@ -1,2 +1,2 @@
1
- export { b as AGENT_RULES_HINT, D as DEFAULT_DEPLOY_TARGET, l as LUNORA_TAG, n as LunoraReporter, type P as PackageManager, type o as PackageManagerProbe, S as STEP_BADGE_NAMES, type p as StepBadgeName, q as addArgsFor, u as claimAgentRulesHint, v as deployTargetIds, w as detectAgentRules, x as detectInstalledManagers, y as detectPackageManager, z as execArgsFor, C as installArgsFor, E as isRunnableTarget, F as lunoraLine, N as readProjectManifest, U as runScriptCommand, V as runnableTargetIds, X as toolchainExecArgs } from "../packem_shared/index.d-CGlT0loP.mjs";
2
- import "../packem_shared/deploy-driver.d-BqO40t1Q.mjs";
1
+ export { b as AGENT_RULES_HINT, D as DEFAULT_DEPLOY_TARGET, l as LUNORA_TAG, n as LunoraReporter, type P as PackageManager, type o as PackageManagerProbe, S as STEP_BADGE_NAMES, type p as StepBadgeName, q as addArgsFor, u as claimAgentRulesHint, v as deployTargetIds, w as detectAgentRules, x as detectInstalledManagers, y as detectPackageManager, z as execArgsFor, C as installArgsFor, E as isRunnableTarget, F as lunoraLine, N as readProjectManifest, U as runScriptCommand, V as runnableTargetIds, X as toolchainExecArgs } from "../packem_shared/index.d-BoUSSRrk.mjs";
2
+ import "../packem_shared/deploy-driver.d-CHVNQFV2.mjs";
@@ -1,2 +1,2 @@
1
- export { b as AGENT_RULES_HINT, D as DEFAULT_DEPLOY_TARGET, l as LUNORA_TAG, n as LunoraReporter, type P as PackageManager, type o as PackageManagerProbe, S as STEP_BADGE_NAMES, type p as StepBadgeName, q as addArgsFor, u as claimAgentRulesHint, v as deployTargetIds, w as detectAgentRules, x as detectInstalledManagers, y as detectPackageManager, z as execArgsFor, C as installArgsFor, E as isRunnableTarget, F as lunoraLine, N as readProjectManifest, U as runScriptCommand, V as runnableTargetIds, X as toolchainExecArgs } from "../packem_shared/index.d-BuYbPa9W.js";
2
- import "../packem_shared/deploy-driver.d-BqO40t1Q.js";
1
+ export { b as AGENT_RULES_HINT, D as DEFAULT_DEPLOY_TARGET, l as LUNORA_TAG, n as LunoraReporter, type P as PackageManager, type o as PackageManagerProbe, S as STEP_BADGE_NAMES, type p as StepBadgeName, q as addArgsFor, u as claimAgentRulesHint, v as deployTargetIds, w as detectAgentRules, x as detectInstalledManagers, y as detectPackageManager, z as execArgsFor, C as installArgsFor, E as isRunnableTarget, F as lunoraLine, N as readProjectManifest, U as runScriptCommand, V as runnableTargetIds, X as toolchainExecArgs } from "../packem_shared/index.d-C1nVDcie.js";
2
+ import "../packem_shared/deploy-driver.d-CHVNQFV2.js";
@@ -1 +1 @@
1
- import{AGENT_RULES_HINT as t,claimAgentRulesHint as o,detectAgentRules as a}from"../packem_shared/AGENT_RULES_DIR-Bd6JPtNa.mjs";import{DEFAULT_DEPLOY_TARGET as s,deployTargetIds as l,isRunnableTarget as A,runnableTargetIds as d}from"../packem_shared/DEFAULT_DEPLOY_TARGET-D_krePy-.mjs";import{LUNORA_TAG as c,lunoraLine as m}from"../packem_shared/LUNORA_TAG-DQTGPqcJ.mjs";import{default as T}from"../packem_shared/LunoraReporter-f277GLNT.mjs";import{addArgsFor as x,detectInstalledManagers as E,detectPackageManager as i,execArgsFor as u,installArgsFor as R,runScriptCommand as _,toolchainExecArgs as L}from"../packem_shared/addArgsFor-CYZKhNIo.mjs";import{readProjectManifest as G}from"../packem_shared/readProjectDependencies-l3uhUKjo.mjs";import{STEP_BADGE_NAMES as M}from"../packem_shared/ACCENT-CotPTfv7.mjs";export{t as AGENT_RULES_HINT,s as DEFAULT_DEPLOY_TARGET,c as LUNORA_TAG,T as LunoraReporter,M as STEP_BADGE_NAMES,x as addArgsFor,o as claimAgentRulesHint,l as deployTargetIds,a as detectAgentRules,E as detectInstalledManagers,i as detectPackageManager,u as execArgsFor,R as installArgsFor,A as isRunnableTarget,m as lunoraLine,G as readProjectManifest,_ as runScriptCommand,d as runnableTargetIds,L as toolchainExecArgs};
1
+ import{AGENT_RULES_HINT as t,claimAgentRulesHint as o,detectAgentRules as a}from"../packem_shared/AGENT_RULES_DIR-Bd6JPtNa.mjs";import{DEFAULT_DEPLOY_TARGET as s,deployTargetIds as l,isRunnableTarget as A,runnableTargetIds as d}from"../packem_shared/DEFAULT_DEPLOY_TARGET-DllYb7Tj.mjs";import{LUNORA_TAG as c,lunoraLine as m}from"../packem_shared/LUNORA_TAG-DQTGPqcJ.mjs";import{default as T}from"../packem_shared/LunoraReporter-f277GLNT.mjs";import{addArgsFor as x,detectInstalledManagers as E,detectPackageManager as i,execArgsFor as u,installArgsFor as R,runScriptCommand as _,toolchainExecArgs as L}from"../packem_shared/addArgsFor-CYZKhNIo.mjs";import{readProjectManifest as G}from"../packem_shared/readProjectDependencies-l3uhUKjo.mjs";import{STEP_BADGE_NAMES as M}from"../packem_shared/ACCENT-CotPTfv7.mjs";export{t as AGENT_RULES_HINT,s as DEFAULT_DEPLOY_TARGET,c as LUNORA_TAG,T as LunoraReporter,M as STEP_BADGE_NAMES,x as addArgsFor,o as claimAgentRulesHint,l as deployTargetIds,a as detectAgentRules,E as detectInstalledManagers,i as detectPackageManager,u as execArgsFor,R as installArgsFor,A as isRunnableTarget,m as lunoraLine,G as readProjectManifest,_ as runScriptCommand,d as runnableTargetIds,L as toolchainExecArgs};
@@ -1,6 +1,6 @@
1
- import { D as DiscoveryCache, G as GeneratedClassModule, I as InferredBindings, S as SchemaInfo } from "../packem_shared/infer-bindings.d-BUdWC3tw.mjs";
2
- export { H as HYPERDRIVE_PLACEHOLDER_ID } from "../packem_shared/infer-bindings.d-BUdWC3tw.mjs";
3
- import { D as DeployDriver } from "../packem_shared/deploy-driver.d-BqO40t1Q.mjs";
1
+ import { D as DiscoveryCache, G as GeneratedClassModule, I as InferredBindings, S as SchemaInfo } from "../packem_shared/infer-bindings.d-BKaqvxUQ.mjs";
2
+ export { H as HYPERDRIVE_PLACEHOLDER_ID } from "../packem_shared/infer-bindings.d-BKaqvxUQ.mjs";
3
+ import { D as DeployDriver } from "../packem_shared/deploy-driver.d-CHVNQFV2.mjs";
4
4
  import { WranglerQueueProducerIR, WranglerVariableIR } from '@lunora/codegen';
5
5
  /** Apply one structural jsonc edit and return the rewritten text (a no-op edit returns the input). */
6
6
  declare const applyModify: (text: string, path: ReadonlyArray<number | string>, value: unknown) => string;
@@ -1,6 +1,6 @@
1
- import { D as DiscoveryCache, G as GeneratedClassModule, I as InferredBindings, S as SchemaInfo } from "../packem_shared/infer-bindings.d-BUdWC3tw.js";
2
- export { H as HYPERDRIVE_PLACEHOLDER_ID } from "../packem_shared/infer-bindings.d-BUdWC3tw.js";
3
- import { D as DeployDriver } from "../packem_shared/deploy-driver.d-BqO40t1Q.js";
1
+ import { D as DiscoveryCache, G as GeneratedClassModule, I as InferredBindings, S as SchemaInfo } from "../packem_shared/infer-bindings.d-BKaqvxUQ.js";
2
+ export { H as HYPERDRIVE_PLACEHOLDER_ID } from "../packem_shared/infer-bindings.d-BKaqvxUQ.js";
3
+ import { D as DeployDriver } from "../packem_shared/deploy-driver.d-CHVNQFV2.js";
4
4
  import { WranglerQueueProducerIR, WranglerVariableIR } from '@lunora/codegen';
5
5
  /** Apply one structural jsonc edit and return the rewritten text (a no-op edit returns the input). */
6
6
  declare const applyModify: (text: string, path: ReadonlyArray<number | string>, value: unknown) => string;
@@ -1 +1 @@
1
- import{applyModify as o}from"../packem_shared/applyModify-DKP2l6S9.mjs";import{assertWranglerSatisfiesSchema as t}from"../packem_shared/assertWranglerSatisfiesSchema-DGXrk16q.mjs";import{BINDING_MANIFEST_VERSION as i,buildBindingManifest as l}from"../packem_shared/BINDING_MANIFEST_VERSION-CfXEYG8e.mjs";import{CLOUDFLARE_CLI_CONFIG_WARNING_ENV as m,detectCloudflareCliConfig as E,warnCloudflareCliConfigOnce as s}from"../packem_shared/CLOUDFLARE_CLI_CONFIG_WARNING_ENV-BKMrOuXV.mjs";import{default as d}from"../packem_shared/CLOUDFLARE_DRIVER-DJwtY5NT.mjs";import{default as C}from"../packem_shared/GLOBAL_FETCH_STRICTLY_PUBLIC_FLAG-f8CnJha3.mjs";import{hasCloudflareCredentials as R}from"../packem_shared/hasCloudflareCredentials-Bak5w1_6.mjs";import{describeWithheld as _,withheldBindings as I}from"../packem_shared/describeWithheld-CbyzZjZF.mjs";import{bindingsNeedingDatabase as A,startLocalHyperdrive as D}from"../packem_shared/bindingsNeedingDatabase-6eD6Qtqf.mjs";import{readManifest as S,recordManifestKey as W}from"../packem_shared/readManifest-Cighz3WC.mjs";import{HYPERDRIVE_PLACEHOLDER_ID as N}from"../packem_shared/D1_PLACEHOLDER_ID-ZnDjVymH.mjs";import{collectExportGaps as F,reconcileWranglerBindings as b}from"../packem_shared/collectExportGaps-B53R2mba.mjs";import{reconcileWranglerCompatibilityDate as h}from"../packem_shared/reconcileWranglerCompatibilityDate-hocXEuRA.mjs";import{describePreservedCrons as G,reconcileWranglerCrons as M}from"../packem_shared/describePreservedCrons-Bt2rPPeY.mjs";import{reconcileBindingsSafely as U,reconcileWranglerExtras as P}from"../packem_shared/reconcileBindingsSafely-t02cOkaF.mjs";import{REMOTE_ELIGIBLE_KEYS as H,injectRemoteFlags as w,isRemoteEnvEnabled as Y,materializeDevWranglerConfig as K,planRemoteBindings as j,resolveRemoteEnabled as z}from"../packem_shared/REMOTE_ELIGIBLE_KEYS-DooK0pzs.mjs";import{materializeServiceDevConfigs as J}from"../packem_shared/materializeServiceDevConfigs-qUY4_iu1.mjs";import{default as k}from"../packem_shared/CLOUDFLARE_TOOLCHAIN_VERSIONS-DV5E_f_q.mjs";import{withTailConsumer as Z}from"../packem_shared/withTailConsumer-CF3pk_Ov.mjs";import{WORKERS_CACHE_MIN_DATE as ee,isCacheEnabled as re}from"../packem_shared/WORKERS_CACHE_MIN_DATE-0k9ABJtF.mjs";import{wranglerCodegenInputs as ae}from"../packem_shared/wranglerCodegenInputs-BZamZrPz.mjs";import{DEFAULT_OBSERVABILITY as ne,resolveObservabilitySampling as ie}from"../packem_shared/DEFAULT_OBSERVABILITY-CPLADr5u.mjs";import{mergeWranglerEnvironment as fe}from"../packem_shared/mergeWranglerEnvironment-D5ekKj5x.mjs";import{WRANGLER_FILES as Ee,findWranglerFile as se,readWranglerJsonc as pe}from"../packem_shared/WRANGLER_FILES-UNW-xY5u.mjs";import{UNEXPORTED_CLASS_MARKER as ge,validateWranglerProject as Ce}from"../packem_shared/UNEXPORTED_CLASS_MARKER-CntuT4Ck.mjs";import{scanWranglerVariablesForSecrets as Re}from"../packem_shared/scanWranglerVariablesForSecrets-DRBYlMYb.mjs";import{wranglerToAlchemy as _e}from"../packem_shared/wranglerToAlchemy-CBO2ucRm.mjs";import{REQUIRED_COMPATIBILITY_DATE as Le,REQUIRED_FLAG as Ae,validateWrangler as De,validateWranglerConfig as Oe}from"../packem_shared/REQUIRED_COMPATIBILITY_DATE-D4UcOP_t.mjs";export{i as BINDING_MANIFEST_VERSION,m as CLOUDFLARE_CLI_CONFIG_WARNING_ENV,d as CLOUDFLARE_DRIVER,k as CLOUDFLARE_TOOLCHAIN_VERSIONS,ne as DEFAULT_OBSERVABILITY,C as GLOBAL_FETCH_STRICTLY_PUBLIC_FLAG,N as HYPERDRIVE_PLACEHOLDER_ID,H as REMOTE_ELIGIBLE_KEYS,Le as REQUIRED_COMPATIBILITY_DATE,Ae as REQUIRED_FLAG,ge as UNEXPORTED_CLASS_MARKER,ee as WORKERS_CACHE_MIN_DATE,Ee as WRANGLER_FILES,o as applyModify,t as assertWranglerSatisfiesSchema,A as bindingsNeedingDatabase,l as buildBindingManifest,F as collectExportGaps,G as describePreservedCrons,_ as describeWithheld,E as detectCloudflareCliConfig,se as findWranglerFile,R as hasCloudflareCredentials,w as injectRemoteFlags,re as isCacheEnabled,Y as isRemoteEnvEnabled,K as materializeDevWranglerConfig,J as materializeServiceDevConfigs,fe as mergeWranglerEnvironment,j as planRemoteBindings,S as readManifest,pe as readWranglerJsonc,U as reconcileBindingsSafely,b as reconcileWranglerBindings,h as reconcileWranglerCompatibilityDate,M as reconcileWranglerCrons,P as reconcileWranglerExtras,W as recordManifestKey,ie as resolveObservabilitySampling,z as resolveRemoteEnabled,Re as scanWranglerVariablesForSecrets,D as startLocalHyperdrive,De as validateWrangler,Oe as validateWranglerConfig,Ce as validateWranglerProject,s as warnCloudflareCliConfigOnce,Z as withTailConsumer,I as withheldBindings,ae as wranglerCodegenInputs,_e as wranglerToAlchemy};
1
+ import{applyModify as o}from"../packem_shared/applyModify-DKP2l6S9.mjs";import{assertWranglerSatisfiesSchema as t}from"../packem_shared/assertWranglerSatisfiesSchema-DmkdB-OW.mjs";import{BINDING_MANIFEST_VERSION as i,buildBindingManifest as l}from"../packem_shared/BINDING_MANIFEST_VERSION-CfXEYG8e.mjs";import{CLOUDFLARE_CLI_CONFIG_WARNING_ENV as m,detectCloudflareCliConfig as E,warnCloudflareCliConfigOnce as s}from"../packem_shared/CLOUDFLARE_CLI_CONFIG_WARNING_ENV-BKMrOuXV.mjs";import{default as d}from"../packem_shared/CLOUDFLARE_DRIVER-DbmpoIcg.mjs";import{default as C}from"../packem_shared/GLOBAL_FETCH_STRICTLY_PUBLIC_FLAG-f8CnJha3.mjs";import{hasCloudflareCredentials as R}from"../packem_shared/hasCloudflareCredentials-Bak5w1_6.mjs";import{describeWithheld as _,withheldBindings as I}from"../packem_shared/describeWithheld-CbyzZjZF.mjs";import{bindingsNeedingDatabase as A,startLocalHyperdrive as D}from"../packem_shared/bindingsNeedingDatabase-6eD6Qtqf.mjs";import{readManifest as S,recordManifestKey as W}from"../packem_shared/readManifest-Cighz3WC.mjs";import{HYPERDRIVE_PLACEHOLDER_ID as N}from"../packem_shared/D1_PLACEHOLDER_ID-ZnDjVymH.mjs";import{collectExportGaps as F,reconcileWranglerBindings as b}from"../packem_shared/collectExportGaps-CLrCQp09.mjs";import{reconcileWranglerCompatibilityDate as h}from"../packem_shared/reconcileWranglerCompatibilityDate-hocXEuRA.mjs";import{describePreservedCrons as G,reconcileWranglerCrons as M}from"../packem_shared/describePreservedCrons-Bt2rPPeY.mjs";import{reconcileBindingsSafely as U,reconcileWranglerExtras as P}from"../packem_shared/reconcileBindingsSafely-CSov1jsv.mjs";import{REMOTE_ELIGIBLE_KEYS as H,injectRemoteFlags as w,isRemoteEnvEnabled as Y,materializeDevWranglerConfig as K,planRemoteBindings as j,resolveRemoteEnabled as z}from"../packem_shared/REMOTE_ELIGIBLE_KEYS-DooK0pzs.mjs";import{materializeServiceDevConfigs as J}from"../packem_shared/materializeServiceDevConfigs-qUY4_iu1.mjs";import{default as k}from"../packem_shared/CLOUDFLARE_TOOLCHAIN_VERSIONS-DV5E_f_q.mjs";import{withTailConsumer as Z}from"../packem_shared/withTailConsumer-CF3pk_Ov.mjs";import{WORKERS_CACHE_MIN_DATE as ee,isCacheEnabled as re}from"../packem_shared/WORKERS_CACHE_MIN_DATE-0k9ABJtF.mjs";import{wranglerCodegenInputs as ae}from"../packem_shared/wranglerCodegenInputs-BZamZrPz.mjs";import{DEFAULT_OBSERVABILITY as ne,resolveObservabilitySampling as ie}from"../packem_shared/DEFAULT_OBSERVABILITY-CPLADr5u.mjs";import{mergeWranglerEnvironment as fe}from"../packem_shared/mergeWranglerEnvironment-D5ekKj5x.mjs";import{WRANGLER_FILES as Ee,findWranglerFile as se,readWranglerJsonc as pe}from"../packem_shared/WRANGLER_FILES-UNW-xY5u.mjs";import{UNEXPORTED_CLASS_MARKER as ge,validateWranglerProject as Ce}from"../packem_shared/UNEXPORTED_CLASS_MARKER-07SNQ0rP.mjs";import{scanWranglerVariablesForSecrets as Re}from"../packem_shared/scanWranglerVariablesForSecrets-DRBYlMYb.mjs";import{wranglerToAlchemy as _e}from"../packem_shared/wranglerToAlchemy-CBO2ucRm.mjs";import{REQUIRED_COMPATIBILITY_DATE as Le,REQUIRED_FLAG as Ae,validateWrangler as De,validateWranglerConfig as Oe}from"../packem_shared/REQUIRED_COMPATIBILITY_DATE-C8qfwbaA.mjs";export{i as BINDING_MANIFEST_VERSION,m as CLOUDFLARE_CLI_CONFIG_WARNING_ENV,d as CLOUDFLARE_DRIVER,k as CLOUDFLARE_TOOLCHAIN_VERSIONS,ne as DEFAULT_OBSERVABILITY,C as GLOBAL_FETCH_STRICTLY_PUBLIC_FLAG,N as HYPERDRIVE_PLACEHOLDER_ID,H as REMOTE_ELIGIBLE_KEYS,Le as REQUIRED_COMPATIBILITY_DATE,Ae as REQUIRED_FLAG,ge as UNEXPORTED_CLASS_MARKER,ee as WORKERS_CACHE_MIN_DATE,Ee as WRANGLER_FILES,o as applyModify,t as assertWranglerSatisfiesSchema,A as bindingsNeedingDatabase,l as buildBindingManifest,F as collectExportGaps,G as describePreservedCrons,_ as describeWithheld,E as detectCloudflareCliConfig,se as findWranglerFile,R as hasCloudflareCredentials,w as injectRemoteFlags,re as isCacheEnabled,Y as isRemoteEnvEnabled,K as materializeDevWranglerConfig,J as materializeServiceDevConfigs,fe as mergeWranglerEnvironment,j as planRemoteBindings,S as readManifest,pe as readWranglerJsonc,U as reconcileBindingsSafely,b as reconcileWranglerBindings,h as reconcileWranglerCompatibilityDate,M as reconcileWranglerCrons,P as reconcileWranglerExtras,W as recordManifestKey,ie as resolveObservabilitySampling,z as resolveRemoteEnabled,Re as scanWranglerVariablesForSecrets,D as startLocalHyperdrive,De as validateWrangler,Oe as validateWranglerConfig,Ce as validateWranglerProject,s as warnCloudflareCliConfigOnce,Z as withTailConsumer,I as withheldBindings,ae as wranglerCodegenInputs,_e as wranglerToAlchemy};
package/dist/index.d.mts CHANGED
@@ -1,11 +1,11 @@
1
1
  import { AgentIR, ContainerIR, WorkflowIR, CodegenResult } from '@lunora/codegen';
2
2
  export type { AgentIR, ContainerIR, WorkflowIR } from '@lunora/codegen';
3
- export { A as ACCENT, a as AGENT_RULES_DIR, b as AGENT_RULES_HINT, c as AGENT_RULES_HINT_ENV, type d as AgentRulesStatus, B as BADGES, e as BADGE_COLUMN_WIDTH, type f as BadgeName, type g as BadgeSpec, D as DEFAULT_DEPLOY_TARGET, L as LUNA_ART, h as LUNA_BUNNY, i as LUNA_NAME, j as LUNA_SIGNOFF, k as LUNORA_SKILL_NAMES, l as LUNORA_TAG, type m as LevelBadgeName, n as LunoraReporter, type P as PackageManager, type o as PackageManagerProbe, R as ROOT_SKILL_NAME, S as STEP_BADGE_NAMES, type p as StepBadgeName, type T as ToolchainInvocation, q as addArgsFor, r as advisoryLine, s as badgeLead, t as badgeWidth, u as claimAgentRulesHint, v as deployTargetIds, w as detectAgentRules, x as detectInstalledManagers, y as detectPackageManager, z as execArgsFor, C as installArgsFor, E as isRunnableTarget, F as lunoraLine, G as padBadge, H as paintAnswer, I as paintBadge, J as planToolchainInvocation, K as readProjectDependencies, M as readProjectDependencyNames, N as readProjectManifest, O as resolveDeployDriver, Q as runScriptArgsFor, U as runScriptCommand, V as runnableTargetIds, W as targetRunsOwnDevServer, X as toolchainExecArgs } from "./packem_shared/index.d-CGlT0loP.mjs";
3
+ export { A as ACCENT, a as AGENT_RULES_DIR, b as AGENT_RULES_HINT, c as AGENT_RULES_HINT_ENV, type d as AgentRulesStatus, B as BADGES, e as BADGE_COLUMN_WIDTH, type f as BadgeName, type g as BadgeSpec, D as DEFAULT_DEPLOY_TARGET, L as LUNA_ART, h as LUNA_BUNNY, i as LUNA_NAME, j as LUNA_SIGNOFF, k as LUNORA_SKILL_NAMES, l as LUNORA_TAG, type m as LevelBadgeName, n as LunoraReporter, type P as PackageManager, type o as PackageManagerProbe, R as ROOT_SKILL_NAME, S as STEP_BADGE_NAMES, type p as StepBadgeName, type T as ToolchainInvocation, q as addArgsFor, r as advisoryLine, s as badgeLead, t as badgeWidth, u as claimAgentRulesHint, v as deployTargetIds, w as detectAgentRules, x as detectInstalledManagers, y as detectPackageManager, z as execArgsFor, C as installArgsFor, E as isRunnableTarget, F as lunoraLine, G as padBadge, H as paintAnswer, I as paintBadge, J as planToolchainInvocation, K as readProjectDependencies, M as readProjectDependencyNames, N as readProjectManifest, O as resolveDeployDriver, Q as runScriptArgsFor, U as runScriptCommand, V as runnableTargetIds, W as targetRunsOwnDevServer, X as toolchainExecArgs } from "./packem_shared/index.d-BoUSSRrk.mjs";
4
4
  import { ChildProcess } from 'node:child_process';
5
- import { D as DiscoveryCache } from "./packem_shared/infer-bindings.d-BUdWC3tw.mjs";
6
- export { C as COMPOSED_WORKER_ENTRY, a as D1_PLACEHOLDER_ID, b as DURABLE_OBJECT_BINDINGS, type c as DiscoverSchemaInfoResult, d as GENERATED_CLASS_MODULES, e as GENERATED_MODULE_DURABLE_OBJECTS, type G as GeneratedClassModule, type f as InferOptions, type g as InferredAgent, type I as InferredBindings, type h as InferredContainer, type i as InferredWorkflow, M as MERGED_DURABLE_OBJECTS_MODULE, type S as SchemaInfo, j as createDiscoveryCache, k as discoverSchemaInfo, l as inferLunoraBindings, m as isMergedProject, n as isMergedRoleModule, s as secretSourcesFromBindings } from "./packem_shared/infer-bindings.d-BUdWC3tw.mjs";
5
+ import { D as DiscoveryCache } from "./packem_shared/infer-bindings.d-BKaqvxUQ.mjs";
6
+ export { C as COMPOSED_WORKER_ENTRY, a as D1_PLACEHOLDER_ID, b as DURABLE_OBJECT_BINDINGS, type c as DiscoverSchemaInfoResult, d as GENERATED_CLASS_MODULES, e as GENERATED_MODULE_DURABLE_OBJECTS, type G as GeneratedClassModule, type f as InferOptions, type g as InferredAgent, type I as InferredBindings, type h as InferredContainer, type i as InferredWorkflow, M as MERGED_DURABLE_OBJECTS_MODULE, type S as SchemaInfo, j as createDiscoveryCache, k as discoverSchemaInfo, l as inferLunoraBindings, m as isMergedProject, n as isMergedRoleModule, s as secretSourcesFromBindings } from "./packem_shared/infer-bindings.d-BKaqvxUQ.mjs";
7
7
  import { Writable } from 'node:stream';
8
- export type { D as DeployDriver, a as DeployRequest, b as DevRequest, c as DriverToolchain, P as ProjectedConfig, d as ProjectionPurpose, S as SecretRequest, T as TailRequest, e as ToolchainCommand } from "./packem_shared/deploy-driver.d-BqO40t1Q.mjs";
8
+ export type { D as DeployDriver, a as DeployRequest, b as DevRequest, c as DriverToolchain, P as ProjectedConfig, d as ProjectionPurpose, S as SecretRequest, T as TailRequest, e as ToolchainCommand } from "./packem_shared/deploy-driver.d-CHVNQFV2.mjs";
9
9
  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";
10
10
  interface DiscoverAgentInfoResult {
11
11
  /** Discovered agent definitions; `[]` when none are declared or parsing failed. */
package/dist/index.d.ts CHANGED
@@ -1,11 +1,11 @@
1
1
  import { AgentIR, ContainerIR, WorkflowIR, CodegenResult } from '@lunora/codegen';
2
2
  export type { AgentIR, ContainerIR, WorkflowIR } from '@lunora/codegen';
3
- export { A as ACCENT, a as AGENT_RULES_DIR, b as AGENT_RULES_HINT, c as AGENT_RULES_HINT_ENV, type d as AgentRulesStatus, B as BADGES, e as BADGE_COLUMN_WIDTH, type f as BadgeName, type g as BadgeSpec, D as DEFAULT_DEPLOY_TARGET, L as LUNA_ART, h as LUNA_BUNNY, i as LUNA_NAME, j as LUNA_SIGNOFF, k as LUNORA_SKILL_NAMES, l as LUNORA_TAG, type m as LevelBadgeName, n as LunoraReporter, type P as PackageManager, type o as PackageManagerProbe, R as ROOT_SKILL_NAME, S as STEP_BADGE_NAMES, type p as StepBadgeName, type T as ToolchainInvocation, q as addArgsFor, r as advisoryLine, s as badgeLead, t as badgeWidth, u as claimAgentRulesHint, v as deployTargetIds, w as detectAgentRules, x as detectInstalledManagers, y as detectPackageManager, z as execArgsFor, C as installArgsFor, E as isRunnableTarget, F as lunoraLine, G as padBadge, H as paintAnswer, I as paintBadge, J as planToolchainInvocation, K as readProjectDependencies, M as readProjectDependencyNames, N as readProjectManifest, O as resolveDeployDriver, Q as runScriptArgsFor, U as runScriptCommand, V as runnableTargetIds, W as targetRunsOwnDevServer, X as toolchainExecArgs } from "./packem_shared/index.d-BuYbPa9W.js";
3
+ export { A as ACCENT, a as AGENT_RULES_DIR, b as AGENT_RULES_HINT, c as AGENT_RULES_HINT_ENV, type d as AgentRulesStatus, B as BADGES, e as BADGE_COLUMN_WIDTH, type f as BadgeName, type g as BadgeSpec, D as DEFAULT_DEPLOY_TARGET, L as LUNA_ART, h as LUNA_BUNNY, i as LUNA_NAME, j as LUNA_SIGNOFF, k as LUNORA_SKILL_NAMES, l as LUNORA_TAG, type m as LevelBadgeName, n as LunoraReporter, type P as PackageManager, type o as PackageManagerProbe, R as ROOT_SKILL_NAME, S as STEP_BADGE_NAMES, type p as StepBadgeName, type T as ToolchainInvocation, q as addArgsFor, r as advisoryLine, s as badgeLead, t as badgeWidth, u as claimAgentRulesHint, v as deployTargetIds, w as detectAgentRules, x as detectInstalledManagers, y as detectPackageManager, z as execArgsFor, C as installArgsFor, E as isRunnableTarget, F as lunoraLine, G as padBadge, H as paintAnswer, I as paintBadge, J as planToolchainInvocation, K as readProjectDependencies, M as readProjectDependencyNames, N as readProjectManifest, O as resolveDeployDriver, Q as runScriptArgsFor, U as runScriptCommand, V as runnableTargetIds, W as targetRunsOwnDevServer, X as toolchainExecArgs } from "./packem_shared/index.d-C1nVDcie.js";
4
4
  import { ChildProcess } from 'node:child_process';
5
- import { D as DiscoveryCache } from "./packem_shared/infer-bindings.d-BUdWC3tw.js";
6
- export { C as COMPOSED_WORKER_ENTRY, a as D1_PLACEHOLDER_ID, b as DURABLE_OBJECT_BINDINGS, type c as DiscoverSchemaInfoResult, d as GENERATED_CLASS_MODULES, e as GENERATED_MODULE_DURABLE_OBJECTS, type G as GeneratedClassModule, type f as InferOptions, type g as InferredAgent, type I as InferredBindings, type h as InferredContainer, type i as InferredWorkflow, M as MERGED_DURABLE_OBJECTS_MODULE, type S as SchemaInfo, j as createDiscoveryCache, k as discoverSchemaInfo, l as inferLunoraBindings, m as isMergedProject, n as isMergedRoleModule, s as secretSourcesFromBindings } from "./packem_shared/infer-bindings.d-BUdWC3tw.js";
5
+ import { D as DiscoveryCache } from "./packem_shared/infer-bindings.d-BKaqvxUQ.js";
6
+ export { C as COMPOSED_WORKER_ENTRY, a as D1_PLACEHOLDER_ID, b as DURABLE_OBJECT_BINDINGS, type c as DiscoverSchemaInfoResult, d as GENERATED_CLASS_MODULES, e as GENERATED_MODULE_DURABLE_OBJECTS, type G as GeneratedClassModule, type f as InferOptions, type g as InferredAgent, type I as InferredBindings, type h as InferredContainer, type i as InferredWorkflow, M as MERGED_DURABLE_OBJECTS_MODULE, type S as SchemaInfo, j as createDiscoveryCache, k as discoverSchemaInfo, l as inferLunoraBindings, m as isMergedProject, n as isMergedRoleModule, s as secretSourcesFromBindings } from "./packem_shared/infer-bindings.d-BKaqvxUQ.js";
7
7
  import { Writable } from 'node:stream';
8
- export type { D as DeployDriver, a as DeployRequest, b as DevRequest, c as DriverToolchain, P as ProjectedConfig, d as ProjectionPurpose, S as SecretRequest, T as TailRequest, e as ToolchainCommand } from "./packem_shared/deploy-driver.d-BqO40t1Q.js";
8
+ export type { D as DeployDriver, a as DeployRequest, b as DevRequest, c as DriverToolchain, P as ProjectedConfig, d as ProjectionPurpose, S as SecretRequest, T as TailRequest, e as ToolchainCommand } from "./packem_shared/deploy-driver.d-CHVNQFV2.js";
9
9
  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";
10
10
  interface DiscoverAgentInfoResult {
11
11
  /** 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-pqFMJBtJ.mjs";import{AGENT_RULES_DIR as i,AGENT_RULES_HINT as n,AGENT_RULES_HINT_ENV as _,LUNORA_SKILL_NAMES as l,ROOT_SKILL_NAME as c,claimAgentRulesHint as p,detectAgentRules as D}from"./packem_shared/AGENT_RULES_DIR-Bd6JPtNa.mjs";import{clearApiSpecMarker as A,readApiSpecMarker as m,writeApiSpecMarker as S}from"./packem_shared/clearApiSpecMarker-DMGpP41V.mjs";import{MissingBuildOutputError as L}from"./packem_shared/MissingBuildOutputError-BAyekzof.mjs";import{default as T}from"./packem_shared/canonicalPath-DrfMiT3U.mjs";import{probeCelldToolchain as v}from"./packem_shared/probeCelldToolchain-DxDttfHy.mjs";import{startCelldDevSession as g,writeCelldDevProjection as I}from"./packem_shared/startCelldDevSession-BKRiLvt-.mjs";import{D1_PLACEHOLDER_ID as u}from"./packem_shared/D1_PLACEHOLDER_ID-ZnDjVymH.mjs";import{BUILD_ROOT_ENV as P,BUILD_TARGET_ENV as C,BUNDLE_META_PATH_ENV as M,CODEGEN_ENV as U,DEFAULT_BUNDLE_META_PATH as F,LAZY_FUNCTIONS_ENV as B,STRICT_ADVISORIES_ENV as G,isCodegenDisabled as b,isLazyFunctionsEnabled as y,resolveLazyFunctions as k}from"./packem_shared/BUILD_ROOT_ENV-Dg4MV3wY.mjs";import{discoverContainerInfo as j}from"./packem_shared/discoverContainerInfo-DzXr7Vm3.mjs";import{streamContainerLogs as K}from"./packem_shared/streamContainerLogs-0nko1qpv.mjs";import{detectFramework as W,projectUsesUmbrella as Y}from"./packem_shared/detectFramework-Dfpvu6rD.mjs";import{acceptsConnection as z,startDevProcess as q}from"./packem_shared/acceptsConnection-DHhUYGjT.mjs";import{DEV_BINDINGS_FILE as Z,DEV_DAEMON_ENV as Q,DEV_HANDOFF_ENV as $,DEV_LOG_FILE as ee,DEV_LOG_FILE_ENV as re,DEV_STATE_DIR as oe,DEV_STATE_FILE as te,claimDevServerState as ae,clearDevServerState as Ee,isDevServerReady as se,isProcessAlive as ie,isRecordedProcessCurrent as ne,readDevServerState as _e,readLiveDevServerState as le,updateDevServerState as ce,writeDevServerState as pe}from"./packem_shared/DEV_BINDINGS_FILE-C0ZN_XlP.mjs";import{DEV_VARS_EXAMPLE_FILE as de,DEV_VARS_FILE as Ae,DEV_VARS_KEY_PATTERN as me,escapeRegExp as Se,parseDevVariableEntries as fe,removeDevVariableLine as Le,upsertDevVariableLine as Ne}from"./packem_shared/DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";import{DEV_WORKER_ENV_VALUE as Re,DEV_WORKER_ENV_VAR as ve,ensureDevWorkerEnv as xe}from"./packem_shared/DEV_WORKER_ENV_VALUE-CgozgOxh.mjs";import{createDiscoveryCache as Ie}from"./packem_shared/createDiscoveryCache-npJI4uej.mjs";import{DEFAULT_DEPLOY_TARGET as ue,deployTargetIds as Oe,isRunnableTarget as Pe,planToolchainInvocation as Ce,resolveDeployDriver as Me,runnableTargetIds as Ue,targetRunsOwnDevServer as Fe}from"./packem_shared/DEFAULT_DEPLOY_TARGET-D_krePy-.mjs";import{default as Ge}from"./packem_shared/ensureGitignoreEntries-Tsk8Qkw7.mjs";import{inferLunoraBindings as ye,secretSourcesFromBindings as ke}from"./packem_shared/inferLunoraBindings-DvB8IpbN.mjs";import{LINKED_PROJECT_DIR as je,LINKED_PROJECT_FILE as we,readLinkedProject as Ke,writeLinkedProject as He}from"./packem_shared/LINKED_PROJECT_DIR-Ba5qPEwo.mjs";import{LUNORA_IGNORED_PATHS as Ye,applyLintIgnores as Je,detectLintTools as ze}from"./packem_shared/LUNORA_IGNORED_PATHS-U93uPxrW.mjs";import{blockingFindingsMessage as Xe,reportCodegenFindings as Ze}from"./packem_shared/blockingFindingsMessage-CRbg1sla.mjs";import{LUNORA_EVENT_SOURCE as $e,formatLunoraEvent as er}from"./packem_shared/LUNORA_EVENT_SOURCE-B9ZVohjO.mjs";import{LUNORA_TAG as or,advisoryLine as tr,lunoraLine as ar}from"./packem_shared/LUNORA_TAG-DQTGPqcJ.mjs";import{default as sr}from"./packem_shared/LunoraReporter-f277GLNT.mjs";import{addArgsFor as nr,detectInstalledManagers as _r,detectPackageManager as lr,execArgsFor as cr,installArgsFor as pr,runScriptArgsFor as Dr,runScriptCommand as dr,toolchainExecArgs as Ar}from"./packem_shared/addArgsFor-CYZKhNIo.mjs";import{P as Sr,m as fr,s as Lr}from"./packem_shared/package-secrets-registry-UQ_uEAB_.mjs";import{runPostCodegenHook as Tr}from"./packem_shared/runPostCodegenHook-Dx3yTsYZ.mjs";import{assertBuildTargetMatches as vr,interpretRemote as xr,readProjectRemotePreference as gr,readProjectTarget as Ir,resolveProjectTarget as Vr,resolveTargetOrThrow as ur}from"./packem_shared/assertBuildTargetMatches-t0UvJp_O.mjs";import{readProjectDependencies as Pr,readProjectDependencyNames as Cr,readProjectManifest as Mr}from"./packem_shared/readProjectDependencies-l3uhUKjo.mjs";import{createConfirm as Fr,isInteractive as Br,promptMultiSelect as Gr,promptSelect as br,promptText as yr,promptYesNo as kr}from"./packem_shared/createConfirm-D5mKTMHj.mjs";import{default as jr}from"./packem_shared/resolveSchemaDirectory-Ca5P6KuP.mjs";import{buildPackageSecretsBlock as Kr,ensureDevVariables as Hr,ensureDevVarsExample as Wr,fillDevSecrets as Yr,generateSecretValue as Jr,isMintableSecretKey as zr,isPlaceholderValue as qr,planDevSecretsFill as Xr,planDevVariablesAugment as Zr,planDevVariablesScaffold as Qr,requiredSecrets as $r,writeDevVariablesFileAtomically as eo}from"./packem_shared/buildPackageSecretsBlock-GvaLgvFN.mjs";import{applyAdditiveEdit as oo,classifyEdit as to}from"./packem_shared/applyAdditiveEdit-DEwPKcJg.mjs";import{parseSchema as Eo}from"./packem_shared/parseSchema-D1Wbr1qv.mjs";import{classifyPolicyEdit as io,resolveServerModule as no,scaffoldPolicyFile as _o,wireRlsIntoProcedure as lo}from"./packem_shared/classifyPolicyEdit-DJi9Fk8G.mjs";import{discoverSchemaInfo as po}from"./packem_shared/discoverSchemaInfo-DRPnqgif.mjs";import{ACCENT as Ao,BADGES as mo,BADGE_COLUMN_WIDTH as So,LUNA_ART as fo,LUNA_BUNNY as Lo,LUNA_NAME as No,LUNA_SIGNOFF as To,STEP_BADGE_NAMES as Ro,badgeLead as vo,badgeWidth as xo,padBadge as go,paintAnswer as Io,paintBadge as Vo}from"./packem_shared/ACCENT-CotPTfv7.mjs";import{COMPOSED_WORKER_ENTRY as Oo,DURABLE_OBJECT_BINDINGS as Po,GENERATED_CLASS_MODULES as Co,GENERATED_MODULE_DURABLE_OBJECTS as Mo,MERGED_DURABLE_OBJECTS_MODULE as Uo,isMergedProject as Fo,isMergedRoleModule as Bo}from"./packem_shared/COMPOSED_WORKER_ENTRY-Ciiba5g_.mjs";import{discoverWorkflowInfo as bo}from"./packem_shared/discoverWorkflowInfo-zW7Tt0Tn.mjs";export{Ao as ACCENT,o as AGENT_MODE_ENV,i as AGENT_RULES_DIR,n as AGENT_RULES_HINT,_ as AGENT_RULES_HINT_ENV,mo as BADGES,So as BADGE_COLUMN_WIDTH,P as BUILD_ROOT_ENV,C as BUILD_TARGET_ENV,M as BUNDLE_META_PATH_ENV,U as CODEGEN_ENV,Oo as COMPOSED_WORKER_ENTRY,u as D1_PLACEHOLDER_ID,F as DEFAULT_BUNDLE_META_PATH,ue as DEFAULT_DEPLOY_TARGET,Z as DEV_BINDINGS_FILE,Q as DEV_DAEMON_ENV,$ as DEV_HANDOFF_ENV,ee as DEV_LOG_FILE,re as DEV_LOG_FILE_ENV,oe as DEV_STATE_DIR,te as DEV_STATE_FILE,de as DEV_VARS_EXAMPLE_FILE,Ae as DEV_VARS_FILE,me as DEV_VARS_KEY_PATTERN,Re as DEV_WORKER_ENV_VALUE,ve as DEV_WORKER_ENV_VAR,Po as DURABLE_OBJECT_BINDINGS,Co as GENERATED_CLASS_MODULES,Mo as GENERATED_MODULE_DURABLE_OBJECTS,B as LAZY_FUNCTIONS_ENV,je as LINKED_PROJECT_DIR,we as LINKED_PROJECT_FILE,fo as LUNA_ART,Lo as LUNA_BUNNY,No as LUNA_NAME,To as LUNA_SIGNOFF,$e as LUNORA_EVENT_SOURCE,Ye as LUNORA_IGNORED_PATHS,l as LUNORA_SKILL_NAMES,or as LUNORA_TAG,sr as LunoraReporter,Uo as MERGED_DURABLE_OBJECTS_MODULE,L as MissingBuildOutputError,Sr as PACKAGE_SECRETS_REGISTRY,c as ROOT_SKILL_NAME,Ro as STEP_BADGE_NAMES,G as STRICT_ADVISORIES_ENV,z as acceptsConnection,nr as addArgsFor,tr as advisoryLine,oo as applyAdditiveEdit,Je as applyLintIgnores,vr as assertBuildTargetMatches,vo as badgeLead,xo as badgeWidth,Xe as blockingFindingsMessage,Kr as buildPackageSecretsBlock,T as canonicalPath,p as claimAgentRulesHint,ae as claimDevServerState,to as classifyEdit,io as classifyPolicyEdit,A as clearApiSpecMarker,Ee as clearDevServerState,Fr as createConfirm,Ie as createDiscoveryCache,Oe as deployTargetIds,D as detectAgentRules,t as detectAiAgent,W as detectFramework,_r as detectInstalledManagers,ze as detectLintTools,lr as detectPackageManager,E as discoverAgentInfo,j as discoverContainerInfo,po as discoverSchemaInfo,bo as discoverWorkflowInfo,Hr as ensureDevVariables,Wr as ensureDevVarsExample,xe as ensureDevWorkerEnv,Ge as ensureGitignoreEntries,Se as escapeRegExp,cr as execArgsFor,Yr as fillDevSecrets,er as formatLunoraEvent,Jr as generateSecretValue,ye as inferLunoraBindings,pr as installArgsFor,xr as interpretRemote,b as isCodegenDisabled,se as isDevServerReady,Br as isInteractive,y as isLazyFunctionsEnabled,Fo as isMergedProject,Bo as isMergedRoleModule,zr as isMintableSecretKey,qr as isPlaceholderValue,ie as isProcessAlive,ne as isRecordedProcessCurrent,Pe as isRunnableTarget,ar as lunoraLine,fr as mintableSecretKeysFor,go as padBadge,Io as paintAnswer,Vo as paintBadge,fe as parseDevVariableEntries,Eo as parseSchema,Xr as planDevSecretsFill,Zr as planDevVariablesAugment,Qr as planDevVariablesScaffold,Ce as planToolchainInvocation,v as probeCelldToolchain,Y as projectUsesUmbrella,Gr as promptMultiSelect,br as promptSelect,yr as promptText,kr as promptYesNo,m as readApiSpecMarker,_e as readDevServerState,Ke as readLinkedProject,le as readLiveDevServerState,Pr as readProjectDependencies,Cr as readProjectDependencyNames,Mr as readProjectManifest,gr as readProjectRemotePreference,Ir as readProjectTarget,Le as removeDevVariableLine,Ze as reportCodegenFindings,$r as requiredSecrets,Me as resolveDeployDriver,k as resolveLazyFunctions,Vr as resolveProjectTarget,jr as resolveSchemaDirectory,no as resolveServerModule,ur as resolveTargetOrThrow,Tr as runPostCodegenHook,Dr as runScriptArgsFor,dr as runScriptCommand,Ue as runnableTargetIds,_o as scaffoldPolicyFile,ke as secretSourcesFromBindings,Lr as secretsForPackages,g as startCelldDevSession,q as startDevProcess,K as streamContainerLogs,Fe as targetRunsOwnDevServer,Ar as toolchainExecArgs,ce as updateDevServerState,Ne as upsertDevVariableLine,lo as wireRlsIntoProcedure,S as writeApiSpecMarker,I as writeCelldDevProjection,pe as writeDevServerState,eo as writeDevVariablesFileAtomically,He 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-pqFMJBtJ.mjs";import{AGENT_RULES_DIR as i,AGENT_RULES_HINT as n,AGENT_RULES_HINT_ENV as _,LUNORA_SKILL_NAMES as l,ROOT_SKILL_NAME as c,claimAgentRulesHint as p,detectAgentRules as D}from"./packem_shared/AGENT_RULES_DIR-Bd6JPtNa.mjs";import{clearApiSpecMarker as A,readApiSpecMarker as m,writeApiSpecMarker as S}from"./packem_shared/clearApiSpecMarker-DMGpP41V.mjs";import{MissingBuildOutputError as L}from"./packem_shared/MissingBuildOutputError-BAyekzof.mjs";import{default as T}from"./packem_shared/canonicalPath-DrfMiT3U.mjs";import{probeCelldToolchain as v}from"./packem_shared/probeCelldToolchain-DxDttfHy.mjs";import{startCelldDevSession as g,writeCelldDevProjection as I}from"./packem_shared/startCelldDevSession-BKRiLvt-.mjs";import{D1_PLACEHOLDER_ID as u}from"./packem_shared/D1_PLACEHOLDER_ID-ZnDjVymH.mjs";import{BUILD_ROOT_ENV as P,BUILD_TARGET_ENV as C,BUNDLE_META_PATH_ENV as M,CODEGEN_ENV as U,DEFAULT_BUNDLE_META_PATH as F,LAZY_FUNCTIONS_ENV as B,STRICT_ADVISORIES_ENV as G,isCodegenDisabled as b,isLazyFunctionsEnabled as y,resolveLazyFunctions as k}from"./packem_shared/BUILD_ROOT_ENV-Dg4MV3wY.mjs";import{discoverContainerInfo as j}from"./packem_shared/discoverContainerInfo-DzXr7Vm3.mjs";import{streamContainerLogs as K}from"./packem_shared/streamContainerLogs-0nko1qpv.mjs";import{detectFramework as W,projectUsesUmbrella as Y}from"./packem_shared/detectFramework-Dfpvu6rD.mjs";import{acceptsConnection as z,startDevProcess as q}from"./packem_shared/acceptsConnection-DHhUYGjT.mjs";import{DEV_BINDINGS_FILE as Z,DEV_DAEMON_ENV as Q,DEV_HANDOFF_ENV as $,DEV_LOG_FILE as ee,DEV_LOG_FILE_ENV as re,DEV_STATE_DIR as oe,DEV_STATE_FILE as te,claimDevServerState as ae,clearDevServerState as Ee,isDevServerReady as se,isProcessAlive as ie,isRecordedProcessCurrent as ne,readDevServerState as _e,readLiveDevServerState as le,updateDevServerState as ce,writeDevServerState as pe}from"./packem_shared/DEV_BINDINGS_FILE-C0ZN_XlP.mjs";import{DEV_VARS_EXAMPLE_FILE as de,DEV_VARS_FILE as Ae,DEV_VARS_KEY_PATTERN as me,escapeRegExp as Se,parseDevVariableEntries as fe,removeDevVariableLine as Le,upsertDevVariableLine as Ne}from"./packem_shared/DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";import{DEV_WORKER_ENV_VALUE as Re,DEV_WORKER_ENV_VAR as ve,ensureDevWorkerEnv as xe}from"./packem_shared/DEV_WORKER_ENV_VALUE-CgozgOxh.mjs";import{createDiscoveryCache as Ie}from"./packem_shared/createDiscoveryCache-npJI4uej.mjs";import{DEFAULT_DEPLOY_TARGET as ue,deployTargetIds as Oe,isRunnableTarget as Pe,planToolchainInvocation as Ce,resolveDeployDriver as Me,runnableTargetIds as Ue,targetRunsOwnDevServer as Fe}from"./packem_shared/DEFAULT_DEPLOY_TARGET-DllYb7Tj.mjs";import{default as Ge}from"./packem_shared/ensureGitignoreEntries-Tsk8Qkw7.mjs";import{inferLunoraBindings as ye,secretSourcesFromBindings as ke}from"./packem_shared/inferLunoraBindings-BiRE_Jh9.mjs";import{LINKED_PROJECT_DIR as je,LINKED_PROJECT_FILE as we,readLinkedProject as Ke,writeLinkedProject as He}from"./packem_shared/LINKED_PROJECT_DIR-Ba5qPEwo.mjs";import{LUNORA_IGNORED_PATHS as Ye,applyLintIgnores as Je,detectLintTools as ze}from"./packem_shared/LUNORA_IGNORED_PATHS-U93uPxrW.mjs";import{blockingFindingsMessage as Xe,reportCodegenFindings as Ze}from"./packem_shared/blockingFindingsMessage-CRbg1sla.mjs";import{LUNORA_EVENT_SOURCE as $e,formatLunoraEvent as er}from"./packem_shared/LUNORA_EVENT_SOURCE-B9ZVohjO.mjs";import{LUNORA_TAG as or,advisoryLine as tr,lunoraLine as ar}from"./packem_shared/LUNORA_TAG-DQTGPqcJ.mjs";import{default as sr}from"./packem_shared/LunoraReporter-f277GLNT.mjs";import{addArgsFor as nr,detectInstalledManagers as _r,detectPackageManager as lr,execArgsFor as cr,installArgsFor as pr,runScriptArgsFor as Dr,runScriptCommand as dr,toolchainExecArgs as Ar}from"./packem_shared/addArgsFor-CYZKhNIo.mjs";import{P as Sr,m as fr,s as Lr}from"./packem_shared/package-secrets-registry-UQ_uEAB_.mjs";import{runPostCodegenHook as Tr}from"./packem_shared/runPostCodegenHook-Dx3yTsYZ.mjs";import{assertBuildTargetMatches as vr,interpretRemote as xr,readProjectRemotePreference as gr,readProjectTarget as Ir,resolveProjectTarget as Vr,resolveTargetOrThrow as ur}from"./packem_shared/assertBuildTargetMatches-CqrrwiQ-.mjs";import{readProjectDependencies as Pr,readProjectDependencyNames as Cr,readProjectManifest as Mr}from"./packem_shared/readProjectDependencies-l3uhUKjo.mjs";import{createConfirm as Fr,isInteractive as Br,promptMultiSelect as Gr,promptSelect as br,promptText as yr,promptYesNo as kr}from"./packem_shared/createConfirm-D5mKTMHj.mjs";import{default as jr}from"./packem_shared/resolveSchemaDirectory-Ca5P6KuP.mjs";import{buildPackageSecretsBlock as Kr,ensureDevVariables as Hr,ensureDevVarsExample as Wr,fillDevSecrets as Yr,generateSecretValue as Jr,isMintableSecretKey as zr,isPlaceholderValue as qr,planDevSecretsFill as Xr,planDevVariablesAugment as Zr,planDevVariablesScaffold as Qr,requiredSecrets as $r,writeDevVariablesFileAtomically as eo}from"./packem_shared/buildPackageSecretsBlock-GvaLgvFN.mjs";import{applyAdditiveEdit as oo,classifyEdit as to}from"./packem_shared/applyAdditiveEdit-DEwPKcJg.mjs";import{parseSchema as Eo}from"./packem_shared/parseSchema-D1Wbr1qv.mjs";import{classifyPolicyEdit as io,resolveServerModule as no,scaffoldPolicyFile as _o,wireRlsIntoProcedure as lo}from"./packem_shared/classifyPolicyEdit-DJi9Fk8G.mjs";import{discoverSchemaInfo as po}from"./packem_shared/discoverSchemaInfo-DRPnqgif.mjs";import{ACCENT as Ao,BADGES as mo,BADGE_COLUMN_WIDTH as So,LUNA_ART as fo,LUNA_BUNNY as Lo,LUNA_NAME as No,LUNA_SIGNOFF as To,STEP_BADGE_NAMES as Ro,badgeLead as vo,badgeWidth as xo,padBadge as go,paintAnswer as Io,paintBadge as Vo}from"./packem_shared/ACCENT-CotPTfv7.mjs";import{COMPOSED_WORKER_ENTRY as Oo,DURABLE_OBJECT_BINDINGS as Po,GENERATED_CLASS_MODULES as Co,GENERATED_MODULE_DURABLE_OBJECTS as Mo,MERGED_DURABLE_OBJECTS_MODULE as Uo,isMergedProject as Fo,isMergedRoleModule as Bo}from"./packem_shared/COMPOSED_WORKER_ENTRY-BcFt6ts5.mjs";import{discoverWorkflowInfo as bo}from"./packem_shared/discoverWorkflowInfo-zW7Tt0Tn.mjs";export{Ao as ACCENT,o as AGENT_MODE_ENV,i as AGENT_RULES_DIR,n as AGENT_RULES_HINT,_ as AGENT_RULES_HINT_ENV,mo as BADGES,So as BADGE_COLUMN_WIDTH,P as BUILD_ROOT_ENV,C as BUILD_TARGET_ENV,M as BUNDLE_META_PATH_ENV,U as CODEGEN_ENV,Oo as COMPOSED_WORKER_ENTRY,u as D1_PLACEHOLDER_ID,F as DEFAULT_BUNDLE_META_PATH,ue as DEFAULT_DEPLOY_TARGET,Z as DEV_BINDINGS_FILE,Q as DEV_DAEMON_ENV,$ as DEV_HANDOFF_ENV,ee as DEV_LOG_FILE,re as DEV_LOG_FILE_ENV,oe as DEV_STATE_DIR,te as DEV_STATE_FILE,de as DEV_VARS_EXAMPLE_FILE,Ae as DEV_VARS_FILE,me as DEV_VARS_KEY_PATTERN,Re as DEV_WORKER_ENV_VALUE,ve as DEV_WORKER_ENV_VAR,Po as DURABLE_OBJECT_BINDINGS,Co as GENERATED_CLASS_MODULES,Mo as GENERATED_MODULE_DURABLE_OBJECTS,B as LAZY_FUNCTIONS_ENV,je as LINKED_PROJECT_DIR,we as LINKED_PROJECT_FILE,fo as LUNA_ART,Lo as LUNA_BUNNY,No as LUNA_NAME,To as LUNA_SIGNOFF,$e as LUNORA_EVENT_SOURCE,Ye as LUNORA_IGNORED_PATHS,l as LUNORA_SKILL_NAMES,or as LUNORA_TAG,sr as LunoraReporter,Uo as MERGED_DURABLE_OBJECTS_MODULE,L as MissingBuildOutputError,Sr as PACKAGE_SECRETS_REGISTRY,c as ROOT_SKILL_NAME,Ro as STEP_BADGE_NAMES,G as STRICT_ADVISORIES_ENV,z as acceptsConnection,nr as addArgsFor,tr as advisoryLine,oo as applyAdditiveEdit,Je as applyLintIgnores,vr as assertBuildTargetMatches,vo as badgeLead,xo as badgeWidth,Xe as blockingFindingsMessage,Kr as buildPackageSecretsBlock,T as canonicalPath,p as claimAgentRulesHint,ae as claimDevServerState,to as classifyEdit,io as classifyPolicyEdit,A as clearApiSpecMarker,Ee as clearDevServerState,Fr as createConfirm,Ie as createDiscoveryCache,Oe as deployTargetIds,D as detectAgentRules,t as detectAiAgent,W as detectFramework,_r as detectInstalledManagers,ze as detectLintTools,lr as detectPackageManager,E as discoverAgentInfo,j as discoverContainerInfo,po as discoverSchemaInfo,bo as discoverWorkflowInfo,Hr as ensureDevVariables,Wr as ensureDevVarsExample,xe as ensureDevWorkerEnv,Ge as ensureGitignoreEntries,Se as escapeRegExp,cr as execArgsFor,Yr as fillDevSecrets,er as formatLunoraEvent,Jr as generateSecretValue,ye as inferLunoraBindings,pr as installArgsFor,xr as interpretRemote,b as isCodegenDisabled,se as isDevServerReady,Br as isInteractive,y as isLazyFunctionsEnabled,Fo as isMergedProject,Bo as isMergedRoleModule,zr as isMintableSecretKey,qr as isPlaceholderValue,ie as isProcessAlive,ne as isRecordedProcessCurrent,Pe as isRunnableTarget,ar as lunoraLine,fr as mintableSecretKeysFor,go as padBadge,Io as paintAnswer,Vo as paintBadge,fe as parseDevVariableEntries,Eo as parseSchema,Xr as planDevSecretsFill,Zr as planDevVariablesAugment,Qr as planDevVariablesScaffold,Ce as planToolchainInvocation,v as probeCelldToolchain,Y as projectUsesUmbrella,Gr as promptMultiSelect,br as promptSelect,yr as promptText,kr as promptYesNo,m as readApiSpecMarker,_e as readDevServerState,Ke as readLinkedProject,le as readLiveDevServerState,Pr as readProjectDependencies,Cr as readProjectDependencyNames,Mr as readProjectManifest,gr as readProjectRemotePreference,Ir as readProjectTarget,Le as removeDevVariableLine,Ze as reportCodegenFindings,$r as requiredSecrets,Me as resolveDeployDriver,k as resolveLazyFunctions,Vr as resolveProjectTarget,jr as resolveSchemaDirectory,no as resolveServerModule,ur as resolveTargetOrThrow,Tr as runPostCodegenHook,Dr as runScriptArgsFor,dr as runScriptCommand,Ue as runnableTargetIds,_o as scaffoldPolicyFile,ke as secretSourcesFromBindings,Lr as secretsForPackages,g as startCelldDevSession,q as startDevProcess,K as streamContainerLogs,Fe as targetRunsOwnDevServer,Ar as toolchainExecArgs,ce as updateDevServerState,Ne as upsertDevVariableLine,lo as wireRlsIntoProcedure,S as writeApiSpecMarker,I as writeCelldDevProjection,pe as writeDevServerState,eo as writeDevVariablesFileAtomically,He as writeLinkedProject};
@@ -0,0 +1 @@
1
+ const i={devServer:"workerd",prebuildsContainerImages:!0,deploy:o=>{if(o.preview===!0)throw new Error("the Cloudflare driver cannot build a preview upload; deploy an isolated preview with `lunora preview deploy`");const r=["deploy"];return o.entry!==void 0&&r.push(o.entry),o.configPath!==void 0&&r.push("--config",o.configPath),o.environment!==void 0&&r.push("--env",o.environment),o.temporary===!0&&r.push("--temporary"),o.dryRun===!0&&r.push("--dry-run"),o.secretsFile!==void 0&&r.push("--secrets-file",o.secretsFile),o.outDir!==void 0&&r.push("--outdir",o.outDir,"--metafile"),o.outFile!==void 0&&r.push("--outfile",o.outFile),{args:r,tool:"wrangler"}},dev:o=>{const r=["dev"];return o.configPath!==void 0&&r.push("--config",o.configPath),o.environment!==void 0&&r.push("--env",o.environment),r.push(...o.extraArgs??[]),{args:r,tool:"wrangler"}},secretList:o=>{const r=["secret","list","--format","json"];return o.environment!==void 0&&r.push("--env",o.environment),o.temporary===!0&&r.push("--temporary"),{args:r,tool:"wrangler"}},secretBulk:o=>{const r=["secret","bulk"];return o.environment!==void 0&&r.push("--env",o.environment),o.temporary===!0&&r.push("--temporary"),{args:r,tool:"wrangler"}},secretPut:o=>{const r=["secret","put",o.key??""];return o.environment!==void 0&&r.push("--env",o.environment),o.temporary===!0&&r.push("--temporary"),{args:r,tool:"wrangler"}},tail:o=>{const r=["tail"];return o.worker!==void 0&&r.push(o.worker),o.environment!==void 0&&r.push("--env",o.environment),o.format!==void 0&&r.push("--format",o.format),o.status!==void 0&&r.push("--status",o.status),o.search!==void 0&&r.push("--search",o.search),o.temporary===!0&&r.push("--temporary"),{args:r,tool:"wrangler"}}},n={id:"cloudflare",name:"Cloudflare",toolchain:i};export{n as default};
@@ -0,0 +1 @@
1
+ import{existsSync as E,readFileSync as O}from"node:fs";import{parse as u}from"es-module-lexer";import{WRANGLER_FILES as b,readWranglerJsonc as f}from"./WRANGLER_FILES-UNW-xY5u.mjs";import{escapeRegExp as S}from"./DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";import{join as c}from"node:path";const g="_generated",x=["src/server.ts","src/server/index.ts","src/server/index.tsx","src/index.ts","src/worker.ts"],h=new Set(["build","coverage","dist",g,"node_modules","out","target"]),w=new Set([".client",".server"]),A=/[/\\]/u,T=t=>{const e=[];for(const r of t.split(A))r===""||r==="."||(r===".."&&e.length>0&&e.at(-1)!==".."?e.pop():e.push(r));return e},L=t=>T(t).slice(0,-1).some(e=>h.has(e)||e.startsWith(".")&&!w.has(e)),i={AdminRevocationDO:"ADMIN_REVOCATIONS",LunoraDO:"SHARD",SchedulerDO:"SCHEDULER",SessionDO:"SESSION",ShardDO:"SHARD",ShardRegistryDO:"SHARD_REGISTRY"},l=Object.keys(i),$=t=>Object.hasOwn(i,t),C="virtual:lunora/worker",d=["ShardDO"],J=["adminRevocations","agents","containers","scheduler","shardRegistry","workflows"],R={adminRevocations:"AdminRevocationDO",scheduler:"SchedulerDO",shardRegistry:"ShardRegistryDO"},D="LunoraDO",I=new Set([...d,...Object.values(R)]),N="durableObjects",y=t=>E(c(t,`${N}.ts`)),W=t=>Object.hasOwn(R,t),F=t=>y(t)?[D]:[...d,...Object.entries(R).filter(([e])=>E(c(t,`${e}.ts`))).map(([,e])=>e)],B=t=>t.includes(D)?t.filter(e=>!I.has(e)):[...t],U="src/worker.ts",Y=t=>{for(const e of b){const r=c(t,e);if(!E(r))continue;const{parsed:s}=f(r),o=s?.main;if(o===C)return{composed:!0};const a=c(t,U);if(E(a))return{composed:!1,path:a};if(typeof o=="string"&&!L(o)&&E(c(t,o)))return{composed:!1,path:c(t,o)};break}for(const e of x){const r=c(t,e);if(E(r))return{composed:!1,path:r}}return{composed:!1}},v=/(?:^|[\s,{])type$/u,m=(t,e)=>{const r=e.ls>=0?e.ls:e.s;return v.test(t.slice(0,r).trimEnd())},_=(t,e)=>{const r=S(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)},H=t=>{const e=O(t,"utf8");let r;try{const[,s]=u(e);r=new Set(s.filter(o=>!m(e,o)).map(o=>o.n))}catch{r=new Set(l.filter(s=>new RegExp(String.raw`\bexport\b[^\n;]*\b${s}\b`,"u").test(e)&&!_(e,s)))}return B(l.filter(s=>r.has(s))).map(s=>({binding:i[s],className:s}))},K=(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=O(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(p=>!m(s,p)).map(p=>p.n))}catch{a=new Set(e.map(n=>n.className).filter(n=>new RegExp(String.raw`\bexport\b[^\n;]*\b${S(n)}\b`,"u").test(s)&&!_(s,n)))}return e.map(n=>{const p=o||a.has(n.className);return{...n,exported:p}})};export{d as COMPOSED_ENTRY_DURABLE_OBJECTS,U as COMPOSED_WORKER_ENTRY,i as DURABLE_OBJECT_BINDINGS,J as GENERATED_CLASS_MODULES,g as GENERATED_DIRECTORY,R as GENERATED_MODULE_DURABLE_OBJECTS,C as LUNORA_WORKER_VIRTUAL_ID,D as MERGED_DURABLE_OBJECT,N as MERGED_DURABLE_OBJECTS_MODULE,I as MERGED_ROLE_DURABLE_OBJECTS,h as NON_SOURCE_DIRECTORIES,w as SOURCE_DOT_DIRECTORIES,x as WORKER_ENTRY_FALLBACKS,B as collapseMergedDurableObjects,F as composedEntryDurableObjects,K as detectClassExports,H as detectExportedDurableObjects,$ as isFrameworkDurableObject,L as isGeneratedOutput,y as isMergedProject,W as isMergedRoleModule,Y as resolveWorkerEntry};
@@ -0,0 +1 @@
1
+ import{p as a}from"./celld-config-DoBVipuN.mjs";import s from"./CLOUDFLARE_DRIVER-DbmpoIcg.mjs";const p=[["entry","`celld deploy` deploys the config's `main`; a composed framework entry has no celld equivalent yet"],["environment","celld has no Wrangler environments — deploy a separate config per environment"],["outDir","`celld deploy` does not write its bundle to disk"],["secretsFile","celld has no secret store — a value the app reads from env is a `vars` entry in the deployed config"],["outFile","`celld deploy` does not write its upload artifact to disk"],["preview","celld has no preview versions — a deploy replaces the fleet's current deployment"],["temporary","celld has no short-lived accounts — it deploys to the fleet bucket in CELLD_BUCKET"]],l=e=>{if(e===void 0)throw new Error("the celld driver runs the projected wrangler config — pass `configPath` from `projectConfig`");return e},v={deploy:e=>{const o=p.find(([r])=>e[r]!==void 0&&e[r]!==!1);if(o!==void 0)throw new Error(o[1]);return{args:["deploy",l(e.configPath),...e.dryRun===!0?["--dry-run"]:[]],onPath:!0,tool:"celld"}},devServer:"own",prebuildsContainerImages:!1,dev:e=>{if(e.environment!==void 0)throw new Error("celld has no Wrangler environments — `celld dev` runs the top-level config");return{args:["dev",l(e.configPath),...e.extraArgs??[]],onPath:!0,tool:"celld"}}},f={id:"celld",name:"celld",projectConfig:a,toolchain:v},h={id:"node",name:"Node"},m="cloudflare",t={celld:f,cloudflare:s,node:h},d=()=>Object.keys(t).toSorted((e,o)=>e.localeCompare(o)),i=(e=m)=>{const o=t[e];if(o===void 0)throw new Error(`unknown deploy target "${e}" — available targets: ${d().join(", ")}`);return o},g=e=>Object.hasOwn(t,e)&&i(e).toolchain!==void 0,E=()=>d().filter(e=>g(e)),D=e=>i(e).toolchain?.devServer==="own",O=(e,o,r,c)=>{const n=e.projectConfig?.(o,r);return{command:c(n?.configPath),commit:()=>n?.write(),projection:n===void 0?void 0:{configPath:n.configPath,dropped:n.dropped}}};export{m as DEFAULT_DEPLOY_TARGET,d as deployTargetIds,g as isRunnableTarget,O as planToolchainInvocation,i as resolveDeployDriver,E as runnableTargetIds,D as targetRunsOwnDevServer};
@@ -1 +1 @@
1
- import{MERGED_DURABLE_OBJECT as _}from"./COMPOSED_WORKER_ENTRY-Ciiba5g_.mjs";import{o as E,v as h,a as p,b as D,c as O,d as R,e as l,g as y,h as I,H as S,i as $,R as j,S as A,j as k,k as L,W as w,l as B}from"./validate-bindings-PVHSAU6M.mjs";import{validateTailConsumers as T,validateSendEmail as C,validateSecretsRequired as N,validateLogpush as U,validateLimits as G,validatePlacement as P,validateObservability as K,validateAssets as V,validateCache as W,validateExports as M,validateCorsVariables as x,validateSchedulerOrigin as F}from"./withTailConsumer-CF3pk_Ov.mjs";import{isCacheEnabled as H,WORKERS_CACHE_MIN_DATE as b}from"./WORKERS_CACHE_MIN_DATE-0k9ABJtF.mjs";import{mergeWranglerEnvironment as Y}from"./mergeWranglerEnvironment-D5ekKj5x.mjs";const q=i=>typeof i=="object"&&i!==null&&!Array.isArray(i),g=i=>Array.isArray(i)?i.flatMap((a,n)=>q(a)?[[n,a]]:[]):[],m=i=>typeof i.binding=="string"?i.binding:"",J=(i,a,n)=>{for(const[e,s]of g(i.kv_namespaces))typeof s.id=="string"&&s.id!==""||n.push(`kv_namespaces[${String(e)}] ("${m(s)}") is not created yet and the schema pins data to "${a}" — create it with \`wrangler kv namespace create <name> --jurisdiction=${a}\`; a namespace's jurisdiction cannot be changed afterwards`)},Q=(i,a,n)=>{for(const[e,s]of g(i.r2_buckets)){const o=s.jurisdiction;if(o===a)continue;const t=typeof o=="string"?`names the "${o}" jurisdiction`:"names no jurisdiction";n.push(`r2_buckets[${String(e)}] ("${m(s)}") ${t}, but the schema pins data to "${a}" — create the bucket with \`wrangler r2 bucket create <name> --jurisdiction=${a}\` and set "jurisdiction": "${a}" on the binding`)}},z=(i,a,n)=>{const e=a?.jurisdiction;e!==void 0&&(J(i,e,n),Q(i,e,n))},v="2026-04-07",le="web_socket_auto_reply_to_close",u="2026-10-01",f="durable_object_io_tasks_prevent_eviction",X="durable_object_io_tasks_do_not_prevent_eviction",Z=/^\d{4}-\d{2}-\d{2}$/,ee=(i,a,n)=>{i>=u||a.includes(f)||a.includes(X)||n.push(`compatibility_date "${i}" predates "${u}", so pending I/O (waitUntil, cross-Durable-Object RPC, service-binding calls, timers) does not keep a Durable Object alive once its last client disconnects — live-query refreshes and durable streams can be cut off mid-flight. Set compatibility_date >= "${u}" or add the "${f}" compatibility flag`)},te=(i,a,n)=>{const{error:e,merged:s,unverifiedKeys:o}=Y(i,a);return e!==void 0?{error:e,wrangler:s}:(o.length>0&&n.push(`env.${String(a)} overrides ${o.join(", ")}, which this validator doesn't have a verified inheritance rule for — validated against the TOP-LEVEL value only. Double-check ${o.length===1?"it":"them"} by hand for "${String(a)}".`),{wrangler:s})},ie=(i,a,n)=>{const e=[],s=[];if(!i||typeof i!="object")return e.push("wrangler config is not a valid object"),{errors:e,valid:!1,warnings:s};const{error:o,wrangler:t}=te(i,n,s);if(o!==void 0)return e.push(o),{errors:e,valid:!1,warnings:s};E(t.durable_objects?.bindings).find(r=>r.name==="SHARD"&&(r.class_name==="ShardDO"||r.class_name===_))||e.push(`durable_objects.bindings must include { "name": "SHARD", "class_name": "ShardDO" } (or "${_}" when the app merges its Durable Objects) — your dev server auto-reconciles this on startup, or add the binding manually`),h(t,e);const d=t.compatibility_date??"",c=Z.test(d);d&&!c?e.push(`compatibility_date must be in YYYY-MM-DD format (got "${d}")`):d<v&&e.push(`compatibility_date must be >= "${v}" (got "${d||"<missing>"}")`),H(t)&&c&&d<b&&e.push(`cache.enabled requires compatibility_date >= "${b}" (got "${d||"<missing>"}")`),c&&ee(d,t.compatibility_flags??[],s),p(t,a,e),z(t,a,s),D(t,e),O(t,a?.vectorIndexNames??[],e),T(t,e),R(t,e,s),l(t.workflows,"workflows",w,e),y(t,e),I(t,e),l(t.secrets_store_secrets,"secrets_store_secrets",B,e);for(const r of S)$(t,r,e,s);for(const r of j)l(t[r.key],r.key,r,e);for(const r of A)k(t,r,e);return L(t,e),C(t,e,s),N(t,e),U(t,e),G(t,e),P(t,e),K(t,e,s),V(t,e),W(t,e),M(t,e),x(t,e),F(t,n,s),{errors:e,valid:e.length===0,warnings:s}},ue=ie;export{v as REQUIRED_COMPATIBILITY_DATE,le as REQUIRED_FLAG,ue as validateWrangler,ie as validateWranglerConfig};
1
+ import{MERGED_DURABLE_OBJECT as _}from"./COMPOSED_WORKER_ENTRY-BcFt6ts5.mjs";import{o as E,v as h,a as p,b as D,c as O,d as R,e as l,g as y,h as I,H as S,i as $,R as j,S as A,j as k,k as L,W as w,l as B}from"./validate-bindings-PVHSAU6M.mjs";import{validateTailConsumers as T,validateSendEmail as C,validateSecretsRequired as N,validateLogpush as U,validateLimits as G,validatePlacement as P,validateObservability as K,validateAssets as V,validateCache as W,validateExports as M,validateCorsVariables as x,validateSchedulerOrigin as F}from"./withTailConsumer-CF3pk_Ov.mjs";import{isCacheEnabled as H,WORKERS_CACHE_MIN_DATE as b}from"./WORKERS_CACHE_MIN_DATE-0k9ABJtF.mjs";import{mergeWranglerEnvironment as Y}from"./mergeWranglerEnvironment-D5ekKj5x.mjs";const q=i=>typeof i=="object"&&i!==null&&!Array.isArray(i),g=i=>Array.isArray(i)?i.flatMap((a,n)=>q(a)?[[n,a]]:[]):[],m=i=>typeof i.binding=="string"?i.binding:"",J=(i,a,n)=>{for(const[e,s]of g(i.kv_namespaces))typeof s.id=="string"&&s.id!==""||n.push(`kv_namespaces[${String(e)}] ("${m(s)}") is not created yet and the schema pins data to "${a}" — create it with \`wrangler kv namespace create <name> --jurisdiction=${a}\`; a namespace's jurisdiction cannot be changed afterwards`)},Q=(i,a,n)=>{for(const[e,s]of g(i.r2_buckets)){const o=s.jurisdiction;if(o===a)continue;const t=typeof o=="string"?`names the "${o}" jurisdiction`:"names no jurisdiction";n.push(`r2_buckets[${String(e)}] ("${m(s)}") ${t}, but the schema pins data to "${a}" — create the bucket with \`wrangler r2 bucket create <name> --jurisdiction=${a}\` and set "jurisdiction": "${a}" on the binding`)}},z=(i,a,n)=>{const e=a?.jurisdiction;e!==void 0&&(J(i,e,n),Q(i,e,n))},v="2026-04-07",le="web_socket_auto_reply_to_close",u="2026-10-01",f="durable_object_io_tasks_prevent_eviction",X="durable_object_io_tasks_do_not_prevent_eviction",Z=/^\d{4}-\d{2}-\d{2}$/,ee=(i,a,n)=>{i>=u||a.includes(f)||a.includes(X)||n.push(`compatibility_date "${i}" predates "${u}", so pending I/O (waitUntil, cross-Durable-Object RPC, service-binding calls, timers) does not keep a Durable Object alive once its last client disconnects — live-query refreshes and durable streams can be cut off mid-flight. Set compatibility_date >= "${u}" or add the "${f}" compatibility flag`)},te=(i,a,n)=>{const{error:e,merged:s,unverifiedKeys:o}=Y(i,a);return e!==void 0?{error:e,wrangler:s}:(o.length>0&&n.push(`env.${String(a)} overrides ${o.join(", ")}, which this validator doesn't have a verified inheritance rule for — validated against the TOP-LEVEL value only. Double-check ${o.length===1?"it":"them"} by hand for "${String(a)}".`),{wrangler:s})},ie=(i,a,n)=>{const e=[],s=[];if(!i||typeof i!="object")return e.push("wrangler config is not a valid object"),{errors:e,valid:!1,warnings:s};const{error:o,wrangler:t}=te(i,n,s);if(o!==void 0)return e.push(o),{errors:e,valid:!1,warnings:s};E(t.durable_objects?.bindings).find(r=>r.name==="SHARD"&&(r.class_name==="ShardDO"||r.class_name===_))||e.push(`durable_objects.bindings must include { "name": "SHARD", "class_name": "ShardDO" } (or "${_}" when the app merges its Durable Objects) — your dev server auto-reconciles this on startup, or add the binding manually`),h(t,e);const d=t.compatibility_date??"",c=Z.test(d);d&&!c?e.push(`compatibility_date must be in YYYY-MM-DD format (got "${d}")`):d<v&&e.push(`compatibility_date must be >= "${v}" (got "${d||"<missing>"}")`),H(t)&&c&&d<b&&e.push(`cache.enabled requires compatibility_date >= "${b}" (got "${d||"<missing>"}")`),c&&ee(d,t.compatibility_flags??[],s),p(t,a,e),z(t,a,s),D(t,e),O(t,a?.vectorIndexNames??[],e),T(t,e),R(t,e,s),l(t.workflows,"workflows",w,e),y(t,e),I(t,e),l(t.secrets_store_secrets,"secrets_store_secrets",B,e);for(const r of S)$(t,r,e,s);for(const r of j)l(t[r.key],r.key,r,e);for(const r of A)k(t,r,e);return L(t,e),C(t,e,s),N(t,e),U(t,e),G(t,e),P(t,e),K(t,e,s),V(t,e),W(t,e),M(t,e),x(t,e),F(t,n,s),{errors:e,valid:e.length===0,warnings:s}},ue=ie;export{v as REQUIRED_COMPATIBILITY_DATE,le as REQUIRED_FLAG,ue as validateWrangler,ie as validateWranglerConfig};
@@ -1 +1 @@
1
- import{existsSync as h}from"node:fs";import{dirname as y,join as p}from"node:path";import{discoverSchemaInfo as w}from"./discoverSchemaInfo-DRPnqgif.mjs";import{MERGED_DURABLE_OBJECT as i,GENERATED_DIRECTORY as E,MERGED_ROLE_DURABLE_OBJECTS as u,COMPOSED_ENTRY_DURABLE_OBJECTS as $,GENERATED_CLASS_MODULES as k,isFrameworkDurableObject as D}from"./COMPOSED_WORKER_ENTRY-Ciiba5g_.mjs";import{o as R,f as j}from"./validate-bindings-PVHSAU6M.mjs";import{validateSchedulerOrigin as x}from"./withTailConsumer-CF3pk_Ov.mjs";import{l as O,r as _,s as A}from"./worker-entry-checks-AIASCYl7.mjs";import{mergeWranglerEnvironment as S}from"./mergeWranglerEnvironment-D5ekKj5x.mjs";import{findWranglerFile as W,readWranglerJsonc as C}from"./WRANGLER_FILES-UNW-xY5u.mjs";import{validateWranglerConfig as T}from"./REQUIRED_COMPATIBILITY_DATE-D4UcOP_t.mjs";const v=r=>Array.isArray(r)?r:[],L=(r,t,o)=>Object.entries(r?.images??{}).flatMap(([s,n])=>{const e=n?.dockerfile;return typeof e!="string"||h(e.startsWith("/")?e:p(t,e))?[]:[`containers images["${s}"] dockerfile "${e}" does not exist (resolved relative to ${o}); create the Dockerfile`]}),I=(r,t,o)=>{const s=[];for(const n of v(r)){const e=n?.image;typeof e=="string"&&(e.startsWith("./")||e.startsWith("../")||e.startsWith("/")||e.includes("Dockerfile"))&&!h(e.startsWith("/")?e:p(t,e))&&s.push(`containers image "${e}" does not exist (resolved relative to ${o}); create the Dockerfile or point image at a registry reference`),s.push(...L(n,t,o))}return s},P=(r,t)=>{const o=r?.vectorIndexNames??[],s=[];if(o.length>0&&s.push({message:e=>`schema declares vector index(es) ${o.map(l=>`"${l}"`).join(", ")} but nothing chains .vectors(...) onto defineApp() (composed in: ${e}) — \`ctx.vectors\` is then a throwing stub and buildWorkerOptions rejects EVERY request, /_lunora/health included. Add \`.vectors((env) => ({ ${String(o[0])}: env.<BINDING> }))\` to the chain.`,method:"vectors"}),r?.hasD1GlobalTable&&s.push({message:e=>`schema declares .global() table(s) but nothing chains .global(...) onto defineApp() (composed in: ${e}) — 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"}),r?.hasHyperdriveGlobalTable&&s.push({message:e=>`schema declares .global({ backend: "hyperdrive" }) table(s) but nothing chains .hyperdriveGlobal(...) onto defineApp() (composed in: ${e}) — 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(async () => (await import("postgres")).default(env.HYPERDRIVE.connectionString, { fetch_types: false, max: 5 }))) })\` to the chain (\`buildPgExec\` from \`@lunora/hyperdrive/global\`, \`fromPostgresJs\` from \`@lunora/hyperdrive\`).`,method:"hyperdriveGlobal"}),s.length===0)return[];const n=A(t,new Set(s.map(e=>e.method)));return n===void 0?[]:s.filter(e=>!n.chained.has(e.method)).map(e=>e.message(n.site))},G="does not export it",B=(r,t)=>{if(t.exports?.has(i)===!0&&u.has(r))return`This app merges its Durable Objects (\`durableObjects.merge\` in lunora.config), so ${i} hosts ${r}: bind only \`SHARD\` to "${i}" and drop the SCHEDULER / SHARD_REGISTRY bindings. Do that only if this Worker has never been deployed — a deployed ${r} namespace keeps its data, which the merged class cannot reach; turn \`durableObjects.merge\` off to keep it.`;if(r===i)return`${i} is the merged class (\`durableObjects.merge\` in lunora.config), and merging cannot be undone once deployed: the shard data lives in ${i}. Turn \`durableObjects.merge\` back on. Only a Worker that has never been deployed may rebind SHARD to "ShardDO".`;if(t.kind!=="composed")return`Re-export it from the module that defines it (\`export { ${r} } from "./…";\`), or add it to the app builder's own export (\`export const { ${r} } = app;\`).`;const o=`it exports ${$.join(", ")}, SchedulerDO when its binding is declared, and every class codegen emits from your ${k.map(s=>`${s}.mjs`).join(" / ")} declarations`;return D(r)?`\`@lunora/vite\` generates that entry — ${o}, and ${r} is not among them. Class-A composition does not carry ${r}, 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: ${o}. Declare "${r}" in one of those and re-run \`lunora codegen\`, or drop the binding.`},M=(r,t)=>{const o=t.exports;if(o===void 0)return[];const s=[];for(const e of R(r.durable_objects?.bindings))typeof e.class_name=="string"&&e.class_name.length>0&&e.script_name===void 0&&s.push({className:e.class_name,label:"durable_objects.bindings"});for(const e of v(r.workflows))typeof e?.class_name=="string"&&e.class_name.length>0&&e.script_name===void 0&&s.push({className:e.class_name,label:"workflows"});for(const[e,l]of Object.entries(r.exports??{}))l?.type==="workflow"&&s.push({className:e,label:"workflows"});return s.filter(e=>!o.has(e.className)).map(e=>`${e.label} declares class "${e.className}" but the ${t.kind==="composed"?"composed class-A worker entry":"worker entry"} (${t.path}) ${G} — wrangler refuses to bundle a Worker whose ${e.label==="workflows"?"Workflow":"Durable Object"} classes are not exported. ${B(e.className,t)}`)},N=r=>[...j(r.migrations)].filter(t=>u.has(t)).map(t=>`migrations create class "${t}", which this app hosts in ${i} because it merges its Durable Objects (\`durableObjects.merge\`). Before the first deploy, replace "${t}" with "${i}" in new_sqlite_classes; a Worker already deployed with "${t}" keeps its data there and cannot merge — turn \`durableObjects.merge\` off.`),U=r=>r?.origin!=="absent"?[]:[`main is set but no readable file is there (looked in ${r.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.`],Z=r=>{const t=r.schemaDir??"lunora",o=W(r.projectRoot);if(!o){const c=`wrangler.jsonc not found in ${r.projectRoot}; create one declaring at least the SHARD durable object binding.`;return{problems:[c],report:{errors:[c],valid:!1,warnings:[]},wranglerPath:void 0}}const{parsed:s}=C(o);if(s===void 0){const c=`failed to parse ${o} as JSONC.`;return{problems:[c],report:{errors:[c],valid:!1,warnings:[]},wranglerPath:o}}const{error:n,merged:e}=S(s,r.environment);if(n!==void 0)return{problems:[n],report:{errors:[n],valid:!1,warnings:[]},wranglerPath:o};const{error:l,info:f}=w(r.projectRoot,t,r.cache),a=T(s,f,r.environment);l!==void 0&&a.warnings.push(`schema parse failed in ${t}/schema.ts: ${l}`);const g=y(o),b=O(e.main,r.projectRoot,o),m=_(b,r.projectRoot,t);a.errors.push(...I(e.containers??[],g,o)),a.warnings.push(...U(b)),m!==void 0&&a.errors.push(...M(e,m)),m?.exports?.has(i)===!0&&(a.errors.push(...N(e)),h(p(r.projectRoot,t,E,"scheduler.ts"))&&x(e,r.environment,a.warnings,"the merged LunoraDO hosts the scheduler")),a.errors.push(...P(f,r.projectRoot));const d=e.assets?.directory;if(typeof d=="string"&&d.length>0){const c=d.startsWith("/")?d:p(g,d);h(c)||a.warnings.push(`assets.directory "${d}" 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:o}};export{G as UNEXPORTED_CLASS_MARKER,Z as validateWranglerProject};
1
+ import{existsSync as h}from"node:fs";import{dirname as y,join as p}from"node:path";import{discoverSchemaInfo as w}from"./discoverSchemaInfo-DRPnqgif.mjs";import{MERGED_DURABLE_OBJECT as i,GENERATED_DIRECTORY as E,MERGED_ROLE_DURABLE_OBJECTS as u,COMPOSED_ENTRY_DURABLE_OBJECTS as $,GENERATED_CLASS_MODULES as k,isFrameworkDurableObject as D}from"./COMPOSED_WORKER_ENTRY-BcFt6ts5.mjs";import{o as R,f as j}from"./validate-bindings-PVHSAU6M.mjs";import{validateSchedulerOrigin as x}from"./withTailConsumer-CF3pk_Ov.mjs";import{l as O,r as _,s as A}from"./worker-entry-checks-CHrum2AN.mjs";import{mergeWranglerEnvironment as S}from"./mergeWranglerEnvironment-D5ekKj5x.mjs";import{findWranglerFile as W,readWranglerJsonc as C}from"./WRANGLER_FILES-UNW-xY5u.mjs";import{validateWranglerConfig as T}from"./REQUIRED_COMPATIBILITY_DATE-C8qfwbaA.mjs";const v=r=>Array.isArray(r)?r:[],L=(r,t,o)=>Object.entries(r?.images??{}).flatMap(([s,n])=>{const e=n?.dockerfile;return typeof e!="string"||h(e.startsWith("/")?e:p(t,e))?[]:[`containers images["${s}"] dockerfile "${e}" does not exist (resolved relative to ${o}); create the Dockerfile`]}),I=(r,t,o)=>{const s=[];for(const n of v(r)){const e=n?.image;typeof e=="string"&&(e.startsWith("./")||e.startsWith("../")||e.startsWith("/")||e.includes("Dockerfile"))&&!h(e.startsWith("/")?e:p(t,e))&&s.push(`containers image "${e}" does not exist (resolved relative to ${o}); create the Dockerfile or point image at a registry reference`),s.push(...L(n,t,o))}return s},P=(r,t)=>{const o=r?.vectorIndexNames??[],s=[];if(o.length>0&&s.push({message:e=>`schema declares vector index(es) ${o.map(l=>`"${l}"`).join(", ")} but nothing chains .vectors(...) onto defineApp() (composed in: ${e}) — \`ctx.vectors\` is then a throwing stub and buildWorkerOptions rejects EVERY request, /_lunora/health included. Add \`.vectors((env) => ({ ${String(o[0])}: env.<BINDING> }))\` to the chain.`,method:"vectors"}),r?.hasD1GlobalTable&&s.push({message:e=>`schema declares .global() table(s) but nothing chains .global(...) onto defineApp() (composed in: ${e}) — 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"}),r?.hasHyperdriveGlobalTable&&s.push({message:e=>`schema declares .global({ backend: "hyperdrive" }) table(s) but nothing chains .hyperdriveGlobal(...) onto defineApp() (composed in: ${e}) — 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(async () => (await import("postgres")).default(env.HYPERDRIVE.connectionString, { fetch_types: false, max: 5 }))) })\` to the chain (\`buildPgExec\` from \`@lunora/hyperdrive/global\`, \`fromPostgresJs\` from \`@lunora/hyperdrive\`).`,method:"hyperdriveGlobal"}),s.length===0)return[];const n=A(t,new Set(s.map(e=>e.method)));return n===void 0?[]:s.filter(e=>!n.chained.has(e.method)).map(e=>e.message(n.site))},G="does not export it",B=(r,t)=>{if(t.exports?.has(i)===!0&&u.has(r))return`This app merges its Durable Objects (\`durableObjects.merge\` in lunora.config), so ${i} hosts ${r}: bind only \`SHARD\` to "${i}" and drop the SCHEDULER / SHARD_REGISTRY bindings. Do that only if this Worker has never been deployed — a deployed ${r} namespace keeps its data, which the merged class cannot reach; turn \`durableObjects.merge\` off to keep it.`;if(r===i)return`${i} is the merged class (\`durableObjects.merge\` in lunora.config), and merging cannot be undone once deployed: the shard data lives in ${i}. Turn \`durableObjects.merge\` back on. Only a Worker that has never been deployed may rebind SHARD to "ShardDO".`;if(t.kind!=="composed")return`Re-export it from the module that defines it (\`export { ${r} } from "./…";\`), or add it to the app builder's own export (\`export const { ${r} } = app;\`).`;const o=`it exports ${$.join(", ")}, SchedulerDO when its binding is declared, and every class codegen emits from your ${k.map(s=>`${s}.mjs`).join(" / ")} declarations`;return D(r)?`\`@lunora/vite\` generates that entry — ${o}, and ${r} is not among them. Class-A composition does not carry ${r}, 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: ${o}. Declare "${r}" in one of those and re-run \`lunora codegen\`, or drop the binding.`},M=(r,t)=>{const o=t.exports;if(o===void 0)return[];const s=[];for(const e of R(r.durable_objects?.bindings))typeof e.class_name=="string"&&e.class_name.length>0&&e.script_name===void 0&&s.push({className:e.class_name,label:"durable_objects.bindings"});for(const e of v(r.workflows))typeof e?.class_name=="string"&&e.class_name.length>0&&e.script_name===void 0&&s.push({className:e.class_name,label:"workflows"});for(const[e,l]of Object.entries(r.exports??{}))l?.type==="workflow"&&s.push({className:e,label:"workflows"});return s.filter(e=>!o.has(e.className)).map(e=>`${e.label} declares class "${e.className}" but the ${t.kind==="composed"?"composed class-A worker entry":"worker entry"} (${t.path}) ${G} — wrangler refuses to bundle a Worker whose ${e.label==="workflows"?"Workflow":"Durable Object"} classes are not exported. ${B(e.className,t)}`)},N=r=>[...j(r.migrations)].filter(t=>u.has(t)).map(t=>`migrations create class "${t}", which this app hosts in ${i} because it merges its Durable Objects (\`durableObjects.merge\`). Before the first deploy, replace "${t}" with "${i}" in new_sqlite_classes; a Worker already deployed with "${t}" keeps its data there and cannot merge — turn \`durableObjects.merge\` off.`),U=r=>r?.origin!=="absent"?[]:[`main is set but no readable file is there (looked in ${r.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.`],Z=r=>{const t=r.schemaDir??"lunora",o=W(r.projectRoot);if(!o){const c=`wrangler.jsonc not found in ${r.projectRoot}; create one declaring at least the SHARD durable object binding.`;return{problems:[c],report:{errors:[c],valid:!1,warnings:[]},wranglerPath:void 0}}const{parsed:s}=C(o);if(s===void 0){const c=`failed to parse ${o} as JSONC.`;return{problems:[c],report:{errors:[c],valid:!1,warnings:[]},wranglerPath:o}}const{error:n,merged:e}=S(s,r.environment);if(n!==void 0)return{problems:[n],report:{errors:[n],valid:!1,warnings:[]},wranglerPath:o};const{error:l,info:f}=w(r.projectRoot,t,r.cache),a=T(s,f,r.environment);l!==void 0&&a.warnings.push(`schema parse failed in ${t}/schema.ts: ${l}`);const g=y(o),b=O(e.main,r.projectRoot,o),m=_(b,r.projectRoot,t);a.errors.push(...I(e.containers??[],g,o)),a.warnings.push(...U(b)),m!==void 0&&a.errors.push(...M(e,m)),m?.exports?.has(i)===!0&&(a.errors.push(...N(e)),h(p(r.projectRoot,t,E,"scheduler.ts"))&&x(e,r.environment,a.warnings,"the merged LunoraDO hosts the scheduler")),a.errors.push(...P(f,r.projectRoot));const d=e.assets?.directory;if(typeof d=="string"&&d.length>0){const c=d.startsWith("/")?d:p(g,d);h(c)||a.warnings.push(`assets.directory "${d}" 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:o}};export{G as UNEXPORTED_CLASS_MARKER,Z as validateWranglerProject};
@@ -1 +1 @@
1
- import{readProjectConfigLiterals as s,readProjectTarget as c}from"@lunora/codegen";import n from"./canonicalPath-DrfMiT3U.mjs";import{BUILD_TARGET_ENV as i,BUILD_ROOT_ENV as a}from"./BUILD_ROOT_ENV-Dg4MV3wY.mjs";import{DEFAULT_DEPLOY_TARGET as p,resolveDeployDriver as f}from"./DEFAULT_DEPLOY_TARGET-D_krePy-.mjs";const d=e=>{if(typeof e=="boolean")return e;if(e!==null&&typeof e=="object")return!0},P=e=>d(s(e).remote),T=e=>c(e),g=(e,t)=>t??T(e)??p,j=(e,t)=>{const r=g(e,t);return f(r),r},v=(e,t)=>{const r=process.env[i],o=process.env[a];if(!(o===void 0||o===""||n(o)!==n(t))&&r!==void 0&&r!==""&&r!==e)throw new Error(`the plugin resolves target "${e}" but the CLI resolved "${r}" for this run; set the same target in the plugin options and the project config`)};export{v as assertBuildTargetMatches,d as interpretRemote,P as readProjectRemotePreference,T as readProjectTarget,g as resolveProjectTarget,j as resolveTargetOrThrow};
1
+ import{readProjectConfigLiterals as s,readProjectTarget as c}from"@lunora/codegen";import n from"./canonicalPath-DrfMiT3U.mjs";import{BUILD_TARGET_ENV as i,BUILD_ROOT_ENV as a}from"./BUILD_ROOT_ENV-Dg4MV3wY.mjs";import{DEFAULT_DEPLOY_TARGET as p,resolveDeployDriver as f}from"./DEFAULT_DEPLOY_TARGET-DllYb7Tj.mjs";const d=e=>{if(typeof e=="boolean")return e;if(e!==null&&typeof e=="object")return!0},P=e=>d(s(e).remote),T=e=>c(e),g=(e,t)=>t??T(e)??p,j=(e,t)=>{const r=g(e,t);return f(r),r},v=(e,t)=>{const r=process.env[i],o=process.env[a];if(!(o===void 0||o===""||n(o)!==n(t))&&r!==void 0&&r!==""&&r!==e)throw new Error(`the plugin resolves target "${e}" but the CLI resolved "${r}" for this run; set the same target in the plugin options and the project config`)};export{v as assertBuildTargetMatches,d as interpretRemote,P as readProjectRemotePreference,T as readProjectTarget,g as resolveProjectTarget,j as resolveTargetOrThrow};
@@ -1,3 +1,3 @@
1
- import{LunoraError as n}from"@lunora/errors";import{lunoraLine as i}from"./LUNORA_TAG-DQTGPqcJ.mjs";import{validateWranglerProject as c}from"./UNEXPORTED_CLASS_MARKER-CntuT4Ck.mjs";const m=(e,o,t)=>{const r=c({cache:e.cache,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-DQTGPqcJ.mjs";import{validateWranglerProject as c}from"./UNEXPORTED_CLASS_MARKER-07SNQ0rP.mjs";const m=(e,o,t)=>{const r=c({cache:e.cache,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 a of r.report.warnings)o(i(`wrangler validator: ${a}`));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(a=>` - ${a}`),"",` ${t}`].join(`
3
3
  `))};export{m as assertWranglerSatisfiesSchema};
@@ -1,2 +1,2 @@
1
- import{readFileSync as ee,writeFileSync as ne}from"node:fs";import{createRequire as se}from"node:module";import{join as Q}from"node:path";import{containerBuildTag as te}from"@lunora/container";import{readJsonSync as ie}from"@visulima/fs";import{c as oe}from"./celld-binding-id-9MiUoteo.mjs";import{applyModify as w}from"./applyModify-DKP2l6S9.mjs";import{recordManifestKey as ae,readManifest as Y}from"./readManifest-Cighz3WC.mjs";import{D1_PLACEHOLDER_ID as U,HYPERDRIVE_PLACEHOLDER_ID as re}from"./D1_PLACEHOLDER_ID-ZnDjVymH.mjs";import{parseTree as de,findNodeAtLocation as ce}from"jsonc-parser";import{r as le,a as ue,b as ge,c as me}from"./reconcile-services-C4TwY8YH.mjs";import{DEV_VARS_FILE as pe,parseDevVariableEntries as fe}from"./DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";import{secretSourcesFromBindings as be}from"./inferLunoraBindings-DvB8IpbN.mjs";import{requiredSecrets as he}from"./buildPackageSecretsBlock-GvaLgvFN.mjs";import{w as ve,m as we,s as G,o as P,n as I,p as _e}from"./validate-bindings-PVHSAU6M.mjs";import{s as ye}from"./worker-entry-checks-AIASCYl7.mjs";import{DEFAULT_OBSERVABILITY as Se}from"./DEFAULT_OBSERVABILITY-CPLADr5u.mjs";import{findWranglerFile as Ee,readWranglerJsonc as xe}from"./WRANGLER_FILES-UNW-xY5u.mjs";const Ae=[["maxBatchSize","max_batch_size"],["maxBatchTimeout","max_batch_timeout"],["maxConcurrency","max_concurrency"],["maxRetries","max_retries"],["deadLetterQueue","dead_letter_queue"],["retryDelay","retry_delay"]],B=e=>Object.fromEntries(Ae.filter(([n])=>e.tuning[n]!==void 0).map(([n,s])=>[s,e.tuning[n]])),L="queueTuning",Oe=/^[\t ]*(?:,[\t ]*)?(?:\/\/[^\n\r]*)?\r?\n/u,Ne=/^[\t ]*,/u,ke=(e,n)=>{const s=de(e),t=s===void 0?void 0:ce(s,[...n])?.parent;if(t?.type==="property"){const o=t.offset+t.length,i=e.lastIndexOf(`
1
+ import{readFileSync as ee,writeFileSync as ne}from"node:fs";import{createRequire as se}from"node:module";import{join as Q}from"node:path";import{containerBuildTag as te}from"@lunora/container";import{readJsonSync as ie}from"@visulima/fs";import{c as oe}from"./celld-binding-id-9MiUoteo.mjs";import{applyModify as w}from"./applyModify-DKP2l6S9.mjs";import{recordManifestKey as ae,readManifest as Y}from"./readManifest-Cighz3WC.mjs";import{D1_PLACEHOLDER_ID as U,HYPERDRIVE_PLACEHOLDER_ID as re}from"./D1_PLACEHOLDER_ID-ZnDjVymH.mjs";import{parseTree as de,findNodeAtLocation as ce}from"jsonc-parser";import{r as le,a as ue,b as ge,c as me}from"./reconcile-services-C4TwY8YH.mjs";import{DEV_VARS_FILE as pe,parseDevVariableEntries as fe}from"./DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";import{secretSourcesFromBindings as be}from"./inferLunoraBindings-BiRE_Jh9.mjs";import{requiredSecrets as he}from"./buildPackageSecretsBlock-GvaLgvFN.mjs";import{w as ve,m as we,s as G,o as P,n as I,p as _e}from"./validate-bindings-PVHSAU6M.mjs";import{s as ye}from"./worker-entry-checks-CHrum2AN.mjs";import{DEFAULT_OBSERVABILITY as Se}from"./DEFAULT_OBSERVABILITY-CPLADr5u.mjs";import{findWranglerFile as Ee,readWranglerJsonc as xe}from"./WRANGLER_FILES-UNW-xY5u.mjs";const Ae=[["maxBatchSize","max_batch_size"],["maxBatchTimeout","max_batch_timeout"],["maxConcurrency","max_concurrency"],["maxRetries","max_retries"],["deadLetterQueue","dead_letter_queue"],["retryDelay","retry_delay"]],B=e=>Object.fromEntries(Ae.filter(([n])=>e.tuning[n]!==void 0).map(([n,s])=>[s,e.tuning[n]])),L="queueTuning",Oe=/^[\t ]*(?:,[\t ]*)?(?:\/\/[^\n\r]*)?\r?\n/u,Ne=/^[\t ]*,/u,ke=(e,n)=>{const s=de(e),t=s===void 0?void 0:ce(s,[...n])?.parent;if(t?.type==="property"){const o=t.offset+t.length,i=e.lastIndexOf(`
2
2
  `,t.offset-1)+1,a=Oe.exec(e.slice(o));if(a!==null&&e.slice(i,t.offset).trim()===""){const m=t.parent?.children??[],u=m.indexOf(t),d=u===m.length-1&&u>0?m[u-1]:void 0,c=d===void 0?void 0:Ne.exec(e.slice(d.offset+d.length))??void 0;return(c===void 0||d===void 0?e.slice(0,i):e.slice(0,d.offset+d.length)+e.slice(d.offset+d.length+c[0].length,i))+e.slice(o+a[0].length)}}return w(e,n,void 0)},J=(e,n,s,t,o,i=new Set)=>{const a=s.join("."),m={},u=[],d=[];let c=e;return{entries:n.map((l,v)=>{const g=t(l);if(g===void 0||l.queue===void 0)return l;const b=Object.fromEntries(Object.entries(B(g)).filter(([f])=>!i.has(f))),h=Object.entries(o[l.queue]??{}).filter(([f])=>!Object.hasOwn(b,f)),_=Object.entries(b).filter(([f,y])=>l[f]!==y),E=h.filter(([f,y])=>l[f]===y).map(([f])=>f),O=Object.fromEntries(Object.entries({...l,...b}).filter(([f])=>!E.includes(f)));for(const[f,y]of _)c=w(c,[...s,v,f],y);for(const f of E)c=ke(c,[...s,v,f]);for(const[f,y]of h){const A=l[f];A!==void 0&&A!==y&&d.push(`${a}/${l.queue}: ${f} is no longer declared by defineQueue, but it was changed by hand to ${JSON.stringify(A)} from the declared ${JSON.stringify(y)}, so it was kept. Delete it from wrangler.jsonc if it should go.`)}return(_.length>0||E.length>0)&&u.push(`${a}/${l.queue} (${[..._.map(([f])=>f),...E.map(f=>`removed ${f}`)].join(", ")})`),Object.keys(b).length>0&&(m[l.queue]=b),O}),owned:m,text:c,updated:u,warnings:d}},$e=(e,n,s,t)=>{const o=n.queues??{},i=o.producers??[],a=o.consumers??[],m=new Set(i.map(g=>g?.binding)),u=new Set(a.map(g=>g.queue)),d=s.filter(g=>!m.has(g.bindingName)),c=s.filter(g=>!u.has(g.name)),p=J(e,a,["queues","consumers"],g=>s.find(b=>b.name===g.queue),t);let l=p.text;const v={...p.owned};if(d.length>0||c.length>0){const g=[...i,...d.map(h=>({binding:h.bindingName,queue:h.name}))],b=[...p.entries,...c.map(h=>({queue:h.name,...h.mode==="pull"?{type:"http_pull"}:{},...B(h)}))];for(const h of c){const _=B(h);Object.keys(_).length>0&&(v[h.name]=_)}l=w(l,["queues"],{consumers:b,producers:g})}return{added:[...d.map(g=>`queues.producers/${g.bindingName}`),...c.map(g=>`queues.consumers/${g.name}`)],owned:v,text:l,updated:p.updated,warnings:p.warnings}},Ce=(e,n,s,t,o)=>{const i=n.env?.[t],a=i?.queues?.consumers??[],m=i?.queues?.producers??[],u=l=>{const v=m.find(g=>g?.queue===l.queue)?.binding;return v!==void 0?s.find(g=>g.bindingName===v):s.find(g=>g.name===l.queue&&!m.some(b=>b?.binding===g.bindingName))},d=J(e,a,["env",t,"queues","consumers"],u,o,new Set(["dead_letter_queue"])),c=a.filter(l=>l.queue!==void 0&&u(l)===void 0).map(l=>`env.${t}.queues.consumers/${String(l.queue)}: no defineQueue export matches it — this block declares no producer mapping one of their bindings to "${String(l.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.`),p=a.flatMap(l=>{const v=u(l)?.tuning.deadLetterQueue;return v===void 0||l.dead_letter_queue!==void 0?[]:[`env.${t}.queues.consumers/${String(l.queue)}: defineQueue declares deadLetterQueue "${v}", 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:d.owned,text:d.text,updated:d.updated,warnings:[...d.warnings,...p,...c]}},Te=(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?.[L],t=o=>typeof o=="object"&&o!==null&&!Array.isArray(o);return s===void 0?{}:!t(s)||!Object.values(s).every(o=>t(o)&&Object.values(o).every(i=>t(i)))?(n.push(`${e?.path??"package.json"}: \`lunora.${L}\` 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},Ie=(e,n,s)=>{const t=Object.fromEntries(Object.entries({...n,...s}).filter(([,o])=>Object.keys(o).length>0));ae(e,L,Object.keys(t).length===0?void 0:t)},je="https://api.cloudflare.com/client/v4/accounts/<ACCOUNT_ID>/artifacts/namespaces",Re=e=>{const n='add an "artifacts" binding ({ binding: "ARTIFACTS", namespace }) — codegen reads env.ARTIFACTS unless `.artifacts()` on defineApp points ctx.artifacts at another binding';return e===void 0?`ctx.artifacts is used; ${n}. The namespace is created by the first repo create() if it does not exist yet.`:`ctx.artifacts is used and the schema pins data to "${e}"; create the namespace in that jurisdiction BEFORE the first repo, with POST ${je} and body { "namespace": "<name>", "jurisdiction": "${e}" }, then ${n}. A namespace's jurisdiction cannot be changed, and one created implicitly by the first repo create() is unrestricted. With CLOUDFLARE_API_TOKEN set, \`lunora deploy\` creates a missing namespace in that jurisdiction for a binding you have added.`},j="PIPELINES",R="ARTIFACTS",qe=(e,n,s)=>{const t=n!==void 0&&(s===void 0||s==="cloudflare"),o=e.flagshipBinding!==void 0&&!(n?.flagship??[]).some(d=>d.binding===e.flagshipBinding),i=e.usesPipelines&&!(n?.pipelines??[]).some(d=>d.binding===j),a=e.usesArtifacts?n?.artifacts??[]:[],m=a.some(d=>d.binding===R)?[]:a.flatMap(d=>d.binding===void 0?[]:[d.binding]);return[[e.usesKv&&(n?.kv_namespaces?.length??0)===0&&(!t||e.jurisdiction!==void 0),e.jurisdiction===void 0?'ctx.kv is used but no kv_namespaces binding exists; add one ({ binding: "KV" }) — wrangler creates the namespace on the first deploy.':`ctx.kv is used and the schema pins data to "${e.jurisdiction}"; run \`wrangler kv namespace create <name> --jurisdiction ${e.jurisdiction}\` and add a kv_namespaces entry ({ binding: "KV", id }) — a namespace wrangler creates on deploy is unrestricted.`],[e.usesHyperdrive&&(n?.hyperdrive?.length??0)===0&&!t,'@lunora/hyperdrive is used but no hyperdrive binding exists; add one ({ binding: "HYPERDRIVE", id }) — on a Cloudflare target `lunora deploy` creates the Hyperdrive config from a connection string.'],[e.usesArtifacts&&a.length===0&&(!t||e.jurisdiction!==void 0),Re(e.jurisdiction)],[i,`ctx.pipelines is used but no "${j}" pipelines binding exists; run 'wrangler pipelines create <name>' and add a 'pipelines' binding ({ binding: "${j}", stream }) — codegen resolves this one name, and the pipeline resource can't be auto-provisioned.`],[m.length>0,`ctx.artifacts is used and ${m.map(d=>`"${d}"`).join(", ")} ${m.length===1?"is":"are"} bound, but none is named "${R}"; make sure \`.artifacts()\` on defineApp points ctx.artifacts at it — otherwise it reads env.${R} and throws.`],[o,`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(([d])=>d).map(([,d])=>d)},De=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.usesX402,"@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),q=(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.`),Pe=(e,n)=>{const s=new Set([...e.workflows,...e.agents].map(i=>i.className));if(s.size===0)return[];const t=Object.entries(n.exports??{}).flatMap(([i,a])=>a?.type==="workflow"?[i]:[]),o=(n.workflows??[]).flatMap(i=>i.class_name===void 0||i.script_name!==void 0?[]:[i.class_name]);return[...new Set([...t,...o])].filter(i=>!s.has(i)).map(i=>`wrangler.jsonc declares workflow "${i}" but no defineWorkflow/defineAgent export generates that class — a leftover from a rename will fail the deploy (wrangler rejects a class the worker does not export). Remove it if it is not hand-wired.`)},Be=(e,n)=>{if(e.queues.length===0)return[];const s=new Set(e.queues.map(o=>o.name)),t=new Set(e.queues.map(o=>o.bindingName));return[...(n.queues?.consumers??[]).flatMap(o=>{const{queue:i}=o;return i===void 0||s.has(i)?[]:[`wrangler.jsonc subscribes queues.consumers[] to "${i}" 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(o=>{const i=o?.binding;return i===void 0||t.has(i)?[]:[`wrangler.jsonc declares queues.producers[] binding "${i}" but no defineQueue export declares it — a leftover from a rename. Remove it if it is not hand-wired.`]})]},Le=(e,n)=>[...Pe(e,n),...Be(e,n)],X=[{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"}],We=()=>X.map(({keys:e,label:n})=>`${e[0]} + ${e[1]} (${n})`).join(" or "),Me=e=>{let n;try{n=ee(Q(e,pe),"utf8")}catch{return!1}const s=new Map(fe(n).map(t=>[t.key,t.value]));return X.some(({keys:t})=>t.every(o=>(s.get(o)??"")!==""))},Ke=(e,n)=>{const s=n?.secrets?.required;if(!Array.isArray(s))return[];const t=new Set(s),o=he(be(e)).map(i=>i.key).filter(i=>!t.has(i));return o.length===0?[]:[`wrangler.jsonc declares secrets.required without ${o.join(", ")}, which this app needs — wrangler dev loads only the listed keys from .dev.vars, so add ${o.length===1?"it":"them"} to secrets.required.`]},D=(e,n,s,t)=>{const o=new Set(e.durableObjects.map(u=>u.className)),i=[],a=(s?.r2_buckets?.length??0)>0,m=(s?.d1_databases?.some(u=>u.binding==="DB")??!1)||e.needsD1;return e.usesStorage&&!a&&i.push("@lunora/storage is used but R2 bucket bindings have user-defined names; add an r2_buckets entry and pass env.<BINDING> to createStorage()."),e.usesAuth&&!o.has("SessionDO")&&!m&&i.push("@lunora/auth is used but the worker entry exports no SessionDO; sessions are D1-backed, or export SessionDO to enable DO-backed sessions."),e.usesScheduler&&!o.has("SchedulerDO")&&i.push("@lunora/scheduler is used but the worker entry exports no SchedulerDO; export it so the SCHEDULER binding can be provisioned."),i.push(...q("container","containers",e.containers),...q("workflow","workflows",e.workflows),...q("agent","agents",e.agents)),e.containers.length>0&&s?.observability?.enabled===!1&&i.push("containers are declared but observability is explicitly disabled in wrangler.jsonc — container logs will not be captured."),e.usesPayments&&!Me(n)&&i.push(`@lunora/payment is used; set one provider's secret pair in .dev.vars — ${We()}.`),i.push(...De(e),...qe(e,s,t),...Ke(e,s)),s!==void 0&&i.push(...Le(e,s)),i},Fe=e=>[["container","containers",e.containers],["workflow","workflows",e.workflows],["agent","agents",e.agents]].flatMap(([s,t,o])=>o.filter(i=>!i.exported).map(({className:i,exportName:a})=>({className:i,exportName:a,kind:s,module:t}))),He=e=>{const n=new Set(P(e).map(t=>t.tag));let s=1;for(;n.has(`v${String(s)}`);)s+=1;return`v${String(s)}`},Ye=e=>{const n=new Set;for(const s of P(e)){for(const t of I(s.deleted_classes))n.delete(t);for(const{from:t,to:o}of P(s.renamed_classes))t!==void 0&&n.delete(t),o!==void 0&&n.add(o);for(const t of[...I(s.new_classes),...I(s.new_sqlite_classes)])n.add(t)}return n},Ve=(e,n,s)=>{const t=n.durable_objects?.bindings??[],o=new Set(t.map(c=>c.name)),i=s.filter(c=>!o.has(c.binding));let a=e;const m=[];if(i.length>0){const c=[...t,...i.map(p=>({class_name:p.className,name:p.binding}))];a=w(a,["durable_objects","bindings"],c),m.push(...i.map(p=>`${p.binding}/${p.className}`))}const u=n.migrations??[],d=s.map(c=>c.className).filter(c=>!Ye(u).has(c));if(d.length>0){const c=[...u,{new_sqlite_classes:d,tag:He(u)}];a=w(a,["migrations"],c)}return{added:m,text:a}},M=e=>e===void 0||e==="cloudflare",Qe=(e,n)=>e.includes("DB (D1)")&&M(n)?[`wrote a DB binding with a placeholder database_id ("${U}") — run \`wrangler d1 create <name>\` and replace it before deploying.`]:[],Ue=(e,n)=>{const s=n.d1_databases??[];if(s.some(i=>i.binding==="DB"))return{added:[],text:e};const t=typeof n.name=="string"&&n.name.length>0?n.name:"lunora",o=[...s,{binding:"DB",database_id:U,database_name:t}];return{added:["DB (D1)"],text:w(e,["d1_databases"],o)}},Ge={ai:{binding:"AI",label:"AI (Workers AI)"},analytics:{binding:"ANALYTICS_SQL",label:"ANALYTICS_SQL (Analytics SQL)"},browser:{binding:"BROWSER",label:"BROWSER (Browser Rendering)"},images:{binding:"IMAGES",label:"IMAGES (Cloudflare Images)"}},k=(e,n,s)=>{const{binding:t,label:o}=Ge[s],i=n[s]?.binding;return typeof i=="string"&&i.length>0?{added:[],text:e}:{added:[o],text:w(e,[s],{binding:t})}},Je=(e,n)=>e.usesAnalyticsSql&&ye(n,new Set(["analyticsSql"]))?.chained.has("analyticsSql")!==!0,Xe=new Set(["ratelimits","send_email"]),ze=["durable_objects","logfwdr","unsafe"],Ze=new Set(["data_blobs","text_blobs","vars","wasm_modules"]),K=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),W=(e,n,s)=>K(e)&&e[n]===s,en=(e,n,s)=>{if(Ze.has(e))return K(n)&&Object.hasOwn(n,s);const t=Xe.has(e)?"name":"binding";return Array.isArray(n)?n.some(o=>W(o,t,s)):W(n,"binding",s)},$=(e,n)=>{const s=e,t=Object.entries(s).find(([i,a])=>i!=="env"&&en(i,a,n));if(t!==void 0)return t[0];for(const i of ze){const a=s[i];if(K(a)&&Array.isArray(a.bindings)&&a.bindings.some(m=>W(m,"name",n)))return`${i}.bindings`}if(e.queues?.producers?.some(i=>i?.binding===n)===!0)return"queues.producers";const o=e.secrets?.required;if(Array.isArray(o)&&o.includes(n))return"secrets.required"},F=(e,n,s)=>`${e}: not adding "${n}" — the name is already bound by \`${s}\` in wrangler.jsonc. Add a ${e} entry under another binding name and point the matching \`defineApp()\` override at it.`,nn=(e,n,s)=>{if(!M(s)||(n.hyperdrive?.length??0)>0)return{added:[],text:e};const t=$(n,"HYPERDRIVE");return t!==void 0?{added:[],text:e,warnings:[F("hyperdrive","HYPERDRIVE",t)]}:{added:["HYPERDRIVE (Hyperdrive, created on deploy)"],text:w(e,["hyperdrive"],[{binding:"HYPERDRIVE",id:re}])}},sn=new Set(["celld","cloudflare"]),tn=(e,n,s,t)=>{if(t!==void 0&&!sn.has(t)||s!==void 0||(n.kv_namespaces?.length??0)>0)return{added:[],text:e};const o=$(n,"KV");return o!==void 0?{added:[],text:e,warnings:[F("kv_namespaces","KV",o)]}:{added:[t==="celld"?`KV (Workers KV, celld namespace ${oe(n.name,"KV")})`:"KV (Workers KV, created on deploy)"],text:w(e,["kv_namespaces"],[{binding:"KV"}])}},on=(e,n,s,t)=>{if(!M(t)||s!==void 0||(n.artifacts?.length??0)>0)return{added:[],text:e};const o=$(n,"ARTIFACTS");if(o!==void 0)return{added:[],text:e,warnings:[F("artifacts","ARTIFACTS",o)]};const i=typeof n.name=="string"&&n.name.length>0?n.name:"lunora";return{added:["ARTIFACTS (Cloudflare Artifacts)"],text:w(e,["artifacts"],[{binding:"ARTIFACTS",namespace:i}])}},V=(e,n,s,t,o)=>{if((n[s]?.length??0)>0)return{added:[],text:e};const i=$(n,t.binding);return i!==void 0?{added:[],text:e,warnings:[`${s}: not adding ${JSON.stringify(t)} — the name "${t.binding}" is already bound by \`${i}\` in wrangler.jsonc. Add a ${s} entry under another binding name and point the matching \`defineApp()\` override at it.`]}:{added:[o],text:w(e,[s],[t])}},an=(e,n)=>{const s=n.worker_loaders??[];return s.some(t=>t.binding==="LOADER")?{added:[],text:e}:{added:["LOADER (Worker Loader)"],text:w(e,["worker_loaders"],[...s,{binding:"LOADER"}])}},rn=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},dn=e=>{const{image:n}=e;return n.kind==="dockerfile"?n.dockerfilePath:n.kind==="registry"?n.reference:te(e.exportName)},z=e=>{const n={};for(const[s,t]of Object.entries(e.images??{}))n[s]=t.kind==="registry"?{image:t.reference}:{build_context:t.buildContext,dockerfile:t.dockerfilePath,...e.buildArgs===void 0?{}:{build_vars:e.buildArgs}};return{class_name:e.className,scheduling_policy:"durable_object",...Object.keys(n).length>0?{images:n}:{},...e.name===void 0?{}:{name:e.name}}},cn=e=>{if(e.schedulingPolicy==="durable_object")return z(e);const{image:n}=e,s={class_name:e.className,image:dn(e)};return n.kind==="dockerfile"&&(s.image_build_context=n.buildContext),e.buildArgs!==void 0&&n.kind!=="registry"&&(s.image_vars=e.buildArgs),e.instanceType!==void 0&&(s.instance_type=rn(e.instanceType)),e.maxInstances!==void 0&&(s.max_instances=e.maxInstances),e.name!==void 0&&(s.name=e.name),e.rollout?.stepPercentage!==void 0&&(s.rollout_step_percentage=e.rollout.stepPercentage),e.rollout?.gracePeriodSeconds!==void 0&&(s.rollout_active_grace_period=e.rollout.gracePeriodSeconds),s},ln=(e,n,s)=>{const t=n.containers??[],o=new Set(t.map(d=>d.class_name)),i=s.filter(d=>!o.has(d.className));let a=i.length===0?e:w(e,["containers"],[...t,...i.map(d=>cn(d))]);const m=[],u=[];for(const[d,c]of t.entries()){const p=s.find(g=>g.className===c.class_name);if(p===void 0)continue;const l=p.schedulingPolicy??"default";if((c.scheduling_policy??"default")!==l){u.push(`containers/${p.className} has scheduling_policy "${c.scheduling_policy??"default"}" in wrangler.jsonc but defineContainer "${p.exportName}" declares "${l}" — the policy is immutable, so replace the entry (and its container application) by hand.`);continue}const v=p.schedulingPolicy==="durable_object"?z(p).images:void 0;v!==void 0&&JSON.stringify(c.images)!==JSON.stringify(v)&&(a=w(a,["containers",d,"images"],v),m.push(`containers/${p.className}.images`))}return{added:i.map(d=>`containers/${d.className}`),text:a,updated:m,warnings:u}},un=(e,n)=>{if(n.observability!==void 0)return{added:[],text:e};const s=w(e,["observability"],{...Se});return{added:["observability"],text:s}},gn=(e,n)=>n.upload_source_maps!==void 0?{added:[],text:e}:{added:["upload_source_maps"],text:w(e,["upload_source_maps"],!0)},Z=[{minimum:[4,142],name:"wrangler"},{minimum:[1,61],name:"@cloudflare/vite-plugin"}],mn=Z.map(({minimum:e,name:n})=>`${n}@^${e.join(".")}.0`).join(" "),pn=(e,n)=>{try{const s=se(Q(e,"package.json")).resolve(`${n}/package.json`),[t=0,o=0]=String(ie(s).version).split(".").map(Number);return[t,o]}catch{return}},fn=e=>{const n=Z.flatMap(({minimum:s,name:t})=>{const o=pn(e,t);return o!==void 0&&(o[0]<s[0]||o[0]===s[0]&&o[1]<s[1])?[`${t} ${o.join(".")} (needs >= ${s.join(".")})`]:[]});return n.length===0?void 0:`workflows are declared in wrangler \`exports\`, which ${n.join(" and ")} cannot run — reconcile left workflows[] untouched. Upgrade (\`pnpm add -D ${mn}\`) and re-run.`},bn=e=>Object.entries(e.env??{}).flatMap(([n,s])=>Array.isArray(s?.workflows)?[`env.${n}.workflows declares workflow bindings, but Lunora now declares workflows in \`exports\` and resolves them on ctx.exports — move them to that environment's own \`exports\` by hand.`]:[]),hn=(e,n,s)=>{let t=e;const o=[],i=[];for(const a of s){const m=n[a.className];if(m?.type==="workflow")for(const{of:u,path:d}of _e){const c=u(a),p=G(m,d),l=`exports/${a.className}.${d.join(".")}`;if(c===void 0){p!==void 0&&i.push(`${l} is set in wrangler.jsonc but defineWorkflow "${a.exportName}" does not declare it — reconcile leaves it in place. Remove it by hand if it was dropped from the definition.`);continue}JSON.stringify(p)!==JSON.stringify(c)&&(t=w(t,["exports",a.className,...d],c),o.push(l))}}return{text:t,updated:o,warnings:i}},vn=(e,n,s,t,o)=>{if(o!==void 0)return{added:[],text:e,warnings:[o]};const i=[...s.map(b=>({settings:ve(b),workflow:b})),...t.map(b=>({settings:{},workflow:b}))],a=new Set(i.map(({workflow:b})=>b.className)),m=n.workflows??[],u=m.filter(b=>b.script_name===void 0&&b.class_name!==void 0&&a.has(b.class_name)),d=n.exports??{},c=[],p=[],l=[];let v=e;for(const{settings:b,workflow:h}of i){if(d[h.className]!==void 0&&d[h.className]!==null)continue;const _=u.find(f=>f.class_name===h.className),E=Object.fromEntries(we.flatMap(f=>{const y=G(_,[f]);return y===void 0?[]:[[f,y]]})),O=_?.name??h.name;_?.name!==void 0&&_.name!==h.name&&l.push(`workflows/${h.className} is deployed as "${_.name}" but declared as "${h.name}" — its export keeps "${_.name}" so running instances survive. Change the declaration to match, or rename deliberately (it starts a new, empty workflow).`),v=w(v,["exports",h.className],{type:"workflow",...E,...b,name:O}),(_===void 0?c:p).push(`exports/${h.className}`)}if(u.length>0){const b=m.filter(h=>!u.includes(h));v=w(v,["workflows"],b.length===0?void 0:b),p.push(...u.map(h=>`workflows/${String(h.class_name)} → exports`))}l.push(...bn(n));const g=hn(v,d,s);return{added:c,text:g.text,updated:[...p,...g.updated],warnings:[...l,...g.warnings]}},Pn=(e,n,{environment:s,target:t}={})=>{const o=Ee(e),i=Fe(n);if(!o)return{added:[],changed:!1,exportGaps:i,reason:"wrangler.jsonc not found",updated:[],warnings:D(n,e)};const{parsed:a,text:m}=xe(o);if(a===void 0)return{added:[],changed:!1,exportGaps:i,reason:`failed to parse ${o} as JSONC`,updated:[],warnings:D(n,e),wranglerPath:o};const u=D(n,e,a,t);if(s!==void 0){const r=a.env?.[s]!==void 0;u.push(r?`auto-provisioned bindings are written to the top level of wrangler.jsonc only (queue consumers "env.${s}" already declares are retuned, nothing is added) — "env.${s}" has its own (non-inheritable) bindings and must be reconciled by hand; \`lunora deploy --env ${s}\` now validates them, so a gap here will be reported at deploy time.`:`--env "${s}" was requested but wrangler.jsonc declares no "env.${s}" block — auto-provisioned bindings are written to the top level only and will not apply to that environment.`)}const d=n.containers.filter(r=>r.exported),c=n.agents.filter(r=>r.exported&&r.voice===!0&&r.voiceBindingName!==void 0&&r.voiceClassName!==void 0),p=[...n.durableObjects,...d.map(r=>({binding:r.bindingName,className:r.className})),...c.map(r=>({binding:r.voiceBindingName,className:r.voiceClassName}))],l=n.workflows.filter(r=>r.exported),v=n.agents.filter(r=>r.exported),g=Y(e),b=Te(g,u),h={},_=le(g);let E;const O=[{enabled:!0,run:r=>Ve(r,a,p)},{enabled:n.needsD1,run:r=>Ue(r,a)},{enabled:n.usesKv,run:r=>tn(r,a,n.jurisdiction,t)},{enabled:n.usesHyperdrive,run:r=>nn(r,a,t)},{enabled:n.usesArtifacts,run:r=>on(r,a,n.jurisdiction,t)},{enabled:n.usesAi,run:r=>k(r,a,"ai")},{enabled:n.usesAiSearch,run:r=>V(r,a,"ai_search_namespaces",{binding:"AI_SEARCH",namespace:"default"},"AI_SEARCH (AI Search namespace)")},{enabled:Je(n,e),run:r=>k(r,a,"analytics")},{enabled:n.usesBrowser,run:r=>k(r,a,"browser")},{enabled:n.usesImages,run:r=>k(r,a,"images")},{enabled:n.usesAnalytics,run:r=>V(r,a,"analytics_engine_datasets",{binding:"ANALYTICS",dataset:"ANALYTICS"},"ANALYTICS (Analytics Engine)")},{enabled:n.usesWorkerLoader,run:r=>an(r,a)},{enabled:!0,run:r=>un(r,a)},{enabled:t===void 0||t==="cloudflare",run:r=>gn(r,a)},{enabled:d.length>0,run:r=>ln(r,a,d)},{enabled:l.length>0||v.length>0,run:r=>vn(r,a,l,v,fn(e))},{enabled:n.queues.length>0,run:r=>{const S=$e(r,a,n.queues,b.queues??{});return h.queues=S.owned,S}},{enabled:n.services!==void 0&&(n.services.length>0||Object.keys(_).length>0),run:r=>{const S=ue(r,a,n.services??[],_);return E=S.owned,S}},...s===void 0||a.env?.[s]===void 0?[]:[{enabled:n.queues.length>0,run:r=>{const S=`env.${s}.queues`,N=Ce(r,a,n.queues,s,b[S]??{});return h[S]=N.owned,N}}]];let f=m;const y=[],A=[];for(const r of O){if(!r.enabled)continue;const S=r.run(f);f=S.text,y.push(...S.added),A.push(...S.updated??[]),u.push(...S.warnings??[])}const H=r=>{if(g===void 0)return;const S=E,N=[...Object.keys(h).length>0?[{consequence:"an option removed from defineQueue stays deployed",key:"queueTuning",label:"queue tuning",write:x=>{Ie(x,b,h)}}]:[],...S===void 0?[]:[{consequence:"a service removed from lunora.config stays bound",key:"services",label:"service bindings",write:x=>{me(x,S)}}]];for(const x of N)try{x.write(Y(e)??g)}catch(T){u.push(`${r?"wrangler.jsonc was updated, but ":""}recording the ${x.label} reconcile owns in ${g.path} (lunora.${x.key}) failed: ${T instanceof Error?T.message:String(T)}. Until it is recorded, ${x.consequence}.`)}};let C;if(n.services!==void 0){const r=ge(e,n.services,_);u.push(...r.warnings),E={...E,...r.owned},C=r.added.length>0||r.updated.length>0?{added:r.added,path:r.path,updated:r.updated}:void 0}return u.push(...Qe(y,t)),f===m?(H(!1),{added:y,changed:!1,devConfig:C,exportGaps:i,reason:"bindings already in sync",updated:A,warnings:u,wranglerPath:o}):(ne(o,f,"utf8"),H(!0),{added:y,changed:!0,devConfig:C,exportGaps:i,updated:A,warnings:u,wranglerPath:o})};export{Fe as collectExportGaps,Pn as reconcileWranglerBindings};
@@ -65,6 +65,10 @@ interface DeployRequest {
65
65
  environment?: string;
66
66
  /** Write the built bundle (and any build metadata) to this directory. */
67
67
  outDir?: string;
68
+ /** Also write the upload-ready artifact (what the host would receive) to this file, for tools that profile it. */
69
+ outFile?: string;
70
+ /** Upload a preview/versioned artifact instead of taking production traffic. No built-in driver can produce one yet: the Cloudflare driver refuses it. */
71
+ preview?: boolean;
68
72
  /** A file of secrets (JSON object of name to value) uploaded with the deployment, so a Worker's first version boots with them. */
69
73
  secretsFile?: string;
70
74
  /** Deploy to a short-lived, unauthenticated account where the host offers one. */
@@ -65,6 +65,10 @@ interface DeployRequest {
65
65
  environment?: string;
66
66
  /** Write the built bundle (and any build metadata) to this directory. */
67
67
  outDir?: string;
68
+ /** Also write the upload-ready artifact (what the host would receive) to this file, for tools that profile it. */
69
+ outFile?: string;
70
+ /** Upload a preview/versioned artifact instead of taking production traffic. No built-in driver can produce one yet: the Cloudflare driver refuses it. */
71
+ preview?: boolean;
68
72
  /** A file of secrets (JSON object of name to value) uploaded with the deployment, so a Worker's first version boots with them. */
69
73
  secretsFile?: string;
70
74
  /** Deploy to a short-lived, unauthenticated account where the host offers one. */
@@ -1,4 +1,4 @@
1
- import { e as ToolchainCommand, D as DeployDriver, d as ProjectionPurpose } from "./deploy-driver.d-BqO40t1Q.mjs";
1
+ import { e as ToolchainCommand, D as DeployDriver, d as ProjectionPurpose } from "./deploy-driver.d-CHVNQFV2.mjs";
2
2
  /**
3
3
  * Project-relative directory the Lunora agent skills ("rules") install into.
4
4
  * This is the portable [Agent Skills](https://tanstack.com/intent/latest/docs/registry)
@@ -1,4 +1,4 @@
1
- import { e as ToolchainCommand, D as DeployDriver, d as ProjectionPurpose } from "./deploy-driver.d-BqO40t1Q.js";
1
+ import { e as ToolchainCommand, D as DeployDriver, d as ProjectionPurpose } from "./deploy-driver.d-CHVNQFV2.js";
2
2
  /**
3
3
  * Project-relative directory the Lunora agent skills ("rules") install into.
4
4
  * This is the portable [Agent Skills](https://tanstack.com/intent/latest/docs/registry)
@@ -86,6 +86,7 @@ interface DurableObjectSpec {
86
86
  * to export a class of this exact name, so detection keys on the class name.
87
87
  */
88
88
  declare const DURABLE_OBJECT_BINDINGS: {
89
+ readonly AdminRevocationDO: "ADMIN_REVOCATIONS";
89
90
  readonly LunoraDO: "SHARD";
90
91
  readonly SchedulerDO: "SCHEDULER";
91
92
  readonly SessionDO: "SESSION";
@@ -113,7 +114,7 @@ type DurableObjectClass = keyof typeof DURABLE_OBJECT_BINDINGS;
113
114
  * has a `.scheduler()` method at all. `@lunora/vite` depends on `@lunora/config`, so config
114
115
  * owning it is the direction the dependency graph allows.
115
116
  */
116
- declare const GENERATED_CLASS_MODULES: readonly ["agents", "containers", "scheduler", "shardRegistry", "workflows"];
117
+ declare const GENERATED_CLASS_MODULES: readonly ["adminRevocations", "agents", "containers", "scheduler", "shardRegistry", "workflows"];
117
118
  /** One {@link GENERATED_CLASS_MODULES} entry. */
118
119
  type GeneratedClassModule = (typeof GENERATED_CLASS_MODULES)[number];
119
120
  /**
@@ -86,6 +86,7 @@ interface DurableObjectSpec {
86
86
  * to export a class of this exact name, so detection keys on the class name.
87
87
  */
88
88
  declare const DURABLE_OBJECT_BINDINGS: {
89
+ readonly AdminRevocationDO: "ADMIN_REVOCATIONS";
89
90
  readonly LunoraDO: "SHARD";
90
91
  readonly SchedulerDO: "SCHEDULER";
91
92
  readonly SessionDO: "SESSION";
@@ -113,7 +114,7 @@ type DurableObjectClass = keyof typeof DURABLE_OBJECT_BINDINGS;
113
114
  * has a `.scheduler()` method at all. `@lunora/vite` depends on `@lunora/config`, so config
114
115
  * owning it is the direction the dependency graph allows.
115
116
  */
116
- declare const GENERATED_CLASS_MODULES: readonly ["agents", "containers", "scheduler", "shardRegistry", "workflows"];
117
+ declare const GENERATED_CLASS_MODULES: readonly ["adminRevocations", "agents", "containers", "scheduler", "shardRegistry", "workflows"];
117
118
  /** One {@link GENERATED_CLASS_MODULES} entry. */
118
119
  type GeneratedClassModule = (typeof GENERATED_CLASS_MODULES)[number];
119
120
  /**
@@ -1 +1 @@
1
- import{statSync as F,readFileSync as J,existsSync as k,readdirSync as de}from"node:fs";import{relative as le,sep as ue,isAbsolute as pe,join as S,dirname as P,resolve as me}from"node:path";import{discoverFlags as fe,FLAGS_FILENAME as ge,discoverQueues as he,CAPABILITY_PROBES as Q,readServiceBindings as xe,discoverNotifyChannels as Se,NOTIFY_FILENAME as ye,createTargetScope as ve,mayReadCapabilityContext as Ee,sourceCapabilitySignals as be,foldCapabilitySignals as V,capabilitiesUsedBy as Ne}from"@lunora/codegen";import{init as Ce}from"es-module-lexer";import{ts as n,Node as m,Project as z}from"ts-morph";import{discoverAgentInfo as Te}from"./discoverAgentInfo-pqFMJBtJ.mjs";import{discoverContainerInfo as Ie}from"./discoverContainerInfo-DzXr7Vm3.mjs";import{escapeRegExp as Re}from"./DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";import{d as M}from"./discover-info-DC2MrAIM.mjs";import{P as Ae}from"./package-secrets-registry-UQ_uEAB_.mjs";import{discoverSchemaInfo as Oe}from"./discoverSchemaInfo-DRPnqgif.mjs";import{resolveWorkerEntry as we,composedEntryDurableObjects as De,GENERATED_DIRECTORY as w,DURABLE_OBJECT_BINDINGS as _e,detectExportedDurableObjects as Le,detectClassExports as L,isMergedProject as Z}from"./COMPOSED_WORKER_ENTRY-Ciiba5g_.mjs";import{discoverWorkflowInfo as $e}from"./discoverWorkflowInfo-zW7Tt0Tn.mjs";const Pe=(e,t)=>{const{error:s,value:o}=M(e,t,ge,fe);return s===void 0?{flags:o}:{error:s}},ee=(e,t)=>{const s=le(t,e);return s!==""&&s!==".."&&!s.startsWith(`..${ue}`)&&!pe(s)},je=(e,t)=>{const{error:s,value:o}=M(e,t,void 0,he);return s===void 0?{queues:o??[]}:{error:s,queues:[]}},b="@lunora/replica",h="EventLogDOClient",Fe=/\.[cm]?[jt]sx?$/u,Y=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"],U=new Map,K=e=>{const{mtimeMs:t}=F(e),s=U.get(e);if(s?.mtimeMs===t)return s.source;const o=n.createSourceFile(e,J(e,"utf8"),n.ScriptTarget.Latest);return U.set(e,{mtimeMs:t,source:o}),o},q=new WeakMap,ke=e=>{const t=q.get(e);if(t!==void 0&&t[0]?.wasForgotten()!==!0)return t;const s=e.getDescendantsOfKind(n.SyntaxKind.Identifier);return q.set(e,s),s},H=e=>n.sys.fileExists(e)?F(e).mtimeMs:-1,X=new Map,Me=e=>{const t=n.findConfigFile(P(e),i=>n.sys.fileExists(i));if(t===void 0)return{};const s=X.get(t);if(s!==void 0&&[...s.mtimes].every(([i,c])=>H(i)===c))return s.options;const o=n.readJsonConfigFile(t,i=>n.sys.readFile(i)),{options:r}=n.parseJsonSourceFileConfigFileContent(o,n.sys,P(t)),a=new Map([t,...o.extendedSourceFiles??[]].map(i=>[i,H(i)]));return X.set(t,{mtimes:a,options:r}),r},B=(e,t)=>{if(t===b)return;if(!t.startsWith("./")&&!t.startsWith("../")){const a={moduleResolution:n.ModuleResolutionKind.Bundler,...Me(e)},i=n.resolveModuleName(t,e,a,n.sys).resolvedModule;return i?.isExternalLibraryImport===!0?void 0:i?.resolvedFileName}const s=S(P(e),t.replace(Fe,"")),o=Y.map(a=>`${s}${a}`),r=Y.map(a=>S(s,`index${a}`));return[...o,...r].find(a=>k(a))},Ke=e=>{const t=new Map;for(const s of e.statements){if(!n.isImportDeclaration(s)||s.importClause?.phaseModifier===n.SyntaxKind.TypeKeyword||!n.isStringLiteral(s.moduleSpecifier))continue;const o=s.importClause?.namedBindings,r=o!==void 0&&n.isNamedImports(o)?o.elements:[];for(const a of r)a.isTypeOnly||t.set(a.name.text,{module:s.moduleSpecifier.text,name:(a.propertyName??a.name).text})}return t},Be=e=>{const t=new Map;for(const s of e.statements){if(!n.isImportDeclaration(s)||s.importClause?.phaseModifier===n.SyntaxKind.TypeKeyword||!n.isStringLiteral(s.moduleSpecifier))continue;const o=s.importClause?.namedBindings;o!==void 0&&n.isNamespaceImport(o)&&t.set(o.name.text,s.moduleSpecifier.text)}return t},D=e=>n.canHaveModifiers(e)&&(n.getModifiers(e)??[]).some(t=>t.kind===n.SyntaxKind.ExportKeyword),Ge=e=>n.isVariableStatement(e)?D(e)?e.declarationList.declarations.flatMap(t=>n.isIdentifier(t.name)?[t.name.text]:[]):[]:(n.isClassDeclaration(e)||n.isFunctionDeclaration(e))&&D(e)?e.name===void 0?[]:[e.name.text]:n.isExportDeclaration(e)&&e.moduleSpecifier===void 0&&!e.isTypeOnly&&e.exportClause!==void 0&&n.isNamedExports(e.exportClause)?e.exportClause.elements.map(t=>t.name.text):[],We=e=>new Set(e.statements.flatMap(t=>Ge(t))),Ve=(e,t,s)=>{if(n.isIdentifier(e))return t.get(e.text);if(n.isPropertyAccessExpression(e)&&n.isIdentifier(e.expression)){const o=s.get(e.expression.text);return o===void 0?void 0:{module:o,name:e.name.text}}},Ye=(e,t,s)=>D(e)?e.declarationList.declarations.flatMap(o=>{if(!n.isIdentifier(o.name)||o.initializer===void 0)return[];const r=Ve(o.initializer,t,s);return r===void 0?[]:[{exported:o.name.text,module:r.module,name:r.name}]}):[],Ue=(e,t)=>{const s=e.heritageClauses?.find(r=>r.token===n.SyntaxKind.ExtendsKeyword)?.types[0]?.expression;if(!D(e)||e.name===void 0||s===void 0||!n.isIdentifier(s))return[];const o=t.get(s.text);return o===void 0?[]:[{exported:e.name.text,module:o.module,name:o.name}]},qe=e=>{const t=Ke(e),s=Be(e);return e.statements.flatMap(o=>{if(n.isVariableStatement(o))return Ye(o,t,s);if(n.isClassDeclaration(o))return Ue(o,t);if(!n.isExportDeclaration(o)||o.isTypeOnly)return[];const{exportClause:r,moduleSpecifier:a}=o,i=a!==void 0&&n.isStringLiteral(a)?a.text:void 0;return r===void 0?i===void 0?[]:[{exported:void 0,module:i,name:void 0}]:n.isNamedExports(r)?r.elements.flatMap(c=>{if(c.isTypeOnly)return[];const d=c.name.text,l=(c.propertyName??c.name).text;if(i!==void 0)return[{exported:d,module:i,name:l}];const u=t.get(l);return u===void 0?[]:[{exported:d,module:u.module,name:u.name}]}):[]})},G=(e,t,s,o,r=new Set)=>{const a=JSON.stringify([e,s,[...r]]);if(o.has(a))return!1;o.add(a);const i=K(e),c=qe(i),d=new Set([...r,...We(i),...c.flatMap(l=>l.exported===void 0?[]:[l.exported])]);return c.some(l=>{if(s!==void 0&&l.exported!==void 0&&l.exported!==s||l.exported!==void 0&&r.has(l.exported))return!1;if(l.exported===void 0){const g=s??(l.module===b?t:void 0);if(g!==void 0&&d.has(g))return!1}const u=l.exported===void 0?s:l.name;if(l.module===b)return u===void 0||u===t;const v=B(e,l.module);return v!==void 0&&G(v,t,u,o,l.exported===void 0?d:r)})},j=(e,t)=>ke(e).some(s=>{const o=s.getParent();return s.getText()!==t||m.isNamespaceImport(o)||m.isPropertyAccessExpression(o)&&o.getNameNode()===s||m.isQualifiedName(o)&&o.getRight()===s?!1:m.isPropertyAccessExpression(o)?o.getName()===h:m.isQualifiedName(o)?!m.isTypeReference(o.getParent())&&o.getRight().getText()===h:!0}),He=e=>{const[t]=e.getArguments();return e.getExpression().getKind()===n.SyntaxKind.ImportKeyword&&t!==void 0&&(m.isStringLiteral(t)||m.isNoSubstitutionTemplateLiteral(t))&&t.getLiteralValue()===b},Xe=e=>{const t=e.getPropertyNameNode();if(t===void 0)return e.getNameNode().getText();const s=m.isComputedPropertyName(t)?t.getExpression():t;return m.isStringLiteral(s)||m.isNoSubstitutionTemplateLiteral(s)?s.getLiteralValue():t.getText()},Je=e=>{let t=e,s=!1;for(let r=e.getParent();m.isParenthesizedExpression(r)||m.isAwaitExpression(r);r=t.getParent())s||=m.isAwaitExpression(r),t=r;if(!s)return!0;const o=t.getParent();if(m.isVariableDeclaration(o)){const r=o.getNameNode();return!m.isObjectBindingPattern(r)||r.getElements().some(a=>a.getDotDotDotToken()!==void 0||Xe(a)===h)}return m.isPropertyAccessExpression(o)&&o.getExpression()===t?o.getName()===h:!0},Qe=(e,t)=>K(e).statements.some(s=>n.isExportDeclaration(s)&&s.moduleSpecifier!==void 0&&n.isStringLiteral(s.moduleSpecifier)&&s.moduleSpecifier.text===b&&s.exportClause!==void 0&&n.isNamespaceExport(s.exportClause)&&s.exportClause.name.text===t),ze=e=>e.getImportDeclarations().some(t=>{const s=t.getNamespaceImport(),o=t.isTypeOnly()?[]:t.getNamedImports().filter(d=>!d.isTypeOnly()),r=o.some(d=>d.getNameNode().getText()===h),a=o.filter(d=>j(e,(d.getAliasNode()??d.getNameNode()).getText())),i=s!==void 0&&j(e,s.getText());if(!r&&!i&&a.length===0)return!1;const c=B(e.getFilePath(),t.getModuleSpecifierValue());return c===void 0?!1:(r||i)&&G(c,h,h,new Set)||a.some(d=>Qe(c,d.getNameNode().getText()))}),te=e=>{const t=e.getImportDeclarations().filter(s=>s.getModuleSpecifierValue()===b&&!s.isTypeOnly());return t.some(s=>s.getNamedImports().some(o=>!o.isTypeOnly()&&o.getNameNode().getText()===h))||t.some(s=>{const o=s.getNamespaceImport();return o!==void 0&&j(e,o.getText())})||e.getExportDeclarations().some(s=>s.getModuleSpecifierValue()===b&&!s.isTypeOnly()&&s.getNamedExports().some(o=>!o.isTypeOnly()&&o.getNameNode().getText()===h))||ze(e)||e.getDescendantsOfKind(n.SyntaxKind.CallExpression).some(s=>He(s)&&Je(s))},Ze=e=>{const t=[],s=o=>{if(n.isImportDeclaration(o)&&o.importClause?.phaseModifier!==n.SyntaxKind.TypeKeyword&&n.isStringLiteral(o.moduleSpecifier))t.push(o.moduleSpecifier.text);else if(n.isExportDeclaration(o)&&!o.isTypeOnly&&o.moduleSpecifier!==void 0&&n.isStringLiteral(o.moduleSpecifier))t.push(o.moduleSpecifier.text);else if(n.isCallExpression(o)&&o.expression.kind===n.SyntaxKind.ImportKeyword){const[r]=o.arguments;r!==void 0&&(n.isStringLiteral(r)||n.isNoSubstitutionTemplateLiteral(r))&&t.push(r.text)}n.forEachChild(o,s)};return s(e),t},et=new Set([".cjs",".cts",".js",".jsx",".mjs",".mts",".ts",".tsx"]),tt=new Set([".git",".lunora-cache",".wrangler","dist",w,"node_modules"]),st=["lunora","src"],ot=/\benv\s*\.\s*DB\b/,rt=/\benv\s*\.\s*AI\b/,se=["ai","aiSearch","analytics","analyticsSql","artifacts","browser","hyperdrive","images","kv","mail","notify","payments","pipelines","r2sql","scheduler","storage","x402"],oe=e=>`uses${e.charAt(0).toUpperCase()}${e.slice(1)}`,re=[["usesAuth","@lunora/auth"],["usesCimdWorkers","@lunora/auth/cimd/workers"],["usesX402Charge","@lunora/x402/charge"],["usesPaymentAutumn","@lunora/payment/autumn"],["usesPaymentCreem","@lunora/payment/creem"],["usesPaymentDodopayments","@lunora/payment/dodopayments"],["usesPaymentPolar","@lunora/payment/polar"],["usesPaymentStripe","@lunora/payment/stripe"]],ne=[...se.map(e=>[oe(e),Q[e].moduleSpecifier]),...re].toSorted(([e],[t])=>e.localeCompare(t)),nt=[["usesNotifyFcm","@lunora/notify:fcm"],["usesNotifyWebPush","@lunora/notify:webPush"],["hostsShardRegistry","@lunora/do:shardRegistry"],["hostsEventLog","@lunora/replica:eventLog"],["usesEventLogClient","@lunora/replica:eventLogClient"],["usesRequestSecretTool","@lunora/agent:requestSecretTool"]],it=["@lunora/agent","@lunora/agent/sandbox"],ie=new RegExp(String.raw`["'\x60](?:${[...ne.map(([,e])=>e),...it,b].map(e=>Re(e)).join("|")})["'\x60]`,"u"),p=e=>{const{contextProperty:t,moduleSpecifier:s}=Q[e];return t===void 0?`${s} is imported`:`${s} is imported or ctx.${t} is read`},at="STRIPE_SECRET_KEY + STRIPE_WEBHOOK_SECRET (Stripe) or POLAR_ACCESS_TOKEN + POLAR_WEBHOOK_SECRET (Polar)",ct=/\bfrom\s+["']\.{1,2}\//u,ae=(e,t)=>{let s;try{s=de(e,{withFileTypes:!0})}catch{return}for(const o of s){if(o.isDirectory()){tt.has(o.name)||ae(S(e,o.name),t);continue}const r=o.name.lastIndexOf(".");r!==-1&&et.has(o.name.slice(r))&&t.push(S(e,o.name))}},dt=(e,t,s)=>{const{info:o}=Oe(e,t,s);return{jurisdiction:o?.jurisdiction,needsD1:o?.hasD1GlobalTable??!1}};let $;const lt=e=>{const t=me(e);return $?.root!==t&&($={project:new z({compilerOptions:{allowJs:!0},skipAddingFilesFromTsConfig:!0}),root:t}),$.project},ut=(e,t,s)=>{e.getSourceFile(t)?.getFullText()!==s&&e.createSourceFile(t,s,{overwrite:!0})},pt=(e,t)=>{for(const s of e.getSourceFiles())t.has(s)||e.removeSourceFile(s)},mt=(e,t,s)=>{const o=S(e,s),r=lt(e),a=[],i=new Set,c=[],d=[],l=ve();let u=!1,v=!1;for(const f of t){const x=S(e,f);if(!k(x)||!F(x).isDirectory())continue;const O=[];ae(x,O);for(const C of O){i.add(C);const y=J(C,"utf8"),E=ee(C,o);u||=rt.test(y),v||=ot.test(y),(ie.test(y)||y.includes(h)||E&&(Ee(y)||ct.test(y)))&&(ut(r,C,y),a.push({file:C,inLunora:E}))}}pt(r,new Set(a.map(({file:f})=>r.getSourceFileOrThrow(f))));for(const{file:f,inLunora:x}of a)(x?c:d).push(be(r.getSourceFileOrThrow(f),l));const g=V(c),A=V([g,...d]),N=new Set([...A.valueImports,...A.dynamicImports]),T=Ne({contextReads:g.contextReads,valueImports:N});return{...Object.fromEntries([...se.map(f=>[oe(f),T.has(f)]),...re.map(([f,x])=>[f,N.has(x)])]),needsD1:v,usesEventLogClient:a.some(({file:f})=>te(r.getSourceFileOrThrow(f))),usesRequestSecretTool:g.requestSecretTool,usesAi:T.has("ai")||u,usesBrowser:T.has("browser")||g.sandboxTools.usesSandboxBrowser,usesWorkerLoader:g.sandboxTools.usesSandboxLoader,scannedFiles:i}},ft=(e,t,s)=>[...e.map(o=>o.exported?`${o.bindingName}/${o.className} (container "${o.exportName}" declared and exported)`:`hint: container "${o.exportName}" is declared but ${o.className} is not exported by the worker entry — add \`export * from "./lunora/_generated/containers"\``),...t.map(o=>o.exported?`exports.${o.className} (workflow "${o.exportName}" declared and exported)`:`hint: workflow "${o.exportName}" is declared but ${o.className} is not exported by the worker entry — add \`export * from "./lunora/_generated/workflows"\``),...s.map(o=>o.exported?`exports.${o.className} (agent "${o.exportName}" declared and exported)`:`hint: agent "${o.exportName}" is declared but ${o.className} is not exported by the worker entry — add \`export * from "./lunora/_generated/agents"\``)],gt=(e,t,s)=>[[e.usesAi,`AI (${p("ai")}, or env.AI is used)`],[e.usesAuth&&!t.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&&!t.has("SchedulerDO"),`hint: ${p("scheduler")}, but no SchedulerDO is exported by the worker entry`],[e.usesStorage,`hint: ${p("storage")}; add an r2_buckets binding (bucket binding names are user-defined)`],[e.usesMail,`hint: ${p("mail")}; set RESEND_API_KEY in .dev.vars (obtain at https://resend.com/api-keys)`],[e.usesPayments,`hint: ${p("payments")}; set the provider secrets in .dev.vars — ${at}`],[e.usesBrowser,`browser (${p("browser")}, or a sandbox browserTool imported in lunora/) — self-describing { binding: BROWSER }`],[e.usesImages,`images (${p("images")}) — self-describing { binding: IMAGES }`],[e.usesAnalytics,`analytics_engine_datasets (${p("analytics")}) — self-describing { binding: ANALYTICS, dataset }`],[e.usesWorkerLoader,"worker_loaders (jsCodeTool imported in lunora/) — self-describing { binding: LOADER }"],[e.usesAiSearch,`ai_search_namespaces (${p("aiSearch")}) — self-describing { binding: AI_SEARCH, namespace: "default" }; remote-only, so \`lunora dev\` reaches the deployed AI Search service`],[e.usesAnalyticsSql,`analytics (${p("analyticsSql")}) — self-describing { binding: ANALYTICS_SQL }; needs wrangler >= 4.145.0, and is remote-only, so \`lunora dev\` queries the account's live analytics`],[e.usesKv,s.jurisdiction===void 0?`kv_namespaces (${p("kv")}) — { binding: KV } with no id; wrangler creates the namespace on the first deploy`:`hint: ${p("kv")} and the schema pins "${s.jurisdiction}"; create the namespace with --jurisdiction ${s.jurisdiction} and add a kv_namespaces binding ({ binding, id })`],[e.usesHyperdrive,`hyperdrive (${p("hyperdrive")}) — { binding: HYPERDRIVE } with a placeholder id; dev uses an embedded Postgres and \`lunora deploy\` creates the config`],[e.usesPipelines,`hint: ${p("pipelines")}; run 'wrangler pipelines create <name>' and add a 'pipelines' binding ({ binding, stream }) — the pipeline resource can't be auto-provisioned`],[e.usesArtifacts,s.jurisdiction===void 0?`artifacts (${p("artifacts")}) — { binding: ARTIFACTS, namespace }`:`hint: ${p("artifacts")}; the schema pins data to "${s.jurisdiction}", so create the namespace in that jurisdiction first and add { binding: ARTIFACTS, namespace } yourself — \`lunora deploy\` then checks it (a first create() in dev would make it unrestricted)`],[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.usesX402,`hint: ${p("x402")} (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),ht=(e,t,s,o=[],r=[],a=[])=>{const i=new Set(e.map(d=>d.className)),c=e.map(d=>`${d.binding}/${d.className} (exported by worker entry)`);return t.needsD1&&c.push("DB (.global() table declared)"),c.push(...ft(o,r,a),...gt(s,i,t)),c},xt=(e,t)=>e.some(s=>s.binding==="SHARD_REGISTRY")||Z(t)&&k(S(t,"shardRegistry.ts")),St=(e,t,s)=>{const o=new z({compilerOptions:{allowJs:!0},skipAddingFilesFromTsConfig:!0}),r=[e],a=new Set;for(let i=r.pop();i!==void 0;i=r.pop()){if(a.has(i))continue;a.add(i);const c=K(i),d=c.text;if((ie.test(d)||d.includes(h))&&te(o.createSourceFile(i,d,{overwrite:!0})))return!0;for(const l of Ze(c)){const u=B(i,l);u!==void 0&&!t.has(u)&&!ee(u,s)&&r.push(u)}}return!1},yt=e=>!e.composed&&e.path!==void 0&&G(e.path,"EventLogDO",void 0,new Set),Lt=async e=>{await Ce;const t=e.schemaDir??"lunora",s=e.scanDirs??st,o=()=>mt(e.projectRoot,s,t),{scannedFiles:r,...a}=e.cache===void 0?o():e.cache.memo(`capabilities:${e.projectRoot}:${t}:${s.join(",")}`,o),i=we(e.projectRoot);let c;i.composed?c=De(S(e.projectRoot,t,w)).map(W=>({binding:_e[W],className:W})):c=i.path===void 0?[]:Le(i.path);const d=dt(e.projectRoot,t,e.cache),l={...d,needsD1:a.needsD1||d.needsD1},u=L(i,Ie(e.projectRoot,t,e.cache).containers,"containers"),v=L(i,$e(e.projectRoot,t).workflows,"workflows"),g=L(i,Te(e.projectRoot,t).agents,"agents"),A=[...je(e.projectRoot,t).queues],{flags:N}=Pe(e.projectRoot,t),T=M(e.projectRoot,t,ye,Se),_=T.error===void 0?T.value:{hasFcm:!0,hasWebPush:!0},f=N?.provider==="flagship"&&N.mode==="binding"?N.bindingName:void 0,x=S(e.projectRoot,t,w),O=xt(c,x),C=yt(i),y=!i.composed&&i.path!==void 0&&St(i.path,r,x),E=ht(c,l,a,u,v,g);!i.composed&&Z(S(e.projectRoot,t,w))&&!c.some(I=>I.className==="LunoraDO")&&E.push("hint: durableObjects.merge is set, but the worker entry exports no LunoraDO — export one built with mergeDurableObjects, or the classes stay separate"),f!==void 0&&E.push(`hint: lunora/flags.ts uses Flagship in binding mode; add a flagship binding ({ binding: "${f}", app_id }) — the app_id can't be auto-provisioned`);const R=xe(e.projectRoot),ce=R.error===void 0?R.services:void 0;return R.error!==void 0&&E.push(`hint: lunora.config \`services\` not reconciled — ${R.error}`),E.push(...R.services.map(I=>`${I.binding} → ${I.worker} (lunora.config services.${I.name})`)),{...a,usesEventLogClient:a.usesEventLogClient||y,agents:g,containers:u,durableObjects:c,flagshipBinding:f,...l.jurisdiction===void 0?{}:{jurisdiction:l.jurisdiction},needsD1:l.needsD1,queues:A,services:ce,signals:E,usesFlags:N!==void 0,usesNotifyFcm:_?.hasFcm??!1,usesNotifyWebPush:_?.hasWebPush??!1,hostsEventLog:C,hostsShardRegistry:O,workflows:v}},$t=e=>[...ne,...nt].filter(([t,s])=>e[t]&&Ae[s]!==void 0).map(([,t])=>t);export{Lt as inferLunoraBindings,$t as secretSourcesFromBindings};
1
+ import{statSync as F,readFileSync as J,existsSync as k,readdirSync as de}from"node:fs";import{relative as le,sep as ue,isAbsolute as pe,join as S,dirname as P,resolve as me}from"node:path";import{discoverFlags as fe,FLAGS_FILENAME as ge,discoverQueues as he,CAPABILITY_PROBES as Q,readServiceBindings as xe,discoverNotifyChannels as Se,NOTIFY_FILENAME as ye,createTargetScope as ve,mayReadCapabilityContext as Ee,sourceCapabilitySignals as be,foldCapabilitySignals as V,capabilitiesUsedBy as Ne}from"@lunora/codegen";import{init as Ce}from"es-module-lexer";import{ts as n,Node as m,Project as z}from"ts-morph";import{discoverAgentInfo as Te}from"./discoverAgentInfo-pqFMJBtJ.mjs";import{discoverContainerInfo as Ie}from"./discoverContainerInfo-DzXr7Vm3.mjs";import{escapeRegExp as Re}from"./DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";import{d as M}from"./discover-info-DC2MrAIM.mjs";import{P as Ae}from"./package-secrets-registry-UQ_uEAB_.mjs";import{discoverSchemaInfo as Oe}from"./discoverSchemaInfo-DRPnqgif.mjs";import{resolveWorkerEntry as we,composedEntryDurableObjects as De,GENERATED_DIRECTORY as w,DURABLE_OBJECT_BINDINGS as _e,detectExportedDurableObjects as Le,detectClassExports as L,isMergedProject as Z}from"./COMPOSED_WORKER_ENTRY-BcFt6ts5.mjs";import{discoverWorkflowInfo as $e}from"./discoverWorkflowInfo-zW7Tt0Tn.mjs";const Pe=(e,t)=>{const{error:s,value:o}=M(e,t,ge,fe);return s===void 0?{flags:o}:{error:s}},ee=(e,t)=>{const s=le(t,e);return s!==""&&s!==".."&&!s.startsWith(`..${ue}`)&&!pe(s)},je=(e,t)=>{const{error:s,value:o}=M(e,t,void 0,he);return s===void 0?{queues:o??[]}:{error:s,queues:[]}},b="@lunora/replica",h="EventLogDOClient",Fe=/\.[cm]?[jt]sx?$/u,Y=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs"],U=new Map,K=e=>{const{mtimeMs:t}=F(e),s=U.get(e);if(s?.mtimeMs===t)return s.source;const o=n.createSourceFile(e,J(e,"utf8"),n.ScriptTarget.Latest);return U.set(e,{mtimeMs:t,source:o}),o},q=new WeakMap,ke=e=>{const t=q.get(e);if(t!==void 0&&t[0]?.wasForgotten()!==!0)return t;const s=e.getDescendantsOfKind(n.SyntaxKind.Identifier);return q.set(e,s),s},H=e=>n.sys.fileExists(e)?F(e).mtimeMs:-1,X=new Map,Me=e=>{const t=n.findConfigFile(P(e),i=>n.sys.fileExists(i));if(t===void 0)return{};const s=X.get(t);if(s!==void 0&&[...s.mtimes].every(([i,c])=>H(i)===c))return s.options;const o=n.readJsonConfigFile(t,i=>n.sys.readFile(i)),{options:r}=n.parseJsonSourceFileConfigFileContent(o,n.sys,P(t)),a=new Map([t,...o.extendedSourceFiles??[]].map(i=>[i,H(i)]));return X.set(t,{mtimes:a,options:r}),r},B=(e,t)=>{if(t===b)return;if(!t.startsWith("./")&&!t.startsWith("../")){const a={moduleResolution:n.ModuleResolutionKind.Bundler,...Me(e)},i=n.resolveModuleName(t,e,a,n.sys).resolvedModule;return i?.isExternalLibraryImport===!0?void 0:i?.resolvedFileName}const s=S(P(e),t.replace(Fe,"")),o=Y.map(a=>`${s}${a}`),r=Y.map(a=>S(s,`index${a}`));return[...o,...r].find(a=>k(a))},Ke=e=>{const t=new Map;for(const s of e.statements){if(!n.isImportDeclaration(s)||s.importClause?.phaseModifier===n.SyntaxKind.TypeKeyword||!n.isStringLiteral(s.moduleSpecifier))continue;const o=s.importClause?.namedBindings,r=o!==void 0&&n.isNamedImports(o)?o.elements:[];for(const a of r)a.isTypeOnly||t.set(a.name.text,{module:s.moduleSpecifier.text,name:(a.propertyName??a.name).text})}return t},Be=e=>{const t=new Map;for(const s of e.statements){if(!n.isImportDeclaration(s)||s.importClause?.phaseModifier===n.SyntaxKind.TypeKeyword||!n.isStringLiteral(s.moduleSpecifier))continue;const o=s.importClause?.namedBindings;o!==void 0&&n.isNamespaceImport(o)&&t.set(o.name.text,s.moduleSpecifier.text)}return t},D=e=>n.canHaveModifiers(e)&&(n.getModifiers(e)??[]).some(t=>t.kind===n.SyntaxKind.ExportKeyword),Ge=e=>n.isVariableStatement(e)?D(e)?e.declarationList.declarations.flatMap(t=>n.isIdentifier(t.name)?[t.name.text]:[]):[]:(n.isClassDeclaration(e)||n.isFunctionDeclaration(e))&&D(e)?e.name===void 0?[]:[e.name.text]:n.isExportDeclaration(e)&&e.moduleSpecifier===void 0&&!e.isTypeOnly&&e.exportClause!==void 0&&n.isNamedExports(e.exportClause)?e.exportClause.elements.map(t=>t.name.text):[],We=e=>new Set(e.statements.flatMap(t=>Ge(t))),Ve=(e,t,s)=>{if(n.isIdentifier(e))return t.get(e.text);if(n.isPropertyAccessExpression(e)&&n.isIdentifier(e.expression)){const o=s.get(e.expression.text);return o===void 0?void 0:{module:o,name:e.name.text}}},Ye=(e,t,s)=>D(e)?e.declarationList.declarations.flatMap(o=>{if(!n.isIdentifier(o.name)||o.initializer===void 0)return[];const r=Ve(o.initializer,t,s);return r===void 0?[]:[{exported:o.name.text,module:r.module,name:r.name}]}):[],Ue=(e,t)=>{const s=e.heritageClauses?.find(r=>r.token===n.SyntaxKind.ExtendsKeyword)?.types[0]?.expression;if(!D(e)||e.name===void 0||s===void 0||!n.isIdentifier(s))return[];const o=t.get(s.text);return o===void 0?[]:[{exported:e.name.text,module:o.module,name:o.name}]},qe=e=>{const t=Ke(e),s=Be(e);return e.statements.flatMap(o=>{if(n.isVariableStatement(o))return Ye(o,t,s);if(n.isClassDeclaration(o))return Ue(o,t);if(!n.isExportDeclaration(o)||o.isTypeOnly)return[];const{exportClause:r,moduleSpecifier:a}=o,i=a!==void 0&&n.isStringLiteral(a)?a.text:void 0;return r===void 0?i===void 0?[]:[{exported:void 0,module:i,name:void 0}]:n.isNamedExports(r)?r.elements.flatMap(c=>{if(c.isTypeOnly)return[];const d=c.name.text,l=(c.propertyName??c.name).text;if(i!==void 0)return[{exported:d,module:i,name:l}];const u=t.get(l);return u===void 0?[]:[{exported:d,module:u.module,name:u.name}]}):[]})},G=(e,t,s,o,r=new Set)=>{const a=JSON.stringify([e,s,[...r]]);if(o.has(a))return!1;o.add(a);const i=K(e),c=qe(i),d=new Set([...r,...We(i),...c.flatMap(l=>l.exported===void 0?[]:[l.exported])]);return c.some(l=>{if(s!==void 0&&l.exported!==void 0&&l.exported!==s||l.exported!==void 0&&r.has(l.exported))return!1;if(l.exported===void 0){const g=s??(l.module===b?t:void 0);if(g!==void 0&&d.has(g))return!1}const u=l.exported===void 0?s:l.name;if(l.module===b)return u===void 0||u===t;const v=B(e,l.module);return v!==void 0&&G(v,t,u,o,l.exported===void 0?d:r)})},j=(e,t)=>ke(e).some(s=>{const o=s.getParent();return s.getText()!==t||m.isNamespaceImport(o)||m.isPropertyAccessExpression(o)&&o.getNameNode()===s||m.isQualifiedName(o)&&o.getRight()===s?!1:m.isPropertyAccessExpression(o)?o.getName()===h:m.isQualifiedName(o)?!m.isTypeReference(o.getParent())&&o.getRight().getText()===h:!0}),He=e=>{const[t]=e.getArguments();return e.getExpression().getKind()===n.SyntaxKind.ImportKeyword&&t!==void 0&&(m.isStringLiteral(t)||m.isNoSubstitutionTemplateLiteral(t))&&t.getLiteralValue()===b},Xe=e=>{const t=e.getPropertyNameNode();if(t===void 0)return e.getNameNode().getText();const s=m.isComputedPropertyName(t)?t.getExpression():t;return m.isStringLiteral(s)||m.isNoSubstitutionTemplateLiteral(s)?s.getLiteralValue():t.getText()},Je=e=>{let t=e,s=!1;for(let r=e.getParent();m.isParenthesizedExpression(r)||m.isAwaitExpression(r);r=t.getParent())s||=m.isAwaitExpression(r),t=r;if(!s)return!0;const o=t.getParent();if(m.isVariableDeclaration(o)){const r=o.getNameNode();return!m.isObjectBindingPattern(r)||r.getElements().some(a=>a.getDotDotDotToken()!==void 0||Xe(a)===h)}return m.isPropertyAccessExpression(o)&&o.getExpression()===t?o.getName()===h:!0},Qe=(e,t)=>K(e).statements.some(s=>n.isExportDeclaration(s)&&s.moduleSpecifier!==void 0&&n.isStringLiteral(s.moduleSpecifier)&&s.moduleSpecifier.text===b&&s.exportClause!==void 0&&n.isNamespaceExport(s.exportClause)&&s.exportClause.name.text===t),ze=e=>e.getImportDeclarations().some(t=>{const s=t.getNamespaceImport(),o=t.isTypeOnly()?[]:t.getNamedImports().filter(d=>!d.isTypeOnly()),r=o.some(d=>d.getNameNode().getText()===h),a=o.filter(d=>j(e,(d.getAliasNode()??d.getNameNode()).getText())),i=s!==void 0&&j(e,s.getText());if(!r&&!i&&a.length===0)return!1;const c=B(e.getFilePath(),t.getModuleSpecifierValue());return c===void 0?!1:(r||i)&&G(c,h,h,new Set)||a.some(d=>Qe(c,d.getNameNode().getText()))}),te=e=>{const t=e.getImportDeclarations().filter(s=>s.getModuleSpecifierValue()===b&&!s.isTypeOnly());return t.some(s=>s.getNamedImports().some(o=>!o.isTypeOnly()&&o.getNameNode().getText()===h))||t.some(s=>{const o=s.getNamespaceImport();return o!==void 0&&j(e,o.getText())})||e.getExportDeclarations().some(s=>s.getModuleSpecifierValue()===b&&!s.isTypeOnly()&&s.getNamedExports().some(o=>!o.isTypeOnly()&&o.getNameNode().getText()===h))||ze(e)||e.getDescendantsOfKind(n.SyntaxKind.CallExpression).some(s=>He(s)&&Je(s))},Ze=e=>{const t=[],s=o=>{if(n.isImportDeclaration(o)&&o.importClause?.phaseModifier!==n.SyntaxKind.TypeKeyword&&n.isStringLiteral(o.moduleSpecifier))t.push(o.moduleSpecifier.text);else if(n.isExportDeclaration(o)&&!o.isTypeOnly&&o.moduleSpecifier!==void 0&&n.isStringLiteral(o.moduleSpecifier))t.push(o.moduleSpecifier.text);else if(n.isCallExpression(o)&&o.expression.kind===n.SyntaxKind.ImportKeyword){const[r]=o.arguments;r!==void 0&&(n.isStringLiteral(r)||n.isNoSubstitutionTemplateLiteral(r))&&t.push(r.text)}n.forEachChild(o,s)};return s(e),t},et=new Set([".cjs",".cts",".js",".jsx",".mjs",".mts",".ts",".tsx"]),tt=new Set([".git",".lunora-cache",".wrangler","dist",w,"node_modules"]),st=["lunora","src"],ot=/\benv\s*\.\s*DB\b/,rt=/\benv\s*\.\s*AI\b/,se=["ai","aiSearch","analytics","analyticsSql","artifacts","browser","hyperdrive","images","kv","mail","notify","payments","pipelines","r2sql","scheduler","storage","x402"],oe=e=>`uses${e.charAt(0).toUpperCase()}${e.slice(1)}`,re=[["usesAuth","@lunora/auth"],["usesCimdWorkers","@lunora/auth/cimd/workers"],["usesX402Charge","@lunora/x402/charge"],["usesPaymentAutumn","@lunora/payment/autumn"],["usesPaymentCreem","@lunora/payment/creem"],["usesPaymentDodopayments","@lunora/payment/dodopayments"],["usesPaymentPolar","@lunora/payment/polar"],["usesPaymentStripe","@lunora/payment/stripe"]],ne=[...se.map(e=>[oe(e),Q[e].moduleSpecifier]),...re].toSorted(([e],[t])=>e.localeCompare(t)),nt=[["usesNotifyFcm","@lunora/notify:fcm"],["usesNotifyWebPush","@lunora/notify:webPush"],["hostsShardRegistry","@lunora/do:shardRegistry"],["hostsEventLog","@lunora/replica:eventLog"],["usesEventLogClient","@lunora/replica:eventLogClient"],["usesRequestSecretTool","@lunora/agent:requestSecretTool"]],it=["@lunora/agent","@lunora/agent/sandbox"],ie=new RegExp(String.raw`["'\x60](?:${[...ne.map(([,e])=>e),...it,b].map(e=>Re(e)).join("|")})["'\x60]`,"u"),p=e=>{const{contextProperty:t,moduleSpecifier:s}=Q[e];return t===void 0?`${s} is imported`:`${s} is imported or ctx.${t} is read`},at="STRIPE_SECRET_KEY + STRIPE_WEBHOOK_SECRET (Stripe) or POLAR_ACCESS_TOKEN + POLAR_WEBHOOK_SECRET (Polar)",ct=/\bfrom\s+["']\.{1,2}\//u,ae=(e,t)=>{let s;try{s=de(e,{withFileTypes:!0})}catch{return}for(const o of s){if(o.isDirectory()){tt.has(o.name)||ae(S(e,o.name),t);continue}const r=o.name.lastIndexOf(".");r!==-1&&et.has(o.name.slice(r))&&t.push(S(e,o.name))}},dt=(e,t,s)=>{const{info:o}=Oe(e,t,s);return{jurisdiction:o?.jurisdiction,needsD1:o?.hasD1GlobalTable??!1}};let $;const lt=e=>{const t=me(e);return $?.root!==t&&($={project:new z({compilerOptions:{allowJs:!0},skipAddingFilesFromTsConfig:!0}),root:t}),$.project},ut=(e,t,s)=>{e.getSourceFile(t)?.getFullText()!==s&&e.createSourceFile(t,s,{overwrite:!0})},pt=(e,t)=>{for(const s of e.getSourceFiles())t.has(s)||e.removeSourceFile(s)},mt=(e,t,s)=>{const o=S(e,s),r=lt(e),a=[],i=new Set,c=[],d=[],l=ve();let u=!1,v=!1;for(const f of t){const x=S(e,f);if(!k(x)||!F(x).isDirectory())continue;const O=[];ae(x,O);for(const C of O){i.add(C);const y=J(C,"utf8"),E=ee(C,o);u||=rt.test(y),v||=ot.test(y),(ie.test(y)||y.includes(h)||E&&(Ee(y)||ct.test(y)))&&(ut(r,C,y),a.push({file:C,inLunora:E}))}}pt(r,new Set(a.map(({file:f})=>r.getSourceFileOrThrow(f))));for(const{file:f,inLunora:x}of a)(x?c:d).push(be(r.getSourceFileOrThrow(f),l));const g=V(c),A=V([g,...d]),N=new Set([...A.valueImports,...A.dynamicImports]),T=Ne({contextReads:g.contextReads,valueImports:N});return{...Object.fromEntries([...se.map(f=>[oe(f),T.has(f)]),...re.map(([f,x])=>[f,N.has(x)])]),needsD1:v,usesEventLogClient:a.some(({file:f})=>te(r.getSourceFileOrThrow(f))),usesRequestSecretTool:g.requestSecretTool,usesAi:T.has("ai")||u,usesBrowser:T.has("browser")||g.sandboxTools.usesSandboxBrowser,usesWorkerLoader:g.sandboxTools.usesSandboxLoader,scannedFiles:i}},ft=(e,t,s)=>[...e.map(o=>o.exported?`${o.bindingName}/${o.className} (container "${o.exportName}" declared and exported)`:`hint: container "${o.exportName}" is declared but ${o.className} is not exported by the worker entry — add \`export * from "./lunora/_generated/containers"\``),...t.map(o=>o.exported?`exports.${o.className} (workflow "${o.exportName}" declared and exported)`:`hint: workflow "${o.exportName}" is declared but ${o.className} is not exported by the worker entry — add \`export * from "./lunora/_generated/workflows"\``),...s.map(o=>o.exported?`exports.${o.className} (agent "${o.exportName}" declared and exported)`:`hint: agent "${o.exportName}" is declared but ${o.className} is not exported by the worker entry — add \`export * from "./lunora/_generated/agents"\``)],gt=(e,t,s)=>[[e.usesAi,`AI (${p("ai")}, or env.AI is used)`],[e.usesAuth&&!t.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&&!t.has("SchedulerDO"),`hint: ${p("scheduler")}, but no SchedulerDO is exported by the worker entry`],[e.usesStorage,`hint: ${p("storage")}; add an r2_buckets binding (bucket binding names are user-defined)`],[e.usesMail,`hint: ${p("mail")}; set RESEND_API_KEY in .dev.vars (obtain at https://resend.com/api-keys)`],[e.usesPayments,`hint: ${p("payments")}; set the provider secrets in .dev.vars — ${at}`],[e.usesBrowser,`browser (${p("browser")}, or a sandbox browserTool imported in lunora/) — self-describing { binding: BROWSER }`],[e.usesImages,`images (${p("images")}) — self-describing { binding: IMAGES }`],[e.usesAnalytics,`analytics_engine_datasets (${p("analytics")}) — self-describing { binding: ANALYTICS, dataset }`],[e.usesWorkerLoader,"worker_loaders (jsCodeTool imported in lunora/) — self-describing { binding: LOADER }"],[e.usesAiSearch,`ai_search_namespaces (${p("aiSearch")}) — self-describing { binding: AI_SEARCH, namespace: "default" }; remote-only, so \`lunora dev\` reaches the deployed AI Search service`],[e.usesAnalyticsSql,`analytics (${p("analyticsSql")}) — self-describing { binding: ANALYTICS_SQL }; needs wrangler >= 4.145.0, and is remote-only, so \`lunora dev\` queries the account's live analytics`],[e.usesKv,s.jurisdiction===void 0?`kv_namespaces (${p("kv")}) — { binding: KV } with no id; wrangler creates the namespace on the first deploy`:`hint: ${p("kv")} and the schema pins "${s.jurisdiction}"; create the namespace with --jurisdiction ${s.jurisdiction} and add a kv_namespaces binding ({ binding, id })`],[e.usesHyperdrive,`hyperdrive (${p("hyperdrive")}) — { binding: HYPERDRIVE } with a placeholder id; dev uses an embedded Postgres and \`lunora deploy\` creates the config`],[e.usesPipelines,`hint: ${p("pipelines")}; run 'wrangler pipelines create <name>' and add a 'pipelines' binding ({ binding, stream }) — the pipeline resource can't be auto-provisioned`],[e.usesArtifacts,s.jurisdiction===void 0?`artifacts (${p("artifacts")}) — { binding: ARTIFACTS, namespace }`:`hint: ${p("artifacts")}; the schema pins data to "${s.jurisdiction}", so create the namespace in that jurisdiction first and add { binding: ARTIFACTS, namespace } yourself — \`lunora deploy\` then checks it (a first create() in dev would make it unrestricted)`],[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.usesX402,`hint: ${p("x402")} (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),ht=(e,t,s,o=[],r=[],a=[])=>{const i=new Set(e.map(d=>d.className)),c=e.map(d=>`${d.binding}/${d.className} (exported by worker entry)`);return t.needsD1&&c.push("DB (.global() table declared)"),c.push(...ft(o,r,a),...gt(s,i,t)),c},xt=(e,t)=>e.some(s=>s.binding==="SHARD_REGISTRY")||Z(t)&&k(S(t,"shardRegistry.ts")),St=(e,t,s)=>{const o=new z({compilerOptions:{allowJs:!0},skipAddingFilesFromTsConfig:!0}),r=[e],a=new Set;for(let i=r.pop();i!==void 0;i=r.pop()){if(a.has(i))continue;a.add(i);const c=K(i),d=c.text;if((ie.test(d)||d.includes(h))&&te(o.createSourceFile(i,d,{overwrite:!0})))return!0;for(const l of Ze(c)){const u=B(i,l);u!==void 0&&!t.has(u)&&!ee(u,s)&&r.push(u)}}return!1},yt=e=>!e.composed&&e.path!==void 0&&G(e.path,"EventLogDO",void 0,new Set),Lt=async e=>{await Ce;const t=e.schemaDir??"lunora",s=e.scanDirs??st,o=()=>mt(e.projectRoot,s,t),{scannedFiles:r,...a}=e.cache===void 0?o():e.cache.memo(`capabilities:${e.projectRoot}:${t}:${s.join(",")}`,o),i=we(e.projectRoot);let c;i.composed?c=De(S(e.projectRoot,t,w)).map(W=>({binding:_e[W],className:W})):c=i.path===void 0?[]:Le(i.path);const d=dt(e.projectRoot,t,e.cache),l={...d,needsD1:a.needsD1||d.needsD1},u=L(i,Ie(e.projectRoot,t,e.cache).containers,"containers"),v=L(i,$e(e.projectRoot,t).workflows,"workflows"),g=L(i,Te(e.projectRoot,t).agents,"agents"),A=[...je(e.projectRoot,t).queues],{flags:N}=Pe(e.projectRoot,t),T=M(e.projectRoot,t,ye,Se),_=T.error===void 0?T.value:{hasFcm:!0,hasWebPush:!0},f=N?.provider==="flagship"&&N.mode==="binding"?N.bindingName:void 0,x=S(e.projectRoot,t,w),O=xt(c,x),C=yt(i),y=!i.composed&&i.path!==void 0&&St(i.path,r,x),E=ht(c,l,a,u,v,g);!i.composed&&Z(S(e.projectRoot,t,w))&&!c.some(I=>I.className==="LunoraDO")&&E.push("hint: durableObjects.merge is set, but the worker entry exports no LunoraDO — export one built with mergeDurableObjects, or the classes stay separate"),f!==void 0&&E.push(`hint: lunora/flags.ts uses Flagship in binding mode; add a flagship binding ({ binding: "${f}", app_id }) — the app_id can't be auto-provisioned`);const R=xe(e.projectRoot),ce=R.error===void 0?R.services:void 0;return R.error!==void 0&&E.push(`hint: lunora.config \`services\` not reconciled — ${R.error}`),E.push(...R.services.map(I=>`${I.binding} → ${I.worker} (lunora.config services.${I.name})`)),{...a,usesEventLogClient:a.usesEventLogClient||y,agents:g,containers:u,durableObjects:c,flagshipBinding:f,...l.jurisdiction===void 0?{}:{jurisdiction:l.jurisdiction},needsD1:l.needsD1,queues:A,services:ce,signals:E,usesFlags:N!==void 0,usesNotifyFcm:_?.hasFcm??!1,usesNotifyWebPush:_?.hasWebPush??!1,hostsEventLog:C,hostsShardRegistry:O,workflows:v}},$t=e=>[...ne,...nt].filter(([t,s])=>e[t]&&Ae[s]!==void 0).map(([,t])=>t);export{Lt as inferLunoraBindings,$t as secretSourcesFromBindings};
@@ -1 +1 @@
1
- import{inferLunoraBindings as g}from"./inferLunoraBindings-DvB8IpbN.mjs";import{LUNORA_TAG as r}from"./LUNORA_TAG-DQTGPqcJ.mjs";import{reconcileWranglerBindings as $}from"./collectExportGaps-B53R2mba.mjs";import{reconcileWranglerCompatibilityDate as p}from"./reconcileWranglerCompatibilityDate-hocXEuRA.mjs";import{reconcileWranglerCrons as m,describePreservedCrons as w}from"./describePreservedCrons-Bt2rPPeY.mjs";const j=async(i,t,a)=>{try{const n=await g({cache:i.cache,projectRoot:i.projectRoot,schemaDir:i.schemaDir}),e=$(i.projectRoot,n,{target:i.target}),o=e.wranglerPath??"wrangler.jsonc";if(e.added.length>0&&t.info?.(`${r} inferred bindings → ${e.added.join(", ")} (written to ${o})`),e.updated.length>0&&t.info?.(`${r} updated bindings → ${e.updated.join(", ")} (written to ${o})`),e.devConfig!==void 0){const{added:c,path:d,updated:f}=e.devConfig;t.info?.(`${r} dev sidecar bindings → ${[...c,...f].join(", ")} (written to ${d})`)}for(const c of e.warnings)t.warn(`${r} ${c}`);e.exportGaps.length>0&&a?.(e.exportGaps)}catch(n){const e=n instanceof Error?n.message:String(n);t.warn(`${r} binding inference skipped: ${e}`)}},s=new Map,u=(i,t,a)=>{try{const n=m(i,t);n.changed&&a.info?.(`${r} synced ${t.length.toFixed(0)} cron trigger(s) into ${n.wranglerPath??"wrangler.jsonc"}`);for(const c of n.warnings)a.warn(`${r} ${c}`);const e=n.preserved.join("\0"),o=w(n.preserved);o!==void 0&&(n.changed||s.get(i)!==e)&&a.info?.(`${r} ${o}`),s.set(i,e)}catch(n){const e=n instanceof Error?n.message:String(n);a.warn(`${r} cron trigger sync skipped: ${e}`)}try{const n=p(i);n.changed&&a.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);a.warn(`${r} compatibility date sync skipped: ${e}`)}};export{j as reconcileBindingsSafely,u as reconcileWranglerExtras};
1
+ import{inferLunoraBindings as g}from"./inferLunoraBindings-BiRE_Jh9.mjs";import{LUNORA_TAG as r}from"./LUNORA_TAG-DQTGPqcJ.mjs";import{reconcileWranglerBindings as $}from"./collectExportGaps-CLrCQp09.mjs";import{reconcileWranglerCompatibilityDate as p}from"./reconcileWranglerCompatibilityDate-hocXEuRA.mjs";import{reconcileWranglerCrons as m,describePreservedCrons as w}from"./describePreservedCrons-Bt2rPPeY.mjs";const j=async(i,t,a)=>{try{const n=await g({cache:i.cache,projectRoot:i.projectRoot,schemaDir:i.schemaDir}),e=$(i.projectRoot,n,{target:i.target}),o=e.wranglerPath??"wrangler.jsonc";if(e.added.length>0&&t.info?.(`${r} inferred bindings → ${e.added.join(", ")} (written to ${o})`),e.updated.length>0&&t.info?.(`${r} updated bindings → ${e.updated.join(", ")} (written to ${o})`),e.devConfig!==void 0){const{added:c,path:d,updated:f}=e.devConfig;t.info?.(`${r} dev sidecar bindings → ${[...c,...f].join(", ")} (written to ${d})`)}for(const c of e.warnings)t.warn(`${r} ${c}`);e.exportGaps.length>0&&a?.(e.exportGaps)}catch(n){const e=n instanceof Error?n.message:String(n);t.warn(`${r} binding inference skipped: ${e}`)}},s=new Map,u=(i,t,a)=>{try{const n=m(i,t);n.changed&&a.info?.(`${r} synced ${t.length.toFixed(0)} cron trigger(s) into ${n.wranglerPath??"wrangler.jsonc"}`);for(const c of n.warnings)a.warn(`${r} ${c}`);const e=n.preserved.join("\0"),o=w(n.preserved);o!==void 0&&(n.changed||s.get(i)!==e)&&a.info?.(`${r} ${o}`),s.set(i,e)}catch(n){const e=n instanceof Error?n.message:String(n);a.warn(`${r} cron trigger sync skipped: ${e}`)}try{const n=p(i);n.changed&&a.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);a.warn(`${r} compatibility date sync skipped: ${e}`)}};export{j as reconcileBindingsSafely,u as reconcileWranglerExtras};
@@ -1 +1 @@
1
- import{existsSync as f,readFileSync as N,readdirSync as I}from"node:fs";import{join as p,dirname as v,extname as h,basename as x}from"node:path";import{Project as b,Node as d}from"ts-morph";import{COMPOSED_WORKER_ENTRY as w,LUNORA_WORKER_VIRTUAL_ID as u,isGeneratedOutput as L,WORKER_ENTRY_FALLBACKS as M,GENERATED_DIRECTORY as j,isMergedProject as F,MERGED_DURABLE_OBJECT as P,COMPOSED_ENTRY_DURABLE_OBJECTS as k,GENERATED_CLASS_MODULES as U,isMergedRoleModule as W,SOURCE_DOT_DIRECTORIES as B,NON_SOURCE_DIRECTORIES as K}from"./COMPOSED_WORKER_ENTRY-Ciiba5g_.mjs";const E=[".ts",".tsx",".mts",".cts"],g=new Set(E),X=new Set([".cjs",".js",".mjs"]),m="default",S={".cjs":[".cts"],".js":[".ts",".tsx"],".mjs":[".mts"]},Y=250,ae=(e,o,t)=>{const s=p(o,w);if(f(s))return{origin:"declared",path:s};if(e===u)return{origin:"composed"};const n=()=>{const i=M.map(a=>p(o,a)).find(a=>f(a));return i===void 0?void 0:{origin:"probed",path:i}};if(typeof e!="string"||e.length===0||L(e))return n();const r=p(v(t),e),c=h(r);if(!(!g.has(c)&&!X.has(c)))return f(r)?{origin:"declared",path:r}:{origin:"absent",path:r}},_=(e,o)=>{if(d.isIdentifier(e)){o.add(e.getText());return}if(d.isObjectBindingPattern(e)||d.isArrayBindingPattern(e))for(const t of e.getElements())d.isBindingElement(t)&&_(t.getNameNode(),o)},G=(e,o)=>{const t=[];for(const s of e.getExportDeclarations())if(!s.isTypeOnly()){if(s.isNamespaceExport()){const n=s.getNamespaceExport();n===void 0?t.push(s.getModuleSpecifierValue()??""):o.add(n.getName());continue}for(const n of s.getNamedExports())n.isTypeOnly()||o.add(n.getAliasNode()?.getText()??n.getName())}return t},$=(e,o)=>{for(const t of e.getVariableStatements().filter(s=>s.getExportKeyword()!==void 0))for(const s of t.getDeclarations())_(s.getNameNode(),o);for(const t of[...e.getClasses(),...e.getFunctions(),...e.getEnums()]){if(t.getExportKeyword()===void 0)continue;const s=t.isDefaultExport()?m:t.getName();s!==void 0&&o.add(s)}e.getExportAssignments().length>0&&o.add(m)},y=(e,o)=>{const t=new b({compilerOptions:{allowJs:!0},skipFileDependencyResolution:!0,skipLoadingLibFiles:!0,useInMemoryFileSystem:!0}),s=t.createSourceFile(e,o,{overwrite:!0});return t.getProgram().compilerObject.getSyntacticDiagnostics(s.compilerNode).length>0?void 0:s},J=(e,o)=>{if(!o.startsWith("./")&&!o.startsWith("../"))return;const t=p(v(e),o),s=h(t),n=g.has(s)||S[s]!==void 0,r=n?t.slice(0,-s.length):t;return[...g.has(s)?[t]:[],...(S[s]??[]).map(i=>`${r}${i}`),...n?[]:E.map(i=>`${t}${i}`),...n||s.length===0?E.map(i=>p(r,`index${i}`)):[]].find(i=>f(i))},T=e=>{const o=new Set,t=new Set([e]),s=[e];for(;s.length>0;){if(t.size-1>Y)return;const n=s.pop();let r;try{r=N(n,"utf8")}catch{return}const c=y(x(n),r);if(c===void 0)return;const i=G(c,o);$(c,o);for(const a of i){const l=J(n,a);if(l===void 0)return;t.has(l)||(t.add(l),s.push(l))}}return o},z=(e,o)=>{const t={exports:void 0,kind:"composed",path:u},s=p(e,o,j);if(!f(s))return t;const n=F(s),r=new Set(n?[P]:k);for(const c of U){const i=p(s,`${c}.ts`);if(!f(i)||n&&W(c))continue;const a=T(i);if(a===void 0)return t;for(const l of a)r.add(l)}return{exports:r,kind:"composed",path:u}},de=(e,o,t)=>{if(e===void 0||e.origin==="absent")return;if(e.origin==="composed")return z(o,t);const s=T(e.path);if(!(e.origin==="probed"&&s!==void 0&&!s.has(m)))return{exports:s,kind:"authored",path:e.path}},q=new Set([".cjs",".cts",".js",".jsx",".mjs",".mts",".ts",".tsx"]),V=2e3,O="defineTable",R="defineApp",H=e=>{const o=[],t=[];let s;try{s=I(e,{withFileTypes:!0})}catch{return{files:o,subdirectories:t}}for(const n of s)n.isDirectory()?n.name.startsWith(".")&&!B.has(n.name)||K.has(n.name)||t.push(p(e,n.name)):q.has(h(n.name))&&o.push(p(e,n.name));return{files:o,subdirectories:t}},D=(e,o)=>{const t=new Set;for(const s of e.getImportDeclarations())for(const n of s.getNamedImports())!n.isTypeOnly()&&n.getName()===o&&t.add(n.getAliasNode()?.getText()??n.getName());return t},Q=(e,o)=>{let t=!1;return e.forEachDescendant((s,n)=>{if(!d.isCallExpression(s))return;const r=s.getExpression();d.isIdentifier(r)&&o.has(r.getText())&&(t=!0,n.stop())}),t},Z=e=>{let o=e;for(;d.isCallExpression(o)||d.isPropertyAccessExpression(o);)o=o.getExpression();return o},ee=(e,o)=>{const t=Z(e);return d.isIdentifier(t)&&o.has(t.getText())},A={analyticsSql:/\.\s*analyticsSql\s*\(/u,global:/\.\s*global\s*\(/u,hyperdriveGlobal:/\.\s*hyperdriveGlobal\s*\(/u,vectors:/\.\s*vectors\s*\(/u},te=e=>Object.hasOwn(A,e),se=(e,o)=>{const t=new Set,s=new Set([O,...D(e,O)]);return e.forEachDescendant(n=>{if(!d.isCallExpression(n))return;const r=n.getExpression();if(!d.isPropertyAccessExpression(r)||ee(r,s))return;const c=r.getName();te(c)&&o.has(c)&&t.add(c)}),t},oe=(e,o)=>{let t;try{t=N(e,"utf8")}catch{return}const s=new Set([...o].filter(r=>A[r].test(t)));if(s.size===0&&!t.includes(R))return;const n=y(x(e),t);return n===void 0?{chained:s,composes:!1}:{chained:se(n,s),composes:Q(n,D(n,R))}},le=(e,o)=>{const t=[e],s=new Set;let n=0,r;const c=i=>{if(n+=1,n>V)return!1;const a=oe(i,o);for(const l of a?.chained??[])s.add(l);return a?.composes&&(r??=i),!0};for(;t.length>0;){const i=t.pop(),{files:a,subdirectories:l}=H(i);t.push(...l);for(const C of a){if(!c(C))return;if(r!==void 0&&s.size===o.size)return{chained:s,site:r}}}return r===void 0?void 0:{chained:s,site:r}};export{ae as l,de as r,le as s};
1
+ import{existsSync as f,readFileSync as N,readdirSync as I}from"node:fs";import{join as p,dirname as v,extname as h,basename as x}from"node:path";import{Project as b,Node as d}from"ts-morph";import{COMPOSED_WORKER_ENTRY as w,LUNORA_WORKER_VIRTUAL_ID as u,isGeneratedOutput as L,WORKER_ENTRY_FALLBACKS as M,GENERATED_DIRECTORY as j,isMergedProject as F,MERGED_DURABLE_OBJECT as P,COMPOSED_ENTRY_DURABLE_OBJECTS as k,GENERATED_CLASS_MODULES as U,isMergedRoleModule as W,SOURCE_DOT_DIRECTORIES as B,NON_SOURCE_DIRECTORIES as K}from"./COMPOSED_WORKER_ENTRY-BcFt6ts5.mjs";const E=[".ts",".tsx",".mts",".cts"],g=new Set(E),X=new Set([".cjs",".js",".mjs"]),m="default",S={".cjs":[".cts"],".js":[".ts",".tsx"],".mjs":[".mts"]},Y=250,ae=(e,o,t)=>{const s=p(o,w);if(f(s))return{origin:"declared",path:s};if(e===u)return{origin:"composed"};const n=()=>{const i=M.map(a=>p(o,a)).find(a=>f(a));return i===void 0?void 0:{origin:"probed",path:i}};if(typeof e!="string"||e.length===0||L(e))return n();const r=p(v(t),e),c=h(r);if(!(!g.has(c)&&!X.has(c)))return f(r)?{origin:"declared",path:r}:{origin:"absent",path:r}},_=(e,o)=>{if(d.isIdentifier(e)){o.add(e.getText());return}if(d.isObjectBindingPattern(e)||d.isArrayBindingPattern(e))for(const t of e.getElements())d.isBindingElement(t)&&_(t.getNameNode(),o)},G=(e,o)=>{const t=[];for(const s of e.getExportDeclarations())if(!s.isTypeOnly()){if(s.isNamespaceExport()){const n=s.getNamespaceExport();n===void 0?t.push(s.getModuleSpecifierValue()??""):o.add(n.getName());continue}for(const n of s.getNamedExports())n.isTypeOnly()||o.add(n.getAliasNode()?.getText()??n.getName())}return t},$=(e,o)=>{for(const t of e.getVariableStatements().filter(s=>s.getExportKeyword()!==void 0))for(const s of t.getDeclarations())_(s.getNameNode(),o);for(const t of[...e.getClasses(),...e.getFunctions(),...e.getEnums()]){if(t.getExportKeyword()===void 0)continue;const s=t.isDefaultExport()?m:t.getName();s!==void 0&&o.add(s)}e.getExportAssignments().length>0&&o.add(m)},y=(e,o)=>{const t=new b({compilerOptions:{allowJs:!0},skipFileDependencyResolution:!0,skipLoadingLibFiles:!0,useInMemoryFileSystem:!0}),s=t.createSourceFile(e,o,{overwrite:!0});return t.getProgram().compilerObject.getSyntacticDiagnostics(s.compilerNode).length>0?void 0:s},J=(e,o)=>{if(!o.startsWith("./")&&!o.startsWith("../"))return;const t=p(v(e),o),s=h(t),n=g.has(s)||S[s]!==void 0,r=n?t.slice(0,-s.length):t;return[...g.has(s)?[t]:[],...(S[s]??[]).map(i=>`${r}${i}`),...n?[]:E.map(i=>`${t}${i}`),...n||s.length===0?E.map(i=>p(r,`index${i}`)):[]].find(i=>f(i))},T=e=>{const o=new Set,t=new Set([e]),s=[e];for(;s.length>0;){if(t.size-1>Y)return;const n=s.pop();let r;try{r=N(n,"utf8")}catch{return}const c=y(x(n),r);if(c===void 0)return;const i=G(c,o);$(c,o);for(const a of i){const l=J(n,a);if(l===void 0)return;t.has(l)||(t.add(l),s.push(l))}}return o},z=(e,o)=>{const t={exports:void 0,kind:"composed",path:u},s=p(e,o,j);if(!f(s))return t;const n=F(s),r=new Set(n?[P]:k);for(const c of U){const i=p(s,`${c}.ts`);if(!f(i)||n&&W(c))continue;const a=T(i);if(a===void 0)return t;for(const l of a)r.add(l)}return{exports:r,kind:"composed",path:u}},de=(e,o,t)=>{if(e===void 0||e.origin==="absent")return;if(e.origin==="composed")return z(o,t);const s=T(e.path);if(!(e.origin==="probed"&&s!==void 0&&!s.has(m)))return{exports:s,kind:"authored",path:e.path}},q=new Set([".cjs",".cts",".js",".jsx",".mjs",".mts",".ts",".tsx"]),V=2e3,O="defineTable",R="defineApp",H=e=>{const o=[],t=[];let s;try{s=I(e,{withFileTypes:!0})}catch{return{files:o,subdirectories:t}}for(const n of s)n.isDirectory()?n.name.startsWith(".")&&!B.has(n.name)||K.has(n.name)||t.push(p(e,n.name)):q.has(h(n.name))&&o.push(p(e,n.name));return{files:o,subdirectories:t}},D=(e,o)=>{const t=new Set;for(const s of e.getImportDeclarations())for(const n of s.getNamedImports())!n.isTypeOnly()&&n.getName()===o&&t.add(n.getAliasNode()?.getText()??n.getName());return t},Q=(e,o)=>{let t=!1;return e.forEachDescendant((s,n)=>{if(!d.isCallExpression(s))return;const r=s.getExpression();d.isIdentifier(r)&&o.has(r.getText())&&(t=!0,n.stop())}),t},Z=e=>{let o=e;for(;d.isCallExpression(o)||d.isPropertyAccessExpression(o);)o=o.getExpression();return o},ee=(e,o)=>{const t=Z(e);return d.isIdentifier(t)&&o.has(t.getText())},A={analyticsSql:/\.\s*analyticsSql\s*\(/u,global:/\.\s*global\s*\(/u,hyperdriveGlobal:/\.\s*hyperdriveGlobal\s*\(/u,vectors:/\.\s*vectors\s*\(/u},te=e=>Object.hasOwn(A,e),se=(e,o)=>{const t=new Set,s=new Set([O,...D(e,O)]);return e.forEachDescendant(n=>{if(!d.isCallExpression(n))return;const r=n.getExpression();if(!d.isPropertyAccessExpression(r)||ee(r,s))return;const c=r.getName();te(c)&&o.has(c)&&t.add(c)}),t},oe=(e,o)=>{let t;try{t=N(e,"utf8")}catch{return}const s=new Set([...o].filter(r=>A[r].test(t)));if(s.size===0&&!t.includes(R))return;const n=y(x(e),t);return n===void 0?{chained:s,composes:!1}:{chained:se(n,s),composes:Q(n,D(n,R))}},le=(e,o)=>{const t=[e],s=new Set;let n=0,r;const c=i=>{if(n+=1,n>V)return!1;const a=oe(i,o);for(const l of a?.chained??[])s.add(l);return a?.composes&&(r??=i),!0};for(;t.length>0;){const i=t.pop(),{files:a,subdirectories:l}=H(i);t.push(...l);for(const C of a){if(!c(C))return;if(r!==void 0&&s.size===o.size)return{chained:s,site:r}}}return r===void 0?void 0:{chained:s,site:r}};export{ae as l,de as r,le as s};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lunora/config",
3
- "version": "1.0.0-alpha.445",
3
+ "version": "1.0.0-alpha.446",
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",
@@ -58,8 +58,8 @@
58
58
  "access": "public"
59
59
  },
60
60
  "dependencies": {
61
- "@lunora/codegen": "1.0.0-alpha.388",
62
- "@lunora/container": "1.0.0-alpha.107",
61
+ "@lunora/codegen": "1.0.0-alpha.389",
62
+ "@lunora/container": "1.0.0-alpha.108",
63
63
  "@lunora/errors": ">=1.0.0-alpha.51 <2.0.0-0",
64
64
  "@lunora/seed": "1.0.0-alpha.278",
65
65
  "@visulima/colorize": "3.0.0",
@@ -1 +0,0 @@
1
- const r={devServer:"workerd",prebuildsContainerImages:!0,deploy:o=>{const n=["deploy"];return o.entry!==void 0&&n.push(o.entry),o.configPath!==void 0&&n.push("--config",o.configPath),o.environment!==void 0&&n.push("--env",o.environment),o.temporary===!0&&n.push("--temporary"),o.dryRun===!0&&n.push("--dry-run"),o.secretsFile!==void 0&&n.push("--secrets-file",o.secretsFile),o.outDir!==void 0&&n.push("--outdir",o.outDir,"--metafile"),{args:n,tool:"wrangler"}},dev:o=>{const n=["dev"];return o.configPath!==void 0&&n.push("--config",o.configPath),o.environment!==void 0&&n.push("--env",o.environment),n.push(...o.extraArgs??[]),{args:n,tool:"wrangler"}},secretList:o=>{const n=["secret","list","--format","json"];return o.environment!==void 0&&n.push("--env",o.environment),o.temporary===!0&&n.push("--temporary"),{args:n,tool:"wrangler"}},secretBulk:o=>{const n=["secret","bulk"];return o.environment!==void 0&&n.push("--env",o.environment),o.temporary===!0&&n.push("--temporary"),{args:n,tool:"wrangler"}},secretPut:o=>{const n=["secret","put",o.key??""];return o.environment!==void 0&&n.push("--env",o.environment),o.temporary===!0&&n.push("--temporary"),{args:n,tool:"wrangler"}},tail:o=>{const n=["tail"];return o.worker!==void 0&&n.push(o.worker),o.environment!==void 0&&n.push("--env",o.environment),o.format!==void 0&&n.push("--format",o.format),o.status!==void 0&&n.push("--status",o.status),o.search!==void 0&&n.push("--search",o.search),o.temporary===!0&&n.push("--temporary"),{args:n,tool:"wrangler"}}},i={id:"cloudflare",name:"Cloudflare",toolchain:r};export{i as default};
@@ -1 +0,0 @@
1
- import{existsSync as E,readFileSync as O}from"node:fs";import{parse as S}from"es-module-lexer";import{WRANGLER_FILES as m,readWranglerJsonc as f}from"./WRANGLER_FILES-UNW-xY5u.mjs";import{escapeRegExp as i}from"./DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";import{join as c}from"node:path";const g="_generated",x=["src/server.ts","src/server/index.ts","src/server/index.tsx","src/index.ts","src/worker.ts"],h=new Set(["build","coverage","dist",g,"node_modules","out","target"]),w=new Set([".client",".server"]),A=/[/\\]/u,L=t=>{const e=[];for(const r of t.split(A))r===""||r==="."||(r===".."&&e.length>0&&e.at(-1)!==".."?e.pop():e.push(r));return e},T=t=>L(t).slice(0,-1).some(e=>h.has(e)||e.startsWith(".")&&!w.has(e)),l={LunoraDO:"SHARD",SchedulerDO:"SCHEDULER",SessionDO:"SESSION",ShardDO:"SHARD",ShardRegistryDO:"SHARD_REGISTRY"},R=Object.keys(l),$=t=>Object.hasOwn(l,t),C="virtual:lunora/worker",d=["ShardDO"],J=["agents","containers","scheduler","shardRegistry","workflows"],u={scheduler:"SchedulerDO",shardRegistry:"ShardRegistryDO"},D="LunoraDO",y=new Set([...d,...Object.values(u)]),B="durableObjects",I=t=>E(c(t,`${B}.ts`)),W=t=>Object.hasOwn(u,t),F=t=>I(t)?[D]:[...d,...Object.entries(u).filter(([e])=>E(c(t,`${e}.ts`))).map(([,e])=>e)],N=t=>t.includes(D)?t.filter(e=>!y.has(e)):[...t],U="src/worker.ts",Y=t=>{for(const e of m){const r=c(t,e);if(!E(r))continue;const{parsed:s}=f(r),o=s?.main;if(o===C)return{composed:!0};const a=c(t,U);if(E(a))return{composed:!1,path:a};if(typeof o=="string"&&!T(o)&&E(c(t,o)))return{composed:!1,path:c(t,o)};break}for(const e of x){const r=c(t,e);if(E(r))return{composed:!1,path:r}}return{composed:!1}},M=/(?:^|[\s,{])type$/u,_=(t,e)=>{const r=e.ls>=0?e.ls:e.s;return M.test(t.slice(0,r).trimEnd())},b=(t,e)=>{const r=i(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)},H=t=>{const e=O(t,"utf8");let r;try{const[,s]=S(e);r=new Set(s.filter(o=>!_(e,o)).map(o=>o.n))}catch{r=new Set(R.filter(s=>new RegExp(String.raw`\bexport\b[^\n;]*\b${s}\b`,"u").test(e)&&!b(e,s)))}return N(R.filter(s=>r.has(s))).map(s=>({binding:l[s],className:s}))},K=(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=O(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(p=>!_(s,p)).map(p=>p.n))}catch{a=new Set(e.map(n=>n.className).filter(n=>new RegExp(String.raw`\bexport\b[^\n;]*\b${i(n)}\b`,"u").test(s)&&!b(s,n)))}return e.map(n=>{const p=o||a.has(n.className);return{...n,exported:p}})};export{d as COMPOSED_ENTRY_DURABLE_OBJECTS,U as COMPOSED_WORKER_ENTRY,l as DURABLE_OBJECT_BINDINGS,J as GENERATED_CLASS_MODULES,g as GENERATED_DIRECTORY,u as GENERATED_MODULE_DURABLE_OBJECTS,C as LUNORA_WORKER_VIRTUAL_ID,D as MERGED_DURABLE_OBJECT,B as MERGED_DURABLE_OBJECTS_MODULE,y as MERGED_ROLE_DURABLE_OBJECTS,h as NON_SOURCE_DIRECTORIES,w as SOURCE_DOT_DIRECTORIES,x as WORKER_ENTRY_FALLBACKS,N as collapseMergedDurableObjects,F as composedEntryDurableObjects,K as detectClassExports,H as detectExportedDurableObjects,$ as isFrameworkDurableObject,T as isGeneratedOutput,I as isMergedProject,W as isMergedRoleModule,Y as resolveWorkerEntry};
@@ -1 +0,0 @@
1
- import{p as i}from"./celld-config-DoBVipuN.mjs";import s from"./CLOUDFLARE_DRIVER-DJwtY5NT.mjs";const p=[["entry","`celld deploy` deploys the config's `main`; a composed framework entry has no celld equivalent yet"],["environment","celld has no Wrangler environments — deploy a separate config per environment"],["outDir","`celld deploy` does not write its bundle to disk"],["secretsFile","celld has no secret store — a value the app reads from env is a `vars` entry in the deployed config"],["temporary","celld has no short-lived accounts — it deploys to the fleet bucket in CELLD_BUCKET"]],l=e=>{if(e===void 0)throw new Error("the celld driver runs the projected wrangler config — pass `configPath` from `projectConfig`");return e},v={deploy:e=>{const o=p.find(([r])=>e[r]!==void 0&&e[r]!==!1);if(o!==void 0)throw new Error(o[1]);return{args:["deploy",l(e.configPath),...e.dryRun===!0?["--dry-run"]:[]],onPath:!0,tool:"celld"}},devServer:"own",prebuildsContainerImages:!1,dev:e=>{if(e.environment!==void 0)throw new Error("celld has no Wrangler environments — `celld dev` runs the top-level config");return{args:["dev",l(e.configPath),...e.extraArgs??[]],onPath:!0,tool:"celld"}}},f={id:"celld",name:"celld",projectConfig:i,toolchain:v},h={id:"node",name:"Node"},g="cloudflare",t={celld:f,cloudflare:s,node:h},d=()=>Object.keys(t).toSorted((e,o)=>e.localeCompare(o)),c=(e=g)=>{const o=t[e];if(o===void 0)throw new Error(`unknown deploy target "${e}" — available targets: ${d().join(", ")}`);return o},m=e=>Object.hasOwn(t,e)&&c(e).toolchain!==void 0,D=()=>d().filter(e=>m(e)),w=e=>c(e).toolchain?.devServer==="own",O=(e,o,r,a)=>{const n=e.projectConfig?.(o,r);return{command:a(n?.configPath),commit:()=>n?.write(),projection:n===void 0?void 0:{configPath:n.configPath,dropped:n.dropped}}};export{g as DEFAULT_DEPLOY_TARGET,d as deployTargetIds,m as isRunnableTarget,O as planToolchainInvocation,c as resolveDeployDriver,D as runnableTargetIds,w as targetRunsOwnDevServer};