@theholocron/astromech 5.0.0-alpha.45 → 5.0.0-alpha.451

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,41 +1,608 @@
1
- import { r as TasksConfig } from "./schema-D01VYg43.mjs";
2
- //#region src/run.d.ts
3
- /**
4
- * `holocron run <task> [job] [-- <passthrough>]` — run a registry task (or one
5
- * of its sub-jobs) locally.
6
- *
7
- * A `job` argument only applies to tasks that declare `jobs`; for any other
8
- * task it is folded back into the passthrough (`holocron run delivery.build
9
- * src/`).
10
- *
11
- * Resolution:
12
- *
13
- * J. job given → TASKS[task].jobs[job].local (unknown job → exit 1)
14
- * 1. turbo.json defines the task → `turbo run <task>`
15
- * 2. package.json has a `<task>` script → `<pm> run <task>`
16
- * (unless it's the `holocron run …` thin caller — that recurses)
17
- * 3. TASKS[task].local resolves → `<tool> <args> <org-flags> <passthrough>`
18
- * 3b. TASKS[task].linterGroup → run each resolved linter natively (see below)
19
- * 4. TASKS[task].jobs has entries → run each job in declared order
20
- * 5. TASKS[task].local === null → "enforced in CI" (skip, even with --required)
21
- * 5b. known task, nothing resolved → "no <task> task" (exit 0, or 1 with --required)
22
- * 6. unknown task → "unknown task" (exit 1)
23
- *
24
- * A `linterGroup` task (`sourceQuality.staticAnalysis`, etc.) runs its fixed
25
- * set of `linters.ts` entries, each still gated by that linter's own
26
- * `detect`/`always` rule — every entry runs its `localBin` natively when
27
- * found on PATH. Missing tools are flagged; the exit code is the worst of
28
- * the lot. Unlike the old single `lint` task, this check runs *after*
29
- * turbo/`package.json` resolution (step 3b, not step 0) — a `linterGroup`
30
- * task is a normal turbo-delegatable task like any other.
1
+ /**
2
+ * `@theholocron/astromech` — the Holocron task runner.
3
+ *
4
+ * An astromech droid runs a starfighter's maintenance, diagnostics and
5
+ * system wiring while the pilot flies. This does that for a repo: one
6
+ * task manifest drives `holocron run` (local), `holocron run ci` (the CI
7
+ * suite locally), the generated GitHub Actions workflows, the
8
+ * `package.json` scripts, the linter set, and the required-checks list.
9
+ *
10
+ * A plain library — not a capability plugin. `@theholocron/cli` depends
11
+ * on it and instantiates it once.
12
+ *
13
+ * ```ts
14
+ * import { createAstromech } from "@theholocron/astromech";
15
+ *
16
+ * const astromech = createAstromech({ cwd });
17
+ * const report = astromech.run("test", { passthrough: ["--watch"] });
18
+ * ```
19
+ *
20
+ * The config surface (`defineConfig`, `TasksConfig`, `loadTasksConfig`)
21
+ * lives in the zero-runtime-dep `@theholocron/astromech/config` subpath.
22
+ */
23
+ import { r as TasksConfig } from "./schema.type-DRfLKO70.mjs";
24
+ /** What the `ci` aggregate check waits on, as the two inputs of its reusable workflow. */
25
+ interface AggregateChecks {
26
+ /**
27
+ * Check ids: each must have a check run named `<id> / ...`. The part of a check context before its first ` / `
28
+ * (the caller job's name), so a renamed called job or a matrix label cannot break the match.
29
+ */
30
+ expected: string[];
31
+ /** Commit-status contexts (`codecov/patch`, ...) that must reach `success`. */
32
+ statuses: string[];
33
+ }
34
+ /**
35
+ * The `expected` ids and `statuses` the `ci` aggregate waits on, derived from the same list `requiredChecks()` read
36
+ * before the aggregate: every `required: true` task, then the `extraRequiredChecks`. `DCO` is left out because it stays
37
+ * its own required context. The ids are the callers' job names, which GitHub puts before the " / " of each check they post.
38
+ */
39
+ export declare function aggregateChecks(config: TasksConfig): AggregateChecks;
40
+ /**
41
+ * Where the reusable workflows and composite actions that every generated workflow calls are hosted, and at which ref.
42
+ * This is the only place that says so: the templates are written against the spelling in {@link TEMPLATE_HOME}, and
43
+ * {@link rehome} rewrites it to {@link CI_HOME} once, where the template maps are built. Moving the home is a change
44
+ * to {@link CI_HOME} alone (spec `tech-workflows-in-holocron`, issue #1474).
45
+ */
46
+ /** The base path of a hosted workflow or action, without its name: `<owner>/<repo>/<dir>`, and the ref to run it at. */
47
+ interface CiHome {
48
+ /** Base of the reusable workflows; a name and `.yml` follow. */
49
+ workflows: string;
50
+ /** Base of the composite actions; a name follows. */
51
+ actions: string;
52
+ /** The git ref every reference is pinned to. */
53
+ ref: string;
54
+ }
55
+ /**
56
+ * The org slug a CLI user gets when no config names one. Where a resolved config is in reach, `config.org` is the
57
+ * source and this is only the fallback; a command with no config (`new repo`, `sync github`, `publish --sync-trust`)
58
+ * uses it as it is.
59
+ */
60
+ export declare const DEFAULT_ORG = "theholocron";
61
+ /** The `owner/repo` of the org's `.github` repo, which hosts the frozen reusable workflows (and Sentinel's dispatch target). */
62
+ export declare const DOT_GITHUB_REPO = "theholocron/.github";
63
+ /** The `owner/repo` of this monorepo, where the CLI, the reusables' sources and the Trusted Publisher config live. */
64
+ export declare const HOLOCRON_REPO = "theholocron/holocron";
65
+ /** How the templates spell a reference. Never emitted as it is, and never to be changed: {@link rehome} reads it. */
66
+ export declare const TEMPLATE_HOME: CiHome;
67
+ /**
68
+ * Whether a caller that calls its reusables at `home` keeps the names it had before they became the task id (the
69
+ * legacy-name gate): while 'home' is the frozen copies on `main`, the callers of a repo other than the one that hosts
70
+ * the reusables keep their old workflow, job and file names, because their rulesets list the checks those post. `ci-v1`
71
+ * has only flat names, so the gate is open there and every caller is flat (spec `ci-flat-task-vocabulary`, phase K).
72
+ */
73
+ export declare function legacyGate(home?: CiHome): boolean;
74
+ /**
75
+ * `text` with every reference to a hosted reusable workflow at `home` rewritten to the file in the same checkout
76
+ * (`./.github/workflows/<name>.yml`, always the flat name, whichever spelling the reference had). For the repo that hosts the reusables: its own callers then run the reusable at
77
+ * their own commit, so a PR that edits one exercises it. Composite actions are left on their full ref, because a
78
+ * reusable called from another repository cannot see this checkout.
79
+ */
80
+ export declare function localize(text: string, home?: CiHome): string;
81
+ /**
82
+ * `text` with each reference to a hosted composite action in `names` at `home` rewritten to its folder in the same
83
+ * checkout (`./ci/actions/<name>`). For the written copy of a reusable in the repo that hosts it, which only that
84
+ * repo's own callers run: a change to the action then takes effect at the PR's own commit, instead of waiting for
85
+ * the frozen copy in `theholocron/.github` that `home` still names. An action not in `names` keeps its full ref.
86
+ */
87
+ export declare function localizeActions(text: string, names: readonly string[], home?: CiHome): string;
88
+ /**
89
+ * How strictly a repo enforces doc-comment coverage of its public API (`repoValidation.docsCoverage`, spec
90
+ * `tech-api-docs`): `off` (the default) does nothing, `warn` reports without failing and posts informational Codecov
91
+ * statuses, `required` fails the check and posts statuses that are not informational.
92
+ */
93
+ type DocsCoverageMode = "off" | "warn" | "required";
94
+ /** Per-repo choices that change what the `codecov.yml` generator writes. */
95
+ interface CodecovConfigOptions {
96
+ /** Adds the `documentation` flag and its statuses to `codecov.yml`. Default `off`: nothing is added. */
97
+ docsCoverage?: DocsCoverageMode;
98
+ }
99
+ /** A workspace package as the `codecov.yml` generator sees it: the flag and component it gets, and where it lives. */
100
+ interface WorkspacePackage$1 {
101
+ /** The package's folder name, used as its Codecov flag and component id. */
102
+ slug: string;
103
+ /** The package's npm name. */
104
+ name: string;
105
+ /** The workspace root the package was discovered under (`packages`, `apps`, `clients`, ...). Defaults to `"packages"`. */
106
+ dir?: string;
107
+ /**
108
+ * Repo-relative directory, set when it is not `<dir>/<slug>` -- a package that
109
+ * is itself a workspace folder (`observability`) or sits deeper (`docs/theme`).
110
+ */
111
+ path?: string;
112
+ }
113
+ /** The YAML list of components, one per package and grouped by workspace root, that `codecov.yml` carries. */
114
+ export declare function codecovComponentBlock(packages: WorkspacePackage$1[]): string;
115
+ /**
116
+ * Ensure every codecov status default carries `if_not_found: success`, so an
117
+ * infra-only PR (dep bump, config, lockfile — no coverable change) passes
118
+ * instead of hanging forever on a required check codecov never posts.
119
+ *
120
+ * Injects the key on the line after each `target:` that sits inside a status
121
+ * block (`coverage.status.*.default` or a `statuses:` list item — indent ≥ 8,
122
+ * or ≥ 8 for a `- type:` list entry), when the immediate sibling lines do not
123
+ * already declare it.
124
+ */
125
+ export declare function ensureIfNotFound(yaml: string): string;
126
+ /**
127
+ * The `uploads` input of the `verification.unitTests` workflow: a JSON list of `{ flag, files }`, one per package
128
+ * that has a flag. `files` is where the package writes its lcov report (`<location>/coverage/lcov.info`), unless
129
+ * `lcovPaths` names another for that slug (a package whose test runner writes it elsewhere).
130
+ */
131
+ export declare function codecovUploads(packages: WorkspacePackage$1[], lcovPaths?: Record<string, string>): string;
132
+ /**
133
+ * Brings an existing `codecov.yml` up to date with the workspace packages (flags, components and status rules) and the
134
+ * repo's `options`, keeping every hand edit.
135
+ */
136
+ export declare function mergeCodecovComponents(existing: string, packages: WorkspacePackage$1[], options?: CodecovConfigOptions): string;
137
+ /**
138
+ * Every package the repo's `pnpm-workspace.yaml` declares (the default roots
139
+ * when it declares none), sorted by location, so each group folder (`cli/`, `plugins/`, ...) stays together. Every one needs a
140
+ * codecov component so `codecov/patch/<slug>` actually posts for each. A
141
+ * package at `<root>/<slug>` carries `dir: <root>`; one that is itself a
142
+ * workspace folder (`observability`) or sits deeper (`docs/theme`) carries its
143
+ * `path`. Two packages with the same folder name are told apart by their full
144
+ * path (`docs-theme`). `[]` when there are none.
145
+ */
146
+ export declare function readWorkspacePackages(repoRoot: string): WorkspacePackage$1[];
147
+ /** A brand-new `codecov.yml` — the scaffold header + the base template + this repo's component list. */
148
+ export declare function createCodecovConfig(packages: WorkspacePackage$1[], options?: CodecovConfigOptions): string;
149
+ /**
150
+ * The full pipeline `holocron setup` needs: read this repo's public
151
+ * `packages/*`, then either merge them into an `existing` `codecov.yml` or
152
+ * scaffold a new one.
153
+ */
154
+ export declare function codecovConfig(repoRoot: string, existing: string | null, options?: CodecovConfigOptions): string;
155
+ /**
156
+ * The **reusable** GitHub Actions surface pushed to `theholocron/.github` by
157
+ * `holocron sync github` — the `workflow_call` implementations and composite
158
+ * actions that every repo's thin callers delegate to.
159
+ *
160
+ * `theholocron/.github` is a **pure sync target**: `.github/workflows/*`,
161
+ * `.github/actions/*` and `workflow-templates/*` there are generated from the
162
+ * `.yml` files in `ci/` (`@theholocron/ci`) and pushed verbatim (with a
163
+ * "do not edit" header). Never hand-edit them in `.github`.
164
+ *
165
+ * Not to be confused with `WORKFLOW_TEMPLATES` in `github-action-thin-callers.ts` — those are
166
+ * the *thin-caller bases* written into each consumer repo's `.github/workflows/`.
167
+ */
168
+ /**
169
+ * The workflows by task id (`test:unit`): a hosting repo writes one as `.github/workflows/<workflowFile(id)>` and
170
+ * `theholocron/.github` holds the frozen copy under its old name ({@link legacyFile}).
171
+ */
172
+ export declare const REUSABLE_WORKFLOWS: Record<string, string>;
173
+ /**
174
+ * The reusables a repo that hosts them keeps in its own `.github/workflows`, by id: the ones that only run when
175
+ * another workflow calls them. A reusable that is also started by an event or by hand (`tag`, `sync-dispatch`,
176
+ * `check-dispatched`) would become a live workflow of the hosting repo, and runs where it is dispatched, so
177
+ * it stays out (spec `tech-workflows-in-holocron`, #1216).
178
+ */
179
+ export declare function hostedReusableWorkflows(): Map<string, string>;
180
+ /** Composite actions → `.github/actions/<name>/action.yml` (key includes `/action`). */
181
+ export declare const REUSABLE_ACTIONS: Record<string, string>;
182
+ /** GitHub starter-workflow metadata → `workflow-templates/<name>.properties.json`. */
183
+ export declare const WORKFLOW_TEMPLATE_PROPERTIES: Record<string, string>;
184
+ /**
185
+ * The complete file batch `holocron sync github` pushes to `theholocron/.github`:
186
+ * path → content. YAML gets the "do not edit" header; the starter-workflow
187
+ * `.properties.json` files are left bare (native JSON, not a commented file).
188
+ */
189
+ export declare function reusableTemplates(): Map<string, string>;
190
+ /**
191
+ * The files in `theholocron/.github` that moved to holocron and are frozen: every reusable workflow
192
+ * {@link hostedReusableWorkflows} hosts, and every composite action. `holocron sync github` stops pushing them and
193
+ * stamps each once with {@link stampDeprecated}; repos still calling them keep working, and the copies never change
194
+ * again. (A forwarding shim would nest a job and rename every required check of its callers, so the copies are
195
+ * frozen instead; spec `tech-workflows-in-holocron`, issue #1477.)
196
+ */
197
+ export declare function frozenReusablePaths(): string[];
198
+ /** Whether `content` already carries the deprecation notice. */
199
+ export declare function isDeprecated(content: string): boolean;
200
+ /**
201
+ * `content` of a frozen file with the deprecation notice added below its AUTO-GENERATED header: what it was replaced
202
+ * by, the removal condition and the tracking issue. Already stamped content is returned as it is.
203
+ */
204
+ export declare function stampDeprecated(content: string, path: string): string;
205
+ /** Where a repo's pull-request previews are deployed. */
206
+ interface PreviewConfig {
207
+ /** Cloudflare Pages project name shared across all repos for previews. */
208
+ project: string;
209
+ /**
210
+ * Base domain for preview URLs (e.g. `"preview.theholocron.dev"`).
211
+ * When set, `holocron setup` automatically provisions:
212
+ * - Cloudflare Pages custom domain `*.<domain>` on the project
213
+ * - DNS wildcard CNAME `*.<domain>` → `<project>.pages.dev`
214
+ *
215
+ * Preview URLs resolve as `<repo>-pr-<n>.<domain>`.
216
+ */
217
+ domain?: string;
218
+ }
219
+ /** Org-level context used to derive preview defaults from `preview: true`. */
220
+ interface OrgContext {
221
+ /** GitHub org name — becomes the prefix of the default project: `<org>-preview`. */
222
+ org?: string;
223
+ /** Org canonical domain — becomes `preview.<domain>` for the default preview domain. */
224
+ domain?: string;
225
+ /** Project name — injected as the `name` input to the deploy reusable when `docs: true`. */
226
+ repoName?: string;
227
+ }
228
+ /**
229
+ * The reusable-workflow thin-caller templates, by task id. A template's id is its path under `templates/workflows/`
230
+ * (`lint/code.yml` is `lint:code`, see `idFromSource`). The workflow `name:`, the job id and the job `name:` of each are
231
+ * the id (see `legacyCaller` for the names they had before).
232
+ */
233
+ export declare const WORKFLOW_TEMPLATES: Record<string, string>;
234
+ /** The task names that have a thin-caller workflow template. */
235
+ export declare const KNOWN_WORKFLOWS: Set<string>;
236
+ /**
237
+ * The GitHub status-check context a `required` task contributes, by task id. Format: `"{caller job name} / {called job
238
+ * name}"`, and the caller job name is the id, so the `ci` aggregate (which waits for a check starting with `<id> / `)
239
+ * reads the id from the part before the slash.
240
+ *
241
+ * Most of these are single-job workflows (D3's decomposition split what used to be multi-job `lint`/`audit` into one
242
+ * task per concern), so the context names that job directly; a single job's own conclusion already *is* the workflow's
243
+ * conclusion. `Conclusion` fan-in jobs are kept only where a task has several conditionally-run jobs feeding one
244
+ * check: `test:unit` (unit / Storybook / Chromatic / interaction / user-flow, each gated by its own `run-*` input).
245
+ * `format` has no workflow of its own: its check is a step of `lint:code` (the `ci/actions/format` action), so it is
246
+ * listed under that. Only merge-gating workflows are listed.
247
+ * `astromech.requiredChecks()` reads this for every `required` task.
248
+ */
249
+ export declare const WORKFLOW_CHECK_CONTEXTS: Partial<Record<string, string>>;
250
+ /**
251
+ * Generate the thin caller content for a workflow, optionally injecting or
252
+ * merging `with:` overrides into the jobs block.
253
+ *
254
+ * Two strategies are used depending on the template:
255
+ * - Templates that already have a `with:` block (e.g. lint):
256
+ * the override entries are merged in, replacing existing keys and appending
257
+ * new ones.
258
+ * - Templates that end with ` secrets: inherit`: a new `with:` block is
259
+ * injected immediately before `secrets: inherit`.
260
+ * If neither pattern matches the template, a warning is emitted and the
261
+ * base template is returned unchanged.
262
+ */
263
+ export declare function generateThinCallerContent(name: string, withOverrides?: Record<string, unknown>, additionalPaths?: string[],
264
+ /** Optional sink for the "could not inject `with:`" warning. */
265
+ logger?: {
266
+ warn(obj: Record<string, unknown>, msg: string): void;
267
+ },
268
+ /**
269
+ * `with:` key → a `# comment` line rendered immediately above that entry.
270
+ * Only honored when injecting a fresh `with:` block (no template today
271
+ * ships one), which is the path `lint` takes.
272
+ */
273
+ comments?: Record<string, string>): string;
274
+ /**
275
+ * Extract the Cloudflare Pages preview config from a deploy workflow's `with:` object.
276
+ *
277
+ * Accepts three forms:
278
+ * - `preview: true` — derive both project and domain from org context
279
+ * - `preview: { project: "..." }` — explicit project; domain derived from context if omitted
280
+ * - `preview: { project: "...", domain: "..." }` — fully explicit
281
+ *
282
+ * Returns null when `preview:` is absent, false, or can't be resolved.
283
+ */
284
+ export declare function extractPreviewConfig(raw: Record<string, unknown>, ctx?: OrgContext): PreviewConfig | null;
285
+ /**
286
+ * Generate the full thin-caller YAML for a `deploy.yml` that handles both
287
+ * production (push to main → GitHub Pages) and preview (pull_request →
288
+ * Cloudflare Pages) in a single file.
289
+ *
290
+ * Both jobs receive the same docs/storybook `with:` inputs. If the per-repo
291
+ * config supplies `cloudflare-project` it is forwarded; otherwise the reusable
292
+ * falls back to the `CLOUDFLARE_PAGES_PROJECT` org variable (filled from the 1Password sync) — set that once and
293
+ * all repos with a `deploy` workflow get previews without per-repo config.
294
+ */
295
+ export declare function generateCombinedDeployContent(deployWith: Record<string, unknown>, paths: string[], preview: Pick<PreviewConfig, "project">,
296
+ /** The task id the caller is for: the workflow name, and the name of both jobs (`deploy`, `deploy-docs`, `deploy-components`). */
297
+ id?: string): string;
298
+ /**
299
+ * Expand structured with-values to flat GitHub Actions inputs before
300
+ * generating the thin caller. Handles:
301
+ * - deploy shorthand: docs/storybook → type + storybook-projects
302
+ * - preview: stripped (handled separately via extractPreviewConfig)
303
+ * - chromatic-projects entries' untraced array → newline-joined string
304
+ * - plain arrays → JSON-stringified for YAML scalar quoting
305
+ *
306
+ * Used by both `holocron setup` and `sync-workflow-templates`.
307
+ */
308
+ export declare function normalizeWorkflowWith(raw: Record<string, unknown>): Record<string, unknown>;
309
+ /**
310
+ * Derive on.push.paths entries from the deploy with: shorthand.
311
+ * Used by both `holocron setup` and `sync-workflow-templates`.
312
+ */
313
+ export declare function deriveDeployPaths(raw: Record<string, unknown>): string[];
314
+ /**
315
+ * The context of the aggregate check: the caller's job (`ci`) and the called job (`Required checks`), as GitHub joins
316
+ * them for a reusable workflow.
317
+ */
318
+ export declare const AGGREGATE_CHECK = "ci / Required checks";
319
+ /** Ordered, de-duplicated. */
320
+ export declare function requiredChecks(config: TasksConfig, aggregate: boolean): string[];
321
+ /** Where a `package.json` sits in the repo: the root (which holds the suite scripts) or any other package. */
322
+ type PackageRole = "root" | "package";
323
+ /** One thing wrong with a script. `warn` is a deprecated spelling accepted for a window; `fail` breaks a rule. */
324
+ interface PackageScriptProblem {
325
+ /** `warn` is allowed for now; `fail` breaks the build. */
326
+ level: "warn" | "fail";
327
+ /** The script name the problem is about. */
328
+ script: string;
329
+ /** What is wrong and what to use instead. */
330
+ message: string;
331
+ }
332
+ /**
333
+ * The rule violations in one `package.json`'s `scripts` (spec `ci-flat-task-vocabulary`, "The recursion hazard" and "The
334
+ * check that keeps them aligned"):
335
+ *
336
+ * - a script named like an npm or pnpm lifecycle word (`publish`, `install`, …), except the root's `prepare` (husky);
337
+ * - a script named like a suite (`test`, `lint`, `scan`) in a package: a suite is a turbo task with no script, and a
338
+ * package's own would be run by `turbo run test` as well as the aggregator. The root holds the suite scripts;
339
+ * - a leaf script that calls `turbo run` or `holocron run` in a package: it must hold the real tool command, or turbo
340
+ * would run it, and it would run turbo again;
341
+ * - a script that looks like a suite member but is none (`test:unt`), other than a known variant;
342
+ * - a script named by a task id's hyphen spelling (`deploy-preview`) where the script spelling takes a colon
343
+ * (`deploy:preview`): `holocron run` looks the script up by the script spelling, so the task would find none and be
344
+ * skipped as "enforced in CI" (#1929);
345
+ * - an old dotted task name, as a `warn` while those are accepted.
346
+ */
347
+ export declare function checkPackageScripts(scripts: Readonly<Record<string, string>>, role: PackageRole): PackageScriptProblem[];
348
+ /** The scripts of a `package.json` after the generated ones are merged in. */
349
+ interface MergedScripts {
350
+ /** `existing` with the generated scripts set. */
351
+ scripts: Record<string, string>;
352
+ /** The names that were added or rewritten, sorted. */
353
+ changed: string[];
354
+ }
355
+ /**
356
+ * `true` for a script body this tool writes: a `turbo run …` call or a `holocron run … --` wrapper. Both call back into
357
+ * the task machinery, so neither may stand for a package's own command (a root that is itself a package would loop).
358
+ */
359
+ export declare function isGeneratedScript(command: string): boolean;
360
+ /**
361
+ * `existing` with `desired` set, key by key; every other script is left alone. `turboKeys` are the keys the repo's
362
+ * `turbo.json` fans out (#747): for those, and for any script whose desired body is `turbo run …`, an existing script
363
+ * that is not itself generated is left untouched. Root may be a directly buildable package with its own real command
364
+ * (`tsc --noEmit`, `vitest run`) for that task, and overwriting it would send turbo into the root script, which calls
365
+ * turbo again, forever. Every other key is generator-owned: a hand edit of it is drift.
366
+ */
367
+ export declare function mergeScripts(existing: Readonly<Record<string, string>>, desired: Readonly<Record<string, string>>, turboKeys: ReadonlySet<string>): MergedScripts;
368
+ /** How to run one task locally. */
369
+ interface LocalRunner {
370
+ /** Binary to invoke — resolved from `node_modules/.bin` then PATH. */
371
+ tool?: string;
372
+ /** Args appended after the tool. */
373
+ args?: string[];
374
+ /** First entry whose `when` filename matches a repo-root file wins. */
375
+ detect?: Array<{
376
+ when: RegExp;
377
+ tool: string;
378
+ args?: string[];
379
+ }>;
380
+ /** The task is already a holocron subcommand (`sync`, `sync-wiki`). */
381
+ command?: string;
382
+ }
383
+ /**
384
+ * How a task fans out across every workspace via Turborepo — content-hash
385
+ * caching + `^`-prefixed cross-package ordering, epic #672 D9 (#681).
386
+ * Present only on tasks that genuinely run *per workspace* (a real build/
387
+ * compile/test step); whole-repo single-run tools (prettier, gitleaks,
388
+ * commitlint, yamllint, …) have no entry here — they stay off turbo.json
389
+ * entirely and run once, un-fanned-out, the way they already do.
390
+ */
391
+ interface TurboTaskConfig {
392
+ /** Glob patterns turbo hashes to decide whether a cached run is still valid. */
393
+ inputs: string[];
394
+ /** Glob patterns turbo caches/restores after a run. Empty array for a task with no build artifact (lint, typecheck). */
395
+ outputs: string[];
396
+ /** Task names this depends on — a bare name runs in this package first; `^name` waits on every upstream workspace's task. */
397
+ dependsOn: string[];
398
+ }
399
+ /** The six intent groups. They survive only as documentation and `--help` grouping. */
400
+ type TaskGroup = "Verification" | "Source Quality" | "Security" | "Delivery" | "Platform" | "Knowledge";
401
+ /** Where a task runs: once per package that has it, or once at the repo root. */
402
+ type TaskScope = "package" | "repo";
403
+ /**
404
+ * One registry task: its built-in runner (`local`) and its
405
+ * Turborepo fan-out. `holocron run <task>` and `holocron run ci` start from this definition.
406
+ */
407
+ interface TaskDef {
408
+ /** The intent group: documentation and `--help` grouping only. It is no longer part of any name. */
409
+ group: TaskGroup;
410
+ /**
411
+ * `package` — runs in each package that has the script (turbo-delegated); `repo` — runs once at the root (a linter
412
+ * group, a probe, a workflow). `holocron run <suite>` from a package directory runs only the package-scoped members.
413
+ */
414
+ scope: TaskScope;
415
+ /**
416
+ * The suite this task is a leaf of (`test` for `test:unit`). A suite is declared here, by its leaves; it is never a
417
+ * task id of its own, and `holocron run <suite>` runs the repo's configured members in registry order.
418
+ */
419
+ suite?: string;
420
+ /**
421
+ * Args that replace {@link LocalRunner.args} when `--check` is given, for a task that writes by default (`format`):
422
+ * `holocron run format --check` runs `prettier --check .` instead of `prettier --write .`.
423
+ */
424
+ checkArgs?: string[];
425
+ /** `false` — the task has no workflow of its own, so no thin caller is generated for it (`format`). */
426
+ workflow?: false;
427
+ /**
428
+ * The id of the workflow that runs this task's check, for a task with no workflow of its own: `format` is checked
429
+ * by an action that `lint:code` calls, so its host is `lint:code`.
430
+ */
431
+ host?: string;
432
+ /**
433
+ * `null` — the registry has no built-in runner (CodeQL, deploys, the
434
+ * bundle-size job). An explicit turbo task or `package.json` script still
435
+ * runs (resolution steps 1–2); with neither, `holocron run` does nothing
436
+ * and `holocron run ci` skips it — never a failure, even when the task is
437
+ * `required` (a CI-only check isn't a local one).
438
+ */
439
+ local: LocalRunner | null;
440
+ /**
441
+ * This task is a linter-group aggregate: `holocron run <task>` resolves
442
+ * this fixed set of `linters.ts` entries (still gated by each linter's
443
+ * own `detect`/`always` rule) and runs each natively, instead of using
444
+ * `local`. Replaces the old single `lint` task's auto-detected linter
445
+ * list (`config.tasks[].linters`) — a repo's choice of which of these
446
+ * run is now just whether it includes this task in `tasks: [...]`, same
447
+ * as any other task. See `linters.ts` / `run.ts`.
448
+ */
449
+ linterGroup?: string[];
450
+ /** Carries a `preview` mode (Cloudflare/Vercel deploy, npm dist-tag, Fern preview docs, …). Cross-cutting, not its own task. */
451
+ preview?: boolean;
452
+ /** Turborepo fan-out config for this task — see {@link TurboTaskConfig}. Omitted for whole-repo, non-fan-out tasks. */
453
+ turbo?: TurboTaskConfig;
454
+ }
455
+ /**
456
+ * The task registry — how each task runs *locally*, without GitHub
457
+ * Actions. `holocron run <task>` and `holocron run ci` resolve against this;
458
+ * adding a task here gives every repo that task.
459
+ *
460
+ * Keyed by the flat, verb-first id (`test:unit`, `lint:code`, `build`,
461
+ * `deploy-preview`), the one spelling of a task in the CLI (spec
462
+ * `ci-flat-task-vocabulary`, SPEC-0064, epic #1612). A colon means "member of
463
+ * the suite named before it": `test`, `lint`, `scan`,
464
+ * `validate` and `measure` are suites, declared here by the `suite` field of their leaves
465
+ * and never ids of their own. A hyphen is part of a verb phrase and implies no
466
+ * suite. The old dotted names (`verification.unitTests`, …) are accepted for a
467
+ * window through {@link LEGACY_NAMES} and still name the generated workflow
468
+ * files, turbo tasks and `package.json` scripts until the later phases move
469
+ * those (see {@link legacyName}).
470
+ *
471
+ * Every other artifact (`KNOWN_TASKS`, `CI_ORDER`, the suites) derives from
472
+ * these keys rather than hand-duplicating them — including the GitHub App
473
+ * (#679), which imports this same table for config-schema validation.
474
+ *
475
+ * Declared order is run order: a suite runs its members in the order they
476
+ * appear here.
477
+ *
478
+ * Task names are an intent-facing vocabulary, not tool names —
479
+ * `eslint`/`vitest`/`tsdown`/… stay internal to this file and the `configs/`
480
+ * folder.
481
+ *
482
+ * Spec: `.notes/ci-flat-task-vocabulary.spec.md`, and
483
+ * `docs/wiki/specifications/tech-astromech-task-runner.spec.md` (epic #581).
484
+ */
485
+ export declare const TASKS: Record<string, TaskDef>;
486
+ /**
487
+ * The order `holocron run ci` runs tasks in — cheapest / fastest signal first, so
488
+ * an agent or a `pre-push` hook fails early. Tasks not listed here run last, in
489
+ * manifest order. (The generated thin callers carry no `needs:` — cross-workflow
490
+ * ordering lives in `theholocron/.github` — so `holocron run ci` declares its own.)
491
+ */
492
+ export declare const CI_ORDER: string[];
493
+ /**
494
+ * How a runnable task reaches a script in a repo with a `turbo.json`:
495
+ *
496
+ * - `turbo`: fans out over the packages (`turbo run <key>`), each running its own script of that name;
497
+ * - `tool`: a repo-scoped leaf whose root script holds the registry's own command, run once at the root;
498
+ * - `cli`: runnable only through `holocron run` (a holocron subcommand, a set of sub-jobs, a tool picked by what the
499
+ * repo contains, a linter group with no local binary), so a turbo repo has no script for it.
500
+ */
501
+ type PlannedKind = "turbo" | "tool" | "cli";
502
+ /** One flat task id a manifest entry stands for and the repo can run locally. */
503
+ interface PlannedTask {
504
+ /** The manifest entry that listed it (`verification.unitTests`, or `test:unit` itself). */
505
+ entry: string;
506
+ /** The flat id. */
507
+ id: string;
508
+ /** The root script's name: the id in its script spelling (`deploy-preview` is `deploy:preview`). */
509
+ script: string;
510
+ /** The key in `turbo.json` and the package scripts: follows the entry's spelling (see `taskKey`). */
511
+ key: string;
512
+ /** How the task reaches a script: through turbo, a root tool script, or only the CLI. */
513
+ kind: PlannedKind;
514
+ /** The root script's body for a `tool` leaf. */
515
+ command?: string;
516
+ }
517
+ /**
518
+ * The tasks a manifest can run locally, once per flat id, in manifest order: what `scriptsFor` and the `turbo.json`
519
+ * generator both read, so a root script and the turbo task it calls never disagree.
520
+ *
521
+ * `local: null` alone means there is genuinely no local equivalent (CodeQL, a deploy); a `linterGroup`
522
+ * task still runs through `holocron run`. An entry with `local: false` is left out, and so is an id the registry does
523
+ * not know.
524
+ */
525
+ export declare function planTasks(config: TasksConfig, registry: Record<string, TaskDef>): PlannedTask[];
526
+ /**
527
+ * The suites of a plan with the planned leaves that take part in them, in registry (run) order. Only a leaf a turbo
528
+ * repo has a script for counts (`turbo` and `tool`); a suite none of whose configured leaves has one is not in the map,
529
+ * so no aggregator task and no root script exists for it.
530
+ */
531
+ export declare function planSuites(planned: readonly PlannedTask[], registry: Record<string, TaskDef>): Map<string, PlannedTask[]>;
532
+ /** The facts about a repo that decide what its scripts call. */
533
+ interface RepoShape {
534
+ /**
535
+ * `true` for a workspace whose `turbo.json` is generated (holocron, the monorepo templates): its root scripts call
536
+ * `turbo run` directly, because the `holocron` bin may not exist yet on a fresh clone and turbo is an ordinary
537
+ * devDependency. `false` for a single package, whose scripts call `holocron run`.
538
+ */
539
+ monorepo: boolean;
540
+ }
541
+ /**
542
+ * The `package.json` scripts a manifest asks for, by name: the one rule that `sync` writes, `probe generated
543
+ * check` compares against, and the `turbo.json` generator agrees with (spec `ci-flat-task-vocabulary`, "Scripts").
544
+ * `holocron` and `prepare` are not tasks and are added by the caller.
545
+ *
546
+ * A repo with a generated `turbo.json` ({@link RepoShape.monorepo}) gets root scripts that call turbo:
547
+ * `turbo run <key>` for a package-scoped leaf and for each suite (an aggregator task), and, for a repo-scoped leaf with
548
+ * a local tool, the tool's own command (`prettier --write .`), because `turbo run <id>` would call itself. A leaf with no
549
+ * local command has no script. The key a leaf has in turbo follows the manifest entry's spelling.
550
+ *
551
+ * A single package gets `holocron run <words> --` for every task it can run locally; the trailing `--` is there because
552
+ * pnpm appends arguments as typed, and `holocron run` would otherwise reject a flag meant for the tool. An entry written
553
+ * with an old dotted name keeps its old script, named as the entry is, and no suite scripts, until the list is
554
+ * rewritten with flat ids.
31
555
  */
556
+ export declare function scriptsFor(config: TasksConfig, registry?: Record<string, TaskDef>, repo?: RepoShape): Record<string, string>;
557
+ /** Options for a package's generated `tsconfig.json`. */
558
+ interface TsconfigOptions {
559
+ /** Human-readable name for the `display` field — the package's own name is the usual choice. */
560
+ display: string;
561
+ /**
562
+ * `@theholocron/tsconfig` variant. Defaults to `"node-lts"` — every
563
+ * checked package uses it; the other three (`astro`, `nextjs`, `react`)
564
+ * exist for a template repo's app-shaped packages, not the plain
565
+ * Node.js library packages this org's currently-migrated repos ship.
566
+ */
567
+ variant?: "astro" | "nextjs" | "node-lts" | "react";
568
+ /**
569
+ * Add a `@/*` → `./src/*` path alias. A real per-package choice, not a
570
+ * default — roughly 40% of packages checked use one, the rest don't.
571
+ */
572
+ paths?: boolean;
573
+ }
574
+ /**
575
+ * A package-level `tsconfig.json` — the uniform shape confirmed across
576
+ * every package checked, parameterized only by the two fields that
577
+ * genuinely vary (`display`, `paths`). No scaffold/workflow header (matches
578
+ * `.alexrc.json`'s existing precedent for a strict-JSON Bucket B file —
579
+ * JSON has no comment syntax to carry one, and TypeScript's own tolerance
580
+ * for JSONC comments in `tsconfig.json` isn't worth relying on for a file
581
+ * this thin).
582
+ */
583
+ export declare function createTsconfig(options: TsconfigOptions): string;
584
+ interface EnsureRootWorkspaceMemberResult {
585
+ content: string;
586
+ changed: boolean;
587
+ }
588
+ interface EnsureTurboDependencyResult {
589
+ content: string;
590
+ changed: boolean;
591
+ }
32
592
  /** Minimal structural logger — `@theholocron/observability`'s `Logger` satisfies it. */
33
593
  interface RunLogger {
594
+ /** Records a debug-level structured line. */
34
595
  debug(obj: Record<string, unknown>, msg?: string): void;
596
+ /** Records a warning. */
35
597
  warn(obj: Record<string, unknown>, msg?: string): void;
36
598
  }
599
+ /**
600
+ * Runs `cmd` and reports its exit code. `opts.env` is added to the child's
601
+ * environment (on top of the parent's), e.g. `TURBO_SCM_BASE` for `--affected`.
602
+ */
37
603
  type ExecFn = (cmd: string, args: string[], opts: {
38
604
  cwd: string;
605
+ env?: Record<string, string>;
39
606
  }) => {
40
607
  exitCode: number;
41
608
  };
@@ -55,14 +622,10 @@ interface RunDeps {
55
622
  /** `node_modules/.bin/<bin>` or a PATH entry; `null` when not runnable. */
56
623
  lookPath: (cwd: string, bin: string) => string | null;
57
624
  }
625
+ /** What `runTask` needs for one task: the task, where to run it, and the injected dependencies. */
58
626
  interface RunTaskInput extends RunDeps {
59
627
  /** Registry task name, e.g. `"test"`. */
60
628
  task: string;
61
- /**
62
- * Sub-job within the task, e.g. `"performance"` in `holocron run audit
63
- * performance`. Ignored (folded into `passthrough`) for tasks with no `jobs`.
64
- */
65
- job?: string;
66
629
  /** Directory to run in. */
67
630
  cwd: string;
68
631
  /** Args after `--` on the command line, forwarded to the tool / turbo / script. */
@@ -73,165 +636,287 @@ interface RunTaskInput extends RunDeps {
73
636
  required?: boolean;
74
637
  /** `turbo --filter=<pkg>` passthrough (monorepo). Ignored when the repo has no `turbo.json`. */
75
638
  filter?: string;
639
+ /** `turbo --affected`: only the packages changed since `base`, plus their dependents. Ignored without a `turbo.json`. */
640
+ affected?: boolean;
641
+ /** Git ref `affected` compares against; falls back to `TURBO_SCM_BASE`. */
642
+ base?: string;
643
+ /** Environment `affected` reads (`GITHUB_EVENT_NAME`, `GITHUB_REF_NAME`, `TURBO_SCM_BASE`). Defaults to empty. */
644
+ env?: Record<string, string | undefined>;
76
645
  }
646
+ /** The result of `runTask`. */
77
647
  interface RunTaskReport {
648
+ /** `ok`, `fail`, `skip` (no such task for this repo), `dry-run` or `unknown` (not a registry task). */
78
649
  status: "ok" | "fail" | "skip" | "dry-run" | "unknown";
79
650
  /** Resolved command, for the caller / tests. */
80
651
  command?: string;
652
+ /** Why the task failed or was skipped. */
81
653
  message?: string;
82
654
  }
83
- declare function runTask(input: RunTaskInput): RunTaskReport;
84
- //#endregion
85
- //#region src/ci.d.ts
655
+ /**
656
+ * Resolves one registry task (an explicit turbo task, a `package.json` script, then the registry's built-in runner)
657
+ * and runs it, or prints the command on a dry run.
658
+ */
659
+ export declare function runTask(input: RunTaskInput): RunTaskReport;
660
+ /** Options for `Astromech.ci`: the scope, turbo filtering and whether to only print the plan. */
86
661
  interface CiOptions {
87
662
  /** Print the plan without running anything. */
88
663
  dryRun?: boolean;
89
664
  /** `turbo --filter=<pkg>` passthrough (monorepo). */
90
665
  filter?: string;
666
+ /** `turbo --affected`: only the packages changed since `base`. */
667
+ affected?: boolean;
668
+ /** Git ref `affected` compares against. */
669
+ base?: string;
670
+ /** Environment `affected` reads. */
671
+ env?: Record<string, string | undefined>;
91
672
  /** `"required"` (default) or `"all"` (every `ci: true` task). */
92
673
  scope?: "required" | "all";
93
674
  }
675
+ /** The result of one task in a CI pre-flight run. */
94
676
  interface CiJobReport {
677
+ /** Registry task name, e.g. `"test"`. */
95
678
  task: string;
96
679
  /** The branch-protection check context, or `null` for a non-gating task. */
97
680
  checkContext: string | null;
681
+ /** `ok`, `fail`, `skip` (nothing to run for this repo) or `dry-run` (planned, not run). */
98
682
  status: "ok" | "fail" | "skip" | "dry-run";
683
+ /** The resolved command, when one was run or planned. */
99
684
  command?: string;
685
+ /** Why the job failed or was skipped. */
100
686
  message?: string;
101
- }
102
- interface CiReport {
103
- status: "ok" | "fail";
104
- jobs: CiJobReport[];
105
- }
106
- interface CiInput extends RunDeps, CiOptions {
107
- cwd: string;
108
- config: TasksConfig;
109
- }
110
- declare function runCi(input: CiInput): CiReport;
111
- //#endregion
112
- //#region src/thin-callers.d.ts
113
- /**
114
- * Workflow templates + thin-caller generation.
115
- *
116
- * `WORKFLOW_TEMPLATES` holds each reusable `.github/workflows/<name>.yml`
117
- * (synced to `theholocron/.github`); `generateThinCallerContent` wraps one
118
- * into the thin caller `holocron setup` / `holocron sync` write locally.
119
- */
120
- declare const WORKFLOW_TEMPLATES: Record<string, string>;
121
- declare const KNOWN_WORKFLOWS: Set<string>;
122
- /**
123
- * The GitHub status-check context a `required` task contributes to branch
124
- * protection. Format: `"{workflow name} / {job name}"`.
125
- *
126
- * Most of these are single-job workflows now (D3's decomposition split what
127
- * used to be multi-job `lint`/`audit` into one task per concern) — the
128
- * context names that job directly, no `Conclusion` aggregator needed; a
129
- * single job's own conclusion already *is* the workflow's conclusion.
130
- * `Conclusion` fan-in jobs are kept only where a task genuinely has several
131
- * conditionally-run jobs feeding one required check:
132
- * `verification.unitTests` (unit / Storybook / Chromatic / interaction /
133
- * user-flow, each gated by its own `run-*` input) and
134
- * `platform.repoValidation` (its three script jobs all must pass). Only
135
- * merge-gating workflows are listed. `astromech.requiredChecks()` reads this
136
- * for every `required` task.
137
- */
138
- declare const WORKFLOW_CHECK_CONTEXTS: Partial<Record<string, string>>;
139
- /**
140
- * Generate the thin caller content for a workflow, optionally injecting or
141
- * merging `with:` overrides into the jobs block.
142
- *
143
- * Two strategies are used depending on the template:
144
- * - Templates that already have a `with:` block (e.g. lint):
145
- * the override entries are merged in, replacing existing keys and appending
146
- * new ones.
147
- * - Templates that end with ` secrets: inherit`: a new `with:` block is
148
- * injected immediately before `secrets: inherit`.
149
- * If neither pattern matches the template, a warning is emitted and the
150
- * base template is returned unchanged.
151
- */
152
- declare function generateThinCallerContent(name: string, withOverrides?: Record<string, unknown>, additionalPaths?: string[],
153
- /** Optional sink for the "could not inject `with:`" warning. */
154
- logger?: {
155
- warn(obj: Record<string, unknown>, msg: string): void;
156
- },
157
- /**
158
- * `with:` key → a `# comment` line rendered immediately above that entry.
159
- * Only honored when injecting a fresh `with:` block (no template today
160
- * ships one), which is the path `lint` takes.
161
- */
162
- comments?: Record<string, string>): string;
163
- interface PreviewConfig {
164
- /** Cloudflare Pages project name shared across all repos for previews. */
165
- project: string;
687
+ }
688
+ /** The result of a CI pre-flight run. */
689
+ interface CiReport {
690
+ /** `fail` if any job failed, else `ok`. */
691
+ status: "ok" | "fail";
692
+ /** One entry per task. */
693
+ jobs: CiJobReport[];
694
+ }
695
+ interface CiInput extends RunDeps, CiOptions {
696
+ cwd: string;
697
+ config: TasksConfig;
698
+ }
699
+ /** Runs the merge-gating tasks in CI order and reports each job and an overall `ok` or `fail`. */
700
+ export declare function runCi(input: CiInput): CiReport;
701
+ /** Comment style produced by workflowHeader. */
702
+ type WorkflowHeaderFormat = "yaml" | "cjs" | "shebang";
703
+ /** Where a generated file came from, for the header `createHeader` writes. */
704
+ interface CreateHeaderOptions {
705
+ /** Path within theholocron/holocron that owns the file being generated. */
706
+ source: string;
707
+ /** CLI command that produces the file. Defaults to "holocron setup". */
708
+ tool?: string;
709
+ /** Set true only when writing to theholocron/.github itself. */
710
+ forPrimary?: boolean;
711
+ }
712
+ /** The header writers `createHeader` returns, one per kind of generated file. */
713
+ interface HeaderFunctions {
166
714
  /**
167
- * Base domain for preview URLs (e.g. `"preview.theholocron.dev"`).
168
- * When set, `holocron setup` automatically provisions:
169
- * - Cloudflare Pages custom domain `*.<domain>` on the project
170
- * - DNS wildcard CNAME `*.<domain>` → `<project>.pages.dev`
715
+ * "AUTO-GENERATED — do not edit" header for files managed on every run.
171
716
  *
172
- * Preview URLs resolve as `<repo>-pr-<n>.<domain>`.
717
+ * format:
718
+ * "yaml" — `# …` comment lines (YAML, text, ignore files)
719
+ * "cjs" — `/* … *\/` block comment (CommonJS modules)
720
+ * "shebang" — `#!/bin/sh` on line 1, then yaml header (shell scripts)
173
721
  */
174
- domain?: string;
175
- }
176
- /** Org-level context used to derive preview defaults from `preview: true`. */
177
- interface OrgContext {
178
- /** GitHub org name — becomes the prefix of the default project: `<org>-preview`. */
179
- org?: string;
180
- /** Org canonical domain — becomes `preview.<domain>` for the default preview domain. */
181
- domain?: string;
182
- /** Project name — injected as the `name` input to the deploy reusable when `docs: true`. */
183
- repoName?: string;
722
+ workflowHeader(format?: WorkflowHeaderFormat): string;
723
+ /**
724
+ * "Scaffolded — edit this file freely" header for one-time generated files
725
+ * that the user is expected to take over (e.g. codecov.yml).
726
+ */
727
+ scaffoldHeader(): string;
184
728
  }
185
729
  /**
186
- * Extract the Cloudflare Pages preview config from a deploy workflow's `with:` object.
730
+ * Factory that binds `source` and `tool` once and returns all header
731
+ * constructors for auto-generated files. Prefer this over passing source
732
+ * as a positional argument at every call site.
187
733
  *
188
- * Accepts three forms:
189
- * - `preview: true` — derive both project and domain from org context
190
- * - `preview: { project: "..." }` — explicit project; domain derived from context if omitted
191
- * - `preview: { project: "...", domain: "..." }` — fully explicit
734
+ * @example
735
+ * const { workflowHeader, scaffoldHeader } = createHeader({
736
+ * source: "cli/astromech/src/templates/configs/editorconfig/create-config.ts",
737
+ * });
192
738
  *
193
- * Returns null when `preview:` is absent, false, or can't be resolved.
194
- */
195
- declare function extractPreviewConfig(raw: Record<string, unknown>, ctx?: OrgContext): PreviewConfig | null;
196
- /**
197
- * Generate the full thin-caller YAML for a `deploy.yml` that handles both
198
- * production (push to main → GitHub Pages) and preview (pull_request →
199
- * Cloudflare Pages) in a single file.
739
+ * export function createConfig(): string {
740
+ * return `${workflowHeader()}${body}`;
741
+ * }
200
742
  *
201
- * Both jobs receive the same docs/storybook `with:` inputs. If the per-repo
202
- * config supplies `cloudflare-project` it is forwarded; otherwise the reusable
203
- * falls back to the `CLOUDFLARE_PAGES_PROJECT` org variable — set that once and
204
- * all repos with a `deploy` workflow get previews without per-repo config.
743
+ * ## Which header to use
744
+ *
745
+ * | Function | When to use | User can edit? |
746
+ * |-------------------|----------------------------------------------------|----------------|
747
+ * | `workflowHeader` | Files overwritten on every setup / sync-github run | No — "AUTO-GENERATED — do not edit" |
748
+ * | `scaffoldHeader` | Files written once; user takes ownership after | Yes — "Scaffolded — edit this file freely" |
749
+ *
750
+ * ## `workflowHeader` formats
751
+ *
752
+ * | Format | Comment style | Used for |
753
+ * |---------------------|------------------------|-------------------------------------------------------|
754
+ * | `"yaml"` (default) | `# …` lines | YAML workflows, ignore files, `.editorconfig`, labeler|
755
+ * | `"cjs"` | `/* … *\/` block | CommonJS config files (`.cjs`) |
756
+ * | `"shebang"` | `#!/bin/sh` + `# …` | Shell scripts (`prepare-commit-msg`, hooks) |
205
757
  */
206
- declare function generateCombinedDeployContent(deployWith: Record<string, unknown>, paths: string[], preview: Pick<PreviewConfig, "project">): string;
758
+ export declare function createHeader(options: CreateHeaderOptions): HeaderFunctions;
759
+ /** The names of the directories directly inside `path`. */
760
+ export declare const defaultListDirs: (path: string) => string[];
761
+ /** Reads and parses the JSON file at `path`. */
762
+ export declare const defaultReadJson: (path: string) => unknown;
763
+ interface SpawnResult {
764
+ status: number | null;
765
+ stdout: string;
766
+ stderr: string;
767
+ }
768
+ type Run = (command: string, args: string[], options: Record<string, unknown>) => SpawnResult;
769
+ /** A workspace package: absolute folder, and what its `package.json` says. */
770
+ interface WorkspacePackage {
771
+ /** The package's `name`. */
772
+ name: string;
773
+ /** Absolute path of the package folder. */
774
+ dir: string;
775
+ /** The package's `version`; `undefined` when its manifest has none. */
776
+ version: string | undefined;
777
+ /** The package's `dependencies`, name to range. */
778
+ dependencies: Record<string, string>;
779
+ /**
780
+ * A workspace:* devDependency can optionally count too (holocron#1071,
781
+ * workspaceDependencies' includeDevDependencies option). Optional so a
782
+ * caller holding the previous, dev-dependency-less shape (a plain
783
+ * object literal, or a value from outside this package's own version)
784
+ * keeps compiling and working -- a missing value is treated the same
785
+ * as `{}`.
786
+ */
787
+ devDependencies?: Record<string, string>;
788
+ }
789
+ interface Tree {
790
+ readJson: (path: string) => unknown;
791
+ listDirs: (path: string) => string[];
792
+ }
207
793
  /**
208
- * Expand structured with-values to flat GitHub Actions inputs before
209
- * generating the thin caller. Handles:
210
- * - deploy shorthand: docs/storybook → type + storybook-projects
211
- * - preview: stripped (handled separately via extractPreviewConfig)
212
- * - run-chromatic object → run-chromatic: true + chromatic-projects
213
- * - plain arrays → JSON-stringified for YAML scalar quoting
214
- *
215
- * Used by both `holocron setup` and `sync-workflow-templates`.
794
+ * Every package the repo's `pnpm-workspace.yaml` declares (`packages/*`,
795
+ * `apps/*` and `plugins/*` when it declares none) with a readable, named
796
+ * `package.json`.
216
797
  */
217
- declare function normalizeWorkflowWith(raw: Record<string, unknown>): Record<string, unknown>;
798
+ export declare function workspacePackages(repoRoot: string, { readJson, listDirs }: Tree): WorkspacePackage[];
799
+ /** What `deployOnRelease` needs to know about a release. */
800
+ interface DeployOnReleaseOptions {
801
+ /** Repo root. */
802
+ cwd: string;
803
+ /** The release's channel: its prerelease identifier (`alpha`); empty or `main` for a stable release. */
804
+ channel: string;
805
+ /** The previous release's commit; omitted when there is none, so every deploying channel match deploys. */
806
+ from?: string;
807
+ /** The release commit. Default `HEAD`. */
808
+ to?: string;
809
+ /** Where progress lines go (stdout in the CLI). */
810
+ print: (line: string) => void;
811
+ /** Print what would deploy without running it. */
812
+ dryRun?: boolean;
813
+ }
814
+ interface DeployOnReleaseDeps extends Partial<Tree> {
815
+ run?: Run;
816
+ sleep?: (ms: number) => Promise<void>;
817
+ now?: () => number;
818
+ /** Reads a package folder's task manifest; `loadTasksConfig` by default. */
819
+ loadTasks?: (dir: string) => Promise<TasksConfig>;
820
+ }
821
+ /** The outcome of deploying one workspace package. */
822
+ interface DeployOnReleaseResult {
823
+ /** The package's name. */
824
+ pkg: string;
825
+ /** `ok`, `fail`, `skip` (the package does not deploy on this release) or `dry-run`. */
826
+ status: "ok" | "fail" | "skip" | "dry-run";
827
+ /** A one-line account of what happened. */
828
+ message: string;
829
+ }
830
+ /** The outcome of a release-time deploy across the workspace. */
831
+ interface DeployOnReleaseReport {
832
+ /** `fail` if any package's deploy failed; `skip` if none applied to this release; else `ok`. */
833
+ status: "ok" | "fail" | "skip";
834
+ /** One entry per package considered for this release. */
835
+ results: DeployOnReleaseResult[];
836
+ }
218
837
  /**
219
- * Derive on.push.paths entries from the deploy with: shorthand.
220
- * Used by both `holocron setup` and `sync-workflow-templates`.
838
+ * Deploys every package whose manifest declares a release-time deploy that
839
+ * applies to this release. Never throws for a deploy problem: each package's
840
+ * outcome is in the report, and `status: "fail"` is the caller's exit code.
221
841
  */
222
- declare function deriveDeployPaths(raw: Record<string, unknown>): string[];
223
- //#endregion
224
- //#region src/turbo.d.ts
225
- interface EnsureRootWorkspaceMemberResult {
226
- content: string;
227
- changed: boolean;
842
+ export declare function deployOnRelease(options: DeployOnReleaseOptions, { run, readJson, listDirs, sleep, now, loadTasks }?: DeployOnReleaseDeps): Promise<DeployOnReleaseReport>;
843
+ /** Options for running a suite: a dry run and turbo scoping. */
844
+ interface GroupOptions {
845
+ /** Print the resolved commands without running anything. */
846
+ dryRun?: boolean;
847
+ /** `turbo --filter=<pkg>` passthrough (monorepo). */
848
+ filter?: string;
849
+ /** `turbo --affected`: only the packages changed since `base`. */
850
+ affected?: boolean;
851
+ /** Git ref `affected` compares against. */
852
+ base?: string;
853
+ /** Environment `affected` reads. */
854
+ env?: Record<string, string | undefined>;
228
855
  }
229
- interface EnsureTurboDependencyResult {
230
- content: string;
231
- changed: boolean;
856
+ /** One task of a group run. */
857
+ interface GroupMember {
858
+ /** Flat id, e.g. `"lint:code"`. */
859
+ task: string;
860
+ /** Args the task is run with (`--check` for `format` when an old name asked for it). */
861
+ passthrough?: string[];
862
+ }
863
+ /** The result of one task in a group run. */
864
+ interface GroupJobReport {
865
+ /** Flat id, e.g. `"lint:code"`. */
866
+ task: string;
867
+ /** `ok`, `fail`, `skip` (nothing to run for this repo) or `dry-run` (planned, not run). */
868
+ status: "ok" | "fail" | "skip" | "dry-run";
869
+ /** The resolved command, when one was run or planned. */
870
+ command?: string;
871
+ /** Why the job failed or was skipped. */
872
+ message?: string;
873
+ }
874
+ /** The result of running every task in a group. */
875
+ interface GroupReport {
876
+ /** `"unknown"` when the group has no task to run. */
877
+ status: "ok" | "fail" | "dry-run" | "unknown";
878
+ /** One entry per task. */
879
+ jobs: GroupJobReport[];
880
+ }
881
+ interface GroupInput extends RunDeps, GroupOptions {
882
+ cwd: string;
883
+ /** What was asked for, as typed: `"test"`, `"sourceQuality"`. */
884
+ label: string;
885
+ /** The tasks to run, in order. */
886
+ members: GroupMember[];
887
+ /** Tasks reported as skipped without running, each with its reason (the repo-wide leaves, from a package directory). */
888
+ skipped?: Array<{
889
+ task: string;
890
+ message: string;
891
+ }>;
892
+ }
893
+ /** Runs every task of a group in sequence and reports each. */
894
+ export declare function runGroup(input: GroupInput): GroupReport;
895
+ /** One flat id an old dotted name stands for, with the args it adds to that id's run. */
896
+ interface LegacyTarget {
897
+ /** The flat id (`lint:editorconfig`). */
898
+ id: string;
899
+ /** Args the old name implied: `sourceQuality.formatting` checked prettier, it never wrote, so it adds `--check` to `format`. */
900
+ passthrough?: string[];
232
901
  }
233
- //#endregion
234
- //#region src/astromech.d.ts
902
+ /**
903
+ * The old dotted task names (and the workflow-only keys) and the flat ids they became — the complete map of spec
904
+ * `ci-flat-task-vocabulary`, "Old to new". `holocron run <old>` and `tasks:` in `holocron.config` still accept them
905
+ * for a window (the frozen reusables in `theholocron/.github` run `holocron run <old>` until #1216 deletes them), and
906
+ * a name that stood for one workflow carrying several checks maps to all of its successors, in run order.
907
+ *
908
+ * Each key is also the name of the generated workflow file, the turbo task and the `package.json` script until the
909
+ * later phases move those, so {@link legacyName} reads this table backwards. Removed together with the aliases in the
910
+ * last phase.
911
+ */
912
+ export declare const LEGACY_NAMES: Record<string, LegacyTarget[]>;
913
+ /**
914
+ * The configured tasks that were under an old intent-group namespace (`sourceQuality` matches the tasks that were
915
+ * `sourceQuality.*`), as flat ids in manifest declaration order. The old group names are accepted for the window that
916
+ * the old dotted names are, and a new-style `tasks:` entry matches through the old name its id replaced.
917
+ */
918
+ export declare function matchNamespace(config: TasksConfig, namespace: string): LegacyTarget[];
919
+ /** Everything `createAstromech` needs from the repo and the outside world; only `cwd` is required. */
235
920
  interface AstromechOptions {
236
921
  /** Repo root. */
237
922
  cwd: string;
@@ -250,34 +935,60 @@ interface AstromechOptions {
250
935
  logger?: RunLogger;
251
936
  /** User-facing line printer. Defaults to `console.log`. */
252
937
  print?: (line: string) => void;
938
+ /** Where a deprecation notice goes (an old task name, a group name). Defaults to `console.error`, so it is on stderr. */
939
+ warn?: (line: string) => void;
253
940
  /** Injectable subprocess runner (tests). Defaults to `spawnSync` (stdio inherit). */
254
941
  exec?: ExecFn;
255
942
  /** Injectable fs (tests). Default to `node:fs`. */
256
943
  readFile?: (path: string) => string;
944
+ /** Injectable existence check (tests). Defaults to `node:fs`. */
257
945
  fileExists?: (path: string) => boolean;
946
+ /** Injectable directory listing (tests). Defaults to `node:fs`. */
258
947
  listDir?: (path: string) => string[];
948
+ /** Injectable environment for `--affected` (tests). Defaults to `process.env`. */
949
+ env?: Record<string, string | undefined>;
259
950
  /** Injectable binary lookup (tests). Default checks `node_modules/.bin` then `PATH`. */
260
951
  lookPath?: (cwd: string, bin: string) => string | null;
261
952
  }
953
+ /** Options for `Astromech.run`: which word follows the task, what to forward, and how to scope the turbo run. */
262
954
  interface RunOptions {
263
955
  /**
264
- * Sub-job within the task — `performance` in `holocron run audit
265
- * performance`. Only meaningful for tasks that declare `jobs` (`audit`);
266
- * ignored otherwise. Omit to run every job the task has.
956
+ * The word after `task`, part of the task's name when the two together name a leaf (`unit` in `holocron run test
957
+ * unit`), else forwarded to the task as an argument.
267
958
  */
268
959
  job?: string;
960
+ /**
961
+ * Further positional words after `task` and `job`. All the words together name the task: `holocron run test unit
962
+ * storybook` is `task: "test"`, `job: "unit"`, `args: ["storybook"]`, and the longest match against the registry
963
+ * (`test:unit`) leaves `storybook` as an argument for the task.
964
+ */
965
+ args?: string[];
269
966
  /** Args after `--`, forwarded to the tool / turbo / script. */
270
967
  passthrough?: string[];
968
+ /** The read-only form of a task that writes by default: `format --check` runs prettier without writing. */
969
+ check?: boolean;
271
970
  /** Print the resolved command without running it. */
272
971
  dryRun?: boolean;
273
972
  /** Fail (exit 1) instead of skipping when the repo has no such task. */
274
973
  required?: boolean;
275
974
  /** `turbo --filter=<pkg>` passthrough (monorepo). */
276
975
  filter?: string;
976
+ /** `turbo --affected`: only the packages changed since `base`. */
977
+ affected?: boolean;
978
+ /** Git ref `affected` compares against. */
979
+ base?: string;
277
980
  }
981
+ /** The task runner: one manifest drives local runs, the CI pre-flight and the generated workflows and scripts. */
278
982
  interface Astromech {
279
- /** Run one task — or one of its sub-jobs (`opts.job`) — locally. */
280
- run(task: string, opts?: RunOptions): RunTaskReport;
983
+ /**
984
+ * Run a task, a suite or an old name locally. The words (`task`, `opts.job`, `opts.args`) are joined with `:` and the
985
+ * longest match against the registry wins: `test:unit` and `test unit` are one leaf, `test` is the suite (every
986
+ * configured leaf, in registry order, as a {@link GroupReport}), and what is left over is forwarded to the
987
+ * task. An old dotted name (`verification.unitTests`) still works and prints a deprecation notice; one that
988
+ * stood for several tasks (`sourceQuality.formatting`) or an old group name (`"sourceQuality"`) runs each in
989
+ * sequence as a {@link GroupReport}.
990
+ */
991
+ run(task: string, opts?: RunOptions): RunTaskReport | GroupReport;
281
992
  /**
282
993
  * Run the merge-gating checks locally, in CI order — "will CI pass?".
283
994
  * Default scope: `required: true` tasks (falls back to every `ci: true`
@@ -292,36 +1003,54 @@ interface Astromech {
292
1003
  */
293
1004
  thinCallers(): Map<string, string>;
294
1005
  /**
295
- * The complete reusable-workflow batch `holocron sync-github` pushes to
1006
+ * The complete reusable-workflow batch `holocron sync github` pushes to
296
1007
  * `theholocron/.github` — repo-relative path → content, "do not edit" header
297
1008
  * already applied to the YAML. Config-independent (the same for every repo).
298
1009
  */
299
1010
  reusableTemplates(): Map<string, string>;
300
1011
  /**
301
- * `package.json` scripts for this repo's manifest — the `"holocron"` entry
302
- * (`config.holocronScript ?? "holocron"`) plus `"<task>": "holocron run
303
- * <task>"` for every `config.tasks` item that is a runnable registry task
304
- * and not `local: false`. Merge into `package.json`; never clobber. Empty
305
- * when there is no config or `syncScripts: false`.
1012
+ * `package.json` scripts for this repo's manifest, from `scriptsFor()`: the `"holocron"` entry
1013
+ * (`config.holocronScript ?? "holocron"`), `prepare` when hooks are on, and one script per task the repo can run
1014
+ * locally. In a pnpm workspace with a generated `turbo.json` those call `turbo run <key>` (a suite is a turbo task
1015
+ * of its own) or, for a repo-scoped leaf, hold the tool's command; in a single package they are `holocron run
1016
+ * <words> --`. Merge into `package.json` with `mergeScripts()`; never clobber. Empty when there is no config or
1017
+ * `syncScripts: false`.
306
1018
  */
307
1019
  packageScripts(): Record<string, string>;
308
1020
  /**
309
- * The branch-protection required-status-check contexts for this repo —
310
- * every `required: true` task's check context plus `extraRequiredChecks`,
311
- * ordered and de-duplicated. `holocron setup` prepends `"DCO"` and applies
312
- * the list; this method is policy-free (manifest only).
1021
+ * Task names this repo's manifest can actually run locally — the same
1022
+ * filter {@link packageScripts} applies (skips `local: false` and tasks
1023
+ * with no local runner at all), but independent of `syncScripts`: a repo
1024
+ * that opts out of generated `package.json` scripts still has real
1025
+ * runnable tasks. Empty when there is no config. Backs `holocron`'s own
1026
+ * interactive task picker (`run` with no task given).
1027
+ */
1028
+ runnableTasks(): string[];
1029
+ /**
1030
+ * The branch-protection required-status-check contexts for this repo. With `aggregate` (the repo hosts the `ci`
1031
+ * check, see {@link aggregateCaller}) they are `ci / Required checks` and `DCO`; without it, `DCO`, every `required: true` task's
1032
+ * check context and `extraRequiredChecks`, ordered and de-duplicated. `holocron setup` applies the list; this
1033
+ * method is policy-free (manifest only).
313
1034
  */
314
- requiredChecks(): string[];
1035
+ requiredChecks(aggregate: boolean): string[];
315
1036
  /**
316
- * This repo's `codecov.yml` — component `paths` derived from `packages/*`.
1037
+ * The thin caller of the `ci` aggregate check (a `pull_request` workflow whose job `ci` calls the `Required checks` job that waits on every
1038
+ * `required: true` task, the hand-written checks and the `codecov/*` statuses), or `null` when the manifest has
1039
+ * nothing to wait on. Only a repo that hosts the reusable `ci.yml` writes it; the others have no `ci` yet.
1040
+ */
1041
+ aggregateCaller(): string | null;
1042
+ /**
1043
+ * This repo's `codecov.yml` — component `paths` derived from the workspace packages.
317
1044
  * Pass the current file's content (`null` if none exists yet) to either
318
1045
  * merge the component list in or scaffold a fresh file. Policy-free same
319
1046
  * as {@link requiredChecks} — `holocron setup` owns writing the result.
1047
+ * `options.docsCoverage` adds the `documentation` flag and its statuses.
320
1048
  */
321
- codecovConfig(existing: string | null): string;
1049
+ codecovConfig(existing: string | null, options?: CodecovConfigOptions): string;
322
1050
  /**
323
1051
  * The generated `turbo.json` for this repo's manifest, pretty-printed —
324
- * write directly, no merge. `null` when no manifest task has turbo fan-out
1052
+ * write directly, no merge. In a pnpm workspace it also holds the suite aggregator tasks and a `//#<id>` root task
1053
+ * per repo-scoped leaf with a local tool. `null` when no manifest task has turbo fan-out
325
1054
  * config (nothing to write). See {@link TurboTaskConfig} in `registry.ts`.
326
1055
  */
327
1056
  turboConfig(): string | null;
@@ -332,10 +1061,14 @@ interface Astromech {
332
1061
  * (not just an orchestrator) silently vanishes from `turbo run <task>`.
333
1062
  * Pass `pnpm-workspace.yaml`'s current content (or `""` if none exists —
334
1063
  * a no-op either way, since no `packages:` key means single-package mode
335
- * already) and root `package.json`'s own `scripts` keys. `changed: false`
336
- * means don't write anything — the file is already correct.
1064
+ * already) and root `package.json`'s own `scripts` object — values and
1065
+ * all, not just keys, so a task-name-matching script that's already the
1066
+ * generated `holocron run <task> --` wrapper (predating this call, not
1067
+ * written by it) is correctly excluded rather than treated as proof root
1068
+ * is directly buildable (#846). `changed: false` means don't write
1069
+ * anything — the file is already correct.
337
1070
  */
338
- ensureRootWorkspaceMember(workspaceYaml: string, rootScripts: readonly string[]): EnsureRootWorkspaceMemberResult;
1071
+ ensureRootWorkspaceMember(workspaceYaml: string, rootScripts: Readonly<Record<string, string>>): EnsureRootWorkspaceMemberResult;
339
1072
  /**
340
1073
  * `turboConfig()` writes a `turbo.json` but never touches `package.json`
341
1074
  * — a repo with no local `turbo` devDependency falls back to whatever
@@ -347,382 +1080,227 @@ interface Astromech {
347
1080
  */
348
1081
  ensureTurboDependency(packageJson: string, workspaceYaml: string): EnsureTurboDependencyResult;
349
1082
  }
350
- declare function createAstromech(options: AstromechOptions): Astromech;
351
- //#endregion
352
- //#region src/codecov.d.ts
1083
+ export declare function createAstromech(options: AstromechOptions): Astromech;
353
1084
  /**
354
- * `codecov.yml` generation — a manifest-derived artifact (component `paths`
355
- * come from workspace packages; the status targets track the `test` task's
356
- * coverage setup), the same category as the reusable `test.yml` this package
357
- * also generates. Moved out of `@theholocron/cli` (theholocron/holocron#650)
358
- * — `holocron setup`'s codecov step now calls {@link codecovConfig} instead
359
- * of importing this logic directly.
1085
+ * The branches releases are cut from, in release order: `main` is the stable line, `alpha` the prerelease line.
1086
+ *
1087
+ * This is the release-branch LIST. It is not the repo's default branch (`defaultBranch` in `holocron.config.ts` is a
1088
+ * per-repo setting) and it is not the prerelease channel name (see {@link PRERELEASE_CHANNEL}).
360
1089
  */
361
- interface WorkspacePackage {
362
- slug: string;
363
- name: string;
364
- /** Which workspace root the package was discovered under. Defaults to `"packages"`. */
365
- dir?: "packages" | "apps";
366
- }
367
- declare function codecovComponentBlock(packages: WorkspacePackage[]): string;
1090
+ export declare const RELEASE_BRANCHES: readonly ["main", "alpha"];
368
1091
  /**
369
- * Ensure every codecov status default carries `if_not_found: success`, so an
370
- * infra-only PR (dep bump, config, lockfile — no coverable change) passes
371
- * instead of hanging forever on a required check codecov never posts.
1092
+ * The prerelease channel: the branch name semantic-release publishes prereleases from, which is also the npm
1093
+ * dist-tag those prereleases carry. It is one of {@link RELEASE_BRANCHES}.
1094
+ */
1095
+ export declare const PRERELEASE_CHANNEL: "alpha";
1096
+ /**
1097
+ * The paths a release must touch to redeploy `pkg` when its manifest doesn't
1098
+ * list them: its own folder plus the folder of every
1099
+ * {@link workspaceDependencies} entry. Derived rather than listed so a new or
1100
+ * dropped workspace dependency needs no second edit.
372
1101
  *
373
- * Injects the key on the line after each `target:` that sits inside a status
374
- * block (`coverage.status.*.default` or a `statuses:` list item — indent ≥ 8,
375
- * or ≥ 8 for a `- type:` list entry), when the immediate sibling lines do not
376
- * already declare it.
1102
+ * @returns Repo-relative prefixes, each ending in `/`.
377
1103
  */
378
- declare function ensureIfNotFound(yaml: string): string;
379
- declare function mergeCodecovComponents(existing: string, packages: WorkspacePackage[]): string;
1104
+ export declare function defaultPaths(repoRoot: string, pkg: WorkspacePackage, all: WorkspacePackage[]): string[];
380
1105
  /**
381
- * Every public `packages/*` and `apps/*` workspace, sorted by slug. `[]`
382
- * when neither directory exists. Monorepo templates (Next.js, React, …)
383
- * ship user-facing code under `apps/` alongside library code under
384
- * `packages/` — both need a codecov component so `codecov/patch/<slug>`
385
- * actually posts for each.
1106
+ * The text of `holocron run --help`: the suites with their leaves, and the tasks that are not in a suite, under the six
1107
+ * intent groups (which survive only as this grouping and the docs table).
386
1108
  */
387
- declare function readWorkspacePackages(repoRoot: string): WorkspacePackage[];
388
- /** A brand-new `codecov.yml` — the scaffold header + the base template + this repo's component list. */
389
- declare function createCodecovConfig(packages: WorkspacePackage[]): string;
1109
+ export declare function describeTasks(): string;
1110
+ /** `true` when a manifest name (a flat id or an old dotted name) stands for the given flat id. */
1111
+ export declare function isTask(name: string, id: string): boolean;
390
1112
  /**
391
- * The full pipeline `holocron setup` needs: read this repo's public
392
- * `packages/*`, then either merge them into an `existing` `codecov.yml` or
393
- * scaffold a new one.
1113
+ * Every task name a manifest may list: the flat ids of the registry, the workflow-only ids (`label`, `greet`), and the
1114
+ * old dotted names that are still accepted. What a config validator checks a `tasks:` entry against.
394
1115
  */
395
- declare function codecovConfig(repoRoot: string, existing: string | null): string;
396
- //#endregion
397
- //#region src/linters.d.ts
1116
+ export declare const KNOWN_TASKS: ReadonlySet<string>;
398
1117
  /**
399
- * The linter registry — one list of linter names (from `config.tasks`'
400
- * `{ name: "lint", linters: [...] }`, or auto-detected) maps to both the
401
- * CI super-linter `VALIDATE_*` env and the native local run. This table is
402
- * the single source of truth for that mapping; {@link superLinterConfig}
403
- * (CI) and the `holocron run lint` aggregate (local) both read it.
404
- *
405
- * Spec: `docs/wiki/specifications/tech-astromech-task-runner.spec.md` "Lint parity".
1118
+ * The thin caller `yaml` of task `id` spelled with the names it had before they became the task id: the old workflow
1119
+ * `name:` and the old id and `name:` of each job. This is the legacy-name gate (spec `ci-flat-task-vocabulary`, phase
1120
+ * F): a repo whose callers still call the frozen reusables in `theholocron/.github` keeps the checks its ruleset lists,
1121
+ * so only the repo that hosts the reusables (and, later, every repo once `CI_HOME` is `ci-v1`) gets the flat names.
1122
+ * An id with no old spelling is returned as it is. Only a job `name:` that is the id is rewritten, so a name a caller
1123
+ * builds itself (the grouped release's matrix name) is left to the entry's `replace`.
406
1124
  */
407
- interface LinterDef {
408
- /**
409
- * super-linter `VALIDATE_*` keys this linter turns on. Setting any
410
- * `VALIDATE_*` puts super-linter in allow-list mode, so emitting only the
411
- * enabled keys makes it run exactly this set.
412
- */
413
- validate: string[];
414
- /** super-linter `FIX_*` keys (auto-commit / `--write` parity). */
415
- fix?: string[];
416
- /**
417
- * Local binary, resolved from `node_modules/.bin` then `PATH`. Absent →
418
- * the linter has no meaningful local run (`holocron run lint` prints
419
- * "CI only"); CI still enforces it.
420
- */
421
- localBin?: string;
422
- /** Args for `localBin` in CHECK mode — never `--write` / `--fix`. */
423
- localArgs?: string[];
424
- /**
425
- * Shown by `holocron run lint` when `localBin` is set but not found on
426
- * PATH — the "you're missing a tool the repo needs" nudge.
427
- */
428
- installHint?: string;
429
- /**
430
- * Repo-root filenames that auto-enable this linter when the `lint` task
431
- * has no explicit `linters` list. Ignored when {@link always} is set.
432
- */
433
- detect?: string[];
434
- /** Enabled regardless of detection (the org baseline). */
435
- always?: boolean;
436
- /** Reusable-workflow config-file input this linter honors, if any. */
437
- configInput?: "eslint-config" | "prettier-config" | "yaml-config";
438
- }
1125
+ export declare function legacyCaller(id: string, yaml: string): string;
439
1126
  /**
440
- * Known linters, in execution order. `always` entries are the current
441
- * hard-coded super-linter baseline; `prettier` is always-on because the org
442
- * applies it universally (super-linter only lints files that exist).
1127
+ * The file name a thin caller of task `id` has while callers are legacy-named (see `legacyCaller`): the old task name
1128
+ * and `.yml`, `verification.unitTests.yml` for `test:unit`. An id with no old name (`preview`) keeps its own.
443
1129
  */
444
- declare const LINTERS: Record<string, LinterDef>;
445
- /** Every linter name the registry knows. */
446
- declare const LINTER_NAMES: ReadonlySet<string>;
1130
+ export declare function legacyCallerFile(id: string): string;
447
1131
  /**
448
- * Resolve the linter set for a repo. An `explicit` list (from `config.tasks`)
449
- * picks the candidate set; otherwise the candidates are every `always` linter
450
- * plus every `detect`-gated linter whose filenames are present at the repo
451
- * root. Either way, a `detect`-gated linter (eslint, markdownlint) only makes
452
- * the final set when its config file is actually present — a repo can't run
453
- * eslint without an `eslint.config.*`, and super-linter FATALs if you ask it
454
- * to (theholocron/holocron#654). `always` linters are unconditional. Result
455
- * is ordered by {@link LINTERS} declaration order.
456
- *
457
- * @throws when an `explicit` name is not in the registry — a typo is a
458
- * config bug, not a linter to silently skip.
1132
+ * The old file name of a flat reusable workflow — `test-unit.yml` is `verification.unitTests.yml`. The frozen copies in
1133
+ * `theholocron/.github` keep the old names and exist only there, so a reference to a reusable that is called from
1134
+ * outside this repo while `CI_HOME` points at `main` is spelled with it (spec `ci-flat-task-vocabulary`, "Legacy names
1135
+ * while `CI_HOME` points at `.github`"). A file with no old name (`preview.yml`, `ci.yml`) is returned as it is.
459
1136
  */
460
- declare function resolveLinters(opts: {
461
- explicit?: string[];
462
- rootFiles: string[];
463
- }): Array<{
464
- name: string;
465
- def: LinterDef;
466
- }>;
467
- //#endregion
468
- //#region src/registry.d.ts
1137
+ export declare function legacyFile(file: string): string;
469
1138
  /**
470
- * The task registry — how each task runs *locally*, without GitHub
471
- * Actions. `holocron run <task>` and `holocron ci` resolve against this;
472
- * adding a task here gives every repo that task.
473
- *
474
- * Keyed identically to the workflow templates — a task IS a workflow. This
475
- * is the canonical vocabulary table (epic #672, D11): every other artifact
476
- * (`KNOWN_TASKS`, `thin-callers.ts`'s `KNOWN_WORKFLOWS`/`WORKFLOW_CHECK_CONTEXTS`,
477
- * `CI_ORDER`) derives from these keys rather than hand-duplicating them —
478
- * including the future GitHub App (#679), which imports this same table for
479
- * config-schema validation instead of reimplementing its own copy.
480
- *
481
- * Task names are an intent-facing vocabulary (`verification.*`,
482
- * `sourceQuality.*`, `security.*`, `delivery.*`, `platform.*`,
483
- * `knowledge.*`), not tool names — `eslint`/`vitest`/`tsdown`/… stay
484
- * internal to this file and `theholocron/configs`. See
485
- * `.notes/tech-vocabulary-rename.spec.md` (#675) for the full mapping and
486
- * the reasoning behind each namespace and decomposition.
487
- *
488
- * Spec: `docs/wiki/specifications/tech-astromech-task-runner.spec.md` (epic #581).
1139
+ * The old name a flat id replaced — `test:unit` is `verification.unitTests`. It is what the generated workflow files,
1140
+ * `turbo.json` tasks and `package.json` scripts are still called until the later phases rename them, so generators
1141
+ * translate through it and the files do not change. `undefined` for an id that never had an old name (`preview`).
1142
+ * `format` and the other formatting successors share the formatting workflow's name.
489
1143
  */
490
- /** How to run one task (or job) locally. */
491
- interface LocalRunner {
492
- /** Binary to invoke — resolved from `node_modules/.bin` then PATH. */
493
- tool?: string;
494
- /** Args appended after the tool. */
495
- args?: string[];
496
- /** First entry whose `when` filename matches a repo-root file wins. */
497
- detect?: Array<{
498
- when: RegExp;
499
- tool: string;
500
- args?: string[];
501
- }>;
502
- /** The task is already a holocron subcommand (`sync`, `sync-wiki`). */
503
- command?: string;
504
- }
1144
+ export declare function legacyName(id: string): string | undefined;
505
1145
  /**
506
- * How a task fans out across every workspace via Turborepo — content-hash
507
- * caching + `^`-prefixed cross-package ordering, epic #672 D9 (#681).
508
- * Present only on tasks that genuinely run *per workspace* (a real build/
509
- * compile/test step); whole-repo single-run tools (prettier, gitleaks,
510
- * commitlint, yamllint, …) have no entry here — they stay off turbo.json
511
- * entirely and run once, un-fanned-out, the way they already do.
1146
+ * The key of the workflow that carries `name` in a repo that still calls the frozen reusables in `theholocron/.github`
1147
+ * (the legacy-name gate): a flat id that shared an old workflow with others (`lint:markdown` and `format` with
1148
+ * `lint:editorconfig`, the old `sourceQuality.formatting`) maps to the first of them, because only that one has a
1149
+ * frozen reusable. Every other name is its own key, an old name mapping to its first successor.
512
1150
  */
513
- interface TurboTaskConfig {
514
- /** Glob patterns turbo hashes to decide whether a cached run is still valid. */
515
- inputs: string[];
516
- /** Glob patterns turbo caches/restores after a run. Empty array for a task with no build artifact (lint, typecheck). */
517
- outputs: string[];
518
- /** Task names this depends on — a bare name runs in this package first; `^name` waits on every upstream workspace's task. */
519
- dependsOn: string[];
520
- }
521
- /** One sub-job of a task — `performance` in `holocron run audit performance`. */
522
- interface JobDef {
523
- /** How the job runs locally; `null` → no local equivalent (enforced in CI). */
524
- local: LocalRunner | null;
525
- /**
526
- * The CI status-check context this job reports as (e.g.
527
- * `platform.repoValidation / Validate registry consistency`) — every sub-job is a CI job.
528
- * `holocron run <task>` and `holocron ci` label each job line with it;
529
- * the task-level `… / Conclusion` context (only for tasks with several
530
- * jobs) lives in `WORKFLOW_CHECK_CONTEXTS`.
531
- */
532
- checkContext: string;
533
- }
534
- interface TaskDef {
535
- /**
536
- * `null` — the registry has no built-in runner (CodeQL, deploys, the
537
- * bundle-size job). An explicit turbo task or `package.json` script still
538
- * runs (resolution steps 1–2); with neither, `holocron run` does nothing
539
- * and `holocron ci` skips it — never a failure, even when the task is
540
- * `required` (a CI-only check isn't a local one).
541
- */
542
- local: LocalRunner | null;
543
- /**
544
- * Sub-jobs, keyed by slug. Declared order is run order: `holocron run
545
- * <task>` (no job) runs each in turn.
546
- */
547
- jobs?: Record<string, JobDef>;
548
- /** Org-default flags injected by tool name. Removed by a repo override. */
549
- flags?: Record<string, string[]>;
550
- /**
551
- * This task is a linter-group aggregate: `holocron run <task>` resolves
552
- * this fixed set of `linters.ts` entries (still gated by each linter's
553
- * own `detect`/`always` rule) and runs each natively, instead of using
554
- * `local`. Replaces the old single `lint` task's auto-detected linter
555
- * list (`config.tasks[].linters`) — a repo's choice of which of these
556
- * run is now just whether it includes this task in `tasks: [...]`, same
557
- * as any other task. See `linters.ts` / `run.ts`.
558
- */
559
- linterGroup?: string[];
560
- /** Carries a `preview` mode (Cloudflare/Vercel deploy, npm dist-tag, Fern preview docs, …). Cross-cutting, not its own task. */
561
- preview?: boolean;
562
- /** Turborepo fan-out config for this task — see {@link TurboTaskConfig}. Omitted for whole-repo, non-fan-out tasks. */
563
- turbo?: TurboTaskConfig;
564
- }
565
- declare const TASKS: Record<string, TaskDef>;
566
- /** Every task name the registry knows. */
567
- declare const KNOWN_TASKS: Set<string>;
1151
+ export declare function legacyWorkflowKey(name: string): string;
568
1152
  /**
569
- * The order `holocron ci` runs tasks in — cheapest / fastest signal first, so
570
- * an agent or a `pre-push` hook fails early. Tasks not listed here run last, in
571
- * manifest order. (The generated thin callers carry no `needs:` — cross-workflow
572
- * ordering lives in `theholocron/.github` — so `holocron ci` declares its own.)
573
- */
574
- declare const CI_ORDER: string[];
575
- //#endregion
576
- //#region src/required-checks.d.ts
577
- /** Ordered (task contexts in {@link CI_ORDER}, then extras), de-duplicated. */
578
- declare function requiredChecks(config: TasksConfig): string[];
579
- //#endregion
580
- //#region src/resolver.d.ts
581
- /**
582
- * Resolves the absolute path to a Bucket A tool's shared `@theholocron/*-config`
583
- * entry point, installed in the consuming repo's own `node_modules` — and the
584
- * CLI flag(s) to hand it via (`--config`, `--extends`, …). `run.ts` splices the
585
- * result into the command it builds for a tool/detect runner or a linter-group
586
- * entry, right after the tool's own args.
587
- *
588
- * Every mapped package's resolved entry point already carries a ready-to-use
589
- * default export (a plain re-export for `prettier`/`commitlint`; an invoked,
590
- * zero-arg preset for `eslint`/`vitest`/`tsdown` — verified end-to-end against
591
- * each tool's real `--config`/`--extends` loader, not just the file's shape).
592
- * A repo doesn't need this package installed at all — every lookup degrades to
593
- * `[]` (no flag added, the tool falls back to its own auto-discovery of a
594
- * local file, unchanged from today) rather than throwing.
595
- *
596
- * **Local file wins.** A `<tool>.config.*` sitting in `cwd` (whether it's
597
- * pure boilerplate or has real per-package customization on top of the
598
- * shared bundle, e.g. `mergeConfig(base, { test: { coverage: { exclude }
599
- * } })`) always skips the splice, even when the shared package is also
600
- * installed — an explicit `--config <shared path>` flag beats a tool's own
601
- * auto-discovery every time, so splicing it unconditionally would silently
602
- * discard that customization the file is still sitting right there on disk.
603
- * The shared bundle is only ever the fallback for a package with *no* local
604
- * file at all — that's still the "delete the file to go fully shared" path
605
- * this was designed for (#676); it just isn't unconditional (#749).
606
- *
607
- * `semantic-release`, `devmoji`, `editorconfig-checker`, and `knip` are
608
- * deliberately absent — `semantic-release-config`'s `defineConfig()` needs
609
- * real per-repo data (branches, npm options) a static `--extends <path>` can't
610
- * carry; `devmoji` runs through a git hook template, not `holocron run
611
- * <task>`; `editorconfig-checker` has no shared-config package yet; `knip` is
612
- * repo-specific by nature, never a shared-config candidate. See
613
- * `.notes/tech-config-resolution.spec.md` (#676).
614
- */
615
- interface ResolverDeps {
616
- readFile: (path: string) => string;
617
- fileExists: (path: string) => boolean;
618
- }
619
- /** Every tool name the resolver knows how to point at a shared config. */
620
- declare const RESOLVABLE_TOOLS: ReadonlySet<string>;
1153
+ * Script names npm and pnpm give a meaning of their own, so no task may be named like one (spec
1154
+ * `ci-flat-task-vocabulary`, "npm lifecycle and package-manager names"): `pnpm publish` runs a script called `publish`
1155
+ * after publishing, `prepare` and the install hooks run on `pnpm install`, `version` hooks wrap `npm version`. That is
1156
+ * why the task is `release`. `prepare` stays a root script (husky) and can never be a task.
1157
+ */
1158
+ export declare const RESERVED_SCRIPT_NAMES: ReadonlySet<string>;
621
1159
  /**
622
- * `<flag> <absolute path>` for `tool`, resolved against `cwd`'s
623
- * `node_modules` — or `[]` when the tool isn't mapped, `cwd` already has its
624
- * own local config file for it (#749 — local always wins, customized or
625
- * not), the shared package isn't installed, its `package.json` doesn't
626
- * declare the export subpath this needs, or the resolved file doesn't
627
- * actually exist on disk (a stale install, or a package version that
628
- * predates the export existing).
1160
+ * pnpm's own commands. `pnpm deploy` runs pnpm's `deploy`, not the script, which is reachable only as `pnpm run deploy`,
1161
+ * so anything that prints a command for a script of this name must print `pnpm run <script>`.
629
1162
  */
630
- declare function resolveToolConfig(tool: string, cwd: string, deps: ResolverDeps): string[];
631
- //#endregion
632
- //#region src/reusable.d.ts
1163
+ export declare const PNPM_BUILTIN_COMMANDS: ReadonlySet<string>;
633
1164
  /**
634
- * The **reusable** GitHub Actions surface pushed to `theholocron/.github` by
635
- * `holocron sync-github` — the `workflow_call` implementations and composite
636
- * actions that every repo's thin callers delegate to.
637
- *
638
- * `theholocron/.github` is a **pure sync target**: `.github/workflows/*`,
639
- * `.github/actions/*` and `workflow-templates/*` there are generated from the
640
- * `.yml` files in `src/templates/reusable/` and pushed verbatim (with a
641
- * "do not edit" header). Never hand-edit them in `.github`.
1165
+ * The flat ids a name written in a manifest, a script or on the command line stands for, in run order: a flat id (or
1166
+ * its hyphen compound in the script spelling, `deploy:preview`) stands for itself, an old dotted name for its
1167
+ * successors (`sourceQuality.formatting` for three), anything else for none. A suite name is not a task and resolves to
1168
+ * none.
1169
+ */
1170
+ export declare function resolveTaskName(name: string): LegacyTarget[];
1171
+ /**
1172
+ * The npm script spelling of a task id: a hyphen compound takes a colon (`deploy-preview` is the script
1173
+ * `deploy:preview`), because `deploy:preview` reads as a variant of `deploy` the way `test:watch` does. Every other id
1174
+ * is its own script name, and only an id that has a script needs it (`check-tokens` and `release` have none).
1175
+ */
1176
+ export declare function scriptName(id: string): string;
1177
+ /**
1178
+ * The suites the registry declares, in the order their first leaf appears: `test`, `lint`, `scan` and `validate`. A suite is declared by the `suite` field of its
1179
+ * leaves; it is never a task id.
1180
+ */
1181
+ export declare const SUITES: readonly string[];
1182
+ /** The leaf ids of a suite, in registry (run) order; empty for a name that is not a suite. */
1183
+ export declare function suiteMembers(suite: string): string[];
1184
+ /**
1185
+ * The key a task has in `turbo.json` and, in a package, as the script that runs it (the two must be the same string):
1186
+ * its script spelling, unless the manifest spells the task with the old dotted name it replaced. Both vocabularies are
1187
+ * accepted for a window, and a repo's packages hold scripts named in the vocabulary its `tasks:` list speaks, so the key
1188
+ * follows the entry. Rewriting the list to flat ids is what moves a repo's turbo keys, and its package scripts with them.
642
1189
  *
643
- * Not to be confused with `WORKFLOW_TEMPLATES` in `thin-callers.ts` — those are
644
- * the *thin-caller bases* written into each consumer repo's `.github/workflows/`.
1190
+ * `name` is the manifest entry, `id` one of the flat ids it stands for (`sourceQuality.formatting` stands for three, and
1191
+ * none of them owns the name, so they are keyed by their ids).
645
1192
  */
646
- /** `workflow_call` implementations → `.github/workflows/<name>.yml`. */
647
- declare const REUSABLE_WORKFLOWS: Record<string, string>;
648
- /** Composite actions → `.github/actions/<name>/action.yml` (key includes `/action`). */
649
- declare const REUSABLE_ACTIONS: Record<string, string>;
650
- /** GitHub starter-workflow metadata → `workflow-templates/<name>.properties.json`. */
651
- declare const WORKFLOW_TEMPLATE_PROPERTIES: Record<string, string>;
1193
+ export declare function taskKey(name: string, id: string): string;
652
1194
  /**
653
- * The complete file batch `holocron sync-github` pushes to `theholocron/.github`:
654
- * path → content. YAML gets the "do not edit" header; the starter-workflow
655
- * `.properties.json` files are left bare (native JSON, not a commented file).
1195
+ * The key a manifest name has in the workflow tables (`WORKFLOW_TEMPLATES`, `WORKFLOW_CHECK_CONTEXTS`): the flat id of
1196
+ * the workflow that carries it. A flat id is its own key; an old name maps to the first id that replaced it
1197
+ * (`sourceQuality.formatting` is `lint:editorconfig`); a task with no workflow of its own maps to the workflow that
1198
+ * runs its check (`format` is `lint:code`, see `TaskDef.host`); a name with no old name (`preview`, an unknown one) is
1199
+ * its own key. See {@link legacyWorkflowKey} for the key a repo that still calls the frozen reusables uses.
656
1200
  */
657
- declare function reusableTemplates(): Map<string, string>;
658
- //#endregion
659
- //#region src/tsconfig.d.ts
660
- /**
661
- * `tsconfig.json` generation — Bucket B (config-resolution workstream, #676):
662
- * the file must stay committed (the TypeScript language server discovers it
663
- * directly from disk, no `--config` override mechanism to hand it a path
664
- * instead), but its content is fully derivable, so it's generated rather
665
- * than hand-authored — the same category as `.editorconfig`
666
- * ({@link "./templates/configs/editorconfig/create-config.js" createConfig})
667
- * and {@link codecovConfig}.
668
- *
669
- * Surveyed every package-level `tsconfig.json` across the org (`holocron`,
670
- * `clients`, `utils` — 20+ packages). `extends: "@theholocron/tsconfig/
671
- * node-lts"`, `compilerOptions.baseUrl: "./"`, `compilerOptions.outDir:
672
- * "./dist"`, `include: ["src/**\/*.ts"]`, and `exclude: ["node_modules",
673
- * "dist"]` are uniform in every one — safe defaults here. `paths` (a `@/*`
674
- * → `./src/*` import alias) is a real per-package choice, present in
675
- * roughly 40% of packages checked — an opt-in parameter, not a default.
676
- *
677
- * Two fields checked and deliberately *not* absorbed as defaults, unlike
678
- * `eslint-config`'s `tsconfigRootDir`/`settings.node` (which turned out
679
- * redundant with the shared package's own behavior, `configs`#461):
680
- * `compilerOptions.module`/`moduleResolution` (only `@theholocron/cli`
681
- * overrides these, to `esnext`/`bundler` — a genuine deviation from the
682
- * shared `node-lts` preset's `nodenext`/`nodenext`, needed for its bundler
683
- * tooling, not something every package should inherit) and
684
- * `compilerOptions.rootDir` (present in exactly two packages, always the
685
- * same value `./src` that `include` already implies — an unnecessary
686
- * override wherever it appears, not a pattern worth generalizing).
687
- *
688
- * Monorepo *root* `tsconfig.json` (a TS project-references "solution
689
- * file" — `holocron`'s own root is `{ files: [], references: [...] }`,
690
- * listing which packages to build) is a structurally different, genuinely
691
- * per-repo document — out of scope here, same as Bucket C content.
692
- *
693
- * Not yet wired into `holocron setup`'s per-package write loop (every
694
- * other Bucket B file there is a single repo-root file, safely
695
- * overwritten every run — `tsconfig.json` is per-package, and most
696
- * packages' files still carry real hand-authored content today, not yet
697
- * migrated to a fully-generated state). That per-package iteration +
698
- * safe-migration design is `#680`'s job, not duplicated here — this is
699
- * the generator itself, ready for it to call.
1201
+ export declare function workflowKey(name: string): string;
1202
+ /**
1203
+ * The workflow keys a manifest name needs a thin caller for, without repeats and in run order: one per workflow that
1204
+ * carries the ids the name stands for. A name that stands for one id has one; `validate` has two, `validate:specs` and
1205
+ * `validate:docs`, because each leaf has a reusable workflow of its own, and `sourceQuality.formatting` has
1206
+ * `lint:editorconfig` and `lint:markdown` (its `format` step runs inside `lint:code`, which has no caller of its own for
1207
+ * it). A name that stands for no id (unknown) is its own key.
700
1208
  */
701
- interface TsconfigOptions {
702
- /** Human-readable name for the `display` field — the package's own name is the usual choice. */
703
- display: string;
1209
+ export declare function workflowKeys(name: string): string[];
1210
+ /**
1211
+ * The task id a workflow source path stands for: the `ci/workflows/` prefix (or `../workflows/`, which is how
1212
+ * `src/index.ts` globs it) and the `.yml` suffix are dropped, and each folder separator becomes a colon, so
1213
+ * `ci/workflows/test/unit.yml` is `test:unit` and `ci/workflows/typecheck.yml` is `typecheck`. The folder is the
1214
+ * suite of a leaf; {@link workflowFile} gives the generated file name of the id.
1215
+ */
1216
+ export declare function idFromSource(path: string): string;
1217
+ /**
1218
+ * The file name of the reusable workflow generated for a task id: a colon becomes a hyphen and `.yml` is added, so
1219
+ * `test:unit` is `test-unit.yml` and `typecheck` is `typecheck.yml`. GitHub reads only a flat `.github/workflows`, which
1220
+ * is why the grouped sources of `ci/workflows/` are flattened; {@link idFromSource} goes the other way.
1221
+ */
1222
+ export declare function workflowFile(id: string): string;
1223
+ /** The `.alexrc.json` body: the org's inclusive-language allow-list. */
1224
+ declare function createRcConfig(): string;
1225
+ /** The `.alexignore` body. */
1226
+ declare function createIgnoreConfig(): string;
1227
+ /**
1228
+ * `.husky/commit-msg` — lints the commit message via `holocron run lint
1229
+ * commit-msg` (holocron#789), the real programmatic replacement for
1230
+ * shelling out to `commitlint --edit`. Installed by `holocron setup` when
1231
+ * hooks are enabled. Same `__HOLOCRON_SCRIPT__` substitution as `pre-push`.
1232
+ *
1233
+ * @param holocronScript - the command that invokes the CLI. Defaults to
1234
+ * `pnpm exec holocron`; the source repo passes `node cli/cli/dist/cli.mjs`.
1235
+ */
1236
+ declare function createConfig(holocronScript?: string): string;
1237
+ /** The `.github/dco.yml` body, which lets a maintainer remediate a missing sign-off with a follow-up commit. */
1238
+ declare function createConfig$1(): string;
1239
+ /** What varies in the generated `.github/dependabot.yml`; the rest of the file is the same for every repo. */
1240
+ interface DependabotConfigOptions {
704
1241
  /**
705
- * `@theholocron/tsconfig` variant. Defaults to `"node-lts"` — every
706
- * checked package uses it; the other three (`astro`, `nextjs`, `react`)
707
- * exist for a template repo's app-shaped packages, not the plain
708
- * Node.js library packages this org's currently-migrated repos ship.
1242
+ * Packages Dependabot must not raise version updates for, by exact name. Each becomes a name-only
1243
+ * `ignore` entry on the npm ecosystem. Security updates are not affected: for those, Dependabot
1244
+ * only honours an `ignore` entry that lists `versions`.
709
1245
  */
710
- variant?: "astro" | "nextjs" | "node-lts" | "react";
1246
+ ignore?: readonly string[];
711
1247
  /**
712
- * Add a `@/*` → `./src/*` path alias. A real per-package choice, not a
713
- * default — roughly 40% of packages checked use one, the rest don't.
1248
+ * Directories, besides `.github/workflows` (`/`), whose workflow and action files the github-actions ecosystem
1249
+ * watches: the sources a repo generates its workflows from. Dependabot does not bump those otherwise, so
1250
+ * `probe generated check` fails on the difference. Globs are allowed.
714
1251
  */
715
- paths?: boolean;
1252
+ sources?: readonly string[];
716
1253
  }
717
1254
  /**
718
- * A package-level `tsconfig.json` — the uniform shape confirmed across
719
- * every package checked, parameterized only by the two fields that
720
- * genuinely vary (`display`, `paths`). No scaffold/workflow header (matches
721
- * `.alexrc.json`'s existing precedent for a strict-JSON Bucket B file —
722
- * JSON has no comment syntax to carry one, and TypeScript's own tolerance
723
- * for JSONC comments in `tsconfig.json` isn't worth relying on for a file
724
- * this thin).
1255
+ * The content of `.github/dependabot.yml`, with its generated-file header. Names in `ignore` get a name-only
1256
+ * `ignore` entry on the npm ecosystem, and `sources` are watched next to `/` (`.github/workflows`) by the
1257
+ * github-actions one; with neither, the file is the shared body unchanged.
1258
+ */
1259
+ declare function createConfig$2({ ignore, sources }?: DependabotConfigOptions): string;
1260
+ /** The `devmoji.config.cjs` body, which defers to `@theholocron/devmoji-config`. */
1261
+ declare function createConfig$3(): string;
1262
+ /** The `.editorconfig` body, under the auto-generated header. */
1263
+ declare function createConfig$4(): string;
1264
+ /**
1265
+ * The generated `.editorconfig-checker.json`.
1266
+ *
1267
+ * Deliberately carries no `"Version"` key: editorconfig-checker treats it as a
1268
+ * hard gate and exits non-zero the moment the running binary's version differs
1269
+ * — which it does the instant a contributor's local install (Homebrew tracks
1270
+ * latest) drifts from the version super-linter bundles in CI, breaking
1271
+ * `holocron run lint` / the pre-push hook for everyone (#618). The config
1272
+ * options here (`Exclude`, `Disable`) are stable across releases, so pinning
1273
+ * buys nothing.
1274
+ */
1275
+ declare function createConfig$5(): string;
1276
+ /** The `.github/labeler.yml` body, which labels a pull request by its Conventional Commit type. */
1277
+ declare function createConfig$6(): string;
1278
+ /**
1279
+ * `.husky/pre-commit` — runs GitLeaks (scoped to staged changes) and
1280
+ * lint-staged before every commit. Installed by `holocron setup` when hooks
1281
+ * are enabled (default for `protection: "strict"`). `git commit --no-verify`
1282
+ * bypasses it.
1283
+ *
1284
+ * `gitleaks protect --staged` (not `gitleaks git`) is deliberate: the latter
1285
+ * scans the entire commit history on every invocation, so once any false
1286
+ * positive lands in a past commit — a fake test token, an example key in a
1287
+ * doc — every future commit is permanently blocked, regardless of what's
1288
+ * actually staged.
1289
+ */
1290
+ declare function createConfig$7(): string;
1291
+ /**
1292
+ * `.husky/pre-push` — runs `holocron run ci` (the merge-gating checks, in CI order)
1293
+ * before every push. Installed by `holocron setup` when hooks are enabled
1294
+ * (default for `protection: "strict"`). `git push --no-verify` bypasses it.
1295
+ *
1296
+ * @param holocronScript - the command that invokes the CLI. Defaults to
1297
+ * `pnpm exec holocron`; the source repo passes `node cli/cli/dist/cli.mjs`.
725
1298
  */
726
- declare function createTsconfig(options: TsconfigOptions): string;
727
- //#endregion
728
- export { type Astromech, type AstromechOptions, CI_ORDER, type CiJobReport, type CiOptions, type CiReport, type ExecFn, type JobDef, KNOWN_TASKS, KNOWN_WORKFLOWS, LINTERS, LINTER_NAMES, type LinterDef, type LocalRunner, type OrgContext, type PreviewConfig, RESOLVABLE_TOOLS, REUSABLE_ACTIONS, REUSABLE_WORKFLOWS, type ResolverDeps, type RunLogger, type RunOptions, type RunTaskInput, type RunTaskReport, TASKS, type TaskDef, type TsconfigOptions, WORKFLOW_CHECK_CONTEXTS, WORKFLOW_TEMPLATES, WORKFLOW_TEMPLATE_PROPERTIES, type WorkspacePackage, codecovComponentBlock, codecovConfig, createAstromech, createCodecovConfig, createTsconfig, deriveDeployPaths, ensureIfNotFound, extractPreviewConfig, generateCombinedDeployContent, generateThinCallerContent, mergeCodecovComponents, normalizeWorkflowWith, readWorkspacePackages, requiredChecks, resolveLinters, resolveToolConfig, reusableTemplates, runCi, runTask };
1299
+ declare function createConfig$8(holocronScript?: string): string;
1300
+ /** The `.husky/prepare-commit-msg` hook, a shell script under the auto-generated header. */
1301
+ declare function createConfig$9(): string;
1302
+ /** The `.yamllint.yml` body, under the auto-generated header. */
1303
+ declare function createConfig$10(): string;
1304
+ /** The `.yamlignore` body. */
1305
+ declare function createIgnoreConfig$1(): string;
1306
+ export { type AggregateChecks, type Astromech, type AstromechOptions, type CiJobReport, type CiOptions, type CiReport, type CodecovConfigOptions, type CreateHeaderOptions, type DependabotConfigOptions, type DeployOnReleaseOptions, type DeployOnReleaseReport, type DeployOnReleaseResult, type WorkspacePackage as DeployWorkspacePackage, type DocsCoverageMode, type ExecFn, type GroupJobReport, type GroupOptions, type GroupReport, type HeaderFunctions, type LegacyTarget, type LocalRunner, type MergedScripts, type OrgContext, type PackageRole, type PackageScriptProblem, type PlannedKind, type PlannedTask, type PreviewConfig, type RepoShape, type RunLogger, type RunOptions, type RunTaskInput, type RunTaskReport, type TaskDef, type TaskGroup, type TaskScope, type TsconfigOptions, type WorkflowHeaderFormat, type WorkspacePackage$1 as WorkspacePackage, createIgnoreConfig as createAlexignore, createRcConfig as createAlexrc, createConfig as createCommitMsg, createConfig$1 as createDco, createConfig$2 as createDependabot, createConfig$3 as createDevmoji, createConfig$4 as createEditorconfig, createConfig$5 as createEditorconfigChecker, createConfig$6 as createLabeler, createConfig$7 as createPreCommit, createConfig$8 as createPrePush, createConfig$9 as createPrepareCommitMsg, createIgnoreConfig$1 as createYamlignore, createConfig$10 as createYamllint };