@lunora/config 1.0.0-alpha.41 → 1.0.0-alpha.410
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 +135 -0
- package/README.md +3 -3
- package/dist/cli/index.d.mts +2 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.mjs +1 -0
- package/dist/cloudflare/index.d.mts +1301 -0
- package/dist/cloudflare/index.d.ts +1301 -0
- package/dist/cloudflare/index.mjs +1 -0
- package/dist/index.d.mts +956 -974
- package/dist/index.d.ts +956 -974
- package/dist/index.mjs +1 -23
- package/dist/packem_shared/ACCENT-CotPTfv7.mjs +7 -0
- package/dist/packem_shared/AGENT_MODE_ENV-D8MvSwPE.mjs +1 -0
- package/dist/packem_shared/AGENT_RULES_DIR-Bd6JPtNa.mjs +1 -0
- package/dist/packem_shared/ALLOW_FORWARDED_ENV-BUndghJx.mjs +1 -0
- package/dist/packem_shared/BINDING_MANIFEST_VERSION-CfXEYG8e.mjs +1 -0
- package/dist/packem_shared/BUILD_ROOT_ENV-Dg4MV3wY.mjs +1 -0
- package/dist/packem_shared/CLOUDFLARE_CLI_CONFIG_WARNING_ENV-BKMrOuXV.mjs +1 -0
- package/dist/packem_shared/CLOUDFLARE_DRIVER-CULavrYO.mjs +1 -0
- package/dist/packem_shared/CLOUDFLARE_TOOLCHAIN_VERSIONS-DV5E_f_q.mjs +1 -0
- package/dist/packem_shared/COMPOSED_WORKER_ENTRY-Ciiba5g_.mjs +1 -0
- package/dist/packem_shared/D1_PLACEHOLDER_ID-ZnDjVymH.mjs +1 -0
- package/dist/packem_shared/DEFAULT_DEPLOY_TARGET-CuEMuxSY.mjs +1 -0
- package/dist/packem_shared/DEFAULT_OBSERVABILITY-bN6UkTMx.mjs +1 -0
- package/dist/packem_shared/DEV_BINDINGS_FILE-C0ZN_XlP.mjs +4 -0
- package/dist/packem_shared/DEV_VARS_EXAMPLE_FILE-CqLorAxT.mjs +6 -0
- package/dist/packem_shared/DEV_WORKER_ENV_VALUE-B34mwSpH.mjs +1 -0
- package/dist/packem_shared/GLOBAL_FETCH_STRICTLY_PUBLIC_FLAG-f8CnJha3.mjs +1 -0
- package/dist/packem_shared/LINKED_PROJECT_DIR-Ba5qPEwo.mjs +2 -0
- package/dist/packem_shared/LUNORA_EVENT_SOURCE-B9ZVohjO.mjs +1 -0
- package/dist/packem_shared/LUNORA_IGNORED_PATHS-U93uPxrW.mjs +19 -0
- package/dist/packem_shared/LUNORA_TAG-DQTGPqcJ.mjs +1 -0
- package/dist/packem_shared/LunoraReporter-f277GLNT.mjs +6 -0
- package/dist/packem_shared/MissingBuildOutputError-BAyekzof.mjs +1 -0
- package/dist/packem_shared/PACKAGE_SECRETS_REGISTRY-Cc-o-5Z9.mjs +1 -0
- package/dist/packem_shared/POLICY_SCAFFOLD_ENDPOINT-3Rxi46n7.mjs +1 -0
- package/dist/packem_shared/REMOTE_ELIGIBLE_KEYS-CuhB99R2.mjs +1 -0
- package/dist/packem_shared/REQUIRED_COMPATIBILITY_DATE-D4UcOP_t.mjs +1 -0
- package/dist/packem_shared/SCHEMA_EDIT_ENDPOINT-CkMPlCce.mjs +1 -0
- package/dist/packem_shared/SEED_ENDPOINT-BqSqBZuZ.mjs +1 -0
- package/dist/packem_shared/STUDIO_PATH-Dfr-Fa7B.mjs +1 -0
- package/dist/packem_shared/STUDIO_WRITE_TEMP_SUFFIX-BTTELz3K.mjs +1 -0
- package/dist/packem_shared/UNEXPORTED_CLASS_MARKER-mdcw5KDY.mjs +1 -0
- package/dist/packem_shared/WORKERS_CACHE_MIN_DATE-0k9ABJtF.mjs +1 -0
- package/dist/packem_shared/WRANGLER_FILES-UNW-xY5u.mjs +1 -0
- package/dist/packem_shared/acceptsConnection-DHhUYGjT.mjs +2 -0
- package/dist/packem_shared/addArgsFor-CYZKhNIo.mjs +1 -0
- package/dist/packem_shared/applyAdditiveEdit-DEwPKcJg.mjs +6 -0
- package/dist/packem_shared/applyModify-DKP2l6S9.mjs +1 -0
- package/dist/packem_shared/applyStudioAssetCache-DHQEJuuv.mjs +1 -0
- package/dist/packem_shared/assertBuildTargetMatches-C58Lo9HU.mjs +1 -0
- package/dist/packem_shared/assertWranglerSatisfiesSchema-B4DcaiJY.mjs +3 -0
- package/dist/packem_shared/assetContentType-CUb5bpbI.mjs +1 -0
- package/dist/packem_shared/bindingsNeedingDatabase-6eD6Qtqf.mjs +3 -0
- package/dist/packem_shared/blockingFindingsMessage-CRbg1sla.mjs +1 -0
- package/dist/packem_shared/buildPackageSecretsBlock-DhsxZhTy.mjs +19 -0
- package/dist/packem_shared/canonicalPath-DrfMiT3U.mjs +1 -0
- package/dist/packem_shared/celld-binding-id-9MiUoteo.mjs +1 -0
- package/dist/packem_shared/celld-config-DoBVipuN.mjs +3 -0
- package/dist/packem_shared/classifyPolicyEdit-DJi9Fk8G.mjs +24 -0
- package/dist/packem_shared/clearApiSpecMarker-DMGpP41V.mjs +2 -0
- package/dist/packem_shared/collectExportGaps-BIPdSjrC.mjs +2 -0
- package/dist/packem_shared/createConfirm-D5mKTMHj.mjs +7 -0
- package/dist/packem_shared/createDiscoveryCache-npJI4uej.mjs +1 -0
- package/dist/packem_shared/createStudioDocumentCache-B3Sf1bIl.mjs +1 -0
- package/dist/packem_shared/deploy-driver.d-DraUd2R2.d.mts +186 -0
- package/dist/packem_shared/deploy-driver.d-DraUd2R2.d.ts +186 -0
- package/dist/packem_shared/describePreservedCrons-C5KPuPy3.mjs +1 -0
- package/dist/packem_shared/describeWithheld-CbyzZjZF.mjs +1 -0
- package/dist/packem_shared/detectFramework-Dfpvu6rD.mjs +1 -0
- package/dist/packem_shared/devVariablesStamp-Cetr3qFz.mjs +1 -0
- package/dist/packem_shared/discover-info-DC2MrAIM.mjs +1 -0
- package/dist/packem_shared/discoverAgentInfo-pqFMJBtJ.mjs +1 -0
- package/dist/packem_shared/discoverContainerInfo-DzXr7Vm3.mjs +1 -0
- package/dist/packem_shared/discoverSchemaInfo-BBRlXZop.mjs +1 -0
- package/dist/packem_shared/discoverWorkflowInfo-zW7Tt0Tn.mjs +1 -0
- package/dist/packem_shared/ensureGitignoreEntries-Tsk8Qkw7.mjs +7 -0
- package/dist/packem_shared/guards-Buu_E7mP.mjs +1 -0
- package/dist/packem_shared/hasCloudflareCredentials-Bak5w1_6.mjs +1 -0
- package/dist/packem_shared/index.d-DSqsbmlq.d.mts +270 -0
- package/dist/packem_shared/index.d-sZ22Dkwr.d.ts +270 -0
- package/dist/packem_shared/infer-bindings.d-CyLHWT50.d.mts +319 -0
- package/dist/packem_shared/infer-bindings.d-CyLHWT50.d.ts +319 -0
- package/dist/packem_shared/inferLunoraBindings-DdtLvzEd.mjs +1 -0
- package/dist/packem_shared/lunora-manifest-DuH_Cmyu.mjs +6 -0
- package/dist/packem_shared/materializeServiceDevConfigs-qUY4_iu1.mjs +1 -0
- package/dist/packem_shared/mergeWranglerEnvironment-D5ekKj5x.mjs +1 -0
- package/dist/packem_shared/package-secrets-registry-CkRQL24p.mjs +1 -0
- package/dist/packem_shared/parseSchema-D1Wbr1qv.mjs +1 -0
- package/dist/packem_shared/policy-scaffold.d-D2H4_G01.d.mts +86 -0
- package/dist/packem_shared/policy-scaffold.d-D2H4_G01.d.ts +86 -0
- package/dist/packem_shared/probeCelldToolchain-DxDttfHy.mjs +1 -0
- package/dist/packem_shared/process-tree-once-Ou4SfxKM.mjs +1 -0
- package/dist/packem_shared/readProjectDependencies-l3uhUKjo.mjs +1 -0
- package/dist/packem_shared/reconcile-services-DFqH4eMQ.mjs +1 -0
- package/dist/packem_shared/reconcileBindingsSafely-0wAgKJpO.mjs +1 -0
- package/dist/packem_shared/reconcileWranglerCompatibilityDate-hocXEuRA.mjs +1 -0
- package/dist/packem_shared/renderStudioHtml-ByowDtMl.mjs +15 -0
- package/dist/packem_shared/resolveSchemaDirectory-Ca5P6KuP.mjs +1 -0
- package/dist/packem_shared/runPostCodegenHook-Dx3yTsYZ.mjs +1 -0
- package/dist/packem_shared/scanWranglerVariablesForSecrets--xUsy1Lq.mjs +1 -0
- package/dist/packem_shared/serveJsonHandler-Dv0EdCb9.mjs +1 -0
- package/dist/packem_shared/startCelldDevSession-BKRiLvt-.mjs +1 -0
- package/dist/packem_shared/streamContainerLogs-0nko1qpv.mjs +2 -0
- package/dist/packem_shared/validate-bindings-PVHSAU6M.mjs +1 -0
- package/dist/packem_shared/withTailConsumer-CF3pk_Ov.mjs +1 -0
- package/dist/packem_shared/worker-entry-checks-AIASCYl7.mjs +1 -0
- package/dist/packem_shared/wranglerCodegenInputs-C02zHFYw.mjs +1 -0
- package/dist/packem_shared/wranglerToAlchemy-CBO2ucRm.mjs +6 -0
- package/dist/packem_shared/write-atomic-C_Bu-bIv.mjs +3 -0
- package/dist/studio-host/index.d.mts +365 -110
- package/dist/studio-host/index.d.ts +365 -110
- package/dist/studio-host/index.mjs +1 -7
- package/package.json +32 -7
- package/dist/packem_shared/ACCENT-DW1XJn8i.mjs +0 -40
- package/dist/packem_shared/AGENT_RULES_DIR-lcgC08aE.mjs +0 -40
- package/dist/packem_shared/DEV_VARS_EXAMPLE_FILE-dJPNTEnK.mjs +0 -37
- package/dist/packem_shared/LINKED_PROJECT_DIR-CXwXzV_C.mjs +0 -52
- package/dist/packem_shared/LUNORA_CONFIG_FILE-CtcIcB5-.mjs +0 -34
- package/dist/packem_shared/LUNORA_EVENT_SOURCE-D2fDeGB6.mjs +0 -86
- package/dist/packem_shared/LunoraReporter-Ci-bDCK9.mjs +0 -70
- package/dist/packem_shared/PACKAGE_SECRETS_REGISTRY-B8t_SdoZ.mjs +0 -70
- package/dist/packem_shared/POLICY_SCAFFOLD_ENDPOINT-CiC2IGKx.mjs +0 -103
- package/dist/packem_shared/REMOTE_ELIGIBLE_KEYS-BC7_e9Bz.mjs +0 -105
- package/dist/packem_shared/REQUIRED_COMPATIBILITY_DATE-2YYyWJUq.mjs +0 -561
- package/dist/packem_shared/SCHEMA_EDIT_ENDPOINT-Df-Wrix-.mjs +0 -99
- package/dist/packem_shared/SEED_ENDPOINT-DVCjaGO-.mjs +0 -61
- package/dist/packem_shared/WRANGLER_FILES-DwSuC-Kn.mjs +0 -25
- package/dist/packem_shared/applyAdditiveEdit-C-snTFEV.mjs +0 -228
- package/dist/packem_shared/buildPackageSecretsBlock-BCHtfQ2A.mjs +0 -280
- package/dist/packem_shared/classifyPolicyEdit-BHeAqF8P.mjs +0 -99
- package/dist/packem_shared/createConfirm-fvpdgJ9s.mjs +0 -100
- package/dist/packem_shared/detectFramework-Br-BcPBq.mjs +0 -41
- package/dist/packem_shared/discoverContainerInfo-BXFs6Wav.mjs +0 -19
- package/dist/packem_shared/discoverSchemaInfo-BB-CKlTK.mjs +0 -25
- package/dist/packem_shared/discoverWorkflowInfo-CedvR0mn.mjs +0 -19
- package/dist/packem_shared/inferLunoraBindings-ByMwG-gH.mjs +0 -352
- package/dist/packem_shared/loadStudioAssets-Csk5RS4E.mjs +0 -28
- package/dist/packem_shared/parseDevVariable-CJiq2IwE.mjs +0 -30
- package/dist/packem_shared/parseSchema-DSeyktvG.mjs +0 -107
- package/dist/packem_shared/policy-scaffold.d-DCmwn7zQ.d.mts +0 -74
- package/dist/packem_shared/policy-scaffold.d-DCmwn7zQ.d.ts +0 -74
- package/dist/packem_shared/reconcileWranglerBindings-Cruwwx1M.mjs +0 -334
- package/dist/packem_shared/renderStudioHtml-449Ysn75.mjs +0 -37
- package/dist/packem_shared/serveJsonHandler-B4OLTGLS.mjs +0 -86
- package/dist/packem_shared/streamContainerLogs-BZ4cOZwH.mjs +0 -157
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import { e as ToolchainCommand, D as DeployDriver, d as ProjectionPurpose } from "./deploy-driver.d-DraUd2R2.mjs";
|
|
2
|
+
/**
|
|
3
|
+
* Project-relative directory the Lunora agent skills ("rules") install into.
|
|
4
|
+
* This is the portable [Agent Skills](https://tanstack.com/intent/latest/docs/registry)
|
|
5
|
+
* location — Cursor, Claude Code, and GitHub Copilot all discover skills here.
|
|
6
|
+
*/
|
|
7
|
+
declare const AGENT_RULES_DIR = ".agents/skills";
|
|
8
|
+
/** Env var the once-per-process-tree hint guard ({@link claimAgentRulesHint}) sets. */
|
|
9
|
+
declare const AGENT_RULES_HINT_ENV = "LUNORA_RULES_HINT_SHOWN";
|
|
10
|
+
/**
|
|
11
|
+
* The Lunora agent skills shipped by `@lunora/cli`. The first entry (`lunora`)
|
|
12
|
+
* is the router skill — its presence is what {@link detectAgentRules} treats as
|
|
13
|
+
* "rules installed", since every other skill is reachable through it.
|
|
14
|
+
*
|
|
15
|
+
* `lunora rules install` enumerates `@lunora/cli`'s `skills/` directory rather
|
|
16
|
+
* than reading this list, so a skill missing here still installs — but
|
|
17
|
+
* `lunora rules check` counts against it, and reported "9/9 skills" with an
|
|
18
|
+
* empty "Missing:" line for a project holding all 14. The CLI's rules test
|
|
19
|
+
* pins the two together, since this package cannot see that directory.
|
|
20
|
+
*/
|
|
21
|
+
declare const LUNORA_SKILL_NAMES: ReadonlyArray<string>;
|
|
22
|
+
/** The router skill whose presence marks the rule set as installed. */
|
|
23
|
+
declare const ROOT_SKILL_NAME = "lunora";
|
|
24
|
+
/**
|
|
25
|
+
* The single "rules not installed" message shared by every surface (the CLI
|
|
26
|
+
* `lunora dev` summary and the Vite dev plugin), so the wording and the
|
|
27
|
+
* pointer at `lunora rules install` stay identical wherever it appears.
|
|
28
|
+
*/
|
|
29
|
+
declare const AGENT_RULES_HINT = "Lunora AI rules not installed — run `lunora rules install` so your coding agent knows how to use Lunora.";
|
|
30
|
+
/**
|
|
31
|
+
* Process-tree guard so the hint is emitted at most once. The first surface to
|
|
32
|
+
* print it sets {@link AGENT_RULES_HINT_ENV} on `process.env`; later surfaces (a
|
|
33
|
+
* Vite dev-server restart, or a child process that inherited the env) read it
|
|
34
|
+
* and stay quiet. Returns `true` the first time, `false` afterwards.
|
|
35
|
+
*/
|
|
36
|
+
declare const claimAgentRulesHint: () => boolean;
|
|
37
|
+
interface AgentRulesStatus {
|
|
38
|
+
/**
|
|
39
|
+
* True when the `lunora` router skill is installed. We key on the router
|
|
40
|
+
* (not "all nine present") so a project that intentionally trims the set
|
|
41
|
+
* still counts as installed and isn't nagged.
|
|
42
|
+
*/
|
|
43
|
+
readonly installed: boolean;
|
|
44
|
+
/** Skill names with no `SKILL.md` under `<root>/.agents/skills/<name>/`. */
|
|
45
|
+
readonly missing: ReadonlyArray<string>;
|
|
46
|
+
/** Skill names found under `<root>/.agents/skills/<name>/SKILL.md`. */
|
|
47
|
+
readonly present: ReadonlyArray<string>;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Detect whether the Lunora agent skills are installed in `projectRoot` by
|
|
51
|
+
* checking the skills folder for each `SKILL.md`. Pure filesystem reads, safe to
|
|
52
|
+
* call on every dev-server / CLI startup — the CLI, the Vite plugin, and the
|
|
53
|
+
* studio host all use it to decide whether to surface the "rules not installed"
|
|
54
|
+
* hint.
|
|
55
|
+
*/
|
|
56
|
+
declare const detectAgentRules: (projectRoot: string) => AgentRulesStatus;
|
|
57
|
+
/** The default deploy target — today's behavior for every project. */
|
|
58
|
+
declare const DEFAULT_DEPLOY_TARGET = "cloudflare";
|
|
59
|
+
/** The ids a caller may select, for error messages and `--target` help text. */
|
|
60
|
+
declare const deployTargetIds: () => ReadonlyArray<string>;
|
|
61
|
+
/**
|
|
62
|
+
* Resolve a target name to its driver.
|
|
63
|
+
* @throws when `target` names no registered driver — never falls back to the default.
|
|
64
|
+
*/
|
|
65
|
+
declare const resolveDeployDriver: (target?: string) => DeployDriver;
|
|
66
|
+
/**
|
|
67
|
+
* Whether `target`'s driver ships a `toolchain` — i.e. whether any tool can
|
|
68
|
+
* actually build, serve or deploy it, as opposed to merely generate for it.
|
|
69
|
+
*
|
|
70
|
+
* One predicate rather than one per caller: the CLI (`deploy`, `dev`) and the
|
|
71
|
+
* Vite plugin (`build`, `dev`) must refuse the same set, and a second copy
|
|
72
|
+
* fails silently — the tool that forgot runs the WRONG pipeline for the target
|
|
73
|
+
* instead of rejecting it.
|
|
74
|
+
* @param target A target id already resolved by `resolveTargetOrThrow`. Unknown
|
|
75
|
+
* ids answer `false` rather than throwing, so this is safe to ask about
|
|
76
|
+
* arbitrary input.
|
|
77
|
+
* @returns `true` when the target can be run.
|
|
78
|
+
*/
|
|
79
|
+
declare const isRunnableTarget: (target: string) => boolean;
|
|
80
|
+
/**
|
|
81
|
+
* The subset of {@link deployTargetIds} that {@link isRunnableTarget} accepts,
|
|
82
|
+
* in the same (alphabetical) order.
|
|
83
|
+
* @returns every target id a tool can build, serve or deploy — used to name the
|
|
84
|
+
* alternatives when one is refused.
|
|
85
|
+
*/
|
|
86
|
+
declare const runnableTargetIds: () => ReadonlyArray<string>;
|
|
87
|
+
/**
|
|
88
|
+
* Whether `lunora dev` serves `target`'s worker with the host's own dev server
|
|
89
|
+
* (`DriverToolchain.devServer === "own"`) instead of workerd. The CLI's flavor
|
|
90
|
+
* choice and the Vite plugin's warning both ask this, so it is answered once.
|
|
91
|
+
*/
|
|
92
|
+
declare const targetRunsOwnDevServer: (target: string) => boolean;
|
|
93
|
+
/** A toolchain command planned against the driver's config projection, with nothing written yet. */
|
|
94
|
+
interface ToolchainInvocation {
|
|
95
|
+
command: ToolchainCommand;
|
|
96
|
+
/** Write the projection, if the driver has one. Call only once the command is going to run. */
|
|
97
|
+
commit: () => void;
|
|
98
|
+
/** The projection the command reads, and every key it left out — `undefined` when the host reads the project config as-is. */
|
|
99
|
+
projection: {
|
|
100
|
+
configPath: string;
|
|
101
|
+
dropped: ReadonlyArray<string>;
|
|
102
|
+
} | undefined;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Plan a toolchain call in the one safe order: project the config (in memory),
|
|
106
|
+
* build the argv against the projection's path — which is where a host refuses
|
|
107
|
+
* an option it cannot honour, so a refusal throws here — and only then offer the
|
|
108
|
+
* write. A refused command therefore leaves nothing on disk, and `configPath`
|
|
109
|
+
* is set on every request whose driver projects.
|
|
110
|
+
*/
|
|
111
|
+
declare const planToolchainInvocation: (driver: DeployDriver, projectRoot: string, purpose: ProjectionPurpose, build: (configPath: string | undefined) => ToolchainCommand) => ToolchainInvocation;
|
|
112
|
+
/** The painted ` lunora ` badge, prepended to the plugin's branded log lines. */
|
|
113
|
+
declare const LUNORA_TAG: string;
|
|
114
|
+
/** Prefix a message with the Lunora badge (e.g. `lunoraLine("codegen done")`). */
|
|
115
|
+
declare const lunoraLine: (message: string) => string;
|
|
116
|
+
/**
|
|
117
|
+
* A branded schema-advisory line: the level-coloured badge (`warn`/`error`/`info`)
|
|
118
|
+
* — same badges the CLI reporter uses, so the dev server reads as one tool — then
|
|
119
|
+
* the rule name, the detail, and the remediation. Replaces the old dense
|
|
120
|
+
* `lunora-badge … schema advisory [WARN] …` line with the level-appropriate badge.
|
|
121
|
+
*/
|
|
122
|
+
declare const advisoryLine: (level: "ERROR" | "INFO" | "WARN", name: string, detail: string, remediation: string) => string;
|
|
123
|
+
declare class LunoraReporter {
|
|
124
|
+
#private;
|
|
125
|
+
setStdout(stdout: NodeJS.WriteStream): void;
|
|
126
|
+
setStderr(stderr: NodeJS.WriteStream): void;
|
|
127
|
+
log(meta: unknown): void;
|
|
128
|
+
}
|
|
129
|
+
type PackageManager = "pnpm" | "npm" | "yarn" | "bun";
|
|
130
|
+
/** True when `manager` is on PATH — probed by running `<manager> --version`. Injectable for tests. */
|
|
131
|
+
type PackageManagerProbe = (manager: PackageManager) => boolean;
|
|
132
|
+
/**
|
|
133
|
+
* The package managers actually installed on this machine, in preference order
|
|
134
|
+
* ({@link INSTALL_PREFERENCE} — pnpm > bun > yarn > npm). The first entry is the
|
|
135
|
+
* recommended default for the install prompt; the whole list is what the user
|
|
136
|
+
* picks from. Empty when none are found.
|
|
137
|
+
*/
|
|
138
|
+
declare const detectInstalledManagers: (probe?: PackageManagerProbe) => PackageManager[];
|
|
139
|
+
/** The argv that installs a project's dependencies with `manager` (`<manager> install`). */
|
|
140
|
+
declare const installArgsFor: (manager: PackageManager) => {
|
|
141
|
+
args: string[];
|
|
142
|
+
command: string;
|
|
143
|
+
};
|
|
144
|
+
/**
|
|
145
|
+
* The argv that adds `packages` as new dependencies with `manager` — the
|
|
146
|
+
* counterpart to {@link installArgsFor}, which reinstalls what package.json
|
|
147
|
+
* already declares rather than adding something new to it.
|
|
148
|
+
*
|
|
149
|
+
* npm's dev flag is `--save-dev` (its own docs lead with the long form); bun's
|
|
150
|
+
* is the lowercase `-d` (uppercase `-D` is not one of its recognized flags);
|
|
151
|
+
* pnpm and yarn both take `-D`.
|
|
152
|
+
*/
|
|
153
|
+
declare const addArgsFor: (manager: PackageManager, packages: ReadonlyArray<string>, options?: {
|
|
154
|
+
dev?: boolean;
|
|
155
|
+
}) => {
|
|
156
|
+
args: string[];
|
|
157
|
+
command: string;
|
|
158
|
+
};
|
|
159
|
+
/**
|
|
160
|
+
* Resolve the package manager to drive for the project rooted at (or above)
|
|
161
|
+
* `startDirectory`. Every step is a real signal — Lunora never blindly assumes a
|
|
162
|
+
* particular manager, and there is no hardcoded fallback:
|
|
163
|
+
*
|
|
164
|
+
* 1. `@visulima/package` — the nearest lock file (`pnpm-lock.yaml`, `yarn.lock`,
|
|
165
|
+
* `package-lock.json`, `bun.lockb`) or the `packageManager` field of the nearest
|
|
166
|
+
* `package.json`.
|
|
167
|
+
* 2. The manager that launched this CLI, read from `npm_config_user_agent` (so
|
|
168
|
+
* `pnpm dlx lunora …` / `npx lunora …` resolve to the right manager).
|
|
169
|
+
* 3. The first package manager actually installed on this machine
|
|
170
|
+
* ({@link detectInstalledManagers}).
|
|
171
|
+
*
|
|
172
|
+
* Throws when none of those resolve — i.e. there is no lock file / `packageManager`
|
|
173
|
+
* field, the CLI wasn't launched by a known manager, and none is on `PATH`.
|
|
174
|
+
* Surfacing that is better than silently guessing a manager that can't run.
|
|
175
|
+
*/
|
|
176
|
+
declare const detectPackageManager: (startDirectory: string) => PackageManager;
|
|
177
|
+
/** Map a package manager to the argv pair that runs an installed CLI. */
|
|
178
|
+
declare const execArgsFor: (manager: PackageManager, command: string, args: ReadonlyArray<string>) => {
|
|
179
|
+
args: string[];
|
|
180
|
+
command: string;
|
|
181
|
+
};
|
|
182
|
+
/**
|
|
183
|
+
* The argv that runs a driver's {@link ToolchainCommand}: through the package
|
|
184
|
+
* manager for a project dependency, directly for a binary on `PATH`.
|
|
185
|
+
*/
|
|
186
|
+
declare const toolchainExecArgs: (manager: PackageManager, command: ToolchainCommand) => {
|
|
187
|
+
args: string[];
|
|
188
|
+
command: string;
|
|
189
|
+
};
|
|
190
|
+
/**
|
|
191
|
+
* The argv that runs a project SCRIPT with `manager` — the counterpart to
|
|
192
|
+
* {@link execArgsFor}, which runs a BINARY.
|
|
193
|
+
*
|
|
194
|
+
* All four managers accept `<manager> run <script>`, so this is uniform. It is a
|
|
195
|
+
* separate function because reaching for `execArgsFor(manager, "run", [script])`
|
|
196
|
+
* silently produces something else entirely: `pnpm exec run <script>` fails with
|
|
197
|
+
* `Command "run" not found`, and `npx -- run <script>` resolves the registry
|
|
198
|
+
* PACKAGE named `run` and executes it.
|
|
199
|
+
*/
|
|
200
|
+
declare const runScriptArgsFor: (manager: PackageManager, script: string) => {
|
|
201
|
+
args: string[];
|
|
202
|
+
command: string;
|
|
203
|
+
};
|
|
204
|
+
/** The shell command that runs a project script with `manager` (`pnpm dev`, `npm run dev`, …). */
|
|
205
|
+
declare const runScriptCommand: (manager: PackageManager, script: string) => string;
|
|
206
|
+
/**
|
|
207
|
+
* The `package.json` at `root` as a plain object, or `undefined` when it is
|
|
208
|
+
* missing, unreadable, or not a JSON object. Best-effort on purpose: every
|
|
209
|
+
* caller reads one fact off it (a script, a key, the dependencies) and falls
|
|
210
|
+
* back to its default rather than failing over a broken manifest.
|
|
211
|
+
*/
|
|
212
|
+
declare const readProjectManifest: (root: string) => Readonly<Record<string, unknown>> | undefined;
|
|
213
|
+
/**
|
|
214
|
+
* The manifest's merged `devDependencies` + `dependencies` map — a runtime
|
|
215
|
+
* dependency wins a name declared in both — or `{}` when it cannot be read.
|
|
216
|
+
*/
|
|
217
|
+
declare const readProjectDependencies: (root: string) => Readonly<Record<string, string>>;
|
|
218
|
+
/** The names {@link readProjectDependencies} reads — empty when the manifest cannot be read. */
|
|
219
|
+
declare const readProjectDependencyNames: (root: string) => ReadonlySet<string>;
|
|
220
|
+
/**
|
|
221
|
+
* A badge: the short colored label that prefixes a line. `bg`/`fg` are hex so the
|
|
222
|
+
* same value drives both colorize's `bgHex().hex()` and the tui `<Text>` props.
|
|
223
|
+
*/
|
|
224
|
+
interface BadgeSpec {
|
|
225
|
+
bg: `#${string}`;
|
|
226
|
+
fg: `#${string}`;
|
|
227
|
+
text: string;
|
|
228
|
+
}
|
|
229
|
+
/** Lunora purple — the accent shared with the CLI prompt frames. */
|
|
230
|
+
declare const ACCENT: `#${string}`;
|
|
231
|
+
/** Standard log-level badge names (the restyled base output). */
|
|
232
|
+
type LevelBadgeName = "debug" | "error" | "info" | "success" | "warn";
|
|
233
|
+
/** Step-phase badge names (the create-astro-style flow transcript). */
|
|
234
|
+
type StepBadgeName = "add" | "deps" | "dir" | "git" | "lunora" | "next" | "tmpl";
|
|
235
|
+
type BadgeName = LevelBadgeName | StepBadgeName;
|
|
236
|
+
/** The ordered step-phase names, used to register custom pail log types. */
|
|
237
|
+
declare const STEP_BADGE_NAMES: ReadonlyArray<StepBadgeName>;
|
|
238
|
+
/**
|
|
239
|
+
* Every badge, keyed by name. Levels get their conventional colors (red/amber/
|
|
240
|
+
* green/blue/grey); step phases follow create-astro's green→purple→cyan rhythm.
|
|
241
|
+
*/
|
|
242
|
+
declare const BADGES: Record<BadgeName, BadgeSpec>;
|
|
243
|
+
/**
|
|
244
|
+
* Luna, the mascot: the folklore rabbit-in-the-moon — a bunny tucked inside the
|
|
245
|
+
* moon disc. Pure ASCII so it renders the same everywhere (including piped logs).
|
|
246
|
+
* The CLI signs off the `init` flow with it, the way create-astro closes with
|
|
247
|
+
* Houston.
|
|
248
|
+
*/
|
|
249
|
+
declare const LUNA_NAME = "Luna";
|
|
250
|
+
declare const LUNA_SIGNOFF = "Safe travels, voyager.";
|
|
251
|
+
declare const LUNA_BUNNY: string;
|
|
252
|
+
/**
|
|
253
|
+
* {@link LUNA_BUNNY} with its leading newline stripped, ready to render inline
|
|
254
|
+
* (beside the name + sign-off). Both render paths — the tui mascot frame and the
|
|
255
|
+
* pail off-TTY fallback — use this so neither re-implements the strip.
|
|
256
|
+
*/
|
|
257
|
+
declare const LUNA_ART: string;
|
|
258
|
+
/** The colored part of a badge — the word with one space of padding each side. */
|
|
259
|
+
declare const padBadge: (text: string) => string;
|
|
260
|
+
/** Leading spaces that right-align a badge's box within the gutter. */
|
|
261
|
+
declare const badgeLead: (text: string) => string;
|
|
262
|
+
/** Total columns a rendered badge column occupies (lead + box), constant across badges. */
|
|
263
|
+
declare const BADGE_COLUMN_WIDTH: number;
|
|
264
|
+
/** Columns a rendered badge occupies — the gutter-aligned column width. */
|
|
265
|
+
declare const badgeWidth: (_spec: BadgeSpec) => number;
|
|
266
|
+
/** Paint a badge as an ANSI string (the non-tui path): right-aligning spaces + the colored box. */
|
|
267
|
+
declare const paintBadge: (spec: BadgeSpec) => string;
|
|
268
|
+
/** Dim continuation text (a step's chosen answer, shown under the question). */
|
|
269
|
+
declare const paintAnswer: (text: string) => string;
|
|
270
|
+
export { ACCENT as A, BADGES as B, installArgsFor as C, DEFAULT_DEPLOY_TARGET as D, isRunnableTarget as E, lunoraLine as F, padBadge as G, paintAnswer as H, paintBadge as I, planToolchainInvocation as J, readProjectDependencies as K, LUNA_ART as L, readProjectDependencyNames as M, readProjectManifest as N, resolveDeployDriver as O, PackageManager as P, runScriptArgsFor as Q, ROOT_SKILL_NAME as R, STEP_BADGE_NAMES as S, ToolchainInvocation as T, runScriptCommand as U, runnableTargetIds as V, targetRunsOwnDevServer as W, toolchainExecArgs as X, AGENT_RULES_DIR as a, AGENT_RULES_HINT as b, AGENT_RULES_HINT_ENV as c, AgentRulesStatus as d, BADGE_COLUMN_WIDTH as e, BadgeName as f, BadgeSpec as g, LUNA_BUNNY as h, LUNA_NAME as i, LUNA_SIGNOFF as j, LUNORA_SKILL_NAMES as k, LUNORA_TAG as l, LevelBadgeName as m, LunoraReporter as n, PackageManagerProbe as o, StepBadgeName as p, addArgsFor as q, advisoryLine as r, badgeLead as s, badgeWidth as t, claimAgentRulesHint as u, deployTargetIds as v, detectAgentRules as w, detectInstalledManagers as x, detectPackageManager as y, execArgsFor as z };
|
|
@@ -0,0 +1,270 @@
|
|
|
1
|
+
import { e as ToolchainCommand, D as DeployDriver, d as ProjectionPurpose } from "./deploy-driver.d-DraUd2R2.js";
|
|
2
|
+
/**
|
|
3
|
+
* Project-relative directory the Lunora agent skills ("rules") install into.
|
|
4
|
+
* This is the portable [Agent Skills](https://tanstack.com/intent/latest/docs/registry)
|
|
5
|
+
* location — Cursor, Claude Code, and GitHub Copilot all discover skills here.
|
|
6
|
+
*/
|
|
7
|
+
declare const AGENT_RULES_DIR = ".agents/skills";
|
|
8
|
+
/** Env var the once-per-process-tree hint guard ({@link claimAgentRulesHint}) sets. */
|
|
9
|
+
declare const AGENT_RULES_HINT_ENV = "LUNORA_RULES_HINT_SHOWN";
|
|
10
|
+
/**
|
|
11
|
+
* The Lunora agent skills shipped by `@lunora/cli`. The first entry (`lunora`)
|
|
12
|
+
* is the router skill — its presence is what {@link detectAgentRules} treats as
|
|
13
|
+
* "rules installed", since every other skill is reachable through it.
|
|
14
|
+
*
|
|
15
|
+
* `lunora rules install` enumerates `@lunora/cli`'s `skills/` directory rather
|
|
16
|
+
* than reading this list, so a skill missing here still installs — but
|
|
17
|
+
* `lunora rules check` counts against it, and reported "9/9 skills" with an
|
|
18
|
+
* empty "Missing:" line for a project holding all 14. The CLI's rules test
|
|
19
|
+
* pins the two together, since this package cannot see that directory.
|
|
20
|
+
*/
|
|
21
|
+
declare const LUNORA_SKILL_NAMES: ReadonlyArray<string>;
|
|
22
|
+
/** The router skill whose presence marks the rule set as installed. */
|
|
23
|
+
declare const ROOT_SKILL_NAME = "lunora";
|
|
24
|
+
/**
|
|
25
|
+
* The single "rules not installed" message shared by every surface (the CLI
|
|
26
|
+
* `lunora dev` summary and the Vite dev plugin), so the wording and the
|
|
27
|
+
* pointer at `lunora rules install` stay identical wherever it appears.
|
|
28
|
+
*/
|
|
29
|
+
declare const AGENT_RULES_HINT = "Lunora AI rules not installed — run `lunora rules install` so your coding agent knows how to use Lunora.";
|
|
30
|
+
/**
|
|
31
|
+
* Process-tree guard so the hint is emitted at most once. The first surface to
|
|
32
|
+
* print it sets {@link AGENT_RULES_HINT_ENV} on `process.env`; later surfaces (a
|
|
33
|
+
* Vite dev-server restart, or a child process that inherited the env) read it
|
|
34
|
+
* and stay quiet. Returns `true` the first time, `false` afterwards.
|
|
35
|
+
*/
|
|
36
|
+
declare const claimAgentRulesHint: () => boolean;
|
|
37
|
+
interface AgentRulesStatus {
|
|
38
|
+
/**
|
|
39
|
+
* True when the `lunora` router skill is installed. We key on the router
|
|
40
|
+
* (not "all nine present") so a project that intentionally trims the set
|
|
41
|
+
* still counts as installed and isn't nagged.
|
|
42
|
+
*/
|
|
43
|
+
readonly installed: boolean;
|
|
44
|
+
/** Skill names with no `SKILL.md` under `<root>/.agents/skills/<name>/`. */
|
|
45
|
+
readonly missing: ReadonlyArray<string>;
|
|
46
|
+
/** Skill names found under `<root>/.agents/skills/<name>/SKILL.md`. */
|
|
47
|
+
readonly present: ReadonlyArray<string>;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Detect whether the Lunora agent skills are installed in `projectRoot` by
|
|
51
|
+
* checking the skills folder for each `SKILL.md`. Pure filesystem reads, safe to
|
|
52
|
+
* call on every dev-server / CLI startup — the CLI, the Vite plugin, and the
|
|
53
|
+
* studio host all use it to decide whether to surface the "rules not installed"
|
|
54
|
+
* hint.
|
|
55
|
+
*/
|
|
56
|
+
declare const detectAgentRules: (projectRoot: string) => AgentRulesStatus;
|
|
57
|
+
/** The default deploy target — today's behavior for every project. */
|
|
58
|
+
declare const DEFAULT_DEPLOY_TARGET = "cloudflare";
|
|
59
|
+
/** The ids a caller may select, for error messages and `--target` help text. */
|
|
60
|
+
declare const deployTargetIds: () => ReadonlyArray<string>;
|
|
61
|
+
/**
|
|
62
|
+
* Resolve a target name to its driver.
|
|
63
|
+
* @throws when `target` names no registered driver — never falls back to the default.
|
|
64
|
+
*/
|
|
65
|
+
declare const resolveDeployDriver: (target?: string) => DeployDriver;
|
|
66
|
+
/**
|
|
67
|
+
* Whether `target`'s driver ships a `toolchain` — i.e. whether any tool can
|
|
68
|
+
* actually build, serve or deploy it, as opposed to merely generate for it.
|
|
69
|
+
*
|
|
70
|
+
* One predicate rather than one per caller: the CLI (`deploy`, `dev`) and the
|
|
71
|
+
* Vite plugin (`build`, `dev`) must refuse the same set, and a second copy
|
|
72
|
+
* fails silently — the tool that forgot runs the WRONG pipeline for the target
|
|
73
|
+
* instead of rejecting it.
|
|
74
|
+
* @param target A target id already resolved by `resolveTargetOrThrow`. Unknown
|
|
75
|
+
* ids answer `false` rather than throwing, so this is safe to ask about
|
|
76
|
+
* arbitrary input.
|
|
77
|
+
* @returns `true` when the target can be run.
|
|
78
|
+
*/
|
|
79
|
+
declare const isRunnableTarget: (target: string) => boolean;
|
|
80
|
+
/**
|
|
81
|
+
* The subset of {@link deployTargetIds} that {@link isRunnableTarget} accepts,
|
|
82
|
+
* in the same (alphabetical) order.
|
|
83
|
+
* @returns every target id a tool can build, serve or deploy — used to name the
|
|
84
|
+
* alternatives when one is refused.
|
|
85
|
+
*/
|
|
86
|
+
declare const runnableTargetIds: () => ReadonlyArray<string>;
|
|
87
|
+
/**
|
|
88
|
+
* Whether `lunora dev` serves `target`'s worker with the host's own dev server
|
|
89
|
+
* (`DriverToolchain.devServer === "own"`) instead of workerd. The CLI's flavor
|
|
90
|
+
* choice and the Vite plugin's warning both ask this, so it is answered once.
|
|
91
|
+
*/
|
|
92
|
+
declare const targetRunsOwnDevServer: (target: string) => boolean;
|
|
93
|
+
/** A toolchain command planned against the driver's config projection, with nothing written yet. */
|
|
94
|
+
interface ToolchainInvocation {
|
|
95
|
+
command: ToolchainCommand;
|
|
96
|
+
/** Write the projection, if the driver has one. Call only once the command is going to run. */
|
|
97
|
+
commit: () => void;
|
|
98
|
+
/** The projection the command reads, and every key it left out — `undefined` when the host reads the project config as-is. */
|
|
99
|
+
projection: {
|
|
100
|
+
configPath: string;
|
|
101
|
+
dropped: ReadonlyArray<string>;
|
|
102
|
+
} | undefined;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Plan a toolchain call in the one safe order: project the config (in memory),
|
|
106
|
+
* build the argv against the projection's path — which is where a host refuses
|
|
107
|
+
* an option it cannot honour, so a refusal throws here — and only then offer the
|
|
108
|
+
* write. A refused command therefore leaves nothing on disk, and `configPath`
|
|
109
|
+
* is set on every request whose driver projects.
|
|
110
|
+
*/
|
|
111
|
+
declare const planToolchainInvocation: (driver: DeployDriver, projectRoot: string, purpose: ProjectionPurpose, build: (configPath: string | undefined) => ToolchainCommand) => ToolchainInvocation;
|
|
112
|
+
/** The painted ` lunora ` badge, prepended to the plugin's branded log lines. */
|
|
113
|
+
declare const LUNORA_TAG: string;
|
|
114
|
+
/** Prefix a message with the Lunora badge (e.g. `lunoraLine("codegen done")`). */
|
|
115
|
+
declare const lunoraLine: (message: string) => string;
|
|
116
|
+
/**
|
|
117
|
+
* A branded schema-advisory line: the level-coloured badge (`warn`/`error`/`info`)
|
|
118
|
+
* — same badges the CLI reporter uses, so the dev server reads as one tool — then
|
|
119
|
+
* the rule name, the detail, and the remediation. Replaces the old dense
|
|
120
|
+
* `lunora-badge … schema advisory [WARN] …` line with the level-appropriate badge.
|
|
121
|
+
*/
|
|
122
|
+
declare const advisoryLine: (level: "ERROR" | "INFO" | "WARN", name: string, detail: string, remediation: string) => string;
|
|
123
|
+
declare class LunoraReporter {
|
|
124
|
+
#private;
|
|
125
|
+
setStdout(stdout: NodeJS.WriteStream): void;
|
|
126
|
+
setStderr(stderr: NodeJS.WriteStream): void;
|
|
127
|
+
log(meta: unknown): void;
|
|
128
|
+
}
|
|
129
|
+
type PackageManager = "pnpm" | "npm" | "yarn" | "bun";
|
|
130
|
+
/** True when `manager` is on PATH — probed by running `<manager> --version`. Injectable for tests. */
|
|
131
|
+
type PackageManagerProbe = (manager: PackageManager) => boolean;
|
|
132
|
+
/**
|
|
133
|
+
* The package managers actually installed on this machine, in preference order
|
|
134
|
+
* ({@link INSTALL_PREFERENCE} — pnpm > bun > yarn > npm). The first entry is the
|
|
135
|
+
* recommended default for the install prompt; the whole list is what the user
|
|
136
|
+
* picks from. Empty when none are found.
|
|
137
|
+
*/
|
|
138
|
+
declare const detectInstalledManagers: (probe?: PackageManagerProbe) => PackageManager[];
|
|
139
|
+
/** The argv that installs a project's dependencies with `manager` (`<manager> install`). */
|
|
140
|
+
declare const installArgsFor: (manager: PackageManager) => {
|
|
141
|
+
args: string[];
|
|
142
|
+
command: string;
|
|
143
|
+
};
|
|
144
|
+
/**
|
|
145
|
+
* The argv that adds `packages` as new dependencies with `manager` — the
|
|
146
|
+
* counterpart to {@link installArgsFor}, which reinstalls what package.json
|
|
147
|
+
* already declares rather than adding something new to it.
|
|
148
|
+
*
|
|
149
|
+
* npm's dev flag is `--save-dev` (its own docs lead with the long form); bun's
|
|
150
|
+
* is the lowercase `-d` (uppercase `-D` is not one of its recognized flags);
|
|
151
|
+
* pnpm and yarn both take `-D`.
|
|
152
|
+
*/
|
|
153
|
+
declare const addArgsFor: (manager: PackageManager, packages: ReadonlyArray<string>, options?: {
|
|
154
|
+
dev?: boolean;
|
|
155
|
+
}) => {
|
|
156
|
+
args: string[];
|
|
157
|
+
command: string;
|
|
158
|
+
};
|
|
159
|
+
/**
|
|
160
|
+
* Resolve the package manager to drive for the project rooted at (or above)
|
|
161
|
+
* `startDirectory`. Every step is a real signal — Lunora never blindly assumes a
|
|
162
|
+
* particular manager, and there is no hardcoded fallback:
|
|
163
|
+
*
|
|
164
|
+
* 1. `@visulima/package` — the nearest lock file (`pnpm-lock.yaml`, `yarn.lock`,
|
|
165
|
+
* `package-lock.json`, `bun.lockb`) or the `packageManager` field of the nearest
|
|
166
|
+
* `package.json`.
|
|
167
|
+
* 2. The manager that launched this CLI, read from `npm_config_user_agent` (so
|
|
168
|
+
* `pnpm dlx lunora …` / `npx lunora …` resolve to the right manager).
|
|
169
|
+
* 3. The first package manager actually installed on this machine
|
|
170
|
+
* ({@link detectInstalledManagers}).
|
|
171
|
+
*
|
|
172
|
+
* Throws when none of those resolve — i.e. there is no lock file / `packageManager`
|
|
173
|
+
* field, the CLI wasn't launched by a known manager, and none is on `PATH`.
|
|
174
|
+
* Surfacing that is better than silently guessing a manager that can't run.
|
|
175
|
+
*/
|
|
176
|
+
declare const detectPackageManager: (startDirectory: string) => PackageManager;
|
|
177
|
+
/** Map a package manager to the argv pair that runs an installed CLI. */
|
|
178
|
+
declare const execArgsFor: (manager: PackageManager, command: string, args: ReadonlyArray<string>) => {
|
|
179
|
+
args: string[];
|
|
180
|
+
command: string;
|
|
181
|
+
};
|
|
182
|
+
/**
|
|
183
|
+
* The argv that runs a driver's {@link ToolchainCommand}: through the package
|
|
184
|
+
* manager for a project dependency, directly for a binary on `PATH`.
|
|
185
|
+
*/
|
|
186
|
+
declare const toolchainExecArgs: (manager: PackageManager, command: ToolchainCommand) => {
|
|
187
|
+
args: string[];
|
|
188
|
+
command: string;
|
|
189
|
+
};
|
|
190
|
+
/**
|
|
191
|
+
* The argv that runs a project SCRIPT with `manager` — the counterpart to
|
|
192
|
+
* {@link execArgsFor}, which runs a BINARY.
|
|
193
|
+
*
|
|
194
|
+
* All four managers accept `<manager> run <script>`, so this is uniform. It is a
|
|
195
|
+
* separate function because reaching for `execArgsFor(manager, "run", [script])`
|
|
196
|
+
* silently produces something else entirely: `pnpm exec run <script>` fails with
|
|
197
|
+
* `Command "run" not found`, and `npx -- run <script>` resolves the registry
|
|
198
|
+
* PACKAGE named `run` and executes it.
|
|
199
|
+
*/
|
|
200
|
+
declare const runScriptArgsFor: (manager: PackageManager, script: string) => {
|
|
201
|
+
args: string[];
|
|
202
|
+
command: string;
|
|
203
|
+
};
|
|
204
|
+
/** The shell command that runs a project script with `manager` (`pnpm dev`, `npm run dev`, …). */
|
|
205
|
+
declare const runScriptCommand: (manager: PackageManager, script: string) => string;
|
|
206
|
+
/**
|
|
207
|
+
* The `package.json` at `root` as a plain object, or `undefined` when it is
|
|
208
|
+
* missing, unreadable, or not a JSON object. Best-effort on purpose: every
|
|
209
|
+
* caller reads one fact off it (a script, a key, the dependencies) and falls
|
|
210
|
+
* back to its default rather than failing over a broken manifest.
|
|
211
|
+
*/
|
|
212
|
+
declare const readProjectManifest: (root: string) => Readonly<Record<string, unknown>> | undefined;
|
|
213
|
+
/**
|
|
214
|
+
* The manifest's merged `devDependencies` + `dependencies` map — a runtime
|
|
215
|
+
* dependency wins a name declared in both — or `{}` when it cannot be read.
|
|
216
|
+
*/
|
|
217
|
+
declare const readProjectDependencies: (root: string) => Readonly<Record<string, string>>;
|
|
218
|
+
/** The names {@link readProjectDependencies} reads — empty when the manifest cannot be read. */
|
|
219
|
+
declare const readProjectDependencyNames: (root: string) => ReadonlySet<string>;
|
|
220
|
+
/**
|
|
221
|
+
* A badge: the short colored label that prefixes a line. `bg`/`fg` are hex so the
|
|
222
|
+
* same value drives both colorize's `bgHex().hex()` and the tui `<Text>` props.
|
|
223
|
+
*/
|
|
224
|
+
interface BadgeSpec {
|
|
225
|
+
bg: `#${string}`;
|
|
226
|
+
fg: `#${string}`;
|
|
227
|
+
text: string;
|
|
228
|
+
}
|
|
229
|
+
/** Lunora purple — the accent shared with the CLI prompt frames. */
|
|
230
|
+
declare const ACCENT: `#${string}`;
|
|
231
|
+
/** Standard log-level badge names (the restyled base output). */
|
|
232
|
+
type LevelBadgeName = "debug" | "error" | "info" | "success" | "warn";
|
|
233
|
+
/** Step-phase badge names (the create-astro-style flow transcript). */
|
|
234
|
+
type StepBadgeName = "add" | "deps" | "dir" | "git" | "lunora" | "next" | "tmpl";
|
|
235
|
+
type BadgeName = LevelBadgeName | StepBadgeName;
|
|
236
|
+
/** The ordered step-phase names, used to register custom pail log types. */
|
|
237
|
+
declare const STEP_BADGE_NAMES: ReadonlyArray<StepBadgeName>;
|
|
238
|
+
/**
|
|
239
|
+
* Every badge, keyed by name. Levels get their conventional colors (red/amber/
|
|
240
|
+
* green/blue/grey); step phases follow create-astro's green→purple→cyan rhythm.
|
|
241
|
+
*/
|
|
242
|
+
declare const BADGES: Record<BadgeName, BadgeSpec>;
|
|
243
|
+
/**
|
|
244
|
+
* Luna, the mascot: the folklore rabbit-in-the-moon — a bunny tucked inside the
|
|
245
|
+
* moon disc. Pure ASCII so it renders the same everywhere (including piped logs).
|
|
246
|
+
* The CLI signs off the `init` flow with it, the way create-astro closes with
|
|
247
|
+
* Houston.
|
|
248
|
+
*/
|
|
249
|
+
declare const LUNA_NAME = "Luna";
|
|
250
|
+
declare const LUNA_SIGNOFF = "Safe travels, voyager.";
|
|
251
|
+
declare const LUNA_BUNNY: string;
|
|
252
|
+
/**
|
|
253
|
+
* {@link LUNA_BUNNY} with its leading newline stripped, ready to render inline
|
|
254
|
+
* (beside the name + sign-off). Both render paths — the tui mascot frame and the
|
|
255
|
+
* pail off-TTY fallback — use this so neither re-implements the strip.
|
|
256
|
+
*/
|
|
257
|
+
declare const LUNA_ART: string;
|
|
258
|
+
/** The colored part of a badge — the word with one space of padding each side. */
|
|
259
|
+
declare const padBadge: (text: string) => string;
|
|
260
|
+
/** Leading spaces that right-align a badge's box within the gutter. */
|
|
261
|
+
declare const badgeLead: (text: string) => string;
|
|
262
|
+
/** Total columns a rendered badge column occupies (lead + box), constant across badges. */
|
|
263
|
+
declare const BADGE_COLUMN_WIDTH: number;
|
|
264
|
+
/** Columns a rendered badge occupies — the gutter-aligned column width. */
|
|
265
|
+
declare const badgeWidth: (_spec: BadgeSpec) => number;
|
|
266
|
+
/** Paint a badge as an ANSI string (the non-tui path): right-aligning spaces + the colored box. */
|
|
267
|
+
declare const paintBadge: (spec: BadgeSpec) => string;
|
|
268
|
+
/** Dim continuation text (a step's chosen answer, shown under the question). */
|
|
269
|
+
declare const paintAnswer: (text: string) => string;
|
|
270
|
+
export { ACCENT as A, BADGES as B, installArgsFor as C, DEFAULT_DEPLOY_TARGET as D, isRunnableTarget as E, lunoraLine as F, padBadge as G, paintAnswer as H, paintBadge as I, planToolchainInvocation as J, readProjectDependencies as K, LUNA_ART as L, readProjectDependencyNames as M, readProjectManifest as N, resolveDeployDriver as O, PackageManager as P, runScriptArgsFor as Q, ROOT_SKILL_NAME as R, STEP_BADGE_NAMES as S, ToolchainInvocation as T, runScriptCommand as U, runnableTargetIds as V, targetRunsOwnDevServer as W, toolchainExecArgs as X, AGENT_RULES_DIR as a, AGENT_RULES_HINT as b, AGENT_RULES_HINT_ENV as c, AgentRulesStatus as d, BADGE_COLUMN_WIDTH as e, BadgeName as f, BadgeSpec as g, LUNA_BUNNY as h, LUNA_NAME as i, LUNA_SIGNOFF as j, LUNORA_SKILL_NAMES as k, LUNORA_TAG as l, LevelBadgeName as m, LunoraReporter as n, PackageManagerProbe as o, StepBadgeName as p, addArgsFor as q, advisoryLine as r, badgeLead as s, badgeWidth as t, claimAgentRulesHint as u, deployTargetIds as v, detectAgentRules as w, detectInstalledManagers as x, detectPackageManager as y, execArgsFor as z };
|