@lunora/config 1.0.0-alpha.459 → 1.0.0-alpha.460
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 +1097 -1068
- package/dist/cloudflare/index.d.ts +1097 -1068
- package/dist/cloudflare/index.mjs +1 -1
- package/dist/index.d.mts +119 -6
- package/dist/index.d.ts +119 -6
- package/dist/index.mjs +1 -1
- package/dist/packem_shared/BINDING_MANIFEST_VERSION-CR06-eW7.mjs +1 -0
- package/dist/packem_shared/{CLOUDFLARE_CLI_CONFIG_WARNING_ENV-BKMrOuXV.mjs → CLOUDFLARE_CLI_CONFIG_WARNING_ENV-75Y5zVF8.mjs} +1 -1
- package/dist/packem_shared/{COMPOSED_WORKER_ENTRY-BcFt6ts5.mjs → COMPOSED_WORKER_ENTRY-LpLlp-aF.mjs} +1 -1
- package/dist/packem_shared/{DEFAULT_DEPLOY_TARGET-DllYb7Tj.mjs → DEFAULT_DEPLOY_TARGET-CAJl2nEI.mjs} +1 -1
- package/dist/packem_shared/DEV_VARS_EXAMPLE_FILE-hBT89IXh.mjs +6 -0
- package/dist/packem_shared/{DEV_WORKER_ENV_VALUE-DdPmCpf3.mjs → DEV_WORKER_ENV_VALUE-FoysLtF0.mjs} +1 -1
- package/dist/packem_shared/LUNORA_EVENT_SOURCE-Cq0oj0_9.mjs +9 -0
- package/dist/packem_shared/PACKAGE_SECRETS_REGISTRY-CPWkw-qE.mjs +1 -0
- package/dist/packem_shared/{POLICY_SCAFFOLD_ENDPOINT-uJ8CZJh-.mjs → POLICY_SCAFFOLD_ENDPOINT-UcPFeEyM.mjs} +1 -1
- package/dist/packem_shared/REMOTE_ELIGIBLE_KEYS-D66_hwjD.mjs +1 -0
- package/dist/packem_shared/REQUIRED_COMPATIBILITY_DATE-BPxR2Ht_.mjs +1 -0
- package/dist/packem_shared/{SCHEMA_EDIT_ENDPOINT-C4h_C4TI.mjs → SCHEMA_EDIT_ENDPOINT-C-ic_pvD.mjs} +1 -1
- package/dist/packem_shared/{STUDIO_PATH-C6kNFiHy.mjs → STUDIO_PATH-CDf-EtPs.mjs} +1 -1
- package/dist/packem_shared/UNEXPORTED_CLASS_MARKER-Zw1oiigQ.mjs +1 -0
- package/dist/packem_shared/WRANGLER_FILES-BF8PUjuo.mjs +1 -0
- package/dist/packem_shared/{assertBuildTargetMatches-CqrrwiQ-.mjs → assertBuildTargetMatches-tkKAa5zl.mjs} +1 -1
- package/dist/packem_shared/{assertWranglerSatisfiesSchema-071lEemx.mjs → assertWranglerSatisfiesSchema-CZWQnfly.mjs} +1 -1
- package/dist/packem_shared/{bindingsNeedingDatabase-6eD6Qtqf.mjs → bindingsNeedingDatabase-3KyGflIq.mjs} +1 -1
- package/dist/packem_shared/buildPackageSecretsBlock-DrSD60vH.mjs +19 -0
- package/dist/packem_shared/{celld-config-DoBVipuN.mjs → celld-config-CpvLkAEg.mjs} +1 -1
- package/dist/packem_shared/checkDevEnv-egiW2lSF.mjs +3 -0
- package/dist/packem_shared/{collectExportGaps-C5OYqfkE.mjs → collectExportGaps-BYo3bcXi.mjs} +2 -2
- package/dist/packem_shared/{createStudioDocumentCache-B3Sf1bIl.mjs → createStudioDocumentCache-XBG1aWbl.mjs} +1 -1
- package/dist/packem_shared/{describePreservedCrons-Bt2rPPeY.mjs → describePreservedCrons-i5XT6rtl.mjs} +1 -1
- package/dist/packem_shared/devTriggerHints-CN_RJxWW.mjs +1 -0
- package/dist/packem_shared/{devVariablesStamp-Cetr3qFz.mjs → devVariablesStamp-BQkGEn9d.mjs} +1 -1
- package/dist/packem_shared/{emitProjectAssetHeaders-2FtExZPG.mjs → emitProjectAssetHeaders-6iinmRWE.mjs} +1 -1
- package/dist/packem_shared/guards-CoCtgpeR.mjs +1 -0
- package/dist/packem_shared/hasCloudflareCredentials-ByCrwaLT.mjs +1 -0
- package/dist/packem_shared/inferLunoraBindings-Biq1OW9V.mjs +1 -0
- package/dist/packem_shared/{materializeServiceDevConfigs-qUY4_iu1.mjs → materializeServiceDevConfigs-CI1HXv7f.mjs} +1 -1
- package/dist/packem_shared/pendingBindingChanges-5fPhwxMt.mjs +1 -0
- package/dist/packem_shared/{infer-bindings.d-Tkaosiub.d.mts → placeholder-ids.d-DvGHP6bl.d.mts} +18 -18
- package/dist/packem_shared/{infer-bindings.d-Tkaosiub.d.ts → placeholder-ids.d-DvGHP6bl.d.ts} +18 -18
- package/dist/packem_shared/queue-info-D38n7YdX.mjs +1 -0
- package/dist/packem_shared/reconcile-services-CjgIJKim.mjs +1 -0
- package/dist/packem_shared/reconcileWranglerBindings-D7mXDfAe.mjs +1 -0
- package/dist/packem_shared/{reconcileWranglerCompatibilityDate-hocXEuRA.mjs → reconcileWranglerCompatibilityDate-Cj94osA-.mjs} +1 -1
- package/dist/packem_shared/scanWranglerVariablesForSecrets-DojbojUo.mjs +1 -0
- package/dist/packem_shared/secret-key-xi4VK8Jw.mjs +1 -0
- package/dist/packem_shared/{startCelldDevSession-Bg_RN5uf.mjs → startCelldDevSession-DQ7YylR_.mjs} +1 -1
- package/dist/packem_shared/validate-bindings-CQbR23li.mjs +1 -0
- package/dist/packem_shared/withTailConsumer-CKXL6P6s.mjs +1 -0
- package/dist/packem_shared/{worker-entry-checks-CHrum2AN.mjs → worker-entry-checks-DH-ApvvX.mjs} +1 -1
- package/dist/packem_shared/wranglerCodegenInputs-Cz9ByxSo.mjs +1 -0
- package/dist/packem_shared/{write-atomic-NN-EjI8U.mjs → write-atomic-CcNMkFsX.mjs} +1 -1
- package/dist/studio-host/index.mjs +1 -1
- package/package.json +4 -2
- package/dist/packem_shared/BINDING_MANIFEST_VERSION-CfXEYG8e.mjs +0 -1
- package/dist/packem_shared/DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs +0 -6
- package/dist/packem_shared/LUNORA_EVENT_SOURCE-D_VGT1JJ.mjs +0 -9
- package/dist/packem_shared/PACKAGE_SECRETS_REGISTRY-CnY7jg9j.mjs +0 -1
- package/dist/packem_shared/REMOTE_ELIGIBLE_KEYS-DooK0pzs.mjs +0 -1
- package/dist/packem_shared/REQUIRED_COMPATIBILITY_DATE-CKjEIFrf.mjs +0 -1
- package/dist/packem_shared/UNEXPORTED_CLASS_MARKER-YnIX5BDi.mjs +0 -1
- package/dist/packem_shared/WRANGLER_FILES-UNW-xY5u.mjs +0 -1
- package/dist/packem_shared/buildPackageSecretsBlock-B4Odg5OF.mjs +0 -19
- package/dist/packem_shared/hasCloudflareCredentials-Bak5w1_6.mjs +0 -1
- package/dist/packem_shared/inferLunoraBindings-D0QDcugr.mjs +0 -1
- package/dist/packem_shared/package-secrets-registry-TouCAMQN.mjs +0 -1
- package/dist/packem_shared/reconcile-assets-h8q3F4Sy.mjs +0 -1
- package/dist/packem_shared/reconcile-services-C4TwY8YH.mjs +0 -1
- package/dist/packem_shared/reconcileBindingsSafely-BI6znzGg.mjs +0 -1
- package/dist/packem_shared/scanWranglerVariablesForSecrets-CkonQUdG.mjs +0 -1
- package/dist/packem_shared/spa-assets-BwJFTBeO.mjs +0 -1
- package/dist/packem_shared/withTailConsumer-_EZ9WqMc.mjs +0 -1
- package/dist/packem_shared/wranglerCodegenInputs-BZUWdHzz.mjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{applyModify as o}from"../packem_shared/applyModify-DKP2l6S9.mjs";import{
|
|
1
|
+
import{applyModify as o}from"../packem_shared/applyModify-DKP2l6S9.mjs";import{reconcileWranglerBindings as a}from"../packem_shared/reconcileWranglerBindings-D7mXDfAe.mjs";import{assertWranglerSatisfiesSchema as i}from"../packem_shared/assertWranglerSatisfiesSchema-CZWQnfly.mjs";import{w as f}from"../packem_shared/asset-headers-CPuEX21i.mjs";import{BINDING_MANIFEST_VERSION as m,buildBindingManifest as p}from"../packem_shared/BINDING_MANIFEST_VERSION-CR06-eW7.mjs";import{CLOUDFLARE_CLI_CONFIG_WARNING_ENV as d,detectCloudflareCliConfig as g,warnCloudflareCliConfigOnce as x}from"../packem_shared/CLOUDFLARE_CLI_CONFIG_WARNING_ENV-75Y5zVF8.mjs";import{default as R}from"../packem_shared/CLOUDFLARE_DRIVER-DbmpoIcg.mjs";import{default as _}from"../packem_shared/GLOBAL_FETCH_STRICTLY_PUBLIC_FLAG-f8CnJha3.mjs";import{hasCloudflareCredentials as L}from"../packem_shared/hasCloudflareCredentials-ByCrwaLT.mjs";import{describeWithheld as D,withheldBindings as O}from"../packem_shared/describeWithheld-CbyzZjZF.mjs";import{bindingsNeedingDatabase as W,startLocalHyperdrive as T}from"../packem_shared/bindingsNeedingDatabase-3KyGflIq.mjs";import{readManifest as v,recordManifestKey as B}from"../packem_shared/readManifest-Cighz3WC.mjs";import{HYPERDRIVE_PLACEHOLDER_ID as b}from"../packem_shared/D1_PLACEHOLDER_ID-ZnDjVymH.mjs";import{emitProjectAssetHeaders as u}from"../packem_shared/emitProjectAssetHeaders-6iinmRWE.mjs";import{collectExportGaps as M}from"../packem_shared/collectExportGaps-BYo3bcXi.mjs";import{reconcileWranglerCompatibilityDate as y}from"../packem_shared/reconcileWranglerCompatibilityDate-Cj94osA-.mjs";import{describePreservedCrons as U,reconcileWranglerCrons as w}from"../packem_shared/describePreservedCrons-i5XT6rtl.mjs";import{pendingBindingChanges as Y,reconcileBindingsSafely as K,reconcileWranglerExtras as j}from"../packem_shared/pendingBindingChanges-5fPhwxMt.mjs";import{REMOTE_ELIGIBLE_KEYS as Q,injectRemoteFlags as J,isRemoteEnvEnabled as X,materializeDevWranglerConfig as k,planRemoteBindings as q,resolveRemoteEnabled as Z,toRemotePlan as $}from"../packem_shared/REMOTE_ELIGIBLE_KEYS-D66_hwjD.mjs";import{materializeServiceDevConfigs as re}from"../packem_shared/materializeServiceDevConfigs-CI1HXv7f.mjs";import{default as te}from"../packem_shared/CLOUDFLARE_TOOLCHAIN_VERSIONS-DWyZ_2QM.mjs";import{withTailConsumer as ne}from"../packem_shared/withTailConsumer-CKXL6P6s.mjs";import{WORKERS_CACHE_MIN_DATE as le,isCacheEnabled as fe}from"../packem_shared/WORKERS_CACHE_MIN_DATE-0k9ABJtF.mjs";import{wranglerCodegenInputs as me}from"../packem_shared/wranglerCodegenInputs-Cz9ByxSo.mjs";import{DEFAULT_OBSERVABILITY as Ee,resolveObservabilitySampling as de}from"../packem_shared/DEFAULT_OBSERVABILITY-CPLADr5u.mjs";import{mergeWranglerEnvironment as xe}from"../packem_shared/mergeWranglerEnvironment-D5ekKj5x.mjs";import{WRANGLER_FILES as Re,findWranglerFile as ce,readWranglerJsonc as _e}from"../packem_shared/WRANGLER_FILES-BF8PUjuo.mjs";import{UNEXPORTED_CLASS_MARKER as Le,validateWranglerProject as Ae}from"../packem_shared/UNEXPORTED_CLASS_MARKER-Zw1oiigQ.mjs";import{scanWranglerVariablesForSecrets as Oe}from"../packem_shared/scanWranglerVariablesForSecrets-DojbojUo.mjs";import{wranglerToAlchemy as We}from"../packem_shared/wranglerToAlchemy-CBO2ucRm.mjs";import{REQUIRED_COMPATIBILITY_DATE as Ne,REQUIRED_FLAG as ve,validateWrangler as Be,validateWranglerConfig as Fe}from"../packem_shared/REQUIRED_COMPATIBILITY_DATE-BPxR2Ht_.mjs";export{m as BINDING_MANIFEST_VERSION,d as CLOUDFLARE_CLI_CONFIG_WARNING_ENV,R as CLOUDFLARE_DRIVER,te as CLOUDFLARE_TOOLCHAIN_VERSIONS,Ee as DEFAULT_OBSERVABILITY,_ as GLOBAL_FETCH_STRICTLY_PUBLIC_FLAG,b as HYPERDRIVE_PLACEHOLDER_ID,Q as REMOTE_ELIGIBLE_KEYS,Ne as REQUIRED_COMPATIBILITY_DATE,ve as REQUIRED_FLAG,Le as UNEXPORTED_CLASS_MARKER,le as WORKERS_CACHE_MIN_DATE,Re as WRANGLER_FILES,o as applyModify,i as assertWranglerSatisfiesSchema,W as bindingsNeedingDatabase,p as buildBindingManifest,M as collectExportGaps,U as describePreservedCrons,D as describeWithheld,g as detectCloudflareCliConfig,u as emitProjectAssetHeaders,ce as findWranglerFile,L as hasCloudflareCredentials,J as injectRemoteFlags,fe as isCacheEnabled,X as isRemoteEnvEnabled,k as materializeDevWranglerConfig,re as materializeServiceDevConfigs,xe as mergeWranglerEnvironment,Y as pendingBindingChanges,q as planRemoteBindings,v as readManifest,_e as readWranglerJsonc,K as reconcileBindingsSafely,a as reconcileWranglerBindings,y as reconcileWranglerCompatibilityDate,w as reconcileWranglerCrons,j as reconcileWranglerExtras,B as recordManifestKey,de as resolveObservabilitySampling,Z as resolveRemoteEnabled,Oe as scanWranglerVariablesForSecrets,T as startLocalHyperdrive,$ as toRemotePlan,Be as validateWrangler,Fe as validateWranglerConfig,Ae as validateWranglerProject,x as warnCloudflareCliConfigOnce,ne as withTailConsumer,O as withheldBindings,me as wranglerCodegenInputs,We as wranglerToAlchemy,f as writeAssetHeaders};
|
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { AgentIR, ContainerIR, WorkflowIR, CodegenResult } from '@lunora/codegen';
|
|
2
|
-
export type
|
|
2
|
+
export { type AgentIR, type ContainerIR, ENV_FILENAME, type 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-BoUSSRrk.mjs";
|
|
4
4
|
import { ChildProcess } from 'node:child_process';
|
|
5
|
-
import { D as DiscoveryCache } from "./packem_shared/
|
|
6
|
-
export { C as COMPOSED_WORKER_ENTRY, a as D1_PLACEHOLDER_ID, b as DURABLE_OBJECT_BINDINGS, type c as DiscoverSchemaInfoResult,
|
|
5
|
+
import { D as DiscoveryCache } from "./packem_shared/placeholder-ids.d-DvGHP6bl.mjs";
|
|
6
|
+
export { C as COMPOSED_WORKER_ENTRY, a as D1_PLACEHOLDER_ID, b as DURABLE_OBJECT_BINDINGS, type c as DiscoverSchemaInfoResult, d as GENERATED_CLASS_MODULES, e as GENERATED_MODULE_DURABLE_OBJECTS, type G as GeneratedClassModule, type f as InferOptions, type g as InferredAgent, type I as InferredBindings, type h as InferredContainer, type i as InferredWorkflow, M as MERGED_DURABLE_OBJECTS_MODULE, type S as SchemaInfo, j as createDiscoveryCache, k as discoverSchemaInfo, l as inferLunoraBindings, m as isMergedProject, n as isMergedRoleModule, s as secretSourcesFromBindings } from "./packem_shared/placeholder-ids.d-DvGHP6bl.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-CHVNQFV2.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";
|
|
@@ -354,6 +354,68 @@ declare const projectUsesUmbrella: (root: string) => boolean;
|
|
|
354
354
|
* SPA flow is preserved.
|
|
355
355
|
*/
|
|
356
356
|
declare const detectFramework: (root: string) => FrameworkDetection;
|
|
357
|
+
/** One key the contract rejected; `message` is already secret-redacted. */
|
|
358
|
+
interface EnvKeyFailure {
|
|
359
|
+
/** The env key that failed. */
|
|
360
|
+
key: string;
|
|
361
|
+
/** Redacted human-readable reason. */
|
|
362
|
+
message: string;
|
|
363
|
+
}
|
|
364
|
+
/** What {@link checkDevEnv} found. */
|
|
365
|
+
type DevEnvCheck = {
|
|
366
|
+
error: string;
|
|
367
|
+
kind: "unloadable";
|
|
368
|
+
} | {
|
|
369
|
+
failures: EnvKeyFailure[];
|
|
370
|
+
kind: "invalid";
|
|
371
|
+
sources: string[];
|
|
372
|
+
} | {
|
|
373
|
+
kind: "absent";
|
|
374
|
+
} | {
|
|
375
|
+
kind: "valid";
|
|
376
|
+
};
|
|
377
|
+
interface DevEnvCheckOptions {
|
|
378
|
+
/**
|
|
379
|
+
* The wrangler config the dev worker runs, when it is not the project's
|
|
380
|
+
* `wrangler.jsonc` — the SvelteKit / Nuxt sidecar runs `wrangler.dev.jsonc`.
|
|
381
|
+
* Its vars, its bindings, and the `.dev.vars` / `.env` beside it are read.
|
|
382
|
+
*/
|
|
383
|
+
configPath?: string;
|
|
384
|
+
/** The wrangler environment the dev worker runs; defaults to `CLOUDFLARE_ENV`, which wrangler reads too. */
|
|
385
|
+
environment?: string;
|
|
386
|
+
/**
|
|
387
|
+
* Imports `lunora/env.ts` and answers its module namespace. Defaults to a
|
|
388
|
+
* cache-free `jiti` import, so an edited contract is read fresh.
|
|
389
|
+
*/
|
|
390
|
+
load?: (path: string) => Promise<unknown>;
|
|
391
|
+
/** Defaults to `process.env`. */
|
|
392
|
+
processEnv?: Record<string, string | undefined>;
|
|
393
|
+
projectRoot: string;
|
|
394
|
+
schemaDirectory: string;
|
|
395
|
+
/** `--var` values the dev worker is started with; they win over the config's `vars` and over `.dev.vars` / `.env`, as in wrangler. */
|
|
396
|
+
vars?: Readonly<Record<string, string>>;
|
|
397
|
+
/** Binding names the dev session leaves out of the worker (a logged-out `ai` / `artifacts`), so they are not exempt. */
|
|
398
|
+
withheld?: ReadonlyArray<string>;
|
|
399
|
+
}
|
|
400
|
+
/**
|
|
401
|
+
* Run the project's env contract against its local worker env. Never throws:
|
|
402
|
+
* anything that stops the check — a contract that cannot be loaded on the host
|
|
403
|
+
* (a `cloudflare:` import, a tsconfig path alias jiti does not read), an
|
|
404
|
+
* unreadable `.dev.vars`, a wrangler config whose bindings cannot be read —
|
|
405
|
+
* answers `unloadable` with the reason, secrets redacted.
|
|
406
|
+
*/
|
|
407
|
+
declare const checkDevEnv: (options: DevEnvCheckOptions) => Promise<DevEnvCheck>;
|
|
408
|
+
/**
|
|
409
|
+
* The one log line {@link checkDevEnv}'s result deserves, with its level — or
|
|
410
|
+
* `undefined` when there is nothing to say. `wasInvalid` is what the previous
|
|
411
|
+
* check of the same server found, so a check that passes again says so.
|
|
412
|
+
*/
|
|
413
|
+
declare const describeDevEnvCheck: (check: DevEnvCheck, schemaDirectory: string, { wasInvalid }?: {
|
|
414
|
+
wasInvalid?: boolean;
|
|
415
|
+
}) => undefined | {
|
|
416
|
+
level: "info" | "warn";
|
|
417
|
+
message: string;
|
|
418
|
+
};
|
|
357
419
|
/** Directory holding per-checkout Lunora state (gitignored by convention). */
|
|
358
420
|
declare const DEV_STATE_DIR = ".lunora";
|
|
359
421
|
/** The dev-server state filename, relative to the project root. */
|
|
@@ -511,6 +573,43 @@ interface ClaimDevServerStateResult {
|
|
|
511
573
|
declare const claimDevServerState: (projectRoot: string, state: DevServerState, options?: {
|
|
512
574
|
supersedePid?: number;
|
|
513
575
|
}) => ClaimDevServerStateResult;
|
|
576
|
+
interface DevTriggerHintOptions {
|
|
577
|
+
/** The wrangler environment the dev worker runs; defaults to `CLOUDFLARE_ENV`, which wrangler reads too. */
|
|
578
|
+
environment?: string;
|
|
579
|
+
projectRoot: string;
|
|
580
|
+
/**
|
|
581
|
+
* The dev worker's scheduled-trigger endpoint (no query), when the dev server
|
|
582
|
+
* exposes one, for a ready-to-run `curl`. Omitted, the cron hint names only
|
|
583
|
+
* the Studio page.
|
|
584
|
+
*/
|
|
585
|
+
scheduledUrl?: string;
|
|
586
|
+
/** The schema directory the project declares its queues under. */
|
|
587
|
+
schemaDirectory: string;
|
|
588
|
+
/** The Studio's root URL (`…/__lunora`), or `undefined` when it is not served. */
|
|
589
|
+
studioUrl?: string;
|
|
590
|
+
}
|
|
591
|
+
/** One hint row; each dev banner lays it out with {@link formatDevBannerRow}. */
|
|
592
|
+
interface DevTriggerHint {
|
|
593
|
+
label: "Crons" | "Queues";
|
|
594
|
+
text: string;
|
|
595
|
+
}
|
|
596
|
+
/**
|
|
597
|
+
* The hint rows for the project's crons and queues — empty when it declares
|
|
598
|
+
* neither, when `wrangler.jsonc` is missing or unparseable, or when there is no
|
|
599
|
+
* surface to point at. Never throws: it only decorates a startup banner.
|
|
600
|
+
*/
|
|
601
|
+
declare const devTriggerHints: (options: DevTriggerHintOptions) => DevTriggerHint[];
|
|
602
|
+
/**
|
|
603
|
+
* One ` ➜ Label: value` banner row, the label padded to `width` (colon
|
|
604
|
+
* included) so the values line up. `style` decorates the arrow and the label
|
|
605
|
+
* after padding, so escape codes never count toward the width — Vite's banner
|
|
606
|
+
* colours both, `lunora dev`'s colours neither. A label wider than `width` gets
|
|
607
|
+
* no padding rather than an error.
|
|
608
|
+
*/
|
|
609
|
+
declare const formatDevBannerRow: (label: string, value: string, width: number, style?: {
|
|
610
|
+
arrow?: (text: string) => string;
|
|
611
|
+
label?: (text: string) => string;
|
|
612
|
+
}) => string;
|
|
514
613
|
/** The conventional filename for local Cloudflare dev secrets (gitignored). */
|
|
515
614
|
declare const DEV_VARS_FILE: string;
|
|
516
615
|
/** Its committed, secret-free counterpart that scaffolding reads from. */
|
|
@@ -545,6 +644,16 @@ declare const parseDevVariableEntries: (content: string) => {
|
|
|
545
644
|
key: string;
|
|
546
645
|
value: string;
|
|
547
646
|
}[];
|
|
647
|
+
/**
|
|
648
|
+
* A dotenv-format file (`.dev.vars`, `.env`, …) as a record, through
|
|
649
|
+
* {@link parseDevVariableEntries} — or `undefined` when the file does not exist.
|
|
650
|
+
* Any other read failure (a directory, no permission) throws, as it makes
|
|
651
|
+
* `wrangler dev` refuse a `.dev.vars`; a caller that reads a broken file as
|
|
652
|
+
* unset catches it.
|
|
653
|
+
*/
|
|
654
|
+
declare const readDevVariablesRecord: (path: string) => Record<string, string> | undefined;
|
|
655
|
+
/** The `.env` files `wrangler dev` reads for `environment`, in load order (later wins) — its `getDefaultEnvFiles`. */
|
|
656
|
+
declare const wranglerDotenvFiles: (environment?: string) => string[];
|
|
548
657
|
/**
|
|
549
658
|
* Escape a runtime string for safe literal interpolation into a `RegExp`
|
|
550
659
|
* source. The one canonical implementation — `@lunora/config`'s own
|
|
@@ -1072,10 +1181,12 @@ interface EnsureDevVariablesDeps {
|
|
|
1072
1181
|
info: (message: string) => void;
|
|
1073
1182
|
/** Injectable for tests; defaults to `crypto.randomBytes` hex. */
|
|
1074
1183
|
randomHex?: (bytes: number) => string;
|
|
1184
|
+
/** Emit a warning; defaults to {@link EnsureDevVariablesDeps.info}. */
|
|
1185
|
+
warn?: (message: string) => void;
|
|
1075
1186
|
/** Generate without prompting (e.g. a `--yes` flag). */
|
|
1076
1187
|
yes?: boolean;
|
|
1077
1188
|
}
|
|
1078
|
-
type EnsureDevVariablesStatus = "augmented" | "declined" | "exists" | "generated" | "no-example" | "skipped-exists";
|
|
1189
|
+
type EnsureDevVariablesStatus = "augmented" | "declined" | "exists" | "generated" | "no-example" | "skipped-exists" | "unreadable";
|
|
1079
1190
|
interface EnsureDevVariablesResult {
|
|
1080
1191
|
/** Keys appended to an existing file, when `status` is `"augmented"`. */
|
|
1081
1192
|
addedKeys: string[];
|
|
@@ -1098,7 +1209,9 @@ declare const writeDevVariablesFileAtomically: (path: string, content: string) =
|
|
|
1098
1209
|
*
|
|
1099
1210
|
* - file missing → offer to generate it (secret placeholders auto-filled);
|
|
1100
1211
|
* - file present but missing keys the example lists → offer to append them;
|
|
1101
|
-
* - file present and complete → nothing to do
|
|
1212
|
+
* - file present and complete → nothing to do;
|
|
1213
|
+
* - either one not a readable file (a directory, no permission) → one warning,
|
|
1214
|
+
* status `"unreadable"`, nothing written.
|
|
1102
1215
|
*
|
|
1103
1216
|
* Prompts via `confirm` (skipped when `yes`); never overwrites existing values.
|
|
1104
1217
|
* Returns what happened so the caller can tailor any follow-up. Shared by
|
|
@@ -1307,4 +1420,4 @@ type ParseSchemaResult = {
|
|
|
1307
1420
|
* message per failure mode without throwing.
|
|
1308
1421
|
*/
|
|
1309
1422
|
declare const parseSchema: (source: string) => ParseSchemaResult;
|
|
1310
|
-
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 CelldToolchainProbe, type CelldToolchainProbeOptions, 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, ensureGitignoreEntries, escapeRegExp, fillDevSecrets, formatLunoraEvent, generateSecretValue, interpretRemote, isCodegenDisabled, isDevServerReady, isInteractive, isLazyFunctionsEnabled, isMintableSecretKey, isPlaceholderValue, isProcessAlive, isRecordedProcessCurrent, mintableSecretKeysFor, parseDevVariableEntries, parseSchema, planDevSecretsFill, planDevVariablesAugment, planDevVariablesScaffold, probeCelldToolchain, 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, writeCelldDevProjection, writeDevServerState, writeDevVariablesFileAtomically, writeLinkedProject };
|
|
1423
|
+
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 CelldToolchainProbe, type CelldToolchainProbeOptions, 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 DevEnvCheck, type DevEnvCheckOptions, type DevProcess, type DevProcessOptions, type DevProcessSpawner, type DevSecretsFillPlan, type DevServerMode, type DevServerState, type DevTriggerHint, type DevTriggerHintOptions, type DiscoverAgentInfoResult, type DiscoverContainerInfoResult, type DiscoverWorkflowInfoResult, type DiscoveryCache, type DockerLike, type EnsureDevVariablesDeps, type EnsureDevVariablesResult, type EnsureDevVariablesStatus, type EnvKeyFailure, 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, checkDevEnv, claimDevServerState, classifyEdit, clearApiSpecMarker, clearDevServerState, createConfirm, describeDevEnvCheck, detectAiAgent, detectFramework, detectLintTools, devTriggerHints, discoverAgentInfo, discoverContainerInfo, discoverWorkflowInfo, ensureDevVariables, ensureDevVariablesExample as ensureDevVarsExample, ensureDevWorkerEnv, ensureGitignoreEntries, escapeRegExp, fillDevSecrets, formatDevBannerRow, formatLunoraEvent, generateSecretValue, interpretRemote, isCodegenDisabled, isDevServerReady, isInteractive, isLazyFunctionsEnabled, isMintableSecretKey, isPlaceholderValue, isProcessAlive, isRecordedProcessCurrent, mintableSecretKeysFor, parseDevVariableEntries, parseSchema, planDevSecretsFill, planDevVariablesAugment, planDevVariablesScaffold, probeCelldToolchain, projectUsesUmbrella, promptMultiSelect, promptSelect, promptText, promptYesNo, readApiSpecMarker, readDevServerState, readDevVariablesRecord, readLinkedProject, readLiveDevServerState, readProjectRemotePreference, readProjectTarget, removeDevVariableLine, reportCodegenFindings, requiredSecrets, resolveLazyFunctions, resolveProjectTarget, resolveSchemaDirectory, resolveTargetOrThrow, runPostCodegenHook, secretsForPackages, startCelldDevSession, startDevProcess, streamContainerLogs, updateDevServerState, upsertDevVariableLine, wranglerDotenvFiles, writeApiSpecMarker, writeCelldDevProjection, writeDevServerState, writeDevVariablesFileAtomically, writeLinkedProject };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { AgentIR, ContainerIR, WorkflowIR, CodegenResult } from '@lunora/codegen';
|
|
2
|
-
export type
|
|
2
|
+
export { type AgentIR, type ContainerIR, ENV_FILENAME, type 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-C1nVDcie.js";
|
|
4
4
|
import { ChildProcess } from 'node:child_process';
|
|
5
|
-
import { D as DiscoveryCache } from "./packem_shared/
|
|
6
|
-
export { C as COMPOSED_WORKER_ENTRY, a as D1_PLACEHOLDER_ID, b as DURABLE_OBJECT_BINDINGS, type c as DiscoverSchemaInfoResult,
|
|
5
|
+
import { D as DiscoveryCache } from "./packem_shared/placeholder-ids.d-DvGHP6bl.js";
|
|
6
|
+
export { C as COMPOSED_WORKER_ENTRY, a as D1_PLACEHOLDER_ID, b as DURABLE_OBJECT_BINDINGS, type c as DiscoverSchemaInfoResult, d as GENERATED_CLASS_MODULES, e as GENERATED_MODULE_DURABLE_OBJECTS, type G as GeneratedClassModule, type f as InferOptions, type g as InferredAgent, type I as InferredBindings, type h as InferredContainer, type i as InferredWorkflow, M as MERGED_DURABLE_OBJECTS_MODULE, type S as SchemaInfo, j as createDiscoveryCache, k as discoverSchemaInfo, l as inferLunoraBindings, m as isMergedProject, n as isMergedRoleModule, s as secretSourcesFromBindings } from "./packem_shared/placeholder-ids.d-DvGHP6bl.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-CHVNQFV2.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";
|
|
@@ -354,6 +354,68 @@ declare const projectUsesUmbrella: (root: string) => boolean;
|
|
|
354
354
|
* SPA flow is preserved.
|
|
355
355
|
*/
|
|
356
356
|
declare const detectFramework: (root: string) => FrameworkDetection;
|
|
357
|
+
/** One key the contract rejected; `message` is already secret-redacted. */
|
|
358
|
+
interface EnvKeyFailure {
|
|
359
|
+
/** The env key that failed. */
|
|
360
|
+
key: string;
|
|
361
|
+
/** Redacted human-readable reason. */
|
|
362
|
+
message: string;
|
|
363
|
+
}
|
|
364
|
+
/** What {@link checkDevEnv} found. */
|
|
365
|
+
type DevEnvCheck = {
|
|
366
|
+
error: string;
|
|
367
|
+
kind: "unloadable";
|
|
368
|
+
} | {
|
|
369
|
+
failures: EnvKeyFailure[];
|
|
370
|
+
kind: "invalid";
|
|
371
|
+
sources: string[];
|
|
372
|
+
} | {
|
|
373
|
+
kind: "absent";
|
|
374
|
+
} | {
|
|
375
|
+
kind: "valid";
|
|
376
|
+
};
|
|
377
|
+
interface DevEnvCheckOptions {
|
|
378
|
+
/**
|
|
379
|
+
* The wrangler config the dev worker runs, when it is not the project's
|
|
380
|
+
* `wrangler.jsonc` — the SvelteKit / Nuxt sidecar runs `wrangler.dev.jsonc`.
|
|
381
|
+
* Its vars, its bindings, and the `.dev.vars` / `.env` beside it are read.
|
|
382
|
+
*/
|
|
383
|
+
configPath?: string;
|
|
384
|
+
/** The wrangler environment the dev worker runs; defaults to `CLOUDFLARE_ENV`, which wrangler reads too. */
|
|
385
|
+
environment?: string;
|
|
386
|
+
/**
|
|
387
|
+
* Imports `lunora/env.ts` and answers its module namespace. Defaults to a
|
|
388
|
+
* cache-free `jiti` import, so an edited contract is read fresh.
|
|
389
|
+
*/
|
|
390
|
+
load?: (path: string) => Promise<unknown>;
|
|
391
|
+
/** Defaults to `process.env`. */
|
|
392
|
+
processEnv?: Record<string, string | undefined>;
|
|
393
|
+
projectRoot: string;
|
|
394
|
+
schemaDirectory: string;
|
|
395
|
+
/** `--var` values the dev worker is started with; they win over the config's `vars` and over `.dev.vars` / `.env`, as in wrangler. */
|
|
396
|
+
vars?: Readonly<Record<string, string>>;
|
|
397
|
+
/** Binding names the dev session leaves out of the worker (a logged-out `ai` / `artifacts`), so they are not exempt. */
|
|
398
|
+
withheld?: ReadonlyArray<string>;
|
|
399
|
+
}
|
|
400
|
+
/**
|
|
401
|
+
* Run the project's env contract against its local worker env. Never throws:
|
|
402
|
+
* anything that stops the check — a contract that cannot be loaded on the host
|
|
403
|
+
* (a `cloudflare:` import, a tsconfig path alias jiti does not read), an
|
|
404
|
+
* unreadable `.dev.vars`, a wrangler config whose bindings cannot be read —
|
|
405
|
+
* answers `unloadable` with the reason, secrets redacted.
|
|
406
|
+
*/
|
|
407
|
+
declare const checkDevEnv: (options: DevEnvCheckOptions) => Promise<DevEnvCheck>;
|
|
408
|
+
/**
|
|
409
|
+
* The one log line {@link checkDevEnv}'s result deserves, with its level — or
|
|
410
|
+
* `undefined` when there is nothing to say. `wasInvalid` is what the previous
|
|
411
|
+
* check of the same server found, so a check that passes again says so.
|
|
412
|
+
*/
|
|
413
|
+
declare const describeDevEnvCheck: (check: DevEnvCheck, schemaDirectory: string, { wasInvalid }?: {
|
|
414
|
+
wasInvalid?: boolean;
|
|
415
|
+
}) => undefined | {
|
|
416
|
+
level: "info" | "warn";
|
|
417
|
+
message: string;
|
|
418
|
+
};
|
|
357
419
|
/** Directory holding per-checkout Lunora state (gitignored by convention). */
|
|
358
420
|
declare const DEV_STATE_DIR = ".lunora";
|
|
359
421
|
/** The dev-server state filename, relative to the project root. */
|
|
@@ -511,6 +573,43 @@ interface ClaimDevServerStateResult {
|
|
|
511
573
|
declare const claimDevServerState: (projectRoot: string, state: DevServerState, options?: {
|
|
512
574
|
supersedePid?: number;
|
|
513
575
|
}) => ClaimDevServerStateResult;
|
|
576
|
+
interface DevTriggerHintOptions {
|
|
577
|
+
/** The wrangler environment the dev worker runs; defaults to `CLOUDFLARE_ENV`, which wrangler reads too. */
|
|
578
|
+
environment?: string;
|
|
579
|
+
projectRoot: string;
|
|
580
|
+
/**
|
|
581
|
+
* The dev worker's scheduled-trigger endpoint (no query), when the dev server
|
|
582
|
+
* exposes one, for a ready-to-run `curl`. Omitted, the cron hint names only
|
|
583
|
+
* the Studio page.
|
|
584
|
+
*/
|
|
585
|
+
scheduledUrl?: string;
|
|
586
|
+
/** The schema directory the project declares its queues under. */
|
|
587
|
+
schemaDirectory: string;
|
|
588
|
+
/** The Studio's root URL (`…/__lunora`), or `undefined` when it is not served. */
|
|
589
|
+
studioUrl?: string;
|
|
590
|
+
}
|
|
591
|
+
/** One hint row; each dev banner lays it out with {@link formatDevBannerRow}. */
|
|
592
|
+
interface DevTriggerHint {
|
|
593
|
+
label: "Crons" | "Queues";
|
|
594
|
+
text: string;
|
|
595
|
+
}
|
|
596
|
+
/**
|
|
597
|
+
* The hint rows for the project's crons and queues — empty when it declares
|
|
598
|
+
* neither, when `wrangler.jsonc` is missing or unparseable, or when there is no
|
|
599
|
+
* surface to point at. Never throws: it only decorates a startup banner.
|
|
600
|
+
*/
|
|
601
|
+
declare const devTriggerHints: (options: DevTriggerHintOptions) => DevTriggerHint[];
|
|
602
|
+
/**
|
|
603
|
+
* One ` ➜ Label: value` banner row, the label padded to `width` (colon
|
|
604
|
+
* included) so the values line up. `style` decorates the arrow and the label
|
|
605
|
+
* after padding, so escape codes never count toward the width — Vite's banner
|
|
606
|
+
* colours both, `lunora dev`'s colours neither. A label wider than `width` gets
|
|
607
|
+
* no padding rather than an error.
|
|
608
|
+
*/
|
|
609
|
+
declare const formatDevBannerRow: (label: string, value: string, width: number, style?: {
|
|
610
|
+
arrow?: (text: string) => string;
|
|
611
|
+
label?: (text: string) => string;
|
|
612
|
+
}) => string;
|
|
514
613
|
/** The conventional filename for local Cloudflare dev secrets (gitignored). */
|
|
515
614
|
declare const DEV_VARS_FILE: string;
|
|
516
615
|
/** Its committed, secret-free counterpart that scaffolding reads from. */
|
|
@@ -545,6 +644,16 @@ declare const parseDevVariableEntries: (content: string) => {
|
|
|
545
644
|
key: string;
|
|
546
645
|
value: string;
|
|
547
646
|
}[];
|
|
647
|
+
/**
|
|
648
|
+
* A dotenv-format file (`.dev.vars`, `.env`, …) as a record, through
|
|
649
|
+
* {@link parseDevVariableEntries} — or `undefined` when the file does not exist.
|
|
650
|
+
* Any other read failure (a directory, no permission) throws, as it makes
|
|
651
|
+
* `wrangler dev` refuse a `.dev.vars`; a caller that reads a broken file as
|
|
652
|
+
* unset catches it.
|
|
653
|
+
*/
|
|
654
|
+
declare const readDevVariablesRecord: (path: string) => Record<string, string> | undefined;
|
|
655
|
+
/** The `.env` files `wrangler dev` reads for `environment`, in load order (later wins) — its `getDefaultEnvFiles`. */
|
|
656
|
+
declare const wranglerDotenvFiles: (environment?: string) => string[];
|
|
548
657
|
/**
|
|
549
658
|
* Escape a runtime string for safe literal interpolation into a `RegExp`
|
|
550
659
|
* source. The one canonical implementation — `@lunora/config`'s own
|
|
@@ -1072,10 +1181,12 @@ interface EnsureDevVariablesDeps {
|
|
|
1072
1181
|
info: (message: string) => void;
|
|
1073
1182
|
/** Injectable for tests; defaults to `crypto.randomBytes` hex. */
|
|
1074
1183
|
randomHex?: (bytes: number) => string;
|
|
1184
|
+
/** Emit a warning; defaults to {@link EnsureDevVariablesDeps.info}. */
|
|
1185
|
+
warn?: (message: string) => void;
|
|
1075
1186
|
/** Generate without prompting (e.g. a `--yes` flag). */
|
|
1076
1187
|
yes?: boolean;
|
|
1077
1188
|
}
|
|
1078
|
-
type EnsureDevVariablesStatus = "augmented" | "declined" | "exists" | "generated" | "no-example" | "skipped-exists";
|
|
1189
|
+
type EnsureDevVariablesStatus = "augmented" | "declined" | "exists" | "generated" | "no-example" | "skipped-exists" | "unreadable";
|
|
1079
1190
|
interface EnsureDevVariablesResult {
|
|
1080
1191
|
/** Keys appended to an existing file, when `status` is `"augmented"`. */
|
|
1081
1192
|
addedKeys: string[];
|
|
@@ -1098,7 +1209,9 @@ declare const writeDevVariablesFileAtomically: (path: string, content: string) =
|
|
|
1098
1209
|
*
|
|
1099
1210
|
* - file missing → offer to generate it (secret placeholders auto-filled);
|
|
1100
1211
|
* - file present but missing keys the example lists → offer to append them;
|
|
1101
|
-
* - file present and complete → nothing to do
|
|
1212
|
+
* - file present and complete → nothing to do;
|
|
1213
|
+
* - either one not a readable file (a directory, no permission) → one warning,
|
|
1214
|
+
* status `"unreadable"`, nothing written.
|
|
1102
1215
|
*
|
|
1103
1216
|
* Prompts via `confirm` (skipped when `yes`); never overwrites existing values.
|
|
1104
1217
|
* Returns what happened so the caller can tailor any follow-up. Shared by
|
|
@@ -1307,4 +1420,4 @@ type ParseSchemaResult = {
|
|
|
1307
1420
|
* message per failure mode without throwing.
|
|
1308
1421
|
*/
|
|
1309
1422
|
declare const parseSchema: (source: string) => ParseSchemaResult;
|
|
1310
|
-
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 CelldToolchainProbe, type CelldToolchainProbeOptions, 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, ensureGitignoreEntries, escapeRegExp, fillDevSecrets, formatLunoraEvent, generateSecretValue, interpretRemote, isCodegenDisabled, isDevServerReady, isInteractive, isLazyFunctionsEnabled, isMintableSecretKey, isPlaceholderValue, isProcessAlive, isRecordedProcessCurrent, mintableSecretKeysFor, parseDevVariableEntries, parseSchema, planDevSecretsFill, planDevVariablesAugment, planDevVariablesScaffold, probeCelldToolchain, 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, writeCelldDevProjection, writeDevServerState, writeDevVariablesFileAtomically, writeLinkedProject };
|
|
1423
|
+
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 CelldToolchainProbe, type CelldToolchainProbeOptions, 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 DevEnvCheck, type DevEnvCheckOptions, type DevProcess, type DevProcessOptions, type DevProcessSpawner, type DevSecretsFillPlan, type DevServerMode, type DevServerState, type DevTriggerHint, type DevTriggerHintOptions, type DiscoverAgentInfoResult, type DiscoverContainerInfoResult, type DiscoverWorkflowInfoResult, type DiscoveryCache, type DockerLike, type EnsureDevVariablesDeps, type EnsureDevVariablesResult, type EnsureDevVariablesStatus, type EnvKeyFailure, 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, checkDevEnv, claimDevServerState, classifyEdit, clearApiSpecMarker, clearDevServerState, createConfirm, describeDevEnvCheck, detectAiAgent, detectFramework, detectLintTools, devTriggerHints, discoverAgentInfo, discoverContainerInfo, discoverWorkflowInfo, ensureDevVariables, ensureDevVariablesExample as ensureDevVarsExample, ensureDevWorkerEnv, ensureGitignoreEntries, escapeRegExp, fillDevSecrets, formatDevBannerRow, formatLunoraEvent, generateSecretValue, interpretRemote, isCodegenDisabled, isDevServerReady, isInteractive, isLazyFunctionsEnabled, isMintableSecretKey, isPlaceholderValue, isProcessAlive, isRecordedProcessCurrent, mintableSecretKeysFor, parseDevVariableEntries, parseSchema, planDevSecretsFill, planDevVariablesAugment, planDevVariablesScaffold, probeCelldToolchain, projectUsesUmbrella, promptMultiSelect, promptSelect, promptText, promptYesNo, readApiSpecMarker, readDevServerState, readDevVariablesRecord, readLinkedProject, readLiveDevServerState, readProjectRemotePreference, readProjectTarget, removeDevVariableLine, reportCodegenFindings, requiredSecrets, resolveLazyFunctions, resolveProjectTarget, resolveSchemaDirectory, resolveTargetOrThrow, runPostCodegenHook, secretsForPackages, startCelldDevSession, startDevProcess, streamContainerLogs, updateDevServerState, upsertDevVariableLine, wranglerDotenvFiles, writeApiSpecMarker, writeCelldDevProjection, writeDevServerState, writeDevVariablesFileAtomically, writeLinkedProject };
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{AGENT_MODE_ENV as o,detectAiAgent as t}from"./packem_shared/AGENT_MODE_ENV-D8MvSwPE.mjs";import{discoverAgentInfo as E}from"./packem_shared/discoverAgentInfo-pqFMJBtJ.mjs";import{AGENT_RULES_DIR as i,AGENT_RULES_HINT as n,AGENT_RULES_HINT_ENV as _,LUNORA_SKILL_NAMES as l,ROOT_SKILL_NAME as c,claimAgentRulesHint as p,detectAgentRules as D}from"./packem_shared/AGENT_RULES_DIR-Bd6JPtNa.mjs";import{clearApiSpecMarker as A,readApiSpecMarker as m,writeApiSpecMarker as S}from"./packem_shared/clearApiSpecMarker-DMGpP41V.mjs";import{MissingBuildOutputError as L}from"./packem_shared/MissingBuildOutputError-BAyekzof.mjs";import{default as T}from"./packem_shared/canonicalPath-DrfMiT3U.mjs";import{probeCelldToolchain as v}from"./packem_shared/probeCelldToolchain-DxDttfHy.mjs";import{startCelldDevSession as g,writeCelldDevProjection as I}from"./packem_shared/startCelldDevSession-Bg_RN5uf.mjs";import{D1_PLACEHOLDER_ID as u}from"./packem_shared/D1_PLACEHOLDER_ID-ZnDjVymH.mjs";import{BUILD_ROOT_ENV as P,BUILD_TARGET_ENV as C,BUNDLE_META_PATH_ENV as M,CODEGEN_ENV as U,DEFAULT_BUNDLE_META_PATH as F,LAZY_FUNCTIONS_ENV as B,STRICT_ADVISORIES_ENV as G,isCodegenDisabled as b,isLazyFunctionsEnabled as y,resolveLazyFunctions as k}from"./packem_shared/BUILD_ROOT_ENV-Dg4MV3wY.mjs";import{discoverContainerInfo as j}from"./packem_shared/discoverContainerInfo-DzXr7Vm3.mjs";import{streamContainerLogs as K}from"./packem_shared/streamContainerLogs-0nko1qpv.mjs";import{detectFramework as W,projectUsesUmbrella as Y}from"./packem_shared/detectFramework-Dfpvu6rD.mjs";import{acceptsConnection as z,startDevProcess as q}from"./packem_shared/acceptsConnection-DHhUYGjT.mjs";import{DEV_BINDINGS_FILE as Z,DEV_DAEMON_ENV as Q,DEV_HANDOFF_ENV as $,DEV_LOG_FILE as ee,DEV_LOG_FILE_ENV as re,DEV_STATE_DIR as oe,DEV_STATE_FILE as te,claimDevServerState as ae,clearDevServerState as Ee,isDevServerReady as se,isProcessAlive as ie,isRecordedProcessCurrent as ne,readDevServerState as _e,readLiveDevServerState as le,updateDevServerState as ce,writeDevServerState as pe}from"./packem_shared/DEV_BINDINGS_FILE-C0ZN_XlP.mjs";import{DEV_VARS_EXAMPLE_FILE as de,DEV_VARS_FILE as Ae,DEV_VARS_KEY_PATTERN as me,escapeRegExp as Se,parseDevVariableEntries as fe,removeDevVariableLine as Le,upsertDevVariableLine as Ne}from"./packem_shared/DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";import{DEV_WORKER_ENV_VALUE as Re,DEV_WORKER_ENV_VAR as ve,ensureDevWorkerEnv as xe}from"./packem_shared/DEV_WORKER_ENV_VALUE-DdPmCpf3.mjs";import{createDiscoveryCache as Ie}from"./packem_shared/createDiscoveryCache-npJI4uej.mjs";import{DEFAULT_DEPLOY_TARGET as ue,deployTargetIds as Oe,isRunnableTarget as Pe,planToolchainInvocation as Ce,resolveDeployDriver as Me,runnableTargetIds as Ue,targetRunsOwnDevServer as Fe}from"./packem_shared/DEFAULT_DEPLOY_TARGET-DllYb7Tj.mjs";import{default as Ge}from"./packem_shared/ensureGitignoreEntries-Tsk8Qkw7.mjs";import{inferLunoraBindings as ye,secretSourcesFromBindings as ke}from"./packem_shared/inferLunoraBindings-D0QDcugr.mjs";import{LINKED_PROJECT_DIR as je,LINKED_PROJECT_FILE as we,readLinkedProject as Ke,writeLinkedProject as He}from"./packem_shared/LINKED_PROJECT_DIR-Ba5qPEwo.mjs";import{LUNORA_IGNORED_PATHS as Ye,applyLintIgnores as Je,detectLintTools as ze}from"./packem_shared/LUNORA_IGNORED_PATHS-U93uPxrW.mjs";import{blockingFindingsMessage as Xe,reportCodegenFindings as Ze}from"./packem_shared/blockingFindingsMessage-CRbg1sla.mjs";import{LUNORA_EVENT_SOURCE as $e,formatLunoraEvent as er}from"./packem_shared/LUNORA_EVENT_SOURCE-D_VGT1JJ.mjs";import{LUNORA_TAG as or,advisoryLine as tr,lunoraLine as ar}from"./packem_shared/LUNORA_TAG-DQTGPqcJ.mjs";import{default as sr}from"./packem_shared/LunoraReporter-f277GLNT.mjs";import{addArgsFor as nr,detectInstalledManagers as _r,detectPackageManager as lr,execArgsFor as cr,installArgsFor as pr,runScriptArgsFor as Dr,runScriptCommand as dr,toolchainExecArgs as Ar}from"./packem_shared/addArgsFor-CYZKhNIo.mjs";import{P as Sr,m as fr,s as Lr}from"./packem_shared/package-secrets-registry-TouCAMQN.mjs";import{runPostCodegenHook as Tr}from"./packem_shared/runPostCodegenHook-Dx3yTsYZ.mjs";import{assertBuildTargetMatches as vr,interpretRemote as xr,readProjectRemotePreference as gr,readProjectTarget as Ir,resolveProjectTarget as Vr,resolveTargetOrThrow as ur}from"./packem_shared/assertBuildTargetMatches-CqrrwiQ-.mjs";import{readProjectDependencies as Pr,readProjectDependencyNames as Cr,readProjectManifest as Mr}from"./packem_shared/readProjectDependencies-l3uhUKjo.mjs";import{createConfirm as Fr,isInteractive as Br,promptMultiSelect as Gr,promptSelect as br,promptText as yr,promptYesNo as kr}from"./packem_shared/createConfirm-D5mKTMHj.mjs";import{default as jr}from"./packem_shared/resolveSchemaDirectory-Ca5P6KuP.mjs";import{buildPackageSecretsBlock as Kr,ensureDevVariables as Hr,ensureDevVarsExample as Wr,fillDevSecrets as Yr,generateSecretValue as Jr,isMintableSecretKey as zr,isPlaceholderValue as qr,planDevSecretsFill as Xr,planDevVariablesAugment as Zr,planDevVariablesScaffold as Qr,requiredSecrets as $r,writeDevVariablesFileAtomically as eo}from"./packem_shared/buildPackageSecretsBlock-B4Odg5OF.mjs";import{applyAdditiveEdit as oo,classifyEdit as to}from"./packem_shared/applyAdditiveEdit-DEwPKcJg.mjs";import{parseSchema as Eo}from"./packem_shared/parseSchema-D1Wbr1qv.mjs";import{classifyPolicyEdit as io,resolveServerModule as no,scaffoldPolicyFile as _o,wireRlsIntoProcedure as lo}from"./packem_shared/classifyPolicyEdit-DJi9Fk8G.mjs";import{discoverSchemaInfo as po}from"./packem_shared/discoverSchemaInfo-DRPnqgif.mjs";import{ACCENT as Ao,BADGES as mo,BADGE_COLUMN_WIDTH as So,LUNA_ART as fo,LUNA_BUNNY as Lo,LUNA_NAME as No,LUNA_SIGNOFF as To,STEP_BADGE_NAMES as Ro,badgeLead as vo,badgeWidth as xo,padBadge as go,paintAnswer as Io,paintBadge as Vo}from"./packem_shared/ACCENT-CotPTfv7.mjs";import{COMPOSED_WORKER_ENTRY as Oo,DURABLE_OBJECT_BINDINGS as Po,GENERATED_CLASS_MODULES as Co,GENERATED_MODULE_DURABLE_OBJECTS as Mo,MERGED_DURABLE_OBJECTS_MODULE as Uo,isMergedProject as Fo,isMergedRoleModule as Bo}from"./packem_shared/COMPOSED_WORKER_ENTRY-BcFt6ts5.mjs";import{discoverWorkflowInfo as bo}from"./packem_shared/discoverWorkflowInfo-zW7Tt0Tn.mjs";export{Ao as ACCENT,o as AGENT_MODE_ENV,i as AGENT_RULES_DIR,n as AGENT_RULES_HINT,_ as AGENT_RULES_HINT_ENV,mo as BADGES,So as BADGE_COLUMN_WIDTH,P as BUILD_ROOT_ENV,C as BUILD_TARGET_ENV,M as BUNDLE_META_PATH_ENV,U as CODEGEN_ENV,Oo as COMPOSED_WORKER_ENTRY,u as D1_PLACEHOLDER_ID,F as DEFAULT_BUNDLE_META_PATH,ue as DEFAULT_DEPLOY_TARGET,Z as DEV_BINDINGS_FILE,Q as DEV_DAEMON_ENV,$ as DEV_HANDOFF_ENV,ee as DEV_LOG_FILE,re as DEV_LOG_FILE_ENV,oe as DEV_STATE_DIR,te as DEV_STATE_FILE,de as DEV_VARS_EXAMPLE_FILE,Ae as DEV_VARS_FILE,me as DEV_VARS_KEY_PATTERN,Re as DEV_WORKER_ENV_VALUE,ve as DEV_WORKER_ENV_VAR,Po as DURABLE_OBJECT_BINDINGS,Co as GENERATED_CLASS_MODULES,Mo as GENERATED_MODULE_DURABLE_OBJECTS,B as LAZY_FUNCTIONS_ENV,je as LINKED_PROJECT_DIR,we as LINKED_PROJECT_FILE,fo as LUNA_ART,Lo as LUNA_BUNNY,No as LUNA_NAME,To as LUNA_SIGNOFF,$e as LUNORA_EVENT_SOURCE,Ye as LUNORA_IGNORED_PATHS,l as LUNORA_SKILL_NAMES,or as LUNORA_TAG,sr as LunoraReporter,Uo as MERGED_DURABLE_OBJECTS_MODULE,L as MissingBuildOutputError,Sr as PACKAGE_SECRETS_REGISTRY,c as ROOT_SKILL_NAME,Ro as STEP_BADGE_NAMES,G as STRICT_ADVISORIES_ENV,z as acceptsConnection,nr as addArgsFor,tr as advisoryLine,oo as applyAdditiveEdit,Je as applyLintIgnores,vr as assertBuildTargetMatches,vo as badgeLead,xo as badgeWidth,Xe as blockingFindingsMessage,Kr as buildPackageSecretsBlock,T as canonicalPath,p as claimAgentRulesHint,ae as claimDevServerState,to as classifyEdit,io as classifyPolicyEdit,A as clearApiSpecMarker,Ee as clearDevServerState,Fr as createConfirm,Ie as createDiscoveryCache,Oe as deployTargetIds,D as detectAgentRules,t as detectAiAgent,W as detectFramework,_r as detectInstalledManagers,ze as detectLintTools,lr as detectPackageManager,E as discoverAgentInfo,j as discoverContainerInfo,po as discoverSchemaInfo,bo as discoverWorkflowInfo,Hr as ensureDevVariables,Wr as ensureDevVarsExample,xe as ensureDevWorkerEnv,Ge as ensureGitignoreEntries,Se as escapeRegExp,cr as execArgsFor,Yr as fillDevSecrets,er as formatLunoraEvent,Jr as generateSecretValue,ye as inferLunoraBindings,pr as installArgsFor,xr as interpretRemote,b as isCodegenDisabled,se as isDevServerReady,Br as isInteractive,y as isLazyFunctionsEnabled,Fo as isMergedProject,Bo as isMergedRoleModule,zr as isMintableSecretKey,qr as isPlaceholderValue,ie as isProcessAlive,ne as isRecordedProcessCurrent,Pe as isRunnableTarget,ar as lunoraLine,fr as mintableSecretKeysFor,go as padBadge,Io as paintAnswer,Vo as paintBadge,fe as parseDevVariableEntries,Eo as parseSchema,Xr as planDevSecretsFill,Zr as planDevVariablesAugment,Qr as planDevVariablesScaffold,Ce as planToolchainInvocation,v as probeCelldToolchain,Y as projectUsesUmbrella,Gr as promptMultiSelect,br as promptSelect,yr as promptText,kr as promptYesNo,m as readApiSpecMarker,_e as readDevServerState,Ke as readLinkedProject,le as readLiveDevServerState,Pr as readProjectDependencies,Cr as readProjectDependencyNames,Mr as readProjectManifest,gr as readProjectRemotePreference,Ir as readProjectTarget,Le as removeDevVariableLine,Ze as reportCodegenFindings,$r as requiredSecrets,Me as resolveDeployDriver,k as resolveLazyFunctions,Vr as resolveProjectTarget,jr as resolveSchemaDirectory,no as resolveServerModule,ur as resolveTargetOrThrow,Tr as runPostCodegenHook,Dr as runScriptArgsFor,dr as runScriptCommand,Ue as runnableTargetIds,_o as scaffoldPolicyFile,ke as secretSourcesFromBindings,Lr as secretsForPackages,g as startCelldDevSession,q as startDevProcess,K as streamContainerLogs,Fe as targetRunsOwnDevServer,Ar as toolchainExecArgs,ce as updateDevServerState,Ne as upsertDevVariableLine,lo as wireRlsIntoProcedure,S as writeApiSpecMarker,I as writeCelldDevProjection,pe as writeDevServerState,eo as writeDevVariablesFileAtomically,He as writeLinkedProject};
|
|
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 s,AGENT_RULES_HINT as n,AGENT_RULES_HINT_ENV as _,LUNORA_SKILL_NAMES as c,ROOT_SKILL_NAME as l,claimAgentRulesHint as p,detectAgentRules as D}from"./packem_shared/AGENT_RULES_DIR-Bd6JPtNa.mjs";import{clearApiSpecMarker as A,readApiSpecMarker as m,writeApiSpecMarker as f}from"./packem_shared/clearApiSpecMarker-DMGpP41V.mjs";import{MissingBuildOutputError as L}from"./packem_shared/MissingBuildOutputError-BAyekzof.mjs";import{default as N}from"./packem_shared/canonicalPath-DrfMiT3U.mjs";import{probeCelldToolchain as T}from"./packem_shared/probeCelldToolchain-DxDttfHy.mjs";import{startCelldDevSession as g,writeCelldDevProjection as V}from"./packem_shared/startCelldDevSession-DQ7YylR_.mjs";import{D1_PLACEHOLDER_ID as u}from"./packem_shared/D1_PLACEHOLDER_ID-ZnDjVymH.mjs";import{BUILD_ROOT_ENV as P,BUILD_TARGET_ENV as C,BUNDLE_META_PATH_ENV as F,CODEGEN_ENV as M,DEFAULT_BUNDLE_META_PATH as U,LAZY_FUNCTIONS_ENV as B,STRICT_ADVISORIES_ENV as G,isCodegenDisabled as b,isLazyFunctionsEnabled as y,resolveLazyFunctions as k}from"./packem_shared/BUILD_ROOT_ENV-Dg4MV3wY.mjs";import{discoverContainerInfo as w}from"./packem_shared/discoverContainerInfo-DzXr7Vm3.mjs";import{streamContainerLogs as H}from"./packem_shared/streamContainerLogs-0nko1qpv.mjs";import{detectFramework as W,projectUsesUmbrella as Y}from"./packem_shared/detectFramework-Dfpvu6rD.mjs";import{checkDevEnv as z,describeDevEnvCheck as q}from"./packem_shared/checkDevEnv-egiW2lSF.mjs";import{acceptsConnection as Z,startDevProcess as Q}from"./packem_shared/acceptsConnection-DHhUYGjT.mjs";import{DEV_BINDINGS_FILE as ee,DEV_DAEMON_ENV as re,DEV_HANDOFF_ENV as oe,DEV_LOG_FILE as te,DEV_LOG_FILE_ENV as ae,DEV_STATE_DIR as Ee,DEV_STATE_FILE as ie,claimDevServerState as se,clearDevServerState as ne,isDevServerReady as _e,isProcessAlive as ce,isRecordedProcessCurrent as le,readDevServerState as pe,readLiveDevServerState as De,updateDevServerState as de,writeDevServerState as Ae}from"./packem_shared/DEV_BINDINGS_FILE-C0ZN_XlP.mjs";import{devTriggerHints as fe,formatDevBannerRow as Se}from"./packem_shared/devTriggerHints-CN_RJxWW.mjs";import{DEV_VARS_EXAMPLE_FILE as ve,DEV_VARS_FILE as Ne,DEV_VARS_KEY_PATTERN as Re,escapeRegExp as Te,parseDevVariableEntries as xe,readDevVariablesRecord as ge,removeDevVariableLine as Ve,upsertDevVariableLine as Ie,wranglerDotenvFiles as ue}from"./packem_shared/DEV_VARS_EXAMPLE_FILE-hBT89IXh.mjs";import{DEV_WORKER_ENV_VALUE as Pe,DEV_WORKER_ENV_VAR as Ce,ensureDevWorkerEnv as Fe}from"./packem_shared/DEV_WORKER_ENV_VALUE-FoysLtF0.mjs";import{createDiscoveryCache as Ue}from"./packem_shared/createDiscoveryCache-npJI4uej.mjs";import{DEFAULT_DEPLOY_TARGET as Ge,deployTargetIds as be,isRunnableTarget as ye,planToolchainInvocation as ke,resolveDeployDriver as he,runnableTargetIds as we,targetRunsOwnDevServer as je}from"./packem_shared/DEFAULT_DEPLOY_TARGET-CAJl2nEI.mjs";import{default as Ke}from"./packem_shared/ensureGitignoreEntries-Tsk8Qkw7.mjs";import{inferLunoraBindings as Ye,secretSourcesFromBindings as Je}from"./packem_shared/inferLunoraBindings-Biq1OW9V.mjs";import{LINKED_PROJECT_DIR as qe,LINKED_PROJECT_FILE as Xe,readLinkedProject as Ze,writeLinkedProject as Qe}from"./packem_shared/LINKED_PROJECT_DIR-Ba5qPEwo.mjs";import{LUNORA_IGNORED_PATHS as er,applyLintIgnores as rr,detectLintTools as or}from"./packem_shared/LUNORA_IGNORED_PATHS-U93uPxrW.mjs";import{blockingFindingsMessage as ar,reportCodegenFindings as Er}from"./packem_shared/blockingFindingsMessage-CRbg1sla.mjs";import{LUNORA_EVENT_SOURCE as sr,formatLunoraEvent as nr}from"./packem_shared/LUNORA_EVENT_SOURCE-Cq0oj0_9.mjs";import{LUNORA_TAG as cr,advisoryLine as lr,lunoraLine as pr}from"./packem_shared/LUNORA_TAG-DQTGPqcJ.mjs";import{default as dr}from"./packem_shared/LunoraReporter-f277GLNT.mjs";import{addArgsFor as mr,detectInstalledManagers as fr,detectPackageManager as Sr,execArgsFor as Lr,installArgsFor as vr,runScriptArgsFor as Nr,runScriptCommand as Rr,toolchainExecArgs as Tr}from"./packem_shared/addArgsFor-CYZKhNIo.mjs";import{PACKAGE_SECRETS_REGISTRY as gr,mintableSecretKeysFor as Vr,secretsForPackages as Ir}from"./packem_shared/PACKAGE_SECRETS_REGISTRY-CPWkw-qE.mjs";import{runPostCodegenHook as Or}from"./packem_shared/runPostCodegenHook-Dx3yTsYZ.mjs";import{assertBuildTargetMatches as Cr,interpretRemote as Fr,readProjectRemotePreference as Mr,readProjectTarget as Ur,resolveProjectTarget as Br,resolveTargetOrThrow as Gr}from"./packem_shared/assertBuildTargetMatches-tkKAa5zl.mjs";import{readProjectDependencies as yr,readProjectDependencyNames as kr,readProjectManifest as hr}from"./packem_shared/readProjectDependencies-l3uhUKjo.mjs";import{createConfirm as jr,isInteractive as Hr,promptMultiSelect as Kr,promptSelect as Wr,promptText as Yr,promptYesNo as Jr}from"./packem_shared/createConfirm-D5mKTMHj.mjs";import{default as qr}from"./packem_shared/resolveSchemaDirectory-Ca5P6KuP.mjs";import{buildPackageSecretsBlock as Zr,ensureDevVariables as Qr,ensureDevVarsExample as $r,fillDevSecrets as eo,generateSecretValue as ro,isMintableSecretKey as oo,isPlaceholderValue as to,planDevSecretsFill as ao,planDevVariablesAugment as Eo,planDevVariablesScaffold as io,requiredSecrets as so,writeDevVariablesFileAtomically as no}from"./packem_shared/buildPackageSecretsBlock-DrSD60vH.mjs";import{applyAdditiveEdit as co,classifyEdit as lo}from"./packem_shared/applyAdditiveEdit-DEwPKcJg.mjs";import{parseSchema as Do}from"./packem_shared/parseSchema-D1Wbr1qv.mjs";import{classifyPolicyEdit as mo,resolveServerModule as fo,scaffoldPolicyFile as So,wireRlsIntoProcedure as Lo}from"./packem_shared/classifyPolicyEdit-DJi9Fk8G.mjs";import{discoverSchemaInfo as No}from"./packem_shared/discoverSchemaInfo-DRPnqgif.mjs";import{ACCENT as To,BADGES as xo,BADGE_COLUMN_WIDTH as go,LUNA_ART as Vo,LUNA_BUNNY as Io,LUNA_NAME as uo,LUNA_SIGNOFF as Oo,STEP_BADGE_NAMES as Po,badgeLead as Co,badgeWidth as Fo,padBadge as Mo,paintAnswer as Uo,paintBadge as Bo}from"./packem_shared/ACCENT-CotPTfv7.mjs";import{COMPOSED_WORKER_ENTRY as bo,DURABLE_OBJECT_BINDINGS as yo,GENERATED_CLASS_MODULES as ko,GENERATED_MODULE_DURABLE_OBJECTS as ho,MERGED_DURABLE_OBJECTS_MODULE as wo,isMergedProject as jo,isMergedRoleModule as Ho}from"./packem_shared/COMPOSED_WORKER_ENTRY-LpLlp-aF.mjs";import{discoverWorkflowInfo as Wo}from"./packem_shared/discoverWorkflowInfo-zW7Tt0Tn.mjs";import{ENV_FILENAME as Jo}from"@lunora/codegen";export{To as ACCENT,o as AGENT_MODE_ENV,s as AGENT_RULES_DIR,n as AGENT_RULES_HINT,_ as AGENT_RULES_HINT_ENV,xo as BADGES,go as BADGE_COLUMN_WIDTH,P as BUILD_ROOT_ENV,C as BUILD_TARGET_ENV,F as BUNDLE_META_PATH_ENV,M as CODEGEN_ENV,bo as COMPOSED_WORKER_ENTRY,u as D1_PLACEHOLDER_ID,U as DEFAULT_BUNDLE_META_PATH,Ge as DEFAULT_DEPLOY_TARGET,ee as DEV_BINDINGS_FILE,re as DEV_DAEMON_ENV,oe as DEV_HANDOFF_ENV,te as DEV_LOG_FILE,ae as DEV_LOG_FILE_ENV,Ee as DEV_STATE_DIR,ie as DEV_STATE_FILE,ve as DEV_VARS_EXAMPLE_FILE,Ne as DEV_VARS_FILE,Re as DEV_VARS_KEY_PATTERN,Pe as DEV_WORKER_ENV_VALUE,Ce as DEV_WORKER_ENV_VAR,yo as DURABLE_OBJECT_BINDINGS,Jo as ENV_FILENAME,ko as GENERATED_CLASS_MODULES,ho as GENERATED_MODULE_DURABLE_OBJECTS,B as LAZY_FUNCTIONS_ENV,qe as LINKED_PROJECT_DIR,Xe as LINKED_PROJECT_FILE,Vo as LUNA_ART,Io as LUNA_BUNNY,uo as LUNA_NAME,Oo as LUNA_SIGNOFF,sr as LUNORA_EVENT_SOURCE,er as LUNORA_IGNORED_PATHS,c as LUNORA_SKILL_NAMES,cr as LUNORA_TAG,dr as LunoraReporter,wo as MERGED_DURABLE_OBJECTS_MODULE,L as MissingBuildOutputError,gr as PACKAGE_SECRETS_REGISTRY,l as ROOT_SKILL_NAME,Po as STEP_BADGE_NAMES,G as STRICT_ADVISORIES_ENV,Z as acceptsConnection,mr as addArgsFor,lr as advisoryLine,co as applyAdditiveEdit,rr as applyLintIgnores,Cr as assertBuildTargetMatches,Co as badgeLead,Fo as badgeWidth,ar as blockingFindingsMessage,Zr as buildPackageSecretsBlock,N as canonicalPath,z as checkDevEnv,p as claimAgentRulesHint,se as claimDevServerState,lo as classifyEdit,mo as classifyPolicyEdit,A as clearApiSpecMarker,ne as clearDevServerState,jr as createConfirm,Ue as createDiscoveryCache,be as deployTargetIds,q as describeDevEnvCheck,D as detectAgentRules,t as detectAiAgent,W as detectFramework,fr as detectInstalledManagers,or as detectLintTools,Sr as detectPackageManager,fe as devTriggerHints,E as discoverAgentInfo,w as discoverContainerInfo,No as discoverSchemaInfo,Wo as discoverWorkflowInfo,Qr as ensureDevVariables,$r as ensureDevVarsExample,Fe as ensureDevWorkerEnv,Ke as ensureGitignoreEntries,Te as escapeRegExp,Lr as execArgsFor,eo as fillDevSecrets,Se as formatDevBannerRow,nr as formatLunoraEvent,ro as generateSecretValue,Ye as inferLunoraBindings,vr as installArgsFor,Fr as interpretRemote,b as isCodegenDisabled,_e as isDevServerReady,Hr as isInteractive,y as isLazyFunctionsEnabled,jo as isMergedProject,Ho as isMergedRoleModule,oo as isMintableSecretKey,to as isPlaceholderValue,ce as isProcessAlive,le as isRecordedProcessCurrent,ye as isRunnableTarget,pr as lunoraLine,Vr as mintableSecretKeysFor,Mo as padBadge,Uo as paintAnswer,Bo as paintBadge,xe as parseDevVariableEntries,Do as parseSchema,ao as planDevSecretsFill,Eo as planDevVariablesAugment,io as planDevVariablesScaffold,ke as planToolchainInvocation,T as probeCelldToolchain,Y as projectUsesUmbrella,Kr as promptMultiSelect,Wr as promptSelect,Yr as promptText,Jr as promptYesNo,m as readApiSpecMarker,pe as readDevServerState,ge as readDevVariablesRecord,Ze as readLinkedProject,De as readLiveDevServerState,yr as readProjectDependencies,kr as readProjectDependencyNames,hr as readProjectManifest,Mr as readProjectRemotePreference,Ur as readProjectTarget,Ve as removeDevVariableLine,Er as reportCodegenFindings,so as requiredSecrets,he as resolveDeployDriver,k as resolveLazyFunctions,Br as resolveProjectTarget,qr as resolveSchemaDirectory,fo as resolveServerModule,Gr as resolveTargetOrThrow,Or as runPostCodegenHook,Nr as runScriptArgsFor,Rr as runScriptCommand,we as runnableTargetIds,So as scaffoldPolicyFile,Je as secretSourcesFromBindings,Ir as secretsForPackages,g as startCelldDevSession,Q as startDevProcess,H as streamContainerLogs,je as targetRunsOwnDevServer,Tr as toolchainExecArgs,de as updateDevServerState,Ie as upsertDevVariableLine,Lo as wireRlsIntoProcedure,ue as wranglerDotenvFiles,f as writeApiSpecMarker,V as writeCelldDevProjection,Ae as writeDevServerState,no as writeDevVariablesFileAtomically,Qe as writeLinkedProject};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const B=1,N=new Set(["$schema","account_id","compatibility_date","compatibility_flags","keep_vars","main","migrations","minify","name","observability","placement","routes","rules","secrets","triggers","upload_source_maps","vars","workers_dev"]),q=e=>Object.fromEntries(Object.entries(e).filter(([,i])=>i!==void 0)),K=[{bindingKey:"binding",field:"ai_search",resourceKey:"instance_name",type:"ai_search"},{bindingKey:"binding",field:"ai_search_namespaces",resourceKey:"namespace",type:"ai_search_namespace"},{bindingKey:"binding",field:"analytics_engine_datasets",resourceKey:"dataset",type:"analytics_engine"},{bindingKey:"binding",field:"artifacts",resourceKey:"namespace",type:"artifacts"},{bindingKey:"class_name",field:"containers",resourceKey:"image",type:"container"},{bindingKey:"binding",field:"d1_databases",resourceIdKey:"database_id",resourceKey:"database_name",type:"d1"},{bindingKey:"binding",field:"hyperdrive",resourceIdKey:"id",type:"hyperdrive"},{bindingKey:"binding",field:"kv_namespaces",resourceIdKey:"id",type:"kv"},{bindingKey:"binding",field:"pipelines",resourceKey:["stream","pipeline"],type:"pipeline"},{bindingKey:"binding",field:"r2_buckets",resourceKey:"bucket_name",type:"r2"},{bindingKey:"binding",field:"services",resourceKey:"service",type:"service"},{bindingKey:"binding",field:"vectorize",resourceKey:"index_name",type:"vectorize"},{bindingKey:"binding",field:"vpc_networks",resourceIdKey:["tunnel_id","network_id"],type:"vpc_network"},{bindingKey:"binding",field:"vpc_services",resourceIdKey:"service_id",type:"vpc_service"},{bindingKey:"binding",field:"workflows",resourceKey:"name",type:"workflow"}],w=[{field:"ai",type:"ai"},{field:"analytics",type:"analytics_sql"},{field:"assets",type:"assets"},{field:"browser",type:"browser"},{field:"images",type:"images"},{field:"media",type:"media"},{field:"stream",type:"stream"}],S=new Set([...K.map(e=>e.field),...w.map(e=>e.field),"durable_objects","exports","queues"]),u=(e,i)=>(typeof i=="string"?[i]:i??[]).map(n=>e[n]).find(n=>typeof n=="string"&&n!==""),b=(e,i,t,n)=>{const s=u(e,i);if(s!==void 0)return{name:s,wrongType:!1};const o=(typeof i=="string"?[i]:i??[]).find(r=>{const c=e[r];return c!=null&&typeof c!="string"});return o!==void 0&&n.add(`${t}.${o}`),{wrongType:o!==void 0}},_=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),g=(e,i,t)=>{if(e==null)return[];if(!Array.isArray(e))return t.add(i),[];const n=e.filter(s=>_(s));return n.length!==e.length&&t.add(i),n},f=(e,i,t)=>{if(e==null)return[];if(!Array.isArray(e))return t.add(i),[];const n=e.filter(s=>typeof s=="string");return n.length!==e.length&&t.add(i),n},p=(e,i,t)=>_(e)?e:(e!=null&&t.add(i),{}),v=(e,i,t)=>{if(typeof e=="string")return e;e!=null&&t.add(i)},O=(e,i,t)=>{const n=[];for(const s of K)for(const o of g(e[s.field],s.field,t)){const{name:r,wrongType:c}=b(o,s.bindingKey,s.field,t);if(!c){if(r===void 0){i.push(s.field);continue}n.push({binding:r,className:u(o,"class_name"),resource:u(o,s.resourceKey),resourceId:u(o,s.resourceIdKey),type:s.type})}}return n},j=(e,i,t)=>{const n=new Set(g(e.migrations,"migrations",t).flatMap(r=>f(r.new_sqlite_classes,"migrations.new_sqlite_classes",t))),s=p(e.durable_objects,"durable_objects",t),o=[];for(const r of g(s.bindings,"durable_objects.bindings",t)){const{name:c,wrongType:y}=b(r,"name","durable_objects.bindings",t);if(y)continue;if(c===void 0){i.push("durable_objects");continue}const l=u(r,"class_name");o.push({binding:c,className:l,sqlite:r.script_name===void 0&&l!==void 0?n.has(l):void 0,type:"durable_object"})}return o},T=(e,i,t)=>{const n=p(e.queues,"queues",t),s=[];for(const o of g(n.producers,"queues.producers",t)){const{name:r,wrongType:c}=b(o,"binding","queues.producers",t);if(!c){if(r===void 0){i.push("queues.producers");continue}s.push({binding:r,resource:u(o,"queue"),type:"queue_producer"})}}for(const o of g(n.consumers,"queues.consumers",t)){const{name:r,wrongType:c}=b(o,"queue","queues.consumers",t);if(!c){if(r===void 0){i.push("queues.consumers");continue}s.push({binding:r,resource:r,type:"queue_consumer"})}}return s},A=(e,i,t)=>Object.entries(p(e.exports,"exports",t)).flatMap(([n,s])=>!_(s)||s.type!=="workflow"?(i.push(`exports.${n}`),[]):[{binding:n,className:n,resource:u(s,"name"),type:"workflow"}]),E=(e,i)=>w.flatMap(t=>{const{binding:n}=p(e[t.field],t.field,i);return n===void 0?[]:typeof n!="string"?(i.add(`${t.field}.binding`),[]):[{binding:n,type:t.type}]}),k=(e,i,t,n)=>[...A(e,t,n),...O(e,i,n),...j(e,i,n),...T(e,i,n),...E(e,n)],D=e=>{const i=[],t=[],n=new Set,s=p(e,"(wrangler config)",n),o=k(s,i,t,n).map(d=>q(d)).toSorted((d,a)=>d.type.localeCompare(a.type)||d.binding.localeCompare(a.binding)),r=[...Object.keys(s).filter(d=>!N.has(d)&&!S.has(d)),...i.map(d=>`${d} (entry with no binding name)`),...t].toSorted((d,a)=>d.localeCompare(a)),c=v(s.compatibility_date,"compatibility_date",n),y=s.compatibility_flags,l=y==null?void 0:f(y,"compatibility_flags",n),h=f(p(s.triggers,"triggers",n).crons,"triggers.crons",n),m=v(s.name,"name",n),I=Object.keys(p(s.vars,"vars",n)).toSorted((d,a)=>d.localeCompare(a));return{bindings:o,...c===void 0?{}:{compatibilityDate:c},...l===void 0?{}:{compatibilityFlags:l},crons:h,malformed:[...n].toSorted((d,a)=>d.localeCompare(a)),...m===void 0?{}:{name:m},unknown:r,vars:I,version:1}};export{B as BINDING_MANIFEST_VERSION,D as buildBindingManifest};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{existsSync as c}from"node:fs";import{join as t,basename as f}from"node:path";import{i as l,c as d}from"./process-tree-once-Ou4SfxKM.mjs";import{findWranglerFile as u}from"./WRANGLER_FILES-
|
|
1
|
+
import{existsSync as c}from"node:fs";import{join as t,basename as f}from"node:path";import{i as l,c as d}from"./process-tree-once-Ou4SfxKM.mjs";import{findWranglerFile as u}from"./WRANGLER_FILES-BF8PUjuo.mjs";const m=["cloudflare.config.ts","cloudflare.config.mts","cloudflare.config.js","cloudflare.config.mjs"],g="https://github.com/anolilab/lunora/issues/964",s="LUNORA_CF_CONFIG_WARNING_SHOWN",C=o=>{const n=m.find(a=>c(t(o,a)));if(n===void 0)return;const e=u(o),r=e===void 0?void 0:f(e),i=r===void 0?"in the project root":`next to ${r}`;return{fix:`\`cf\` resource commands (zones, DNS, KV, …) are fine. Don't use \`cf dev\` / \`cf build\` / \`cf deploy\` on a Lunora project until Lunora supports \`cf\` — see ${g}.`,message:`${n} found ${i}. Lunora manages ${r??"the wrangler config"} and never updates a Cloudflare CLI (\`cf\`) config, so \`cf dev\` / \`cf build\` / \`cf deploy\` would run from a stale config, silently missing the bindings, Durable Object classes and migrations Lunora adds.`}},I=(o,n)=>{if(l(s))return!1;const e=C(o);return e===void 0||!d(s)?!1:(n(`${e.message} ${e.fix}`),!0)};export{s as CLOUDFLARE_CLI_CONFIG_WARNING_ENV,C as detectCloudflareCliConfig,I as warnCloudflareCliConfigOnce};
|
package/dist/packem_shared/{COMPOSED_WORKER_ENTRY-BcFt6ts5.mjs → COMPOSED_WORKER_ENTRY-LpLlp-aF.mjs}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{existsSync as E,readFileSync as O}from"node:fs";import{parse as u}from"es-module-lexer";import{WRANGLER_FILES as b,readWranglerJsonc as f}from"./WRANGLER_FILES-
|
|
1
|
+
import{existsSync as E,readFileSync as O}from"node:fs";import{parse as u}from"es-module-lexer";import{WRANGLER_FILES as b,readWranglerJsonc as f}from"./WRANGLER_FILES-BF8PUjuo.mjs";import{escapeRegExp as S}from"./DEV_VARS_EXAMPLE_FILE-hBT89IXh.mjs";import{join as c}from"node:path";const g="_generated",x=["src/server.ts","src/server/index.ts","src/server/index.tsx","src/index.ts","src/worker.ts"],h=new Set(["build","coverage","dist",g,"node_modules","out","target"]),w=new Set([".client",".server"]),A=/[/\\]/u,T=t=>{const e=[];for(const r of t.split(A))r===""||r==="."||(r===".."&&e.length>0&&e.at(-1)!==".."?e.pop():e.push(r));return e},L=t=>T(t).slice(0,-1).some(e=>h.has(e)||e.startsWith(".")&&!w.has(e)),i={AdminRevocationDO:"ADMIN_REVOCATIONS",LunoraDO:"SHARD",SchedulerDO:"SCHEDULER",SessionDO:"SESSION",ShardDO:"SHARD",ShardRegistryDO:"SHARD_REGISTRY"},l=Object.keys(i),$=t=>Object.hasOwn(i,t),C="virtual:lunora/worker",d=["ShardDO"],J=["adminRevocations","agents","containers","scheduler","shardRegistry","workflows"],R={adminRevocations:"AdminRevocationDO",scheduler:"SchedulerDO",shardRegistry:"ShardRegistryDO"},D="LunoraDO",I=new Set([...d,...Object.values(R)]),N="durableObjects",y=t=>E(c(t,`${N}.ts`)),W=t=>Object.hasOwn(R,t),F=t=>y(t)?[D]:[...d,...Object.entries(R).filter(([e])=>E(c(t,`${e}.ts`))).map(([,e])=>e)],B=t=>t.includes(D)?t.filter(e=>!I.has(e)):[...t],U="src/worker.ts",Y=t=>{for(const e of b){const r=c(t,e);if(!E(r))continue;const{parsed:s}=f(r),o=s?.main;if(o===C)return{composed:!0};const a=c(t,U);if(E(a))return{composed:!1,path:a};if(typeof o=="string"&&!L(o)&&E(c(t,o)))return{composed:!1,path:c(t,o)};break}for(const e of x){const r=c(t,e);if(E(r))return{composed:!1,path:r}}return{composed:!1}},v=/(?:^|[\s,{])type$/u,m=(t,e)=>{const r=e.ls>=0?e.ls:e.s;return v.test(t.slice(0,r).trimEnd())},_=(t,e)=>{const r=S(e);return new RegExp(String.raw`\bexport\s+type\s+${r}\b`,"u").test(t)||new RegExp(String.raw`\bexport\s+type\s*\{[^}]*\b${r}\b`,"u").test(t)||new RegExp(String.raw`\bexport\s+\{[^}]*\btype\s+${r}\b`,"u").test(t)},H=t=>{const e=O(t,"utf8");let r;try{const[,s]=u(e);r=new Set(s.filter(o=>!m(e,o)).map(o=>o.n))}catch{r=new Set(l.filter(s=>new RegExp(String.raw`\bexport\b[^\n;]*\b${s}\b`,"u").test(e)&&!_(e,s)))}return B(l.filter(s=>r.has(s))).map(s=>({binding:i[s],className:s}))},K=(t,e,r)=>{if(e.length===0)return[];if(t.composed)return e.map(n=>({...n,exported:!0}));if(t.path===void 0)return e.map(n=>({...n,exported:!1}));const s=O(t.path,"utf8"),o=new RegExp(String.raw`\bexport\s*\*\s*from\s*["'][^"']*_generated\/${r}(?:\.js)?["']`).test(s);let a;try{const[,n]=u(s);a=new Set(n.filter(p=>!m(s,p)).map(p=>p.n))}catch{a=new Set(e.map(n=>n.className).filter(n=>new RegExp(String.raw`\bexport\b[^\n;]*\b${S(n)}\b`,"u").test(s)&&!_(s,n)))}return e.map(n=>{const p=o||a.has(n.className);return{...n,exported:p}})};export{d as COMPOSED_ENTRY_DURABLE_OBJECTS,U as COMPOSED_WORKER_ENTRY,i as DURABLE_OBJECT_BINDINGS,J as GENERATED_CLASS_MODULES,g as GENERATED_DIRECTORY,R as GENERATED_MODULE_DURABLE_OBJECTS,C as LUNORA_WORKER_VIRTUAL_ID,D as MERGED_DURABLE_OBJECT,N as MERGED_DURABLE_OBJECTS_MODULE,I as MERGED_ROLE_DURABLE_OBJECTS,h as NON_SOURCE_DIRECTORIES,w as SOURCE_DOT_DIRECTORIES,x as WORKER_ENTRY_FALLBACKS,B as collapseMergedDurableObjects,F as composedEntryDurableObjects,K as detectClassExports,H as detectExportedDurableObjects,$ as isFrameworkDurableObject,L as isGeneratedOutput,y as isMergedProject,W as isMergedRoleModule,Y as resolveWorkerEntry};
|
package/dist/packem_shared/{DEFAULT_DEPLOY_TARGET-DllYb7Tj.mjs → DEFAULT_DEPLOY_TARGET-CAJl2nEI.mjs}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as a}from"./celld-config-
|
|
1
|
+
import{p as a}from"./celld-config-CpvLkAEg.mjs";import s from"./CLOUDFLARE_DRIVER-DbmpoIcg.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"],["secretsFile","celld has no secret store — a value the app reads from env is a `vars` entry in the deployed config"],["outFile","`celld deploy` does not write its upload artifact 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)),i=(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)&&i(e).toolchain!==void 0,E=()=>d().filter(e=>g(e)),D=e=>i(e).toolchain?.devServer==="own",O=(e,o,r,c)=>{const n=e.projectConfig?.(o,r);return{command:c(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,i as resolveDeployDriver,E as runnableTargetIds,D as targetRunsOwnDevServer};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import{readFileSync as p}from"node:fs";import{parse as u}from"dotenv";const $=".dev.vars",f=".dev.vars.example",m=/^[A-Za-z_]\w*$/u,A=/\r?\n/u,l=e=>Object.entries(u(e)).map(([r,t])=>({key:r,value:t})),h=e=>{let r;try{r=p(e,"utf8")}catch(t){if(t.code==="ENOENT")return;throw t}return Object.fromEntries(l(r).map(({key:t,value:n})=>[t,n]))},L=e=>e===void 0?[".env",".env.local"]:[".env",".env.local",`.env.${e}`,`.env.${e}.local`],d=e=>l(e)[0],R=e=>e.replaceAll(/[.*+?^${}()|[\]\\]/gu,String.raw`\$&`),V=/(\r?\n)/u,v=(e,r,t)=>{const n=e.split(V),o=[];let a=!1;for(let s=0;s<n.length;s+=2){const c=n[s]??"",i=n[s+1]??"";if(d(c)?.key!==r){o.push(c,i);continue}const E=!a;a=!0,t!==void 0&&E&&o.push(t,i)}return{content:o.join(""),matched:a}},b=(e,r,t)=>{const n=`${r}="${t}"`,o=v(e,r,n);return o.matched?o.content:e===""?`${n}
|
|
2
|
+
`:e.endsWith(`
|
|
3
|
+
`)?`${e}${n}
|
|
4
|
+
`:`${e}
|
|
5
|
+
${n}
|
|
6
|
+
`},N=(e,r)=>v(e,r,void 0).content;export{f as DEV_VARS_EXAMPLE_FILE,$ as DEV_VARS_FILE,m as DEV_VARS_KEY_PATTERN,A as DEV_VARS_NEWLINE,R as escapeRegExp,l as parseDevVariableEntries,d as parseDevVariableLine,h as readDevVariablesRecord,N as removeDevVariableLine,b as upsertDevVariableLine,L as wranglerDotenvFiles};
|
package/dist/packem_shared/{DEV_WORKER_ENV_VALUE-DdPmCpf3.mjs → DEV_WORKER_ENV_VALUE-FoysLtF0.mjs}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{readFileSync as l}from"node:fs";import{findWranglerFile as m,readWranglerJsonc as E}from"./WRANGLER_FILES-
|
|
1
|
+
import{readFileSync as l}from"node:fs";import{findWranglerFile as m,readWranglerJsonc as E}from"./WRANGLER_FILES-BF8PUjuo.mjs";import{DEV_VARS_FILE as i,parseDevVariableEntries as V,upsertDevVariableLine as c}from"./DEV_VARS_EXAMPLE_FILE-hBT89IXh.mjs";import{writeDevVariablesFileAtomically as p}from"./buildPackageSecretsBlock-DrSD60vH.mjs";import{join as v}from"node:path";const n="WORKER_ENV",a="development",d=e=>{const r=m(e);return r===void 0?{}:E(r).parsed?.vars??{}},W=(e,r)=>{const o=v(e,i);let t;try{t=l(o,"utf8")}catch{return}V(t).some(s=>s.key===n)||n in d(e)||(p(o,c(t,n,a)),r(`set ${n}=${a} in ${i} so the dev worker runs in development mode`))};export{a as DEV_WORKER_ENV_VALUE,n as DEV_WORKER_ENV_VAR,W as ensureDevWorkerEnv};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const R=t=>{const r=String(t.name),s=String(t.message);return s===""?r:`${r}: ${s}`},u=t=>{if(typeof t=="string")return t;if(t instanceof Error)return R(t);try{return JSON.stringify(t)??String(t)}catch{return String(t)}};const E=t=>typeof t=="object"&&t!==null&&!Array.isArray(t),$=t=>E(t)&&typeof t.name=="string"&&typeof t.message=="string"?t:void 0,m=t=>{let r=t;if(typeof t=="string"){if(!t.startsWith("{")||!t.endsWith("}"))return;try{r=JSON.parse(t)}catch{return}}const s=$(r);return s!==void 0&&(typeof s.stack=="string"||s.cause!==void 0||Array.isArray(s.errors))?s:void 0},d=t=>t.message===""?t.name:`${t.name}: ${t.message}`,A=/^[\w$.]+$/u,_=t=>{if(typeof t.stack!="string")return[];let r=t.stack;const s=t.message===""?-1:r.indexOf(t.message),n=s===-1?"":r.slice(0,s);return s>0&&n.endsWith(": ")&&!n.includes(`
|
|
2
|
+
`)?r=r.slice(s+t.message.length):t.message===""&&A.test(r.split(`
|
|
3
|
+
`,1)[0]??"")&&(r=r.slice((r.split(`
|
|
4
|
+
`,1)[0]??"").length)),r.split(`
|
|
5
|
+
`).map(e=>e.trim()).filter(e=>e!=="")},h=(t,r,s=0)=>{const n=`${r} `,e=[d(t),..._(t).map(o=>`${n}${o}`)],i=(o,a)=>{const f=$(a);return f===void 0?`${r}${o}: ${u(a)}`:`${r}${o}: ${s>=4?d(f):h(f,n,s+1).join(`
|
|
6
|
+
`)}`};return Array.isArray(t.errors)&&t.errors.slice(0,10).forEach((o,a)=>{e.push(i(`errors[${String(a)}]`,o))}),t.cause!==void 0&&e.push(i("caused by",t.cause)),e},l=(t,r="")=>t.map(([s,n])=>`${r}${s}: ${h(n,`${r} `).join(`
|
|
7
|
+
`)}`).join(`
|
|
8
|
+
`);const S=t=>{if(typeof t!="string")return t;if(!(!(t.startsWith("{")&&t.endsWith("}"))&&!(t.startsWith("[")&&t.endsWith("]"))))try{return JSON.parse(t)}catch{return}},g=(t,r,s,n)=>{if(n.length>=10||s>=8||typeof t!="object"||t===null)return;const e=m(t);if(e!==void 0){n.push([r,e]);return}if(Array.isArray(t)){t.forEach((i,o)=>{g(i,`${r}[${String(o)}]`,s+1,n)});return}for(const[i,o]of Object.entries(t))g(o,`${r}.${i}`,s+1,n)},O=t=>{if(!E(t))return{errors:[],text:""};const r=[],s=[];for(const[n,e]of Object.entries(t)){const i=m(e);if(i===void 0){s.push(`${n}=${u(e)}`);const o=[];g(S(e),n,0,o),r.push(...o)}else r.push([n,i]),s.push(`${n}=${d(i)}`)}return{errors:r,text:s.join(" ")}},j="lunora",N="__root__",c=t=>typeof t=="string"?t:"",p=t=>Array.isArray(t)?t.filter(r=>typeof r=="string"):[],k=t=>typeof t=="number"&&Number.isFinite(t)?`${String(Math.round(t))}ms`:"?ms",M=t=>t==="error"||t==="fatal"?"error":t==="warn"?"warn":"info",b=t=>{const r=t.trim();if(!r.startsWith("{")||!r.endsWith("}"))return;let s;try{s=JSON.parse(r)}catch{return}if(typeof s!="object"||s===null)return;const n=s;return n.source===j?n:void 0},y=(t,r)=>{const s=c(r.shard);return s===""||s===N?t:`${t}@${s}`},D=(t,r)=>{const s=t.outcome==="error",n=[y(r,t),s?"error":"ok",k(t.durationMs)],e=p(t.tablesRead),i=p(t.tablesWritten);e.length>0&&n.push(`read[${e.join(",")}]`),i.length>0&&n.push(`write[${i.join(",")}]`),t.cacheHit===!0&&n.push("cached");const o=c(t.error);return s&&o!==""&&n.push(o),{kind:"rpc",level:s?"error":"info",text:n.join(" ")}},G=t=>{const r=c(t.container)||"<unknown>",s=c(t.instance),n=c(t.event)||"event",e=s===""||s==="unknown"?"":`#${s.slice(0,8)}`,i=c(t.message),o=[`container:${r}${e}`,n];return i!==""&&o.push(i),{kind:"log",level:t.event==="error"?"error":"info",text:o.join(" ")}},T=t=>{const r=b(t);if(!r)return;const s=c(r.function)||"<unknown>";if(r.type==="log"){const n=[`${y(s,r)} ${c(r.message)}`.trimEnd()],e=O(r.fields);e.text!==""&&n.push(e.text);const i=c(r.traceId);i!==""&&n.push(`trace=${i.slice(0,8)}`);const o=e.errors.length===0?"":`
|
|
9
|
+
${l(e.errors," ")}`;return{kind:"log",level:M(c(r.level)),text:n.join(" ")+o}}if(r.type==="request")return D(r,s);if(r.type==="container")return G(r)};export{j as LUNORA_EVENT_SOURCE,T as formatLunoraEvent};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{i}from"./secret-key-xi4VK8Jw.mjs";const p=[{description:"Bearer token the local Lunora Studio uses to call the worker's admin endpoints (data browser, schema edits) in dev. Generate with: openssl rand -hex 32",docsUrl:"https://lunora.sh/docs/packages/studio",key:"LUNORA_ADMIN_TOKEN",placeholderValue:"replace-with-openssl-rand-hex-32"}],o="LUNORA_RELAY_SECRET",r="replace-with-openssl-rand-hex-32",d=new Set(["@lunora/do:shardRegistry","@lunora/replica:eventLog"]),h="@lunora/replica:eventLogClient",u=["BETTER_AUTH_SECRET","STORAGE_SIGNING_SECRET"],l={"@lunora/auth":[{description:"32-byte random secret used to sign sessions and tokens. Generate with: openssl rand -hex 32",docsUrl:"https://lunora.sh/docs/packages/auth#secrets",key:"AUTH_SECRET",placeholderValue:"replace-with-openssl-rand-hex-32"},{description:"Public base URL of your worker (used by better-auth for redirects and cookie domain). For local dev this is typically http://localhost:8787",docsUrl:"https://lunora.sh/docs/packages/auth#secrets",key:"AUTH_URL",placeholderValue:"http://localhost:8787"}],"@lunora/agent:requestSecretTool":[{description:"AES-256 key that seals secret values held for one agent step, base64 of 32 bytes. Generate with: openssl rand -base64 32. Rotate by moving the old value to LUNORA_SECRET_VALUE_KEY_PREVIOUS first.",docsUrl:"https://lunora.sh/docs/packages/agent#secret-values",key:"LUNORA_SECRET_VALUE_KEY",placeholderValue:"<your-base64-32-byte-key>"}],"@lunora/do:shardRegistry":[{description:"Signs every request to ShardRegistryDO, which refuses unsigned ones, and the shard-to-shard control channel. Set the same value on the worker and every Durable Object. Generate with: openssl rand -hex 32",docsUrl:"https://lunora.sh/docs/concepts/sharding#the-shard-registry",key:o,placeholderValue:r}],"@lunora/bindings/r2sql":[{description:"Cloudflare API token with R2 SQL read access, for `ctx.r2sql`. Create at https://dash.cloudflare.com/profile/api-tokens with the R2 SQL permission.",docsUrl:"https://lunora.sh/docs/packages/bindings#r2-sql",key:"R2_SQL_TOKEN",placeholderValue:"<your-r2-sql-api-token>"},{description:"Cloudflare account id the R2 SQL queries run against. Falls back to CLOUDFLARE_ACCOUNT_ID when unset.",docsUrl:"https://lunora.sh/docs/packages/bindings#r2-sql",key:"R2_SQL_ACCOUNT_ID",placeholderValue:"<your-cloudflare-account-id>"},{description:"Name of the R2 bucket holding the Iceberg tables `ctx.r2sql` queries.",docsUrl:"https://lunora.sh/docs/packages/bindings#r2-sql",key:"R2_SQL_BUCKET",placeholderValue:"<your-r2-sql-bucket>"}],"@lunora/mail":[{description:"Resend API key for sending transactional email via @lunora/mail. Obtain at https://resend.com/api-keys",docsUrl:"https://lunora.sh/docs/packages/mail#secrets",key:"RESEND_API_KEY",placeholderValue:"<your-resend-api-key>"}],"@lunora/replica:eventLog":[{description:"Signs every request to EventLogDO, which refuses unsigned ones, and the calls from the worker that reads or appends the log. Set the same value on the worker and every Durable Object. Generate with: openssl rand -hex 32",docsUrl:"https://lunora.sh/docs/packages/replica#eventlogdo",key:o,placeholderValue:r}],"@lunora/replica:eventLogClient":[{description:"The LUNORA_RELAY_SECRET of the worker that hosts EventLogDO. EventLogDOClient throws at construction without it, and the log refuses every request signed with another value.",docsUrl:"https://lunora.sh/docs/packages/replica#eventlogdo",key:o,placeholderValue:"<your-eventlogdo-host-relay-secret>"}],"@lunora/notify:fcm":[{description:"Google service-account key file for FCM HTTP v1, base64-encoded on one line for .dev.vars (.dev.vars cannot hold its JSON quotes); in production use: wrangler secret put FCM_SERVICE_ACCOUNT < key.json. fcmFromEnv mints access tokens from it and reads the project id from it. Download it from the Firebase console (Project settings → Service accounts).",docsUrl:"https://lunora.sh/docs/packages/notify#fcm",key:"FCM_SERVICE_ACCOUNT",placeholderValue:"<base64-of-your-service-account-key-json>"}],"@lunora/notify:fcmTokenSource":[{description:"Firebase project id for FCM HTTP v1. Your fcm channel supplies its own getAccessToken, so only the project id comes from env. Find it in the Firebase console (Project settings).",docsUrl:"https://lunora.sh/docs/packages/notify#fcm",key:"FCM_PROJECT_ID",placeholderValue:"<your-firebase-project-id>"}],"@lunora/notify:webPush":[{description:"Public VAPID key (base64url) for Web Push. Generate a keypair once with: npx web-push generate-vapid-keys — the public key is also shipped to the browser to subscribe.",docsUrl:"https://lunora.sh/docs/packages/notify#web-push",key:"VAPID_PUBLIC_KEY",placeholderValue:"<your-vapid-public-key>"},{description:"Private VAPID key (base64url) for Web Push — the application-server signing key. Generate with: npx web-push generate-vapid-keys",docsUrl:"https://lunora.sh/docs/packages/notify#web-push",key:"VAPID_PRIVATE_KEY",placeholderValue:"<your-vapid-private-key>"},{description:"VAPID `sub` contact — a mailto: or https: URL identifying the application server (e.g. mailto:you@example.com).",docsUrl:"https://lunora.sh/docs/packages/notify#web-push",key:"VAPID_SUBJECT",placeholderValue:"mailto:you@example.com"}],"@lunora/payment/autumn":[{description:"Autumn secret key (am_sk_…) for the Autumn payment adapter. Obtain at https://app.useautumn.com/dev",docsUrl:"https://lunora.sh/docs/packages/payment#autumn",key:"AUTUMN_SECRET_KEY",placeholderValue:"<your-autumn-secret-key>"},{description:"Autumn webhook signing secret for verifying Standard Webhooks event payloads. Obtain from your Autumn dashboard webhook settings.",docsUrl:"https://lunora.sh/docs/packages/payment#autumn",key:"AUTUMN_WEBHOOK_SECRET",placeholderValue:"<your-autumn-webhook-secret>"}],"@lunora/payment/creem":[{description:"Creem API key for the Creem payment adapter. Obtain at https://www.creem.io/dashboard/developers",docsUrl:"https://lunora.sh/docs/packages/payment#creem",key:"CREEM_API_KEY",placeholderValue:"<your-creem-api-key>"},{description:"Creem webhook signing secret for verifying the creem-signature header. Obtain from your Creem dashboard webhook settings.",docsUrl:"https://lunora.sh/docs/packages/payment#creem",key:"CREEM_WEBHOOK_SECRET",placeholderValue:"<your-creem-webhook-secret>"}],"@lunora/payment/dodopayments":[{description:"Dodo Payments API key (bearer token) for the Dodo Payments adapter. Obtain at https://app.dodopayments.com/developer/api-keys",docsUrl:"https://lunora.sh/docs/packages/payment#dodo-payments",key:"DODO_PAYMENTS_API_KEY",placeholderValue:"<your-dodo-payments-api-key>"},{description:"Dodo Payments webhook signing secret (whsec_…) for verifying event payloads. Obtain at https://app.dodopayments.com/developer/webhooks",docsUrl:"https://lunora.sh/docs/packages/payment#dodo-payments",key:"DODO_PAYMENTS_WEBHOOK_KEY",placeholderValue:"<your-dodo-payments-webhook-secret>"}],"@lunora/payment/polar":[{description:"Polar access token for the Polar payment adapter. Obtain at https://polar.sh/settings/tokens",docsUrl:"https://lunora.sh/docs/packages/payment#polar",key:"POLAR_ACCESS_TOKEN",placeholderValue:"<your-polar-access-token>"},{description:"Polar webhook secret for verifying event payloads from Polar. Obtain at https://polar.sh/settings/webhooks",docsUrl:"https://lunora.sh/docs/packages/payment#polar",key:"POLAR_WEBHOOK_SECRET",placeholderValue:"<your-polar-webhook-secret>"}],"@lunora/payment/stripe":[{description:"Stripe secret key (sk_test_…). Required when using the Stripe adapter. Obtain at https://dashboard.stripe.com/apikeys",docsUrl:"https://lunora.sh/docs/packages/payment#stripe",key:"STRIPE_SECRET_KEY",placeholderValue:"<your-stripe-secret-key>"},{description:"Stripe webhook signing secret (whsec_…) for verifying event payloads. Obtain at https://dashboard.stripe.com/webhooks",docsUrl:"https://lunora.sh/docs/packages/payment#stripe",key:"STRIPE_WEBHOOK_SECRET",placeholderValue:"<your-stripe-webhook-secret>"}]},n=new Set([...u,...[...p,...Object.values(l).flat()].filter(e=>i(e.key)&&!e.placeholderValue.startsWith("<")&&e.key!==o).map(e=>e.key)]),k=e=>e.includes(h)&&!e.some(t=>d.has(t))?n:new Set([...n,o]),E=e=>{const s=[];for(const t of e)for(const a of l[t]??[])s.some(c=>c.key===a.key)||s.push(a);return s};export{p as CORE_SECRETS,n as MINTABLE_SECRET_KEYS,l as PACKAGE_SECRETS_REGISTRY,r as SHARD_RELAY_HOST_PLACEHOLDER,o as SHARD_RELAY_SECRET_KEY,k as mintableSecretKeysFor,E as secretsForPackages};
|
|
@@ -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 h,resolveServerModule as l,wireRlsIntoProcedure as v}from"./classifyPolicyEdit-DJi9Fk8G.mjs";import{w as c,r as b}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 h,resolveServerModule as l,wireRlsIntoProcedure as v}from"./classifyPolicyEdit-DJi9Fk8G.mjs";import{w as c,r as b}from"./write-atomic-CcNMkFsX.mjs";const D="/__lunora/policy-scaffold",u=r=>r==="unknown-procedure"?404:r==="already-wired"||r==="destructive"?409:422,f=(r,o,e)=>{let t;try{t=b(r,o)}catch(n){return{body:{error:n instanceof Error?n.message:String(n),ok:!1},status:500}}return{body:{...e,diagnostics:t,ok:!0},status:200}},g=r=>({body:{edit:r,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=(r,o)=>{const e=h(o,l(r.projectRoot));if(!e.ok)return{body:{error:e.reason,ok:!1},status:u(e.reason)};const t=r.schemaDirectory??"lunora",n=s(r.projectRoot,t,e.fileName);return d(n)?{body:{error:"file-exists",fileName:e.fileName,ok:!1},status:409}:(c(n,e.source),f(r,{path:n,text:e.source},{fileName:e.fileName}))},R=(r,o,e)=>{if(typeof e!="string"||e.length===0||a(e)||e.includes("\\"))return;const t=s(r,o),n=s(t,`${e}.ts`),i=m(t,n);if(!(i.startsWith("..")||a(i)))return n},N=(r,o)=>{const e=R(r.projectRoot,r.schemaDirectory??"lunora",o.filePath);if(e===void 0||!d(e))return{body:{error:"unknown-procedure",ok:!1},status:404};const t=v(y(e,"utf8"),o,l(r.projectRoot));return t.ok?(c(e,t.text),f(r,{path:e,text:t.text},{exportName:o.exportName})):{body:{error:t.reason,ok:!1},status:u(t.reason)}},E=r=>{if(r.method!=="POST")return{body:{error:"method-not-allowed",ok:!1},status:405};const{body:o}=r;if(o==null||typeof o!="object"||typeof o.kind!="string")return{body:{error:"invalid-edit",ok:!1},status:400};const e=o;if(k(e)==="destructive")return g(e);if(e.kind==="scaffoldPolicy")return w(r,e);if(e.kind==="wireRls")return N(r,e);throw new p("INTERNAL",`unhandled additive policy edit kind: ${String(e.kind)}`)};export{D as POLICY_SCAFFOLD_ENDPOINT,E as handlePolicyScaffoldRequest};
|