@lunora/config 1.0.0-alpha.338 → 1.0.0-alpha.339
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.mjs +1 -1
- package/dist/index.d.mts +5 -2
- package/dist/index.d.ts +5 -2
- package/dist/index.mjs +1 -1
- package/dist/packem_shared/{DEV_WORKER_ENV_VALUE-jek0qc2i.mjs → DEV_WORKER_ENV_VALUE-2XFXmRrP.mjs} +1 -1
- package/dist/packem_shared/{POLICY_SCAFFOLD_ENDPOINT-BquzWeBo.mjs → POLICY_SCAFFOLD_ENDPOINT-BmJYwAy2.mjs} +1 -1
- package/dist/packem_shared/{SCHEMA_EDIT_ENDPOINT-DrZLd5rF.mjs → SCHEMA_EDIT_ENDPOINT-BeTxqCuQ.mjs} +1 -1
- package/dist/packem_shared/{STUDIO_PATH-B-rhpKZU.mjs → STUDIO_PATH-CSx_psKS.mjs} +1 -1
- package/dist/packem_shared/buildPackageSecretsBlock-BWV_VxqV.mjs +19 -0
- package/dist/packem_shared/{collectExportGaps-BVb5JlSY.mjs → collectExportGaps-BfnHx4y3.mjs} +1 -1
- package/dist/packem_shared/{reconcileBindingsSafely-Cj6LlUTQ.mjs → reconcileBindingsSafely-Ck6LaDO-.mjs} +1 -1
- package/dist/packem_shared/{scanWranglerVariablesForSecrets-BF-791aw.mjs → scanWranglerVariablesForSecrets-BFTVje1q.mjs} +1 -1
- package/dist/packem_shared/{wranglerCodegenInputs-DBtq3faO.mjs → wranglerCodegenInputs-CbisphsH.mjs} +1 -1
- package/dist/packem_shared/{write-atomic-COUkUylA.mjs → write-atomic-CK6VZaPI.mjs} +1 -1
- package/dist/studio-host/index.mjs +1 -1
- package/package.json +3 -3
- package/dist/packem_shared/buildPackageSecretsBlock-xaAqLu5K.mjs +0 -19
|
@@ -1 +1 @@
|
|
|
1
|
-
import{applyModify as o}from"../packem_shared/applyModify-DKP2l6S9.mjs";import{assertWranglerSatisfiesSchema as l}from"../packem_shared/assertWranglerSatisfiesSchema-Dy0WXvP8.mjs";import{BINDING_MANIFEST_VERSION as i,buildBindingManifest as n}from"../packem_shared/BINDING_MANIFEST_VERSION-CfXEYG8e.mjs";import{CLOUDFLARE_CLI_CONFIG_WARNING_ENV as m,detectCloudflareCliConfig as E,warnCloudflareCliConfigOnce as s}from"../packem_shared/CLOUDFLARE_CLI_CONFIG_WARNING_ENV-BKMrOuXV.mjs";import{default as C}from"../packem_shared/CLOUDFLARE_DRIVER-Ci3VIqnk.mjs";import{default as g}from"../packem_shared/GLOBAL_FETCH_STRICTLY_PUBLIC_FLAG-f8CnJha3.mjs";import{hasCloudflareCredentials as R}from"../packem_shared/hasCloudflareCredentials-byvHpEiD.mjs";import{describeWithheldWorkersAi as _,withheldWorkersAi as I}from"../packem_shared/describeWithheldWorkersAi-IIxe3TuI.mjs";import{collectExportGaps as A,reconcileWranglerBindings as W}from"../packem_shared/collectExportGaps-
|
|
1
|
+
import{applyModify as o}from"../packem_shared/applyModify-DKP2l6S9.mjs";import{assertWranglerSatisfiesSchema as l}from"../packem_shared/assertWranglerSatisfiesSchema-Dy0WXvP8.mjs";import{BINDING_MANIFEST_VERSION as i,buildBindingManifest as n}from"../packem_shared/BINDING_MANIFEST_VERSION-CfXEYG8e.mjs";import{CLOUDFLARE_CLI_CONFIG_WARNING_ENV as m,detectCloudflareCliConfig as E,warnCloudflareCliConfigOnce as s}from"../packem_shared/CLOUDFLARE_CLI_CONFIG_WARNING_ENV-BKMrOuXV.mjs";import{default as C}from"../packem_shared/CLOUDFLARE_DRIVER-Ci3VIqnk.mjs";import{default as g}from"../packem_shared/GLOBAL_FETCH_STRICTLY_PUBLIC_FLAG-f8CnJha3.mjs";import{hasCloudflareCredentials as R}from"../packem_shared/hasCloudflareCredentials-byvHpEiD.mjs";import{describeWithheldWorkersAi as _,withheldWorkersAi as I}from"../packem_shared/describeWithheldWorkersAi-IIxe3TuI.mjs";import{collectExportGaps as A,reconcileWranglerBindings as W}from"../packem_shared/collectExportGaps-BfnHx4y3.mjs";import{reconcileWranglerCompatibilityDate as O}from"../packem_shared/reconcileWranglerCompatibilityDate-hocXEuRA.mjs";import{describePreservedCrons as D,reconcileWranglerCrons as F}from"../packem_shared/describePreservedCrons-C5KPuPy3.mjs";import{reconcileBindingsSafely as v,reconcileWranglerExtras as B}from"../packem_shared/reconcileBindingsSafely-Ck6LaDO-.mjs";import{REMOTE_ELIGIBLE_KEYS as h,injectRemoteFlags as u,isRemoteEnvEnabled as G,materializeDevWranglerConfig as U,planRemoteBindings as M,resolveRemoteEnabled as y}from"../packem_shared/REMOTE_ELIGIBLE_KEYS-PLeh_74E.mjs";import{materializeServiceDevConfigs as w}from"../packem_shared/materializeServiceDevConfigs-DLUHefD-.mjs";import{default as Y}from"../packem_shared/CLOUDFLARE_TOOLCHAIN_VERSIONS-DV5E_f_q.mjs";import{withTailConsumer as K}from"../packem_shared/withTailConsumer-DngzpJMK.mjs";import{WORKERS_CACHE_MIN_DATE as k,isCacheEnabled as z}from"../packem_shared/WORKERS_CACHE_MIN_DATE-0k9ABJtF.mjs";import{wranglerCodegenInputs as J}from"../packem_shared/wranglerCodegenInputs-CbisphsH.mjs";import{DEFAULT_OBSERVABILITY as q,resolveObservabilitySampling as Z}from"../packem_shared/DEFAULT_OBSERVABILITY-bN6UkTMx.mjs";import{mergeWranglerEnvironment as ee}from"../packem_shared/mergeWranglerEnvironment-DXiB-HcS.mjs";import{WRANGLER_FILES as oe,findWranglerFile as ae,readWranglerJsonc as le}from"../packem_shared/WRANGLER_FILES-UNW-xY5u.mjs";import{UNEXPORTED_CLASS_MARKER as ie,validateWranglerProject as ne}from"../packem_shared/UNEXPORTED_CLASS_MARKER-IAK9PiDz.mjs";import{scanWranglerVariablesForSecrets as me}from"../packem_shared/scanWranglerVariablesForSecrets-BFTVje1q.mjs";import{wranglerToAlchemy as se}from"../packem_shared/wranglerToAlchemy-CBO2ucRm.mjs";import{REQUIRED_COMPATIBILITY_DATE as Ce,REQUIRED_FLAG as de,validateWrangler as ge,validateWranglerConfig as xe}from"../packem_shared/REQUIRED_COMPATIBILITY_DATE-OLQlG0oj.mjs";export{i as BINDING_MANIFEST_VERSION,m as CLOUDFLARE_CLI_CONFIG_WARNING_ENV,C as CLOUDFLARE_DRIVER,Y as CLOUDFLARE_TOOLCHAIN_VERSIONS,q as DEFAULT_OBSERVABILITY,g as GLOBAL_FETCH_STRICTLY_PUBLIC_FLAG,h as REMOTE_ELIGIBLE_KEYS,Ce as REQUIRED_COMPATIBILITY_DATE,de as REQUIRED_FLAG,ie as UNEXPORTED_CLASS_MARKER,k as WORKERS_CACHE_MIN_DATE,oe as WRANGLER_FILES,o as applyModify,l as assertWranglerSatisfiesSchema,n as buildBindingManifest,A as collectExportGaps,D as describePreservedCrons,_ as describeWithheldWorkersAi,E as detectCloudflareCliConfig,ae as findWranglerFile,R as hasCloudflareCredentials,u as injectRemoteFlags,z as isCacheEnabled,G as isRemoteEnvEnabled,U as materializeDevWranglerConfig,w as materializeServiceDevConfigs,ee as mergeWranglerEnvironment,M as planRemoteBindings,le as readWranglerJsonc,v as reconcileBindingsSafely,W as reconcileWranglerBindings,O as reconcileWranglerCompatibilityDate,F as reconcileWranglerCrons,B as reconcileWranglerExtras,Z as resolveObservabilitySampling,y as resolveRemoteEnabled,me as scanWranglerVariablesForSecrets,ge as validateWrangler,xe as validateWranglerConfig,ne as validateWranglerProject,s as warnCloudflareCliConfigOnce,K as withTailConsumer,I as withheldWorkersAi,J as wranglerCodegenInputs,se as wranglerToAlchemy};
|
package/dist/index.d.mts
CHANGED
|
@@ -1281,8 +1281,11 @@ interface FillDevSecretsResult {
|
|
|
1281
1281
|
* This fills those gaps at dev startup, so both `lunora dev` and the
|
|
1282
1282
|
* `@lunora/vite` dev server give a working project with zero manual `openssl`.
|
|
1283
1283
|
*
|
|
1284
|
-
* Never overwrites a real (non-placeholder) value.
|
|
1285
|
-
*
|
|
1284
|
+
* Never overwrites a real (non-placeholder) value. Two writers, on purpose: when
|
|
1285
|
+
* the file does not exist yet, the create goes through {@link createExclusively}
|
|
1286
|
+
* and loses to a peer that creates it first; when it exists, the fill rewrites
|
|
1287
|
+
* it through {@link atomicWrite} (temp + rename, owner-only) with the keys it
|
|
1288
|
+
* just read and planned against.
|
|
1286
1289
|
*/
|
|
1287
1290
|
declare const fillDevSecrets: (deps: {
|
|
1288
1291
|
cwd: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -1281,8 +1281,11 @@ interface FillDevSecretsResult {
|
|
|
1281
1281
|
* This fills those gaps at dev startup, so both `lunora dev` and the
|
|
1282
1282
|
* `@lunora/vite` dev server give a working project with zero manual `openssl`.
|
|
1283
1283
|
*
|
|
1284
|
-
* Never overwrites a real (non-placeholder) value.
|
|
1285
|
-
*
|
|
1284
|
+
* Never overwrites a real (non-placeholder) value. Two writers, on purpose: when
|
|
1285
|
+
* the file does not exist yet, the create goes through {@link createExclusively}
|
|
1286
|
+
* and loses to a peer that creates it first; when it exists, the fill rewrites
|
|
1287
|
+
* it through {@link atomicWrite} (temp + rename, owner-only) with the keys it
|
|
1288
|
+
* just read and planned against.
|
|
1286
1289
|
*/
|
|
1287
1290
|
declare const fillDevSecrets: (deps: {
|
|
1288
1291
|
cwd: string;
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{AGENT_MODE_ENV as o,detectAiAgent as t}from"./packem_shared/AGENT_MODE_ENV-D8MvSwPE.mjs";import{discoverAgentInfo as E}from"./packem_shared/discoverAgentInfo-pqFMJBtJ.mjs";import{AGENT_RULES_DIR as i,AGENT_RULES_HINT as n,AGENT_RULES_HINT_ENV as _,LUNORA_SKILL_NAMES as l,ROOT_SKILL_NAME as c,claimAgentRulesHint as p,detectAgentRules as d}from"./packem_shared/AGENT_RULES_DIR-HrrbNZPy.mjs";import{startCelldDevSession as A}from"./packem_shared/startCelldDevSession-BLFsd6jG.mjs";import{CODEGEN_ENV as m,isCodegenDisabled as f}from"./packem_shared/CODEGEN_ENV-ZsCxV1kP.mjs";import{discoverContainerInfo as R}from"./packem_shared/discoverContainerInfo-MI3HIHmJ.mjs";import{streamContainerLogs as N}from"./packem_shared/streamContainerLogs-0nko1qpv.mjs";import{detectFramework as g,projectUsesUmbrella as x}from"./packem_shared/detectFramework-Dfpvu6rD.mjs";import{acceptsConnection as I,startDevProcess as O}from"./packem_shared/acceptsConnection-DHhUYGjT.mjs";import{DEV_BINDINGS_FILE as u,DEV_DAEMON_ENV as C,DEV_HANDOFF_ENV as F,DEV_LOG_FILE as U,DEV_LOG_FILE_ENV as M,DEV_STATE_DIR as G,DEV_STATE_FILE as B,claimDevServerState as b,clearDevServerState as y,isDevServerReady as k,isProcessAlive as j,isRecordedProcessCurrent as K,readDevServerState as w,readLiveDevServerState as h,updateDevServerState as H,writeDevServerState as W}from"./packem_shared/DEV_BINDINGS_FILE-C0ZN_XlP.mjs";import{DEV_VARS_EXAMPLE_FILE as J,DEV_VARS_FILE as q,DEV_VARS_KEY_PATTERN as X,escapeRegExp as z,parseDevVariableEntries as Q,removeDevVariableLine as Z,upsertDevVariableLine as $}from"./packem_shared/DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";import{DEV_WORKER_ENV_VALUE as re,DEV_WORKER_ENV_VAR as oe,ensureDevWorkerEnv as te}from"./packem_shared/DEV_WORKER_ENV_VALUE-
|
|
1
|
+
import{AGENT_MODE_ENV as o,detectAiAgent as t}from"./packem_shared/AGENT_MODE_ENV-D8MvSwPE.mjs";import{discoverAgentInfo as E}from"./packem_shared/discoverAgentInfo-pqFMJBtJ.mjs";import{AGENT_RULES_DIR as i,AGENT_RULES_HINT as n,AGENT_RULES_HINT_ENV as _,LUNORA_SKILL_NAMES as l,ROOT_SKILL_NAME as c,claimAgentRulesHint as p,detectAgentRules as d}from"./packem_shared/AGENT_RULES_DIR-HrrbNZPy.mjs";import{startCelldDevSession as A}from"./packem_shared/startCelldDevSession-BLFsd6jG.mjs";import{CODEGEN_ENV as m,isCodegenDisabled as f}from"./packem_shared/CODEGEN_ENV-ZsCxV1kP.mjs";import{discoverContainerInfo as R}from"./packem_shared/discoverContainerInfo-MI3HIHmJ.mjs";import{streamContainerLogs as N}from"./packem_shared/streamContainerLogs-0nko1qpv.mjs";import{detectFramework as g,projectUsesUmbrella as x}from"./packem_shared/detectFramework-Dfpvu6rD.mjs";import{acceptsConnection as I,startDevProcess as O}from"./packem_shared/acceptsConnection-DHhUYGjT.mjs";import{DEV_BINDINGS_FILE as u,DEV_DAEMON_ENV as C,DEV_HANDOFF_ENV as F,DEV_LOG_FILE as U,DEV_LOG_FILE_ENV as M,DEV_STATE_DIR as G,DEV_STATE_FILE as B,claimDevServerState as b,clearDevServerState as y,isDevServerReady as k,isProcessAlive as j,isRecordedProcessCurrent as K,readDevServerState as w,readLiveDevServerState as h,updateDevServerState as H,writeDevServerState as W}from"./packem_shared/DEV_BINDINGS_FILE-C0ZN_XlP.mjs";import{DEV_VARS_EXAMPLE_FILE as J,DEV_VARS_FILE as q,DEV_VARS_KEY_PATTERN as X,escapeRegExp as z,parseDevVariableEntries as Q,removeDevVariableLine as Z,upsertDevVariableLine as $}from"./packem_shared/DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";import{DEV_WORKER_ENV_VALUE as re,DEV_WORKER_ENV_VAR as oe,ensureDevWorkerEnv as te}from"./packem_shared/DEV_WORKER_ENV_VALUE-2XFXmRrP.mjs";import{DEFAULT_DEPLOY_TARGET as Ee,deployTargetIds as se,isRunnableTarget as ie,planToolchainInvocation as ne,resolveDeployDriver as _e,runnableTargetIds as le,targetRunsOwnDevServer as ce}from"./packem_shared/DEFAULT_DEPLOY_TARGET-CfoV0tDu.mjs";import{i as de,s as De}from"./packem_shared/infer-bindings-BsgN5eCm.mjs";import{LINKED_PROJECT_DIR as Se,LINKED_PROJECT_FILE as me,readLinkedProject as fe,writeLinkedProject as Le}from"./packem_shared/LINKED_PROJECT_DIR-Ba5qPEwo.mjs";import{LUNORA_IGNORED_PATHS as ve,applyLintIgnores as Ne,detectLintTools as Te}from"./packem_shared/LUNORA_IGNORED_PATHS-U93uPxrW.mjs";import{LUNORA_TAG as xe,advisoryLine as Ve,blockingFindingsMessage as Ie,lunoraLine as Oe,reportCodegenFindings as Pe}from"./packem_shared/LUNORA_TAG-CiQM3BkI.mjs";import{LUNORA_EVENT_SOURCE as Ce,formatLunoraEvent as Fe}from"./packem_shared/LUNORA_EVENT_SOURCE-B9ZVohjO.mjs";import{default as Me}from"./packem_shared/LunoraReporter-f277GLNT.mjs";import{addArgsFor as Be,detectInstalledManagers as be,detectPackageManager as ye,execArgsFor as ke,installArgsFor as je,runScriptArgsFor as Ke,runScriptCommand as we,toolchainExecArgs as he}from"./packem_shared/addArgsFor-CYZKhNIo.mjs";import{P as We,s as Ye}from"./packem_shared/package-secrets-registry-BeheNwsP.mjs";import{runPostCodegenHook as qe}from"./packem_shared/runPostCodegenHook-Dx3yTsYZ.mjs";import{interpretRemote as ze,readProjectRemotePreference as Qe,readProjectTarget as Ze,resolveProjectTarget as $e,resolveTargetOrThrow as er}from"./packem_shared/interpretRemote-C9yJC_ZK.mjs";import{readProjectDependencies as or,readProjectDependencyNames as tr,readProjectManifest as ar}from"./packem_shared/readProjectDependencies-l3uhUKjo.mjs";import{createConfirm as sr,isInteractive as ir,promptMultiSelect as nr,promptSelect as _r,promptText as lr,promptYesNo as cr}from"./packem_shared/createConfirm-D5mKTMHj.mjs";import{default as dr}from"./packem_shared/resolveSchemaDirectory-Ca5P6KuP.mjs";import{buildPackageSecretsBlock as Ar,ensureDevVariables as Sr,ensureDevVarsExample as mr,fillDevSecrets as fr,generateSecretValue as Lr,isMintableSecretKey as Rr,isPlaceholderValue as vr,planDevSecretsFill as Nr,planDevVariablesAugment as Tr,planDevVariablesScaffold as gr,requiredSecrets as xr,writeDevVariablesFileAtomically as Vr}from"./packem_shared/buildPackageSecretsBlock-BWV_VxqV.mjs";import{applyAdditiveEdit as Or,classifyEdit as Pr}from"./packem_shared/applyAdditiveEdit-CH0VhMJ2.mjs";import{parseSchema as Cr}from"./packem_shared/parseSchema-D1Wbr1qv.mjs";import{classifyPolicyEdit as Ur,resolveServerModule as Mr,scaffoldPolicyFile as Gr,wireRlsIntoProcedure as Br}from"./packem_shared/classifyPolicyEdit-DJi9Fk8G.mjs";import{discoverSchemaInfo as yr}from"./packem_shared/discoverSchemaInfo-BLe1EVI8.mjs";import{ACCENT as jr,BADGES as Kr,BADGE_COLUMN_WIDTH as wr,LUNA_ART as hr,LUNA_BUNNY as Hr,LUNA_NAME as Wr,LUNA_SIGNOFF as Yr,STEP_BADGE_NAMES as Jr,badgeLead as qr,badgeWidth as Xr,padBadge as zr,paintAnswer as Qr,paintBadge as Zr}from"./packem_shared/ACCENT-CotPTfv7.mjs";import{COMPOSED_WORKER_ENTRY as eo,DURABLE_OBJECT_BINDINGS as ro,GENERATED_CLASS_MODULES as oo,GENERATED_MODULE_DURABLE_OBJECTS as to,MERGED_DURABLE_OBJECTS_MODULE as ao,isMergedProject as Eo,isMergedRoleModule as so}from"./packem_shared/COMPOSED_WORKER_ENTRY-Ciiba5g_.mjs";import{discoverWorkflowInfo as no}from"./packem_shared/discoverWorkflowInfo-zW7Tt0Tn.mjs";export{jr as ACCENT,o as AGENT_MODE_ENV,i as AGENT_RULES_DIR,n as AGENT_RULES_HINT,_ as AGENT_RULES_HINT_ENV,Kr as BADGES,wr as BADGE_COLUMN_WIDTH,m as CODEGEN_ENV,eo as COMPOSED_WORKER_ENTRY,Ee as DEFAULT_DEPLOY_TARGET,u as DEV_BINDINGS_FILE,C as DEV_DAEMON_ENV,F as DEV_HANDOFF_ENV,U as DEV_LOG_FILE,M as DEV_LOG_FILE_ENV,G as DEV_STATE_DIR,B as DEV_STATE_FILE,J as DEV_VARS_EXAMPLE_FILE,q as DEV_VARS_FILE,X as DEV_VARS_KEY_PATTERN,re as DEV_WORKER_ENV_VALUE,oe as DEV_WORKER_ENV_VAR,ro as DURABLE_OBJECT_BINDINGS,oo as GENERATED_CLASS_MODULES,to as GENERATED_MODULE_DURABLE_OBJECTS,Se as LINKED_PROJECT_DIR,me as LINKED_PROJECT_FILE,hr as LUNA_ART,Hr as LUNA_BUNNY,Wr as LUNA_NAME,Yr as LUNA_SIGNOFF,Ce as LUNORA_EVENT_SOURCE,ve as LUNORA_IGNORED_PATHS,l as LUNORA_SKILL_NAMES,xe as LUNORA_TAG,Me as LunoraReporter,ao as MERGED_DURABLE_OBJECTS_MODULE,We as PACKAGE_SECRETS_REGISTRY,c as ROOT_SKILL_NAME,Jr as STEP_BADGE_NAMES,I as acceptsConnection,Be as addArgsFor,Ve as advisoryLine,Or as applyAdditiveEdit,Ne as applyLintIgnores,qr as badgeLead,Xr as badgeWidth,Ie as blockingFindingsMessage,Ar as buildPackageSecretsBlock,p as claimAgentRulesHint,b as claimDevServerState,Pr as classifyEdit,Ur as classifyPolicyEdit,y as clearDevServerState,sr as createConfirm,se as deployTargetIds,d as detectAgentRules,t as detectAiAgent,g as detectFramework,be as detectInstalledManagers,Te as detectLintTools,ye as detectPackageManager,E as discoverAgentInfo,R as discoverContainerInfo,yr as discoverSchemaInfo,no as discoverWorkflowInfo,Sr as ensureDevVariables,mr as ensureDevVarsExample,te as ensureDevWorkerEnv,z as escapeRegExp,ke as execArgsFor,fr as fillDevSecrets,Fe as formatLunoraEvent,Lr as generateSecretValue,de as inferLunoraBindings,je as installArgsFor,ze as interpretRemote,f as isCodegenDisabled,k as isDevServerReady,ir as isInteractive,Eo as isMergedProject,so as isMergedRoleModule,Rr as isMintableSecretKey,vr as isPlaceholderValue,j as isProcessAlive,K as isRecordedProcessCurrent,ie as isRunnableTarget,Oe as lunoraLine,zr as padBadge,Qr as paintAnswer,Zr as paintBadge,Q as parseDevVariableEntries,Cr as parseSchema,Nr as planDevSecretsFill,Tr as planDevVariablesAugment,gr as planDevVariablesScaffold,ne as planToolchainInvocation,x as projectUsesUmbrella,nr as promptMultiSelect,_r as promptSelect,lr as promptText,cr as promptYesNo,w as readDevServerState,fe as readLinkedProject,h as readLiveDevServerState,or as readProjectDependencies,tr as readProjectDependencyNames,ar as readProjectManifest,Qe as readProjectRemotePreference,Ze as readProjectTarget,Z as removeDevVariableLine,Pe as reportCodegenFindings,xr as requiredSecrets,_e as resolveDeployDriver,$e as resolveProjectTarget,dr as resolveSchemaDirectory,Mr as resolveServerModule,er as resolveTargetOrThrow,qe as runPostCodegenHook,Ke as runScriptArgsFor,we as runScriptCommand,le as runnableTargetIds,Gr as scaffoldPolicyFile,De as secretSourcesFromBindings,Ye as secretsForPackages,A as startCelldDevSession,O as startDevProcess,N as streamContainerLogs,ce as targetRunsOwnDevServer,he as toolchainExecArgs,H as updateDevServerState,$ as upsertDevVariableLine,Br as wireRlsIntoProcedure,W as writeDevServerState,Vr as writeDevVariablesFileAtomically,Le as writeLinkedProject};
|
package/dist/packem_shared/{DEV_WORKER_ENV_VALUE-jek0qc2i.mjs → DEV_WORKER_ENV_VALUE-2XFXmRrP.mjs}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{readFileSync as l}from"node:fs";import{findWranglerFile as m,readWranglerJsonc as E}from"./WRANGLER_FILES-UNW-xY5u.mjs";import{DEV_VARS_FILE as i,parseDevVariableEntries as V,upsertDevVariableLine as c}from"./DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";import{writeDevVariablesFileAtomically as p}from"./buildPackageSecretsBlock-
|
|
1
|
+
import{readFileSync as l}from"node:fs";import{findWranglerFile as m,readWranglerJsonc as E}from"./WRANGLER_FILES-UNW-xY5u.mjs";import{DEV_VARS_FILE as i,parseDevVariableEntries as V,upsertDevVariableLine as c}from"./DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";import{writeDevVariablesFileAtomically as p}from"./buildPackageSecretsBlock-BWV_VxqV.mjs";import{join as v}from"node:path";const n="WORKER_ENV",a="development",d=e=>{const r=m(e);return r===void 0?{}:E(r).parsed?.vars??{}},W=(e,r)=>{const o=v(e,i);let t;try{t=l(o,"utf8")}catch{return}V(t).some(s=>s.key===n)||n in d(e)||(p(o,c(t,n,a)),r(`set ${n}=${a} in ${i} so the dev worker runs in development mode`))};export{a as DEV_WORKER_ENV_VALUE,n as DEV_WORKER_ENV_VAR,W as ensureDevWorkerEnv};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{existsSync as d,readFileSync as y}from"node:fs";import{join as s,isAbsolute as a,relative as m}from"node:path";import{LunoraError as p}from"@lunora/errors";import{classifyPolicyEdit as k,scaffoldPolicyFile as v,resolveServerModule as l,wireRlsIntoProcedure as b}from"./classifyPolicyEdit-DJi9Fk8G.mjs";import{w as c,r as h}from"./write-atomic-
|
|
1
|
+
import{existsSync as d,readFileSync as y}from"node:fs";import{join as s,isAbsolute as a,relative as m}from"node:path";import{LunoraError as p}from"@lunora/errors";import{classifyPolicyEdit as k,scaffoldPolicyFile as v,resolveServerModule as l,wireRlsIntoProcedure as b}from"./classifyPolicyEdit-DJi9Fk8G.mjs";import{w as c,r as h}from"./write-atomic-CK6VZaPI.mjs";const D="/__lunora/policy-scaffold",u=e=>e==="unknown-procedure"?404:e==="already-wired"||e==="destructive"?409:422,f=(e,o)=>{let r;try{r=h(e)}catch(t){return{body:{error:t instanceof Error?t.message:String(t),ok:!1},status:500}}return{body:{...o,diagnostics:r,ok:!0},status:200}},g=e=>({body:{edit:e,message:"Rewriting an existing policy predicate changes evaluation semantics and must be done by hand. The scaffolder only adds new, deny-by-default rules.",needsManualEdit:!0,ok:!1},status:409}),w=(e,o)=>{const r=v(o,l(e.projectRoot));if(!r.ok)return{body:{error:r.reason,ok:!1},status:u(r.reason)};const t=e.schemaDirectory??"lunora",n=s(e.projectRoot,t,r.fileName);return d(n)?{body:{error:"file-exists",fileName:r.fileName,ok:!1},status:409}:(c(n,r.source),f(e,{fileName:r.fileName}))},R=(e,o,r)=>{if(typeof r!="string"||r.length===0||a(r)||r.includes("\\"))return;const t=s(e,o),n=s(t,`${r}.ts`),i=m(t,n);if(!(i.startsWith("..")||a(i)))return n},N=(e,o)=>{const r=R(e.projectRoot,e.schemaDirectory??"lunora",o.filePath);if(r===void 0||!d(r))return{body:{error:"unknown-procedure",ok:!1},status:404};const t=b(y(r,"utf8"),o,l(e.projectRoot));return t.ok?(c(r,t.text),f(e,{exportName:o.exportName})):{body:{error:t.reason,ok:!1},status:u(t.reason)}},E=e=>{if(e.method!=="POST")return{body:{error:"method-not-allowed",ok:!1},status:405};const{body:o}=e;if(o==null||typeof o!="object"||typeof o.kind!="string")return{body:{error:"invalid-edit",ok:!1},status:400};const r=o;if(k(r)==="destructive")return g(r);if(r.kind==="scaffoldPolicy")return w(e,r);if(r.kind==="wireRls")return N(e,r);throw new p("INTERNAL",`unhandled additive policy edit kind: ${String(r.kind)}`)};export{D as POLICY_SCAFFOLD_ENDPOINT,E as handlePolicyScaffoldRequest};
|
package/dist/packem_shared/{SCHEMA_EDIT_ENDPOINT-DrZLd5rF.mjs → SCHEMA_EDIT_ENDPOINT-BeTxqCuQ.mjs}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{existsSync as a,readFileSync as d}from"node:fs";import{classifyEdit as l,applyAdditiveEdit as c}from"./applyAdditiveEdit-CH0VhMJ2.mjs";import{parseSchema as u}from"./parseSchema-D1Wbr1qv.mjs";import{w as f,r as p}from"./write-atomic-
|
|
1
|
+
import{existsSync as a,readFileSync as d}from"node:fs";import{classifyEdit as l,applyAdditiveEdit as c}from"./applyAdditiveEdit-CH0VhMJ2.mjs";import{parseSchema as u}from"./parseSchema-D1Wbr1qv.mjs";import{w as f,r as p}from"./write-atomic-CK6VZaPI.mjs";import{join as m}from"node:path";const F="/__lunora/schema-edit",b=t=>t==="destructive"||t==="duplicate-table"||t==="duplicate-column"||t==="duplicate-index"?409:t==="unknown-table"?404:t==="invalid-identifier"||t==="invalid-validator"?400:422,y=t=>({body:{error:t.reason,ok:!1},status:422}),h=t=>{if(!a(t))return{response:{body:{error:"no-schema-file",ok:!1},status:404}};const r=u(d(t,"utf8"));return r.ok?{tables:r.tables}:{response:y(r)}},k=t=>({body:{edit:t,message:"This edit changes stored data and must go through a migration. Review the migration before applying.",needsMigration:!0,ok:!1},status:409}),g=(t,r)=>{const e=t.body;if(e==null||typeof e!="object"||typeof e.kind!="string")return{body:{error:"invalid-edit",ok:!1},status:400};if(l(e)==="destructive")return k(e);if(!a(r))return{body:{error:"no-schema-file",ok:!1},status:404};const o=c(d(r,"utf8"),e);if(!o.ok)return{body:{error:o.reason,ok:!1},status:b(o.reason)};f(r,o.text);let i;try{i=p(t)}catch(s){return{body:{error:s instanceof Error?s.message:String(s),ok:!1},status:500}}const n=u(o.text);return{body:{diagnostics:i,ok:!0,tables:n.ok?n.tables:[]},status:200}},R=t=>{const r=m(t.projectRoot,t.schemaDirectory??"lunora","schema.ts");if(t.method==="GET"){const e=h(r);return"response"in e?e.response:{body:{ok:!0,tables:e.tables},status:200}}return t.method==="POST"?g(t,r):{body:{error:"method-not-allowed",ok:!1},status:405}};export{F as SCHEMA_EDIT_ENDPOINT,R as handleSchemaEditRequest};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{resolveAdminToken as A}from"./parseDevVariable-teAAahVD.mjs";import{sendStudioDocument as I,applyStudioAssetCache as O}from"./applyStudioAssetCache-DHQEJuuv.mjs";import{isStandaloneModulePath as _,studioAssetsStamp as H,loadStudioAssets as N,readStandaloneAsset as C,assetContentType as D}from"./assetContentType-CUb5bpbI.mjs";import{detectAgentRules as E}from"./AGENT_RULES_DIR-HrrbNZPy.mjs";import{handlePolicyScaffoldRequest as v,POLICY_SCAFFOLD_ENDPOINT as L}from"./POLICY_SCAFFOLD_ENDPOINT-
|
|
1
|
+
import{resolveAdminToken as A}from"./parseDevVariable-teAAahVD.mjs";import{sendStudioDocument as I,applyStudioAssetCache as O}from"./applyStudioAssetCache-DHQEJuuv.mjs";import{isStandaloneModulePath as _,studioAssetsStamp as H,loadStudioAssets as N,readStandaloneAsset as C,assetContentType as D}from"./assetContentType-CUb5bpbI.mjs";import{detectAgentRules as E}from"./AGENT_RULES_DIR-HrrbNZPy.mjs";import{handlePolicyScaffoldRequest as v,POLICY_SCAFFOLD_ENDPOINT as L}from"./POLICY_SCAFFOLD_ENDPOINT-BmJYwAy2.mjs";import R from"./renderStudioHtml-ByowDtMl.mjs";import{handleSchemaEditRequest as b,SCHEMA_EDIT_ENDPOINT as x}from"./SCHEMA_EDIT_ENDPOINT-BeTxqCuQ.mjs";import{handleSeedRequest as k,SEED_ENDPOINT as $}from"./SEED_ENDPOINT-2B56PN_H.mjs";import{serveJsonHandler as g}from"./serveJsonHandler-Dv0EdCb9.mjs";import{transportRejectionReason as j}from"./ALLOW_FORWARDED_ENV-BUndghJx.mjs";const d="/__lunora",M=`${d}/studio.js`,m=`${d}/styles.css`,p=/\/$/,U={[L]:v,[x]:b,[$]:k},q=new Set(["127.0.0.1","::1","localhost"]),X=t=>t!==void 0&&t!==!1&&!q.has(t),y=t=>t===void 0||t==="/"?"":t.replace(p,""),Z=t=>`${y(t)}${d}`,T=(t,n,c)=>{t.statusCode=200,t.setHeader("Content-Type",c),t.end(n)},w=t=>{try{return new URL(t,"http://localhost").pathname}catch{const n=t.indexOf("?");return n===-1?t:t.slice(0,n)}},tt=t=>{const{logger:n,projectRoot:c}=t,u=y(t.base);let l,f,S;const P=(o,s,e)=>{const i=H();if((l===void 0||i!==f)&&(l=N(n),f=i),l===void 0){e.statusCode=501,e.setHeader("Content-Type","text/plain"),e.end("Lunora studio assets not found — install and build @lunora/studio.");return}const a=o===m,r=o.slice(o.lastIndexOf("/")+1);if(O(s,e,r,i))return;if(a){T(e,l.styles,"text/css; charset=utf-8");return}const h=C(r);if(h===void 0){e.statusCode=404,e.setHeader("Content-Type","text/plain"),e.end("Not found");return}T(e,h,D(r))};return(o,s,e)=>{const i=w(o.url??"").replace(p,""),a=u!==""&&i.startsWith(u)?i.slice(u.length):i;if(a!==d&&!a.startsWith(`${d}/`)){e();return}if(t.isNonLoopbackBind||j(o,n)!==void 0){s.statusCode=403,s.setHeader("Content-Type","text/plain"),s.end("Lunora studio is only available on loopback hosts in dev.");return}const r=U[a];if(r!==void 0){g(o,s,r,c,{apiSpec:t.apiSpec,schemaDirectory:t.schemaDirectory});return}if(a===m||_(a)){P(a,o,s);return}S??=R({adminToken:A(c),basePath:d,dataEditable:!0,rulesInstalled:E(c).installed,runAsIdentity:!0,schemaEditable:!0,scriptSrc:M,styleHref:m}),I(s,S)}};export{d as STUDIO_PATH,M as STUDIO_SCRIPT_PATH,m as STUDIO_STYLE_PATH,tt as createStudioMiddleware,X as isNonLoopbackHost,w as requestPathname,Z as studioMountPath};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import{randomBytes as _}from"node:crypto";import{existsSync as m,readFileSync as y,writeFileSync as h,linkSync as M,rmSync as g,renameSync as A,statSync as T}from"node:fs";import{join as p}from"node:path";import{LunoraError as F}from"@lunora/errors";import{DEV_VARS_FILE as u,DEV_VARS_EXAMPLE_FILE as f,parseDevVariableLine as $,parseDevVariableEntries as E,DEV_VARS_NEWLINE as C}from"./DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";import{C as P,M as j,s as I}from"./package-secrets-registry-BeheNwsP.mjs";const R=e=>[...P,...I(e)],S=32,N=["replace","openssl","changeme","change-me","change_me","change-this","change_this","your-","your_","example","placeholder","todo","fill-me","fill_me","fill-in","fill_in","xxx"],z=/[.*+?^${}()|[\]\\]/gu,B=/[a-z0-9]$/u,W=e=>{const t=e.trim().toLowerCase();return t===""||t.startsWith("<")&&t.endsWith(">")?!0:N.some(r=>{const s=r.replaceAll(z,String.raw`\$&`),o=B.test(r)?`(^|[^a-z0-9])${s}([^a-z0-9]|$)`:`(^|[^a-z0-9])${s}`;return new RegExp(o,"u").test(t)})},x=e=>_(e).toString("hex"),X=e=>j.has(e),D=(e,t,r)=>X(e)&&W(t)?r(S):void 0,ae=(e=x)=>e(S),H=(e,t,r)=>e.split(C).map(s=>{const n=$(s),o=n?D(n.key,n.value,t):void 0;return!n||o===void 0?s:(r.push(n.key),`${n.key}="${o}"`)}),G=e=>{if(e.devVarsExists)return{status:"exists"};if(e.exampleContent===void 0)return{status:"no-example"};const t=[];return{content:H(e.exampleContent,e.randomHex??x,t).join(`
|
|
2
|
+
`),generatedKeys:t,status:"generate"}},O=e=>e.includes('"')||e.includes("\\")?"":e.replaceAll("\r",String.raw`\r`).replaceAll(`
|
|
3
|
+
`,String.raw`\n`),w=e=>{const t=e.randomHex??x,r=new Set(E(e.existingContent).map(d=>d.key)),s=[],n=[],o=[];for(const d of e.exampleContent.split(C)){const i=$(d);if(!i||r.has(i.key))continue;const a=D(i.key,i.value,t);o.push(i.key),a===void 0?s.push(`${i.key}="${O(i.value)}"`):(n.push(i.key),s.push(`${i.key}="${a}"`))}return{additions:s,generatedKeys:n,missingKeys:o}},k=e=>e.length>0?` (generated ${e.join(", ")})`:"",b=e=>`${e}.tmp-${String(process.pid)}`,K=(e,t,r={})=>{const s=b(e);try{h(s,t,{encoding:"utf8",...r}),A(s,e)}catch(n){throw g(s,{force:!0}),n}},U=(e,t)=>{try{return h(e,t,{encoding:"utf8",flag:"wx",mode:384}),!0}catch(r){if(r.code==="EEXIST")return!1;throw r}},L=(e,t)=>{const r=b(e);try{h(r,t,{encoding:"utf8",flag:"wx",mode:384});try{return M(r,e),!0}catch(s){const{code:n}=s;if(n==="EEXIST")return!1;if(n==="EPERM"||n==="ENOTSUP")return U(e,t);throw s}}finally{g(r,{force:!0})}},ce=(e,t)=>{K(e,t,{mode:384})},v=5,V=e=>{try{const t=T(e);return{mtimeMs:t.mtimeMs,size:t.size}}catch{return}},Y=(e,t)=>e===void 0||t===void 0?!1:e.mtimeMs===t.mtimeMs&&e.size===t.size,q=(e,t)=>{for(let r=0;r<v;r+=1){const s=V(e),n=y(e,"utf8"),o=t(n);if(o.length===0)return[];const d=n.length>0&&!n.endsWith(`
|
|
4
|
+
`)?`
|
|
5
|
+
`:"",i=`${n}${d}${o.join(`
|
|
6
|
+
`)}
|
|
7
|
+
`,a=`${e}.tmp-${String(process.pid)}-${_(6).toString("hex")}`;try{h(a,i,{encoding:"utf8",mode:384});const c=V(e);if(!Y(s,c)){g(a,{force:!0});continue}return A(a,e),o}catch(c){throw g(a,{force:!0}),c}}throw new F("INTERNAL",`Failed to append to ${e} after ${String(v)} attempts — a concurrent writer kept winning the race.`)},de=async e=>{const t=p(e.cwd,u),r=p(e.cwd,f);if(!m(r))return{addedKeys:[],generatedKeys:[],status:"no-example"};const s=y(r,"utf8");if(!m(t)){const l=G({devVarsExists:!1,exampleContent:s,randomHex:e.randomHex});return l.status!=="generate"?{addedKeys:[],generatedKeys:[],status:"no-example"}:e.yes===!0||await e.confirm(`No ${u} found. Generate it from ${f} (secrets auto-filled)?`)?L(t,l.content)?(e.info(`Created ${u}${k(l.generatedKeys)}.`),{addedKeys:[],generatedKeys:l.generatedKeys,status:"generated"}):{addedKeys:[],generatedKeys:[],status:"skipped-exists"}:(e.info(`Skipped — copy ${f} to ${u} and fill it in when you're ready.`),{addedKeys:[],generatedKeys:[],status:"declined"})}const n=w({existingContent:y(t,"utf8"),exampleContent:s,randomHex:e.randomHex});if(n.missingKeys.length===0)return{addedKeys:[],generatedKeys:[],status:"exists"};const o=n.missingKeys.join(", ");if(!(e.yes===!0||await e.confirm(`${u} is missing ${String(n.missingKeys.length)} key(s) from ${f} (${o}). Add them?`)))return e.info(`Skipped — add ${o} to ${u} when you're ready.`),{addedKeys:[],generatedKeys:[],status:"declined"};const a=q(t,l=>w({existingContent:l,exampleContent:s,randomHex:e.randomHex}).additions).map(l=>$(l)?.key).filter(l=>l!==void 0);if(a.length===0)return{addedKeys:[],generatedKeys:[],status:"exists"};const c=n.generatedKeys.filter(l=>a.includes(l));return e.info(`Updated ${u} — added ${a.join(", ")}${k(c)}.`),{addedKeys:a,generatedKeys:c,status:"augmented"}},J=e=>[`# ${e.description}`,`# Docs: ${e.docsUrl}`,`${e.key}="${e.placeholderValue}"`].join(`
|
|
8
|
+
`),Q=(e,t)=>{const r=R(e).filter(s=>!t.has(s.key));return r.length===0?"":r.map(s=>J(s)).join(`
|
|
9
|
+
|
|
10
|
+
`)},le=(e,t)=>{const r=p(e,f),s=m(r)?y(r,"utf8"):"",n=new Set(E(s).map(i=>i.key)),o=Q(t,n);if(o==="")return[];const d=s.length>0&&!s.endsWith(`
|
|
11
|
+
`)?`
|
|
12
|
+
`:"";return K(r,`${s}${d}
|
|
13
|
+
${o}
|
|
14
|
+
`),R(t).filter(i=>!n.has(i.key)).map(i=>i.key)},Z=e=>{const t=e.randomHex??x,r=[],s=H(e.existingContent,t,r),n=new Set(E(e.existingContent).map(c=>c.key)),o=[],d=[];for(const c of P)n.has(c.key)||(o.push(c.key),d.push(`# ${c.description}`,`${c.key}="${t(S)}"`));const i=s.join(`
|
|
15
|
+
`);if(d.length===0)return{addedKeys:o,content:i,filledKeys:r};const a=i===""||i.endsWith(`
|
|
16
|
+
`)?"":`
|
|
17
|
+
`;return{addedKeys:o,content:`${i}${a}${d.join(`
|
|
18
|
+
`)}
|
|
19
|
+
`,filledKeys:r}},ue=e=>{const t=p(e.cwd,u),r=m(t),s=r?y(t,"utf8"):"",n=Z({existingContent:s,randomHex:e.randomHex});if(n.filledKeys.length===0&&n.addedKeys.length===0)return{addedKeys:[],filledKeys:[],status:"unchanged"};if(r)K(t,n.content,{mode:384});else if(!L(t,n.content))return{addedKeys:[],filledKeys:[],status:"unchanged"};const o=[...n.filledKeys,...n.addedKeys];return e.info?.(`Generated ${String(o.length)} dev secret(s) in ${u}: ${o.join(", ")}`),{addedKeys:n.addedKeys,filledKeys:n.filledKeys,status:r?"filled":"created"}};export{Q as buildPackageSecretsBlock,de as ensureDevVariables,le as ensureDevVarsExample,ue as fillDevSecrets,ae as generateSecretValue,X as isMintableSecretKey,W as isPlaceholderValue,Z as planDevSecretsFill,w as planDevVariablesAugment,G as planDevVariablesScaffold,R as requiredSecrets,ce as writeDevVariablesFileAtomically};
|
package/dist/packem_shared/{collectExportGaps-BVb5JlSY.mjs → collectExportGaps-BfnHx4y3.mjs}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{readFileSync as X,writeFileSync as z}from"node:fs";import{createRequire as Z}from"node:module";import{join as Q}from"node:path";import{containerBuildTag as ee}from"@lunora/container";import{readJsonSync as ne}from"@visulima/fs";import{applyModify as S}from"./applyModify-DKP2l6S9.mjs";import{a as se,r as K}from"./lunora-manifest-DuH_Cmyu.mjs";import{parseTree as te,findNodeAtLocation as oe}from"jsonc-parser";import{r as ie,a as re,b as ae,c as de}from"./reconcile-services-DFqH4eMQ.mjs";import{a as ce,s as le}from"./infer-bindings-BsgN5eCm.mjs";import{DEV_VARS_FILE as ue,parseDevVariableEntries as ge}from"./DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";import{requiredSecrets as me}from"./buildPackageSecretsBlock-
|
|
1
|
+
import{readFileSync as X,writeFileSync as z}from"node:fs";import{createRequire as Z}from"node:module";import{join as Q}from"node:path";import{containerBuildTag as ee}from"@lunora/container";import{readJsonSync as ne}from"@visulima/fs";import{applyModify as S}from"./applyModify-DKP2l6S9.mjs";import{a as se,r as K}from"./lunora-manifest-DuH_Cmyu.mjs";import{parseTree as te,findNodeAtLocation as oe}from"jsonc-parser";import{r as ie,a as re,b as ae,c as de}from"./reconcile-services-DFqH4eMQ.mjs";import{a as ce,s as le}from"./infer-bindings-BsgN5eCm.mjs";import{DEV_VARS_FILE as ue,parseDevVariableEntries as ge}from"./DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";import{requiredSecrets as me}from"./buildPackageSecretsBlock-BWV_VxqV.mjs";import{w as pe,m as fe,s as Y,o as B,n as C,p as be}from"./validate-bindings-CvNBF3U4.mjs";import{s as he}from"./worker-entry-checks-AIASCYl7.mjs";import{DEFAULT_OBSERVABILITY as we}from"./DEFAULT_OBSERVABILITY-bN6UkTMx.mjs";import{findWranglerFile as ve,readWranglerJsonc as _e}from"./WRANGLER_FILES-UNW-xY5u.mjs";const ye=[["maxBatchSize","max_batch_size"],["maxBatchTimeout","max_batch_timeout"],["maxConcurrency","max_concurrency"],["maxRetries","max_retries"],["deadLetterQueue","dead_letter_queue"],["retryDelay","retry_delay"]],R=e=>Object.fromEntries(ye.filter(([n])=>e.tuning[n]!==void 0).map(([n,s])=>[s,e.tuning[n]])),P="queueTuning",Se=/^[\t ]*(?:,[\t ]*)?(?:\/\/[^\n\r]*)?\r?\n/u,xe=/^[\t ]*,/u,Ne=(e,n)=>{const s=te(e),t=s===void 0?void 0:oe(s,[...n])?.parent;if(t?.type==="property"){const o=t.offset+t.length,i=e.lastIndexOf(`
|
|
2
2
|
`,t.offset-1)+1,r=Se.exec(e.slice(o));if(r!==null&&e.slice(i,t.offset).trim()===""){const d=t.parent?.children??[],m=d.indexOf(t),c=m===d.length-1&&m>0?d[m-1]:void 0,l=c===void 0?void 0:xe.exec(e.slice(c.offset+c.length))??void 0;return(l===void 0||c===void 0?e.slice(0,i):e.slice(0,c.offset+c.length)+e.slice(c.offset+c.length+l[0].length,i))+e.slice(o+r[0].length)}}return S(e,n,void 0)},G=(e,n,s,t,o,i=new Set)=>{const r=s.join("."),d={},m=[],c=[];let l=e;return{entries:n.map((u,w)=>{const g=t(u);if(g===void 0||u.queue===void 0)return u;const b=Object.fromEntries(Object.entries(R(g)).filter(([f])=>!i.has(f))),h=Object.entries(o[u.queue]??{}).filter(([f])=>!Object.hasOwn(b,f)),v=Object.entries(b).filter(([f,_])=>u[f]!==_),x=h.filter(([f,_])=>u[f]===_).map(([f])=>f),E=Object.fromEntries(Object.entries({...u,...b}).filter(([f])=>!x.includes(f)));for(const[f,_]of v)l=S(l,[...s,w,f],_);for(const f of x)l=Ne(l,[...s,w,f]);for(const[f,_]of h){const O=u[f];O!==void 0&&O!==_&&c.push(`${r}/${u.queue}: ${f} is no longer declared by defineQueue, but it was changed by hand to ${JSON.stringify(O)} from the declared ${JSON.stringify(_)}, so it was kept. Delete it from wrangler.jsonc if it should go.`)}return(v.length>0||x.length>0)&&m.push(`${r}/${u.queue} (${[...v.map(([f])=>f),...x.map(f=>`removed ${f}`)].join(", ")})`),Object.keys(b).length>0&&(d[u.queue]=b),E}),owned:d,text:l,updated:m,warnings:c}},Oe=(e,n,s,t)=>{const o=n.queues??{},i=o.producers??[],r=o.consumers??[],d=new Set(i.map(g=>g?.binding)),m=new Set(r.map(g=>g.queue)),c=s.filter(g=>!d.has(g.bindingName)),l=s.filter(g=>!m.has(g.name)),p=G(e,r,["queues","consumers"],g=>s.find(b=>b.name===g.queue),t);let u=p.text;const w={...p.owned};if(c.length>0||l.length>0){const g=[...i,...c.map(h=>({binding:h.bindingName,queue:h.name}))],b=[...p.entries,...l.map(h=>({queue:h.name,...h.mode==="pull"?{type:"http_pull"}:{},...R(h)}))];for(const h of l){const v=R(h);Object.keys(v).length>0&&(w[h.name]=v)}u=S(u,["queues"],{consumers:b,producers:g})}return{added:[...c.map(g=>`queues.producers/${g.bindingName}`),...l.map(g=>`queues.consumers/${g.name}`)],owned:w,text:u,updated:p.updated,warnings:p.warnings}},Ee=(e,n,s,t,o)=>{const i=n.env?.[t],r=i?.queues?.consumers??[],d=i?.queues?.producers??[],m=u=>{const w=d.find(g=>g?.queue===u.queue)?.binding;return w!==void 0?s.find(g=>g.bindingName===w):s.find(g=>g.name===u.queue&&!d.some(b=>b?.binding===g.bindingName))},c=G(e,r,["env",t,"queues","consumers"],m,o,new Set(["dead_letter_queue"])),l=r.filter(u=>u.queue!==void 0&&m(u)===void 0).map(u=>`env.${t}.queues.consumers/${String(u.queue)}: no defineQueue export matches it — this block declares no producer mapping one of their bindings to "${String(u.queue)}", and no export is named that — so it was not retuned. A consumer for a queue another worker produces is skipped the same way.`),p=r.flatMap(u=>{const w=m(u)?.tuning.deadLetterQueue;return w===void 0||u.dead_letter_queue!==void 0?[]:[`env.${t}.queues.consumers/${String(u.queue)}: defineQueue declares deadLetterQueue "${w}", but this consumer has no dead_letter_queue, so its exhausted messages are dropped. Queue names differ per environment, so reconcile does not write it here; add it by hand.`]});return{added:[],owned:c.owned,text:c.text,updated:c.updated,warnings:[...c.warnings,...p,...l]}},ke=(e,n)=>{if(e?.lunoraIsForeign===!0)return n.push(`${e.path}: \`lunora\` is not an object, so the queue tuning ownership record cannot be read or written — an option removed from defineQueue stays deployed.`),{};const s=e?.lunora?.[P],t=o=>typeof o=="object"&&o!==null&&!Array.isArray(o);return s===void 0?{}:!t(s)||!Object.values(s).every(o=>t(o)&&Object.values(o).every(i=>t(i)))?(n.push(`${e?.path??"package.json"}: \`lunora.${P}\` is not a map of scope → queue → fields, so it is ignored — an option removed from defineQueue stays deployed until the next pass records it again.`),{}):s},$e=(e,n,s)=>{const t=Object.fromEntries(Object.entries({...n,...s}).filter(([,o])=>Object.keys(o).length>0));se(e,P,Object.keys(t).length===0?void 0:t)},j="PIPELINES",I="ARTIFACTS",Ae=(e,n)=>{const s=e.flagshipBinding!==void 0&&!(n?.flagship??[]).some(d=>d.binding===e.flagshipBinding),t=e.usesPipelines&&!(n?.pipelines??[]).some(d=>d.binding===j),o=e.usesArtifacts?n?.artifacts??[]:[],i=o.some(d=>d.binding===I)?[]:o.flatMap(d=>d.binding===void 0?[]:[d.binding]);return[[e.usesKv&&(n?.kv_namespaces?.length??0)===0,"@lunora/bindings/kv is used but no kv_namespaces binding exists; add a kv_namespaces entry ({ binding, id }) and pass env.<BINDING> to createKv() — the namespace id can't be auto-provisioned."],[e.usesHyperdrive&&(n?.hyperdrive?.length??0)===0,"@lunora/hyperdrive is used but no hyperdrive binding exists; run 'wrangler hyperdrive create' and add a 'hyperdrive' binding ({ binding, id }) — the id can't be auto-provisioned."],[t,`ctx.pipelines is used but no "${j}" pipelines binding exists; run 'wrangler pipelines create <name>' and add a 'pipelines' binding ({ binding: "${j}", stream }) — codegen resolves this one name, and the pipeline resource can't be auto-provisioned.`],[e.usesArtifacts&&o.length===0,ce(e.jurisdiction)],[i.length>0,`ctx.artifacts is used and ${i.map(d=>`"${d}"`).join(", ")} ${i.length===1?"is":"are"} bound, but none is named "${I}"; make sure \`.artifacts()\` on defineApp points ctx.artifacts at it — otherwise it reads env.${I} and throws.`],[s,`lunora/flags.ts uses Flagship in binding mode but no flagship binding "${e.flagshipBinding??""}" exists; add a flagship entry ({ binding: "${e.flagshipBinding??""}", app_id }) — the app_id can't be auto-provisioned.`]].filter(([d])=>d).map(([,d])=>d)},qe=e=>[[e.usesX402Charge,"@lunora/x402/charge is used; set the recipient wallet address as a [vars] entry (the var name is your choice) and pass it to the charge config — the x402 facilitator settles USDC to that address."],[e.usesX402,"@lunora/x402/pay is used (ActionCtx-only, spends real funds); add a secrets_store_secrets[] binding holding the agent wallet key (binding name == signer.secretName) and pair the pay rail with a spend policy — ctx.secrets reads a Secrets Store binding, not .dev.vars."]].filter(([s])=>s).map(([,s])=>s),D=(e,n,s)=>s.filter(t=>!t.exported).map(t=>`${e} "${t.exportName}" is declared but ${t.className} is not exported by the worker entry; add \`export * from "./lunora/_generated/${n}"\` so its binding can be provisioned.`),Ce=(e,n)=>{const s=new Set([...e.workflows,...e.agents].map(i=>i.className));if(s.size===0)return[];const t=Object.entries(n.exports??{}).flatMap(([i,r])=>r?.type==="workflow"?[i]:[]),o=(n.workflows??[]).flatMap(i=>i.class_name===void 0||i.script_name!==void 0?[]:[i.class_name]);return[...new Set([...t,...o])].filter(i=>!s.has(i)).map(i=>`wrangler.jsonc declares workflow "${i}" but no defineWorkflow/defineAgent export generates that class — a leftover from a rename will fail the deploy (wrangler rejects a class the worker does not export). Remove it if it is not hand-wired.`)},je=(e,n)=>{if(e.queues.length===0)return[];const s=new Set(e.queues.map(o=>o.name)),t=new Set(e.queues.map(o=>o.bindingName));return[...(n.queues?.consumers??[]).flatMap(o=>{const{queue:i}=o;return i===void 0||s.has(i)?[]:[`wrangler.jsonc subscribes queues.consumers[] to "${i}" but no defineQueue export declares that queue — a leftover from a rename keeps delivering batches this worker has no handler for (they retry to exhaustion, then drop or dead-letter). Remove it if it is not hand-wired.`]}),...(n.queues?.producers??[]).flatMap(o=>{const i=o?.binding;return i===void 0||t.has(i)?[]:[`wrangler.jsonc declares queues.producers[] binding "${i}" but no defineQueue export declares it — a leftover from a rename. Remove it if it is not hand-wired.`]})]},Ie=(e,n)=>[...Ce(e,n),...je(e,n)],U=[{keys:["STRIPE_SECRET_KEY","STRIPE_WEBHOOK_SECRET"],label:"Stripe"},{keys:["POLAR_ACCESS_TOKEN","POLAR_WEBHOOK_SECRET"],label:"Polar"},{keys:["CREEM_API_KEY","CREEM_WEBHOOK_SECRET"],label:"Creem"},{keys:["AUTUMN_SECRET_KEY","AUTUMN_WEBHOOK_SECRET"],label:"Autumn"},{keys:["DODO_PAYMENTS_API_KEY","DODO_PAYMENTS_WEBHOOK_KEY"],label:"Dodo Payments"}],De=()=>U.map(({keys:e,label:n})=>`${e[0]} + ${e[1]} (${n})`).join(" or "),Te=e=>{let n;try{n=X(Q(e,ue),"utf8")}catch{return!1}const s=new Map(ge(n).map(t=>[t.key,t.value]));return U.some(({keys:t})=>t.every(o=>(s.get(o)??"")!==""))},Be=(e,n)=>{const s=n?.secrets?.required;if(!Array.isArray(s))return[];const t=new Set(s),o=me(le(e)).map(i=>i.key).filter(i=>!t.has(i));return o.length===0?[]:[`wrangler.jsonc declares secrets.required without ${o.join(", ")}, which this app needs — wrangler dev loads only the listed keys from .dev.vars, so add ${o.length===1?"it":"them"} to secrets.required.`]},T=(e,n,s)=>{const t=new Set(e.durableObjects.map(d=>d.className)),o=[],i=(s?.r2_buckets?.length??0)>0,r=(s?.d1_databases?.some(d=>d.binding==="DB")??!1)||e.needsD1;return e.usesStorage&&!i&&o.push("@lunora/storage is used but R2 bucket bindings have user-defined names; add an r2_buckets entry and pass env.<BINDING> to createStorage()."),e.usesAuth&&!t.has("SessionDO")&&!r&&o.push("@lunora/auth is used but the worker entry exports no SessionDO; sessions are D1-backed, or export SessionDO to enable DO-backed sessions."),e.usesScheduler&&!t.has("SchedulerDO")&&o.push("@lunora/scheduler is used but the worker entry exports no SchedulerDO; export it so the SCHEDULER binding can be provisioned."),o.push(...D("container","containers",e.containers),...D("workflow","workflows",e.workflows),...D("agent","agents",e.agents)),e.containers.length>0&&s?.observability?.enabled===!1&&o.push("containers are declared but observability is explicitly disabled in wrangler.jsonc — container logs will not be captured."),e.usesPayments&&!Te(n)&&o.push(`@lunora/payment is used; set one provider's secret pair in .dev.vars — ${De()}.`),o.push(...qe(e),...Ae(e,s),...Be(e,s)),s!==void 0&&o.push(...Ie(e,s)),o},H="<replace-with-d1-create-id>",Re=e=>[["container","containers",e.containers],["workflow","workflows",e.workflows],["agent","agents",e.agents]].flatMap(([s,t,o])=>o.filter(i=>!i.exported).map(({className:i,exportName:r})=>({className:i,exportName:r,kind:s,module:t}))),Pe=e=>{const n=new Set(B(e).map(t=>t.tag));let s=1;for(;n.has(`v${String(s)}`);)s+=1;return`v${String(s)}`},Le=e=>{const n=new Set;for(const s of B(e)){for(const t of C(s.deleted_classes))n.delete(t);for(const{from:t,to:o}of B(s.renamed_classes))t!==void 0&&n.delete(t),o!==void 0&&n.add(o);for(const t of[...C(s.new_classes),...C(s.new_sqlite_classes)])n.add(t)}return n},Me=(e,n,s)=>{const t=n.durable_objects?.bindings??[],o=new Set(t.map(l=>l.name)),i=s.filter(l=>!o.has(l.binding));let r=e;const d=[];if(i.length>0){const l=[...t,...i.map(p=>({class_name:p.className,name:p.binding}))];r=S(r,["durable_objects","bindings"],l),d.push(...i.map(p=>`${p.binding}/${p.className}`))}const m=n.migrations??[],c=s.map(l=>l.className).filter(l=>!Le(m).has(l));if(c.length>0){const l=[...m,{new_sqlite_classes:c,tag:Pe(m)}];r=S(r,["migrations"],l)}return{added:d,text:r}},We=(e,n)=>{const s=n.d1_databases??[];if(s.some(i=>i.binding==="DB"))return{added:[],text:e};const t=typeof n.name=="string"&&n.name.length>0?n.name:"lunora",o=[...s,{binding:"DB",database_id:H,database_name:t}];return{added:["DB (D1)"],text:S(e,["d1_databases"],o)}},Ke={ai:{binding:"AI",label:"AI (Workers AI)"},analytics:{binding:"ANALYTICS_SQL",label:"ANALYTICS_SQL (Analytics SQL)"},browser:{binding:"BROWSER",label:"BROWSER (Browser Rendering)"},images:{binding:"IMAGES",label:"IMAGES (Cloudflare Images)"}},$=(e,n,s)=>{const{binding:t,label:o}=Ke[s],i=n[s]?.binding;return typeof i=="string"&&i.length>0?{added:[],text:e}:{added:[o],text:S(e,[s],{binding:t})}},Fe=(e,n)=>e.usesAnalyticsSql&&he(n,new Set(["analyticsSql"]))?.chained.has("analyticsSql")!==!0,Qe=new Set(["ratelimits","send_email"]),Ye=["durable_objects","logfwdr","unsafe"],Ge=new Set(["data_blobs","text_blobs","vars","wasm_modules"]),M=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),L=(e,n,s)=>M(e)&&e[n]===s,Ue=(e,n,s)=>{if(Ge.has(e))return M(n)&&Object.hasOwn(n,s);const t=Qe.has(e)?"name":"binding";return Array.isArray(n)?n.some(o=>L(o,t,s)):L(n,"binding",s)},He=(e,n)=>{const s=e,t=Object.entries(s).find(([i,r])=>i!=="env"&&Ue(i,r,n));if(t!==void 0)return t[0];for(const i of Ye){const r=s[i];if(M(r)&&Array.isArray(r.bindings)&&r.bindings.some(d=>L(d,"name",n)))return`${i}.bindings`}if(e.queues?.producers?.some(i=>i?.binding===n)===!0)return"queues.producers";const o=e.secrets?.required;if(Array.isArray(o)&&o.includes(n))return"secrets.required"},F=(e,n,s,t,o)=>{if((n[s]?.length??0)>0)return{added:[],text:e};const i=He(n,t.binding);return i!==void 0?{added:[],text:e,warnings:[`${s}: not adding ${JSON.stringify(t)} — the name "${t.binding}" is already bound by \`${i}\` in wrangler.jsonc. Add a ${s} entry under another binding name and point the matching \`defineApp()\` override at it.`]}:{added:[o],text:S(e,[s],[t])}},Je=(e,n)=>{const s=n.worker_loaders??[];return s.some(t=>t.binding==="LOADER")?{added:[],text:e}:{added:["LOADER (Worker Loader)"],text:S(e,["worker_loaders"],[...s,{binding:"LOADER"}])}},Ve=e=>{if(typeof e=="string")return e;const n={};return e.diskMb!==void 0&&(n.disk_mb=e.diskMb),e.memoryMib!==void 0&&(n.memory_mib=e.memoryMib),e.vcpu!==void 0&&(n.vcpu=e.vcpu),n},Xe=e=>{const{image:n}=e;return n.kind==="dockerfile"?n.dockerfilePath:n.kind==="registry"?n.reference:ee(e.exportName)},J=e=>{const n={};for(const[s,t]of Object.entries(e.images??{}))n[s]=t.kind==="registry"?{image:t.reference}:{build_context:t.buildContext,dockerfile:t.dockerfilePath,...e.buildArgs===void 0?{}:{build_vars:e.buildArgs}};return{class_name:e.className,scheduling_policy:"durable_object",...Object.keys(n).length>0?{images:n}:{},...e.name===void 0?{}:{name:e.name}}},ze=e=>{if(e.schedulingPolicy==="durable_object")return J(e);const{image:n}=e,s={class_name:e.className,image:Xe(e)};return n.kind==="dockerfile"&&(s.image_build_context=n.buildContext),e.buildArgs!==void 0&&n.kind!=="registry"&&(s.image_vars=e.buildArgs),e.instanceType!==void 0&&(s.instance_type=Ve(e.instanceType)),e.maxInstances!==void 0&&(s.max_instances=e.maxInstances),e.name!==void 0&&(s.name=e.name),e.rollout?.stepPercentage!==void 0&&(s.rollout_step_percentage=e.rollout.stepPercentage),e.rollout?.gracePeriodSeconds!==void 0&&(s.rollout_active_grace_period=e.rollout.gracePeriodSeconds),s},Ze=(e,n,s)=>{const t=n.containers??[],o=new Set(t.map(c=>c.class_name)),i=s.filter(c=>!o.has(c.className));let r=i.length===0?e:S(e,["containers"],[...t,...i.map(c=>ze(c))]);const d=[],m=[];for(const[c,l]of t.entries()){const p=s.find(g=>g.className===l.class_name);if(p===void 0)continue;const u=p.schedulingPolicy??"default";if((l.scheduling_policy??"default")!==u){m.push(`containers/${p.className} has scheduling_policy "${l.scheduling_policy??"default"}" in wrangler.jsonc but defineContainer "${p.exportName}" declares "${u}" — the policy is immutable, so replace the entry (and its container application) by hand.`);continue}const w=p.schedulingPolicy==="durable_object"?J(p).images:void 0;w!==void 0&&JSON.stringify(l.images)!==JSON.stringify(w)&&(r=S(r,["containers",c,"images"],w),d.push(`containers/${p.className}.images`))}return{added:i.map(c=>`containers/${c.className}`),text:r,updated:d,warnings:m}},en=(e,n)=>{if(n.observability!==void 0)return{added:[],text:e};const s=S(e,["observability"],{...we});return{added:["observability"],text:s}},nn=(e,n)=>n.upload_source_maps!==void 0?{added:[],text:e}:{added:["upload_source_maps"],text:S(e,["upload_source_maps"],!0)},V=[{minimum:[4,142],name:"wrangler"},{minimum:[1,61],name:"@cloudflare/vite-plugin"}],sn=V.map(({minimum:e,name:n})=>`${n}@^${e.join(".")}.0`).join(" "),tn=(e,n)=>{try{const s=Z(Q(e,"package.json")).resolve(`${n}/package.json`),[t=0,o=0]=String(ne(s).version).split(".").map(Number);return[t,o]}catch{return}},on=e=>{const n=V.flatMap(({minimum:s,name:t})=>{const o=tn(e,t);return o!==void 0&&(o[0]<s[0]||o[0]===s[0]&&o[1]<s[1])?[`${t} ${o.join(".")} (needs >= ${s.join(".")})`]:[]});return n.length===0?void 0:`workflows are declared in wrangler \`exports\`, which ${n.join(" and ")} cannot run — reconcile left workflows[] untouched. Upgrade (\`pnpm add -D ${sn}\`) and re-run.`},rn=e=>Object.entries(e.env??{}).flatMap(([n,s])=>Array.isArray(s?.workflows)?[`env.${n}.workflows declares workflow bindings, but Lunora now declares workflows in \`exports\` and resolves them on ctx.exports — move them to that environment's own \`exports\` by hand.`]:[]),an=(e,n,s)=>{let t=e;const o=[],i=[];for(const r of s){const d=n[r.className];if(d?.type==="workflow")for(const{of:m,path:c}of be){const l=m(r),p=Y(d,c),u=`exports/${r.className}.${c.join(".")}`;if(l===void 0){p!==void 0&&i.push(`${u} is set in wrangler.jsonc but defineWorkflow "${r.exportName}" does not declare it — reconcile leaves it in place. Remove it by hand if it was dropped from the definition.`);continue}JSON.stringify(p)!==JSON.stringify(l)&&(t=S(t,["exports",r.className,...c],l),o.push(u))}}return{text:t,updated:o,warnings:i}},dn=(e,n,s,t,o)=>{if(o!==void 0)return{added:[],text:e,warnings:[o]};const i=[...s.map(b=>({settings:pe(b),workflow:b})),...t.map(b=>({settings:{},workflow:b}))],r=new Set(i.map(({workflow:b})=>b.className)),d=n.workflows??[],m=d.filter(b=>b.script_name===void 0&&b.class_name!==void 0&&r.has(b.class_name)),c=n.exports??{},l=[],p=[],u=[];let w=e;for(const{settings:b,workflow:h}of i){if(c[h.className]!==void 0&&c[h.className]!==null)continue;const v=m.find(f=>f.class_name===h.className),x=Object.fromEntries(fe.flatMap(f=>{const _=Y(v,[f]);return _===void 0?[]:[[f,_]]})),E=v?.name??h.name;v?.name!==void 0&&v.name!==h.name&&u.push(`workflows/${h.className} is deployed as "${v.name}" but declared as "${h.name}" — its export keeps "${v.name}" so running instances survive. Change the declaration to match, or rename deliberately (it starts a new, empty workflow).`),w=S(w,["exports",h.className],{type:"workflow",...x,...b,name:E}),(v===void 0?l:p).push(`exports/${h.className}`)}if(m.length>0){const b=d.filter(h=>!m.includes(h));w=S(w,["workflows"],b.length===0?void 0:b),p.push(...m.map(h=>`workflows/${String(h.class_name)} → exports`))}u.push(...rn(n));const g=an(w,c,s);return{added:l,text:g.text,updated:[...p,...g.updated],warnings:[...u,...g.warnings]}},On=(e,n,{environment:s,target:t}={})=>{const o=ve(e),i=Re(n);if(!o)return{added:[],changed:!1,exportGaps:i,reason:"wrangler.jsonc not found",updated:[],warnings:T(n,e)};const{parsed:r,text:d}=_e(o);if(r===void 0)return{added:[],changed:!1,exportGaps:i,reason:`failed to parse ${o} as JSONC`,updated:[],warnings:T(n,e),wranglerPath:o};const m=T(n,e,r);if(s!==void 0){const a=r.env?.[s]!==void 0;m.push(a?`auto-provisioned bindings are written to the top level of wrangler.jsonc only (queue consumers "env.${s}" already declares are retuned, nothing is added) — "env.${s}" has its own (non-inheritable) bindings and must be reconciled by hand; \`lunora deploy --env ${s}\` now validates them, so a gap here will be reported at deploy time.`:`--env "${s}" was requested but wrangler.jsonc declares no "env.${s}" block — auto-provisioned bindings are written to the top level only and will not apply to that environment.`)}const c=n.containers.filter(a=>a.exported),l=n.agents.filter(a=>a.exported&&a.voice===!0&&a.voiceBindingName!==void 0&&a.voiceClassName!==void 0),p=[...n.durableObjects,...c.map(a=>({binding:a.bindingName,className:a.className})),...l.map(a=>({binding:a.voiceBindingName,className:a.voiceClassName}))],u=n.workflows.filter(a=>a.exported),w=n.agents.filter(a=>a.exported),g=K(e),b=ke(g,m),h={},v=ie(g);let x;const E=[{enabled:!0,run:a=>Me(a,r,p)},{enabled:n.needsD1,run:a=>We(a,r)},{enabled:n.usesAi,run:a=>$(a,r,"ai")},{enabled:n.usesAiSearch,run:a=>F(a,r,"ai_search_namespaces",{binding:"AI_SEARCH",namespace:"default"},"AI_SEARCH (AI Search namespace)")},{enabled:Fe(n,e),run:a=>$(a,r,"analytics")},{enabled:n.usesBrowser,run:a=>$(a,r,"browser")},{enabled:n.usesImages,run:a=>$(a,r,"images")},{enabled:n.usesAnalytics,run:a=>F(a,r,"analytics_engine_datasets",{binding:"ANALYTICS",dataset:"ANALYTICS"},"ANALYTICS (Analytics Engine)")},{enabled:n.usesWorkerLoader,run:a=>Je(a,r)},{enabled:!0,run:a=>en(a,r)},{enabled:t===void 0||t==="cloudflare",run:a=>nn(a,r)},{enabled:c.length>0,run:a=>Ze(a,r,c)},{enabled:u.length>0||w.length>0,run:a=>dn(a,r,u,w,on(e))},{enabled:n.queues.length>0,run:a=>{const y=Oe(a,r,n.queues,b.queues??{});return h.queues=y.owned,y}},{enabled:n.services!==void 0&&(n.services.length>0||Object.keys(v).length>0),run:a=>{const y=re(a,r,n.services??[],v);return x=y.owned,y}},...s===void 0||r.env?.[s]===void 0?[]:[{enabled:n.queues.length>0,run:a=>{const y=`env.${s}.queues`,k=Ee(a,r,n.queues,s,b[y]??{});return h[y]=k.owned,k}}]];let f=d;const _=[],O=[];for(const a of E){if(!a.enabled)continue;const y=a.run(f);f=y.text,_.push(...y.added),O.push(...y.updated??[]),m.push(...y.warnings??[])}const W=a=>{if(g===void 0)return;const y=x,k=[...Object.keys(h).length>0?[{consequence:"an option removed from defineQueue stays deployed",key:"queueTuning",label:"queue tuning",write:N=>{$e(N,b,h)}}]:[],...y===void 0?[]:[{consequence:"a service removed from lunora.config stays bound",key:"services",label:"service bindings",write:N=>{de(N,y)}}]];for(const N of k)try{N.write(K(e)??g)}catch(q){m.push(`${a?"wrangler.jsonc was updated, but ":""}recording the ${N.label} reconcile owns in ${g.path} (lunora.${N.key}) failed: ${q instanceof Error?q.message:String(q)}. Until it is recorded, ${N.consequence}.`)}};let A;if(n.services!==void 0){const a=ae(e,n.services,v);m.push(...a.warnings),x={...x,...a.owned},A=a.added.length>0||a.updated.length>0?{added:a.added,path:a.path,updated:a.updated}:void 0}return _.includes("DB (D1)")&&m.push(`wrote a DB binding with a placeholder database_id ("${H}") — run \`wrangler d1 create <name>\` and replace it before deploying.`),f===d?(W(!1),{added:_,changed:!1,devConfig:A,exportGaps:i,reason:"bindings already in sync",updated:O,warnings:m,wranglerPath:o}):(z(o,f,"utf8"),W(!0),{added:_,changed:!0,devConfig:A,exportGaps:i,updated:O,warnings:m,wranglerPath:o})};export{Re as collectExportGaps,On as reconcileWranglerBindings};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as g}from"./infer-bindings-BsgN5eCm.mjs";import{LUNORA_TAG as r}from"./LUNORA_TAG-CiQM3BkI.mjs";import{reconcileWranglerBindings as p}from"./collectExportGaps-
|
|
1
|
+
import{i as g}from"./infer-bindings-BsgN5eCm.mjs";import{LUNORA_TAG as r}from"./LUNORA_TAG-CiQM3BkI.mjs";import{reconcileWranglerBindings as p}from"./collectExportGaps-BfnHx4y3.mjs";import{reconcileWranglerCompatibilityDate as $}from"./reconcileWranglerCompatibilityDate-hocXEuRA.mjs";import{reconcileWranglerCrons as m,describePreservedCrons as w}from"./describePreservedCrons-C5KPuPy3.mjs";const j=async(i,t,a)=>{try{const n=await g({projectRoot:i.projectRoot,schemaDir:i.schemaDir}),e=p(i.projectRoot,n,{target:i.target}),o=e.wranglerPath??"wrangler.jsonc";if(e.added.length>0&&t.info?.(`${r} inferred bindings → ${e.added.join(", ")} (written to ${o})`),e.updated.length>0&&t.info?.(`${r} updated bindings → ${e.updated.join(", ")} (written to ${o})`),e.devConfig!==void 0){const{added:s,path:d,updated:f}=e.devConfig;t.info?.(`${r} dev sidecar bindings → ${[...s,...f].join(", ")} (written to ${d})`)}for(const s of e.warnings)t.warn(`${r} ${s}`);e.exportGaps.length>0&&a?.(e.exportGaps)}catch(n){const e=n instanceof Error?n.message:String(n);t.warn(`${r} binding inference skipped: ${e}`)}},c=new Map,u=(i,t,a)=>{try{const n=m(i,t);n.changed&&a.info?.(`${r} synced ${t.length.toFixed(0)} cron trigger(s) into ${n.wranglerPath??"wrangler.jsonc"}`);for(const s of n.warnings)a.warn(`${r} ${s}`);const e=n.preserved.join("\0"),o=w(n.preserved);o!==void 0&&(n.changed||c.get(i)!==e)&&a.info?.(`${r} ${o}`),c.set(i,e)}catch(n){const e=n instanceof Error?n.message:String(n);a.warn(`${r} cron trigger sync skipped: ${e}`)}try{const n=$(i);n.changed&&a.info?.(`${r} bumped compatibility_date to ${n.date??"unknown"} (Workers Cache enabled) → ${n.wranglerPath??"wrangler.jsonc"}`)}catch(n){const e=n instanceof Error?n.message:String(n);a.warn(`${r} compatibility date sync skipped: ${e}`)}};export{j as reconcileBindingsSafely,u as reconcileWranglerExtras};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{secretKindOf as s,redact as c}from"@lunora/codegen";import{i as a,a as f}from"./package-secrets-registry-BeheNwsP.mjs";import{isPlaceholderValue as d}from"./buildPackageSecretsBlock-
|
|
1
|
+
import{secretKindOf as s,redact as c}from"@lunora/codegen";import{i as a,a as f}from"./package-secrets-registry-BeheNwsP.mjs";import{isPlaceholderValue as d}from"./buildPackageSecretsBlock-BWV_VxqV.mjs";const u=8,h=(n,o)=>{if(n===void 0)return[];const r=[];for(const[i,e]of Object.entries(n)){if(typeof e!="string"||d(e)||a(i))continue;const t=s(e)??(f(i)&&e.length>=u?"secret_named_var":void 0);t!==void 0&&r.push({file:o,key:i,kind:t,preview:c(e)})}return r};export{h as scanWranglerVariablesForSecrets};
|
package/dist/packem_shared/{wranglerCodegenInputs-DBtq3faO.mjs → wranglerCodegenInputs-CbisphsH.mjs}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{relative as t}from"node:path";import{i as o}from"./guards-Buu_E7mP.mjs";import{findWranglerFile as u,readWranglerJsonc as d}from"./WRANGLER_FILES-UNW-xY5u.mjs";import{scanWranglerVariablesForSecrets as l}from"./scanWranglerVariablesForSecrets-
|
|
1
|
+
import{relative as t}from"node:path";import{i as o}from"./guards-Buu_E7mP.mjs";import{findWranglerFile as u,readWranglerJsonc as d}from"./WRANGLER_FILES-UNW-xY5u.mjs";import{scanWranglerVariablesForSecrets as l}from"./scanWranglerVariablesForSecrets-BFTVje1q.mjs";const n=(s,e)=>{const r=s?.producers;return(Array.isArray(r)?r:[]).flatMap(i=>o(i)&&typeof i.binding=="string"&&typeof i.queue=="string"?[{binding:i.binding,queue:i.queue,...e===void 0?{}:{env:e}}]:[])},v=s=>{const e=u(s),r=e===void 0?void 0:d(e).parsed;return e===void 0||r===void 0?{wranglerQueueProducers:[],wranglerVariables:[]}:{wranglerQueueProducers:[...n(r.queues),...Object.entries(r.env??{}).flatMap(([a,i])=>n(i?.queues,a))],wranglerVariables:l(o(r.vars)?r.vars:void 0,t(s,e))}};export{v as wranglerCodegenInputs};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{runCodegen as c,CodegenDiagnosticError as i}from"@lunora/codegen";import{wranglerCodegenInputs as a}from"./wranglerCodegenInputs-
|
|
1
|
+
import{runCodegen as c,CodegenDiagnosticError as i}from"@lunora/codegen";import{wranglerCodegenInputs as a}from"./wranglerCodegenInputs-CbisphsH.mjs";import{isCodegenDisabled as s,CODEGEN_ENV as t}from"./CODEGEN_ENV-ZsCxV1kP.mjs";import{writeFileSync as p,renameSync as m,rmSync as d}from"node:fs";const u=r=>({apiSpec:r.apiSpec,lunoraDirectory:r.schemaDirectory??"lunora",projectRoot:r.projectRoot,...a(r.projectRoot)}),y=r=>{if(s(process.env[t]))return[`codegen is off (${t}=0 / \`lunora dev --no-codegen\`) — the source was written but \`_generated/\` was NOT regenerated`];try{c(u(r))}catch(o){if(o instanceof i)return[o.message];throw o}return[]},C=(r,o)=>{const e=`${r}.lunora-tmp`;try{p(e,o,"utf8"),m(e,r)}catch(n){throw d(e,{force:!0}),n}};export{y as r,C as w};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{parseDevVariable as t,resolveAdminToken as r}from"../packem_shared/parseDevVariable-teAAahVD.mjs";import{applyStudioAssetCache as s,sendStudioDocument as d}from"../packem_shared/applyStudioAssetCache-DHQEJuuv.mjs";import{assetContentType as S,isStandaloneModulePath as l,loadStudioAssets as p,readStandaloneAsset as i,resolveStandaloneDirectory as m,studioAssetsStamp as u}from"../packem_shared/assetContentType-CUb5bpbI.mjs";import{STUDIO_PATH as T,STUDIO_SCRIPT_PATH as f,STUDIO_STYLE_PATH as A,createStudioMiddleware as P,isNonLoopbackHost as _,requestPathname as E,studioMountPath as c}from"../packem_shared/STUDIO_PATH-
|
|
1
|
+
import{parseDevVariable as t,resolveAdminToken as r}from"../packem_shared/parseDevVariable-teAAahVD.mjs";import{applyStudioAssetCache as s,sendStudioDocument as d}from"../packem_shared/applyStudioAssetCache-DHQEJuuv.mjs";import{assetContentType as S,isStandaloneModulePath as l,loadStudioAssets as p,readStandaloneAsset as i,resolveStandaloneDirectory as m,studioAssetsStamp as u}from"../packem_shared/assetContentType-CUb5bpbI.mjs";import{STUDIO_PATH as T,STUDIO_SCRIPT_PATH as f,STUDIO_STYLE_PATH as A,createStudioMiddleware as P,isNonLoopbackHost as _,requestPathname as E,studioMountPath as c}from"../packem_shared/STUDIO_PATH-CSx_psKS.mjs";import{POLICY_SCAFFOLD_ENDPOINT as O,handlePolicyScaffoldRequest as h}from"../packem_shared/POLICY_SCAFFOLD_ENDPOINT-BmJYwAy2.mjs";import{default as N}from"../packem_shared/renderStudioHtml-ByowDtMl.mjs";import{SCHEMA_EDIT_ENDPOINT as H,handleSchemaEditRequest as L}from"../packem_shared/SCHEMA_EDIT_ENDPOINT-BeTxqCuQ.mjs";import{SEED_ENDPOINT as q,handleSeedRequest as v}from"../packem_shared/SEED_ENDPOINT-2B56PN_H.mjs";import{serveJsonHandler as M}from"../packem_shared/serveJsonHandler-Dv0EdCb9.mjs";import{ALLOW_FORWARDED_ENV as k,headerValue as F,isLoopbackAddress as U,transportRejectionReason as V}from"../packem_shared/ALLOW_FORWARDED_ENV-BUndghJx.mjs";export{k as ALLOW_FORWARDED_ENV,O as POLICY_SCAFFOLD_ENDPOINT,H as SCHEMA_EDIT_ENDPOINT,q as SEED_ENDPOINT,T as STUDIO_PATH,f as STUDIO_SCRIPT_PATH,A as STUDIO_STYLE_PATH,s as applyStudioAssetCache,S as assetContentType,P as createStudioMiddleware,h as handlePolicyScaffoldRequest,L as handleSchemaEditRequest,v as handleSeedRequest,F as headerValue,U as isLoopbackAddress,_ as isNonLoopbackHost,l as isStandaloneModulePath,p as loadStudioAssets,t as parseDevVariable,i as readStandaloneAsset,N as renderStudioHtml,E as requestPathname,r as resolveAdminToken,m as resolveStandaloneDirectory,d as sendStudioDocument,M as serveJsonHandler,u as studioAssetsStamp,c as studioMountPath,V as transportRejectionReason};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lunora/config",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.339",
|
|
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.
|
|
57
|
+
"@lunora/codegen": "1.0.0-alpha.292",
|
|
58
58
|
"@lunora/container": "1.0.0-alpha.72",
|
|
59
59
|
"@lunora/errors": ">=1.0.0-alpha.51 <2.0.0-0",
|
|
60
|
-
"@lunora/seed": "1.0.0-alpha.
|
|
60
|
+
"@lunora/seed": "1.0.0-alpha.210",
|
|
61
61
|
"@visulima/colorize": "2.1.1",
|
|
62
62
|
"@visulima/find-ai-runner": "1.0.2",
|
|
63
63
|
"@visulima/fs": "6.0.29",
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import{randomBytes as V}from"node:crypto";import{existsSync as y,readFileSync as f,writeFileSync as _,renameSync as A,rmSync as x,statSync as b}from"node:fs";import{join as g}from"node:path";import{LunoraError as L}from"@lunora/errors";import{DEV_VARS_FILE as u,DEV_VARS_EXAMPLE_FILE as m,parseDevVariableLine as h,parseDevVariableEntries as K,DEV_VARS_NEWLINE as C}from"./DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";import{C as R,M,s as F}from"./package-secrets-registry-BeheNwsP.mjs";const D=e=>[...R,...F(e)],S=32,j=["replace","openssl","changeme","change-me","change_me","change-this","change_this","your-","your_","example","placeholder","todo","fill-me","fill_me","fill-in","fill_in","xxx"],T=/[.*+?^${}()|[\]\\]/gu,z=/[a-z0-9]$/u,N=e=>{const t=e.trim().toLowerCase();return t===""||t.startsWith("<")&&t.endsWith(">")?!0:j.some(r=>{const s=r.replaceAll(T,String.raw`\$&`),o=z.test(r)?`(^|[^a-z0-9])${s}([^a-z0-9]|$)`:`(^|[^a-z0-9])${s}`;return new RegExp(o,"u").test(t)})},p=e=>V(e).toString("hex"),B=e=>M.has(e),H=(e,t,r)=>B(e)&&N(t)?r(S):void 0,se=(e=p)=>e(S),P=(e,t,r)=>e.split(C).map(s=>{const n=h(s),o=n?H(n.key,n.value,t):void 0;return!n||o===void 0?s:(r.push(n.key),`${n.key}="${o}"`)}),I=e=>{if(e.devVarsExists)return{status:"exists"};if(e.exampleContent===void 0)return{status:"no-example"};const t=[];return{content:P(e.exampleContent,e.randomHex??p,t).join(`
|
|
2
|
-
`),generatedKeys:t,status:"generate"}},W=e=>e.includes('"')||e.includes("\\")?"":e.replaceAll("\r",String.raw`\r`).replaceAll(`
|
|
3
|
-
`,String.raw`\n`),E=e=>{const t=e.randomHex??p,r=new Set(K(e.existingContent).map(d=>d.key)),s=[],n=[],o=[];for(const d of e.exampleContent.split(C)){const i=h(d);if(!i||r.has(i.key))continue;const a=H(i.key,i.value,t);o.push(i.key),a===void 0?s.push(`${i.key}="${W(i.value)}"`):(n.push(i.key),s.push(`${i.key}="${a}"`))}return{additions:s,generatedKeys:n,missingKeys:o}},w=e=>e.length>0?` (generated ${e.join(", ")})`:"",$=(e,t,r={})=>{const s=`${e}.tmp-${String(process.pid)}`;try{_(s,t,{encoding:"utf8",...r}),A(s,e)}catch(n){throw x(s,{force:!0}),n}},re=(e,t)=>{$(e,t,{mode:384})},k=5,v=e=>{try{const t=b(e);return{mtimeMs:t.mtimeMs,size:t.size}}catch{return}},G=(e,t)=>e===void 0||t===void 0?!1:e.mtimeMs===t.mtimeMs&&e.size===t.size,O=(e,t)=>{for(let r=0;r<k;r+=1){const s=v(e),n=f(e,"utf8"),o=t(n);if(o.length===0)return[];const d=n.length>0&&!n.endsWith(`
|
|
4
|
-
`)?`
|
|
5
|
-
`:"",i=`${n}${d}${o.join(`
|
|
6
|
-
`)}
|
|
7
|
-
`,a=`${e}.tmp-${String(process.pid)}-${V(6).toString("hex")}`;try{_(a,i,{encoding:"utf8",mode:384});const c=v(e);if(!G(s,c)){x(a,{force:!0});continue}return A(a,e),o}catch(c){throw x(a,{force:!0}),c}}throw new L("INTERNAL",`Failed to append to ${e} after ${String(k)} attempts — a concurrent writer kept winning the race.`)},oe=async e=>{const t=g(e.cwd,u),r=g(e.cwd,m);if(!y(r))return{addedKeys:[],generatedKeys:[],status:"no-example"};const s=f(r,"utf8");if(!y(t)){const l=I({devVarsExists:!1,exampleContent:s,randomHex:e.randomHex});return l.status!=="generate"?{addedKeys:[],generatedKeys:[],status:"no-example"}:e.yes===!0||await e.confirm(`No ${u} found. Generate it from ${m} (secrets auto-filled)?`)?y(t)?{addedKeys:[],generatedKeys:[],status:"skipped-exists"}:($(t,l.content,{flag:"wx",mode:384}),e.info(`Created ${u}${w(l.generatedKeys)}.`),{addedKeys:[],generatedKeys:l.generatedKeys,status:"generated"}):(e.info(`Skipped — copy ${m} to ${u} and fill it in when you're ready.`),{addedKeys:[],generatedKeys:[],status:"declined"})}const n=E({existingContent:f(t,"utf8"),exampleContent:s,randomHex:e.randomHex});if(n.missingKeys.length===0)return{addedKeys:[],generatedKeys:[],status:"exists"};const o=n.missingKeys.join(", ");if(!(e.yes===!0||await e.confirm(`${u} is missing ${String(n.missingKeys.length)} key(s) from ${m} (${o}). Add them?`)))return e.info(`Skipped — add ${o} to ${u} when you're ready.`),{addedKeys:[],generatedKeys:[],status:"declined"};const a=O(t,l=>E({existingContent:l,exampleContent:s,randomHex:e.randomHex}).additions).map(l=>h(l)?.key).filter(l=>l!==void 0);if(a.length===0)return{addedKeys:[],generatedKeys:[],status:"exists"};const c=n.generatedKeys.filter(l=>a.includes(l));return e.info(`Updated ${u} — added ${a.join(", ")}${w(c)}.`),{addedKeys:a,generatedKeys:c,status:"augmented"}},U=e=>[`# ${e.description}`,`# Docs: ${e.docsUrl}`,`${e.key}="${e.placeholderValue}"`].join(`
|
|
8
|
-
`),X=(e,t)=>{const r=D(e).filter(s=>!t.has(s.key));return r.length===0?"":r.map(s=>U(s)).join(`
|
|
9
|
-
|
|
10
|
-
`)},ie=(e,t)=>{const r=g(e,m),s=y(r)?f(r,"utf8"):"",n=new Set(K(s).map(i=>i.key)),o=X(t,n);if(o==="")return[];const d=s.length>0&&!s.endsWith(`
|
|
11
|
-
`)?`
|
|
12
|
-
`:"";return $(r,`${s}${d}
|
|
13
|
-
${o}
|
|
14
|
-
`),D(t).filter(i=>!n.has(i.key)).map(i=>i.key)},Y=e=>{const t=e.randomHex??p,r=[],s=P(e.existingContent,t,r),n=new Set(K(e.existingContent).map(c=>c.key)),o=[],d=[];for(const c of R)n.has(c.key)||(o.push(c.key),d.push(`# ${c.description}`,`${c.key}="${t(S)}"`));const i=s.join(`
|
|
15
|
-
`);if(d.length===0)return{addedKeys:o,content:i,filledKeys:r};const a=i===""||i.endsWith(`
|
|
16
|
-
`)?"":`
|
|
17
|
-
`;return{addedKeys:o,content:`${i}${a}${d.join(`
|
|
18
|
-
`)}
|
|
19
|
-
`,filledKeys:r}},ae=e=>{const t=g(e.cwd,u),r=y(t),s=r?f(t,"utf8"):"",n=Y({existingContent:s,randomHex:e.randomHex});if(n.filledKeys.length===0&&n.addedKeys.length===0)return{addedKeys:[],filledKeys:[],status:"unchanged"};$(t,n.content,{mode:384});const o=[...n.filledKeys,...n.addedKeys];return e.info?.(`Generated ${String(o.length)} dev secret(s) in ${u}: ${o.join(", ")}`),{addedKeys:n.addedKeys,filledKeys:n.filledKeys,status:r?"filled":"created"}};export{X as buildPackageSecretsBlock,oe as ensureDevVariables,ie as ensureDevVarsExample,ae as fillDevSecrets,se as generateSecretValue,B as isMintableSecretKey,N as isPlaceholderValue,Y as planDevSecretsFill,E as planDevVariablesAugment,I as planDevVariablesScaffold,D as requiredSecrets,re as writeDevVariablesFileAtomically};
|