@lunora/config 1.0.0-alpha.136 → 1.0.0-alpha.138
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.
- package/dist/cloudflare/index.d.mts +49 -1
- package/dist/cloudflare/index.d.ts +49 -1
- package/dist/cloudflare/index.mjs +1 -1
- package/dist/index.d.mts +0 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.mjs +1 -1
- package/dist/packem_shared/ACCENT-CotPTfv7.mjs +7 -0
- package/dist/packem_shared/AGENT_MODE_ENV-D8MvSwPE.mjs +1 -0
- package/dist/packem_shared/AGENT_RULES_DIR-3-Sx1gHU.mjs +1 -0
- package/dist/packem_shared/ALLOW_FORWARDED_ENV-BUndghJx.mjs +1 -0
- package/dist/packem_shared/{BINDING_MANIFEST_VERSION-DOlqQgYt.mjs → BINDING_MANIFEST_VERSION-Cd00jVOf.mjs} +1 -1
- package/dist/packem_shared/CLOUDFLARE_DRIVER-6bjm6hSn.mjs +1 -0
- package/dist/packem_shared/DEFAULT_DEPLOY_TARGET-RDWcFKBe.mjs +1 -0
- package/dist/packem_shared/DEV_DAEMON_ENV-e1mJUd1-.mjs +4 -0
- package/dist/packem_shared/DEV_VARS_EXAMPLE_FILE-DxtfY0DW.mjs +6 -0
- package/dist/packem_shared/LINKED_PROJECT_DIR-Ba5qPEwo.mjs +2 -0
- package/dist/packem_shared/LUNORA_CONFIG_FILE-CBV3C1Hl.mjs +1 -0
- package/dist/packem_shared/LUNORA_EVENT_SOURCE-DYdcDU9G.mjs +1 -0
- package/dist/packem_shared/LUNORA_IGNORED_PATHS-BGbVUqw_.mjs +19 -0
- package/dist/packem_shared/LunoraReporter-f277GLNT.mjs +6 -0
- package/dist/packem_shared/POLICY_SCAFFOLD_ENDPOINT-C1gb9ykA.mjs +1 -0
- package/dist/packem_shared/REMOTE_ELIGIBLE_KEYS-DKlqkz1w.mjs +1 -0
- package/dist/packem_shared/REQUIRED_COMPATIBILITY_DATE-Cx6D676Z.mjs +1 -0
- package/dist/packem_shared/SCHEMA_EDIT_ENDPOINT-CknH7oga.mjs +1 -0
- package/dist/packem_shared/SEED_ENDPOINT-DVzCYp6l.mjs +1 -0
- package/dist/packem_shared/{WORKERS_CACHE_MIN_DATE-B1h_wNDN.mjs → WORKERS_CACHE_MIN_DATE-0k9ABJtF.mjs} +1 -1
- package/dist/packem_shared/WRANGLER_FILES-UNW-xY5u.mjs +1 -0
- package/dist/packem_shared/applyAdditiveEdit-DPhNZsf2.mjs +6 -0
- package/dist/packem_shared/assetContentType-CUb5bpbI.mjs +1 -0
- package/dist/packem_shared/buildPackageSecretsBlock-DX6SFs-J.mjs +18 -0
- package/dist/packem_shared/classifyPolicyEdit-BfSiVpv-.mjs +24 -0
- package/dist/packem_shared/cloudflare-driver-CvMyH1Ih.mjs +1 -0
- package/dist/packem_shared/collectExportGaps-B5eIg8p8.mjs +1 -0
- package/dist/packem_shared/collectWranglerSecretVariables-Df_H6ytT.mjs +1 -0
- package/dist/packem_shared/createConfirm-D5mKTMHj.mjs +7 -0
- package/dist/packem_shared/{detectFramework-cbwEhpMt.mjs → detectFramework-DOn4PtpP.mjs} +1 -1
- package/dist/packem_shared/discover-info-Vj9d4qYt.mjs +1 -0
- package/dist/packem_shared/discoverAgentInfo-CTdCSfYM.mjs +1 -0
- package/dist/packem_shared/discoverContainerInfo-EhZtEBQs.mjs +1 -0
- package/dist/packem_shared/discoverSchemaInfo-Bg2CUZXG.mjs +1 -0
- package/dist/packem_shared/discoverWorkflowInfo-BsPvlo6O.mjs +1 -0
- package/dist/packem_shared/inferLunoraBindings-CEE39hXz.mjs +1 -0
- package/dist/packem_shared/jsonc-edit-BZgQIdAH.mjs +1 -0
- package/dist/packem_shared/parseDevVariable-C0QlCXhO.mjs +1 -0
- package/dist/packem_shared/parseSchema-B4nFDPzZ.mjs +1 -0
- package/dist/packem_shared/reconcileWranglerCompatibilityDate-7OO_xaKR.mjs +1 -0
- package/dist/packem_shared/reconcileWranglerCrons-COMb6ICf.mjs +1 -0
- package/dist/packem_shared/renderStudioHtml-ByowDtMl.mjs +15 -0
- package/dist/packem_shared/serveJsonHandler-CB85A2S9.mjs +1 -0
- package/dist/packem_shared/streamContainerLogs-0nko1qpv.mjs +2 -0
- package/dist/packem_shared/wranglerToAlchemy-CX9nCwtu.mjs +6 -0
- package/dist/packem_shared/write-atomic-ooiPzStx.mjs +1 -0
- package/dist/studio-host/index.d.mts +31 -1
- package/dist/studio-host/index.d.ts +31 -1
- package/dist/studio-host/index.mjs +1 -1
- package/package.json +5 -5
- package/dist/packem_shared/ACCENT-CLeV5v0K.mjs +0 -7
- package/dist/packem_shared/AGENT_MODE_ENV-B54hVQ_w.mjs +0 -1
- package/dist/packem_shared/AGENT_RULES_DIR-hP9TiDNx.mjs +0 -1
- package/dist/packem_shared/ALLOW_FORWARDED_ENV-DGdbCDre.mjs +0 -1
- package/dist/packem_shared/CLOUDFLARE_DRIVER-B_MaIVFz.mjs +0 -1
- package/dist/packem_shared/DEFAULT_DEPLOY_TARGET-cfA_ogWA.mjs +0 -1
- package/dist/packem_shared/DEV_DAEMON_ENV-D9Z83rlU.mjs +0 -4
- package/dist/packem_shared/DEV_VARS_EXAMPLE_FILE-BL0hrPx3.mjs +0 -6
- package/dist/packem_shared/LINKED_PROJECT_DIR-CMzUvj-1.mjs +0 -2
- package/dist/packem_shared/LUNORA_CONFIG_FILE-11ax8L-y.mjs +0 -1
- package/dist/packem_shared/LUNORA_EVENT_SOURCE-ZclWASXS.mjs +0 -1
- package/dist/packem_shared/LUNORA_IGNORED_PATHS-BcFR0dxS.mjs +0 -19
- package/dist/packem_shared/LunoraReporter-BnXUqh8t.mjs +0 -6
- package/dist/packem_shared/POLICY_SCAFFOLD_ENDPOINT-CUYWD0Mh.mjs +0 -1
- package/dist/packem_shared/REMOTE_ELIGIBLE_KEYS-ws6iE0y-.mjs +0 -1
- package/dist/packem_shared/REQUIRED_COMPATIBILITY_DATE-BN97lRmC.mjs +0 -1
- package/dist/packem_shared/SCHEMA_EDIT_ENDPOINT-BNB1ogaj.mjs +0 -1
- package/dist/packem_shared/SEED_ENDPOINT-BaYShU8q.mjs +0 -1
- package/dist/packem_shared/WRANGLER_FILES-Bi_18Pj6.mjs +0 -1
- package/dist/packem_shared/applyAdditiveEdit-Cff30cSa.mjs +0 -6
- package/dist/packem_shared/assetContentType-DNZyUOuF.mjs +0 -1
- package/dist/packem_shared/buildPackageSecretsBlock-D2oDEMcf.mjs +0 -18
- package/dist/packem_shared/classifyPolicyEdit-BzC_MfYK.mjs +0 -24
- package/dist/packem_shared/cloudflare-driver-BHtz6vmK.mjs +0 -1
- package/dist/packem_shared/collectExportGaps-ajyIOfom.mjs +0 -1
- package/dist/packem_shared/collectWranglerSecretVariables-DZE0RIsW.mjs +0 -1
- package/dist/packem_shared/createConfirm-C5G4-dT6.mjs +0 -7
- package/dist/packem_shared/discover-info-DRQ0Ote0.mjs +0 -1
- package/dist/packem_shared/discoverAgentInfo-C8LTinx8.mjs +0 -1
- package/dist/packem_shared/discoverContainerInfo-C1zY2O8F.mjs +0 -1
- package/dist/packem_shared/discoverSchemaInfo-C8X9mo-i.mjs +0 -1
- package/dist/packem_shared/discoverWorkflowInfo-DHzCyLRj.mjs +0 -1
- package/dist/packem_shared/inferLunoraBindings-_ESCdL9P.mjs +0 -1
- package/dist/packem_shared/jsonc-edit-BZVpxVA0.mjs +0 -1
- package/dist/packem_shared/parseDevVariable-B193_28t.mjs +0 -1
- package/dist/packem_shared/parseSchema-BQjgz6bk.mjs +0 -1
- package/dist/packem_shared/reconcileWranglerCompatibilityDate-BXNiEQ7p.mjs +0 -1
- package/dist/packem_shared/reconcileWranglerCrons-BmQa_kGL.mjs +0 -1
- package/dist/packem_shared/renderStudioHtml-B2AkxcW1.mjs +0 -15
- package/dist/packem_shared/serveJsonHandler-DQ-Yqa4J.mjs +0 -1
- package/dist/packem_shared/streamContainerLogs-BPYBNrWS.mjs +0 -2
- package/dist/packem_shared/wranglerToAlchemy-BXagFk92.mjs +0 -6
- package/dist/packem_shared/write-atomic-Cdr2oQb-.mjs +0 -1
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{createInterface as v}from"node:readline";const g=/[\s,]+/u,d=()=>process.stdin.isTTY,f=async n=>{const t=v({input:process.stdin,output:process.stdout});try{return await new Promise(e=>{t.question(n,s=>{e(s)})})}finally{t.close()}},w=async(n,t)=>{const e=(await f(n)).trim().toLowerCase();return e===""?t?.defaultYes===!0:e==="y"||e==="yes"},b=(n="")=>d()?t=>w(`${n}${t} [Y/n] `,{defaultYes:!0}):()=>Promise.resolve(!1),S=async(n,t,e)=>{if(!d()||t.length===0)return e?.default;const s=e?.default===void 0?-1:t.findIndex(a=>a.value===e.default),p=t.map((a,u)=>` ${String(u+1)}) ${a.label}${a.description===void 0?"":` — ${a.description}`}`),m=`${n}
|
|
2
|
-
${p.join(`
|
|
3
|
-
`)}
|
|
4
|
-
> ${s>=0?`[${String(s+1)}] `:""}`,l=(await f(m)).trim();if(l==="")return e?.default;const i=Number.parseInt(l,10);return Number.isInteger(i)&&i>=1&&i<=t.length?t[i-1]?.value:t.find(a=>a.value===l||a.label.toLowerCase()===l.toLowerCase())?.value??e?.default},I=async(n,t)=>{if(!d())return t?.default;const e=(await f(n)).trim();return e===""?t?.default:e},h=async(n,t,e)=>{const s=e?.defaults??[];if(!d()||t.length===0)return[...s];const p=t.map((r,o)=>` ${String(o+1)}) ${r.label}${r.description===void 0?"":` — ${r.description}`}`),m=s.length===0?"":`[${s.join(", ")}] `,l=`${n} (comma-separated; Enter for default)
|
|
5
|
-
${p.join(`
|
|
6
|
-
`)}
|
|
7
|
-
> ${m}`,i=(await f(l)).trim();if(i==="")return[...s];const a=i.split(g).map(r=>r.trim()).filter(r=>r!==""),u=new Set;for(const r of a){const o=Number.parseInt(r,10);if(Number.isInteger(o)&&o>=1&&o<=t.length&&String(o)===r){const c=t[o-1]?.value;c!==void 0&&u.add(c);continue}const $=t.find(c=>c.value===r||c.label.toLowerCase()===r.toLowerCase());$!==void 0&&u.add($.value)}return t.filter(r=>u.has(r.value)).map(r=>r.value)};export{b as createConfirm,d as isInteractive,h as promptMultiSelect,S as promptSelect,I as promptText,w as promptYesNo};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{existsSync as m}from"node:fs";import{Project as c}from"ts-morph";import{join as t}from"node:path";const p=(e,o,n,i,s={})=>{if(!m(t(e,o,n)))return{};try{const r=new c({skipAddingFilesFromTsConfig:!0,useInMemoryFileSystem:!1,...s});return{value:i(r,t(e,o))}}catch(r){return{error:r instanceof Error?r.message:String(r)}}};export{p as m};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{discoverAgents as n,AGENTS_FILENAME as s}from"@lunora/codegen";import{m as i}from"./discover-info-DRQ0Ote0.mjs";const c=(o,e)=>{const{error:r,value:t}=i(o,e,s,n);return r===void 0?{agents:t??[]}:{agents:[],error:r}};export{c as discoverAgentInfo};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{discoverContainers as i,CONTAINERS_FILENAME as t}from"@lunora/codegen";import{m as s}from"./discover-info-DRQ0Ote0.mjs";const m=(o,e)=>{const{error:r,value:n}=s(o,e,t,i,{skipFileDependencyResolution:!0});return r===void 0?{containers:n??[]}:{containers:[],error:r}};export{m as discoverContainerInfo};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{existsSync as m}from"node:fs";import{discoverSchema as c}from"@lunora/codegen";import{Project as d}from"ts-morph";import{join as f}from"node:path";const b=(a,s)=>{const n=f(a,s,"schema.ts");if(!m(n))return{info:void 0};try{const o=new d({skipAddingFilesFromTsConfig:!0,useInMemoryFileSystem:!1}),r=c(o,n,a),i=e=>r.tables.find(t=>t.name===e)?.shape??{};return{info:{hasGlobalTable:r.tables.some(e=>e.shardMode==="global"),vectorIndexNames:r.vectorIndexes.map(e=>e.name),vectorMetadata:r.vectorIndexes.flatMap(e=>(e.metadata??[]).map(t=>({index:e.name,kind:i(e.table)[t]?.kind,property:t})))}}}catch(o){return{error:o instanceof Error?o.message:String(o),info:void 0}}};export{b as discoverSchemaInfo};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{discoverWorkflows as e,WORKFLOWS_FILENAME as t}from"@lunora/codegen";import{m as w}from"./discover-info-DRQ0Ote0.mjs";const m=(r,f)=>{const{error:o,value:s}=w(r,f,t,e);return o===void 0?{workflows:s??[]}:{error:o,workflows:[]}};export{m as discoverWorkflowInfo};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{existsSync as p,statSync as $,readFileSync as b,readdirSync as T}from"node:fs";import{init as C,parse as f}from"es-module-lexer";import{discoverAgentInfo as P}from"./discoverAgentInfo-C8LTinx8.mjs";import{WRANGLER_FILES as L,readWranglerJsonc as F}from"./WRANGLER_FILES-Bi_18Pj6.mjs";import{discoverContainerInfo as K}from"./discoverContainerInfo-C1zY2O8F.mjs";import{escapeRegExp as D}from"./DEV_VARS_EXAMPLE_FILE-BL0hrPx3.mjs";import{discoverFlags as W,FLAGS_FILENAME as H,discoverQueues as q,QUEUES_FILENAME as G}from"@lunora/codegen";import{m as k}from"./discover-info-DRQ0Ote0.mjs";import{discoverSchemaInfo as M}from"./discoverSchemaInfo-C8X9mo-i.mjs";import{discoverWorkflowInfo as U}from"./discoverWorkflowInfo-DHzCyLRj.mjs";import{join as c}from"node:path";const X=(e,r)=>{const{error:t,value:s}=k(e,r,H,W);return t===void 0?{flags:s}:{error:t}},Y=(e,r)=>{const{error:t,value:s}=k(e,r,G,q);return t===void 0?{queues:s??[]}:{error:t,queues:[]}},Q=new Set([".cjs",".cts",".js",".jsx",".mjs",".mts",".ts",".tsx"]),z=new Set([".git",".lunora-cache",".wrangler","_generated","dist","node_modules"]),J=["lunora","src"],V=["src/server/index.ts","src/server/index.tsx","src/index.ts","src/worker.ts"],_={SchedulerDO:"SCHEDULER",SessionDO:"SESSION",ShardDO:"SHARD"},O=Object.keys(_),Z={SchedulerDO:/\btype\s+SchedulerDO\b/,SessionDO:/\btype\s+SessionDO\b/,ShardDO:/\btype\s+ShardDO\b/},ee=/\benv\s*\.\s*DB\b/,re=/\benv\s*\.\s*AI\b/,A=/\bctx\s*\.\s*pipelines\b/,I=/^\s*import\s+type\b/,se=new Set(["@lunora/agent","@lunora/agent/sandbox"]),te=e=>{const r=e.indexOf("{");if(r===-1)return"";const t=e.indexOf("}",r+1);return t===-1?e.slice(r+1):e.slice(r+1,t)},ne=/\btype\s+browserTool\b/,oe=/\bbrowserTool\b/,ae=/import\s+\{[^}]*\bbrowserTool\b[^}]*\}\s+from\s+["']@lunora\/agent(?:\/sandbox)?["']/,ie=e=>{if(I.test(e))return!1;const r=te(e);return oe.test(r)&&!ne.test(r)},ce=e=>{try{const[r]=f(e);return r.some(t=>t.n!==void 0&&se.has(t.n)&&ie(e.slice(t.ss,t.se)))}catch{return ae.test(e)}},g={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"},usesPayment:{pattern:/\bfrom\s+["']@lunora\/payment["']/,source:"@lunora/payment"},usesPipelines:{pattern:A,source:"@lunora/bindings/pipelines"},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(g),de="STRIPE_SECRET_KEY + STRIPE_WEBHOOK_SECRET (Stripe) or POLAR_ACCESS_TOKEN + POLAR_WEBHOOK_SECRET (Polar)",j=[...l,"needsD1"],ue=()=>{const e={};for(const r of j)e[r]=!1;return e},u=Object.freeze(ue()),x=(e,r)=>{const t={};for(const s of j)t[s]=e[s]||r[s];return t},pe=e=>{for(const r of l)if(g[r].source===e)return{...u,[r]:!0};return u},le=e=>{const[r]=f(e);let t=u;for(const s of r){const n=s.n;!n||I.test(e.slice(s.ss,s.se))||(t=x(t,pe(n)))}return t},me=e=>{const r={...u};for(const t of l)r[t]=g[t].pattern.test(e);return r},be=e=>{let r;try{r=le(e)}catch{r=me(e)}return x(r,{...u,needsD1:ee.test(e),usesAi:re.test(e),usesPipelines:A.test(e)})},S=(e,r)=>{let t;try{t=T(e,{withFileTypes:!0})}catch{return}for(const s of t){if(s.isDirectory()){z.has(s.name)||S(c(e,s.name),r);continue}const n=s.name.lastIndexOf(".");n!==-1&&Q.has(s.name.slice(n))&&r.push(c(e,s.name))}},fe=e=>{for(const r of L){const t=c(e,r);if(!p(t))continue;const{parsed:s}=F(t),n=s?.main;if(typeof n=="string"&&p(c(e,n)))return c(e,n);break}for(const r of V){const t=c(e,r);if(p(t))return t}},ge=e=>{const r=b(e,"utf8");let t;try{const[,s]=f(r);t=new Set(s.map(n=>n.n))}catch{t=new Set(O.filter(s=>new RegExp(String.raw`\bexport\b[^\n;]*\b${s}\b`).test(r)))}return O.filter(s=>t.has(s)&&!Z[s].test(r)).map(s=>({binding:_[s],className:s}))},he=/(?:^|[\s,{])type$/u,ye=(e,r)=>{const t=r.ls>=0?r.ls:r.s;return he.test(e.slice(0,t).trimEnd())},xe=(e,r)=>{const t=D(r);return new RegExp(String.raw`\bexport\s+type\s+${t}\b`,"u").test(e)||new RegExp(String.raw`\bexport\s+type\s*\{[^}]*\b${t}\b`,"u").test(e)||new RegExp(String.raw`\bexport\s+\{[^}]*\btype\s+${t}\b`,"u").test(e)},y=(e,r,t)=>{if(r.length===0)return[];if(e===void 0)return r.map(o=>({...o,exported:!1}));const s=b(e,"utf8"),n=new RegExp(String.raw`\bexport\s*\*\s*from\s*["'][^"']*_generated\/${t}(?:\.js)?["']`).test(s);let a;try{const[,o]=f(s);a=new Set(o.filter(i=>!ye(s,i)).map(i=>i.n))}catch{a=new Set(r.map(o=>o.className).filter(o=>new RegExp(String.raw`\bexport\b[^\n;]*\b${D(o)}\b`,"u").test(s)&&!xe(s,o)))}return r.map(o=>{const i=n||a.has(o.className);return{...o,exported:i}})},Se=(e,r)=>M(e,r).info?.hasGlobalTable??!1,we=(e,r)=>{let t=u;for(const s of r){const n=c(e,s);if(!p(n)||!$(n).isDirectory())continue;const a=[];S(n,a);for(const o of a)t=x(t,be(b(o,"utf8")))}return t},ve=(e,r)=>{const t=c(e,r);if(!p(t)||!$(t).isDirectory())return!1;const s=[];return S(t,s),s.some(n=>ce(b(n,"utf8")))},Ee=(e,r,t)=>[...e.map(s=>s.exported?`${s.bindingName}/${s.className} (container "${s.exportName}" declared and exported)`:`hint: container "${s.exportName}" is declared but ${s.className} is not exported by the worker entry — add \`export * from "./lunora/_generated/containers"\``),...r.map(s=>s.exported?`${s.bindingName}/${s.className} (workflow "${s.exportName}" declared and exported)`:`hint: workflow "${s.exportName}" is declared but ${s.className} is not exported by the worker entry — add \`export * from "./lunora/_generated/workflows"\``),...t.map(s=>s.exported?`${s.bindingName}/${s.className} (agent "${s.exportName}" declared and exported)`:`hint: agent "${s.exportName}" is declared but ${s.className} is not exported by the worker entry — add \`export * from "./lunora/_generated/agents"\``)],Re=(e,r)=>[[e.usesAi,"AI (@lunora/ai imported or env.AI used)"],[e.usesAuth&&!r.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&&!r.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 — ${de}`],[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.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(([t])=>t).map(([,t])=>t),Ne=(e,r,t,s=[],n=[],a=[])=>{const o=new Set(e.map(d=>d.className)),i=e.map(d=>`${d.binding}/${d.className} (exported by worker entry)`);return r&&i.push("DB (.global() table declared)"),i.push(...Ee(s,n,a),...Re(t,o)),i},Pe=async e=>{await C;const r=e.schemaDir??"lunora",t=e.scanDirs??J,s=we(e.projectRoot,t),n={...s,usesBrowser:s.usesBrowser||ve(e.projectRoot,r)},a=fe(e.projectRoot),o=a?ge(a):[],i=n.needsD1||Se(e.projectRoot,r),d=y(a,K(e.projectRoot,r).containers,"containers"),w=y(a,U(e.projectRoot,r).workflows,"workflows"),v=y(a,P(e.projectRoot,r).agents,"agents"),B=[...Y(e.projectRoot,r).queues],{flags:m}=X(e.projectRoot,r),h=m?.provider==="flagship"&&m.mode==="binding"?m.bindingName:void 0,E={};for(const N of l)E[N]=n[N];const R=Ne(o,i,n,d,w,v);return h!==void 0&&R.push(`hint: lunora/flags.ts uses Flagship in binding mode; add a flagship binding ({ binding: "${h}", app_id }) — the app_id can't be auto-provisioned`),{agents:v,containers:d,durableObjects:o,flagshipBinding:h,needsD1:i,queues:B,signals:R,usesFlags:m!==void 0,workflows:w,...E}},Le=e=>{const r=[];for(const t of l)e[t]&&r.push(g[t].source);return r};export{V as WORKER_ENTRY_FALLBACKS,Pe as inferLunoraBindings,ye as isTypeOnlyExportEntry,Le as packageNamesFromBindings,fe as resolveWorkerEntry};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{modify as i,applyEdits as p}from"jsonc-parser";const s={formattingOptions:{insertSpaces:!0,tabSize:4}},a=(t,e,o)=>{const r=i(t,[...e],o,s);return r.length>0?p(t,r):t};export{a as e,s as r};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{readFileSync as n}from"node:fs";import{join as i}from"node:path";import{parseDevVariableEntries as a}from"./DEV_VARS_EXAMPLE_FILE-BL0hrPx3.mjs";const s=(e,r)=>{const o=a(e).find(t=>t.key===r);return o===void 0||o.value===""?void 0:o.value},c=e=>{const r=process.env.LUNORA_ADMIN_TOKEN;if(typeof r=="string"&&r!=="")return r;try{return s(n(i(e,".dev.vars"),"utf8"),"LUNORA_ADMIN_TOKEN")}catch{return}};export{s as parseDevVariable,c as resolveAdminToken};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{Project as p,SyntaxKind as r}from"ts-morph";const u=/^v\s*\.\s*optional\s*\(/u,m=/\.shardBy\(\s*["']([^"']+)["']\s*\)/u,f=/\.global\(\s*(?:\{[^{}]*\}\s*)?\)/u,c=/["']/gu,x=t=>{const e=t.getDescendantsOfKind(r.CallExpression);return t.getKind()===r.CallExpression&&e.push(t.asKindOrThrow(r.CallExpression)),e},K=t=>u.test(t.trim()),h=t=>t?.getKind()!==r.ArrayLiteralExpression?[]:t.asKindOrThrow(r.ArrayLiteralExpression).getElements().filter(e=>e.getKind()===r.StringLiteral).map(e=>e.asKindOrThrow(r.StringLiteral).getLiteralText()),E=t=>{if(t?.getKind()!==r.ObjectLiteralExpression)return!1;const e=t.asKindOrThrow(r.ObjectLiteralExpression).getProperty("unique");return e?.getKind()===r.PropertyAssignment&&e.getInitializer()?.getText()==="true"},O=t=>{const e=t.getExpression();if(e.getKind()!==r.PropertyAccessExpression||e.asKindOrThrow(r.PropertyAccessExpression).getName()!=="index")return;const[n,s,i]=t.getArguments();if(n?.getKind()===r.StringLiteral)return{fields:h(s),name:n.asKindOrThrow(r.StringLiteral).getLiteralText(),unique:E(i)}},T=t=>{const e=t.getInitializer();if(e===void 0)return[];const n=[];for(const s of x(e)){const i=O(s);i!==void 0&&n.push(i)}return n},y=t=>{const e=[],n=t.getInitializer()?.getDescendantsOfKind(r.CallExpression).find(s=>s.getExpression().getText()==="defineTable")?.getArguments()[0];if(n?.getKind()!==r.ObjectLiteralExpression)return e;for(const s of n.getProperties()){if(s.getKind()!==r.PropertyAssignment)continue;const i=s,a=i.getName().replaceAll(c,""),o=i.getInitializer()?.getText()??"";e.push({name:a,optional:K(o),validator:o})}return e},L=t=>{const e=new p({compilerOptions:{allowJs:!0},useInMemoryFileSystem:!0}).createSourceFile("schema.ts",t,{overwrite:!0}),n=e.getDescendantsOfKind(r.CallExpression).find(a=>a.getExpression().getText()==="defineSchema");if(n===void 0)return{ok:!1,reason:e.getImportDeclarations().some(a=>a.getNamedImports().some(o=>o.getName()==="defineSchema"&&o.getAliasNode()!==void 0))?"aliased-define-schema":"no-define-schema"};const s=n.getArguments()[0];if(s?.getKind()!==r.ObjectLiteralExpression)return{ok:!1,reason:"non-object-argument"};const i=[];for(const a of s.getProperties()){if(a.getKind()!==r.PropertyAssignment)continue;const o=a,d=o.getName().replaceAll(c,""),l=o.getInitializer()?.getText()??"",g=m.exec(l);i.push({columns:y(o),global:f.test(l),indexes:T(o),name:d,...g?.[1]===void 0?{}:{shardBy:g[1]}})}return{ok:!0,tables:i}};export{x as collectCalls,L as parseSchema};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{writeFileSync as d}from"node:fs";import{modify as l,applyEdits as c}from"jsonc-parser";import{r as s}from"./jsonc-edit-BZVpxVA0.mjs";import{isCacheEnabled as f,WORKERS_CACHE_MIN_DATE as r}from"./WORKERS_CACHE_MIN_DATE-B1h_wNDN.mjs";import{findWranglerFile as g,readWranglerJsonc as m}from"./WRANGLER_FILES-Bi_18Pj6.mjs";const b=i=>{const e=g(i);if(!e)return{changed:!1,date:void 0,reason:"wrangler.jsonc not found"};const{parsed:t,text:n}=m(e);if(t===void 0)return{changed:!1,date:void 0,reason:`failed to parse ${e} as JSONC`,wranglerPath:e};const a=t.compatibility_date??"";if(!f(t))return{changed:!1,date:a||void 0,reason:"cache not enabled",wranglerPath:e};if(a>=r)return{changed:!1,date:a,reason:`compatibility_date already >= ${r}`,wranglerPath:e};const o=l(n,["compatibility_date"],r,s);return o.length===0?{changed:!1,date:a||void 0,reason:"no structural edit produced",wranglerPath:e}:(d(e,c(n,o),"utf8"),{changed:!0,date:r,wranglerPath:e})};export{b as reconcileWranglerCompatibilityDate};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{writeFileSync as g}from"node:fs";import{modify as c,applyEdits as l}from"jsonc-parser";import{findWranglerFile as d,readWranglerJsonc as f}from"./WRANGLER_FILES-Bi_18Pj6.mjs";const h=(t,e)=>t.length===e.length&&t.every((r,n)=>r===e[n]),m=(t,e)=>{const r=d(t);if(!r)return{changed:!1,reason:"wrangler.jsonc not found"};const{parsed:n,text:a}=f(r);if(n===void 0)return{changed:!1,reason:`failed to parse ${r} as JSONC`,wranglerPath:r};const o=Array.isArray(n.triggers?.crons)?n.triggers.crons.filter(i=>typeof i=="string"):[];if(h(o,e))return{changed:!1,reason:"triggers.crons already in sync",wranglerPath:r};const s=c(a,["triggers","crons"],[...e],{formattingOptions:{insertSpaces:!0,tabSize:4}});return s.length===0?{changed:!1,reason:"no structural edit produced",wranglerPath:r}:(g(r,l(a,s),"utf8"),{changed:!0,wranglerPath:r})};export{m as reconcileWranglerCrons};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
const i=e=>JSON.stringify(e).replaceAll("<",String.raw`\u003c`),_=e=>e.replaceAll("&","&").replaceAll('"',""").replaceAll("<","<"),l=e=>{const t=[`window.__LUNORA_BASE_PATH__=${i(e.basePath)};`];return e.adminToken!==void 0&&e.adminToken!==""&&t.push(`window.__LUNORA_ADMIN_TOKEN__=${i(e.adminToken)};`),e.dataEditable===!0&&t.push("window.__LUNORA_DATA_EDITABLE__=true;"),e.runAsIdentity===!0&&t.push("window.__LUNORA_RUN_AS_IDENTITY__=true;"),e.schemaEditable===!0&&t.push("window.__LUNORA_SCHEMA_EDITABLE__=true;"),e.rulesInstalled===!1&&t.push("window.__LUNORA_RULES_INSTALLED__=false;"),`<!doctype html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8" />
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
-
<title>Lunora Studio</title>
|
|
7
|
-
<script>${t.join("")}<\/script>
|
|
8
|
-
<link rel="stylesheet" href="${_(e.styleHref)}" />
|
|
9
|
-
</head>
|
|
10
|
-
<body>
|
|
11
|
-
<div id="root"></div>
|
|
12
|
-
<script type="module" src="${_(e.scriptSrc)}"><\/script>
|
|
13
|
-
</body>
|
|
14
|
-
</html>
|
|
15
|
-
`};export{l as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{headerValue as i}from"./ALLOW_FORWARDED_ENV-DGdbCDre.mjs";const u=1e6,f=async e=>await new Promise((t,r)=>{const o=[];let a=0;e.on("data",s=>{if(a+=s.length,a>u){r(new Error("request body too large"));return}o.push(s)}),e.on("end",()=>{t(Buffer.concat(o).toString("utf8"))}),e.on("error",r)}),n=(e,t,r)=>{e.statusCode=t,e.setHeader("Content-Type","application/json; charset=utf-8"),e.end(JSON.stringify(r))},l=new Set(["none","same-origin","same-site"]),p=e=>{const t=i(e.headers["sec-fetch-site"]);if(t!==void 0)return l.has(t)?void 0:"cross-origin request rejected";const r=i(e.headers.origin);if(r===void 0||r==="null")return;let o;try{o=new URL(r).host.toLowerCase()}catch{return"invalid origin header"}return o===i(e.headers.host)?void 0:"cross-origin request rejected"},y=e=>{const t=(e.method??"GET").toUpperCase(),r=t!=="GET"&&t!=="HEAD",o=p(e);if(o!==void 0)return o;if(r&&!i(e.headers["content-type"])?.startsWith("application/json"))return"content-type must be application/json"},g=(e,t,r,o,a)=>{(async()=>{try{const s=y(e);if(s!==void 0){n(t,403,{error:s,ok:!1});return}const c=e.method==="GET"?"":await f(e);let d;try{d=c===""?void 0:JSON.parse(c)}catch{n(t,400,{error:"invalid-json",ok:!1});return}const h=r({body:d,method:e.method??"POST",projectRoot:o,schemaDirectory:a});n(t,h.status,h.body)}catch(s){n(t,500,{error:s instanceof Error?s.message:String(s),ok:!1})}})().catch(()=>{})};export{g as serveJsonHandler};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{Writable as S}from"node:stream";import{StringDecoder as b}from"node:string_decoder";const y="cloudflare-dev/",M=1500,N=async()=>{const{default:t}=await import("dockerode");return new t},W=t=>{if(!t.startsWith(y))return;const[s]=t.slice(y.length).split(":");return s!==void 0&&s.length>0?s:void 0},h=t=>{const s=new b("utf8");let a="";const n=r=>{t(r.endsWith("\r")?r.slice(0,-1):r)};return new S({final(r){a+=s.end(),a.length>0&&(n(a),a=""),r()},write(r,m,i){a+=s.write(r);const d=a.split(`
|
|
2
|
-
`);a=d.pop()??"";for(const w of d)n(w);i()}})},P=t=>{const s=new Map(t.containers.map(e=>[e.className.toLowerCase(),e.exportName]));if(s.size===0)return{close:()=>{}};const a=t.pollIntervalMs??M,n=new Map;let r=!1,m=!1,i,d;const w=async()=>(d??=t.docker?Promise.resolve(t.docker):N(),d),I=async(e,l,f)=>{try{const o=await e.getContainer(l).logs({follow:!0,stderr:!0,stdout:!0,tail:"all",timestamps:!1});if(r){o.destroy();return}const c=h(p=>{t.onLine({level:"info",name:f,text:p})}),u=h(p=>{t.onLine({level:"error",name:f,text:p})});e.modem.demuxStream(o,c,u),o.on("end",()=>{c.end(),u.end(),n.delete(l)}),o.on("error",()=>{n.delete(l)}),n.set(l,o)}catch{}},x=async()=>{try{const e=await(await w()).listContainers({filters:{status:["running"]}});return m=!1,e}catch(e){m||(m=!0,t.onUnavailable?.(e instanceof Error?e.message:String(e)));return}},C=async(e,l)=>{const f=new Set;for(const o of l){const c=W(o.Image),u=c===void 0?void 0:s.get(c);u!==void 0&&(f.add(o.Id),n.has(o.Id)||await I(e,o.Id,u))}for(const[o,c]of n)f.has(o)||(c.destroy(),n.delete(o))},L=async()=>{if(r)return;const e=await x();e!==void 0&&await C(await w(),e)};let v=!1;const g=()=>{v||r||(v=!0,L().finally(()=>{v=!1}).catch(()=>{}))};return i=setInterval(g,a),i.unref(),g(),{close:()=>{r=!0,i&&(clearInterval(i),i=void 0);for(const[e,l]of n)l.destroy(),n.delete(e)}}};export{P as streamContainerLogs};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
const o=n=>JSON.stringify(n),y=/^[A-Z_a-z][\w$]*$/u,l=n=>y.test(n),p=n=>l(n)?n:`binding_${n.replaceAll(/\W/gu,"_")}`,m=(n,i=p(n))=>{const t=l(n);return t&&i===n?`${n},`:`${t?n:o(n)}: ${i},`},_=n=>{const i=new Set;for(const t of n.migrations??[])for(const s of t.new_sqlite_classes??[])i.add(s);return i},$=(n,i,t,s,r)=>{for(const a of n.durable_objects?.bindings??[])if(!(a.name===void 0||a.class_name===void 0)){if(a.script_name!==void 0){r.push(`durable_objects.${a.name} (external script_name "${a.script_name}")`);continue}t.add("DurableObjectNamespace"),s.push(m(a.name,`DurableObjectNamespace(${o(a.name)}, { className: ${o(a.class_name)}, sqlite: ${String(i.has(a.class_name))} })`))}},v=(n,i)=>{for(const[t,s]of Object.entries(n.vars??{}))i.push(m(t,o(String(s))))},h=(n,i)=>{for(const[t,s]of[["ai","ai"],["analytics_engine_datasets","analytics_engine_datasets"],["browser","browser"],["containers","containers"],["hyperdrive","hyperdrive"],["images","images"],["pipelines","pipelines"],["vectorize","vectorize"],["workflows","workflows"]]){const r=n[t];r!==void 0&&(!Array.isArray(r)||r.length>0)&&i.push(s)}},w=n=>{const i=n.name??"worker",t=[],s=new Set(["Worker"]),r=[],a=[],g=_(n),b=[{construct:"D1Database",entries:(n.d1_databases??[]).map(e=>({binding:e.binding,name:e.database_name})),nameKey:"name"},{construct:"R2Bucket",entries:(n.r2_buckets??[]).map(e=>({binding:e.binding,name:e.bucket_name})),nameKey:"name"},{construct:"KVNamespace",entries:(n.kv_namespaces??[]).map(e=>({binding:e.binding,name:e.binding})),nameKey:"title"},{construct:"Queue",entries:(n.queues?.producers??[]).map(e=>({binding:e.binding,name:e.queue})),nameKey:"name"}];for(const{construct:e,entries:d,nameKey:f}of b)for(const c of d)c.binding!==void 0&&(s.add(e),r.push(`const ${p(c.binding)} = await ${e}(${o(c.binding)}, { adopt: true, ${f}: ${o(c.name??c.binding)} });`),a.push(m(c.binding)));$(n,g,s,a,t),v(n,a),h(n,t);const u=["adopt: true,",a.length===0?void 0:`bindings: {
|
|
2
|
-
${a.join(`
|
|
3
|
-
`)}
|
|
4
|
-
},`,n.compatibility_date===void 0?void 0:`compatibilityDate: ${o(n.compatibility_date)},`,n.compatibility_flags===void 0||n.compatibility_flags.length===0?void 0:`compatibilityFlags: ${o([...n.compatibility_flags])},`,n.triggers?.crons===void 0||n.triggers.crons.length===0?void 0:`crons: ${o([...n.triggers.crons])},`,n.main===void 0?void 0:`entrypoint: ${o(n.main)},`,`name: ${o(i)},`].filter(e=>e!==void 0);return{source:["// GENERATED by @lunora/config from wrangler.jsonc — do not edit.","// Re-generated on every `lunora deploy`; edit wrangler.jsonc instead.","",'import alchemy from "alchemy";',`import { ${[...s].toSorted((e,d)=>e.localeCompare(d)).join(", ")} } from "alchemy/cloudflare";`,"",`const app = await alchemy(${o(i)});`,"",...r.length===0?[]:[...r,""],`export const worker = await Worker(${o(i)}, {`,` ${u.join(`
|
|
5
|
-
`)}`,"});","","await app.finalize();",""].join(`
|
|
6
|
-
`),unsupported:t}};export{_ as sqliteClasses,w as wranglerToAlchemy};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{writeFileSync as e,renameSync as n,rmSync as m}from"node:fs";const a=(t,o)=>{const r=`${t}.lunora-tmp`;try{e(r,o,"utf8"),n(r,t)}catch(c){throw m(r,{force:!0}),c}};export{a as m};
|