@lunora/config 1.0.0-alpha.391 → 1.0.0-alpha.393
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/index.mjs +1 -1
- package/dist/cloudflare/index.d.mts +1 -1
- package/dist/cloudflare/index.d.ts +1 -1
- package/dist/index.d.mts +54 -4
- package/dist/index.d.ts +54 -4
- package/dist/index.mjs +1 -1
- package/dist/packem_shared/BUILD_ROOT_ENV-Dg4MV3wY.mjs +1 -0
- package/dist/packem_shared/{DEFAULT_DEPLOY_TARGET-rR7buNQw.mjs → DEFAULT_DEPLOY_TARGET-CnovxJid.mjs} +1 -1
- package/dist/packem_shared/MissingBuildOutputError-BAyekzof.mjs +1 -0
- package/dist/packem_shared/{POLICY_SCAFFOLD_ENDPOINT-BGmCp5gf.mjs → POLICY_SCAFFOLD_ENDPOINT-eNqjov6d.mjs} +1 -1
- package/dist/packem_shared/{SCHEMA_EDIT_ENDPOINT-oGE8lMFF.mjs → SCHEMA_EDIT_ENDPOINT-Cgpy_347.mjs} +1 -1
- package/dist/packem_shared/{STUDIO_PATH-DEi8zoNu.mjs → STUDIO_PATH-B93PUAsG.mjs} +1 -1
- package/dist/packem_shared/assertBuildTargetMatches-Bw7uURKp.mjs +1 -0
- package/dist/packem_shared/blockingFindingsMessage-CRbg1sla.mjs +1 -0
- package/dist/packem_shared/canonicalPath-DrfMiT3U.mjs +1 -0
- package/dist/packem_shared/celld-config-Iv0tK526.mjs +3 -0
- package/dist/packem_shared/clearApiSpecMarker-DMGpP41V.mjs +2 -0
- package/dist/packem_shared/{infer-bindings.d-BNrKAI1c.d.mts → infer-bindings.d-C9ktoVW4.d.mts} +1 -1
- package/dist/packem_shared/{infer-bindings.d-BNrKAI1c.d.ts → infer-bindings.d-C9ktoVW4.d.ts} +1 -1
- package/dist/packem_shared/{startCelldDevSession-BLFsd6jG.mjs → startCelldDevSession-PHdbwtI5.mjs} +1 -1
- package/dist/packem_shared/write-atomic-D0PdxcE3.mjs +1 -0
- package/dist/studio-host/index.mjs +1 -1
- package/package.json +2 -2
- package/dist/packem_shared/CODEGEN_ENV-CkUo3_GU.mjs +0 -1
- package/dist/packem_shared/blockingFindingsMessage-BVbijPdn.mjs +0 -1
- package/dist/packem_shared/celld-config-D-L6uskI.mjs +0 -3
- package/dist/packem_shared/interpretRemote-CcmGeGZ_.mjs +0 -1
- package/dist/packem_shared/write-atomic-zfU6flfm.mjs +0 -1
package/dist/cli/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{AGENT_RULES_HINT as t,claimAgentRulesHint as o,detectAgentRules as a}from"../packem_shared/AGENT_RULES_DIR-Bd6JPtNa.mjs";import{DEFAULT_DEPLOY_TARGET as s,deployTargetIds as l,isRunnableTarget as A,runnableTargetIds as d}from"../packem_shared/DEFAULT_DEPLOY_TARGET-
|
|
1
|
+
import{AGENT_RULES_HINT as t,claimAgentRulesHint as o,detectAgentRules as a}from"../packem_shared/AGENT_RULES_DIR-Bd6JPtNa.mjs";import{DEFAULT_DEPLOY_TARGET as s,deployTargetIds as l,isRunnableTarget as A,runnableTargetIds as d}from"../packem_shared/DEFAULT_DEPLOY_TARGET-CnovxJid.mjs";import{LUNORA_TAG as c,lunoraLine as m}from"../packem_shared/LUNORA_TAG-DQTGPqcJ.mjs";import{default as T}from"../packem_shared/LunoraReporter-f277GLNT.mjs";import{addArgsFor as x,detectInstalledManagers as E,detectPackageManager as i,execArgsFor as u,installArgsFor as R,runScriptCommand as _,toolchainExecArgs as L}from"../packem_shared/addArgsFor-CYZKhNIo.mjs";import{readProjectManifest as G}from"../packem_shared/readProjectDependencies-l3uhUKjo.mjs";import{STEP_BADGE_NAMES as M}from"../packem_shared/ACCENT-CotPTfv7.mjs";export{t as AGENT_RULES_HINT,s as DEFAULT_DEPLOY_TARGET,c as LUNORA_TAG,T as LunoraReporter,M as STEP_BADGE_NAMES,x as addArgsFor,o as claimAgentRulesHint,l as deployTargetIds,a as detectAgentRules,E as detectInstalledManagers,i as detectPackageManager,u as execArgsFor,R as installArgsFor,A as isRunnableTarget,m as lunoraLine,G as readProjectManifest,_ as runScriptCommand,d as runnableTargetIds,L as toolchainExecArgs};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { D as DeployDriver } from "../packem_shared/deploy-driver.d-Cl96-c1l.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { G as GeneratedClassModule, I as InferredBindings, S as SchemaInfo } from "../packem_shared/infer-bindings.d-C9ktoVW4.mjs";
|
|
3
3
|
import { WranglerQueueProducerIR, WranglerVariableIR } from '@lunora/codegen';
|
|
4
4
|
/** Apply one structural jsonc edit and return the rewritten text (a no-op edit returns the input). */
|
|
5
5
|
declare const applyModify: (text: string, path: ReadonlyArray<number | string>, value: unknown) => string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { D as DeployDriver } from "../packem_shared/deploy-driver.d-Cl96-c1l.js";
|
|
2
|
-
import {
|
|
2
|
+
import { G as GeneratedClassModule, I as InferredBindings, S as SchemaInfo } from "../packem_shared/infer-bindings.d-C9ktoVW4.js";
|
|
3
3
|
import { WranglerQueueProducerIR, WranglerVariableIR } from '@lunora/codegen';
|
|
4
4
|
/** Apply one structural jsonc edit and return the rewritten text (a no-op edit returns the input). */
|
|
5
5
|
declare const applyModify: (text: string, path: ReadonlyArray<number | string>, value: unknown) => string;
|
package/dist/index.d.mts
CHANGED
|
@@ -2,8 +2,8 @@ import { AgentIR, ContainerIR, WorkflowIR, CodegenResult } from '@lunora/codegen
|
|
|
2
2
|
export type { AgentIR, ContainerIR, WorkflowIR } from '@lunora/codegen';
|
|
3
3
|
export { A as ACCENT, a as AGENT_RULES_DIR, b as AGENT_RULES_HINT, c as AGENT_RULES_HINT_ENV, type d as AgentRulesStatus, B as BADGES, e as BADGE_COLUMN_WIDTH, type f as BadgeName, type g as BadgeSpec, D as DEFAULT_DEPLOY_TARGET, L as LUNA_ART, h as LUNA_BUNNY, i as LUNA_NAME, j as LUNA_SIGNOFF, k as LUNORA_SKILL_NAMES, l as LUNORA_TAG, type m as LevelBadgeName, n as LunoraReporter, type P as PackageManager, type o as PackageManagerProbe, R as ROOT_SKILL_NAME, S as STEP_BADGE_NAMES, type p as StepBadgeName, type T as ToolchainInvocation, q as addArgsFor, r as advisoryLine, s as badgeLead, t as badgeWidth, u as claimAgentRulesHint, v as deployTargetIds, w as detectAgentRules, x as detectInstalledManagers, y as detectPackageManager, z as execArgsFor, C as installArgsFor, E as isRunnableTarget, F as lunoraLine, G as padBadge, H as paintAnswer, I as paintBadge, J as planToolchainInvocation, K as readProjectDependencies, M as readProjectDependencyNames, N as readProjectManifest, O as resolveDeployDriver, Q as runScriptArgsFor, U as runScriptCommand, V as runnableTargetIds, W as targetRunsOwnDevServer, X as toolchainExecArgs } from "./packem_shared/index.d-DkNi7r6E.mjs";
|
|
4
4
|
import { ChildProcess } from 'node:child_process';
|
|
5
|
-
import { D as DiscoveryCache } from "./packem_shared/infer-bindings.d-
|
|
6
|
-
export { C as COMPOSED_WORKER_ENTRY, a as DURABLE_OBJECT_BINDINGS, type b as DiscoverSchemaInfoResult,
|
|
5
|
+
import { D as DiscoveryCache } from "./packem_shared/infer-bindings.d-C9ktoVW4.mjs";
|
|
6
|
+
export { C as COMPOSED_WORKER_ENTRY, a as DURABLE_OBJECT_BINDINGS, type b as DiscoverSchemaInfoResult, c as GENERATED_CLASS_MODULES, d as GENERATED_MODULE_DURABLE_OBJECTS, type G as GeneratedClassModule, type e as InferOptions, type f as InferredAgent, type I as InferredBindings, type g as InferredContainer, type h as InferredWorkflow, M as MERGED_DURABLE_OBJECTS_MODULE, type S as SchemaInfo, i as createDiscoveryCache, j as discoverSchemaInfo, k as inferLunoraBindings, l as isMergedProject, m as isMergedRoleModule, s as secretSourcesFromBindings } from "./packem_shared/infer-bindings.d-C9ktoVW4.mjs";
|
|
7
7
|
import { Writable } from 'node:stream';
|
|
8
8
|
export type { D as DeployDriver, a as DeployRequest, b as DevRequest, c as DriverToolchain, P as ProjectedConfig, d as ProjectionPurpose, S as SecretRequest, T as TailRequest, e as ToolchainCommand } from "./packem_shared/deploy-driver.d-Cl96-c1l.mjs";
|
|
9
9
|
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";
|
|
@@ -59,6 +59,28 @@ declare const AGENT_MODE_ENV = "LUNORA_AGENT_MODE";
|
|
|
59
59
|
* both directions. Pure — pass a custom `env` in tests.
|
|
60
60
|
*/
|
|
61
61
|
declare const detectAiAgent: (env?: EnvLike) => AgentDetection | undefined;
|
|
62
|
+
/** The API specs codegen can emit; `"openapi"` is codegen's own default. */
|
|
63
|
+
type MarkedApiSpec = "both" | "none" | "openapi" | "openrpc";
|
|
64
|
+
/**
|
|
65
|
+
* Record which API spec the bundler plugin's codegen emitted. The CLI's deploy runs the plugin's build
|
|
66
|
+
* before its own codegen, and that codegen must emit the same spec, or it deletes the files the plugin
|
|
67
|
+
* wrote. The plugin is the only place its option is read, so it leaves the answer here.
|
|
68
|
+
*/
|
|
69
|
+
declare const writeApiSpecMarker: (projectRoot: string, apiSpec: MarkedApiSpec | undefined) => void;
|
|
70
|
+
/** Forget a recorded spec, so the next read sees only what a new client build writes. */
|
|
71
|
+
declare const clearApiSpecMarker: (projectRoot: string) => void;
|
|
72
|
+
/** The spec the last plugin codegen recorded, or `undefined` when there is no readable record. */
|
|
73
|
+
declare const readApiSpecMarker: (projectRoot: string) => MarkedApiSpec | undefined;
|
|
74
|
+
/**
|
|
75
|
+
* A deploy target needs the project's client build output, and none exists yet. The CLI tells this apart from an option a
|
|
76
|
+
* target refuses: a run that is about to build creates that output and defers the check to after its build.
|
|
77
|
+
*/
|
|
78
|
+
declare class MissingBuildOutputError extends Error {}
|
|
79
|
+
/**
|
|
80
|
+
* The absolute path with symlinks resolved, so two spellings of one directory compare equal. A path that does not exist yet
|
|
81
|
+
* resolves through its nearest existing ancestor, since the CLI and the plugin often name a `.lunora` directory before creating it.
|
|
82
|
+
*/
|
|
83
|
+
declare const canonicalPath: (path: string) => string;
|
|
62
84
|
/** Spawns the process — injectable so tests run without the binary. */
|
|
63
85
|
type DevProcessSpawner = (command: string, args: ReadonlyArray<string>, options: {
|
|
64
86
|
cwd: string;
|
|
@@ -148,8 +170,25 @@ declare const startCelldDevSession: (options: CelldDevSessionOptions) => Promise
|
|
|
148
170
|
*/
|
|
149
171
|
/** Env var that turns codegen off when it spells `0` / `false`. Unset means on. */
|
|
150
172
|
declare const CODEGEN_ENV = "LUNORA_CODEGEN";
|
|
173
|
+
/** Env var the CLI sets to `0` when `--no-strict-advisories` opts out, so a framework build does not fail on ERROR-level advisories. */
|
|
174
|
+
declare const STRICT_ADVISORIES_ENV = "LUNORA_STRICT_ADVISORIES";
|
|
151
175
|
/** Env var that enables lazy function imports for codegen when it spells `1` / `true`. */
|
|
152
176
|
declare const LAZY_FUNCTIONS_ENV = "LUNORA_LAZY_FUNCTIONS";
|
|
177
|
+
/** The project root the CLI started a client build for. Only that root's plugin checks {@link BUILD_TARGET_ENV} against itself. */
|
|
178
|
+
declare const BUILD_ROOT_ENV = "LUNORA_BUILD_ROOT";
|
|
179
|
+
/**
|
|
180
|
+
* Env var the CLI sets on the client build it spawns (`lunora build` and `lunora deploy`): the target it resolved for this run.
|
|
181
|
+
* A plugin whose own `target` option names another one refuses to build, so the artifact cannot
|
|
182
|
+
* describe a target the deploy will not ship to.
|
|
183
|
+
*/
|
|
184
|
+
declare const BUILD_TARGET_ENV = "LUNORA_BUILD_TARGET";
|
|
185
|
+
/** Env var the CLI sets to the path the Vite plugin writes its server metafile to. Unset means the default under `.lunora/`. */
|
|
186
|
+
declare const BUNDLE_META_PATH_ENV = "LUNORA_BUNDLE_META_PATH";
|
|
187
|
+
/**
|
|
188
|
+
* Where a plain `vite build` (no {@link BUNDLE_META_PATH_ENV}) writes the server metafile. Only a prebuilt worker
|
|
189
|
+
* (`frameworkBuild: false`) reads it back, so the CLI clears it before its own client build.
|
|
190
|
+
*/
|
|
191
|
+
declare const DEFAULT_BUNDLE_META_PATH: string;
|
|
153
192
|
/**
|
|
154
193
|
* Whether a {@link CODEGEN_ENV} value spells an explicit "off".
|
|
155
194
|
*
|
|
@@ -629,7 +668,9 @@ declare const reportCodegenFindings: (result: Pick<CodegenResult, "advisories" |
|
|
|
629
668
|
* presentation — and presentation is what this module owns, which is also why
|
|
630
669
|
* this needs no `tag` parameter: {@link LUNORA_TAG} is right above it.
|
|
631
670
|
*/
|
|
632
|
-
declare const blockingFindingsMessage: (result: Pick<CodegenResult, "advisories" | "platformDiagnostics"
|
|
671
|
+
declare const blockingFindingsMessage: (result: Pick<CodegenResult, "advisories" | "platformDiagnostics">, options?: {
|
|
672
|
+
strictAdvisories?: boolean;
|
|
673
|
+
}) => string | undefined;
|
|
633
674
|
/** Severity a formatted line should be surfaced at, mapped onto the three logger channels. */
|
|
634
675
|
type LunoraLineLevel = "error" | "info" | "warn";
|
|
635
676
|
/** A formatted lunora event: the channel to surface it on, the display text, and which event produced it. */
|
|
@@ -803,6 +844,15 @@ declare const resolveProjectTarget: (projectRoot: string, explicit?: string) =>
|
|
|
803
844
|
* @returns the resolved, registered target id.
|
|
804
845
|
*/
|
|
805
846
|
declare const resolveTargetOrThrow: (projectRoot: string, explicit?: string) => string;
|
|
847
|
+
/**
|
|
848
|
+
* Refuse a plugin-resolved target that differs from the one the CLI resolved
|
|
849
|
+
* for this run. The CLI's `--target` guard only sees the config file, so a target set
|
|
850
|
+
* in a plugin's options would otherwise slip past it. A no-op outside a CLI build,
|
|
851
|
+
* where {@link BUILD_TARGET_ENV} is unset.
|
|
852
|
+
* @param target The target the plugin resolved.
|
|
853
|
+
* @throws when the CLI resolved a different target.
|
|
854
|
+
*/
|
|
855
|
+
declare const assertBuildTargetMatches: (target: string, projectRoot: string) => void;
|
|
806
856
|
/**
|
|
807
857
|
* Whether we can interactively prompt — stdin must be a TTY. In CI / piped
|
|
808
858
|
* contexts this is false, and callers should fall back to a non-interactive
|
|
@@ -1190,4 +1240,4 @@ type ParseSchemaResult = {
|
|
|
1190
1240
|
* message per failure mode without throwing.
|
|
1191
1241
|
*/
|
|
1192
1242
|
declare const parseSchema: (source: string) => ParseSchemaResult;
|
|
1193
|
-
export { AGENT_MODE_ENV, type AddIndexEdit, type AddOptionalColumnEdit, type AddTableEdit, type AdditiveEdit, type AgentDetection, type ApplyEditResult, type ApplyFailureReason, type AugmentPlan, CODEGEN_ENV, type CelldDevSession, type CelldDevSessionOptions, type CelldLineOrigin, type ClaimDevServerStateResult, type ContainerLogLevel, type ContainerLogLine, type ContainerLogSource, type ContainerLogStreamHandle, type ContainerLogStreamOptions, 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 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, LAZY_FUNCTIONS_ENV, LINKED_PROJECT_DIR, LINKED_PROJECT_FILE, LUNORA_EVENT_SOURCE, LUNORA_IGNORED_PATHS, type LinkedProject, type LintIgnoreOutcome, type LintIgnoreStatus, type LintTool, type LunoraFormattedLine, type LunoraLineLevel, type MultiSelectOption, PACKAGE_SECRETS_REGISTRY, type ParseSchemaResult, type PostCodegenHookResult, type RemotePreference, type ScaffoldPlan, type SchemaColumn, type SchemaEdit, type SchemaIndex, type SchemaTable, type SecretEntry, type SelectOption, acceptsConnection, applyAdditiveEdit, applyLintIgnores, blockingFindingsMessage, buildPackageSecretsBlock, claimDevServerState, classifyEdit, clearDevServerState, createConfirm, detectAiAgent, detectFramework, detectLintTools, discoverAgentInfo, discoverContainerInfo, discoverWorkflowInfo, ensureDevVariables, ensureDevVariablesExample as ensureDevVarsExample, ensureDevWorkerEnv, escapeRegExp, fillDevSecrets, formatLunoraEvent, generateSecretValue, interpretRemote, isCodegenDisabled, isDevServerReady, isInteractive, isLazyFunctionsEnabled, isMintableSecretKey, isPlaceholderValue, isProcessAlive, isRecordedProcessCurrent, parseDevVariableEntries, parseSchema, planDevSecretsFill, planDevVariablesAugment, planDevVariablesScaffold, projectUsesUmbrella, promptMultiSelect, promptSelect, promptText, promptYesNo, readDevServerState, readLinkedProject, readLiveDevServerState, readProjectRemotePreference, readProjectTarget, removeDevVariableLine, reportCodegenFindings, requiredSecrets, resolveLazyFunctions, resolveProjectTarget, resolveSchemaDirectory, resolveTargetOrThrow, runPostCodegenHook, secretsForPackages, startCelldDevSession, startDevProcess, streamContainerLogs, updateDevServerState, upsertDevVariableLine, writeDevServerState, writeDevVariablesFileAtomically, writeLinkedProject };
|
|
1243
|
+
export { AGENT_MODE_ENV, type AddIndexEdit, type AddOptionalColumnEdit, type AddTableEdit, type AdditiveEdit, type AgentDetection, type ApplyEditResult, type ApplyFailureReason, type AugmentPlan, BUILD_ROOT_ENV, BUILD_TARGET_ENV, BUNDLE_META_PATH_ENV, CODEGEN_ENV, type CelldDevSession, type CelldDevSessionOptions, type CelldLineOrigin, type ClaimDevServerStateResult, type ContainerLogLevel, type ContainerLogLine, type ContainerLogSource, type ContainerLogStreamHandle, type ContainerLogStreamOptions, DEFAULT_BUNDLE_META_PATH, 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 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, LAZY_FUNCTIONS_ENV, LINKED_PROJECT_DIR, LINKED_PROJECT_FILE, LUNORA_EVENT_SOURCE, LUNORA_IGNORED_PATHS, type LinkedProject, type LintIgnoreOutcome, type LintIgnoreStatus, type LintTool, type LunoraFormattedLine, type LunoraLineLevel, type MarkedApiSpec, MissingBuildOutputError, type MultiSelectOption, PACKAGE_SECRETS_REGISTRY, type ParseSchemaResult, type PostCodegenHookResult, type RemotePreference, STRICT_ADVISORIES_ENV, type ScaffoldPlan, type SchemaColumn, type SchemaEdit, type SchemaIndex, type SchemaTable, type SecretEntry, type SelectOption, acceptsConnection, applyAdditiveEdit, applyLintIgnores, assertBuildTargetMatches, blockingFindingsMessage, buildPackageSecretsBlock, canonicalPath, claimDevServerState, classifyEdit, clearApiSpecMarker, clearDevServerState, createConfirm, detectAiAgent, detectFramework, detectLintTools, discoverAgentInfo, discoverContainerInfo, discoverWorkflowInfo, ensureDevVariables, ensureDevVariablesExample as ensureDevVarsExample, ensureDevWorkerEnv, escapeRegExp, fillDevSecrets, formatLunoraEvent, generateSecretValue, interpretRemote, isCodegenDisabled, isDevServerReady, isInteractive, isLazyFunctionsEnabled, isMintableSecretKey, isPlaceholderValue, isProcessAlive, isRecordedProcessCurrent, parseDevVariableEntries, parseSchema, planDevSecretsFill, planDevVariablesAugment, planDevVariablesScaffold, projectUsesUmbrella, promptMultiSelect, promptSelect, promptText, promptYesNo, readApiSpecMarker, readDevServerState, readLinkedProject, readLiveDevServerState, readProjectRemotePreference, readProjectTarget, removeDevVariableLine, reportCodegenFindings, requiredSecrets, resolveLazyFunctions, resolveProjectTarget, resolveSchemaDirectory, resolveTargetOrThrow, runPostCodegenHook, secretsForPackages, startCelldDevSession, startDevProcess, streamContainerLogs, updateDevServerState, upsertDevVariableLine, writeApiSpecMarker, writeDevServerState, writeDevVariablesFileAtomically, writeLinkedProject };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import { AgentIR, ContainerIR, WorkflowIR, CodegenResult } from '@lunora/codegen
|
|
|
2
2
|
export type { AgentIR, ContainerIR, WorkflowIR } from '@lunora/codegen';
|
|
3
3
|
export { A as ACCENT, a as AGENT_RULES_DIR, b as AGENT_RULES_HINT, c as AGENT_RULES_HINT_ENV, type d as AgentRulesStatus, B as BADGES, e as BADGE_COLUMN_WIDTH, type f as BadgeName, type g as BadgeSpec, D as DEFAULT_DEPLOY_TARGET, L as LUNA_ART, h as LUNA_BUNNY, i as LUNA_NAME, j as LUNA_SIGNOFF, k as LUNORA_SKILL_NAMES, l as LUNORA_TAG, type m as LevelBadgeName, n as LunoraReporter, type P as PackageManager, type o as PackageManagerProbe, R as ROOT_SKILL_NAME, S as STEP_BADGE_NAMES, type p as StepBadgeName, type T as ToolchainInvocation, q as addArgsFor, r as advisoryLine, s as badgeLead, t as badgeWidth, u as claimAgentRulesHint, v as deployTargetIds, w as detectAgentRules, x as detectInstalledManagers, y as detectPackageManager, z as execArgsFor, C as installArgsFor, E as isRunnableTarget, F as lunoraLine, G as padBadge, H as paintAnswer, I as paintBadge, J as planToolchainInvocation, K as readProjectDependencies, M as readProjectDependencyNames, N as readProjectManifest, O as resolveDeployDriver, Q as runScriptArgsFor, U as runScriptCommand, V as runnableTargetIds, W as targetRunsOwnDevServer, X as toolchainExecArgs } from "./packem_shared/index.d-Cmx4jMFV.js";
|
|
4
4
|
import { ChildProcess } from 'node:child_process';
|
|
5
|
-
import { D as DiscoveryCache } from "./packem_shared/infer-bindings.d-
|
|
6
|
-
export { C as COMPOSED_WORKER_ENTRY, a as DURABLE_OBJECT_BINDINGS, type b as DiscoverSchemaInfoResult,
|
|
5
|
+
import { D as DiscoveryCache } from "./packem_shared/infer-bindings.d-C9ktoVW4.js";
|
|
6
|
+
export { C as COMPOSED_WORKER_ENTRY, a as DURABLE_OBJECT_BINDINGS, type b as DiscoverSchemaInfoResult, c as GENERATED_CLASS_MODULES, d as GENERATED_MODULE_DURABLE_OBJECTS, type G as GeneratedClassModule, type e as InferOptions, type f as InferredAgent, type I as InferredBindings, type g as InferredContainer, type h as InferredWorkflow, M as MERGED_DURABLE_OBJECTS_MODULE, type S as SchemaInfo, i as createDiscoveryCache, j as discoverSchemaInfo, k as inferLunoraBindings, l as isMergedProject, m as isMergedRoleModule, s as secretSourcesFromBindings } from "./packem_shared/infer-bindings.d-C9ktoVW4.js";
|
|
7
7
|
import { Writable } from 'node:stream';
|
|
8
8
|
export type { D as DeployDriver, a as DeployRequest, b as DevRequest, c as DriverToolchain, P as ProjectedConfig, d as ProjectionPurpose, S as SecretRequest, T as TailRequest, e as ToolchainCommand } from "./packem_shared/deploy-driver.d-Cl96-c1l.js";
|
|
9
9
|
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";
|
|
@@ -59,6 +59,28 @@ declare const AGENT_MODE_ENV = "LUNORA_AGENT_MODE";
|
|
|
59
59
|
* both directions. Pure — pass a custom `env` in tests.
|
|
60
60
|
*/
|
|
61
61
|
declare const detectAiAgent: (env?: EnvLike) => AgentDetection | undefined;
|
|
62
|
+
/** The API specs codegen can emit; `"openapi"` is codegen's own default. */
|
|
63
|
+
type MarkedApiSpec = "both" | "none" | "openapi" | "openrpc";
|
|
64
|
+
/**
|
|
65
|
+
* Record which API spec the bundler plugin's codegen emitted. The CLI's deploy runs the plugin's build
|
|
66
|
+
* before its own codegen, and that codegen must emit the same spec, or it deletes the files the plugin
|
|
67
|
+
* wrote. The plugin is the only place its option is read, so it leaves the answer here.
|
|
68
|
+
*/
|
|
69
|
+
declare const writeApiSpecMarker: (projectRoot: string, apiSpec: MarkedApiSpec | undefined) => void;
|
|
70
|
+
/** Forget a recorded spec, so the next read sees only what a new client build writes. */
|
|
71
|
+
declare const clearApiSpecMarker: (projectRoot: string) => void;
|
|
72
|
+
/** The spec the last plugin codegen recorded, or `undefined` when there is no readable record. */
|
|
73
|
+
declare const readApiSpecMarker: (projectRoot: string) => MarkedApiSpec | undefined;
|
|
74
|
+
/**
|
|
75
|
+
* A deploy target needs the project's client build output, and none exists yet. The CLI tells this apart from an option a
|
|
76
|
+
* target refuses: a run that is about to build creates that output and defers the check to after its build.
|
|
77
|
+
*/
|
|
78
|
+
declare class MissingBuildOutputError extends Error {}
|
|
79
|
+
/**
|
|
80
|
+
* The absolute path with symlinks resolved, so two spellings of one directory compare equal. A path that does not exist yet
|
|
81
|
+
* resolves through its nearest existing ancestor, since the CLI and the plugin often name a `.lunora` directory before creating it.
|
|
82
|
+
*/
|
|
83
|
+
declare const canonicalPath: (path: string) => string;
|
|
62
84
|
/** Spawns the process — injectable so tests run without the binary. */
|
|
63
85
|
type DevProcessSpawner = (command: string, args: ReadonlyArray<string>, options: {
|
|
64
86
|
cwd: string;
|
|
@@ -148,8 +170,25 @@ declare const startCelldDevSession: (options: CelldDevSessionOptions) => Promise
|
|
|
148
170
|
*/
|
|
149
171
|
/** Env var that turns codegen off when it spells `0` / `false`. Unset means on. */
|
|
150
172
|
declare const CODEGEN_ENV = "LUNORA_CODEGEN";
|
|
173
|
+
/** Env var the CLI sets to `0` when `--no-strict-advisories` opts out, so a framework build does not fail on ERROR-level advisories. */
|
|
174
|
+
declare const STRICT_ADVISORIES_ENV = "LUNORA_STRICT_ADVISORIES";
|
|
151
175
|
/** Env var that enables lazy function imports for codegen when it spells `1` / `true`. */
|
|
152
176
|
declare const LAZY_FUNCTIONS_ENV = "LUNORA_LAZY_FUNCTIONS";
|
|
177
|
+
/** The project root the CLI started a client build for. Only that root's plugin checks {@link BUILD_TARGET_ENV} against itself. */
|
|
178
|
+
declare const BUILD_ROOT_ENV = "LUNORA_BUILD_ROOT";
|
|
179
|
+
/**
|
|
180
|
+
* Env var the CLI sets on the client build it spawns (`lunora build` and `lunora deploy`): the target it resolved for this run.
|
|
181
|
+
* A plugin whose own `target` option names another one refuses to build, so the artifact cannot
|
|
182
|
+
* describe a target the deploy will not ship to.
|
|
183
|
+
*/
|
|
184
|
+
declare const BUILD_TARGET_ENV = "LUNORA_BUILD_TARGET";
|
|
185
|
+
/** Env var the CLI sets to the path the Vite plugin writes its server metafile to. Unset means the default under `.lunora/`. */
|
|
186
|
+
declare const BUNDLE_META_PATH_ENV = "LUNORA_BUNDLE_META_PATH";
|
|
187
|
+
/**
|
|
188
|
+
* Where a plain `vite build` (no {@link BUNDLE_META_PATH_ENV}) writes the server metafile. Only a prebuilt worker
|
|
189
|
+
* (`frameworkBuild: false`) reads it back, so the CLI clears it before its own client build.
|
|
190
|
+
*/
|
|
191
|
+
declare const DEFAULT_BUNDLE_META_PATH: string;
|
|
153
192
|
/**
|
|
154
193
|
* Whether a {@link CODEGEN_ENV} value spells an explicit "off".
|
|
155
194
|
*
|
|
@@ -629,7 +668,9 @@ declare const reportCodegenFindings: (result: Pick<CodegenResult, "advisories" |
|
|
|
629
668
|
* presentation — and presentation is what this module owns, which is also why
|
|
630
669
|
* this needs no `tag` parameter: {@link LUNORA_TAG} is right above it.
|
|
631
670
|
*/
|
|
632
|
-
declare const blockingFindingsMessage: (result: Pick<CodegenResult, "advisories" | "platformDiagnostics"
|
|
671
|
+
declare const blockingFindingsMessage: (result: Pick<CodegenResult, "advisories" | "platformDiagnostics">, options?: {
|
|
672
|
+
strictAdvisories?: boolean;
|
|
673
|
+
}) => string | undefined;
|
|
633
674
|
/** Severity a formatted line should be surfaced at, mapped onto the three logger channels. */
|
|
634
675
|
type LunoraLineLevel = "error" | "info" | "warn";
|
|
635
676
|
/** A formatted lunora event: the channel to surface it on, the display text, and which event produced it. */
|
|
@@ -803,6 +844,15 @@ declare const resolveProjectTarget: (projectRoot: string, explicit?: string) =>
|
|
|
803
844
|
* @returns the resolved, registered target id.
|
|
804
845
|
*/
|
|
805
846
|
declare const resolveTargetOrThrow: (projectRoot: string, explicit?: string) => string;
|
|
847
|
+
/**
|
|
848
|
+
* Refuse a plugin-resolved target that differs from the one the CLI resolved
|
|
849
|
+
* for this run. The CLI's `--target` guard only sees the config file, so a target set
|
|
850
|
+
* in a plugin's options would otherwise slip past it. A no-op outside a CLI build,
|
|
851
|
+
* where {@link BUILD_TARGET_ENV} is unset.
|
|
852
|
+
* @param target The target the plugin resolved.
|
|
853
|
+
* @throws when the CLI resolved a different target.
|
|
854
|
+
*/
|
|
855
|
+
declare const assertBuildTargetMatches: (target: string, projectRoot: string) => void;
|
|
806
856
|
/**
|
|
807
857
|
* Whether we can interactively prompt — stdin must be a TTY. In CI / piped
|
|
808
858
|
* contexts this is false, and callers should fall back to a non-interactive
|
|
@@ -1190,4 +1240,4 @@ type ParseSchemaResult = {
|
|
|
1190
1240
|
* message per failure mode without throwing.
|
|
1191
1241
|
*/
|
|
1192
1242
|
declare const parseSchema: (source: string) => ParseSchemaResult;
|
|
1193
|
-
export { AGENT_MODE_ENV, type AddIndexEdit, type AddOptionalColumnEdit, type AddTableEdit, type AdditiveEdit, type AgentDetection, type ApplyEditResult, type ApplyFailureReason, type AugmentPlan, CODEGEN_ENV, type CelldDevSession, type CelldDevSessionOptions, type CelldLineOrigin, type ClaimDevServerStateResult, type ContainerLogLevel, type ContainerLogLine, type ContainerLogSource, type ContainerLogStreamHandle, type ContainerLogStreamOptions, 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 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, LAZY_FUNCTIONS_ENV, LINKED_PROJECT_DIR, LINKED_PROJECT_FILE, LUNORA_EVENT_SOURCE, LUNORA_IGNORED_PATHS, type LinkedProject, type LintIgnoreOutcome, type LintIgnoreStatus, type LintTool, type LunoraFormattedLine, type LunoraLineLevel, type MultiSelectOption, PACKAGE_SECRETS_REGISTRY, type ParseSchemaResult, type PostCodegenHookResult, type RemotePreference, type ScaffoldPlan, type SchemaColumn, type SchemaEdit, type SchemaIndex, type SchemaTable, type SecretEntry, type SelectOption, acceptsConnection, applyAdditiveEdit, applyLintIgnores, blockingFindingsMessage, buildPackageSecretsBlock, claimDevServerState, classifyEdit, clearDevServerState, createConfirm, detectAiAgent, detectFramework, detectLintTools, discoverAgentInfo, discoverContainerInfo, discoverWorkflowInfo, ensureDevVariables, ensureDevVariablesExample as ensureDevVarsExample, ensureDevWorkerEnv, escapeRegExp, fillDevSecrets, formatLunoraEvent, generateSecretValue, interpretRemote, isCodegenDisabled, isDevServerReady, isInteractive, isLazyFunctionsEnabled, isMintableSecretKey, isPlaceholderValue, isProcessAlive, isRecordedProcessCurrent, parseDevVariableEntries, parseSchema, planDevSecretsFill, planDevVariablesAugment, planDevVariablesScaffold, projectUsesUmbrella, promptMultiSelect, promptSelect, promptText, promptYesNo, readDevServerState, readLinkedProject, readLiveDevServerState, readProjectRemotePreference, readProjectTarget, removeDevVariableLine, reportCodegenFindings, requiredSecrets, resolveLazyFunctions, resolveProjectTarget, resolveSchemaDirectory, resolveTargetOrThrow, runPostCodegenHook, secretsForPackages, startCelldDevSession, startDevProcess, streamContainerLogs, updateDevServerState, upsertDevVariableLine, writeDevServerState, writeDevVariablesFileAtomically, writeLinkedProject };
|
|
1243
|
+
export { AGENT_MODE_ENV, type AddIndexEdit, type AddOptionalColumnEdit, type AddTableEdit, type AdditiveEdit, type AgentDetection, type ApplyEditResult, type ApplyFailureReason, type AugmentPlan, BUILD_ROOT_ENV, BUILD_TARGET_ENV, BUNDLE_META_PATH_ENV, CODEGEN_ENV, type CelldDevSession, type CelldDevSessionOptions, type CelldLineOrigin, type ClaimDevServerStateResult, type ContainerLogLevel, type ContainerLogLine, type ContainerLogSource, type ContainerLogStreamHandle, type ContainerLogStreamOptions, DEFAULT_BUNDLE_META_PATH, 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 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, LAZY_FUNCTIONS_ENV, LINKED_PROJECT_DIR, LINKED_PROJECT_FILE, LUNORA_EVENT_SOURCE, LUNORA_IGNORED_PATHS, type LinkedProject, type LintIgnoreOutcome, type LintIgnoreStatus, type LintTool, type LunoraFormattedLine, type LunoraLineLevel, type MarkedApiSpec, MissingBuildOutputError, type MultiSelectOption, PACKAGE_SECRETS_REGISTRY, type ParseSchemaResult, type PostCodegenHookResult, type RemotePreference, STRICT_ADVISORIES_ENV, type ScaffoldPlan, type SchemaColumn, type SchemaEdit, type SchemaIndex, type SchemaTable, type SecretEntry, type SelectOption, acceptsConnection, applyAdditiveEdit, applyLintIgnores, assertBuildTargetMatches, blockingFindingsMessage, buildPackageSecretsBlock, canonicalPath, claimDevServerState, classifyEdit, clearApiSpecMarker, clearDevServerState, createConfirm, detectAiAgent, detectFramework, detectLintTools, discoverAgentInfo, discoverContainerInfo, discoverWorkflowInfo, ensureDevVariables, ensureDevVariablesExample as ensureDevVarsExample, ensureDevWorkerEnv, escapeRegExp, fillDevSecrets, formatLunoraEvent, generateSecretValue, interpretRemote, isCodegenDisabled, isDevServerReady, isInteractive, isLazyFunctionsEnabled, isMintableSecretKey, isPlaceholderValue, isProcessAlive, isRecordedProcessCurrent, parseDevVariableEntries, parseSchema, planDevSecretsFill, planDevVariablesAugment, planDevVariablesScaffold, projectUsesUmbrella, promptMultiSelect, promptSelect, promptText, promptYesNo, readApiSpecMarker, readDevServerState, readLinkedProject, readLiveDevServerState, readProjectRemotePreference, readProjectTarget, removeDevVariableLine, reportCodegenFindings, requiredSecrets, resolveLazyFunctions, resolveProjectTarget, resolveSchemaDirectory, resolveTargetOrThrow, runPostCodegenHook, secretsForPackages, startCelldDevSession, startDevProcess, streamContainerLogs, updateDevServerState, upsertDevVariableLine, writeApiSpecMarker, 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 c,ROOT_SKILL_NAME as
|
|
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 c,ROOT_SKILL_NAME as p,claimAgentRulesHint as l,detectAgentRules as D}from"./packem_shared/AGENT_RULES_DIR-Bd6JPtNa.mjs";import{clearApiSpecMarker as A,readApiSpecMarker as S,writeApiSpecMarker as m}from"./packem_shared/clearApiSpecMarker-DMGpP41V.mjs";import{MissingBuildOutputError as f}from"./packem_shared/MissingBuildOutputError-BAyekzof.mjs";import{default as T}from"./packem_shared/canonicalPath-DrfMiT3U.mjs";import{startCelldDevSession as v}from"./packem_shared/startCelldDevSession-PHdbwtI5.mjs";import{BUILD_ROOT_ENV as g,BUILD_TARGET_ENV as V,BUNDLE_META_PATH_ENV as I,CODEGEN_ENV as u,DEFAULT_BUNDLE_META_PATH as O,LAZY_FUNCTIONS_ENV as P,STRICT_ADVISORIES_ENV as M,isCodegenDisabled as U,isLazyFunctionsEnabled as F,resolveLazyFunctions as C}from"./packem_shared/BUILD_ROOT_ENV-Dg4MV3wY.mjs";import{discoverContainerInfo as G}from"./packem_shared/discoverContainerInfo-DzXr7Vm3.mjs";import{streamContainerLogs as y}from"./packem_shared/streamContainerLogs-0nko1qpv.mjs";import{detectFramework as h,projectUsesUmbrella as j}from"./packem_shared/detectFramework-Dfpvu6rD.mjs";import{acceptsConnection as K,startDevProcess as H}from"./packem_shared/acceptsConnection-DHhUYGjT.mjs";import{DEV_BINDINGS_FILE as Y,DEV_DAEMON_ENV as J,DEV_HANDOFF_ENV as z,DEV_LOG_FILE as q,DEV_LOG_FILE_ENV as X,DEV_STATE_DIR as Z,DEV_STATE_FILE as Q,claimDevServerState as $,clearDevServerState as ee,isDevServerReady as re,isProcessAlive as oe,isRecordedProcessCurrent as te,readDevServerState as ae,readLiveDevServerState as Ee,updateDevServerState as se,writeDevServerState as ie}from"./packem_shared/DEV_BINDINGS_FILE-C0ZN_XlP.mjs";import{DEV_VARS_EXAMPLE_FILE as _e,DEV_VARS_FILE as ce,DEV_VARS_KEY_PATTERN as pe,escapeRegExp as le,parseDevVariableEntries as De,removeDevVariableLine as de,upsertDevVariableLine as Ae}from"./packem_shared/DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";import{DEV_WORKER_ENV_VALUE as me,DEV_WORKER_ENV_VAR as Le,ensureDevWorkerEnv as fe}from"./packem_shared/DEV_WORKER_ENV_VALUE-CARjGoAv.mjs";import{createDiscoveryCache as Te}from"./packem_shared/createDiscoveryCache-npJI4uej.mjs";import{DEFAULT_DEPLOY_TARGET as ve,deployTargetIds as xe,isRunnableTarget as ge,planToolchainInvocation as Ve,resolveDeployDriver as Ie,runnableTargetIds as ue,targetRunsOwnDevServer as Oe}from"./packem_shared/DEFAULT_DEPLOY_TARGET-CnovxJid.mjs";import{inferLunoraBindings as Me,secretSourcesFromBindings as Ue}from"./packem_shared/inferLunoraBindings-BT4-fwiQ.mjs";import{LINKED_PROJECT_DIR as Ce,LINKED_PROJECT_FILE as Be,readLinkedProject as Ge,writeLinkedProject as be}from"./packem_shared/LINKED_PROJECT_DIR-Ba5qPEwo.mjs";import{LUNORA_IGNORED_PATHS as ke,applyLintIgnores as he,detectLintTools as je}from"./packem_shared/LUNORA_IGNORED_PATHS-U93uPxrW.mjs";import{blockingFindingsMessage as Ke,reportCodegenFindings as He}from"./packem_shared/blockingFindingsMessage-CRbg1sla.mjs";import{LUNORA_EVENT_SOURCE as Ye,formatLunoraEvent as Je}from"./packem_shared/LUNORA_EVENT_SOURCE-B9ZVohjO.mjs";import{LUNORA_TAG as qe,advisoryLine as Xe,lunoraLine as Ze}from"./packem_shared/LUNORA_TAG-DQTGPqcJ.mjs";import{default as $e}from"./packem_shared/LunoraReporter-f277GLNT.mjs";import{addArgsFor as rr,detectInstalledManagers as or,detectPackageManager as tr,execArgsFor as ar,installArgsFor as Er,runScriptArgsFor as sr,runScriptCommand as ir,toolchainExecArgs as nr}from"./packem_shared/addArgsFor-CYZKhNIo.mjs";import{P as cr,s as pr}from"./packem_shared/package-secrets-registry-BEJELdls.mjs";import{runPostCodegenHook as Dr}from"./packem_shared/runPostCodegenHook-Dx3yTsYZ.mjs";import{assertBuildTargetMatches as Ar,interpretRemote as Sr,readProjectRemotePreference as mr,readProjectTarget as Lr,resolveProjectTarget as fr,resolveTargetOrThrow as Nr}from"./packem_shared/assertBuildTargetMatches-Bw7uURKp.mjs";import{readProjectDependencies as Rr,readProjectDependencyNames as vr,readProjectManifest as xr}from"./packem_shared/readProjectDependencies-l3uhUKjo.mjs";import{createConfirm as Vr,isInteractive as Ir,promptMultiSelect as ur,promptSelect as Or,promptText as Pr,promptYesNo as Mr}from"./packem_shared/createConfirm-D5mKTMHj.mjs";import{default as Fr}from"./packem_shared/resolveSchemaDirectory-Ca5P6KuP.mjs";import{buildPackageSecretsBlock as Br,ensureDevVariables as Gr,ensureDevVarsExample as br,fillDevSecrets as yr,generateSecretValue as kr,isMintableSecretKey as hr,isPlaceholderValue as jr,planDevSecretsFill as wr,planDevVariablesAugment as Kr,planDevVariablesScaffold as Hr,requiredSecrets as Wr,writeDevVariablesFileAtomically as Yr}from"./packem_shared/buildPackageSecretsBlock-C5WZfMwe.mjs";import{applyAdditiveEdit as zr,classifyEdit as qr}from"./packem_shared/applyAdditiveEdit-CH0VhMJ2.mjs";import{parseSchema as Zr}from"./packem_shared/parseSchema-D1Wbr1qv.mjs";import{classifyPolicyEdit as $r,resolveServerModule as eo,scaffoldPolicyFile as ro,wireRlsIntoProcedure as oo}from"./packem_shared/classifyPolicyEdit-DJi9Fk8G.mjs";import{discoverSchemaInfo as ao}from"./packem_shared/discoverSchemaInfo-BBRlXZop.mjs";import{ACCENT as so,BADGES as io,BADGE_COLUMN_WIDTH as no,LUNA_ART as _o,LUNA_BUNNY as co,LUNA_NAME as po,LUNA_SIGNOFF as lo,STEP_BADGE_NAMES as Do,badgeLead as Ao,badgeWidth as So,padBadge as mo,paintAnswer as Lo,paintBadge as fo}from"./packem_shared/ACCENT-CotPTfv7.mjs";import{COMPOSED_WORKER_ENTRY as To,DURABLE_OBJECT_BINDINGS as Ro,GENERATED_CLASS_MODULES as vo,GENERATED_MODULE_DURABLE_OBJECTS as xo,MERGED_DURABLE_OBJECTS_MODULE as go,isMergedProject as Vo,isMergedRoleModule as Io}from"./packem_shared/COMPOSED_WORKER_ENTRY-Ciiba5g_.mjs";import{discoverWorkflowInfo as Oo}from"./packem_shared/discoverWorkflowInfo-zW7Tt0Tn.mjs";export{so as ACCENT,o as AGENT_MODE_ENV,i as AGENT_RULES_DIR,n as AGENT_RULES_HINT,_ as AGENT_RULES_HINT_ENV,io as BADGES,no as BADGE_COLUMN_WIDTH,g as BUILD_ROOT_ENV,V as BUILD_TARGET_ENV,I as BUNDLE_META_PATH_ENV,u as CODEGEN_ENV,To as COMPOSED_WORKER_ENTRY,O as DEFAULT_BUNDLE_META_PATH,ve as DEFAULT_DEPLOY_TARGET,Y as DEV_BINDINGS_FILE,J as DEV_DAEMON_ENV,z as DEV_HANDOFF_ENV,q as DEV_LOG_FILE,X as DEV_LOG_FILE_ENV,Z as DEV_STATE_DIR,Q as DEV_STATE_FILE,_e as DEV_VARS_EXAMPLE_FILE,ce as DEV_VARS_FILE,pe as DEV_VARS_KEY_PATTERN,me as DEV_WORKER_ENV_VALUE,Le as DEV_WORKER_ENV_VAR,Ro as DURABLE_OBJECT_BINDINGS,vo as GENERATED_CLASS_MODULES,xo as GENERATED_MODULE_DURABLE_OBJECTS,P as LAZY_FUNCTIONS_ENV,Ce as LINKED_PROJECT_DIR,Be as LINKED_PROJECT_FILE,_o as LUNA_ART,co as LUNA_BUNNY,po as LUNA_NAME,lo as LUNA_SIGNOFF,Ye as LUNORA_EVENT_SOURCE,ke as LUNORA_IGNORED_PATHS,c as LUNORA_SKILL_NAMES,qe as LUNORA_TAG,$e as LunoraReporter,go as MERGED_DURABLE_OBJECTS_MODULE,f as MissingBuildOutputError,cr as PACKAGE_SECRETS_REGISTRY,p as ROOT_SKILL_NAME,Do as STEP_BADGE_NAMES,M as STRICT_ADVISORIES_ENV,K as acceptsConnection,rr as addArgsFor,Xe as advisoryLine,zr as applyAdditiveEdit,he as applyLintIgnores,Ar as assertBuildTargetMatches,Ao as badgeLead,So as badgeWidth,Ke as blockingFindingsMessage,Br as buildPackageSecretsBlock,T as canonicalPath,l as claimAgentRulesHint,$ as claimDevServerState,qr as classifyEdit,$r as classifyPolicyEdit,A as clearApiSpecMarker,ee as clearDevServerState,Vr as createConfirm,Te as createDiscoveryCache,xe as deployTargetIds,D as detectAgentRules,t as detectAiAgent,h as detectFramework,or as detectInstalledManagers,je as detectLintTools,tr as detectPackageManager,E as discoverAgentInfo,G as discoverContainerInfo,ao as discoverSchemaInfo,Oo as discoverWorkflowInfo,Gr as ensureDevVariables,br as ensureDevVarsExample,fe as ensureDevWorkerEnv,le as escapeRegExp,ar as execArgsFor,yr as fillDevSecrets,Je as formatLunoraEvent,kr as generateSecretValue,Me as inferLunoraBindings,Er as installArgsFor,Sr as interpretRemote,U as isCodegenDisabled,re as isDevServerReady,Ir as isInteractive,F as isLazyFunctionsEnabled,Vo as isMergedProject,Io as isMergedRoleModule,hr as isMintableSecretKey,jr as isPlaceholderValue,oe as isProcessAlive,te as isRecordedProcessCurrent,ge as isRunnableTarget,Ze as lunoraLine,mo as padBadge,Lo as paintAnswer,fo as paintBadge,De as parseDevVariableEntries,Zr as parseSchema,wr as planDevSecretsFill,Kr as planDevVariablesAugment,Hr as planDevVariablesScaffold,Ve as planToolchainInvocation,j as projectUsesUmbrella,ur as promptMultiSelect,Or as promptSelect,Pr as promptText,Mr as promptYesNo,S as readApiSpecMarker,ae as readDevServerState,Ge as readLinkedProject,Ee as readLiveDevServerState,Rr as readProjectDependencies,vr as readProjectDependencyNames,xr as readProjectManifest,mr as readProjectRemotePreference,Lr as readProjectTarget,de as removeDevVariableLine,He as reportCodegenFindings,Wr as requiredSecrets,Ie as resolveDeployDriver,C as resolveLazyFunctions,fr as resolveProjectTarget,Fr as resolveSchemaDirectory,eo as resolveServerModule,Nr as resolveTargetOrThrow,Dr as runPostCodegenHook,sr as runScriptArgsFor,ir as runScriptCommand,ue as runnableTargetIds,ro as scaffoldPolicyFile,Ue as secretSourcesFromBindings,pr as secretsForPackages,v as startCelldDevSession,H as startDevProcess,y as streamContainerLogs,Oe as targetRunsOwnDevServer,nr as toolchainExecArgs,se as updateDevServerState,Ae as upsertDevVariableLine,oo as wireRlsIntoProcedure,m as writeApiSpecMarker,ie as writeDevServerState,Yr as writeDevVariablesFileAtomically,be as writeLinkedProject};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{join as _}from"node:path";const E="LUNORA_CODEGEN",N="LUNORA_STRICT_ADVISORIES",t="LUNORA_LAZY_FUNCTIONS",L="LUNORA_BUILD_ROOT",A="LUNORA_BUILD_TARGET",T="LUNORA_BUNDLE_META_PATH",r=_(".lunora","vite-bundle-meta.json"),O=o=>{const n=o?.trim().toLowerCase();return n==="0"||n==="false"},s=o=>{const n=o?.trim().toLowerCase();return n==="1"||n==="true"},U=o=>o===!0||s(process.env[t]);export{L as BUILD_ROOT_ENV,A as BUILD_TARGET_ENV,T as BUNDLE_META_PATH_ENV,E as CODEGEN_ENV,r as DEFAULT_BUNDLE_META_PATH,t as LAZY_FUNCTIONS_ENV,N as STRICT_ADVISORIES_ENV,O as isCodegenDisabled,s as isLazyFunctionsEnabled,U as resolveLazyFunctions};
|
package/dist/packem_shared/{DEFAULT_DEPLOY_TARGET-rR7buNQw.mjs → DEFAULT_DEPLOY_TARGET-CnovxJid.mjs}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as a}from"./celld-config-
|
|
1
|
+
import{p as a}from"./celld-config-Iv0tK526.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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
class s extends Error{}export{s as MissingBuildOutputError};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{existsSync as d,readFileSync as y}from"node:fs";import{join as s,isAbsolute as a,relative as m}from"node:path";import{LunoraError as p}from"@lunora/errors";import{classifyPolicyEdit as k,scaffoldPolicyFile as v,resolveServerModule as l,wireRlsIntoProcedure as b}from"./classifyPolicyEdit-DJi9Fk8G.mjs";import{w as c,r as h}from"./write-atomic-
|
|
1
|
+
import{existsSync as d,readFileSync as y}from"node:fs";import{join as s,isAbsolute as a,relative as m}from"node:path";import{LunoraError as p}from"@lunora/errors";import{classifyPolicyEdit as k,scaffoldPolicyFile as v,resolveServerModule as l,wireRlsIntoProcedure as b}from"./classifyPolicyEdit-DJi9Fk8G.mjs";import{w as c,r as h}from"./write-atomic-D0PdxcE3.mjs";const D="/__lunora/policy-scaffold",u=e=>e==="unknown-procedure"?404:e==="already-wired"||e==="destructive"?409:422,f=(e,o)=>{let r;try{r=h(e)}catch(t){return{body:{error:t instanceof Error?t.message:String(t),ok:!1},status:500}}return{body:{...o,diagnostics:r,ok:!0},status:200}},g=e=>({body:{edit:e,message:"Rewriting an existing policy predicate changes evaluation semantics and must be done by hand. The scaffolder only adds new, deny-by-default rules.",needsManualEdit:!0,ok:!1},status:409}),w=(e,o)=>{const r=v(o,l(e.projectRoot));if(!r.ok)return{body:{error:r.reason,ok:!1},status:u(r.reason)};const t=e.schemaDirectory??"lunora",n=s(e.projectRoot,t,r.fileName);return d(n)?{body:{error:"file-exists",fileName:r.fileName,ok:!1},status:409}:(c(n,r.source),f(e,{fileName:r.fileName}))},R=(e,o,r)=>{if(typeof r!="string"||r.length===0||a(r)||r.includes("\\"))return;const t=s(e,o),n=s(t,`${r}.ts`),i=m(t,n);if(!(i.startsWith("..")||a(i)))return n},N=(e,o)=>{const r=R(e.projectRoot,e.schemaDirectory??"lunora",o.filePath);if(r===void 0||!d(r))return{body:{error:"unknown-procedure",ok:!1},status:404};const t=b(y(r,"utf8"),o,l(e.projectRoot));return t.ok?(c(r,t.text),f(e,{exportName:o.exportName})):{body:{error:t.reason,ok:!1},status:u(t.reason)}},E=e=>{if(e.method!=="POST")return{body:{error:"method-not-allowed",ok:!1},status:405};const{body:o}=e;if(o==null||typeof o!="object"||typeof o.kind!="string")return{body:{error:"invalid-edit",ok:!1},status:400};const r=o;if(k(r)==="destructive")return g(r);if(r.kind==="scaffoldPolicy")return w(e,r);if(r.kind==="wireRls")return N(e,r);throw new p("INTERNAL",`unhandled additive policy edit kind: ${String(r.kind)}`)};export{D as POLICY_SCAFFOLD_ENDPOINT,E as handlePolicyScaffoldRequest};
|
package/dist/packem_shared/{SCHEMA_EDIT_ENDPOINT-oGE8lMFF.mjs → SCHEMA_EDIT_ENDPOINT-Cgpy_347.mjs}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{existsSync as a,readFileSync as d}from"node:fs";import{classifyEdit as l,applyAdditiveEdit as c}from"./applyAdditiveEdit-CH0VhMJ2.mjs";import{parseSchema as u}from"./parseSchema-D1Wbr1qv.mjs";import{w as f,r as p}from"./write-atomic-
|
|
1
|
+
import{existsSync as a,readFileSync as d}from"node:fs";import{classifyEdit as l,applyAdditiveEdit as c}from"./applyAdditiveEdit-CH0VhMJ2.mjs";import{parseSchema as u}from"./parseSchema-D1Wbr1qv.mjs";import{w as f,r as p}from"./write-atomic-D0PdxcE3.mjs";import{join as m}from"node:path";const F="/__lunora/schema-edit",b=t=>t==="destructive"||t==="duplicate-table"||t==="duplicate-column"||t==="duplicate-index"?409:t==="unknown-table"?404:t==="invalid-identifier"||t==="invalid-validator"?400:422,y=t=>({body:{error:t.reason,ok:!1},status:422}),h=t=>{if(!a(t))return{response:{body:{error:"no-schema-file",ok:!1},status:404}};const r=u(d(t,"utf8"));return r.ok?{tables:r.tables}:{response:y(r)}},k=t=>({body:{edit:t,message:"This edit changes stored data and must go through a migration. Review the migration before applying.",needsMigration:!0,ok:!1},status:409}),g=(t,r)=>{const e=t.body;if(e==null||typeof e!="object"||typeof e.kind!="string")return{body:{error:"invalid-edit",ok:!1},status:400};if(l(e)==="destructive")return k(e);if(!a(r))return{body:{error:"no-schema-file",ok:!1},status:404};const o=c(d(r,"utf8"),e);if(!o.ok)return{body:{error:o.reason,ok:!1},status:b(o.reason)};f(r,o.text);let i;try{i=p(t)}catch(s){return{body:{error:s instanceof Error?s.message:String(s),ok:!1},status:500}}const n=u(o.text);return{body:{diagnostics:i,ok:!0,tables:n.ok?n.tables:[]},status:200}},R=t=>{const r=m(t.projectRoot,t.schemaDirectory??"lunora","schema.ts");if(t.method==="GET"){const e=h(r);return"response"in e?e.response:{body:{ok:!0,tables:e.tables},status:200}}return t.method==="POST"?g(t,r):{body:{error:"method-not-allowed",ok:!1},status:405}};export{F as SCHEMA_EDIT_ENDPOINT,R as handleSchemaEditRequest};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{resolveAdminToken as A}from"./parseDevVariable-teAAahVD.mjs";import{sendStudioDocument as I,applyStudioAssetCache as O}from"./applyStudioAssetCache-DHQEJuuv.mjs";import{isStandaloneModulePath as _,studioAssetsStamp as H,loadStudioAssets as N,readStandaloneAsset as C,assetContentType as D}from"./assetContentType-CUb5bpbI.mjs";import{detectAgentRules as E}from"./AGENT_RULES_DIR-Bd6JPtNa.mjs";import{handlePolicyScaffoldRequest as v,POLICY_SCAFFOLD_ENDPOINT as L}from"./POLICY_SCAFFOLD_ENDPOINT-
|
|
1
|
+
import{resolveAdminToken as A}from"./parseDevVariable-teAAahVD.mjs";import{sendStudioDocument as I,applyStudioAssetCache as O}from"./applyStudioAssetCache-DHQEJuuv.mjs";import{isStandaloneModulePath as _,studioAssetsStamp as H,loadStudioAssets as N,readStandaloneAsset as C,assetContentType as D}from"./assetContentType-CUb5bpbI.mjs";import{detectAgentRules as E}from"./AGENT_RULES_DIR-Bd6JPtNa.mjs";import{handlePolicyScaffoldRequest as v,POLICY_SCAFFOLD_ENDPOINT as L}from"./POLICY_SCAFFOLD_ENDPOINT-eNqjov6d.mjs";import R from"./renderStudioHtml-ByowDtMl.mjs";import{handleSchemaEditRequest as b,SCHEMA_EDIT_ENDPOINT as x}from"./SCHEMA_EDIT_ENDPOINT-Cgpy_347.mjs";import{handleSeedRequest as k,SEED_ENDPOINT as $}from"./SEED_ENDPOINT-2B56PN_H.mjs";import{serveJsonHandler as g}from"./serveJsonHandler-Dv0EdCb9.mjs";import{transportRejectionReason as j}from"./ALLOW_FORWARDED_ENV-BUndghJx.mjs";const d="/__lunora",F=`${d}/studio.js`,m=`${d}/styles.css`,y=/\/$/,M={[L]:v,[x]:b,[$]:k},U=new Set(["127.0.0.1","::1","localhost"]),X=t=>t!==void 0&&t!==!1&&!U.has(t),P=t=>t===void 0||t==="/"?"":t.replace(y,""),Z=t=>`${P(t)}${d}`,T=(t,a,c)=>{t.statusCode=200,t.setHeader("Content-Type",c),t.end(a)},q=t=>{try{return new URL(t,"http://localhost").pathname}catch{const a=t.indexOf("?");return a===-1?t:t.slice(0,a)}},tt=t=>{const{logger:a,projectRoot:c}=t,u=P(t.base);let l,f,S;const p=(o,n,e)=>{const i=H();if((l===void 0||i!==f)&&(l=N(a),f=i),l===void 0){e.statusCode=501,e.setHeader("Content-Type","text/plain"),e.end("Lunora studio assets not found — install and build @lunora/studio.");return}const s=o===m,r=o.slice(o.lastIndexOf("/")+1);if(O(n,e,r,i))return;if(s){T(e,l.styles,"text/css; charset=utf-8");return}const h=C(r);if(h===void 0){e.statusCode=404,e.setHeader("Content-Type","text/plain"),e.end("Not found");return}T(e,h,D(r))};return(o,n,e)=>{const i=q(o.url??"").replace(y,""),s=u!==""&&i.startsWith(u)?i.slice(u.length):i;if(s!==d&&!s.startsWith(`${d}/`)){e();return}if(t.isNonLoopbackBind||j(o,a)!==void 0){n.statusCode=403,n.setHeader("Content-Type","text/plain"),n.end("Lunora studio is only available on loopback hosts in dev.");return}const r=M[s];if(r!==void 0){g(o,n,r,c,{apiSpec:t.apiSpec,lazyFunctions:t.lazyFunctions,schemaDirectory:t.schemaDirectory});return}if(s===m||_(s)){p(s,o,n);return}S??=R({adminToken:A(c),basePath:d,dataEditable:!0,rulesInstalled:E(c).installed,runAsIdentity:!0,schemaEditable:!0,scriptSrc:F,styleHref:m}),I(n,S)}};export{d as STUDIO_PATH,F as STUDIO_SCRIPT_PATH,m as STUDIO_STYLE_PATH,tt as createStudioMiddleware,X as isNonLoopbackHost,q as requestPathname,Z as studioMountPath};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{readProjectConfigLiterals as s,readProjectTarget as c}from"@lunora/codegen";import n from"./canonicalPath-DrfMiT3U.mjs";import{BUILD_TARGET_ENV as i,BUILD_ROOT_ENV as a}from"./BUILD_ROOT_ENV-Dg4MV3wY.mjs";import{DEFAULT_DEPLOY_TARGET as p,resolveDeployDriver as f}from"./DEFAULT_DEPLOY_TARGET-CnovxJid.mjs";const d=e=>{if(typeof e=="boolean")return e;if(e!==null&&typeof e=="object")return!0},P=e=>d(s(e).remote),T=e=>c(e),g=(e,t)=>t??T(e)??p,j=(e,t)=>{const r=g(e,t);return f(r),r},v=(e,t)=>{const r=process.env[i],o=process.env[a];if(!(o===void 0||o===""||n(o)!==n(t))&&r!==void 0&&r!==""&&r!==e)throw new Error(`the plugin resolves target "${e}" but the CLI resolved "${r}" for this run; set the same target in the plugin options and the project config`)};export{v as assertBuildTargetMatches,d as interpretRemote,P as readProjectRemotePreference,T as readProjectTarget,g as resolveProjectTarget,j as resolveTargetOrThrow};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{describeErrorLevelFindings as a,sortedUniqueNames as l}from"@lunora/codegen";import{LUNORA_TAG as d,advisoryLine as n}from"./LUNORA_TAG-DQTGPqcJ.mjs";const f=(r,i)=>{for(const e of r.advisories){const o=n(e.level,e.name,e.detail,e.remediation);e.level==="ERROR"?i.error(o):i.warn(o)}for(const e of r.platformDiagnostics){const o=n(e.level==="error"?"ERROR":"WARN",e.name,e.message,e.remediation);e.level==="error"?i.error(o):i.warn(o)}},v=(r,i={})=>{const{advisoryNames:e,platformDiagnosticNames:o}=a(r),s=l([...i.strictAdvisories===!1?[]:e,...o]);if(s.length===0)return;const t=s.length===1?"advisory/platform diagnostic":"advisories/platform diagnostics";return`${d} ${String(s.length)} ERROR-level ${t} (${s.join(", ")}) — see the log above for detail.`};export{v as blockingFindingsMessage,f as reportCodegenFindings};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{realpathSync as e}from"node:fs";import{resolve as n,dirname as o,join as c,basename as s}from"node:path";const i=r=>{const t=n(r);try{return e.native(t)}catch{const a=o(t);return a===t?t:c(i(a),s(t))}};export{i as default};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{writeFileSync as $,rmSync as V,existsSync as b,readFileSync as j}from"node:fs";import{dirname as E,resolve as h,join as y,sep as g,relative as v,isAbsolute as R}from"node:path";import{MissingBuildOutputError as W}from"./MissingBuildOutputError-BAyekzof.mjs";import{findWranglerFile as x,readWranglerJsonc as B}from"./WRANGLER_FILES-UNW-xY5u.mjs";import{DEV_VARS_FILE as F,parseDevVariableEntries as L}from"./DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";const Y=".celld.wrangler.json",J=y(".wrangler","deploy","config.json"),K=new Set(["$schema","assets","compatibility_date","compatibility_flags","containers","d1_databases","define","durable_objects","kv_namespaces","main","migrations","name","no_bundle","queues","r2_buckets","rules","services","triggers","vars","worker_loaders","workflows"]),q=new Set(["class_name","image","instance_type","max_instances","name","runtime"]),M=new Set(["CompiledWasm","Data","Text"]),G=/\r?\n/u,U=/[!*?[]/u,X=/[.[]/u,z=["deleted_classes","new_classes","renamed_classes","transferred_classes"],l=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),O=e=>Array.isArray(e)&&e.length===0||l(e)&&Object.values(e).every(t=>O(t)),H=e=>Array.isArray(e)?e.map(t=>{if(!l(t))return t;const s=z.find(r=>t[r]!==void 0);if(s!==void 0)throw new Error(`migration "${String(t.tag)}" uses \`${s}\`, which celld refuses — celld accepts only \`new_sqlite_classes\` migrations`);return{new_sqlite_classes:t.new_sqlite_classes,tag:t.tag}}):e,Q=(e,t)=>Array.isArray(e)?e.map((s,r)=>l(s)?Object.fromEntries(Object.entries(s).filter(([n])=>{const o=q.has(n);return o||t.push(`containers[${String(r)}].${n}`),o})):s):e,Z=(e,t)=>Array.isArray(e)?e.filter((s,r)=>{const n=l(s)&&typeof s.type=="string"&&M.has(s.type);return n||t.push(`rules[${String(r)}]`),n}):e,ee=e=>{const t=[],s={};for(const[r,n]of Object.entries(l(e)?e:{}))l(n)&&n.type==="workflow"?t.push({binding:r,class_name:r,name:n.name}):s[r]=n;return{bindings:t,rest:s}},k=e=>{const t=[],s={},r=ee(e.exports),n={...e,exports:r.rest};for(const[o,i]of Object.entries(n)){if(!K.has(o)){O(i)||t.push(o);continue}switch(o){case"containers":{s[o]=Q(i,t);break}case"migrations":{s[o]=H(i);break}case"rules":{s[o]=Z(i,t);break}default:s[o]=i}}if(r.bindings.length>0){const o=Array.isArray(s.workflows)?s.workflows:[];s.workflows=[...o,...r.bindings]}return{config:s,dropped:t}},se=e=>{const[t=[],...s]=e.map(n=>h(n).split(g));let r=0;for(;r<t.length&&s.every(n=>n[r]===t[r]);)r+=1;return t.slice(0,r).join(g)||g},C=(e,t,s)=>{const r=o=>v(s,h(t,o)).split(g).join("/"),n={...e};return typeof e.main=="string"&&(n.main=r(e.main)),l(e.assets)&&typeof e.assets.directory=="string"&&(n.assets={...e.assets,directory:r(e.assets.directory)}),n},re=e=>{const t=y(e,".assetsignore");if(!b(t))return;const s=j(t,"utf8").split(G).map(r=>r.trim()).filter(r=>r!==""&&!r.startsWith("#")).filter(r=>U.test(r)||b(y(e,r)));if(s.length>0)throw new Error(`${t} hides ${s.join(", ")} from the assets, and celld has no .assetsignore — remove those files from ${e} first`);return t},te=(e,t)=>{const s=y(e,J);if(!b(s))throw new W(`wrangler \`main\` is the Vite virtual module "${t}", so celld deploys the Vite build output — and there is none yet. Run the project's build (\`vite build\`) first`);const{configPath:r}=JSON.parse(j(s,"utf8"));if(typeof r!="string")throw new TypeError(`${s} names no configPath`);return h(E(s),r)},A=e=>{const{parsed:t}=B(e);if(t===void 0)throw new Error(`${e} is not valid JSONC`);return t},D=(e,t,s,r)=>{const{d1_databases:n}=e;if(!Array.isArray(n)||r===s)return e;const o=Array.isArray(t.d1_databases)?t.d1_databases.filter(i=>l(i)):[];return{...e,d1_databases:n.map(i=>{if(!l(i))return i;const a=o.find(w=>w.binding===i.binding),c=a?.migrations_dir,f=h(s,typeof c=="string"?c:"migrations"),d=b(f)?{...i,migrations_dir:v(r,f).split(g).join("/")}:i,u=a?.migrations_pattern;return typeof u=="string"?{...d,migrations_pattern:v(r,h(s,u)).split(g).join("/")}:d})}},ne=(e,t,s,r)=>{const{main:n}=s;if(typeof n!="string"||!n.startsWith("virtual:"))return{fromBuild:!1,source:s,sourcePath:t};if(r==="dev")throw new Error(`wrangler \`main\` is the Vite virtual module "${n}", which only a Vite build can resolve — \`celld dev\` rebuilds from a source file. Use \`vite dev\` for the dev loop and \`lunora deploy\` to ship the build to celld, or point \`main\` at a worker file`);const o=te(e,n);return{fromBuild:!0,source:A(o),sourcePath:o}},oe=(e,t,s,r,n)=>{const o=t.filter(c=>Object.hasOwn(s,c.split(X)[0]??c));let i=e;e.no_bundle!==void 0&&(i=Object.fromEntries(Object.entries(e).filter(([c])=>c!=="no_bundle")),o.push("no_bundle (celld re-bundles the build output)"));const a=r===void 0?void 0:re(r);return a!==void 0&&o.push(`${v(n,a)} (matched no files)`),{assetsIgnore:a,projected:i,reported:o}},I=e=>{const t=l(e.vars)?e.vars:{};return{...e,vars:{WORKER_ENV:"development",...t}}},fe=(e,t)=>{const s=x(e);if(s===void 0)throw new Error(`no wrangler.jsonc or wrangler.json in ${e} — celld deploys from the project's Wrangler config`);const r=A(s),{fromBuild:n,source:o,sourcePath:i}=ne(e,s,r,t),a=E(i),{config:c,dropped:f}=k(o),{assets:d}=o,u=l(d)&&typeof d.directory=="string"?h(a,d.directory):void 0,w=typeof o.main=="string"?E(h(a,o.main)):void 0,p=se([a,w,u].filter(T=>T!==void 0));if(!n&&p!==a)throw new Error(`wrangler \`main\` and \`assets.directory\` must sit inside ${a} — celld resolves everything against the config's directory`);const _=D(C(c,a,p),r,e,p),m=n?oe(_,f,r,u,p):{assetsIgnore:void 0,projected:_,reported:f},N=t==="dev"?I(m.projected):m.projected,S=y(p,Y),P=`${JSON.stringify(N,void 0,4)}
|
|
2
|
+
`;return{configPath:S,dropped:m.reported,write:()=>{$(S,P),m.assetsIgnore!==void 0&&V(m.assetsIgnore)}}},ue=(e,t)=>{const s=A(t),r=E(t),{config:n,dropped:o}=k(s),i=typeof s.name=="string"?s.name:"service",a=v(e,r);if(a===".."||a.startsWith(`..${g}`)||R(a))throw new Error(`service ${i} (${r}) must sit inside ${e} — celld dev runs it from a config beside the app's`);const c=y(r,F),f=b(c)?Object.fromEntries(L(j(c,"utf8")).map(({key:_,value:m})=>[_,m])):{},d=D(C(n,r,e),s,r,e),u=l(d.vars)?d.vars:{},w=y(e,`.celld.service.${i.replaceAll(/[^\w.-]/gu,"-")}.wrangler.json`),p=`${JSON.stringify(I({...d,vars:{...u,...f}}),void 0,4)}
|
|
3
|
+
`;return{configPath:w,dropped:o,write:()=>{$(w,p)}}};export{ue as a,fe as p};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{rmSync as t,readFileSync as i,mkdirSync as o,writeFileSync as a}from"node:fs";import{join as n,dirname as S}from"node:path";const p=n(".lunora","api-spec.json"),s=["both","none","openapi","openrpc"],m=(r,c)=>{const e=n(r,p);o(S(e),{recursive:!0}),a(e,`${JSON.stringify({apiSpec:c??"openapi"})}
|
|
2
|
+
`,"utf8")},d=r=>{t(n(r,p),{force:!0})},y=r=>{try{const{apiSpec:c}=JSON.parse(i(n(r,p),"utf8"));return s.find(e=>e===c)}catch{return}};export{d as clearApiSpecMarker,y as readApiSpecMarker,m as writeApiSpecMarker};
|
package/dist/packem_shared/{infer-bindings.d-BNrKAI1c.d.mts → infer-bindings.d-C9ktoVW4.d.mts}
RENAMED
|
@@ -297,4 +297,4 @@ declare const inferLunoraBindings: (options: InferOptions) => Promise<InferredBi
|
|
|
297
297
|
* ({@link SECRET_SOURCE_FLAGS}), keeping only sources that carry secrets.
|
|
298
298
|
*/
|
|
299
299
|
declare const secretSourcesFromBindings: (bindings: InferredBindings) => string[];
|
|
300
|
-
export { COMPOSED_WORKER_ENTRY as C, DiscoveryCache as D,
|
|
300
|
+
export { COMPOSED_WORKER_ENTRY as C, DiscoveryCache as D, GeneratedClassModule as G, InferredBindings as I, MERGED_DURABLE_OBJECTS_MODULE as M, SchemaInfo as S, DURABLE_OBJECT_BINDINGS as a, DiscoverSchemaInfoResult as b, GENERATED_CLASS_MODULES as c, GENERATED_MODULE_DURABLE_OBJECTS as d, InferOptions as e, InferredAgent as f, InferredContainer as g, InferredWorkflow as h, createDiscoveryCache as i, discoverSchemaInfo as j, inferLunoraBindings as k, isMergedProject as l, isMergedRoleModule as m, secretSourcesFromBindings as s };
|
package/dist/packem_shared/{infer-bindings.d-BNrKAI1c.d.ts → infer-bindings.d-C9ktoVW4.d.ts}
RENAMED
|
@@ -297,4 +297,4 @@ declare const inferLunoraBindings: (options: InferOptions) => Promise<InferredBi
|
|
|
297
297
|
* ({@link SECRET_SOURCE_FLAGS}), keeping only sources that carry secrets.
|
|
298
298
|
*/
|
|
299
299
|
declare const secretSourcesFromBindings: (bindings: InferredBindings) => string[];
|
|
300
|
-
export { COMPOSED_WORKER_ENTRY as C, DiscoveryCache as D,
|
|
300
|
+
export { COMPOSED_WORKER_ENTRY as C, DiscoveryCache as D, GeneratedClassModule as G, InferredBindings as I, MERGED_DURABLE_OBJECTS_MODULE as M, SchemaInfo as S, DURABLE_OBJECT_BINDINGS as a, DiscoverSchemaInfoResult as b, GENERATED_CLASS_MODULES as c, GENERATED_MODULE_DURABLE_OBJECTS as d, InferOptions as e, InferredAgent as f, InferredContainer as g, InferredWorkflow as h, createDiscoveryCache as i, discoverSchemaInfo as j, inferLunoraBindings as k, isMergedProject as l, isMergedRoleModule as m, secretSourcesFromBindings as s };
|
package/dist/packem_shared/{startCelldDevSession-BLFsd6jG.mjs → startCelldDevSession-PHdbwtI5.mjs}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{watch as A}from"node:fs";import{createServer as _}from"node:net";import{dirname as C}from"node:path";import{readServiceBindings as R}from"@lunora/codegen";import{acceptsConnection as b,startDevProcess as M}from"./acceptsConnection-DHhUYGjT.mjs";import{p as D,a as x}from"./celld-config-
|
|
1
|
+
import{watch as A}from"node:fs";import{createServer as _}from"node:net";import{dirname as C}from"node:path";import{readServiceBindings as R}from"@lunora/codegen";import{acceptsConnection as b,startDevProcess as M}from"./acceptsConnection-DHhUYGjT.mjs";import{p as D,a as x}from"./celld-config-Iv0tK526.mjs";const N=6e4,O=200,j=new Set([".celld",".wrangler","node_modules"]),I=/[/\\]/u,B=async()=>new Promise((r,a)=>{const s=_();s.once("error",a),s.listen(0,"127.0.0.1",()=>{const o=s.address();s.close(()=>{r(typeof o=="object"&&o!==null?o.port:0)})})}),F=r=>r?.split(I).some(a=>j.has(a))===!0,G=(r,a,s)=>{let o;const c=A(r,{recursive:!0},(l,w)=>{F(w)||(clearTimeout(o),o=setTimeout(a,O))}),i=()=>{clearTimeout(o),c.close()};return c.once("error",l=>{i(),s(l)}),{close:i}},H=r=>r instanceof Error?r.message:String(r),J=async r=>{const{log:a,port:s,projectRoot:o}=r,c=(t,e="stdout")=>{a(t,{stream:e,tag:"celld"})};if(await b(s))throw new Error(`port ${String(s)} is already in use — stop whatever is serving there (another dev server?), or pick another worker port`);const i=R(o);if(i.error!==void 0)throw new Error(`could not read the lunora.config services: ${i.error}`);const l=D(o,"dev");l.write();const w=C(l.configPath),m=[...new Map(i.services.map(t=>[t.wranglerPath,t])).values()],p=new AbortController,h=()=>p.signal.aborted,v=async(t,e,n)=>M({args:["dev",t,"--port",String(n)],command:"celld",cwd:o,label:"celld dev",notFound:"`celld` was not found on PATH — install it (https://celld.dev) to run the celld target",onLine:T=>{T.trim()!==""&&a(T,{stream:"stdout",tag:e})},port:n,readyTimeoutMs:N,signal:p.signal,spawn:r.spawn}),S=async t=>{const e=x(w,t.wranglerPath);e.write(),c(`registering service ${t.worker} in the local dev state`),await(await v(e.configPath,`celld:${t.worker}`,await B())).stop()};for(const t of m)await S(t);let g=()=>{};const E=new Promise(t=>{g=t}),y=async()=>{const t=await v(l.configPath,"celld",s);return t.crashed.then(g).catch(()=>{}),t};let d=await y();const $=async t=>{await d.stop();let e;try{await S(t)}catch(n){e=n instanceof Error?n:new Error(String(n))}if(!h()){try{d=await y()}catch(n){throw h()||g(1),n}if(e!==void 0)throw e}};let f=Promise.resolve();const k=t=>{c(`service ${t.worker} changed — restarting`),f=f.then(async()=>$(t)).catch(e=>{h()||c(`service ${t.worker} failed to restart: ${H(e)}`,"stderr")})},P=[],u=()=>{for(const t of P)t.close()};try{for(const t of m)P.push(G(C(t.wranglerPath),()=>{k(t)},e=>{c(`stopped watching service ${t.worker}: ${e.message} — restart the dev server to pick up its edits`,"stderr")}))}catch(t){throw u(),await d.stop(),t}return E.then(u).catch(()=>{}),{exited:E,stop:async()=>{p.abort(),u(),await f,await d.stop()}}};export{J as startCelldDevSession};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{runCodegen as c,CodegenDiagnosticError as i}from"@lunora/codegen";import{wranglerCodegenInputs as a}from"./wranglerCodegenInputs-UqO5e_qJ.mjs";import{isCodegenDisabled as s,CODEGEN_ENV as t}from"./BUILD_ROOT_ENV-Dg4MV3wY.mjs";import{writeFileSync as p,renameSync as m,rmSync as u}from"node:fs";const d=r=>({apiSpec:r.apiSpec,lazyFunctions:r.lazyFunctions,lunoraDirectory:r.schemaDirectory??"lunora",projectRoot:r.projectRoot,...a(r.projectRoot)}),w=r=>{if(s(process.env[t]))return[`codegen is off (${t}=0 / \`lunora dev --no-codegen\`) — the source was written but \`_generated/\` was NOT regenerated`];try{c(d(r))}catch(o){if(o instanceof i)return[o.message];throw o}return[]},C=(r,o)=>{const e=`${r}.lunora-tmp`;try{p(e,o,"utf8"),m(e,r)}catch(n){throw u(e,{force:!0}),n}};export{w as r,C as w};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{parseDevVariable as t,resolveAdminToken as r}from"../packem_shared/parseDevVariable-teAAahVD.mjs";import{applyStudioAssetCache as s,sendStudioDocument as d}from"../packem_shared/applyStudioAssetCache-DHQEJuuv.mjs";import{assetContentType as S,isStandaloneModulePath as l,loadStudioAssets as p,readStandaloneAsset as i,resolveStandaloneDirectory as m,studioAssetsStamp as u}from"../packem_shared/assetContentType-CUb5bpbI.mjs";import{STUDIO_PATH as T,STUDIO_SCRIPT_PATH as f,STUDIO_STYLE_PATH as A,createStudioMiddleware as P,isNonLoopbackHost as _,requestPathname as E,studioMountPath as c}from"../packem_shared/STUDIO_PATH-
|
|
1
|
+
import{parseDevVariable as t,resolveAdminToken as r}from"../packem_shared/parseDevVariable-teAAahVD.mjs";import{applyStudioAssetCache as s,sendStudioDocument as d}from"../packem_shared/applyStudioAssetCache-DHQEJuuv.mjs";import{assetContentType as S,isStandaloneModulePath as l,loadStudioAssets as p,readStandaloneAsset as i,resolveStandaloneDirectory as m,studioAssetsStamp as u}from"../packem_shared/assetContentType-CUb5bpbI.mjs";import{STUDIO_PATH as T,STUDIO_SCRIPT_PATH as f,STUDIO_STYLE_PATH as A,createStudioMiddleware as P,isNonLoopbackHost as _,requestPathname as E,studioMountPath as c}from"../packem_shared/STUDIO_PATH-B93PUAsG.mjs";import{POLICY_SCAFFOLD_ENDPOINT as O,handlePolicyScaffoldRequest as h}from"../packem_shared/POLICY_SCAFFOLD_ENDPOINT-eNqjov6d.mjs";import{default as N}from"../packem_shared/renderStudioHtml-ByowDtMl.mjs";import{SCHEMA_EDIT_ENDPOINT as H,handleSchemaEditRequest as L}from"../packem_shared/SCHEMA_EDIT_ENDPOINT-Cgpy_347.mjs";import{SEED_ENDPOINT as q,handleSeedRequest as v}from"../packem_shared/SEED_ENDPOINT-2B56PN_H.mjs";import{serveJsonHandler as M}from"../packem_shared/serveJsonHandler-Dv0EdCb9.mjs";import{ALLOW_FORWARDED_ENV as k,headerValue as F,isLoopbackAddress as U,transportRejectionReason as V}from"../packem_shared/ALLOW_FORWARDED_ENV-BUndghJx.mjs";export{k as ALLOW_FORWARDED_ENV,O as POLICY_SCAFFOLD_ENDPOINT,H as SCHEMA_EDIT_ENDPOINT,q as SEED_ENDPOINT,T as STUDIO_PATH,f as STUDIO_SCRIPT_PATH,A as STUDIO_STYLE_PATH,s as applyStudioAssetCache,S as assetContentType,P as createStudioMiddleware,h as handlePolicyScaffoldRequest,L as handleSchemaEditRequest,v as handleSeedRequest,F as headerValue,U as isLoopbackAddress,_ as isNonLoopbackHost,l as isStandaloneModulePath,p as loadStudioAssets,t as parseDevVariable,i as readStandaloneAsset,N as renderStudioHtml,E as requestPathname,r as resolveAdminToken,m as resolveStandaloneDirectory,d as sendStudioDocument,M as serveJsonHandler,u as studioAssetsStamp,c as studioMountPath,V as transportRejectionReason};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lunora/config",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.393",
|
|
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",
|
|
@@ -58,7 +58,7 @@
|
|
|
58
58
|
"access": "public"
|
|
59
59
|
},
|
|
60
60
|
"dependencies": {
|
|
61
|
-
"@lunora/codegen": "1.0.0-alpha.
|
|
61
|
+
"@lunora/codegen": "1.0.0-alpha.342",
|
|
62
62
|
"@lunora/container": "1.0.0-alpha.89",
|
|
63
63
|
"@lunora/errors": ">=1.0.0-alpha.51 <2.0.0-0",
|
|
64
64
|
"@lunora/seed": "1.0.0-alpha.246",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
const t="LUNORA_CODEGEN",n="LUNORA_LAZY_FUNCTIONS",r=e=>{const o=e?.trim().toLowerCase();return o==="0"||o==="false"},s=e=>{const o=e?.trim().toLowerCase();return o==="1"||o==="true"},c=e=>e===!0||s(process.env[n]);export{t as CODEGEN_ENV,n as LAZY_FUNCTIONS_ENV,r as isCodegenDisabled,s as isLazyFunctionsEnabled,c as resolveLazyFunctions};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{describeErrorLevelFindings as t,sortedUniqueNames as a}from"@lunora/codegen";import{LUNORA_TAG as l,advisoryLine as r}from"./LUNORA_TAG-DQTGPqcJ.mjs";const m=(n,i)=>{for(const e of n.advisories){const o=r(e.level,e.name,e.detail,e.remediation);e.level==="ERROR"?i.error(o):i.warn(o)}for(const e of n.platformDiagnostics){const o=r(e.level==="error"?"ERROR":"WARN",e.name,e.message,e.remediation);e.level==="error"?i.error(o):i.warn(o)}},f=n=>{const{advisoryNames:i,platformDiagnosticNames:e}=t(n),o=a([...i,...e]);if(o.length===0)return;const s=o.length===1?"advisory/platform diagnostic":"advisories/platform diagnostics";return`${l} ${String(o.length)} ERROR-level ${s} (${o.join(", ")}) — see the log above for detail.`};export{f as blockingFindingsMessage,m as reportCodegenFindings};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{writeFileSync as $,rmSync as V,existsSync as b,readFileSync as j}from"node:fs";import{dirname as E,resolve as h,join as y,sep as g,relative as v,isAbsolute as R}from"node:path";import{findWranglerFile as W,readWranglerJsonc as x}from"./WRANGLER_FILES-UNW-xY5u.mjs";import{DEV_VARS_FILE as F,parseDevVariableEntries as L}from"./DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";const B=".celld.wrangler.json",Y=y(".wrangler","deploy","config.json"),J=new Set(["$schema","assets","compatibility_date","compatibility_flags","containers","d1_databases","define","durable_objects","kv_namespaces","main","migrations","name","no_bundle","queues","r2_buckets","rules","services","triggers","vars","worker_loaders","workflows"]),K=new Set(["class_name","image","instance_type","max_instances","name","runtime"]),q=new Set(["CompiledWasm","Data","Text"]),G=/\r?\n/u,M=/[!*?[]/u,U=/[.[]/u,X=["deleted_classes","new_classes","renamed_classes","transferred_classes"],l=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),O=e=>Array.isArray(e)&&e.length===0||l(e)&&Object.values(e).every(t=>O(t)),z=e=>Array.isArray(e)?e.map(t=>{if(!l(t))return t;const s=X.find(r=>t[r]!==void 0);if(s!==void 0)throw new Error(`migration "${String(t.tag)}" uses \`${s}\`, which celld refuses — celld accepts only \`new_sqlite_classes\` migrations`);return{new_sqlite_classes:t.new_sqlite_classes,tag:t.tag}}):e,H=(e,t)=>Array.isArray(e)?e.map((s,r)=>l(s)?Object.fromEntries(Object.entries(s).filter(([n])=>{const o=K.has(n);return o||t.push(`containers[${String(r)}].${n}`),o})):s):e,Q=(e,t)=>Array.isArray(e)?e.filter((s,r)=>{const n=l(s)&&typeof s.type=="string"&&q.has(s.type);return n||t.push(`rules[${String(r)}]`),n}):e,Z=e=>{const t=[],s={};for(const[r,n]of Object.entries(l(e)?e:{}))l(n)&&n.type==="workflow"?t.push({binding:r,class_name:r,name:n.name}):s[r]=n;return{bindings:t,rest:s}},k=e=>{const t=[],s={},r=Z(e.exports),n={...e,exports:r.rest};for(const[o,i]of Object.entries(n)){if(!J.has(o)){O(i)||t.push(o);continue}switch(o){case"containers":{s[o]=H(i,t);break}case"migrations":{s[o]=z(i);break}case"rules":{s[o]=Q(i,t);break}default:s[o]=i}}if(r.bindings.length>0){const o=Array.isArray(s.workflows)?s.workflows:[];s.workflows=[...o,...r.bindings]}return{config:s,dropped:t}},ee=e=>{const[t=[],...s]=e.map(n=>h(n).split(g));let r=0;for(;r<t.length&&s.every(n=>n[r]===t[r]);)r+=1;return t.slice(0,r).join(g)||g},C=(e,t,s)=>{const r=o=>v(s,h(t,o)).split(g).join("/"),n={...e};return typeof e.main=="string"&&(n.main=r(e.main)),l(e.assets)&&typeof e.assets.directory=="string"&&(n.assets={...e.assets,directory:r(e.assets.directory)}),n},se=e=>{const t=y(e,".assetsignore");if(!b(t))return;const s=j(t,"utf8").split(G).map(r=>r.trim()).filter(r=>r!==""&&!r.startsWith("#")).filter(r=>M.test(r)||b(y(e,r)));if(s.length>0)throw new Error(`${t} hides ${s.join(", ")} from the assets, and celld has no .assetsignore — remove those files from ${e} first`);return t},re=(e,t)=>{const s=y(e,Y);if(!b(s))throw new Error(`wrangler \`main\` is the Vite virtual module "${t}", so celld deploys the Vite build output — and there is none yet. Run the project's build (\`vite build\`) first`);const{configPath:r}=JSON.parse(j(s,"utf8"));if(typeof r!="string")throw new TypeError(`${s} names no configPath`);return h(E(s),r)},A=e=>{const{parsed:t}=x(e);if(t===void 0)throw new Error(`${e} is not valid JSONC`);return t},D=(e,t,s,r)=>{const{d1_databases:n}=e;if(!Array.isArray(n)||r===s)return e;const o=Array.isArray(t.d1_databases)?t.d1_databases.filter(i=>l(i)):[];return{...e,d1_databases:n.map(i=>{if(!l(i))return i;const a=o.find(w=>w.binding===i.binding),c=a?.migrations_dir,f=h(s,typeof c=="string"?c:"migrations"),d=b(f)?{...i,migrations_dir:v(r,f).split(g).join("/")}:i,u=a?.migrations_pattern;return typeof u=="string"?{...d,migrations_pattern:v(r,h(s,u)).split(g).join("/")}:d})}},te=(e,t,s,r)=>{const{main:n}=s;if(typeof n!="string"||!n.startsWith("virtual:"))return{fromBuild:!1,source:s,sourcePath:t};if(r==="dev")throw new Error(`wrangler \`main\` is the Vite virtual module "${n}", which only a Vite build can resolve — \`celld dev\` rebuilds from a source file. Use \`vite dev\` for the dev loop and \`lunora deploy\` to ship the build to celld, or point \`main\` at a worker file`);const o=re(e,n);return{fromBuild:!0,source:A(o),sourcePath:o}},ne=(e,t,s,r,n)=>{const o=t.filter(c=>Object.hasOwn(s,c.split(U)[0]??c));let i=e;e.no_bundle!==void 0&&(i=Object.fromEntries(Object.entries(e).filter(([c])=>c!=="no_bundle")),o.push("no_bundle (celld re-bundles the build output)"));const a=r===void 0?void 0:se(r);return a!==void 0&&o.push(`${v(n,a)} (matched no files)`),{assetsIgnore:a,projected:i,reported:o}},I=e=>{const t=l(e.vars)?e.vars:{};return{...e,vars:{WORKER_ENV:"development",...t}}},le=(e,t)=>{const s=W(e);if(s===void 0)throw new Error(`no wrangler.jsonc or wrangler.json in ${e} — celld deploys from the project's Wrangler config`);const r=A(s),{fromBuild:n,source:o,sourcePath:i}=te(e,s,r,t),a=E(i),{config:c,dropped:f}=k(o),{assets:d}=o,u=l(d)&&typeof d.directory=="string"?h(a,d.directory):void 0,w=typeof o.main=="string"?E(h(a,o.main)):void 0,p=ee([a,w,u].filter(T=>T!==void 0));if(!n&&p!==a)throw new Error(`wrangler \`main\` and \`assets.directory\` must sit inside ${a} — celld resolves everything against the config's directory`);const _=D(C(c,a,p),r,e,p),m=n?ne(_,f,r,u,p):{assetsIgnore:void 0,projected:_,reported:f},N=t==="dev"?I(m.projected):m.projected,S=y(p,B),P=`${JSON.stringify(N,void 0,4)}
|
|
2
|
-
`;return{configPath:S,dropped:m.reported,write:()=>{$(S,P),m.assetsIgnore!==void 0&&V(m.assetsIgnore)}}},de=(e,t)=>{const s=A(t),r=E(t),{config:n,dropped:o}=k(s),i=typeof s.name=="string"?s.name:"service",a=v(e,r);if(a===".."||a.startsWith(`..${g}`)||R(a))throw new Error(`service ${i} (${r}) must sit inside ${e} — celld dev runs it from a config beside the app's`);const c=y(r,F),f=b(c)?Object.fromEntries(L(j(c,"utf8")).map(({key:_,value:m})=>[_,m])):{},d=D(C(n,r,e),s,r,e),u=l(d.vars)?d.vars:{},w=y(e,`.celld.service.${i.replaceAll(/[^\w.-]/gu,"-")}.wrangler.json`),p=`${JSON.stringify(I({...d,vars:{...u,...f}}),void 0,4)}
|
|
3
|
-
`;return{configPath:w,dropped:o,write:()=>{$(w,p)}}};export{de as a,le as p};
|
|
@@ -1 +0,0 @@
|
|
|
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 +0,0 @@
|
|
|
1
|
-
import{runCodegen as c,CodegenDiagnosticError as i}from"@lunora/codegen";import{wranglerCodegenInputs as a}from"./wranglerCodegenInputs-UqO5e_qJ.mjs";import{isCodegenDisabled as s,CODEGEN_ENV as t}from"./CODEGEN_ENV-CkUo3_GU.mjs";import{writeFileSync as p,renameSync as m,rmSync as u}from"node:fs";const d=r=>({apiSpec:r.apiSpec,lazyFunctions:r.lazyFunctions,lunoraDirectory:r.schemaDirectory??"lunora",projectRoot:r.projectRoot,...a(r.projectRoot)}),w=r=>{if(s(process.env[t]))return[`codegen is off (${t}=0 / \`lunora dev --no-codegen\`) — the source was written but \`_generated/\` was NOT regenerated`];try{c(d(r))}catch(o){if(o instanceof i)return[o.message];throw o}return[]},C=(r,o)=>{const e=`${r}.lunora-tmp`;try{p(e,o,"utf8"),m(e,r)}catch(n){throw u(e,{force:!0}),n}};export{w as r,C as w};
|