@lunora/config 1.0.0-alpha.34 → 1.0.0-alpha.340

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (128) hide show
  1. package/LICENSE.md +135 -0
  2. package/README.md +3 -3
  3. package/dist/cloudflare/index.d.mts +1252 -0
  4. package/dist/cloudflare/index.d.ts +1252 -0
  5. package/dist/cloudflare/index.mjs +1 -0
  6. package/dist/index.d.mts +1054 -917
  7. package/dist/index.d.ts +1054 -917
  8. package/dist/index.mjs +1 -23
  9. package/dist/packem_shared/ACCENT-CotPTfv7.mjs +7 -0
  10. package/dist/packem_shared/AGENT_MODE_ENV-D8MvSwPE.mjs +1 -0
  11. package/dist/packem_shared/AGENT_RULES_DIR-HrrbNZPy.mjs +1 -0
  12. package/dist/packem_shared/ALLOW_FORWARDED_ENV-BUndghJx.mjs +1 -0
  13. package/dist/packem_shared/BINDING_MANIFEST_VERSION-CfXEYG8e.mjs +1 -0
  14. package/dist/packem_shared/CLOUDFLARE_CLI_CONFIG_WARNING_ENV-BKMrOuXV.mjs +1 -0
  15. package/dist/packem_shared/CLOUDFLARE_DRIVER-Ci3VIqnk.mjs +1 -0
  16. package/dist/packem_shared/CLOUDFLARE_TOOLCHAIN_VERSIONS-DV5E_f_q.mjs +1 -0
  17. package/dist/packem_shared/CODEGEN_ENV-ZsCxV1kP.mjs +1 -0
  18. package/dist/packem_shared/COMPOSED_WORKER_ENTRY-Ciiba5g_.mjs +1 -0
  19. package/dist/packem_shared/DEFAULT_DEPLOY_TARGET-CfoV0tDu.mjs +1 -0
  20. package/dist/packem_shared/DEFAULT_OBSERVABILITY-bN6UkTMx.mjs +1 -0
  21. package/dist/packem_shared/DEV_BINDINGS_FILE-C0ZN_XlP.mjs +4 -0
  22. package/dist/packem_shared/DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs +6 -0
  23. package/dist/packem_shared/DEV_WORKER_ENV_VALUE-2XFXmRrP.mjs +1 -0
  24. package/dist/packem_shared/GLOBAL_FETCH_STRICTLY_PUBLIC_FLAG-f8CnJha3.mjs +1 -0
  25. package/dist/packem_shared/LINKED_PROJECT_DIR-Ba5qPEwo.mjs +2 -0
  26. package/dist/packem_shared/LUNORA_EVENT_SOURCE-B9ZVohjO.mjs +1 -0
  27. package/dist/packem_shared/LUNORA_IGNORED_PATHS-U93uPxrW.mjs +19 -0
  28. package/dist/packem_shared/LUNORA_TAG-CiQM3BkI.mjs +1 -0
  29. package/dist/packem_shared/LunoraReporter-f277GLNT.mjs +6 -0
  30. package/dist/packem_shared/PACKAGE_SECRETS_REGISTRY-38Plje8b.mjs +1 -0
  31. package/dist/packem_shared/POLICY_SCAFFOLD_ENDPOINT-BmJYwAy2.mjs +1 -0
  32. package/dist/packem_shared/REMOTE_ELIGIBLE_KEYS-PLeh_74E.mjs +1 -0
  33. package/dist/packem_shared/REQUIRED_COMPATIBILITY_DATE-OLQlG0oj.mjs +1 -0
  34. package/dist/packem_shared/SCHEMA_EDIT_ENDPOINT-BeTxqCuQ.mjs +1 -0
  35. package/dist/packem_shared/SEED_ENDPOINT-2B56PN_H.mjs +1 -0
  36. package/dist/packem_shared/STUDIO_PATH-CSx_psKS.mjs +1 -0
  37. package/dist/packem_shared/UNEXPORTED_CLASS_MARKER-IAK9PiDz.mjs +1 -0
  38. package/dist/packem_shared/WORKERS_CACHE_MIN_DATE-0k9ABJtF.mjs +1 -0
  39. package/dist/packem_shared/WRANGLER_FILES-UNW-xY5u.mjs +1 -0
  40. package/dist/packem_shared/acceptsConnection-DHhUYGjT.mjs +2 -0
  41. package/dist/packem_shared/addArgsFor-CYZKhNIo.mjs +1 -0
  42. package/dist/packem_shared/applyAdditiveEdit-CH0VhMJ2.mjs +6 -0
  43. package/dist/packem_shared/applyModify-DKP2l6S9.mjs +1 -0
  44. package/dist/packem_shared/applyStudioAssetCache-DHQEJuuv.mjs +1 -0
  45. package/dist/packem_shared/assertWranglerSatisfiesSchema-Dy0WXvP8.mjs +3 -0
  46. package/dist/packem_shared/assetContentType-CUb5bpbI.mjs +1 -0
  47. package/dist/packem_shared/buildPackageSecretsBlock-BWV_VxqV.mjs +19 -0
  48. package/dist/packem_shared/celld-config-D-L6uskI.mjs +3 -0
  49. package/dist/packem_shared/classifyPolicyEdit-DJi9Fk8G.mjs +24 -0
  50. package/dist/packem_shared/collectExportGaps-BfnHx4y3.mjs +2 -0
  51. package/dist/packem_shared/createConfirm-D5mKTMHj.mjs +7 -0
  52. package/dist/packem_shared/describePreservedCrons-C5KPuPy3.mjs +1 -0
  53. package/dist/packem_shared/describeWithheldWorkersAi-IIxe3TuI.mjs +1 -0
  54. package/dist/packem_shared/detectFramework-Dfpvu6rD.mjs +1 -0
  55. package/dist/packem_shared/discover-info-DC2MrAIM.mjs +1 -0
  56. package/dist/packem_shared/discoverAgentInfo-pqFMJBtJ.mjs +1 -0
  57. package/dist/packem_shared/discoverContainerInfo-MI3HIHmJ.mjs +1 -0
  58. package/dist/packem_shared/discoverSchemaInfo-BLe1EVI8.mjs +1 -0
  59. package/dist/packem_shared/discoverWorkflowInfo-zW7Tt0Tn.mjs +1 -0
  60. package/dist/packem_shared/guards-Buu_E7mP.mjs +1 -0
  61. package/dist/packem_shared/hasCloudflareCredentials-byvHpEiD.mjs +1 -0
  62. package/dist/packem_shared/infer-bindings-BsgN5eCm.mjs +1 -0
  63. package/dist/packem_shared/infer-bindings.d-RLlCg7Zn.d.mts +467 -0
  64. package/dist/packem_shared/infer-bindings.d-RLlCg7Zn.d.ts +467 -0
  65. package/dist/packem_shared/inferLunoraBindings-BCWWtftG.mjs +1 -0
  66. package/dist/packem_shared/interpretRemote-C9yJC_ZK.mjs +1 -0
  67. package/dist/packem_shared/lunora-manifest-DuH_Cmyu.mjs +6 -0
  68. package/dist/packem_shared/materializeServiceDevConfigs-DLUHefD-.mjs +1 -0
  69. package/dist/packem_shared/mergeWranglerEnvironment-DXiB-HcS.mjs +1 -0
  70. package/dist/packem_shared/package-secrets-registry-BeheNwsP.mjs +1 -0
  71. package/dist/packem_shared/parseDevVariable-teAAahVD.mjs +1 -0
  72. package/dist/packem_shared/parseSchema-D1Wbr1qv.mjs +1 -0
  73. package/dist/packem_shared/policy-scaffold.d-D2H4_G01.d.mts +86 -0
  74. package/dist/packem_shared/policy-scaffold.d-D2H4_G01.d.ts +86 -0
  75. package/dist/packem_shared/process-tree-once-Ou4SfxKM.mjs +1 -0
  76. package/dist/packem_shared/readProjectDependencies-l3uhUKjo.mjs +1 -0
  77. package/dist/packem_shared/reconcile-services-DFqH4eMQ.mjs +1 -0
  78. package/dist/packem_shared/reconcileBindingsSafely-Ck6LaDO-.mjs +1 -0
  79. package/dist/packem_shared/reconcileWranglerCompatibilityDate-hocXEuRA.mjs +1 -0
  80. package/dist/packem_shared/renderStudioHtml-ByowDtMl.mjs +15 -0
  81. package/dist/packem_shared/resolveSchemaDirectory-Ca5P6KuP.mjs +1 -0
  82. package/dist/packem_shared/runPostCodegenHook-Dx3yTsYZ.mjs +1 -0
  83. package/dist/packem_shared/scanWranglerVariablesForSecrets-BFTVje1q.mjs +1 -0
  84. package/dist/packem_shared/serveJsonHandler-Dv0EdCb9.mjs +1 -0
  85. package/dist/packem_shared/startCelldDevSession-BLFsd6jG.mjs +1 -0
  86. package/dist/packem_shared/streamContainerLogs-0nko1qpv.mjs +2 -0
  87. package/dist/packem_shared/validate-bindings-CvNBF3U4.mjs +1 -0
  88. package/dist/packem_shared/withTailConsumer-DngzpJMK.mjs +1 -0
  89. package/dist/packem_shared/worker-entry-checks-AIASCYl7.mjs +1 -0
  90. package/dist/packem_shared/wranglerCodegenInputs-CbisphsH.mjs +1 -0
  91. package/dist/packem_shared/wranglerToAlchemy-CBO2ucRm.mjs +6 -0
  92. package/dist/packem_shared/write-atomic-CK6VZaPI.mjs +1 -0
  93. package/dist/studio-host/index.d.mts +314 -110
  94. package/dist/studio-host/index.d.ts +314 -110
  95. package/dist/studio-host/index.mjs +1 -7
  96. package/package.json +16 -7
  97. package/dist/packem_shared/ACCENT-DW1XJn8i.mjs +0 -40
  98. package/dist/packem_shared/AGENT_RULES_DIR-lcgC08aE.mjs +0 -40
  99. package/dist/packem_shared/DEV_VARS_EXAMPLE_FILE-dJPNTEnK.mjs +0 -37
  100. package/dist/packem_shared/LINKED_PROJECT_DIR-CXwXzV_C.mjs +0 -52
  101. package/dist/packem_shared/LUNORA_CONFIG_FILE-CtcIcB5-.mjs +0 -34
  102. package/dist/packem_shared/LUNORA_EVENT_SOURCE-D2fDeGB6.mjs +0 -86
  103. package/dist/packem_shared/LunoraReporter-Ci-bDCK9.mjs +0 -70
  104. package/dist/packem_shared/PACKAGE_SECRETS_REGISTRY-B8t_SdoZ.mjs +0 -70
  105. package/dist/packem_shared/POLICY_SCAFFOLD_ENDPOINT-CiC2IGKx.mjs +0 -103
  106. package/dist/packem_shared/REMOTE_ELIGIBLE_KEYS-BC7_e9Bz.mjs +0 -105
  107. package/dist/packem_shared/REQUIRED_COMPATIBILITY_DATE-2YYyWJUq.mjs +0 -561
  108. package/dist/packem_shared/SCHEMA_EDIT_ENDPOINT-Df-Wrix-.mjs +0 -99
  109. package/dist/packem_shared/SEED_ENDPOINT-DVCjaGO-.mjs +0 -61
  110. package/dist/packem_shared/WRANGLER_FILES-DwSuC-Kn.mjs +0 -25
  111. package/dist/packem_shared/applyAdditiveEdit-C-snTFEV.mjs +0 -228
  112. package/dist/packem_shared/buildPackageSecretsBlock-DWDKHViT.mjs +0 -243
  113. package/dist/packem_shared/classifyPolicyEdit-BHeAqF8P.mjs +0 -99
  114. package/dist/packem_shared/createConfirm-fvpdgJ9s.mjs +0 -100
  115. package/dist/packem_shared/detectFramework-Br-BcPBq.mjs +0 -41
  116. package/dist/packem_shared/discoverContainerInfo-BXFs6Wav.mjs +0 -19
  117. package/dist/packem_shared/discoverSchemaInfo-BB-CKlTK.mjs +0 -25
  118. package/dist/packem_shared/discoverWorkflowInfo-CedvR0mn.mjs +0 -19
  119. package/dist/packem_shared/inferLunoraBindings-ByMwG-gH.mjs +0 -352
  120. package/dist/packem_shared/loadStudioAssets-Csk5RS4E.mjs +0 -28
  121. package/dist/packem_shared/parseDevVariable-CJiq2IwE.mjs +0 -30
  122. package/dist/packem_shared/parseSchema-DSeyktvG.mjs +0 -107
  123. package/dist/packem_shared/policy-scaffold.d-DCmwn7zQ.d.mts +0 -74
  124. package/dist/packem_shared/policy-scaffold.d-DCmwn7zQ.d.ts +0 -74
  125. package/dist/packem_shared/reconcileWranglerBindings-Cruwwx1M.mjs +0 -334
  126. package/dist/packem_shared/renderStudioHtml-449Ysn75.mjs +0 -37
  127. package/dist/packem_shared/serveJsonHandler-B4OLTGLS.mjs +0 -86
  128. package/dist/packem_shared/streamContainerLogs-BZ4cOZwH.mjs +0 -157
@@ -0,0 +1 @@
1
+ import{discoverWorkflows as f,WORKFLOWS_FILENAME as i}from"@lunora/codegen";import{d as t}from"./discover-info-DC2MrAIM.mjs";const d=(r,s)=>{const{error:o,value:e}=t(r,s,i,f);return o===void 0?{workflows:e??[]}:{error:o,workflows:[]}};export{d as discoverWorkflowInfo};
@@ -0,0 +1 @@
1
+ const n=t=>typeof t=="object"&&t!==null&&!Array.isArray(t),s=t=>typeof t=="string"&&t.length>0;export{s as a,n as i};
@@ -0,0 +1 @@
1
+ import{readFileSync as d,readdirSync as m}from"node:fs";import{homedir as L}from"node:os";import{join as r}from"node:path";const u=[".env",".env.local",".env.development",".env.development.local"],l=["CLOUDFLARE_API_TOKEN","CF_API_TOKEN"],f=["CLOUDFLARE_API_KEY","CF_API_KEY"],A=["CLOUDFLARE_EMAIL","CF_EMAIL"],v=new Set([...l,...f,...A]),O=/^export\s+/u,S=/\r?\n/u,p=/^(["'])(.*)\1$/u,E=t=>t!==void 0&&t.trim()!=="",C=(t,o)=>[o,t.XDG_CONFIG_HOME,r(o,"Library","Preferences"),r(o,".config"),t.APPDATA===void 0?void 0:r(t.APPDATA,"xdg.config"),r(o,"AppData","Roaming","xdg.config")].filter(s=>E(s)),I=t=>{try{return m(t).length>0}catch{return!1}},K=t=>{const o=new Set;for(const s of u){let n;try{n=d(r(t,s),"utf8")}catch{continue}for(const e of n.split(S)){const c=e.trim().replace(O,""),i=c.indexOf("=");if(c.startsWith("#")||i===-1)continue;const a=c.slice(0,i).trim(),_=c.slice(i+1).trim().replace(p,"$2");v.has(a)&&E(_)&&o.add(a)}}return o},F=(t={})=>{const o=t.env??process.env,s=t.projectRoot===void 0?new Set:K(t.projectRoot),n=e=>E(o[e])||s.has(e);return l.some(e=>n(e))||f.some(e=>n(e))&&A.some(e=>n(e))?!0:C(o,t.home??L()).some(e=>I(r(e,".wrangler","config")))};export{F as hasCloudflareCredentials};
@@ -0,0 +1 @@
1
+ import{existsSync as w,statSync as P,readFileSync as j,readdirSync as F}from"node:fs";import{discoverFlags as B,FLAGS_FILENAME as L,discoverQueues as k,CAPABILITY_PROBES as R,readServiceBindings as G,mayReadCapabilityContext as W,foldCapabilitySignals as C,capabilitiesUsedBy as Y,discoverNotifyChannels as K,NOTIFY_FILENAME as q,sourceCapabilitySignals as M}from"@lunora/codegen";import{init as U}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-MI3HIHmJ.mjs";import{escapeRegExp as V}from"./DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";import{d as I}from"./discover-info-DC2MrAIM.mjs";import{relative as J,sep as z,isAbsolute as Z,join as y}from"node:path";import{P as ee}from"./package-secrets-registry-BeheNwsP.mjs";import{discoverSchemaInfo as se}from"./discoverSchemaInfo-BLe1EVI8.mjs";import{resolveWorkerEntry as te,composedEntryDurableObjects as re,GENERATED_DIRECTORY as x,DURABLE_OBJECT_BINDINGS as ne,detectExportedDurableObjects as oe,detectClassExports as A,isMergedProject as ae}from"./COMPOSED_WORKER_ENTRY-Ciiba5g_.mjs";import{discoverWorkflowInfo as ie}from"./discoverWorkflowInfo-zW7Tt0Tn.mjs";const ce="https://api.cloudflare.com/client/v4/accounts/<ACCOUNT_ID>/artifacts/namespaces",de=e=>{const s='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; ${s}. 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 ${ce} and body { "namespace": "<name>", "jurisdiction": "${e}" }, then ${s}. A namespace's jurisdiction cannot be changed, and one created implicitly by the first repo create() is unrestricted.`},ue=(e,s)=>{const{error:r,value:t}=I(e,s,L,B);return r===void 0?{flags:t}:{error:r}},le=(e,s)=>{const r=J(s,e);return r!==""&&r!==".."&&!r.startsWith(`..${z}`)&&!Z(r)},pe=(e,s)=>{const{error:r,value:t}=I(e,s,void 0,k);return r===void 0?{queues:t??[]}:{error:r,queues:[]}},me=new Set([".cjs",".cts",".js",".jsx",".mjs",".mts",".ts",".tsx"]),he=new Set([".git",".lunora-cache",".wrangler","dist",x,"node_modules"]),fe=["lunora","src"],ge=/\benv\s*\.\s*DB\b/,be=/\benv\s*\.\s*AI\b/,N=["ai","aiSearch","analytics","analyticsSql","artifacts","browser","hyperdrive","images","kv","mail","notify","payments","pipelines","r2sql","scheduler","storage","x402"],D=e=>`uses${e.charAt(0).toUpperCase()}${e.slice(1)}`,$=[["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"]],T=[...N.map(e=>[D(e),R[e].moduleSpecifier]),...$].toSorted(([e],[s])=>e.localeCompare(s)),ye=[["usesNotifyFcm","@lunora/notify:fcm"],["usesNotifyWebPush","@lunora/notify:webPush"]],Se=["@lunora/agent","@lunora/agent/sandbox"],ve=new RegExp(String.raw`["'\x60](?:${[...T.map(([,e])=>e),...Se].map(e=>V(e)).join("|")})["'\x60]`,"u"),o=e=>{const{contextProperty:s,moduleSpecifier:r}=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)",Ae=()=>{let e;return()=>(e??=new H({compilerOptions:{allowJs:!0},useInMemoryFileSystem:!0}),e)},xe=(e,s,r)=>{const t=r(),n=t.createSourceFile(`/scan/${s.slice(s.lastIndexOf("/")+1)}`,e,{overwrite:!0}),a=M(n);return t.removeSourceFile(n),a},O=(e,s)=>{let r;try{r=F(e,{withFileTypes:!0})}catch{return}for(const t of r){if(t.isDirectory()){he.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))}},Ie=(e,s)=>{const{info:r}=se(e,s);return{jurisdiction:r?.jurisdiction,needsD1:r?.hasD1GlobalTable??!1}},_e=(e,s,r)=>{const t=Ae(),n=y(e,r),a=[],f=[];let i=!1,c=!1;for(const d of s){const u=y(e,d);if(!w(u)||!P(u).isDirectory())continue;const h=[];O(u,h);for(const l of h){const b=j(l,"utf8"),p=le(l,n);i||=be.test(b),c||=ge.test(b),(ve.test(b)||p&&W(b))&&(p?a:f).push(xe(b,l,t))}}const g=C(a),S=C([g,...f]),v=new Set([...S.valueImports,...S.dynamicImports]),m=Y({contextReads:g.contextReads,valueImports:v});return{...Object.fromEntries([...N.map(d=>[D(d),m.has(d)]),...$.map(([d,u])=>[d,v.has(u)])]),needsD1:c,usesAi:m.has("ai")||i,usesBrowser:m.has("browser")||g.sandboxTools.usesSandboxBrowser,usesWorkerLoader:g.sandboxTools.usesSandboxLoader}},Ce=(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"\``)],Re=(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,`hint: ${o("kv")}; add a kv_namespaces binding ({ binding, id }) and pass env.<BINDING> to createKv() — the namespace id can't be auto-provisioned`],[e.usesHyperdrive,`hint: ${o("hyperdrive")}; run 'wrangler hyperdrive create' and add a 'hyperdrive' binding ({ binding, id }) — the id can't be auto-provisioned`],[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,`hint: ${de(r.jurisdiction)}`],[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),Ne=(e,s,r,t=[],n=[],a=[])=>{const f=new Set(e.map(c=>c.className)),i=e.map(c=>`${c.binding}/${c.className} (exported by worker entry)`);return s.needsD1&&i.push("DB (.global() table declared)"),i.push(...Ce(t,n,a),...Re(r,f,s)),i},Ye=async e=>{await U;const s=e.schemaDir??"lunora",r=e.scanDirs??fe,t=_e(e.projectRoot,r,s),n=te(e.projectRoot);let a;n.composed?a=re(y(e.projectRoot,s,x)).map(_=>({binding:ne[_],className:_})):a=n.path===void 0?[]:oe(n.path);const f=Ie(e.projectRoot,s),i={...f,needsD1:t.needsD1||f.needsD1},c=A(n,Q(e.projectRoot,s).containers,"containers"),g=A(n,ie(e.projectRoot,s).workflows,"workflows"),S=A(n,X(e.projectRoot,s).agents,"agents"),v=[...pe(e.projectRoot,s).queues],{flags:m}=ue(e.projectRoot,s),E=I(e.projectRoot,s,q,K),d=E.error===void 0?E.value:{hasFcm:!0,hasWebPush:!0},u=m?.provider==="flagship"&&m.mode==="binding"?m.bindingName:void 0,h=Ne(a,i,t,c,g,S);!n.composed&&ae(y(e.projectRoot,s,x))&&!a.some(p=>p.className==="LunoraDO")&&h.push("hint: durableObjects.merge is set, but the worker entry exports no LunoraDO — export one built with mergeDurableObjects, or the classes stay separate"),u!==void 0&&h.push(`hint: lunora/flags.ts uses Flagship in binding mode; add a flagship binding ({ binding: "${u}", app_id }) — the app_id can't be auto-provisioned`);const l=G(e.projectRoot),b=l.error===void 0?l.services:void 0;return l.error!==void 0&&h.push(`hint: lunora.config \`services\` not reconciled — ${l.error}`),h.push(...l.services.map(p=>`${p.binding} → ${p.worker} (lunora.config services.${p.name})`)),{...t,agents:S,containers:c,durableObjects:a,flagshipBinding:u,...i.jurisdiction===void 0?{}:{jurisdiction:i.jurisdiction},needsD1:i.needsD1,queues:v,services:b,signals:h,usesFlags:m!==void 0,usesNotifyFcm:d?.hasFcm??!1,usesNotifyWebPush:d?.hasWebPush??!1,workflows:g}},Ke=e=>[...T,...ye].filter(([s,r])=>e[s]&&ee[r]!==void 0).map(([,s])=>s);export{de as a,Ye as i,Ke as s};
@@ -0,0 +1,467 @@
1
+ import { SchemaIR, AgentIR, ContainerIR, QueueIR, ServiceBindingIR, WorkflowIR } from '@lunora/codegen';
2
+ /**
3
+ * `DeployDriver` — the provider-neutral seam between a Lunora command and the
4
+ * host CLI that carries it out (plan 114, §5.3).
5
+ *
6
+ * The seam is the **toolchain surface**: which command a host runs to deploy,
7
+ * serve, tail, or set a secret. A driver only *describes* that command
8
+ * ({@link ToolchainCommand}); it never spawns. The CLI keeps ownership of
9
+ * running it — package-manager resolution (`pnpm exec` / `npx --` / `bun x`)
10
+ * and the injected spawner its tests substitute — so the driver stays free of
11
+ * process concerns and remains trivially testable as a pure function.
12
+ *
13
+ * Each request type below is deliberately neutral: `preview`, `environment`,
14
+ * `temporary` are concepts, not wrangler flags. A second host maps the same
15
+ * request onto its own CLI without the caller changing.
16
+ *
17
+ * Three drivers are registered: Cloudflare (`cloudflare/cloudflare-driver.ts`)
18
+ * and celld (`celld/celld-driver.ts`), which ship toolchains, and Node
19
+ * (`node/node-driver.ts`), which has none — it is a codegen target, and
20
+ * `lunora deploy` / `lunora dev` refuse it at selection.
21
+ *
22
+ * **What this seam deliberately does NOT carry: configuration inference.** It
23
+ * used to, through an `infer`/`provision` pair over a provider-neutral
24
+ * `ResourceGraph`. Nothing ever called either one — every consumer reads
25
+ * `.toolchain` or just validates the target — and the arm rotted in place: the
26
+ * Node driver was *only* `infer` + `provision`, so its report of what that
27
+ * target cannot serve (containers, undispatched crons) could not reach an
28
+ * operator however wrong the app was. The reason it never got wired is worth
29
+ * keeping: writing real host configuration needs the host's own encodings —
30
+ * binding names, DO class wiring, migration tags — which a neutral graph
31
+ * necessarily discards, so `provision` re-derived them anyway and the graph was
32
+ * decorative. A second target that needs to share inference should grow the
33
+ * seam back with a caller attached, and with an encoding escape hatch.
34
+ */
35
+ /**
36
+ * A host CLI invocation, described but not run.
37
+ *
38
+ * `tool` is the binary name only (`"wrangler"`); the caller resolves how to
39
+ * execute it through the project's package manager (see `toolchainExecArgs`).
40
+ * Keeping that split means a driver never has to know whether the project uses
41
+ * pnpm, npm, yarn, or bun.
42
+ */
43
+ interface ToolchainCommand {
44
+ /** Arguments for {@link ToolchainCommand.tool}. */
45
+ args: ReadonlyArray<string>;
46
+ /**
47
+ * The tool is a standalone binary installed on `PATH`, not a project
48
+ * dependency: run it directly. Going through the package manager would be
49
+ * wrong for it — `npx --` / `bun x` fetch an npm package of the same name
50
+ * when none is installed locally, which for a non-npm binary is somebody
51
+ * else's code.
52
+ */
53
+ onPath?: boolean;
54
+ /** The host CLI binary, e.g. `"wrangler"`. */
55
+ tool: string;
56
+ }
57
+ /** Neutral options for a deploy. */
58
+ interface DeployRequest {
59
+ /** Host config file to deploy, when the flow uses a projected one (see {@link DeployDriver.projectConfig}). */
60
+ configPath?: string;
61
+ /** Validate and bundle without publishing — nothing ships. */
62
+ dryRun?: boolean;
63
+ /** Deploy this entry file instead of the host config's default (framework composition). */
64
+ entry?: string;
65
+ /** Named deployment environment, when the host supports them. */
66
+ environment?: string;
67
+ /** Write the built bundle (and any build metadata) to this directory. */
68
+ outDir?: string;
69
+ /** Upload a preview/versioned artifact instead of taking production traffic. */
70
+ preview?: boolean;
71
+ /** Deploy to a short-lived, unauthenticated account where the host offers one. */
72
+ temporary?: boolean;
73
+ }
74
+ /** Neutral options for a local dev server. */
75
+ interface DevRequest {
76
+ /** Host config file to run against, when the flow uses a generated one. */
77
+ configPath?: string;
78
+ /** Named environment. */
79
+ environment?: string;
80
+ /** Extra host-specific flags the caller has already resolved. */
81
+ extraArgs?: ReadonlyArray<string>;
82
+ }
83
+ /** Neutral options for tailing live logs. */
84
+ interface TailRequest {
85
+ /** Named environment. */
86
+ environment?: string;
87
+ /** Output format the host tail supports (`"json"`, `"pretty"`, …). */
88
+ format?: string;
89
+ /** Free-text filter. */
90
+ search?: string;
91
+ /** Status filter (`"error"`, `"ok"`, …). */
92
+ status?: string;
93
+ /** Tail a short-lived account's deployment. */
94
+ temporary?: boolean;
95
+ /** Tail a specific deployed worker/service by name, when the host addresses them individually. */
96
+ worker?: string;
97
+ }
98
+ /** Neutral options for reading or writing deployment secrets. */
99
+ interface SecretRequest {
100
+ /** Named environment. */
101
+ environment?: string;
102
+ /** The secret's name — required for `put`, unused for `list`. */
103
+ key?: string;
104
+ /** Operate against a short-lived account. */
105
+ temporary?: boolean;
106
+ }
107
+ /**
108
+ * The host's command-line surface. Optional as a whole: a host with no vendor
109
+ * CLI (the Node target; a hypothetical API-driven one) declares none, and
110
+ * `isRunnableTarget` refuses it for the commands that would have to shell out.
111
+ *
112
+ * `deploy` and `dev` are what make a target runnable. The secret and tail
113
+ * commands are optional on their own, because a runnable host can simply not
114
+ * have them — celld keeps configuration in plain `vars` and has no log tail —
115
+ * and the commands that need one say so rather than guessing a substitute.
116
+ */
117
+ interface DriverToolchain {
118
+ /** The command that deploys the app. */
119
+ deploy: (request: DeployRequest) => ToolchainCommand;
120
+ /** The command that runs a local dev server. */
121
+ dev: (request: DevRequest) => ToolchainCommand;
122
+ /**
123
+ * Where `lunora dev` runs the worker. `"workerd"`: `wrangler dev`, or the
124
+ * Vite plugin's `@cloudflare/vite-plugin`, whichever flavor the project
125
+ * picks. `"own"`: the host's dev server ({@link DriverToolchain.dev}) on
126
+ * the projected config, always the standalone flavor — neither Vite nor a
127
+ * framework sidecar can serve the worker on that runtime.
128
+ */
129
+ readonly devServer: "own" | "workerd";
130
+ /**
131
+ * Whether `lunora deploy` builds and pushes container images itself
132
+ * (railpack, into the host's registry) before `deploy`. `false` when the
133
+ * host CLI builds each image from its Dockerfile during the deploy.
134
+ */
135
+ readonly prebuildsContainerImages: boolean;
136
+ /** The command that lists remote secret names, when the host has a secret store. */
137
+ secretList?: (request: SecretRequest) => ToolchainCommand;
138
+ /** The command that writes one secret, when the host has a secret store. Its value is passed on stdin, never argv. */
139
+ secretPut?: (request: SecretRequest) => ToolchainCommand;
140
+ /** The command that tails live logs, when the host has one. */
141
+ tail?: (request: TailRequest) => ToolchainCommand;
142
+ }
143
+ /** What a {@link DeployDriver.projectConfig} projection is for — a dev server may need a different source than a deploy. */
144
+ type ProjectionPurpose = "deploy" | "dev";
145
+ /**
146
+ * The result of {@link DeployDriver.projectConfig}: a plan, not yet on disk.
147
+ * The caller validates the request it is for (the toolchain's argv builder
148
+ * refuses unsupported options), then calls `write` — so a refused command
149
+ * changes nothing.
150
+ */
151
+ interface ProjectedConfig {
152
+ /** Where the projection goes, to pass as the request's `configPath`. */
153
+ configPath: string;
154
+ /** Every key removed, as a dotted path (`observability`, `containers[0].rollout_step_percentage`). */
155
+ dropped: ReadonlyArray<string>;
156
+ /** Write the projection (and any build-artifact cleanup it planned). */
157
+ write: () => void;
158
+ }
159
+ /** A deploy target's implementation: an identity the registry resolves, and the host CLI surface (if any) behind it. */
160
+ interface DeployDriver {
161
+ /** The target id this driver serves (`"cloudflare"`, …) — matches codegen's `target`. */
162
+ readonly id: string;
163
+ /** Human-readable target name, for logs. */
164
+ readonly name: string;
165
+ /**
166
+ * Rewrite the project's wrangler config into the form this host's CLI
167
+ * accepts, and return the file to hand `deploy`/`dev` as `configPath`.
168
+ * Absent when the host reads the project's config as-is (Cloudflare).
169
+ *
170
+ * Needed because Lunora's reconcilers and templates write Cloudflare-only
171
+ * keys (`observability`, `limits`, …) that a Workers-compatible host with a
172
+ * strict config reader refuses outright. `dropped` names what was removed,
173
+ * so the caller can say so instead of silently deploying less than the
174
+ * config describes.
175
+ */
176
+ readonly projectConfig?: (projectRoot: string, purpose: ProjectionPurpose) => ProjectedConfig;
177
+ /**
178
+ * The host's command-line surface, or `undefined` for a host that has none.
179
+ * Pure: these build argv, they never spawn.
180
+ */
181
+ readonly toolchain?: DriverToolchain;
182
+ }
183
+ /** One filterable Vectorize metadata property a schema declares. */
184
+ interface VectorMetadataDeclaration {
185
+ /** The vector index the property belongs to. */
186
+ index: string;
187
+ /**
188
+ * The validator kind behind the column, with `v.optional(...)` and a
189
+ * nullable union unwrapped (metadata columns are usually optional), or
190
+ * `undefined` when the column isn't in the owning table's shape. Callers map it to the Vectorize
191
+ * metadata type; a kind that can't be filtered on is reported, not indexed.
192
+ */
193
+ kind: string | undefined;
194
+ /** Column mirrored into vector metadata. */
195
+ property: string;
196
+ }
197
+ interface SchemaInfo {
198
+ /**
199
+ * Whether the schema declares a **D1-backed** `.global()` table — the only
200
+ * flavour that needs the `DB` binding and the app's `.global({ d1 })` chain.
201
+ * A `.global({ backend: "hyperdrive" })` table needs neither, and counting it
202
+ * here demanded a D1 database of a project that has none.
203
+ */
204
+ hasD1GlobalTable: boolean;
205
+ /** Whether the schema declares a `.global({ backend: "hyperdrive" })` table — needs the app's `.hyperdriveGlobal(...)` chain instead. Required, not optional: the only producer always knows the answer, and `?` made every consumer read a two-valued fact as three-valued. */
206
+ hasHyperdriveGlobalTable: boolean;
207
+ /**
208
+ * Data-residency jurisdiction declared via `defineSchema(...).jurisdiction("…")`.
209
+ * It pins the app's Durable Objects only; KV namespaces and R2 buckets carry
210
+ * their own jurisdiction, set when they are created.
211
+ */
212
+ jurisdiction?: SchemaIR["jurisdiction"];
213
+ /** Names of vector indexes declared via `.vectorize()` / `defineVectorIndex()`. */
214
+ vectorIndexNames?: ReadonlyArray<string>;
215
+ /**
216
+ * Metadata properties declared filterable on a vector index. Cloudflare
217
+ * needs an explicit metadata index per property before a `filter` can match
218
+ * anything, so deploy provisions these and doctor reports them.
219
+ */
220
+ vectorMetadata?: ReadonlyArray<VectorMetadataDeclaration>;
221
+ }
222
+ interface DiscoverSchemaInfoResult {
223
+ /** Parse error message, when the schema exists but could not be analyzed. */
224
+ error?: string;
225
+ /** Schema facts, or `undefined` when no `schema.ts` exists or parsing failed. */
226
+ info: SchemaInfo | undefined;
227
+ }
228
+ /**
229
+ * Discover {@link SchemaInfo} for a project. Returns `{ info: undefined }` when
230
+ * the project declares no `schema.ts` (not an error), or `{ info: undefined,
231
+ * error }` when a present schema could not be parsed — callers decide whether a
232
+ * parse failure is a warning (validator) or simply ignorable (inference).
233
+ */
234
+ declare const discoverSchemaInfo: (projectRoot: string, schemaDirectory: string) => DiscoverSchemaInfoResult;
235
+ interface DurableObjectSpec {
236
+ binding: string;
237
+ className: string;
238
+ }
239
+ /**
240
+ * Canonical Durable Object class → binding name. wrangler requires the worker
241
+ * to export a class of this exact name, so detection keys on the class name.
242
+ */
243
+ declare const DURABLE_OBJECT_BINDINGS: {
244
+ readonly LunoraDO: "SHARD";
245
+ readonly SchedulerDO: "SCHEDULER";
246
+ readonly SessionDO: "SESSION";
247
+ readonly ShardDO: "SHARD";
248
+ readonly ShardRegistryDO: "SHARD_REGISTRY";
249
+ };
250
+ type DurableObjectClass = keyof typeof DURABLE_OBJECT_BINDINGS;
251
+ /**
252
+ * The `_generated/` modules that hold a generated Durable Object / Workflow
253
+ * class — one per class kind a project can declare. wrangler validates every
254
+ * `class_name` against the worker's exports, so this is the set a worker entry
255
+ * re-exports (and the set the composed class-A entry star-re-exports for the
256
+ * kinds the project has).
257
+ *
258
+ * Owned here because four places need it and they must not drift:
259
+ * `@lunora/vite` emits one star re-export per entry, the wrangler validator
260
+ * DECIDES the composed entry's exports from it, `reconcile-bindings` types its
261
+ * export-gap `module` field on it, and this module's own `detectClassExports`
262
+ * probes the same names.
263
+ *
264
+ * `scheduler` carries no `define*` declarations of its own — codegen writes it
265
+ * off `hasScheduler` purely so the composed class-A entry has a `SchedulerDO`
266
+ * to forward. Its presence is therefore the ONLY signal the plugin and the
267
+ * validator need, and it is the same signal that decides whether the builder
268
+ * has a `.scheduler()` method at all. `@lunora/vite` depends on `@lunora/config`, so config
269
+ * owning it is the direction the dependency graph allows.
270
+ */
271
+ declare const GENERATED_CLASS_MODULES: readonly ["agents", "containers", "scheduler", "shardRegistry", "workflows"];
272
+ /** One {@link GENERATED_CLASS_MODULES} entry. */
273
+ type GeneratedClassModule = (typeof GENERATED_CLASS_MODULES)[number];
274
+ /**
275
+ * The framework Durable Object each class module forwards, for the modules that
276
+ * carry one: codegen writes them off the same signal that gives the builder the
277
+ * matching method, so the module's existence means the composed entry exports
278
+ * the class.
279
+ */
280
+ declare const GENERATED_MODULE_DURABLE_OBJECTS: Partial<Record<GeneratedClassModule, DurableObjectClass>>;
281
+ /** The `_generated/` module codegen writes when `lunora.config` opts in to the merge. */
282
+ declare const MERGED_DURABLE_OBJECTS_MODULE: "durableObjects";
283
+ /**
284
+ * Whether the project merges its Durable Objects: codegen wrote the merge
285
+ * module. The one test the composed entry, binding inference and the export
286
+ * validator all ask — the same "module existence is the signal" rule the
287
+ * scheduler and registry modules follow.
288
+ */
289
+ declare const isMergedProject: (generatedDirectory: string) => boolean;
290
+ /** Whether `module` holds a class the merged class hosts — imported into it, never re-exported. */
291
+ declare const isMergedRoleModule: (module: string) => boolean;
292
+ /**
293
+ * The class-B composed entry. `lunora deploy` passes this file to wrangler as
294
+ * the positional script whenever it exists, overriding `wrangler.main` — so it
295
+ * is what actually gets bundled and what wrangler checks its DO/Workflow
296
+ * bindings against. `main` in a class-B project names the framework adapter's
297
+ * build output (`.svelte-kit/cloudflare/_worker.js`, `dist/_worker.js`), which
298
+ * exists after `vite build` and exports only the SSR fetch handler. Lexing that
299
+ * instead read every declared class as unexported: nothing provisioned, plus a
300
+ * "add `export * from …`" warning the user cannot silence.
301
+ *
302
+ * Exported, not documented-as-duplicated: the CLI's `resolveComposedWorkerEntry`
303
+ * imports this constant, so the deploy's positional entry and the file this
304
+ * module lexes for exported classes cannot drift apart.
305
+ */
306
+ declare const COMPOSED_WORKER_ENTRY = "src/worker.ts";
307
+ /**
308
+ * A `defineContainer` declaration plus whether its generated DO class is
309
+ * exported by the worker entry. Only exported containers are safe to
310
+ * provision — wrangler rejects a `containers[].class_name` (and its Durable
311
+ * Object binding) that the worker doesn't export.
312
+ */
313
+ type InferredContainer = ContainerIR & {
314
+ exported: boolean;
315
+ };
316
+ /**
317
+ * A `defineWorkflow` declaration plus whether its generated
318
+ * `WorkflowEntrypoint` class is exported by the worker entry. Only exported
319
+ * workflows are safe to provision — wrangler rejects an `exports.<Class>`
320
+ * workflow the worker doesn't export. Workflows are NOT Durable Objects, so this never
321
+ * implies a `durable_objects` binding or migration.
322
+ */
323
+ interface InferredWorkflow extends WorkflowIR {
324
+ exported: boolean;
325
+ }
326
+ /**
327
+ * A `defineAgent` declaration plus whether its generated agent
328
+ * `WorkflowEntrypoint` class (e.g. `SupportAgentWorkflow`) is exported by the
329
+ * worker entry. An agent compiles onto a Cloudflare Workflow, so — exactly like
330
+ * {@link InferredWorkflow} — only exported agents are safe to provision
331
+ * (wrangler rejects an `exports.<Class>` workflow the worker doesn't export), and
332
+ * an agent is NOT a Durable Object (no `durable_objects` binding or migration).
333
+ */
334
+ interface InferredAgent extends AgentIR {
335
+ exported: boolean;
336
+ }
337
+ /**
338
+ * A queue declared in `lunora/queues.ts`. Unlike workflows, a queue needs no
339
+ * worker-entry class export (its `queue()` handler rides `createWorker`), so
340
+ * there is no `exported` flag — every declared queue is reconcilable into the
341
+ * wrangler `queues.producers[]` / `queues.consumers[]`.
342
+ */
343
+ type InferredQueue = QueueIR;
344
+ interface InferredBindings {
345
+ /** Agents declared in `lunora/agents.ts` (exported or not — see {@link InferredAgent.exported}); reconciled into wrangler `exports`. */
346
+ agents: InferredAgent[];
347
+ /** Containers declared in `lunora/containers.ts` (exported or not — see {@link InferredContainer.exported}). */
348
+ containers: InferredContainer[];
349
+ /** Durable Objects the worker entry exports → safe to bind. */
350
+ durableObjects: DurableObjectSpec[];
351
+ /**
352
+ * The wrangler `flagship[].binding` name implied by `lunora/flags.ts` when it
353
+ * uses the Flagship provider in binding mode — `undefined` for HTTP-mode
354
+ * Flagship, a custom OpenFeature provider, or no flags. The binding needs an
355
+ * un-mintable `app_id`, so it is reconciled as a hint, not auto-written.
356
+ */
357
+ flagshipBinding?: string;
358
+ /**
359
+ * The schema's `.jurisdiction("…")`, when it declares one. Read by the binding
360
+ * hints whose resource takes its residency at creation (Artifacts), so the
361
+ * hint can name the jurisdiction to create it in.
362
+ */
363
+ jurisdiction?: SchemaInfo["jurisdiction"];
364
+ /** Schema declares a `.global()` table → needs the `DB` D1 binding. */
365
+ needsD1: boolean;
366
+ /** Queues declared in `lunora/queues.ts` → reconciled into `queues.producers[]` / `queues.consumers[]`. */
367
+ queues: InferredQueue[];
368
+ /**
369
+ * Sibling Workers declared in `lunora.config` `services` → reconciled into
370
+ * `services[]` (plan 457). `undefined` when the declaration is unreadable, so
371
+ * reconcile leaves every entry alone rather than removing the owned ones.
372
+ */
373
+ services: ServiceBindingIR[] | undefined;
374
+ /** Human-readable provenance for each inferred binding / hint, for logging. */
375
+ signals: string[];
376
+ /** `@lunora/ai` is imported, `ctx.ai` read, or `env.AI` used → needs the `ai` Workers AI binding. */
377
+ usesAi: boolean;
378
+ /** `@lunora/bindings/ai-search` is value-imported or `ctx.aiSearch` read → self-describing `ai_search_namespaces` binding (`AI_SEARCH` on namespace `default`; auto-writeable). */
379
+ usesAiSearch: boolean;
380
+ /** `@lunora/bindings/analytics` is imported or `ctx.analytics` read → self-describing `analytics_engine_datasets` binding (auto-writeable). */
381
+ usesAnalytics: boolean;
382
+ /** `@lunora/bindings/analytics-sql` is value-imported or `ctx.analyticsSql` read → self-describing `analytics` binding (`{ binding: ANALYTICS_SQL }`; auto-writeable, wrangler >= 4.145.0). */
383
+ usesAnalyticsSql: boolean;
384
+ /**
385
+ * `ctx.artifacts` is read or `@lunora/bindings/artifacts` value-imported.
386
+ * Hint-only: the first repo `create()` against a missing namespace creates it
387
+ * UNRESTRICTED, and a namespace's jurisdiction can never change after that,
388
+ * so Lunora never writes the binding for you.
389
+ */
390
+ usesArtifacts: boolean;
391
+ /** `@lunora/auth` is imported (sessions may be D1- or `SessionDO`-backed). */
392
+ usesAuth: boolean;
393
+ /** `@lunora/browser` is imported or `ctx.browser` read → self-describing `browser` binding (auto-writeable). */
394
+ usesBrowser: boolean;
395
+ /** `@lunora/auth/cimd/workers` is imported → needs the `global_fetch_strictly_public` compatibility flag (no binding; `lunora doctor` checks it). */
396
+ usesCimdWorkers: boolean;
397
+ /** `lunora/flags.ts` declares a feature-flag provider (any OpenFeature provider — Flagship or custom). */
398
+ usesFlags: boolean;
399
+ /** `@lunora/hyperdrive` is imported or `ctx.sql` read (binding needs an un-mintable remote `id`; hint-only). */
400
+ usesHyperdrive: boolean;
401
+ /** `@lunora/bindings/images` is imported or `ctx.images` read → self-describing `images` binding (auto-writeable). */
402
+ usesImages: boolean;
403
+ /** `@lunora/bindings/kv` is imported or `ctx.kv` read (namespace binding name + id are user-defined; hint-only). */
404
+ usesKv: boolean;
405
+ /** `@lunora/mail` is imported (Resend API key must be set in `.dev.vars`; no binding). No `ctx.mail` helper exists, so only the import counts. */
406
+ usesMail: boolean;
407
+ /** `@lunora/notify` is imported or `ctx.notify` read (no binding; channel secrets ride `usesNotifyFcm` / `usesNotifyWebPush`). */
408
+ usesNotify: boolean;
409
+ /** `lunora/notify.ts` configures the `fcm` channel → the `FCM_*` secrets in `.dev.vars`. */
410
+ usesNotifyFcm: boolean;
411
+ /** `lunora/notify.ts` configures the `webPush` channel → the `VAPID_*` secrets in `.dev.vars`. */
412
+ usesNotifyWebPush: boolean;
413
+ /** `@lunora/payment/autumn` is imported → the Autumn secrets in `.dev.vars` (no binding). */
414
+ usesPaymentAutumn: boolean;
415
+ /** `@lunora/payment/creem` is imported → the Creem secrets in `.dev.vars` (no binding). */
416
+ usesPaymentCreem: boolean;
417
+ /** `@lunora/payment/dodopayments` is imported → the Dodo Payments secrets in `.dev.vars` (no binding). */
418
+ usesPaymentDodopayments: boolean;
419
+ /** `@lunora/payment/polar` is imported → the Polar secrets in `.dev.vars` (no binding). */
420
+ usesPaymentPolar: boolean;
421
+ /** `@lunora/payment` is imported or `ctx.payments` read (provider secrets must be set in `.dev.vars`; no binding). */
422
+ usesPayments: boolean;
423
+ /** `@lunora/payment/stripe` is imported → the Stripe secrets in `.dev.vars` (no binding). */
424
+ usesPaymentStripe: boolean;
425
+ /** `@lunora/bindings/pipelines` is value-imported or `ctx.pipelines` read (binding needs an un-mintable remote pipeline name; hint-only). */
426
+ usesPipelines: boolean;
427
+ /** `@lunora/bindings/r2sql` is value-imported or `ctx.r2sql` read (needs the `R2_SQL_*` secrets in `.dev.vars`; no binding). */
428
+ usesR2sql: boolean;
429
+ /** `@lunora/scheduler` is imported or `ctx.scheduler` read. */
430
+ usesScheduler: boolean;
431
+ /** `@lunora/storage` is imported or `ctx.storage` read under `lunora/` (R2 bucket binding name is user-defined). */
432
+ usesStorage: boolean;
433
+ /** `jsCodeTool` is imported from `@lunora/agent` in `lunora/` → self-describing `worker_loaders` binding (`LOADER`). */
434
+ usesWorkerLoader: boolean;
435
+ /** `@lunora/x402/pay` is imported or `ctx.x402` read — the agent-wallet pay rail signs from a Secrets Store binding paired with a spend policy (ActionCtx-only; hint-only). */
436
+ usesX402: boolean;
437
+ /** `@lunora/x402/charge` is imported — the charge rail settles USDC to a recipient address (a public `[vars]` entry, user-named; hint-only). */
438
+ usesX402Charge: boolean;
439
+ /** Workflows declared in `lunora/workflows.ts` (exported or not — see {@link InferredWorkflow.exported}). */
440
+ workflows: InferredWorkflow[];
441
+ }
442
+ interface InferOptions {
443
+ projectRoot: string;
444
+ /** Directories (relative to root) to scan. Defaults to `lunora` + `src`. */
445
+ scanDirs?: ReadonlyArray<string>;
446
+ /** Lunora source directory holding `schema.ts`. Defaults to `lunora`. */
447
+ schemaDir?: string;
448
+ }
449
+ /**
450
+ * Scan a Lunora project and report which Cloudflare bindings its code implies.
451
+ * Read-only: performs no writes. Binding provisioning is driven by the worker
452
+ * entry's Durable Object exports plus the schema's D1 need; capability imports
453
+ * surface as hints.
454
+ */
455
+ declare const inferLunoraBindings: (options: InferOptions) => Promise<InferredBindings>;
456
+ /**
457
+ * The secret sources a project uses — the {@link PACKAGE_SECRETS_REGISTRY} keys
458
+ * whose secrets it needs, derived from its already-resolved {@link InferredBindings}.
459
+ *
460
+ * This is the canonical bridge between binding inference and the
461
+ * `.dev.vars.example` scaffolding in `scaffold-dev-variables.ts`. The result is
462
+ * {@link FLAG_PACKAGES}' sources whose flag is `true` in `bindings` — in
463
+ * flag-name order — followed by the configured `@lunora/notify` channels
464
+ * ({@link NOTIFY_CHANNEL_SECRETS}), keeping only sources that carry secrets.
465
+ */
466
+ declare const secretSourcesFromBindings: (bindings: InferredBindings) => string[];
467
+ export { COMPOSED_WORKER_ENTRY as C, DeployDriver as D, GeneratedClassModule as G, InferredBindings as I, MERGED_DURABLE_OBJECTS_MODULE as M, ProjectionPurpose as P, SchemaInfo as S, ToolchainCommand as T, DURABLE_OBJECT_BINDINGS as a, DeployRequest as b, DevRequest as c, DiscoverSchemaInfoResult as d, DriverToolchain as e, GENERATED_CLASS_MODULES as f, GENERATED_MODULE_DURABLE_OBJECTS as g, InferOptions as h, InferredAgent as i, InferredContainer as j, InferredWorkflow as k, ProjectedConfig as l, SecretRequest as m, TailRequest as n, discoverSchemaInfo as o, inferLunoraBindings as p, isMergedProject as q, isMergedRoleModule as r, secretSourcesFromBindings as s };