@lunora/config 1.0.0-alpha.394 → 1.0.0-alpha.395

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.
@@ -1 +1 @@
1
- import{applyModify as o}from"../packem_shared/applyModify-DKP2l6S9.mjs";import{assertWranglerSatisfiesSchema as t}from"../packem_shared/assertWranglerSatisfiesSchema-B4DcaiJY.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 E,detectCloudflareCliConfig as m,warnCloudflareCliConfigOnce as s}from"../packem_shared/CLOUDFLARE_CLI_CONFIG_WARNING_ENV-BKMrOuXV.mjs";import{default as d}from"../packem_shared/CLOUDFLARE_DRIVER-CULavrYO.mjs";import{default as C}from"../packem_shared/GLOBAL_FETCH_STRICTLY_PUBLIC_FLAG-f8CnJha3.mjs";import{hasCloudflareCredentials as x}from"../packem_shared/hasCloudflareCredentials-CNPVIVBb.mjs";import{describeWithheld as c,withheldBindings as I}from"../packem_shared/describeWithheld-CbyzZjZF.mjs";import{bindingsNeedingDatabase as A,startLocalHyperdrive as D}from"../packem_shared/bindingsNeedingDatabase-6eD6Qtqf.mjs";import{HYPERDRIVE_PLACEHOLDER_ID as S,collectExportGaps as W,reconcileWranglerBindings as T}from"../packem_shared/HYPERDRIVE_PLACEHOLDER_ID-ChryQmwG.mjs";import{reconcileWranglerCompatibilityDate as v}from"../packem_shared/reconcileWranglerCompatibilityDate-hocXEuRA.mjs";import{describePreservedCrons as b,reconcileWranglerCrons as B}from"../packem_shared/describePreservedCrons-C5KPuPy3.mjs";import{reconcileBindingsSafely as u,reconcileWranglerExtras as G}from"../packem_shared/reconcileBindingsSafely-Bpi7q5vG.mjs";import{REMOTE_ELIGIBLE_KEYS as y,injectRemoteFlags as M,isRemoteEnvEnabled as P,materializeDevWranglerConfig as V,planRemoteBindings as H,resolveRemoteEnabled as w}from"../packem_shared/REMOTE_ELIGIBLE_KEYS-DnbYTTWX.mjs";import{materializeServiceDevConfigs as K}from"../packem_shared/materializeServiceDevConfigs-k_oLCcBT.mjs";import{default as z}from"../packem_shared/CLOUDFLARE_TOOLCHAIN_VERSIONS-DV5E_f_q.mjs";import{withTailConsumer as J}from"../packem_shared/withTailConsumer-CF3pk_Ov.mjs";import{WORKERS_CACHE_MIN_DATE as k,isCacheEnabled as q}from"../packem_shared/WORKERS_CACHE_MIN_DATE-0k9ABJtF.mjs";import{wranglerCodegenInputs as $}from"../packem_shared/wranglerCodegenInputs-UqO5e_qJ.mjs";import{DEFAULT_OBSERVABILITY as re,resolveObservabilitySampling as oe}from"../packem_shared/DEFAULT_OBSERVABILITY-bN6UkTMx.mjs";import{mergeWranglerEnvironment as te}from"../packem_shared/mergeWranglerEnvironment-D5ekKj5x.mjs";import{WRANGLER_FILES as ie,findWranglerFile as le,readWranglerJsonc as fe}from"../packem_shared/WRANGLER_FILES-UNW-xY5u.mjs";import{UNEXPORTED_CLASS_MARKER as me,validateWranglerProject as se}from"../packem_shared/UNEXPORTED_CLASS_MARKER-mdcw5KDY.mjs";import{scanWranglerVariablesForSecrets as de}from"../packem_shared/scanWranglerVariablesForSecrets-CZDS9y2i.mjs";import{wranglerToAlchemy as Ce}from"../packem_shared/wranglerToAlchemy-CBO2ucRm.mjs";import{REQUIRED_COMPATIBILITY_DATE as xe,REQUIRED_FLAG as _e,validateWrangler as ce,validateWranglerConfig as Ie}from"../packem_shared/REQUIRED_COMPATIBILITY_DATE-D4UcOP_t.mjs";export{i as BINDING_MANIFEST_VERSION,E as CLOUDFLARE_CLI_CONFIG_WARNING_ENV,d as CLOUDFLARE_DRIVER,z as CLOUDFLARE_TOOLCHAIN_VERSIONS,re as DEFAULT_OBSERVABILITY,C as GLOBAL_FETCH_STRICTLY_PUBLIC_FLAG,S as HYPERDRIVE_PLACEHOLDER_ID,y as REMOTE_ELIGIBLE_KEYS,xe as REQUIRED_COMPATIBILITY_DATE,_e as REQUIRED_FLAG,me as UNEXPORTED_CLASS_MARKER,k as WORKERS_CACHE_MIN_DATE,ie as WRANGLER_FILES,o as applyModify,t as assertWranglerSatisfiesSchema,A as bindingsNeedingDatabase,l as buildBindingManifest,W as collectExportGaps,b as describePreservedCrons,c as describeWithheld,m as detectCloudflareCliConfig,le as findWranglerFile,x as hasCloudflareCredentials,M as injectRemoteFlags,q as isCacheEnabled,P as isRemoteEnvEnabled,V as materializeDevWranglerConfig,K as materializeServiceDevConfigs,te as mergeWranglerEnvironment,H as planRemoteBindings,fe as readWranglerJsonc,u as reconcileBindingsSafely,T as reconcileWranglerBindings,v as reconcileWranglerCompatibilityDate,B as reconcileWranglerCrons,G as reconcileWranglerExtras,oe as resolveObservabilitySampling,w as resolveRemoteEnabled,de as scanWranglerVariablesForSecrets,D as startLocalHyperdrive,ce as validateWrangler,Ie as validateWranglerConfig,se as validateWranglerProject,s as warnCloudflareCliConfigOnce,J as withTailConsumer,I as withheldBindings,$ as wranglerCodegenInputs,Ce as wranglerToAlchemy};
1
+ import{applyModify as o}from"../packem_shared/applyModify-DKP2l6S9.mjs";import{assertWranglerSatisfiesSchema as t}from"../packem_shared/assertWranglerSatisfiesSchema-B4DcaiJY.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 E,detectCloudflareCliConfig as m,warnCloudflareCliConfigOnce as s}from"../packem_shared/CLOUDFLARE_CLI_CONFIG_WARNING_ENV-BKMrOuXV.mjs";import{default as d}from"../packem_shared/CLOUDFLARE_DRIVER-CULavrYO.mjs";import{default as C}from"../packem_shared/GLOBAL_FETCH_STRICTLY_PUBLIC_FLAG-f8CnJha3.mjs";import{hasCloudflareCredentials as x}from"../packem_shared/hasCloudflareCredentials-CNPVIVBb.mjs";import{describeWithheld as c,withheldBindings as I}from"../packem_shared/describeWithheld-CbyzZjZF.mjs";import{bindingsNeedingDatabase as A,startLocalHyperdrive as D}from"../packem_shared/bindingsNeedingDatabase-6eD6Qtqf.mjs";import{HYPERDRIVE_PLACEHOLDER_ID as S,collectExportGaps as W,reconcileWranglerBindings as T}from"../packem_shared/HYPERDRIVE_PLACEHOLDER_ID-DJGsqkww.mjs";import{reconcileWranglerCompatibilityDate as v}from"../packem_shared/reconcileWranglerCompatibilityDate-hocXEuRA.mjs";import{describePreservedCrons as b,reconcileWranglerCrons as B}from"../packem_shared/describePreservedCrons-C5KPuPy3.mjs";import{reconcileBindingsSafely as u,reconcileWranglerExtras as G}from"../packem_shared/reconcileBindingsSafely-BY8Od1M9.mjs";import{REMOTE_ELIGIBLE_KEYS as y,injectRemoteFlags as M,isRemoteEnvEnabled as P,materializeDevWranglerConfig as V,planRemoteBindings as H,resolveRemoteEnabled as w}from"../packem_shared/REMOTE_ELIGIBLE_KEYS-DnbYTTWX.mjs";import{materializeServiceDevConfigs as K}from"../packem_shared/materializeServiceDevConfigs-k_oLCcBT.mjs";import{default as z}from"../packem_shared/CLOUDFLARE_TOOLCHAIN_VERSIONS-DV5E_f_q.mjs";import{withTailConsumer as J}from"../packem_shared/withTailConsumer-CF3pk_Ov.mjs";import{WORKERS_CACHE_MIN_DATE as k,isCacheEnabled as q}from"../packem_shared/WORKERS_CACHE_MIN_DATE-0k9ABJtF.mjs";import{wranglerCodegenInputs as $}from"../packem_shared/wranglerCodegenInputs-UqO5e_qJ.mjs";import{DEFAULT_OBSERVABILITY as re,resolveObservabilitySampling as oe}from"../packem_shared/DEFAULT_OBSERVABILITY-bN6UkTMx.mjs";import{mergeWranglerEnvironment as te}from"../packem_shared/mergeWranglerEnvironment-D5ekKj5x.mjs";import{WRANGLER_FILES as ie,findWranglerFile as le,readWranglerJsonc as fe}from"../packem_shared/WRANGLER_FILES-UNW-xY5u.mjs";import{UNEXPORTED_CLASS_MARKER as me,validateWranglerProject as se}from"../packem_shared/UNEXPORTED_CLASS_MARKER-mdcw5KDY.mjs";import{scanWranglerVariablesForSecrets as de}from"../packem_shared/scanWranglerVariablesForSecrets-CZDS9y2i.mjs";import{wranglerToAlchemy as Ce}from"../packem_shared/wranglerToAlchemy-CBO2ucRm.mjs";import{REQUIRED_COMPATIBILITY_DATE as xe,REQUIRED_FLAG as _e,validateWrangler as ce,validateWranglerConfig as Ie}from"../packem_shared/REQUIRED_COMPATIBILITY_DATE-D4UcOP_t.mjs";export{i as BINDING_MANIFEST_VERSION,E as CLOUDFLARE_CLI_CONFIG_WARNING_ENV,d as CLOUDFLARE_DRIVER,z as CLOUDFLARE_TOOLCHAIN_VERSIONS,re as DEFAULT_OBSERVABILITY,C as GLOBAL_FETCH_STRICTLY_PUBLIC_FLAG,S as HYPERDRIVE_PLACEHOLDER_ID,y as REMOTE_ELIGIBLE_KEYS,xe as REQUIRED_COMPATIBILITY_DATE,_e as REQUIRED_FLAG,me as UNEXPORTED_CLASS_MARKER,k as WORKERS_CACHE_MIN_DATE,ie as WRANGLER_FILES,o as applyModify,t as assertWranglerSatisfiesSchema,A as bindingsNeedingDatabase,l as buildBindingManifest,W as collectExportGaps,b as describePreservedCrons,c as describeWithheld,m as detectCloudflareCliConfig,le as findWranglerFile,x as hasCloudflareCredentials,M as injectRemoteFlags,q as isCacheEnabled,P as isRemoteEnvEnabled,V as materializeDevWranglerConfig,K as materializeServiceDevConfigs,te as mergeWranglerEnvironment,H as planRemoteBindings,fe as readWranglerJsonc,u as reconcileBindingsSafely,T as reconcileWranglerBindings,v as reconcileWranglerCompatibilityDate,B as reconcileWranglerCrons,G as reconcileWranglerExtras,oe as resolveObservabilitySampling,w as resolveRemoteEnabled,de as scanWranglerVariablesForSecrets,D as startLocalHyperdrive,ce as validateWrangler,Ie as validateWranglerConfig,se as validateWranglerProject,s as warnCloudflareCliConfigOnce,J as withTailConsumer,I as withheldBindings,$ as wranglerCodegenInputs,Ce as wranglerToAlchemy};
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 c,ROOT_SKILL_NAME as p,claimAgentRulesHint as l,detectAgentRules as D}from"./packem_shared/AGENT_RULES_DIR-Bd6JPtNa.mjs";import{clearApiSpecMarker as A,readApiSpecMarker as S,writeApiSpecMarker as m}from"./packem_shared/clearApiSpecMarker-DMGpP41V.mjs";import{MissingBuildOutputError as f}from"./packem_shared/MissingBuildOutputError-BAyekzof.mjs";import{default as T}from"./packem_shared/canonicalPath-DrfMiT3U.mjs";import{startCelldDevSession as v}from"./packem_shared/startCelldDevSession-PHdbwtI5.mjs";import{BUILD_ROOT_ENV as g,BUILD_TARGET_ENV as V,BUNDLE_META_PATH_ENV as I,CODEGEN_ENV as u,DEFAULT_BUNDLE_META_PATH as O,LAZY_FUNCTIONS_ENV as P,STRICT_ADVISORIES_ENV as M,isCodegenDisabled as U,isLazyFunctionsEnabled as F,resolveLazyFunctions as C}from"./packem_shared/BUILD_ROOT_ENV-Dg4MV3wY.mjs";import{discoverContainerInfo as G}from"./packem_shared/discoverContainerInfo-DzXr7Vm3.mjs";import{streamContainerLogs as y}from"./packem_shared/streamContainerLogs-0nko1qpv.mjs";import{detectFramework as h,projectUsesUmbrella as j}from"./packem_shared/detectFramework-Dfpvu6rD.mjs";import{acceptsConnection as K,startDevProcess as H}from"./packem_shared/acceptsConnection-DHhUYGjT.mjs";import{DEV_BINDINGS_FILE as Y,DEV_DAEMON_ENV as J,DEV_HANDOFF_ENV as z,DEV_LOG_FILE as q,DEV_LOG_FILE_ENV as X,DEV_STATE_DIR as Z,DEV_STATE_FILE as Q,claimDevServerState as $,clearDevServerState as ee,isDevServerReady as re,isProcessAlive as oe,isRecordedProcessCurrent as te,readDevServerState as ae,readLiveDevServerState as Ee,updateDevServerState as se,writeDevServerState as ie}from"./packem_shared/DEV_BINDINGS_FILE-C0ZN_XlP.mjs";import{DEV_VARS_EXAMPLE_FILE as _e,DEV_VARS_FILE as ce,DEV_VARS_KEY_PATTERN as pe,escapeRegExp as le,parseDevVariableEntries as De,removeDevVariableLine as de,upsertDevVariableLine as Ae}from"./packem_shared/DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";import{DEV_WORKER_ENV_VALUE as me,DEV_WORKER_ENV_VAR as Le,ensureDevWorkerEnv as fe}from"./packem_shared/DEV_WORKER_ENV_VALUE-CARjGoAv.mjs";import{createDiscoveryCache as Te}from"./packem_shared/createDiscoveryCache-npJI4uej.mjs";import{DEFAULT_DEPLOY_TARGET as ve,deployTargetIds as xe,isRunnableTarget as ge,planToolchainInvocation as Ve,resolveDeployDriver as Ie,runnableTargetIds as ue,targetRunsOwnDevServer as Oe}from"./packem_shared/DEFAULT_DEPLOY_TARGET-CnovxJid.mjs";import{inferLunoraBindings as Me,secretSourcesFromBindings as Ue}from"./packem_shared/inferLunoraBindings-BT4-fwiQ.mjs";import{LINKED_PROJECT_DIR as Ce,LINKED_PROJECT_FILE as Be,readLinkedProject as Ge,writeLinkedProject as be}from"./packem_shared/LINKED_PROJECT_DIR-Ba5qPEwo.mjs";import{LUNORA_IGNORED_PATHS as ke,applyLintIgnores as he,detectLintTools as je}from"./packem_shared/LUNORA_IGNORED_PATHS-U93uPxrW.mjs";import{blockingFindingsMessage as Ke,reportCodegenFindings as He}from"./packem_shared/blockingFindingsMessage-CRbg1sla.mjs";import{LUNORA_EVENT_SOURCE as Ye,formatLunoraEvent as Je}from"./packem_shared/LUNORA_EVENT_SOURCE-B9ZVohjO.mjs";import{LUNORA_TAG as qe,advisoryLine as Xe,lunoraLine as Ze}from"./packem_shared/LUNORA_TAG-DQTGPqcJ.mjs";import{default as $e}from"./packem_shared/LunoraReporter-f277GLNT.mjs";import{addArgsFor as rr,detectInstalledManagers as or,detectPackageManager as tr,execArgsFor as ar,installArgsFor as Er,runScriptArgsFor as sr,runScriptCommand as ir,toolchainExecArgs as nr}from"./packem_shared/addArgsFor-CYZKhNIo.mjs";import{P as cr,s as pr}from"./packem_shared/package-secrets-registry-BEJELdls.mjs";import{runPostCodegenHook as Dr}from"./packem_shared/runPostCodegenHook-Dx3yTsYZ.mjs";import{assertBuildTargetMatches as Ar,interpretRemote as Sr,readProjectRemotePreference as mr,readProjectTarget as Lr,resolveProjectTarget as fr,resolveTargetOrThrow as Nr}from"./packem_shared/assertBuildTargetMatches-Bw7uURKp.mjs";import{readProjectDependencies as Rr,readProjectDependencyNames as vr,readProjectManifest as xr}from"./packem_shared/readProjectDependencies-l3uhUKjo.mjs";import{createConfirm as Vr,isInteractive as Ir,promptMultiSelect as ur,promptSelect as Or,promptText as Pr,promptYesNo as Mr}from"./packem_shared/createConfirm-D5mKTMHj.mjs";import{default as Fr}from"./packem_shared/resolveSchemaDirectory-Ca5P6KuP.mjs";import{buildPackageSecretsBlock as Br,ensureDevVariables as Gr,ensureDevVarsExample as br,fillDevSecrets as yr,generateSecretValue as kr,isMintableSecretKey as hr,isPlaceholderValue as jr,planDevSecretsFill as wr,planDevVariablesAugment as Kr,planDevVariablesScaffold as Hr,requiredSecrets as Wr,writeDevVariablesFileAtomically as Yr}from"./packem_shared/buildPackageSecretsBlock-C5WZfMwe.mjs";import{applyAdditiveEdit as zr,classifyEdit as qr}from"./packem_shared/applyAdditiveEdit-CH0VhMJ2.mjs";import{parseSchema as Zr}from"./packem_shared/parseSchema-D1Wbr1qv.mjs";import{classifyPolicyEdit as $r,resolveServerModule as eo,scaffoldPolicyFile as ro,wireRlsIntoProcedure as oo}from"./packem_shared/classifyPolicyEdit-DJi9Fk8G.mjs";import{discoverSchemaInfo as ao}from"./packem_shared/discoverSchemaInfo-BBRlXZop.mjs";import{ACCENT as so,BADGES as io,BADGE_COLUMN_WIDTH as no,LUNA_ART as _o,LUNA_BUNNY as co,LUNA_NAME as po,LUNA_SIGNOFF as lo,STEP_BADGE_NAMES as Do,badgeLead as Ao,badgeWidth as So,padBadge as mo,paintAnswer as Lo,paintBadge as fo}from"./packem_shared/ACCENT-CotPTfv7.mjs";import{COMPOSED_WORKER_ENTRY as To,DURABLE_OBJECT_BINDINGS as Ro,GENERATED_CLASS_MODULES as vo,GENERATED_MODULE_DURABLE_OBJECTS as xo,MERGED_DURABLE_OBJECTS_MODULE as go,isMergedProject as Vo,isMergedRoleModule as Io}from"./packem_shared/COMPOSED_WORKER_ENTRY-Ciiba5g_.mjs";import{discoverWorkflowInfo as Oo}from"./packem_shared/discoverWorkflowInfo-zW7Tt0Tn.mjs";export{so as ACCENT,o as AGENT_MODE_ENV,i as AGENT_RULES_DIR,n as AGENT_RULES_HINT,_ as AGENT_RULES_HINT_ENV,io as BADGES,no as BADGE_COLUMN_WIDTH,g as BUILD_ROOT_ENV,V as BUILD_TARGET_ENV,I as BUNDLE_META_PATH_ENV,u as CODEGEN_ENV,To as COMPOSED_WORKER_ENTRY,O as DEFAULT_BUNDLE_META_PATH,ve as DEFAULT_DEPLOY_TARGET,Y as DEV_BINDINGS_FILE,J as DEV_DAEMON_ENV,z as DEV_HANDOFF_ENV,q as DEV_LOG_FILE,X as DEV_LOG_FILE_ENV,Z as DEV_STATE_DIR,Q as DEV_STATE_FILE,_e as DEV_VARS_EXAMPLE_FILE,ce as DEV_VARS_FILE,pe as DEV_VARS_KEY_PATTERN,me as DEV_WORKER_ENV_VALUE,Le as DEV_WORKER_ENV_VAR,Ro as DURABLE_OBJECT_BINDINGS,vo as GENERATED_CLASS_MODULES,xo as GENERATED_MODULE_DURABLE_OBJECTS,P as LAZY_FUNCTIONS_ENV,Ce as LINKED_PROJECT_DIR,Be as LINKED_PROJECT_FILE,_o as LUNA_ART,co as LUNA_BUNNY,po as LUNA_NAME,lo as LUNA_SIGNOFF,Ye as LUNORA_EVENT_SOURCE,ke as LUNORA_IGNORED_PATHS,c as LUNORA_SKILL_NAMES,qe as LUNORA_TAG,$e as LunoraReporter,go as MERGED_DURABLE_OBJECTS_MODULE,f as MissingBuildOutputError,cr as PACKAGE_SECRETS_REGISTRY,p as ROOT_SKILL_NAME,Do as STEP_BADGE_NAMES,M as STRICT_ADVISORIES_ENV,K as acceptsConnection,rr as addArgsFor,Xe as advisoryLine,zr as applyAdditiveEdit,he as applyLintIgnores,Ar as assertBuildTargetMatches,Ao as badgeLead,So as badgeWidth,Ke as blockingFindingsMessage,Br as buildPackageSecretsBlock,T as canonicalPath,l as claimAgentRulesHint,$ as claimDevServerState,qr as classifyEdit,$r as classifyPolicyEdit,A as clearApiSpecMarker,ee as clearDevServerState,Vr as createConfirm,Te as createDiscoveryCache,xe as deployTargetIds,D as detectAgentRules,t as detectAiAgent,h as detectFramework,or as detectInstalledManagers,je as detectLintTools,tr as detectPackageManager,E as discoverAgentInfo,G as discoverContainerInfo,ao as discoverSchemaInfo,Oo as discoverWorkflowInfo,Gr as ensureDevVariables,br as ensureDevVarsExample,fe as ensureDevWorkerEnv,le as escapeRegExp,ar as execArgsFor,yr as fillDevSecrets,Je as formatLunoraEvent,kr as generateSecretValue,Me as inferLunoraBindings,Er as installArgsFor,Sr as interpretRemote,U as isCodegenDisabled,re as isDevServerReady,Ir as isInteractive,F as isLazyFunctionsEnabled,Vo as isMergedProject,Io as isMergedRoleModule,hr as isMintableSecretKey,jr as isPlaceholderValue,oe as isProcessAlive,te as isRecordedProcessCurrent,ge as isRunnableTarget,Ze as lunoraLine,mo as padBadge,Lo as paintAnswer,fo as paintBadge,De as parseDevVariableEntries,Zr as parseSchema,wr as planDevSecretsFill,Kr as planDevVariablesAugment,Hr as planDevVariablesScaffold,Ve as planToolchainInvocation,j as projectUsesUmbrella,ur as promptMultiSelect,Or as promptSelect,Pr as promptText,Mr as promptYesNo,S as readApiSpecMarker,ae as readDevServerState,Ge as readLinkedProject,Ee as readLiveDevServerState,Rr as readProjectDependencies,vr as readProjectDependencyNames,xr as readProjectManifest,mr as readProjectRemotePreference,Lr as readProjectTarget,de as removeDevVariableLine,He as reportCodegenFindings,Wr as requiredSecrets,Ie as resolveDeployDriver,C as resolveLazyFunctions,fr as resolveProjectTarget,Fr as resolveSchemaDirectory,eo as resolveServerModule,Nr as resolveTargetOrThrow,Dr as runPostCodegenHook,sr as runScriptArgsFor,ir as runScriptCommand,ue as runnableTargetIds,ro as scaffoldPolicyFile,Ue as secretSourcesFromBindings,pr as secretsForPackages,v as startCelldDevSession,H as startDevProcess,y as streamContainerLogs,Oe as targetRunsOwnDevServer,nr as toolchainExecArgs,se as updateDevServerState,Ae as upsertDevVariableLine,oo as wireRlsIntoProcedure,m as writeApiSpecMarker,ie as writeDevServerState,Yr as writeDevVariablesFileAtomically,be 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 c,ROOT_SKILL_NAME as p,claimAgentRulesHint as l,detectAgentRules as D}from"./packem_shared/AGENT_RULES_DIR-Bd6JPtNa.mjs";import{clearApiSpecMarker as A,readApiSpecMarker as S,writeApiSpecMarker as m}from"./packem_shared/clearApiSpecMarker-DMGpP41V.mjs";import{MissingBuildOutputError as f}from"./packem_shared/MissingBuildOutputError-BAyekzof.mjs";import{default as T}from"./packem_shared/canonicalPath-DrfMiT3U.mjs";import{startCelldDevSession as v}from"./packem_shared/startCelldDevSession-PHdbwtI5.mjs";import{BUILD_ROOT_ENV as g,BUILD_TARGET_ENV as V,BUNDLE_META_PATH_ENV as I,CODEGEN_ENV as u,DEFAULT_BUNDLE_META_PATH as O,LAZY_FUNCTIONS_ENV as P,STRICT_ADVISORIES_ENV as M,isCodegenDisabled as U,isLazyFunctionsEnabled as F,resolveLazyFunctions as C}from"./packem_shared/BUILD_ROOT_ENV-Dg4MV3wY.mjs";import{discoverContainerInfo as G}from"./packem_shared/discoverContainerInfo-DzXr7Vm3.mjs";import{streamContainerLogs as y}from"./packem_shared/streamContainerLogs-0nko1qpv.mjs";import{detectFramework as h,projectUsesUmbrella as j}from"./packem_shared/detectFramework-Dfpvu6rD.mjs";import{acceptsConnection as K,startDevProcess as H}from"./packem_shared/acceptsConnection-DHhUYGjT.mjs";import{DEV_BINDINGS_FILE as Y,DEV_DAEMON_ENV as J,DEV_HANDOFF_ENV as z,DEV_LOG_FILE as q,DEV_LOG_FILE_ENV as X,DEV_STATE_DIR as Z,DEV_STATE_FILE as Q,claimDevServerState as $,clearDevServerState as ee,isDevServerReady as re,isProcessAlive as oe,isRecordedProcessCurrent as te,readDevServerState as ae,readLiveDevServerState as Ee,updateDevServerState as se,writeDevServerState as ie}from"./packem_shared/DEV_BINDINGS_FILE-C0ZN_XlP.mjs";import{DEV_VARS_EXAMPLE_FILE as _e,DEV_VARS_FILE as ce,DEV_VARS_KEY_PATTERN as pe,escapeRegExp as le,parseDevVariableEntries as De,removeDevVariableLine as de,upsertDevVariableLine as Ae}from"./packem_shared/DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";import{DEV_WORKER_ENV_VALUE as me,DEV_WORKER_ENV_VAR as Le,ensureDevWorkerEnv as fe}from"./packem_shared/DEV_WORKER_ENV_VALUE-CARjGoAv.mjs";import{createDiscoveryCache as Te}from"./packem_shared/createDiscoveryCache-npJI4uej.mjs";import{DEFAULT_DEPLOY_TARGET as ve,deployTargetIds as xe,isRunnableTarget as ge,planToolchainInvocation as Ve,resolveDeployDriver as Ie,runnableTargetIds as ue,targetRunsOwnDevServer as Oe}from"./packem_shared/DEFAULT_DEPLOY_TARGET-CnovxJid.mjs";import{inferLunoraBindings as Me,secretSourcesFromBindings as Ue}from"./packem_shared/inferLunoraBindings-Ddx-f6eV.mjs";import{LINKED_PROJECT_DIR as Ce,LINKED_PROJECT_FILE as Be,readLinkedProject as Ge,writeLinkedProject as be}from"./packem_shared/LINKED_PROJECT_DIR-Ba5qPEwo.mjs";import{LUNORA_IGNORED_PATHS as ke,applyLintIgnores as he,detectLintTools as je}from"./packem_shared/LUNORA_IGNORED_PATHS-U93uPxrW.mjs";import{blockingFindingsMessage as Ke,reportCodegenFindings as He}from"./packem_shared/blockingFindingsMessage-CRbg1sla.mjs";import{LUNORA_EVENT_SOURCE as Ye,formatLunoraEvent as Je}from"./packem_shared/LUNORA_EVENT_SOURCE-B9ZVohjO.mjs";import{LUNORA_TAG as qe,advisoryLine as Xe,lunoraLine as Ze}from"./packem_shared/LUNORA_TAG-DQTGPqcJ.mjs";import{default as $e}from"./packem_shared/LunoraReporter-f277GLNT.mjs";import{addArgsFor as rr,detectInstalledManagers as or,detectPackageManager as tr,execArgsFor as ar,installArgsFor as Er,runScriptArgsFor as sr,runScriptCommand as ir,toolchainExecArgs as nr}from"./packem_shared/addArgsFor-CYZKhNIo.mjs";import{P as cr,s as pr}from"./packem_shared/package-secrets-registry-BEJELdls.mjs";import{runPostCodegenHook as Dr}from"./packem_shared/runPostCodegenHook-Dx3yTsYZ.mjs";import{assertBuildTargetMatches as Ar,interpretRemote as Sr,readProjectRemotePreference as mr,readProjectTarget as Lr,resolveProjectTarget as fr,resolveTargetOrThrow as Nr}from"./packem_shared/assertBuildTargetMatches-Bw7uURKp.mjs";import{readProjectDependencies as Rr,readProjectDependencyNames as vr,readProjectManifest as xr}from"./packem_shared/readProjectDependencies-l3uhUKjo.mjs";import{createConfirm as Vr,isInteractive as Ir,promptMultiSelect as ur,promptSelect as Or,promptText as Pr,promptYesNo as Mr}from"./packem_shared/createConfirm-D5mKTMHj.mjs";import{default as Fr}from"./packem_shared/resolveSchemaDirectory-Ca5P6KuP.mjs";import{buildPackageSecretsBlock as Br,ensureDevVariables as Gr,ensureDevVarsExample as br,fillDevSecrets as yr,generateSecretValue as kr,isMintableSecretKey as hr,isPlaceholderValue as jr,planDevSecretsFill as wr,planDevVariablesAugment as Kr,planDevVariablesScaffold as Hr,requiredSecrets as Wr,writeDevVariablesFileAtomically as Yr}from"./packem_shared/buildPackageSecretsBlock-C5WZfMwe.mjs";import{applyAdditiveEdit as zr,classifyEdit as qr}from"./packem_shared/applyAdditiveEdit-CH0VhMJ2.mjs";import{parseSchema as Zr}from"./packem_shared/parseSchema-D1Wbr1qv.mjs";import{classifyPolicyEdit as $r,resolveServerModule as eo,scaffoldPolicyFile as ro,wireRlsIntoProcedure as oo}from"./packem_shared/classifyPolicyEdit-DJi9Fk8G.mjs";import{discoverSchemaInfo as ao}from"./packem_shared/discoverSchemaInfo-BBRlXZop.mjs";import{ACCENT as so,BADGES as io,BADGE_COLUMN_WIDTH as no,LUNA_ART as _o,LUNA_BUNNY as co,LUNA_NAME as po,LUNA_SIGNOFF as lo,STEP_BADGE_NAMES as Do,badgeLead as Ao,badgeWidth as So,padBadge as mo,paintAnswer as Lo,paintBadge as fo}from"./packem_shared/ACCENT-CotPTfv7.mjs";import{COMPOSED_WORKER_ENTRY as To,DURABLE_OBJECT_BINDINGS as Ro,GENERATED_CLASS_MODULES as vo,GENERATED_MODULE_DURABLE_OBJECTS as xo,MERGED_DURABLE_OBJECTS_MODULE as go,isMergedProject as Vo,isMergedRoleModule as Io}from"./packem_shared/COMPOSED_WORKER_ENTRY-Ciiba5g_.mjs";import{discoverWorkflowInfo as Oo}from"./packem_shared/discoverWorkflowInfo-zW7Tt0Tn.mjs";export{so as ACCENT,o as AGENT_MODE_ENV,i as AGENT_RULES_DIR,n as AGENT_RULES_HINT,_ as AGENT_RULES_HINT_ENV,io as BADGES,no as BADGE_COLUMN_WIDTH,g as BUILD_ROOT_ENV,V as BUILD_TARGET_ENV,I as BUNDLE_META_PATH_ENV,u as CODEGEN_ENV,To as COMPOSED_WORKER_ENTRY,O as DEFAULT_BUNDLE_META_PATH,ve as DEFAULT_DEPLOY_TARGET,Y as DEV_BINDINGS_FILE,J as DEV_DAEMON_ENV,z as DEV_HANDOFF_ENV,q as DEV_LOG_FILE,X as DEV_LOG_FILE_ENV,Z as DEV_STATE_DIR,Q as DEV_STATE_FILE,_e as DEV_VARS_EXAMPLE_FILE,ce as DEV_VARS_FILE,pe as DEV_VARS_KEY_PATTERN,me as DEV_WORKER_ENV_VALUE,Le as DEV_WORKER_ENV_VAR,Ro as DURABLE_OBJECT_BINDINGS,vo as GENERATED_CLASS_MODULES,xo as GENERATED_MODULE_DURABLE_OBJECTS,P as LAZY_FUNCTIONS_ENV,Ce as LINKED_PROJECT_DIR,Be as LINKED_PROJECT_FILE,_o as LUNA_ART,co as LUNA_BUNNY,po as LUNA_NAME,lo as LUNA_SIGNOFF,Ye as LUNORA_EVENT_SOURCE,ke as LUNORA_IGNORED_PATHS,c as LUNORA_SKILL_NAMES,qe as LUNORA_TAG,$e as LunoraReporter,go as MERGED_DURABLE_OBJECTS_MODULE,f as MissingBuildOutputError,cr as PACKAGE_SECRETS_REGISTRY,p as ROOT_SKILL_NAME,Do as STEP_BADGE_NAMES,M as STRICT_ADVISORIES_ENV,K as acceptsConnection,rr as addArgsFor,Xe as advisoryLine,zr as applyAdditiveEdit,he as applyLintIgnores,Ar as assertBuildTargetMatches,Ao as badgeLead,So as badgeWidth,Ke as blockingFindingsMessage,Br as buildPackageSecretsBlock,T as canonicalPath,l as claimAgentRulesHint,$ as claimDevServerState,qr as classifyEdit,$r as classifyPolicyEdit,A as clearApiSpecMarker,ee as clearDevServerState,Vr as createConfirm,Te as createDiscoveryCache,xe as deployTargetIds,D as detectAgentRules,t as detectAiAgent,h as detectFramework,or as detectInstalledManagers,je as detectLintTools,tr as detectPackageManager,E as discoverAgentInfo,G as discoverContainerInfo,ao as discoverSchemaInfo,Oo as discoverWorkflowInfo,Gr as ensureDevVariables,br as ensureDevVarsExample,fe as ensureDevWorkerEnv,le as escapeRegExp,ar as execArgsFor,yr as fillDevSecrets,Je as formatLunoraEvent,kr as generateSecretValue,Me as inferLunoraBindings,Er as installArgsFor,Sr as interpretRemote,U as isCodegenDisabled,re as isDevServerReady,Ir as isInteractive,F as isLazyFunctionsEnabled,Vo as isMergedProject,Io as isMergedRoleModule,hr as isMintableSecretKey,jr as isPlaceholderValue,oe as isProcessAlive,te as isRecordedProcessCurrent,ge as isRunnableTarget,Ze as lunoraLine,mo as padBadge,Lo as paintAnswer,fo as paintBadge,De as parseDevVariableEntries,Zr as parseSchema,wr as planDevSecretsFill,Kr as planDevVariablesAugment,Hr as planDevVariablesScaffold,Ve as planToolchainInvocation,j as projectUsesUmbrella,ur as promptMultiSelect,Or as promptSelect,Pr as promptText,Mr as promptYesNo,S as readApiSpecMarker,ae as readDevServerState,Ge as readLinkedProject,Ee as readLiveDevServerState,Rr as readProjectDependencies,vr as readProjectDependencyNames,xr as readProjectManifest,mr as readProjectRemotePreference,Lr as readProjectTarget,de as removeDevVariableLine,He as reportCodegenFindings,Wr as requiredSecrets,Ie as resolveDeployDriver,C as resolveLazyFunctions,fr as resolveProjectTarget,Fr as resolveSchemaDirectory,eo as resolveServerModule,Nr as resolveTargetOrThrow,Dr as runPostCodegenHook,sr as runScriptArgsFor,ir as runScriptCommand,ue as runnableTargetIds,ro as scaffoldPolicyFile,Ue as secretSourcesFromBindings,pr as secretsForPackages,v as startCelldDevSession,H as startDevProcess,y as streamContainerLogs,Oe as targetRunsOwnDevServer,nr as toolchainExecArgs,se as updateDevServerState,Ae as upsertDevVariableLine,oo as wireRlsIntoProcedure,m as writeApiSpecMarker,ie as writeDevServerState,Yr as writeDevVariablesFileAtomically,be as writeLinkedProject};
@@ -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 V}from"node:path";import{containerBuildTag as te}from"@lunora/container";import{readJsonSync as ie}from"@visulima/fs";import{applyModify as w}from"./applyModify-DKP2l6S9.mjs";import{a as oe,r as Y}from"./lunora-manifest-DuH_Cmyu.mjs";import{parseTree as ae,findNodeAtLocation as re}from"jsonc-parser";import{r as de,a as ce,b as le,c as ue}from"./reconcile-services-DFqH4eMQ.mjs";import{DEV_VARS_FILE as ge,parseDevVariableEntries as me}from"./DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";import{secretSourcesFromBindings as pe}from"./inferLunoraBindings-BT4-fwiQ.mjs";import{requiredSecrets as fe}from"./buildPackageSecretsBlock-C5WZfMwe.mjs";import{w as be,m as he,s as U,o as P,n as T,p as ve}from"./validate-bindings-PVHSAU6M.mjs";import{s as we}from"./worker-entry-checks-AIASCYl7.mjs";import{DEFAULT_OBSERVABILITY as _e}from"./DEFAULT_OBSERVABILITY-bN6UkTMx.mjs";import{findWranglerFile as ye,readWranglerJsonc as Se}from"./WRANGLER_FILES-UNW-xY5u.mjs";const Ee=[["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(Ee.filter(([n])=>e.tuning[n]!==void 0).map(([n,s])=>[s,e.tuning[n]])),L="queueTuning",xe=/^[\t ]*(?:,[\t ]*)?(?:\/\/[^\n\r]*)?\r?\n/u,Ae=/^[\t ]*,/u,Oe=(e,n)=>{const s=ae(e),t=s===void 0?void 0:re(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 V}from"node:path";import{containerBuildTag as te}from"@lunora/container";import{readJsonSync as ie}from"@visulima/fs";import{applyModify as w}from"./applyModify-DKP2l6S9.mjs";import{a as oe,r as Y}from"./lunora-manifest-DuH_Cmyu.mjs";import{parseTree as ae,findNodeAtLocation as re}from"jsonc-parser";import{r as de,a as ce,b as le,c as ue}from"./reconcile-services-DFqH4eMQ.mjs";import{DEV_VARS_FILE as ge,parseDevVariableEntries as me}from"./DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";import{secretSourcesFromBindings as pe}from"./inferLunoraBindings-Ddx-f6eV.mjs";import{requiredSecrets as fe}from"./buildPackageSecretsBlock-C5WZfMwe.mjs";import{w as be,m as he,s as U,o as P,n as T,p as ve}from"./validate-bindings-PVHSAU6M.mjs";import{s as we}from"./worker-entry-checks-AIASCYl7.mjs";import{DEFAULT_OBSERVABILITY as _e}from"./DEFAULT_OBSERVABILITY-bN6UkTMx.mjs";import{findWranglerFile as ye,readWranglerJsonc as Se}from"./WRANGLER_FILES-UNW-xY5u.mjs";const Ee=[["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(Ee.filter(([n])=>e.tuning[n]!==void 0).map(([n,s])=>[s,e.tuning[n]])),L="queueTuning",xe=/^[\t ]*(?:,[\t ]*)?(?:\/\/[^\n\r]*)?\r?\n/u,Ae=/^[\t ]*,/u,Oe=(e,n)=>{const s=ae(e),t=s===void 0?void 0:re(s,[...n])?.parent;if(t?.type==="property"){const o=t.offset+t.length,i=e.lastIndexOf(`
2
2
  `,t.offset-1)+1,a=xe.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:Ae.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)},G=(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=Oe(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}},Ne=(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=G(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}},ke=(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=G(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]}},$e=(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},Ce=(e,n,s)=>{const t=Object.fromEntries(Object.entries({...n,...s}).filter(([,o])=>Object.keys(o).length>0));oe(e,L,Object.keys(t).length===0?void 0:t)},Ie="https://api.cloudflare.com/client/v4/accounts/<ACCOUNT_ID>/artifacts/namespaces",Te=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 ${Ie} 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",je=(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),Te(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)},Re=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.`),qe=(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.`)},De=(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.`]})]},Pe=(e,n)=>[...qe(e,n),...De(e,n)],J=[{keys:["STRIPE_SECRET_KEY","STRIPE_WEBHOOK_SECRET"],label:"Stripe"},{keys:["POLAR_ACCESS_TOKEN","POLAR_WEBHOOK_SECRET"],label:"Polar"},{keys:["CREEM_API_KEY","CREEM_WEBHOOK_SECRET"],label:"Creem"},{keys:["AUTUMN_SECRET_KEY","AUTUMN_WEBHOOK_SECRET"],label:"Autumn"},{keys:["DODO_PAYMENTS_API_KEY","DODO_PAYMENTS_WEBHOOK_KEY"],label:"Dodo Payments"}],Be=()=>J.map(({keys:e,label:n})=>`${e[0]} + ${e[1]} (${n})`).join(" or "),Le=e=>{let n;try{n=ee(V(e,ge),"utf8")}catch{return!1}const s=new Map(me(n).map(t=>[t.key,t.value]));return J.some(({keys:t})=>t.every(o=>(s.get(o)??"")!==""))},We=(e,n)=>{const s=n?.secrets?.required;if(!Array.isArray(s))return[];const t=new Set(s),o=fe(pe(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&&!Le(n)&&i.push(`@lunora/payment is used; set one provider's secret pair in .dev.vars — ${Be()}.`),i.push(...Re(e),...je(e,s,t),...We(e,s)),s!==void 0&&i.push(...Pe(e,s)),i},X="<replace-with-d1-create-id>",Me="<replace-with-hyperdrive-create-id>",Ke=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}))),Fe=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)}`},He=e=>{const n=new Set;for(const s of P(e)){for(const t of T(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[...T(s.new_classes),...T(s.new_sqlite_classes)])n.add(t)}return n},Ye=(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=>!He(u).has(c));if(d.length>0){const c=[...u,{new_sqlite_classes:d,tag:Fe(u)}];a=w(a,["migrations"],c)}return{added:m,text:a}},Qe=(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:X,database_name:t}];return{added:["DB (D1)"],text:w(e,["d1_databases"],o)}},Ve={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}=Ve[s],i=n[s]?.binding;return typeof i=="string"&&i.length>0?{added:[],text:e}:{added:[o],text:w(e,[s],{binding:t})}},Ue=(e,n)=>e.usesAnalyticsSql&&we(n,new Set(["analyticsSql"]))?.chained.has("analyticsSql")!==!0,Ge=new Set(["ratelimits","send_email"]),Je=["durable_objects","logfwdr","unsafe"],Xe=new Set(["data_blobs","text_blobs","vars","wasm_modules"]),M=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),W=(e,n,s)=>M(e)&&e[n]===s,ze=(e,n,s)=>{if(Xe.has(e))return M(n)&&Object.hasOwn(n,s);const t=Ge.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"&&ze(i,a,n));if(t!==void 0)return t[0];for(const i of Je){const a=s[i];if(M(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"},K=(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.`,F=e=>e===void 0||e==="cloudflare",Ze=(e,n,s)=>{if(!F(s)||(n.hyperdrive?.length??0)>0)return{added:[],text:e};const t=$(n,"HYPERDRIVE");return t!==void 0?{added:[],text:e,warnings:[K("hyperdrive","HYPERDRIVE",t)]}:{added:["HYPERDRIVE (Hyperdrive, created on deploy)"],text:w(e,["hyperdrive"],[{binding:"HYPERDRIVE",id:Me}])}},en=(e,n,s,t)=>{if(!F(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:[K("kv_namespaces","KV",o)]}:{added:["KV (Workers KV, created on deploy)"],text:w(e,["kv_namespaces"],[{binding:"KV"}])}},nn=(e,n,s,t)=>{if(!F(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:[K("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}])}},Q=(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])}},sn=(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"}])}},tn=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},on=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}}},an=e=>{if(e.schedulingPolicy==="durable_object")return z(e);const{image:n}=e,s={class_name:e.className,image:on(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=tn(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},rn=(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=>an(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}},dn=(e,n)=>{if(n.observability!==void 0)return{added:[],text:e};const s=w(e,["observability"],{..._e});return{added:["observability"],text:s}},cn=(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"}],ln=Z.map(({minimum:e,name:n})=>`${n}@^${e.join(".")}.0`).join(" "),un=(e,n)=>{try{const s=se(V(e,"package.json")).resolve(`${n}/package.json`),[t=0,o=0]=String(ie(s).version).split(".").map(Number);return[t,o]}catch{return}},gn=e=>{const n=Z.flatMap(({minimum:s,name:t})=>{const o=un(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 ${ln}\`) and re-run.`},mn=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.`]:[]),pn=(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 ve){const c=u(a),p=U(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}},fn=(e,n,s,t,o)=>{if(o!==void 0)return{added:[],text:e,warnings:[o]};const i=[...s.map(b=>({settings:be(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(he.flatMap(f=>{const y=U(_,[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(...mn(n));const g=pn(v,d,s);return{added:c,text:g.text,updated:[...p,...g.updated],warnings:[...l,...g.warnings]}},Tn=(e,n,{environment:s,target:t}={})=>{const o=ye(e),i=Ke(n);if(!o)return{added:[],changed:!1,exportGaps:i,reason:"wrangler.jsonc not found",updated:[],warnings:D(n,e)};const{parsed:a,text:m}=Se(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=$e(g,u),h={},_=de(g);let E;const O=[{enabled:!0,run:r=>Ye(r,a,p)},{enabled:n.needsD1,run:r=>Qe(r,a)},{enabled:n.usesKv,run:r=>en(r,a,n.jurisdiction,t)},{enabled:n.usesHyperdrive,run:r=>Ze(r,a,t)},{enabled:n.usesArtifacts,run:r=>nn(r,a,n.jurisdiction,t)},{enabled:n.usesAi,run:r=>k(r,a,"ai")},{enabled:n.usesAiSearch,run:r=>Q(r,a,"ai_search_namespaces",{binding:"AI_SEARCH",namespace:"default"},"AI_SEARCH (AI Search namespace)")},{enabled:Ue(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=>Q(r,a,"analytics_engine_datasets",{binding:"ANALYTICS",dataset:"ANALYTICS"},"ANALYTICS (Analytics Engine)")},{enabled:n.usesWorkerLoader,run:r=>sn(r,a)},{enabled:!0,run:r=>dn(r,a)},{enabled:t===void 0||t==="cloudflare",run:r=>cn(r,a)},{enabled:d.length>0,run:r=>rn(r,a,d)},{enabled:l.length>0||v.length>0,run:r=>fn(r,a,l,v,gn(e))},{enabled:n.queues.length>0,run:r=>{const S=Ne(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=ce(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=ke(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=>{Ce(x,b,h)}}]:[],...S===void 0?[]:[{consequence:"a service removed from lunora.config stays bound",key:"services",label:"service bindings",write:x=>{ue(x,S)}}]];for(const x of N)try{x.write(Y(e)??g)}catch(I){u.push(`${r?"wrangler.jsonc was updated, but ":""}recording the ${x.label} reconcile owns in ${g.path} (lunora.${x.key}) failed: ${I instanceof Error?I.message:String(I)}. Until it is recorded, ${x.consequence}.`)}};let C;if(n.services!==void 0){const r=le(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 y.includes("DB (D1)")&&u.push(`wrote a DB binding with a placeholder database_id ("${X}") — run \`wrangler d1 create <name>\` and replace it before deploying.`),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{Me as HYPERDRIVE_PLACEHOLDER_ID,Ke as collectExportGaps,Tn as reconcileWranglerBindings};
@@ -0,0 +1 @@
1
+ import{existsSync as P,statSync as j,readFileSync as F,readdirSync as k}from"node:fs";import{discoverFlags as L,FLAGS_FILENAME as B,discoverQueues as G,CAPABILITY_PROBES as $,readServiceBindings as W,discoverNotifyChannels as q,NOTIFY_FILENAME as Y,mayReadCapabilityContext as K,sourceCapabilitySignals as U,foldCapabilitySignals as C,capabilitiesUsedBy as M}from"@lunora/codegen";import{init as V}from"es-module-lexer";import{Project as H}from"ts-morph";import{discoverAgentInfo as X}from"./discoverAgentInfo-pqFMJBtJ.mjs";import{discoverContainerInfo as Q}from"./discoverContainerInfo-DzXr7Vm3.mjs";import{escapeRegExp as J}from"./DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";import{d as x}from"./discover-info-DC2MrAIM.mjs";import{relative as z,sep as Z,isAbsolute as ee,join as y}from"node:path";import{P as se}from"./package-secrets-registry-BEJELdls.mjs";import{discoverSchemaInfo as te}from"./discoverSchemaInfo-BBRlXZop.mjs";import{resolveWorkerEntry as re,composedEntryDurableObjects as oe,GENERATED_DIRECTORY as _,DURABLE_OBJECT_BINDINGS as ne,detectExportedDurableObjects as ae,detectClassExports as R,isMergedProject as ie}from"./COMPOSED_WORKER_ENTRY-Ciiba5g_.mjs";import{discoverWorkflowInfo as ce}from"./discoverWorkflowInfo-zW7Tt0Tn.mjs";const de=(e,s)=>{const{error:r,value:t}=x(e,s,B,L);return r===void 0?{flags:t}:{error:r}},ue=(e,s)=>{const r=z(s,e);return r!==""&&r!==".."&&!r.startsWith(`..${Z}`)&&!ee(r)},le=(e,s)=>{const{error:r,value:t}=x(e,s,void 0,G);return r===void 0?{queues:t??[]}:{error:r,queues:[]}},me=new Set([".cjs",".cts",".js",".jsx",".mjs",".mts",".ts",".tsx"]),pe=new Set([".git",".lunora-cache",".wrangler","dist",_,"node_modules"]),he=["lunora","src"],fe=/\benv\s*\.\s*DB\b/,ge=/\benv\s*\.\s*AI\b/,T=["ai","aiSearch","analytics","analyticsSql","artifacts","browser","hyperdrive","images","kv","mail","notify","payments","pipelines","r2sql","scheduler","storage","x402"],w=e=>`uses${e.charAt(0).toUpperCase()}${e.slice(1)}`,D=[["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"]],N=[...T.map(e=>[w(e),$[e].moduleSpecifier]),...D].toSorted(([e],[s])=>e.localeCompare(s)),be=[["usesNotifyFcm","@lunora/notify:fcm"],["usesNotifyWebPush","@lunora/notify:webPush"],["usesRequestSecretTool","@lunora/agent:requestSecretTool"]],ye=["@lunora/agent","@lunora/agent/sandbox"],Se=new RegExp(String.raw`["'\x60](?:${[...N.map(([,e])=>e),...ye].map(e=>J(e)).join("|")})["'\x60]`,"u"),o=e=>{const{contextProperty:s,moduleSpecifier:r}=$[e];return s===void 0?`${r} is imported`:`${r} is imported or ctx.${s} is read`},Ee="STRIPE_SECRET_KEY + STRIPE_WEBHOOK_SECRET (Stripe) or POLAR_ACCESS_TOKEN + POLAR_WEBHOOK_SECRET (Polar)",ve=/\bfrom\s+["']\.{1,2}\//u,O=(e,s)=>{let r;try{r=k(e,{withFileTypes:!0})}catch{return}for(const t of r){if(t.isDirectory()){pe.has(t.name)||O(y(e,t.name),s);continue}const n=t.name.lastIndexOf(".");n!==-1&&me.has(t.name.slice(n))&&s.push(y(e,t.name))}},Ae=(e,s,r)=>{const{info:t}=te(e,s,r);return{jurisdiction:t?.jurisdiction,needsD1:t?.hasD1GlobalTable??!1}},Re=(e,s,r)=>{const t=y(e,r),n=new H({compilerOptions:{allowJs:!0},skipAddingFilesFromTsConfig:!0}),a=[],u=[],m=[];let i=!1,S=!1;for(const c of s){const d=y(e,c);if(!P(d)||!j(d).isDirectory())continue;const g=[];O(d,g);for(const l of g){const b=F(l,"utf8"),p=ue(l,t);i||=ge.test(b),S||=fe.test(b),(Se.test(b)||p&&(K(b)||ve.test(b)))&&(n.createSourceFile(l,b,{overwrite:!0}),a.push({file:l,inLunora:p}))}}for(const{file:c,inLunora:d}of a)(d?u:m).push(U(n.getSourceFileOrThrow(c)));const h=C(u),E=C([h,...m]),v=new Set([...E.valueImports,...E.dynamicImports]),f=M({contextReads:h.contextReads,valueImports:v});return{...Object.fromEntries([...T.map(c=>[w(c),f.has(c)]),...D.map(([c,d])=>[c,v.has(d)])]),needsD1:S,usesRequestSecretTool:h.requestSecretTool,usesAi:f.has("ai")||i,usesBrowser:f.has("browser")||h.sandboxTools.usesSandboxBrowser,usesWorkerLoader:h.sandboxTools.usesSandboxLoader}},_e=(e,s,r)=>[...e.map(t=>t.exported?`${t.bindingName}/${t.className} (container "${t.exportName}" declared and exported)`:`hint: container "${t.exportName}" is declared but ${t.className} is not exported by the worker entry — add \`export * from "./lunora/_generated/containers"\``),...s.map(t=>t.exported?`exports.${t.className} (workflow "${t.exportName}" declared and exported)`:`hint: workflow "${t.exportName}" is declared but ${t.className} is not exported by the worker entry — add \`export * from "./lunora/_generated/workflows"\``),...r.map(t=>t.exported?`exports.${t.className} (agent "${t.exportName}" declared and exported)`:`hint: agent "${t.exportName}" is declared but ${t.className} is not exported by the worker entry — add \`export * from "./lunora/_generated/agents"\``)],xe=(e,s,r)=>[[e.usesAi,`AI (${o("ai")}, or env.AI is used)`],[e.usesAuth&&!s.has("SessionDO"),"hint: @lunora/auth is imported; its tables are D1-backed by default. For DO-backed auth (what @better-auth/scim needs), pass `namespace` to .auth() and export the generated auth DO class"],[e.usesScheduler&&!s.has("SchedulerDO"),`hint: ${o("scheduler")}, but no SchedulerDO is exported by the worker entry`],[e.usesStorage,`hint: ${o("storage")}; add an r2_buckets binding (bucket binding names are user-defined)`],[e.usesMail,`hint: ${o("mail")}; set RESEND_API_KEY in .dev.vars (obtain at https://resend.com/api-keys)`],[e.usesPayments,`hint: ${o("payments")}; set the provider secrets in .dev.vars — ${Ee}`],[e.usesBrowser,`browser (${o("browser")}, or a sandbox browserTool imported in lunora/) — self-describing { binding: BROWSER }`],[e.usesImages,`images (${o("images")}) — self-describing { binding: IMAGES }`],[e.usesAnalytics,`analytics_engine_datasets (${o("analytics")}) — self-describing { binding: ANALYTICS, dataset }`],[e.usesWorkerLoader,"worker_loaders (jsCodeTool imported in lunora/) — self-describing { binding: LOADER }"],[e.usesAiSearch,`ai_search_namespaces (${o("aiSearch")}) — self-describing { binding: AI_SEARCH, namespace: "default" }; remote-only, so \`lunora dev\` reaches the deployed AI Search service`],[e.usesAnalyticsSql,`analytics (${o("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,r.jurisdiction===void 0?`kv_namespaces (${o("kv")}) — { binding: KV } with no id; wrangler creates the namespace on the first deploy`:`hint: ${o("kv")} and the schema pins "${r.jurisdiction}"; create the namespace with --jurisdiction ${r.jurisdiction} and add a kv_namespaces binding ({ binding, id })`],[e.usesHyperdrive,`hyperdrive (${o("hyperdrive")}) — { binding: HYPERDRIVE } with a placeholder id; dev uses an embedded Postgres and \`lunora deploy\` creates the config`],[e.usesPipelines,`hint: ${o("pipelines")}; run 'wrangler pipelines create <name>' and add a 'pipelines' binding ({ binding, stream }) — the pipeline resource can't be auto-provisioned`],[e.usesArtifacts,r.jurisdiction===void 0?`artifacts (${o("artifacts")}) — { binding: ARTIFACTS, namespace }`:`hint: ${o("artifacts")}; the schema pins data to "${r.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: ${o("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(([n])=>n).map(([,n])=>n),Ie=(e,s,r,t=[],n=[],a=[])=>{const u=new Set(e.map(i=>i.className)),m=e.map(i=>`${i.binding}/${i.className} (exported by worker entry)`);return s.needsD1&&m.push("DB (.global() table declared)"),m.push(..._e(t,n,a),...xe(r,u,s)),m},Ge=async e=>{await V;const s=e.schemaDir??"lunora",r=e.scanDirs??he,t=()=>Re(e.projectRoot,r,s),n=e.cache===void 0?t():e.cache.memo(`capabilities:${e.projectRoot}:${s}:${r.join(",")}`,t),a=re(e.projectRoot);let u;a.composed?u=oe(y(e.projectRoot,s,_)).map(I=>({binding:ne[I],className:I})):u=a.path===void 0?[]:ae(a.path);const m=Ae(e.projectRoot,s,e.cache),i={...m,needsD1:n.needsD1||m.needsD1},S=R(a,Q(e.projectRoot,s,e.cache).containers,"containers"),h=R(a,ce(e.projectRoot,s).workflows,"workflows"),E=R(a,X(e.projectRoot,s).agents,"agents"),v=[...le(e.projectRoot,s).queues],{flags:f}=de(e.projectRoot,s),A=x(e.projectRoot,s,Y,q),c=A.error===void 0?A.value:{hasFcm:!0,hasWebPush:!0},d=f?.provider==="flagship"&&f.mode==="binding"?f.bindingName:void 0,g=Ie(u,i,n,S,h,E);!a.composed&&ie(y(e.projectRoot,s,_))&&!u.some(p=>p.className==="LunoraDO")&&g.push("hint: durableObjects.merge is set, but the worker entry exports no LunoraDO — export one built with mergeDurableObjects, or the classes stay separate"),d!==void 0&&g.push(`hint: lunora/flags.ts uses Flagship in binding mode; add a flagship binding ({ binding: "${d}", app_id }) — the app_id can't be auto-provisioned`);const l=W(e.projectRoot),b=l.error===void 0?l.services:void 0;return l.error!==void 0&&g.push(`hint: lunora.config \`services\` not reconciled — ${l.error}`),g.push(...l.services.map(p=>`${p.binding} → ${p.worker} (lunora.config services.${p.name})`)),{...n,agents:E,containers:S,durableObjects:u,flagshipBinding:d,...i.jurisdiction===void 0?{}:{jurisdiction:i.jurisdiction},needsD1:i.needsD1,queues:v,services:b,signals:g,usesFlags:f!==void 0,usesNotifyFcm:c?.hasFcm??!1,usesNotifyWebPush:c?.hasWebPush??!1,workflows:h}},We=e=>[...N,...be].filter(([s,r])=>e[s]&&se[r]!==void 0).map(([,s])=>s);export{Ge as inferLunoraBindings,We as secretSourcesFromBindings};
@@ -1 +1 @@
1
- import{inferLunoraBindings as g}from"./inferLunoraBindings-BT4-fwiQ.mjs";import{LUNORA_TAG as r}from"./LUNORA_TAG-DQTGPqcJ.mjs";import{reconcileWranglerBindings as p}from"./HYPERDRIVE_PLACEHOLDER_ID-ChryQmwG.mjs";import{reconcileWranglerCompatibilityDate as $}from"./reconcileWranglerCompatibilityDate-hocXEuRA.mjs";import{reconcileWranglerCrons as m,describePreservedCrons as w}from"./describePreservedCrons-C5KPuPy3.mjs";const j=async(i,t,a)=>{try{const n=await g({projectRoot:i.projectRoot,schemaDir:i.schemaDir}),e=p(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:s,path:d,updated:f}=e.devConfig;t.info?.(`${r} dev sidecar bindings → ${[...s,...f].join(", ")} (written to ${d})`)}for(const s of e.warnings)t.warn(`${r} ${s}`);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}`)}},c=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 s of n.warnings)a.warn(`${r} ${s}`);const e=n.preserved.join("\0"),o=w(n.preserved);o!==void 0&&(n.changed||c.get(i)!==e)&&a.info?.(`${r} ${o}`),c.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=$(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-Ddx-f6eV.mjs";import{LUNORA_TAG as r}from"./LUNORA_TAG-DQTGPqcJ.mjs";import{reconcileWranglerBindings as p}from"./HYPERDRIVE_PLACEHOLDER_ID-DJGsqkww.mjs";import{reconcileWranglerCompatibilityDate as $}from"./reconcileWranglerCompatibilityDate-hocXEuRA.mjs";import{reconcileWranglerCrons as m,describePreservedCrons as w}from"./describePreservedCrons-C5KPuPy3.mjs";const j=async(i,t,a)=>{try{const n=await g({projectRoot:i.projectRoot,schemaDir:i.schemaDir}),e=p(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:s,path:d,updated:f}=e.devConfig;t.info?.(`${r} dev sidecar bindings → ${[...s,...f].join(", ")} (written to ${d})`)}for(const s of e.warnings)t.warn(`${r} ${s}`);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}`)}},c=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 s of n.warnings)a.warn(`${r} ${s}`);const e=n.preserved.join("\0"),o=w(n.preserved);o!==void 0&&(n.changed||c.get(i)!==e)&&a.info?.(`${r} ${o}`),c.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=$(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};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lunora/config",
3
- "version": "1.0.0-alpha.394",
3
+ "version": "1.0.0-alpha.395",
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",
@@ -1 +0,0 @@
1
- import{existsSync as O,statSync as P,readFileSync as F,readdirSync as k}from"node:fs";import{discoverFlags as L,FLAGS_FILENAME as B,discoverQueues as G,CAPABILITY_PROBES as $,readServiceBindings as W,discoverNotifyChannels as q,NOTIFY_FILENAME as Y,mayReadCapabilityContext as K,foldCapabilitySignals as C,capabilitiesUsedBy as U,sourceCapabilitySignals as M}from"@lunora/codegen";import{init as V}from"es-module-lexer";import{Project as H}from"ts-morph";import{discoverAgentInfo as X}from"./discoverAgentInfo-pqFMJBtJ.mjs";import{discoverContainerInfo as Q}from"./discoverContainerInfo-DzXr7Vm3.mjs";import{escapeRegExp as J}from"./DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";import{d as x}from"./discover-info-DC2MrAIM.mjs";import{relative as z,sep as Z,isAbsolute as ee,join as S}from"node:path";import{P as se}from"./package-secrets-registry-BEJELdls.mjs";import{discoverSchemaInfo as te}from"./discoverSchemaInfo-BBRlXZop.mjs";import{resolveWorkerEntry as re,composedEntryDurableObjects as oe,GENERATED_DIRECTORY as _,DURABLE_OBJECT_BINDINGS as ne,detectExportedDurableObjects as ae,detectClassExports as R,isMergedProject as ie}from"./COMPOSED_WORKER_ENTRY-Ciiba5g_.mjs";import{discoverWorkflowInfo as ce}from"./discoverWorkflowInfo-zW7Tt0Tn.mjs";const de=(e,s)=>{const{error:r,value:t}=x(e,s,B,L);return r===void 0?{flags:t}:{error:r}},ue=(e,s)=>{const r=z(s,e);return r!==""&&r!==".."&&!r.startsWith(`..${Z}`)&&!ee(r)},le=(e,s)=>{const{error:r,value:t}=x(e,s,void 0,G);return r===void 0?{queues:t??[]}:{error:r,queues:[]}},me=new Set([".cjs",".cts",".js",".jsx",".mjs",".mts",".ts",".tsx"]),pe=new Set([".git",".lunora-cache",".wrangler","dist",_,"node_modules"]),he=["lunora","src"],fe=/\benv\s*\.\s*DB\b/,ge=/\benv\s*\.\s*AI\b/,D=["ai","aiSearch","analytics","analyticsSql","artifacts","browser","hyperdrive","images","kv","mail","notify","payments","pipelines","r2sql","scheduler","storage","x402"],T=e=>`uses${e.charAt(0).toUpperCase()}${e.slice(1)}`,w=[["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"]],N=[...D.map(e=>[T(e),$[e].moduleSpecifier]),...w].toSorted(([e],[s])=>e.localeCompare(s)),Se=[["usesNotifyFcm","@lunora/notify:fcm"],["usesNotifyWebPush","@lunora/notify:webPush"],["usesRequestSecretTool","@lunora/agent:requestSecretTool"]],be=["@lunora/agent","@lunora/agent/sandbox"],ye=new RegExp(String.raw`["'\x60](?:${[...N.map(([,e])=>e),...be].map(e=>J(e)).join("|")})["'\x60]`,"u"),n=e=>{const{contextProperty:s,moduleSpecifier:r}=$[e];return s===void 0?`${r} is imported`:`${r} is imported or ctx.${s} is read`},ve="STRIPE_SECRET_KEY + STRIPE_WEBHOOK_SECRET (Stripe) or POLAR_ACCESS_TOKEN + POLAR_WEBHOOK_SECRET (Polar)",Ee=()=>{let e;return()=>(e??=new H({compilerOptions:{allowJs:!0},skipAddingFilesFromTsConfig:!0}),e)},Ae=/\bfrom\s+["']\.{1,2}\//u,Re=(e,s,r)=>{const t=r(),o=t.createSourceFile(s,e,{overwrite:!0}),a=M(o);return t.removeSourceFile(o),a},j=(e,s)=>{let r;try{r=k(e,{withFileTypes:!0})}catch{return}for(const t of r){if(t.isDirectory()){pe.has(t.name)||j(S(e,t.name),s);continue}const o=t.name.lastIndexOf(".");o!==-1&&me.has(t.name.slice(o))&&s.push(S(e,t.name))}},_e=(e,s,r)=>{const{info:t}=te(e,s,r);return{jurisdiction:t?.jurisdiction,needsD1:t?.hasD1GlobalTable??!1}},xe=(e,s,r)=>{const t=Ee(),o=S(e,r),a=[],d=[];let u=!1,i=!1;for(const l of s){const h=S(e,l);if(!O(h)||!P(h).isDirectory())continue;const f=[];j(h,f);for(const m of f){const c=F(m,"utf8"),A=ue(m,o);u||=ge.test(c),i||=fe.test(c),(ye.test(c)||A&&(K(c)||Ae.test(c)))&&(A?a:d).push(Re(c,m,t))}}const p=C(a),b=C([p,...d]),y=new Set([...b.valueImports,...b.dynamicImports]),v=U({contextReads:p.contextReads,valueImports:y});return{...Object.fromEntries([...D.map(l=>[T(l),v.has(l)]),...w.map(([l,h])=>[l,y.has(h)])]),needsD1:i,usesRequestSecretTool:p.requestSecretTool,usesAi:v.has("ai")||u,usesBrowser:v.has("browser")||p.sandboxTools.usesSandboxBrowser,usesWorkerLoader:p.sandboxTools.usesSandboxLoader}},Ie=(e,s,r)=>[...e.map(t=>t.exported?`${t.bindingName}/${t.className} (container "${t.exportName}" declared and exported)`:`hint: container "${t.exportName}" is declared but ${t.className} is not exported by the worker entry — add \`export * from "./lunora/_generated/containers"\``),...s.map(t=>t.exported?`exports.${t.className} (workflow "${t.exportName}" declared and exported)`:`hint: workflow "${t.exportName}" is declared but ${t.className} is not exported by the worker entry — add \`export * from "./lunora/_generated/workflows"\``),...r.map(t=>t.exported?`exports.${t.className} (agent "${t.exportName}" declared and exported)`:`hint: agent "${t.exportName}" is declared but ${t.className} is not exported by the worker entry — add \`export * from "./lunora/_generated/agents"\``)],Ce=(e,s,r)=>[[e.usesAi,`AI (${n("ai")}, or env.AI is used)`],[e.usesAuth&&!s.has("SessionDO"),"hint: @lunora/auth is imported; its tables are D1-backed by default. For DO-backed auth (what @better-auth/scim needs), pass `namespace` to .auth() and export the generated auth DO class"],[e.usesScheduler&&!s.has("SchedulerDO"),`hint: ${n("scheduler")}, but no SchedulerDO is exported by the worker entry`],[e.usesStorage,`hint: ${n("storage")}; add an r2_buckets binding (bucket binding names are user-defined)`],[e.usesMail,`hint: ${n("mail")}; set RESEND_API_KEY in .dev.vars (obtain at https://resend.com/api-keys)`],[e.usesPayments,`hint: ${n("payments")}; set the provider secrets in .dev.vars — ${ve}`],[e.usesBrowser,`browser (${n("browser")}, or a sandbox browserTool imported in lunora/) — self-describing { binding: BROWSER }`],[e.usesImages,`images (${n("images")}) — self-describing { binding: IMAGES }`],[e.usesAnalytics,`analytics_engine_datasets (${n("analytics")}) — self-describing { binding: ANALYTICS, dataset }`],[e.usesWorkerLoader,"worker_loaders (jsCodeTool imported in lunora/) — self-describing { binding: LOADER }"],[e.usesAiSearch,`ai_search_namespaces (${n("aiSearch")}) — self-describing { binding: AI_SEARCH, namespace: "default" }; remote-only, so \`lunora dev\` reaches the deployed AI Search service`],[e.usesAnalyticsSql,`analytics (${n("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,r.jurisdiction===void 0?`kv_namespaces (${n("kv")}) — { binding: KV } with no id; wrangler creates the namespace on the first deploy`:`hint: ${n("kv")} and the schema pins "${r.jurisdiction}"; create the namespace with --jurisdiction ${r.jurisdiction} and add a kv_namespaces binding ({ binding, id })`],[e.usesHyperdrive,`hyperdrive (${n("hyperdrive")}) — { binding: HYPERDRIVE } with a placeholder id; dev uses an embedded Postgres and \`lunora deploy\` creates the config`],[e.usesPipelines,`hint: ${n("pipelines")}; run 'wrangler pipelines create <name>' and add a 'pipelines' binding ({ binding, stream }) — the pipeline resource can't be auto-provisioned`],[e.usesArtifacts,r.jurisdiction===void 0?`artifacts (${n("artifacts")}) — { binding: ARTIFACTS, namespace }`:`hint: ${n("artifacts")}; the schema pins data to "${r.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: ${n("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(([o])=>o).map(([,o])=>o),$e=(e,s,r,t=[],o=[],a=[])=>{const d=new Set(e.map(i=>i.className)),u=e.map(i=>`${i.binding}/${i.className} (exported by worker entry)`);return s.needsD1&&u.push("DB (.global() table declared)"),u.push(...Ie(t,o,a),...Ce(r,d,s)),u},qe=async e=>{await V;const s=e.schemaDir??"lunora",r=e.scanDirs??he,t=()=>xe(e.projectRoot,r,s),o=e.cache===void 0?t():e.cache.memo(`capabilities:${e.projectRoot}:${s}:${r.join(",")}`,t),a=re(e.projectRoot);let d;a.composed?d=oe(S(e.projectRoot,s,_)).map(I=>({binding:ne[I],className:I})):d=a.path===void 0?[]:ae(a.path);const u=_e(e.projectRoot,s,e.cache),i={...u,needsD1:o.needsD1||u.needsD1},p=R(a,Q(e.projectRoot,s,e.cache).containers,"containers"),b=R(a,ce(e.projectRoot,s).workflows,"workflows"),y=R(a,X(e.projectRoot,s).agents,"agents"),v=[...le(e.projectRoot,s).queues],{flags:E}=de(e.projectRoot,s),l=x(e.projectRoot,s,Y,q),h=l.error===void 0?l.value:{hasFcm:!0,hasWebPush:!0},f=E?.provider==="flagship"&&E.mode==="binding"?E.bindingName:void 0,m=$e(d,i,o,p,b,y);!a.composed&&ie(S(e.projectRoot,s,_))&&!d.some(g=>g.className==="LunoraDO")&&m.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&&m.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 c=W(e.projectRoot),A=c.error===void 0?c.services:void 0;return c.error!==void 0&&m.push(`hint: lunora.config \`services\` not reconciled — ${c.error}`),m.push(...c.services.map(g=>`${g.binding} → ${g.worker} (lunora.config services.${g.name})`)),{...o,agents:y,containers:p,durableObjects:d,flagshipBinding:f,...i.jurisdiction===void 0?{}:{jurisdiction:i.jurisdiction},needsD1:i.needsD1,queues:v,services:A,signals:m,usesFlags:E!==void 0,usesNotifyFcm:h?.hasFcm??!1,usesNotifyWebPush:h?.hasWebPush??!1,workflows:b}},Ye=e=>[...N,...Se].filter(([s,r])=>e[s]&&se[r]!==void 0).map(([,s])=>s);export{qe as inferLunoraBindings,Ye as secretSourcesFromBindings};