@theholocron/cli 5.0.0-alpha.27 → 5.0.0-alpha.271

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