@lunora/config 1.0.0-alpha.284 → 1.0.0-alpha.285
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 +7 -2
- package/dist/cloudflare/index.d.ts +7 -2
- package/dist/cloudflare/index.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/packem_shared/{LUNORA_IGNORED_PATHS-BHABA9u-.mjs → LUNORA_IGNORED_PATHS-B0-PPvRp.mjs} +1 -1
- package/dist/packem_shared/REMOTE_ELIGIBLE_KEYS-D72UkJEq.mjs +1 -0
- package/dist/packem_shared/applyModify-DKP2l6S9.mjs +1 -0
- package/dist/packem_shared/{collectExportGaps-BmEGzQQc.mjs → collectExportGaps-DUaEyDNw.mjs} +1 -1
- package/dist/packem_shared/{reconcileBindingsSafely-DOqY2zb2.mjs → reconcileBindingsSafely-Zi2HVRkH.mjs} +1 -1
- package/dist/packem_shared/reconcileWranglerCompatibilityDate-hocXEuRA.mjs +1 -0
- package/package.json +3 -3
- package/dist/packem_shared/REMOTE_ELIGIBLE_KEYS-D-edJjVY.mjs +0 -1
- package/dist/packem_shared/jsonc-edit-BZgQIdAH.mjs +0 -1
- package/dist/packem_shared/reconcileWranglerCompatibilityDate-7OO_xaKR.mjs +0 -1
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { D as DeployDriver, G as GeneratedClassModule, I as InferredBindings, S as SchemaInfo } from "../packem_shared/schema-info.d-C3DeuUmC.mjs";
|
|
2
2
|
import { WranglerVariableIR } from '@lunora/codegen';
|
|
3
|
+
/** Apply one structural jsonc edit and return the rewritten text (a no-op edit returns the input). */
|
|
4
|
+
declare const applyModify: (text: string, path: ReadonlyArray<number | string>, value: unknown) => string;
|
|
3
5
|
/** The project coordinates the validator needs. */
|
|
4
6
|
interface AssertWranglerOptions {
|
|
5
7
|
/** Absolute path to the project root holding `wrangler.jsonc`. */
|
|
@@ -683,6 +685,9 @@ interface WranglerQueueConsumer {
|
|
|
683
685
|
type?: string;
|
|
684
686
|
}
|
|
685
687
|
interface WranglerConfig {
|
|
688
|
+
ai?: {
|
|
689
|
+
binding?: unknown;
|
|
690
|
+
} | null;
|
|
686
691
|
analytics_engine_datasets?: ReadonlyArray<{
|
|
687
692
|
binding?: string;
|
|
688
693
|
dataset?: string;
|
|
@@ -964,7 +969,7 @@ declare const validateWranglerConfig: (wranglerInput: WranglerConfig | undefined
|
|
|
964
969
|
* `{ valid, errors, warnings }`.
|
|
965
970
|
*/
|
|
966
971
|
declare const validateWrangler: typeof validateWranglerConfig;
|
|
967
|
-
export { type AlchemyTranslation,
|
|
972
|
+
export { type AlchemyTranslation, type AssertWranglerOptions, 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 ReconcileProject, type RemoteBindingPlan, type RemoteEnableInputs, type RemoteWranglerShape, type TailConsumer, UNEXPORTED_CLASS_MARKER, WORKERS_CACHE_MIN_DATE, WRANGLER_FILES, type WranglerCacheShape, type WranglerConfig, type WranglerConfigShape, type WranglerContainerEntry, type WranglerEnvironmentMerge, type WranglerProjectValidationOptions, type WranglerProjectValidationResult, type WranglerValidationReport, type WranglerWorkflowEntry,
|
|
968
973
|
/**
|
|
969
974
|
* `@lunora/config/cloudflare` — the wrangler layer.
|
|
970
975
|
*
|
|
@@ -980,4 +985,4 @@ export { type AlchemyTranslation,
|
|
|
980
985
|
* Plan 114 §5.3 (D6): a package carrying real provider code isolates it behind a
|
|
981
986
|
* subpath rather than relocating wholesale.
|
|
982
987
|
*/
|
|
983
|
-
|
|
988
|
+
applyModify, assertWranglerSatisfiesSchema, buildBindingManifest, collectExportGaps, collectWranglerSecretVariables, describePreservedCrons, findWranglerFile, injectRemoteFlags, isCacheEnabled, isRemoteEnvEnabled, materializeRemoteWranglerConfig, mergeWranglerEnvironment, planRemoteBindings, readWranglerJsonc, reconcileBindingsSafely, reconcileWranglerBindings, reconcileWranglerCompatibilityDate, reconcileWranglerCrons, reconcileWranglerExtras, resolveRemoteEnabled, scanWranglerVariablesForSecrets, validateWrangler, validateWranglerConfig, validateWranglerProject, withTailConsumer, wranglerToAlchemy };
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { D as DeployDriver, G as GeneratedClassModule, I as InferredBindings, S as SchemaInfo } from "../packem_shared/schema-info.d-C3DeuUmC.js";
|
|
2
2
|
import { WranglerVariableIR } from '@lunora/codegen';
|
|
3
|
+
/** Apply one structural jsonc edit and return the rewritten text (a no-op edit returns the input). */
|
|
4
|
+
declare const applyModify: (text: string, path: ReadonlyArray<number | string>, value: unknown) => string;
|
|
3
5
|
/** The project coordinates the validator needs. */
|
|
4
6
|
interface AssertWranglerOptions {
|
|
5
7
|
/** Absolute path to the project root holding `wrangler.jsonc`. */
|
|
@@ -683,6 +685,9 @@ interface WranglerQueueConsumer {
|
|
|
683
685
|
type?: string;
|
|
684
686
|
}
|
|
685
687
|
interface WranglerConfig {
|
|
688
|
+
ai?: {
|
|
689
|
+
binding?: unknown;
|
|
690
|
+
} | null;
|
|
686
691
|
analytics_engine_datasets?: ReadonlyArray<{
|
|
687
692
|
binding?: string;
|
|
688
693
|
dataset?: string;
|
|
@@ -964,7 +969,7 @@ declare const validateWranglerConfig: (wranglerInput: WranglerConfig | undefined
|
|
|
964
969
|
* `{ valid, errors, warnings }`.
|
|
965
970
|
*/
|
|
966
971
|
declare const validateWrangler: typeof validateWranglerConfig;
|
|
967
|
-
export { type AlchemyTranslation,
|
|
972
|
+
export { type AlchemyTranslation, type AssertWranglerOptions, 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 ReconcileProject, type RemoteBindingPlan, type RemoteEnableInputs, type RemoteWranglerShape, type TailConsumer, UNEXPORTED_CLASS_MARKER, WORKERS_CACHE_MIN_DATE, WRANGLER_FILES, type WranglerCacheShape, type WranglerConfig, type WranglerConfigShape, type WranglerContainerEntry, type WranglerEnvironmentMerge, type WranglerProjectValidationOptions, type WranglerProjectValidationResult, type WranglerValidationReport, type WranglerWorkflowEntry,
|
|
968
973
|
/**
|
|
969
974
|
* `@lunora/config/cloudflare` — the wrangler layer.
|
|
970
975
|
*
|
|
@@ -980,4 +985,4 @@ export { type AlchemyTranslation,
|
|
|
980
985
|
* Plan 114 §5.3 (D6): a package carrying real provider code isolates it behind a
|
|
981
986
|
* subpath rather than relocating wholesale.
|
|
982
987
|
*/
|
|
983
|
-
|
|
988
|
+
applyModify, assertWranglerSatisfiesSchema, buildBindingManifest, collectExportGaps, collectWranglerSecretVariables, describePreservedCrons, findWranglerFile, injectRemoteFlags, isCacheEnabled, isRemoteEnvEnabled, materializeRemoteWranglerConfig, mergeWranglerEnvironment, planRemoteBindings, readWranglerJsonc, reconcileBindingsSafely, reconcileWranglerBindings, reconcileWranglerCompatibilityDate, reconcileWranglerCrons, reconcileWranglerExtras, resolveRemoteEnabled, scanWranglerVariablesForSecrets, validateWrangler, validateWranglerConfig, validateWranglerProject, withTailConsumer, wranglerToAlchemy };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{applyModify as o}from"../packem_shared/applyModify-DKP2l6S9.mjs";import{assertWranglerSatisfiesSchema as n}from"../packem_shared/assertWranglerSatisfiesSchema-B24XPKq7.mjs";import{BINDING_MANIFEST_VERSION as t,buildBindingManifest as i}from"../packem_shared/BINDING_MANIFEST_VERSION-B4Tu8Ytd.mjs";import{default as E}from"../packem_shared/CLOUDFLARE_DRIVER-DUE6r-Pg.mjs";import{collectExportGaps as s,reconcileWranglerBindings as c}from"../packem_shared/collectExportGaps-DUaEyDNw.mjs";import{reconcileWranglerCompatibilityDate as p}from"../packem_shared/reconcileWranglerCompatibilityDate-hocXEuRA.mjs";import{describePreservedCrons as x,reconcileWranglerCrons as d}from"../packem_shared/describePreservedCrons-Ci5r2aph.mjs";import{reconcileBindingsSafely as I,reconcileWranglerExtras as _}from"../packem_shared/reconcileBindingsSafely-Zi2HVRkH.mjs";import{REMOTE_ELIGIBLE_KEYS as S,injectRemoteFlags as A,isRemoteEnvEnabled as D,materializeRemoteWranglerConfig as L,planRemoteBindings as T,resolveRemoteEnabled as b}from"../packem_shared/REMOTE_ELIGIBLE_KEYS-D72UkJEq.mjs";import{withTailConsumer as B}from"../packem_shared/withTailConsumer-DaP3r6ia.mjs";import{WORKERS_CACHE_MIN_DATE as M,isCacheEnabled as N}from"../packem_shared/WORKERS_CACHE_MIN_DATE-0k9ABJtF.mjs";import{mergeWranglerEnvironment as y}from"../packem_shared/mergeWranglerEnvironment-BIcLqPfv.mjs";import{WRANGLER_FILES as h,findWranglerFile as P,readWranglerJsonc as U}from"../packem_shared/WRANGLER_FILES-UNW-xY5u.mjs";import{UNEXPORTED_CLASS_MARKER as u,validateWranglerProject as K}from"../packem_shared/UNEXPORTED_CLASS_MARKER-Bc302QS4.mjs";import{collectWranglerSecretVariables as w,scanWranglerVariablesForSecrets as Q}from"../packem_shared/collectWranglerSecretVariables-D-usPfT8.mjs";import{wranglerToAlchemy as z}from"../packem_shared/wranglerToAlchemy-DZOim9As.mjs";import{REQUIRED_COMPATIBILITY_DATE as J,REQUIRED_FLAG as X,validateWrangler as k,validateWranglerConfig as q}from"../packem_shared/REQUIRED_COMPATIBILITY_DATE-g_1F-n2X.mjs";export{t as BINDING_MANIFEST_VERSION,E as CLOUDFLARE_DRIVER,S as REMOTE_ELIGIBLE_KEYS,J as REQUIRED_COMPATIBILITY_DATE,X as REQUIRED_FLAG,u as UNEXPORTED_CLASS_MARKER,M as WORKERS_CACHE_MIN_DATE,h as WRANGLER_FILES,o as applyModify,n as assertWranglerSatisfiesSchema,i as buildBindingManifest,s as collectExportGaps,w as collectWranglerSecretVariables,x as describePreservedCrons,P as findWranglerFile,A as injectRemoteFlags,N as isCacheEnabled,D as isRemoteEnvEnabled,L as materializeRemoteWranglerConfig,y as mergeWranglerEnvironment,T as planRemoteBindings,U as readWranglerJsonc,I as reconcileBindingsSafely,c as reconcileWranglerBindings,p as reconcileWranglerCompatibilityDate,d as reconcileWranglerCrons,_ as reconcileWranglerExtras,b as resolveRemoteEnabled,Q as scanWranglerVariablesForSecrets,k as validateWrangler,q as validateWranglerConfig,K as validateWranglerProject,B as withTailConsumer,z as wranglerToAlchemy};
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{AGENT_MODE_ENV as o,detectAiAgent as t}from"./packem_shared/AGENT_MODE_ENV-D8MvSwPE.mjs";import{discoverAgentInfo as E}from"./packem_shared/discoverAgentInfo-CTdCSfYM.mjs";import{AGENT_RULES_DIR as s,AGENT_RULES_HINT as n,AGENT_RULES_HINT_ENV as l,LUNORA_SKILL_NAMES as _,ROOT_SKILL_NAME as p,claimAgentRulesHint as c,detectAgentRules as d}from"./packem_shared/AGENT_RULES_DIR-C54Ta_vz.mjs";import{CODEGEN_ENV as D,isCodegenDisabled as m}from"./packem_shared/CODEGEN_ENV-ZsCxV1kP.mjs";import{discoverContainerInfo as f}from"./packem_shared/discoverContainerInfo-EhZtEBQs.mjs";import{streamContainerLogs as v}from"./packem_shared/streamContainerLogs-0nko1qpv.mjs";import{detectFramework as R,projectUsesUmbrella as g,readProjectDependencyNames as T}from"./packem_shared/detectFramework-CUiVEHDQ.mjs";import{DEV_BINDINGS_FILE as x,DEV_DAEMON_ENV as I,DEV_HANDOFF_ENV as u,DEV_LOG_FILE as O,DEV_LOG_FILE_ENV as P,DEV_STATE_DIR as F,DEV_STATE_FILE as C,claimDevServerState as U,clearDevServerState as G,isDevServerReady as b,isProcessAlive as M,isRecordedProcessCurrent as y,readDevServerState as k,readLiveDevServerState as B,updateDevServerState as K,writeDevServerState as w}from"./packem_shared/DEV_BINDINGS_FILE-pyOiNLP4.mjs";import{DEV_VARS_EXAMPLE_FILE as j,DEV_VARS_FILE as H,DEV_VARS_KEY_PATTERN as W,escapeRegExp as Y,parseDevVariableEntries as J,removeDevVariableLine as q,upsertDevVariableLine as X}from"./packem_shared/DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";import{DEV_WORKER_ENV_VALUE as Q,DEV_WORKER_ENV_VAR as Z,ensureDevWorkerEnv as $}from"./packem_shared/DEV_WORKER_ENV_VALUE-DwGANZVw.mjs";import{DEFAULT_DEPLOY_TARGET as re,deployTargetIds as oe,isRunnableTarget as te,planToolchainInvocation as ae,resolveDeployDriver as Ee,runnableTargetIds as ie,targetRunsOwnDevServer as se}from"./packem_shared/DEFAULT_DEPLOY_TARGET-CtEZtsUF.mjs";import{inferLunoraBindings as le,packageNamesFromBindings as _e}from"./packem_shared/inferLunoraBindings-GaAITuz-.mjs";import{LINKED_PROJECT_DIR as ce,LINKED_PROJECT_FILE as de,readLinkedProject as Ae,writeLinkedProject as De}from"./packem_shared/LINKED_PROJECT_DIR-Ba5qPEwo.mjs";import{LUNORA_IGNORED_PATHS as Se,applyLintIgnores as fe,detectLintTools as Le}from"./packem_shared/LUNORA_IGNORED_PATHS-
|
|
1
|
+
import{AGENT_MODE_ENV as o,detectAiAgent as t}from"./packem_shared/AGENT_MODE_ENV-D8MvSwPE.mjs";import{discoverAgentInfo as E}from"./packem_shared/discoverAgentInfo-CTdCSfYM.mjs";import{AGENT_RULES_DIR as s,AGENT_RULES_HINT as n,AGENT_RULES_HINT_ENV as l,LUNORA_SKILL_NAMES as _,ROOT_SKILL_NAME as p,claimAgentRulesHint as c,detectAgentRules as d}from"./packem_shared/AGENT_RULES_DIR-C54Ta_vz.mjs";import{CODEGEN_ENV as D,isCodegenDisabled as m}from"./packem_shared/CODEGEN_ENV-ZsCxV1kP.mjs";import{discoverContainerInfo as f}from"./packem_shared/discoverContainerInfo-EhZtEBQs.mjs";import{streamContainerLogs as v}from"./packem_shared/streamContainerLogs-0nko1qpv.mjs";import{detectFramework as R,projectUsesUmbrella as g,readProjectDependencyNames as T}from"./packem_shared/detectFramework-CUiVEHDQ.mjs";import{DEV_BINDINGS_FILE as x,DEV_DAEMON_ENV as I,DEV_HANDOFF_ENV as u,DEV_LOG_FILE as O,DEV_LOG_FILE_ENV as P,DEV_STATE_DIR as F,DEV_STATE_FILE as C,claimDevServerState as U,clearDevServerState as G,isDevServerReady as b,isProcessAlive as M,isRecordedProcessCurrent as y,readDevServerState as k,readLiveDevServerState as B,updateDevServerState as K,writeDevServerState as w}from"./packem_shared/DEV_BINDINGS_FILE-pyOiNLP4.mjs";import{DEV_VARS_EXAMPLE_FILE as j,DEV_VARS_FILE as H,DEV_VARS_KEY_PATTERN as W,escapeRegExp as Y,parseDevVariableEntries as J,removeDevVariableLine as q,upsertDevVariableLine as X}from"./packem_shared/DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";import{DEV_WORKER_ENV_VALUE as Q,DEV_WORKER_ENV_VAR as Z,ensureDevWorkerEnv as $}from"./packem_shared/DEV_WORKER_ENV_VALUE-DwGANZVw.mjs";import{DEFAULT_DEPLOY_TARGET as re,deployTargetIds as oe,isRunnableTarget as te,planToolchainInvocation as ae,resolveDeployDriver as Ee,runnableTargetIds as ie,targetRunsOwnDevServer as se}from"./packem_shared/DEFAULT_DEPLOY_TARGET-CtEZtsUF.mjs";import{inferLunoraBindings as le,packageNamesFromBindings as _e}from"./packem_shared/inferLunoraBindings-GaAITuz-.mjs";import{LINKED_PROJECT_DIR as ce,LINKED_PROJECT_FILE as de,readLinkedProject as Ae,writeLinkedProject as De}from"./packem_shared/LINKED_PROJECT_DIR-Ba5qPEwo.mjs";import{LUNORA_IGNORED_PATHS as Se,applyLintIgnores as fe,detectLintTools as Le}from"./packem_shared/LUNORA_IGNORED_PATHS-B0-PPvRp.mjs";import{LUNORA_TAG as Ne,advisoryLine as Re,blockingFindingsMessage as ge,lunoraLine as Te,reportCodegenFindings as Ve}from"./packem_shared/LUNORA_TAG-CiQM3BkI.mjs";import{LUNORA_EVENT_SOURCE as Ie,formatLunoraEvent as ue}from"./packem_shared/LUNORA_EVENT_SOURCE-DYdcDU9G.mjs";import{default as Pe}from"./packem_shared/LunoraReporter-f277GLNT.mjs";import{addArgsFor as Ce,detectInstalledManagers as Ue,detectPackageManager as Ge,execArgsFor as be,installArgsFor as Me,runScriptArgsFor as ye,runScriptCommand as ke,toolchainExecArgs as Be}from"./packem_shared/addArgsFor-CYZKhNIo.mjs";import{P as we,s as he}from"./packem_shared/package-secrets-registry-DvtTiK4b.mjs";import{runPostCodegenHook as He}from"./packem_shared/runPostCodegenHook-B0T1q2YI.mjs";import{interpretRemote as Ye,readProjectRemotePreference as Je,readProjectTarget as qe,resolveProjectTarget as Xe,resolveTargetOrThrow as ze}from"./packem_shared/interpretRemote-Da32GcUi.mjs";import{createConfirm as Ze,isInteractive as $e,promptMultiSelect as er,promptSelect as rr,promptText as or,promptYesNo as tr}from"./packem_shared/createConfirm-D5mKTMHj.mjs";import{buildPackageSecretsBlock as Er,ensureDevVariables as ir,ensureDevVarsExample as sr,fillDevSecrets as nr,generateSecretValue as lr,isMintableSecretKey as _r,isPlaceholderValue as pr,planDevSecretsFill as cr,planDevVariablesAugment as dr,planDevVariablesScaffold as Ar,requiredSecrets as Dr,writeDevVariablesFileAtomically as mr}from"./packem_shared/buildPackageSecretsBlock-yv9mjKEW.mjs";import{applyAdditiveEdit as fr,classifyEdit as Lr}from"./packem_shared/applyAdditiveEdit-CH0VhMJ2.mjs";import{parseSchema as Nr}from"./packem_shared/parseSchema-D1Wbr1qv.mjs";import{classifyPolicyEdit as gr,resolveServerModule as Tr,scaffoldPolicyFile as Vr,wireRlsIntoProcedure as xr}from"./packem_shared/classifyPolicyEdit-D8NwrHxR.mjs";import{discoverSchemaInfo as ur}from"./packem_shared/discoverSchemaInfo-DJvevsCm.mjs";import{ACCENT as Pr,BADGES as Fr,BADGE_COLUMN_WIDTH as Cr,LUNA_ART as Ur,LUNA_BUNNY as Gr,LUNA_NAME as br,LUNA_SIGNOFF as Mr,STEP_BADGE_NAMES as yr,badgeLead as kr,badgeWidth as Br,padBadge as Kr,paintAnswer as wr,paintBadge as hr}from"./packem_shared/ACCENT-CotPTfv7.mjs";import{COMPOSED_WORKER_ENTRY as Hr,GENERATED_CLASS_MODULES as Wr}from"./packem_shared/COMPOSED_WORKER_ENTRY-5R-BECOC.mjs";import{discoverWorkflowInfo as Jr}from"./packem_shared/discoverWorkflowInfo-BsPvlo6O.mjs";export{Pr as ACCENT,o as AGENT_MODE_ENV,s as AGENT_RULES_DIR,n as AGENT_RULES_HINT,l as AGENT_RULES_HINT_ENV,Fr as BADGES,Cr as BADGE_COLUMN_WIDTH,D as CODEGEN_ENV,Hr as COMPOSED_WORKER_ENTRY,re as DEFAULT_DEPLOY_TARGET,x as DEV_BINDINGS_FILE,I as DEV_DAEMON_ENV,u as DEV_HANDOFF_ENV,O as DEV_LOG_FILE,P as DEV_LOG_FILE_ENV,F as DEV_STATE_DIR,C as DEV_STATE_FILE,j as DEV_VARS_EXAMPLE_FILE,H as DEV_VARS_FILE,W as DEV_VARS_KEY_PATTERN,Q as DEV_WORKER_ENV_VALUE,Z as DEV_WORKER_ENV_VAR,Wr as GENERATED_CLASS_MODULES,ce as LINKED_PROJECT_DIR,de as LINKED_PROJECT_FILE,Ur as LUNA_ART,Gr as LUNA_BUNNY,br as LUNA_NAME,Mr as LUNA_SIGNOFF,Ie as LUNORA_EVENT_SOURCE,Se as LUNORA_IGNORED_PATHS,_ as LUNORA_SKILL_NAMES,Ne as LUNORA_TAG,Pe as LunoraReporter,we as PACKAGE_SECRETS_REGISTRY,p as ROOT_SKILL_NAME,yr as STEP_BADGE_NAMES,Ce as addArgsFor,Re as advisoryLine,fr as applyAdditiveEdit,fe as applyLintIgnores,kr as badgeLead,Br as badgeWidth,ge as blockingFindingsMessage,Er as buildPackageSecretsBlock,c as claimAgentRulesHint,U as claimDevServerState,Lr as classifyEdit,gr as classifyPolicyEdit,G as clearDevServerState,Ze as createConfirm,oe as deployTargetIds,d as detectAgentRules,t as detectAiAgent,R as detectFramework,Ue as detectInstalledManagers,Le as detectLintTools,Ge as detectPackageManager,E as discoverAgentInfo,f as discoverContainerInfo,ur as discoverSchemaInfo,Jr as discoverWorkflowInfo,ir as ensureDevVariables,sr as ensureDevVarsExample,$ as ensureDevWorkerEnv,Y as escapeRegExp,be as execArgsFor,nr as fillDevSecrets,ue as formatLunoraEvent,lr as generateSecretValue,le as inferLunoraBindings,Me as installArgsFor,Ye as interpretRemote,m as isCodegenDisabled,b as isDevServerReady,$e as isInteractive,_r as isMintableSecretKey,pr as isPlaceholderValue,M as isProcessAlive,y as isRecordedProcessCurrent,te as isRunnableTarget,Te as lunoraLine,_e as packageNamesFromBindings,Kr as padBadge,wr as paintAnswer,hr as paintBadge,J as parseDevVariableEntries,Nr as parseSchema,cr as planDevSecretsFill,dr as planDevVariablesAugment,Ar as planDevVariablesScaffold,ae as planToolchainInvocation,g as projectUsesUmbrella,er as promptMultiSelect,rr as promptSelect,or as promptText,tr as promptYesNo,k as readDevServerState,Ae as readLinkedProject,B as readLiveDevServerState,T as readProjectDependencyNames,Je as readProjectRemotePreference,qe as readProjectTarget,q as removeDevVariableLine,Ve as reportCodegenFindings,Dr as requiredSecrets,Ee as resolveDeployDriver,Xe as resolveProjectTarget,Tr as resolveServerModule,ze as resolveTargetOrThrow,He as runPostCodegenHook,ye as runScriptArgsFor,ke as runScriptCommand,ie as runnableTargetIds,Vr as scaffoldPolicyFile,he as secretsForPackages,v as streamContainerLogs,se as targetRunsOwnDevServer,Be as toolchainExecArgs,K as updateDevServerState,X as upsertDevVariableLine,xr as wireRlsIntoProcedure,w as writeDevServerState,mr as writeDevVariablesFileAtomically,De as writeLinkedProject};
|
package/dist/packem_shared/{LUNORA_IGNORED_PATHS-BHABA9u-.mjs → LUNORA_IGNORED_PATHS-B0-PPvRp.mjs}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{existsSync as g,readFileSync as m,writeFileSync as d}from"node:fs";import{join as l,dirname as x}from"node:path";import{parse as v}from"jsonc-parser";import{readProjectDependencyNames as F}from"./detectFramework-CUiVEHDQ.mjs";import{
|
|
1
|
+
import{existsSync as g,readFileSync as m,writeFileSync as d}from"node:fs";import{join as l,dirname as x}from"node:path";import{parse as v}from"jsonc-parser";import{readProjectDependencyNames as F}from"./detectFramework-CUiVEHDQ.mjs";import{applyModify as $}from"./applyModify-DKP2l6S9.mjs";const c=["lunora/_generated/","lunora/.lunora-schema.json","lunora.advisor.map.json",".lunora/",".wrangler/"],f={biome:{configFiles:["biome.json","biome.jsonc"],packages:["@biomejs/biome"],shadowable:!0},eslint:{configFiles:["eslint.config.js","eslint.config.mjs","eslint.config.cjs","eslint.config.ts","eslint.config.mts","eslint.config.cts"],packages:["eslint"],shadowable:!0},oxlint:{configFiles:[".oxlintrc.json"],packages:["oxlint"],shadowable:!0},prettier:{configFiles:[".prettierrc",".prettierrc.json",".prettierrc.js",".prettierrc.mjs",".prettierrc.cjs","prettier.config.js","prettier.config.mjs","prettier.config.cjs"],packages:["prettier"],shadowable:!1}},k=Object.keys(f),y=(e,n)=>f[n].configFiles.map(t=>l(e,t)).find(t=>g(t)),w=(e,n)=>{let t=e;for(;;){const s=y(t,n);if(s!==void 0)return s;if(g(l(t,".git")))return;const i=x(t);if(i===t)return;t=i}},j=(e,n)=>{const t=y(e,n);if(t!==void 0)return{action:"extend",path:t};const s=g(l(e,".git")),i=f[n].shadowable&&!s?w(x(e),n):void 0,[a=""]=f[n].configFiles;return i===void 0?{action:"create",path:l(e,a)}:{action:"report",path:i}},J=e=>{const n=F(e),t=()=>{try{return JSON.parse(m(l(e,"package.json"),"utf8")).prettier!==void 0}catch{return!1}};return k.filter(s=>f[s].packages.some(i=>n.has(i))||y(e,s)!==void 0||s==="prettier"&&t())},L="# Lunora generated + derived artifacts",O=e=>{const n=l(e,".prettierignore"),t=g(n)?m(n,"utf8"):void 0,s=t===void 0?[]:t.split(`
|
|
2
2
|
`).map(o=>o.trim()),i=c.filter(o=>!s.includes(o));if(i.length===0)return{path:n,status:t===void 0?"created":"unchanged",tool:"prettier"};const a=`${L}
|
|
3
3
|
${i.join(`
|
|
4
4
|
`)}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{writeFileSync as d,rmSync as f}from"node:fs";import{applyModify as g}from"./applyModify-DKP2l6S9.mjs";import{findWranglerFile as m,readWranglerJsonc as b}from"./WRANGLER_FILES-UNW-xY5u.mjs";import{join as y}from"node:path";const u={ai:{label:"AI",shape:"object"},d1_databases:{label:"D1",shape:"array"},kv_namespaces:{label:"KV",shape:"array"},queues:{label:"Queue",shape:"producers"},r2_buckets:{label:"R2",shape:"array"},services:{label:"Service",shape:"array"},vectorize:{label:"Vectorize",shape:"array"}},h=Object.keys(u),p=(e,r)=>typeof e.binding=="string"?e.binding:r,l=(e,r,n,a)=>{const t=[];for(const[o,s]of r.entries())s!=null&&t.push({binding:p(s,`#${String(o)}`),kind:n,path:[...a,o],section:e});return t},E=(e,r)=>{const{label:n,shape:a}=u[e];if(a==="array"){const o=r[e]??[];return l(e,o,n,[])}if(a==="producers")return l(e,r.queues?.producers??[],n,["producers"]);const t=r.ai;return t==null?[]:[{binding:p(t,e),kind:n,path:[],section:e}]},v=e=>h.flatMap(r=>E(r,e)),R=(e,r)=>{let n=e;for(const a of r)n=g(n,[a.section,...a.path,"remote"],!0);return n},i=()=>{},S=e=>{let r=!1;return()=>{if(!r){r=!0;try{f(e,{force:!0,recursive:!0})}catch{}}}};let c=0;const B=()=>(c+=1,`.wrangler.lunora-remote.${String(process.pid)}.${String(c)}.jsonc`),w=e=>{if(!e.enabled)return{cleanup:i,enabled:!1,remoteBindings:[]};const r=m(e.projectRoot);if(!r)return{cleanup:i,enabled:!0,reason:"wrangler.jsonc not found",remoteBindings:[]};const{parsed:n,text:a}=b(r);if(n===void 0)return{cleanup:i,enabled:!0,reason:`failed to parse ${r} as JSONC`,remoteBindings:[]};const t=v(n);if(t.length===0)return{cleanup:i,enabled:!0,reason:"no remote-eligible bindings to proxy",remoteBindings:[]};const o=y(e.projectRoot,B());return d(o,R(a,t),"utf8"),{cleanup:S(o),configPath:o,enabled:!0,remoteBindings:t}},j=e=>{if(e===void 0)return!1;const r=e.trim().toLowerCase();return r==="1"||r==="true"},x=e=>e.flag===!0||j(e.envValue)?!0:e.configPreference??!1;export{u as REMOTE_ELIGIBLE_KEYS,R as injectRemoteFlags,j as isRemoteEnvEnabled,w as materializeRemoteWranglerConfig,v as planRemoteBindings,x as resolveRemoteEnabled};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{modify as p,applyEdits as r}from"jsonc-parser";const s={formattingOptions:{insertSpaces:!0,tabSize:4}},a=(t,i,n)=>{const o=p(t,[...i],n,s);return o.length>0?r(t,o):t};export{s as FORMATTING,a as applyModify};
|
package/dist/packem_shared/{collectExportGaps-BmEGzQQc.mjs → collectExportGaps-DUaEyDNw.mjs}
RENAMED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{readFileSync as R,writeFileSync as T}from"node:fs";import{containerBuildTag as M}from"@lunora/container";import{
|
|
1
|
+
import{readFileSync as R,writeFileSync as T}from"node:fs";import{containerBuildTag as M}from"@lunora/container";import{applyModify as _}from"./applyModify-DKP2l6S9.mjs";import{a as W,r as L}from"./lunora-manifest-V77OcyFC.mjs";import{parseTree as Q,findNodeAtLocation as K}from"jsonc-parser";import{join as U}from"node:path";import{DEV_VARS_FILE as Y,parseDevVariableEntries as F}from"./DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";import{o as q,s as k}from"./validate-bindings-D6-vb6if.mjs";import{findWranglerFile as G,readWranglerJsonc as H}from"./WRANGLER_FILES-UNW-xY5u.mjs";const J=[["maxBatchSize","max_batch_size"],["maxBatchTimeout","max_batch_timeout"],["maxRetries","max_retries"],["deadLetterQueue","dead_letter_queue"],["retryDelay","retry_delay"]],D=e=>Object.fromEntries(J.filter(([n])=>e.tuning[n]!==void 0).map(([n,s])=>[s,e.tuning[n]])),A="queueTuning",V=/^[\t ]*(?:,[\t ]*)?(?:\/\/[^\n\r]*)?\r?\n/u,z=/^[\t ]*,/u,X=(e,n)=>{const s=Q(e),t=s===void 0?void 0:K(s,[...n])?.parent;if(t?.type==="property"){const a=t.offset+t.length,o=e.lastIndexOf(`
|
|
2
2
|
`,t.offset-1)+1,c=V.exec(e.slice(a));if(c!==null&&e.slice(o,t.offset).trim()===""){const d=t.parent?.children??[],p=d.indexOf(t),r=p===d.length-1&&p>0?d[p-1]:void 0,l=r===void 0?void 0:z.exec(e.slice(r.offset+r.length))??void 0;return(l===void 0||r===void 0?e.slice(0,o):e.slice(0,r.offset+r.length)+e.slice(r.offset+r.length+l[0].length,o))+e.slice(a+c[0].length)}}return _(e,n,void 0)},I=(e,n,s,t,a,o=new Set)=>{const c=s.join("."),d={},p=[],r=[];let l=e;return{entries:n.map((u,f)=>{const g=t(u);if(g===void 0||u.queue===void 0)return u;const v=Object.fromEntries(Object.entries(D(g)).filter(([m])=>!o.has(m))),w=Object.entries(a[u.queue]??{}).filter(([m])=>!Object.hasOwn(v,m)),x=Object.entries(v).filter(([m,i])=>u[m]!==i),y=w.filter(([m,i])=>u[m]===i).map(([m])=>m),E=Object.fromEntries(Object.entries({...u,...v}).filter(([m])=>!y.includes(m)));for(const[m,i]of x)l=_(l,[...s,f,m],i);for(const m of y)l=X(l,[...s,f,m]);for(const[m,i]of w){const h=u[m];h!==void 0&&h!==i&&r.push(`${c}/${u.queue}: ${m} is no longer declared by defineQueue, but it was changed by hand to ${JSON.stringify(h)} from the declared ${JSON.stringify(i)}, so it was kept. Delete it from wrangler.jsonc if it should go.`)}return(x.length>0||y.length>0)&&p.push(`${c}/${u.queue} (${[...x.map(([m])=>m),...y.map(m=>`removed ${m}`)].join(", ")})`),Object.keys(v).length>0&&(d[u.queue]=v),E}),owned:d,text:l,updated:p,warnings:r}},Z=(e,n,s,t)=>{const a=n.queues??{},o=a.producers??[],c=a.consumers??[],d=new Set(o.map(g=>g.binding)),p=new Set(c.map(g=>g.queue)),r=s.filter(g=>!d.has(g.bindingName)),l=s.filter(g=>!p.has(g.name)),b=I(e,c,["queues","consumers"],g=>s.find(v=>v.name===g.queue),t);let u=b.text;const f={...b.owned};if(r.length>0||l.length>0){const g=[...o,...r.map(w=>({binding:w.bindingName,queue:w.name}))],v=[...b.entries,...l.map(w=>({queue:w.name,...w.mode==="pull"?{type:"http_pull"}:{},...D(w)}))];for(const w of l){const x=D(w);Object.keys(x).length>0&&(f[w.name]=x)}u=_(u,["queues"],{consumers:v,producers:g})}return{added:[...r.map(g=>`queues.producers/${g.bindingName}`),...l.map(g=>`queues.consumers/${g.name}`)],owned:f,text:u,updated:b.updated,warnings:b.warnings}},ee=(e,n,s,t,a)=>{const o=n.env?.[t],c=o?.queues?.consumers??[],d=o?.queues?.producers??[],p=u=>{const f=d.find(g=>g.queue===u.queue)?.binding;return f!==void 0?s.find(g=>g.bindingName===f):s.find(g=>g.name===u.queue&&!d.some(v=>v.binding===g.bindingName))},r=I(e,c,["env",t,"queues","consumers"],p,a,new Set(["dead_letter_queue"])),l=c.filter(u=>u.queue!==void 0&&p(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.`),b=c.flatMap(u=>{const f=p(u)?.tuning.deadLetterQueue;return f===void 0||u.dead_letter_queue!==void 0?[]:[`env.${t}.queues.consumers/${String(u.queue)}: defineQueue declares deadLetterQueue "${f}", 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:r.owned,text:r.text,updated:r.updated,warnings:[...r.warnings,...b,...l]}},ne=(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?.[A],t=a=>typeof a=="object"&&a!==null&&!Array.isArray(a);return s===void 0?{}:!t(s)||!Object.values(s).every(a=>t(a)&&Object.values(a).every(o=>t(o)))?(n.push(`${e?.path??"package.json"}: \`lunora.${A}\` 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},se=(e,n,s)=>{const t=Object.fromEntries(Object.entries({...n,...s}).filter(([,a])=>Object.keys(a).length>0));W(e,A,Object.keys(t).length===0?void 0:t)},S="PIPELINES",te=(e,n)=>{const s=e.flagshipBinding!==void 0&&!(n?.flagship??[]).some(o=>o.binding===e.flagshipBinding),t=e.usesPipelines&&!(n?.pipelines??[]).some(o=>o.binding===S);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 "${S}" pipelines binding exists; run 'wrangler pipelines create <name>' and add a 'pipelines' binding ({ binding: "${S}", pipeline }) — codegen resolves this one name, and the pipeline resource can't be auto-provisioned.`],[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(([o])=>o).map(([,o])=>o)},oe=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(([s])=>s).map(([,s])=>s),O=(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.`),ae=(e,n)=>{const s=new Set([...e.workflows,...e.agents].map(t=>t.className));return s.size===0?[]:(n.workflows??[]).flatMap(t=>{const a=t.class_name;return a===void 0||s.has(a)?[]:[`wrangler.jsonc declares workflows[] entry "${a}" but no defineWorkflow/defineAgent export generates that class — a leftover from a rename will fail the deploy (wrangler rejects a class_name the worker does not export). Remove it if it is not hand-wired.`]})},ie=(e,n)=>{if(e.queues.length===0)return[];const s=new Set(e.queues.map(a=>a.name)),t=new Set(e.queues.map(a=>a.bindingName));return[...(n.queues?.consumers??[]).flatMap(a=>{const{queue:o}=a;return o===void 0||s.has(o)?[]:[`wrangler.jsonc subscribes queues.consumers[] to "${o}" 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(a=>{const{binding:o}=a;return o===void 0||t.has(o)?[]:[`wrangler.jsonc declares queues.producers[] binding "${o}" but no defineQueue export declares it — a leftover from a rename. Remove it if it is not hand-wired.`]})]},re=(e,n)=>[...ae(e,n),...ie(e,n)],j=[{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=()=>j.map(({keys:e,label:n})=>`${e[0]} + ${e[1]} (${n})`).join(" or "),ce=e=>{let n;try{n=R(U(e,Y),"utf8")}catch{return!1}const s=new Map(F(n).map(t=>[t.key,t.value]));return j.some(({keys:t})=>t.every(a=>(s.get(a)??"")!==""))},N=(e,n,s)=>{const t=new Set(e.durableObjects.map(d=>d.className)),a=[],o=(s?.r2_buckets?.length??0)>0,c=(s?.d1_databases?.some(d=>d.binding==="DB")??!1)||e.needsD1;return e.usesStorage&&!o&&a.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")&&!c&&a.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")&&a.push("@lunora/scheduler is used but the worker entry exports no SchedulerDO; export it so the SCHEDULER binding can be provisioned."),a.push(...O("container","containers",e.containers),...O("workflow","workflows",e.workflows),...O("agent","agents",e.agents)),e.containers.length>0&&s?.observability?.enabled===!1&&a.push("containers are declared but observability is explicitly disabled in wrangler.jsonc — container logs will not be captured."),e.usesPayment&&!ce(n)&&a.push(`@lunora/payment is used; set one provider's secret pair in .dev.vars — ${de()}.`),a.push(...oe(e),...te(e,s)),s!==void 0&&a.push(...re(e,s)),a},P="<replace-with-d1-create-id>",ue=e=>[["container","containers",e.containers],["workflow","workflows",e.workflows],["agent","agents",e.agents]].flatMap(([s,t,a])=>a.filter(o=>!o.exported).map(({className:o,exportName:c})=>({className:o,exportName:c,kind:s,module:t}))),le=e=>{const n=new Set(q(e).map(t=>t.tag));let s=1;for(;n.has(`v${String(s)}`);)s+=1;return`v${String(s)}`},ge=e=>{const n=new Set;for(const s of q(e)){for(const t of k(s.deleted_classes))n.delete(t);for(const{from:t,to:a}of q(s.renamed_classes))t!==void 0&&n.delete(t),a!==void 0&&n.add(a);for(const t of[...k(s.new_classes),...k(s.new_sqlite_classes)])n.add(t)}return n},me=(e,n,s)=>{const t=n.durable_objects?.bindings??[],a=new Set(t.map(l=>l.name)),o=s.filter(l=>!a.has(l.binding));let c=e;const d=[];if(o.length>0){const l=[...t,...o.map(b=>({class_name:b.className,name:b.binding}))];c=_(c,["durable_objects","bindings"],l),d.push(...o.map(b=>`${b.binding}/${b.className}`))}const p=n.migrations??[],r=s.map(l=>l.className).filter(l=>!ge(p).has(l));if(r.length>0){const l=[...p,{new_sqlite_classes:r,tag:le(p)}];c=_(c,["migrations"],l)}return{added:d,text:c}},pe=(e,n)=>{const s=n.d1_databases??[];if(s.some(o=>o.binding==="DB"))return{added:[],text:e};const t=typeof n.name=="string"&&n.name.length>0?n.name:"lunora",a=[...s,{binding:"DB",database_id:P,database_name:t}];return{added:["DB (D1)"],text:_(e,["d1_databases"],a)}},$=(e,n,s,t,a)=>{const o=n[s]?.binding;return typeof o=="string"&&o.length>0?{added:[],text:e}:{added:[a],text:_(e,[s],{binding:t})}},be=(e,n)=>(n.analytics_engine_datasets?.length??0)>0?{added:[],text:e}:{added:["ANALYTICS (Analytics Engine)"],text:_(e,["analytics_engine_datasets"],[{binding:"ANALYTICS",dataset:"ANALYTICS"}])},he=(e,n)=>{const s=n.worker_loaders??[];return s.some(t=>t.binding==="LOADER")?{added:[],text:e}:{added:["LOADER (Worker Loader)"],text:_(e,["worker_loaders"],[...s,{binding:"LOADER"}])}},fe=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},ve=e=>e.image.kind==="dockerfile"?e.image.dockerfilePath:e.image.kind==="registry"?e.image.reference:M(e.exportName),we=e=>{const n={class_name:e.className,image:ve(e)};return e.image.kind==="dockerfile"&&(n.image_build_context=e.image.buildContext),e.buildArgs!==void 0&&e.image.kind!=="registry"&&(n.image_vars=e.buildArgs),e.instanceType!==void 0&&(n.instance_type=fe(e.instanceType)),e.maxInstances!==void 0&&(n.max_instances=e.maxInstances),e.name!==void 0&&(n.name=e.name),e.rollout?.stepPercentage!==void 0&&(n.rollout_step_percentage=e.rollout.stepPercentage),e.rollout?.gracePeriodSeconds!==void 0&&(n.rollout_active_grace_period=e.rollout.gracePeriodSeconds),n},_e=(e,n,s)=>{const t=n.containers??[],a=new Set(t.map(d=>d.class_name)),o=s.filter(d=>!a.has(d.className));if(o.length===0)return{added:[],text:e};const c=_(e,["containers"],[...t,...o.map(d=>we(d))]);return{added:o.map(d=>`containers/${d.className}`),text:c}},xe=(e,n)=>{if(n.observability!==void 0)return{added:[],text:e};const s=_(e,["observability"],{enabled:!0,head_sampling_rate:1});return{added:["observability"],text:s}},B=e=>({binding:e.bindingName,class_name:e.className,name:e.name}),ye=(e,n,s,t=[])=>{const a=n.workflows??[],o=new Set(a.map(r=>r.class_name)),c=s.filter(r=>!o.has(r.className)),d=t.filter(r=>!o.has(r.className));if(c.length===0&&d.length===0)return{added:[],text:e};const p=_(e,["workflows"],[...a,...c.map(r=>B(r)),...d.map(r=>B(r))]);return{added:[...c.map(r=>`workflows/${r.className}`),...d.map(r=>`workflows/${r.className}`)],text:p}},Ce=(e,n,s)=>{const t=G(e),a=ue(n);if(!t)return{added:[],changed:!1,exportGaps:a,reason:"wrangler.jsonc not found",updated:[],warnings:N(n,e)};const{parsed:o,text:c}=H(t);if(o===void 0)return{added:[],changed:!1,exportGaps:a,reason:`failed to parse ${t} as JSONC`,updated:[],warnings:N(n,e),wranglerPath:t};const d=N(n,e,o);if(s!==void 0){const i=o.env?.[s]!==void 0;d.push(i?`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 p=n.containers.filter(i=>i.exported),r=n.agents.filter(i=>i.exported&&i.voice===!0&&i.voiceBindingName!==void 0&&i.voiceClassName!==void 0),l=[...n.durableObjects,...p.map(i=>({binding:i.bindingName,className:i.className})),...r.map(i=>({binding:i.voiceBindingName,className:i.voiceClassName}))],b=n.workflows.filter(i=>i.exported),u=n.agents.filter(i=>i.exported),f=L(e),g=ne(f,d),v={},w=[{enabled:!0,run:i=>me(i,o,l)},{enabled:n.needsD1,run:i=>pe(i,o)},{enabled:n.usesAi,run:i=>$(i,o,"ai","AI","AI (Workers AI)")},{enabled:n.usesBrowser,run:i=>$(i,o,"browser","BROWSER","BROWSER (Browser Rendering)")},{enabled:n.usesImages,run:i=>$(i,o,"images","IMAGES","IMAGES (Cloudflare Images)")},{enabled:n.usesAnalytics,run:i=>be(i,o)},{enabled:n.usesWorkerLoader,run:i=>he(i,o)},{enabled:!0,run:i=>xe(i,o)},{enabled:p.length>0,run:i=>_e(i,o,p)},{enabled:b.length>0||u.length>0,run:i=>ye(i,o,b,u)},{enabled:n.queues.length>0,run:i=>{const h=Z(i,o,n.queues,g.queues??{});return v.queues=h.owned,h}},...s===void 0||o.env?.[s]===void 0?[]:[{enabled:n.queues.length>0,run:i=>{const h=`env.${s}.queues`,C=ee(i,o,n.queues,s,g[h]??{});return v[h]=C.owned,C}}]];let x=c;const y=[],E=[];for(const i of w){if(!i.enabled)continue;const h=i.run(x);x=h.text,y.push(...h.added),E.push(...h.updated??[]),d.push(...h.warnings??[])}const m=i=>{if(!(f===void 0||Object.keys(v).length===0))try{se(f,g,v)}catch(h){d.push(`${i?"wrangler.jsonc was updated, but ":""}recording the queue tuning reconcile owns in ${f.path} (lunora.queueTuning) failed: ${h instanceof Error?h.message:String(h)}. Until it is recorded, an option removed from defineQueue stays deployed.`)}};return y.includes("DB (D1)")&&d.push(`wrote a DB binding with a placeholder database_id ("${P}") — run \`wrangler d1 create <name>\` and replace it before deploying.`),x===c?(m(!1),{added:[],changed:!1,exportGaps:a,reason:"bindings already in sync",updated:[],warnings:d,wranglerPath:t}):(T(t,x,"utf8"),m(!0),{added:y,changed:!0,exportGaps:a,updated:E,warnings:d,wranglerPath:t})};export{ue as collectExportGaps,Ce as reconcileWranglerBindings};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{inferLunoraBindings as d}from"./inferLunoraBindings-GaAITuz-.mjs";import{LUNORA_TAG as r}from"./LUNORA_TAG-CiQM3BkI.mjs";import{reconcileWranglerBindings as f}from"./collectExportGaps-
|
|
1
|
+
import{inferLunoraBindings as d}from"./inferLunoraBindings-GaAITuz-.mjs";import{LUNORA_TAG as r}from"./LUNORA_TAG-CiQM3BkI.mjs";import{reconcileWranglerBindings as f}from"./collectExportGaps-DUaEyDNw.mjs";import{reconcileWranglerCompatibilityDate as p}from"./reconcileWranglerCompatibilityDate-hocXEuRA.mjs";import{reconcileWranglerCrons as g,describePreservedCrons as $}from"./describePreservedCrons-Ci5r2aph.mjs";const b=async(i,a,t)=>{try{const n=await d({projectRoot:i.projectRoot,schemaDir:i.schemaDir}),e=f(i.projectRoot,n),o=e.wranglerPath??"wrangler.jsonc";e.added.length>0&&a.info?.(`${r} inferred bindings → ${e.added.join(", ")} (written to ${o})`),e.updated.length>0&&a.info?.(`${r} updated bindings → ${e.updated.join(", ")} (written to ${o})`);for(const s of e.warnings)a.warn(`${r} ${s}`);e.exportGaps.length>0&&t?.(e.exportGaps)}catch(n){const e=n instanceof Error?n.message:String(n);a.warn(`${r} binding inference skipped: ${e}`)}},c=new Map,j=(i,a,t)=>{try{const n=g(i,a);n.changed&&t.info?.(`${r} synced ${a.length.toFixed(0)} cron trigger(s) into ${n.wranglerPath??"wrangler.jsonc"}`);for(const s of n.warnings)t.warn(`${r} ${s}`);const e=n.preserved.join("\0"),o=$(n.preserved);o!==void 0&&(n.changed||c.get(i)!==e)&&t.info?.(`${r} ${o}`),c.set(i,e)}catch(n){const e=n instanceof Error?n.message:String(n);t.warn(`${r} cron trigger sync skipped: ${e}`)}try{const n=p(i);n.changed&&t.info?.(`${r} bumped compatibility_date to ${n.date??"unknown"} (Workers Cache enabled) → ${n.wranglerPath??"wrangler.jsonc"}`)}catch(n){const e=n instanceof Error?n.message:String(n);t.warn(`${r} compatibility date sync skipped: ${e}`)}};export{b as reconcileBindingsSafely,j as reconcileWranglerExtras};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{writeFileSync as d}from"node:fs";import{modify as c,applyEdits as l}from"jsonc-parser";import{FORMATTING as s}from"./applyModify-DKP2l6S9.mjs";import{isCacheEnabled as f,WORKERS_CACHE_MIN_DATE as a}from"./WORKERS_CACHE_MIN_DATE-0k9ABJtF.mjs";import{findWranglerFile as m,readWranglerJsonc as p}from"./WRANGLER_FILES-UNW-xY5u.mjs";const _=i=>{const e=m(i);if(!e)return{changed:!1,date:void 0,reason:"wrangler.jsonc not found"};const{parsed:r,text:n}=p(e);if(r===void 0)return{changed:!1,date:void 0,reason:`failed to parse ${e} as JSONC`,wranglerPath:e};const t=r.compatibility_date??"";if(!f(r))return{changed:!1,date:t||void 0,reason:"cache not enabled",wranglerPath:e};if(t>=a)return{changed:!1,date:t,reason:`compatibility_date already >= ${a}`,wranglerPath:e};const o=c(n,["compatibility_date"],a,s);return o.length===0?{changed:!1,date:t||void 0,reason:"no structural edit produced",wranglerPath:e}:(d(e,l(n,o),"utf8"),{changed:!0,date:a,wranglerPath:e})};export{_ as reconcileWranglerCompatibilityDate};
|
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.285",
|
|
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.240",
|
|
58
58
|
"@lunora/container": "1.0.0-alpha.63",
|
|
59
59
|
"@lunora/errors": "1.0.0-alpha.47",
|
|
60
|
-
"@lunora/seed": "1.0.0-alpha.
|
|
60
|
+
"@lunora/seed": "1.0.0-alpha.170",
|
|
61
61
|
"@visulima/colorize": "2.1.1",
|
|
62
62
|
"@visulima/find-ai-runner": "1.0.2",
|
|
63
63
|
"@visulima/package": "5.0.20",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{writeFileSync as d,rmSync as f}from"node:fs";import{a as g}from"./jsonc-edit-BZgQIdAH.mjs";import{findWranglerFile as m,readWranglerJsonc as b}from"./WRANGLER_FILES-UNW-xY5u.mjs";import{join as y}from"node:path";const u={ai:{label:"AI",shape:"object"},d1_databases:{label:"D1",shape:"array"},kv_namespaces:{label:"KV",shape:"array"},queues:{label:"Queue",shape:"producers"},r2_buckets:{label:"R2",shape:"array"},services:{label:"Service",shape:"array"},vectorize:{label:"Vectorize",shape:"array"}},h=Object.keys(u),p=(e,r)=>typeof e.binding=="string"?e.binding:r,l=(e,r,n,a)=>{const t=[];for(const[o,s]of r.entries())s!=null&&t.push({binding:p(s,`#${String(o)}`),kind:n,path:[...a,o],section:e});return t},E=(e,r)=>{const{label:n,shape:a}=u[e];if(a==="array"){const o=r[e]??[];return l(e,o,n,[])}if(a==="producers")return l(e,r.queues?.producers??[],n,["producers"]);const t=r.ai;return t==null?[]:[{binding:p(t,e),kind:n,path:[],section:e}]},v=e=>h.flatMap(r=>E(r,e)),R=(e,r)=>{let n=e;for(const a of r)n=g(n,[a.section,...a.path,"remote"],!0);return n},i=()=>{},S=e=>{let r=!1;return()=>{if(!r){r=!0;try{f(e,{force:!0,recursive:!0})}catch{}}}};let c=0;const B=()=>(c+=1,`.wrangler.lunora-remote.${String(process.pid)}.${String(c)}.jsonc`),w=e=>{if(!e.enabled)return{cleanup:i,enabled:!1,remoteBindings:[]};const r=m(e.projectRoot);if(!r)return{cleanup:i,enabled:!0,reason:"wrangler.jsonc not found",remoteBindings:[]};const{parsed:n,text:a}=b(r);if(n===void 0)return{cleanup:i,enabled:!0,reason:`failed to parse ${r} as JSONC`,remoteBindings:[]};const t=v(n);if(t.length===0)return{cleanup:i,enabled:!0,reason:"no remote-eligible bindings to proxy",remoteBindings:[]};const o=y(e.projectRoot,B());return d(o,R(a,t),"utf8"),{cleanup:S(o),configPath:o,enabled:!0,remoteBindings:t}},j=e=>{if(e===void 0)return!1;const r=e.trim().toLowerCase();return r==="1"||r==="true"},x=e=>e.flag===!0||j(e.envValue)?!0:e.configPreference??!1;export{u as REMOTE_ELIGIBLE_KEYS,R as injectRemoteFlags,j as isRemoteEnvEnabled,w as materializeRemoteWranglerConfig,v as planRemoteBindings,x as resolveRemoteEnabled};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{modify as a,applyEdits as n}from"jsonc-parser";const p={formattingOptions:{insertSpaces:!0,tabSize:4}},e=(t,s,i)=>{const o=a(t,[...s],i,p);return o.length>0?n(t,o):t};export{p as F,e as a};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{writeFileSync as d}from"node:fs";import{modify as c,applyEdits as s}from"jsonc-parser";import{F as l}from"./jsonc-edit-BZgQIdAH.mjs";import{isCacheEnabled as f,WORKERS_CACHE_MIN_DATE as a}from"./WORKERS_CACHE_MIN_DATE-0k9ABJtF.mjs";import{findWranglerFile as m,readWranglerJsonc as p}from"./WRANGLER_FILES-UNW-xY5u.mjs";const _=i=>{const e=m(i);if(!e)return{changed:!1,date:void 0,reason:"wrangler.jsonc not found"};const{parsed:r,text:n}=p(e);if(r===void 0)return{changed:!1,date:void 0,reason:`failed to parse ${e} as JSONC`,wranglerPath:e};const t=r.compatibility_date??"";if(!f(r))return{changed:!1,date:t||void 0,reason:"cache not enabled",wranglerPath:e};if(t>=a)return{changed:!1,date:t,reason:`compatibility_date already >= ${a}`,wranglerPath:e};const o=c(n,["compatibility_date"],a,l);return o.length===0?{changed:!1,date:t||void 0,reason:"no structural edit produced",wranglerPath:e}:(d(e,s(n,o),"utf8"),{changed:!0,date:a,wranglerPath:e})};export{_ as reconcileWranglerCompatibilityDate};
|