@theholocron/cli 5.0.0-alpha.33 → 5.0.0-alpha.331

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.
@@ -0,0 +1,833 @@
1
+ import { g as CapabilityKey, sn as TeamEntry, zt as PagesConfig } from "./index-KMWrNLpJ.mjs";
2
+ import { DocsCoverageMode } from "@theholocron/astromech";
3
+ import { LogLevel } from "@theholocron/observability/core";
4
+ /** Structured-logging config. The Axiom **token** never lives here — only in
5
+ * env vars or the OS keyring — but the non-secret dataset name may. */
6
+ interface LogConfig {
7
+ /**
8
+ * Default log level. The lowest-priority level source: `--verbose` /
9
+ * `--quiet` and `HOLOCRON_LOG_LEVEL` both outrank it.
10
+ */
11
+ level?: LogLevel;
12
+ /**
13
+ * Axiom log-shipping. Set `axiom.dataset` to opt local runs into Axiom
14
+ * without exporting `HOLOCRON_AXIOM_DATASET` — the CLI then pairs it with
15
+ * the token from `HOLOCRON_AXIOM_TOKEN` / `AXIOM_TOKEN` or the OS keyring
16
+ * (`holocron auth set axiom[.<org>] <TOKEN>`). Env vars still win. In CI,
17
+ * prefer the `HOLOCRON_AXIOM_DATASET` variable.
18
+ */
19
+ axiom?: {
20
+ /** Target Axiom dataset, e.g. `"holocron-local"`. */
21
+ dataset?: string;
22
+ };
23
+ }
24
+ /**
25
+ * CLI self-telemetry config — the committed, reviewable override layer over the
26
+ * env-var + shipped-fallback activation (ADR-0007 / ADR-0008). No secret lives
27
+ * here; the Sentry DSN and PostHog key come from env vars or ship as fallbacks.
28
+ *
29
+ * Precedence: `HOLOCRON_TELEMETRY=false` (env) → `telemetry.enabled` (this) →
30
+ * default on. `enabled` never *re-enables* what the env var turned off.
31
+ */
32
+ interface TelemetryConfig {
33
+ /**
34
+ * Repo-level opt-out — the committed peer of `HOLOCRON_TELEMETRY=false`.
35
+ * `false` installs the no-op sinks for the whole run. Default on.
36
+ */
37
+ enabled?: boolean;
38
+ /**
39
+ * Usage-analytics provider. `"none"` disables PostHog usage analytics while
40
+ * leaving error reporting (Sentry) untouched. Default `"posthog"`.
41
+ */
42
+ analytics?: "posthog" | "none";
43
+ }
44
+ /** Options a provider plugin receives; their shape is the plugin's own. */
45
+ type ProviderOptions = Record<string, unknown>;
46
+ /**
47
+ * The shape a capability config package's default export must satisfy.
48
+ * Config packages let teams share a pre-bundled provider + options across
49
+ * repos (Level 1 of the shareable-configs story, issue #75).
50
+ *
51
+ * @example
52
+ * // @acme/holocron-vault/index.ts
53
+ * import type { CapabilityConfigPackage } from '@theholocron/cli'
54
+ * export default {
55
+ * provider: '1password',
56
+ * options: { vault: 'acme-app' },
57
+ * } satisfies CapabilityConfigPackage
58
+ */
59
+ interface CapabilityConfigPackage {
60
+ /** The provider's short name or package. */
61
+ provider: string;
62
+ /** Options passed to the provider. */
63
+ options?: ProviderOptions;
64
+ }
65
+ /** A single provider: a name, or a `[provider, options]` tuple. */
66
+ type SingleEntry = string | [provider: string, options: ProviderOptions];
67
+ /** Several providers: a list of names or `[provider, options]` tuples. */
68
+ type MultiEntry = Array<string | [provider: string, options: ProviderOptions]>;
69
+ /** A capability's provider entry as written in the config. */
70
+ type RawProviderEntry = SingleEntry | MultiEntry;
71
+ /** The `providers` block as written in the config. */
72
+ type RawProvidersConfig = Partial<Record<CapabilityKey, RawProviderEntry>>;
73
+ /** A branch-protection preset: `balanced`, `strict` or `none`. */
74
+ type RepoProtection = "balanced" | "strict" | "none";
75
+ /**
76
+ * Raw `docs` config as written by the user. `build` is optional so the
77
+ * field can be declared without committing to a build type yet; setup
78
+ * will error if `docs` is present but `build` is absent.
79
+ */
80
+ interface DocsConfig {
81
+ /**
82
+ * GitHub Pages build source.
83
+ * "workflow" → GitHub Actions (PUT { build_type: "workflow" })
84
+ * "branch" → classic gh-pages branch (PUT { build_type: "legacy", source: { branch: "gh-pages", path: "/" } })
85
+ * When absent, Pages is not managed by `holocron repo setup`.
86
+ */
87
+ build?: "workflow" | "branch";
88
+ /**
89
+ * Custom domain / CNAME (e.g. "docs.theholocron.dev").
90
+ * When set and `homepage` is not explicitly provided, setup derives
91
+ * `homepage` as `https://{domain}/` for package.json and the repo website field.
92
+ */
93
+ domain?: string;
94
+ /** Enforce HTTPS. Only effective once the custom domain is DNS-verified. */
95
+ https?: boolean;
96
+ }
97
+ /** GitHub custom properties synced to the org dashboard. */
98
+ interface RepoProperties {
99
+ /** The repo's lifecycle stage. */
100
+ lifecycle?: "active" | "experimental" | "deprecated";
101
+ /** Whether the repo is open source. */
102
+ open_source?: boolean;
103
+ /** Where the code runs. */
104
+ runtime_environment?: "node" | "browser" | "universal" | "none";
105
+ /** Whether the repo depends on external packages. */
106
+ uses_external_packages?: boolean;
107
+ }
108
+ /**
109
+ * GitHub Actions variables, declared so a workflow that reads `vars.NAME` finds it. Values are plain text, so
110
+ * never put a secret here; secrets go through the `secrets` capability.
111
+ */
112
+ interface RepoVariables {
113
+ /** Repository-level variables. */
114
+ repo?: Record<string, string>;
115
+ /**
116
+ * Organization-level variables. A bare string is visible to every repository; `visibility: "private"` limits it
117
+ * to private ones. Declare these in one repo only (the one that owns the org's configuration).
118
+ */
119
+ org?: Record<string, string | {
120
+ value: string;
121
+ visibility?: "all" | "private";
122
+ }>;
123
+ /** Delete variables that exist but are not declared here. Off by default: they are left alone. */
124
+ prune?: boolean;
125
+ }
126
+ /**
127
+ * The names of the secrets that must exist for this repository's workflows to work, so `holocron doctor secrets`
128
+ * can say which are missing. Only names go here, never values; `holocron secrets set` and `secrets sync` write
129
+ * them. The secrets the config already implies (the notification layout's webhooks and roles, a Chromatic project
130
+ * token) are expected without being listed again. A secret that exists but is not listed is never a problem.
131
+ */
132
+ interface RepoSecrets {
133
+ /** Repository secrets. */
134
+ repo?: string[];
135
+ /** Organization secrets. Declare these in one repo only (the one that owns the org's configuration). */
136
+ org?: string[];
137
+ /** Environment secrets, by environment name. */
138
+ environments?: Record<string, string[]>;
139
+ /**
140
+ * The vault environments `holocron secrets sync` fills secrets from. `holocron doctor secrets` expects the
141
+ * keys each one holds (or lists) at its scope. Names only; the doctor never reads or prints a value.
142
+ */
143
+ sync?: RepoSecretsSync[];
144
+ }
145
+ /** One vault environment that `holocron secrets sync` pushes into GitHub secrets, declared so the doctor can check them. */
146
+ interface RepoSecretsSync {
147
+ /** The vault environment id, as given to `holocron secrets sync <environmentId>`. */
148
+ environment: string;
149
+ /**
150
+ * The vault keys pushed to GitHub (the `--github-secret` allowlist). Omit it for every key the vault
151
+ * environment holds, which the doctor then asks the `vault` provider to list.
152
+ */
153
+ keys?: string[];
154
+ /** Where the secrets land, as `--github-secret-scope` words it: `"repo"` (the default), `"env=<name>"` or `"org=<name>"`. */
155
+ scope?: string;
156
+ }
157
+ /** Per-repo switches for the repo-validation checks (spec `tech-api-docs`, #1368). */
158
+ interface RepoValidationConfig {
159
+ /**
160
+ * How strictly this repo enforces doc-comment coverage of its public API (`holocron probe docs patch` and
161
+ * the `documentation` Codecov flag). `"off"` (the default) does nothing; `"warn"`
162
+ * reports without failing and posts informational Codecov statuses; `"required"` fails the check and posts statuses
163
+ * that are not informational. It never adds a status to the branch-protection required checks: that stays in
164
+ * `extraRequiredChecks`.
165
+ */
166
+ docsCoverage?: DocsCoverageMode;
167
+ }
168
+ /** The `repo` block: how the GitHub repository is set up and kept in sync by `holocron repo setup`. */
169
+ interface RepoConfig {
170
+ /** "owner/name" — the GitHub repository coordinate. Derived from the git remote when absent. */
171
+ name?: string;
172
+ /**
173
+ * GitHub's repo-level default branch (`HEAD`) — what a fresh clone checks
174
+ * out, what `gh pr create`/the compare UI target by default, and what
175
+ * Sentinel's `validateConfig()` reads (D6: the App only ever reads config
176
+ * from the repo's default branch, never a PR ref, as a security boundary
177
+ * — never widen that to read PR branches instead of fixing this field).
178
+ * Synced by `holocron repo setup`. Omit to leave GitHub's current setting
179
+ * untouched — most repos never need this. Exists for a repo using a
180
+ * `main`/`alpha` prerelease-channel split (CLAUDE.md's Releases section)
181
+ * where active development happens on a non-`main` branch: set this to
182
+ * that branch so Sentinel validates against what's actually being
183
+ * developed, then change it back once that branch merges to `main` for a
184
+ * stable cut and stops being the active branch.
185
+ */
186
+ defaultBranch?: string;
187
+ /**
188
+ * Branch protection preset applied by `holocron repo setup`. When omitted,
189
+ * no protection is applied and no `branch_protection_level` property is set.
190
+ * Required-status-check contexts for `"strict"` are derived from the task
191
+ * manifest — `{ required: true }` tasks + top-level `extraRequiredChecks`
192
+ * (see `astromech.requiredChecks()`).
193
+ */
194
+ protection?: RepoProtection;
195
+ /**
196
+ * GitHub teams granted repository access. Synced by `holocron repo setup`, which
197
+ * also writes `.github/CODEOWNERS` for teams with write-or-higher permission.
198
+ * String shorthand defaults to `push` (Write).
199
+ */
200
+ teams?: TeamEntry[];
201
+ /** GitHub topics set on the repository. */
202
+ topics?: string[];
203
+ /** GitHub custom properties synced to the org dashboard. */
204
+ properties?: RepoProperties;
205
+ /** GitHub Actions variables reconciled by `holocron repo setup`. */
206
+ variables?: RepoVariables;
207
+ /** The secrets that must exist, checked by `holocron doctor secrets`. Names only; nothing writes them. */
208
+ secrets?: RepoSecrets;
209
+ }
210
+ /** An application in the repo. */
211
+ interface AppConfig {
212
+ /** The application's name. */
213
+ name: string;
214
+ /** The application's directory. */
215
+ path: string;
216
+ /** What kind of application it is. */
217
+ kind?: string;
218
+ }
219
+ /** The `doctor` block. */
220
+ interface DoctorConfig {
221
+ /** Names of the checks `doctor` runs. */
222
+ checks?: string[];
223
+ /**
224
+ * The mail provider that serves the apex of `domain`. `holocron doctor dns` then expects that provider's MX and SPF
225
+ * records in the zone, so a change that would break mail is caught. Nothing writes them; they are set up by hand.
226
+ */
227
+ mail?: "icloud";
228
+ }
229
+ /** The `credentials` block: which environment the `credentials` providers read this machine's tokens from. */
230
+ interface CredentialsConfig {
231
+ /**
232
+ * The name of the environment the `credentials` providers read (a 1Password Environment, for 1Password), for
233
+ * every provider that does not give its own with an `environment` option
234
+ * (`credentials: ["1password", { environment: "Holocron" }]`). It is a name, not a secret, so it is committed. A provider that matches names exactly may be tried with other
235
+ * letter cases of it; see the provider's page.
236
+ */
237
+ environment: string;
238
+ }
239
+ /** The `dev` block: how `holocron dev` runs this directory's application locally behind a development tunnel. */
240
+ interface DevConfig {
241
+ /**
242
+ * The vault environment whose variables the application runs with, e.g. `"Sentinel - dev"`. A name, not a
243
+ * secret, so it is committed.
244
+ */
245
+ environment?: string;
246
+ /** The named tunnel to the application: its name, and the public hostname it serves (not a secret). */
247
+ tunnel?: {
248
+ /** The tunnel's name. A second run finds the first one's tunnel by it. */
249
+ name: string;
250
+ /** The public hostname, e.g. `sentinel-dev.theholocron.dev`. One level under a zone the DNS provider manages. */
251
+ hostname: string;
252
+ };
253
+ /** The port the application listens on, and the tunnel sends requests to. Defaults to 3000. */
254
+ port?: number;
255
+ /** The application's command and arguments, e.g. `["pnpm", "run", "serve"]`. */
256
+ command?: string[];
257
+ /**
258
+ * A web-standard handler for `holocron dev` to serve itself, in place of `command`: the application is then
259
+ * `holocron dev serve`, which loads the handler and serves it on `PORT`. `command` and a command after `--` win.
260
+ */
261
+ serve?: DevServeConfig;
262
+ }
263
+ /** The `dev.serve` block: the handler `holocron dev` serves, and the variables it needs. */
264
+ interface DevServeConfig {
265
+ /** The module that exports the handler, relative to the directory, e.g. `./src/handler/index.ts`. TypeScript is loaded as is. */
266
+ handler: string;
267
+ /** The name of the handler's export. Defaults to `default`. */
268
+ export?: string;
269
+ /** The variables the handler cannot run without. Missing ones are named; nothing starts. */
270
+ required?: string[];
271
+ /** The variables holding the Axiom ingest token and dataset, to say where this run's logs go. */
272
+ logging?: {
273
+ /** The variable holding the Axiom ingest token. Only its presence is reported, never its value. */
274
+ tokenVar: string;
275
+ /** The variable holding the Axiom dataset the app's logs go to. */
276
+ datasetVar: string;
277
+ };
278
+ }
279
+ /** The `env` block: how the project's environment variables are named and documented. */
280
+ interface EnvConfig {
281
+ /**
282
+ * Namespace prefixes used by this project's env vars.
283
+ * Listed from least- to most-specific (cascade model — last wins).
284
+ * Tooling reads this to generate `.env.example`, validate required
285
+ * vars, and produce documentation.
286
+ *
287
+ * @example
288
+ * // Project-only prefix
289
+ * namespaces: ["CLI_TEMPLATE"]
290
+ *
291
+ * // Org-wide defaults + project-specific overrides
292
+ * namespaces: ["HOLOCRON", "MY_CLI"]
293
+ */
294
+ namespaces?: string[];
295
+ }
296
+ /**
297
+ * A single Chromatic project entry in a `verification.visualRegression`
298
+ * task's `chromatic-projects` config.
299
+ * Each entry produces one matrix job in CI, publishing to a separate Chromatic project.
300
+ *
301
+ * The `tokenName` maps to a repository secret named `CHROMATIC_PROJECT_TOKEN_<TOKENNAME>`.
302
+ * Additional fields correspond to chromaui/action inputs and are passed through directly.
303
+ *
304
+ * @see https://www.chromatic.com/docs/monorepos/
305
+ */
306
+ interface ChromaticProjectConfig {
307
+ /**
308
+ * Secret suffix. The CI job reads `CHROMATIC_PROJECT_TOKEN_<tokenName>`.
309
+ * Must be uppercase (e.g. `"WEB"`, `"UI"`).
310
+ */
311
+ tokenName: string;
312
+ /**
313
+ * Path to run the Chromatic build from, relative to the repo root.
314
+ * Typically the package directory (e.g. `"apps/web"`, `"packages/ui"`).
315
+ */
316
+ workingDir: string;
317
+ /**
318
+ * Script name to build Storybook. Defaults to `"build:storybook"`.
319
+ * Must accept `--output-dir` pass-through (use `turbo run … --` at root).
320
+ */
321
+ buildScript?: string;
322
+ /**
323
+ * Path to the Storybook folder relative to `workingDir`, for TurboSnap.
324
+ * Tells Chromatic where to find `.storybook/` when the Storybook config
325
+ * is in a subdirectory. Corresponds to `--storybook-base-dir`.
326
+ */
327
+ storybookBaseDir?: string;
328
+ /**
329
+ * Glob patterns of files/dirs that should NOT trigger a TurboSnap bailout
330
+ * when changed. Useful for ignoring non-UI changes in a monorepo
331
+ * (e.g. `"./packages/!(ui)/**"` to focus TurboSnap on the UI package).
332
+ * Corresponds to `--untraced`. Accepts a single glob string or array.
333
+ */
334
+ untraced?: string | string[];
335
+ /**
336
+ * Glob patterns matching story files to snapshot. When set, only matching
337
+ * stories are captured. Corresponds to `--only-story-files`.
338
+ * Cannot be combined with `onlyStoryNames`.
339
+ */
340
+ onlyStoryFiles?: string;
341
+ /**
342
+ * Exit with code 0 even when visual changes are detected.
343
+ * Useful during initial setup before baselines are approved.
344
+ * Corresponds to `--exit-zero-on-changes`.
345
+ */
346
+ exitZeroOnChanges?: boolean;
347
+ }
348
+ /**
349
+ * A single Storybook app in a deploy workflow config.
350
+ * `name` becomes the sandbox sub-path (`_site/sandbox/<name>/`).
351
+ * `path` is the working directory relative to the repo root; defaults to `"."` (repo root) when omitted.
352
+ */
353
+ interface StorybookDeployProject {
354
+ /** The sub-path under `_site/sandbox/` the Storybook app is published to. */
355
+ name?: string;
356
+ /** The app's working directory relative to the repo root; defaults to `"."`. */
357
+ path?: string;
358
+ }
359
+ /**
360
+ * Typed `with:` inputs for reusable workflows.
361
+ *
362
+ * `chromatic-projects` (on the `verification.visualRegression` task) takes a
363
+ * `ChromaticProjectConfig[]` directly; each entry's `untraced` glob list may
364
+ * be authored as an array and is newline-joined for you.
365
+ *
366
+ * `docs` / `storybook` are high-level deploy shorthand that `holocron repo setup`
367
+ * translates to `type` / `storybook-projects` before writing the thin caller.
368
+ * They also drive automatic `paths:` derivation so you never need to write
369
+ * `paths:` manually for deploy entries.
370
+ */
371
+ type WorkflowWithConfig = Record<string, unknown> & {
372
+ "chromatic-projects"?: ChromaticProjectConfig[];
373
+ /**
374
+ * Docs deployment shorthand. `true` uses the org-standard `docs/` directory;
375
+ * `{ path: "custom" }` uses a custom directory. Both derive a `paths:` entry automatically.
376
+ */
377
+ docs?: true | {
378
+ path: string;
379
+ };
380
+ /** Storybook apps to deploy alongside docs. Each entry's `path` is appended to `paths:`. */
381
+ storybook?: StorybookDeployProject[];
382
+ };
383
+ /**
384
+ * A `tasks` manifest entry in object form. A bare string entry is shorthand
385
+ * for `{ name, ci: true, local: true }`.
386
+ */
387
+ interface TaskEntryConfig {
388
+ /** The task's name. */
389
+ name: string;
390
+ /** Inputs passed to the task's reusable workflow. */
391
+ with?: WorkflowWithConfig;
392
+ /** Path filters for the generated workflow's triggers. */
393
+ paths?: string[];
394
+ /** Linters this task runs. */
395
+ linters?: string[];
396
+ /** Emit a `.github/workflows/<name>.yml` thin caller + include in `holocron run ci`. Default `true`. */
397
+ ci?: boolean;
398
+ /** Write a `package.json` script + let `holocron run <name>` resolve the task. Default `true`. */
399
+ local?: boolean;
400
+ /** The task's CI check context is a required status check + part of `holocron run ci`'s default run. */
401
+ required?: boolean;
402
+ /**
403
+ * Per-repo additions to this task's generated `turbo.json` entry —
404
+ * a separate channel from `with:` (that's the reusable *workflow's*
405
+ * inputs; this is local turbo cache config, unrelated). No-op for a
406
+ * task with no turbo fan-out config in the registry. Mirrors
407
+ * astromech's own `TaskEntry["turbo"]` — kept in sync by hand, since
408
+ * this package doesn't depend on astromech directly.
409
+ */
410
+ turbo?: {
411
+ /** Extra env vars turbo hashes into this task's cache key, appended to the registry default. */
412
+ passThroughEnv?: string[];
413
+ /**
414
+ * Extra input globs appended to the registry default's `inputs`
415
+ * (holocron#845) — for a package whose layout the registry
416
+ * default doesn't cover (e.g. a flat-layout package with no
417
+ * `src/` directory at all).
418
+ */
419
+ inputs?: string[];
420
+ /** Extra tasks this one waits for, appended to the registry default's `dependsOn` (turbo syntax: `"<package>#<task>"`). */
421
+ dependsOn?: string[];
422
+ };
423
+ }
424
+ /** A `holocron.config` as a user writes it; `defineConfig` types it. */
425
+ interface HolocronConfig {
426
+ /** Project name. Derived from package.json when absent. */
427
+ name?: string;
428
+ /** A one-line description of the project. */
429
+ description?: string;
430
+ /** Project homepage URL. Synced to package.json#homepage and the GitHub repo's website field by `holocron repo sync`. */
431
+ homepage?: string;
432
+ /**
433
+ * Active org name for namespaced keyring lookup. When set, token resolution
434
+ * tries `<service>.<org>` before the unnamespaced `<service>` fallback, so
435
+ * a single machine can hold credentials for multiple GitHub orgs without
436
+ * collision. Overridden by `--org` CLI flag or `HOLOCRON_ORG` env var.
437
+ */
438
+ org?: string;
439
+ /**
440
+ * Org canonical domain (e.g. `"theholocron.dev"`). Subdomains are derived
441
+ * from this — `preview: true` on a deploy workflow resolves the preview base
442
+ * domain as `preview.<domain>`, giving URLs like `<repo>-pr-<n>.<domain>`.
443
+ */
444
+ domain?: string;
445
+ /**
446
+ * Repository identity and metadata. When set, `PluginLoader` injects
447
+ * `repo.name` into every plugin's `RuntimeContext.repo` so plugins that
448
+ * need a repo (github, etc.) don't require `--repo` on every invocation.
449
+ * `--repo` on the command line still overrides.
450
+ */
451
+ repo?: RepoConfig;
452
+ /** Per-repo switches for the repo-validation checks. */
453
+ repoValidation?: RepoValidationConfig;
454
+ /**
455
+ * The task manifest — what this repo runs. Each entry is a task name
456
+ * (backed by a reusable workflow in `theholocron/.github`), or the object
457
+ * form to pass `with:` inputs. `@theholocron/astromech` reads this as the
458
+ * single source for `holocron run` / `holocron run ci` / the generated CI
459
+ * workflows / `package.json` scripts.
460
+ *
461
+ * Supported values (intent-facing vocabulary — epic #672, D3):
462
+ * "verification.unitTests" | "verification.visualRegression" | "verification.typeSafety" | "verification.performance" |
463
+ * "sourceQuality.staticAnalysis" | "sourceQuality.formatting" |
464
+ * "sourceQuality.structuredDataValidation" | "sourceQuality.deadCodeAnalysis" |
465
+ * "security.secretDetection" | "security.codeScanning" | "security.tokenExpiry" |
466
+ * "delivery.build" | "delivery.publish" | "delivery.deploy" | "delivery.bundleSize" |
467
+ * "platform.repoSync" | "platform.notifyCheck" | "platform.commitStandards" | "platform.repoValidation" |
468
+ * "knowledge.wiki" | "knowledge.docs" | "knowledge.components" |
469
+ * "review" | "tag" | "stale" | "greetings" | "dependencies" | "bookkeeping"
470
+ *
471
+ * `holocron repo setup` writes `.github/workflows/<name>.yml` for each entry,
472
+ * calling the corresponding reusable workflow in `theholocron/.github`.
473
+ * Files are overwritten on each run — they are generated artifacts.
474
+ *
475
+ * ### delivery.deploy / knowledge.docs / knowledge.components
476
+ * `delivery.deploy` uses `docs` and/or `storybook` in `with:` — setup
477
+ * derives `paths:` automatically. `docs: true` uses the org-standard
478
+ * `docs/` directory; `docs: { path: "custom" }` overrides it.
479
+ * `knowledge.docs` / `knowledge.components` are the same underlying
480
+ * mechanism, each dedicated to exactly one type — they imply the
481
+ * corresponding shorthand, so a repo using them never has to spell out
482
+ * `docs: true` / `storybook: […]` itself.
483
+ *
484
+ * ```ts
485
+ * // Docs only (standard layout)
486
+ * { name: "delivery.deploy", with: { docs: true } }
487
+ * // …or equivalently, the dedicated task:
488
+ * "knowledge.docs"
489
+ *
490
+ * // Docs + monorepo storybooks
491
+ * {
492
+ * name: "delivery.deploy",
493
+ * with: {
494
+ * docs: true,
495
+ * storybook: [
496
+ * { name: "web", path: "apps/web" },
497
+ * { name: "ui", path: "packages/ui" },
498
+ * ],
499
+ * },
500
+ * }
501
+ *
502
+ * // Non-standard docs location
503
+ * { name: "delivery.deploy", with: { docs: { path: "packages/site" } } }
504
+ * ```
505
+ *
506
+ * ### verification.visualRegression
507
+ * Its own task, not a `verification.unitTests` sub-job (holocron#394/#1062)
508
+ * — GitHub evaluates a job's `if:` before expanding its `strategy.matrix`,
509
+ * so no `chromatic-projects` default can make a *disabled* Chromatic job
510
+ * disappear from PR checks; only not generating the job at all does. Omit
511
+ * this task entirely for a repo that doesn't use Chromatic — no workflow,
512
+ * no job, no check, not even a skipped one.
513
+ *
514
+ * For a single-project repo, use a `CHROMATIC_PROJECT_TOKEN` repository
515
+ * secret with `tokenName: "default"`:
516
+ * ```ts
517
+ * {
518
+ * name: "verification.visualRegression",
519
+ * with: { "chromatic-projects": [{ tokenName: "default", workingDir: "." }] },
520
+ * }
521
+ * ```
522
+ *
523
+ * For monorepos with multiple Storybooks, list one entry per project:
524
+ * ```ts
525
+ * {
526
+ * name: "verification.visualRegression",
527
+ * with: {
528
+ * "chromatic-projects": [
529
+ * { tokenName: "WEB", workingDir: "apps/web" },
530
+ * { tokenName: "UI", workingDir: "packages/ui" },
531
+ * ],
532
+ * },
533
+ * }
534
+ * ```
535
+ * Each `tokenName` maps to a repository secret named
536
+ * `CHROMATIC_PROJECT_TOKEN_<TOKENNAME>`.
537
+ *
538
+ * @example
539
+ * ["sourceQuality.staticAnalysis", { "name": "delivery.publish", "with": { "run-build": false } }]
540
+ * { "name": "delivery.deploy", "with": { "docs": true } }
541
+ */
542
+ tasks?: Array<string | TaskEntryConfig>;
543
+ /**
544
+ * Opt out of `holocron repo sync`'s `package.json` script writes. Default `true`.
545
+ */
546
+ syncScripts?: boolean;
547
+ /**
548
+ * The command the synced `"holocron"` `package.json` script runs. Default
549
+ * `"holocron"` (the installed bin). This repo overrides it to run its own
550
+ * build (`"node cli/cli/dist/cli.mjs"`).
551
+ */
552
+ holocronScript?: string;
553
+ /**
554
+ * Required status-check contexts not backed by a `required` task (codecov
555
+ * gates, the bundle-build check, …). `holocron repo setup` appends these to the
556
+ * task-derived list from `astromech.requiredChecks()`.
557
+ */
558
+ extraRequiredChecks?: string[];
559
+ /**
560
+ * Git hooks `holocron repo setup` installs. `true` / `{ prePush: true }` writes
561
+ * `.husky/pre-push` (runs `holocron run ci` before every push); `false` /
562
+ * `{ prePush: false }` opts out. Omitted → on for `protection: "strict"`,
563
+ * off otherwise. `--hooks` / `--no-hooks` on `holocron repo setup` override.
564
+ */
565
+ hooks?: boolean | {
566
+ prePush?: boolean;
567
+ };
568
+ /** Which provider backs each capability. */
569
+ providers: RawProvidersConfig;
570
+ /** Applications in the repo. */
571
+ apps?: AppConfig[];
572
+ /** Settings for `holocron doctor`. */
573
+ doctor?: DoctorConfig;
574
+ /**
575
+ * Agent runtime that determines where skills are installed by `holocron repo setup`.
576
+ * Skills are installed to `.agents/skills/<name>/` (canonical) with a
577
+ * relative symlink at the agent-specific path:
578
+ * - `"claude"` → `.claude/skills/<name>` → `../../.agents/skills/<name>`
579
+ * - `"codex"` | `"gemini"` → logged as unsupported; skipped gracefully.
580
+ */
581
+ agent?: "claude" | "codex" | "gemini";
582
+ /**
583
+ * Skill names from `@theholocron/skills` to install during `holocron repo setup`.
584
+ * Installed paths are gitignored and managed by setup — do not commit them.
585
+ *
586
+ * @example
587
+ * ["git-safety", "pr-workflow", "commit-standards"]
588
+ */
589
+ skills?: string[];
590
+ /**
591
+ * GitHub Pages configuration. When present, `holocron repo setup` calls the
592
+ * Pages API using `HOLOCRON_DEPLOY_TOKEN` (requires `pages:write` + `repo` scope).
593
+ * When absent, Pages is left as-is.
594
+ *
595
+ * @example
596
+ * { build: "workflow", domain: "docs.theholocron.dev", https: true }
597
+ */
598
+ docs?: DocsConfig;
599
+ /**
600
+ * Environment variable namespace configuration.
601
+ * Declares the prefix(es) this project uses for its env vars so that
602
+ * tooling can generate `.env.example`, validate required vars, and
603
+ * produce accurate documentation without hard-coding prefix strings.
604
+ *
605
+ * @example
606
+ * { namespaces: ["HOLOCRON", "MY_CLI"] }
607
+ */
608
+ env?: EnvConfig;
609
+ /**
610
+ * Which environment the `credentials` providers (`providers.credentials`) read this machine's tokens from.
611
+ * The default for every provider; one provider can name its own with an `environment` option in its
612
+ * `providers.credentials` entry, which wins. The plugin never stores the name: the CLI passes it to `read`.
613
+ * Each provider needs one or the other when `providers.credentials` is set.
614
+ *
615
+ * @example
616
+ * { environment: "Holocron" }
617
+ */
618
+ credentials?: CredentialsConfig;
619
+ /**
620
+ * How `holocron dev` runs this directory's application locally behind a development tunnel: the vault
621
+ * environment its variables come from, the tunnel's name and hostname, the port and the command. Every field is
622
+ * optional here and can be given as a flag instead (a flag wins); `holocron dev` says which one is missing.
623
+ *
624
+ * @example
625
+ * { environment: "Sentinel - dev", tunnel: { name: "sentinel-dev", hostname: "sentinel-dev.theholocron.dev" } }
626
+ */
627
+ dev?: DevConfig;
628
+ /**
629
+ * Structured-logging config. Only the level belongs here — Axiom
630
+ * credentials come from env vars, never a committed file.
631
+ *
632
+ * @example
633
+ * { level: "debug" }
634
+ */
635
+ log?: LogConfig;
636
+ /**
637
+ * CLI self-telemetry override layer. Env var (`HOLOCRON_TELEMETRY=false`)
638
+ * still wins; this is the committed way to opt a repo out or drop usage
639
+ * analytics while keeping error reporting.
640
+ *
641
+ * @example
642
+ * { enabled: false }
643
+ * { analytics: "none" }
644
+ */
645
+ telemetry?: TelemetryConfig;
646
+ /**
647
+ * ESLint bundle option overrides that Sentinel's centralized static-
648
+ * analysis check (holocron#849) can't otherwise see. Bucket 1 checks
649
+ * never read a PR's own committed files for config — this is the
650
+ * declared source of truth Sentinel reads instead, so its check stays
651
+ * in sync with what each package's own `eslint.config.ts` already
652
+ * enforces locally and in CI.
653
+ */
654
+ eslint?: EslintConfig;
655
+ }
656
+ /**
657
+ * Repo-root-relative directories treated as browser-targeted for eslint's
658
+ * node-builtins compatibility checks — mirrors
659
+ * `@theholocron/eslint-config`'s `library({ browserPackages })` option.
660
+ * Only needed for a package whose own `eslint.config.ts` already declares
661
+ * `browserPackages` (a deliberate outlier, not the norm — see that
662
+ * package's own config file for why).
663
+ *
664
+ * @example
665
+ * { browserPackages: ["packages/github-client/src/app-auth"] }
666
+ */
667
+ interface EslintConfig {
668
+ /** Repo-root-relative directories treated as browser-targeted. */
669
+ browserPackages?: string[];
670
+ }
671
+ /** A provider with its plugin package resolved. */
672
+ interface ResolvedTuple {
673
+ /** The provider's short name, e.g. `github`. */
674
+ provider: string;
675
+ /** Resolved package name (`@theholocron/holocron-plugin-<provider>` for short refs). */
676
+ packageName: string;
677
+ /** Options passed to the plugin. */
678
+ options: ProviderOptions;
679
+ }
680
+ /** A capability's resolved entry: one provider, or a list of providers. */
681
+ type ResolvedProviderEntry = {
682
+ cardinality: "single";
683
+ tuple: ResolvedTuple;
684
+ } | {
685
+ cardinality: "many";
686
+ tuples: ResolvedTuple[];
687
+ };
688
+ /** Resolved entries by capability. */
689
+ type ResolvedProvidersConfig = Partial<Record<CapabilityKey, ResolvedProviderEntry>>;
690
+ /** A `holocron.config` after `resolveConfig`: defaults applied and provider entries resolved. */
691
+ interface ResolvedHolocronConfig {
692
+ /** Project name. */
693
+ name: string;
694
+ /** A one-line description of the project. */
695
+ description?: string;
696
+ /** Project homepage URL. */
697
+ homepage?: string;
698
+ /** Org name. */
699
+ org?: string;
700
+ /** Org canonical domain. */
701
+ domain?: string;
702
+ /** Repository settings. */
703
+ repo?: RepoConfig;
704
+ /** Which repo-wide checks this repo turns on (`docsCoverage`), validated by `resolveConfig`. */
705
+ repoValidation?: RepoValidationConfig;
706
+ /** The task manifest. */
707
+ tasks?: Array<string | TaskEntryConfig>;
708
+ /** Whether to sync the generated `package.json` scripts. */
709
+ syncScripts?: boolean;
710
+ /** The script used to invoke the `holocron` binary. */
711
+ holocronScript?: string;
712
+ /** Required status checks not backed by a task. */
713
+ extraRequiredChecks?: string[];
714
+ /** Git hooks `holocron repo setup` installs. */
715
+ hooks?: boolean | {
716
+ prePush?: boolean;
717
+ };
718
+ /** Resolved provider entries by capability. */
719
+ providers: ResolvedProvidersConfig;
720
+ /** Applications in the repo; empty when none are declared. */
721
+ apps: AppConfig[];
722
+ /** Settings for `holocron doctor`; empty when none are declared. */
723
+ doctor: DoctorConfig;
724
+ /** The agent runtime skills are installed for. */
725
+ agent?: "claude" | "codex" | "gemini";
726
+ /** Names of the agent skills to install. */
727
+ skills?: string[];
728
+ /** Resolved Pages config. `build` is guaranteed present when this field exists. */
729
+ docs?: PagesConfig;
730
+ /** Environment-variable settings. */
731
+ env?: EnvConfig;
732
+ /** The environment the `credentials` providers read, validated by `resolveConfig`. */
733
+ credentials?: CredentialsConfig;
734
+ /** How `holocron dev` runs the application, validated by `resolveConfig`. */
735
+ dev?: DevConfig;
736
+ /** Logging settings. */
737
+ log?: LogConfig;
738
+ /** Telemetry settings. */
739
+ telemetry?: TelemetryConfig;
740
+ /** ESLint settings. */
741
+ eslint?: EslintConfig;
742
+ }
743
+ /** Thrown when a `holocron.config` is invalid. */
744
+ declare class ConfigError extends Error {
745
+ /** The error's name, `"ConfigError"`. */
746
+ name: string;
747
+ }
748
+ /**
749
+ * Resolve `"github"` → `"@theholocron/holocron-plugin-github"`.
750
+ * Fully-qualified names (scoped or not) are honored verbatim, which
751
+ * is how third-party plugins published outside the org work.
752
+ */
753
+ declare function resolvePluginPackage(provider: string): string;
754
+ /** Resolves one capability's raw provider entry into single or multiple resolved tuples, checking it against the capability's cardinality. */
755
+ declare function resolveEntry(key: CapabilityKey, raw: RawProviderEntry): ResolvedProviderEntry;
756
+ /**
757
+ * The environment a `credentials` provider reads: its own `environment` option when it has one, else the shared
758
+ * `credentials.environment`, else `undefined`. The option lets each of several providers name its own (a 1Password
759
+ * Environment and an AWS secret are not called the same thing) without the plugin storing the name.
760
+ */
761
+ declare function credentialsEnvironment(tuple: ResolvedTuple, config: {
762
+ credentials?: CredentialsConfig;
763
+ }): string | undefined;
764
+ /** Validates a raw `holocron.config` and resolves its provider entries; throws `ConfigError` when `name` or `providers` is missing or an entry is malformed. */
765
+ declare function resolveConfig(raw: HolocronConfig): ResolvedHolocronConfig;
766
+ /** One entry of the `tasks` manifest: a task name or the object form. */
767
+ type TaskEntry = NonNullable<HolocronConfig["tasks"]>[number];
768
+ /** A single composable capability fragment. */
769
+ interface Capability {
770
+ /** Unique identifier — used for deduplication and dependency resolution. */
771
+ id: string;
772
+ /** Other capability IDs that must be present in the same compose() call. */
773
+ requires?: string[];
774
+ /** Task entries contributed by this capability. Merged by name; last writer wins. */
775
+ tasks?: TaskEntry[];
776
+ /** Provider config. Shallow-merged at the top level; later capabilities override per-key. */
777
+ providers?: RawProvidersConfig;
778
+ /**
779
+ * Required status-check contexts **not** backed by a `required` task
780
+ * (codecov gates, `Storybook Publish`, …). Unioned across all capabilities
781
+ * onto the top-level `extraRequiredChecks`. Task-backed checks come from
782
+ * `{ required: true }` task entries via `astromech.requiredChecks()`.
783
+ */
784
+ extraRequiredChecks?: string[];
785
+ /** Repo config fragment. Scalar fields: last writer wins. properties/topics/teams: merged. */
786
+ repo?: Partial<Omit<RepoConfig, "name">>;
787
+ /** Org name. Last writer wins. */
788
+ org?: string;
789
+ /** Org canonical domain. Last writer wins. */
790
+ domain?: string;
791
+ /** Docs site config. Last writer wins. */
792
+ docs?: DocsConfig;
793
+ }
794
+ /** The merged result of a compose() call. Spreads into defineConfig(). */
795
+ interface ComposedPreset {
796
+ /** Task entries merged from every capability, by name. */
797
+ tasks: TaskEntry[];
798
+ /** Provider config merged from every capability. */
799
+ providers: RawProvidersConfig;
800
+ /** Repo config merged from every capability. */
801
+ repo: Partial<Omit<RepoConfig, "name">>;
802
+ /** Non-task required-check contexts, unioned across capabilities. */
803
+ extraRequiredChecks: string[];
804
+ /** Org name; the last capability that sets it wins. */
805
+ org?: string;
806
+ /** Org canonical domain; the last capability that sets it wins. */
807
+ domain?: string;
808
+ /** Docs site config; the last capability that sets it wins. */
809
+ docs?: DocsConfig;
810
+ }
811
+ /**
812
+ * Merge any number of capability fragments into a single preset object that
813
+ * spreads directly into `defineConfig()`.
814
+ *
815
+ * - Accepts individual capabilities or nested arrays (for bundle presets).
816
+ * - Deduplicates by `id` — when the same ID appears more than once, the last
817
+ * occurrence wins. This lets callers override bundle defaults by listing an
818
+ * explicit capability after the bundle.
819
+ * - Validates all `requires` at call time and throws `ConfigError` if any are
820
+ * unmet, listing every missing dependency in a single message.
821
+ *
822
+ * @example
823
+ * // docs-only site — no typecheck
824
+ * const preset = compose(node(), docs());
825
+ *
826
+ * // library with docs
827
+ * const preset = compose(node(), typecheck(), docs());
828
+ *
829
+ * // nextjs() is a bundle that returns Capability[]
830
+ * const preset = compose(node(), nextjs());
831
+ */
832
+ declare function compose(...args: (Capability | Capability[])[]): ComposedPreset;
833
+ export { RepoSecretsSync as A, TelemetryConfig as B, ProviderOptions as C, RepoProperties as D, RepoConfig as E, ResolvedProvidersConfig as F, ResolvedTuple as I, SingleEntry as L, RepoVariables as M, ResolvedHolocronConfig as N, RepoProtection as O, ResolvedProviderEntry as P, StorybookDeployProject as R, MultiEntry as S, RawProvidersConfig as T, WorkflowWithConfig as V, DoctorConfig as _, ConfigError as a, HolocronConfig as b, resolveEntry as c, CapabilityConfigPackage as d, ChromaticProjectConfig as f, DocsConfig as g, DevServeConfig as h, TaskEntry as i, RepoValidationConfig as j, RepoSecrets as k, resolvePluginPackage as l, DevConfig as m, Capability as n, credentialsEnvironment as o, CredentialsConfig as p, ComposedPreset as r, resolveConfig as s, compose as t, AppConfig as u, EnvConfig as v, RawProviderEntry as w, LogConfig as x, EslintConfig as y, TaskEntryConfig as z };