@lunora/config 1.0.0-alpha.117 → 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 +21 -8
- package/dist/cloudflare/index.d.ts +21 -8
- package/dist/cloudflare/index.mjs +1 -1
- package/dist/index.d.mts +6 -6
- package/dist/index.d.ts +6 -6
- 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/dist/packem_shared/{policy-scaffold.d-CFd2FlqG.d.ts → policy-scaffold.d-fV3db0S_.d.mts} +2 -2
- package/dist/packem_shared/{policy-scaffold.d-CFd2FlqG.d.mts → policy-scaffold.d-fV3db0S_.d.ts} +2 -2
- package/dist/studio-host/index.d.mts +1 -1
- package/dist/studio-host/index.d.ts +1 -1
- package/package.json +5 -5
- 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
|
*
|
|
@@ -264,16 +277,16 @@ interface ReconcileBindingsResult {
|
|
|
264
277
|
* config already satisfies the inferred needs.
|
|
265
278
|
*
|
|
266
279
|
* `environment`, when passed, does NOT change where this writes — every step
|
|
267
|
-
* below still only touches the TOP-LEVEL config; wrangler's `env
|
|
280
|
+
* below still only touches the TOP-LEVEL config; wrangler's `env.<name>`
|
|
268
281
|
* blocks have no auto-provisioning path today. It is used only to emit an
|
|
269
282
|
* advisory warning, because bindings (`durable_objects`, `d1_databases`, …)
|
|
270
283
|
* are non-inheritable (see `wrangler-validator.ts`'s `NON_INHERITABLE_KEYS`):
|
|
271
284
|
* a `--env production` deploy needs its OWN copy of each one, and silently
|
|
272
285
|
* writing only to the top level would leave that gap unmentioned. Extending
|
|
273
|
-
* the JSONC writer itself to target `env
|
|
286
|
+
* the JSONC writer itself to target `env.<name>.*` idempotently for every
|
|
274
287
|
* binding kind here is a separate, larger change (each of the ~10 pipeline
|
|
275
288
|
* steps below reads AND writes the top-level path) that this fix does not
|
|
276
|
-
* attempt — `lunora deploy --env
|
|
289
|
+
* attempt — `lunora deploy --env <name>` now VALIDATES the env-scoped view
|
|
277
290
|
* (closing the reported gap), it just doesn't yet auto-provision it.
|
|
278
291
|
*/
|
|
279
292
|
declare const reconcileWranglerBindings: (projectRoot: string, inferred: InferredBindings, environment?: string) => ReconcileBindingsResult;
|
|
@@ -441,7 +454,7 @@ interface MaterializeResult {
|
|
|
441
454
|
}
|
|
442
455
|
/**
|
|
443
456
|
* Produce a temporary wrangler config with `"remote": true` on every eligible
|
|
444
|
-
* binding, so `lunora dev` can run `wrangler dev --config
|
|
457
|
+
* binding, so `lunora dev` can run `wrangler dev --config <temp>` against the
|
|
445
458
|
* deployed D1/KV/R2 without touching the user's file.
|
|
446
459
|
*
|
|
447
460
|
* The temp file is written as a sibling of the source `wrangler.jsonc` (in the
|
|
@@ -548,7 +561,7 @@ declare const scanWranglerVariablesForSecrets: (variables: Record<string, unknow
|
|
|
548
561
|
* for the `plaintext_secret_in_wrangler_vars` lint. Returns `[]` when there is no
|
|
549
562
|
* wrangler config, it doesn't parse, or nothing looks like a secret. Scans the
|
|
550
563
|
* top-level `vars` block (mirroring the existing `validateCorsVariables` scope);
|
|
551
|
-
* per-environment `env
|
|
564
|
+
* per-environment `env.<name>.vars` overrides are out of scope for now.
|
|
552
565
|
*/
|
|
553
566
|
declare const collectWranglerSecretVariables: (projectRoot: string) => WranglerVariableIR[];
|
|
554
567
|
declare const REQUIRED_COMPATIBILITY_DATE: string;
|
|
@@ -737,7 +750,7 @@ declare const withTailConsumer: (wrangler: WranglerConfig, consumer: TailConsume
|
|
|
737
750
|
* Pure validator: given a parsed `WranglerConfig` object and an optional
|
|
738
751
|
* `SchemaInfo`, produce a structured report. Performs no I/O.
|
|
739
752
|
*
|
|
740
|
-
* `environment`, when set, validates the `env
|
|
753
|
+
* `environment`, when set, validates the `env.<environment>` view
|
|
741
754
|
* ({@link mergeWranglerEnvironment}) instead of the top-level config — e.g. a
|
|
742
755
|
* `durable_objects` binding present only at the top level is a validation
|
|
743
756
|
* FAILURE for `--env production` if `env.production` doesn't repeat it,
|
|
@@ -753,7 +766,7 @@ declare const validateWranglerConfig: (wranglerInput: WranglerConfig | undefined
|
|
|
753
766
|
declare const validateWrangler: typeof validateWranglerConfig;
|
|
754
767
|
interface WranglerProjectValidationOptions {
|
|
755
768
|
/**
|
|
756
|
-
* Cloudflare environment to validate against `env
|
|
769
|
+
* Cloudflare environment to validate against `env.<name>` in
|
|
757
770
|
* wrangler.jsonc. See {@link mergeWranglerEnvironment} for which keys
|
|
758
771
|
* inherit the top-level value vs must be redeclared per environment.
|
|
759
772
|
* Omit to validate the top-level config only (unchanged default).
|
|
@@ -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
|
*
|
|
@@ -264,16 +277,16 @@ interface ReconcileBindingsResult {
|
|
|
264
277
|
* config already satisfies the inferred needs.
|
|
265
278
|
*
|
|
266
279
|
* `environment`, when passed, does NOT change where this writes — every step
|
|
267
|
-
* below still only touches the TOP-LEVEL config; wrangler's `env
|
|
280
|
+
* below still only touches the TOP-LEVEL config; wrangler's `env.<name>`
|
|
268
281
|
* blocks have no auto-provisioning path today. It is used only to emit an
|
|
269
282
|
* advisory warning, because bindings (`durable_objects`, `d1_databases`, …)
|
|
270
283
|
* are non-inheritable (see `wrangler-validator.ts`'s `NON_INHERITABLE_KEYS`):
|
|
271
284
|
* a `--env production` deploy needs its OWN copy of each one, and silently
|
|
272
285
|
* writing only to the top level would leave that gap unmentioned. Extending
|
|
273
|
-
* the JSONC writer itself to target `env
|
|
286
|
+
* the JSONC writer itself to target `env.<name>.*` idempotently for every
|
|
274
287
|
* binding kind here is a separate, larger change (each of the ~10 pipeline
|
|
275
288
|
* steps below reads AND writes the top-level path) that this fix does not
|
|
276
|
-
* attempt — `lunora deploy --env
|
|
289
|
+
* attempt — `lunora deploy --env <name>` now VALIDATES the env-scoped view
|
|
277
290
|
* (closing the reported gap), it just doesn't yet auto-provision it.
|
|
278
291
|
*/
|
|
279
292
|
declare const reconcileWranglerBindings: (projectRoot: string, inferred: InferredBindings, environment?: string) => ReconcileBindingsResult;
|
|
@@ -441,7 +454,7 @@ interface MaterializeResult {
|
|
|
441
454
|
}
|
|
442
455
|
/**
|
|
443
456
|
* Produce a temporary wrangler config with `"remote": true` on every eligible
|
|
444
|
-
* binding, so `lunora dev` can run `wrangler dev --config
|
|
457
|
+
* binding, so `lunora dev` can run `wrangler dev --config <temp>` against the
|
|
445
458
|
* deployed D1/KV/R2 without touching the user's file.
|
|
446
459
|
*
|
|
447
460
|
* The temp file is written as a sibling of the source `wrangler.jsonc` (in the
|
|
@@ -548,7 +561,7 @@ declare const scanWranglerVariablesForSecrets: (variables: Record<string, unknow
|
|
|
548
561
|
* for the `plaintext_secret_in_wrangler_vars` lint. Returns `[]` when there is no
|
|
549
562
|
* wrangler config, it doesn't parse, or nothing looks like a secret. Scans the
|
|
550
563
|
* top-level `vars` block (mirroring the existing `validateCorsVariables` scope);
|
|
551
|
-
* per-environment `env
|
|
564
|
+
* per-environment `env.<name>.vars` overrides are out of scope for now.
|
|
552
565
|
*/
|
|
553
566
|
declare const collectWranglerSecretVariables: (projectRoot: string) => WranglerVariableIR[];
|
|
554
567
|
declare const REQUIRED_COMPATIBILITY_DATE: string;
|
|
@@ -737,7 +750,7 @@ declare const withTailConsumer: (wrangler: WranglerConfig, consumer: TailConsume
|
|
|
737
750
|
* Pure validator: given a parsed `WranglerConfig` object and an optional
|
|
738
751
|
* `SchemaInfo`, produce a structured report. Performs no I/O.
|
|
739
752
|
*
|
|
740
|
-
* `environment`, when set, validates the `env
|
|
753
|
+
* `environment`, when set, validates the `env.<environment>` view
|
|
741
754
|
* ({@link mergeWranglerEnvironment}) instead of the top-level config — e.g. a
|
|
742
755
|
* `durable_objects` binding present only at the top level is a validation
|
|
743
756
|
* FAILURE for `--env production` if `env.production` doesn't repeat it,
|
|
@@ -753,7 +766,7 @@ declare const validateWranglerConfig: (wranglerInput: WranglerConfig | undefined
|
|
|
753
766
|
declare const validateWrangler: typeof validateWranglerConfig;
|
|
754
767
|
interface WranglerProjectValidationOptions {
|
|
755
768
|
/**
|
|
756
|
-
* Cloudflare environment to validate against `env
|
|
769
|
+
* Cloudflare environment to validate against `env.<name>` in
|
|
757
770
|
* wrangler.jsonc. See {@link mergeWranglerEnvironment} for which keys
|
|
758
771
|
* inherit the top-level value vs must be redeclared per environment.
|
|
759
772
|
* Omit to validate the top-level config only (unchanged default).
|
|
@@ -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.d.mts
CHANGED
|
@@ -4,7 +4,7 @@ import { Writable } from 'node:stream';
|
|
|
4
4
|
import { D as DeployDriver } from "./packem_shared/schema-info.d-DS0bUsWE.mjs";
|
|
5
5
|
export { type a as DeployRequest, type b as DevRequest, type c as DiscoverSchemaInfoResult, type d as DriverContext, type e as DriverToolchain, type f as InferOptions, type g as InferredAgent, type I as InferredBindings, type h as InferredContainer, type i as InferredWorkflow, type N as NamedResource, type P as ProvisionResult, type R as ResourceGraph, type S as SchemaInfo, type j as SecretRequest, type k as ShardNamespaceResource, type T as TailRequest, type l as ToolchainCommand, m as discoverSchemaInfo, n as inferLunoraBindings, p as packageNamesFromBindings } from "./packem_shared/schema-info.d-DS0bUsWE.mjs";
|
|
6
6
|
import 'ts-morph';
|
|
7
|
-
export { type A as AdditivePolicyEdit, type D as DestructivePolicyEdit, type P as PolicyEdit, type a as PolicyScaffoldFailureReason, type b as ScaffoldFileResult, type S as ScaffoldPolicyEdit, type c as WireResult, type W as WireRlsEdit, d as classifyPolicyEdit, s as scaffoldPolicyFile, w as wireRlsIntoProcedure } from "./packem_shared/policy-scaffold.d-
|
|
7
|
+
export { type A as AdditivePolicyEdit, type D as DestructivePolicyEdit, type P as PolicyEdit, type a as PolicyScaffoldFailureReason, type b as ScaffoldFileResult, type S as ScaffoldPolicyEdit, type c as WireResult, type W as WireRlsEdit, d as classifyPolicyEdit, s as scaffoldPolicyFile, w as wireRlsIntoProcedure } from "./packem_shared/policy-scaffold.d-fV3db0S_.mjs";
|
|
8
8
|
interface DiscoverAgentInfoResult {
|
|
9
9
|
/** Discovered agent definitions; `[]` when none are declared or parsing failed. */
|
|
10
10
|
agents: ReadonlyArray<AgentIR>;
|
|
@@ -99,9 +99,9 @@ interface AgentRulesStatus {
|
|
|
99
99
|
* still counts as installed and isn't nagged.
|
|
100
100
|
*/
|
|
101
101
|
readonly installed: boolean;
|
|
102
|
-
/** Skill names with no `SKILL.md` under
|
|
102
|
+
/** Skill names with no `SKILL.md` under `<root>/.agents/skills/<name>/`. */
|
|
103
103
|
readonly missing: ReadonlyArray<string>;
|
|
104
|
-
/** Skill names found under
|
|
104
|
+
/** Skill names found under `<root>/.agents/skills/<name>/SKILL.md`. */
|
|
105
105
|
readonly present: ReadonlyArray<string>;
|
|
106
106
|
}
|
|
107
107
|
/**
|
|
@@ -116,7 +116,7 @@ declare const detectAgentRules: (projectRoot: string) => AgentRulesStatus;
|
|
|
116
116
|
type ContainerLogLevel = "error" | "info";
|
|
117
117
|
/** One declared container to follow, identified by the names codegen lifts from `defineContainer`. */
|
|
118
118
|
interface ContainerLogSource {
|
|
119
|
-
/** Generated Durable Object class name, e.g. `TranscoderContainer`. Wrangler's dev image is `cloudflare-dev
|
|
119
|
+
/** Generated Durable Object class name, e.g. `TranscoderContainer`. Wrangler's dev image is `cloudflare-dev/<lowercased>`. */
|
|
120
120
|
className: string;
|
|
121
121
|
/** The `lunora/containers.ts` export name, e.g. `transcoder` — used as the display tag. */
|
|
122
122
|
exportName: string;
|
|
@@ -401,7 +401,7 @@ declare const LINKED_PROJECT_FILE: string;
|
|
|
401
401
|
interface LinkedProject {
|
|
402
402
|
/** Cloudflare account id the worker lives under, when known. */
|
|
403
403
|
account?: string;
|
|
404
|
-
/** Cloudflare environment name (`wrangler … --env
|
|
404
|
+
/** Cloudflare environment name (`wrangler … --env <env>`), when scoped. */
|
|
405
405
|
env?: string;
|
|
406
406
|
/** ISO-8601 timestamp recorded when the link was written. */
|
|
407
407
|
linkedAt?: string;
|
|
@@ -1004,7 +1004,7 @@ type ParseSchemaResult = {
|
|
|
1004
1004
|
declare const parseSchema: (source: string) => ParseSchemaResult;
|
|
1005
1005
|
/**
|
|
1006
1006
|
* A badge: the short colored label that prefixes a line. `bg`/`fg` are hex so the
|
|
1007
|
-
* same value drives both colorize's `bgHex().hex()` and the tui
|
|
1007
|
+
* same value drives both colorize's `bgHex().hex()` and the tui `<Text>` props.
|
|
1008
1008
|
*/
|
|
1009
1009
|
interface BadgeSpec {
|
|
1010
1010
|
bg: `#${string}`;
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { Writable } from 'node:stream';
|
|
|
4
4
|
import { D as DeployDriver } from "./packem_shared/schema-info.d-DS0bUsWE.js";
|
|
5
5
|
export { type a as DeployRequest, type b as DevRequest, type c as DiscoverSchemaInfoResult, type d as DriverContext, type e as DriverToolchain, type f as InferOptions, type g as InferredAgent, type I as InferredBindings, type h as InferredContainer, type i as InferredWorkflow, type N as NamedResource, type P as ProvisionResult, type R as ResourceGraph, type S as SchemaInfo, type j as SecretRequest, type k as ShardNamespaceResource, type T as TailRequest, type l as ToolchainCommand, m as discoverSchemaInfo, n as inferLunoraBindings, p as packageNamesFromBindings } from "./packem_shared/schema-info.d-DS0bUsWE.js";
|
|
6
6
|
import 'ts-morph';
|
|
7
|
-
export { type A as AdditivePolicyEdit, type D as DestructivePolicyEdit, type P as PolicyEdit, type a as PolicyScaffoldFailureReason, type b as ScaffoldFileResult, type S as ScaffoldPolicyEdit, type c as WireResult, type W as WireRlsEdit, d as classifyPolicyEdit, s as scaffoldPolicyFile, w as wireRlsIntoProcedure } from "./packem_shared/policy-scaffold.d-
|
|
7
|
+
export { type A as AdditivePolicyEdit, type D as DestructivePolicyEdit, type P as PolicyEdit, type a as PolicyScaffoldFailureReason, type b as ScaffoldFileResult, type S as ScaffoldPolicyEdit, type c as WireResult, type W as WireRlsEdit, d as classifyPolicyEdit, s as scaffoldPolicyFile, w as wireRlsIntoProcedure } from "./packem_shared/policy-scaffold.d-fV3db0S_.js";
|
|
8
8
|
interface DiscoverAgentInfoResult {
|
|
9
9
|
/** Discovered agent definitions; `[]` when none are declared or parsing failed. */
|
|
10
10
|
agents: ReadonlyArray<AgentIR>;
|
|
@@ -99,9 +99,9 @@ interface AgentRulesStatus {
|
|
|
99
99
|
* still counts as installed and isn't nagged.
|
|
100
100
|
*/
|
|
101
101
|
readonly installed: boolean;
|
|
102
|
-
/** Skill names with no `SKILL.md` under
|
|
102
|
+
/** Skill names with no `SKILL.md` under `<root>/.agents/skills/<name>/`. */
|
|
103
103
|
readonly missing: ReadonlyArray<string>;
|
|
104
|
-
/** Skill names found under
|
|
104
|
+
/** Skill names found under `<root>/.agents/skills/<name>/SKILL.md`. */
|
|
105
105
|
readonly present: ReadonlyArray<string>;
|
|
106
106
|
}
|
|
107
107
|
/**
|
|
@@ -116,7 +116,7 @@ declare const detectAgentRules: (projectRoot: string) => AgentRulesStatus;
|
|
|
116
116
|
type ContainerLogLevel = "error" | "info";
|
|
117
117
|
/** One declared container to follow, identified by the names codegen lifts from `defineContainer`. */
|
|
118
118
|
interface ContainerLogSource {
|
|
119
|
-
/** Generated Durable Object class name, e.g. `TranscoderContainer`. Wrangler's dev image is `cloudflare-dev
|
|
119
|
+
/** Generated Durable Object class name, e.g. `TranscoderContainer`. Wrangler's dev image is `cloudflare-dev/<lowercased>`. */
|
|
120
120
|
className: string;
|
|
121
121
|
/** The `lunora/containers.ts` export name, e.g. `transcoder` — used as the display tag. */
|
|
122
122
|
exportName: string;
|
|
@@ -401,7 +401,7 @@ declare const LINKED_PROJECT_FILE: string;
|
|
|
401
401
|
interface LinkedProject {
|
|
402
402
|
/** Cloudflare account id the worker lives under, when known. */
|
|
403
403
|
account?: string;
|
|
404
|
-
/** Cloudflare environment name (`wrangler … --env
|
|
404
|
+
/** Cloudflare environment name (`wrangler … --env <env>`), when scoped. */
|
|
405
405
|
env?: string;
|
|
406
406
|
/** ISO-8601 timestamp recorded when the link was written. */
|
|
407
407
|
linkedAt?: string;
|
|
@@ -1004,7 +1004,7 @@ type ParseSchemaResult = {
|
|
|
1004
1004
|
declare const parseSchema: (source: string) => ParseSchemaResult;
|
|
1005
1005
|
/**
|
|
1006
1006
|
* A badge: the short colored label that prefixes a line. `bg`/`fg` are hex so the
|
|
1007
|
-
* same value drives both colorize's `bgHex().hex()` and the tui
|
|
1007
|
+
* same value drives both colorize's `bgHex().hex()` and the tui `<Text>` props.
|
|
1008
1008
|
*/
|
|
1009
1009
|
interface BadgeSpec {
|
|
1010
1010
|
bg: `#${string}`;
|
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/dist/packem_shared/{policy-scaffold.d-CFd2FlqG.d.ts → policy-scaffold.d-fV3db0S_.d.mts}
RENAMED
|
@@ -9,7 +9,7 @@ interface ScaffoldPolicyEdit {
|
|
|
9
9
|
/** Logical table the scaffolded policy guards (used in the stub body). */
|
|
10
10
|
readonly table: string;
|
|
11
11
|
}
|
|
12
|
-
/** Append `.use(rls(
|
|
12
|
+
/** Append `.use(rls(<policies>))` to an existing procedure's builder chain. */
|
|
13
13
|
interface WireRlsEdit {
|
|
14
14
|
/** Exported procedure name to wire, e.g. `listInvoices`. */
|
|
15
15
|
readonly exportName: string;
|
|
@@ -64,7 +64,7 @@ type WireResult = {
|
|
|
64
64
|
*/
|
|
65
65
|
declare const scaffoldPolicyFile: (edit: ScaffoldPolicyEdit) => ScaffoldFileResult;
|
|
66
66
|
/**
|
|
67
|
-
* Append `.use(rls(
|
|
67
|
+
* Append `.use(rls(<policies>))` to a procedure's builder chain, preserving the
|
|
68
68
|
* terminal `.query(handler)` (and its handler body) byte-for-byte. Only the
|
|
69
69
|
* **builder** form can be wired; the bare-factory form (`query({ handler })`)
|
|
70
70
|
* has no chain and is reported `unsupported-procedure-shape` so the editor can
|
package/dist/packem_shared/{policy-scaffold.d-CFd2FlqG.d.mts → policy-scaffold.d-fV3db0S_.d.ts}
RENAMED
|
@@ -9,7 +9,7 @@ interface ScaffoldPolicyEdit {
|
|
|
9
9
|
/** Logical table the scaffolded policy guards (used in the stub body). */
|
|
10
10
|
readonly table: string;
|
|
11
11
|
}
|
|
12
|
-
/** Append `.use(rls(
|
|
12
|
+
/** Append `.use(rls(<policies>))` to an existing procedure's builder chain. */
|
|
13
13
|
interface WireRlsEdit {
|
|
14
14
|
/** Exported procedure name to wire, e.g. `listInvoices`. */
|
|
15
15
|
readonly exportName: string;
|
|
@@ -64,7 +64,7 @@ type WireResult = {
|
|
|
64
64
|
*/
|
|
65
65
|
declare const scaffoldPolicyFile: (edit: ScaffoldPolicyEdit) => ScaffoldFileResult;
|
|
66
66
|
/**
|
|
67
|
-
* Append `.use(rls(
|
|
67
|
+
* Append `.use(rls(<policies>))` to a procedure's builder chain, preserving the
|
|
68
68
|
* terminal `.query(handler)` (and its handler body) byte-for-byte. Only the
|
|
69
69
|
* **builder** form can be wired; the bare-factory form (`query({ handler })`)
|
|
70
70
|
* has no chain and is reported `unsupported-procedure-shape` so the editor can
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as DestructivePolicyEdit, S as ScaffoldPolicyEdit, W as WireRlsEdit } from "../packem_shared/policy-scaffold.d-
|
|
1
|
+
import { D as DestructivePolicyEdit, S as ScaffoldPolicyEdit, W as WireRlsEdit } from "../packem_shared/policy-scaffold.d-fV3db0S_.mjs";
|
|
2
2
|
import { IncomingMessage, ServerResponse } from 'node:http';
|
|
3
3
|
/**
|
|
4
4
|
* Parse a single `KEY=value` (optionally quoted) out of a `.dev.vars` body,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D as DestructivePolicyEdit, S as ScaffoldPolicyEdit, W as WireRlsEdit } from "../packem_shared/policy-scaffold.d-
|
|
1
|
+
import { D as DestructivePolicyEdit, S as ScaffoldPolicyEdit, W as WireRlsEdit } from "../packem_shared/policy-scaffold.d-fV3db0S_.js";
|
|
2
2
|
import { IncomingMessage, ServerResponse } from 'node:http';
|
|
3
3
|
/**
|
|
4
4
|
* Parse a single `KEY=value` (optionally quoted) out of a `.dev.vars` body,
|
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.119",
|
|
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.
|
|
58
|
-
"@lunora/container": "1.0.0-alpha.
|
|
59
|
-
"@lunora/errors": "1.0.0-alpha.
|
|
60
|
-
"@lunora/seed": "1.0.0-alpha.
|
|
57
|
+
"@lunora/codegen": "1.0.0-alpha.90",
|
|
58
|
+
"@lunora/container": "1.0.0-alpha.23",
|
|
59
|
+
"@lunora/errors": "1.0.0-alpha.14",
|
|
60
|
+
"@lunora/seed": "1.0.0-alpha.62",
|
|
61
61
|
"@visulima/colorize": "2.0.0",
|
|
62
62
|
"@visulima/find-ai-runner": "1.0.0",
|
|
63
63
|
"dockerode": "^5.0.1",
|
|
@@ -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};
|