@lunora/config 1.0.0-alpha.118 → 1.0.0-alpha.119
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 +14 -1
- package/dist/cloudflare/index.d.ts +14 -1
- package/dist/cloudflare/index.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/packem_shared/CLOUDFLARE_DRIVER-4eMO4O3x.mjs +1 -0
- package/dist/packem_shared/{DEFAULT_DEPLOY_TARGET-CBoD0Zha.mjs → DEFAULT_DEPLOY_TARGET-DftkW2Zb.mjs} +1 -1
- package/dist/packem_shared/{LUNORA_CONFIG_FILE-DoVUD52W.mjs → LUNORA_CONFIG_FILE-BrZLPIqF.mjs} +1 -1
- package/dist/packem_shared/{reconcileWranglerBindings-BCwTpuLO.mjs → collectExportGaps-B7gjEClt.mjs} +1 -1
- package/package.json +1 -1
- package/dist/packem_shared/CLOUDFLARE_DRIVER-DS7cF7Cl.mjs +0 -1
|
@@ -257,6 +257,19 @@ interface ReconcileBindingsResult {
|
|
|
257
257
|
/** Resolved wrangler path, or `undefined` when none was found. */
|
|
258
258
|
wranglerPath?: string;
|
|
259
259
|
}
|
|
260
|
+
/**
|
|
261
|
+
* The declared-but-not-re-exported containers and workflows, as structured
|
|
262
|
+
* {@link ExportGap}s. The same gaps `collectWarnings` renders into prose — kept
|
|
263
|
+
* here as data so the Vite plugin can raise them in the error overlay with a
|
|
264
|
+
* precise remediation, rather than re-parsing the warning strings.
|
|
265
|
+
*
|
|
266
|
+
* Exported because reconciliation is not the only caller that needs the answer:
|
|
267
|
+
* `lunora codegen` and `lunora doctor` both want the gaps WITHOUT rewriting
|
|
268
|
+
* `wrangler.jsonc`, which is the rest of what {@link reconcileWranglerBindings}
|
|
269
|
+
* does. Deriving them again from `inferred.{containers,workflows,agents}` at each
|
|
270
|
+
* call site is how one kind ends up silently uncovered.
|
|
271
|
+
*/
|
|
272
|
+
declare const collectExportGaps: (inferred: InferredBindings) => ExportGap[];
|
|
260
273
|
/**
|
|
261
274
|
* Reconcile inferred Durable Object / D1 bindings into `wrangler.jsonc`.
|
|
262
275
|
*
|
|
@@ -774,4 +787,4 @@ interface WranglerProjectValidationResult {
|
|
|
774
787
|
* `{ problems, wranglerPath }` shape plus the structured `report`.
|
|
775
788
|
*/
|
|
776
789
|
declare const validateWranglerProject: (options: WranglerProjectValidationOptions) => WranglerProjectValidationResult;
|
|
777
|
-
export { type AlchemyTranslation, BINDING_MANIFEST_VERSION, type BindingManifest, type BindingRequirement, CLOUDFLARE_DRIVER, type ExportGap, type ManifestConfigShape, type MaterializeOptions, type MaterializeResult, REMOTE_ELIGIBLE_KEYS, REQUIRED_COMPATIBILITY_DATE, REQUIRED_FLAG, type ReadWranglerResult, type ReconcileBindingsResult, type ReconcileCompatibilityDateResult, type ReconcileResult as ReconcileCronsResult, type RemoteBindingPlan, type RemoteEnableInputs, type RemoteWranglerShape, type TailConsumer, WORKERS_CACHE_MIN_DATE, WRANGLER_FILES, type WranglerCacheShape, type WranglerConfig, type WranglerConfigShape, type WranglerContainerEntry, type WranglerProjectValidationOptions, type WranglerProjectValidationResult, type WranglerValidationReport, type WranglerWorkflowEntry, buildBindingManifest, collectWranglerSecretVariables, findWranglerFile, injectRemoteFlags, isCacheEnabled, isRemoteEnvEnabled, materializeRemoteWranglerConfig, planRemoteBindings, readWranglerJsonc, reconcileWranglerBindings, reconcileWranglerCompatibilityDate, reconcileWranglerCrons, resolveRemoteEnabled, scanWranglerVariablesForSecrets, validateWrangler, validateWranglerConfig, validateWranglerProject, withTailConsumer, wranglerToAlchemy };
|
|
790
|
+
export { type AlchemyTranslation, BINDING_MANIFEST_VERSION, type BindingManifest, type BindingRequirement, CLOUDFLARE_DRIVER, type ExportGap, type ManifestConfigShape, type MaterializeOptions, type MaterializeResult, REMOTE_ELIGIBLE_KEYS, REQUIRED_COMPATIBILITY_DATE, REQUIRED_FLAG, type ReadWranglerResult, type ReconcileBindingsResult, type ReconcileCompatibilityDateResult, type ReconcileResult as ReconcileCronsResult, type RemoteBindingPlan, type RemoteEnableInputs, type RemoteWranglerShape, type TailConsumer, WORKERS_CACHE_MIN_DATE, WRANGLER_FILES, type WranglerCacheShape, type WranglerConfig, type WranglerConfigShape, type WranglerContainerEntry, type WranglerProjectValidationOptions, type WranglerProjectValidationResult, type WranglerValidationReport, type WranglerWorkflowEntry, buildBindingManifest, collectExportGaps, collectWranglerSecretVariables, findWranglerFile, injectRemoteFlags, isCacheEnabled, isRemoteEnvEnabled, materializeRemoteWranglerConfig, planRemoteBindings, readWranglerJsonc, reconcileWranglerBindings, reconcileWranglerCompatibilityDate, reconcileWranglerCrons, resolveRemoteEnabled, scanWranglerVariablesForSecrets, validateWrangler, validateWranglerConfig, validateWranglerProject, withTailConsumer, wranglerToAlchemy };
|
|
@@ -257,6 +257,19 @@ interface ReconcileBindingsResult {
|
|
|
257
257
|
/** Resolved wrangler path, or `undefined` when none was found. */
|
|
258
258
|
wranglerPath?: string;
|
|
259
259
|
}
|
|
260
|
+
/**
|
|
261
|
+
* The declared-but-not-re-exported containers and workflows, as structured
|
|
262
|
+
* {@link ExportGap}s. The same gaps `collectWarnings` renders into prose — kept
|
|
263
|
+
* here as data so the Vite plugin can raise them in the error overlay with a
|
|
264
|
+
* precise remediation, rather than re-parsing the warning strings.
|
|
265
|
+
*
|
|
266
|
+
* Exported because reconciliation is not the only caller that needs the answer:
|
|
267
|
+
* `lunora codegen` and `lunora doctor` both want the gaps WITHOUT rewriting
|
|
268
|
+
* `wrangler.jsonc`, which is the rest of what {@link reconcileWranglerBindings}
|
|
269
|
+
* does. Deriving them again from `inferred.{containers,workflows,agents}` at each
|
|
270
|
+
* call site is how one kind ends up silently uncovered.
|
|
271
|
+
*/
|
|
272
|
+
declare const collectExportGaps: (inferred: InferredBindings) => ExportGap[];
|
|
260
273
|
/**
|
|
261
274
|
* Reconcile inferred Durable Object / D1 bindings into `wrangler.jsonc`.
|
|
262
275
|
*
|
|
@@ -774,4 +787,4 @@ interface WranglerProjectValidationResult {
|
|
|
774
787
|
* `{ problems, wranglerPath }` shape plus the structured `report`.
|
|
775
788
|
*/
|
|
776
789
|
declare const validateWranglerProject: (options: WranglerProjectValidationOptions) => WranglerProjectValidationResult;
|
|
777
|
-
export { type AlchemyTranslation, BINDING_MANIFEST_VERSION, type BindingManifest, type BindingRequirement, CLOUDFLARE_DRIVER, type ExportGap, type ManifestConfigShape, type MaterializeOptions, type MaterializeResult, REMOTE_ELIGIBLE_KEYS, REQUIRED_COMPATIBILITY_DATE, REQUIRED_FLAG, type ReadWranglerResult, type ReconcileBindingsResult, type ReconcileCompatibilityDateResult, type ReconcileResult as ReconcileCronsResult, type RemoteBindingPlan, type RemoteEnableInputs, type RemoteWranglerShape, type TailConsumer, WORKERS_CACHE_MIN_DATE, WRANGLER_FILES, type WranglerCacheShape, type WranglerConfig, type WranglerConfigShape, type WranglerContainerEntry, type WranglerProjectValidationOptions, type WranglerProjectValidationResult, type WranglerValidationReport, type WranglerWorkflowEntry, buildBindingManifest, collectWranglerSecretVariables, findWranglerFile, injectRemoteFlags, isCacheEnabled, isRemoteEnvEnabled, materializeRemoteWranglerConfig, planRemoteBindings, readWranglerJsonc, reconcileWranglerBindings, reconcileWranglerCompatibilityDate, reconcileWranglerCrons, resolveRemoteEnabled, scanWranglerVariablesForSecrets, validateWrangler, validateWranglerConfig, validateWranglerProject, withTailConsumer, wranglerToAlchemy };
|
|
790
|
+
export { type AlchemyTranslation, BINDING_MANIFEST_VERSION, type BindingManifest, type BindingRequirement, CLOUDFLARE_DRIVER, type ExportGap, type ManifestConfigShape, type MaterializeOptions, type MaterializeResult, REMOTE_ELIGIBLE_KEYS, REQUIRED_COMPATIBILITY_DATE, REQUIRED_FLAG, type ReadWranglerResult, type ReconcileBindingsResult, type ReconcileCompatibilityDateResult, type ReconcileResult as ReconcileCronsResult, type RemoteBindingPlan, type RemoteEnableInputs, type RemoteWranglerShape, type TailConsumer, WORKERS_CACHE_MIN_DATE, WRANGLER_FILES, type WranglerCacheShape, type WranglerConfig, type WranglerConfigShape, type WranglerContainerEntry, type WranglerProjectValidationOptions, type WranglerProjectValidationResult, type WranglerValidationReport, type WranglerWorkflowEntry, buildBindingManifest, collectExportGaps, collectWranglerSecretVariables, findWranglerFile, injectRemoteFlags, isCacheEnabled, isRemoteEnvEnabled, materializeRemoteWranglerConfig, planRemoteBindings, readWranglerJsonc, reconcileWranglerBindings, reconcileWranglerCompatibilityDate, reconcileWranglerCrons, resolveRemoteEnabled, scanWranglerVariablesForSecrets, validateWrangler, validateWranglerConfig, validateWranglerProject, withTailConsumer, wranglerToAlchemy };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{BINDING_MANIFEST_VERSION as o,buildBindingManifest as a}from"../packem_shared/BINDING_MANIFEST_VERSION-BNab7wQ-.mjs";import{default as n}from"../packem_shared/CLOUDFLARE_DRIVER-
|
|
1
|
+
import{BINDING_MANIFEST_VERSION as o,buildBindingManifest as a}from"../packem_shared/BINDING_MANIFEST_VERSION-BNab7wQ-.mjs";import{default as n}from"../packem_shared/CLOUDFLARE_DRIVER-4eMO4O3x.mjs";import{collectExportGaps as i,reconcileWranglerBindings as E}from"../packem_shared/collectExportGaps-B7gjEClt.mjs";import{reconcileWranglerCompatibilityDate as c}from"../packem_shared/reconcileWranglerCompatibilityDate-BXNiEQ7p.mjs";import{reconcileWranglerCrons as R}from"../packem_shared/reconcileWranglerCrons-BmQa_kGL.mjs";import{REMOTE_ELIGIBLE_KEYS as s,injectRemoteFlags as p,isRemoteEnvEnabled as I,materializeRemoteWranglerConfig as d,planRemoteBindings as W,resolveRemoteEnabled as x}from"../packem_shared/REMOTE_ELIGIBLE_KEYS-ws6iE0y-.mjs";import{WORKERS_CACHE_MIN_DATE as C,isCacheEnabled as A}from"../packem_shared/WORKERS_CACHE_MIN_DATE-B1h_wNDN.mjs";import{WRANGLER_FILES as L,findWranglerFile as T,readWranglerJsonc as b}from"../packem_shared/WRANGLER_FILES-Bi_18Pj6.mjs";import{collectWranglerSecretVariables as S,scanWranglerVariablesForSecrets as B}from"../packem_shared/collectWranglerSecretVariables-jPUxMC9j.mjs";import{wranglerToAlchemy as v}from"../packem_shared/wranglerToAlchemy-Fh5KfTPB.mjs";import{REQUIRED_COMPATIBILITY_DATE as M,REQUIRED_FLAG as O,validateWrangler as V,validateWranglerConfig as h,validateWranglerProject as u,withTailConsumer as U}from"../packem_shared/REQUIRED_COMPATIBILITY_DATE-BwmyesjD.mjs";export{o as BINDING_MANIFEST_VERSION,n as CLOUDFLARE_DRIVER,s as REMOTE_ELIGIBLE_KEYS,M as REQUIRED_COMPATIBILITY_DATE,O as REQUIRED_FLAG,C as WORKERS_CACHE_MIN_DATE,L as WRANGLER_FILES,a as buildBindingManifest,i as collectExportGaps,S as collectWranglerSecretVariables,T as findWranglerFile,p as injectRemoteFlags,A as isCacheEnabled,I as isRemoteEnvEnabled,d as materializeRemoteWranglerConfig,W as planRemoteBindings,b as readWranglerJsonc,E as reconcileWranglerBindings,c as reconcileWranglerCompatibilityDate,R as reconcileWranglerCrons,x as resolveRemoteEnabled,B as scanWranglerVariablesForSecrets,V as validateWrangler,h as validateWranglerConfig,u as validateWranglerProject,U as withTailConsumer,v as wranglerToAlchemy};
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{AGENT_MODE_ENV as t,detectAiAgent as o}from"./packem_shared/AGENT_MODE_ENV-B54hVQ_w.mjs";import{discoverAgentInfo as E}from"./packem_shared/discoverAgentInfo-BJm0QtoI.mjs";import{AGENT_RULES_DIR as _,AGENT_RULES_HINT as p,AGENT_RULES_HINT_ENV as s,LUNORA_SKILL_NAMES as l,ROOT_SKILL_NAME as c,claimAgentRulesHint as n,detectAgentRules as A}from"./packem_shared/AGENT_RULES_DIR-hP9TiDNx.mjs";import{discoverContainerInfo as d}from"./packem_shared/discoverContainerInfo-CYG9j2LY.mjs";import{streamContainerLogs as D}from"./packem_shared/streamContainerLogs-BPYBNrWS.mjs";import{detectFramework as L,readProjectDependencyNames as N}from"./packem_shared/detectFramework-VTQfCNXy.mjs";import{DEV_DAEMON_ENV as T,DEV_HANDOFF_ENV as R,DEV_LOG_FILE as I,DEV_LOG_FILE_ENV as x,DEV_STATE_DIR as V,DEV_STATE_FILE as P,claimDevServerState as g,clearDevServerState as O,isProcessAlive as F,isRecordedProcessCurrent as u,readDevServerState as G,readLiveDevServerState as U,updateDevServerState as C,writeDevServerState as y}from"./packem_shared/DEV_DAEMON_ENV-D9Z83rlU.mjs";import{DEV_VARS_EXAMPLE_FILE as M,DEV_VARS_FILE as B,DEV_VARS_KEY_PATTERN as k,escapeRegExp as w,parseDevVariableEntries as K,upsertDevVariableLine as j}from"./packem_shared/DEV_VARS_EXAMPLE_FILE-BL0hrPx3.mjs";import{DEFAULT_DEPLOY_TARGET as h,deployTargetIds as Y,resolveDeployDriver as W}from"./packem_shared/DEFAULT_DEPLOY_TARGET-
|
|
1
|
+
import{AGENT_MODE_ENV as t,detectAiAgent as o}from"./packem_shared/AGENT_MODE_ENV-B54hVQ_w.mjs";import{discoverAgentInfo as E}from"./packem_shared/discoverAgentInfo-BJm0QtoI.mjs";import{AGENT_RULES_DIR as _,AGENT_RULES_HINT as p,AGENT_RULES_HINT_ENV as s,LUNORA_SKILL_NAMES as l,ROOT_SKILL_NAME as c,claimAgentRulesHint as n,detectAgentRules as A}from"./packem_shared/AGENT_RULES_DIR-hP9TiDNx.mjs";import{discoverContainerInfo as d}from"./packem_shared/discoverContainerInfo-CYG9j2LY.mjs";import{streamContainerLogs as D}from"./packem_shared/streamContainerLogs-BPYBNrWS.mjs";import{detectFramework as L,readProjectDependencyNames as N}from"./packem_shared/detectFramework-VTQfCNXy.mjs";import{DEV_DAEMON_ENV as T,DEV_HANDOFF_ENV as R,DEV_LOG_FILE as I,DEV_LOG_FILE_ENV as x,DEV_STATE_DIR as V,DEV_STATE_FILE as P,claimDevServerState as g,clearDevServerState as O,isProcessAlive as F,isRecordedProcessCurrent as u,readDevServerState as G,readLiveDevServerState as U,updateDevServerState as C,writeDevServerState as y}from"./packem_shared/DEV_DAEMON_ENV-D9Z83rlU.mjs";import{DEV_VARS_EXAMPLE_FILE as M,DEV_VARS_FILE as B,DEV_VARS_KEY_PATTERN as k,escapeRegExp as w,parseDevVariableEntries as K,upsertDevVariableLine as j}from"./packem_shared/DEV_VARS_EXAMPLE_FILE-BL0hrPx3.mjs";import{DEFAULT_DEPLOY_TARGET as h,deployTargetIds as Y,resolveDeployDriver as W}from"./packem_shared/DEFAULT_DEPLOY_TARGET-DftkW2Zb.mjs";import{inferLunoraBindings as q,packageNamesFromBindings as X}from"./packem_shared/inferLunoraBindings-tf2nExl_.mjs";import{LINKED_PROJECT_DIR as Q,LINKED_PROJECT_FILE as Z,readLinkedProject as $,writeLinkedProject as ee}from"./packem_shared/LINKED_PROJECT_DIR-CMzUvj-1.mjs";import{LUNORA_IGNORED_PATHS as te,applyLintIgnores as oe,detectLintTools as ae}from"./packem_shared/LUNORA_IGNORED_PATHS-DIdyP0js.mjs";import{LUNORA_EVENT_SOURCE as ie,formatLunoraEvent as _e}from"./packem_shared/LUNORA_EVENT_SOURCE-ZclWASXS.mjs";import{default as se}from"./packem_shared/LunoraReporter-BnXUqh8t.mjs";import{PACKAGE_SECRETS_REGISTRY as ce,secretsForPackages as ne}from"./packem_shared/PACKAGE_SECRETS_REGISTRY-BgmvEPA-.mjs";import{LUNORA_CONFIG_FILE as me,interpretRemote as de,readProjectRemotePreference as Se,readProjectTarget as De,resolveProjectTarget as fe,resolveTargetOrThrow as Le}from"./packem_shared/LUNORA_CONFIG_FILE-BrZLPIqF.mjs";import{createConfirm as ve,isInteractive as Te,promptMultiSelect as Re,promptSelect as Ie,promptText as xe,promptYesNo as Ve}from"./packem_shared/createConfirm-7IL0kZyE.mjs";import{buildPackageSecretsBlock as ge,ensureDevVariables as Oe,ensureDevVarsExample as Fe,fillDevSecrets as ue,generateSecretValue as Ge,isMintableSecretKey as Ue,isPlaceholderValue as Ce,planDevSecretsFill as ye,planDevVariablesAugment as be,planDevVariablesScaffold as Me,requiredSecrets as Be,writeDevVariablesFileAtomically as ke}from"./packem_shared/buildPackageSecretsBlock-DlAPMSwt.mjs";import{applyAdditiveEdit as Ke,classifyEdit as je}from"./packem_shared/applyAdditiveEdit-Cff30cSa.mjs";import{parseSchema as he}from"./packem_shared/parseSchema-BQjgz6bk.mjs";import{classifyPolicyEdit as We,scaffoldPolicyFile as Je,wireRlsIntoProcedure as qe}from"./packem_shared/classifyPolicyEdit-BzC_MfYK.mjs";import{discoverSchemaInfo as ze}from"./packem_shared/discoverSchemaInfo-C8X9mo-i.mjs";import{ACCENT as Ze,BADGES as $e,BADGE_COLUMN_WIDTH as er,LUNA_ART as rr,LUNA_BUNNY as tr,LUNA_NAME as or,LUNA_SIGNOFF as ar,STEP_BADGE_NAMES as Er,badgeLead as ir,badgeWidth as _r,padBadge as pr,paintAnswer as sr,paintBadge as lr}from"./packem_shared/ACCENT-CLeV5v0K.mjs";import{discoverWorkflowInfo as nr}from"./packem_shared/discoverWorkflowInfo-Bbc0u2gE.mjs";export{Ze as ACCENT,t as AGENT_MODE_ENV,_ as AGENT_RULES_DIR,p as AGENT_RULES_HINT,s as AGENT_RULES_HINT_ENV,$e as BADGES,er as BADGE_COLUMN_WIDTH,h as DEFAULT_DEPLOY_TARGET,T as DEV_DAEMON_ENV,R as DEV_HANDOFF_ENV,I as DEV_LOG_FILE,x as DEV_LOG_FILE_ENV,V as DEV_STATE_DIR,P as DEV_STATE_FILE,M as DEV_VARS_EXAMPLE_FILE,B as DEV_VARS_FILE,k as DEV_VARS_KEY_PATTERN,Q as LINKED_PROJECT_DIR,Z as LINKED_PROJECT_FILE,rr as LUNA_ART,tr as LUNA_BUNNY,or as LUNA_NAME,ar as LUNA_SIGNOFF,me as LUNORA_CONFIG_FILE,ie as LUNORA_EVENT_SOURCE,te as LUNORA_IGNORED_PATHS,l as LUNORA_SKILL_NAMES,se as LunoraReporter,ce as PACKAGE_SECRETS_REGISTRY,c as ROOT_SKILL_NAME,Er as STEP_BADGE_NAMES,Ke as applyAdditiveEdit,oe as applyLintIgnores,ir as badgeLead,_r as badgeWidth,ge as buildPackageSecretsBlock,n as claimAgentRulesHint,g as claimDevServerState,je as classifyEdit,We as classifyPolicyEdit,O as clearDevServerState,ve as createConfirm,Y as deployTargetIds,A as detectAgentRules,o as detectAiAgent,L as detectFramework,ae as detectLintTools,E as discoverAgentInfo,d as discoverContainerInfo,ze as discoverSchemaInfo,nr as discoverWorkflowInfo,Oe as ensureDevVariables,Fe as ensureDevVarsExample,w as escapeRegExp,ue as fillDevSecrets,_e as formatLunoraEvent,Ge as generateSecretValue,q as inferLunoraBindings,de as interpretRemote,Te as isInteractive,Ue as isMintableSecretKey,Ce as isPlaceholderValue,F as isProcessAlive,u as isRecordedProcessCurrent,X as packageNamesFromBindings,pr as padBadge,sr as paintAnswer,lr as paintBadge,K as parseDevVariableEntries,he as parseSchema,ye as planDevSecretsFill,be as planDevVariablesAugment,Me as planDevVariablesScaffold,Re as promptMultiSelect,Ie as promptSelect,xe as promptText,Ve as promptYesNo,G as readDevServerState,$ as readLinkedProject,U as readLiveDevServerState,N as readProjectDependencyNames,Se as readProjectRemotePreference,De as readProjectTarget,Be as requiredSecrets,W as resolveDeployDriver,fe as resolveProjectTarget,Le as resolveTargetOrThrow,Je as scaffoldPolicyFile,ne as secretsForPackages,D as streamContainerLogs,C as updateDevServerState,j as upsertDevVariableLine,qe as wireRlsIntoProcedure,y as writeDevServerState,ke as writeDevVariablesFileAtomically,ee as writeLinkedProject};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{inferLunoraBindings as c}from"./inferLunoraBindings-tf2nExl_.mjs";import{reconcileWranglerBindings as p}from"./collectExportGaps-B7gjEClt.mjs";import{reconcileWranglerCompatibilityDate as u}from"./reconcileWranglerCompatibilityDate-BXNiEQ7p.mjs";import{reconcileWranglerCrons as g}from"./reconcileWranglerCrons-BmQa_kGL.mjs";const m=(e,r)=>{const a=e.durableObjects.map(t=>({className:t.className,exported:!0,name:t.binding})),n=e.queues.map(t=>({name:t.name})),s=e.workflows.map(t=>({exported:t.exported,name:t.exportName}));return{containers:e.containers.map(t=>({exported:t.exported,name:t.exportName})),crons:[...r],globalDatabase:e.needsD1,keyValueStore:e.usesKv,objectStorage:e.usesStorage,queues:n,shardNamespaces:a,signals:[...e.signals],workflows:s}},i=(e,r)=>{try{const a=r();return{added:a.added??[],changed:a.changed,configPath:a.wranglerPath,warnings:a.warnings??[]}}catch(a){const n=a instanceof Error?a.message:String(a);return{added:[],changed:!1,warnings:[`${e} skipped: ${n}`]}}},l={deploy:e=>{const r=e.preview===!0?["versions","upload"]:["deploy"];return e.entry!==void 0&&r.push(e.entry),e.environment!==void 0&&r.push("--env",e.environment),e.temporary===!0&&r.push("--temporary"),e.dryRun===!0&&r.push("--dry-run"),e.outDir!==void 0&&r.push("--outdir",e.outDir,"--metafile"),{args:r,tool:"wrangler"}},dev:e=>{const r=["dev"];return e.configPath!==void 0&&r.push("--config",e.configPath),e.environment!==void 0&&r.push("--env",e.environment),r.push(...e.extraArgs??[]),{args:r,tool:"wrangler"}},secretList:e=>{const r=["secret","list","--format","json"];return e.environment!==void 0&&r.push("--env",e.environment),e.temporary===!0&&r.push("--temporary"),{args:r,tool:"wrangler"}},secretPut:e=>{const r=["secret","put",e.key??""];return e.environment!==void 0&&r.push("--env",e.environment),e.temporary===!0&&r.push("--temporary"),{args:r,tool:"wrangler"}},tail:e=>{const r=["tail"];return e.worker!==void 0&&r.push(e.worker),e.environment!==void 0&&r.push("--env",e.environment),e.format!==void 0&&r.push("--format",e.format),e.status!==void 0&&r.push("--status",e.status),e.search!==void 0&&r.push("--search",e.search),e.temporary===!0&&r.push("--temporary"),{args:r,tool:"wrangler"}}},w={id:"cloudflare",infer:async e=>{const r=await c({projectRoot:e.projectRoot});return m(r,e.crons??[])},name:"Cloudflare",provision:async e=>{const r=e.crons??[],a=await(async()=>{try{const o=await c({projectRoot:e.projectRoot});return i("binding inference",()=>p(e.projectRoot,o))}catch(o){const d=o instanceof Error?o.message:String(o);return{added:[],changed:!1,warnings:[`binding inference skipped: ${d}`]}}})(),n=i("compatibility date sync",()=>u(e.projectRoot)),s=i("cron trigger sync",()=>g(e.projectRoot,r)),t=[a,{...n,added:n.changed?["compatibility_date"]:[]},{...s,added:s.changed?[`${String(r.length)} cron trigger(s)`]:[]}];return{added:t.flatMap(o=>o.added),changed:t.some(o=>o.changed),configPath:t.find(o=>o.configPath!==void 0)?.configPath,warnings:t.flatMap(o=>o.warnings)}},toolchain:l};export{w as default};
|
package/dist/packem_shared/{DEFAULT_DEPLOY_TARGET-CBoD0Zha.mjs → DEFAULT_DEPLOY_TARGET-DftkW2Zb.mjs}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import t from"./CLOUDFLARE_DRIVER-
|
|
1
|
+
import t from"./CLOUDFLARE_DRIVER-4eMO4O3x.mjs";const a="cloudflare",r={cloudflare:t},l=()=>Object.keys(r).toSorted((e,o)=>e.localeCompare(o)),n=(e=a)=>{const o=r[e];if(o===void 0)throw new Error(`unknown deploy target "${e}" — available targets: ${l().join(", ")}`);return o};export{a as DEFAULT_DEPLOY_TARGET,l as deployTargetIds,n as resolveDeployDriver};
|
package/dist/packem_shared/{LUNORA_CONFIG_FILE-DoVUD52W.mjs → LUNORA_CONFIG_FILE-BrZLPIqF.mjs}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{existsSync as n,readFileSync as s}from"node:fs";import{readProjectTarget as i}from"@lunora/codegen";import{parse as l}from"jsonc-parser";import{DEFAULT_DEPLOY_TARGET as c,resolveDeployDriver as f}from"./DEFAULT_DEPLOY_TARGET-
|
|
1
|
+
import{existsSync as n,readFileSync as s}from"node:fs";import{readProjectTarget as i}from"@lunora/codegen";import{parse as l}from"jsonc-parser";import{DEFAULT_DEPLOY_TARGET as c,resolveDeployDriver as f}from"./DEFAULT_DEPLOY_TARGET-DftkW2Zb.mjs";import{join as m}from"node:path";const p="lunora.json",u=r=>{if(typeof r=="boolean")return r;if(r!==null&&typeof r=="object")return!0},j=r=>{const e=m(r,p);if(!n(e))return;let t;try{t=s(e,"utf8")}catch{return}const a=[],o=l(t,a,{allowTrailingComma:!0});if(!(a.length>0||o===null||typeof o!="object"))return o},E=r=>u(j(r)?.remote),T=r=>i(r),y=(r,e)=>e??T(r)??c,F=(r,e)=>{const t=y(r,e);return f(t),t};export{p as LUNORA_CONFIG_FILE,u as interpretRemote,E as readProjectRemotePreference,T as readProjectTarget,y as resolveProjectTarget,F as resolveTargetOrThrow};
|
package/dist/packem_shared/{reconcileWranglerBindings-BCwTpuLO.mjs → collectExportGaps-B7gjEClt.mjs}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{writeFileSync as S,readFileSync as k}from"node:fs";import{join as E}from"node:path";import{containerBuildTag as D}from"@lunora/container";import{DEV_VARS_FILE as A,parseDevVariableEntries as B}from"./DEV_VARS_EXAMPLE_FILE-BL0hrPx3.mjs";import{e as b}from"./jsonc-edit-BZVpxVA0.mjs";import{findWranglerFile as O,readWranglerJsonc as C}from"./WRANGLER_FILES-Bi_18Pj6.mjs";const x="<replace-with-d1-create-id>",R=e=>{const a=[];for(const n of e.containers)n.exported||a.push({className:n.className,exportName:n.exportName,kind:"container",module:"containers"});for(const n of e.workflows)n.exported||a.push({className:n.className,exportName:n.exportName,kind:"workflow",module:"workflows"});for(const n of e.agents)n.exported||a.push({className:n.className,exportName:n.exportName,kind:"agent",module:"agents"});return a},I=(e,a)=>{const n=e.flagshipBinding!==void 0&&!(a?.flagship??[]).some(s=>s.binding===e.flagshipBinding);return[[e.usesKv&&(a?.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&&(a?.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."],[e.usesPipelines&&(a?.pipelines?.length??0)===0,"ctx.pipelines is used but no pipelines binding exists; run 'wrangler pipelines create <name>' and add a 'pipelines' binding ({ binding, pipeline }) — the pipeline resource can't be auto-provisioned."],[n,`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(([s])=>s).map(([,s])=>s)},P=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.usesX402Pay,"@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(([a])=>a).map(([,a])=>a),_=(e,a,n)=>n.filter(s=>!s.exported).map(s=>`${e} "${s.exportName}" is declared but ${s.className} is not exported by the worker entry; add \`export * from "./lunora/_generated/${a}"\` so its binding can be provisioned.`),N=[{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"}],T=()=>N.map(({keys:e,label:a})=>`${e[0]} + ${e[1]} (${a})`).join(" or "),$=e=>{let a;try{a=k(E(e,A),"utf8")}catch{return!1}const n=new Map(B(a).map(s=>[s.key,s.value]));return N.some(({keys:s})=>s.every(r=>(n.get(r)??"")!==""))},v=(e,a,n)=>{const s=new Set(e.durableObjects.map(o=>o.className)),r=[],i=(n?.r2_buckets?.length??0)>0,u=(n?.d1_databases?.some(o=>o.binding==="DB")??!1)||e.needsD1;return e.usesStorage&&!i&&r.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&&!s.has("SessionDO")&&!u&&r.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&&!s.has("SchedulerDO")&&r.push("@lunora/scheduler is used but the worker entry exports no SchedulerDO; export it so the SCHEDULER binding can be provisioned."),r.push(..._("container","containers",e.containers),..._("workflow","workflows",e.workflows),..._("agent","agents",e.agents)),e.containers.length>0&&n?.observability?.enabled===!1&&r.push("containers are declared but observability is explicitly disabled in wrangler.jsonc — container logs will not be captured."),e.usesPayment&&!$(a)&&r.push(`@lunora/payment is used; set one provider's secret pair in .dev.vars — ${T()}.`),r.push(...P(e),...I(e,n)),r},M=e=>{const a=new Set(e.map(s=>s.tag));let n=1;for(;a.has(`v${String(n)}`);)n+=1;return`v${String(n)}`},q=(e,a,n)=>{const s=a.durable_objects?.bindings??[],r=new Set(s.map(c=>c.name)),i=n.filter(c=>!r.has(c.binding));let u=e;const o=[];if(i.length>0){const c=[...s,...i.map(m=>({class_name:m.className,name:m.binding}))];u=b(u,["durable_objects","bindings"],c),o.push(...i.map(m=>`${m.binding}/${m.className}`))}const p=a.migrations??[],l=new Set(p.flatMap(c=>[...c.new_sqlite_classes??[],...c.new_classes??[]])),h=n.map(c=>c.className).filter(c=>!l.has(c));if(h.length>0){const c=[...p,{new_sqlite_classes:h,tag:M(p)}];u=b(u,["migrations"],c)}return{added:o,text:u}},K=(e,a)=>{const n=a.d1_databases??[];if(n.some(i=>i.binding==="DB"))return{added:[],text:e};const s=typeof a.name=="string"&&a.name.length>0?a.name:"lunora",r=[...n,{binding:"DB",database_id:x,database_name:s}];return{added:["DB (D1)"],text:b(e,["d1_databases"],r)}},y=(e,a,n,s,r)=>{const i=a[n]?.binding;return typeof i=="string"&&i.length>0?{added:[],text:e}:{added:[r],text:b(e,[n],{binding:s})}},W=(e,a)=>(a.analytics_engine_datasets?.length??0)>0?{added:[],text:e}:{added:["ANALYTICS (Analytics Engine)"],text:b(e,["analytics_engine_datasets"],[{binding:"ANALYTICS",dataset:"ANALYTICS"}])},j=e=>{if(typeof e=="string")return e;const a={};return e.diskMb!==void 0&&(a.disk_mb=e.diskMb),e.memoryMib!==void 0&&(a.memory_mib=e.memoryMib),e.vcpu!==void 0&&(a.vcpu=e.vcpu),a},Y=e=>e.image.kind==="dockerfile"?e.image.dockerfilePath:e.image.kind==="registry"?e.image.reference:D(e.exportName),L=e=>{const a={class_name:e.className,image:Y(e)};return e.image.kind==="dockerfile"&&(a.image_build_context=e.image.buildContext),e.buildArgs!==void 0&&e.image.kind!=="registry"&&(a.image_vars=e.buildArgs),e.instanceType!==void 0&&(a.instance_type=j(e.instanceType)),e.maxInstances!==void 0&&(a.max_instances=e.maxInstances),e.name!==void 0&&(a.name=e.name),e.rollout?.stepPercentage!==void 0&&(a.rollout_step_percentage=e.rollout.stepPercentage),e.rollout?.gracePeriodSeconds!==void 0&&(a.rollout_active_grace_period=e.rollout.gracePeriodSeconds),a},G=(e,a,n)=>{const s=a.containers??[],r=new Set(s.map(o=>o.class_name)),i=n.filter(o=>!r.has(o.className));if(i.length===0)return{added:[],text:e};const u=b(e,["containers"],[...s,...i.map(o=>L(o))]);return{added:i.map(o=>`containers/${o.className}`),text:u}},H=(e,a)=>{if(a.observability!==void 0)return{added:[],text:e};const n=b(e,["observability"],{enabled:!0,head_sampling_rate:1});return{added:["observability"],text:n}},U=e=>({binding:e.bindingName,class_name:e.className,name:e.name}),F=e=>({binding:e.bindingName,class_name:e.className,name:e.name}),z=(e,a,n,s=[])=>{const r=a.workflows??[],i=new Set(r.map(l=>l.class_name)),u=n.filter(l=>!i.has(l.className)),o=s.filter(l=>!i.has(l.className));if(u.length===0&&o.length===0)return{added:[],text:e};const p=b(e,["workflows"],[...r,...u.map(l=>U(l)),...o.map(l=>F(l))]);return{added:[...u.map(l=>`workflows/${l.className}`),...o.map(l=>`workflows/${l.className}`)],text:p}},V=(e,a,n)=>{const s=a.queues??{},r=s.producers??[],i=s.consumers??[],u=new Set(r.map(d=>d.binding)),o=new Set(i.map(d=>d.queue)),p=n.filter(d=>!u.has(d.bindingName)),l=n.filter(d=>!o.has(d.name));if(p.length===0&&l.length===0)return{added:[],text:e};const h=[...r,...p.map(d=>({binding:d.bindingName,queue:d.name}))],c=[...i,...l.map(d=>{const g={queue:d.name};return d.mode==="pull"&&(g.type="http_pull"),d.tuning.maxBatchSize!==void 0&&(g.max_batch_size=d.tuning.maxBatchSize),d.tuning.maxBatchTimeout!==void 0&&(g.max_batch_timeout=d.tuning.maxBatchTimeout),d.tuning.maxRetries!==void 0&&(g.max_retries=d.tuning.maxRetries),d.tuning.deadLetterQueue!==void 0&&(g.dead_letter_queue=d.tuning.deadLetterQueue),d.tuning.retryDelay!==void 0&&(g.retry_delay=d.tuning.retryDelay),g})],m=b(e,["queues"],{consumers:c,producers:h});return{added:[...p.map(d=>`queues.producers/${d.bindingName}`),...l.map(d=>`queues.consumers/${d.name}`)],text:m}},ne=(e,a,n)=>{const s=O(e),r=R(a);if(!s)return{added:[],changed:!1,exportGaps:r,reason:"wrangler.jsonc not found",warnings:v(a,e)};const{parsed:i,text:u}=C(s);if(i===void 0)return{added:[],changed:!1,exportGaps:r,reason:`failed to parse ${s} as JSONC`,warnings:v(a,e),wranglerPath:s};const o=v(a,e,i);if(n!==void 0){const t=i.env?.[n]!==void 0;o.push(t?`auto-provisioned bindings are written to the top level of wrangler.jsonc only — "env.${n}" has its own (non-inheritable) bindings and must be reconciled by hand; \`lunora deploy --env ${n}\` now validates them, so a gap here will be reported at deploy time.`:`--env "${n}" was requested but wrangler.jsonc declares no "env.${n}" block — auto-provisioned bindings are written to the top level only and will not apply to that environment.`)}const p=a.containers.filter(t=>t.exported),l=a.agents.filter(t=>t.exported&&t.voice===!0&&t.voiceBindingName!==void 0&&t.voiceClassName!==void 0),h=[...a.durableObjects,...p.map(t=>({binding:t.bindingName,className:t.className})),...l.map(t=>({binding:t.voiceBindingName,className:t.voiceClassName}))],c=a.workflows.filter(t=>t.exported),m=a.agents.filter(t=>t.exported),d=[{enabled:!0,run:t=>q(t,i,h)},{enabled:a.needsD1,run:t=>K(t,i)},{enabled:a.usesAi,run:t=>y(t,i,"ai","AI","AI (Workers AI)")},{enabled:a.usesBrowser,run:t=>y(t,i,"browser","BROWSER","BROWSER (Browser Rendering)")},{enabled:a.usesImages,run:t=>y(t,i,"images","IMAGES","IMAGES (Cloudflare Images)")},{enabled:a.usesAnalytics,run:t=>W(t,i)},{enabled:!0,run:t=>H(t,i)},{enabled:p.length>0,run:t=>G(t,i,p)},{enabled:c.length>0||m.length>0,run:t=>z(t,i,c,m)},{enabled:a.queues.length>0,run:t=>V(t,i,a.queues)}];let g=u;const f=[];for(const t of d){if(!t.enabled)continue;const w=t.run(g);g=w.text,f.push(...w.added)}return f.includes("DB (D1)")&&o.push(`wrote a DB binding with a placeholder database_id ("${x}") — run \`wrangler d1 create <name>\` and replace it before deploying.`),g===u?{added:[],changed:!1,exportGaps:r,reason:"bindings already in sync",warnings:o,wranglerPath:s}:(S(s,g,"utf8"),{added:f,changed:!0,exportGaps:r,warnings:o,wranglerPath:s})};export{ne as reconcileWranglerBindings};
|
|
1
|
+
import{writeFileSync as S,readFileSync as k}from"node:fs";import{join as E}from"node:path";import{containerBuildTag as D}from"@lunora/container";import{DEV_VARS_FILE as A,parseDevVariableEntries as B}from"./DEV_VARS_EXAMPLE_FILE-BL0hrPx3.mjs";import{e as b}from"./jsonc-edit-BZVpxVA0.mjs";import{findWranglerFile as O,readWranglerJsonc as C}from"./WRANGLER_FILES-Bi_18Pj6.mjs";const w="<replace-with-d1-create-id>",R=e=>{const a=[];for(const n of e.containers)n.exported||a.push({className:n.className,exportName:n.exportName,kind:"container",module:"containers"});for(const n of e.workflows)n.exported||a.push({className:n.className,exportName:n.exportName,kind:"workflow",module:"workflows"});for(const n of e.agents)n.exported||a.push({className:n.className,exportName:n.exportName,kind:"agent",module:"agents"});return a},P=(e,a)=>{const n=e.flagshipBinding!==void 0&&!(a?.flagship??[]).some(s=>s.binding===e.flagshipBinding);return[[e.usesKv&&(a?.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&&(a?.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."],[e.usesPipelines&&(a?.pipelines?.length??0)===0,"ctx.pipelines is used but no pipelines binding exists; run 'wrangler pipelines create <name>' and add a 'pipelines' binding ({ binding, pipeline }) — the pipeline resource can't be auto-provisioned."],[n,`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(([s])=>s).map(([,s])=>s)},T=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.usesX402Pay,"@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(([a])=>a).map(([,a])=>a),_=(e,a,n)=>n.filter(s=>!s.exported).map(s=>`${e} "${s.exportName}" is declared but ${s.className} is not exported by the worker entry; add \`export * from "./lunora/_generated/${a}"\` so its binding can be provisioned.`),N=[{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"}],I=()=>N.map(({keys:e,label:a})=>`${e[0]} + ${e[1]} (${a})`).join(" or "),$=e=>{let a;try{a=k(E(e,A),"utf8")}catch{return!1}const n=new Map(B(a).map(s=>[s.key,s.value]));return N.some(({keys:s})=>s.every(r=>(n.get(r)??"")!==""))},v=(e,a,n)=>{const s=new Set(e.durableObjects.map(o=>o.className)),r=[],i=(n?.r2_buckets?.length??0)>0,u=(n?.d1_databases?.some(o=>o.binding==="DB")??!1)||e.needsD1;return e.usesStorage&&!i&&r.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&&!s.has("SessionDO")&&!u&&r.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&&!s.has("SchedulerDO")&&r.push("@lunora/scheduler is used but the worker entry exports no SchedulerDO; export it so the SCHEDULER binding can be provisioned."),r.push(..._("container","containers",e.containers),..._("workflow","workflows",e.workflows),..._("agent","agents",e.agents)),e.containers.length>0&&n?.observability?.enabled===!1&&r.push("containers are declared but observability is explicitly disabled in wrangler.jsonc — container logs will not be captured."),e.usesPayment&&!$(a)&&r.push(`@lunora/payment is used; set one provider's secret pair in .dev.vars — ${I()}.`),r.push(...T(e),...P(e,n)),r},M=e=>{const a=new Set(e.map(s=>s.tag));let n=1;for(;a.has(`v${String(n)}`);)n+=1;return`v${String(n)}`},q=(e,a,n)=>{const s=a.durable_objects?.bindings??[],r=new Set(s.map(c=>c.name)),i=n.filter(c=>!r.has(c.binding));let u=e;const o=[];if(i.length>0){const c=[...s,...i.map(m=>({class_name:m.className,name:m.binding}))];u=b(u,["durable_objects","bindings"],c),o.push(...i.map(m=>`${m.binding}/${m.className}`))}const p=a.migrations??[],l=new Set(p.flatMap(c=>[...c.new_sqlite_classes??[],...c.new_classes??[]])),h=n.map(c=>c.className).filter(c=>!l.has(c));if(h.length>0){const c=[...p,{new_sqlite_classes:h,tag:M(p)}];u=b(u,["migrations"],c)}return{added:o,text:u}},K=(e,a)=>{const n=a.d1_databases??[];if(n.some(i=>i.binding==="DB"))return{added:[],text:e};const s=typeof a.name=="string"&&a.name.length>0?a.name:"lunora",r=[...n,{binding:"DB",database_id:w,database_name:s}];return{added:["DB (D1)"],text:b(e,["d1_databases"],r)}},y=(e,a,n,s,r)=>{const i=a[n]?.binding;return typeof i=="string"&&i.length>0?{added:[],text:e}:{added:[r],text:b(e,[n],{binding:s})}},W=(e,a)=>(a.analytics_engine_datasets?.length??0)>0?{added:[],text:e}:{added:["ANALYTICS (Analytics Engine)"],text:b(e,["analytics_engine_datasets"],[{binding:"ANALYTICS",dataset:"ANALYTICS"}])},j=e=>{if(typeof e=="string")return e;const a={};return e.diskMb!==void 0&&(a.disk_mb=e.diskMb),e.memoryMib!==void 0&&(a.memory_mib=e.memoryMib),e.vcpu!==void 0&&(a.vcpu=e.vcpu),a},Y=e=>e.image.kind==="dockerfile"?e.image.dockerfilePath:e.image.kind==="registry"?e.image.reference:D(e.exportName),G=e=>{const a={class_name:e.className,image:Y(e)};return e.image.kind==="dockerfile"&&(a.image_build_context=e.image.buildContext),e.buildArgs!==void 0&&e.image.kind!=="registry"&&(a.image_vars=e.buildArgs),e.instanceType!==void 0&&(a.instance_type=j(e.instanceType)),e.maxInstances!==void 0&&(a.max_instances=e.maxInstances),e.name!==void 0&&(a.name=e.name),e.rollout?.stepPercentage!==void 0&&(a.rollout_step_percentage=e.rollout.stepPercentage),e.rollout?.gracePeriodSeconds!==void 0&&(a.rollout_active_grace_period=e.rollout.gracePeriodSeconds),a},L=(e,a,n)=>{const s=a.containers??[],r=new Set(s.map(o=>o.class_name)),i=n.filter(o=>!r.has(o.className));if(i.length===0)return{added:[],text:e};const u=b(e,["containers"],[...s,...i.map(o=>G(o))]);return{added:i.map(o=>`containers/${o.className}`),text:u}},H=(e,a)=>{if(a.observability!==void 0)return{added:[],text:e};const n=b(e,["observability"],{enabled:!0,head_sampling_rate:1});return{added:["observability"],text:n}},U=e=>({binding:e.bindingName,class_name:e.className,name:e.name}),F=e=>({binding:e.bindingName,class_name:e.className,name:e.name}),z=(e,a,n,s=[])=>{const r=a.workflows??[],i=new Set(r.map(l=>l.class_name)),u=n.filter(l=>!i.has(l.className)),o=s.filter(l=>!i.has(l.className));if(u.length===0&&o.length===0)return{added:[],text:e};const p=b(e,["workflows"],[...r,...u.map(l=>U(l)),...o.map(l=>F(l))]);return{added:[...u.map(l=>`workflows/${l.className}`),...o.map(l=>`workflows/${l.className}`)],text:p}},V=(e,a,n)=>{const s=a.queues??{},r=s.producers??[],i=s.consumers??[],u=new Set(r.map(d=>d.binding)),o=new Set(i.map(d=>d.queue)),p=n.filter(d=>!u.has(d.bindingName)),l=n.filter(d=>!o.has(d.name));if(p.length===0&&l.length===0)return{added:[],text:e};const h=[...r,...p.map(d=>({binding:d.bindingName,queue:d.name}))],c=[...i,...l.map(d=>{const g={queue:d.name};return d.mode==="pull"&&(g.type="http_pull"),d.tuning.maxBatchSize!==void 0&&(g.max_batch_size=d.tuning.maxBatchSize),d.tuning.maxBatchTimeout!==void 0&&(g.max_batch_timeout=d.tuning.maxBatchTimeout),d.tuning.maxRetries!==void 0&&(g.max_retries=d.tuning.maxRetries),d.tuning.deadLetterQueue!==void 0&&(g.dead_letter_queue=d.tuning.deadLetterQueue),d.tuning.retryDelay!==void 0&&(g.retry_delay=d.tuning.retryDelay),g})],m=b(e,["queues"],{consumers:c,producers:h});return{added:[...p.map(d=>`queues.producers/${d.bindingName}`),...l.map(d=>`queues.consumers/${d.name}`)],text:m}},ne=(e,a,n)=>{const s=O(e),r=R(a);if(!s)return{added:[],changed:!1,exportGaps:r,reason:"wrangler.jsonc not found",warnings:v(a,e)};const{parsed:i,text:u}=C(s);if(i===void 0)return{added:[],changed:!1,exportGaps:r,reason:`failed to parse ${s} as JSONC`,warnings:v(a,e),wranglerPath:s};const o=v(a,e,i);if(n!==void 0){const t=i.env?.[n]!==void 0;o.push(t?`auto-provisioned bindings are written to the top level of wrangler.jsonc only — "env.${n}" has its own (non-inheritable) bindings and must be reconciled by hand; \`lunora deploy --env ${n}\` now validates them, so a gap here will be reported at deploy time.`:`--env "${n}" was requested but wrangler.jsonc declares no "env.${n}" block — auto-provisioned bindings are written to the top level only and will not apply to that environment.`)}const p=a.containers.filter(t=>t.exported),l=a.agents.filter(t=>t.exported&&t.voice===!0&&t.voiceBindingName!==void 0&&t.voiceClassName!==void 0),h=[...a.durableObjects,...p.map(t=>({binding:t.bindingName,className:t.className})),...l.map(t=>({binding:t.voiceBindingName,className:t.voiceClassName}))],c=a.workflows.filter(t=>t.exported),m=a.agents.filter(t=>t.exported),d=[{enabled:!0,run:t=>q(t,i,h)},{enabled:a.needsD1,run:t=>K(t,i)},{enabled:a.usesAi,run:t=>y(t,i,"ai","AI","AI (Workers AI)")},{enabled:a.usesBrowser,run:t=>y(t,i,"browser","BROWSER","BROWSER (Browser Rendering)")},{enabled:a.usesImages,run:t=>y(t,i,"images","IMAGES","IMAGES (Cloudflare Images)")},{enabled:a.usesAnalytics,run:t=>W(t,i)},{enabled:!0,run:t=>H(t,i)},{enabled:p.length>0,run:t=>L(t,i,p)},{enabled:c.length>0||m.length>0,run:t=>z(t,i,c,m)},{enabled:a.queues.length>0,run:t=>V(t,i,a.queues)}];let g=u;const f=[];for(const t of d){if(!t.enabled)continue;const x=t.run(g);g=x.text,f.push(...x.added)}return f.includes("DB (D1)")&&o.push(`wrote a DB binding with a placeholder database_id ("${w}") — run \`wrangler d1 create <name>\` and replace it before deploying.`),g===u?{added:[],changed:!1,exportGaps:r,reason:"bindings already in sync",warnings:o,wranglerPath:s}:(S(s,g,"utf8"),{added:f,changed:!0,exportGaps:r,warnings:o,wranglerPath:s})};export{R as collectExportGaps,ne as reconcileWranglerBindings};
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{inferLunoraBindings as c}from"./inferLunoraBindings-tf2nExl_.mjs";import{reconcileWranglerBindings as p}from"./reconcileWranglerBindings-BCwTpuLO.mjs";import{reconcileWranglerCompatibilityDate as u}from"./reconcileWranglerCompatibilityDate-BXNiEQ7p.mjs";import{reconcileWranglerCrons as g}from"./reconcileWranglerCrons-BmQa_kGL.mjs";const m=(e,r)=>{const a=e.durableObjects.map(t=>({className:t.className,exported:!0,name:t.binding})),n=e.queues.map(t=>({name:t.name})),s=e.workflows.map(t=>({exported:t.exported,name:t.exportName}));return{containers:e.containers.map(t=>({exported:t.exported,name:t.exportName})),crons:[...r],globalDatabase:e.needsD1,keyValueStore:e.usesKv,objectStorage:e.usesStorage,queues:n,shardNamespaces:a,signals:[...e.signals],workflows:s}},i=(e,r)=>{try{const a=r();return{added:a.added??[],changed:a.changed,configPath:a.wranglerPath,warnings:a.warnings??[]}}catch(a){const n=a instanceof Error?a.message:String(a);return{added:[],changed:!1,warnings:[`${e} skipped: ${n}`]}}},l={deploy:e=>{const r=e.preview===!0?["versions","upload"]:["deploy"];return e.entry!==void 0&&r.push(e.entry),e.environment!==void 0&&r.push("--env",e.environment),e.temporary===!0&&r.push("--temporary"),e.dryRun===!0&&r.push("--dry-run"),e.outDir!==void 0&&r.push("--outdir",e.outDir,"--metafile"),{args:r,tool:"wrangler"}},dev:e=>{const r=["dev"];return e.configPath!==void 0&&r.push("--config",e.configPath),e.environment!==void 0&&r.push("--env",e.environment),r.push(...e.extraArgs??[]),{args:r,tool:"wrangler"}},secretList:e=>{const r=["secret","list","--format","json"];return e.environment!==void 0&&r.push("--env",e.environment),e.temporary===!0&&r.push("--temporary"),{args:r,tool:"wrangler"}},secretPut:e=>{const r=["secret","put",e.key??""];return e.environment!==void 0&&r.push("--env",e.environment),e.temporary===!0&&r.push("--temporary"),{args:r,tool:"wrangler"}},tail:e=>{const r=["tail"];return e.worker!==void 0&&r.push(e.worker),e.environment!==void 0&&r.push("--env",e.environment),e.format!==void 0&&r.push("--format",e.format),e.status!==void 0&&r.push("--status",e.status),e.search!==void 0&&r.push("--search",e.search),e.temporary===!0&&r.push("--temporary"),{args:r,tool:"wrangler"}}},w={id:"cloudflare",infer:async e=>{const r=await c({projectRoot:e.projectRoot});return m(r,e.crons??[])},name:"Cloudflare",provision:async e=>{const r=e.crons??[],a=await(async()=>{try{const o=await c({projectRoot:e.projectRoot});return i("binding inference",()=>p(e.projectRoot,o))}catch(o){const d=o instanceof Error?o.message:String(o);return{added:[],changed:!1,warnings:[`binding inference skipped: ${d}`]}}})(),n=i("compatibility date sync",()=>u(e.projectRoot)),s=i("cron trigger sync",()=>g(e.projectRoot,r)),t=[a,{...n,added:n.changed?["compatibility_date"]:[]},{...s,added:s.changed?[`${String(r.length)} cron trigger(s)`]:[]}];return{added:t.flatMap(o=>o.added),changed:t.some(o=>o.changed),configPath:t.find(o=>o.configPath!==void 0)?.configPath,warnings:t.flatMap(o=>o.warnings)}},toolchain:l};export{w as default};
|