@theholocron/cli 5.0.0-alpha.404 → 5.0.0-alpha.406

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