@lunora/config 1.0.0-alpha.391 → 1.0.0-alpha.392
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 +25 -4
- package/dist/index.d.ts +25 -4
- package/dist/index.mjs +1 -1
- package/dist/packem_shared/CODEGEN_ENV-CI9GQHkz.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-CDGx3u-a.mjs} +1 -1
- package/dist/packem_shared/{SCHEMA_EDIT_ENDPOINT-oGE8lMFF.mjs → SCHEMA_EDIT_ENDPOINT-D7s2SlLi.mjs} +1 -1
- package/dist/packem_shared/{STUDIO_PATH-DEi8zoNu.mjs → STUDIO_PATH-Dq0LWvYT.mjs} +1 -1
- package/dist/packem_shared/blockingFindingsMessage-CRbg1sla.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/{interpretRemote-CcmGeGZ_.mjs → interpretRemote-DJ0sEk1j.mjs} +1 -1
- package/dist/packem_shared/{startCelldDevSession-BLFsd6jG.mjs → startCelldDevSession-PHdbwtI5.mjs} +1 -1
- package/dist/packem_shared/{write-atomic-zfU6flfm.mjs → write-atomic-DDF6wDCM.mjs} +1 -1
- package/dist/studio-host/index.mjs +1 -1
- package/package.json +1 -1
- 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/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,23 @@ 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 {}
|
|
62
79
|
/** Spawns the process — injectable so tests run without the binary. */
|
|
63
80
|
type DevProcessSpawner = (command: string, args: ReadonlyArray<string>, options: {
|
|
64
81
|
cwd: string;
|
|
@@ -148,6 +165,8 @@ declare const startCelldDevSession: (options: CelldDevSessionOptions) => Promise
|
|
|
148
165
|
*/
|
|
149
166
|
/** Env var that turns codegen off when it spells `0` / `false`. Unset means on. */
|
|
150
167
|
declare const CODEGEN_ENV = "LUNORA_CODEGEN";
|
|
168
|
+
/** Env var the CLI sets to `0` when `--no-strict-advisories` opts out, so a framework build does not fail on ERROR-level advisories. */
|
|
169
|
+
declare const STRICT_ADVISORIES_ENV = "LUNORA_STRICT_ADVISORIES";
|
|
151
170
|
/** Env var that enables lazy function imports for codegen when it spells `1` / `true`. */
|
|
152
171
|
declare const LAZY_FUNCTIONS_ENV = "LUNORA_LAZY_FUNCTIONS";
|
|
153
172
|
/**
|
|
@@ -629,7 +648,9 @@ declare const reportCodegenFindings: (result: Pick<CodegenResult, "advisories" |
|
|
|
629
648
|
* presentation — and presentation is what this module owns, which is also why
|
|
630
649
|
* this needs no `tag` parameter: {@link LUNORA_TAG} is right above it.
|
|
631
650
|
*/
|
|
632
|
-
declare const blockingFindingsMessage: (result: Pick<CodegenResult, "advisories" | "platformDiagnostics"
|
|
651
|
+
declare const blockingFindingsMessage: (result: Pick<CodegenResult, "advisories" | "platformDiagnostics">, options?: {
|
|
652
|
+
strictAdvisories?: boolean;
|
|
653
|
+
}) => string | undefined;
|
|
633
654
|
/** Severity a formatted line should be surfaced at, mapped onto the three logger channels. */
|
|
634
655
|
type LunoraLineLevel = "error" | "info" | "warn";
|
|
635
656
|
/** A formatted lunora event: the channel to surface it on, the display text, and which event produced it. */
|
|
@@ -1190,4 +1211,4 @@ type ParseSchemaResult = {
|
|
|
1190
1211
|
* message per failure mode without throwing.
|
|
1191
1212
|
*/
|
|
1192
1213
|
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 };
|
|
1214
|
+
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 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, blockingFindingsMessage, buildPackageSecretsBlock, 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,23 @@ 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 {}
|
|
62
79
|
/** Spawns the process — injectable so tests run without the binary. */
|
|
63
80
|
type DevProcessSpawner = (command: string, args: ReadonlyArray<string>, options: {
|
|
64
81
|
cwd: string;
|
|
@@ -148,6 +165,8 @@ declare const startCelldDevSession: (options: CelldDevSessionOptions) => Promise
|
|
|
148
165
|
*/
|
|
149
166
|
/** Env var that turns codegen off when it spells `0` / `false`. Unset means on. */
|
|
150
167
|
declare const CODEGEN_ENV = "LUNORA_CODEGEN";
|
|
168
|
+
/** Env var the CLI sets to `0` when `--no-strict-advisories` opts out, so a framework build does not fail on ERROR-level advisories. */
|
|
169
|
+
declare const STRICT_ADVISORIES_ENV = "LUNORA_STRICT_ADVISORIES";
|
|
151
170
|
/** Env var that enables lazy function imports for codegen when it spells `1` / `true`. */
|
|
152
171
|
declare const LAZY_FUNCTIONS_ENV = "LUNORA_LAZY_FUNCTIONS";
|
|
153
172
|
/**
|
|
@@ -629,7 +648,9 @@ declare const reportCodegenFindings: (result: Pick<CodegenResult, "advisories" |
|
|
|
629
648
|
* presentation — and presentation is what this module owns, which is also why
|
|
630
649
|
* this needs no `tag` parameter: {@link LUNORA_TAG} is right above it.
|
|
631
650
|
*/
|
|
632
|
-
declare const blockingFindingsMessage: (result: Pick<CodegenResult, "advisories" | "platformDiagnostics"
|
|
651
|
+
declare const blockingFindingsMessage: (result: Pick<CodegenResult, "advisories" | "platformDiagnostics">, options?: {
|
|
652
|
+
strictAdvisories?: boolean;
|
|
653
|
+
}) => string | undefined;
|
|
633
654
|
/** Severity a formatted line should be surfaced at, mapped onto the three logger channels. */
|
|
634
655
|
type LunoraLineLevel = "error" | "info" | "warn";
|
|
635
656
|
/** A formatted lunora event: the channel to surface it on, the display text, and which event produced it. */
|
|
@@ -1190,4 +1211,4 @@ type ParseSchemaResult = {
|
|
|
1190
1211
|
* message per failure mode without throwing.
|
|
1191
1212
|
*/
|
|
1192
1213
|
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 };
|
|
1214
|
+
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 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, blockingFindingsMessage, buildPackageSecretsBlock, 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
|
|
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 p,LUNORA_SKILL_NAMES as c,ROOT_SKILL_NAME as _,claimAgentRulesHint as l,detectAgentRules as d}from"./packem_shared/AGENT_RULES_DIR-Bd6JPtNa.mjs";import{clearApiSpecMarker as S,readApiSpecMarker as A,writeApiSpecMarker as m}from"./packem_shared/clearApiSpecMarker-DMGpP41V.mjs";import{MissingBuildOutputError as L}from"./packem_shared/MissingBuildOutputError-BAyekzof.mjs";import{startCelldDevSession as R}from"./packem_shared/startCelldDevSession-PHdbwtI5.mjs";import{CODEGEN_ENV as T,LAZY_FUNCTIONS_ENV as x,STRICT_ADVISORIES_ENV as g,isCodegenDisabled as I,isLazyFunctionsEnabled as V,resolveLazyFunctions as u}from"./packem_shared/CODEGEN_ENV-CI9GQHkz.mjs";import{discoverContainerInfo as P}from"./packem_shared/discoverContainerInfo-DzXr7Vm3.mjs";import{streamContainerLogs as F}from"./packem_shared/streamContainerLogs-0nko1qpv.mjs";import{detectFramework as U,projectUsesUmbrella as G}from"./packem_shared/detectFramework-Dfpvu6rD.mjs";import{acceptsConnection as b,startDevProcess as y}from"./packem_shared/acceptsConnection-DHhUYGjT.mjs";import{DEV_BINDINGS_FILE as j,DEV_DAEMON_ENV as w,DEV_HANDOFF_ENV as K,DEV_LOG_FILE as h,DEV_LOG_FILE_ENV as H,DEV_STATE_DIR as W,DEV_STATE_FILE as Y,claimDevServerState as J,clearDevServerState as z,isDevServerReady as q,isProcessAlive as X,isRecordedProcessCurrent as Z,readDevServerState as Q,readLiveDevServerState as $,updateDevServerState as ee,writeDevServerState as re}from"./packem_shared/DEV_BINDINGS_FILE-C0ZN_XlP.mjs";import{DEV_VARS_EXAMPLE_FILE as te,DEV_VARS_FILE as ae,DEV_VARS_KEY_PATTERN as Ee,escapeRegExp as se,parseDevVariableEntries as ie,removeDevVariableLine as ne,upsertDevVariableLine as pe}from"./packem_shared/DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";import{DEV_WORKER_ENV_VALUE as _e,DEV_WORKER_ENV_VAR as le,ensureDevWorkerEnv as de}from"./packem_shared/DEV_WORKER_ENV_VALUE-CARjGoAv.mjs";import{createDiscoveryCache as Se}from"./packem_shared/createDiscoveryCache-npJI4uej.mjs";import{DEFAULT_DEPLOY_TARGET as me,deployTargetIds as fe,isRunnableTarget as Le,planToolchainInvocation as Ne,resolveDeployDriver as Re,runnableTargetIds as ve,targetRunsOwnDevServer as Te}from"./packem_shared/DEFAULT_DEPLOY_TARGET-CnovxJid.mjs";import{inferLunoraBindings as ge,secretSourcesFromBindings as Ie}from"./packem_shared/inferLunoraBindings-BT4-fwiQ.mjs";import{LINKED_PROJECT_DIR as ue,LINKED_PROJECT_FILE as Oe,readLinkedProject as Pe,writeLinkedProject as Ce}from"./packem_shared/LINKED_PROJECT_DIR-Ba5qPEwo.mjs";import{LUNORA_IGNORED_PATHS as Me,applyLintIgnores as Ue,detectLintTools as Ge}from"./packem_shared/LUNORA_IGNORED_PATHS-U93uPxrW.mjs";import{blockingFindingsMessage as be,reportCodegenFindings as ye}from"./packem_shared/blockingFindingsMessage-CRbg1sla.mjs";import{LUNORA_EVENT_SOURCE as je,formatLunoraEvent as we}from"./packem_shared/LUNORA_EVENT_SOURCE-B9ZVohjO.mjs";import{LUNORA_TAG as he,advisoryLine as He,lunoraLine as We}from"./packem_shared/LUNORA_TAG-DQTGPqcJ.mjs";import{default as Je}from"./packem_shared/LunoraReporter-f277GLNT.mjs";import{addArgsFor as qe,detectInstalledManagers as Xe,detectPackageManager as Ze,execArgsFor as Qe,installArgsFor as $e,runScriptArgsFor as er,runScriptCommand as rr,toolchainExecArgs as or}from"./packem_shared/addArgsFor-CYZKhNIo.mjs";import{P as ar,s as Er}from"./packem_shared/package-secrets-registry-BEJELdls.mjs";import{runPostCodegenHook as ir}from"./packem_shared/runPostCodegenHook-Dx3yTsYZ.mjs";import{interpretRemote as pr,readProjectRemotePreference as cr,readProjectTarget as _r,resolveProjectTarget as lr,resolveTargetOrThrow as dr}from"./packem_shared/interpretRemote-DJ0sEk1j.mjs";import{readProjectDependencies as Sr,readProjectDependencyNames as Ar,readProjectManifest as mr}from"./packem_shared/readProjectDependencies-l3uhUKjo.mjs";import{createConfirm as Lr,isInteractive as Nr,promptMultiSelect as Rr,promptSelect as vr,promptText as Tr,promptYesNo as xr}from"./packem_shared/createConfirm-D5mKTMHj.mjs";import{default as Ir}from"./packem_shared/resolveSchemaDirectory-Ca5P6KuP.mjs";import{buildPackageSecretsBlock as ur,ensureDevVariables as Or,ensureDevVarsExample as Pr,fillDevSecrets as Cr,generateSecretValue as Fr,isMintableSecretKey as Mr,isPlaceholderValue as Ur,planDevSecretsFill as Gr,planDevVariablesAugment as Br,planDevVariablesScaffold as br,requiredSecrets as yr,writeDevVariablesFileAtomically as kr}from"./packem_shared/buildPackageSecretsBlock-C5WZfMwe.mjs";import{applyAdditiveEdit as wr,classifyEdit as Kr}from"./packem_shared/applyAdditiveEdit-CH0VhMJ2.mjs";import{parseSchema as Hr}from"./packem_shared/parseSchema-D1Wbr1qv.mjs";import{classifyPolicyEdit as Yr,resolveServerModule as Jr,scaffoldPolicyFile as zr,wireRlsIntoProcedure as qr}from"./packem_shared/classifyPolicyEdit-DJi9Fk8G.mjs";import{discoverSchemaInfo as Zr}from"./packem_shared/discoverSchemaInfo-BBRlXZop.mjs";import{ACCENT as $r,BADGES as eo,BADGE_COLUMN_WIDTH as ro,LUNA_ART as oo,LUNA_BUNNY as to,LUNA_NAME as ao,LUNA_SIGNOFF as Eo,STEP_BADGE_NAMES as so,badgeLead as io,badgeWidth as no,padBadge as po,paintAnswer as co,paintBadge as _o}from"./packem_shared/ACCENT-CotPTfv7.mjs";import{COMPOSED_WORKER_ENTRY as Do,DURABLE_OBJECT_BINDINGS as So,GENERATED_CLASS_MODULES as Ao,GENERATED_MODULE_DURABLE_OBJECTS as mo,MERGED_DURABLE_OBJECTS_MODULE as fo,isMergedProject as Lo,isMergedRoleModule as No}from"./packem_shared/COMPOSED_WORKER_ENTRY-Ciiba5g_.mjs";import{discoverWorkflowInfo as vo}from"./packem_shared/discoverWorkflowInfo-zW7Tt0Tn.mjs";export{$r as ACCENT,o as AGENT_MODE_ENV,i as AGENT_RULES_DIR,n as AGENT_RULES_HINT,p as AGENT_RULES_HINT_ENV,eo as BADGES,ro as BADGE_COLUMN_WIDTH,T as CODEGEN_ENV,Do as COMPOSED_WORKER_ENTRY,me as DEFAULT_DEPLOY_TARGET,j as DEV_BINDINGS_FILE,w as DEV_DAEMON_ENV,K as DEV_HANDOFF_ENV,h as DEV_LOG_FILE,H as DEV_LOG_FILE_ENV,W as DEV_STATE_DIR,Y as DEV_STATE_FILE,te as DEV_VARS_EXAMPLE_FILE,ae as DEV_VARS_FILE,Ee as DEV_VARS_KEY_PATTERN,_e as DEV_WORKER_ENV_VALUE,le as DEV_WORKER_ENV_VAR,So as DURABLE_OBJECT_BINDINGS,Ao as GENERATED_CLASS_MODULES,mo as GENERATED_MODULE_DURABLE_OBJECTS,x as LAZY_FUNCTIONS_ENV,ue as LINKED_PROJECT_DIR,Oe as LINKED_PROJECT_FILE,oo as LUNA_ART,to as LUNA_BUNNY,ao as LUNA_NAME,Eo as LUNA_SIGNOFF,je as LUNORA_EVENT_SOURCE,Me as LUNORA_IGNORED_PATHS,c as LUNORA_SKILL_NAMES,he as LUNORA_TAG,Je as LunoraReporter,fo as MERGED_DURABLE_OBJECTS_MODULE,L as MissingBuildOutputError,ar as PACKAGE_SECRETS_REGISTRY,_ as ROOT_SKILL_NAME,so as STEP_BADGE_NAMES,g as STRICT_ADVISORIES_ENV,b as acceptsConnection,qe as addArgsFor,He as advisoryLine,wr as applyAdditiveEdit,Ue as applyLintIgnores,io as badgeLead,no as badgeWidth,be as blockingFindingsMessage,ur as buildPackageSecretsBlock,l as claimAgentRulesHint,J as claimDevServerState,Kr as classifyEdit,Yr as classifyPolicyEdit,S as clearApiSpecMarker,z as clearDevServerState,Lr as createConfirm,Se as createDiscoveryCache,fe as deployTargetIds,d as detectAgentRules,t as detectAiAgent,U as detectFramework,Xe as detectInstalledManagers,Ge as detectLintTools,Ze as detectPackageManager,E as discoverAgentInfo,P as discoverContainerInfo,Zr as discoverSchemaInfo,vo as discoverWorkflowInfo,Or as ensureDevVariables,Pr as ensureDevVarsExample,de as ensureDevWorkerEnv,se as escapeRegExp,Qe as execArgsFor,Cr as fillDevSecrets,we as formatLunoraEvent,Fr as generateSecretValue,ge as inferLunoraBindings,$e as installArgsFor,pr as interpretRemote,I as isCodegenDisabled,q as isDevServerReady,Nr as isInteractive,V as isLazyFunctionsEnabled,Lo as isMergedProject,No as isMergedRoleModule,Mr as isMintableSecretKey,Ur as isPlaceholderValue,X as isProcessAlive,Z as isRecordedProcessCurrent,Le as isRunnableTarget,We as lunoraLine,po as padBadge,co as paintAnswer,_o as paintBadge,ie as parseDevVariableEntries,Hr as parseSchema,Gr as planDevSecretsFill,Br as planDevVariablesAugment,br as planDevVariablesScaffold,Ne as planToolchainInvocation,G as projectUsesUmbrella,Rr as promptMultiSelect,vr as promptSelect,Tr as promptText,xr as promptYesNo,A as readApiSpecMarker,Q as readDevServerState,Pe as readLinkedProject,$ as readLiveDevServerState,Sr as readProjectDependencies,Ar as readProjectDependencyNames,mr as readProjectManifest,cr as readProjectRemotePreference,_r as readProjectTarget,ne as removeDevVariableLine,ye as reportCodegenFindings,yr as requiredSecrets,Re as resolveDeployDriver,u as resolveLazyFunctions,lr as resolveProjectTarget,Ir as resolveSchemaDirectory,Jr as resolveServerModule,dr as resolveTargetOrThrow,ir as runPostCodegenHook,er as runScriptArgsFor,rr as runScriptCommand,ve as runnableTargetIds,zr as scaffoldPolicyFile,Ie as secretSourcesFromBindings,Er as secretsForPackages,R as startCelldDevSession,y as startDevProcess,F as streamContainerLogs,Te as targetRunsOwnDevServer,or as toolchainExecArgs,ee as updateDevServerState,pe as upsertDevVariableLine,qr as wireRlsIntoProcedure,m as writeApiSpecMarker,re as writeDevServerState,kr as writeDevVariablesFileAtomically,Ce as writeLinkedProject};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const t="LUNORA_CODEGEN",r="LUNORA_STRICT_ADVISORIES",n="LUNORA_LAZY_FUNCTIONS",N=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 STRICT_ADVISORIES_ENV,N as isCodegenDisabled,s as isLazyFunctionsEnabled,c 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-DDF6wDCM.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-D7s2SlLi.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-DDF6wDCM.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-CDGx3u-a.mjs";import R from"./renderStudioHtml-ByowDtMl.mjs";import{handleSchemaEditRequest as b,SCHEMA_EDIT_ENDPOINT as x}from"./SCHEMA_EDIT_ENDPOINT-D7s2SlLi.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{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,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 };
|
|
@@ -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-
|
|
1
|
+
import{readProjectConfigLiterals as o,readProjectTarget as n}from"@lunora/codegen";import{DEFAULT_DEPLOY_TARGET as c,resolveDeployDriver as a}from"./DEFAULT_DEPLOY_TARGET-CnovxJid.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};
|
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};
|
|
@@ -1 +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"./CODEGEN_ENV-
|
|
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-CI9GQHkz.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-Dq0LWvYT.mjs";import{POLICY_SCAFFOLD_ENDPOINT as O,handlePolicyScaffoldRequest as h}from"../packem_shared/POLICY_SCAFFOLD_ENDPOINT-CDGx3u-a.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-D7s2SlLi.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 +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};
|