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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { D as DeployDriver, G as GeneratedClassModule, I as InferredBindings, S as SchemaInfo } from "../packem_shared/schema-info.d-C3DeuUmC.mjs";
1
+ import { D as DeployDriver, G as GeneratedClassModule, I as InferredBindings, S as SchemaInfo } from "../packem_shared/schema-info.d-DamDrltc.mjs";
2
2
  import { WranglerVariableIR } from '@lunora/codegen';
3
3
  /** Apply one structural jsonc edit and return the rewritten text (a no-op edit returns the input). */
4
4
  declare const applyModify: (text: string, path: ReadonlyArray<number | string>, value: unknown) => string;
@@ -1,4 +1,4 @@
1
- import { D as DeployDriver, G as GeneratedClassModule, I as InferredBindings, S as SchemaInfo } from "../packem_shared/schema-info.d-C3DeuUmC.js";
1
+ import { D as DeployDriver, G as GeneratedClassModule, I as InferredBindings, S as SchemaInfo } from "../packem_shared/schema-info.d-DamDrltc.js";
2
2
  import { WranglerVariableIR } from '@lunora/codegen';
3
3
  /** Apply one structural jsonc edit and return the rewritten text (a no-op edit returns the input). */
4
4
  declare const applyModify: (text: string, path: ReadonlyArray<number | string>, value: unknown) => string;
@@ -1 +1 @@
1
- import{applyModify as o}from"../packem_shared/applyModify-DKP2l6S9.mjs";import{assertWranglerSatisfiesSchema as n}from"../packem_shared/assertWranglerSatisfiesSchema-B24XPKq7.mjs";import{BINDING_MANIFEST_VERSION as t,buildBindingManifest as i}from"../packem_shared/BINDING_MANIFEST_VERSION-B4Tu8Ytd.mjs";import{default as E}from"../packem_shared/CLOUDFLARE_DRIVER-DUE6r-Pg.mjs";import{collectExportGaps as s,reconcileWranglerBindings as c}from"../packem_shared/collectExportGaps-DUaEyDNw.mjs";import{reconcileWranglerCompatibilityDate as p}from"../packem_shared/reconcileWranglerCompatibilityDate-hocXEuRA.mjs";import{describePreservedCrons as x,reconcileWranglerCrons as d}from"../packem_shared/describePreservedCrons-Ci5r2aph.mjs";import{reconcileBindingsSafely as I,reconcileWranglerExtras as _}from"../packem_shared/reconcileBindingsSafely-Zi2HVRkH.mjs";import{REMOTE_ELIGIBLE_KEYS as S,injectRemoteFlags as A,isRemoteEnvEnabled as D,materializeRemoteWranglerConfig as L,planRemoteBindings as T,resolveRemoteEnabled as b}from"../packem_shared/REMOTE_ELIGIBLE_KEYS-D72UkJEq.mjs";import{withTailConsumer as B}from"../packem_shared/withTailConsumer-DaP3r6ia.mjs";import{WORKERS_CACHE_MIN_DATE as M,isCacheEnabled as N}from"../packem_shared/WORKERS_CACHE_MIN_DATE-0k9ABJtF.mjs";import{mergeWranglerEnvironment as y}from"../packem_shared/mergeWranglerEnvironment-BIcLqPfv.mjs";import{WRANGLER_FILES as h,findWranglerFile as P,readWranglerJsonc as U}from"../packem_shared/WRANGLER_FILES-UNW-xY5u.mjs";import{UNEXPORTED_CLASS_MARKER as u,validateWranglerProject as K}from"../packem_shared/UNEXPORTED_CLASS_MARKER-Bc302QS4.mjs";import{collectWranglerSecretVariables as w,scanWranglerVariablesForSecrets as Q}from"../packem_shared/collectWranglerSecretVariables-D-usPfT8.mjs";import{wranglerToAlchemy as z}from"../packem_shared/wranglerToAlchemy-DZOim9As.mjs";import{REQUIRED_COMPATIBILITY_DATE as J,REQUIRED_FLAG as X,validateWrangler as k,validateWranglerConfig as q}from"../packem_shared/REQUIRED_COMPATIBILITY_DATE-g_1F-n2X.mjs";export{t as BINDING_MANIFEST_VERSION,E as CLOUDFLARE_DRIVER,S as REMOTE_ELIGIBLE_KEYS,J as REQUIRED_COMPATIBILITY_DATE,X as REQUIRED_FLAG,u as UNEXPORTED_CLASS_MARKER,M as WORKERS_CACHE_MIN_DATE,h as WRANGLER_FILES,o as applyModify,n as assertWranglerSatisfiesSchema,i as buildBindingManifest,s as collectExportGaps,w as collectWranglerSecretVariables,x as describePreservedCrons,P as findWranglerFile,A as injectRemoteFlags,N as isCacheEnabled,D as isRemoteEnvEnabled,L as materializeRemoteWranglerConfig,y as mergeWranglerEnvironment,T as planRemoteBindings,U as readWranglerJsonc,I as reconcileBindingsSafely,c as reconcileWranglerBindings,p as reconcileWranglerCompatibilityDate,d as reconcileWranglerCrons,_ as reconcileWranglerExtras,b as resolveRemoteEnabled,Q as scanWranglerVariablesForSecrets,k as validateWrangler,q as validateWranglerConfig,K as validateWranglerProject,B as withTailConsumer,z as wranglerToAlchemy};
1
+ import{applyModify as o}from"../packem_shared/applyModify-DKP2l6S9.mjs";import{assertWranglerSatisfiesSchema as n}from"../packem_shared/assertWranglerSatisfiesSchema-c7577QR3.mjs";import{BINDING_MANIFEST_VERSION as t,buildBindingManifest as i}from"../packem_shared/BINDING_MANIFEST_VERSION-B4Tu8Ytd.mjs";import{default as E}from"../packem_shared/CLOUDFLARE_DRIVER-DUE6r-Pg.mjs";import{collectExportGaps as s,reconcileWranglerBindings as c}from"../packem_shared/collectExportGaps-DUaEyDNw.mjs";import{reconcileWranglerCompatibilityDate as p}from"../packem_shared/reconcileWranglerCompatibilityDate-hocXEuRA.mjs";import{describePreservedCrons as x,reconcileWranglerCrons as d}from"../packem_shared/describePreservedCrons-Ci5r2aph.mjs";import{reconcileBindingsSafely as I,reconcileWranglerExtras as _}from"../packem_shared/reconcileBindingsSafely-BYFuD4MB.mjs";import{REMOTE_ELIGIBLE_KEYS as S,injectRemoteFlags as A,isRemoteEnvEnabled as D,materializeRemoteWranglerConfig as L,planRemoteBindings as T,resolveRemoteEnabled as b}from"../packem_shared/REMOTE_ELIGIBLE_KEYS-D72UkJEq.mjs";import{withTailConsumer as B}from"../packem_shared/withTailConsumer-DaP3r6ia.mjs";import{WORKERS_CACHE_MIN_DATE as M,isCacheEnabled as N}from"../packem_shared/WORKERS_CACHE_MIN_DATE-0k9ABJtF.mjs";import{mergeWranglerEnvironment as y}from"../packem_shared/mergeWranglerEnvironment-BIcLqPfv.mjs";import{WRANGLER_FILES as h,findWranglerFile as P,readWranglerJsonc as U}from"../packem_shared/WRANGLER_FILES-UNW-xY5u.mjs";import{UNEXPORTED_CLASS_MARKER as u,validateWranglerProject as K}from"../packem_shared/UNEXPORTED_CLASS_MARKER-D3aUWNly.mjs";import{collectWranglerSecretVariables as w,scanWranglerVariablesForSecrets as Q}from"../packem_shared/collectWranglerSecretVariables-D-usPfT8.mjs";import{wranglerToAlchemy as z}from"../packem_shared/wranglerToAlchemy-DZOim9As.mjs";import{REQUIRED_COMPATIBILITY_DATE as J,REQUIRED_FLAG as X,validateWrangler as k,validateWranglerConfig as q}from"../packem_shared/REQUIRED_COMPATIBILITY_DATE-g_1F-n2X.mjs";export{t as BINDING_MANIFEST_VERSION,E as CLOUDFLARE_DRIVER,S as REMOTE_ELIGIBLE_KEYS,J as REQUIRED_COMPATIBILITY_DATE,X as REQUIRED_FLAG,u as UNEXPORTED_CLASS_MARKER,M as WORKERS_CACHE_MIN_DATE,h as WRANGLER_FILES,o as applyModify,n as assertWranglerSatisfiesSchema,i as buildBindingManifest,s as collectExportGaps,w as collectWranglerSecretVariables,x as describePreservedCrons,P as findWranglerFile,A as injectRemoteFlags,N as isCacheEnabled,D as isRemoteEnvEnabled,L as materializeRemoteWranglerConfig,y as mergeWranglerEnvironment,T as planRemoteBindings,U as readWranglerJsonc,I as reconcileBindingsSafely,c as reconcileWranglerBindings,p as reconcileWranglerCompatibilityDate,d as reconcileWranglerCrons,_ as reconcileWranglerExtras,b as resolveRemoteEnabled,Q as scanWranglerVariablesForSecrets,k as validateWrangler,q as validateWranglerConfig,K as validateWranglerProject,B as withTailConsumer,z as wranglerToAlchemy};
package/dist/index.d.mts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { AgentIR, ContainerIR, WorkflowIR, CodegenResult } from '@lunora/codegen';
2
2
  export type { AgentIR, ContainerIR, WorkflowIR } from '@lunora/codegen';
3
3
  import { Writable } from 'node:stream';
4
- import { T as ToolchainCommand, D as DeployDriver, P as ProjectionPurpose } from "./packem_shared/schema-info.d-C3DeuUmC.mjs";
5
- export { C as COMPOSED_WORKER_ENTRY, type a as DeployRequest, type b as DevRequest, type c as DiscoverSchemaInfoResult, type d as DriverToolchain, e as GENERATED_CLASS_MODULES, type G as GeneratedClassModule, type f as InferOptions, type g as InferredAgent, type I as InferredBindings, type h as InferredContainer, type i as InferredWorkflow, type j as ProjectedConfig, type S as SchemaInfo, type k as SecretRequest, type l as TailRequest, m as discoverSchemaInfo, n as inferLunoraBindings, p as packageNamesFromBindings } from "./packem_shared/schema-info.d-C3DeuUmC.mjs";
4
+ import { T as ToolchainCommand, D as DeployDriver, P as ProjectionPurpose } from "./packem_shared/schema-info.d-DamDrltc.mjs";
5
+ export { C as COMPOSED_WORKER_ENTRY, type a as DeployRequest, type b as DevRequest, type c as DiscoverSchemaInfoResult, type d as DriverToolchain, e as GENERATED_CLASS_MODULES, type G as GeneratedClassModule, type f as InferOptions, type g as InferredAgent, type I as InferredBindings, type h as InferredContainer, type i as InferredWorkflow, type j as ProjectedConfig, type S as SchemaInfo, type k as SecretRequest, type l as TailRequest, m as discoverSchemaInfo, n as inferLunoraBindings, p as packageNamesFromBindings } from "./packem_shared/schema-info.d-DamDrltc.mjs";
6
6
  export { type A as AdditivePolicyEdit, type D as DestructivePolicyEdit, type P as PolicyEdit, type a as PolicyScaffoldFailureReason, type b as ScaffoldFileResult, type S as ScaffoldPolicyEdit, type c as WireResult, type W as WireRlsEdit, d as classifyPolicyEdit, r as resolveServerModule, s as scaffoldPolicyFile, w as wireRlsIntoProcedure } from "./packem_shared/policy-scaffold.d-D2H4_G01.mjs";
7
7
  interface DiscoverAgentInfoResult {
8
8
  /** Discovered agent definitions; `[]` when none are declared or parsing failed. */
package/dist/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { AgentIR, ContainerIR, WorkflowIR, CodegenResult } from '@lunora/codegen';
2
2
  export type { AgentIR, ContainerIR, WorkflowIR } from '@lunora/codegen';
3
3
  import { Writable } from 'node:stream';
4
- import { T as ToolchainCommand, D as DeployDriver, P as ProjectionPurpose } from "./packem_shared/schema-info.d-C3DeuUmC.js";
5
- export { C as COMPOSED_WORKER_ENTRY, type a as DeployRequest, type b as DevRequest, type c as DiscoverSchemaInfoResult, type d as DriverToolchain, e as GENERATED_CLASS_MODULES, type G as GeneratedClassModule, type f as InferOptions, type g as InferredAgent, type I as InferredBindings, type h as InferredContainer, type i as InferredWorkflow, type j as ProjectedConfig, type S as SchemaInfo, type k as SecretRequest, type l as TailRequest, m as discoverSchemaInfo, n as inferLunoraBindings, p as packageNamesFromBindings } from "./packem_shared/schema-info.d-C3DeuUmC.js";
4
+ import { T as ToolchainCommand, D as DeployDriver, P as ProjectionPurpose } from "./packem_shared/schema-info.d-DamDrltc.js";
5
+ export { C as COMPOSED_WORKER_ENTRY, type a as DeployRequest, type b as DevRequest, type c as DiscoverSchemaInfoResult, type d as DriverToolchain, e as GENERATED_CLASS_MODULES, type G as GeneratedClassModule, type f as InferOptions, type g as InferredAgent, type I as InferredBindings, type h as InferredContainer, type i as InferredWorkflow, type j as ProjectedConfig, type S as SchemaInfo, type k as SecretRequest, type l as TailRequest, m as discoverSchemaInfo, n as inferLunoraBindings, p as packageNamesFromBindings } from "./packem_shared/schema-info.d-DamDrltc.js";
6
6
  export { type A as AdditivePolicyEdit, type D as DestructivePolicyEdit, type P as PolicyEdit, type a as PolicyScaffoldFailureReason, type b as ScaffoldFileResult, type S as ScaffoldPolicyEdit, type c as WireResult, type W as WireRlsEdit, d as classifyPolicyEdit, r as resolveServerModule, s as scaffoldPolicyFile, w as wireRlsIntoProcedure } from "./packem_shared/policy-scaffold.d-D2H4_G01.js";
7
7
  interface DiscoverAgentInfoResult {
8
8
  /** Discovered agent definitions; `[]` when none are declared or parsing failed. */
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{AGENT_MODE_ENV as o,detectAiAgent as t}from"./packem_shared/AGENT_MODE_ENV-D8MvSwPE.mjs";import{discoverAgentInfo as E}from"./packem_shared/discoverAgentInfo-CTdCSfYM.mjs";import{AGENT_RULES_DIR as s,AGENT_RULES_HINT as n,AGENT_RULES_HINT_ENV as l,LUNORA_SKILL_NAMES as _,ROOT_SKILL_NAME as p,claimAgentRulesHint as c,detectAgentRules as d}from"./packem_shared/AGENT_RULES_DIR-C54Ta_vz.mjs";import{CODEGEN_ENV as D,isCodegenDisabled as m}from"./packem_shared/CODEGEN_ENV-ZsCxV1kP.mjs";import{discoverContainerInfo as f}from"./packem_shared/discoverContainerInfo-EhZtEBQs.mjs";import{streamContainerLogs as v}from"./packem_shared/streamContainerLogs-0nko1qpv.mjs";import{detectFramework as R,projectUsesUmbrella as g,readProjectDependencyNames as T}from"./packem_shared/detectFramework-CUiVEHDQ.mjs";import{DEV_BINDINGS_FILE as x,DEV_DAEMON_ENV as I,DEV_HANDOFF_ENV as u,DEV_LOG_FILE as O,DEV_LOG_FILE_ENV as P,DEV_STATE_DIR as F,DEV_STATE_FILE as C,claimDevServerState as U,clearDevServerState as G,isDevServerReady as b,isProcessAlive as M,isRecordedProcessCurrent as y,readDevServerState as k,readLiveDevServerState as B,updateDevServerState as K,writeDevServerState as w}from"./packem_shared/DEV_BINDINGS_FILE-pyOiNLP4.mjs";import{DEV_VARS_EXAMPLE_FILE as j,DEV_VARS_FILE as H,DEV_VARS_KEY_PATTERN as W,escapeRegExp as Y,parseDevVariableEntries as J,removeDevVariableLine as q,upsertDevVariableLine as X}from"./packem_shared/DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";import{DEV_WORKER_ENV_VALUE as Q,DEV_WORKER_ENV_VAR as Z,ensureDevWorkerEnv as $}from"./packem_shared/DEV_WORKER_ENV_VALUE-DwGANZVw.mjs";import{DEFAULT_DEPLOY_TARGET as re,deployTargetIds as oe,isRunnableTarget as te,planToolchainInvocation as ae,resolveDeployDriver as Ee,runnableTargetIds as ie,targetRunsOwnDevServer as se}from"./packem_shared/DEFAULT_DEPLOY_TARGET-CtEZtsUF.mjs";import{inferLunoraBindings as le,packageNamesFromBindings as _e}from"./packem_shared/inferLunoraBindings-GaAITuz-.mjs";import{LINKED_PROJECT_DIR as ce,LINKED_PROJECT_FILE as de,readLinkedProject as Ae,writeLinkedProject as De}from"./packem_shared/LINKED_PROJECT_DIR-Ba5qPEwo.mjs";import{LUNORA_IGNORED_PATHS as Se,applyLintIgnores as fe,detectLintTools as Le}from"./packem_shared/LUNORA_IGNORED_PATHS-B0-PPvRp.mjs";import{LUNORA_TAG as Ne,advisoryLine as Re,blockingFindingsMessage as ge,lunoraLine as Te,reportCodegenFindings as Ve}from"./packem_shared/LUNORA_TAG-CiQM3BkI.mjs";import{LUNORA_EVENT_SOURCE as Ie,formatLunoraEvent as ue}from"./packem_shared/LUNORA_EVENT_SOURCE-DYdcDU9G.mjs";import{default as Pe}from"./packem_shared/LunoraReporter-f277GLNT.mjs";import{addArgsFor as Ce,detectInstalledManagers as Ue,detectPackageManager as Ge,execArgsFor as be,installArgsFor as Me,runScriptArgsFor as ye,runScriptCommand as ke,toolchainExecArgs as Be}from"./packem_shared/addArgsFor-CYZKhNIo.mjs";import{P as we,s as he}from"./packem_shared/package-secrets-registry-DvtTiK4b.mjs";import{runPostCodegenHook as He}from"./packem_shared/runPostCodegenHook-B0T1q2YI.mjs";import{interpretRemote as Ye,readProjectRemotePreference as Je,readProjectTarget as qe,resolveProjectTarget as Xe,resolveTargetOrThrow as ze}from"./packem_shared/interpretRemote-Da32GcUi.mjs";import{createConfirm as Ze,isInteractive as $e,promptMultiSelect as er,promptSelect as rr,promptText as or,promptYesNo as tr}from"./packem_shared/createConfirm-D5mKTMHj.mjs";import{buildPackageSecretsBlock as Er,ensureDevVariables as ir,ensureDevVarsExample as sr,fillDevSecrets as nr,generateSecretValue as lr,isMintableSecretKey as _r,isPlaceholderValue as pr,planDevSecretsFill as cr,planDevVariablesAugment as dr,planDevVariablesScaffold as Ar,requiredSecrets as Dr,writeDevVariablesFileAtomically as mr}from"./packem_shared/buildPackageSecretsBlock-yv9mjKEW.mjs";import{applyAdditiveEdit as fr,classifyEdit as Lr}from"./packem_shared/applyAdditiveEdit-CH0VhMJ2.mjs";import{parseSchema as Nr}from"./packem_shared/parseSchema-D1Wbr1qv.mjs";import{classifyPolicyEdit as gr,resolveServerModule as Tr,scaffoldPolicyFile as Vr,wireRlsIntoProcedure as xr}from"./packem_shared/classifyPolicyEdit-D8NwrHxR.mjs";import{discoverSchemaInfo as ur}from"./packem_shared/discoverSchemaInfo-DJvevsCm.mjs";import{ACCENT as Pr,BADGES as Fr,BADGE_COLUMN_WIDTH as Cr,LUNA_ART as Ur,LUNA_BUNNY as Gr,LUNA_NAME as br,LUNA_SIGNOFF as Mr,STEP_BADGE_NAMES as yr,badgeLead as kr,badgeWidth as Br,padBadge as Kr,paintAnswer as wr,paintBadge as hr}from"./packem_shared/ACCENT-CotPTfv7.mjs";import{COMPOSED_WORKER_ENTRY as Hr,GENERATED_CLASS_MODULES as Wr}from"./packem_shared/COMPOSED_WORKER_ENTRY-5R-BECOC.mjs";import{discoverWorkflowInfo as Jr}from"./packem_shared/discoverWorkflowInfo-BsPvlo6O.mjs";export{Pr as ACCENT,o as AGENT_MODE_ENV,s as AGENT_RULES_DIR,n as AGENT_RULES_HINT,l as AGENT_RULES_HINT_ENV,Fr as BADGES,Cr as BADGE_COLUMN_WIDTH,D as CODEGEN_ENV,Hr as COMPOSED_WORKER_ENTRY,re as DEFAULT_DEPLOY_TARGET,x as DEV_BINDINGS_FILE,I as DEV_DAEMON_ENV,u as DEV_HANDOFF_ENV,O as DEV_LOG_FILE,P as DEV_LOG_FILE_ENV,F as DEV_STATE_DIR,C as DEV_STATE_FILE,j as DEV_VARS_EXAMPLE_FILE,H as DEV_VARS_FILE,W as DEV_VARS_KEY_PATTERN,Q as DEV_WORKER_ENV_VALUE,Z as DEV_WORKER_ENV_VAR,Wr as GENERATED_CLASS_MODULES,ce as LINKED_PROJECT_DIR,de as LINKED_PROJECT_FILE,Ur as LUNA_ART,Gr as LUNA_BUNNY,br as LUNA_NAME,Mr as LUNA_SIGNOFF,Ie as LUNORA_EVENT_SOURCE,Se as LUNORA_IGNORED_PATHS,_ as LUNORA_SKILL_NAMES,Ne as LUNORA_TAG,Pe as LunoraReporter,we as PACKAGE_SECRETS_REGISTRY,p as ROOT_SKILL_NAME,yr as STEP_BADGE_NAMES,Ce as addArgsFor,Re as advisoryLine,fr as applyAdditiveEdit,fe as applyLintIgnores,kr as badgeLead,Br as badgeWidth,ge as blockingFindingsMessage,Er as buildPackageSecretsBlock,c as claimAgentRulesHint,U as claimDevServerState,Lr as classifyEdit,gr as classifyPolicyEdit,G as clearDevServerState,Ze as createConfirm,oe as deployTargetIds,d as detectAgentRules,t as detectAiAgent,R as detectFramework,Ue as detectInstalledManagers,Le as detectLintTools,Ge as detectPackageManager,E as discoverAgentInfo,f as discoverContainerInfo,ur as discoverSchemaInfo,Jr as discoverWorkflowInfo,ir as ensureDevVariables,sr as ensureDevVarsExample,$ as ensureDevWorkerEnv,Y as escapeRegExp,be as execArgsFor,nr as fillDevSecrets,ue as formatLunoraEvent,lr as generateSecretValue,le as inferLunoraBindings,Me as installArgsFor,Ye as interpretRemote,m as isCodegenDisabled,b as isDevServerReady,$e as isInteractive,_r as isMintableSecretKey,pr as isPlaceholderValue,M as isProcessAlive,y as isRecordedProcessCurrent,te as isRunnableTarget,Te as lunoraLine,_e as packageNamesFromBindings,Kr as padBadge,wr as paintAnswer,hr as paintBadge,J as parseDevVariableEntries,Nr as parseSchema,cr as planDevSecretsFill,dr as planDevVariablesAugment,Ar as planDevVariablesScaffold,ae as planToolchainInvocation,g as projectUsesUmbrella,er as promptMultiSelect,rr as promptSelect,or as promptText,tr as promptYesNo,k as readDevServerState,Ae as readLinkedProject,B as readLiveDevServerState,T as readProjectDependencyNames,Je as readProjectRemotePreference,qe as readProjectTarget,q as removeDevVariableLine,Ve as reportCodegenFindings,Dr as requiredSecrets,Ee as resolveDeployDriver,Xe as resolveProjectTarget,Tr as resolveServerModule,ze as resolveTargetOrThrow,He as runPostCodegenHook,ye as runScriptArgsFor,ke as runScriptCommand,ie as runnableTargetIds,Vr as scaffoldPolicyFile,he as secretsForPackages,v as streamContainerLogs,se as targetRunsOwnDevServer,Be as toolchainExecArgs,K as updateDevServerState,X as upsertDevVariableLine,xr as wireRlsIntoProcedure,w as writeDevServerState,mr as writeDevVariablesFileAtomically,De as writeLinkedProject};
1
+ import{AGENT_MODE_ENV as o,detectAiAgent as t}from"./packem_shared/AGENT_MODE_ENV-D8MvSwPE.mjs";import{discoverAgentInfo as E}from"./packem_shared/discoverAgentInfo-CTdCSfYM.mjs";import{AGENT_RULES_DIR as s,AGENT_RULES_HINT as n,AGENT_RULES_HINT_ENV as l,LUNORA_SKILL_NAMES as _,ROOT_SKILL_NAME as p,claimAgentRulesHint as c,detectAgentRules as d}from"./packem_shared/AGENT_RULES_DIR-C54Ta_vz.mjs";import{CODEGEN_ENV as D,isCodegenDisabled as m}from"./packem_shared/CODEGEN_ENV-ZsCxV1kP.mjs";import{discoverContainerInfo as f}from"./packem_shared/discoverContainerInfo-EhZtEBQs.mjs";import{streamContainerLogs as v}from"./packem_shared/streamContainerLogs-0nko1qpv.mjs";import{detectFramework as R,projectUsesUmbrella as g,readProjectDependencyNames as T}from"./packem_shared/detectFramework-CUiVEHDQ.mjs";import{DEV_BINDINGS_FILE as x,DEV_DAEMON_ENV as I,DEV_HANDOFF_ENV as u,DEV_LOG_FILE as O,DEV_LOG_FILE_ENV as P,DEV_STATE_DIR as F,DEV_STATE_FILE as C,claimDevServerState as U,clearDevServerState as G,isDevServerReady as b,isProcessAlive as M,isRecordedProcessCurrent as y,readDevServerState as k,readLiveDevServerState as B,updateDevServerState as K,writeDevServerState as w}from"./packem_shared/DEV_BINDINGS_FILE-pyOiNLP4.mjs";import{DEV_VARS_EXAMPLE_FILE as j,DEV_VARS_FILE as H,DEV_VARS_KEY_PATTERN as W,escapeRegExp as Y,parseDevVariableEntries as J,removeDevVariableLine as q,upsertDevVariableLine as X}from"./packem_shared/DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";import{DEV_WORKER_ENV_VALUE as Q,DEV_WORKER_ENV_VAR as Z,ensureDevWorkerEnv as $}from"./packem_shared/DEV_WORKER_ENV_VALUE-DwGANZVw.mjs";import{DEFAULT_DEPLOY_TARGET as re,deployTargetIds as oe,isRunnableTarget as te,planToolchainInvocation as ae,resolveDeployDriver as Ee,runnableTargetIds as ie,targetRunsOwnDevServer as se}from"./packem_shared/DEFAULT_DEPLOY_TARGET-CtEZtsUF.mjs";import{inferLunoraBindings as le,packageNamesFromBindings as _e}from"./packem_shared/inferLunoraBindings-DTiYSVS2.mjs";import{LINKED_PROJECT_DIR as ce,LINKED_PROJECT_FILE as de,readLinkedProject as Ae,writeLinkedProject as De}from"./packem_shared/LINKED_PROJECT_DIR-Ba5qPEwo.mjs";import{LUNORA_IGNORED_PATHS as Se,applyLintIgnores as fe,detectLintTools as Le}from"./packem_shared/LUNORA_IGNORED_PATHS-B0-PPvRp.mjs";import{LUNORA_TAG as Ne,advisoryLine as Re,blockingFindingsMessage as ge,lunoraLine as Te,reportCodegenFindings as Ve}from"./packem_shared/LUNORA_TAG-CiQM3BkI.mjs";import{LUNORA_EVENT_SOURCE as Ie,formatLunoraEvent as ue}from"./packem_shared/LUNORA_EVENT_SOURCE-DYdcDU9G.mjs";import{default as Pe}from"./packem_shared/LunoraReporter-f277GLNT.mjs";import{addArgsFor as Ce,detectInstalledManagers as Ue,detectPackageManager as Ge,execArgsFor as be,installArgsFor as Me,runScriptArgsFor as ye,runScriptCommand as ke,toolchainExecArgs as Be}from"./packem_shared/addArgsFor-CYZKhNIo.mjs";import{P as we,s as he}from"./packem_shared/package-secrets-registry-DvtTiK4b.mjs";import{runPostCodegenHook as He}from"./packem_shared/runPostCodegenHook-B0T1q2YI.mjs";import{interpretRemote as Ye,readProjectRemotePreference as Je,readProjectTarget as qe,resolveProjectTarget as Xe,resolveTargetOrThrow as ze}from"./packem_shared/interpretRemote-Da32GcUi.mjs";import{createConfirm as Ze,isInteractive as $e,promptMultiSelect as er,promptSelect as rr,promptText as or,promptYesNo as tr}from"./packem_shared/createConfirm-D5mKTMHj.mjs";import{buildPackageSecretsBlock as Er,ensureDevVariables as ir,ensureDevVarsExample as sr,fillDevSecrets as nr,generateSecretValue as lr,isMintableSecretKey as _r,isPlaceholderValue as pr,planDevSecretsFill as cr,planDevVariablesAugment as dr,planDevVariablesScaffold as Ar,requiredSecrets as Dr,writeDevVariablesFileAtomically as mr}from"./packem_shared/buildPackageSecretsBlock-yv9mjKEW.mjs";import{applyAdditiveEdit as fr,classifyEdit as Lr}from"./packem_shared/applyAdditiveEdit-CH0VhMJ2.mjs";import{parseSchema as Nr}from"./packem_shared/parseSchema-D1Wbr1qv.mjs";import{classifyPolicyEdit as gr,resolveServerModule as Tr,scaffoldPolicyFile as Vr,wireRlsIntoProcedure as xr}from"./packem_shared/classifyPolicyEdit-D8NwrHxR.mjs";import{discoverSchemaInfo as ur}from"./packem_shared/discoverSchemaInfo-DJvevsCm.mjs";import{ACCENT as Pr,BADGES as Fr,BADGE_COLUMN_WIDTH as Cr,LUNA_ART as Ur,LUNA_BUNNY as Gr,LUNA_NAME as br,LUNA_SIGNOFF as Mr,STEP_BADGE_NAMES as yr,badgeLead as kr,badgeWidth as Br,padBadge as Kr,paintAnswer as wr,paintBadge as hr}from"./packem_shared/ACCENT-CotPTfv7.mjs";import{COMPOSED_WORKER_ENTRY as Hr,GENERATED_CLASS_MODULES as Wr}from"./packem_shared/COMPOSED_WORKER_ENTRY-C69wqbSP.mjs";import{discoverWorkflowInfo as Jr}from"./packem_shared/discoverWorkflowInfo-BsPvlo6O.mjs";export{Pr as ACCENT,o as AGENT_MODE_ENV,s as AGENT_RULES_DIR,n as AGENT_RULES_HINT,l as AGENT_RULES_HINT_ENV,Fr as BADGES,Cr as BADGE_COLUMN_WIDTH,D as CODEGEN_ENV,Hr as COMPOSED_WORKER_ENTRY,re as DEFAULT_DEPLOY_TARGET,x as DEV_BINDINGS_FILE,I as DEV_DAEMON_ENV,u as DEV_HANDOFF_ENV,O as DEV_LOG_FILE,P as DEV_LOG_FILE_ENV,F as DEV_STATE_DIR,C as DEV_STATE_FILE,j as DEV_VARS_EXAMPLE_FILE,H as DEV_VARS_FILE,W as DEV_VARS_KEY_PATTERN,Q as DEV_WORKER_ENV_VALUE,Z as DEV_WORKER_ENV_VAR,Wr as GENERATED_CLASS_MODULES,ce as LINKED_PROJECT_DIR,de as LINKED_PROJECT_FILE,Ur as LUNA_ART,Gr as LUNA_BUNNY,br as LUNA_NAME,Mr as LUNA_SIGNOFF,Ie as LUNORA_EVENT_SOURCE,Se as LUNORA_IGNORED_PATHS,_ as LUNORA_SKILL_NAMES,Ne as LUNORA_TAG,Pe as LunoraReporter,we as PACKAGE_SECRETS_REGISTRY,p as ROOT_SKILL_NAME,yr as STEP_BADGE_NAMES,Ce as addArgsFor,Re as advisoryLine,fr as applyAdditiveEdit,fe as applyLintIgnores,kr as badgeLead,Br as badgeWidth,ge as blockingFindingsMessage,Er as buildPackageSecretsBlock,c as claimAgentRulesHint,U as claimDevServerState,Lr as classifyEdit,gr as classifyPolicyEdit,G as clearDevServerState,Ze as createConfirm,oe as deployTargetIds,d as detectAgentRules,t as detectAiAgent,R as detectFramework,Ue as detectInstalledManagers,Le as detectLintTools,Ge as detectPackageManager,E as discoverAgentInfo,f as discoverContainerInfo,ur as discoverSchemaInfo,Jr as discoverWorkflowInfo,ir as ensureDevVariables,sr as ensureDevVarsExample,$ as ensureDevWorkerEnv,Y as escapeRegExp,be as execArgsFor,nr as fillDevSecrets,ue as formatLunoraEvent,lr as generateSecretValue,le as inferLunoraBindings,Me as installArgsFor,Ye as interpretRemote,m as isCodegenDisabled,b as isDevServerReady,$e as isInteractive,_r as isMintableSecretKey,pr as isPlaceholderValue,M as isProcessAlive,y as isRecordedProcessCurrent,te as isRunnableTarget,Te as lunoraLine,_e as packageNamesFromBindings,Kr as padBadge,wr as paintAnswer,hr as paintBadge,J as parseDevVariableEntries,Nr as parseSchema,cr as planDevSecretsFill,dr as planDevVariablesAugment,Ar as planDevVariablesScaffold,ae as planToolchainInvocation,g as projectUsesUmbrella,er as promptMultiSelect,rr as promptSelect,or as promptText,tr as promptYesNo,k as readDevServerState,Ae as readLinkedProject,B as readLiveDevServerState,T as readProjectDependencyNames,Je as readProjectRemotePreference,qe as readProjectTarget,q as removeDevVariableLine,Ve as reportCodegenFindings,Dr as requiredSecrets,Ee as resolveDeployDriver,Xe as resolveProjectTarget,Tr as resolveServerModule,ze as resolveTargetOrThrow,He as runPostCodegenHook,ye as runScriptArgsFor,ke as runScriptCommand,ie as runnableTargetIds,Vr as scaffoldPolicyFile,he as secretsForPackages,v as streamContainerLogs,se as targetRunsOwnDevServer,Be as toolchainExecArgs,K as updateDevServerState,X as upsertDevVariableLine,xr as wireRlsIntoProcedure,w as writeDevServerState,mr as writeDevVariablesFileAtomically,De as writeLinkedProject};
@@ -0,0 +1 @@
1
+ import{readFileSync as i,existsSync as E}from"node:fs";import{parse as u}from"es-module-lexer";import{WRANGLER_FILES as m,readWranglerJsonc as f}from"./WRANGLER_FILES-UNW-xY5u.mjs";import{escapeRegExp as R}from"./DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";import{join as p}from"node:path";const x="_generated",_=["src/server.ts","src/server/index.ts","src/server/index.tsx","src/index.ts","src/worker.ts"],g=new Set(["build","coverage","dist",x,"node_modules","out","target"]),h=new Set([".client",".server"]),D=/[/\\]/u,b=t=>{const e=[];for(const r of t.split(D))r===""||r==="."||(r===".."&&e.length>0&&e.at(-1)!==".."?e.pop():e.push(r));return e},w=t=>b(t).slice(0,-1).some(e=>g.has(e)||e.startsWith(".")&&!h.has(e)),l={SchedulerDO:"SCHEDULER",SessionDO:"SESSION",ShardDO:"SHARD",ShardRegistryDO:"SHARD_REGISTRY"},S=Object.keys(l),k=t=>Object.hasOwn(l,t),T="virtual:lunora/worker",B=["ShardDO"],v=["agents","containers","scheduler","shardRegistry","workflows"],P={scheduler:"SchedulerDO",shardRegistry:"ShardRegistryDO"},A="src/worker.ts",G=t=>{for(const e of m){const r=p(t,e);if(!E(r))continue;const{parsed:s}=f(r),o=s?.main;if(o===T)return{composed:!0};const a=p(t,A);if(E(a))return{composed:!1,path:a};if(typeof o=="string"&&!w(o)&&E(p(t,o)))return{composed:!1,path:p(t,o)};break}for(const e of _){const r=p(t,e);if(E(r))return{composed:!1,path:r}}return{composed:!1}},L=/(?:^|[\s,{])type$/u,d=(t,e)=>{const r=e.ls>=0?e.ls:e.s;return L.test(t.slice(0,r).trimEnd())},O=(t,e)=>{const r=R(e);return new RegExp(String.raw`\bexport\s+type\s+${r}\b`,"u").test(t)||new RegExp(String.raw`\bexport\s+type\s*\{[^}]*\b${r}\b`,"u").test(t)||new RegExp(String.raw`\bexport\s+\{[^}]*\btype\s+${r}\b`,"u").test(t)},W=t=>{const e=i(t,"utf8");let r;try{const[,s]=u(e);r=new Set(s.filter(o=>!d(e,o)).map(o=>o.n))}catch{r=new Set(S.filter(s=>new RegExp(String.raw`\bexport\b[^\n;]*\b${s}\b`,"u").test(e)&&!O(e,s)))}return S.filter(s=>r.has(s)).map(s=>({binding:l[s],className:s}))},$=(t,e,r)=>{if(e.length===0)return[];if(t.composed)return e.map(n=>({...n,exported:!0}));if(t.path===void 0)return e.map(n=>({...n,exported:!1}));const s=i(t.path,"utf8"),o=new RegExp(String.raw`\bexport\s*\*\s*from\s*["'][^"']*_generated\/${r}(?:\.js)?["']`).test(s);let a;try{const[,n]=u(s);a=new Set(n.filter(c=>!d(s,c)).map(c=>c.n))}catch{a=new Set(e.map(n=>n.className).filter(n=>new RegExp(String.raw`\bexport\b[^\n;]*\b${R(n)}\b`,"u").test(s)&&!O(s,n)))}return e.map(n=>{const c=o||a.has(n.className);return{...n,exported:c}})};export{B as COMPOSED_ENTRY_DURABLE_OBJECTS,A as COMPOSED_WORKER_ENTRY,l as DURABLE_OBJECT_BINDINGS,v as GENERATED_CLASS_MODULES,x as GENERATED_DIRECTORY,P as GENERATED_MODULE_DURABLE_OBJECTS,T as LUNORA_WORKER_VIRTUAL_ID,g as NON_SOURCE_DIRECTORIES,h as SOURCE_DOT_DIRECTORIES,_ as WORKER_ENTRY_FALLBACKS,$ as detectClassExports,W as detectExportedDurableObjects,k as isFrameworkDurableObject,w as isGeneratedOutput,G as resolveWorkerEntry};
@@ -1 +1 @@
1
- import{existsSync as f,readFileSync as O,readdirSync as W}from"node:fs";import{join as p,dirname as y,extname as w,basename as _}from"node:path";import{discoverSchemaInfo as P}from"./discoverSchemaInfo-DJvevsCm.mjs";import{COMPOSED_WORKER_ENTRY as L,LUNORA_WORKER_VIRTUAL_ID as g,isGeneratedOutput as F,WORKER_ENTRY_FALLBACKS as M,GENERATED_DIRECTORY as U,COMPOSED_ENTRY_DURABLE_OBJECTS as D,GENERATED_CLASS_MODULES as A,SOURCE_DOT_DIRECTORIES as B,NON_SOURCE_DIRECTORIES as G,isFrameworkDurableObject as Y}from"./COMPOSED_WORKER_ENTRY-5R-BECOC.mjs";import{o as K}from"./validate-bindings-D6-vb6if.mjs";import{Project as X,Node as l}from"ts-morph";import{mergeWranglerEnvironment as J}from"./mergeWranglerEnvironment-BIcLqPfv.mjs";import{findWranglerFile as V,readWranglerJsonc as q}from"./WRANGLER_FILES-UNW-xY5u.mjs";import{validateWranglerConfig as z}from"./REQUIRED_COMPATIBILITY_DATE-g_1F-n2X.mjs";const E=[".ts",".tsx",".mts",".cts"],b=new Set(E),H=new Set([".cjs",".js",".mjs"]),v="default",x={".cjs":[".cts"],".js":[".ts",".tsx"],".mjs":[".mts"]},Q=250,Z=(e,s,t)=>{const r=p(s,L);if(f(r))return{origin:"declared",path:r};if(e===g)return{origin:"composed"};const n=()=>{const i=M.map(a=>p(s,a)).find(a=>f(a));return i===void 0?void 0:{origin:"probed",path:i}};if(typeof e!="string"||e.length===0||F(e))return n();const o=p(y(t),e),c=w(o);if(!(!b.has(c)&&!H.has(c)))return f(o)?{origin:"declared",path:o}:{origin:"absent",path:o}},T=(e,s)=>{if(l.isIdentifier(e)){s.add(e.getText());return}if(l.isObjectBindingPattern(e)||l.isArrayBindingPattern(e))for(const t of e.getElements())l.isBindingElement(t)&&T(t.getNameNode(),s)},ee=(e,s)=>{const t=[];for(const r of e.getExportDeclarations())if(!r.isTypeOnly()){if(r.isNamespaceExport()){const n=r.getNamespaceExport();n===void 0?t.push(r.getModuleSpecifierValue()??""):s.add(n.getName());continue}for(const n of r.getNamedExports())n.isTypeOnly()||s.add(n.getAliasNode()?.getText()??n.getName())}return t},te=(e,s)=>{for(const t of e.getVariableStatements().filter(r=>r.getExportKeyword()!==void 0))for(const r of t.getDeclarations())T(r.getNameNode(),s);for(const t of[...e.getClasses(),...e.getFunctions(),...e.getEnums()]){if(t.getExportKeyword()===void 0)continue;const r=t.isDefaultExport()?v:t.getName();r!==void 0&&s.add(r)}e.getExportAssignments().length>0&&s.add(v)},$=(e,s)=>{const t=new X({compilerOptions:{allowJs:!0},skipFileDependencyResolution:!0,skipLoadingLibFiles:!0,useInMemoryFileSystem:!0}),r=t.createSourceFile(e,s,{overwrite:!0});return t.getProgram().compilerObject.getSyntacticDiagnostics(r.compilerNode).length>0?void 0:r},re=(e,s)=>{if(!s.startsWith("./")&&!s.startsWith("../"))return;const t=p(y(e),s),r=w(t),n=b.has(r)||x[r]!==void 0,o=n?t.slice(0,-r.length):t;return[...b.has(r)?[t]:[],...(x[r]??[]).map(i=>`${o}${i}`),...n?[]:E.map(i=>`${t}${i}`),...n||r.length===0?E.map(i=>p(o,`index${i}`)):[]].find(i=>f(i))},j=e=>{const s=new Set,t=new Set([e]),r=[e];for(;r.length>0;){if(t.size-1>Q)return;const n=r.pop();let o;try{o=O(n,"utf8")}catch{return}const c=$(_(n),o);if(c===void 0)return;const i=ee(c,s);te(c,s);for(const a of i){const d=re(n,a);if(d===void 0)return;t.has(d)||(t.add(d),r.push(d))}}return s},oe=(e,s)=>{const t={exports:void 0,kind:"composed",path:g},r=p(e,s,U);if(!f(r))return t;const n=new Set(D);for(const o of A){const c=p(r,`${o}.ts`);if(!f(c))continue;const i=j(c);if(i===void 0)return t;for(const a of i)n.add(a)}return{exports:n,kind:"composed",path:g}},se=(e,s,t)=>{if(e===void 0||e.origin==="absent")return;if(e.origin==="composed")return oe(s,t);const r=j(e.path);if(!(e.origin==="probed"&&r!==void 0&&!r.has(v)))return{exports:r,kind:"authored",path:e.path}},ne=new Set([".cjs",".cts",".js",".jsx",".mjs",".mts",".ts",".tsx"]),ie=2e3,R="defineTable",N="defineApp",ae=e=>{const s=[],t=[];let r;try{r=W(e,{withFileTypes:!0})}catch{return{files:s,subdirectories:t}}for(const n of r)n.isDirectory()?n.name.startsWith(".")&&!B.has(n.name)||G.has(n.name)||t.push(p(e,n.name)):ne.has(w(n.name))&&s.push(p(e,n.name));return{files:s,subdirectories:t}},k=(e,s)=>{const t=new Set;for(const r of e.getImportDeclarations())for(const n of r.getNamedImports())!n.isTypeOnly()&&n.getName()===s&&t.add(n.getAliasNode()?.getText()??n.getName());return t},ce=(e,s)=>{let t=!1;return e.forEachDescendant((r,n)=>{if(!l.isCallExpression(r))return;const o=r.getExpression();l.isIdentifier(o)&&s.has(o.getText())&&(t=!0,n.stop())}),t},de=e=>{let s=e;for(;l.isCallExpression(s)||l.isPropertyAccessExpression(s);)s=s.getExpression();return s},le=(e,s)=>{const t=de(e);return l.isIdentifier(t)&&s.has(t.getText())},C={global:/\.\s*global\s*\(/u,hyperdriveGlobal:/\.\s*hyperdriveGlobal\s*\(/u,vectors:/\.\s*vectors\s*\(/u},pe=e=>Object.hasOwn(C,e),fe=(e,s)=>{const t=new Set,r=new Set([R,...k(e,R)]);return e.forEachDescendant(n=>{if(!l.isCallExpression(n))return;const o=n.getExpression();if(!l.isPropertyAccessExpression(o)||le(o,r))return;const c=o.getName();pe(c)&&s.has(c)&&t.add(c)}),t},he=(e,s)=>{let t;try{t=O(e,"utf8")}catch{return}const r=new Set([...s].filter(o=>C[o].test(t)));if(r.size===0&&!t.includes(N))return;const n=$(_(e),t);return n===void 0?{chained:r,composes:!1}:{chained:fe(n,r),composes:ce(n,k(n,N))}},ue=(e,s)=>{const t=[e],r=new Set;let n=0,o;const c=i=>{if(n+=1,n>ie)return!1;const a=he(i,s);for(const d of a?.chained??[])r.add(d);return a?.composes&&(o??=i),!0};for(;t.length>0;){const i=t.pop(),{files:a,subdirectories:d}=ae(i);t.push(...d);for(const m of a){if(!c(m))return;if(o!==void 0&&r.size===s.size)return{chained:r,site:o}}}return o===void 0?void 0:{chained:r,site:o}},I=e=>Array.isArray(e)?e:[],me=(e,s,t)=>{const r=[];for(const n of I(e)){const o=n?.image;typeof o!="string"||!(o.startsWith("./")||o.startsWith("../")||o.startsWith("/")||o.includes("Dockerfile"))||f(o.startsWith("/")?o:p(s,o))||r.push(`containers image "${o}" does not exist (resolved relative to ${t}); create the Dockerfile or point image at a registry reference`)}return r},ge=(e,s)=>{const t=e?.vectorIndexNames??[],r=[];if(t.length>0&&r.push({message:o=>`schema declares vector index(es) ${t.map(c=>`"${c}"`).join(", ")} but nothing chains .vectors(...) onto defineApp() (composed in: ${o}) — \`ctx.vectors\` is then a throwing stub and buildWorkerOptions rejects EVERY request, /_lunora/health included. Add \`.vectors((env) => ({ ${String(t[0])}: env.<BINDING> }))\` to the chain.`,method:"vectors"}),e?.hasD1GlobalTable&&r.push({message:o=>`schema declares .global() table(s) but nothing chains .global(...) onto defineApp() (composed in: ${o}) — the shard then has no global writer, so every read or write of a global table throws INTERNAL ("requires a globalDb writer"). Add \`.global({ d1: (env) => env.DB })\` to the chain.`,method:"global"}),e?.hasHyperdriveGlobalTable&&r.push({message:o=>`schema declares .global({ backend: "hyperdrive" }) table(s) but nothing chains .hyperdriveGlobal(...) onto defineApp() (composed in: ${o}) — the shard then has no global writer, so every read or write of those tables throws INTERNAL. Add \`.hyperdriveGlobal({ engine: "postgres", exec: (env) => buildPgExec(fromPostgresJs(postgres(env.HYPERDRIVE.connectionString))) })\` to the chain (\`buildPgExec\` from \`@lunora/hyperdrive/global\`, \`fromPostgresJs\` from \`@lunora/hyperdrive\`).`,method:"hyperdriveGlobal"}),r.length===0)return[];const n=ue(s,new Set(r.map(o=>o.method)));return n===void 0?[]:r.filter(o=>!n.chained.has(o.method)).map(o=>o.message(n.site))},Ee="does not export it",be=(e,s)=>{if(s!=="composed")return`Re-export it from the module that defines it (\`export { ${e} } from "./…";\`), or add it to the app builder's own export (\`export const { ${e} } = app;\`).`;const t=`it exports ${D.join(", ")}, SchedulerDO when its binding is declared, and every class codegen emits from your ${A.map(r=>`${r}.ts`).join(" / ")} declarations`;return Y(e)?`\`@lunora/vite\` generates that entry — ${t}, and ${e} is not among them. Class-A composition does not carry ${e}, so drop the binding; a project that needs it has to own its worker entry (add \`src/worker.ts\`, which \`lunora deploy\` bundles in place of \`main\`, and compose \`defineApp()\` there).`:`\`@lunora/vite\` generates that entry, so there is no file to add a re-export to: ${t}. Declare "${e}" in one of those and re-run \`lunora codegen\`, or drop the binding.`},ve=(e,s)=>{const t=s.exports;if(t===void 0)return[];const r=[];for(const o of K(e.durable_objects?.bindings))typeof o.class_name=="string"&&o.class_name.length>0&&o.script_name===void 0&&r.push({className:o.class_name,label:"durable_objects.bindings"});for(const o of I(e.workflows))typeof o?.class_name=="string"&&o.class_name.length>0&&o.script_name===void 0&&r.push({className:o.class_name,label:"workflows"});return r.filter(o=>!t.has(o.className)).map(o=>`${o.label} declares class "${o.className}" but the ${s.kind==="composed"?"composed class-A worker entry":"worker entry"} (${s.path}) ${Ee} — wrangler refuses to bundle a Worker whose ${o.label==="workflows"?"Workflow":"Durable Object"} classes are not exported. ${be(o.className,s.kind)}`)},ye=e=>e?.origin!=="absent"?[]:[`main is set but no readable file is there (looked in ${e.path}) — wrangler cannot resolve the worker entry, so a deploy will fail there. Point main at the entry that composes your app, or remove it to fall back to the conventional locations.`],Te=e=>{const s=e.schemaDir??"lunora",t=V(e.projectRoot);if(!t){const h=`wrangler.jsonc not found in ${e.projectRoot}; create one declaring at least the SHARD durable object binding.`;return{problems:[h],report:{errors:[h],valid:!1,warnings:[]},wranglerPath:void 0}}const{parsed:r}=q(t);if(r===void 0){const h=`failed to parse ${t} as JSONC.`;return{problems:[h],report:{errors:[h],valid:!1,warnings:[]},wranglerPath:t}}const{error:n,merged:o}=J(r,e.environment);if(n!==void 0)return{problems:[n],report:{errors:[n],valid:!1,warnings:[]},wranglerPath:t};const{error:c,info:i}=P(e.projectRoot,s),a=z(r,i,e.environment);c!==void 0&&a.warnings.push(`schema parse failed in ${s}/schema.ts: ${c}`);const d=y(t),m=Z(o.main,e.projectRoot,t),S=se(m,e.projectRoot,s);a.errors.push(...me(o.containers??[],d,t)),a.warnings.push(...ye(m)),S!==void 0&&a.errors.push(...ve(o,S)),a.errors.push(...ge(i,e.projectRoot));const u=o.assets?.directory;if(typeof u=="string"&&u.length>0){const h=u.startsWith("/")?u:p(d,u);f(h)||a.warnings.push(`assets.directory "${u}" does not exist yet — it is created by the client build; run the build before deploy`)}return a.valid=a.errors.length===0,{problems:a.errors,report:a,wranglerPath:t}};export{Ee as UNEXPORTED_CLASS_MARKER,Te as validateWranglerProject};
1
+ import{existsSync as f,readFileSync as O,readdirSync as W}from"node:fs";import{join as p,dirname as y,extname as w,basename as _}from"node:path";import{discoverSchemaInfo as P}from"./discoverSchemaInfo-DJvevsCm.mjs";import{COMPOSED_WORKER_ENTRY as L,LUNORA_WORKER_VIRTUAL_ID as g,isGeneratedOutput as F,WORKER_ENTRY_FALLBACKS as M,GENERATED_DIRECTORY as U,COMPOSED_ENTRY_DURABLE_OBJECTS as D,GENERATED_CLASS_MODULES as A,SOURCE_DOT_DIRECTORIES as B,NON_SOURCE_DIRECTORIES as G,isFrameworkDurableObject as Y}from"./COMPOSED_WORKER_ENTRY-C69wqbSP.mjs";import{o as K}from"./validate-bindings-D6-vb6if.mjs";import{Project as X,Node as l}from"ts-morph";import{mergeWranglerEnvironment as J}from"./mergeWranglerEnvironment-BIcLqPfv.mjs";import{findWranglerFile as V,readWranglerJsonc as q}from"./WRANGLER_FILES-UNW-xY5u.mjs";import{validateWranglerConfig as z}from"./REQUIRED_COMPATIBILITY_DATE-g_1F-n2X.mjs";const E=[".ts",".tsx",".mts",".cts"],b=new Set(E),H=new Set([".cjs",".js",".mjs"]),v="default",x={".cjs":[".cts"],".js":[".ts",".tsx"],".mjs":[".mts"]},Q=250,Z=(e,s,t)=>{const r=p(s,L);if(f(r))return{origin:"declared",path:r};if(e===g)return{origin:"composed"};const n=()=>{const i=M.map(a=>p(s,a)).find(a=>f(a));return i===void 0?void 0:{origin:"probed",path:i}};if(typeof e!="string"||e.length===0||F(e))return n();const o=p(y(t),e),c=w(o);if(!(!b.has(c)&&!H.has(c)))return f(o)?{origin:"declared",path:o}:{origin:"absent",path:o}},T=(e,s)=>{if(l.isIdentifier(e)){s.add(e.getText());return}if(l.isObjectBindingPattern(e)||l.isArrayBindingPattern(e))for(const t of e.getElements())l.isBindingElement(t)&&T(t.getNameNode(),s)},ee=(e,s)=>{const t=[];for(const r of e.getExportDeclarations())if(!r.isTypeOnly()){if(r.isNamespaceExport()){const n=r.getNamespaceExport();n===void 0?t.push(r.getModuleSpecifierValue()??""):s.add(n.getName());continue}for(const n of r.getNamedExports())n.isTypeOnly()||s.add(n.getAliasNode()?.getText()??n.getName())}return t},te=(e,s)=>{for(const t of e.getVariableStatements().filter(r=>r.getExportKeyword()!==void 0))for(const r of t.getDeclarations())T(r.getNameNode(),s);for(const t of[...e.getClasses(),...e.getFunctions(),...e.getEnums()]){if(t.getExportKeyword()===void 0)continue;const r=t.isDefaultExport()?v:t.getName();r!==void 0&&s.add(r)}e.getExportAssignments().length>0&&s.add(v)},$=(e,s)=>{const t=new X({compilerOptions:{allowJs:!0},skipFileDependencyResolution:!0,skipLoadingLibFiles:!0,useInMemoryFileSystem:!0}),r=t.createSourceFile(e,s,{overwrite:!0});return t.getProgram().compilerObject.getSyntacticDiagnostics(r.compilerNode).length>0?void 0:r},re=(e,s)=>{if(!s.startsWith("./")&&!s.startsWith("../"))return;const t=p(y(e),s),r=w(t),n=b.has(r)||x[r]!==void 0,o=n?t.slice(0,-r.length):t;return[...b.has(r)?[t]:[],...(x[r]??[]).map(i=>`${o}${i}`),...n?[]:E.map(i=>`${t}${i}`),...n||r.length===0?E.map(i=>p(o,`index${i}`)):[]].find(i=>f(i))},j=e=>{const s=new Set,t=new Set([e]),r=[e];for(;r.length>0;){if(t.size-1>Q)return;const n=r.pop();let o;try{o=O(n,"utf8")}catch{return}const c=$(_(n),o);if(c===void 0)return;const i=ee(c,s);te(c,s);for(const a of i){const d=re(n,a);if(d===void 0)return;t.has(d)||(t.add(d),r.push(d))}}return s},oe=(e,s)=>{const t={exports:void 0,kind:"composed",path:g},r=p(e,s,U);if(!f(r))return t;const n=new Set(D);for(const o of A){const c=p(r,`${o}.ts`);if(!f(c))continue;const i=j(c);if(i===void 0)return t;for(const a of i)n.add(a)}return{exports:n,kind:"composed",path:g}},se=(e,s,t)=>{if(e===void 0||e.origin==="absent")return;if(e.origin==="composed")return oe(s,t);const r=j(e.path);if(!(e.origin==="probed"&&r!==void 0&&!r.has(v)))return{exports:r,kind:"authored",path:e.path}},ne=new Set([".cjs",".cts",".js",".jsx",".mjs",".mts",".ts",".tsx"]),ie=2e3,R="defineTable",N="defineApp",ae=e=>{const s=[],t=[];let r;try{r=W(e,{withFileTypes:!0})}catch{return{files:s,subdirectories:t}}for(const n of r)n.isDirectory()?n.name.startsWith(".")&&!B.has(n.name)||G.has(n.name)||t.push(p(e,n.name)):ne.has(w(n.name))&&s.push(p(e,n.name));return{files:s,subdirectories:t}},k=(e,s)=>{const t=new Set;for(const r of e.getImportDeclarations())for(const n of r.getNamedImports())!n.isTypeOnly()&&n.getName()===s&&t.add(n.getAliasNode()?.getText()??n.getName());return t},ce=(e,s)=>{let t=!1;return e.forEachDescendant((r,n)=>{if(!l.isCallExpression(r))return;const o=r.getExpression();l.isIdentifier(o)&&s.has(o.getText())&&(t=!0,n.stop())}),t},de=e=>{let s=e;for(;l.isCallExpression(s)||l.isPropertyAccessExpression(s);)s=s.getExpression();return s},le=(e,s)=>{const t=de(e);return l.isIdentifier(t)&&s.has(t.getText())},C={global:/\.\s*global\s*\(/u,hyperdriveGlobal:/\.\s*hyperdriveGlobal\s*\(/u,vectors:/\.\s*vectors\s*\(/u},pe=e=>Object.hasOwn(C,e),fe=(e,s)=>{const t=new Set,r=new Set([R,...k(e,R)]);return e.forEachDescendant(n=>{if(!l.isCallExpression(n))return;const o=n.getExpression();if(!l.isPropertyAccessExpression(o)||le(o,r))return;const c=o.getName();pe(c)&&s.has(c)&&t.add(c)}),t},he=(e,s)=>{let t;try{t=O(e,"utf8")}catch{return}const r=new Set([...s].filter(o=>C[o].test(t)));if(r.size===0&&!t.includes(N))return;const n=$(_(e),t);return n===void 0?{chained:r,composes:!1}:{chained:fe(n,r),composes:ce(n,k(n,N))}},ue=(e,s)=>{const t=[e],r=new Set;let n=0,o;const c=i=>{if(n+=1,n>ie)return!1;const a=he(i,s);for(const d of a?.chained??[])r.add(d);return a?.composes&&(o??=i),!0};for(;t.length>0;){const i=t.pop(),{files:a,subdirectories:d}=ae(i);t.push(...d);for(const m of a){if(!c(m))return;if(o!==void 0&&r.size===s.size)return{chained:r,site:o}}}return o===void 0?void 0:{chained:r,site:o}},I=e=>Array.isArray(e)?e:[],me=(e,s,t)=>{const r=[];for(const n of I(e)){const o=n?.image;typeof o!="string"||!(o.startsWith("./")||o.startsWith("../")||o.startsWith("/")||o.includes("Dockerfile"))||f(o.startsWith("/")?o:p(s,o))||r.push(`containers image "${o}" does not exist (resolved relative to ${t}); create the Dockerfile or point image at a registry reference`)}return r},ge=(e,s)=>{const t=e?.vectorIndexNames??[],r=[];if(t.length>0&&r.push({message:o=>`schema declares vector index(es) ${t.map(c=>`"${c}"`).join(", ")} but nothing chains .vectors(...) onto defineApp() (composed in: ${o}) — \`ctx.vectors\` is then a throwing stub and buildWorkerOptions rejects EVERY request, /_lunora/health included. Add \`.vectors((env) => ({ ${String(t[0])}: env.<BINDING> }))\` to the chain.`,method:"vectors"}),e?.hasD1GlobalTable&&r.push({message:o=>`schema declares .global() table(s) but nothing chains .global(...) onto defineApp() (composed in: ${o}) — the shard then has no global writer, so every read or write of a global table throws INTERNAL ("requires a globalDb writer"). Add \`.global({ d1: (env) => env.DB })\` to the chain.`,method:"global"}),e?.hasHyperdriveGlobalTable&&r.push({message:o=>`schema declares .global({ backend: "hyperdrive" }) table(s) but nothing chains .hyperdriveGlobal(...) onto defineApp() (composed in: ${o}) — the shard then has no global writer, so every read or write of those tables throws INTERNAL. Add \`.hyperdriveGlobal({ engine: "postgres", exec: (env) => buildPgExec(fromPostgresJs(postgres(env.HYPERDRIVE.connectionString))) })\` to the chain (\`buildPgExec\` from \`@lunora/hyperdrive/global\`, \`fromPostgresJs\` from \`@lunora/hyperdrive\`).`,method:"hyperdriveGlobal"}),r.length===0)return[];const n=ue(s,new Set(r.map(o=>o.method)));return n===void 0?[]:r.filter(o=>!n.chained.has(o.method)).map(o=>o.message(n.site))},Ee="does not export it",be=(e,s)=>{if(s!=="composed")return`Re-export it from the module that defines it (\`export { ${e} } from "./…";\`), or add it to the app builder's own export (\`export const { ${e} } = app;\`).`;const t=`it exports ${D.join(", ")}, SchedulerDO when its binding is declared, and every class codegen emits from your ${A.map(r=>`${r}.ts`).join(" / ")} declarations`;return Y(e)?`\`@lunora/vite\` generates that entry — ${t}, and ${e} is not among them. Class-A composition does not carry ${e}, so drop the binding; a project that needs it has to own its worker entry (add \`src/worker.ts\`, which \`lunora deploy\` bundles in place of \`main\`, and compose \`defineApp()\` there).`:`\`@lunora/vite\` generates that entry, so there is no file to add a re-export to: ${t}. Declare "${e}" in one of those and re-run \`lunora codegen\`, or drop the binding.`},ve=(e,s)=>{const t=s.exports;if(t===void 0)return[];const r=[];for(const o of K(e.durable_objects?.bindings))typeof o.class_name=="string"&&o.class_name.length>0&&o.script_name===void 0&&r.push({className:o.class_name,label:"durable_objects.bindings"});for(const o of I(e.workflows))typeof o?.class_name=="string"&&o.class_name.length>0&&o.script_name===void 0&&r.push({className:o.class_name,label:"workflows"});return r.filter(o=>!t.has(o.className)).map(o=>`${o.label} declares class "${o.className}" but the ${s.kind==="composed"?"composed class-A worker entry":"worker entry"} (${s.path}) ${Ee} — wrangler refuses to bundle a Worker whose ${o.label==="workflows"?"Workflow":"Durable Object"} classes are not exported. ${be(o.className,s.kind)}`)},ye=e=>e?.origin!=="absent"?[]:[`main is set but no readable file is there (looked in ${e.path}) — wrangler cannot resolve the worker entry, so a deploy will fail there. Point main at the entry that composes your app, or remove it to fall back to the conventional locations.`],Te=e=>{const s=e.schemaDir??"lunora",t=V(e.projectRoot);if(!t){const h=`wrangler.jsonc not found in ${e.projectRoot}; create one declaring at least the SHARD durable object binding.`;return{problems:[h],report:{errors:[h],valid:!1,warnings:[]},wranglerPath:void 0}}const{parsed:r}=q(t);if(r===void 0){const h=`failed to parse ${t} as JSONC.`;return{problems:[h],report:{errors:[h],valid:!1,warnings:[]},wranglerPath:t}}const{error:n,merged:o}=J(r,e.environment);if(n!==void 0)return{problems:[n],report:{errors:[n],valid:!1,warnings:[]},wranglerPath:t};const{error:c,info:i}=P(e.projectRoot,s),a=z(r,i,e.environment);c!==void 0&&a.warnings.push(`schema parse failed in ${s}/schema.ts: ${c}`);const d=y(t),m=Z(o.main,e.projectRoot,t),S=se(m,e.projectRoot,s);a.errors.push(...me(o.containers??[],d,t)),a.warnings.push(...ye(m)),S!==void 0&&a.errors.push(...ve(o,S)),a.errors.push(...ge(i,e.projectRoot));const u=o.assets?.directory;if(typeof u=="string"&&u.length>0){const h=u.startsWith("/")?u:p(d,u);f(h)||a.warnings.push(`assets.directory "${u}" does not exist yet — it is created by the client build; run the build before deploy`)}return a.valid=a.errors.length===0,{problems:a.errors,report:a,wranglerPath:t}};export{Ee as UNEXPORTED_CLASS_MARKER,Te as validateWranglerProject};
@@ -1,3 +1,3 @@
1
- import{LunoraError as n}from"@lunora/errors";import{lunoraLine as i}from"./LUNORA_TAG-CiQM3BkI.mjs";import{validateWranglerProject as l}from"./UNEXPORTED_CLASS_MARKER-Bc302QS4.mjs";const m=(e,a,t)=>{const r=l({projectRoot:e.projectRoot,schemaDir:e.schemaDir});if(!r.wranglerPath)throw new n("INTERNAL",["[lunora] wrangler.jsonc not found.",` searched in: ${e.projectRoot}`," create a wrangler.jsonc declaring at least the SHARD durable object binding."].join(`
1
+ import{LunoraError as n}from"@lunora/errors";import{lunoraLine as i}from"./LUNORA_TAG-CiQM3BkI.mjs";import{validateWranglerProject as l}from"./UNEXPORTED_CLASS_MARKER-D3aUWNly.mjs";const m=(e,a,t)=>{const r=l({projectRoot:e.projectRoot,schemaDir:e.schemaDir});if(!r.wranglerPath)throw new n("INTERNAL",["[lunora] wrangler.jsonc not found.",` searched in: ${e.projectRoot}`," create a wrangler.jsonc declaring at least the SHARD durable object binding."].join(`
2
2
  `));for(const o of r.report.warnings)a(i(`wrangler validator: ${o}`));if(r.problems.length>0)throw new n("INTERNAL",["[lunora] wrangler configuration is missing bindings required by your schema.",` file: ${r.wranglerPath}`,"",...r.problems.map(o=>` - ${o}`),"",` ${t}`].join(`
3
3
  `))};export{m as assertWranglerSatisfiesSchema};
@@ -0,0 +1 @@
1
+ import{existsSync as S,statSync as T,readFileSync as O,readdirSync as $}from"node:fs";import{parse as D,init as F}from"es-module-lexer";import{discoverAgentInfo as U}from"./discoverAgentInfo-CTdCSfYM.mjs";import{discoverContainerInfo as Y}from"./discoverContainerInfo-EhZtEBQs.mjs";import{discoverFlags as M,FLAGS_FILENAME as W,discoverQueues as G,QUEUES_FILENAME as K}from"@lunora/codegen";import{d as C}from"./discover-info-Vj9d4qYt.mjs";import{escapeRegExp as X}from"./DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";import{discoverSchemaInfo as q}from"./discoverSchemaInfo-DJvevsCm.mjs";import{resolveWorkerEntry as H,COMPOSED_ENTRY_DURABLE_OBJECTS as Q,GENERATED_MODULE_DURABLE_OBJECTS as V,GENERATED_DIRECTORY as w,DURABLE_OBJECT_BINDINGS as J,detectExportedDurableObjects as z,detectClassExports as E}from"./COMPOSED_WORKER_ENTRY-C69wqbSP.mjs";import{discoverWorkflowInfo as Z}from"./discoverWorkflowInfo-BsPvlo6O.mjs";import{join as l}from"node:path";const ee=(e,s)=>{const{error:t,value:r}=C(e,s,W,M);return t===void 0?{flags:r}:{error:t}},L=/^\s*import\s+type\b/,se=new Set(["@lunora/agent","@lunora/agent/sandbox"]),f=["browserTool","jsCodeTool"],y=Object.fromEntries(f.map(e=>{const s=X(e);return[e,{fallback:new RegExp(String.raw`import\s+\{[^}]*\b${s}\b[^}]*\}\s+from\s+["']@lunora\/agent(?:\/sandbox)?["']`,"u"),name:new RegExp(String.raw`\b${s}\b`,"u"),typeSpecifier:new RegExp(String.raw`\btype\s+${s}\b`,"u")}]})),re=e=>{const s=e.indexOf("{");if(s===-1)return"";const t=e.indexOf("}",s+1);return t===-1?e.slice(s+1):e.slice(s+1,t)},te=(e,s)=>{if(L.test(e))return!1;const t=re(e);return y[s].name.test(t)&&!y[s].typeSpecifier.test(t)},oe=e=>{let s;try{const[t]=D(e);s=t.filter(r=>r.n!==void 0&&se.has(r.n)).map(r=>e.slice(r.ss,r.se))}catch{s=void 0}return Object.fromEntries(f.map(t=>[t,s===void 0?y[t].fallback.test(e):s.some(r=>te(r,t))]))},ne=(e,s)=>{const{error:t,value:r}=C(e,s,K,G);return t===void 0?{queues:r??[]}:{error:t,queues:[]}},ae=new Set([".cjs",".cts",".js",".jsx",".mjs",".mts",".ts",".tsx"]),ie=new Set([".git",".lunora-cache",".wrangler","dist",w,"node_modules"]),ce=["lunora","src"],de=/\benv\s*\.\s*DB\b/,ue=/\benv\s*\.\s*AI\b/,k=/\bctx\s*\.\s*pipelines\b/,P=/\bctx\s*\.\s*r2sql\b/,b={usesAi:{pattern:/\bfrom\s+["']@lunora\/ai["']/,source:"@lunora/ai"},usesAnalytics:{pattern:/\bfrom\s+["']@lunora\/bindings\/analytics["']/,source:"@lunora/bindings/analytics"},usesAuth:{pattern:/\bfrom\s+["']@lunora\/auth["']/,source:"@lunora/auth"},usesBrowser:{pattern:/\bfrom\s+["']@lunora\/browser["']/,source:"@lunora/browser"},usesHyperdrive:{pattern:/\bfrom\s+["']@lunora\/hyperdrive["']/,source:"@lunora/hyperdrive"},usesImages:{pattern:/\bfrom\s+["']@lunora\/bindings\/images["']/,source:"@lunora/bindings/images"},usesKv:{pattern:/\bfrom\s+["']@lunora\/bindings\/kv["']/,source:"@lunora/bindings/kv"},usesMail:{pattern:/\bfrom\s+["']@lunora\/mail["']/,source:"@lunora/mail"},usesNotify:{pattern:/\bfrom\s+["']@lunora\/notify["']/,source:"@lunora/notify"},usesPayment:{pattern:/\bfrom\s+["']@lunora\/payment["']/,source:"@lunora/payment"},usesPipelines:{pattern:k,source:"@lunora/bindings/pipelines"},usesR2sql:{pattern:P,source:"@lunora/bindings/r2sql"},usesScheduler:{pattern:/\bfrom\s+["']@lunora\/scheduler["']/,source:"@lunora/scheduler"},usesStorage:{pattern:/\bfrom\s+["']@lunora\/storage["']/,source:"@lunora/storage"},usesX402Charge:{pattern:/\bfrom\s+["']@lunora\/x402\/charge["']/,source:"@lunora/x402/charge"},usesX402Pay:{pattern:/\bfrom\s+["']@lunora\/x402\/pay["']/,source:"@lunora/x402/pay"}},p=Object.keys(b),le="STRIPE_SECRET_KEY + STRIPE_WEBHOOK_SECRET (Stripe) or POLAR_ACCESS_TOKEN + POLAR_WEBHOOK_SECRET (Polar)",B=[...p,"needsD1","usesWorkerLoader"],pe=()=>{const e={};for(const s of B)e[s]=!1;return e},u=Object.freeze(pe()),_=(e,s)=>{const t={};for(const r of B)t[r]=e[r]||s[r];return t},me=e=>{for(const s of p)if(b[s].source===e)return{...u,[s]:!0};return u},fe=e=>{const[s]=D(e);let t=u;for(const r of s){const o=r.n;!o||L.test(e.slice(r.ss,r.se))||(t=_(t,me(o)))}return t},be=e=>{const s={...u};for(const t of p)s[t]=b[t].pattern.test(e);return s},ge=e=>{let s;try{s=fe(e)}catch{s=be(e)}return _(s,{...u,needsD1:de.test(e),usesAi:ue.test(e),usesPipelines:k.test(e),usesR2sql:P.test(e)})},v=(e,s)=>{let t;try{t=$(e,{withFileTypes:!0})}catch{return}for(const r of t){if(r.isDirectory()){ie.has(r.name)||v(l(e,r.name),s);continue}const o=r.name.lastIndexOf(".");o!==-1&&ae.has(r.name.slice(o))&&s.push(l(e,r.name))}},he=(e,s)=>q(e,s).info?.hasD1GlobalTable??!1,Ee=(e,s)=>{let t=u;for(const r of s){const o=l(e,r);if(!S(o)||!T(o).isDirectory())continue;const n=[];v(o,n);for(const a of n)t=_(t,ge(O(a,"utf8")))}return t},ye=(e,s)=>{const t=l(e,s),r=Object.fromEntries(f.map(n=>[n,!1]));if(!S(t)||!T(t).isDirectory())return r;const o=[];v(t,o);for(const n of o){const a=oe(O(n,"utf8"));for(const i of f)r[i]||=a[i]}return r},Se=(e,s,t)=>[...e.map(r=>r.exported?`${r.bindingName}/${r.className} (container "${r.exportName}" declared and exported)`:`hint: container "${r.exportName}" is declared but ${r.className} is not exported by the worker entry — add \`export * from "./lunora/_generated/containers"\``),...s.map(r=>r.exported?`${r.bindingName}/${r.className} (workflow "${r.exportName}" declared and exported)`:`hint: workflow "${r.exportName}" is declared but ${r.className} is not exported by the worker entry — add \`export * from "./lunora/_generated/workflows"\``),...t.map(r=>r.exported?`${r.bindingName}/${r.className} (agent "${r.exportName}" declared and exported)`:`hint: agent "${r.exportName}" is declared but ${r.className} is not exported by the worker entry — add \`export * from "./lunora/_generated/agents"\``)],_e=(e,s)=>[[e.usesAi,"AI (@lunora/ai imported or env.AI used)"],[e.usesAuth&&!s.has("SessionDO"),"hint: @lunora/auth is imported; its tables are D1-backed by default. For DO-backed auth (what @better-auth/scim needs), pass `namespace` to .auth() and export the generated auth DO class"],[e.usesScheduler&&!s.has("SchedulerDO"),"hint: @lunora/scheduler is imported but no SchedulerDO is exported by the worker entry"],[e.usesStorage,"hint: @lunora/storage is imported; add an r2_buckets binding (bucket binding names are user-defined)"],[e.usesMail,"hint: @lunora/mail is imported; set RESEND_API_KEY in .dev.vars (obtain at https://resend.com/api-keys)"],[e.usesPayment,`hint: @lunora/payment is imported; set the provider secrets in .dev.vars — ${le}`],[e.usesBrowser,"browser (@lunora/browser imported) — self-describing { binding: BROWSER }"],[e.usesImages,"images (@lunora/bindings/images imported) — self-describing { binding: IMAGES }"],[e.usesAnalytics,"analytics_engine_datasets (@lunora/bindings/analytics imported) — self-describing { binding: ANALYTICS, dataset }"],[e.usesWorkerLoader,"worker_loaders (jsCodeTool imported in lunora/) — self-describing { binding: LOADER }"],[e.usesKv,"hint: @lunora/bindings/kv is imported; add a kv_namespaces binding ({ binding, id }) and pass env.<BINDING> to createKv() — the namespace id can't be auto-provisioned"],[e.usesHyperdrive,"hint: @lunora/hyperdrive is imported; run 'wrangler hyperdrive create' and add a 'hyperdrive' binding ({ binding, id }) — the id can't be auto-provisioned"],[e.usesPipelines,"hint: ctx.pipelines is used; run 'wrangler pipelines create <name>' and add a 'pipelines' binding ({ binding, pipeline }) — the pipeline resource can't be auto-provisioned"],[e.usesX402Charge,"hint: @lunora/x402/charge is imported; set the recipient wallet address as a [vars] entry (the var name is yours to choose) and pass it to the charge config — the x402 facilitator settles USDC to that address"],[e.usesX402Pay,"hint: @lunora/x402/pay is imported (ActionCtx-only, spends real funds); add a secrets_store_secrets[] binding for the agent wallet key (name it to match signer.secretName) and pair the pay rail with a spend policy — ctx.secrets reads a Secrets Store binding, not .dev.vars, so the key can't be auto-provisioned"]].filter(([r])=>r).map(([,r])=>r),ve=(e,s,t,r=[],o=[],n=[])=>{const a=new Set(e.map(c=>c.className)),i=e.map(c=>`${c.binding}/${c.className} (exported by worker entry)`);return s&&i.push("DB (.global() table declared)"),i.push(...Se(r,o,n),..._e(t,a)),i},ke=async e=>{await F;const s=e.schemaDir??"lunora",t=e.scanDirs??ce,r=Ee(e.projectRoot,t),o=ye(e.projectRoot,s),n={...r,usesBrowser:r.usesBrowser||o.browserTool,usesWorkerLoader:o.jsCodeTool},a=H(e.projectRoot);let i;a.composed?i=[...Q,...Object.entries(V).filter(([d])=>S(l(e.projectRoot,s,w,`${d}.ts`))).map(([,d])=>d)].map(d=>({binding:J[d],className:d})):i=a.path===void 0?[]:z(a.path);const c=n.needsD1||he(e.projectRoot,s),x=E(a,Y(e.projectRoot,s).containers,"containers"),I=E(a,Z(e.projectRoot,s).workflows,"workflows"),R=E(a,U(e.projectRoot,s).agents,"agents"),j=[...ne(e.projectRoot,s).queues],{flags:m}=ee(e.projectRoot,s),g=m?.provider==="flagship"&&m.mode==="binding"?m.bindingName:void 0,N={};for(const h of p)N[h]=n[h];const A=ve(i,c,n,x,I,R);return g!==void 0&&A.push(`hint: lunora/flags.ts uses Flagship in binding mode; add a flagship binding ({ binding: "${g}", app_id }) — the app_id can't be auto-provisioned`),{agents:R,containers:x,durableObjects:i,flagshipBinding:g,needsD1:c,queues:j,signals:A,usesFlags:m!==void 0,usesWorkerLoader:n.usesWorkerLoader,workflows:I,...N}},Pe=e=>{const s=[];for(const t of p)e[t]&&s.push(b[t].source);return s};export{ke as inferLunoraBindings,Pe as packageNamesFromBindings};
@@ -1 +1 @@
1
- import{inferLunoraBindings as d}from"./inferLunoraBindings-GaAITuz-.mjs";import{LUNORA_TAG as r}from"./LUNORA_TAG-CiQM3BkI.mjs";import{reconcileWranglerBindings as f}from"./collectExportGaps-DUaEyDNw.mjs";import{reconcileWranglerCompatibilityDate as p}from"./reconcileWranglerCompatibilityDate-hocXEuRA.mjs";import{reconcileWranglerCrons as g,describePreservedCrons as $}from"./describePreservedCrons-Ci5r2aph.mjs";const b=async(i,a,t)=>{try{const n=await d({projectRoot:i.projectRoot,schemaDir:i.schemaDir}),e=f(i.projectRoot,n),o=e.wranglerPath??"wrangler.jsonc";e.added.length>0&&a.info?.(`${r} inferred bindings → ${e.added.join(", ")} (written to ${o})`),e.updated.length>0&&a.info?.(`${r} updated bindings → ${e.updated.join(", ")} (written to ${o})`);for(const s of e.warnings)a.warn(`${r} ${s}`);e.exportGaps.length>0&&t?.(e.exportGaps)}catch(n){const e=n instanceof Error?n.message:String(n);a.warn(`${r} binding inference skipped: ${e}`)}},c=new Map,j=(i,a,t)=>{try{const n=g(i,a);n.changed&&t.info?.(`${r} synced ${a.length.toFixed(0)} cron trigger(s) into ${n.wranglerPath??"wrangler.jsonc"}`);for(const s of n.warnings)t.warn(`${r} ${s}`);const e=n.preserved.join("\0"),o=$(n.preserved);o!==void 0&&(n.changed||c.get(i)!==e)&&t.info?.(`${r} ${o}`),c.set(i,e)}catch(n){const e=n instanceof Error?n.message:String(n);t.warn(`${r} cron trigger sync skipped: ${e}`)}try{const n=p(i);n.changed&&t.info?.(`${r} bumped compatibility_date to ${n.date??"unknown"} (Workers Cache enabled) → ${n.wranglerPath??"wrangler.jsonc"}`)}catch(n){const e=n instanceof Error?n.message:String(n);t.warn(`${r} compatibility date sync skipped: ${e}`)}};export{b as reconcileBindingsSafely,j as reconcileWranglerExtras};
1
+ import{inferLunoraBindings as d}from"./inferLunoraBindings-DTiYSVS2.mjs";import{LUNORA_TAG as r}from"./LUNORA_TAG-CiQM3BkI.mjs";import{reconcileWranglerBindings as f}from"./collectExportGaps-DUaEyDNw.mjs";import{reconcileWranglerCompatibilityDate as p}from"./reconcileWranglerCompatibilityDate-hocXEuRA.mjs";import{reconcileWranglerCrons as g,describePreservedCrons as $}from"./describePreservedCrons-Ci5r2aph.mjs";const b=async(i,a,t)=>{try{const n=await d({projectRoot:i.projectRoot,schemaDir:i.schemaDir}),e=f(i.projectRoot,n),o=e.wranglerPath??"wrangler.jsonc";e.added.length>0&&a.info?.(`${r} inferred bindings → ${e.added.join(", ")} (written to ${o})`),e.updated.length>0&&a.info?.(`${r} updated bindings → ${e.updated.join(", ")} (written to ${o})`);for(const s of e.warnings)a.warn(`${r} ${s}`);e.exportGaps.length>0&&t?.(e.exportGaps)}catch(n){const e=n instanceof Error?n.message:String(n);a.warn(`${r} binding inference skipped: ${e}`)}},c=new Map,j=(i,a,t)=>{try{const n=g(i,a);n.changed&&t.info?.(`${r} synced ${a.length.toFixed(0)} cron trigger(s) into ${n.wranglerPath??"wrangler.jsonc"}`);for(const s of n.warnings)t.warn(`${r} ${s}`);const e=n.preserved.join("\0"),o=$(n.preserved);o!==void 0&&(n.changed||c.get(i)!==e)&&t.info?.(`${r} ${o}`),c.set(i,e)}catch(n){const e=n instanceof Error?n.message:String(n);t.warn(`${r} cron trigger sync skipped: ${e}`)}try{const n=p(i);n.changed&&t.info?.(`${r} bumped compatibility_date to ${n.date??"unknown"} (Workers Cache enabled) → ${n.wranglerPath??"wrangler.jsonc"}`)}catch(n){const e=n instanceof Error?n.message:String(n);t.warn(`${r} compatibility date sync skipped: ${e}`)}};export{b as reconcileBindingsSafely,j as reconcileWranglerExtras};
@@ -204,7 +204,7 @@ interface DurableObjectSpec {
204
204
  * has a `.scheduler()` method at all. `@lunora/vite` depends on `@lunora/config`, so config
205
205
  * owning it is the direction the dependency graph allows.
206
206
  */
207
- declare const GENERATED_CLASS_MODULES: readonly ["agents", "containers", "scheduler", "workflows"];
207
+ declare const GENERATED_CLASS_MODULES: readonly ["agents", "containers", "scheduler", "shardRegistry", "workflows"];
208
208
  /** One {@link GENERATED_CLASS_MODULES} entry. */
209
209
  type GeneratedClassModule = (typeof GENERATED_CLASS_MODULES)[number];
210
210
  /**
@@ -204,7 +204,7 @@ interface DurableObjectSpec {
204
204
  * has a `.scheduler()` method at all. `@lunora/vite` depends on `@lunora/config`, so config
205
205
  * owning it is the direction the dependency graph allows.
206
206
  */
207
- declare const GENERATED_CLASS_MODULES: readonly ["agents", "containers", "scheduler", "workflows"];
207
+ declare const GENERATED_CLASS_MODULES: readonly ["agents", "containers", "scheduler", "shardRegistry", "workflows"];
208
208
  /** One {@link GENERATED_CLASS_MODULES} entry. */
209
209
  type GeneratedClassModule = (typeof GENERATED_CLASS_MODULES)[number];
210
210
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lunora/config",
3
- "version": "1.0.0-alpha.285",
3
+ "version": "1.0.0-alpha.286",
4
4
  "description": "Internal shared CLI + Vite config layer for Lunora: wrangler.jsonc validation, binding inference, and .dev.vars scaffolding",
5
5
  "keywords": [
6
6
  "bindings",
@@ -54,10 +54,10 @@
54
54
  "access": "public"
55
55
  },
56
56
  "dependencies": {
57
- "@lunora/codegen": "1.0.0-alpha.240",
57
+ "@lunora/codegen": "1.0.0-alpha.241",
58
58
  "@lunora/container": "1.0.0-alpha.63",
59
59
  "@lunora/errors": "1.0.0-alpha.47",
60
- "@lunora/seed": "1.0.0-alpha.170",
60
+ "@lunora/seed": "1.0.0-alpha.171",
61
61
  "@visulima/colorize": "2.1.1",
62
62
  "@visulima/find-ai-runner": "1.0.2",
63
63
  "@visulima/package": "5.0.20",
@@ -1 +0,0 @@
1
- import{readFileSync as i,existsSync as E}from"node:fs";import{parse as S}from"es-module-lexer";import{WRANGLER_FILES as O,readWranglerJsonc as d}from"./WRANGLER_FILES-UNW-xY5u.mjs";import{escapeRegExp as R}from"./DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";import{join as p}from"node:path";const x="_generated",b=["src/server.ts","src/server/index.ts","src/server/index.tsx","src/index.ts","src/worker.ts"],_=new Set(["build","coverage","dist",x,"node_modules","out","target"]),g=new Set([".client",".server"]),w=/[/\\]/u,h=t=>{const e=[];for(const r of t.split(w))r===""||r==="."||(r===".."&&e.length>0&&e.at(-1)!==".."?e.pop():e.push(r));return e},D=t=>h(t).slice(0,-1).some(e=>_.has(e)||e.startsWith(".")&&!g.has(e)),l={SchedulerDO:"SCHEDULER",SessionDO:"SESSION",ShardDO:"SHARD"},u=Object.keys(l),U=t=>Object.hasOwn(l,t),T="virtual:lunora/worker",v=["ShardDO"],B=["agents","containers","scheduler","workflows"],A="src/worker.ts",P=t=>{for(const e of O){const r=p(t,e);if(!E(r))continue;const{parsed:s}=d(r),o=s?.main;if(o===T)return{composed:!0};const a=p(t,A);if(E(a))return{composed:!1,path:a};if(typeof o=="string"&&!D(o)&&E(p(t,o)))return{composed:!1,path:p(t,o)};break}for(const e of b){const r=p(t,e);if(E(r))return{composed:!1,path:r}}return{composed:!1}},C=/(?:^|[\s,{])type$/u,m=(t,e)=>{const r=e.ls>=0?e.ls:e.s;return C.test(t.slice(0,r).trimEnd())},f=(t,e)=>{const r=R(e);return new RegExp(String.raw`\bexport\s+type\s+${r}\b`,"u").test(t)||new RegExp(String.raw`\bexport\s+type\s*\{[^}]*\b${r}\b`,"u").test(t)||new RegExp(String.raw`\bexport\s+\{[^}]*\btype\s+${r}\b`,"u").test(t)},W=t=>{const e=i(t,"utf8");let r;try{const[,s]=S(e);r=new Set(s.filter(o=>!m(e,o)).map(o=>o.n))}catch{r=new Set(u.filter(s=>new RegExp(String.raw`\bexport\b[^\n;]*\b${s}\b`,"u").test(e)&&!f(e,s)))}return u.filter(s=>r.has(s)).map(s=>({binding:l[s],className:s}))},$=(t,e,r)=>{if(e.length===0)return[];if(t.composed)return e.map(n=>({...n,exported:!0}));if(t.path===void 0)return e.map(n=>({...n,exported:!1}));const s=i(t.path,"utf8"),o=new RegExp(String.raw`\bexport\s*\*\s*from\s*["'][^"']*_generated\/${r}(?:\.js)?["']`).test(s);let a;try{const[,n]=S(s);a=new Set(n.filter(c=>!m(s,c)).map(c=>c.n))}catch{a=new Set(e.map(n=>n.className).filter(n=>new RegExp(String.raw`\bexport\b[^\n;]*\b${R(n)}\b`,"u").test(s)&&!f(s,n)))}return e.map(n=>{const c=o||a.has(n.className);return{...n,exported:c}})};export{v as COMPOSED_ENTRY_DURABLE_OBJECTS,A as COMPOSED_WORKER_ENTRY,l as DURABLE_OBJECT_BINDINGS,B as GENERATED_CLASS_MODULES,x as GENERATED_DIRECTORY,T as LUNORA_WORKER_VIRTUAL_ID,_ as NON_SOURCE_DIRECTORIES,g as SOURCE_DOT_DIRECTORIES,b as WORKER_ENTRY_FALLBACKS,$ as detectClassExports,W as detectExportedDurableObjects,U as isFrameworkDurableObject,D as isGeneratedOutput,P as resolveWorkerEntry};
@@ -1 +0,0 @@
1
- import{existsSync as y,statSync as T,readFileSync as O,readdirSync as $}from"node:fs";import{parse as D,init as F}from"es-module-lexer";import{discoverAgentInfo as Y}from"./discoverAgentInfo-CTdCSfYM.mjs";import{discoverContainerInfo as U}from"./discoverContainerInfo-EhZtEBQs.mjs";import{discoverFlags as W,FLAGS_FILENAME as K,discoverQueues as M,QUEUES_FILENAME as X}from"@lunora/codegen";import{d as C}from"./discover-info-Vj9d4qYt.mjs";import{escapeRegExp as q}from"./DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";import{discoverSchemaInfo as G}from"./discoverSchemaInfo-DJvevsCm.mjs";import{resolveWorkerEntry as H,COMPOSED_ENTRY_DURABLE_OBJECTS as Q,GENERATED_DIRECTORY as w,DURABLE_OBJECT_BINDINGS as V,detectExportedDurableObjects as J,detectClassExports as h}from"./COMPOSED_WORKER_ENTRY-5R-BECOC.mjs";import{discoverWorkflowInfo as z}from"./discoverWorkflowInfo-BsPvlo6O.mjs";import{join as u}from"node:path";const Z=(e,s)=>{const{error:o,value:r}=C(e,s,K,W);return o===void 0?{flags:r}:{error:o}},k=/^\s*import\s+type\b/,ee=new Set(["@lunora/agent","@lunora/agent/sandbox"]),m=["browserTool","jsCodeTool"],E=Object.fromEntries(m.map(e=>{const s=q(e);return[e,{fallback:new RegExp(String.raw`import\s+\{[^}]*\b${s}\b[^}]*\}\s+from\s+["']@lunora\/agent(?:\/sandbox)?["']`,"u"),name:new RegExp(String.raw`\b${s}\b`,"u"),typeSpecifier:new RegExp(String.raw`\btype\s+${s}\b`,"u")}]})),se=e=>{const s=e.indexOf("{");if(s===-1)return"";const o=e.indexOf("}",s+1);return o===-1?e.slice(s+1):e.slice(s+1,o)},re=(e,s)=>{if(k.test(e))return!1;const o=se(e);return E[s].name.test(o)&&!E[s].typeSpecifier.test(o)},oe=e=>{let s;try{const[o]=D(e);s=o.filter(r=>r.n!==void 0&&ee.has(r.n)).map(r=>e.slice(r.ss,r.se))}catch{s=void 0}return Object.fromEntries(m.map(o=>[o,s===void 0?E[o].fallback.test(e):s.some(r=>re(r,o))]))},te=(e,s)=>{const{error:o,value:r}=C(e,s,X,M);return o===void 0?{queues:r??[]}:{error:o,queues:[]}},ne=new Set([".cjs",".cts",".js",".jsx",".mjs",".mts",".ts",".tsx"]),ae=new Set([".git",".lunora-cache",".wrangler","dist",w,"node_modules"]),ie=["lunora","src"],ce=/\benv\s*\.\s*DB\b/,de=/\benv\s*\.\s*AI\b/,L=/\bctx\s*\.\s*pipelines\b/,P=/\bctx\s*\.\s*r2sql\b/,f={usesAi:{pattern:/\bfrom\s+["']@lunora\/ai["']/,source:"@lunora/ai"},usesAnalytics:{pattern:/\bfrom\s+["']@lunora\/bindings\/analytics["']/,source:"@lunora/bindings/analytics"},usesAuth:{pattern:/\bfrom\s+["']@lunora\/auth["']/,source:"@lunora/auth"},usesBrowser:{pattern:/\bfrom\s+["']@lunora\/browser["']/,source:"@lunora/browser"},usesHyperdrive:{pattern:/\bfrom\s+["']@lunora\/hyperdrive["']/,source:"@lunora/hyperdrive"},usesImages:{pattern:/\bfrom\s+["']@lunora\/bindings\/images["']/,source:"@lunora/bindings/images"},usesKv:{pattern:/\bfrom\s+["']@lunora\/bindings\/kv["']/,source:"@lunora/bindings/kv"},usesMail:{pattern:/\bfrom\s+["']@lunora\/mail["']/,source:"@lunora/mail"},usesNotify:{pattern:/\bfrom\s+["']@lunora\/notify["']/,source:"@lunora/notify"},usesPayment:{pattern:/\bfrom\s+["']@lunora\/payment["']/,source:"@lunora/payment"},usesPipelines:{pattern:L,source:"@lunora/bindings/pipelines"},usesR2sql:{pattern:P,source:"@lunora/bindings/r2sql"},usesScheduler:{pattern:/\bfrom\s+["']@lunora\/scheduler["']/,source:"@lunora/scheduler"},usesStorage:{pattern:/\bfrom\s+["']@lunora\/storage["']/,source:"@lunora/storage"},usesX402Charge:{pattern:/\bfrom\s+["']@lunora\/x402\/charge["']/,source:"@lunora/x402/charge"},usesX402Pay:{pattern:/\bfrom\s+["']@lunora\/x402\/pay["']/,source:"@lunora/x402/pay"}},l=Object.keys(f),ue="STRIPE_SECRET_KEY + STRIPE_WEBHOOK_SECRET (Stripe) or POLAR_ACCESS_TOKEN + POLAR_WEBHOOK_SECRET (Polar)",B=[...l,"needsD1","usesWorkerLoader"],le=()=>{const e={};for(const s of B)e[s]=!1;return e},d=Object.freeze(le()),S=(e,s)=>{const o={};for(const r of B)o[r]=e[r]||s[r];return o},pe=e=>{for(const s of l)if(f[s].source===e)return{...d,[s]:!0};return d},me=e=>{const[s]=D(e);let o=d;for(const r of s){const t=r.n;!t||k.test(e.slice(r.ss,r.se))||(o=S(o,pe(t)))}return o},fe=e=>{const s={...d};for(const o of l)s[o]=f[o].pattern.test(e);return s},be=e=>{let s;try{s=me(e)}catch{s=fe(e)}return S(s,{...d,needsD1:ce.test(e),usesAi:de.test(e),usesPipelines:L.test(e),usesR2sql:P.test(e)})},_=(e,s)=>{let o;try{o=$(e,{withFileTypes:!0})}catch{return}for(const r of o){if(r.isDirectory()){ae.has(r.name)||_(u(e,r.name),s);continue}const t=r.name.lastIndexOf(".");t!==-1&&ne.has(r.name.slice(t))&&s.push(u(e,r.name))}},ge=(e,s)=>G(e,s).info?.hasD1GlobalTable??!1,he=(e,s)=>{let o=d;for(const r of s){const t=u(e,r);if(!y(t)||!T(t).isDirectory())continue;const n=[];_(t,n);for(const a of n)o=S(o,be(O(a,"utf8")))}return o},Ee=(e,s)=>{const o=u(e,s),r=Object.fromEntries(m.map(n=>[n,!1]));if(!y(o)||!T(o).isDirectory())return r;const t=[];_(o,t);for(const n of t){const a=oe(O(n,"utf8"));for(const i of m)r[i]||=a[i]}return r},ye=(e,s,o)=>[...e.map(r=>r.exported?`${r.bindingName}/${r.className} (container "${r.exportName}" declared and exported)`:`hint: container "${r.exportName}" is declared but ${r.className} is not exported by the worker entry — add \`export * from "./lunora/_generated/containers"\``),...s.map(r=>r.exported?`${r.bindingName}/${r.className} (workflow "${r.exportName}" declared and exported)`:`hint: workflow "${r.exportName}" is declared but ${r.className} is not exported by the worker entry — add \`export * from "./lunora/_generated/workflows"\``),...o.map(r=>r.exported?`${r.bindingName}/${r.className} (agent "${r.exportName}" declared and exported)`:`hint: agent "${r.exportName}" is declared but ${r.className} is not exported by the worker entry — add \`export * from "./lunora/_generated/agents"\``)],Se=(e,s)=>[[e.usesAi,"AI (@lunora/ai imported or env.AI used)"],[e.usesAuth&&!s.has("SessionDO"),"hint: @lunora/auth is imported; its tables are D1-backed by default. For DO-backed auth (what @better-auth/scim needs), pass `namespace` to .auth() and export the generated auth DO class"],[e.usesScheduler&&!s.has("SchedulerDO"),"hint: @lunora/scheduler is imported but no SchedulerDO is exported by the worker entry"],[e.usesStorage,"hint: @lunora/storage is imported; add an r2_buckets binding (bucket binding names are user-defined)"],[e.usesMail,"hint: @lunora/mail is imported; set RESEND_API_KEY in .dev.vars (obtain at https://resend.com/api-keys)"],[e.usesPayment,`hint: @lunora/payment is imported; set the provider secrets in .dev.vars — ${ue}`],[e.usesBrowser,"browser (@lunora/browser imported) — self-describing { binding: BROWSER }"],[e.usesImages,"images (@lunora/bindings/images imported) — self-describing { binding: IMAGES }"],[e.usesAnalytics,"analytics_engine_datasets (@lunora/bindings/analytics imported) — self-describing { binding: ANALYTICS, dataset }"],[e.usesWorkerLoader,"worker_loaders (jsCodeTool imported in lunora/) — self-describing { binding: LOADER }"],[e.usesKv,"hint: @lunora/bindings/kv is imported; add a kv_namespaces binding ({ binding, id }) and pass env.<BINDING> to createKv() — the namespace id can't be auto-provisioned"],[e.usesHyperdrive,"hint: @lunora/hyperdrive is imported; run 'wrangler hyperdrive create' and add a 'hyperdrive' binding ({ binding, id }) — the id can't be auto-provisioned"],[e.usesPipelines,"hint: ctx.pipelines is used; run 'wrangler pipelines create <name>' and add a 'pipelines' binding ({ binding, pipeline }) — the pipeline resource can't be auto-provisioned"],[e.usesX402Charge,"hint: @lunora/x402/charge is imported; set the recipient wallet address as a [vars] entry (the var name is yours to choose) and pass it to the charge config — the x402 facilitator settles USDC to that address"],[e.usesX402Pay,"hint: @lunora/x402/pay is imported (ActionCtx-only, spends real funds); add a secrets_store_secrets[] binding for the agent wallet key (name it to match signer.secretName) and pair the pay rail with a spend policy — ctx.secrets reads a Secrets Store binding, not .dev.vars, so the key can't be auto-provisioned"]].filter(([r])=>r).map(([,r])=>r),_e=(e,s,o,r=[],t=[],n=[])=>{const a=new Set(e.map(c=>c.className)),i=e.map(c=>`${c.binding}/${c.className} (exported by worker entry)`);return s&&i.push("DB (.global() table declared)"),i.push(...ye(r,t,n),...Se(o,a)),i},ke=async e=>{await F;const s=e.schemaDir??"lunora",o=e.scanDirs??ie,r=he(e.projectRoot,o),t=Ee(e.projectRoot,s),n={...r,usesBrowser:r.usesBrowser||t.browserTool,usesWorkerLoader:t.jsCodeTool},a=H(e.projectRoot);let i;a.composed?i=[...Q,...y(u(e.projectRoot,s,w,"scheduler.ts"))?["SchedulerDO"]:[]].map(A=>({binding:V[A],className:A})):i=a.path===void 0?[]:J(a.path);const c=n.needsD1||ge(e.projectRoot,s),v=h(a,U(e.projectRoot,s).containers,"containers"),x=h(a,z(e.projectRoot,s).workflows,"workflows"),I=h(a,Y(e.projectRoot,s).agents,"agents"),j=[...te(e.projectRoot,s).queues],{flags:p}=Z(e.projectRoot,s),b=p?.provider==="flagship"&&p.mode==="binding"?p.bindingName:void 0,R={};for(const g of l)R[g]=n[g];const N=_e(i,c,n,v,x,I);return b!==void 0&&N.push(`hint: lunora/flags.ts uses Flagship in binding mode; add a flagship binding ({ binding: "${b}", app_id }) — the app_id can't be auto-provisioned`),{agents:I,containers:v,durableObjects:i,flagshipBinding:b,needsD1:c,queues:j,signals:N,usesFlags:p!==void 0,usesWorkerLoader:n.usesWorkerLoader,workflows:x,...R}},Le=e=>{const s=[];for(const o of l)e[o]&&s.push(f[o].source);return s};export{ke as inferLunoraBindings,Le as packageNamesFromBindings};