@lunora/config 1.0.0-alpha.42 → 1.0.0-alpha.421

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. package/LICENSE.md +135 -0
  2. package/README.md +3 -3
  3. package/dist/cli/index.d.mts +2 -0
  4. package/dist/cli/index.d.ts +2 -0
  5. package/dist/cli/index.mjs +1 -0
  6. package/dist/cloudflare/index.d.mts +1307 -0
  7. package/dist/cloudflare/index.d.ts +1307 -0
  8. package/dist/cloudflare/index.mjs +1 -0
  9. package/dist/index.d.mts +962 -974
  10. package/dist/index.d.ts +962 -974
  11. package/dist/index.mjs +1 -23
  12. package/dist/packem_shared/ACCENT-CotPTfv7.mjs +7 -0
  13. package/dist/packem_shared/AGENT_MODE_ENV-D8MvSwPE.mjs +1 -0
  14. package/dist/packem_shared/AGENT_RULES_DIR-Bd6JPtNa.mjs +1 -0
  15. package/dist/packem_shared/ALLOW_FORWARDED_ENV-BUndghJx.mjs +1 -0
  16. package/dist/packem_shared/BINDING_MANIFEST_VERSION-CfXEYG8e.mjs +1 -0
  17. package/dist/packem_shared/BUILD_ROOT_ENV-Dg4MV3wY.mjs +1 -0
  18. package/dist/packem_shared/CLOUDFLARE_CLI_CONFIG_WARNING_ENV-BKMrOuXV.mjs +1 -0
  19. package/dist/packem_shared/CLOUDFLARE_DRIVER-CULavrYO.mjs +1 -0
  20. package/dist/packem_shared/CLOUDFLARE_TOOLCHAIN_VERSIONS-DV5E_f_q.mjs +1 -0
  21. package/dist/packem_shared/COMPOSED_WORKER_ENTRY-Ciiba5g_.mjs +1 -0
  22. package/dist/packem_shared/D1_PLACEHOLDER_ID-ZnDjVymH.mjs +1 -0
  23. package/dist/packem_shared/DEFAULT_DEPLOY_TARGET-CuEMuxSY.mjs +1 -0
  24. package/dist/packem_shared/DEFAULT_OBSERVABILITY-bN6UkTMx.mjs +1 -0
  25. package/dist/packem_shared/DEV_BINDINGS_FILE-C0ZN_XlP.mjs +4 -0
  26. package/dist/packem_shared/DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs +6 -0
  27. package/dist/packem_shared/DEV_WORKER_ENV_VALUE-CgozgOxh.mjs +1 -0
  28. package/dist/packem_shared/GLOBAL_FETCH_STRICTLY_PUBLIC_FLAG-f8CnJha3.mjs +1 -0
  29. package/dist/packem_shared/LINKED_PROJECT_DIR-Ba5qPEwo.mjs +2 -0
  30. package/dist/packem_shared/LUNORA_EVENT_SOURCE-B9ZVohjO.mjs +1 -0
  31. package/dist/packem_shared/LUNORA_IGNORED_PATHS-U93uPxrW.mjs +19 -0
  32. package/dist/packem_shared/LUNORA_TAG-DQTGPqcJ.mjs +1 -0
  33. package/dist/packem_shared/LunoraReporter-f277GLNT.mjs +6 -0
  34. package/dist/packem_shared/MissingBuildOutputError-BAyekzof.mjs +1 -0
  35. package/dist/packem_shared/PACKAGE_SECRETS_REGISTRY-ByJhGJMf.mjs +1 -0
  36. package/dist/packem_shared/POLICY_SCAFFOLD_ENDPOINT-D5PpQPkf.mjs +1 -0
  37. package/dist/packem_shared/REMOTE_ELIGIBLE_KEYS-CuhB99R2.mjs +1 -0
  38. package/dist/packem_shared/REQUIRED_COMPATIBILITY_DATE-D4UcOP_t.mjs +1 -0
  39. package/dist/packem_shared/SCHEMA_EDIT_ENDPOINT-CtxWqfDe.mjs +1 -0
  40. package/dist/packem_shared/SEED_ENDPOINT-C1fhrehH.mjs +1 -0
  41. package/dist/packem_shared/STUDIO_PATH-Dc-3nLO6.mjs +1 -0
  42. package/dist/packem_shared/STUDIO_WRITE_TEMP_SUFFIX-BTTELz3K.mjs +1 -0
  43. package/dist/packem_shared/UNEXPORTED_CLASS_MARKER-BV29zhUp.mjs +1 -0
  44. package/dist/packem_shared/WORKERS_CACHE_MIN_DATE-0k9ABJtF.mjs +1 -0
  45. package/dist/packem_shared/WRANGLER_FILES-UNW-xY5u.mjs +1 -0
  46. package/dist/packem_shared/acceptsConnection-DHhUYGjT.mjs +2 -0
  47. package/dist/packem_shared/addArgsFor-CYZKhNIo.mjs +1 -0
  48. package/dist/packem_shared/applyAdditiveEdit-DEwPKcJg.mjs +6 -0
  49. package/dist/packem_shared/applyModify-DKP2l6S9.mjs +1 -0
  50. package/dist/packem_shared/assertBuildTargetMatches-C58Lo9HU.mjs +1 -0
  51. package/dist/packem_shared/assertWranglerSatisfiesSchema-A2WCMIRa.mjs +3 -0
  52. package/dist/packem_shared/assetContentType-CUb5bpbI.mjs +1 -0
  53. package/dist/packem_shared/bindingsNeedingDatabase-6eD6Qtqf.mjs +3 -0
  54. package/dist/packem_shared/blockingFindingsMessage-CRbg1sla.mjs +1 -0
  55. package/dist/packem_shared/buildPackageSecretsBlock-GvaLgvFN.mjs +19 -0
  56. package/dist/packem_shared/canonicalPath-DrfMiT3U.mjs +1 -0
  57. package/dist/packem_shared/celld-binding-id-9MiUoteo.mjs +1 -0
  58. package/dist/packem_shared/celld-config-DoBVipuN.mjs +3 -0
  59. package/dist/packem_shared/classifyPolicyEdit-DJi9Fk8G.mjs +24 -0
  60. package/dist/packem_shared/clearApiSpecMarker-DMGpP41V.mjs +2 -0
  61. package/dist/packem_shared/collectExportGaps-zmra4uTS.mjs +2 -0
  62. package/dist/packem_shared/createConfirm-D5mKTMHj.mjs +7 -0
  63. package/dist/packem_shared/createDiscoveryCache-npJI4uej.mjs +1 -0
  64. package/dist/packem_shared/createStudioDocumentCache-B3Sf1bIl.mjs +1 -0
  65. package/dist/packem_shared/deploy-driver.d-DraUd2R2.d.mts +186 -0
  66. package/dist/packem_shared/deploy-driver.d-DraUd2R2.d.ts +186 -0
  67. package/dist/packem_shared/describePreservedCrons-C5KPuPy3.mjs +1 -0
  68. package/dist/packem_shared/describeWithheld-CbyzZjZF.mjs +1 -0
  69. package/dist/packem_shared/detectFramework-Dfpvu6rD.mjs +1 -0
  70. package/dist/packem_shared/devVariablesStamp-Cetr3qFz.mjs +1 -0
  71. package/dist/packem_shared/discover-info-DC2MrAIM.mjs +1 -0
  72. package/dist/packem_shared/discoverAgentInfo-pqFMJBtJ.mjs +1 -0
  73. package/dist/packem_shared/discoverContainerInfo-DzXr7Vm3.mjs +1 -0
  74. package/dist/packem_shared/discoverSchemaInfo-DRPnqgif.mjs +1 -0
  75. package/dist/packem_shared/discoverWorkflowInfo-zW7Tt0Tn.mjs +1 -0
  76. package/dist/packem_shared/ensureGitignoreEntries-Tsk8Qkw7.mjs +7 -0
  77. package/dist/packem_shared/guards-Buu_E7mP.mjs +1 -0
  78. package/dist/packem_shared/hasCloudflareCredentials-Bak5w1_6.mjs +1 -0
  79. package/dist/packem_shared/index.d-DSqsbmlq.d.mts +270 -0
  80. package/dist/packem_shared/index.d-sZ22Dkwr.d.ts +270 -0
  81. package/dist/packem_shared/infer-bindings.d-BUdWC3tw.d.mts +323 -0
  82. package/dist/packem_shared/infer-bindings.d-BUdWC3tw.d.ts +323 -0
  83. package/dist/packem_shared/inferLunoraBindings-DvB8IpbN.mjs +1 -0
  84. package/dist/packem_shared/lunora-manifest-DuH_Cmyu.mjs +6 -0
  85. package/dist/packem_shared/materializeServiceDevConfigs-qUY4_iu1.mjs +1 -0
  86. package/dist/packem_shared/mergeWranglerEnvironment-D5ekKj5x.mjs +1 -0
  87. package/dist/packem_shared/package-secrets-registry-UQ_uEAB_.mjs +1 -0
  88. package/dist/packem_shared/parseSchema-D1Wbr1qv.mjs +1 -0
  89. package/dist/packem_shared/policy-scaffold.d-D2H4_G01.d.mts +86 -0
  90. package/dist/packem_shared/policy-scaffold.d-D2H4_G01.d.ts +86 -0
  91. package/dist/packem_shared/probeCelldToolchain-DxDttfHy.mjs +1 -0
  92. package/dist/packem_shared/process-tree-once-Ou4SfxKM.mjs +1 -0
  93. package/dist/packem_shared/readProjectDependencies-l3uhUKjo.mjs +1 -0
  94. package/dist/packem_shared/reconcile-services-DFqH4eMQ.mjs +1 -0
  95. package/dist/packem_shared/reconcileBindingsSafely-Dh2MIIWG.mjs +1 -0
  96. package/dist/packem_shared/reconcileWranglerCompatibilityDate-hocXEuRA.mjs +1 -0
  97. package/dist/packem_shared/renderStudioHtml-ByowDtMl.mjs +15 -0
  98. package/dist/packem_shared/resolveSchemaDirectory-Ca5P6KuP.mjs +1 -0
  99. package/dist/packem_shared/runPostCodegenHook-Dx3yTsYZ.mjs +1 -0
  100. package/dist/packem_shared/scanWranglerVariablesForSecrets-DRBYlMYb.mjs +1 -0
  101. package/dist/packem_shared/sendStudioAsset-XBmVLqiI.mjs +1 -0
  102. package/dist/packem_shared/serveJsonHandler-B8_GE6QC.mjs +1 -0
  103. package/dist/packem_shared/startCelldDevSession-BKRiLvt-.mjs +1 -0
  104. package/dist/packem_shared/streamContainerLogs-0nko1qpv.mjs +2 -0
  105. package/dist/packem_shared/validate-bindings-PVHSAU6M.mjs +1 -0
  106. package/dist/packem_shared/withTailConsumer-CF3pk_Ov.mjs +1 -0
  107. package/dist/packem_shared/worker-entry-checks-AIASCYl7.mjs +1 -0
  108. package/dist/packem_shared/wranglerCodegenInputs-BZamZrPz.mjs +1 -0
  109. package/dist/packem_shared/wranglerToAlchemy-CBO2ucRm.mjs +6 -0
  110. package/dist/packem_shared/write-atomic-DRRKWKF-.mjs +3 -0
  111. package/dist/studio-host/index.d.mts +366 -112
  112. package/dist/studio-host/index.d.ts +366 -112
  113. package/dist/studio-host/index.mjs +1 -7
  114. package/package.json +32 -7
  115. package/dist/packem_shared/ACCENT-DW1XJn8i.mjs +0 -40
  116. package/dist/packem_shared/AGENT_RULES_DIR-lcgC08aE.mjs +0 -40
  117. package/dist/packem_shared/DEV_VARS_EXAMPLE_FILE-dJPNTEnK.mjs +0 -37
  118. package/dist/packem_shared/LINKED_PROJECT_DIR-CXwXzV_C.mjs +0 -52
  119. package/dist/packem_shared/LUNORA_CONFIG_FILE-CtcIcB5-.mjs +0 -34
  120. package/dist/packem_shared/LUNORA_EVENT_SOURCE-D2fDeGB6.mjs +0 -86
  121. package/dist/packem_shared/LunoraReporter-Ci-bDCK9.mjs +0 -70
  122. package/dist/packem_shared/PACKAGE_SECRETS_REGISTRY-B8t_SdoZ.mjs +0 -70
  123. package/dist/packem_shared/POLICY_SCAFFOLD_ENDPOINT-CiC2IGKx.mjs +0 -103
  124. package/dist/packem_shared/REMOTE_ELIGIBLE_KEYS-BC7_e9Bz.mjs +0 -105
  125. package/dist/packem_shared/REQUIRED_COMPATIBILITY_DATE-2YYyWJUq.mjs +0 -561
  126. package/dist/packem_shared/SCHEMA_EDIT_ENDPOINT-Df-Wrix-.mjs +0 -99
  127. package/dist/packem_shared/SEED_ENDPOINT-DVCjaGO-.mjs +0 -61
  128. package/dist/packem_shared/WRANGLER_FILES-DwSuC-Kn.mjs +0 -25
  129. package/dist/packem_shared/applyAdditiveEdit-C-snTFEV.mjs +0 -228
  130. package/dist/packem_shared/buildPackageSecretsBlock-BCHtfQ2A.mjs +0 -280
  131. package/dist/packem_shared/classifyPolicyEdit-BHeAqF8P.mjs +0 -99
  132. package/dist/packem_shared/createConfirm-fvpdgJ9s.mjs +0 -100
  133. package/dist/packem_shared/detectFramework-Br-BcPBq.mjs +0 -41
  134. package/dist/packem_shared/discoverContainerInfo-BXFs6Wav.mjs +0 -19
  135. package/dist/packem_shared/discoverSchemaInfo-BB-CKlTK.mjs +0 -25
  136. package/dist/packem_shared/discoverWorkflowInfo-CedvR0mn.mjs +0 -19
  137. package/dist/packem_shared/inferLunoraBindings-ByMwG-gH.mjs +0 -352
  138. package/dist/packem_shared/loadStudioAssets-Csk5RS4E.mjs +0 -28
  139. package/dist/packem_shared/parseDevVariable-CJiq2IwE.mjs +0 -30
  140. package/dist/packem_shared/parseSchema-DSeyktvG.mjs +0 -107
  141. package/dist/packem_shared/policy-scaffold.d-DCmwn7zQ.d.mts +0 -74
  142. package/dist/packem_shared/policy-scaffold.d-DCmwn7zQ.d.ts +0 -74
  143. package/dist/packem_shared/reconcileWranglerBindings-Cruwwx1M.mjs +0 -334
  144. package/dist/packem_shared/renderStudioHtml-449Ysn75.mjs +0 -37
  145. package/dist/packem_shared/serveJsonHandler-B4OLTGLS.mjs +0 -86
  146. package/dist/packem_shared/streamContainerLogs-BZ4cOZwH.mjs +0 -157
@@ -1,15 +1,54 @@
1
- import { D as DestructivePolicyEdit, S as ScaffoldPolicyEdit, W as WireRlsEdit } from "../packem_shared/policy-scaffold.d-DCmwn7zQ.js";
2
1
  import { IncomingMessage, ServerResponse } from 'node:http';
3
- /** Parse a single `KEY=value` (optionally quoted) out of a `.dev.vars` body. */
2
+ import { CodegenOptions } from '@lunora/codegen';
3
+ import { D as DestructivePolicyEdit, S as ScaffoldPolicyEdit, W as WireRlsEdit } from "../packem_shared/policy-scaffold.d-D2H4_G01.js";
4
+ /**
5
+ * Parse a single `KEY=value` (optionally quoted) out of a `.dev.vars` body,
6
+ * returning `undefined` when the key is absent or its value is empty. A thin
7
+ * wrapper over {@link parseDevVariableEntries} — the single owner of the
8
+ * `.dev.vars` line grammar — so the key-validation, comment-skip, and quote-strip
9
+ * rules can't drift from every other reader/writer of the file.
10
+ */
4
11
  declare const parseDevVariable: (contents: string, key: string) => string | undefined;
5
12
  /**
6
- * Resolve the worker's admin token so the studio can auto-authenticate in
7
- * dev. Prefers the `LUNORA_ADMIN_TOKEN` env var, then the project's `.dev.vars`
8
- * — the same file `@cloudflare/vite-plugin` / `wrangler dev` feed the worker, so
9
- * the token the studio sends matches the one the worker's admin gate
10
- * verifies. Returns `undefined` when neither is set (the studio then prompts).
11
- */
13
+ * Resolve the worker's admin token so the studio can auto-authenticate in dev.
14
+ *
15
+ * The ONLY source is the project's `.dev.vars` — the file
16
+ * `@cloudflare/vite-plugin` / `wrangler dev` feed the local worker, and
17
+ * therefore the only token the worker's admin gate can verify. A shell-exported
18
+ * `LUNORA_ADMIN_TOKEN` (the documented way to run `lunora backup` /
19
+ * `lunora deploy --migrate` against **production**) never reaches the local
20
+ * worker's `env`, so embedding it would both fail the gate and put a production
21
+ * bearer into every `/__lunora` document served on the developer's machine.
22
+ * When the two disagree we say so once and keep using `.dev.vars`.
23
+ *
24
+ * Returns `undefined` when `.dev.vars` carries no token (the studio then prompts).
25
+ */
12
26
  declare const resolveAdminToken: (root: string) => string | undefined;
27
+ /**
28
+ * A cheap change stamp for the project's `.dev.vars` (`"0"` when absent), so a
29
+ * host that caches the Studio document can re-render it when the admin token is
30
+ * edited mid-session instead of embedding the one read at startup.
31
+ */
32
+ declare const devVariablesStamp: (root: string) => string;
33
+ /**
34
+ * Send a studio static asset (the stylesheet, the `studio.js` entry, a chunk or
35
+ * a source map): cache headers and `304` via {@link applyStudioAssetCache}, then
36
+ * the body — brotli- or gzip-compressed when the client accepts it. Neither the
37
+ * Vite dev server nor `lunora dev` compresses on its own, so without this the
38
+ * studio's first load is the full raw bundle.
39
+ *
40
+ * `Vary: Accept-Encoding` is set on every answer, `304` included, so a cache
41
+ * never hands a compressed body to a client that didn't ask for one. The weak
42
+ * ETag is shared across encodings: a weak tag means "semantically equivalent",
43
+ * which a re-encoding is (the convention nginx follows too).
44
+ */
45
+ declare const sendStudioAsset: (request: IncomingMessage, response: ServerResponse, body: Buffer, contentType: string, fileName: string, stamp: number | undefined) => void;
46
+ /**
47
+ * Send the studio's SPA document. It embeds the admin token, so it is
48
+ * `no-store` — not merely revalidated — and carries no ETag: a cached `304` for
49
+ * a token-bearing document would be its own bug.
50
+ */
51
+ declare const sendStudioDocument: (response: ServerResponse, body: Buffer | string) => void;
13
52
  /** Config injected into the studio document before the bundle loads. */
14
53
  interface StudioHtmlConfig {
15
54
  /** Admin token sent with admin requests; omitted (and not injected) when unset. */
@@ -17,34 +56,34 @@ interface StudioHtmlConfig {
17
56
  /** Router basepath the studio mounts under (e.g. `/__lunora`, or `/` for a root server). */
18
57
  readonly basePath: string;
19
58
  /**
20
- * Make the data browser editable (insert/edit/delete rows). Injected as
21
- * `window.__LUNORA_DATA_EDITABLE__` for the bundle to read. The loopback-only
22
- * dev hosts (the Vite `/__lunora` route, the CLI studio server) set this so a
23
- * developer can edit; a static deploy leaves it off (read-only) by default.
24
- */
59
+ * Make the data browser editable (insert/edit/delete rows). Injected as
60
+ * `window.__LUNORA_DATA_EDITABLE__` for the bundle to read. The loopback-only
61
+ * dev hosts (the Vite `/__lunora` route, the CLI studio server) set this so a
62
+ * developer can edit; a static deploy leaves it off (read-only) by default.
63
+ */
25
64
  readonly dataEditable?: boolean;
26
65
  /**
27
- * Whether the project's Lunora agent skills ("rules") are installed. Injected
28
- * as `window.__LUNORA_RULES_INSTALLED__` **only when `false`**, so the studio
29
- * shows a "rules not installed" banner on the loopback dev hosts (which detect
30
- * it) and stays quiet on a static deploy (which leaves it unset).
31
- */
66
+ * Whether the project's Lunora agent skills ("rules") are installed. Injected
67
+ * as `window.__LUNORA_RULES_INSTALLED__` **only when `false`**, so the studio
68
+ * shows a "rules not installed" banner on the loopback dev hosts (which detect
69
+ * it) and stays quiet on a static deploy (which leaves it unset).
70
+ */
32
71
  readonly rulesInstalled?: boolean;
33
72
  /**
34
- * Enable the function runner's "Run as identity" tool (execute a function as a
35
- * chosen user to test auth/RLS). Injected as `window.__LUNORA_RUN_AS_IDENTITY__`.
36
- * Like {@link StudioHtmlConfig.dataEditable}, only the loopback-only dev hosts set
37
- * this — forging an identity is a developer-only affordance; a static deploy
38
- * leaves it off so the control never renders.
39
- */
73
+ * Enable the function runner's "Run as identity" tool (execute a function as a
74
+ * chosen user to test auth/RLS). Injected as `window.__LUNORA_RUN_AS_IDENTITY__`.
75
+ * Like {@link StudioHtmlConfig.dataEditable}, only the loopback-only dev hosts set
76
+ * this — forging an identity is a developer-only affordance; a static deploy
77
+ * leaves it off so the control never renders.
78
+ */
40
79
  readonly runAsIdentity?: boolean;
41
80
  /**
42
- * Enable the visual schema editor (add table / column / index, written back to
43
- * `lunora/schema.ts` + codegen). Injected as `window.__LUNORA_SCHEMA_EDITABLE__`.
44
- * Like {@link StudioHtmlConfig.dataEditable}, only the loopback-only dev hosts
45
- * set this — editing source + running codegen needs the project's filesystem and
46
- * toolchain, so a static deploy leaves it off and the diagram stays read-only.
47
- */
81
+ * Enable the visual schema editor (add table / column / index, written back to
82
+ * `lunora/schema.ts` + codegen). Injected as `window.__LUNORA_SCHEMA_EDITABLE__`.
83
+ * Like {@link StudioHtmlConfig.dataEditable}, only the loopback-only dev hosts
84
+ * set this — editing source + running codegen needs the project's filesystem and
85
+ * toolchain, so a static deploy leaves it off and the diagram stays read-only.
86
+ */
48
87
  readonly schemaEditable?: boolean;
49
88
  /** URL the studio bundle is served from (absolute, host-relative). */
50
89
  readonly scriptSrc: string;
@@ -61,30 +100,163 @@ interface StudioAssets {
61
100
  readonly styles: Buffer;
62
101
  }
63
102
  /**
64
- * Read the prebuilt static studio files shipped by `@lunora/studio`
65
- * (`dist/standalone/studio.js` + `dist/styles.css`). Returns `undefined` —
66
- * with a one-time warning — when the optional package isn't installed or hasn't
67
- * been built, so a missing studio never breaks the dev server.
68
- *
69
- * `resolveFrom` controls where `@lunora/studio` is resolved from. It defaults
70
- * to this module's own location, which is correct once this code is inlined into
71
- * a host package (`@lunora/vite` / `@lunora/cli`) that has `@lunora/studio`
72
- * installed — node walks up from the host's `dist` to find it.
73
- */
103
+ * Read the prebuilt static studio files shipped by `@lunora/studio`
104
+ * (`dist/standalone/studio.js` + `dist/styles.css`). Returns `undefined` —
105
+ * with a one-time warning — when the optional package isn't installed or hasn't
106
+ * been built, so a missing studio never breaks the dev server.
107
+ *
108
+ * `resolveFrom` controls where `@lunora/studio` is resolved from. It defaults
109
+ * to this module's own location, which is correct once this code is inlined into
110
+ * a host package (`@lunora/vite` / `@lunora/cli`) that has `@lunora/studio`
111
+ * installed — node walks up from the host's `dist` to find it.
112
+ */
74
113
  declare const loadStudioAssets: (logger?: WarnLogger, resolveFrom?: string) => StudioAssets | undefined;
75
114
  /**
76
- * A freshness stamp for the studio assets: the latest mtime (ms) of the resolved
77
- * `studio.js` / `styles.css`, or `undefined` when they can't be resolved. Hosts
78
- * cache {@link loadStudioAssets} for the dev session but compare this stamp per
79
- * request, so a `@lunora/studio` rebuild mid-session is picked up live — no dev
80
- * server restart needed.
81
- */
115
+ * A freshness stamp for the studio assets: the latest mtime (ms) of the resolved
116
+ * `studio.js` / `styles.css`, or `undefined` when they can't be resolved. Hosts
117
+ * cache {@link loadStudioAssets} for the dev session but compare this stamp per
118
+ * request, so a `@lunora/studio` rebuild mid-session is picked up live — no dev
119
+ * server restart needed.
120
+ */
82
121
  declare const studioAssetsStamp: (resolveFrom?: string) => number | undefined;
83
122
  /**
84
- * Endpoint path both dev hosts mount the handler at. A sibling of the schema
85
- * editor's `/__lunora/schema-edit`; the double underscore keeps it clear of the
86
- * CLI's `/_lunora/*` worker proxy (single underscore).
87
- */
123
+ * Absolute path of the built standalone directory — `@lunora/studio`'s
124
+ * `dist/standalone`, where the `studio.js` entry and its code-split `chunk-*.js`
125
+ * siblings live — or `undefined` when the studio isn't installed/built. The
126
+ * standalone bundle is emitted with esbuild `splitting`, so the hosts must serve
127
+ * the whole directory (not two fixed paths); this resolves its root.
128
+ */
129
+ declare const resolveStandaloneDirectory: (resolveFrom?: string) => string | undefined;
130
+ /**
131
+ * Read a single file from the standalone directory by its plain filename (the
132
+ * `studio.js` entry, a `chunk-*.js`, or a `.map`). **Path-traversal-safe** via
133
+ * {@link resolveContainedFile}: only a lone filename resolving to a direct child
134
+ * of the standalone directory is served — any separator, `..`, NUL, or absolute
135
+ * path is rejected — so a request like `../../etc/passwd` can never escape it.
136
+ * Returns the bytes, or `undefined` when the studio isn't built or the name
137
+ * doesn't resolve to a file inside the directory (the host answers that 404).
138
+ */
139
+ declare const readStandaloneAsset: (fileName: string, resolveFrom?: string) => Buffer | undefined;
140
+ /**
141
+ * True when `pathname` addresses a standalone JS module — the `studio.js` entry
142
+ * or one of its code-split `chunk-*.js` siblings (and their `.map`s). Shared by
143
+ * the CLI and Vite hosts so both route the same request shapes to the directory
144
+ * server; the stylesheet is matched separately at each host's own style path.
145
+ */
146
+ declare const isStandaloneModulePath: (pathname: string) => boolean;
147
+ /**
148
+ * Content-Type for a served standalone asset, by extension: `.css` → CSS,
149
+ * `.map` → JSON (a source map), everything else (the `.js` entry + chunks) →
150
+ * JavaScript. Shared by the CLI and Vite hosts so the MIME decision lives in one
151
+ * place.
152
+ */
153
+ declare const assetContentType: (fileName: string) => string;
154
+ /**
155
+ * Cache a studio host's rendered document, re-rendering it whenever `.dev.vars`
156
+ * under `root` changes. The document embeds the admin token, which is edited
157
+ * mid-session (rotation, the first `lunora dev` run writing it), so a document
158
+ * cached past such an edit would hand the studio a token the worker rejects.
159
+ *
160
+ * Every call costs one `stat` ({@link devVariablesStamp}); `render` runs on the
161
+ * first call and again only after the stamp moves. The stamp is taken before
162
+ * `render` reads the file, so a write landing between the two is seen as a
163
+ * change on the next call rather than cached under the newer stamp.
164
+ */
165
+ declare const createStudioDocumentCache: <T>(root: string, render: () => T) => (() => T);
166
+ /**
167
+ * The host's project configuration, forwarded verbatim to the handler. Separate
168
+ * from `projectRoot` (which every host has) because these two come from the
169
+ * host's own Lunora options.
170
+ */
171
+ interface LocalEndpointContext {
172
+ /** API-spec mode the host runs codegen with, so a studio edit regenerates the same spec files. */
173
+ readonly apiSpec?: CodegenOptions["apiSpec"];
174
+ /** Lazy function mode the host runs codegen with, so a studio edit preserves the generated registry. */
175
+ readonly lazyFunctions?: CodegenOptions["lazyFunctions"];
176
+ /** Override the lunora subdirectory name. Defaults to `"lunora"`. */
177
+ readonly schemaDirectory?: string;
178
+ }
179
+ /** A request adapted from a host transport, passed to a local-dev handler. */
180
+ interface LocalEndpointRequest extends LocalEndpointContext {
181
+ /** Parsed JSON body of the request (`undefined` for `GET` / an empty body). */
182
+ readonly body?: unknown;
183
+ /** HTTP method. */
184
+ readonly method: string;
185
+ /** Project root containing the `lunora/` directory. */
186
+ readonly projectRoot: string;
187
+ }
188
+ /** A response a local-dev handler returns, serialised back as JSON with its status. */
189
+ interface LocalEndpointResponse {
190
+ readonly body: unknown;
191
+ readonly status: number;
192
+ }
193
+ /** A transport-agnostic local-dev handler (schema edit, policy scaffold). */
194
+ type LocalEndpointHandler = (request: LocalEndpointRequest) => LocalEndpointResponse | Promise<LocalEndpointResponse>;
195
+ /**
196
+ * Adapt a `node:http` request/response pair to a transport-agnostic local-dev
197
+ * handler. `GET` carries no body (the schema editor uses it to read the parsed
198
+ * schema); every other method has its body read + JSON-parsed first. The
199
+ * handler's `{ status, body }` is serialised back as JSON. A malformed body is a
200
+ * `400`; an unexpected throw (e.g. the body-size guard) is a `500`.
201
+ *
202
+ * `context` carries the host's own Lunora options through to the handler: its
203
+ * `schemaDirectory` (so a custom `schemaDir` targets the right directory instead
204
+ * of defaulting to `"lunora"`) and its `apiSpec`, so a studio edit regenerates
205
+ * with the same options the host's own codegen run uses.
206
+ */
207
+ declare const serveJsonHandler: (request: IncomingMessage, response: ServerResponse, handle: LocalEndpointHandler, projectRoot: string, context?: LocalEndpointContext) => void;
208
+ /** Dev-server path the studio SPA is served from. */
209
+ declare const STUDIO_PATH = "/__lunora";
210
+ /** Static asset routes the studio document references. */
211
+ declare const STUDIO_SCRIPT_PATH: string;
212
+ declare const STUDIO_STYLE_PATH: string;
213
+ interface StudioMiddlewareOptions extends LocalEndpointContext {
214
+ /**
215
+ * The dev server's base path as configured (`"/"`, `"/app/"`). The studio's
216
+ * mount moves with it. Defaults to `"/"`.
217
+ */
218
+ base?: string;
219
+ /**
220
+ * The host's config binds beyond loopback — see {@link isNonLoopbackHost},
221
+ * which both bundler hosts derive this from. Refused outright, on top of the
222
+ * per-request transport check.
223
+ */
224
+ isNonLoopbackBind: boolean;
225
+ logger?: WarnLogger;
226
+ /** Directory holding `lunora/` and `.dev.vars`. */
227
+ projectRoot: string;
228
+ }
229
+ /**
230
+ * A dev server's CONFIGURED host asks to bind beyond loopback — `--host`
231
+ * (`true`), `0.0.0.0`, a LAN address. `undefined` means the host was never
232
+ * set, which is the bundler's default and not an intent to expose, whatever
233
+ * that default binds.
234
+ */
235
+ declare const isNonLoopbackHost: (host: unknown) => boolean;
236
+ /** Where the studio is mounted under a dev server's `base` — the path a startup banner announces. */
237
+ declare const studioMountPath: (base?: string) => string;
238
+ /**
239
+ * The pathname of a request's `url`, the way every studio host routes on it:
240
+ * query dropped, and dot segments resolved — so `/_lunora/../x` routes as the
241
+ * `/x` it will reach, not as a `/_lunora` path. A url `URL` cannot parse falls
242
+ * back to a plain query strip.
243
+ */
244
+ declare const requestPathname: (url: string) => string;
245
+ /**
246
+ * Connect-style middleware that serves the static studio at {@link STUDIO_PATH}.
247
+ * Both bundler dev servers mount it — Vite's `server.middlewares` and Rsbuild's
248
+ * — so the studio lives at the same URL whichever one runs the app.
249
+ *
250
+ * Caches the asset bytes but re-reads them when the built files change on disk
251
+ * (compared via {@link studioAssetsStamp}), so a `@lunora/studio` rebuild is
252
+ * picked up live without a dev server restart.
253
+ */
254
+ declare const createStudioMiddleware: (options: StudioMiddlewareOptions) => ((request: IncomingMessage, response: ServerResponse, next: () => void) => void);
255
+ /**
256
+ * Endpoint path both dev hosts mount the handler at. A sibling of the schema
257
+ * editor's `/__lunora/schema-edit`; the double underscore keeps it clear of the
258
+ * CLI's `/_lunora/*` worker proxy (single underscore).
259
+ */
88
260
  declare const POLICY_SCAFFOLD_ENDPOINT = "/__lunora/policy-scaffold";
89
261
  /** A `wireRls` request additionally carries the procedure's source-file path. */
90
262
  interface WirePolicyEdit extends WireRlsEdit {
@@ -95,8 +267,12 @@ interface WirePolicyEdit extends WireRlsEdit {
95
267
  type PolicyScaffoldBody = DestructivePolicyEdit | ScaffoldPolicyEdit | WirePolicyEdit;
96
268
  /** A request adapted from the host transport. */
97
269
  interface PolicyScaffoldRequest {
270
+ /** API-spec mode the host runs codegen with; forwarded to the regeneration. */
271
+ readonly apiSpec?: CodegenOptions["apiSpec"];
98
272
  /** Parsed JSON body of the `POST`. */
99
273
  readonly body?: unknown;
274
+ /** Lazy function mode the host runs codegen with; forwarded to the regeneration. */
275
+ readonly lazyFunctions?: CodegenOptions["lazyFunctions"];
100
276
  /** HTTP method — only `POST` is handled. */
101
277
  readonly method: string;
102
278
  /** Project root containing the `lunora/` directory. */
@@ -110,31 +286,35 @@ interface PolicyScaffoldResponse {
110
286
  readonly status: number;
111
287
  }
112
288
  /**
113
- * Handle a policy-scaffold request. Pure over its inputs apart from the file
114
- * I/O + codegen it performs on an applied edit; safe to unit-test against a
115
- * temp project directory.
116
- */
289
+ * Handle a policy-scaffold request. Pure over its inputs apart from the file
290
+ * I/O + codegen it performs on an applied edit; safe to unit-test against a
291
+ * temp project directory.
292
+ */
117
293
  declare const handlePolicyScaffoldRequest: (request: PolicyScaffoldRequest) => PolicyScaffoldResponse;
118
294
  /**
119
- * Render the single-page document that boots the studio. Emitted verbatim —
120
- * never through a bundler/transform — so the studio stays a static tool,
121
- * decoupled from the host project's build. A small inline script publishes the
122
- * per-server config on `globalThis` before the bundle loads: the mount basepath
123
- * (so the router stays under its mount), the admin token when present (so the
124
- * studio auto-authenticates instead of prompting), and an editable flag when the
125
- * host is a loopback dev server (so the data browser allows edits).
126
- */
295
+ * Render the single-page document that boots the studio. Emitted verbatim —
296
+ * never through a bundler/transform — so the studio stays a static tool,
297
+ * decoupled from the host project's build. A small inline script publishes the
298
+ * per-server config on `globalThis` before the bundle loads: the mount basepath
299
+ * (so the router stays under its mount), the admin token when present (so the
300
+ * studio auto-authenticates instead of prompting), and an editable flag when the
301
+ * host is a loopback dev server (so the data browser allows edits).
302
+ */
127
303
  declare const renderStudioHtml: (config: StudioHtmlConfig) => string;
128
304
  /**
129
- * Endpoint path both dev hosts mount the handler at. Distinct from the CLI's
130
- * `/_lunora/*` worker proxy (single underscore), so a schema edit is never
131
- * forwarded to the worker.
132
- */
305
+ * Endpoint path both dev hosts mount the handler at. Distinct from the CLI's
306
+ * `/_lunora/*` worker proxy (single underscore), so a schema edit is never
307
+ * forwarded to the worker.
308
+ */
133
309
  declare const SCHEMA_EDIT_ENDPOINT = "/__lunora/schema-edit";
134
310
  /** A request adapted from the host transport. */
135
311
  interface SchemaEditRequest {
312
+ /** API-spec mode the host runs codegen with; forwarded to the regeneration. */
313
+ readonly apiSpec?: CodegenOptions["apiSpec"];
136
314
  /** Parsed JSON body for a `POST`; ignored for `GET`. */
137
315
  readonly body?: unknown;
316
+ /** Lazy function mode the host runs codegen with; forwarded to the regeneration. */
317
+ readonly lazyFunctions?: CodegenOptions["lazyFunctions"];
138
318
  /** HTTP method (`GET` / `POST`). */
139
319
  readonly method: string;
140
320
  /** Project root containing the `lunora/` directory. */
@@ -148,28 +328,28 @@ interface SchemaEditResponse {
148
328
  readonly status: number;
149
329
  }
150
330
  /**
151
- * Handle a schema-edit request. Pure over its inputs apart from the file I/O +
152
- * codegen it performs on a `POST` additive edit; safe to unit-test against a
153
- * temp project directory.
154
- */
331
+ * Handle a schema-edit request. Pure over its inputs apart from the file I/O +
332
+ * codegen it performs on a `POST` additive edit; safe to unit-test against a
333
+ * temp project directory.
334
+ */
155
335
  declare const handleSchemaEditRequest: (request: SchemaEditRequest) => SchemaEditResponse;
156
336
  /**
157
- * Endpoint path both dev hosts mount the handler at. A sibling of the schema
158
- * editor's `/__lunora/schema-edit`; the double underscore keeps it clear of the
159
- * CLI's `/_lunora/*` worker proxy (single underscore).
160
- */
337
+ * Endpoint path both dev hosts mount the handler at. A sibling of the schema
338
+ * editor's `/__lunora/schema-edit`; the double underscore keeps it clear of the
339
+ * CLI's `/_lunora/*` worker proxy (single underscore).
340
+ */
161
341
  declare const SEED_ENDPOINT = "/__lunora/seed";
162
342
  /** Body the host transport adapts from a `POST` — one generate-rows request. */
163
343
  interface SeedRequestBody {
164
344
  /** How many rows to generate (clamped to `[1, MAX_SEED_ROWS]`). */
165
345
  readonly count?: number;
166
346
  /**
167
- * Ids of rows that already exist in the live DB, keyed by referenced table.
168
- * Foreign keys resolve against these, and every referenced parent table
169
- * present here is treated as covered — so the generator links to existing
170
- * rows instead of fabricating new parent rows. The studio samples these from
171
- * the target table's FK columns before calling.
172
- */
347
+ * Ids of rows that already exist in the live DB, keyed by referenced table.
348
+ * Foreign keys resolve against these, and every referenced parent table
349
+ * present here is treated as covered — so the generator links to existing
350
+ * rows instead of fabricating new parent rows. The studio samples these from
351
+ * the target table's FK columns before calling.
352
+ */
173
353
  readonly existingIds?: Readonly<Record<string, ReadonlyArray<string>>>;
174
354
  /** Deterministic mapping selector — same value yields identical rows. */
175
355
  readonly seed?: number;
@@ -193,35 +373,109 @@ interface SeedResponse {
193
373
  readonly status: number;
194
374
  }
195
375
  /**
196
- * Handle a generate-rows request: statically lift the schema, generate `count`
197
- * rows for `table` (linking foreign keys to the supplied existing ids rather
198
- * than fabricating parents), and return them JSON-safe for the client to insert.
199
- */
200
- declare const handleSeedRequest: (request: SeedRequest) => SeedResponse;
201
- /** A request adapted from a host transport, passed to a local-dev handler. */
202
- interface LocalEndpointRequest {
203
- /** Parsed JSON body of the request (`undefined` for `GET` / an empty body). */
204
- readonly body?: unknown;
205
- /** HTTP method. */
206
- readonly method: string;
207
- /** Project root containing the `lunora/` directory. */
208
- readonly projectRoot: string;
209
- /** Override the lunora subdirectory name. Defaults to `"lunora"`. */
210
- readonly schemaDirectory?: string;
211
- }
212
- /** A response a local-dev handler returns, serialised back as JSON with its status. */
213
- interface LocalEndpointResponse {
214
- readonly body: unknown;
215
- readonly status: number;
216
- }
217
- /** A transport-agnostic local-dev handler (schema edit, policy scaffold). */
218
- type LocalEndpointHandler = (request: LocalEndpointRequest) => LocalEndpointResponse;
219
- /**
220
- * Adapt a `node:http` request/response pair to a transport-agnostic local-dev
221
- * handler. `GET` carries no body (the schema editor uses it to read the parsed
222
- * schema); every other method has its body read + JSON-parsed first. The
223
- * handler's `{ status, body }` is serialised back as JSON. A malformed body is a
224
- * `400`; an unexpected throw (e.g. the body-size guard) is a `500`.
225
- */
226
- declare const serveJsonHandler: (request: IncomingMessage, response: ServerResponse, handle: LocalEndpointHandler, projectRoot: string) => void;
227
- export { type LocalEndpointHandler, type LocalEndpointRequest, type LocalEndpointResponse, POLICY_SCAFFOLD_ENDPOINT, type PolicyScaffoldBody, type PolicyScaffoldRequest, type PolicyScaffoldResponse, SCHEMA_EDIT_ENDPOINT, SEED_ENDPOINT, type SchemaEditRequest, type SchemaEditResponse, type SeedRequest, type SeedRequestBody, type SeedResponse, type StudioAssets, type StudioHtmlConfig, type WarnLogger, type WirePolicyEdit, handlePolicyScaffoldRequest, handleSchemaEditRequest, handleSeedRequest, loadStudioAssets, parseDevVariable, renderStudioHtml, resolveAdminToken, serveJsonHandler, studioAssetsStamp };
376
+ * Handle a generate-rows request: statically lift the schema, generate `count`
377
+ * rows for `table` (linking foreign keys to the supplied existing ids rather
378
+ * than fabricating parents), and return them JSON-safe for the client to insert.
379
+ *
380
+ * Only the requested table's rows are ever returned, so a foreign key with no
381
+ * `existingIds` to resolve against is answered with `409
382
+ * fk-parents-empty` naming the parent tables — the endpoint refuses
383
+ * rather than hand back children whose parents it just dropped.
384
+ *
385
+ * `@lunora/seed` is imported here, on the first request, not at module scope:
386
+ * it pulls in faker, which every dev server paid at startup for a button most
387
+ * sessions never press.
388
+ */
389
+ declare const handleSeedRequest: (request: SeedRequest) => Promise<SeedResponse>;
390
+ /**
391
+ * Suffix of the temporary file a studio handler writes and renames over its
392
+ * target. A watcher that sees every file has to ignore it: its events are part
393
+ * of the handler's write, not a change of their own.
394
+ */
395
+ declare const STUDIO_WRITE_TEMP_SUFFIX = ".lunora-tmp";
396
+ /**
397
+ * Whether a watcher event for `path` is the echo of a studio write. Returns true,
398
+ * and spends the record, only when the file still holds the text that was written.
399
+ */
400
+ declare const consumeStudioWrite: (path: string, now?: number) => boolean;
401
+ /** A single header value, lower-cased and trimmed; `undefined` when absent or array-valued. */
402
+ declare const headerValue: (raw: string | string[] | undefined) => string | undefined;
403
+ /**
404
+ * True for an IPv4/IPv6 loopback peer (`127.0.0.0/8`, `::1`, and the
405
+ * IPv4-mapped `::ffff:127.x`). A missing address means we cannot read the
406
+ * transport (e.g. a mocked request in tests) — treated as loopback so the
407
+ * config-derived gate stays the source of truth there; on a real Vite/Node
408
+ * server `remoteAddress` is always populated.
409
+ */
410
+ declare const isLoopbackAddress: (remoteAddress: string | undefined) => boolean;
411
+ /**
412
+ * Explicit opt-out for the forwarding-header refusal below — set to `"1"` to
413
+ * allow a proxied request through once you've confirmed the forwarding is
414
+ * your own trusted dev tunnel (Codespaces, devcontainers, Gitpod, Cloud
415
+ * Workstations, ngrok, a Docker reverse proxy, …), not an attacker's relay.
416
+ * Does not relax the socket-peer or `Host` checks — only this one.
417
+ */
418
+ declare const ALLOW_FORWARDED_ENV = "LUNORA_STUDIO_ALLOW_FORWARDED";
419
+ /**
420
+ * Per-request transport gate, independent of a host's config-derived bind
421
+ * intent (e.g. Vite's `isNonLoopbackBind`, the CLI's `isLoopback`). In Vite
422
+ * middleware mode the real bind belongs to the embedding server (so the
423
+ * config check measures the wrong thing); here we read the actual socket peer
424
+ * and the `Host` header. Returns a refusal reason, or `undefined` when the
425
+ * connection is loopback-local.
426
+ *
427
+ * `logger`, when supplied, gets a `warnOnce` line for a forwarding-header
428
+ * refusal — naming the specific header seen and the {@link ALLOW_FORWARDED_ENV}
429
+ * escape hatch — so the failure points at its cause in the terminal running
430
+ * the dev server, not just as an opaque 403 in the browser.
431
+ */
432
+ declare const transportRejectionReason: (request: IncomingMessage, logger?: WarnLogger) => string | undefined;
433
+ export { ALLOW_FORWARDED_ENV, type LocalEndpointContext, type LocalEndpointHandler, type LocalEndpointRequest, type LocalEndpointResponse, POLICY_SCAFFOLD_ENDPOINT, type PolicyScaffoldBody, type PolicyScaffoldRequest, type PolicyScaffoldResponse, SCHEMA_EDIT_ENDPOINT, SEED_ENDPOINT, STUDIO_PATH, STUDIO_SCRIPT_PATH, STUDIO_STYLE_PATH, STUDIO_WRITE_TEMP_SUFFIX, type SchemaEditRequest, type SchemaEditResponse, type SeedRequest, type SeedRequestBody, type SeedResponse, type StudioAssets, type StudioHtmlConfig, type StudioMiddlewareOptions, type WarnLogger, type WirePolicyEdit, assetContentType, consumeStudioWrite, createStudioDocumentCache, createStudioMiddleware,
434
+ /**
435
+ * `@lunora/config/studio-host` — internal, build-time-shared helpers for hosting
436
+ * the prebuilt `@lunora/studio` SPA during local dev.
437
+ *
438
+ * Three dev hosts serve the studio from this code, so it behaves identically
439
+ * regardless of how the project is run:
440
+ * - `@lunora/vite` and `@lunora/rspack` mount `createStudioMiddleware` on their
441
+ * dev server at `/__lunora` — same routing, same URL.
442
+ * - `@lunora/cli` (`lunora dev`) serves it from a standalone Node HTTP server
443
+ * with its own routing (a root mount, and a read-only shell off loopback).
444
+ *
445
+ * The genuinely shared parts live here: render the host HTML with per-server
446
+ * config injected, resolve the admin token the same way the worker does, gate
447
+ * the transport, and load the prebuilt asset bytes.
448
+ */
449
+ devVariablesStamp, handlePolicyScaffoldRequest, handleSchemaEditRequest, handleSeedRequest, headerValue, isLoopbackAddress, isNonLoopbackHost, isStandaloneModulePath, loadStudioAssets,
450
+ /**
451
+ * `@lunora/config/studio-host` — internal, build-time-shared helpers for hosting
452
+ * the prebuilt `@lunora/studio` SPA during local dev.
453
+ *
454
+ * Three dev hosts serve the studio from this code, so it behaves identically
455
+ * regardless of how the project is run:
456
+ * - `@lunora/vite` and `@lunora/rspack` mount `createStudioMiddleware` on their
457
+ * dev server at `/__lunora` — same routing, same URL.
458
+ * - `@lunora/cli` (`lunora dev`) serves it from a standalone Node HTTP server
459
+ * with its own routing (a root mount, and a read-only shell off loopback).
460
+ *
461
+ * The genuinely shared parts live here: render the host HTML with per-server
462
+ * config injected, resolve the admin token the same way the worker does, gate
463
+ * the transport, and load the prebuilt asset bytes.
464
+ */
465
+ parseDevVariable, readStandaloneAsset, renderStudioHtml, requestPathname,
466
+ /**
467
+ * `@lunora/config/studio-host` — internal, build-time-shared helpers for hosting
468
+ * the prebuilt `@lunora/studio` SPA during local dev.
469
+ *
470
+ * Three dev hosts serve the studio from this code, so it behaves identically
471
+ * regardless of how the project is run:
472
+ * - `@lunora/vite` and `@lunora/rspack` mount `createStudioMiddleware` on their
473
+ * dev server at `/__lunora` — same routing, same URL.
474
+ * - `@lunora/cli` (`lunora dev`) serves it from a standalone Node HTTP server
475
+ * with its own routing (a root mount, and a read-only shell off loopback).
476
+ *
477
+ * The genuinely shared parts live here: render the host HTML with per-server
478
+ * config injected, resolve the admin token the same way the worker does, gate
479
+ * the transport, and load the prebuilt asset bytes.
480
+ */
481
+ resolveAdminToken, resolveStandaloneDirectory, sendStudioAsset, sendStudioDocument, serveJsonHandler, studioAssetsStamp, studioMountPath, transportRejectionReason };
@@ -1,7 +1 @@
1
- export { parseDevVariable, resolveAdminToken } from '../packem_shared/parseDevVariable-CJiq2IwE.mjs';
2
- export { default as loadStudioAssets, studioAssetsStamp } from '../packem_shared/loadStudioAssets-Csk5RS4E.mjs';
3
- export { POLICY_SCAFFOLD_ENDPOINT, handlePolicyScaffoldRequest } from '../packem_shared/POLICY_SCAFFOLD_ENDPOINT-CiC2IGKx.mjs';
4
- export { default as renderStudioHtml } from '../packem_shared/renderStudioHtml-449Ysn75.mjs';
5
- export { SCHEMA_EDIT_ENDPOINT, handleSchemaEditRequest } from '../packem_shared/SCHEMA_EDIT_ENDPOINT-Df-Wrix-.mjs';
6
- export { SEED_ENDPOINT, handleSeedRequest } from '../packem_shared/SEED_ENDPOINT-DVCjaGO-.mjs';
7
- export { serveJsonHandler } from '../packem_shared/serveJsonHandler-B4OLTGLS.mjs';
1
+ import{devVariablesStamp as t,parseDevVariable as r,resolveAdminToken as a}from"../packem_shared/devVariablesStamp-Cetr3qFz.mjs";import{sendStudioAsset as d,sendStudioDocument as n}from"../packem_shared/sendStudioAsset-XBmVLqiI.mjs";import{assetContentType as i,isStandaloneModulePath as m,loadStudioAssets as u,readStandaloneAsset as l,resolveStandaloneDirectory as p,studioAssetsStamp as T}from"../packem_shared/assetContentType-CUb5bpbI.mjs";import{default as D}from"../packem_shared/createStudioDocumentCache-B3Sf1bIl.mjs";import{STUDIO_PATH as c,STUDIO_SCRIPT_PATH as A,STUDIO_STYLE_PATH as E,createStudioMiddleware as P,isNonLoopbackHost as x,requestPathname as I,studioMountPath as O}from"../packem_shared/STUDIO_PATH-Dc-3nLO6.mjs";import{POLICY_SCAFFOLD_ENDPOINT as R,handlePolicyScaffoldRequest as N}from"../packem_shared/POLICY_SCAFFOLD_ENDPOINT-D5PpQPkf.mjs";import{default as L}from"../packem_shared/renderStudioHtml-ByowDtMl.mjs";import{SCHEMA_EDIT_ENDPOINT as v,handleSchemaEditRequest as F}from"../packem_shared/SCHEMA_EDIT_ENDPOINT-CtxWqfDe.mjs";import{SEED_ENDPOINT as U,handleSeedRequest as b}from"../packem_shared/SEED_ENDPOINT-C1fhrehH.mjs";import{serveJsonHandler as V}from"../packem_shared/serveJsonHandler-B8_GE6QC.mjs";import{STUDIO_WRITE_TEMP_SUFFIX as k,consumeStudioWrite as y}from"../packem_shared/STUDIO_WRITE_TEMP_SUFFIX-BTTELz3K.mjs";import{ALLOW_FORWARDED_ENV as j,headerValue as w,isLoopbackAddress as J,transportRejectionReason as X}from"../packem_shared/ALLOW_FORWARDED_ENV-BUndghJx.mjs";export{j as ALLOW_FORWARDED_ENV,R as POLICY_SCAFFOLD_ENDPOINT,v as SCHEMA_EDIT_ENDPOINT,U as SEED_ENDPOINT,c as STUDIO_PATH,A as STUDIO_SCRIPT_PATH,E as STUDIO_STYLE_PATH,k as STUDIO_WRITE_TEMP_SUFFIX,i as assetContentType,y as consumeStudioWrite,D as createStudioDocumentCache,P as createStudioMiddleware,t as devVariablesStamp,N as handlePolicyScaffoldRequest,F as handleSchemaEditRequest,b as handleSeedRequest,w as headerValue,J as isLoopbackAddress,x as isNonLoopbackHost,m as isStandaloneModulePath,u as loadStudioAssets,r as parseDevVariable,l as readStandaloneAsset,L as renderStudioHtml,I as requestPathname,a as resolveAdminToken,p as resolveStandaloneDirectory,d as sendStudioAsset,n as sendStudioDocument,V as serveJsonHandler,T as studioAssetsStamp,O as studioMountPath,X as transportRejectionReason};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lunora/config",
3
- "version": "1.0.0-alpha.42",
3
+ "version": "1.0.0-alpha.421",
4
4
  "description": "Internal shared CLI + Vite config layer for Lunora: wrangler.jsonc validation, binding inference, and .dev.vars scaffolding",
5
5
  "keywords": [
6
6
  "bindings",
@@ -40,6 +40,14 @@
40
40
  "types": "./dist/index.d.ts",
41
41
  "import": "./dist/index.mjs"
42
42
  },
43
+ "./cloudflare": {
44
+ "types": "./dist/cloudflare/index.d.ts",
45
+ "import": "./dist/cloudflare/index.mjs"
46
+ },
47
+ "./cli": {
48
+ "types": "./dist/cli/index.d.ts",
49
+ "import": "./dist/cli/index.mjs"
50
+ },
43
51
  "./studio-host": {
44
52
  "types": "./dist/studio-host/index.d.ts",
45
53
  "import": "./dist/studio-host/index.mjs"
@@ -50,19 +58,36 @@
50
58
  "access": "public"
51
59
  },
52
60
  "dependencies": {
53
- "@lunora/codegen": "1.0.0-alpha.27",
54
- "@lunora/container": "1.0.0-alpha.5",
55
- "@lunora/seed": "1.0.0-alpha.13",
56
- "@visulima/colorize": "2.0.0-alpha.14",
61
+ "@lunora/codegen": "1.0.0-alpha.366",
62
+ "@lunora/container": "1.0.0-alpha.96",
63
+ "@lunora/errors": ">=1.0.0-alpha.51 <2.0.0-0",
64
+ "@lunora/seed": "1.0.0-alpha.263",
65
+ "@visulima/colorize": "3.0.0",
66
+ "@visulima/find-ai-runner": "1.0.2",
67
+ "@visulima/fs": "7.0.0",
68
+ "@visulima/package": "6.0.0",
57
69
  "dockerode": "^5.0.1",
58
- "es-module-lexer": "^2.1.0",
70
+ "dotenv": "18.0.5",
71
+ "es-module-lexer": "^2.3.2",
59
72
  "jsonc-parser": "^3.3.1",
60
73
  "ts-morph": "^28.0.0"
61
74
  },
62
75
  "peerDependencies": {
63
- "@lunora/studio": "1.0.0-alpha.28"
76
+ "@electric-sql/pglite": "^0.5.8",
77
+ "@electric-sql/pglite-pgvector": "^0.0.9",
78
+ "@electric-sql/pglite-socket": "^0.2.11",
79
+ "@lunora/studio": ">=1.0.0-alpha.50 <2.0.0-0"
64
80
  },
65
81
  "peerDependenciesMeta": {
82
+ "@electric-sql/pglite": {
83
+ "optional": true
84
+ },
85
+ "@electric-sql/pglite-pgvector": {
86
+ "optional": true
87
+ },
88
+ "@electric-sql/pglite-socket": {
89
+ "optional": true
90
+ },
66
91
  "@lunora/studio": {
67
92
  "optional": true
68
93
  }