@lunora/config 1.0.0-alpha.349 → 1.0.0-alpha.350

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.
Files changed (25) hide show
  1. package/dist/cloudflare/index.d.mts +1 -1
  2. package/dist/cloudflare/index.d.ts +1 -1
  3. package/dist/cloudflare/index.mjs +1 -1
  4. package/dist/index.d.mts +5 -11
  5. package/dist/index.d.ts +5 -11
  6. package/dist/index.mjs +1 -1
  7. package/dist/packem_shared/CLOUDFLARE_DRIVER-CULavrYO.mjs +1 -0
  8. package/dist/packem_shared/{DEFAULT_DEPLOY_TARGET-CfoV0tDu.mjs → DEFAULT_DEPLOY_TARGET-rR7buNQw.mjs} +1 -1
  9. package/dist/packem_shared/{UNEXPORTED_CLASS_MARKER-IAK9PiDz.mjs → UNEXPORTED_CLASS_MARKER-DwJCN8fX.mjs} +1 -1
  10. package/dist/packem_shared/{assertWranglerSatisfiesSchema-Dy0WXvP8.mjs → assertWranglerSatisfiesSchema-Dd7ZPhw7.mjs} +1 -1
  11. package/dist/packem_shared/{collectExportGaps-BfnHx4y3.mjs → collectExportGaps-BPuhGH2J.mjs} +1 -1
  12. package/dist/packem_shared/createDiscoveryCache-npJI4uej.mjs +1 -0
  13. package/dist/packem_shared/discoverContainerInfo-DzXr7Vm3.mjs +1 -0
  14. package/dist/packem_shared/discoverSchemaInfo-BBRlXZop.mjs +1 -0
  15. package/dist/packem_shared/infer-bindings-C1NFOdMi.mjs +1 -0
  16. package/dist/packem_shared/{infer-bindings.d-RLlCg7Zn.d.mts → infer-bindings.d-CFxssIAC.d.mts} +21 -8
  17. package/dist/packem_shared/{infer-bindings.d-RLlCg7Zn.d.ts → infer-bindings.d-CFxssIAC.d.ts} +21 -8
  18. package/dist/packem_shared/{inferLunoraBindings-BCWWtftG.mjs → inferLunoraBindings-Gp_7yyIo.mjs} +1 -1
  19. package/dist/packem_shared/{interpretRemote-C9yJC_ZK.mjs → interpretRemote-CcmGeGZ_.mjs} +1 -1
  20. package/dist/packem_shared/{reconcileBindingsSafely-Ck6LaDO-.mjs → reconcileBindingsSafely-7IJ58Uit.mjs} +1 -1
  21. package/package.json +4 -4
  22. package/dist/packem_shared/CLOUDFLARE_DRIVER-Ci3VIqnk.mjs +0 -1
  23. package/dist/packem_shared/discoverContainerInfo-MI3HIHmJ.mjs +0 -1
  24. package/dist/packem_shared/discoverSchemaInfo-BLe1EVI8.mjs +0 -1
  25. package/dist/packem_shared/infer-bindings-BsgN5eCm.mjs +0 -1
@@ -1,4 +1,4 @@
1
- import { D as DeployDriver, G as GeneratedClassModule, I as InferredBindings, S as SchemaInfo } from "../packem_shared/infer-bindings.d-RLlCg7Zn.mjs";
1
+ import { D as DeployDriver, G as GeneratedClassModule, I as InferredBindings, S as SchemaInfo } from "../packem_shared/infer-bindings.d-CFxssIAC.mjs";
2
2
  import { WranglerQueueProducerIR, WranglerVariableIR } from '@lunora/codegen';
3
3
  /** Apply one structural jsonc edit and return the rewritten text (a no-op edit returns the input). */
4
4
  declare const applyModify: (text: string, path: ReadonlyArray<number | string>, value: unknown) => string;
@@ -1,4 +1,4 @@
1
- import { D as DeployDriver, G as GeneratedClassModule, I as InferredBindings, S as SchemaInfo } from "../packem_shared/infer-bindings.d-RLlCg7Zn.js";
1
+ import { D as DeployDriver, G as GeneratedClassModule, I as InferredBindings, S as SchemaInfo } from "../packem_shared/infer-bindings.d-CFxssIAC.js";
2
2
  import { WranglerQueueProducerIR, WranglerVariableIR } from '@lunora/codegen';
3
3
  /** Apply one structural jsonc edit and return the rewritten text (a no-op edit returns the input). */
4
4
  declare const applyModify: (text: string, path: ReadonlyArray<number | string>, value: unknown) => string;
@@ -1 +1 @@
1
- import{applyModify as o}from"../packem_shared/applyModify-DKP2l6S9.mjs";import{assertWranglerSatisfiesSchema as l}from"../packem_shared/assertWranglerSatisfiesSchema-Dy0WXvP8.mjs";import{BINDING_MANIFEST_VERSION as i,buildBindingManifest as n}from"../packem_shared/BINDING_MANIFEST_VERSION-CfXEYG8e.mjs";import{CLOUDFLARE_CLI_CONFIG_WARNING_ENV as m,detectCloudflareCliConfig as E,warnCloudflareCliConfigOnce as s}from"../packem_shared/CLOUDFLARE_CLI_CONFIG_WARNING_ENV-BKMrOuXV.mjs";import{default as C}from"../packem_shared/CLOUDFLARE_DRIVER-Ci3VIqnk.mjs";import{default as g}from"../packem_shared/GLOBAL_FETCH_STRICTLY_PUBLIC_FLAG-f8CnJha3.mjs";import{hasCloudflareCredentials as R}from"../packem_shared/hasCloudflareCredentials-byvHpEiD.mjs";import{describeWithheldWorkersAi as _,withheldWorkersAi as I}from"../packem_shared/describeWithheldWorkersAi-IIxe3TuI.mjs";import{collectExportGaps as A,reconcileWranglerBindings as W}from"../packem_shared/collectExportGaps-BfnHx4y3.mjs";import{reconcileWranglerCompatibilityDate as O}from"../packem_shared/reconcileWranglerCompatibilityDate-hocXEuRA.mjs";import{describePreservedCrons as D,reconcileWranglerCrons as F}from"../packem_shared/describePreservedCrons-C5KPuPy3.mjs";import{reconcileBindingsSafely as v,reconcileWranglerExtras as B}from"../packem_shared/reconcileBindingsSafely-Ck6LaDO-.mjs";import{REMOTE_ELIGIBLE_KEYS as h,injectRemoteFlags as u,isRemoteEnvEnabled as G,materializeDevWranglerConfig as U,planRemoteBindings as M,resolveRemoteEnabled as y}from"../packem_shared/REMOTE_ELIGIBLE_KEYS-PLeh_74E.mjs";import{materializeServiceDevConfigs as w}from"../packem_shared/materializeServiceDevConfigs-DLUHefD-.mjs";import{default as Y}from"../packem_shared/CLOUDFLARE_TOOLCHAIN_VERSIONS-DV5E_f_q.mjs";import{withTailConsumer as K}from"../packem_shared/withTailConsumer-DngzpJMK.mjs";import{WORKERS_CACHE_MIN_DATE as k,isCacheEnabled as z}from"../packem_shared/WORKERS_CACHE_MIN_DATE-0k9ABJtF.mjs";import{wranglerCodegenInputs as J}from"../packem_shared/wranglerCodegenInputs-CbisphsH.mjs";import{DEFAULT_OBSERVABILITY as q,resolveObservabilitySampling as Z}from"../packem_shared/DEFAULT_OBSERVABILITY-bN6UkTMx.mjs";import{mergeWranglerEnvironment as ee}from"../packem_shared/mergeWranglerEnvironment-DXiB-HcS.mjs";import{WRANGLER_FILES as oe,findWranglerFile as ae,readWranglerJsonc as le}from"../packem_shared/WRANGLER_FILES-UNW-xY5u.mjs";import{UNEXPORTED_CLASS_MARKER as ie,validateWranglerProject as ne}from"../packem_shared/UNEXPORTED_CLASS_MARKER-IAK9PiDz.mjs";import{scanWranglerVariablesForSecrets as me}from"../packem_shared/scanWranglerVariablesForSecrets-BFTVje1q.mjs";import{wranglerToAlchemy as se}from"../packem_shared/wranglerToAlchemy-CBO2ucRm.mjs";import{REQUIRED_COMPATIBILITY_DATE as Ce,REQUIRED_FLAG as de,validateWrangler as ge,validateWranglerConfig as xe}from"../packem_shared/REQUIRED_COMPATIBILITY_DATE-OLQlG0oj.mjs";export{i as BINDING_MANIFEST_VERSION,m as CLOUDFLARE_CLI_CONFIG_WARNING_ENV,C as CLOUDFLARE_DRIVER,Y as CLOUDFLARE_TOOLCHAIN_VERSIONS,q as DEFAULT_OBSERVABILITY,g as GLOBAL_FETCH_STRICTLY_PUBLIC_FLAG,h as REMOTE_ELIGIBLE_KEYS,Ce as REQUIRED_COMPATIBILITY_DATE,de as REQUIRED_FLAG,ie as UNEXPORTED_CLASS_MARKER,k as WORKERS_CACHE_MIN_DATE,oe as WRANGLER_FILES,o as applyModify,l as assertWranglerSatisfiesSchema,n as buildBindingManifest,A as collectExportGaps,D as describePreservedCrons,_ as describeWithheldWorkersAi,E as detectCloudflareCliConfig,ae as findWranglerFile,R as hasCloudflareCredentials,u as injectRemoteFlags,z as isCacheEnabled,G as isRemoteEnvEnabled,U as materializeDevWranglerConfig,w as materializeServiceDevConfigs,ee as mergeWranglerEnvironment,M as planRemoteBindings,le as readWranglerJsonc,v as reconcileBindingsSafely,W as reconcileWranglerBindings,O as reconcileWranglerCompatibilityDate,F as reconcileWranglerCrons,B as reconcileWranglerExtras,Z as resolveObservabilitySampling,y as resolveRemoteEnabled,me as scanWranglerVariablesForSecrets,ge as validateWrangler,xe as validateWranglerConfig,ne as validateWranglerProject,s as warnCloudflareCliConfigOnce,K as withTailConsumer,I as withheldWorkersAi,J as wranglerCodegenInputs,se as wranglerToAlchemy};
1
+ import{applyModify as o}from"../packem_shared/applyModify-DKP2l6S9.mjs";import{assertWranglerSatisfiesSchema as l}from"../packem_shared/assertWranglerSatisfiesSchema-Dd7ZPhw7.mjs";import{BINDING_MANIFEST_VERSION as i,buildBindingManifest as n}from"../packem_shared/BINDING_MANIFEST_VERSION-CfXEYG8e.mjs";import{CLOUDFLARE_CLI_CONFIG_WARNING_ENV as m,detectCloudflareCliConfig as E,warnCloudflareCliConfigOnce as s}from"../packem_shared/CLOUDFLARE_CLI_CONFIG_WARNING_ENV-BKMrOuXV.mjs";import{default as C}from"../packem_shared/CLOUDFLARE_DRIVER-CULavrYO.mjs";import{default as g}from"../packem_shared/GLOBAL_FETCH_STRICTLY_PUBLIC_FLAG-f8CnJha3.mjs";import{hasCloudflareCredentials as R}from"../packem_shared/hasCloudflareCredentials-byvHpEiD.mjs";import{describeWithheldWorkersAi as _,withheldWorkersAi as I}from"../packem_shared/describeWithheldWorkersAi-IIxe3TuI.mjs";import{collectExportGaps as A,reconcileWranglerBindings as W}from"../packem_shared/collectExportGaps-BPuhGH2J.mjs";import{reconcileWranglerCompatibilityDate as O}from"../packem_shared/reconcileWranglerCompatibilityDate-hocXEuRA.mjs";import{describePreservedCrons as D,reconcileWranglerCrons as F}from"../packem_shared/describePreservedCrons-C5KPuPy3.mjs";import{reconcileBindingsSafely as v,reconcileWranglerExtras as B}from"../packem_shared/reconcileBindingsSafely-7IJ58Uit.mjs";import{REMOTE_ELIGIBLE_KEYS as h,injectRemoteFlags as u,isRemoteEnvEnabled as G,materializeDevWranglerConfig as U,planRemoteBindings as M,resolveRemoteEnabled as y}from"../packem_shared/REMOTE_ELIGIBLE_KEYS-PLeh_74E.mjs";import{materializeServiceDevConfigs as w}from"../packem_shared/materializeServiceDevConfigs-DLUHefD-.mjs";import{default as Y}from"../packem_shared/CLOUDFLARE_TOOLCHAIN_VERSIONS-DV5E_f_q.mjs";import{withTailConsumer as K}from"../packem_shared/withTailConsumer-DngzpJMK.mjs";import{WORKERS_CACHE_MIN_DATE as k,isCacheEnabled as z}from"../packem_shared/WORKERS_CACHE_MIN_DATE-0k9ABJtF.mjs";import{wranglerCodegenInputs as J}from"../packem_shared/wranglerCodegenInputs-CbisphsH.mjs";import{DEFAULT_OBSERVABILITY as q,resolveObservabilitySampling as Z}from"../packem_shared/DEFAULT_OBSERVABILITY-bN6UkTMx.mjs";import{mergeWranglerEnvironment as ee}from"../packem_shared/mergeWranglerEnvironment-DXiB-HcS.mjs";import{WRANGLER_FILES as oe,findWranglerFile as ae,readWranglerJsonc as le}from"../packem_shared/WRANGLER_FILES-UNW-xY5u.mjs";import{UNEXPORTED_CLASS_MARKER as ie,validateWranglerProject as ne}from"../packem_shared/UNEXPORTED_CLASS_MARKER-DwJCN8fX.mjs";import{scanWranglerVariablesForSecrets as me}from"../packem_shared/scanWranglerVariablesForSecrets-BFTVje1q.mjs";import{wranglerToAlchemy as se}from"../packem_shared/wranglerToAlchemy-CBO2ucRm.mjs";import{REQUIRED_COMPATIBILITY_DATE as Ce,REQUIRED_FLAG as de,validateWrangler as ge,validateWranglerConfig as xe}from"../packem_shared/REQUIRED_COMPATIBILITY_DATE-OLQlG0oj.mjs";export{i as BINDING_MANIFEST_VERSION,m as CLOUDFLARE_CLI_CONFIG_WARNING_ENV,C as CLOUDFLARE_DRIVER,Y as CLOUDFLARE_TOOLCHAIN_VERSIONS,q as DEFAULT_OBSERVABILITY,g as GLOBAL_FETCH_STRICTLY_PUBLIC_FLAG,h as REMOTE_ELIGIBLE_KEYS,Ce as REQUIRED_COMPATIBILITY_DATE,de as REQUIRED_FLAG,ie as UNEXPORTED_CLASS_MARKER,k as WORKERS_CACHE_MIN_DATE,oe as WRANGLER_FILES,o as applyModify,l as assertWranglerSatisfiesSchema,n as buildBindingManifest,A as collectExportGaps,D as describePreservedCrons,_ as describeWithheldWorkersAi,E as detectCloudflareCliConfig,ae as findWranglerFile,R as hasCloudflareCredentials,u as injectRemoteFlags,z as isCacheEnabled,G as isRemoteEnvEnabled,U as materializeDevWranglerConfig,w as materializeServiceDevConfigs,ee as mergeWranglerEnvironment,M as planRemoteBindings,le as readWranglerJsonc,v as reconcileBindingsSafely,W as reconcileWranglerBindings,O as reconcileWranglerCompatibilityDate,F as reconcileWranglerCrons,B as reconcileWranglerExtras,Z as resolveObservabilitySampling,y as resolveRemoteEnabled,me as scanWranglerVariablesForSecrets,ge as validateWrangler,xe as validateWranglerConfig,ne as validateWranglerProject,s as warnCloudflareCliConfigOnce,K as withTailConsumer,I as withheldWorkersAi,J as wranglerCodegenInputs,se as wranglerToAlchemy};
package/dist/index.d.mts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { AgentIR, ContainerIR, WorkflowIR, CodegenResult } from '@lunora/codegen';
2
2
  export type { AgentIR, ContainerIR, WorkflowIR } from '@lunora/codegen';
3
3
  import { ChildProcess } from 'node:child_process';
4
+ import { a as DiscoveryCache, T as ToolchainCommand, D as DeployDriver, P as ProjectionPurpose } from "./packem_shared/infer-bindings.d-CFxssIAC.mjs";
5
+ export { C as COMPOSED_WORKER_ENTRY, b as DURABLE_OBJECT_BINDINGS, type c as DeployRequest, type d as DevRequest, type e as DiscoverSchemaInfoResult, type f as DriverToolchain, g as GENERATED_CLASS_MODULES, h as GENERATED_MODULE_DURABLE_OBJECTS, type G as GeneratedClassModule, type i as InferOptions, type j as InferredAgent, type I as InferredBindings, type k as InferredContainer, type l as InferredWorkflow, M as MERGED_DURABLE_OBJECTS_MODULE, type m as ProjectedConfig, type S as SchemaInfo, type n as SecretRequest, type o as TailRequest, p as createDiscoveryCache, q as discoverSchemaInfo, r as inferLunoraBindings, s as isMergedProject, t as isMergedRoleModule, u as secretSourcesFromBindings } from "./packem_shared/infer-bindings.d-CFxssIAC.mjs";
4
6
  import { Writable } from 'node:stream';
5
- import { T as ToolchainCommand, D as DeployDriver, P as ProjectionPurpose } from "./packem_shared/infer-bindings.d-RLlCg7Zn.mjs";
6
- export { C as COMPOSED_WORKER_ENTRY, a as DURABLE_OBJECT_BINDINGS, type b as DeployRequest, type c as DevRequest, type d as DiscoverSchemaInfoResult, type e as DriverToolchain, f as GENERATED_CLASS_MODULES, g as GENERATED_MODULE_DURABLE_OBJECTS, type G as GeneratedClassModule, type h as InferOptions, type i as InferredAgent, type I as InferredBindings, type j as InferredContainer, type k as InferredWorkflow, M as MERGED_DURABLE_OBJECTS_MODULE, type l as ProjectedConfig, type S as SchemaInfo, type m as SecretRequest, type n as TailRequest, o as discoverSchemaInfo, p as inferLunoraBindings, q as isMergedProject, r as isMergedRoleModule, s as secretSourcesFromBindings } from "./packem_shared/infer-bindings.d-RLlCg7Zn.mjs";
7
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, r as resolveServerModule, s as scaffoldPolicyFile, w as wireRlsIntoProcedure } from "./packem_shared/policy-scaffold.d-D2H4_G01.mjs";
8
8
  interface DiscoverAgentInfoResult {
9
9
  /** Discovered agent definitions; `[]` when none are declared or parsing failed. */
@@ -24,14 +24,8 @@ interface DiscoverContainerInfoResult {
24
24
  /** Parse error message, when `lunora/containers.ts` exists but could not be analyzed. */
25
25
  error?: string;
26
26
  }
27
- /**
28
- * Discover the project's `defineContainer` declarations. Returns
29
- * `{ containers: [] }` when the project has no `lunora/containers.ts` (not an
30
- * error), or `{ containers: [], error }` when the file exists but could not be
31
- * parsed — callers decide whether that is a warning (validator) or ignorable
32
- * (inference).
33
- */
34
- declare const discoverContainerInfo: (projectRoot: string, schemaDirectory: string) => DiscoverContainerInfoResult;
27
+ /** Discover the container facts, memoised on `cache` when one is given. */
28
+ declare const discoverContainerInfo: (projectRoot: string, schemaDirectory: string, cache?: DiscoveryCache) => DiscoverContainerInfoResult;
35
29
  interface DiscoverWorkflowInfoResult {
36
30
  /** Parse error message, when `lunora/workflows.ts` exists but could not be analyzed. */
37
31
  error?: string;
@@ -1456,4 +1450,4 @@ declare const badgeWidth: (_spec: BadgeSpec) => number;
1456
1450
  declare const paintBadge: (spec: BadgeSpec) => string;
1457
1451
  /** Dim continuation text (a step's chosen answer, shown under the question). */
1458
1452
  declare const paintAnswer: (text: string) => string;
1459
- export { ACCENT, AGENT_MODE_ENV, AGENT_RULES_DIR, AGENT_RULES_HINT, AGENT_RULES_HINT_ENV, type AddIndexEdit, type AddOptionalColumnEdit, type AddTableEdit, type AdditiveEdit, type AgentDetection, type AgentRulesStatus, type ApplyEditResult, type ApplyFailureReason, type AugmentPlan, BADGES, BADGE_COLUMN_WIDTH, type BadgeName, type BadgeSpec, CODEGEN_ENV, type CelldDevSession, type CelldDevSessionOptions, type CelldLineOrigin, type ClaimDevServerStateResult, type ContainerLogLevel, type ContainerLogLine, type ContainerLogSource, type ContainerLogStreamHandle, type ContainerLogStreamOptions, DEFAULT_DEPLOY_TARGET, DEV_BINDINGS_FILE, DEV_DAEMON_ENV, DEV_HANDOFF_ENV, DEV_LOG_FILE, DEV_LOG_FILE_ENV, DEV_STATE_DIR, DEV_STATE_FILE, DEV_VARS_EXAMPLE_FILE, DEV_VARS_FILE, DEV_VARS_KEY_PATTERN, DEV_WORKER_ENV_VALUE, DEV_WORKER_ENV_VAR, type DeployDriver, type DestructiveEdit, type DetectedFramework, type DevProcess, type DevProcessOptions, type DevProcessSpawner, type DevSecretsFillPlan, type DevServerMode, type DevServerState, type DiscoverAgentInfoResult, type DiscoverContainerInfoResult, type DiscoverWorkflowInfoResult, type DockerLike, type EnsureDevVariablesDeps, type EnsureDevVariablesResult, type EnsureDevVariablesStatus, type FillDevSecretsResult, type FindingLogger, type FrameworkClass, type FrameworkDetection, type HookLogger, type HookSpawnDescriptor, type HookSpawner, LINKED_PROJECT_DIR, LINKED_PROJECT_FILE, LUNA_ART, LUNA_BUNNY, LUNA_NAME, LUNA_SIGNOFF, LUNORA_EVENT_SOURCE, LUNORA_IGNORED_PATHS, LUNORA_SKILL_NAMES, LUNORA_TAG, type LevelBadgeName, type LinkedProject, type LintIgnoreOutcome, type LintIgnoreStatus, type LintTool, type LunoraFormattedLine, type LunoraLineLevel, LunoraReporter, type MultiSelectOption, PACKAGE_SECRETS_REGISTRY, type PackageManager, type PackageManagerProbe, type ParseSchemaResult, type PostCodegenHookResult, type ProjectionPurpose, ROOT_SKILL_NAME, type RemotePreference, STEP_BADGE_NAMES, type ScaffoldPlan, type SchemaColumn, type SchemaEdit, type SchemaIndex, type SchemaTable, type SecretEntry, type SelectOption, type StepBadgeName, type ToolchainCommand, type ToolchainInvocation, acceptsConnection, addArgsFor, advisoryLine, applyAdditiveEdit, applyLintIgnores, badgeLead, badgeWidth, blockingFindingsMessage, buildPackageSecretsBlock, claimAgentRulesHint, claimDevServerState, classifyEdit, clearDevServerState, createConfirm, deployTargetIds, detectAgentRules, detectAiAgent, detectFramework, detectInstalledManagers, detectLintTools, detectPackageManager, discoverAgentInfo, discoverContainerInfo, discoverWorkflowInfo, ensureDevVariables, ensureDevVariablesExample as ensureDevVarsExample, ensureDevWorkerEnv, escapeRegExp, execArgsFor, fillDevSecrets, formatLunoraEvent, generateSecretValue, installArgsFor, interpretRemote, isCodegenDisabled, isDevServerReady, isInteractive, isMintableSecretKey, isPlaceholderValue, isProcessAlive, isRecordedProcessCurrent, isRunnableTarget, lunoraLine, padBadge, paintAnswer, paintBadge, parseDevVariableEntries, parseSchema, planDevSecretsFill, planDevVariablesAugment, planDevVariablesScaffold, planToolchainInvocation, projectUsesUmbrella, promptMultiSelect, promptSelect, promptText, promptYesNo, readDevServerState, readLinkedProject, readLiveDevServerState, readProjectDependencies, readProjectDependencyNames, readProjectManifest, readProjectRemotePreference, readProjectTarget, removeDevVariableLine, reportCodegenFindings, requiredSecrets, resolveDeployDriver, resolveProjectTarget, resolveSchemaDirectory, resolveTargetOrThrow, runPostCodegenHook, runScriptArgsFor, runScriptCommand, runnableTargetIds, secretsForPackages, startCelldDevSession, startDevProcess, streamContainerLogs, targetRunsOwnDevServer, toolchainExecArgs, updateDevServerState, upsertDevVariableLine, writeDevServerState, writeDevVariablesFileAtomically, writeLinkedProject };
1453
+ export { ACCENT, AGENT_MODE_ENV, AGENT_RULES_DIR, AGENT_RULES_HINT, AGENT_RULES_HINT_ENV, type AddIndexEdit, type AddOptionalColumnEdit, type AddTableEdit, type AdditiveEdit, type AgentDetection, type AgentRulesStatus, type ApplyEditResult, type ApplyFailureReason, type AugmentPlan, BADGES, BADGE_COLUMN_WIDTH, type BadgeName, type BadgeSpec, CODEGEN_ENV, type CelldDevSession, type CelldDevSessionOptions, type CelldLineOrigin, type ClaimDevServerStateResult, type ContainerLogLevel, type ContainerLogLine, type ContainerLogSource, type ContainerLogStreamHandle, type ContainerLogStreamOptions, DEFAULT_DEPLOY_TARGET, DEV_BINDINGS_FILE, DEV_DAEMON_ENV, DEV_HANDOFF_ENV, DEV_LOG_FILE, DEV_LOG_FILE_ENV, DEV_STATE_DIR, DEV_STATE_FILE, DEV_VARS_EXAMPLE_FILE, DEV_VARS_FILE, DEV_VARS_KEY_PATTERN, DEV_WORKER_ENV_VALUE, DEV_WORKER_ENV_VAR, type DeployDriver, type DestructiveEdit, type DetectedFramework, type DevProcess, type DevProcessOptions, type DevProcessSpawner, type DevSecretsFillPlan, type DevServerMode, type DevServerState, type DiscoverAgentInfoResult, type DiscoverContainerInfoResult, type DiscoverWorkflowInfoResult, type DiscoveryCache, type DockerLike, type EnsureDevVariablesDeps, type EnsureDevVariablesResult, type EnsureDevVariablesStatus, type FillDevSecretsResult, type FindingLogger, type FrameworkClass, type FrameworkDetection, type HookLogger, type HookSpawnDescriptor, type HookSpawner, LINKED_PROJECT_DIR, LINKED_PROJECT_FILE, LUNA_ART, LUNA_BUNNY, LUNA_NAME, LUNA_SIGNOFF, LUNORA_EVENT_SOURCE, LUNORA_IGNORED_PATHS, LUNORA_SKILL_NAMES, LUNORA_TAG, type LevelBadgeName, type LinkedProject, type LintIgnoreOutcome, type LintIgnoreStatus, type LintTool, type LunoraFormattedLine, type LunoraLineLevel, LunoraReporter, type MultiSelectOption, PACKAGE_SECRETS_REGISTRY, type PackageManager, type PackageManagerProbe, type ParseSchemaResult, type PostCodegenHookResult, type ProjectionPurpose, ROOT_SKILL_NAME, type RemotePreference, STEP_BADGE_NAMES, type ScaffoldPlan, type SchemaColumn, type SchemaEdit, type SchemaIndex, type SchemaTable, type SecretEntry, type SelectOption, type StepBadgeName, type ToolchainCommand, type ToolchainInvocation, acceptsConnection, addArgsFor, advisoryLine, applyAdditiveEdit, applyLintIgnores, badgeLead, badgeWidth, blockingFindingsMessage, buildPackageSecretsBlock, claimAgentRulesHint, claimDevServerState, classifyEdit, clearDevServerState, createConfirm, deployTargetIds, detectAgentRules, detectAiAgent, detectFramework, detectInstalledManagers, detectLintTools, detectPackageManager, discoverAgentInfo, discoverContainerInfo, discoverWorkflowInfo, ensureDevVariables, ensureDevVariablesExample as ensureDevVarsExample, ensureDevWorkerEnv, escapeRegExp, execArgsFor, fillDevSecrets, formatLunoraEvent, generateSecretValue, installArgsFor, interpretRemote, isCodegenDisabled, isDevServerReady, isInteractive, isMintableSecretKey, isPlaceholderValue, isProcessAlive, isRecordedProcessCurrent, isRunnableTarget, lunoraLine, padBadge, paintAnswer, paintBadge, parseDevVariableEntries, parseSchema, planDevSecretsFill, planDevVariablesAugment, planDevVariablesScaffold, planToolchainInvocation, projectUsesUmbrella, promptMultiSelect, promptSelect, promptText, promptYesNo, readDevServerState, readLinkedProject, readLiveDevServerState, readProjectDependencies, readProjectDependencyNames, readProjectManifest, readProjectRemotePreference, readProjectTarget, removeDevVariableLine, reportCodegenFindings, requiredSecrets, resolveDeployDriver, resolveProjectTarget, resolveSchemaDirectory, resolveTargetOrThrow, runPostCodegenHook, runScriptArgsFor, runScriptCommand, runnableTargetIds, secretsForPackages, startCelldDevSession, startDevProcess, streamContainerLogs, targetRunsOwnDevServer, toolchainExecArgs, updateDevServerState, upsertDevVariableLine, writeDevServerState, writeDevVariablesFileAtomically, writeLinkedProject };
package/dist/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { AgentIR, ContainerIR, WorkflowIR, CodegenResult } from '@lunora/codegen';
2
2
  export type { AgentIR, ContainerIR, WorkflowIR } from '@lunora/codegen';
3
3
  import { ChildProcess } from 'node:child_process';
4
+ import { a as DiscoveryCache, T as ToolchainCommand, D as DeployDriver, P as ProjectionPurpose } from "./packem_shared/infer-bindings.d-CFxssIAC.js";
5
+ export { C as COMPOSED_WORKER_ENTRY, b as DURABLE_OBJECT_BINDINGS, type c as DeployRequest, type d as DevRequest, type e as DiscoverSchemaInfoResult, type f as DriverToolchain, g as GENERATED_CLASS_MODULES, h as GENERATED_MODULE_DURABLE_OBJECTS, type G as GeneratedClassModule, type i as InferOptions, type j as InferredAgent, type I as InferredBindings, type k as InferredContainer, type l as InferredWorkflow, M as MERGED_DURABLE_OBJECTS_MODULE, type m as ProjectedConfig, type S as SchemaInfo, type n as SecretRequest, type o as TailRequest, p as createDiscoveryCache, q as discoverSchemaInfo, r as inferLunoraBindings, s as isMergedProject, t as isMergedRoleModule, u as secretSourcesFromBindings } from "./packem_shared/infer-bindings.d-CFxssIAC.js";
4
6
  import { Writable } from 'node:stream';
5
- import { T as ToolchainCommand, D as DeployDriver, P as ProjectionPurpose } from "./packem_shared/infer-bindings.d-RLlCg7Zn.js";
6
- export { C as COMPOSED_WORKER_ENTRY, a as DURABLE_OBJECT_BINDINGS, type b as DeployRequest, type c as DevRequest, type d as DiscoverSchemaInfoResult, type e as DriverToolchain, f as GENERATED_CLASS_MODULES, g as GENERATED_MODULE_DURABLE_OBJECTS, type G as GeneratedClassModule, type h as InferOptions, type i as InferredAgent, type I as InferredBindings, type j as InferredContainer, type k as InferredWorkflow, M as MERGED_DURABLE_OBJECTS_MODULE, type l as ProjectedConfig, type S as SchemaInfo, type m as SecretRequest, type n as TailRequest, o as discoverSchemaInfo, p as inferLunoraBindings, q as isMergedProject, r as isMergedRoleModule, s as secretSourcesFromBindings } from "./packem_shared/infer-bindings.d-RLlCg7Zn.js";
7
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, r as resolveServerModule, s as scaffoldPolicyFile, w as wireRlsIntoProcedure } from "./packem_shared/policy-scaffold.d-D2H4_G01.js";
8
8
  interface DiscoverAgentInfoResult {
9
9
  /** Discovered agent definitions; `[]` when none are declared or parsing failed. */
@@ -24,14 +24,8 @@ interface DiscoverContainerInfoResult {
24
24
  /** Parse error message, when `lunora/containers.ts` exists but could not be analyzed. */
25
25
  error?: string;
26
26
  }
27
- /**
28
- * Discover the project's `defineContainer` declarations. Returns
29
- * `{ containers: [] }` when the project has no `lunora/containers.ts` (not an
30
- * error), or `{ containers: [], error }` when the file exists but could not be
31
- * parsed — callers decide whether that is a warning (validator) or ignorable
32
- * (inference).
33
- */
34
- declare const discoverContainerInfo: (projectRoot: string, schemaDirectory: string) => DiscoverContainerInfoResult;
27
+ /** Discover the container facts, memoised on `cache` when one is given. */
28
+ declare const discoverContainerInfo: (projectRoot: string, schemaDirectory: string, cache?: DiscoveryCache) => DiscoverContainerInfoResult;
35
29
  interface DiscoverWorkflowInfoResult {
36
30
  /** Parse error message, when `lunora/workflows.ts` exists but could not be analyzed. */
37
31
  error?: string;
@@ -1456,4 +1450,4 @@ declare const badgeWidth: (_spec: BadgeSpec) => number;
1456
1450
  declare const paintBadge: (spec: BadgeSpec) => string;
1457
1451
  /** Dim continuation text (a step's chosen answer, shown under the question). */
1458
1452
  declare const paintAnswer: (text: string) => string;
1459
- export { ACCENT, AGENT_MODE_ENV, AGENT_RULES_DIR, AGENT_RULES_HINT, AGENT_RULES_HINT_ENV, type AddIndexEdit, type AddOptionalColumnEdit, type AddTableEdit, type AdditiveEdit, type AgentDetection, type AgentRulesStatus, type ApplyEditResult, type ApplyFailureReason, type AugmentPlan, BADGES, BADGE_COLUMN_WIDTH, type BadgeName, type BadgeSpec, CODEGEN_ENV, type CelldDevSession, type CelldDevSessionOptions, type CelldLineOrigin, type ClaimDevServerStateResult, type ContainerLogLevel, type ContainerLogLine, type ContainerLogSource, type ContainerLogStreamHandle, type ContainerLogStreamOptions, DEFAULT_DEPLOY_TARGET, DEV_BINDINGS_FILE, DEV_DAEMON_ENV, DEV_HANDOFF_ENV, DEV_LOG_FILE, DEV_LOG_FILE_ENV, DEV_STATE_DIR, DEV_STATE_FILE, DEV_VARS_EXAMPLE_FILE, DEV_VARS_FILE, DEV_VARS_KEY_PATTERN, DEV_WORKER_ENV_VALUE, DEV_WORKER_ENV_VAR, type DeployDriver, type DestructiveEdit, type DetectedFramework, type DevProcess, type DevProcessOptions, type DevProcessSpawner, type DevSecretsFillPlan, type DevServerMode, type DevServerState, type DiscoverAgentInfoResult, type DiscoverContainerInfoResult, type DiscoverWorkflowInfoResult, type DockerLike, type EnsureDevVariablesDeps, type EnsureDevVariablesResult, type EnsureDevVariablesStatus, type FillDevSecretsResult, type FindingLogger, type FrameworkClass, type FrameworkDetection, type HookLogger, type HookSpawnDescriptor, type HookSpawner, LINKED_PROJECT_DIR, LINKED_PROJECT_FILE, LUNA_ART, LUNA_BUNNY, LUNA_NAME, LUNA_SIGNOFF, LUNORA_EVENT_SOURCE, LUNORA_IGNORED_PATHS, LUNORA_SKILL_NAMES, LUNORA_TAG, type LevelBadgeName, type LinkedProject, type LintIgnoreOutcome, type LintIgnoreStatus, type LintTool, type LunoraFormattedLine, type LunoraLineLevel, LunoraReporter, type MultiSelectOption, PACKAGE_SECRETS_REGISTRY, type PackageManager, type PackageManagerProbe, type ParseSchemaResult, type PostCodegenHookResult, type ProjectionPurpose, ROOT_SKILL_NAME, type RemotePreference, STEP_BADGE_NAMES, type ScaffoldPlan, type SchemaColumn, type SchemaEdit, type SchemaIndex, type SchemaTable, type SecretEntry, type SelectOption, type StepBadgeName, type ToolchainCommand, type ToolchainInvocation, acceptsConnection, addArgsFor, advisoryLine, applyAdditiveEdit, applyLintIgnores, badgeLead, badgeWidth, blockingFindingsMessage, buildPackageSecretsBlock, claimAgentRulesHint, claimDevServerState, classifyEdit, clearDevServerState, createConfirm, deployTargetIds, detectAgentRules, detectAiAgent, detectFramework, detectInstalledManagers, detectLintTools, detectPackageManager, discoverAgentInfo, discoverContainerInfo, discoverWorkflowInfo, ensureDevVariables, ensureDevVariablesExample as ensureDevVarsExample, ensureDevWorkerEnv, escapeRegExp, execArgsFor, fillDevSecrets, formatLunoraEvent, generateSecretValue, installArgsFor, interpretRemote, isCodegenDisabled, isDevServerReady, isInteractive, isMintableSecretKey, isPlaceholderValue, isProcessAlive, isRecordedProcessCurrent, isRunnableTarget, lunoraLine, padBadge, paintAnswer, paintBadge, parseDevVariableEntries, parseSchema, planDevSecretsFill, planDevVariablesAugment, planDevVariablesScaffold, planToolchainInvocation, projectUsesUmbrella, promptMultiSelect, promptSelect, promptText, promptYesNo, readDevServerState, readLinkedProject, readLiveDevServerState, readProjectDependencies, readProjectDependencyNames, readProjectManifest, readProjectRemotePreference, readProjectTarget, removeDevVariableLine, reportCodegenFindings, requiredSecrets, resolveDeployDriver, resolveProjectTarget, resolveSchemaDirectory, resolveTargetOrThrow, runPostCodegenHook, runScriptArgsFor, runScriptCommand, runnableTargetIds, secretsForPackages, startCelldDevSession, startDevProcess, streamContainerLogs, targetRunsOwnDevServer, toolchainExecArgs, updateDevServerState, upsertDevVariableLine, writeDevServerState, writeDevVariablesFileAtomically, writeLinkedProject };
1453
+ export { ACCENT, AGENT_MODE_ENV, AGENT_RULES_DIR, AGENT_RULES_HINT, AGENT_RULES_HINT_ENV, type AddIndexEdit, type AddOptionalColumnEdit, type AddTableEdit, type AdditiveEdit, type AgentDetection, type AgentRulesStatus, type ApplyEditResult, type ApplyFailureReason, type AugmentPlan, BADGES, BADGE_COLUMN_WIDTH, type BadgeName, type BadgeSpec, CODEGEN_ENV, type CelldDevSession, type CelldDevSessionOptions, type CelldLineOrigin, type ClaimDevServerStateResult, type ContainerLogLevel, type ContainerLogLine, type ContainerLogSource, type ContainerLogStreamHandle, type ContainerLogStreamOptions, DEFAULT_DEPLOY_TARGET, DEV_BINDINGS_FILE, DEV_DAEMON_ENV, DEV_HANDOFF_ENV, DEV_LOG_FILE, DEV_LOG_FILE_ENV, DEV_STATE_DIR, DEV_STATE_FILE, DEV_VARS_EXAMPLE_FILE, DEV_VARS_FILE, DEV_VARS_KEY_PATTERN, DEV_WORKER_ENV_VALUE, DEV_WORKER_ENV_VAR, type DeployDriver, type DestructiveEdit, type DetectedFramework, type DevProcess, type DevProcessOptions, type DevProcessSpawner, type DevSecretsFillPlan, type DevServerMode, type DevServerState, type DiscoverAgentInfoResult, type DiscoverContainerInfoResult, type DiscoverWorkflowInfoResult, type DiscoveryCache, type DockerLike, type EnsureDevVariablesDeps, type EnsureDevVariablesResult, type EnsureDevVariablesStatus, type FillDevSecretsResult, type FindingLogger, type FrameworkClass, type FrameworkDetection, type HookLogger, type HookSpawnDescriptor, type HookSpawner, LINKED_PROJECT_DIR, LINKED_PROJECT_FILE, LUNA_ART, LUNA_BUNNY, LUNA_NAME, LUNA_SIGNOFF, LUNORA_EVENT_SOURCE, LUNORA_IGNORED_PATHS, LUNORA_SKILL_NAMES, LUNORA_TAG, type LevelBadgeName, type LinkedProject, type LintIgnoreOutcome, type LintIgnoreStatus, type LintTool, type LunoraFormattedLine, type LunoraLineLevel, LunoraReporter, type MultiSelectOption, PACKAGE_SECRETS_REGISTRY, type PackageManager, type PackageManagerProbe, type ParseSchemaResult, type PostCodegenHookResult, type ProjectionPurpose, ROOT_SKILL_NAME, type RemotePreference, STEP_BADGE_NAMES, type ScaffoldPlan, type SchemaColumn, type SchemaEdit, type SchemaIndex, type SchemaTable, type SecretEntry, type SelectOption, type StepBadgeName, type ToolchainCommand, type ToolchainInvocation, acceptsConnection, addArgsFor, advisoryLine, applyAdditiveEdit, applyLintIgnores, badgeLead, badgeWidth, blockingFindingsMessage, buildPackageSecretsBlock, claimAgentRulesHint, claimDevServerState, classifyEdit, clearDevServerState, createConfirm, deployTargetIds, detectAgentRules, detectAiAgent, detectFramework, detectInstalledManagers, detectLintTools, detectPackageManager, discoverAgentInfo, discoverContainerInfo, discoverWorkflowInfo, ensureDevVariables, ensureDevVariablesExample as ensureDevVarsExample, ensureDevWorkerEnv, escapeRegExp, execArgsFor, fillDevSecrets, formatLunoraEvent, generateSecretValue, installArgsFor, interpretRemote, isCodegenDisabled, isDevServerReady, isInteractive, isMintableSecretKey, isPlaceholderValue, isProcessAlive, isRecordedProcessCurrent, isRunnableTarget, lunoraLine, padBadge, paintAnswer, paintBadge, parseDevVariableEntries, parseSchema, planDevSecretsFill, planDevVariablesAugment, planDevVariablesScaffold, planToolchainInvocation, projectUsesUmbrella, promptMultiSelect, promptSelect, promptText, promptYesNo, readDevServerState, readLinkedProject, readLiveDevServerState, readProjectDependencies, readProjectDependencyNames, readProjectManifest, readProjectRemotePreference, readProjectTarget, removeDevVariableLine, reportCodegenFindings, requiredSecrets, resolveDeployDriver, resolveProjectTarget, resolveSchemaDirectory, resolveTargetOrThrow, runPostCodegenHook, runScriptArgsFor, runScriptCommand, runnableTargetIds, secretsForPackages, startCelldDevSession, startDevProcess, streamContainerLogs, targetRunsOwnDevServer, toolchainExecArgs, updateDevServerState, upsertDevVariableLine, writeDevServerState, writeDevVariablesFileAtomically, writeLinkedProject };
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{AGENT_MODE_ENV as o,detectAiAgent as t}from"./packem_shared/AGENT_MODE_ENV-D8MvSwPE.mjs";import{discoverAgentInfo as E}from"./packem_shared/discoverAgentInfo-pqFMJBtJ.mjs";import{AGENT_RULES_DIR as i,AGENT_RULES_HINT as n,AGENT_RULES_HINT_ENV as _,LUNORA_SKILL_NAMES as l,ROOT_SKILL_NAME as c,claimAgentRulesHint as p,detectAgentRules as d}from"./packem_shared/AGENT_RULES_DIR-HrrbNZPy.mjs";import{startCelldDevSession as A}from"./packem_shared/startCelldDevSession-BLFsd6jG.mjs";import{CODEGEN_ENV as m,isCodegenDisabled as f}from"./packem_shared/CODEGEN_ENV-ZsCxV1kP.mjs";import{discoverContainerInfo as R}from"./packem_shared/discoverContainerInfo-MI3HIHmJ.mjs";import{streamContainerLogs as N}from"./packem_shared/streamContainerLogs-0nko1qpv.mjs";import{detectFramework as g,projectUsesUmbrella as x}from"./packem_shared/detectFramework-Dfpvu6rD.mjs";import{acceptsConnection as I,startDevProcess as O}from"./packem_shared/acceptsConnection-DHhUYGjT.mjs";import{DEV_BINDINGS_FILE as u,DEV_DAEMON_ENV as C,DEV_HANDOFF_ENV as F,DEV_LOG_FILE as U,DEV_LOG_FILE_ENV as M,DEV_STATE_DIR as G,DEV_STATE_FILE as B,claimDevServerState as b,clearDevServerState as y,isDevServerReady as k,isProcessAlive as j,isRecordedProcessCurrent as K,readDevServerState as w,readLiveDevServerState as h,updateDevServerState as H,writeDevServerState as W}from"./packem_shared/DEV_BINDINGS_FILE-C0ZN_XlP.mjs";import{DEV_VARS_EXAMPLE_FILE as J,DEV_VARS_FILE as q,DEV_VARS_KEY_PATTERN as X,escapeRegExp as z,parseDevVariableEntries as Q,removeDevVariableLine as Z,upsertDevVariableLine as $}from"./packem_shared/DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";import{DEV_WORKER_ENV_VALUE as re,DEV_WORKER_ENV_VAR as oe,ensureDevWorkerEnv as te}from"./packem_shared/DEV_WORKER_ENV_VALUE-2XFXmRrP.mjs";import{DEFAULT_DEPLOY_TARGET as Ee,deployTargetIds as se,isRunnableTarget as ie,planToolchainInvocation as ne,resolveDeployDriver as _e,runnableTargetIds as le,targetRunsOwnDevServer as ce}from"./packem_shared/DEFAULT_DEPLOY_TARGET-CfoV0tDu.mjs";import{i as de,s as De}from"./packem_shared/infer-bindings-BsgN5eCm.mjs";import{LINKED_PROJECT_DIR as Se,LINKED_PROJECT_FILE as me,readLinkedProject as fe,writeLinkedProject as Le}from"./packem_shared/LINKED_PROJECT_DIR-Ba5qPEwo.mjs";import{LUNORA_IGNORED_PATHS as ve,applyLintIgnores as Ne,detectLintTools as Te}from"./packem_shared/LUNORA_IGNORED_PATHS-U93uPxrW.mjs";import{LUNORA_TAG as xe,advisoryLine as Ve,blockingFindingsMessage as Ie,lunoraLine as Oe,reportCodegenFindings as Pe}from"./packem_shared/LUNORA_TAG-CiQM3BkI.mjs";import{LUNORA_EVENT_SOURCE as Ce,formatLunoraEvent as Fe}from"./packem_shared/LUNORA_EVENT_SOURCE-B9ZVohjO.mjs";import{default as Me}from"./packem_shared/LunoraReporter-f277GLNT.mjs";import{addArgsFor as Be,detectInstalledManagers as be,detectPackageManager as ye,execArgsFor as ke,installArgsFor as je,runScriptArgsFor as Ke,runScriptCommand as we,toolchainExecArgs as he}from"./packem_shared/addArgsFor-CYZKhNIo.mjs";import{P as We,s as Ye}from"./packem_shared/package-secrets-registry-BeheNwsP.mjs";import{runPostCodegenHook as qe}from"./packem_shared/runPostCodegenHook-Dx3yTsYZ.mjs";import{interpretRemote as ze,readProjectRemotePreference as Qe,readProjectTarget as Ze,resolveProjectTarget as $e,resolveTargetOrThrow as er}from"./packem_shared/interpretRemote-C9yJC_ZK.mjs";import{readProjectDependencies as or,readProjectDependencyNames as tr,readProjectManifest as ar}from"./packem_shared/readProjectDependencies-l3uhUKjo.mjs";import{createConfirm as sr,isInteractive as ir,promptMultiSelect as nr,promptSelect as _r,promptText as lr,promptYesNo as cr}from"./packem_shared/createConfirm-D5mKTMHj.mjs";import{default as dr}from"./packem_shared/resolveSchemaDirectory-Ca5P6KuP.mjs";import{buildPackageSecretsBlock as Ar,ensureDevVariables as Sr,ensureDevVarsExample as mr,fillDevSecrets as fr,generateSecretValue as Lr,isMintableSecretKey as Rr,isPlaceholderValue as vr,planDevSecretsFill as Nr,planDevVariablesAugment as Tr,planDevVariablesScaffold as gr,requiredSecrets as xr,writeDevVariablesFileAtomically as Vr}from"./packem_shared/buildPackageSecretsBlock-BWV_VxqV.mjs";import{applyAdditiveEdit as Or,classifyEdit as Pr}from"./packem_shared/applyAdditiveEdit-CH0VhMJ2.mjs";import{parseSchema as Cr}from"./packem_shared/parseSchema-D1Wbr1qv.mjs";import{classifyPolicyEdit as Ur,resolveServerModule as Mr,scaffoldPolicyFile as Gr,wireRlsIntoProcedure as Br}from"./packem_shared/classifyPolicyEdit-DJi9Fk8G.mjs";import{discoverSchemaInfo as yr}from"./packem_shared/discoverSchemaInfo-BLe1EVI8.mjs";import{ACCENT as jr,BADGES as Kr,BADGE_COLUMN_WIDTH as wr,LUNA_ART as hr,LUNA_BUNNY as Hr,LUNA_NAME as Wr,LUNA_SIGNOFF as Yr,STEP_BADGE_NAMES as Jr,badgeLead as qr,badgeWidth as Xr,padBadge as zr,paintAnswer as Qr,paintBadge as Zr}from"./packem_shared/ACCENT-CotPTfv7.mjs";import{COMPOSED_WORKER_ENTRY as eo,DURABLE_OBJECT_BINDINGS as ro,GENERATED_CLASS_MODULES as oo,GENERATED_MODULE_DURABLE_OBJECTS as to,MERGED_DURABLE_OBJECTS_MODULE as ao,isMergedProject as Eo,isMergedRoleModule as so}from"./packem_shared/COMPOSED_WORKER_ENTRY-Ciiba5g_.mjs";import{discoverWorkflowInfo as no}from"./packem_shared/discoverWorkflowInfo-zW7Tt0Tn.mjs";export{jr as ACCENT,o as AGENT_MODE_ENV,i as AGENT_RULES_DIR,n as AGENT_RULES_HINT,_ as AGENT_RULES_HINT_ENV,Kr as BADGES,wr as BADGE_COLUMN_WIDTH,m as CODEGEN_ENV,eo as COMPOSED_WORKER_ENTRY,Ee as DEFAULT_DEPLOY_TARGET,u as DEV_BINDINGS_FILE,C as DEV_DAEMON_ENV,F as DEV_HANDOFF_ENV,U as DEV_LOG_FILE,M as DEV_LOG_FILE_ENV,G as DEV_STATE_DIR,B as DEV_STATE_FILE,J as DEV_VARS_EXAMPLE_FILE,q as DEV_VARS_FILE,X as DEV_VARS_KEY_PATTERN,re as DEV_WORKER_ENV_VALUE,oe as DEV_WORKER_ENV_VAR,ro as DURABLE_OBJECT_BINDINGS,oo as GENERATED_CLASS_MODULES,to as GENERATED_MODULE_DURABLE_OBJECTS,Se as LINKED_PROJECT_DIR,me as LINKED_PROJECT_FILE,hr as LUNA_ART,Hr as LUNA_BUNNY,Wr as LUNA_NAME,Yr as LUNA_SIGNOFF,Ce as LUNORA_EVENT_SOURCE,ve as LUNORA_IGNORED_PATHS,l as LUNORA_SKILL_NAMES,xe as LUNORA_TAG,Me as LunoraReporter,ao as MERGED_DURABLE_OBJECTS_MODULE,We as PACKAGE_SECRETS_REGISTRY,c as ROOT_SKILL_NAME,Jr as STEP_BADGE_NAMES,I as acceptsConnection,Be as addArgsFor,Ve as advisoryLine,Or as applyAdditiveEdit,Ne as applyLintIgnores,qr as badgeLead,Xr as badgeWidth,Ie as blockingFindingsMessage,Ar as buildPackageSecretsBlock,p as claimAgentRulesHint,b as claimDevServerState,Pr as classifyEdit,Ur as classifyPolicyEdit,y as clearDevServerState,sr as createConfirm,se as deployTargetIds,d as detectAgentRules,t as detectAiAgent,g as detectFramework,be as detectInstalledManagers,Te as detectLintTools,ye as detectPackageManager,E as discoverAgentInfo,R as discoverContainerInfo,yr as discoverSchemaInfo,no as discoverWorkflowInfo,Sr as ensureDevVariables,mr as ensureDevVarsExample,te as ensureDevWorkerEnv,z as escapeRegExp,ke as execArgsFor,fr as fillDevSecrets,Fe as formatLunoraEvent,Lr as generateSecretValue,de as inferLunoraBindings,je as installArgsFor,ze as interpretRemote,f as isCodegenDisabled,k as isDevServerReady,ir as isInteractive,Eo as isMergedProject,so as isMergedRoleModule,Rr as isMintableSecretKey,vr as isPlaceholderValue,j as isProcessAlive,K as isRecordedProcessCurrent,ie as isRunnableTarget,Oe as lunoraLine,zr as padBadge,Qr as paintAnswer,Zr as paintBadge,Q as parseDevVariableEntries,Cr as parseSchema,Nr as planDevSecretsFill,Tr as planDevVariablesAugment,gr as planDevVariablesScaffold,ne as planToolchainInvocation,x as projectUsesUmbrella,nr as promptMultiSelect,_r as promptSelect,lr as promptText,cr as promptYesNo,w as readDevServerState,fe as readLinkedProject,h as readLiveDevServerState,or as readProjectDependencies,tr as readProjectDependencyNames,ar as readProjectManifest,Qe as readProjectRemotePreference,Ze as readProjectTarget,Z as removeDevVariableLine,Pe as reportCodegenFindings,xr as requiredSecrets,_e as resolveDeployDriver,$e as resolveProjectTarget,dr as resolveSchemaDirectory,Mr as resolveServerModule,er as resolveTargetOrThrow,qe as runPostCodegenHook,Ke as runScriptArgsFor,we as runScriptCommand,le as runnableTargetIds,Gr as scaffoldPolicyFile,De as secretSourcesFromBindings,Ye as secretsForPackages,A as startCelldDevSession,O as startDevProcess,N as streamContainerLogs,ce as targetRunsOwnDevServer,he as toolchainExecArgs,H as updateDevServerState,$ as upsertDevVariableLine,Br as wireRlsIntoProcedure,W as writeDevServerState,Vr as writeDevVariablesFileAtomically,Le as writeLinkedProject};
1
+ import{AGENT_MODE_ENV as o,detectAiAgent as t}from"./packem_shared/AGENT_MODE_ENV-D8MvSwPE.mjs";import{discoverAgentInfo as s}from"./packem_shared/discoverAgentInfo-pqFMJBtJ.mjs";import{AGENT_RULES_DIR as i,AGENT_RULES_HINT as n,AGENT_RULES_HINT_ENV as _,LUNORA_SKILL_NAMES as c,ROOT_SKILL_NAME as l,claimAgentRulesHint as p,detectAgentRules as D}from"./packem_shared/AGENT_RULES_DIR-HrrbNZPy.mjs";import{startCelldDevSession as m}from"./packem_shared/startCelldDevSession-BLFsd6jG.mjs";import{CODEGEN_ENV as S,isCodegenDisabled as f}from"./packem_shared/CODEGEN_ENV-ZsCxV1kP.mjs";import{discoverContainerInfo as v}from"./packem_shared/discoverContainerInfo-DzXr7Vm3.mjs";import{streamContainerLogs as N}from"./packem_shared/streamContainerLogs-0nko1qpv.mjs";import{detectFramework as g,projectUsesUmbrella as x}from"./packem_shared/detectFramework-Dfpvu6rD.mjs";import{acceptsConnection as I,startDevProcess as O}from"./packem_shared/acceptsConnection-DHhUYGjT.mjs";import{DEV_BINDINGS_FILE as u,DEV_DAEMON_ENV as C,DEV_HANDOFF_ENV as F,DEV_LOG_FILE as U,DEV_LOG_FILE_ENV as M,DEV_STATE_DIR as G,DEV_STATE_FILE as B,claimDevServerState as b,clearDevServerState as y,isDevServerReady as k,isProcessAlive as j,isRecordedProcessCurrent as K,readDevServerState as h,readLiveDevServerState as w,updateDevServerState as H,writeDevServerState as W}from"./packem_shared/DEV_BINDINGS_FILE-C0ZN_XlP.mjs";import{DEV_VARS_EXAMPLE_FILE as J,DEV_VARS_FILE as q,DEV_VARS_KEY_PATTERN as X,escapeRegExp as z,parseDevVariableEntries as Q,removeDevVariableLine as Z,upsertDevVariableLine as $}from"./packem_shared/DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";import{DEV_WORKER_ENV_VALUE as re,DEV_WORKER_ENV_VAR as oe,ensureDevWorkerEnv as te}from"./packem_shared/DEV_WORKER_ENV_VALUE-2XFXmRrP.mjs";import{createDiscoveryCache as se}from"./packem_shared/createDiscoveryCache-npJI4uej.mjs";import{DEFAULT_DEPLOY_TARGET as ie,deployTargetIds as ne,isRunnableTarget as _e,planToolchainInvocation as ce,resolveDeployDriver as le,runnableTargetIds as pe,targetRunsOwnDevServer as De}from"./packem_shared/DEFAULT_DEPLOY_TARGET-rR7buNQw.mjs";import{i as me,s as Ae}from"./packem_shared/infer-bindings-C1NFOdMi.mjs";import{LINKED_PROJECT_DIR as fe,LINKED_PROJECT_FILE as Le,readLinkedProject as ve,writeLinkedProject as Re}from"./packem_shared/LINKED_PROJECT_DIR-Ba5qPEwo.mjs";import{LUNORA_IGNORED_PATHS as Te,applyLintIgnores as ge,detectLintTools as xe}from"./packem_shared/LUNORA_IGNORED_PATHS-U93uPxrW.mjs";import{LUNORA_TAG as Ie,advisoryLine as Oe,blockingFindingsMessage as Pe,lunoraLine as ue,reportCodegenFindings as Ce}from"./packem_shared/LUNORA_TAG-CiQM3BkI.mjs";import{LUNORA_EVENT_SOURCE as Ue,formatLunoraEvent as Me}from"./packem_shared/LUNORA_EVENT_SOURCE-B9ZVohjO.mjs";import{default as Be}from"./packem_shared/LunoraReporter-f277GLNT.mjs";import{addArgsFor as ye,detectInstalledManagers as ke,detectPackageManager as je,execArgsFor as Ke,installArgsFor as he,runScriptArgsFor as we,runScriptCommand as He,toolchainExecArgs as We}from"./packem_shared/addArgsFor-CYZKhNIo.mjs";import{P as Je,s as qe}from"./packem_shared/package-secrets-registry-BeheNwsP.mjs";import{runPostCodegenHook as ze}from"./packem_shared/runPostCodegenHook-Dx3yTsYZ.mjs";import{interpretRemote as Ze,readProjectRemotePreference as $e,readProjectTarget as er,resolveProjectTarget as rr,resolveTargetOrThrow as or}from"./packem_shared/interpretRemote-CcmGeGZ_.mjs";import{readProjectDependencies as ar,readProjectDependencyNames as sr,readProjectManifest as Er}from"./packem_shared/readProjectDependencies-l3uhUKjo.mjs";import{createConfirm as nr,isInteractive as _r,promptMultiSelect as cr,promptSelect as lr,promptText as pr,promptYesNo as Dr}from"./packem_shared/createConfirm-D5mKTMHj.mjs";import{default as mr}from"./packem_shared/resolveSchemaDirectory-Ca5P6KuP.mjs";import{buildPackageSecretsBlock as Sr,ensureDevVariables as fr,ensureDevVarsExample as Lr,fillDevSecrets as vr,generateSecretValue as Rr,isMintableSecretKey as Nr,isPlaceholderValue as Tr,planDevSecretsFill as gr,planDevVariablesAugment as xr,planDevVariablesScaffold as Vr,requiredSecrets as Ir,writeDevVariablesFileAtomically as Or}from"./packem_shared/buildPackageSecretsBlock-BWV_VxqV.mjs";import{applyAdditiveEdit as ur,classifyEdit as Cr}from"./packem_shared/applyAdditiveEdit-CH0VhMJ2.mjs";import{parseSchema as Ur}from"./packem_shared/parseSchema-D1Wbr1qv.mjs";import{classifyPolicyEdit as Gr,resolveServerModule as Br,scaffoldPolicyFile as br,wireRlsIntoProcedure as yr}from"./packem_shared/classifyPolicyEdit-DJi9Fk8G.mjs";import{discoverSchemaInfo as jr}from"./packem_shared/discoverSchemaInfo-BBRlXZop.mjs";import{ACCENT as hr,BADGES as wr,BADGE_COLUMN_WIDTH as Hr,LUNA_ART as Wr,LUNA_BUNNY as Yr,LUNA_NAME as Jr,LUNA_SIGNOFF as qr,STEP_BADGE_NAMES as Xr,badgeLead as zr,badgeWidth as Qr,padBadge as Zr,paintAnswer as $r,paintBadge as eo}from"./packem_shared/ACCENT-CotPTfv7.mjs";import{COMPOSED_WORKER_ENTRY as oo,DURABLE_OBJECT_BINDINGS as to,GENERATED_CLASS_MODULES as ao,GENERATED_MODULE_DURABLE_OBJECTS as so,MERGED_DURABLE_OBJECTS_MODULE as Eo,isMergedProject as io,isMergedRoleModule as no}from"./packem_shared/COMPOSED_WORKER_ENTRY-Ciiba5g_.mjs";import{discoverWorkflowInfo as co}from"./packem_shared/discoverWorkflowInfo-zW7Tt0Tn.mjs";export{hr as ACCENT,o as AGENT_MODE_ENV,i as AGENT_RULES_DIR,n as AGENT_RULES_HINT,_ as AGENT_RULES_HINT_ENV,wr as BADGES,Hr as BADGE_COLUMN_WIDTH,S as CODEGEN_ENV,oo as COMPOSED_WORKER_ENTRY,ie as DEFAULT_DEPLOY_TARGET,u as DEV_BINDINGS_FILE,C as DEV_DAEMON_ENV,F as DEV_HANDOFF_ENV,U as DEV_LOG_FILE,M as DEV_LOG_FILE_ENV,G as DEV_STATE_DIR,B as DEV_STATE_FILE,J as DEV_VARS_EXAMPLE_FILE,q as DEV_VARS_FILE,X as DEV_VARS_KEY_PATTERN,re as DEV_WORKER_ENV_VALUE,oe as DEV_WORKER_ENV_VAR,to as DURABLE_OBJECT_BINDINGS,ao as GENERATED_CLASS_MODULES,so as GENERATED_MODULE_DURABLE_OBJECTS,fe as LINKED_PROJECT_DIR,Le as LINKED_PROJECT_FILE,Wr as LUNA_ART,Yr as LUNA_BUNNY,Jr as LUNA_NAME,qr as LUNA_SIGNOFF,Ue as LUNORA_EVENT_SOURCE,Te as LUNORA_IGNORED_PATHS,c as LUNORA_SKILL_NAMES,Ie as LUNORA_TAG,Be as LunoraReporter,Eo as MERGED_DURABLE_OBJECTS_MODULE,Je as PACKAGE_SECRETS_REGISTRY,l as ROOT_SKILL_NAME,Xr as STEP_BADGE_NAMES,I as acceptsConnection,ye as addArgsFor,Oe as advisoryLine,ur as applyAdditiveEdit,ge as applyLintIgnores,zr as badgeLead,Qr as badgeWidth,Pe as blockingFindingsMessage,Sr as buildPackageSecretsBlock,p as claimAgentRulesHint,b as claimDevServerState,Cr as classifyEdit,Gr as classifyPolicyEdit,y as clearDevServerState,nr as createConfirm,se as createDiscoveryCache,ne as deployTargetIds,D as detectAgentRules,t as detectAiAgent,g as detectFramework,ke as detectInstalledManagers,xe as detectLintTools,je as detectPackageManager,s as discoverAgentInfo,v as discoverContainerInfo,jr as discoverSchemaInfo,co as discoverWorkflowInfo,fr as ensureDevVariables,Lr as ensureDevVarsExample,te as ensureDevWorkerEnv,z as escapeRegExp,Ke as execArgsFor,vr as fillDevSecrets,Me as formatLunoraEvent,Rr as generateSecretValue,me as inferLunoraBindings,he as installArgsFor,Ze as interpretRemote,f as isCodegenDisabled,k as isDevServerReady,_r as isInteractive,io as isMergedProject,no as isMergedRoleModule,Nr as isMintableSecretKey,Tr as isPlaceholderValue,j as isProcessAlive,K as isRecordedProcessCurrent,_e as isRunnableTarget,ue as lunoraLine,Zr as padBadge,$r as paintAnswer,eo as paintBadge,Q as parseDevVariableEntries,Ur as parseSchema,gr as planDevSecretsFill,xr as planDevVariablesAugment,Vr as planDevVariablesScaffold,ce as planToolchainInvocation,x as projectUsesUmbrella,cr as promptMultiSelect,lr as promptSelect,pr as promptText,Dr as promptYesNo,h as readDevServerState,ve as readLinkedProject,w as readLiveDevServerState,ar as readProjectDependencies,sr as readProjectDependencyNames,Er as readProjectManifest,$e as readProjectRemotePreference,er as readProjectTarget,Z as removeDevVariableLine,Ce as reportCodegenFindings,Ir as requiredSecrets,le as resolveDeployDriver,rr as resolveProjectTarget,mr as resolveSchemaDirectory,Br as resolveServerModule,or as resolveTargetOrThrow,ze as runPostCodegenHook,we as runScriptArgsFor,He as runScriptCommand,pe as runnableTargetIds,br as scaffoldPolicyFile,Ae as secretSourcesFromBindings,qe as secretsForPackages,m as startCelldDevSession,O as startDevProcess,N as streamContainerLogs,De as targetRunsOwnDevServer,We as toolchainExecArgs,H as updateDevServerState,$ as upsertDevVariableLine,yr as wireRlsIntoProcedure,W as writeDevServerState,Or as writeDevVariablesFileAtomically,Re as writeLinkedProject};
@@ -0,0 +1 @@
1
+ const r={devServer:"workerd",prebuildsContainerImages:!0,deploy:o=>{const n=o.preview===!0?["versions","upload"]:["deploy"];return o.entry!==void 0&&n.push(o.entry),o.configPath!==void 0&&n.push("--config",o.configPath),o.environment!==void 0&&n.push("--env",o.environment),o.temporary===!0&&n.push("--temporary"),o.dryRun===!0&&n.push("--dry-run"),o.outDir!==void 0&&n.push("--outdir",o.outDir,"--metafile"),{args:n,tool:"wrangler"}},dev:o=>{const n=["dev"];return o.configPath!==void 0&&n.push("--config",o.configPath),o.environment!==void 0&&n.push("--env",o.environment),n.push(...o.extraArgs??[]),{args:n,tool:"wrangler"}},secretList:o=>{const n=["secret","list","--format","json"];return o.environment!==void 0&&n.push("--env",o.environment),o.temporary===!0&&n.push("--temporary"),{args:n,tool:"wrangler"}},secretBulk:o=>{const n=["secret","bulk"];return o.environment!==void 0&&n.push("--env",o.environment),o.temporary===!0&&n.push("--temporary"),{args:n,tool:"wrangler"}},secretPut:o=>{const n=["secret","put",o.key??""];return o.environment!==void 0&&n.push("--env",o.environment),o.temporary===!0&&n.push("--temporary"),{args:n,tool:"wrangler"}},tail:o=>{const n=["tail"];return o.worker!==void 0&&n.push(o.worker),o.environment!==void 0&&n.push("--env",o.environment),o.format!==void 0&&n.push("--format",o.format),o.status!==void 0&&n.push("--status",o.status),o.search!==void 0&&n.push("--search",o.search),o.temporary===!0&&n.push("--temporary"),{args:n,tool:"wrangler"}}},i={id:"cloudflare",name:"Cloudflare",toolchain:r};export{i as default};
@@ -1 +1 @@
1
- import{p as a}from"./celld-config-D-L6uskI.mjs";import s from"./CLOUDFLARE_DRIVER-Ci3VIqnk.mjs";const p=[["entry","`celld deploy` deploys the config's `main`; a composed framework entry has no celld equivalent yet"],["environment","celld has no Wrangler environments — deploy a separate config per environment"],["outDir","`celld deploy` does not write its bundle to disk"],["preview","celld has no preview versions — a deploy replaces the fleet's current deployment"],["temporary","celld has no short-lived accounts — it deploys to the fleet bucket in CELLD_BUCKET"]],l=e=>{if(e===void 0)throw new Error("the celld driver runs the projected wrangler config — pass `configPath` from `projectConfig`");return e},v={deploy:e=>{const o=p.find(([r])=>e[r]!==void 0&&e[r]!==!1);if(o!==void 0)throw new Error(o[1]);return{args:["deploy",l(e.configPath),...e.dryRun===!0?["--dry-run"]:[]],onPath:!0,tool:"celld"}},devServer:"own",prebuildsContainerImages:!1,dev:e=>{if(e.environment!==void 0)throw new Error("celld has no Wrangler environments — `celld dev` runs the top-level config");return{args:["dev",l(e.configPath),...e.extraArgs??[]],onPath:!0,tool:"celld"}}},f={id:"celld",name:"celld",projectConfig:a,toolchain:v},h={id:"node",name:"Node"},m="cloudflare",t={celld:f,cloudflare:s,node:h},d=()=>Object.keys(t).toSorted((e,o)=>e.localeCompare(o)),c=(e=m)=>{const o=t[e];if(o===void 0)throw new Error(`unknown deploy target "${e}" — available targets: ${d().join(", ")}`);return o},g=e=>Object.hasOwn(t,e)&&c(e).toolchain!==void 0,y=()=>d().filter(e=>g(e)),D=e=>c(e).toolchain?.devServer==="own",O=(e,o,r,i)=>{const n=e.projectConfig?.(o,r);return{command:i(n?.configPath),commit:()=>n?.write(),projection:n===void 0?void 0:{configPath:n.configPath,dropped:n.dropped}}};export{m as DEFAULT_DEPLOY_TARGET,d as deployTargetIds,g as isRunnableTarget,O as planToolchainInvocation,c as resolveDeployDriver,y as runnableTargetIds,D as targetRunsOwnDevServer};
1
+ import{p as a}from"./celld-config-D-L6uskI.mjs";import s from"./CLOUDFLARE_DRIVER-CULavrYO.mjs";const p=[["entry","`celld deploy` deploys the config's `main`; a composed framework entry has no celld equivalent yet"],["environment","celld has no Wrangler environments — deploy a separate config per environment"],["outDir","`celld deploy` does not write its bundle to disk"],["preview","celld has no preview versions — a deploy replaces the fleet's current deployment"],["temporary","celld has no short-lived accounts — it deploys to the fleet bucket in CELLD_BUCKET"]],l=e=>{if(e===void 0)throw new Error("the celld driver runs the projected wrangler config — pass `configPath` from `projectConfig`");return e},v={deploy:e=>{const o=p.find(([r])=>e[r]!==void 0&&e[r]!==!1);if(o!==void 0)throw new Error(o[1]);return{args:["deploy",l(e.configPath),...e.dryRun===!0?["--dry-run"]:[]],onPath:!0,tool:"celld"}},devServer:"own",prebuildsContainerImages:!1,dev:e=>{if(e.environment!==void 0)throw new Error("celld has no Wrangler environments — `celld dev` runs the top-level config");return{args:["dev",l(e.configPath),...e.extraArgs??[]],onPath:!0,tool:"celld"}}},f={id:"celld",name:"celld",projectConfig:a,toolchain:v},h={id:"node",name:"Node"},m="cloudflare",t={celld:f,cloudflare:s,node:h},d=()=>Object.keys(t).toSorted((e,o)=>e.localeCompare(o)),c=(e=m)=>{const o=t[e];if(o===void 0)throw new Error(`unknown deploy target "${e}" — available targets: ${d().join(", ")}`);return o},g=e=>Object.hasOwn(t,e)&&c(e).toolchain!==void 0,y=()=>d().filter(e=>g(e)),D=e=>c(e).toolchain?.devServer==="own",O=(e,o,r,i)=>{const n=e.projectConfig?.(o,r);return{command:i(n?.configPath),commit:()=>n?.write(),projection:n===void 0?void 0:{configPath:n.configPath,dropped:n.dropped}}};export{m as DEFAULT_DEPLOY_TARGET,d as deployTargetIds,g as isRunnableTarget,O as planToolchainInvocation,c as resolveDeployDriver,y as runnableTargetIds,D as targetRunsOwnDevServer};
@@ -1 +1 @@
1
- import{existsSync as h}from"node:fs";import{dirname as y,join as p}from"node:path";import{discoverSchemaInfo as E}from"./discoverSchemaInfo-BLe1EVI8.mjs";import{MERGED_DURABLE_OBJECT as i,GENERATED_DIRECTORY as w,MERGED_ROLE_DURABLE_OBJECTS as u,COMPOSED_ENTRY_DURABLE_OBJECTS as $,GENERATED_CLASS_MODULES as k,isFrameworkDurableObject as D}from"./COMPOSED_WORKER_ENTRY-Ciiba5g_.mjs";import{o as R,f as j}from"./validate-bindings-CvNBF3U4.mjs";import{validateSchedulerOrigin as x}from"./withTailConsumer-DngzpJMK.mjs";import{l as O,r as _,s as A}from"./worker-entry-checks-AIASCYl7.mjs";import{mergeWranglerEnvironment as S}from"./mergeWranglerEnvironment-DXiB-HcS.mjs";import{findWranglerFile as W,readWranglerJsonc as C}from"./WRANGLER_FILES-UNW-xY5u.mjs";import{validateWranglerConfig as T}from"./REQUIRED_COMPATIBILITY_DATE-OLQlG0oj.mjs";const v=r=>Array.isArray(r)?r:[],L=(r,o,t)=>Object.entries(r?.images??{}).flatMap(([s,n])=>{const e=n?.dockerfile;return typeof e!="string"||h(e.startsWith("/")?e:p(o,e))?[]:[`containers images["${s}"] dockerfile "${e}" does not exist (resolved relative to ${t}); create the Dockerfile`]}),I=(r,o,t)=>{const s=[];for(const n of v(r)){const e=n?.image;typeof e=="string"&&(e.startsWith("./")||e.startsWith("../")||e.startsWith("/")||e.includes("Dockerfile"))&&!h(e.startsWith("/")?e:p(o,e))&&s.push(`containers image "${e}" does not exist (resolved relative to ${t}); create the Dockerfile or point image at a registry reference`),s.push(...L(n,o,t))}return s},P=(r,o)=>{const t=r?.vectorIndexNames??[],s=[];if(t.length>0&&s.push({message:e=>`schema declares vector index(es) ${t.map(l=>`"${l}"`).join(", ")} but nothing chains .vectors(...) onto defineApp() (composed in: ${e}) — \`ctx.vectors\` is then a throwing stub and buildWorkerOptions rejects EVERY request, /_lunora/health included. Add \`.vectors((env) => ({ ${String(t[0])}: env.<BINDING> }))\` to the chain.`,method:"vectors"}),r?.hasD1GlobalTable&&s.push({message:e=>`schema declares .global() table(s) but nothing chains .global(...) onto defineApp() (composed in: ${e}) — the shard then has no global writer, so every read or write of a global table throws INTERNAL ("requires a globalDb writer"). Add \`.global({ d1: (env) => env.DB })\` to the chain.`,method:"global"}),r?.hasHyperdriveGlobalTable&&s.push({message:e=>`schema declares .global({ backend: "hyperdrive" }) table(s) but nothing chains .hyperdriveGlobal(...) onto defineApp() (composed in: ${e}) — the shard then has no global writer, so every read or write of those tables throws INTERNAL. Add \`.hyperdriveGlobal({ engine: "postgres", exec: (env) => buildPgExec(fromPostgresJs(postgres(env.HYPERDRIVE.connectionString))) })\` to the chain (\`buildPgExec\` from \`@lunora/hyperdrive/global\`, \`fromPostgresJs\` from \`@lunora/hyperdrive\`).`,method:"hyperdriveGlobal"}),s.length===0)return[];const n=A(o,new Set(s.map(e=>e.method)));return n===void 0?[]:s.filter(e=>!n.chained.has(e.method)).map(e=>e.message(n.site))},G="does not export it",B=(r,o)=>{if(o.exports?.has(i)===!0&&u.has(r))return`This app merges its Durable Objects (\`durableObjects.merge\` in lunora.config), so ${i} hosts ${r}: bind only \`SHARD\` to "${i}" and drop the SCHEDULER / SHARD_REGISTRY bindings. Do that only if this Worker has never been deployed — a deployed ${r} namespace keeps its data, which the merged class cannot reach; turn \`durableObjects.merge\` off to keep it.`;if(r===i)return`${i} is the merged class (\`durableObjects.merge\` in lunora.config), and merging cannot be undone once deployed: the shard data lives in ${i}. Turn \`durableObjects.merge\` back on. Only a Worker that has never been deployed may rebind SHARD to "ShardDO".`;if(o.kind!=="composed")return`Re-export it from the module that defines it (\`export { ${r} } from "./…";\`), or add it to the app builder's own export (\`export const { ${r} } = app;\`).`;const t=`it exports ${$.join(", ")}, SchedulerDO when its binding is declared, and every class codegen emits from your ${k.map(s=>`${s}.ts`).join(" / ")} declarations`;return D(r)?`\`@lunora/vite\` generates that entry — ${t}, and ${r} is not among them. Class-A composition does not carry ${r}, so drop the binding; a project that needs it has to own its worker entry (add \`src/worker.ts\`, which \`lunora deploy\` bundles in place of \`main\`, and compose \`defineApp()\` there).`:`\`@lunora/vite\` generates that entry, so there is no file to add a re-export to: ${t}. Declare "${r}" in one of those and re-run \`lunora codegen\`, or drop the binding.`},M=(r,o)=>{const t=o.exports;if(t===void 0)return[];const s=[];for(const e of R(r.durable_objects?.bindings))typeof e.class_name=="string"&&e.class_name.length>0&&e.script_name===void 0&&s.push({className:e.class_name,label:"durable_objects.bindings"});for(const e of v(r.workflows))typeof e?.class_name=="string"&&e.class_name.length>0&&e.script_name===void 0&&s.push({className:e.class_name,label:"workflows"});for(const[e,l]of Object.entries(r.exports??{}))l?.type==="workflow"&&s.push({className:e,label:"workflows"});return s.filter(e=>!t.has(e.className)).map(e=>`${e.label} declares class "${e.className}" but the ${o.kind==="composed"?"composed class-A worker entry":"worker entry"} (${o.path}) ${G} — wrangler refuses to bundle a Worker whose ${e.label==="workflows"?"Workflow":"Durable Object"} classes are not exported. ${B(e.className,o)}`)},N=r=>[...j(r.migrations)].filter(o=>u.has(o)).map(o=>`migrations create class "${o}", which this app hosts in ${i} because it merges its Durable Objects (\`durableObjects.merge\`). Before the first deploy, replace "${o}" with "${i}" in new_sqlite_classes; a Worker already deployed with "${o}" keeps its data there and cannot merge — turn \`durableObjects.merge\` off.`),U=r=>r?.origin!=="absent"?[]:[`main is set but no readable file is there (looked in ${r.path}) — wrangler cannot resolve the worker entry, so a deploy will fail there. Point main at the entry that composes your app, or remove it to fall back to the conventional locations.`],Z=r=>{const o=r.schemaDir??"lunora",t=W(r.projectRoot);if(!t){const c=`wrangler.jsonc not found in ${r.projectRoot}; create one declaring at least the SHARD durable object binding.`;return{problems:[c],report:{errors:[c],valid:!1,warnings:[]},wranglerPath:void 0}}const{parsed:s}=C(t);if(s===void 0){const c=`failed to parse ${t} as JSONC.`;return{problems:[c],report:{errors:[c],valid:!1,warnings:[]},wranglerPath:t}}const{error:n,merged:e}=S(s,r.environment);if(n!==void 0)return{problems:[n],report:{errors:[n],valid:!1,warnings:[]},wranglerPath:t};const{error:l,info:f}=E(r.projectRoot,o),a=T(s,f,r.environment);l!==void 0&&a.warnings.push(`schema parse failed in ${o}/schema.ts: ${l}`);const g=y(t),b=O(e.main,r.projectRoot,t),m=_(b,r.projectRoot,o);a.errors.push(...I(e.containers??[],g,t)),a.warnings.push(...U(b)),m!==void 0&&a.errors.push(...M(e,m)),m?.exports?.has(i)===!0&&(a.errors.push(...N(e)),h(p(r.projectRoot,o,w,"scheduler.ts"))&&x(e,r.environment,a.warnings,"the merged LunoraDO hosts the scheduler")),a.errors.push(...P(f,r.projectRoot));const d=e.assets?.directory;if(typeof d=="string"&&d.length>0){const c=d.startsWith("/")?d:p(g,d);h(c)||a.warnings.push(`assets.directory "${d}" does not exist yet — it is created by the client build; run the build before deploy`)}return a.valid=a.errors.length===0,{problems:a.errors,report:a,wranglerPath:t}};export{G as UNEXPORTED_CLASS_MARKER,Z as validateWranglerProject};
1
+ import{existsSync as h}from"node:fs";import{dirname as y,join as p}from"node:path";import{discoverSchemaInfo as E}from"./discoverSchemaInfo-BBRlXZop.mjs";import{MERGED_DURABLE_OBJECT as i,GENERATED_DIRECTORY as w,MERGED_ROLE_DURABLE_OBJECTS as u,COMPOSED_ENTRY_DURABLE_OBJECTS as $,GENERATED_CLASS_MODULES as k,isFrameworkDurableObject as D}from"./COMPOSED_WORKER_ENTRY-Ciiba5g_.mjs";import{o as R,f as j}from"./validate-bindings-CvNBF3U4.mjs";import{validateSchedulerOrigin as x}from"./withTailConsumer-DngzpJMK.mjs";import{l as O,r as _,s as A}from"./worker-entry-checks-AIASCYl7.mjs";import{mergeWranglerEnvironment as S}from"./mergeWranglerEnvironment-DXiB-HcS.mjs";import{findWranglerFile as W,readWranglerJsonc as C}from"./WRANGLER_FILES-UNW-xY5u.mjs";import{validateWranglerConfig as T}from"./REQUIRED_COMPATIBILITY_DATE-OLQlG0oj.mjs";const v=r=>Array.isArray(r)?r:[],L=(r,o,t)=>Object.entries(r?.images??{}).flatMap(([s,n])=>{const e=n?.dockerfile;return typeof e!="string"||h(e.startsWith("/")?e:p(o,e))?[]:[`containers images["${s}"] dockerfile "${e}" does not exist (resolved relative to ${t}); create the Dockerfile`]}),I=(r,o,t)=>{const s=[];for(const n of v(r)){const e=n?.image;typeof e=="string"&&(e.startsWith("./")||e.startsWith("../")||e.startsWith("/")||e.includes("Dockerfile"))&&!h(e.startsWith("/")?e:p(o,e))&&s.push(`containers image "${e}" does not exist (resolved relative to ${t}); create the Dockerfile or point image at a registry reference`),s.push(...L(n,o,t))}return s},P=(r,o)=>{const t=r?.vectorIndexNames??[],s=[];if(t.length>0&&s.push({message:e=>`schema declares vector index(es) ${t.map(l=>`"${l}"`).join(", ")} but nothing chains .vectors(...) onto defineApp() (composed in: ${e}) — \`ctx.vectors\` is then a throwing stub and buildWorkerOptions rejects EVERY request, /_lunora/health included. Add \`.vectors((env) => ({ ${String(t[0])}: env.<BINDING> }))\` to the chain.`,method:"vectors"}),r?.hasD1GlobalTable&&s.push({message:e=>`schema declares .global() table(s) but nothing chains .global(...) onto defineApp() (composed in: ${e}) — the shard then has no global writer, so every read or write of a global table throws INTERNAL ("requires a globalDb writer"). Add \`.global({ d1: (env) => env.DB })\` to the chain.`,method:"global"}),r?.hasHyperdriveGlobalTable&&s.push({message:e=>`schema declares .global({ backend: "hyperdrive" }) table(s) but nothing chains .hyperdriveGlobal(...) onto defineApp() (composed in: ${e}) — the shard then has no global writer, so every read or write of those tables throws INTERNAL. Add \`.hyperdriveGlobal({ engine: "postgres", exec: (env) => buildPgExec(fromPostgresJs(postgres(env.HYPERDRIVE.connectionString))) })\` to the chain (\`buildPgExec\` from \`@lunora/hyperdrive/global\`, \`fromPostgresJs\` from \`@lunora/hyperdrive\`).`,method:"hyperdriveGlobal"}),s.length===0)return[];const n=A(o,new Set(s.map(e=>e.method)));return n===void 0?[]:s.filter(e=>!n.chained.has(e.method)).map(e=>e.message(n.site))},G="does not export it",B=(r,o)=>{if(o.exports?.has(i)===!0&&u.has(r))return`This app merges its Durable Objects (\`durableObjects.merge\` in lunora.config), so ${i} hosts ${r}: bind only \`SHARD\` to "${i}" and drop the SCHEDULER / SHARD_REGISTRY bindings. Do that only if this Worker has never been deployed — a deployed ${r} namespace keeps its data, which the merged class cannot reach; turn \`durableObjects.merge\` off to keep it.`;if(r===i)return`${i} is the merged class (\`durableObjects.merge\` in lunora.config), and merging cannot be undone once deployed: the shard data lives in ${i}. Turn \`durableObjects.merge\` back on. Only a Worker that has never been deployed may rebind SHARD to "ShardDO".`;if(o.kind!=="composed")return`Re-export it from the module that defines it (\`export { ${r} } from "./…";\`), or add it to the app builder's own export (\`export const { ${r} } = app;\`).`;const t=`it exports ${$.join(", ")}, SchedulerDO when its binding is declared, and every class codegen emits from your ${k.map(s=>`${s}.ts`).join(" / ")} declarations`;return D(r)?`\`@lunora/vite\` generates that entry — ${t}, and ${r} is not among them. Class-A composition does not carry ${r}, so drop the binding; a project that needs it has to own its worker entry (add \`src/worker.ts\`, which \`lunora deploy\` bundles in place of \`main\`, and compose \`defineApp()\` there).`:`\`@lunora/vite\` generates that entry, so there is no file to add a re-export to: ${t}. Declare "${r}" in one of those and re-run \`lunora codegen\`, or drop the binding.`},M=(r,o)=>{const t=o.exports;if(t===void 0)return[];const s=[];for(const e of R(r.durable_objects?.bindings))typeof e.class_name=="string"&&e.class_name.length>0&&e.script_name===void 0&&s.push({className:e.class_name,label:"durable_objects.bindings"});for(const e of v(r.workflows))typeof e?.class_name=="string"&&e.class_name.length>0&&e.script_name===void 0&&s.push({className:e.class_name,label:"workflows"});for(const[e,l]of Object.entries(r.exports??{}))l?.type==="workflow"&&s.push({className:e,label:"workflows"});return s.filter(e=>!t.has(e.className)).map(e=>`${e.label} declares class "${e.className}" but the ${o.kind==="composed"?"composed class-A worker entry":"worker entry"} (${o.path}) ${G} — wrangler refuses to bundle a Worker whose ${e.label==="workflows"?"Workflow":"Durable Object"} classes are not exported. ${B(e.className,o)}`)},N=r=>[...j(r.migrations)].filter(o=>u.has(o)).map(o=>`migrations create class "${o}", which this app hosts in ${i} because it merges its Durable Objects (\`durableObjects.merge\`). Before the first deploy, replace "${o}" with "${i}" in new_sqlite_classes; a Worker already deployed with "${o}" keeps its data there and cannot merge — turn \`durableObjects.merge\` off.`),U=r=>r?.origin!=="absent"?[]:[`main is set but no readable file is there (looked in ${r.path}) — wrangler cannot resolve the worker entry, so a deploy will fail there. Point main at the entry that composes your app, or remove it to fall back to the conventional locations.`],Z=r=>{const o=r.schemaDir??"lunora",t=W(r.projectRoot);if(!t){const c=`wrangler.jsonc not found in ${r.projectRoot}; create one declaring at least the SHARD durable object binding.`;return{problems:[c],report:{errors:[c],valid:!1,warnings:[]},wranglerPath:void 0}}const{parsed:s}=C(t);if(s===void 0){const c=`failed to parse ${t} as JSONC.`;return{problems:[c],report:{errors:[c],valid:!1,warnings:[]},wranglerPath:t}}const{error:n,merged:e}=S(s,r.environment);if(n!==void 0)return{problems:[n],report:{errors:[n],valid:!1,warnings:[]},wranglerPath:t};const{error:l,info:f}=E(r.projectRoot,o),a=T(s,f,r.environment);l!==void 0&&a.warnings.push(`schema parse failed in ${o}/schema.ts: ${l}`);const g=y(t),b=O(e.main,r.projectRoot,t),m=_(b,r.projectRoot,o);a.errors.push(...I(e.containers??[],g,t)),a.warnings.push(...U(b)),m!==void 0&&a.errors.push(...M(e,m)),m?.exports?.has(i)===!0&&(a.errors.push(...N(e)),h(p(r.projectRoot,o,w,"scheduler.ts"))&&x(e,r.environment,a.warnings,"the merged LunoraDO hosts the scheduler")),a.errors.push(...P(f,r.projectRoot));const d=e.assets?.directory;if(typeof d=="string"&&d.length>0){const c=d.startsWith("/")?d:p(g,d);h(c)||a.warnings.push(`assets.directory "${d}" does not exist yet — it is created by the client build; run the build before deploy`)}return a.valid=a.errors.length===0,{problems:a.errors,report:a,wranglerPath:t}};export{G as UNEXPORTED_CLASS_MARKER,Z as validateWranglerProject};
@@ -1,3 +1,3 @@
1
- import{LunoraError as n}from"@lunora/errors";import{lunoraLine as i}from"./LUNORA_TAG-CiQM3BkI.mjs";import{validateWranglerProject as l}from"./UNEXPORTED_CLASS_MARKER-IAK9PiDz.mjs";const m=(e,a,t)=>{const r=l({projectRoot:e.projectRoot,schemaDir:e.schemaDir});if(!r.wranglerPath)throw new n("INTERNAL",["[lunora] wrangler.jsonc not found.",` searched in: ${e.projectRoot}`," create a wrangler.jsonc declaring at least the SHARD durable object binding."].join(`
1
+ import{LunoraError as n}from"@lunora/errors";import{lunoraLine as i}from"./LUNORA_TAG-CiQM3BkI.mjs";import{validateWranglerProject as l}from"./UNEXPORTED_CLASS_MARKER-DwJCN8fX.mjs";const m=(e,a,t)=>{const r=l({projectRoot:e.projectRoot,schemaDir:e.schemaDir});if(!r.wranglerPath)throw new n("INTERNAL",["[lunora] wrangler.jsonc not found.",` searched in: ${e.projectRoot}`," create a wrangler.jsonc declaring at least the SHARD durable object binding."].join(`
2
2
  `));for(const o of r.report.warnings)a(i(`wrangler validator: ${o}`));if(r.problems.length>0)throw new n("INTERNAL",["[lunora] wrangler configuration is missing bindings required by your schema.",` file: ${r.wranglerPath}`,"",...r.problems.map(o=>` - ${o}`),"",` ${t}`].join(`
3
3
  `))};export{m as assertWranglerSatisfiesSchema};
@@ -1,2 +1,2 @@
1
- import{readFileSync as X,writeFileSync as z}from"node:fs";import{createRequire as Z}from"node:module";import{join as Q}from"node:path";import{containerBuildTag as ee}from"@lunora/container";import{readJsonSync as ne}from"@visulima/fs";import{applyModify as S}from"./applyModify-DKP2l6S9.mjs";import{a as se,r as K}from"./lunora-manifest-DuH_Cmyu.mjs";import{parseTree as te,findNodeAtLocation as oe}from"jsonc-parser";import{r as ie,a as re,b as ae,c as de}from"./reconcile-services-DFqH4eMQ.mjs";import{a as ce,s as le}from"./infer-bindings-BsgN5eCm.mjs";import{DEV_VARS_FILE as ue,parseDevVariableEntries as ge}from"./DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";import{requiredSecrets as me}from"./buildPackageSecretsBlock-BWV_VxqV.mjs";import{w as pe,m as fe,s as Y,o as B,n as C,p as be}from"./validate-bindings-CvNBF3U4.mjs";import{s as he}from"./worker-entry-checks-AIASCYl7.mjs";import{DEFAULT_OBSERVABILITY as we}from"./DEFAULT_OBSERVABILITY-bN6UkTMx.mjs";import{findWranglerFile as ve,readWranglerJsonc as _e}from"./WRANGLER_FILES-UNW-xY5u.mjs";const ye=[["maxBatchSize","max_batch_size"],["maxBatchTimeout","max_batch_timeout"],["maxConcurrency","max_concurrency"],["maxRetries","max_retries"],["deadLetterQueue","dead_letter_queue"],["retryDelay","retry_delay"]],R=e=>Object.fromEntries(ye.filter(([n])=>e.tuning[n]!==void 0).map(([n,s])=>[s,e.tuning[n]])),P="queueTuning",Se=/^[\t ]*(?:,[\t ]*)?(?:\/\/[^\n\r]*)?\r?\n/u,xe=/^[\t ]*,/u,Ne=(e,n)=>{const s=te(e),t=s===void 0?void 0:oe(s,[...n])?.parent;if(t?.type==="property"){const o=t.offset+t.length,i=e.lastIndexOf(`
1
+ import{readFileSync as X,writeFileSync as z}from"node:fs";import{createRequire as Z}from"node:module";import{join as Q}from"node:path";import{containerBuildTag as ee}from"@lunora/container";import{readJsonSync as ne}from"@visulima/fs";import{applyModify as S}from"./applyModify-DKP2l6S9.mjs";import{a as se,r as K}from"./lunora-manifest-DuH_Cmyu.mjs";import{parseTree as te,findNodeAtLocation as oe}from"jsonc-parser";import{r as ie,a as re,b as ae,c as de}from"./reconcile-services-DFqH4eMQ.mjs";import{a as ce,s as le}from"./infer-bindings-C1NFOdMi.mjs";import{DEV_VARS_FILE as ue,parseDevVariableEntries as ge}from"./DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";import{requiredSecrets as me}from"./buildPackageSecretsBlock-BWV_VxqV.mjs";import{w as pe,m as fe,s as Y,o as B,n as C,p as be}from"./validate-bindings-CvNBF3U4.mjs";import{s as he}from"./worker-entry-checks-AIASCYl7.mjs";import{DEFAULT_OBSERVABILITY as we}from"./DEFAULT_OBSERVABILITY-bN6UkTMx.mjs";import{findWranglerFile as ve,readWranglerJsonc as _e}from"./WRANGLER_FILES-UNW-xY5u.mjs";const ye=[["maxBatchSize","max_batch_size"],["maxBatchTimeout","max_batch_timeout"],["maxConcurrency","max_concurrency"],["maxRetries","max_retries"],["deadLetterQueue","dead_letter_queue"],["retryDelay","retry_delay"]],R=e=>Object.fromEntries(ye.filter(([n])=>e.tuning[n]!==void 0).map(([n,s])=>[s,e.tuning[n]])),P="queueTuning",Se=/^[\t ]*(?:,[\t ]*)?(?:\/\/[^\n\r]*)?\r?\n/u,xe=/^[\t ]*,/u,Ne=(e,n)=>{const s=te(e),t=s===void 0?void 0:oe(s,[...n])?.parent;if(t?.type==="property"){const o=t.offset+t.length,i=e.lastIndexOf(`
2
2
  `,t.offset-1)+1,r=Se.exec(e.slice(o));if(r!==null&&e.slice(i,t.offset).trim()===""){const d=t.parent?.children??[],m=d.indexOf(t),c=m===d.length-1&&m>0?d[m-1]:void 0,l=c===void 0?void 0:xe.exec(e.slice(c.offset+c.length))??void 0;return(l===void 0||c===void 0?e.slice(0,i):e.slice(0,c.offset+c.length)+e.slice(c.offset+c.length+l[0].length,i))+e.slice(o+r[0].length)}}return S(e,n,void 0)},G=(e,n,s,t,o,i=new Set)=>{const r=s.join("."),d={},m=[],c=[];let l=e;return{entries:n.map((u,w)=>{const g=t(u);if(g===void 0||u.queue===void 0)return u;const b=Object.fromEntries(Object.entries(R(g)).filter(([f])=>!i.has(f))),h=Object.entries(o[u.queue]??{}).filter(([f])=>!Object.hasOwn(b,f)),v=Object.entries(b).filter(([f,_])=>u[f]!==_),x=h.filter(([f,_])=>u[f]===_).map(([f])=>f),E=Object.fromEntries(Object.entries({...u,...b}).filter(([f])=>!x.includes(f)));for(const[f,_]of v)l=S(l,[...s,w,f],_);for(const f of x)l=Ne(l,[...s,w,f]);for(const[f,_]of h){const O=u[f];O!==void 0&&O!==_&&c.push(`${r}/${u.queue}: ${f} is no longer declared by defineQueue, but it was changed by hand to ${JSON.stringify(O)} from the declared ${JSON.stringify(_)}, so it was kept. Delete it from wrangler.jsonc if it should go.`)}return(v.length>0||x.length>0)&&m.push(`${r}/${u.queue} (${[...v.map(([f])=>f),...x.map(f=>`removed ${f}`)].join(", ")})`),Object.keys(b).length>0&&(d[u.queue]=b),E}),owned:d,text:l,updated:m,warnings:c}},Oe=(e,n,s,t)=>{const o=n.queues??{},i=o.producers??[],r=o.consumers??[],d=new Set(i.map(g=>g?.binding)),m=new Set(r.map(g=>g.queue)),c=s.filter(g=>!d.has(g.bindingName)),l=s.filter(g=>!m.has(g.name)),p=G(e,r,["queues","consumers"],g=>s.find(b=>b.name===g.queue),t);let u=p.text;const w={...p.owned};if(c.length>0||l.length>0){const g=[...i,...c.map(h=>({binding:h.bindingName,queue:h.name}))],b=[...p.entries,...l.map(h=>({queue:h.name,...h.mode==="pull"?{type:"http_pull"}:{},...R(h)}))];for(const h of l){const v=R(h);Object.keys(v).length>0&&(w[h.name]=v)}u=S(u,["queues"],{consumers:b,producers:g})}return{added:[...c.map(g=>`queues.producers/${g.bindingName}`),...l.map(g=>`queues.consumers/${g.name}`)],owned:w,text:u,updated:p.updated,warnings:p.warnings}},Ee=(e,n,s,t,o)=>{const i=n.env?.[t],r=i?.queues?.consumers??[],d=i?.queues?.producers??[],m=u=>{const w=d.find(g=>g?.queue===u.queue)?.binding;return w!==void 0?s.find(g=>g.bindingName===w):s.find(g=>g.name===u.queue&&!d.some(b=>b?.binding===g.bindingName))},c=G(e,r,["env",t,"queues","consumers"],m,o,new Set(["dead_letter_queue"])),l=r.filter(u=>u.queue!==void 0&&m(u)===void 0).map(u=>`env.${t}.queues.consumers/${String(u.queue)}: no defineQueue export matches it — this block declares no producer mapping one of their bindings to "${String(u.queue)}", and no export is named that — so it was not retuned. A consumer for a queue another worker produces is skipped the same way.`),p=r.flatMap(u=>{const w=m(u)?.tuning.deadLetterQueue;return w===void 0||u.dead_letter_queue!==void 0?[]:[`env.${t}.queues.consumers/${String(u.queue)}: defineQueue declares deadLetterQueue "${w}", but this consumer has no dead_letter_queue, so its exhausted messages are dropped. Queue names differ per environment, so reconcile does not write it here; add it by hand.`]});return{added:[],owned:c.owned,text:c.text,updated:c.updated,warnings:[...c.warnings,...p,...l]}},ke=(e,n)=>{if(e?.lunoraIsForeign===!0)return n.push(`${e.path}: \`lunora\` is not an object, so the queue tuning ownership record cannot be read or written — an option removed from defineQueue stays deployed.`),{};const s=e?.lunora?.[P],t=o=>typeof o=="object"&&o!==null&&!Array.isArray(o);return s===void 0?{}:!t(s)||!Object.values(s).every(o=>t(o)&&Object.values(o).every(i=>t(i)))?(n.push(`${e?.path??"package.json"}: \`lunora.${P}\` is not a map of scope → queue → fields, so it is ignored — an option removed from defineQueue stays deployed until the next pass records it again.`),{}):s},$e=(e,n,s)=>{const t=Object.fromEntries(Object.entries({...n,...s}).filter(([,o])=>Object.keys(o).length>0));se(e,P,Object.keys(t).length===0?void 0:t)},j="PIPELINES",I="ARTIFACTS",Ae=(e,n)=>{const s=e.flagshipBinding!==void 0&&!(n?.flagship??[]).some(d=>d.binding===e.flagshipBinding),t=e.usesPipelines&&!(n?.pipelines??[]).some(d=>d.binding===j),o=e.usesArtifacts?n?.artifacts??[]:[],i=o.some(d=>d.binding===I)?[]:o.flatMap(d=>d.binding===void 0?[]:[d.binding]);return[[e.usesKv&&(n?.kv_namespaces?.length??0)===0,"@lunora/bindings/kv is used but no kv_namespaces binding exists; add a kv_namespaces entry ({ binding, id }) and pass env.<BINDING> to createKv() — the namespace id can't be auto-provisioned."],[e.usesHyperdrive&&(n?.hyperdrive?.length??0)===0,"@lunora/hyperdrive is used but no hyperdrive binding exists; run 'wrangler hyperdrive create' and add a 'hyperdrive' binding ({ binding, id }) — the id can't be auto-provisioned."],[t,`ctx.pipelines is used but no "${j}" pipelines binding exists; run 'wrangler pipelines create <name>' and add a 'pipelines' binding ({ binding: "${j}", stream }) — codegen resolves this one name, and the pipeline resource can't be auto-provisioned.`],[e.usesArtifacts&&o.length===0,ce(e.jurisdiction)],[i.length>0,`ctx.artifacts is used and ${i.map(d=>`"${d}"`).join(", ")} ${i.length===1?"is":"are"} bound, but none is named "${I}"; make sure \`.artifacts()\` on defineApp points ctx.artifacts at it — otherwise it reads env.${I} and throws.`],[s,`lunora/flags.ts uses Flagship in binding mode but no flagship binding "${e.flagshipBinding??""}" exists; add a flagship entry ({ binding: "${e.flagshipBinding??""}", app_id }) — the app_id can't be auto-provisioned.`]].filter(([d])=>d).map(([,d])=>d)},qe=e=>[[e.usesX402Charge,"@lunora/x402/charge is used; set the recipient wallet address as a [vars] entry (the var name is your choice) and pass it to the charge config — the x402 facilitator settles USDC to that address."],[e.usesX402,"@lunora/x402/pay is used (ActionCtx-only, spends real funds); add a secrets_store_secrets[] binding holding the agent wallet key (binding name == signer.secretName) and pair the pay rail with a spend policy — ctx.secrets reads a Secrets Store binding, not .dev.vars."]].filter(([s])=>s).map(([,s])=>s),D=(e,n,s)=>s.filter(t=>!t.exported).map(t=>`${e} "${t.exportName}" is declared but ${t.className} is not exported by the worker entry; add \`export * from "./lunora/_generated/${n}"\` so its binding can be provisioned.`),Ce=(e,n)=>{const s=new Set([...e.workflows,...e.agents].map(i=>i.className));if(s.size===0)return[];const t=Object.entries(n.exports??{}).flatMap(([i,r])=>r?.type==="workflow"?[i]:[]),o=(n.workflows??[]).flatMap(i=>i.class_name===void 0||i.script_name!==void 0?[]:[i.class_name]);return[...new Set([...t,...o])].filter(i=>!s.has(i)).map(i=>`wrangler.jsonc declares workflow "${i}" but no defineWorkflow/defineAgent export generates that class — a leftover from a rename will fail the deploy (wrangler rejects a class the worker does not export). Remove it if it is not hand-wired.`)},je=(e,n)=>{if(e.queues.length===0)return[];const s=new Set(e.queues.map(o=>o.name)),t=new Set(e.queues.map(o=>o.bindingName));return[...(n.queues?.consumers??[]).flatMap(o=>{const{queue:i}=o;return i===void 0||s.has(i)?[]:[`wrangler.jsonc subscribes queues.consumers[] to "${i}" but no defineQueue export declares that queue — a leftover from a rename keeps delivering batches this worker has no handler for (they retry to exhaustion, then drop or dead-letter). Remove it if it is not hand-wired.`]}),...(n.queues?.producers??[]).flatMap(o=>{const i=o?.binding;return i===void 0||t.has(i)?[]:[`wrangler.jsonc declares queues.producers[] binding "${i}" but no defineQueue export declares it — a leftover from a rename. Remove it if it is not hand-wired.`]})]},Ie=(e,n)=>[...Ce(e,n),...je(e,n)],U=[{keys:["STRIPE_SECRET_KEY","STRIPE_WEBHOOK_SECRET"],label:"Stripe"},{keys:["POLAR_ACCESS_TOKEN","POLAR_WEBHOOK_SECRET"],label:"Polar"},{keys:["CREEM_API_KEY","CREEM_WEBHOOK_SECRET"],label:"Creem"},{keys:["AUTUMN_SECRET_KEY","AUTUMN_WEBHOOK_SECRET"],label:"Autumn"},{keys:["DODO_PAYMENTS_API_KEY","DODO_PAYMENTS_WEBHOOK_KEY"],label:"Dodo Payments"}],De=()=>U.map(({keys:e,label:n})=>`${e[0]} + ${e[1]} (${n})`).join(" or "),Te=e=>{let n;try{n=X(Q(e,ue),"utf8")}catch{return!1}const s=new Map(ge(n).map(t=>[t.key,t.value]));return U.some(({keys:t})=>t.every(o=>(s.get(o)??"")!==""))},Be=(e,n)=>{const s=n?.secrets?.required;if(!Array.isArray(s))return[];const t=new Set(s),o=me(le(e)).map(i=>i.key).filter(i=>!t.has(i));return o.length===0?[]:[`wrangler.jsonc declares secrets.required without ${o.join(", ")}, which this app needs — wrangler dev loads only the listed keys from .dev.vars, so add ${o.length===1?"it":"them"} to secrets.required.`]},T=(e,n,s)=>{const t=new Set(e.durableObjects.map(d=>d.className)),o=[],i=(s?.r2_buckets?.length??0)>0,r=(s?.d1_databases?.some(d=>d.binding==="DB")??!1)||e.needsD1;return e.usesStorage&&!i&&o.push("@lunora/storage is used but R2 bucket bindings have user-defined names; add an r2_buckets entry and pass env.<BINDING> to createStorage()."),e.usesAuth&&!t.has("SessionDO")&&!r&&o.push("@lunora/auth is used but the worker entry exports no SessionDO; sessions are D1-backed, or export SessionDO to enable DO-backed sessions."),e.usesScheduler&&!t.has("SchedulerDO")&&o.push("@lunora/scheduler is used but the worker entry exports no SchedulerDO; export it so the SCHEDULER binding can be provisioned."),o.push(...D("container","containers",e.containers),...D("workflow","workflows",e.workflows),...D("agent","agents",e.agents)),e.containers.length>0&&s?.observability?.enabled===!1&&o.push("containers are declared but observability is explicitly disabled in wrangler.jsonc — container logs will not be captured."),e.usesPayments&&!Te(n)&&o.push(`@lunora/payment is used; set one provider's secret pair in .dev.vars — ${De()}.`),o.push(...qe(e),...Ae(e,s),...Be(e,s)),s!==void 0&&o.push(...Ie(e,s)),o},H="<replace-with-d1-create-id>",Re=e=>[["container","containers",e.containers],["workflow","workflows",e.workflows],["agent","agents",e.agents]].flatMap(([s,t,o])=>o.filter(i=>!i.exported).map(({className:i,exportName:r})=>({className:i,exportName:r,kind:s,module:t}))),Pe=e=>{const n=new Set(B(e).map(t=>t.tag));let s=1;for(;n.has(`v${String(s)}`);)s+=1;return`v${String(s)}`},Le=e=>{const n=new Set;for(const s of B(e)){for(const t of C(s.deleted_classes))n.delete(t);for(const{from:t,to:o}of B(s.renamed_classes))t!==void 0&&n.delete(t),o!==void 0&&n.add(o);for(const t of[...C(s.new_classes),...C(s.new_sqlite_classes)])n.add(t)}return n},Me=(e,n,s)=>{const t=n.durable_objects?.bindings??[],o=new Set(t.map(l=>l.name)),i=s.filter(l=>!o.has(l.binding));let r=e;const d=[];if(i.length>0){const l=[...t,...i.map(p=>({class_name:p.className,name:p.binding}))];r=S(r,["durable_objects","bindings"],l),d.push(...i.map(p=>`${p.binding}/${p.className}`))}const m=n.migrations??[],c=s.map(l=>l.className).filter(l=>!Le(m).has(l));if(c.length>0){const l=[...m,{new_sqlite_classes:c,tag:Pe(m)}];r=S(r,["migrations"],l)}return{added:d,text:r}},We=(e,n)=>{const s=n.d1_databases??[];if(s.some(i=>i.binding==="DB"))return{added:[],text:e};const t=typeof n.name=="string"&&n.name.length>0?n.name:"lunora",o=[...s,{binding:"DB",database_id:H,database_name:t}];return{added:["DB (D1)"],text:S(e,["d1_databases"],o)}},Ke={ai:{binding:"AI",label:"AI (Workers AI)"},analytics:{binding:"ANALYTICS_SQL",label:"ANALYTICS_SQL (Analytics SQL)"},browser:{binding:"BROWSER",label:"BROWSER (Browser Rendering)"},images:{binding:"IMAGES",label:"IMAGES (Cloudflare Images)"}},$=(e,n,s)=>{const{binding:t,label:o}=Ke[s],i=n[s]?.binding;return typeof i=="string"&&i.length>0?{added:[],text:e}:{added:[o],text:S(e,[s],{binding:t})}},Fe=(e,n)=>e.usesAnalyticsSql&&he(n,new Set(["analyticsSql"]))?.chained.has("analyticsSql")!==!0,Qe=new Set(["ratelimits","send_email"]),Ye=["durable_objects","logfwdr","unsafe"],Ge=new Set(["data_blobs","text_blobs","vars","wasm_modules"]),M=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),L=(e,n,s)=>M(e)&&e[n]===s,Ue=(e,n,s)=>{if(Ge.has(e))return M(n)&&Object.hasOwn(n,s);const t=Qe.has(e)?"name":"binding";return Array.isArray(n)?n.some(o=>L(o,t,s)):L(n,"binding",s)},He=(e,n)=>{const s=e,t=Object.entries(s).find(([i,r])=>i!=="env"&&Ue(i,r,n));if(t!==void 0)return t[0];for(const i of Ye){const r=s[i];if(M(r)&&Array.isArray(r.bindings)&&r.bindings.some(d=>L(d,"name",n)))return`${i}.bindings`}if(e.queues?.producers?.some(i=>i?.binding===n)===!0)return"queues.producers";const o=e.secrets?.required;if(Array.isArray(o)&&o.includes(n))return"secrets.required"},F=(e,n,s,t,o)=>{if((n[s]?.length??0)>0)return{added:[],text:e};const i=He(n,t.binding);return i!==void 0?{added:[],text:e,warnings:[`${s}: not adding ${JSON.stringify(t)} — the name "${t.binding}" is already bound by \`${i}\` in wrangler.jsonc. Add a ${s} entry under another binding name and point the matching \`defineApp()\` override at it.`]}:{added:[o],text:S(e,[s],[t])}},Je=(e,n)=>{const s=n.worker_loaders??[];return s.some(t=>t.binding==="LOADER")?{added:[],text:e}:{added:["LOADER (Worker Loader)"],text:S(e,["worker_loaders"],[...s,{binding:"LOADER"}])}},Ve=e=>{if(typeof e=="string")return e;const n={};return e.diskMb!==void 0&&(n.disk_mb=e.diskMb),e.memoryMib!==void 0&&(n.memory_mib=e.memoryMib),e.vcpu!==void 0&&(n.vcpu=e.vcpu),n},Xe=e=>{const{image:n}=e;return n.kind==="dockerfile"?n.dockerfilePath:n.kind==="registry"?n.reference:ee(e.exportName)},J=e=>{const n={};for(const[s,t]of Object.entries(e.images??{}))n[s]=t.kind==="registry"?{image:t.reference}:{build_context:t.buildContext,dockerfile:t.dockerfilePath,...e.buildArgs===void 0?{}:{build_vars:e.buildArgs}};return{class_name:e.className,scheduling_policy:"durable_object",...Object.keys(n).length>0?{images:n}:{},...e.name===void 0?{}:{name:e.name}}},ze=e=>{if(e.schedulingPolicy==="durable_object")return J(e);const{image:n}=e,s={class_name:e.className,image:Xe(e)};return n.kind==="dockerfile"&&(s.image_build_context=n.buildContext),e.buildArgs!==void 0&&n.kind!=="registry"&&(s.image_vars=e.buildArgs),e.instanceType!==void 0&&(s.instance_type=Ve(e.instanceType)),e.maxInstances!==void 0&&(s.max_instances=e.maxInstances),e.name!==void 0&&(s.name=e.name),e.rollout?.stepPercentage!==void 0&&(s.rollout_step_percentage=e.rollout.stepPercentage),e.rollout?.gracePeriodSeconds!==void 0&&(s.rollout_active_grace_period=e.rollout.gracePeriodSeconds),s},Ze=(e,n,s)=>{const t=n.containers??[],o=new Set(t.map(c=>c.class_name)),i=s.filter(c=>!o.has(c.className));let r=i.length===0?e:S(e,["containers"],[...t,...i.map(c=>ze(c))]);const d=[],m=[];for(const[c,l]of t.entries()){const p=s.find(g=>g.className===l.class_name);if(p===void 0)continue;const u=p.schedulingPolicy??"default";if((l.scheduling_policy??"default")!==u){m.push(`containers/${p.className} has scheduling_policy "${l.scheduling_policy??"default"}" in wrangler.jsonc but defineContainer "${p.exportName}" declares "${u}" — the policy is immutable, so replace the entry (and its container application) by hand.`);continue}const w=p.schedulingPolicy==="durable_object"?J(p).images:void 0;w!==void 0&&JSON.stringify(l.images)!==JSON.stringify(w)&&(r=S(r,["containers",c,"images"],w),d.push(`containers/${p.className}.images`))}return{added:i.map(c=>`containers/${c.className}`),text:r,updated:d,warnings:m}},en=(e,n)=>{if(n.observability!==void 0)return{added:[],text:e};const s=S(e,["observability"],{...we});return{added:["observability"],text:s}},nn=(e,n)=>n.upload_source_maps!==void 0?{added:[],text:e}:{added:["upload_source_maps"],text:S(e,["upload_source_maps"],!0)},V=[{minimum:[4,142],name:"wrangler"},{minimum:[1,61],name:"@cloudflare/vite-plugin"}],sn=V.map(({minimum:e,name:n})=>`${n}@^${e.join(".")}.0`).join(" "),tn=(e,n)=>{try{const s=Z(Q(e,"package.json")).resolve(`${n}/package.json`),[t=0,o=0]=String(ne(s).version).split(".").map(Number);return[t,o]}catch{return}},on=e=>{const n=V.flatMap(({minimum:s,name:t})=>{const o=tn(e,t);return o!==void 0&&(o[0]<s[0]||o[0]===s[0]&&o[1]<s[1])?[`${t} ${o.join(".")} (needs >= ${s.join(".")})`]:[]});return n.length===0?void 0:`workflows are declared in wrangler \`exports\`, which ${n.join(" and ")} cannot run — reconcile left workflows[] untouched. Upgrade (\`pnpm add -D ${sn}\`) and re-run.`},rn=e=>Object.entries(e.env??{}).flatMap(([n,s])=>Array.isArray(s?.workflows)?[`env.${n}.workflows declares workflow bindings, but Lunora now declares workflows in \`exports\` and resolves them on ctx.exports — move them to that environment's own \`exports\` by hand.`]:[]),an=(e,n,s)=>{let t=e;const o=[],i=[];for(const r of s){const d=n[r.className];if(d?.type==="workflow")for(const{of:m,path:c}of be){const l=m(r),p=Y(d,c),u=`exports/${r.className}.${c.join(".")}`;if(l===void 0){p!==void 0&&i.push(`${u} is set in wrangler.jsonc but defineWorkflow "${r.exportName}" does not declare it — reconcile leaves it in place. Remove it by hand if it was dropped from the definition.`);continue}JSON.stringify(p)!==JSON.stringify(l)&&(t=S(t,["exports",r.className,...c],l),o.push(u))}}return{text:t,updated:o,warnings:i}},dn=(e,n,s,t,o)=>{if(o!==void 0)return{added:[],text:e,warnings:[o]};const i=[...s.map(b=>({settings:pe(b),workflow:b})),...t.map(b=>({settings:{},workflow:b}))],r=new Set(i.map(({workflow:b})=>b.className)),d=n.workflows??[],m=d.filter(b=>b.script_name===void 0&&b.class_name!==void 0&&r.has(b.class_name)),c=n.exports??{},l=[],p=[],u=[];let w=e;for(const{settings:b,workflow:h}of i){if(c[h.className]!==void 0&&c[h.className]!==null)continue;const v=m.find(f=>f.class_name===h.className),x=Object.fromEntries(fe.flatMap(f=>{const _=Y(v,[f]);return _===void 0?[]:[[f,_]]})),E=v?.name??h.name;v?.name!==void 0&&v.name!==h.name&&u.push(`workflows/${h.className} is deployed as "${v.name}" but declared as "${h.name}" — its export keeps "${v.name}" so running instances survive. Change the declaration to match, or rename deliberately (it starts a new, empty workflow).`),w=S(w,["exports",h.className],{type:"workflow",...x,...b,name:E}),(v===void 0?l:p).push(`exports/${h.className}`)}if(m.length>0){const b=d.filter(h=>!m.includes(h));w=S(w,["workflows"],b.length===0?void 0:b),p.push(...m.map(h=>`workflows/${String(h.class_name)} → exports`))}u.push(...rn(n));const g=an(w,c,s);return{added:l,text:g.text,updated:[...p,...g.updated],warnings:[...u,...g.warnings]}},On=(e,n,{environment:s,target:t}={})=>{const o=ve(e),i=Re(n);if(!o)return{added:[],changed:!1,exportGaps:i,reason:"wrangler.jsonc not found",updated:[],warnings:T(n,e)};const{parsed:r,text:d}=_e(o);if(r===void 0)return{added:[],changed:!1,exportGaps:i,reason:`failed to parse ${o} as JSONC`,updated:[],warnings:T(n,e),wranglerPath:o};const m=T(n,e,r);if(s!==void 0){const a=r.env?.[s]!==void 0;m.push(a?`auto-provisioned bindings are written to the top level of wrangler.jsonc only (queue consumers "env.${s}" already declares are retuned, nothing is added) — "env.${s}" has its own (non-inheritable) bindings and must be reconciled by hand; \`lunora deploy --env ${s}\` now validates them, so a gap here will be reported at deploy time.`:`--env "${s}" was requested but wrangler.jsonc declares no "env.${s}" block — auto-provisioned bindings are written to the top level only and will not apply to that environment.`)}const c=n.containers.filter(a=>a.exported),l=n.agents.filter(a=>a.exported&&a.voice===!0&&a.voiceBindingName!==void 0&&a.voiceClassName!==void 0),p=[...n.durableObjects,...c.map(a=>({binding:a.bindingName,className:a.className})),...l.map(a=>({binding:a.voiceBindingName,className:a.voiceClassName}))],u=n.workflows.filter(a=>a.exported),w=n.agents.filter(a=>a.exported),g=K(e),b=ke(g,m),h={},v=ie(g);let x;const E=[{enabled:!0,run:a=>Me(a,r,p)},{enabled:n.needsD1,run:a=>We(a,r)},{enabled:n.usesAi,run:a=>$(a,r,"ai")},{enabled:n.usesAiSearch,run:a=>F(a,r,"ai_search_namespaces",{binding:"AI_SEARCH",namespace:"default"},"AI_SEARCH (AI Search namespace)")},{enabled:Fe(n,e),run:a=>$(a,r,"analytics")},{enabled:n.usesBrowser,run:a=>$(a,r,"browser")},{enabled:n.usesImages,run:a=>$(a,r,"images")},{enabled:n.usesAnalytics,run:a=>F(a,r,"analytics_engine_datasets",{binding:"ANALYTICS",dataset:"ANALYTICS"},"ANALYTICS (Analytics Engine)")},{enabled:n.usesWorkerLoader,run:a=>Je(a,r)},{enabled:!0,run:a=>en(a,r)},{enabled:t===void 0||t==="cloudflare",run:a=>nn(a,r)},{enabled:c.length>0,run:a=>Ze(a,r,c)},{enabled:u.length>0||w.length>0,run:a=>dn(a,r,u,w,on(e))},{enabled:n.queues.length>0,run:a=>{const y=Oe(a,r,n.queues,b.queues??{});return h.queues=y.owned,y}},{enabled:n.services!==void 0&&(n.services.length>0||Object.keys(v).length>0),run:a=>{const y=re(a,r,n.services??[],v);return x=y.owned,y}},...s===void 0||r.env?.[s]===void 0?[]:[{enabled:n.queues.length>0,run:a=>{const y=`env.${s}.queues`,k=Ee(a,r,n.queues,s,b[y]??{});return h[y]=k.owned,k}}]];let f=d;const _=[],O=[];for(const a of E){if(!a.enabled)continue;const y=a.run(f);f=y.text,_.push(...y.added),O.push(...y.updated??[]),m.push(...y.warnings??[])}const W=a=>{if(g===void 0)return;const y=x,k=[...Object.keys(h).length>0?[{consequence:"an option removed from defineQueue stays deployed",key:"queueTuning",label:"queue tuning",write:N=>{$e(N,b,h)}}]:[],...y===void 0?[]:[{consequence:"a service removed from lunora.config stays bound",key:"services",label:"service bindings",write:N=>{de(N,y)}}]];for(const N of k)try{N.write(K(e)??g)}catch(q){m.push(`${a?"wrangler.jsonc was updated, but ":""}recording the ${N.label} reconcile owns in ${g.path} (lunora.${N.key}) failed: ${q instanceof Error?q.message:String(q)}. Until it is recorded, ${N.consequence}.`)}};let A;if(n.services!==void 0){const a=ae(e,n.services,v);m.push(...a.warnings),x={...x,...a.owned},A=a.added.length>0||a.updated.length>0?{added:a.added,path:a.path,updated:a.updated}:void 0}return _.includes("DB (D1)")&&m.push(`wrote a DB binding with a placeholder database_id ("${H}") — run \`wrangler d1 create <name>\` and replace it before deploying.`),f===d?(W(!1),{added:_,changed:!1,devConfig:A,exportGaps:i,reason:"bindings already in sync",updated:O,warnings:m,wranglerPath:o}):(z(o,f,"utf8"),W(!0),{added:_,changed:!0,devConfig:A,exportGaps:i,updated:O,warnings:m,wranglerPath:o})};export{Re as collectExportGaps,On as reconcileWranglerBindings};
@@ -0,0 +1 @@
1
+ const n=()=>{const e=new Map;return{clear:()=>{e.clear()},memo:(r,c)=>{if(e.has(r))return e.get(r);const t=c();return e.set(r,t),t}}};export{n as createDiscoveryCache};
@@ -0,0 +1 @@
1
+ import{discoverContainers as s,CONTAINERS_FILENAME as t}from"@lunora/codegen";import{d}from"./discover-info-DC2MrAIM.mjs";const e=(n,o)=>{const{error:r,value:i}=d(n,o,t,s,{skipFileDependencyResolution:!0});return r===void 0?{containers:i??[]}:{containers:[],error:r}},I=(n,o,r)=>r===void 0?e(n,o):r.memo(`containers:${n}:${o}`,()=>e(n,o));export{I as discoverContainerInfo};
@@ -0,0 +1 @@
1
+ import{existsSync as d}from"node:fs";import{discoverSchema as l,isHyperdriveGlobalTable as f,isD1GlobalTable as b}from"@lunora/codegen";import{Project as u}from"ts-morph";import{join as p}from"node:path";const a=e=>{if(e?.kind==="optional")return a(e.inner);if(e?.kind==="union"){const s=new Set((e.members??[]).filter(i=>i.kind!=="null").map(i=>a(i)));return s.size===1?[...s][0]:e.kind}return e?.kind},m=(e,s)=>{const i=p(e,s,"schema.ts");if(!d(i))return{info:void 0};try{const o=new u({skipAddingFilesFromTsConfig:!0,useInMemoryFileSystem:!1}),r=l(o,i,e),c=n=>r.tables.find(t=>t.name===n)?.shape??{};return{info:{hasD1GlobalTable:r.tables.some(n=>b(n)),hasHyperdriveGlobalTable:r.tables.some(n=>f(n)),...r.jurisdiction===void 0?{}:{jurisdiction:r.jurisdiction},vectorIndexNames:r.vectorIndexes.map(n=>n.name),vectorMetadata:r.vectorIndexes.flatMap(n=>(n.metadata??[]).map(t=>({index:n.name,kind:a(c(n.table)[t]),property:t})))}}}catch(o){return{error:o instanceof Error?o.message:String(o),info:void 0}}},I=(e,s,i)=>i===void 0?m(e,s):i.memo(`schema:${e}:${s}`,()=>m(e,s));export{I as discoverSchemaInfo};
@@ -0,0 +1 @@
1
+ import{existsSync as P,statSync as j,readFileSync as F,readdirSync as B}from"node:fs";import{discoverFlags as L,FLAGS_FILENAME as k,discoverQueues as G,CAPABILITY_PROBES as N,readServiceBindings as W,discoverNotifyChannels as Y,NOTIFY_FILENAME as K,mayReadCapabilityContext as q,foldCapabilitySignals as C,capabilitiesUsedBy as M,sourceCapabilitySignals as U}from"@lunora/codegen";import{init as H}from"es-module-lexer";import{Project as X}from"ts-morph";import{discoverAgentInfo as Q}from"./discoverAgentInfo-pqFMJBtJ.mjs";import{discoverContainerInfo as V}from"./discoverContainerInfo-DzXr7Vm3.mjs";import{escapeRegExp as J}from"./DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";import{d as _}from"./discover-info-DC2MrAIM.mjs";import{relative as z,sep as Z,isAbsolute as ee,join as b}from"node:path";import{P as se}from"./package-secrets-registry-BeheNwsP.mjs";import{discoverSchemaInfo as te}from"./discoverSchemaInfo-BBRlXZop.mjs";import{resolveWorkerEntry as re,composedEntryDurableObjects as ne,GENERATED_DIRECTORY as I,DURABLE_OBJECT_BINDINGS as oe,detectExportedDurableObjects as ae,detectClassExports as x,isMergedProject as ie}from"./COMPOSED_WORKER_ENTRY-Ciiba5g_.mjs";import{discoverWorkflowInfo as ce}from"./discoverWorkflowInfo-zW7Tt0Tn.mjs";const de="https://api.cloudflare.com/client/v4/accounts/<ACCOUNT_ID>/artifacts/namespaces",ue=e=>{const s='add an "artifacts" binding ({ binding: "ARTIFACTS", namespace }) — codegen reads env.ARTIFACTS unless `.artifacts()` on defineApp points ctx.artifacts at another binding';return e===void 0?`ctx.artifacts is used; ${s}. The namespace is created by the first repo create() if it does not exist yet.`:`ctx.artifacts is used and the schema pins data to "${e}"; create the namespace in that jurisdiction BEFORE the first repo, with POST ${de} and body { "namespace": "<name>", "jurisdiction": "${e}" }, then ${s}. A namespace's jurisdiction cannot be changed, and one created implicitly by the first repo create() is unrestricted.`},le=(e,s)=>{const{error:r,value:t}=_(e,s,k,L);return r===void 0?{flags:t}:{error:r}},me=(e,s)=>{const r=z(s,e);return r!==""&&r!==".."&&!r.startsWith(`..${Z}`)&&!ee(r)},pe=(e,s)=>{const{error:r,value:t}=_(e,s,void 0,G);return r===void 0?{queues:t??[]}:{error:r,queues:[]}},he=new Set([".cjs",".cts",".js",".jsx",".mjs",".mts",".ts",".tsx"]),fe=new Set([".git",".lunora-cache",".wrangler","dist",I,"node_modules"]),ge=["lunora","src"],be=/\benv\s*\.\s*DB\b/,ye=/\benv\s*\.\s*AI\b/,$=["ai","aiSearch","analytics","analyticsSql","artifacts","browser","hyperdrive","images","kv","mail","notify","payments","pipelines","r2sql","scheduler","storage","x402"],D=e=>`uses${e.charAt(0).toUpperCase()}${e.slice(1)}`,T=[["usesAuth","@lunora/auth"],["usesCimdWorkers","@lunora/auth/cimd/workers"],["usesX402Charge","@lunora/x402/charge"],["usesPaymentAutumn","@lunora/payment/autumn"],["usesPaymentCreem","@lunora/payment/creem"],["usesPaymentDodopayments","@lunora/payment/dodopayments"],["usesPaymentPolar","@lunora/payment/polar"],["usesPaymentStripe","@lunora/payment/stripe"]],O=[...$.map(e=>[D(e),N[e].moduleSpecifier]),...T].toSorted(([e],[s])=>e.localeCompare(s)),Se=[["usesNotifyFcm","@lunora/notify:fcm"],["usesNotifyWebPush","@lunora/notify:webPush"]],ve=["@lunora/agent","@lunora/agent/sandbox"],Ee=new RegExp(String.raw`["'\x60](?:${[...O.map(([,e])=>e),...ve].map(e=>J(e)).join("|")})["'\x60]`,"u"),a=e=>{const{contextProperty:s,moduleSpecifier:r}=N[e];return s===void 0?`${r} is imported`:`${r} is imported or ctx.${s} is read`},Ae="STRIPE_SECRET_KEY + STRIPE_WEBHOOK_SECRET (Stripe) or POLAR_ACCESS_TOKEN + POLAR_WEBHOOK_SECRET (Polar)",xe=()=>{let e;return()=>(e??=new X({compilerOptions:{allowJs:!0},useInMemoryFileSystem:!0}),e)},Ie=(e,s,r)=>{const t=r(),n=t.createSourceFile(`/scan/${s.slice(s.lastIndexOf("/")+1)}`,e,{overwrite:!0}),o=U(n);return t.removeSourceFile(n),o},w=(e,s)=>{let r;try{r=B(e,{withFileTypes:!0})}catch{return}for(const t of r){if(t.isDirectory()){fe.has(t.name)||w(b(e,t.name),s);continue}const n=t.name.lastIndexOf(".");n!==-1&&he.has(t.name.slice(n))&&s.push(b(e,t.name))}},_e=(e,s,r)=>{const{info:t}=te(e,s,r);return{jurisdiction:t?.jurisdiction,needsD1:t?.hasD1GlobalTable??!1}},Re=(e,s,r)=>{const t=xe(),n=b(e,r),o=[],d=[];let u=!1,i=!1;for(const l of s){const p=b(e,l);if(!P(p)||!j(p).isDirectory())continue;const f=[];w(p,f);for(const m of f){const c=F(m,"utf8"),A=me(m,n);u||=ye.test(c),i||=be.test(c),(Ee.test(c)||A&&q(c))&&(A?o:d).push(Ie(c,m,t))}}const h=C(o),y=C([h,...d]),S=new Set([...y.valueImports,...y.dynamicImports]),v=M({contextReads:h.contextReads,valueImports:S});return{...Object.fromEntries([...$.map(l=>[D(l),v.has(l)]),...T.map(([l,p])=>[l,S.has(p)])]),needsD1:i,usesAi:v.has("ai")||u,usesBrowser:v.has("browser")||h.sandboxTools.usesSandboxBrowser,usesWorkerLoader:h.sandboxTools.usesSandboxLoader}},Ce=(e,s,r)=>[...e.map(t=>t.exported?`${t.bindingName}/${t.className} (container "${t.exportName}" declared and exported)`:`hint: container "${t.exportName}" is declared but ${t.className} is not exported by the worker entry — add \`export * from "./lunora/_generated/containers"\``),...s.map(t=>t.exported?`exports.${t.className} (workflow "${t.exportName}" declared and exported)`:`hint: workflow "${t.exportName}" is declared but ${t.className} is not exported by the worker entry — add \`export * from "./lunora/_generated/workflows"\``),...r.map(t=>t.exported?`exports.${t.className} (agent "${t.exportName}" declared and exported)`:`hint: agent "${t.exportName}" is declared but ${t.className} is not exported by the worker entry — add \`export * from "./lunora/_generated/agents"\``)],Ne=(e,s,r)=>[[e.usesAi,`AI (${a("ai")}, or env.AI is used)`],[e.usesAuth&&!s.has("SessionDO"),"hint: @lunora/auth is imported; its tables are D1-backed by default. For DO-backed auth (what @better-auth/scim needs), pass `namespace` to .auth() and export the generated auth DO class"],[e.usesScheduler&&!s.has("SchedulerDO"),`hint: ${a("scheduler")}, but no SchedulerDO is exported by the worker entry`],[e.usesStorage,`hint: ${a("storage")}; add an r2_buckets binding (bucket binding names are user-defined)`],[e.usesMail,`hint: ${a("mail")}; set RESEND_API_KEY in .dev.vars (obtain at https://resend.com/api-keys)`],[e.usesPayments,`hint: ${a("payments")}; set the provider secrets in .dev.vars — ${Ae}`],[e.usesBrowser,`browser (${a("browser")}, or a sandbox browserTool imported in lunora/) — self-describing { binding: BROWSER }`],[e.usesImages,`images (${a("images")}) — self-describing { binding: IMAGES }`],[e.usesAnalytics,`analytics_engine_datasets (${a("analytics")}) — self-describing { binding: ANALYTICS, dataset }`],[e.usesWorkerLoader,"worker_loaders (jsCodeTool imported in lunora/) — self-describing { binding: LOADER }"],[e.usesAiSearch,`ai_search_namespaces (${a("aiSearch")}) — self-describing { binding: AI_SEARCH, namespace: "default" }; remote-only, so \`lunora dev\` reaches the deployed AI Search service`],[e.usesAnalyticsSql,`analytics (${a("analyticsSql")}) — self-describing { binding: ANALYTICS_SQL }; needs wrangler >= 4.145.0, and is remote-only, so \`lunora dev\` queries the account's live analytics`],[e.usesKv,`hint: ${a("kv")}; add a kv_namespaces binding ({ binding, id }) and pass env.<BINDING> to createKv() — the namespace id can't be auto-provisioned`],[e.usesHyperdrive,`hint: ${a("hyperdrive")}; run 'wrangler hyperdrive create' and add a 'hyperdrive' binding ({ binding, id }) — the id can't be auto-provisioned`],[e.usesPipelines,`hint: ${a("pipelines")}; run 'wrangler pipelines create <name>' and add a 'pipelines' binding ({ binding, stream }) — the pipeline resource can't be auto-provisioned`],[e.usesArtifacts,`hint: ${ue(r.jurisdiction)}`],[e.usesX402Charge,"hint: @lunora/x402/charge is imported; set the recipient wallet address as a [vars] entry (the var name is yours to choose) and pass it to the charge config — the x402 facilitator settles USDC to that address"],[e.usesX402,`hint: ${a("x402")} (ActionCtx-only, spends real funds); add a secrets_store_secrets[] binding for the agent wallet key (name it to match signer.secretName) and pair the pay rail with a spend policy — ctx.secrets reads a Secrets Store binding, not .dev.vars, so the key can't be auto-provisioned`]].filter(([n])=>n).map(([,n])=>n),$e=(e,s,r,t=[],n=[],o=[])=>{const d=new Set(e.map(i=>i.className)),u=e.map(i=>`${i.binding}/${i.className} (exported by worker entry)`);return s.needsD1&&u.push("DB (.global() table declared)"),u.push(...Ce(t,n,o),...Ne(r,d,s)),u},Ke=async e=>{await H;const s=e.schemaDir??"lunora",r=e.scanDirs??ge,t=()=>Re(e.projectRoot,r,s),n=e.cache===void 0?t():e.cache.memo(`capabilities:${e.projectRoot}:${s}:${r.join(",")}`,t),o=re(e.projectRoot);let d;o.composed?d=ne(b(e.projectRoot,s,I)).map(R=>({binding:oe[R],className:R})):d=o.path===void 0?[]:ae(o.path);const u=_e(e.projectRoot,s,e.cache),i={...u,needsD1:n.needsD1||u.needsD1},h=x(o,V(e.projectRoot,s,e.cache).containers,"containers"),y=x(o,ce(e.projectRoot,s).workflows,"workflows"),S=x(o,Q(e.projectRoot,s).agents,"agents"),v=[...pe(e.projectRoot,s).queues],{flags:E}=le(e.projectRoot,s),l=_(e.projectRoot,s,K,Y),p=l.error===void 0?l.value:{hasFcm:!0,hasWebPush:!0},f=E?.provider==="flagship"&&E.mode==="binding"?E.bindingName:void 0,m=$e(d,i,n,h,y,S);!o.composed&&ie(b(e.projectRoot,s,I))&&!d.some(g=>g.className==="LunoraDO")&&m.push("hint: durableObjects.merge is set, but the worker entry exports no LunoraDO — export one built with mergeDurableObjects, or the classes stay separate"),f!==void 0&&m.push(`hint: lunora/flags.ts uses Flagship in binding mode; add a flagship binding ({ binding: "${f}", app_id }) — the app_id can't be auto-provisioned`);const c=W(e.projectRoot),A=c.error===void 0?c.services:void 0;return c.error!==void 0&&m.push(`hint: lunora.config \`services\` not reconciled — ${c.error}`),m.push(...c.services.map(g=>`${g.binding} → ${g.worker} (lunora.config services.${g.name})`)),{...n,agents:S,containers:h,durableObjects:d,flagshipBinding:f,...i.jurisdiction===void 0?{}:{jurisdiction:i.jurisdiction},needsD1:i.needsD1,queues:v,services:A,signals:m,usesFlags:E!==void 0,usesNotifyFcm:p?.hasFcm??!1,usesNotifyWebPush:p?.hasWebPush??!1,workflows:y}},qe=e=>[...O,...Se].filter(([s,r])=>e[s]&&se[r]!==void 0).map(([,s])=>s);export{ue as a,Ke as i,qe as s};
@@ -133,6 +133,8 @@ interface DriverToolchain {
133
133
  * host CLI builds each image from its Dockerfile during the deploy.
134
134
  */
135
135
  readonly prebuildsContainerImages: boolean;
136
+ /** The command that writes many secrets in one call, as a JSON object of name to value on stdin. Optional: hosts without it get one `secretPut` per key. */
137
+ secretBulk?: (request: SecretRequest) => ToolchainCommand;
136
138
  /** The command that lists remote secret names, when the host has a secret store. */
137
139
  secretList?: (request: SecretRequest) => ToolchainCommand;
138
140
  /** The command that writes one secret, when the host has a secret store. Its value is passed on stdin, never argv. */
@@ -180,6 +182,20 @@ interface DeployDriver {
180
182
  */
181
183
  readonly toolchain?: DriverToolchain;
182
184
  }
185
+ /**
186
+ * An invocation-scoped memo for project discovery. A CLI command creates one,
187
+ * threads it through every `discover*` / `inferLunoraBindings` call it makes,
188
+ * and clears it after anything rewrites the sources discovery reads (codegen).
189
+ * Deliberately not module-level: tests and long-lived processes never see a
190
+ * stale result.
191
+ */
192
+ interface DiscoveryCache {
193
+ /** Drop every memoised result. */
194
+ clear: () => void;
195
+ /** Return the result memoised under `key`, computing it on first use. */
196
+ memo: <T>(key: string, compute: () => T) => T;
197
+ }
198
+ declare const createDiscoveryCache: () => DiscoveryCache;
183
199
  /** One filterable Vectorize metadata property a schema declares. */
184
200
  interface VectorMetadataDeclaration {
185
201
  /** The vector index the property belongs to. */
@@ -225,13 +241,8 @@ interface DiscoverSchemaInfoResult {
225
241
  /** Schema facts, or `undefined` when no `schema.ts` exists or parsing failed. */
226
242
  info: SchemaInfo | undefined;
227
243
  }
228
- /**
229
- * Discover {@link SchemaInfo} for a project. Returns `{ info: undefined }` when
230
- * the project declares no `schema.ts` (not an error), or `{ info: undefined,
231
- * error }` when a present schema could not be parsed — callers decide whether a
232
- * parse failure is a warning (validator) or simply ignorable (inference).
233
- */
234
- declare const discoverSchemaInfo: (projectRoot: string, schemaDirectory: string) => DiscoverSchemaInfoResult;
244
+ /** Discover the schema facts, memoised on `cache` when one is given. */
245
+ declare const discoverSchemaInfo: (projectRoot: string, schemaDirectory: string, cache?: DiscoveryCache) => DiscoverSchemaInfoResult;
235
246
  interface DurableObjectSpec {
236
247
  binding: string;
237
248
  className: string;
@@ -440,6 +451,8 @@ interface InferredBindings {
440
451
  workflows: InferredWorkflow[];
441
452
  }
442
453
  interface InferOptions {
454
+ /** Memoises the source scans, so one CLI invocation parses the project once. */
455
+ cache?: DiscoveryCache;
443
456
  projectRoot: string;
444
457
  /** Directories (relative to root) to scan. Defaults to `lunora` + `src`. */
445
458
  scanDirs?: ReadonlyArray<string>;
@@ -464,4 +477,4 @@ declare const inferLunoraBindings: (options: InferOptions) => Promise<InferredBi
464
477
  * ({@link NOTIFY_CHANNEL_SECRETS}), keeping only sources that carry secrets.
465
478
  */
466
479
  declare const secretSourcesFromBindings: (bindings: InferredBindings) => string[];
467
- export { COMPOSED_WORKER_ENTRY as C, DeployDriver as D, GeneratedClassModule as G, InferredBindings as I, MERGED_DURABLE_OBJECTS_MODULE as M, ProjectionPurpose as P, SchemaInfo as S, ToolchainCommand as T, DURABLE_OBJECT_BINDINGS as a, DeployRequest as b, DevRequest as c, DiscoverSchemaInfoResult as d, DriverToolchain as e, GENERATED_CLASS_MODULES as f, GENERATED_MODULE_DURABLE_OBJECTS as g, InferOptions as h, InferredAgent as i, InferredContainer as j, InferredWorkflow as k, ProjectedConfig as l, SecretRequest as m, TailRequest as n, discoverSchemaInfo as o, inferLunoraBindings as p, isMergedProject as q, isMergedRoleModule as r, secretSourcesFromBindings as s };
480
+ export { COMPOSED_WORKER_ENTRY as C, DeployDriver as D, GeneratedClassModule as G, InferredBindings as I, MERGED_DURABLE_OBJECTS_MODULE as M, ProjectionPurpose as P, SchemaInfo as S, ToolchainCommand as T, DiscoveryCache as a, DURABLE_OBJECT_BINDINGS as b, DeployRequest as c, DevRequest as d, DiscoverSchemaInfoResult as e, DriverToolchain as f, GENERATED_CLASS_MODULES as g, GENERATED_MODULE_DURABLE_OBJECTS as h, InferOptions as i, InferredAgent as j, InferredContainer as k, InferredWorkflow as l, ProjectedConfig as m, SecretRequest as n, TailRequest as o, createDiscoveryCache as p, discoverSchemaInfo as q, inferLunoraBindings as r, isMergedProject as s, isMergedRoleModule as t, secretSourcesFromBindings as u };
@@ -133,6 +133,8 @@ interface DriverToolchain {
133
133
  * host CLI builds each image from its Dockerfile during the deploy.
134
134
  */
135
135
  readonly prebuildsContainerImages: boolean;
136
+ /** The command that writes many secrets in one call, as a JSON object of name to value on stdin. Optional: hosts without it get one `secretPut` per key. */
137
+ secretBulk?: (request: SecretRequest) => ToolchainCommand;
136
138
  /** The command that lists remote secret names, when the host has a secret store. */
137
139
  secretList?: (request: SecretRequest) => ToolchainCommand;
138
140
  /** The command that writes one secret, when the host has a secret store. Its value is passed on stdin, never argv. */
@@ -180,6 +182,20 @@ interface DeployDriver {
180
182
  */
181
183
  readonly toolchain?: DriverToolchain;
182
184
  }
185
+ /**
186
+ * An invocation-scoped memo for project discovery. A CLI command creates one,
187
+ * threads it through every `discover*` / `inferLunoraBindings` call it makes,
188
+ * and clears it after anything rewrites the sources discovery reads (codegen).
189
+ * Deliberately not module-level: tests and long-lived processes never see a
190
+ * stale result.
191
+ */
192
+ interface DiscoveryCache {
193
+ /** Drop every memoised result. */
194
+ clear: () => void;
195
+ /** Return the result memoised under `key`, computing it on first use. */
196
+ memo: <T>(key: string, compute: () => T) => T;
197
+ }
198
+ declare const createDiscoveryCache: () => DiscoveryCache;
183
199
  /** One filterable Vectorize metadata property a schema declares. */
184
200
  interface VectorMetadataDeclaration {
185
201
  /** The vector index the property belongs to. */
@@ -225,13 +241,8 @@ interface DiscoverSchemaInfoResult {
225
241
  /** Schema facts, or `undefined` when no `schema.ts` exists or parsing failed. */
226
242
  info: SchemaInfo | undefined;
227
243
  }
228
- /**
229
- * Discover {@link SchemaInfo} for a project. Returns `{ info: undefined }` when
230
- * the project declares no `schema.ts` (not an error), or `{ info: undefined,
231
- * error }` when a present schema could not be parsed — callers decide whether a
232
- * parse failure is a warning (validator) or simply ignorable (inference).
233
- */
234
- declare const discoverSchemaInfo: (projectRoot: string, schemaDirectory: string) => DiscoverSchemaInfoResult;
244
+ /** Discover the schema facts, memoised on `cache` when one is given. */
245
+ declare const discoverSchemaInfo: (projectRoot: string, schemaDirectory: string, cache?: DiscoveryCache) => DiscoverSchemaInfoResult;
235
246
  interface DurableObjectSpec {
236
247
  binding: string;
237
248
  className: string;
@@ -440,6 +451,8 @@ interface InferredBindings {
440
451
  workflows: InferredWorkflow[];
441
452
  }
442
453
  interface InferOptions {
454
+ /** Memoises the source scans, so one CLI invocation parses the project once. */
455
+ cache?: DiscoveryCache;
443
456
  projectRoot: string;
444
457
  /** Directories (relative to root) to scan. Defaults to `lunora` + `src`. */
445
458
  scanDirs?: ReadonlyArray<string>;
@@ -464,4 +477,4 @@ declare const inferLunoraBindings: (options: InferOptions) => Promise<InferredBi
464
477
  * ({@link NOTIFY_CHANNEL_SECRETS}), keeping only sources that carry secrets.
465
478
  */
466
479
  declare const secretSourcesFromBindings: (bindings: InferredBindings) => string[];
467
- export { COMPOSED_WORKER_ENTRY as C, DeployDriver as D, GeneratedClassModule as G, InferredBindings as I, MERGED_DURABLE_OBJECTS_MODULE as M, ProjectionPurpose as P, SchemaInfo as S, ToolchainCommand as T, DURABLE_OBJECT_BINDINGS as a, DeployRequest as b, DevRequest as c, DiscoverSchemaInfoResult as d, DriverToolchain as e, GENERATED_CLASS_MODULES as f, GENERATED_MODULE_DURABLE_OBJECTS as g, InferOptions as h, InferredAgent as i, InferredContainer as j, InferredWorkflow as k, ProjectedConfig as l, SecretRequest as m, TailRequest as n, discoverSchemaInfo as o, inferLunoraBindings as p, isMergedProject as q, isMergedRoleModule as r, secretSourcesFromBindings as s };
480
+ export { COMPOSED_WORKER_ENTRY as C, DeployDriver as D, GeneratedClassModule as G, InferredBindings as I, MERGED_DURABLE_OBJECTS_MODULE as M, ProjectionPurpose as P, SchemaInfo as S, ToolchainCommand as T, DiscoveryCache as a, DURABLE_OBJECT_BINDINGS as b, DeployRequest as c, DevRequest as d, DiscoverSchemaInfoResult as e, DriverToolchain as f, GENERATED_CLASS_MODULES as g, GENERATED_MODULE_DURABLE_OBJECTS as h, InferOptions as i, InferredAgent as j, InferredContainer as k, InferredWorkflow as l, ProjectedConfig as m, SecretRequest as n, TailRequest as o, createDiscoveryCache as p, discoverSchemaInfo as q, inferLunoraBindings as r, isMergedProject as s, isMergedRoleModule as t, secretSourcesFromBindings as u };
@@ -1 +1 @@
1
- import"./discoverAgentInfo-pqFMJBtJ.mjs";import{i as c,s as d}from"./infer-bindings-BsgN5eCm.mjs";import"./discoverContainerInfo-MI3HIHmJ.mjs";import"./DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";import"./discover-info-DC2MrAIM.mjs";import"./package-secrets-registry-BeheNwsP.mjs";import"./discoverSchemaInfo-BLe1EVI8.mjs";import"./COMPOSED_WORKER_ENTRY-Ciiba5g_.mjs";import"./discoverWorkflowInfo-zW7Tt0Tn.mjs";export{c as inferLunoraBindings,d as secretSourcesFromBindings};
1
+ import"./discoverAgentInfo-pqFMJBtJ.mjs";import{i as c,s as d}from"./infer-bindings-C1NFOdMi.mjs";import"./discoverContainerInfo-DzXr7Vm3.mjs";import"./DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";import"./discover-info-DC2MrAIM.mjs";import"./package-secrets-registry-BeheNwsP.mjs";import"./discoverSchemaInfo-BBRlXZop.mjs";import"./COMPOSED_WORKER_ENTRY-Ciiba5g_.mjs";import"./discoverWorkflowInfo-zW7Tt0Tn.mjs";export{c as inferLunoraBindings,d as secretSourcesFromBindings};
@@ -1 +1 @@
1
- import{readProjectConfigLiterals as o,readProjectTarget as n}from"@lunora/codegen";import{DEFAULT_DEPLOY_TARGET as c,resolveDeployDriver as a}from"./DEFAULT_DEPLOY_TARGET-CfoV0tDu.mjs";const s=e=>{if(typeof e=="boolean")return e;if(e!==null&&typeof e=="object")return!0},g=e=>s(o(e).remote),i=e=>n(e),T=(e,r)=>r??i(e)??c,j=(e,r)=>{const t=T(e,r);return a(t),t};export{s as interpretRemote,g as readProjectRemotePreference,i as readProjectTarget,T as resolveProjectTarget,j as resolveTargetOrThrow};
1
+ import{readProjectConfigLiterals as o,readProjectTarget as n}from"@lunora/codegen";import{DEFAULT_DEPLOY_TARGET as c,resolveDeployDriver as a}from"./DEFAULT_DEPLOY_TARGET-rR7buNQw.mjs";const s=e=>{if(typeof e=="boolean")return e;if(e!==null&&typeof e=="object")return!0},g=e=>s(o(e).remote),i=e=>n(e),T=(e,r)=>r??i(e)??c,j=(e,r)=>{const t=T(e,r);return a(t),t};export{s as interpretRemote,g as readProjectRemotePreference,i as readProjectTarget,T as resolveProjectTarget,j as resolveTargetOrThrow};
@@ -1 +1 @@
1
- import{i as g}from"./infer-bindings-BsgN5eCm.mjs";import{LUNORA_TAG as r}from"./LUNORA_TAG-CiQM3BkI.mjs";import{reconcileWranglerBindings as p}from"./collectExportGaps-BfnHx4y3.mjs";import{reconcileWranglerCompatibilityDate as $}from"./reconcileWranglerCompatibilityDate-hocXEuRA.mjs";import{reconcileWranglerCrons as m,describePreservedCrons as w}from"./describePreservedCrons-C5KPuPy3.mjs";const j=async(i,t,a)=>{try{const n=await g({projectRoot:i.projectRoot,schemaDir:i.schemaDir}),e=p(i.projectRoot,n,{target:i.target}),o=e.wranglerPath??"wrangler.jsonc";if(e.added.length>0&&t.info?.(`${r} inferred bindings → ${e.added.join(", ")} (written to ${o})`),e.updated.length>0&&t.info?.(`${r} updated bindings → ${e.updated.join(", ")} (written to ${o})`),e.devConfig!==void 0){const{added:s,path:d,updated:f}=e.devConfig;t.info?.(`${r} dev sidecar bindings → ${[...s,...f].join(", ")} (written to ${d})`)}for(const s of e.warnings)t.warn(`${r} ${s}`);e.exportGaps.length>0&&a?.(e.exportGaps)}catch(n){const e=n instanceof Error?n.message:String(n);t.warn(`${r} binding inference skipped: ${e}`)}},c=new Map,u=(i,t,a)=>{try{const n=m(i,t);n.changed&&a.info?.(`${r} synced ${t.length.toFixed(0)} cron trigger(s) into ${n.wranglerPath??"wrangler.jsonc"}`);for(const s of n.warnings)a.warn(`${r} ${s}`);const e=n.preserved.join("\0"),o=w(n.preserved);o!==void 0&&(n.changed||c.get(i)!==e)&&a.info?.(`${r} ${o}`),c.set(i,e)}catch(n){const e=n instanceof Error?n.message:String(n);a.warn(`${r} cron trigger sync skipped: ${e}`)}try{const n=$(i);n.changed&&a.info?.(`${r} bumped compatibility_date to ${n.date??"unknown"} (Workers Cache enabled) → ${n.wranglerPath??"wrangler.jsonc"}`)}catch(n){const e=n instanceof Error?n.message:String(n);a.warn(`${r} compatibility date sync skipped: ${e}`)}};export{j as reconcileBindingsSafely,u as reconcileWranglerExtras};
1
+ import{i as g}from"./infer-bindings-C1NFOdMi.mjs";import{LUNORA_TAG as r}from"./LUNORA_TAG-CiQM3BkI.mjs";import{reconcileWranglerBindings as p}from"./collectExportGaps-BPuhGH2J.mjs";import{reconcileWranglerCompatibilityDate as $}from"./reconcileWranglerCompatibilityDate-hocXEuRA.mjs";import{reconcileWranglerCrons as m,describePreservedCrons as w}from"./describePreservedCrons-C5KPuPy3.mjs";const j=async(i,t,a)=>{try{const n=await g({projectRoot:i.projectRoot,schemaDir:i.schemaDir}),e=p(i.projectRoot,n,{target:i.target}),o=e.wranglerPath??"wrangler.jsonc";if(e.added.length>0&&t.info?.(`${r} inferred bindings → ${e.added.join(", ")} (written to ${o})`),e.updated.length>0&&t.info?.(`${r} updated bindings → ${e.updated.join(", ")} (written to ${o})`),e.devConfig!==void 0){const{added:s,path:d,updated:f}=e.devConfig;t.info?.(`${r} dev sidecar bindings → ${[...s,...f].join(", ")} (written to ${d})`)}for(const s of e.warnings)t.warn(`${r} ${s}`);e.exportGaps.length>0&&a?.(e.exportGaps)}catch(n){const e=n instanceof Error?n.message:String(n);t.warn(`${r} binding inference skipped: ${e}`)}},c=new Map,u=(i,t,a)=>{try{const n=m(i,t);n.changed&&a.info?.(`${r} synced ${t.length.toFixed(0)} cron trigger(s) into ${n.wranglerPath??"wrangler.jsonc"}`);for(const s of n.warnings)a.warn(`${r} ${s}`);const e=n.preserved.join("\0"),o=w(n.preserved);o!==void 0&&(n.changed||c.get(i)!==e)&&a.info?.(`${r} ${o}`),c.set(i,e)}catch(n){const e=n instanceof Error?n.message:String(n);a.warn(`${r} cron trigger sync skipped: ${e}`)}try{const n=$(i);n.changed&&a.info?.(`${r} bumped compatibility_date to ${n.date??"unknown"} (Workers Cache enabled) → ${n.wranglerPath??"wrangler.jsonc"}`)}catch(n){const e=n instanceof Error?n.message:String(n);a.warn(`${r} compatibility date sync skipped: ${e}`)}};export{j as reconcileBindingsSafely,u as reconcileWranglerExtras};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lunora/config",
3
- "version": "1.0.0-alpha.349",
3
+ "version": "1.0.0-alpha.350",
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.301",
58
- "@lunora/container": "1.0.0-alpha.74",
57
+ "@lunora/codegen": "1.0.0-alpha.302",
58
+ "@lunora/container": "1.0.0-alpha.75",
59
59
  "@lunora/errors": ">=1.0.0-alpha.51 <2.0.0-0",
60
- "@lunora/seed": "1.0.0-alpha.217",
60
+ "@lunora/seed": "1.0.0-alpha.218",
61
61
  "@visulima/colorize": "2.1.1",
62
62
  "@visulima/find-ai-runner": "1.0.2",
63
63
  "@visulima/fs": "6.0.29",
@@ -1 +0,0 @@
1
- const r={devServer:"workerd",prebuildsContainerImages:!0,deploy:o=>{const n=o.preview===!0?["versions","upload"]:["deploy"];return o.entry!==void 0&&n.push(o.entry),o.configPath!==void 0&&n.push("--config",o.configPath),o.environment!==void 0&&n.push("--env",o.environment),o.temporary===!0&&n.push("--temporary"),o.dryRun===!0&&n.push("--dry-run"),o.outDir!==void 0&&n.push("--outdir",o.outDir,"--metafile"),{args:n,tool:"wrangler"}},dev:o=>{const n=["dev"];return o.configPath!==void 0&&n.push("--config",o.configPath),o.environment!==void 0&&n.push("--env",o.environment),n.push(...o.extraArgs??[]),{args:n,tool:"wrangler"}},secretList:o=>{const n=["secret","list","--format","json"];return o.environment!==void 0&&n.push("--env",o.environment),o.temporary===!0&&n.push("--temporary"),{args:n,tool:"wrangler"}},secretPut:o=>{const n=["secret","put",o.key??""];return o.environment!==void 0&&n.push("--env",o.environment),o.temporary===!0&&n.push("--temporary"),{args:n,tool:"wrangler"}},tail:o=>{const n=["tail"];return o.worker!==void 0&&n.push(o.worker),o.environment!==void 0&&n.push("--env",o.environment),o.format!==void 0&&n.push("--format",o.format),o.status!==void 0&&n.push("--status",o.status),o.search!==void 0&&n.push("--search",o.search),o.temporary===!0&&n.push("--temporary"),{args:n,tool:"wrangler"}}},i={id:"cloudflare",name:"Cloudflare",toolchain:r};export{i as default};
@@ -1 +0,0 @@
1
- import{discoverContainers as i,CONTAINERS_FILENAME as t}from"@lunora/codegen";import{d as s}from"./discover-info-DC2MrAIM.mjs";const d=(r,e)=>{const{error:o,value:n}=s(r,e,t,i,{skipFileDependencyResolution:!0});return o===void 0?{containers:n??[]}:{containers:[],error:o}};export{d as discoverContainerInfo};
@@ -1 +0,0 @@
1
- import{existsSync as c}from"node:fs";import{discoverSchema as l,isHyperdriveGlobalTable as d,isD1GlobalTable as f}from"@lunora/codegen";import{Project as b}from"ts-morph";import{join as u}from"node:path";const a=n=>{if(n?.kind==="optional")return a(n.inner);if(n?.kind==="union"){const o=new Set((n.members??[]).filter(i=>i.kind!=="null").map(i=>a(i)));return o.size===1?[...o][0]:n.kind}return n?.kind},S=(n,o)=>{const i=u(n,o,"schema.ts");if(!c(i))return{info:void 0};try{const s=new b({skipAddingFilesFromTsConfig:!0,useInMemoryFileSystem:!1}),r=l(s,i,n),m=e=>r.tables.find(t=>t.name===e)?.shape??{};return{info:{hasD1GlobalTable:r.tables.some(e=>f(e)),hasHyperdriveGlobalTable:r.tables.some(e=>d(e)),...r.jurisdiction===void 0?{}:{jurisdiction:r.jurisdiction},vectorIndexNames:r.vectorIndexes.map(e=>e.name),vectorMetadata:r.vectorIndexes.flatMap(e=>(e.metadata??[]).map(t=>({index:e.name,kind:a(m(e.table)[t]),property:t})))}}}catch(s){return{error:s instanceof Error?s.message:String(s),info:void 0}}};export{S as discoverSchemaInfo};
@@ -1 +0,0 @@
1
- import{existsSync as w,statSync as P,readFileSync as j,readdirSync as F}from"node:fs";import{discoverFlags as B,FLAGS_FILENAME as L,discoverQueues as k,CAPABILITY_PROBES as R,readServiceBindings as G,mayReadCapabilityContext as W,foldCapabilitySignals as C,capabilitiesUsedBy as Y,discoverNotifyChannels as K,NOTIFY_FILENAME as q,sourceCapabilitySignals as M}from"@lunora/codegen";import{init as U}from"es-module-lexer";import{Project as H}from"ts-morph";import{discoverAgentInfo as X}from"./discoverAgentInfo-pqFMJBtJ.mjs";import{discoverContainerInfo as Q}from"./discoverContainerInfo-MI3HIHmJ.mjs";import{escapeRegExp as V}from"./DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";import{d as I}from"./discover-info-DC2MrAIM.mjs";import{relative as J,sep as z,isAbsolute as Z,join as y}from"node:path";import{P as ee}from"./package-secrets-registry-BeheNwsP.mjs";import{discoverSchemaInfo as se}from"./discoverSchemaInfo-BLe1EVI8.mjs";import{resolveWorkerEntry as te,composedEntryDurableObjects as re,GENERATED_DIRECTORY as x,DURABLE_OBJECT_BINDINGS as ne,detectExportedDurableObjects as oe,detectClassExports as A,isMergedProject as ae}from"./COMPOSED_WORKER_ENTRY-Ciiba5g_.mjs";import{discoverWorkflowInfo as ie}from"./discoverWorkflowInfo-zW7Tt0Tn.mjs";const ce="https://api.cloudflare.com/client/v4/accounts/<ACCOUNT_ID>/artifacts/namespaces",de=e=>{const s='add an "artifacts" binding ({ binding: "ARTIFACTS", namespace }) — codegen reads env.ARTIFACTS unless `.artifacts()` on defineApp points ctx.artifacts at another binding';return e===void 0?`ctx.artifacts is used; ${s}. The namespace is created by the first repo create() if it does not exist yet.`:`ctx.artifacts is used and the schema pins data to "${e}"; create the namespace in that jurisdiction BEFORE the first repo, with POST ${ce} and body { "namespace": "<name>", "jurisdiction": "${e}" }, then ${s}. A namespace's jurisdiction cannot be changed, and one created implicitly by the first repo create() is unrestricted.`},ue=(e,s)=>{const{error:r,value:t}=I(e,s,L,B);return r===void 0?{flags:t}:{error:r}},le=(e,s)=>{const r=J(s,e);return r!==""&&r!==".."&&!r.startsWith(`..${z}`)&&!Z(r)},pe=(e,s)=>{const{error:r,value:t}=I(e,s,void 0,k);return r===void 0?{queues:t??[]}:{error:r,queues:[]}},me=new Set([".cjs",".cts",".js",".jsx",".mjs",".mts",".ts",".tsx"]),he=new Set([".git",".lunora-cache",".wrangler","dist",x,"node_modules"]),fe=["lunora","src"],ge=/\benv\s*\.\s*DB\b/,be=/\benv\s*\.\s*AI\b/,N=["ai","aiSearch","analytics","analyticsSql","artifacts","browser","hyperdrive","images","kv","mail","notify","payments","pipelines","r2sql","scheduler","storage","x402"],D=e=>`uses${e.charAt(0).toUpperCase()}${e.slice(1)}`,$=[["usesAuth","@lunora/auth"],["usesCimdWorkers","@lunora/auth/cimd/workers"],["usesX402Charge","@lunora/x402/charge"],["usesPaymentAutumn","@lunora/payment/autumn"],["usesPaymentCreem","@lunora/payment/creem"],["usesPaymentDodopayments","@lunora/payment/dodopayments"],["usesPaymentPolar","@lunora/payment/polar"],["usesPaymentStripe","@lunora/payment/stripe"]],T=[...N.map(e=>[D(e),R[e].moduleSpecifier]),...$].toSorted(([e],[s])=>e.localeCompare(s)),ye=[["usesNotifyFcm","@lunora/notify:fcm"],["usesNotifyWebPush","@lunora/notify:webPush"]],Se=["@lunora/agent","@lunora/agent/sandbox"],ve=new RegExp(String.raw`["'\x60](?:${[...T.map(([,e])=>e),...Se].map(e=>V(e)).join("|")})["'\x60]`,"u"),o=e=>{const{contextProperty:s,moduleSpecifier:r}=R[e];return s===void 0?`${r} is imported`:`${r} is imported or ctx.${s} is read`},Ee="STRIPE_SECRET_KEY + STRIPE_WEBHOOK_SECRET (Stripe) or POLAR_ACCESS_TOKEN + POLAR_WEBHOOK_SECRET (Polar)",Ae=()=>{let e;return()=>(e??=new H({compilerOptions:{allowJs:!0},useInMemoryFileSystem:!0}),e)},xe=(e,s,r)=>{const t=r(),n=t.createSourceFile(`/scan/${s.slice(s.lastIndexOf("/")+1)}`,e,{overwrite:!0}),a=M(n);return t.removeSourceFile(n),a},O=(e,s)=>{let r;try{r=F(e,{withFileTypes:!0})}catch{return}for(const t of r){if(t.isDirectory()){he.has(t.name)||O(y(e,t.name),s);continue}const n=t.name.lastIndexOf(".");n!==-1&&me.has(t.name.slice(n))&&s.push(y(e,t.name))}},Ie=(e,s)=>{const{info:r}=se(e,s);return{jurisdiction:r?.jurisdiction,needsD1:r?.hasD1GlobalTable??!1}},_e=(e,s,r)=>{const t=Ae(),n=y(e,r),a=[],f=[];let i=!1,c=!1;for(const d of s){const u=y(e,d);if(!w(u)||!P(u).isDirectory())continue;const h=[];O(u,h);for(const l of h){const b=j(l,"utf8"),p=le(l,n);i||=be.test(b),c||=ge.test(b),(ve.test(b)||p&&W(b))&&(p?a:f).push(xe(b,l,t))}}const g=C(a),S=C([g,...f]),v=new Set([...S.valueImports,...S.dynamicImports]),m=Y({contextReads:g.contextReads,valueImports:v});return{...Object.fromEntries([...N.map(d=>[D(d),m.has(d)]),...$.map(([d,u])=>[d,v.has(u)])]),needsD1:c,usesAi:m.has("ai")||i,usesBrowser:m.has("browser")||g.sandboxTools.usesSandboxBrowser,usesWorkerLoader:g.sandboxTools.usesSandboxLoader}},Ce=(e,s,r)=>[...e.map(t=>t.exported?`${t.bindingName}/${t.className} (container "${t.exportName}" declared and exported)`:`hint: container "${t.exportName}" is declared but ${t.className} is not exported by the worker entry — add \`export * from "./lunora/_generated/containers"\``),...s.map(t=>t.exported?`exports.${t.className} (workflow "${t.exportName}" declared and exported)`:`hint: workflow "${t.exportName}" is declared but ${t.className} is not exported by the worker entry — add \`export * from "./lunora/_generated/workflows"\``),...r.map(t=>t.exported?`exports.${t.className} (agent "${t.exportName}" declared and exported)`:`hint: agent "${t.exportName}" is declared but ${t.className} is not exported by the worker entry — add \`export * from "./lunora/_generated/agents"\``)],Re=(e,s,r)=>[[e.usesAi,`AI (${o("ai")}, or env.AI is used)`],[e.usesAuth&&!s.has("SessionDO"),"hint: @lunora/auth is imported; its tables are D1-backed by default. For DO-backed auth (what @better-auth/scim needs), pass `namespace` to .auth() and export the generated auth DO class"],[e.usesScheduler&&!s.has("SchedulerDO"),`hint: ${o("scheduler")}, but no SchedulerDO is exported by the worker entry`],[e.usesStorage,`hint: ${o("storage")}; add an r2_buckets binding (bucket binding names are user-defined)`],[e.usesMail,`hint: ${o("mail")}; set RESEND_API_KEY in .dev.vars (obtain at https://resend.com/api-keys)`],[e.usesPayments,`hint: ${o("payments")}; set the provider secrets in .dev.vars — ${Ee}`],[e.usesBrowser,`browser (${o("browser")}, or a sandbox browserTool imported in lunora/) — self-describing { binding: BROWSER }`],[e.usesImages,`images (${o("images")}) — self-describing { binding: IMAGES }`],[e.usesAnalytics,`analytics_engine_datasets (${o("analytics")}) — self-describing { binding: ANALYTICS, dataset }`],[e.usesWorkerLoader,"worker_loaders (jsCodeTool imported in lunora/) — self-describing { binding: LOADER }"],[e.usesAiSearch,`ai_search_namespaces (${o("aiSearch")}) — self-describing { binding: AI_SEARCH, namespace: "default" }; remote-only, so \`lunora dev\` reaches the deployed AI Search service`],[e.usesAnalyticsSql,`analytics (${o("analyticsSql")}) — self-describing { binding: ANALYTICS_SQL }; needs wrangler >= 4.145.0, and is remote-only, so \`lunora dev\` queries the account's live analytics`],[e.usesKv,`hint: ${o("kv")}; add a kv_namespaces binding ({ binding, id }) and pass env.<BINDING> to createKv() — the namespace id can't be auto-provisioned`],[e.usesHyperdrive,`hint: ${o("hyperdrive")}; run 'wrangler hyperdrive create' and add a 'hyperdrive' binding ({ binding, id }) — the id can't be auto-provisioned`],[e.usesPipelines,`hint: ${o("pipelines")}; run 'wrangler pipelines create <name>' and add a 'pipelines' binding ({ binding, stream }) — the pipeline resource can't be auto-provisioned`],[e.usesArtifacts,`hint: ${de(r.jurisdiction)}`],[e.usesX402Charge,"hint: @lunora/x402/charge is imported; set the recipient wallet address as a [vars] entry (the var name is yours to choose) and pass it to the charge config — the x402 facilitator settles USDC to that address"],[e.usesX402,`hint: ${o("x402")} (ActionCtx-only, spends real funds); add a secrets_store_secrets[] binding for the agent wallet key (name it to match signer.secretName) and pair the pay rail with a spend policy — ctx.secrets reads a Secrets Store binding, not .dev.vars, so the key can't be auto-provisioned`]].filter(([n])=>n).map(([,n])=>n),Ne=(e,s,r,t=[],n=[],a=[])=>{const f=new Set(e.map(c=>c.className)),i=e.map(c=>`${c.binding}/${c.className} (exported by worker entry)`);return s.needsD1&&i.push("DB (.global() table declared)"),i.push(...Ce(t,n,a),...Re(r,f,s)),i},Ye=async e=>{await U;const s=e.schemaDir??"lunora",r=e.scanDirs??fe,t=_e(e.projectRoot,r,s),n=te(e.projectRoot);let a;n.composed?a=re(y(e.projectRoot,s,x)).map(_=>({binding:ne[_],className:_})):a=n.path===void 0?[]:oe(n.path);const f=Ie(e.projectRoot,s),i={...f,needsD1:t.needsD1||f.needsD1},c=A(n,Q(e.projectRoot,s).containers,"containers"),g=A(n,ie(e.projectRoot,s).workflows,"workflows"),S=A(n,X(e.projectRoot,s).agents,"agents"),v=[...pe(e.projectRoot,s).queues],{flags:m}=ue(e.projectRoot,s),E=I(e.projectRoot,s,q,K),d=E.error===void 0?E.value:{hasFcm:!0,hasWebPush:!0},u=m?.provider==="flagship"&&m.mode==="binding"?m.bindingName:void 0,h=Ne(a,i,t,c,g,S);!n.composed&&ae(y(e.projectRoot,s,x))&&!a.some(p=>p.className==="LunoraDO")&&h.push("hint: durableObjects.merge is set, but the worker entry exports no LunoraDO — export one built with mergeDurableObjects, or the classes stay separate"),u!==void 0&&h.push(`hint: lunora/flags.ts uses Flagship in binding mode; add a flagship binding ({ binding: "${u}", app_id }) — the app_id can't be auto-provisioned`);const l=G(e.projectRoot),b=l.error===void 0?l.services:void 0;return l.error!==void 0&&h.push(`hint: lunora.config \`services\` not reconciled — ${l.error}`),h.push(...l.services.map(p=>`${p.binding} → ${p.worker} (lunora.config services.${p.name})`)),{...t,agents:S,containers:c,durableObjects:a,flagshipBinding:u,...i.jurisdiction===void 0?{}:{jurisdiction:i.jurisdiction},needsD1:i.needsD1,queues:v,services:b,signals:h,usesFlags:m!==void 0,usesNotifyFcm:d?.hasFcm??!1,usesNotifyWebPush:d?.hasWebPush??!1,workflows:g}},Ke=e=>[...T,...ye].filter(([s,r])=>e[s]&&ee[r]!==void 0).map(([,s])=>s);export{de as a,Ye as i,Ke as s};