@lunora/config 1.0.0-alpha.169 → 1.0.0-alpha.170

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/LICENSE.md CHANGED
@@ -105,6 +105,135 @@ CONDITIONS OF ANY KIND, either express or implied. See the License for the
105
105
  specific language governing permissions and limitations under the License.
106
106
 
107
107
  <!-- DEPENDENCIES -->
108
+
109
+ # Licenses of bundled dependencies
110
+ The published @lunora/config artifact additionally contains code with the following licenses:
111
+ MIT
112
+
113
+ # Bundled dependencies:
114
+ ## @visulima/path
115
+ License: MIT
116
+ By: Daniel Bannert
117
+ Repository: git+https://github.com/visulima/visulima.git
118
+
119
+ > MIT License
120
+ >
121
+ > Copyright (c) 2026 visulima
122
+ >
123
+ > Permission is hereby granted, free of charge, to any person obtaining a copy
124
+ > of this software and associated documentation files (the "Software"), to deal
125
+ > in the Software without restriction, including without limitation the rights
126
+ > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
127
+ > copies of the Software, and to permit persons to whom the Software is
128
+ > furnished to do so, subject to the following conditions:
129
+ >
130
+ > The above copyright notice and this permission notice shall be included in all
131
+ > copies or substantial portions of the Software.
132
+ >
133
+ > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
134
+ > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
135
+ > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
136
+ > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
137
+ > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
138
+ > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
139
+ > SOFTWARE.
140
+ >
141
+ > ---
142
+ >
143
+ > MIT License
144
+ >
145
+ > Copyright (c) Pooya Parsa <pooya@pi0.io> - Daniel Roe <daniel@roe.dev>
146
+ >
147
+ > Permission is hereby granted, free of charge, to any person obtaining a copy
148
+ > of this software and associated documentation files (the "Software"), to deal
149
+ > in the Software without restriction, including without limitation the rights
150
+ > to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
151
+ > copies of the Software, and to permit persons to whom the Software is
152
+ > furnished to do so, subject to the following conditions:
153
+ >
154
+ > The above copyright notice and this permission notice shall be included in all
155
+ > copies or substantial portions of the Software.
156
+ >
157
+ > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
158
+ > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
159
+ > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
160
+ > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
161
+ > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
162
+ > OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
163
+ > SOFTWARE.
164
+ >
165
+ > ---
166
+ >
167
+ > Copyright Joyent, Inc. and other Node contributors.
168
+ >
169
+ > Permission is hereby granted, free of charge, to any person obtaining a
170
+ > copy of this software and associated documentation files (the
171
+ > "Software"), to deal in the Software without restriction, including
172
+ > without limitation the rights to use, copy, modify, merge, publish,
173
+ > distribute, sublicense, and/or sell copies of the Software, and to permit
174
+ > persons to whom the Software is furnished to do so, subject to the
175
+ > following conditions:
176
+ >
177
+ > The above copyright notice and this permission notice shall be included
178
+ > in all copies or substantial portions of the Software.
179
+ >
180
+ > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
181
+ > OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
182
+ > MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
183
+ > NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
184
+ > DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
185
+ > OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
186
+ > USE OR OTHER DEALINGS IN THE SOFTWARE.
187
+ >
188
+ > ---
189
+ >
190
+ > Bundled zeptomatch (https://github.com/fabiospampinato/zeptomatch)
191
+ >
192
+ > The MIT License (MIT)
193
+ >
194
+ > Copyright (c) 2023-present Fabio Spampinato
195
+ >
196
+ > Permission is hereby granted, free of charge, to any person obtaining a
197
+ > copy of this software and associated documentation files (the "Software"),
198
+ > to deal in the Software without restriction, including without limitation
199
+ > the rights to use, copy, modify, merge, publish, distribute, sublicense,
200
+ > and/or sell copies of the Software, and to permit persons to whom the
201
+ > Software is furnished to do so, subject to the following conditions:
202
+ >
203
+ > The above copyright notice and this permission notice shall be included in
204
+ > all copies or substantial portions of the Software.
205
+ >
206
+ > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
207
+ > IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
208
+ > FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
209
+ > AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
210
+ > LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
211
+ > FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
212
+ > DEALINGS IN THE SOFTWARE.
213
+ >
214
+ >
215
+ >
216
+ > # Licenses of bundled dependencies
217
+ > The published @visulima/path artifact additionally contains code with the following licenses:
218
+ > MIT
219
+ >
220
+ > # Bundled dependencies:
221
+ > ## binary-extensions
222
+ > License: MIT
223
+ > By: Sindre Sorhus
224
+ > Repository: sindresorhus/binary-extensions
225
+ >
226
+ > > MIT License
227
+ > >
228
+ > > Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (https://sindresorhus.com)
229
+ > > Copyright (c) Paul Miller (https://paulmillr.com)
230
+ > >
231
+ > > Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
232
+ > >
233
+ > > The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
234
+ > >
235
+ > > THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
236
+
108
237
  <!-- /DEPENDENCIES -->
109
238
 
110
239
  <!-- TYPE_DEPENDENCIES -->
package/dist/index.d.mts CHANGED
@@ -536,6 +536,75 @@ declare class LunoraReporter {
536
536
  setStderr(stderr: NodeJS.WriteStream): void;
537
537
  log(meta: unknown): void;
538
538
  }
539
+ type PackageManager = "pnpm" | "npm" | "yarn" | "bun";
540
+ /** True when `manager` is on PATH — probed by running `<manager> --version`. Injectable for tests. */
541
+ type PackageManagerProbe = (manager: PackageManager) => boolean;
542
+ /**
543
+ * The package managers actually installed on this machine, in preference order
544
+ * ({@link INSTALL_PREFERENCE} — pnpm > bun > yarn > npm). The first entry is the
545
+ * recommended default for the install prompt; the whole list is what the user
546
+ * picks from. Empty when none are found.
547
+ */
548
+ declare const detectInstalledManagers: (probe?: PackageManagerProbe) => PackageManager[];
549
+ /** The argv that installs a project's dependencies with `manager` (`<manager> install`). */
550
+ declare const installArgsFor: (manager: PackageManager) => {
551
+ args: string[];
552
+ command: string;
553
+ };
554
+ /**
555
+ * The argv that adds `packages` as new dependencies with `manager` — the
556
+ * counterpart to {@link installArgsFor}, which reinstalls what package.json
557
+ * already declares rather than adding something new to it.
558
+ *
559
+ * npm's dev flag is `--save-dev` (its own docs lead with the long form); bun's
560
+ * is the lowercase `-d` (uppercase `-D` is not one of its recognized flags);
561
+ * pnpm and yarn both take `-D`.
562
+ */
563
+ declare const addArgsFor: (manager: PackageManager, packages: ReadonlyArray<string>, options?: {
564
+ dev?: boolean;
565
+ }) => {
566
+ args: string[];
567
+ command: string;
568
+ };
569
+ /**
570
+ * Resolve the package manager to drive for the project rooted at (or above)
571
+ * `startDirectory`. Every step is a real signal — Lunora never blindly assumes a
572
+ * particular manager, and there is no hardcoded fallback:
573
+ *
574
+ * 1. `@visulima/package` — the nearest lock file (`pnpm-lock.yaml`, `yarn.lock`,
575
+ * `package-lock.json`, `bun.lockb`) or the `packageManager` field of the nearest
576
+ * `package.json`.
577
+ * 2. The manager that launched this CLI, read from `npm_config_user_agent` (so
578
+ * `pnpm dlx lunora …` / `npx lunora …` resolve to the right manager).
579
+ * 3. The first package manager actually installed on this machine
580
+ * ({@link detectInstalledManagers}).
581
+ *
582
+ * Throws when none of those resolve — i.e. there is no lock file / `packageManager`
583
+ * field, the CLI wasn't launched by a known manager, and none is on `PATH`.
584
+ * Surfacing that is better than silently guessing a manager that can't run.
585
+ */
586
+ declare const detectPackageManager: (startDirectory: string) => PackageManager;
587
+ /** Map a package manager to the argv pair that runs an installed CLI. */
588
+ declare const execArgsFor: (manager: PackageManager, command: string, args: ReadonlyArray<string>) => {
589
+ args: string[];
590
+ command: string;
591
+ };
592
+ /**
593
+ * The argv that runs a project SCRIPT with `manager` — the counterpart to
594
+ * {@link execArgsFor}, which runs a BINARY.
595
+ *
596
+ * All four managers accept `<manager> run <script>`, so this is uniform. It is a
597
+ * separate function because reaching for `execArgsFor(manager, "run", [script])`
598
+ * silently produces something else entirely: `pnpm exec run <script>` fails with
599
+ * `Command "run" not found`, and `npx -- run <script>` resolves the registry
600
+ * PACKAGE named `run` and executes it.
601
+ */
602
+ declare const runScriptArgsFor: (manager: PackageManager, script: string) => {
603
+ args: string[];
604
+ command: string;
605
+ };
606
+ /** The shell command that runs a project script with `manager` (`pnpm dev`, `npm run dev`, …). */
607
+ declare const runScriptCommand: (manager: PackageManager, script: string) => string;
539
608
  /**
540
609
  * Per-package secret-requirements registry for `.dev.vars` scaffolding.
541
610
  *
@@ -601,6 +670,65 @@ declare const PACKAGE_SECRETS_REGISTRY: Readonly<Record<string, ReadonlyArray<Se
601
670
  * to future capability flags whose packages have no secrets.
602
671
  */
603
672
  declare const secretsForPackages: (packageNames: ReadonlyArray<string>) => SecretEntry[];
673
+ /**
674
+ * The two channels this needs from a caller's logger. Deliberately structural
675
+ * and this small: the CLI's `Logger`, Vite's `server.config.logger` shim, and a
676
+ * two-line test double all satisfy it without any of them being imported here.
677
+ */
678
+ interface HookLogger {
679
+ error: (message: string) => void;
680
+ info: (message: string) => void;
681
+ }
682
+ /** What a spawner is handed. A superset-accepting spawner (the CLI's) satisfies this. */
683
+ interface HookSpawnDescriptor {
684
+ args: ReadonlyArray<string>;
685
+ command: string;
686
+ cwd?: string;
687
+ /**
688
+ * Route the child's stdout to the parent's stderr (fd 2). Set whenever the
689
+ * caller's own stdout is a machine-readable stream — `--format json`, or
690
+ * `lunora dev`'s NDJSON — since a `postcodegen` script that prints anything
691
+ * would otherwise interleave with and corrupt it.
692
+ */
693
+ stdoutToStderr?: boolean;
694
+ }
695
+ /** Run a child process and resolve with its exit code. Injectable so tests need no subprocess. */
696
+ type HookSpawner = (descriptor: HookSpawnDescriptor) => Promise<{
697
+ code: number;
698
+ }>;
699
+ interface PostCodegenHookResult {
700
+ /**
701
+ * The hook's failure message, when it ran and did not succeed.
702
+ *
703
+ * Already logged by the time a caller sees it — read it only to decide
704
+ * whether to ABORT, and to carry into a structured result. Logging it again
705
+ * double-reports.
706
+ */
707
+ error?: string;
708
+ /** True when a `postcodegen` script existed and was invoked. */
709
+ ran: boolean;
710
+ }
711
+ /**
712
+ * Run the project's `postcodegen` script, if it declares one.
713
+ *
714
+ * A failure is reported here and returned rather than thrown, so every caller
715
+ * gets identical reporting and is left with only the decision that actually
716
+ * differs between them: whether it blocks. `deploy` and `prepare` must abort —
717
+ * the whole point is not shipping output the project considers unfinished —
718
+ * while a dev watch loop must not, since the next edit is the chance to fix it.
719
+ *
720
+ * Reporting used to be the caller's job, and all three copied the same
721
+ * `logger.error(result.error)` line. That made "was this surfaced?" a convention
722
+ * rather than a guarantee, and a fourth caller had no way to know it owed one.
723
+ * @returns whether the hook ran, and its (already-logged) error message when it failed.
724
+ */
725
+ declare const runPostCodegenHook: (options: {
726
+ cwd: string;
727
+ logger: HookLogger;
728
+ spawner?: HookSpawner;
729
+ /** See {@link HookSpawnDescriptor.stdoutToStderr}. */
730
+ stdoutToStderr?: boolean;
731
+ }) => Promise<PostCodegenHookResult>;
604
732
  /** The canonical project-config filename probed at the project root. */
605
733
  declare const LUNORA_CONFIG_FILE = "lunora.json";
606
734
  /**
@@ -1085,4 +1213,4 @@ declare const badgeWidth: (_spec: BadgeSpec) => number;
1085
1213
  declare const paintBadge: (spec: BadgeSpec) => string;
1086
1214
  /** Dim continuation text (a step's chosen answer, shown under the question). */
1087
1215
  declare const paintAnswer: (text: string) => string;
1088
- export { ACCENT, AGENT_MODE_ENV, AGENT_RULES_DIR, AGENT_RULES_HINT, AGENT_RULES_HINT_ENV, type AddIndexEdit, type AddOptionalColumnEdit, type AddTableEdit, type AdditiveEdit, type AgentDetection, type AgentRulesStatus, type ApplyEditResult, type ApplyFailureReason, type AugmentPlan, BADGES, BADGE_COLUMN_WIDTH, type BadgeName, type BadgeSpec, CODEGEN_ENV, type ClaimDevServerStateResult, type ContainerLogLevel, type ContainerLogLine, type ContainerLogSource, type ContainerLogStreamHandle, type ContainerLogStreamOptions, DEFAULT_DEPLOY_TARGET, 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, type DeployDriver, type DestructiveEdit, type DetectedFramework, type DevSecretsFillPlan, type DevServerMode, type DevServerState, type DiscoverAgentInfoResult, type DiscoverContainerInfoResult, type DiscoverWorkflowInfoResult, type DockerLike, type EnsureDevVariablesDeps, type EnsureDevVariablesResult, type EnsureDevVariablesStatus, type FillDevSecretsResult, type FrameworkClass, type FrameworkDetection, LINKED_PROJECT_DIR, LINKED_PROJECT_FILE, LUNA_ART, LUNA_BUNNY, LUNA_NAME, LUNA_SIGNOFF, LUNORA_CONFIG_FILE, LUNORA_EVENT_SOURCE, LUNORA_IGNORED_PATHS, LUNORA_SKILL_NAMES, type LevelBadgeName, type LinkedProject, type LintIgnoreOutcome, type LintIgnoreStatus, type LintTool, type LunoraFormattedLine, type LunoraLineLevel, type LunoraProjectConfig, LunoraReporter, type MultiSelectOption, PACKAGE_SECRETS_REGISTRY, type ParseSchemaResult, ROOT_SKILL_NAME, type RemotePreference, STEP_BADGE_NAMES, type ScaffoldPlan, type SchemaColumn, type SchemaEdit, type SchemaIndex, type SchemaTable, type SecretEntry, type SelectOption, type StepBadgeName, applyAdditiveEdit, applyLintIgnores, badgeLead, badgeWidth, buildPackageSecretsBlock, claimAgentRulesHint, claimDevServerState, classifyEdit, clearDevServerState, createConfirm, deployTargetIds, detectAgentRules, detectAiAgent, detectFramework, detectLintTools, discoverAgentInfo, discoverContainerInfo, discoverWorkflowInfo, ensureDevVariables, ensureDevVariablesExample as ensureDevVarsExample, escapeRegExp, fillDevSecrets, formatLunoraEvent, generateSecretValue, interpretRemote, isCodegenDisabled, isInteractive, isMintableSecretKey, isPlaceholderValue, isProcessAlive, isRecordedProcessCurrent, padBadge, paintAnswer, paintBadge, parseDevVariableEntries, parseSchema, planDevSecretsFill, planDevVariablesAugment, planDevVariablesScaffold, promptMultiSelect, promptSelect, promptText, promptYesNo, readDevServerState, readLinkedProject, readLiveDevServerState, readProjectDependencyNames, readProjectRemotePreference, readProjectTarget, removeDevVariableLine, requiredSecrets, resolveDeployDriver, resolveProjectTarget, resolveTargetOrThrow, secretsForPackages, streamContainerLogs, updateDevServerState, upsertDevVariableLine, writeDevServerState, writeDevVariablesFileAtomically, writeLinkedProject };
1216
+ export { ACCENT, AGENT_MODE_ENV, AGENT_RULES_DIR, AGENT_RULES_HINT, AGENT_RULES_HINT_ENV, type AddIndexEdit, type AddOptionalColumnEdit, type AddTableEdit, type AdditiveEdit, type AgentDetection, type AgentRulesStatus, type ApplyEditResult, type ApplyFailureReason, type AugmentPlan, BADGES, BADGE_COLUMN_WIDTH, type BadgeName, type BadgeSpec, CODEGEN_ENV, type ClaimDevServerStateResult, type ContainerLogLevel, type ContainerLogLine, type ContainerLogSource, type ContainerLogStreamHandle, type ContainerLogStreamOptions, DEFAULT_DEPLOY_TARGET, 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, type DeployDriver, type DestructiveEdit, type DetectedFramework, type DevSecretsFillPlan, type DevServerMode, type DevServerState, type DiscoverAgentInfoResult, type DiscoverContainerInfoResult, type DiscoverWorkflowInfoResult, type DockerLike, type EnsureDevVariablesDeps, type EnsureDevVariablesResult, type EnsureDevVariablesStatus, type FillDevSecretsResult, type FrameworkClass, type FrameworkDetection, type HookLogger, type HookSpawnDescriptor, type HookSpawner, LINKED_PROJECT_DIR, LINKED_PROJECT_FILE, LUNA_ART, LUNA_BUNNY, LUNA_NAME, LUNA_SIGNOFF, LUNORA_CONFIG_FILE, LUNORA_EVENT_SOURCE, LUNORA_IGNORED_PATHS, LUNORA_SKILL_NAMES, type LevelBadgeName, type LinkedProject, type LintIgnoreOutcome, type LintIgnoreStatus, type LintTool, type LunoraFormattedLine, type LunoraLineLevel, type LunoraProjectConfig, LunoraReporter, type MultiSelectOption, PACKAGE_SECRETS_REGISTRY, type PackageManager, type PackageManagerProbe, type ParseSchemaResult, type PostCodegenHookResult, ROOT_SKILL_NAME, type RemotePreference, STEP_BADGE_NAMES, type ScaffoldPlan, type SchemaColumn, type SchemaEdit, type SchemaIndex, type SchemaTable, type SecretEntry, type SelectOption, type StepBadgeName, addArgsFor, applyAdditiveEdit, applyLintIgnores, badgeLead, badgeWidth, buildPackageSecretsBlock, claimAgentRulesHint, claimDevServerState, classifyEdit, clearDevServerState, createConfirm, deployTargetIds, detectAgentRules, detectAiAgent, detectFramework, detectInstalledManagers, detectLintTools, detectPackageManager, discoverAgentInfo, discoverContainerInfo, discoverWorkflowInfo, ensureDevVariables, ensureDevVariablesExample as ensureDevVarsExample, escapeRegExp, execArgsFor, fillDevSecrets, formatLunoraEvent, generateSecretValue, installArgsFor, interpretRemote, isCodegenDisabled, isInteractive, isMintableSecretKey, isPlaceholderValue, isProcessAlive, isRecordedProcessCurrent, padBadge, paintAnswer, paintBadge, parseDevVariableEntries, parseSchema, planDevSecretsFill, planDevVariablesAugment, planDevVariablesScaffold, promptMultiSelect, promptSelect, promptText, promptYesNo, readDevServerState, readLinkedProject, readLiveDevServerState, readProjectDependencyNames, readProjectRemotePreference, readProjectTarget, removeDevVariableLine, requiredSecrets, resolveDeployDriver, resolveProjectTarget, resolveTargetOrThrow, runPostCodegenHook, runScriptArgsFor, runScriptCommand, secretsForPackages, streamContainerLogs, updateDevServerState, upsertDevVariableLine, writeDevServerState, writeDevVariablesFileAtomically, writeLinkedProject };
package/dist/index.d.ts CHANGED
@@ -536,6 +536,75 @@ declare class LunoraReporter {
536
536
  setStderr(stderr: NodeJS.WriteStream): void;
537
537
  log(meta: unknown): void;
538
538
  }
539
+ type PackageManager = "pnpm" | "npm" | "yarn" | "bun";
540
+ /** True when `manager` is on PATH — probed by running `<manager> --version`. Injectable for tests. */
541
+ type PackageManagerProbe = (manager: PackageManager) => boolean;
542
+ /**
543
+ * The package managers actually installed on this machine, in preference order
544
+ * ({@link INSTALL_PREFERENCE} — pnpm > bun > yarn > npm). The first entry is the
545
+ * recommended default for the install prompt; the whole list is what the user
546
+ * picks from. Empty when none are found.
547
+ */
548
+ declare const detectInstalledManagers: (probe?: PackageManagerProbe) => PackageManager[];
549
+ /** The argv that installs a project's dependencies with `manager` (`<manager> install`). */
550
+ declare const installArgsFor: (manager: PackageManager) => {
551
+ args: string[];
552
+ command: string;
553
+ };
554
+ /**
555
+ * The argv that adds `packages` as new dependencies with `manager` — the
556
+ * counterpart to {@link installArgsFor}, which reinstalls what package.json
557
+ * already declares rather than adding something new to it.
558
+ *
559
+ * npm's dev flag is `--save-dev` (its own docs lead with the long form); bun's
560
+ * is the lowercase `-d` (uppercase `-D` is not one of its recognized flags);
561
+ * pnpm and yarn both take `-D`.
562
+ */
563
+ declare const addArgsFor: (manager: PackageManager, packages: ReadonlyArray<string>, options?: {
564
+ dev?: boolean;
565
+ }) => {
566
+ args: string[];
567
+ command: string;
568
+ };
569
+ /**
570
+ * Resolve the package manager to drive for the project rooted at (or above)
571
+ * `startDirectory`. Every step is a real signal — Lunora never blindly assumes a
572
+ * particular manager, and there is no hardcoded fallback:
573
+ *
574
+ * 1. `@visulima/package` — the nearest lock file (`pnpm-lock.yaml`, `yarn.lock`,
575
+ * `package-lock.json`, `bun.lockb`) or the `packageManager` field of the nearest
576
+ * `package.json`.
577
+ * 2. The manager that launched this CLI, read from `npm_config_user_agent` (so
578
+ * `pnpm dlx lunora …` / `npx lunora …` resolve to the right manager).
579
+ * 3. The first package manager actually installed on this machine
580
+ * ({@link detectInstalledManagers}).
581
+ *
582
+ * Throws when none of those resolve — i.e. there is no lock file / `packageManager`
583
+ * field, the CLI wasn't launched by a known manager, and none is on `PATH`.
584
+ * Surfacing that is better than silently guessing a manager that can't run.
585
+ */
586
+ declare const detectPackageManager: (startDirectory: string) => PackageManager;
587
+ /** Map a package manager to the argv pair that runs an installed CLI. */
588
+ declare const execArgsFor: (manager: PackageManager, command: string, args: ReadonlyArray<string>) => {
589
+ args: string[];
590
+ command: string;
591
+ };
592
+ /**
593
+ * The argv that runs a project SCRIPT with `manager` — the counterpart to
594
+ * {@link execArgsFor}, which runs a BINARY.
595
+ *
596
+ * All four managers accept `<manager> run <script>`, so this is uniform. It is a
597
+ * separate function because reaching for `execArgsFor(manager, "run", [script])`
598
+ * silently produces something else entirely: `pnpm exec run <script>` fails with
599
+ * `Command "run" not found`, and `npx -- run <script>` resolves the registry
600
+ * PACKAGE named `run` and executes it.
601
+ */
602
+ declare const runScriptArgsFor: (manager: PackageManager, script: string) => {
603
+ args: string[];
604
+ command: string;
605
+ };
606
+ /** The shell command that runs a project script with `manager` (`pnpm dev`, `npm run dev`, …). */
607
+ declare const runScriptCommand: (manager: PackageManager, script: string) => string;
539
608
  /**
540
609
  * Per-package secret-requirements registry for `.dev.vars` scaffolding.
541
610
  *
@@ -601,6 +670,65 @@ declare const PACKAGE_SECRETS_REGISTRY: Readonly<Record<string, ReadonlyArray<Se
601
670
  * to future capability flags whose packages have no secrets.
602
671
  */
603
672
  declare const secretsForPackages: (packageNames: ReadonlyArray<string>) => SecretEntry[];
673
+ /**
674
+ * The two channels this needs from a caller's logger. Deliberately structural
675
+ * and this small: the CLI's `Logger`, Vite's `server.config.logger` shim, and a
676
+ * two-line test double all satisfy it without any of them being imported here.
677
+ */
678
+ interface HookLogger {
679
+ error: (message: string) => void;
680
+ info: (message: string) => void;
681
+ }
682
+ /** What a spawner is handed. A superset-accepting spawner (the CLI's) satisfies this. */
683
+ interface HookSpawnDescriptor {
684
+ args: ReadonlyArray<string>;
685
+ command: string;
686
+ cwd?: string;
687
+ /**
688
+ * Route the child's stdout to the parent's stderr (fd 2). Set whenever the
689
+ * caller's own stdout is a machine-readable stream — `--format json`, or
690
+ * `lunora dev`'s NDJSON — since a `postcodegen` script that prints anything
691
+ * would otherwise interleave with and corrupt it.
692
+ */
693
+ stdoutToStderr?: boolean;
694
+ }
695
+ /** Run a child process and resolve with its exit code. Injectable so tests need no subprocess. */
696
+ type HookSpawner = (descriptor: HookSpawnDescriptor) => Promise<{
697
+ code: number;
698
+ }>;
699
+ interface PostCodegenHookResult {
700
+ /**
701
+ * The hook's failure message, when it ran and did not succeed.
702
+ *
703
+ * Already logged by the time a caller sees it — read it only to decide
704
+ * whether to ABORT, and to carry into a structured result. Logging it again
705
+ * double-reports.
706
+ */
707
+ error?: string;
708
+ /** True when a `postcodegen` script existed and was invoked. */
709
+ ran: boolean;
710
+ }
711
+ /**
712
+ * Run the project's `postcodegen` script, if it declares one.
713
+ *
714
+ * A failure is reported here and returned rather than thrown, so every caller
715
+ * gets identical reporting and is left with only the decision that actually
716
+ * differs between them: whether it blocks. `deploy` and `prepare` must abort —
717
+ * the whole point is not shipping output the project considers unfinished —
718
+ * while a dev watch loop must not, since the next edit is the chance to fix it.
719
+ *
720
+ * Reporting used to be the caller's job, and all three copied the same
721
+ * `logger.error(result.error)` line. That made "was this surfaced?" a convention
722
+ * rather than a guarantee, and a fourth caller had no way to know it owed one.
723
+ * @returns whether the hook ran, and its (already-logged) error message when it failed.
724
+ */
725
+ declare const runPostCodegenHook: (options: {
726
+ cwd: string;
727
+ logger: HookLogger;
728
+ spawner?: HookSpawner;
729
+ /** See {@link HookSpawnDescriptor.stdoutToStderr}. */
730
+ stdoutToStderr?: boolean;
731
+ }) => Promise<PostCodegenHookResult>;
604
732
  /** The canonical project-config filename probed at the project root. */
605
733
  declare const LUNORA_CONFIG_FILE = "lunora.json";
606
734
  /**
@@ -1085,4 +1213,4 @@ declare const badgeWidth: (_spec: BadgeSpec) => number;
1085
1213
  declare const paintBadge: (spec: BadgeSpec) => string;
1086
1214
  /** Dim continuation text (a step's chosen answer, shown under the question). */
1087
1215
  declare const paintAnswer: (text: string) => string;
1088
- export { ACCENT, AGENT_MODE_ENV, AGENT_RULES_DIR, AGENT_RULES_HINT, AGENT_RULES_HINT_ENV, type AddIndexEdit, type AddOptionalColumnEdit, type AddTableEdit, type AdditiveEdit, type AgentDetection, type AgentRulesStatus, type ApplyEditResult, type ApplyFailureReason, type AugmentPlan, BADGES, BADGE_COLUMN_WIDTH, type BadgeName, type BadgeSpec, CODEGEN_ENV, type ClaimDevServerStateResult, type ContainerLogLevel, type ContainerLogLine, type ContainerLogSource, type ContainerLogStreamHandle, type ContainerLogStreamOptions, DEFAULT_DEPLOY_TARGET, 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, type DeployDriver, type DestructiveEdit, type DetectedFramework, type DevSecretsFillPlan, type DevServerMode, type DevServerState, type DiscoverAgentInfoResult, type DiscoverContainerInfoResult, type DiscoverWorkflowInfoResult, type DockerLike, type EnsureDevVariablesDeps, type EnsureDevVariablesResult, type EnsureDevVariablesStatus, type FillDevSecretsResult, type FrameworkClass, type FrameworkDetection, LINKED_PROJECT_DIR, LINKED_PROJECT_FILE, LUNA_ART, LUNA_BUNNY, LUNA_NAME, LUNA_SIGNOFF, LUNORA_CONFIG_FILE, LUNORA_EVENT_SOURCE, LUNORA_IGNORED_PATHS, LUNORA_SKILL_NAMES, type LevelBadgeName, type LinkedProject, type LintIgnoreOutcome, type LintIgnoreStatus, type LintTool, type LunoraFormattedLine, type LunoraLineLevel, type LunoraProjectConfig, LunoraReporter, type MultiSelectOption, PACKAGE_SECRETS_REGISTRY, type ParseSchemaResult, ROOT_SKILL_NAME, type RemotePreference, STEP_BADGE_NAMES, type ScaffoldPlan, type SchemaColumn, type SchemaEdit, type SchemaIndex, type SchemaTable, type SecretEntry, type SelectOption, type StepBadgeName, applyAdditiveEdit, applyLintIgnores, badgeLead, badgeWidth, buildPackageSecretsBlock, claimAgentRulesHint, claimDevServerState, classifyEdit, clearDevServerState, createConfirm, deployTargetIds, detectAgentRules, detectAiAgent, detectFramework, detectLintTools, discoverAgentInfo, discoverContainerInfo, discoverWorkflowInfo, ensureDevVariables, ensureDevVariablesExample as ensureDevVarsExample, escapeRegExp, fillDevSecrets, formatLunoraEvent, generateSecretValue, interpretRemote, isCodegenDisabled, isInteractive, isMintableSecretKey, isPlaceholderValue, isProcessAlive, isRecordedProcessCurrent, padBadge, paintAnswer, paintBadge, parseDevVariableEntries, parseSchema, planDevSecretsFill, planDevVariablesAugment, planDevVariablesScaffold, promptMultiSelect, promptSelect, promptText, promptYesNo, readDevServerState, readLinkedProject, readLiveDevServerState, readProjectDependencyNames, readProjectRemotePreference, readProjectTarget, removeDevVariableLine, requiredSecrets, resolveDeployDriver, resolveProjectTarget, resolveTargetOrThrow, secretsForPackages, streamContainerLogs, updateDevServerState, upsertDevVariableLine, writeDevServerState, writeDevVariablesFileAtomically, writeLinkedProject };
1216
+ export { ACCENT, AGENT_MODE_ENV, AGENT_RULES_DIR, AGENT_RULES_HINT, AGENT_RULES_HINT_ENV, type AddIndexEdit, type AddOptionalColumnEdit, type AddTableEdit, type AdditiveEdit, type AgentDetection, type AgentRulesStatus, type ApplyEditResult, type ApplyFailureReason, type AugmentPlan, BADGES, BADGE_COLUMN_WIDTH, type BadgeName, type BadgeSpec, CODEGEN_ENV, type ClaimDevServerStateResult, type ContainerLogLevel, type ContainerLogLine, type ContainerLogSource, type ContainerLogStreamHandle, type ContainerLogStreamOptions, DEFAULT_DEPLOY_TARGET, 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, type DeployDriver, type DestructiveEdit, type DetectedFramework, type DevSecretsFillPlan, type DevServerMode, type DevServerState, type DiscoverAgentInfoResult, type DiscoverContainerInfoResult, type DiscoverWorkflowInfoResult, type DockerLike, type EnsureDevVariablesDeps, type EnsureDevVariablesResult, type EnsureDevVariablesStatus, type FillDevSecretsResult, type FrameworkClass, type FrameworkDetection, type HookLogger, type HookSpawnDescriptor, type HookSpawner, LINKED_PROJECT_DIR, LINKED_PROJECT_FILE, LUNA_ART, LUNA_BUNNY, LUNA_NAME, LUNA_SIGNOFF, LUNORA_CONFIG_FILE, LUNORA_EVENT_SOURCE, LUNORA_IGNORED_PATHS, LUNORA_SKILL_NAMES, type LevelBadgeName, type LinkedProject, type LintIgnoreOutcome, type LintIgnoreStatus, type LintTool, type LunoraFormattedLine, type LunoraLineLevel, type LunoraProjectConfig, LunoraReporter, type MultiSelectOption, PACKAGE_SECRETS_REGISTRY, type PackageManager, type PackageManagerProbe, type ParseSchemaResult, type PostCodegenHookResult, ROOT_SKILL_NAME, type RemotePreference, STEP_BADGE_NAMES, type ScaffoldPlan, type SchemaColumn, type SchemaEdit, type SchemaIndex, type SchemaTable, type SecretEntry, type SelectOption, type StepBadgeName, addArgsFor, applyAdditiveEdit, applyLintIgnores, badgeLead, badgeWidth, buildPackageSecretsBlock, claimAgentRulesHint, claimDevServerState, classifyEdit, clearDevServerState, createConfirm, deployTargetIds, detectAgentRules, detectAiAgent, detectFramework, detectInstalledManagers, detectLintTools, detectPackageManager, discoverAgentInfo, discoverContainerInfo, discoverWorkflowInfo, ensureDevVariables, ensureDevVariablesExample as ensureDevVarsExample, escapeRegExp, execArgsFor, fillDevSecrets, formatLunoraEvent, generateSecretValue, installArgsFor, interpretRemote, isCodegenDisabled, isInteractive, isMintableSecretKey, isPlaceholderValue, isProcessAlive, isRecordedProcessCurrent, padBadge, paintAnswer, paintBadge, parseDevVariableEntries, parseSchema, planDevSecretsFill, planDevVariablesAugment, planDevVariablesScaffold, promptMultiSelect, promptSelect, promptText, promptYesNo, readDevServerState, readLinkedProject, readLiveDevServerState, readProjectDependencyNames, readProjectRemotePreference, readProjectTarget, removeDevVariableLine, requiredSecrets, resolveDeployDriver, resolveProjectTarget, resolveTargetOrThrow, runPostCodegenHook, runScriptArgsFor, runScriptCommand, secretsForPackages, streamContainerLogs, updateDevServerState, upsertDevVariableLine, writeDevServerState, writeDevVariablesFileAtomically, writeLinkedProject };
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- import{AGENT_MODE_ENV as t,detectAiAgent as o}from"./packem_shared/AGENT_MODE_ENV-D8MvSwPE.mjs";import{discoverAgentInfo as E}from"./packem_shared/discoverAgentInfo-CTdCSfYM.mjs";import{AGENT_RULES_DIR as s,AGENT_RULES_HINT as _,AGENT_RULES_HINT_ENV as p,LUNORA_SKILL_NAMES as l,ROOT_SKILL_NAME as n,claimAgentRulesHint as c,detectAgentRules as m}from"./packem_shared/AGENT_RULES_DIR-3-Sx1gHU.mjs";import{CODEGEN_ENV as A,isCodegenDisabled as D}from"./packem_shared/CODEGEN_ENV-ZsCxV1kP.mjs";import{discoverContainerInfo as f}from"./packem_shared/discoverContainerInfo-EhZtEBQs.mjs";import{streamContainerLogs as N}from"./packem_shared/streamContainerLogs-0nko1qpv.mjs";import{detectFramework as T,readProjectDependencyNames as R}from"./packem_shared/detectFramework-DOn4PtpP.mjs";import{DEV_DAEMON_ENV as V,DEV_HANDOFF_ENV as x,DEV_LOG_FILE as g,DEV_LOG_FILE_ENV as P,DEV_STATE_DIR as O,DEV_STATE_FILE as F,claimDevServerState as u,clearDevServerState as G,isProcessAlive as C,isRecordedProcessCurrent as U,readDevServerState as b,readLiveDevServerState as y,updateDevServerState as M,writeDevServerState as B}from"./packem_shared/DEV_DAEMON_ENV-e1mJUd1-.mjs";import{DEV_VARS_EXAMPLE_FILE as w,DEV_VARS_FILE as K,DEV_VARS_KEY_PATTERN as j,escapeRegExp as H,parseDevVariableEntries as h,removeDevVariableLine as Y,upsertDevVariableLine as W}from"./packem_shared/DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";import{DEFAULT_DEPLOY_TARGET as q,deployTargetIds as X,resolveDeployDriver as z}from"./packem_shared/DEFAULT_DEPLOY_TARGET-dS2wApDX.mjs";import{inferLunoraBindings as Z,packageNamesFromBindings as $}from"./packem_shared/inferLunoraBindings-KST9XCEe.mjs";import{LINKED_PROJECT_DIR as re,LINKED_PROJECT_FILE as te,readLinkedProject as oe,writeLinkedProject as ae}from"./packem_shared/LINKED_PROJECT_DIR-Ba5qPEwo.mjs";import{LUNORA_IGNORED_PATHS as ie,applyLintIgnores as se,detectLintTools as _e}from"./packem_shared/LUNORA_IGNORED_PATHS-BGbVUqw_.mjs";import{LUNORA_EVENT_SOURCE as le,formatLunoraEvent as ne}from"./packem_shared/LUNORA_EVENT_SOURCE-DYdcDU9G.mjs";import{default as me}from"./packem_shared/LunoraReporter-f277GLNT.mjs";import{PACKAGE_SECRETS_REGISTRY as Ae,secretsForPackages as De}from"./packem_shared/PACKAGE_SECRETS_REGISTRY-BgmvEPA-.mjs";import{LUNORA_CONFIG_FILE as fe,interpretRemote as Le,readProjectRemotePreference as Ne,readProjectTarget as ve,resolveProjectTarget as Te,resolveTargetOrThrow as Re}from"./packem_shared/LUNORA_CONFIG_FILE-GOH3iIA4.mjs";import{createConfirm as Ve,isInteractive as xe,promptMultiSelect as ge,promptSelect as Pe,promptText as Oe,promptYesNo as Fe}from"./packem_shared/createConfirm-D5mKTMHj.mjs";import{buildPackageSecretsBlock as Ge,ensureDevVariables as Ce,ensureDevVarsExample as Ue,fillDevSecrets as be,generateSecretValue as ye,isMintableSecretKey as Me,isPlaceholderValue as Be,planDevSecretsFill as ke,planDevVariablesAugment as we,planDevVariablesScaffold as Ke,requiredSecrets as je,writeDevVariablesFileAtomically as He}from"./packem_shared/buildPackageSecretsBlock-J7bP1P-6.mjs";import{applyAdditiveEdit as Ye,classifyEdit as We}from"./packem_shared/applyAdditiveEdit-DPhNZsf2.mjs";import{parseSchema as qe}from"./packem_shared/parseSchema-B4nFDPzZ.mjs";import{classifyPolicyEdit as ze,scaffoldPolicyFile as Qe,wireRlsIntoProcedure as Ze}from"./packem_shared/classifyPolicyEdit-BfSiVpv-.mjs";import{discoverSchemaInfo as er}from"./packem_shared/discoverSchemaInfo-Bg2CUZXG.mjs";import{ACCENT as tr,BADGES as or,BADGE_COLUMN_WIDTH as ar,LUNA_ART as Er,LUNA_BUNNY as ir,LUNA_NAME as sr,LUNA_SIGNOFF as _r,STEP_BADGE_NAMES as pr,badgeLead as lr,badgeWidth as nr,padBadge as cr,paintAnswer as mr,paintBadge as dr}from"./packem_shared/ACCENT-CotPTfv7.mjs";import{discoverWorkflowInfo as Dr}from"./packem_shared/discoverWorkflowInfo-BsPvlo6O.mjs";export{tr as ACCENT,t as AGENT_MODE_ENV,s as AGENT_RULES_DIR,_ as AGENT_RULES_HINT,p as AGENT_RULES_HINT_ENV,or as BADGES,ar as BADGE_COLUMN_WIDTH,A as CODEGEN_ENV,q as DEFAULT_DEPLOY_TARGET,V as DEV_DAEMON_ENV,x as DEV_HANDOFF_ENV,g as DEV_LOG_FILE,P as DEV_LOG_FILE_ENV,O as DEV_STATE_DIR,F as DEV_STATE_FILE,w as DEV_VARS_EXAMPLE_FILE,K as DEV_VARS_FILE,j as DEV_VARS_KEY_PATTERN,re as LINKED_PROJECT_DIR,te as LINKED_PROJECT_FILE,Er as LUNA_ART,ir as LUNA_BUNNY,sr as LUNA_NAME,_r as LUNA_SIGNOFF,fe as LUNORA_CONFIG_FILE,le as LUNORA_EVENT_SOURCE,ie as LUNORA_IGNORED_PATHS,l as LUNORA_SKILL_NAMES,me as LunoraReporter,Ae as PACKAGE_SECRETS_REGISTRY,n as ROOT_SKILL_NAME,pr as STEP_BADGE_NAMES,Ye as applyAdditiveEdit,se as applyLintIgnores,lr as badgeLead,nr as badgeWidth,Ge as buildPackageSecretsBlock,c as claimAgentRulesHint,u as claimDevServerState,We as classifyEdit,ze as classifyPolicyEdit,G as clearDevServerState,Ve as createConfirm,X as deployTargetIds,m as detectAgentRules,o as detectAiAgent,T as detectFramework,_e as detectLintTools,E as discoverAgentInfo,f as discoverContainerInfo,er as discoverSchemaInfo,Dr as discoverWorkflowInfo,Ce as ensureDevVariables,Ue as ensureDevVarsExample,H as escapeRegExp,be as fillDevSecrets,ne as formatLunoraEvent,ye as generateSecretValue,Z as inferLunoraBindings,Le as interpretRemote,D as isCodegenDisabled,xe as isInteractive,Me as isMintableSecretKey,Be as isPlaceholderValue,C as isProcessAlive,U as isRecordedProcessCurrent,$ as packageNamesFromBindings,cr as padBadge,mr as paintAnswer,dr as paintBadge,h as parseDevVariableEntries,qe as parseSchema,ke as planDevSecretsFill,we as planDevVariablesAugment,Ke as planDevVariablesScaffold,ge as promptMultiSelect,Pe as promptSelect,Oe as promptText,Fe as promptYesNo,b as readDevServerState,oe as readLinkedProject,y as readLiveDevServerState,R as readProjectDependencyNames,Ne as readProjectRemotePreference,ve as readProjectTarget,Y as removeDevVariableLine,je as requiredSecrets,z as resolveDeployDriver,Te as resolveProjectTarget,Re as resolveTargetOrThrow,Qe as scaffoldPolicyFile,De as secretsForPackages,N as streamContainerLogs,M as updateDevServerState,W as upsertDevVariableLine,Ze as wireRlsIntoProcedure,B as writeDevServerState,He as writeDevVariablesFileAtomically,ae as writeLinkedProject};
1
+ import{AGENT_MODE_ENV as o,detectAiAgent as t}from"./packem_shared/AGENT_MODE_ENV-D8MvSwPE.mjs";import{discoverAgentInfo as i}from"./packem_shared/discoverAgentInfo-CTdCSfYM.mjs";import{AGENT_RULES_DIR as s,AGENT_RULES_HINT as p,AGENT_RULES_HINT_ENV as n,LUNORA_SKILL_NAMES as l,ROOT_SKILL_NAME as _,claimAgentRulesHint as c,detectAgentRules as d}from"./packem_shared/AGENT_RULES_DIR-3-Sx1gHU.mjs";import{CODEGEN_ENV as A,isCodegenDisabled as D}from"./packem_shared/CODEGEN_ENV-ZsCxV1kP.mjs";import{discoverContainerInfo as f}from"./packem_shared/discoverContainerInfo-EhZtEBQs.mjs";import{streamContainerLogs as N}from"./packem_shared/streamContainerLogs-0nko1qpv.mjs";import{detectFramework as T,readProjectDependencyNames as R}from"./packem_shared/detectFramework-DOn4PtpP.mjs";import{DEV_DAEMON_ENV as x,DEV_HANDOFF_ENV as I,DEV_LOG_FILE as V,DEV_LOG_FILE_ENV as P,DEV_STATE_DIR as F,DEV_STATE_FILE as u,claimDevServerState as O,clearDevServerState as C,isProcessAlive as G,isRecordedProcessCurrent as U,readDevServerState as b,readLiveDevServerState as M,updateDevServerState as y,writeDevServerState as k}from"./packem_shared/DEV_DAEMON_ENV-e1mJUd1-.mjs";import{DEV_VARS_EXAMPLE_FILE as w,DEV_VARS_FILE as H,DEV_VARS_KEY_PATTERN as K,escapeRegExp as j,parseDevVariableEntries as h,removeDevVariableLine as Y,upsertDevVariableLine as W}from"./packem_shared/DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs";import{DEFAULT_DEPLOY_TARGET as q,deployTargetIds as X,resolveDeployDriver as z}from"./packem_shared/DEFAULT_DEPLOY_TARGET-dS2wApDX.mjs";import{inferLunoraBindings as Z,packageNamesFromBindings as $}from"./packem_shared/inferLunoraBindings-KST9XCEe.mjs";import{LINKED_PROJECT_DIR as re,LINKED_PROJECT_FILE as oe,readLinkedProject as te,writeLinkedProject as ae}from"./packem_shared/LINKED_PROJECT_DIR-Ba5qPEwo.mjs";import{LUNORA_IGNORED_PATHS as Ee,applyLintIgnores as se,detectLintTools as pe}from"./packem_shared/LUNORA_IGNORED_PATHS-BGbVUqw_.mjs";import{LUNORA_EVENT_SOURCE as le,formatLunoraEvent as _e}from"./packem_shared/LUNORA_EVENT_SOURCE-DYdcDU9G.mjs";import{default as de}from"./packem_shared/LunoraReporter-f277GLNT.mjs";import{addArgsFor as Ae,detectInstalledManagers as De,detectPackageManager as Se,execArgsFor as fe,installArgsFor as Le,runScriptArgsFor as Ne,runScriptCommand as ve}from"./packem_shared/addArgsFor-B4D4zvM0.mjs";import{PACKAGE_SECRETS_REGISTRY as Re,secretsForPackages as ge}from"./packem_shared/PACKAGE_SECRETS_REGISTRY-BgmvEPA-.mjs";import{runPostCodegenHook as Ie}from"./packem_shared/runPostCodegenHook-BF3XTBFz.mjs";import{LUNORA_CONFIG_FILE as Pe,interpretRemote as Fe,readProjectRemotePreference as ue,readProjectTarget as Oe,resolveProjectTarget as Ce,resolveTargetOrThrow as Ge}from"./packem_shared/LUNORA_CONFIG_FILE-GOH3iIA4.mjs";import{createConfirm as be,isInteractive as Me,promptMultiSelect as ye,promptSelect as ke,promptText as Be,promptYesNo as we}from"./packem_shared/createConfirm-D5mKTMHj.mjs";import{buildPackageSecretsBlock as Ke,ensureDevVariables as je,ensureDevVarsExample as he,fillDevSecrets as Ye,generateSecretValue as We,isMintableSecretKey as Je,isPlaceholderValue as qe,planDevSecretsFill as Xe,planDevVariablesAugment as ze,planDevVariablesScaffold as Qe,requiredSecrets as Ze,writeDevVariablesFileAtomically as $e}from"./packem_shared/buildPackageSecretsBlock-J7bP1P-6.mjs";import{applyAdditiveEdit as rr,classifyEdit as or}from"./packem_shared/applyAdditiveEdit-DPhNZsf2.mjs";import{parseSchema as ar}from"./packem_shared/parseSchema-B4nFDPzZ.mjs";import{classifyPolicyEdit as Er,scaffoldPolicyFile as sr,wireRlsIntoProcedure as pr}from"./packem_shared/classifyPolicyEdit-BfSiVpv-.mjs";import{discoverSchemaInfo as lr}from"./packem_shared/discoverSchemaInfo-Bg2CUZXG.mjs";import{ACCENT as cr,BADGES as dr,BADGE_COLUMN_WIDTH as mr,LUNA_ART as Ar,LUNA_BUNNY as Dr,LUNA_NAME as Sr,LUNA_SIGNOFF as fr,STEP_BADGE_NAMES as Lr,badgeLead as Nr,badgeWidth as vr,padBadge as Tr,paintAnswer as Rr,paintBadge as gr}from"./packem_shared/ACCENT-CotPTfv7.mjs";import{discoverWorkflowInfo as Ir}from"./packem_shared/discoverWorkflowInfo-BsPvlo6O.mjs";export{cr as ACCENT,o as AGENT_MODE_ENV,s as AGENT_RULES_DIR,p as AGENT_RULES_HINT,n as AGENT_RULES_HINT_ENV,dr as BADGES,mr as BADGE_COLUMN_WIDTH,A as CODEGEN_ENV,q as DEFAULT_DEPLOY_TARGET,x as DEV_DAEMON_ENV,I as DEV_HANDOFF_ENV,V as DEV_LOG_FILE,P as DEV_LOG_FILE_ENV,F as DEV_STATE_DIR,u as DEV_STATE_FILE,w as DEV_VARS_EXAMPLE_FILE,H as DEV_VARS_FILE,K as DEV_VARS_KEY_PATTERN,re as LINKED_PROJECT_DIR,oe as LINKED_PROJECT_FILE,Ar as LUNA_ART,Dr as LUNA_BUNNY,Sr as LUNA_NAME,fr as LUNA_SIGNOFF,Pe as LUNORA_CONFIG_FILE,le as LUNORA_EVENT_SOURCE,Ee as LUNORA_IGNORED_PATHS,l as LUNORA_SKILL_NAMES,de as LunoraReporter,Re as PACKAGE_SECRETS_REGISTRY,_ as ROOT_SKILL_NAME,Lr as STEP_BADGE_NAMES,Ae as addArgsFor,rr as applyAdditiveEdit,se as applyLintIgnores,Nr as badgeLead,vr as badgeWidth,Ke as buildPackageSecretsBlock,c as claimAgentRulesHint,O as claimDevServerState,or as classifyEdit,Er as classifyPolicyEdit,C as clearDevServerState,be as createConfirm,X as deployTargetIds,d as detectAgentRules,t as detectAiAgent,T as detectFramework,De as detectInstalledManagers,pe as detectLintTools,Se as detectPackageManager,i as discoverAgentInfo,f as discoverContainerInfo,lr as discoverSchemaInfo,Ir as discoverWorkflowInfo,je as ensureDevVariables,he as ensureDevVarsExample,j as escapeRegExp,fe as execArgsFor,Ye as fillDevSecrets,_e as formatLunoraEvent,We as generateSecretValue,Z as inferLunoraBindings,Le as installArgsFor,Fe as interpretRemote,D as isCodegenDisabled,Me as isInteractive,Je as isMintableSecretKey,qe as isPlaceholderValue,G as isProcessAlive,U as isRecordedProcessCurrent,$ as packageNamesFromBindings,Tr as padBadge,Rr as paintAnswer,gr as paintBadge,h as parseDevVariableEntries,ar as parseSchema,Xe as planDevSecretsFill,ze as planDevVariablesAugment,Qe as planDevVariablesScaffold,ye as promptMultiSelect,ke as promptSelect,Be as promptText,we as promptYesNo,b as readDevServerState,te as readLinkedProject,M as readLiveDevServerState,R as readProjectDependencyNames,ue as readProjectRemotePreference,Oe as readProjectTarget,Y as removeDevVariableLine,Ze as requiredSecrets,z as resolveDeployDriver,Ce as resolveProjectTarget,Ge as resolveTargetOrThrow,Ie as runPostCodegenHook,Ne as runScriptArgsFor,ve as runScriptCommand,sr as scaffoldPolicyFile,ge as secretsForPackages,N as streamContainerLogs,y as updateDevServerState,W as upsertDevVariableLine,pr as wireRlsIntoProcedure,k as writeDevServerState,$e as writeDevVariablesFileAtomically,ae as writeLinkedProject};
@@ -0,0 +1 @@
1
+ import{spawnSync as o}from"node:child_process";import{LunoraError as s}from"@lunora/errors";import{findPackageManagerSync as i,identifyInitiatingPackageManager as c}from"@visulima/package/package-manager";const a=["pnpm","bun","yarn","npm"],u=new Set(a),d=n=>u.has(n),m=n=>{try{return o(n,["--version"],{stdio:"ignore",timeout:5e3}).status===0}catch{return!1}},p=(n=m)=>a.filter(r=>n(r)),A=n=>({args:["install"],command:n}),y=(n,r,t={})=>{const e=t.dev===!0;return n==="npm"?{args:["install",...e?["--save-dev"]:[],...r],command:"npm"}:n==="bun"?{args:["add",...e?["-d"]:[],...r],command:"bun"}:{args:["add",...e?["-D"]:[],...r],command:n}},M=n=>{try{return i(n).packageManager}catch{}const r=c();if(r!==void 0){const e=r.name==="cnpm"?"npm":r.name;if(d(e))return e}const[t]=p();if(t!==void 0)return t;throw new s("INTERNAL","Could not detect a package manager: no lock file or `packageManager` field was found, and none (pnpm, bun, yarn, npm) is installed on PATH.")},b=(n,r,t)=>n==="yarn"?{args:[r,...t],command:"yarn"}:n==="bun"?{args:["x",r,...t],command:"bun"}:n==="npm"?{args:["--",r,...t],command:"npx"}:{args:["exec",r,...t],command:"pnpm"},E=(n,r)=>({args:["run",r],command:n}),v=(n,r)=>n==="npm"?`npm run ${r}`:n==="bun"?`bun run ${r}`:`${n} ${r}`;export{y as addArgsFor,p as detectInstalledManagers,M as detectPackageManager,b as execArgsFor,A as installArgsFor,E as runScriptArgsFor,v as runScriptCommand};
@@ -0,0 +1 @@
1
+ import{spawn as i}from"node:child_process";import{existsSync as d,readFileSync as u}from"node:fs";import{join as f}from"node:path";import{runScriptArgsFor as g,detectPackageManager as m}from"./addArgsFor-B4D4zvM0.mjs";const o="postcodegen",l=r=>new Promise((n,s)=>{const e=i(r.command,[...r.args],{cwd:r.cwd??process.cwd(),shell:process.platform==="win32",stdio:["inherit",r.stdoutToStderr===!0?2:"inherit","inherit"]});e.on("error",s),e.on("close",a=>{n({code:a??1})})}),p=r=>{const n=f(r,"package.json");if(!d(n))return!1;try{const e=JSON.parse(u(n,"utf8"))?.scripts;return typeof e?.[o]=="string"&&e[o]!==""}catch{return!1}},P=async r=>{const{cwd:n,logger:s}=r;if(!p(n))return{ran:!1};const e=t=>(s.error(t),{error:t,ran:!0});let a;try{a=g(m(n),o)}catch(t){return e(`cannot run \`${o}\`: ${t instanceof Error?t.message:String(t)}`)}s.info(`running \`${o}\``);let c;try{c=await(r.spawner??l)({args:a.args,command:a.command,cwd:n,stdoutToStderr:r.stdoutToStderr})}catch(t){return e(`\`${o}\` failed to start: ${t instanceof Error?t.message:String(t)}`)}return c.code!==0?e(`\`${o}\` exited ${String(c.code)}`):{ran:!0}};export{P as runPostCodegenHook};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lunora/config",
3
- "version": "1.0.0-alpha.169",
3
+ "version": "1.0.0-alpha.170",
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",
@@ -60,6 +60,7 @@
60
60
  "@lunora/seed": "1.0.0-alpha.91",
61
61
  "@visulima/colorize": "2.1.1",
62
62
  "@visulima/find-ai-runner": "1.0.1",
63
+ "@visulima/package": "5.0.12",
63
64
  "dockerode": "^5.0.1",
64
65
  "dotenv": "16.6.1",
65
66
  "es-module-lexer": "^2.3.1",