@theholocron/cli 5.0.0-alpha.98 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -1,805 +1,963 @@
1
- import { Analytics, Auth, AuthDescription, AuthEvent, AuthEventType, AuthIdentity, AuthUser, CARDINALITY, CapabilityImpls, CapabilityKey, Cardinality, CardinalityFor, Ci, CiRun, CiRunFilter, CiRunStatus, ConnectionStringOptions, CreateAuthUserInput, DeployFunctionConfig, DeployFunctionResult, DeployScriptConfig, DeployScriptResult, Deployment, DeploymentProject, DeploymentProjectSettings, DeploymentRecord, DeploymentTarget, DeploymentTrigger, Dns, DnsRecord, DnsRecordRequest, DnsRecordType, EnsureResult, Environment, EnvironmentReviewer, Environments, Errors, Issue, IssueSearchFilter, Issues, LabelDef, LifecycleResult, LifecycleSlot, Logs, NormalizedAuthUser, Notifications, PagesConfig, ParseWebhookInput, ProviderApiError, ProviderIdentity, PullRequest, REQUIRED_CAPABILITIES, RepoRef, RepoSettings, ResolvedCapability, Ruleset, SecretScope, Secrets, Source, StatusCategory, Storage, StorageBranch, TeamEntry, TeamPermission, Tooling, ToolingDoctorReport, TrackerDoctorReport, TrackerUser, Vault, WebhookDashboardInfo, WebhookVerificationError, Wiki, WikiProvisionOpts, WikiProxyConfig, Workers, isMulti } from "./plugin/capabilities.mjs";
2
- import { AuthError, RequestOptions, ResolveTokenConfig as ResolveTokenConfig$1, ResolveTokenInput, RestClient, RestClientConfig, createRestClient } from "@theholocron/http-client";
3
- import { ConfigFileError } from "@theholocron/datapad";
4
- import { WorkspacePackage } from "@theholocron/astromech";
5
- import { LogLevel } from "@theholocron/observability/core";
6
- import { QualifiedConfig } from "@commitlint/types";
7
- //#region src/auth/auth-resolver.d.ts
8
- type ResolveTokenConfig = Omit<ResolveTokenConfig$1, "getKeyringToken">;
9
- /** Wraps `createResolveToken` from `@theholocron/http` and injects the
10
- * system keyring so plugins stay at a one-liner call site. */
11
- declare function createResolveToken(config: ResolveTokenConfig): (input?: ResolveTokenInput) => string;
1
+ import { $ as CoverageUploadGroup, $a as ResolvedHolocronConfig, $i as HolocronProfile, $n as NotificationsApplicationLayout, $r as SourceRepoInfo, $t as IssueClearable, A as Cache, Aa as HolocronConfig, Ai as Wiki, An as MonitoringDashboardInput, Ar as PullRequestLink, At as EnsureWebhookResult, B as ConnectionStringOptions, Ba as RepoConfig, Bi as WorkerScriptState, Bn as MonitoringIncidentResolveInput, Br as ResolvedCapability, Bt as ErrorsOrgState, C as BoardState, Ca as DevConfig, Ci as ToolingWorkspaceState, Cn as MonitoringAlertChannelState, Cr as Projects, Ct as EnsureDiscussionInput, D as BoardTemplate, Da as EnvConfig, Di as Tunnels, Dn as MonitoringAssertionSource, Dr as PullRequestChecksState, Dt as EnsureRelaySourceResult, E as BoardSummary, Ea as DoctorConfig, Ei as TunnelRoute, En as MonitoringAssertionComparison, Er as PullRequestChecks, Et as EnsureRelaySourceInput, F as CardinalityFor, Fa as OrgConfig, Fi as WikiProbe, Fn as MonitoringHttpMethod, Fr as RelaySourceMethods, Ft as EnvironmentEntry, G as CoverageConfigInput, Ga as RepoProtection, Gi as KNOWN_STACK_DEPS, Gn as MonitoringStatusComponentInput, Gr as Secrets, Gt as IdeaRecord, H as Coverage, Ha as RepoEnvironmentReviewer, Hi as PullRequestState, Hn as MonitoringIncidentUpdate, Hr as SecretAccess, Ht as ExportInfo, I as Ci, Ia as OrgIssueType, Ii as WikiProvisionOpts, In as MonitoringIncident, Ir as RelaySourceState, It as EnvironmentReviewer, J as CoverageRepoReport, Ja as RepoSecretsSync, Ji as deriveProfile, Jn as MonitoringStatusPageState, Jr as SourceBranch, Jt as ImportResult, K as CoverageExpectations, Ka as RepoSecrets, Ki as deriveCapabilities, Kn as MonitoringStatusPageInput, Kr as ServerInspection, Kt as Ideas, L as CiRun, La as ProviderOptions, Li as WikiProxyConfig, Ln as MonitoringIncidentImpact, Lr as RelayState, Lt as Environments, M as CapabilityImpls, Ma as LogConfig, Mi as WikiInstanceState, Mn as MonitoringHeartbeatInput, Mr as PullRequestResult, Mt as EnsuredResource, N as CapabilityKey, Na as MultiEntry, Ni as WikiNavigationState, Nn as MonitoringHeartbeatResult, Nr as Registry, Nt as EnsuredTunnel, O as BoardTemplateFile, Oa as EslintConfig, Oi as Vault, On as MonitoringCheck, Or as PullRequestFields, Ot as EnsureReport, P as Cardinality, Pa as NotificationsConfig, Pi as WikiOrganizationState, Pn as MonitoringHeartbeatUnit, Pr as RelaySourceCapability, Pt as Environment, Q as CoverageUploadFlagResult, Qa as RepoView, Qi as DeriveProfileInput, Qn as NotificationsAccess, Qr as SourceFile, Qt as Issue, R as CiRunFilter, Ra as RawProviderEntry, Ri as WikiPublishedState, Rn as MonitoringIncidentInput, Rr as RepoRef, Rt as Errors, S as BoardRule, Sa as CredentialsConfig, Si as ToolingWorkspaceSide, Sn as MonitoringAlertChannelResult, Sr as ParseWebhookInput, St as EmojiCheck, T as BoardStatusCategory, Ta as DocsConfig, Ti as TrackerUser, Tn as MonitoringAssertion, Tr as PullRequest, Tt as EnsureRelayResult, U as CoverageConfigComponent, Ua as RepoLabels, Ui as PullRequestTag, Un as MonitoringIncidentUpdateInput, Ur as SecretScope, Ut as HideLinkPreviewsInput, V as CoreIssueKind, Va as RepoEnvironment, Vi as Workers, Vn as MonitoringIncidentStatus, Vr as Ruleset, Vt as ErrorsProjectState, W as CoverageConfigDocumentation, Wa as RepoProperties, Wi as RenderedPullRequest, Wn as MonitoringIncidentWrite, Wr as SecretVisibility, Wt as HideLinkPreviewsResult, X as CoverageStatusInput, Xa as RepoVariables, Xi as missingCapabilities, Xn as NormalizedAuthUser, Xr as SourceCheckRunWrite, Xt as InspectRelayInput, Y as CoverageStatusContext, Ya as RepoValidationConfig, Yi as deriveStack, Yn as MoveReport, Yr as SourceCheckRun, Yt as InspectErrorsInput, Z as CoverageTokenCheck, Za as RepoVariablesSync, Zi as readWorkspacePackageJsons, Zn as Notifications, Zr as SourceCommitStatus, Zt as InspectRelaySourceInput, _ as BoardFieldType, _a as AppConfig, _i as ToolingOpenPlan, _n as LifecycleSlot, _r as NotificationsSignIn, _t as Dns, a as REQUIRED_CAPABILITIES, aa as loadConfig, ai as Storage, an as IssueOrder, ao as TaskEntryConfig, ar as NotificationsLinksLayout, at as DeployFunctionConfig, b as BoardPullRequest, ba as CommandLogMode, bi as ToolingWorkspaceInput, bn as Monitoring, br as OrganizationSecretScope, bt as DnsRecordType, c as AddedItem, ca as ComposedPreset, ci as TeamEntry, cn as IssueRecord, co as EnvironmentLayer, cr as NotificationsOnboardingLayout, ct as DeployScriptResult, d as AuthDescription, da as credentialsEnvironment, di as ToolingDoctorReport, dn as IssueTypeDeclaration, dr as NotificationsPostedMessage, dt as DeploymentProjectSettings, ea as PackageJsonLike, ei as SourceRequiredChecks, en as IssueComment, eo as ResolvedProviderEntry, er as NotificationsChannelLayout, et as CoverageUploadInput, f as AuthEvent, fa as resolveConfig, fi as ToolingExportInput, fn as IssueTypeInfo, fr as NotificationsPrsFeed, ft as DeploymentRecord, g as BoardField, ga as AgentOptions, gi as ToolingOpenLaunch, gn as LifecycleResult, gr as NotificationsServerLayout, gt as DiscussionPost, h as AuthUser, ha as AgentName, hi as ToolingOpenInput, hn as LabelDef, hr as NotificationsSendOptions, ht as DiscussionPatch, i as ProviderApiError, ia as defineConfig, ii as StatusCategory, in as IssueKind, io as StorybookDeployProject, ir as NotificationsLayout, it as CredentialsInspection, j as CacheTokenCheck, ja as IdeasConfig, ji as WikiInspection, jn as MonitoringDashboardState, jr as PullRequestPatch, jt as EnsuredDiscussion, k as BoardView, ka as GitHubAppConfig, ki as WebhookDashboardInfo, kn as MonitoringCheckInput, kr as PullRequestInput, kt as EnsureResult, l as Analytics, la as TaskEntry, li as TeamPermission, ln as IssueSearchFilter, lr as NotificationsPicture, lt as Deployment, m as AuthIdentity, ma as resolvePluginPackage, mi as ToolingExportResult, mn as Issues, mr as NotificationsRelaySource, mt as DeploymentTrigger, n as ElevationRequiredError, na as ConfigFileError, ni as SourceSecurity, nn as IssueEffort, no as ResolvedTuple, nr as NotificationsEveryoneLayout, nt as CreateAuthUserInput, o as WebhookVerificationError, oa as LoadedConfig, oi as StorageBranch, on as IssuePatch, oo as TelemetryConfig, or as NotificationsMember, ot as DeployFunctionResult, p as AuthEventType, pa as resolveEntry, pi as ToolingExportIssue, pn as IssueUpdateResult, pr as NotificationsReaction, pt as DeploymentTarget, q as CoverageNameDiff, qa as RepoSecretsDeploy, qi as deriveCompliance, qn as MonitoringStatusPageResult, qr as Source, qt as ImportOptions, r as MissingTokenError, ra as compose, ri as SourceTeamMember, rn as IssueFields, ro as SingleEntry, rr as NotificationsForumTag, rt as Credentials, s as isMulti, sa as Capability, si as SyncResult, sn as IssuePriority, so as WorkflowWithConfig, sr as NotificationsMonitoringFeed, st as DeployScriptConfig, t as CARDINALITY, ta as StackName, ti as SourceRulesetDetail, tn as IssueCreateInput, to as ResolvedProvidersConfig, tr as NotificationsDelivery, tt as CoverageUploadResult, u as Auth, ua as ConfigError, ui as Tooling, un as IssueSelector, ur as NotificationsPinnedLayout, ut as DeploymentProject, v as BoardItem, va as CapabilityConfigPackage, vi as ToolingOpenWant, vn as Logs, vr as NotificationsSignedIn, vt as DnsRecord, w as BoardStatus, wa as DevServeConfig, wi as TrackerDoctorReport, wn as MonitoringAlertSettings, wr as ProviderIdentity, wt as EnsureRelayInput, x as BoardPullRequestChecks, xa as CommandThreadsMode, xi as ToolingWorkspaceResult, xn as MonitoringAlertChannelInput, xr as PagesConfig, xt as DuplicateDiscussion, y as BoardItemInput, ya as ChromaticProjectConfig, yi as ToolingWorkspaceFile, yn as LogsDataset, yr as NotificationsWelcomeLayout, yt as DnsRecordRequest, z as CiRunStatus, za as RawProvidersConfig, zi as WorkerDeploymentState, zn as MonitoringIncidentQuery, zr as RepoSettings, zt as ErrorsInspection } from "./index-CZon0UNI.mjs";
2
+ import { AuthError, ResolveTokenConfig as ResolveTokenConfig$1, ResolveTokenInput, ResolveTokenInput as ResolveTokenInput$1, resolveValue } from "@theholocron/kyber/secrets";
3
+ import { AGGREGATE_CHECK_NAME, AGGREGATE_SHADOW_CHECK_NAME, DocsCoverageMode, RequiredChecksFailure, RequiredChecksInput, RequiredChecksState, RequiredChecksVerdict, requiredChecksVerdict } from "@theholocron/astromech";
4
+ import { CheckRow } from "@theholocron/kyber/ui";
5
+ import "@theholocron/env-utils/lookup";
6
+ import "@theholocron/observability/core";
7
+ import { RequestOptions, RestClient, RestClientConfig, createRestClient } from "@theholocron/http-client";
8
+ import "@theholocron/kyber/plugins";
9
+ import { GitExec } from "@theholocron/git-utils";
10
+ import { ConnectionProbeInput as ConnectionProbeInput$1 } from "@theholocron/kyber/checks";
11
+ import { Stats } from "node:fs";
12
+ import { TasksConfig } from "@theholocron/astromech/config";
13
+ import { ConfigDirArea } from "@theholocron/datapad";
14
+ /** A plugin's `verifyToken` result when the provider accepted the token. */
15
+ interface VerifyTokenSuccess {
16
+ /** Always `true` for an accepted token. */
17
+ ok: true;
18
+ /** "workplace: acme" / "user: cnewton@x" — surfaced in success output. */
19
+ subject: string;
20
+ /** When the token stops working, ISO 8601 in UTC, for a provider that reports it. Absent when unknown or never. */
21
+ expiresAt?: string;
22
+ }
23
+ /** A plugin's `verifyToken` result when the provider rejected the token. */
24
+ interface VerifyTokenFailure {
25
+ /** Always `false` for a rejected token. */
26
+ ok: false;
27
+ /** Reason the token was rejected. Surfaces to the operator. */
28
+ message: string;
29
+ }
30
+ /** What a plugin's `verifyToken` returns: the token was accepted, or it was rejected with a reason. */
31
+ type VerifyTokenResult = VerifyTokenSuccess | VerifyTokenFailure;
32
+ /** What a layer's token must do about a permission: `required` it must have it, `absent` it must not. */
33
+ type PermissionRule = "required" | "absent";
34
+ /**
35
+ * When a token is due for rotation (#2157). `maxAgeDays` is the longest a token may go unrotated; `warnDays` is how
36
+ * many days before an expiry the check starts to fail. Both default to `DEFAULT_TOKEN_ROTATION`.
37
+ */
38
+ interface TokenRotation {
39
+ /** The most days old a token may be, counted from when the provider says it was made (or became valid). */
40
+ maxAgeDays?: number;
41
+ /** Fail this many days before the token's own expiry, so it is rotated before it stops working. */
42
+ warnDays?: number;
43
+ }
44
+ /**
45
+ * What a token must carry, declared once next to the plugin's `tokens` list. The permission names are the plugin's own
46
+ * (Cloudflare: `pages`, `dns`); a layer's rules say which are `required` and which `absent`, so a laptop token might
47
+ * need everything while `ci` needs one permission and must have none of the rest.
48
+ */
49
+ interface TokenExpectation {
50
+ /**
51
+ * The layers that hold this token, for a token with no permission rules (a rotation-only check). Default: the layers
52
+ * `permissions` names. A layer in neither has no declared expectations.
53
+ */
54
+ layers?: readonly EnvironmentLayer[];
55
+ /** Per layer, each permission's rule. A layer named here holds the token. */
56
+ permissions?: Readonly<Partial<Record<EnvironmentLayer, Readonly<Record<string, PermissionRule>>>>>;
57
+ /** When the token is due for rotation, in every layer that holds it. Default: `DEFAULT_TOKEN_ROTATION`. */
58
+ rotation?: TokenRotation;
59
+ /**
60
+ * Layers whose Environment must not hold this token at all (#2825), e.g. the stage-only npm token, held in `agent`
61
+ * only. `doctor tokens` fails a row for each one that holds it; no probe is run against it. A layer cannot also be
62
+ * declared in `layers` or `permissions`: `forbiddenTokenLayers()` refuses that.
63
+ */
64
+ forbiddenLayers?: readonly EnvironmentLayer[];
65
+ }
66
+ /** One token a plugin takes, and where it is looked up. */
67
+ interface PluginToken {
68
+ /** The plugin's own environment variable, e.g. `HOLOCRON_ADMIN_TOKEN`. */
69
+ envName: string;
70
+ /** The vendor's own environment variable, e.g. `CLOUDFLARE_API_TOKEN`; read after `envName` and before the keyring. */
71
+ vendorEnvName?: string;
72
+ /** The OS keyring entry, e.g. `github.admin`. */
73
+ keyringKey: string;
74
+ /**
75
+ * `false` when the plugin's `verifyToken` does not apply to this token (it checks a different credential, such as
76
+ * a webhook URL), so `holocron doctor secrets --verify` reports it as set without calling the plugin. Default `true`.
77
+ */
78
+ verifiable?: boolean;
79
+ /**
80
+ * How to check this token when the plugin's one `verifyToken` is for a different credential (the Discord bot token,
81
+ * where `verifyToken` checks a webhook). Wins over the plugin's `verifyToken`.
82
+ */
83
+ verify?: (token: string) => Promise<VerifyTokenResult>;
84
+ /**
85
+ * `true` when the plugin only falls back to this token: nothing needs it unless a call names no better source (the
86
+ * Discord webhook a post uses when it names no channel). The checks that expect every token a plugin lists, such as
87
+ * `holocron doctor secrets`, do not expect it, and `holocron export tokens` marks it as optional when it has none.
88
+ * Default `false`.
89
+ */
90
+ optional?: boolean;
91
+ /**
92
+ * The vendor's own page that makes this token, so `holocron new instance` can tell a person where to make it
93
+ * (`tech-new-instance-command`). A public address, never a credential.
94
+ */
95
+ page?: string;
96
+ /**
97
+ * Which layers hold this token and what it must and must not be able to do in each (#2149). One declaration that the
98
+ * token probes, the doctor and the docs check read through `tokenExpectations()`; see `TokenExpectation`.
99
+ */
100
+ expect?: TokenExpectation;
101
+ }
102
+ /** Options for a token resolver, without the keyring lookup, which the CLI supplies itself. */
103
+ type ResolveTokenConfig = Omit<ResolveTokenConfig$1, "keyring" | "orgEnvName">;
104
+ /** Settings for a feature-specific token resolver: which env var and keyring entry it reads. */
12
105
  interface FeatureResolverConfig {
13
106
  /** Env var name for this feature, e.g. `"HOLOCRON_ISSUES_TOKEN"`. */
14
107
  envName: string;
15
108
  /** Keyring account key, e.g. `"github.issues"`. */
16
109
  keyringKey: string;
110
+ /** The vendor named in the "no token" message. Default `GitHub`. */
111
+ vendor?: string;
17
112
  }
113
+ /** A resolver from `createFeatureResolver`: call it for the token, or read `token` to see where it looks. */
114
+ type FeatureResolver = ((input?: ResolveTokenInput$1) => string) & {
115
+ /** The environment variable and keyring entry this resolver reads, for `holocron doctor secrets --verify`. */
116
+ readonly token: PluginToken;
117
+ };
118
+ /** A resolver from `createResolveToken`: call it for the token, or read `token` to see where it looks. */
119
+ type TokenResolver = ((input?: ResolveTokenInput$1) => string) & {
120
+ /** The environment variables and keyring entry this resolver reads, for `holocron doctor secrets --verify`. */
121
+ readonly token: PluginToken;
122
+ };
18
123
  /**
19
- * Build a strict, single-feature token resolver.
20
- *
21
- * Resolution chain: `--token flag → envName env var → keyring(keyringKey)`.
22
- * No broad-token fallback — if the feature-specific token is absent the
23
- * operation fails with a message naming the exact env var to set.
124
+ * The holocron keyring: `get` answers `null` for "not stored" and for "keyring unavailable" alike, so callers fall
125
+ * through to env-var precedence, and remembers the answer for the process (`clearCache` forgets it); `set` and `delete`
126
+ * answer whether they did anything; `list` names the stored providers; `isAvailable` tells an outage from an empty keyring.
24
127
  */
25
- declare function createFeatureResolver(config: FeatureResolverConfig): (input?: ResolveTokenInput) => string;
26
- //#endregion
27
- //#region src/auth/keyring.d.ts
128
+ export declare const keyring: import("@theholocron/kyber/secrets").Keyring;
28
129
  /**
29
- * Keyring-backed bootstrap credential store.
30
- *
31
- * Every holocron plugin's bootstrap token (the one it needs before it
32
- * can talk to its vendor's API) can be stored in the OS keyring under
33
- * a single reverse-DNS service scope. Managed via `holocron auth`
34
- * subcommands; consulted at position 4 in every plugin's auth
35
- * precedence chain (after --token / HOLOCRON_<X>_TOKEN / <native>_TOKEN).
36
- *
37
- * See `docs/wiki/specifications/tech-auth-bootstrap.spec.md` for the design rationale.
38
- *
39
- * Failure model: keyring access is best-effort. Platforms without a
40
- * supported credential store (some Linux CI images, sandboxed
41
- * environments) will throw from the underlying library. Every export
42
- * here catches and returns a null/empty result rather than propagating
43
- * — the plugin's precedence chain then falls through to
44
- * env-var-only paths, which is exactly how CI is meant to work.
130
+ * Kyber's `createResolveToken` with the keyring, the `HOLOCRON_ORG` variable and the `token` description
131
+ * `holocron doctor secrets --verify` reads filled in, so a plugin stays at a one-liner call site. The chain is the flag, the
132
+ * plugin's variable, the vendor's variable, the `credentials` providers' variables, the keyring.
45
133
  */
134
+ export declare function createResolveToken(config: ResolveTokenConfig): TokenResolver;
46
135
  /**
47
- * Store or overwrite a bootstrap token for a provider. Returns true on
48
- * success, false when the underlying keyring is unsupported or errored.
136
+ * Kyber's `createFeatureResolver` for a strict, single-feature token: the flag, the feature's variable, the
137
+ * `credentials` providers' variable of that name, the keyring. No broad-token fallback; if the feature's token is absent
138
+ * the operation fails with a message naming the exact variable to set and `holocron new token`.
49
139
  */
50
- declare function setToken(provider: string, token: string): boolean;
140
+ export declare function createFeatureResolver(config: FeatureResolverConfig): FeatureResolver;
51
141
  /**
52
- * Read the bootstrap token for a provider. Returns `null` for both
53
- * "not stored" and "keyring unavailable" — callers can treat them the
54
- * same way (fall through to env-var precedence).
142
+ * The repository and number a post's key names, the inverse of `prKey()`: `owner/repo#123` gives
143
+ * `{ repo: "owner/repo", number: 123 }`; any other text gives `undefined`.
55
144
  */
56
- declare function getToken(provider: string): string | null;
145
+ export declare function parsePrKey(key: string | undefined): {
146
+ repo: string;
147
+ number: number;
148
+ } | undefined;
149
+ /** The key a pull request's post is found by: `owner/repo#123`. */
150
+ export declare function prKey(repo: string, number: number): string;
151
+ /** The tag of a pull request: the first that applies of merged, closed, draft, conflicts, failing, changes requested, ready, in review. */
152
+ export declare function pullRequestTag(state: PullRequestState): PullRequestTag;
57
153
  /**
58
- * Delete a stored token. Returns true when a token was removed, false
59
- * when there was nothing to delete or the keyring is unavailable.
60
- * Distinguishing the two cases isn't worth the surface area — the
61
- * command output makes the situation clear either way.
154
+ * The post for a pull request: its title (`repo#123: title`, plain text, because a forum post's title is not
155
+ * markdown), the summary that is the first message (edited in place, no footer: a link to the pull request without
156
+ * repeating the title, the status lines and the author's description with Sourcery's parts removed) and its tag. A pure function of the current state; the caller fetches it, and the provider adds the sync footer.
62
157
  */
63
- declare function deleteToken(provider: string): boolean;
158
+ export declare function renderPullRequest(state: PullRequestState, now: Date): RenderedPullRequest;
64
159
  /**
65
- * List provider slugs with a stored token in this service scope.
66
- * Uses the library's `findCredentials(service)` — supported on all
67
- * platforms the underlying credential store supports.
160
+ * The flags and components `holocron sync` writes to `codecov.yml` for the workspace at `repoRoot`: the same
161
+ * functions the generator uses, so a coverage provider's `checkRepo()` compares with exactly what is written. A flag per
162
+ * package (none for `docs`), plus `documentation` when `docsCoverage` is `warn` or `required`; a component per package.
163
+ * Both lists are sorted. Plugins call this instead of importing the task runner.
68
164
  */
69
- declare function listStoredProviders(): string[];
70
- //#endregion
71
- //#region src/config/config.d.ts
72
- /** Structured-logging config. The Axiom **token** never lives here — only in
73
- * env vars or the OS keyring — but the non-secret dataset name may. */
74
- interface LogConfig {
75
- /**
76
- * Default log level. The lowest-priority level source: `--verbose` /
77
- * `--quiet` and `HOLOCRON_LOG_LEVEL` both outrank it.
78
- */
79
- level?: LogLevel;
80
- /**
81
- * Axiom log-shipping. Set `axiom.dataset` to opt local runs into Axiom
82
- * without exporting `HOLOCRON_AXIOM_DATASET` — the CLI then pairs it with
83
- * the token from `HOLOCRON_AXIOM_TOKEN` / `AXIOM_TOKEN` or the OS keyring
84
- * (`holocron auth set axiom[.<org>] <TOKEN>`). Env vars still win. In CI,
85
- * prefer the `HOLOCRON_AXIOM_DATASET` variable.
86
- */
87
- axiom?: {
88
- /** Target Axiom dataset, e.g. `"holocron-local"`. */
89
- dataset?: string;
90
- };
91
- }
165
+ export declare function coverageExpectations(repoRoot: string, docsCoverage?: DocsCoverageMode): CoverageExpectations;
92
166
  /**
93
- * CLI self-telemetry config — the committed, reviewable override layer over the
94
- * env-var + shipped-fallback activation (ADR-0007 / ADR-0008). No secret lives
95
- * here; the Sentry DSN and PostHog key come from env vars or ship as fallbacks.
96
- *
97
- * Precedence: `HOLOCRON_TELEMETRY=false` (env) → `telemetry.enabled` (this) →
98
- * default on. `enabled` never *re-enables* what the env var turned off.
167
+ * Puts issue keys in creation order without asking the tracker: issue numbers (`#12`, `ENG-12`) rise with creation inside
168
+ * one repository or team, so the trailing number is the order. `oldest` is ascending, `newest` descending; keys with the
169
+ * same number keep their place. A key with no trailing number is an error, because nothing can be said of its age.
99
170
  */
100
- interface TelemetryConfig {
101
- /**
102
- * Repo-level opt-out — the committed peer of `HOLOCRON_TELEMETRY=false`.
103
- * `false` installs the no-op sinks for the whole run. Default on.
104
- */
105
- enabled?: boolean;
106
- /**
107
- * Usage-analytics provider. `"none"` disables PostHog usage analytics while
108
- * leaving error reporting (Sentry) untouched. Default `"posthog"`.
109
- */
110
- analytics?: "posthog" | "none";
171
+ export declare function orderKeys(keys: readonly string[], order: IssueOrder): string[];
172
+ /**
173
+ * Keeps the first or last `limit` of a listing by creation time, returned oldest first. `createdAt` reads an item's
174
+ * ISO timestamp; items created in the same instant keep their listed order. The cut happens on what the listing already
175
+ * holds, so no request is spent on an item that is dropped.
176
+ */
177
+ export declare function pickByCreation<T>(items: readonly T[], createdAt: (item: T) => string, order: IssueOrder, limit: number): T[];
178
+ /** What {@link readKeysLimited} needs. */
179
+ interface ReadKeysLimitedInput<T> {
180
+ /** The issue keys to choose from. */
181
+ keys: readonly string[];
182
+ /** Which end of the creation order to take first. */
183
+ order: IssueOrder;
184
+ /** How many items to keep. */
185
+ limit: number;
186
+ /** The most issues fetched at once. */
187
+ concurrency: number;
188
+ /** Fetches one issue by key. */
189
+ fetch: (key: string) => Promise<T>;
190
+ /** Whether a fetched issue counts against the limit; false skips it without using the budget. */
191
+ keep: (item: T) => boolean;
111
192
  }
112
- type ProviderOptions = Record<string, unknown>;
113
193
  /**
114
- * The shape a capability config package's default export must satisfy.
115
- * Config packages let teams share a pre-bundled provider + options across
116
- * repos (Level 1 of the shareable-configs story, issue #75).
194
+ * Reads an explicit list of issues in creation order until `limit` of them are kept. The keys are sorted by number first
195
+ * (see {@link orderKeys}), then fetched in small steps of at most `concurrency`, each step no bigger than the places
196
+ * still open, so an issue that is later skipped (a pull request, a closed one) is replaced by the next key and nothing
197
+ * beyond the budget is fetched unless a skip made room. Within a step the fetches run together; the results keep the key
198
+ * order. The kept items come back oldest first, whichever end was chosen.
199
+ */
200
+ export declare function readKeysLimited<T>(input: ReadKeysLimitedInput<T>): Promise<T[]>;
201
+ /**
202
+ * Calls a provider's optional `onProgress` hook with how many items are done of how many. A hook that throws is
203
+ * ignored, because a progress counter must never change or stop the read or write it reports on.
117
204
  *
118
- * @example
119
- * // @acme/holocron-vault/index.ts
120
- * import type { CapabilityConfigPackage } from '@theholocron/cli'
121
- * export default {
122
- * provider: '1password',
123
- * options: { vault: 'acme-app' },
124
- * } satisfies CapabilityConfigPackage
125
- */
126
- interface CapabilityConfigPackage {
127
- provider: string;
128
- options?: ProviderOptions;
205
+ * @param onProgress - The hook from `ExportInfo` or `ImportOptions`; nothing happens when it is not given.
206
+ * @param done - How many items are finished.
207
+ * @param total - How many items there are.
208
+ */
209
+ export declare function reportProgress(onProgress: ((done: number, total: number) => void) | undefined, done: number, total: number): void;
210
+ /** What `holocron provider <name> token` asks a plugin to make. */
211
+ interface MintTokenInput {
212
+ /** The name the token is made with, as the vendor shows it (`holocron-cloudflare-ci-20261128`). */
213
+ name: string;
214
+ /** The layer that will hold the token: the plugin's declaration for it (`PluginToken.expect`) says what the token may do. */
215
+ layer: EnvironmentLayer;
216
+ /** Days until the token stops working, when the vendor can enforce one. Default: the declared rotation's `maxAgeDays`. */
217
+ expiresInDays?: number;
218
+ /** The clock, for tests. Defaults to now. */
219
+ now?: () => Date;
220
+ }
221
+ /** A token a plugin made. The value is the only copy: it goes to the private import file and is never printed. */
222
+ interface MintTokenResult {
223
+ /** The token's value. Handed over once, never printed, logged or put in a row. */
224
+ value: string;
225
+ /** The plugin's environment variable the value is stored under (`PluginToken.envName`). */
226
+ envName: string;
227
+ /** The vendor's id for the token (not the value), so it can be found and revoked in the vendor's UI. */
228
+ id?: string;
229
+ /** When the token stops working (ISO 8601), when the vendor enforces one. */
230
+ expiresAt?: string;
231
+ /** Lines for the person: what the token reaches, what the vendor could not scope. Never a value. */
232
+ notes: string[];
129
233
  }
130
- type SingleEntry = string | [provider: string, options: ProviderOptions];
131
- type MultiEntry = Array<string | [provider: string, options: ProviderOptions]>;
132
- type RawProviderEntry = SingleEntry | MultiEntry;
133
- type RawProvidersConfig = Partial<Record<CapabilityKey, RawProviderEntry>>;
134
- type RepoProtection = "balanced" | "strict" | "none";
135
234
  /**
136
- * Raw `docs` config as written by the user. `build` is optional so the
137
- * field can be declared without committing to a build type yet; setup
138
- * will error if `docs` is present but `build` is absent.
235
+ * A plugin's way to make a token through the vendor's own API (`holocron provider <name> token`), with a more
236
+ * powerful bootstrap token it already resolves. It fails closed: a layer with no declared permissions is refused, never
237
+ * answered with an unscoped token.
139
238
  */
140
- interface DocsConfig {
141
- /**
142
- * GitHub Pages build source.
143
- * "workflow" → GitHub Actions (PUT { build_type: "workflow" })
144
- * "branch" → classic gh-pages branch (PUT { build_type: "legacy", source: { branch: "gh-pages", path: "/" } })
145
- * When absent, Pages is not managed by `holocron setup`.
146
- */
147
- build?: "workflow" | "branch";
148
- /**
149
- * Custom domain / CNAME (e.g. "docs.theholocron.dev").
150
- * When set and `homepage` is not explicitly provided, setup derives
151
- * `homepage` as `https://{domain}/` for package.json and the repo website field.
152
- */
153
- domain?: string;
154
- /** Enforce HTTPS. Only effective once the custom domain is DNS-verified. */
155
- https?: boolean;
156
- }
157
- interface RepoProperties {
158
- lifecycle?: "active" | "experimental" | "deprecated";
159
- open_source?: boolean;
160
- runtime_environment?: "node" | "browser" | "universal" | "none";
161
- uses_external_packages?: boolean;
162
- }
163
- interface RepoConfig {
164
- /** "owner/name" — the GitHub repository coordinate. Derived from the git remote when absent. */
165
- name?: string;
239
+ type MintToken = (input: MintTokenInput) => Promise<MintTokenResult>;
240
+ /** One line a probe reports: `info` for a fact, `ok` / `fail` for a result, `heading` to title the rows that follow. */
241
+ interface ProbeRow {
242
+ /** `ok` or `fail` for a result, `info` for a fact, `heading` to title the rows that follow. */
243
+ status: "ok" | "fail" | "info" | "heading";
244
+ /** The row's short title. */
245
+ label: string;
246
+ /** Further detail, when there is some. */
247
+ detail?: string;
248
+ }
249
+ /** What a probe is handed. Everything it prints or changes goes through this, so the runner can enforce the rules. */
250
+ interface ProbeContext {
251
+ /** What the person typed after the probe name (`probe deps who vitest` hands `["vitest"]`). */
252
+ args?: readonly string[];
253
+ /**
254
+ * `--lcov <path>`: where a probe that measures coverage also writes an lcov report, on top of the rows it prints.
255
+ * Relative to the repo root. Unset when the flag was not given.
256
+ */
257
+ lcov?: string;
258
+ /** `--dry-run`: `write` calls are announced and skipped. */
259
+ dryRun: boolean;
260
+ /** Report one line. The text is scrubbed of secrets before it is printed. */
261
+ say(row: ProbeRow): void;
262
+ /**
263
+ * Change something on the provider. The only way to: on `--dry-run` it prints `would <label>` and does not call `fn`,
264
+ * and a probe that did not declare `writes: true` cannot call it.
265
+ */
266
+ write<T>(label: string, fn: () => Promise<T>): Promise<T | undefined>;
267
+ /** Register how to undo something this probe made. Runs in reverse order on success, failure and Ctrl-C. */
268
+ cleanup(label: string, fn: () => Promise<void>): void;
269
+ /** Mark a value (a token, a signing secret) as one that must never be printed. */
270
+ secret(value: string | undefined): void;
271
+ }
272
+ /** A named, on-demand poke at a live provider. */
273
+ interface Probe {
274
+ /** One sentence for `holocron probe`'s listing. */
275
+ summary: string;
276
+ /** Whether it creates or changes anything on the provider. Asked about first, and needs `--yes` without a terminal. */
277
+ writes: boolean;
166
278
  /**
167
- * GitHub's repo-level default branch (`HEAD`) — what a fresh clone checks
168
- * out, what `gh pr create`/the compare UI target by default, and what
169
- * Sentinel's `validateConfig()` reads (D6: the App only ever reads config
170
- * from the repo's default branch, never a PR ref, as a security boundary
171
- * — never widen that to read PR branches instead of fixing this field).
172
- * Synced by `holocron setup`. Omit to leave GitHub's current setting
173
- * untouched — most repos never need this. Exists for a repo using a
174
- * `main`/`alpha` prerelease-channel split (CLAUDE.md's Releases section)
175
- * where active development happens on a non-`main` branch: set this to
176
- * that branch so Sentinel validates against what's actually being
177
- * developed, then change it back once that branch merges to `main` for a
178
- * stable cut and stops being the active branch.
279
+ * Where the probe's rows go. Unset, stdout. A probe whose own output is the data on stdout (a `NAME=value` stream
280
+ * for a pipe) sets `stderr`, so the rows never mix with it.
179
281
  */
180
- defaultBranch?: string;
282
+ reportsTo?: "stderr";
181
283
  /**
182
- * Branch protection preset applied by `holocron setup`. When omitted,
183
- * no protection is applied and no `branch_protection_level` property is set.
184
- * Required-status-check contexts for `"strict"` are derived from the task
185
- * manifest — `{ required: true }` tasks + top-level `extraRequiredChecks`
186
- * (see `astromech.requiredChecks()`).
284
+ * Whether the probe is about a token, so `holocron probe` may point it at a different one: `--token <provider>=<value>`,
285
+ * `--environment <layer or name>` (the provider's token from that vault Environment), or, on a terminal with neither,
286
+ * a question that asks which. Unset, the probe uses the token the provider normally resolves.
187
287
  */
188
- protection?: RepoProtection;
288
+ acceptsToken?: boolean;
289
+ /** Runs the probe, reporting and changing things only through `ctx`. */
290
+ run(ctx: ProbeContext): Promise<void>;
291
+ }
292
+ /** A plugin's probes by name (kebab-case), as returned from `createPlugin` next to `capabilities`. */
293
+ type PluginProbes = Record<string, Probe>;
294
+ /**
295
+ * One step of a provider's `setup` or `doctor`, in the shape the shared renderer prints (`printCheckRows`): an id, a
296
+ * title, `ok` / `fail` / `skip`, one line of detail and, for a failure, a line per problem.
297
+ */
298
+ type ProviderRow = CheckRow;
299
+ /** What a provider's `setup` and `doctor` are handed. */
300
+ interface ProviderActionContext {
189
301
  /**
190
- * GitHub teams granted repository access. Synced by `holocron setup`, which
191
- * also writes `.github/CODEOWNERS` for teams with write-or-higher permission.
192
- * String shorthand defaults to `push` (Write).
302
+ * `--dry-run`: `setup` reports what it would change as `ok` rows and changes nothing. `doctor` never changes
303
+ * anything, so it ignores this.
193
304
  */
194
- teams?: TeamEntry[];
195
- /** GitHub topics set on the repository. */
196
- topics?: string[];
197
- /** GitHub custom properties synced to the org dashboard. */
198
- properties?: RepoProperties;
305
+ dryRun: boolean;
199
306
  }
200
- interface AppConfig {
201
- name: string;
202
- path: string;
203
- kind?: string;
307
+ /**
308
+ * Something only one provider has (a Linear team's automation, a Discord server's roles) and no provider-neutral
309
+ * command can express. It reports one row per step and does not stop at the first failure: a step that fails is a
310
+ * `fail` row and the next step still runs. It never prints a token.
311
+ */
312
+ type ProviderAction = (ctx: ProviderActionContext) => Promise<ProviderRow[]>;
313
+ /** A provider's `setup`, `doctor` and `whoami`, as `holocron provider <name> setup|doctor` finds them. */
314
+ interface ProviderActions {
315
+ /** Makes what the provider's own config block declares. Optional. */
316
+ setup?: ProviderAction;
317
+ /** Compares what the provider's own config block declares with what exists, read-only. Optional. */
318
+ doctor?: ProviderAction;
319
+ /** Who the provider's token is, when it stops working and what it may do, read-only. Optional. */
320
+ whoami?: ProviderAction;
204
321
  }
205
- interface DoctorConfig {
206
- checks?: string[];
322
+ /** What `holocron provider <name> revoke <id>` asks a plugin to revoke. */
323
+ interface RevokeTokenInput {
324
+ /** The vendor's id for the token (what minting and `whoami` print), never its value. Already checked to be a plain id. */
325
+ id: string;
207
326
  }
208
- interface EnvConfig {
209
- /**
210
- * Namespace prefixes used by this project's env vars.
211
- * Listed from least- to most-specific (cascade model — last wins).
212
- * Tooling reads this to generate `.env.example`, validate required
213
- * vars, and produce documentation.
214
- *
215
- * @example
216
- * // Project-only prefix
217
- * namespaces: ["CLI_TEMPLATE"]
218
- *
219
- * // Org-wide defaults + project-specific overrides
220
- * namespaces: ["HOLOCRON", "MY_CLI"]
221
- */
222
- namespaces?: string[];
327
+ /** What a plugin did about a revoke. */
328
+ interface RevokeTokenResult {
329
+ /** `true` when the vendor deleted the token, `false` when it was already gone (nothing to do, not a failure). */
330
+ revoked: boolean;
331
+ /** Lines for the person: what to do next, what the vendor kept. Never a token value. */
332
+ notes: string[];
223
333
  }
224
334
  /**
225
- * A single Chromatic project entry in a monorepo `run-chromatic` config.
226
- * Each entry produces one matrix job in CI, publishing to a separate Chromatic project.
227
- *
228
- * The `tokenName` maps to a repository secret named `CHROMATIC_PROJECT_TOKEN_<TOKENNAME>`.
229
- * Additional fields correspond to chromaui/action inputs and are passed through directly.
230
- *
231
- * @see https://www.chromatic.com/docs/monorepos/
335
+ * A plugin's way to delete a token through the vendor's own API (`holocron provider <name> revoke <id>`), with the
336
+ * token the plugin already resolves. It fails closed: it refuses (throws) an id that is the token the call itself is
337
+ * made with whenever the plugin can tell, because that would lock the run out, and it puts the id in the request path
338
+ * only after `encodeURIComponent`. A token the vendor no longer has is `revoked: false`, not an error.
232
339
  */
233
- interface ChromaticProjectConfig {
234
- /**
235
- * Secret suffix. The CI job reads `CHROMATIC_PROJECT_TOKEN_<tokenName>`.
236
- * Must be uppercase (e.g. `"WEB"`, `"UI"`).
237
- */
238
- tokenName: string;
239
- /**
240
- * Path to run the Chromatic build from, relative to the repo root.
241
- * Typically the package directory (e.g. `"apps/web"`, `"packages/ui"`).
242
- */
243
- workingDir: string;
244
- /**
245
- * Script name to build Storybook. Defaults to `"build:storybook"`.
246
- * Must accept `--output-dir` pass-through (use `turbo run … --` at root).
247
- */
248
- buildScript?: string;
249
- /**
250
- * Path to the Storybook folder relative to `workingDir`, for TurboSnap.
251
- * Tells Chromatic where to find `.storybook/` when the Storybook config
252
- * is in a subdirectory. Corresponds to `--storybook-base-dir`.
253
- */
254
- storybookBaseDir?: string;
255
- /**
256
- * Glob patterns of files/dirs that should NOT trigger a TurboSnap bailout
257
- * when changed. Useful for ignoring non-UI changes in a monorepo
258
- * (e.g. `"./packages/!(ui)/**"` to focus TurboSnap on the UI package).
259
- * Corresponds to `--untraced`. Accepts a single glob string or array.
260
- */
261
- untraced?: string | string[];
262
- /**
263
- * Glob patterns matching story files to snapshot. When set, only matching
264
- * stories are captured. Corresponds to `--only-story-files`.
265
- * Cannot be combined with `onlyStoryNames`.
266
- */
267
- onlyStoryFiles?: string;
268
- /**
269
- * Exit with code 0 even when visual changes are detected.
270
- * Useful during initial setup before baselines are approved.
271
- * Corresponds to `--exit-zero-on-changes`.
272
- */
273
- exitZeroOnChanges?: boolean;
340
+ type RevokeToken = (input: RevokeTokenInput) => Promise<RevokeTokenResult>;
341
+ /**
342
+ * A plugin's way to say which token it was built with: the vendor's id for the token this plugin instance resolved
343
+ * (what `holocron provider <name> revoke <id>` takes), or `undefined` when the vendor cannot say. It never returns or
344
+ * logs a value.
345
+ */
346
+ type ReadTokenId = () => Promise<string | undefined>;
347
+ /** What a connection probe needs to check a provider's host and token: kyber's input, with the plugin's `verifyToken` as `verify`. */
348
+ export interface ConnectionProbeInput extends Omit<ConnectionProbeInput$1, "verify"> {
349
+ /** The plugin's `verifyToken`: asks the provider who the token belongs to. */
350
+ verify: (token: string) => Promise<VerifyTokenResult>;
274
351
  }
275
352
  /**
276
- * A single Storybook app in a deploy workflow config.
277
- * `name` becomes the sandbox sub-path (`_site/sandbox/<name>/`).
278
- * `path` is the working directory relative to the repo root; defaults to `"."` (repo root) when omitted.
353
+ * The `connection` probe every provider offers, for telling a network problem from a credential problem. The checks are
354
+ * kyber's `connectionProbe`; this types the result as the plugin system's {@link Probe} and `verify` as `VerifyTokenResult`.
279
355
  */
280
- interface StorybookDeployProject {
281
- name?: string;
282
- path?: string;
356
+ export declare function connectionProbe(input: ConnectionProbeInput): Probe;
357
+ /**
358
+ * The first server emoji a layout gives two different pictures, or undefined. One name is one emoji, so it can be made
359
+ * from one file only; the same file written twice is fine.
360
+ */
361
+ export declare function emojiConflictProblem(layout: NotificationsLayout): string | undefined;
362
+ /** One server emoji a layout's reactions name. */
363
+ interface LayoutEmoji {
364
+ /** The emoji's name, without colons. */
365
+ name: string;
366
+ /** The file in the repo it is made from when the server has none, as the layout wrote it. */
367
+ image?: string;
283
368
  }
284
369
  /**
285
- * Typed `with:` inputs for reusable workflows.
286
- *
287
- * `run-chromatic` accepts either a plain boolean (single-project) or a
288
- * `ChromaticProjectConfig[]` object (multi-project monorepo).
289
- *
290
- * `docs` / `storybook` are high-level deploy shorthand that `holocron setup`
291
- * translates to `type` / `storybook-projects` before writing the thin caller.
292
- * They also drive automatic `paths:` derivation so you never need to write
293
- * `paths:` manually for deploy entries.
294
- */
295
- type WorkflowWithConfig = Record<string, unknown> & {
296
- "run-chromatic"?: boolean | {
297
- projects: ChromaticProjectConfig[];
298
- };
299
- /**
300
- * Docs deployment shorthand. `true` uses the org-standard `docs/` directory;
301
- * `{ path: "custom" }` uses a custom directory. Both derive a `paths:` entry automatically.
302
- */
303
- docs?: true | {
304
- path: string;
305
- };
306
- /** Storybook apps to deploy alongside docs. Each entry's `path` is appended to `paths:`. */
307
- storybook?: StorybookDeployProject[];
308
- };
370
+ * The server emoji a layout's forum reactions name (default and starter) and its `emojis` list, once each, in the order the layout first
371
+ * names them. A name that is given an `image` anywhere keeps it, so the picture can sit on any one of its uses.
372
+ */
373
+ export declare function layoutEmojis(layout: NotificationsLayout | undefined): LayoutEmoji[];
309
374
  /**
310
- * A `tasks` manifest entry in object form. A bare string entry is shorthand
311
- * for `{ name, ci: true, local: true }`.
375
+ * Every reaction a layout writes that can name a server emoji: each forum's default and starter reactions and its tags'
376
+ * `emoji` (a tag's is a string, Unicode or `:name:`), then the layout's own `emojis` (server emoji made with no reaction
377
+ * naming them), in that order.
312
378
  */
313
- interface TaskEntryConfig {
379
+ export declare function layoutReactions(layout: NotificationsLayout | undefined): NotificationsReaction[];
380
+ /** Discord's limit for an emoji file ("256 KiB", its Emoji resource docs). */
381
+ export declare const MAX_EMOJI_BYTES: number;
382
+ /**
383
+ * Reads the picture an emoji is made from, a file in the repo, and returns it as a `data:` URI. The type comes from the
384
+ * first bytes, not the name, and a file Discord would refuse (larger than 256 KiB, or not a JPEG, PNG, GIF, WebP or
385
+ * AVIF image) is refused here, before anything is written. `read` is injected by tests.
386
+ */
387
+ export declare function loadEmojiImage(source: string, baseDir?: string, read?: (path: string) => Promise<Uint8Array>): Promise<string>;
388
+ /** A Unicode emoji, kept as written. */
389
+ interface UnicodeReaction {
390
+ /** Tells it from a server emoji. */
391
+ kind: "unicode";
392
+ /** The emoji character, as written. */
393
+ value: string;
394
+ }
395
+ /** One of the server's own emoji, by name. */
396
+ interface CustomReaction {
397
+ /** Tells it from a Unicode emoji. */
398
+ kind: "custom";
399
+ /** The emoji's name, without colons. */
314
400
  name: string;
315
- with?: WorkflowWithConfig;
316
- paths?: string[];
317
- linters?: string[];
318
- /** Emit a `.github/workflows/<name>.yml` thin caller + include in `holocron ci`. Default `true`. */
319
- ci?: boolean;
320
- /** Write a `package.json` script + let `holocron run <name>` resolve the task. Default `true`. */
321
- local?: boolean;
322
- /** The task's CI check context is a required status check + part of `holocron ci`'s default run. */
323
- required?: boolean;
324
- }
325
- interface HolocronConfig {
326
- /** Project name. Derived from package.json when absent. */
327
- name?: string;
328
- description?: string;
329
- /** Project homepage URL. Synced to package.json#homepage and the GitHub repo's website field by `holocron sync`. */
330
- homepage?: string;
331
- /**
332
- * Active org name for namespaced keyring lookup. When set, token resolution
333
- * tries `<service>.<org>` before the unnamespaced `<service>` fallback, so
334
- * a single machine can hold credentials for multiple GitHub orgs without
335
- * collision. Overridden by `--org` CLI flag or `HOLOCRON_ORG` env var.
336
- */
337
- org?: string;
338
- /**
339
- * Org canonical domain (e.g. `"theholocron.dev"`). Subdomains are derived
340
- * from this — `preview: true` on a deploy workflow resolves the preview base
341
- * domain as `preview.<domain>`, giving URLs like `<repo>-pr-<n>.<domain>`.
342
- */
343
- domain?: string;
344
- /**
345
- * Repository identity and metadata. When set, `PluginLoader` injects
346
- * `repo.name` into every plugin's `RuntimeContext.repo` so plugins that
347
- * need a repo (github, etc.) don't require `--repo` on every invocation.
348
- * `--repo` on the command line still overrides.
349
- */
350
- repo?: RepoConfig;
351
- /**
352
- * The task manifest — what this repo runs. Each entry is a task name
353
- * (backed by a reusable workflow in `theholocron/.github`), or the object
354
- * form to pass `with:` inputs. `@theholocron/astromech` reads this as the
355
- * single source for `holocron run` / `holocron ci` / the generated CI
356
- * workflows / `package.json` scripts.
357
- *
358
- * Supported values (intent-facing vocabulary — epic #672, D3):
359
- * "verification.unitTests" | "verification.typeSafety" | "verification.performance" |
360
- * "sourceQuality.staticAnalysis" | "sourceQuality.formatting" |
361
- * "sourceQuality.structuredDataValidation" | "sourceQuality.deadCodeAnalysis" |
362
- * "security.secretDetection" | "security.codeScanning" |
363
- * "delivery.build" | "delivery.publish" | "delivery.deploy" | "delivery.bundleSize" |
364
- * "platform.repoSync" | "platform.commitStandards" | "platform.repoValidation" |
365
- * "knowledge.wiki" | "knowledge.docs" | "knowledge.components" |
366
- * "review" | "tag" | "stale" | "greetings" | "dependencies" | "bookkeeping"
367
- *
368
- * `holocron setup` writes `.github/workflows/<name>.yml` for each entry,
369
- * calling the corresponding reusable workflow in `theholocron/.github`.
370
- * Files are overwritten on each run — they are generated artifacts.
371
- *
372
- * ### delivery.deploy / knowledge.docs / knowledge.components
373
- * `delivery.deploy` uses `docs` and/or `storybook` in `with:` — setup
374
- * derives `paths:` automatically. `docs: true` uses the org-standard
375
- * `docs/` directory; `docs: { path: "custom" }` overrides it.
376
- * `knowledge.docs` / `knowledge.components` are the same underlying
377
- * mechanism, each dedicated to exactly one type — they imply the
378
- * corresponding shorthand, so a repo using them never has to spell out
379
- * `docs: true` / `storybook: […]` itself.
380
- *
381
- * ```ts
382
- * // Docs only (standard layout)
383
- * { name: "delivery.deploy", with: { docs: true } }
384
- * // …or equivalently, the dedicated task:
385
- * "knowledge.docs"
386
- *
387
- * // Docs + monorepo storybooks
388
- * {
389
- * name: "delivery.deploy",
390
- * with: {
391
- * docs: true,
392
- * storybook: [
393
- * { name: "web", path: "apps/web" },
394
- * { name: "ui", path: "packages/ui" },
395
- * ],
396
- * },
397
- * }
398
- *
399
- * // Non-standard docs location
400
- * { name: "delivery.deploy", with: { docs: { path: "packages/site" } } }
401
- * ```
402
- *
403
- * ### run-chromatic
404
- * For a single-project repo, use `"run-chromatic": true` with a
405
- * `CHROMATIC_PROJECT_TOKEN` repository secret.
406
- *
407
- * For monorepos with multiple Storybooks, use the object form:
408
- * ```ts
409
- * "run-chromatic": {
410
- * projects: [
411
- * { tokenName: "WEB", workingDir: "apps/web" },
412
- * { tokenName: "UI", workingDir: "packages/ui" },
413
- * ]
414
- * }
415
- * ```
416
- * Each `tokenName` maps to a repository secret named
417
- * `CHROMATIC_PROJECT_TOKEN_<TOKENNAME>`. `holocron setup` expands this
418
- * to the flat `run-chromatic: true` + `chromatic-projects: <json>` inputs
419
- * that the reusable workflow accepts.
420
- *
421
- * @example
422
- * ["sourceQuality.staticAnalysis", { "name": "delivery.publish", "with": { "run-build": false } }]
423
- * { "name": "delivery.deploy", "with": { "docs": true } }
424
- */
425
- tasks?: Array<string | TaskEntryConfig>;
426
- /**
427
- * Opt out of `holocron sync`'s `package.json` script writes. Default `true`.
428
- */
429
- syncScripts?: boolean;
430
- /**
431
- * The command the synced `"holocron"` `package.json` script runs. Default
432
- * `"holocron"` (the installed bin). This repo overrides it to run its own
433
- * build (`"node packages/cli/dist/cli.mjs"`).
434
- */
435
- holocronScript?: string;
436
- /**
437
- * Required status-check contexts not backed by a `required` task (codecov
438
- * gates, the bundle-build check, …). `holocron setup` appends these to the
439
- * task-derived list from `astromech.requiredChecks()`.
440
- */
441
- extraRequiredChecks?: string[];
442
- /**
443
- * Git hooks `holocron setup` installs. `true` / `{ prePush: true }` writes
444
- * `.husky/pre-push` (runs `holocron ci` before every push); `false` /
445
- * `{ prePush: false }` opts out. Omitted → on for `protection: "strict"`,
446
- * off otherwise. `--hooks` / `--no-hooks` on `holocron setup` override.
447
- */
448
- hooks?: boolean | {
449
- prePush?: boolean;
450
- };
451
- providers: RawProvidersConfig;
452
- apps?: AppConfig[];
453
- doctor?: DoctorConfig;
454
- /**
455
- * Agent runtime that determines where skills are installed by `holocron setup`.
456
- * Skills are installed to `.agents/skills/<name>/` (canonical) with a
457
- * relative symlink at the agent-specific path:
458
- * - `"claude"` → `.claude/skills/<name>` → `../../.agents/skills/<name>`
459
- * - `"codex"` | `"gemini"` → logged as unsupported; skipped gracefully.
460
- */
461
- agent?: "claude" | "codex" | "gemini";
462
- /**
463
- * Skill names from `@theholocron/skills` to install during `holocron setup`.
464
- * Installed paths are gitignored and managed by setup — do not commit them.
465
- *
466
- * @example
467
- * ["git-safety", "pr-workflow", "commit-standards"]
468
- */
469
- skills?: string[];
470
- /**
471
- * GitHub Pages configuration. When present, `holocron setup` calls the
472
- * Pages API using `HOLOCRON_DEPLOY_TOKEN` (requires `pages:write` + `repo` scope).
473
- * When absent, Pages is left as-is.
474
- *
475
- * @example
476
- * { build: "workflow", domain: "docs.theholocron.dev", https: true }
477
- */
478
- docs?: DocsConfig;
479
- /**
480
- * Environment variable namespace configuration.
481
- * Declares the prefix(es) this project uses for its env vars so that
482
- * tooling can generate `.env.example`, validate required vars, and
483
- * produce accurate documentation without hard-coding prefix strings.
484
- *
485
- * @example
486
- * { namespaces: ["HOLOCRON", "MY_CLI"] }
487
- */
488
- env?: EnvConfig;
489
- /**
490
- * Structured-logging config. Only the level belongs here — Axiom
491
- * credentials come from env vars, never a committed file.
492
- *
493
- * @example
494
- * { level: "debug" }
495
- */
496
- log?: LogConfig;
497
- /**
498
- * CLI self-telemetry override layer. Env var (`HOLOCRON_TELEMETRY=false`)
499
- * still wins; this is the committed way to opt a repo out or drop usage
500
- * analytics while keeping error reporting.
501
- *
502
- * @example
503
- * { enabled: false }
504
- * { analytics: "none" }
505
- */
506
- telemetry?: TelemetryConfig;
507
- /**
508
- * ESLint bundle option overrides that Sentinel's centralized static-
509
- * analysis check (holocron#849) can't otherwise see. Bucket 1 checks
510
- * never read a PR's own committed files for config — this is the
511
- * declared source of truth Sentinel reads instead, so its check stays
512
- * in sync with what each package's own `eslint.config.ts` already
513
- * enforces locally and in CI.
514
- */
515
- eslint?: EslintConfig;
401
+ /** The file in the repo `setup` makes the emoji from when the server has none. */
402
+ image?: string;
516
403
  }
404
+ /** A layout reaction after reading. */
405
+ type ParsedReaction = UnicodeReaction | CustomReaction;
406
+ /** A server emoji written as Discord shows it: `:name:`, the name 2 to 32 letters, digits and underscores. */
407
+ export declare const CUSTOM_EMOJI: RegExp;
517
408
  /**
518
- * Repo-root-relative directories treated as browser-targeted for eslint's
519
- * node-builtins compatibility checks — mirrors
520
- * `@theholocron/eslint-config`'s `library({ browserPackages })` option.
521
- * Only needed for a package whose own `eslint.config.ts` already declares
522
- * `browserPackages` (a deliberate outlier, not the norm — see that
523
- * package's own config file for why).
524
- *
525
- * @example
526
- * { browserPackages: ["packages/github-client/src/app-auth"] }
409
+ * Reads a layout reaction. `":git_merge:"` (or `{ emoji: ":git_merge:", image }`) is a server emoji named `git_merge`;
410
+ * any other string is a Unicode emoji and kept as written. It does not judge a value: `reactionProblem()` does, before
411
+ * anything is applied, so an invalid `emoji` here is kept as the name it was given.
527
412
  */
528
- interface EslintConfig {
529
- browserPackages?: string[];
413
+ export declare function parseReaction(reaction: NotificationsReaction): ParsedReaction;
414
+ /** The folder a layout's emoji pictures live in, as the webhook avatar's files do. */
415
+ export declare const EMOJI_MEDIA_DIR = ".holocron/media/";
416
+ /**
417
+ * The first reason a reaction cannot work, or undefined; `noun` names it in the message (`` `defaultReaction` ``, "a
418
+ * starter reaction"). A Unicode emoji must be a character, not a word (`git_merge` without colons would be sent to
419
+ * Discord as text), a server emoji `:name:` with a name Discord allows, and an `image` a file under `.holocron/media/`
420
+ * (a path, not a URL, with no `..` out of it). A `null` a config wrote is refused, not read as absent.
421
+ */
422
+ export declare function reactionProblem(noun: string, reaction: NotificationsReaction | null): string | undefined;
423
+ /** How a reaction is written in a layout and shown in a row: `:name:` for a server emoji, the character otherwise. */
424
+ export declare function reactionSpelling(reaction: NotificationsReaction): string;
425
+ /**
426
+ * The first reason a forum tag's `emoji` cannot work, or undefined. A string with no colon at either end is a Unicode
427
+ * emoji and kept as written (it is not judged). One that starts or ends with a colon is meant as a server emoji, so it
428
+ * must be `:name:` (2 to 32 letters, digits and underscores), and the layout must give that emoji a picture somewhere
429
+ * (`pictured`: the names an `image` is declared for, from `layoutEmojis()`), because a tag's `emoji` is only a name and
430
+ * `setup` makes the emoji before any channel.
431
+ */
432
+ export declare function tagEmojiProblem(tagName: string, emoji: string | undefined, pictured: ReadonlySet<string>): string | undefined;
433
+ interface RoleSyncOutcome {
434
+ role: string;
435
+ team: string;
436
+ plan: RoleSyncPlan;
437
+ /** Members the role was given to (empty on a dry run). */
438
+ added: string[];
439
+ /** Members the role was taken from (empty on a dry run or with `keep`). */
440
+ removed: string[];
530
441
  }
531
- interface ResolvedTuple {
532
- provider: string;
533
- /** Resolved package name (`@theholocron/holocron-plugin-<provider>` for short refs). */
534
- packageName: string;
535
- options: ProviderOptions;
442
+ /** One person: their GitHub account and their member id on the notifications provider. */
443
+ interface MemberLink {
444
+ /** The GitHub user id, as a string. It survives a rename; the login does not. */
445
+ github: string;
446
+ /** The GitHub login when the link was made; for reports only. */
447
+ login: string;
448
+ /** The member's id on the notifications provider (for Discord, the user id). */
449
+ member: string;
536
450
  }
537
- type ResolvedProviderEntry = {
538
- cardinality: "single";
539
- tuple: ResolvedTuple;
540
- } | {
541
- cardinality: "many";
542
- tuples: ResolvedTuple[];
543
- };
544
- type ResolvedProvidersConfig = Partial<Record<CapabilityKey, ResolvedProviderEntry>>;
545
- interface ResolvedHolocronConfig {
546
- name: string;
547
- description?: string;
548
- homepage?: string;
451
+ /** The file that says which server member is which GitHub account. */
452
+ interface LinksFile {
453
+ /** The file format version. */
454
+ version: 1;
455
+ /** One entry per linked person. */
456
+ links: MemberLink[];
457
+ }
458
+ interface RoleSyncPlan {
459
+ /** Team members who are linked and do not hold the role: give it to them. */
460
+ add: Array<{
461
+ member: string;
462
+ login: string;
463
+ }>;
464
+ /** Holders linked to a GitHub account that is no longer on the team: take it away. */
465
+ remove: Array<{
466
+ member: string;
467
+ login: string;
468
+ }>;
469
+ /** Team members with no link: the role cannot reach them until they link their account. */
470
+ unlinked: SourceTeamMember[];
471
+ /** Holders with no link at all. Left alone, because nothing says they should not have it. */
472
+ unknownHolders: Array<{
473
+ member: string;
474
+ name?: string;
475
+ }>;
476
+ /** Linked team members who already hold the role. */
477
+ inSync: number;
478
+ }
479
+ /** What {@link syncRoles} needs: the providers, the links, and the roles to keep equal to their teams. */
480
+ interface SyncRolesInput {
481
+ /** The provider that lists and changes who holds a role. */
482
+ notifications: Notifications;
483
+ /** The provider that lists a team's members. */
484
+ source: Source;
485
+ /** Who is which person, from the links file. */
486
+ links: LinksFile;
487
+ /** Each role and the team it follows. */
488
+ roles: ReadonlyArray<{
489
+ name: string;
490
+ team: string;
491
+ }>;
492
+ /** The organisation the teams are in; defaults to the source's own. */
549
493
  org?: string;
550
- domain?: string;
551
- repo?: RepoConfig;
552
- tasks?: Array<string | TaskEntryConfig>;
553
- syncScripts?: boolean;
554
- holocronScript?: string;
555
- extraRequiredChecks?: string[];
556
- hooks?: boolean | {
557
- prePush?: boolean;
558
- };
559
- providers: ResolvedProvidersConfig;
560
- apps: AppConfig[];
561
- doctor: DoctorConfig;
562
- agent?: "claude" | "codex" | "gemini";
563
- skills?: string[];
564
- /** Resolved Pages config. `build` is guaranteed present when this field exists. */
565
- docs?: PagesConfig;
566
- env?: EnvConfig;
567
- log?: LogConfig;
568
- telemetry?: TelemetryConfig;
569
- eslint?: EslintConfig;
570
- }
571
- declare class ConfigError extends Error {
572
- name: string;
494
+ /** Report what would change without changing anything. */
495
+ dryRun?: boolean;
496
+ /** Give the role to new team members but do not take it from people who left. */
497
+ keep?: boolean;
498
+ /** Where progress lines go; nowhere when left out. */
499
+ print?: (line: string) => void;
500
+ }
501
+ /** What {@link syncRoles} did. */
502
+ interface SyncRolesResult {
503
+ /** One entry per role whose plan could be made. */
504
+ roles: RoleSyncOutcome[];
505
+ /** Steps that failed; the run carried on past each. */
506
+ failures: Array<{
507
+ step: string;
508
+ message: string;
509
+ }>;
510
+ /** Roles given or taken. */
511
+ ok: number;
512
+ /** Already in sync, left alone, or only previewed. */
513
+ skipped: number;
573
514
  }
515
+ /** What a source provider needs to be able to do to feed a role sync, or the reason it cannot. */
516
+ export declare function sourceProblem(source: Source | undefined): string | undefined;
517
+ /** Reads the links file; a file that does not exist yet is an empty one, a damaged one throws. */
518
+ export declare function readLinks(source: Source, layout: NotificationsLayout, org: string | undefined, provider: string): Promise<LinksFile>;
574
519
  /**
575
- * Resolve `"github"` → `"@theholocron/holocron-plugin-github"`.
576
- * Fully-qualified names (scoped or not) are honored verbatim, which
577
- * is how third-party plugins published outside the org work.
578
- */
579
- declare function resolvePluginPackage(provider: string): string;
580
- declare function resolveEntry(key: CapabilityKey, raw: RawProviderEntry): ResolvedProviderEntry;
581
- declare function resolveConfig(raw: HolocronConfig): ResolvedHolocronConfig;
582
- //#endregion
583
- //#region src/commands/setup/derived-properties.d.ts
584
- /**
585
- * Derived custom-properties (#677). Unlike the existing 6 GitHub
586
- * custom-properties fields (`lifecycle`, `open_source`, `runtime_environment`,
587
- * `uses_external_packages`, `monorepo`, `branch_protection_level`) — which
588
- * mirror what `holocron.config.ts` already states explicitly — these four are
589
- * *derived*: signal that isn't an explicit config field today (framework
590
- * choice, repo archetype, capability drift). See
591
- * `.notes/tech-holocron-platform.spec.md` → "Custom-properties sync — field
592
- * definitions (#677)" for the full design.
593
- */
594
- type HolocronProfile = "library" | "cli" | "plugin" | "template" | "app" | "docs" | "platform";
595
- interface PackageJsonLike {
596
- name?: string;
597
- private?: boolean;
598
- bin?: unknown;
599
- dependencies?: Record<string, string>;
600
- devDependencies?: Record<string, string>;
601
- }
602
- interface DeriveProfileInput {
603
- rootPackageJson: PackageJsonLike | null;
604
- repoName: string;
605
- isMonorepo: boolean;
606
- /** `packages/*` package.json contents, monorepo repos only — used to find the primary published artifact. */
607
- workspacePackageJsons: PackageJsonLike[];
608
- }
609
- /**
610
- * Repo archetype, in priority order:
611
- * 1. `*-template` repo name → `template` (independent of package shape).
612
- * 2. Monorepo whose primary published artifact is a CLI (some workspace
613
- * package has `bin`) → `platform` — matches `holocron` itself: the CLI is
614
- * the deliverable, the plugin packages are supporting infrastructure for
615
- * it, not separate products.
616
- * 3. Monorepo with no CLI but at least one non-private workspace package →
617
- * `library` — matches `clients`/`configs`/`utils`/`themes`/
618
- * `observability`: a family of published packages, none of them a CLI.
619
- * Checked *before* falling into the root-package branch below, because
620
- * these repos' own root `package.json` is private and often carries
621
- * `@theholocron/astro-config` for a docs site built from the monorepo
622
- * root — without this check they'd wrongly resolve to `docs` off that
623
- * root-level signal alone, when the docs site is a secondary concern of
624
- * a library collection, not what the repo fundamentally is.
625
- * 4. Single-package repo with `package.json#bin` → `cli`.
626
- * 5. Docs-only site (astro/starlight present, root package private, no
627
- * publishable exports) → `docs`.
628
- * 6. Private, non-publishable, non-docs → `app`.
629
- * 7. Otherwise, a single publishable package → `library`.
630
- */
631
- declare function deriveProfile(input: DeriveProfileInput): HolocronProfile;
632
- /**
633
- * Detected build/framework tooling — the literal "does this repo need
634
- * next/vite/tsdown" signal `holocron.config.ts` has no field for today
635
- * (framework choice isn't a config concept, unlike `providers`/`tasks`).
636
- * Curated table, not exhaustive by design — add to `KNOWN_STACK_DEPS` as new
637
- * frameworks show up rather than trying to detect anything on npm.
638
- */
639
- declare function deriveStack(pkg: PackageJsonLike | null): string[];
640
- /** The provider capability keys actually wired in `providers: {}` — zero heuristics. */
641
- declare function deriveCapabilities(providers: ResolvedProvidersConfig | undefined): string[];
642
- declare function deriveCompliance(capabilities: readonly string[]): "compliant" | "non-compliant";
643
- /**
644
- * The Phase B refinement `deriveCompliance()`'s own doc comment names —
645
- * *why* a repo is non-compliant, not just that it is. `[]` when compliant.
646
- * Same `REQUIRED_BASELINE` `deriveCompliance()` checks against — one
647
- * table, not two independently-maintained baselines.
648
- */
649
- declare function missingCapabilities(capabilities: readonly string[]): string[];
650
- /**
651
- * Reads each workspace package's actual `package.json` content (not just
652
- * `readWorkspacePackages()`'s `{ slug, name, dir }` — `deriveProfile()`'s
653
- * `platform` detection needs `bin`, which that helper doesn't carry).
654
- * Missing/invalid files are skipped, matching `readWorkspacePackages()`'s
655
- * own soft-fail behavior.
656
- */
657
- declare function readWorkspacePackageJsons(repoRoot: string, workspacePackages: readonly WorkspacePackage[]): Promise<PackageJsonLike[]>;
658
- //#endregion
659
- //#region src/commit-lint/lint-message.d.ts
660
- interface CommitMessageViolation {
661
- /** Rule name, e.g. `"subject-empty"`. */
662
- rule: string;
663
- /** commitlint's own message for the failure, e.g. `"subject may not be empty"`. */
664
- message: string;
520
+ * The first role the layout declares for two different teams, or undefined. Names compare ignoring case, as
521
+ * the server does; the role would be synced against one team and then the other, so the last would win.
522
+ */
523
+ export declare function roleTeamProblem(layout: {
524
+ roles?: ReadonlyArray<{
525
+ name: string;
526
+ team?: string;
527
+ }>;
528
+ }): string | undefined;
529
+ /**
530
+ * Makes each role's holders equal its team, one role after another. This is the sync itself, with no setup in
531
+ * front of it: the caller has already picked the providers, read the links and checked the layout. `holocron
532
+ * sync roles` and Sentinel's role sync are two callers of it. A step that fails is recorded and the
533
+ * run goes on; nothing here throws for a provider error. Idempotent: a role that already matches changes nothing.
534
+ * Lines go to `input.print` when it is given, and nowhere otherwise.
535
+ */
536
+ export declare function syncRoles(input: SyncRolesInput): Promise<SyncRolesResult>;
537
+ /** Why a pull request moves an item's status. */
538
+ type PullRequestStatusReason = "pull-request-open" | "checks-green" | "checks-failed";
539
+ /** The status change a pull request asks for. */
540
+ interface PullRequestStatusChange {
541
+ /** The item's `issues` key. */
542
+ key: string;
543
+ /** The item's title, for the printed line. */
544
+ title: string;
545
+ /** The status it holds now. */
546
+ from: string;
547
+ /** The template's status it is set to. */
548
+ to: string;
549
+ /** The category of `to`. */
550
+ category: Extract<BoardStatusCategory, "active" | "review">;
551
+ /** Which rule applies. */
552
+ reason: PullRequestStatusReason;
665
553
  }
666
- declare function lintCommitMessage(message: string, loaded: QualifiedConfig): Promise<CommitMessageViolation[]>;
667
- //#endregion
668
- //#region src/commit-lint/lint-commit-msg-file.d.ts
669
- interface LintCommitMsgFileResult {
670
- valid: boolean;
671
- violations: CommitMessageViolation[];
672
- }
673
- declare function lintCommitMsgFile(filePath: string, cwd?: string): Promise<LintCommitMsgFileResult>;
674
- //#endregion
675
- //#region src/config/compose.d.ts
676
- type TaskEntry = NonNullable<HolocronConfig["tasks"]>[number];
677
- /** A single composable capability fragment. */
678
- interface Capability {
679
- /** Unique identifier — used for deduplication and dependency resolution. */
680
- id: string;
681
- /** Other capability IDs that must be present in the same compose() call. */
682
- requires?: string[];
683
- /** Task entries contributed by this capability. Merged by name; last writer wins. */
684
- tasks?: TaskEntry[];
685
- /** Provider config. Shallow-merged at the top level; later capabilities override per-key. */
686
- providers?: RawProvidersConfig;
687
- /**
688
- * Required status-check contexts **not** backed by a `required` task
689
- * (codecov gates, `Storybook Publish`, …). Unioned across all capabilities
690
- * onto the top-level `extraRequiredChecks`. Task-backed checks come from
691
- * `{ required: true }` task entries via `astromech.requiredChecks()`.
692
- */
693
- extraRequiredChecks?: string[];
694
- /** Repo config fragment. Scalar fields: last writer wins. properties/topics/teams: merged. */
695
- repo?: Partial<Omit<RepoConfig, "name">>;
696
- /** Org name. Last writer wins. */
697
- org?: string;
698
- /** Org canonical domain. Last writer wins. */
699
- domain?: string;
700
- /** Docs site config. Last writer wins. */
701
- docs?: DocsConfig;
702
- }
703
- /** The merged result of a compose() call. Spreads into defineConfig(). */
704
- interface ComposedPreset {
705
- tasks: TaskEntry[];
706
- providers: RawProvidersConfig;
707
- repo: Partial<Omit<RepoConfig, "name">>;
708
- /** Non-task required-check contexts, unioned across capabilities. */
709
- extraRequiredChecks: string[];
710
- org?: string;
711
- domain?: string;
712
- docs?: DocsConfig;
554
+ /** A rule applies, but the template has no status of the category to set. Reported, never guessed. */
555
+ interface PullRequestStatusUnresolved {
556
+ /** The item's `issues` key. */
557
+ key: string;
558
+ /** The item's title. */
559
+ title: string;
560
+ /** The category the rule wanted. */
561
+ category: PullRequestStatusChange["category"];
562
+ /** Which rule applies. */
563
+ reason: PullRequestStatusReason;
713
564
  }
565
+ /** What {@link planPullRequestStatus} decided: a change or an unresolved rule (it returns `undefined` for nothing). */
566
+ type PullRequestStatusPlan = {
567
+ kind: "change";
568
+ change: PullRequestStatusChange;
569
+ } | {
570
+ kind: "unresolved";
571
+ unresolved: PullRequestStatusUnresolved;
572
+ };
714
573
  /**
715
- * Merge any number of capability fragments into a single preset object that
716
- * spreads directly into `defineConfig()`.
574
+ * Decide the status an item's linked pull requests ask for (spec `tech-board-status-automation`, #2388). Pure: it reads
575
+ * one item and the template and touches nothing; status only, never priority or any other field.
717
576
  *
718
- * - Accepts individual capabilities or nested arrays (for bundle presets).
719
- * - Deduplicates by `id` — when the same ID appears more than once, the last
720
- * occurrence wins. This lets callers override bundle defaults by listing an
721
- * explicit capability after the bundle.
722
- * - Validates all `requires` at call time and throws `ConfigError` if any are
723
- * unmet, listing every missing dependency in a single message.
577
+ * - an open linked pull request (a draft counts) puts the item in `active`;
578
+ * - an open one whose aggregate check is `success` puts it in `review`;
579
+ * - when the item is in `review` and no open pull request is green, a `failure` moves it back to `active`, while
580
+ * `pending` and `none` leave it, so a re-run after a push does not flicker the board;
581
+ * - no open pull request: no change (closed and merged ones are `planReconcile()`'s, through the closed issue).
724
582
  *
725
- * @example
726
- * // docs-only site — no typecheck
727
- * const preset = compose(node(), docs());
583
+ * Left to `planReconcile()`, which runs first: a closed item, an item with an open blocker or in `blocked`, and an
584
+ * item with no status (reported there, not set). An item in `done` is left alone. Where the template has no status of
585
+ * the wanted category the rule comes back as `unresolved` and nothing is guessed; where a category has several statuses
586
+ * the first in template order is used. Applying the change and planning again gives no change.
587
+ */
588
+ export declare function planPullRequestStatus(item: BoardItem, template: BoardTemplate): PullRequestStatusPlan | undefined;
589
+ /** Why an item's status is changed. */
590
+ type ReconcileReason = "blocked" | "unblocked" | "closed" | PullRequestStatusReason;
591
+ /** One status change `reconcile` makes. */
592
+ interface ReconcileChange {
593
+ /** The item's `issues` key. */
594
+ key: string;
595
+ /** The item's title, for the printed line. */
596
+ title: string;
597
+ /** The status it holds now, or undefined for none. */
598
+ from?: string;
599
+ /** The template's status it is set to. */
600
+ to: string;
601
+ /** The category of `to`. */
602
+ category: Extract<BoardStatusCategory, "blocked" | "planned" | "done" | "active" | "review">;
603
+ /** Which rule applies. */
604
+ reason: ReconcileReason;
605
+ }
606
+ /** An item a rule applies to, but whose template has no status of the category to set. Reported, never guessed. */
607
+ interface ReconcileUnresolved {
608
+ /** The item's `issues` key. */
609
+ key: string;
610
+ /** The item's title. */
611
+ title: string;
612
+ /** The category the rule wanted. */
613
+ category: ReconcileChange["category"];
614
+ /** Which rule applies. */
615
+ reason: ReconcileReason;
616
+ }
617
+ /** What {@link planReconcile} decided. */
618
+ interface ReconcilePlan {
619
+ /** The status changes to make, in the items' order. */
620
+ changes: ReconcileChange[];
621
+ /** Open items with no status: reported, not set, since they need a decision and not a rule. */
622
+ unset: BoardItem[];
623
+ /** Items a rule applies to whose template lacks a status of the category. */
624
+ unresolved: ReconcileUnresolved[];
625
+ }
626
+ /**
627
+ * Decide the status changes that keep a board true (spec `command-project`, "Keeping a board true"). Pure: it reads
628
+ * the items and the template and touches nothing. Status only, never priority or any other field.
728
629
  *
729
- * // library with docs
730
- * const preset = compose(node(), typecheck(), docs());
630
+ * - closed or merged, not in a `done` status: set to `done` (whatever the blockers say);
631
+ * - open with no status: not changed, listed in `unset` (it needs a decision, not a rule; this holds even when it has a
632
+ * blocker);
633
+ * - open with an open blocker, not in a `blocked` status: set to `blocked`;
634
+ * - open, in a `blocked` status, with no open blocker: set to `planned` (the status it held before is unknown).
731
635
  *
732
- * // nextjs() is a bundle that returns Capability[]
733
- * const preset = compose(node(), nextjs());
734
- */
735
- declare function compose(...args: (Capability | Capability[])[]): ComposedPreset;
736
- //#endregion
737
- //#region src/config/define-config.d.ts
738
- declare function defineConfig(config: HolocronConfig): HolocronConfig;
739
- //#endregion
740
- //#region src/config/load-config.d.ts
741
- interface LoadedConfig {
742
- resolved: ResolvedHolocronConfig;
743
- /** Absolute path to the file the config was read from. */
744
- filepath: string;
745
- }
746
- /**
747
- * Read + parse + resolve `holocron.config.*` from the given directory.
748
- * Throws {@link ConfigFileError} when nothing is found or a file cannot
749
- * be loaded, or `ConfigError` when the config is invalid.
750
- */
751
- declare function loadConfig(cwd: string): Promise<LoadedConfig>;
752
- //#endregion
753
- //#region src/formatting/config.d.ts
754
- /**
755
- * The org's canonical prettier ignore-pattern list for a central Sentinel
756
- * check (holocron#769/#819) — the `PRETTIER_CONFIG` object itself doesn't
757
- * need a home here, since `@theholocron/prettier-config`'s default export
758
- * already *is* one canonical, importable config (the same "one config,
759
- * not N copies" reasoning `@theholocron/commitlint-config` established for
760
- * commit-message linting, and `ALEX_CONFIG` established for inclusive
761
- * language) — only the ignore list is a Sentinel-specific decision that
762
- * belongs alongside `ALEX_IGNORE_PATTERNS`, not inside the config package.
636
+ * Where a category has several statuses the first in template order is used; where it has none the item is listed in
637
+ * `unresolved` and nothing is guessed. An item's category is read from the template by its status name, falling back
638
+ * to the one the provider reports. Applying the changes and planning again gives no change.
639
+ */
640
+ export declare function planReconcile(items: readonly BoardItem[], template: BoardTemplate): ReconcilePlan;
641
+ /** One board a repo keeps: which template it follows and what it is called. */
642
+ interface BoardDeclaration {
643
+ /** The template's name, a built-in or a file in the templates directory. */
644
+ template: string;
645
+ /** The board's name, which is how it is found among the open boards. */
646
+ name: string;
647
+ }
648
+ /** The options of `providers.projects`, with their defaults filled in. */
649
+ interface ProjectOptions {
650
+ /** Whoever the boards belong to (a GitHub organization): the `org` option, else the config's `org`. */
651
+ owner: string;
652
+ /** The boards this repo keeps, template to name. Empty when the option is absent. */
653
+ boards: BoardDeclaration[];
654
+ /** The directory holding the repo's own template files, relative to the repo root. */
655
+ templatesDir: string;
656
+ }
657
+ /** What {@link resolveProjectOptions} made: the options, or every problem with them. */
658
+ type ResolveProjectOptionsResult = {
659
+ ok: true;
660
+ options: ProjectOptions;
661
+ } | {
662
+ ok: false;
663
+ problems: string[];
664
+ };
665
+ /** Where a repo's own template files live unless the `templates` option says otherwise. */
666
+ export declare const DEFAULT_TEMPLATES_DIR = ".holocron/projects";
667
+ /**
668
+ * Read the options of `providers.projects`: `org` (the owner, defaulting to `fallbackOwner`, the config's org), `boards`
669
+ * (a list of `{ template, name }`, nothing else about a board is written in the config) and `templates` (the directory
670
+ * of template files). Every problem is listed at once, and two boards with the same name are one.
671
+ */
672
+ export declare function resolveProjectOptions(options: Readonly<Record<string, unknown>>, fallbackOwner: string): ResolveProjectOptionsResult;
673
+ /** The templates that ship in `@theholocron/cli`, by name. A repo's own template with the same name replaces one. */
674
+ export declare const BUILTIN_TEMPLATES: Readonly<Record<string, BoardTemplate>>;
675
+ /**
676
+ * The labels every repository gets from `setup`, with their GitHub colours (hex, no `#`) and descriptions. A
677
+ * plugin that makes labels of its own, such as Linear's setup, takes the colour of the one with the same name.
678
+ */
679
+ export declare const CANONICAL_LABELS: readonly [{
680
+ readonly name: "bug";
681
+ readonly color: "d73a4a";
682
+ readonly description: "Something isn't working";
683
+ }, {
684
+ readonly name: "chore";
685
+ readonly color: "ededed";
686
+ readonly description: "Maintenance, no user-facing change";
687
+ }, {
688
+ readonly name: "ci";
689
+ readonly color: "0075ca";
690
+ readonly description: "CI/CD pipeline changes";
691
+ }, {
692
+ readonly name: "dependencies";
693
+ readonly color: "0366d6";
694
+ readonly description: "Dependency update";
695
+ }, {
696
+ readonly name: "documentation";
697
+ readonly color: "0075ca";
698
+ readonly description: "Documentation only";
699
+ }, {
700
+ readonly name: "duplicate";
701
+ readonly color: "cfd3d7";
702
+ readonly description: "Already reported";
703
+ }, {
704
+ readonly name: "enhancement";
705
+ readonly color: "a2eeef";
706
+ readonly description: "New feature or request";
707
+ }, {
708
+ readonly name: "good first issue";
709
+ readonly color: "7057ff";
710
+ readonly description: "Good for newcomers";
711
+ }, {
712
+ readonly name: "help wanted";
713
+ readonly color: "008672";
714
+ readonly description: "Extra attention needed";
715
+ }, {
716
+ readonly name: "invalid";
717
+ readonly color: "e4e669";
718
+ readonly description: "Doesn't seem right";
719
+ }, {
720
+ readonly name: "performance";
721
+ readonly color: "fbca04";
722
+ readonly description: "Performance improvement";
723
+ }, {
724
+ readonly name: "question";
725
+ readonly color: "d876e3";
726
+ readonly description: "Further information requested";
727
+ }, {
728
+ readonly name: "refactor";
729
+ readonly color: "cfd3d7";
730
+ readonly description: "Code restructuring";
731
+ }, {
732
+ readonly name: "released";
733
+ readonly color: "ededed";
734
+ readonly description: "Included in a release";
735
+ }, {
736
+ readonly name: "test";
737
+ readonly color: "bfd4f2";
738
+ readonly description: "Test-related changes";
739
+ }, {
740
+ readonly name: "triage";
741
+ readonly color: "e4e669";
742
+ readonly description: "Needs investigation";
743
+ }, {
744
+ readonly name: "wontfix";
745
+ readonly color: "ffffff";
746
+ readonly description: "Won't be addressed";
747
+ }];
748
+ /** The name of the ruleset `holocron setup` makes for the default branch. */
749
+ export declare const RULESET_NAME = "holocron-default-branch";
750
+ /** The parts of a config {@link configRequiredContexts} reads: a resolved config or the one Sentinel loads at a ref. */
751
+ type ConfigRequiredContextsInput = TasksConfig & {
752
+ /** `repo.requiredChecks`, when the repo writes the whole list down. */
753
+ repo?: Pick<RepoConfig, "requiredChecks">;
754
+ };
755
+ /** A config's required contexts: `repo.requiredChecks` when declared, else what `setup` writes to the ruleset. */
756
+ export declare function configRequiredContexts(config: ConfigRequiredContextsInput): string[];
757
+ /** Contexts to `{ expected, statuses }`: the part before ` / ` is a check id, a context without one is a status. */
758
+ export declare function requiredFromContexts(contexts: readonly string[]): SourceRequiredChecks;
759
+ /**
760
+ * The area a title scope means, by `repo.labels.scopes` (spec `tech-github-area-labels`): `sentinel` gives the area it is
761
+ * mapped to. The scope is matched without regard to case; a scope the map does not name, or a repo with no map, gives
762
+ * `undefined`. It is the area's name, not its label: `areaLabelsForTitle()` adds the prefix.
763
+ */
764
+ export declare function areaForScope(scope: string, scopes: Record<string, string> | undefined): string | undefined;
765
+ /** The colour of every area label: one family, one colour (spec `tech-github-area-labels`). */
766
+ export declare const AREA_LABEL_COLOR = "c5def5";
767
+ /**
768
+ * The labels `holocron setup` makes for the areas a repo declares: `area:<name>`, the one family colour and the
769
+ * description `Changes under <paths>` from the area's own (not excluded) patterns, cut to GitHub's 100 characters. They
770
+ * are never part of `CANONICAL_LABELS`: an area names this repo's folders, so another repo has none of them.
771
+ */
772
+ export declare function areaLabelDefs(areas: Record<string, string[]> | undefined): LabelDef[];
773
+ /**
774
+ * The `area:<name>` labels a set of changed paths earns, in the order the areas are declared (spec
775
+ * `tech-github-area-labels`). An area's patterns are the ones in `repo.labels.areas`; one starting with `!` takes a path
776
+ * out of the area (`docs/**` with `!docs/wiki/**`), so a path is in an area when some pattern includes it and none
777
+ * excludes it. A path in no area earns nothing, which is right, not a failure. This is the one mapping from changed
778
+ * folders to labels in the CLI; Sentinel's `planAreaLabels()` is meant to agree with it.
779
+ */
780
+ export declare function areaLabelsForFiles(files: readonly string[], areas: Record<string, string[]> | undefined): string[];
781
+ /**
782
+ * The `area:<name>` labels the scopes of an issue's title earn, through `repo.labels.scopes` (spec
783
+ * `tech-github-area-labels`): `feat(sentinel): ...` gives `["area:sentinel"]`. An issue has no changed files, so this is
784
+ * its only source of an area. A title with no scope, or a scope the map does not name, earns nothing; the same area
785
+ * from two scopes is given once, in the order of the title.
786
+ */
787
+ export declare function areaLabelsForTitle(title: string, scopes: Record<string, string> | undefined): string[];
788
+ /** The prefix of an area label (spec `tech-github-area-labels`): `area:cli`. */
789
+ export declare const AREA_PREFIX = "area:";
790
+ /**
791
+ * Whether a repository path (forward slashes, from the root) matches one pattern of `repo.labels.areas`. A pattern with
792
+ * a `*` or `?` is a glob (`cli/**`, `docs/**` then `/*.md`); one without is a file (`turbo.json`) or a folder and
793
+ * everything under it (`.holocron`, `.holocron/`).
794
+ */
795
+ export declare function pathMatches(path: string, pattern: string): boolean;
796
+ /**
797
+ * The scopes of a Conventional Commit title: `feat(sentinel): ...` gives `["sentinel"]`, `fix(cli, docs)!: ...` gives
798
+ * `["cli", "docs"]`. A title with no scope, or that is not in the `type(scope): subject` form, gives none.
799
+ */
800
+ export declare function titleScopes(title: string): string[];
801
+ /** What one token must carry in one layer, as `tokenExpectations()` reads it from a plugin's `PluginToken.expect`. */
802
+ interface LayerTokenExpectation {
803
+ /** The token's plugin environment variable (`PluginToken.envName`), its identity in the plugin's list. */
804
+ envName: string;
805
+ /** The layer that holds it. */
806
+ layer: EnvironmentLayer;
807
+ /** Every permission with its rule. Empty for a layer that holds the token with no permission rules. */
808
+ rules: Readonly<Record<string, PermissionRule>>;
809
+ /** The permissions the token must have, in declaration order. */
810
+ required: readonly string[];
811
+ /** The permissions the token must not have, in declaration order. */
812
+ absent: readonly string[];
813
+ /** When the token is due for rotation: the declared policy over `DEFAULT_TOKEN_ROTATION`. */
814
+ rotation: Required<TokenRotation>;
815
+ }
816
+ /** Which of the declared expectations to return; both left out returns all of them. */
817
+ interface TokenExpectationFilter {
818
+ /** Only this layer. */
819
+ layer?: string;
820
+ /** Only the token with this `envName`. */
821
+ envName?: string;
822
+ }
823
+ /**
824
+ * Reads what a plugin's tokens declare (`PluginToken.expect`) as one entry per token and layer that holds it, in the
825
+ * order of `ENVIRONMENT_LAYERS`. The one reader the token probes, the doctor and the docs check share, so none of them
826
+ * walks the declaration itself. A token with no `expect` yields nothing; a layer no token holds is never listed.
827
+ */
828
+ export declare function tokenExpectations(tokens: readonly PluginToken[], filter?: TokenExpectationFilter): LayerTokenExpectation[];
829
+ /** A layer whose Environment must not hold a token at all, as `forbiddenTokenLayers()` reads it from `expect`. */
830
+ interface ForbiddenTokenLayer {
831
+ /** The token's plugin environment variable (`PluginToken.envName`). */
832
+ envName: string;
833
+ /** The layer that must not hold it. */
834
+ layer: EnvironmentLayer;
835
+ /** The layers the token is declared for, to say where it belongs. In `ENVIRONMENT_LAYERS` order. */
836
+ declaredFor: readonly EnvironmentLayer[];
837
+ }
838
+ /**
839
+ * Reads the layers a plugin's tokens forbid (`TokenExpectation.forbiddenLayers`, #2825) as one entry per token and
840
+ * layer, in the order of `ENVIRONMENT_LAYERS`: the Environments that must not hold the token at all. A separate reader
841
+ * from `tokenExpectations()`, which lists only the layers that hold a token, so the probes, the rotation readers and the
842
+ * docs check never see a forbidden layer. A token with no `forbiddenLayers` yields nothing.
763
843
  *
764
- * Reuses `ALEX_IGNORE_PATTERNS`' own entries (`.github/*`, `CHANGELOG.md`,
765
- * `LICENSE` all independently confirmed to fail a real `prettier.check()`
766
- * today — machine-generated or unparseable content, same reasoning that
767
- * excluded them from alex), plus `pnpm-lock.yaml` — prettier-specific
768
- * (alex never reads a lockfile, but prettier would try to reformat it):
769
- * machine-written by pnpm's own writer, and not gitignored (lockfiles are
770
- * tracked), so prettier picks it up by default. Reformatting it just
771
- * fights every subsequent `pnpm install` (this repo's own `.prettierignore`
772
- * already excludes it for that exact reason).
773
- */
774
- declare const PRETTIER_IGNORE_PATTERNS: string[];
775
- //#endregion
776
- //#region src/inclusive-language/config.d.ts
777
- /**
778
- * The org's canonical `alex` (inclusive-language) config, as raw parsed
779
- * data rather than the pre-rendered file strings `createRcConfig()`/
780
- * `createIgnoreConfig()` produce for `holocron setup` to write into a
781
- * repo's own `.alexrc.json`/`.alexignore`.
844
+ * @throws {ConfigError} For a layer that is not one of `ENVIRONMENT_LAYERS` (every layer word reads a vault
845
+ * Environment, so none is left out), and for a layer a token is both declared for (`layers`, or a key of
846
+ * `permissions`) and forbids: the declaration contradicts itself.
847
+ */
848
+ export declare function forbiddenTokenLayers(tokens: readonly PluginToken[], filter?: TokenExpectationFilter): ForbiddenTokenLayer[];
849
+ /** When a provider says a token was made and when it stops working. Each is an ISO date or time, left out when unknown. */
850
+ interface TokenLifetime {
851
+ /** When the token was made, or became valid when that is all the provider says (Cloudflare `not_before`). */
852
+ createdAt?: string;
853
+ /** When the token expires. Unset for a token that never does. */
854
+ expiresAt?: string;
855
+ }
856
+ /** The rotation policy of a token that declares none: a token is due after 90 days, and an expiry is flagged 14 days ahead. */
857
+ export declare const DEFAULT_TOKEN_ROTATION: Required<TokenRotation>;
858
+ /**
859
+ * The labels of the rows that fail for a token that is due (`expired on ...`, `expires on ... (N days left)` inside the
860
+ * warning window, `N days old`): what `rotate tokens` looks for in a `doctor tokens` problem to tell a token that is due
861
+ * from one that only lacks a permission.
862
+ */
863
+ export declare const ROTATION_LABELS: readonly ["expiry", "age"];
864
+ /**
865
+ * Rows saying whether a token is due for rotation, from what its provider exposes. Provider-neutral: a token probe reads
866
+ * the lifetime however its provider offers it and hands it here, with the layer's `rotation` from `tokenExpectations()`.
867
+ * `lifetime` is `undefined` when the provider exposes nothing (the row says so rather than passing), and a date the
868
+ * provider gave that does not parse is an `info` row, never a pass. An expired or near-expiry token fails, and so does
869
+ * one older than `maxAgeDays`. Only dates are printed, never the token.
870
+ */
871
+ export declare function tokenRotationRows(lifetime: TokenLifetime | undefined, rotation: Required<TokenRotation>, now: Date): ProbeRow[];
872
+ /** What a plugin hands `whoamiAction()` to build its `whoami`. */
873
+ interface WhoamiInput {
874
+ /** The provider's name, as `holocron provider <name> whoami` calls it (`vercel`). */
875
+ provider: string;
876
+ /** The token in use, by the plugin's own resolver; throws (an `AuthError`) when none is set. */
877
+ token: () => string;
878
+ /** The plugin's `verifyToken`: who the vendor says the token belongs to, or why it refused it. */
879
+ verify: (token: string) => Promise<VerifyTokenResult>;
880
+ /** The plugin's `tokens` declaration, for the permissions and the rotation policy it declares per layer. */
881
+ tokens: readonly PluginToken[];
882
+ /**
883
+ * Reads when the token was made and when it stops working, for a vendor that says. Left out (or `undefined` back):
884
+ * the rotation row says the provider does not expose it. A throw is a skipped row, never a failure of the run.
885
+ */
886
+ lifetime?: (token: string) => Promise<TokenLifetime | undefined>;
887
+ /** The command that proves the permissions, e.g. `holocron probe vercel token --environment <layer>`. Default: built from `provider`. */
888
+ proveWith?: string;
889
+ /** The clock, for tests. Defaults to now. */
890
+ now?: () => Date;
891
+ }
892
+ /**
893
+ * A provider's `whoami` (`holocron provider <name> whoami`): who its token belongs to, when it stops working and what
894
+ * the plugin declares it may do. Read-only, one row per fact, and a failing step is a row, not the end of the run. The
895
+ * token and its value are never printed: only the vendor's own description of it (`verifyToken`'s subject), dates and
896
+ * permission names.
782
897
  *
783
- * `.alexrc.json` is explicitly "generated by `holocron setup` — do not
784
- * edit manually" (this repo's own `AGENTS.md`) — the real source of truth
785
- * is this JSON file, one canonical copy, not each repo's synced one. A
786
- * central Sentinel check (holocron#769/#793) reads it directly rather
787
- * than fetching each repo's own copy via the Contents API — the same "one
788
- * config, not N copies" reasoning `@theholocron/commitlint-config` already
789
- * established for commit-message linting.
790
- */
791
- declare const ALEX_CONFIG: {
792
- allow: string[];
793
- };
898
+ * The permission row lists what each layer's declaration (`PluginToken.expect`) says the token needs and must not
899
+ * have, and names the probe that proves it against the vendor: a vendor's API rarely says what a token may do, so
900
+ * `whoami` reports the declaration and does not claim more than it has read.
901
+ */
902
+ export declare function whoamiAction(input: WhoamiInput): ProviderAction;
903
+ /**
904
+ * What stdout is. A token is never written to a `terminal` (it would sit in scrollback) or to `other` (a redirect to
905
+ * a regular file, which would leave plaintext tokens on disk without the protections of the file option); only a
906
+ * `pipe` receives the lines. On a terminal they go to the file option instead, or the clipboard when asked.
907
+ */
908
+ type AuthExportOutKind = "terminal" | "pipe" | "other";
909
+ /**
910
+ * What file descriptor `fd` (stdout) is, for deciding where tokens may go: a `terminal`, a `pipe` (a FIFO, or the
911
+ * socket some shells and runners use for one), or `other` (a regular file, a device, or anything that cannot be
912
+ * inspected). Only a pipe is safe to write the lines to, so anything unknown is `other`.
913
+ */
914
+ export declare function stdoutKind(isTerminal: boolean, fd?: number, stat?: (fd: number) => Pick<Stats, "isFIFO" | "isSocket">): AuthExportOutKind;
794
915
  /**
795
- * Glob-ish path patterns `alex` skips. Kept as a literal here rather than
796
- * importing `../templates/configs/alexjs/alexignore` directly — that file
797
- * (like `commit-msg`/`pre-push`) is deliberately extensionless, matching
798
- * the real filename `holocron setup` writes, which ECMAScript's own
799
- * module resolution (`moduleResolution: "nodenext"`) can't import across
800
- * a package boundary without an extension. Keep in sync with that file by
801
- * hand; it changes rarely.
802
- */
803
- declare const ALEX_IGNORE_PATTERNS: string[];
804
- //#endregion
805
- export { ALEX_CONFIG, ALEX_IGNORE_PATTERNS, Analytics, AppConfig, Auth, AuthDescription, AuthError, AuthEvent, AuthEventType, AuthIdentity, AuthUser, CARDINALITY, Capability, CapabilityConfigPackage, CapabilityImpls, CapabilityKey, Cardinality, CardinalityFor, ChromaticProjectConfig, Ci, CiRun, CiRunFilter, CiRunStatus, CommitMessageViolation, ComposedPreset, ConfigError, ConfigFileError, ConnectionStringOptions, CreateAuthUserInput, DeployFunctionConfig, DeployFunctionResult, DeployScriptConfig, DeployScriptResult, Deployment, DeploymentProject, DeploymentProjectSettings, DeploymentRecord, DeploymentTarget, DeploymentTrigger, DeriveProfileInput, Dns, DnsRecord, DnsRecordRequest, DnsRecordType, DocsConfig, DoctorConfig, EnsureResult, EnvConfig, Environment, EnvironmentReviewer, Environments, Errors, EslintConfig, FeatureResolverConfig, HolocronConfig, HolocronProfile, Issue, IssueSearchFilter, Issues, LabelDef, LifecycleResult, LifecycleSlot, LintCommitMsgFileResult, LoadedConfig, LogConfig, Logs, MultiEntry, NormalizedAuthUser, Notifications, PRETTIER_IGNORE_PATTERNS, PackageJsonLike, PagesConfig, ParseWebhookInput, ProviderApiError, ProviderIdentity, ProviderOptions, PullRequest, REQUIRED_CAPABILITIES, RawProviderEntry, RawProvidersConfig, RepoConfig, RepoProperties, RepoProtection, RepoRef, RepoSettings, type RequestOptions, ResolveTokenConfig, type ResolveTokenInput, ResolvedCapability, ResolvedHolocronConfig, ResolvedProviderEntry, ResolvedProvidersConfig, ResolvedTuple, type RestClient, type RestClientConfig, Ruleset, SecretScope, Secrets, SingleEntry, Source, StatusCategory, Storage, StorageBranch, StorybookDeployProject, TaskEntryConfig, TeamEntry, TeamPermission, TelemetryConfig, Tooling, ToolingDoctorReport, TrackerDoctorReport, TrackerUser, Vault, WebhookDashboardInfo, WebhookVerificationError, Wiki, WikiProvisionOpts, WikiProxyConfig, Workers, WorkflowWithConfig, compose, createFeatureResolver, createResolveToken, createRestClient, defineConfig, deleteToken, deriveCapabilities, deriveCompliance, deriveProfile, deriveStack, getToken, isMulti, lintCommitMessage, lintCommitMsgFile, listStoredProviders, loadConfig, missingCapabilities, readWorkspacePackageJsons, resolveConfig, resolveEntry, resolvePluginPackage, setToken };
916
+ * The vault Environment `holocron sync secrets --env <environment>` reads. A layer word (`local`, `dev`, `ci`, `prod`) is the
917
+ * Environment of that layer of this repository, `<org/repo> - <layer>`; any other text is a literal Environment name.
918
+ * A literal name wins only when it is not exactly a layer word, so an Environment that is itself called `prod` cannot be
919
+ * addressed by that name (spec `tech-environment-layers`, #2069).
920
+ *
921
+ * @param id - The `--env` value the user gave.
922
+ * @param input - Where the repository is (its `origin` remote is read there), and optionally how to read it.
923
+ * @throws {ConfigError} For a layer word when the remote cannot be read (the message names the `environment` option).
924
+ */
925
+ export declare function resolveEnvironmentId(id: string, input: {
926
+ repoRoot: string;
927
+ gitExec?: GitExec;
928
+ }): Promise<string>;
929
+ /** The line that says how to fix a credentials path the version control ignore rules do not cover. */
930
+ export declare function ignoreAdvice(isDefault: boolean, choose: string): string;
931
+ /** The file `export tokens` and `new github-app` write by default, relative to the repository root. */
932
+ export declare const PRIVATE_CREDENTIALS_FILE = ".holocron/.private/.credentials";
933
+ /** Where a credentials file goes: its absolute path, and whether it is the default one in the private directory. */
934
+ interface CredentialsFileTarget {
935
+ path: string;
936
+ /** True when no `--file` was given, so the file is in `.holocron/.private/` and a missing ignore rule is fixed by `sync`. */
937
+ isDefault: boolean;
938
+ }
939
+ /**
940
+ * The credentials file for a command: `file` (relative to `base`) when given, else `.holocron/.private/.credentials`
941
+ * under `base`. The default's directory is created when missing (owner-only), because the ignore check can only ask
942
+ * about a path whose directory exists and the file cannot be written without it.
943
+ */
944
+ export declare function resolveCredentialsFile(base: string, file: string | undefined, makeDir?: (dir: string) => void): CredentialsFileTarget;
945
+ /**
946
+ * The closed list of area files `loadConfig` reads from `.holocron/` (the directory is `.<config name>`, set by kyber):
947
+ * `.holocron/notifications.*` fills `providers.notifications`' `layout`, `.holocron/repo.*` fills keys of `repo`, and `.holocron/org.*` fills provider options (`teamId`, `accountId`) a config leaves out.
948
+ * A file not on this list is never read.
949
+ */
950
+ export declare const HOLOCRON_AREAS: readonly ["notifications", "repo", "org"];
951
+ /**
952
+ * The areas a config in a subdirectory also reads from the repository root's `.holocron/` (SPEC-0069): only `org`,
953
+ * because its values are the organization's and every config needs them. `repo` and `notifications` describe the
954
+ * repository itself, so an app's config does not take them from the root.
955
+ */
956
+ export declare const SHARED_AREAS: readonly ["org"];
957
+ /**
958
+ * Put the area files of `.holocron/` into the config as loaded, before `deriveDefaults` runs: `notifications` becomes
959
+ * the `layout` of the notifications provider and `repo` supplies keys of `repo` and `org` fills the provider options a config leaves out. A value set both inline and in a file
960
+ * is a `ConfigError` naming both (no merge, no precedence). With no area files the config is returned as it was.
961
+ */
962
+ export declare function placeAreas(areas: ConfigDirArea[], raw: HolocronConfig): HolocronConfig;
963
+ export { AGGREGATE_CHECK_NAME, AGGREGATE_SHADOW_CHECK_NAME, AddedItem, type AgentName, type AgentOptions, Analytics, type AppConfig, Auth, AuthDescription, AuthError, AuthEvent, AuthEventType, type AuthExportOutKind, AuthIdentity, AuthUser, type BoardDeclaration, BoardField, BoardFieldType, BoardItem, BoardItemInput, BoardPullRequest, BoardPullRequestChecks, BoardRule, BoardState, BoardStatus, BoardStatusCategory, BoardSummary, BoardTemplate, BoardTemplateFile, BoardView, CARDINALITY, Cache, CacheTokenCheck, type Capability, type CapabilityConfigPackage, CapabilityImpls, CapabilityKey, Cardinality, CardinalityFor, type ChromaticProjectConfig, Ci, CiRun, CiRunFilter, CiRunStatus, type CommandLogMode, type CommandThreadsMode, type ComposedPreset, ConfigError, ConfigFileError, ConnectionStringOptions, CoreIssueKind, Coverage, CoverageConfigComponent, CoverageConfigDocumentation, CoverageConfigInput, CoverageExpectations, CoverageNameDiff, CoverageRepoReport, CoverageStatusContext, CoverageStatusInput, CoverageTokenCheck, CoverageUploadFlagResult, CoverageUploadGroup, CoverageUploadInput, CoverageUploadResult, CreateAuthUserInput, Credentials, type CredentialsConfig, CredentialsInspection, type CustomReaction, DeployFunctionConfig, DeployFunctionResult, DeployScriptConfig, DeployScriptResult, Deployment, DeploymentProject, DeploymentProjectSettings, DeploymentRecord, DeploymentTarget, DeploymentTrigger, type DeriveProfileInput, type DevConfig, type DevServeConfig, DiscussionPatch, DiscussionPost, Dns, DnsRecord, DnsRecordRequest, DnsRecordType, type DocsConfig, type DoctorConfig, DuplicateDiscussion, ElevationRequiredError, EmojiCheck, EnsureDiscussionInput, EnsureRelayInput, EnsureRelayResult, EnsureRelaySourceInput, EnsureRelaySourceResult, EnsureReport, EnsureResult, EnsureWebhookResult, EnsuredDiscussion, EnsuredResource, EnsuredTunnel, type EnvConfig, Environment, EnvironmentEntry, type EnvironmentLayer, EnvironmentReviewer, Environments, Errors, ErrorsInspection, ErrorsOrgState, ErrorsProjectState, type EslintConfig, ExportInfo, type FeatureResolver, type FeatureResolverConfig, type ForbiddenTokenLayer, type GitHubAppConfig, HideLinkPreviewsInput, HideLinkPreviewsResult, type HolocronConfig, type HolocronProfile, IdeaRecord, Ideas, type IdeasConfig, ImportOptions, ImportResult, InspectErrorsInput, InspectRelayInput, InspectRelaySourceInput, Issue, IssueClearable, IssueComment, IssueCreateInput, IssueEffort, IssueFields, IssueKind, IssueOrder, IssuePatch, IssuePriority, IssueRecord, IssueSearchFilter, IssueSelector, IssueTypeDeclaration, IssueTypeInfo, IssueUpdateResult, Issues, KNOWN_STACK_DEPS, LabelDef, type LayerTokenExpectation, type LayoutEmoji, LifecycleResult, LifecycleSlot, type LinksFile, type LoadedConfig, type LogConfig, Logs, LogsDataset, type MemberLink, type MintToken, type MintTokenInput, type MintTokenResult, MissingTokenError, Monitoring, MonitoringAlertChannelInput, MonitoringAlertChannelResult, MonitoringAlertChannelState, MonitoringAlertSettings, MonitoringAssertion, MonitoringAssertionComparison, MonitoringAssertionSource, MonitoringCheck, MonitoringCheckInput, MonitoringDashboardInput, MonitoringDashboardState, MonitoringHeartbeatInput, MonitoringHeartbeatResult, MonitoringHeartbeatUnit, MonitoringHttpMethod, MonitoringIncident, MonitoringIncidentImpact, MonitoringIncidentInput, MonitoringIncidentQuery, MonitoringIncidentResolveInput, MonitoringIncidentStatus, MonitoringIncidentUpdate, MonitoringIncidentUpdateInput, MonitoringIncidentWrite, MonitoringStatusComponentInput, MonitoringStatusPageInput, MonitoringStatusPageResult, MonitoringStatusPageState, MoveReport, type MultiEntry, NormalizedAuthUser, Notifications, NotificationsAccess, NotificationsApplicationLayout, NotificationsChannelLayout, type NotificationsConfig, NotificationsDelivery, NotificationsEveryoneLayout, NotificationsForumTag, NotificationsLayout, NotificationsLinksLayout, NotificationsMember, NotificationsMonitoringFeed, NotificationsOnboardingLayout, NotificationsPicture, NotificationsPinnedLayout, NotificationsPostedMessage, NotificationsPrsFeed, NotificationsReaction, NotificationsRelaySource, NotificationsSendOptions, NotificationsServerLayout, NotificationsSignIn, NotificationsSignedIn, NotificationsWelcomeLayout, type OrgConfig, type OrgIssueType, OrganizationSecretScope, type PackageJsonLike, PagesConfig, ParseWebhookInput, type ParsedReaction, type PermissionRule, type PluginProbes, type PluginToken, type Probe, type ProbeContext, type ProbeRow, type ProjectOptions, Projects, type ProviderAction, type ProviderActionContext, type ProviderActions, ProviderApiError, ProviderIdentity, type ProviderOptions, type ProviderRow, PullRequest, PullRequestChecks, PullRequestChecksState, PullRequestFields, PullRequestInput, PullRequestLink, PullRequestPatch, PullRequestResult, type PullRequestState, type PullRequestStatusChange, type PullRequestStatusPlan, type PullRequestStatusReason, type PullRequestStatusUnresolved, type PullRequestTag, REQUIRED_CAPABILITIES, type RawProviderEntry, type RawProvidersConfig, type ReadKeysLimitedInput, type ReadTokenId, type ReconcileChange, type ReconcilePlan, type ReconcileReason, type ReconcileUnresolved, Registry, RelaySourceCapability, RelaySourceMethods, RelaySourceState, RelayState, type RenderedPullRequest, type RepoConfig, type RepoEnvironment, type RepoEnvironmentReviewer, type RepoLabels, type RepoProperties, type RepoProtection, RepoRef, type RepoSecrets, type RepoSecretsDeploy, type RepoSecretsSync, RepoSettings, type RepoValidationConfig, type RepoVariables, type RepoVariablesSync, type RepoView, type RequestOptions, type RequiredChecksFailure, type RequiredChecksInput, type RequiredChecksState, type RequiredChecksVerdict, type ResolveProjectOptionsResult, type ResolveTokenConfig, type ResolveTokenInput, ResolvedCapability, type ResolvedHolocronConfig, type ResolvedProviderEntry, type ResolvedProvidersConfig, type ResolvedTuple, type RestClient, type RestClientConfig, type RevokeToken, type RevokeTokenInput, type RevokeTokenResult, Ruleset, SecretAccess, SecretScope, SecretVisibility, Secrets, ServerInspection, type SingleEntry, Source, SourceBranch, SourceCheckRun, SourceCheckRunWrite, SourceCommitStatus, SourceFile, SourceRepoInfo, SourceRequiredChecks, SourceRulesetDetail, SourceSecurity, SourceTeamMember, type StackName, StatusCategory, Storage, StorageBranch, type StorybookDeployProject, SyncResult, type SyncRolesInput, type SyncRolesResult, type TaskEntry, type TaskEntryConfig, TeamEntry, TeamPermission, type TelemetryConfig, type TokenExpectation, type TokenExpectationFilter, type TokenLifetime, type TokenResolver, type TokenRotation, Tooling, ToolingDoctorReport, ToolingExportInput, ToolingExportIssue, ToolingExportResult, ToolingOpenInput, ToolingOpenLaunch, ToolingOpenPlan, ToolingOpenWant, ToolingWorkspaceFile, ToolingWorkspaceInput, ToolingWorkspaceResult, ToolingWorkspaceSide, ToolingWorkspaceState, TrackerDoctorReport, TrackerUser, TunnelRoute, Tunnels, type UnicodeReaction, Vault, type VerifyTokenFailure, type VerifyTokenResult, type VerifyTokenSuccess, WebhookDashboardInfo, WebhookVerificationError, type WhoamiInput, Wiki, WikiInspection, WikiInstanceState, WikiNavigationState, WikiOrganizationState, WikiProbe, WikiProvisionOpts, WikiProxyConfig, WikiPublishedState, WorkerDeploymentState, WorkerScriptState, Workers, type WorkflowWithConfig, compose, createRestClient, credentialsEnvironment, defineConfig, deriveCapabilities, deriveCompliance, deriveProfile, deriveStack, isMulti, loadConfig, missingCapabilities, readWorkspacePackageJsons, requiredChecksVerdict, resolveConfig, resolveEntry, resolvePluginPackage, resolveValue };