@theholocron/cli 5.0.0-alpha.4 → 5.0.0-alpha.400

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,620 +1,487 @@
1
- import { Analytics, Auth, AuthDescription, AuthEvent, AuthEventType, AuthIdentity, AuthUser, CARDINALITY, CapabilityImpls, CapabilityKey, Cardinality, CardinalityFor, Ci, CiRun, CiRunFilter, CiRunStatus, ConnectionStringOptions, CreateAuthUserInput, Deployment, DeploymentProject, DeploymentProjectSettings, DeploymentRecord, DeploymentTarget, DeploymentTrigger, Dns, DnsRecord, 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, WikiDnsRecord, 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 { LogLevel } from "@theholocron/observability/core";
5
- //#region src/auth/auth-resolver.d.ts
6
- type ResolveTokenConfig = Omit<ResolveTokenConfig$1, "getKeyringToken">;
7
- /** Wraps `createResolveToken` from `@theholocron/http` and injects the
8
- * system keyring so plugins stay at a one-liner call site. */
9
- declare function createResolveToken(config: ResolveTokenConfig): (input?: ResolveTokenInput) => string;
1
+ import { $ as DnsRecord, $t as NotificationsForumTag, A as Cardinality, An as SourceSecurity, At as LifecycleResult, B as DeployFunctionConfig, Bn as TrackerDoctorReport, Bt as MonitoringAssertionComparison, C as BoardStatusCategory, Cn as Secrets, Ct as IssueOrder, D as BoardView, Dn as SourceFile, Dt as IssueSelector, E as BoardTemplateFile, En as SourceBranch, Et as IssueSearchFilter, F as CiRunStatus, Fn as SyncResult, Ft as MonitoringAlertChannelInput, G as DeploymentProject, Gn as WebhookDashboardInfo, Gt as MoveReport, H as DeployScriptConfig, Hn as TunnelRoute, Ht as MonitoringCheck, I as ConnectionStringOptions, In as TeamEntry, It as MonitoringAlertChannelResult, J as DeploymentTarget, Jn as WikiProxyConfig, Jt as NotificationsAccess, K as DeploymentProjectSettings, Kn as Wiki, Kt as NormalizedAuthUser, L as CreateAuthUserInput, Ln as TeamPermission, Lt as MonitoringAlertChannelState, M as Ci, Mn as StatusCategory, Mt as Logs, N as CiRun, Nn as Storage, Nt as LogsDataset, O as CapabilityImpls, On as SourceRepoInfo, Ot as Issues, P as CiRunFilter, Pn as StorageBranch, Pt as Monitoring, Q as Dns, Qt as NotificationsEveryoneLayout, R as Credentials, Rn as Tooling, Rt as MonitoringAlertSettings, S as BoardStatus, Sn as SecretScope, St as IssueComment, T as BoardTemplate, Tn as Source, Tt as IssueRecord, U as DeployScriptResult, Un as Tunnels, Ut as MonitoringCheckInput, V as DeployFunctionResult, Vn as TrackerUser, Vt as MonitoringAssertionSource, W as Deployment, Wn as Vault, Wt as MonitoringHttpMethod, X as DiscussionPatch, Xn as Workers, Xt as NotificationsChannelLayout, Y as DeploymentTrigger, Yn as WorkerScriptState, Yt as NotificationsApplicationLayout, Z as DiscussionPost, Zt as NotificationsDelivery, _ as BoardFieldType, _n as RelayState, _t as Ideas, a as REQUIRED_CAPABILITIES, an as NotificationsPicture, at as EnsureReport, b as BoardRule, bn as ResolvedCapability, bt as InspectRelayInput, c as AddedItem, cn as NotificationsServerLayout, ct as EnsuredDiscussion, d as AuthDescription, dn as NotificationsWelcomeLayout, dt as Environment, en as NotificationsLayout, et as DnsRecordRequest, f as AuthEvent, fn as PagesConfig, ft as EnvironmentReviewer, g as BoardField, gn as PullRequest, gt as IdeaRecord, h as AuthUser, hn as ProviderIdentity, ht as ExportInfo, i as ProviderApiError, in as NotificationsOnboardingLayout, it as EnsureRelayResult, j as CardinalityFor, jn as SourceTeamMember, jt as LifecycleSlot, k as CapabilityKey, kn as SourceRulesetDetail, kt as LabelDef, l as Analytics, ln as NotificationsSignIn, lt as EnsuredResource, m as AuthIdentity, mn as Projects, mt as Errors, n as ElevationRequiredError, nn as NotificationsMember, nt as EnsureDiscussionInput, o as WebhookVerificationError, on as NotificationsPinnedLayout, ot as EnsureResult, p as AuthEventType, pn as ParseWebhookInput, pt as Environments, q as DeploymentRecord, qn as WikiProvisionOpts, qt as Notifications, r as MissingTokenError, rn as NotificationsMonitoringFeed, rt as EnsureRelayInput, s as isMulti, sn as NotificationsPrsFeed, st as EnsureWebhookResult, t as CARDINALITY, tn as NotificationsLinksLayout, tt as DnsRecordType, u as Auth, un as NotificationsSignedIn, ut as EnsuredTunnel, v as BoardItem, vn as RepoRef, vt as ImportOptions, w as BoardSummary, wn as ServerInspection, wt as IssuePriority, x as BoardState, xn as Ruleset, xt as Issue, y as BoardItemInput, yn as RepoSettings, yt as ImportResult, z as CredentialsInspection, zn as ToolingDoctorReport, zt as MonitoringAssertion } from "./index-DbbyDvZi.mjs";
2
+ import { A as ProviderOptions, B as RepoVariablesSync, C as EslintConfig, D as LogConfig, E as IdeasConfig, F as RepoProtection, G as SingleEntry, H as ResolvedProviderEntry, I as RepoSecrets, J as TelemetryConfig, K as StorybookDeployProject, L as RepoSecretsSync, M as RawProvidersConfig, N as RepoConfig, O as MultiEntry, P as RepoProperties, R as RepoValidationConfig, S as EnvConfig, T as HolocronConfig, U as ResolvedProvidersConfig, V as ResolvedHolocronConfig, W as ResolvedTuple, Y as WorkflowWithConfig, _ as CredentialsConfig, a as LoadedConfig, b as DocsConfig, c as TaskEntry, d as resolveConfig, f as resolveEntry, g as ChromaticProjectConfig, h as CapabilityConfigPackage, i as loadConfig, j as RawProviderEntry, k as OrgConfig, l as ConfigError, m as AppConfig, n as compose, o as Capability, p as resolvePluginPackage, q as TaskEntryConfig, r as defineConfig, s as ComposedPreset, t as ConfigFileError, u as credentialsEnvironment, v as DevConfig, w as GitHubAppConfig, x as DoctorConfig, y as DevServeConfig, z as RepoVariables } from "./config-system-CYv5GFIa.mjs";
3
+ import { AuthError, ResolveTokenConfig as ResolveTokenConfig$1, ResolveTokenInput, ResolveTokenInput as ResolveTokenInput$1, resolveValue } from "@theholocron/kyber/secrets";
4
+ import { CheckRow } from "@theholocron/kyber/ui";
5
+ import { RequestOptions, RestClient, RestClientConfig, createRestClient } from "@theholocron/http-client";
6
+ import "@theholocron/kyber/plugins";
7
+ import { ConnectionProbeInput as ConnectionProbeInput$1 } from "@theholocron/kyber/checks";
8
+ import { PackageJson } from "@theholocron/pkg-utils";
9
+ import { WorkspacePackage } from "@theholocron/astromech";
10
+ import "@theholocron/observability/core";
11
+ import { ConfigDirArea } from "@theholocron/datapad";
12
+ /** A plugin's `verifyToken` result when the provider accepted the token. */
13
+ interface VerifyTokenSuccess {
14
+ /** Always `true` for an accepted token. */
15
+ ok: true;
16
+ /** "workplace: acme" / "user: cnewton@x" — surfaced in success output. */
17
+ subject: string;
18
+ /** When the token stops working, ISO 8601 in UTC, for a provider that reports it. Absent when unknown or never. */
19
+ expiresAt?: string;
20
+ }
21
+ /** A plugin's `verifyToken` result when the provider rejected the token. */
22
+ interface VerifyTokenFailure {
23
+ /** Always `false` for a rejected token. */
24
+ ok: false;
25
+ /** Reason the token was rejected. Surfaces to the operator. */
26
+ message: string;
27
+ }
28
+ /** What a plugin's `verifyToken` returns: the token was accepted, or it was rejected with a reason. */
29
+ type VerifyTokenResult = VerifyTokenSuccess | VerifyTokenFailure;
30
+ /** One token a plugin takes, and where it is looked up. */
31
+ interface PluginToken {
32
+ /** The plugin's own environment variable, e.g. `HOLOCRON_ADMIN_TOKEN`. */
33
+ envName: string;
34
+ /** The vendor's own environment variable, e.g. `CLOUDFLARE_API_TOKEN`; read after `envName` and before the keyring. */
35
+ vendorEnvName?: string;
36
+ /** The OS keyring entry, e.g. `github.admin`. */
37
+ keyringKey: string;
38
+ /**
39
+ * `false` when the plugin's `verifyToken` does not apply to this token (it checks a different credential, such as
40
+ * a webhook URL), so `holocron doctor tokens` reports it as set without calling the plugin. Default `true`.
41
+ */
42
+ verifiable?: boolean;
43
+ /**
44
+ * How to check this token when the plugin's one `verifyToken` is for a different credential (the Discord bot token,
45
+ * where `verifyToken` checks a webhook). Wins over the plugin's `verifyToken`.
46
+ */
47
+ verify?: (token: string) => Promise<VerifyTokenResult>;
48
+ /**
49
+ * `true` when the plugin only falls back to this token: nothing needs it unless a call names no better source (the
50
+ * Discord webhook a post uses when it names no channel). The checks that expect every token a plugin lists, such as
51
+ * `holocron doctor credentials`, do not expect it, and `holocron auth export` marks it as optional when it has none.
52
+ * Default `false`.
53
+ */
54
+ optional?: boolean;
55
+ }
56
+ /** Options for a token resolver, without the keyring lookup, which the CLI supplies itself. */
57
+ type ResolveTokenConfig = Omit<ResolveTokenConfig$1, "keyring" | "orgEnvName">;
58
+ /** Settings for a feature-specific token resolver: which env var and keyring entry it reads. */
10
59
  interface FeatureResolverConfig {
11
60
  /** Env var name for this feature, e.g. `"HOLOCRON_ISSUES_TOKEN"`. */
12
61
  envName: string;
13
62
  /** Keyring account key, e.g. `"github.issues"`. */
14
63
  keyringKey: string;
64
+ /** The vendor named in the "no token" message. Default `GitHub`. */
65
+ vendor?: string;
15
66
  }
67
+ /** A resolver from `createFeatureResolver`: call it for the token, or read `token` to see where it looks. */
68
+ type FeatureResolver = ((input?: ResolveTokenInput$1) => string) & {
69
+ /** The environment variable and keyring entry this resolver reads, for `holocron doctor tokens`. */
70
+ readonly token: PluginToken;
71
+ };
72
+ /** A resolver from `createResolveToken`: call it for the token, or read `token` to see where it looks. */
73
+ type TokenResolver = ((input?: ResolveTokenInput$1) => string) & {
74
+ /** The environment variables and keyring entry this resolver reads, for `holocron doctor tokens`. */
75
+ readonly token: PluginToken;
76
+ };
16
77
  /**
17
- * Build a strict, single-feature token resolver.
18
- *
19
- * Resolution chain: `--token flag → envName env var → keyring(keyringKey)`.
20
- * No broad-token fallback — if the feature-specific token is absent the
21
- * operation fails with a message naming the exact env var to set.
78
+ * The holocron keyring: `get` answers `null` for "not stored" and for "keyring unavailable" alike, so callers fall
79
+ * through to env-var precedence, and remembers the answer for the process (`clearCache` forgets it); `set` and `delete`
80
+ * answer whether they did anything; `list` names the stored providers; `isAvailable` tells an outage from an empty keyring.
22
81
  */
23
- declare function createFeatureResolver(config: FeatureResolverConfig): (input?: ResolveTokenInput) => string;
24
- //#endregion
25
- //#region src/auth/keyring.d.ts
82
+ export declare const keyring: import("@theholocron/kyber/secrets").Keyring;
26
83
  /**
27
- * Keyring-backed bootstrap credential store.
28
- *
29
- * Every holocron plugin's bootstrap token (the one it needs before it
30
- * can talk to its vendor's API) can be stored in the OS keyring under
31
- * a single reverse-DNS service scope. Managed via `holocron auth`
32
- * subcommands; consulted at position 4 in every plugin's auth
33
- * precedence chain (after --token / HOLOCRON_<X>_TOKEN / <native>_TOKEN).
34
- *
35
- * See `docs/wiki/specifications/tech-auth-bootstrap.spec.md` for the design rationale.
36
- *
37
- * Failure model: keyring access is best-effort. Platforms without a
38
- * supported credential store (some Linux CI images, sandboxed
39
- * environments) will throw from the underlying library. Every export
40
- * here catches and returns a null/empty result rather than propagating
41
- * — the plugin's precedence chain then falls through to
42
- * env-var-only paths, which is exactly how CI is meant to work.
84
+ * Kyber's `createResolveToken` with the keyring, the `HOLOCRON_ORG` variable and the `token` description
85
+ * `holocron doctor tokens` reads filled in, so a plugin stays at a one-liner call site. The chain is the flag, the
86
+ * plugin's variable, the vendor's variable, the `credentials` providers' variables, the keyring.
43
87
  */
88
+ export declare function createResolveToken(config: ResolveTokenConfig): TokenResolver;
44
89
  /**
45
- * Store or overwrite a bootstrap token for a provider. Returns true on
46
- * success, false when the underlying keyring is unsupported or errored.
90
+ * Kyber's `createFeatureResolver` for a strict, single-feature token: the flag, the feature's variable, the
91
+ * `credentials` providers' variable of that name, the keyring. No broad-token fallback; if the feature's token is absent
92
+ * the operation fails with a message naming the exact variable to set and `holocron auth set`.
47
93
  */
48
- declare function setToken(provider: string, token: string): boolean;
94
+ export declare function createFeatureResolver(config: FeatureResolverConfig): FeatureResolver;
49
95
  /**
50
- * Read the bootstrap token for a provider. Returns `null` for both
51
- * "not stored" and "keyring unavailable" — callers can treat them the
52
- * same way (fall through to env-var precedence).
96
+ * Puts issue keys in creation order without asking the tracker: issue numbers (`#12`, `ENG-12`) rise with creation inside
97
+ * one repository or team, so the trailing number is the order. `oldest` is ascending, `newest` descending; keys with the
98
+ * same number keep their place. A key with no trailing number is an error, because nothing can be said of its age.
53
99
  */
54
- declare function getToken(provider: string): string | null;
100
+ export declare function orderKeys(keys: readonly string[], order: IssueOrder): string[];
55
101
  /**
56
- * Delete a stored token. Returns true when a token was removed, false
57
- * when there was nothing to delete or the keyring is unavailable.
58
- * Distinguishing the two cases isn't worth the surface area — the
59
- * command output makes the situation clear either way.
102
+ * Keeps the first or last `limit` of a listing by creation time, returned oldest first. `createdAt` reads an item's
103
+ * ISO timestamp; items created in the same instant keep their listed order. The cut happens on what the listing already
104
+ * holds, so no request is spent on an item that is dropped.
60
105
  */
61
- declare function deleteToken(provider: string): boolean;
106
+ export declare function pickByCreation<T>(items: readonly T[], createdAt: (item: T) => string, order: IssueOrder, limit: number): T[];
107
+ /** What {@link readKeysLimited} needs. */
108
+ interface ReadKeysLimitedInput<T> {
109
+ /** The issue keys to choose from. */
110
+ keys: readonly string[];
111
+ /** Which end of the creation order to take first. */
112
+ order: IssueOrder;
113
+ /** How many items to keep. */
114
+ limit: number;
115
+ /** The most issues fetched at once. */
116
+ concurrency: number;
117
+ /** Fetches one issue by key. */
118
+ fetch: (key: string) => Promise<T>;
119
+ /** Whether a fetched issue counts against the limit; false skips it without using the budget. */
120
+ keep: (item: T) => boolean;
121
+ }
62
122
  /**
63
- * List provider slugs with a stored token in this service scope.
64
- * Uses the library's `findCredentials(service)` — supported on all
65
- * platforms the underlying credential store supports.
123
+ * Reads an explicit list of issues in creation order until `limit` of them are kept. The keys are sorted by number first
124
+ * (see {@link orderKeys}), then fetched in small steps of at most `concurrency`, each step no bigger than the places
125
+ * still open, so an issue that is later skipped (a pull request, a closed one) is replaced by the next key and nothing
126
+ * beyond the budget is fetched unless a skip made room. Within a step the fetches run together; the results keep the key
127
+ * order. The kept items come back oldest first, whichever end was chosen.
66
128
  */
67
- declare function listStoredProviders(): string[];
68
- //#endregion
69
- //#region src/config/config.d.ts
70
- /** Structured-logging config. The Axiom **token** never lives here — only in
71
- * env vars or the OS keyring — but the non-secret dataset name may. */
72
- interface LogConfig {
73
- /**
74
- * Default log level. The lowest-priority level source: `--verbose` /
75
- * `--quiet` and `HOLOCRON_LOG_LEVEL` both outrank it.
76
- */
77
- level?: LogLevel;
78
- /**
79
- * Axiom log-shipping. Set `axiom.dataset` to opt local runs into Axiom
80
- * without exporting `HOLOCRON_AXIOM_DATASET` — the CLI then pairs it with
81
- * the token from `HOLOCRON_AXIOM_TOKEN` / `AXIOM_TOKEN` or the OS keyring
82
- * (`holocron auth set axiom[.<org>] <TOKEN>`). Env vars still win. In CI,
83
- * prefer the `HOLOCRON_AXIOM_DATASET` variable.
84
- */
85
- axiom?: {
86
- /** Target Axiom dataset, e.g. `"holocron-local"`. */
87
- dataset?: string;
88
- };
89
- }
129
+ export declare function readKeysLimited<T>(input: ReadKeysLimitedInput<T>): Promise<T[]>;
90
130
  /**
91
- * CLI self-telemetry config — the committed, reviewable override layer over the
92
- * env-var + shipped-fallback activation (ADR-0007 / ADR-0008). No secret lives
93
- * here; the Sentry DSN and PostHog key come from env vars or ship as fallbacks.
131
+ * Calls a provider's optional `onProgress` hook with how many items are done of how many. A hook that throws is
132
+ * ignored, because a progress counter must never change or stop the read or write it reports on.
94
133
  *
95
- * Precedence: `HOLOCRON_TELEMETRY=false` (env) → `telemetry.enabled` (this) →
96
- * default on. `enabled` never *re-enables* what the env var turned off.
134
+ * @param onProgress - The hook from `ExportInfo` or `ImportOptions`; nothing happens when it is not given.
135
+ * @param done - How many items are finished.
136
+ * @param total - How many items there are.
97
137
  */
98
- interface TelemetryConfig {
99
- /**
100
- * Repo-level opt-out — the committed peer of `HOLOCRON_TELEMETRY=false`.
101
- * `false` installs the no-op sinks for the whole run. Default on.
102
- */
103
- enabled?: boolean;
138
+ export declare function reportProgress(onProgress: ((done: number, total: number) => void) | undefined, done: number, total: number): void;
139
+ /** One line a probe reports: `info` for a fact, `ok` / `fail` for a result, `heading` to title the rows that follow. */
140
+ interface ProbeRow {
141
+ /** `ok` or `fail` for a result, `info` for a fact, `heading` to title the rows that follow. */
142
+ status: "ok" | "fail" | "info" | "heading";
143
+ /** The row's short title. */
144
+ label: string;
145
+ /** Further detail, when there is some. */
146
+ detail?: string;
147
+ }
148
+ /** What a probe is handed. Everything it prints or changes goes through this, so the runner can enforce the rules. */
149
+ interface ProbeContext {
150
+ /** What the person typed after the probe name (`probe deps who vitest` hands `["vitest"]`). */
151
+ args?: readonly string[];
152
+ /**
153
+ * `--lcov <path>`: where a probe that measures coverage also writes an lcov report, on top of the rows it prints.
154
+ * Relative to the repo root. Unset when the flag was not given.
155
+ */
156
+ lcov?: string;
157
+ /** `--dry-run`: `write` calls are announced and skipped. */
158
+ dryRun: boolean;
159
+ /** Report one line. The text is scrubbed of secrets before it is printed. */
160
+ say(row: ProbeRow): void;
161
+ /**
162
+ * Change something on the provider. The only way to: on `--dry-run` it prints `would <label>` and does not call `fn`,
163
+ * and a probe that did not declare `writes: true` cannot call it.
164
+ */
165
+ write<T>(label: string, fn: () => Promise<T>): Promise<T | undefined>;
166
+ /** Register how to undo something this probe made. Runs in reverse order on success, failure and Ctrl-C. */
167
+ cleanup(label: string, fn: () => Promise<void>): void;
168
+ /** Mark a value (a token, a signing secret) as one that must never be printed. */
169
+ secret(value: string | undefined): void;
170
+ }
171
+ /** A named, on-demand poke at a live provider. */
172
+ interface Probe {
173
+ /** One sentence for `holocron probe`'s listing. */
174
+ summary: string;
175
+ /** Whether it creates or changes anything on the provider. Asked about first, and needs `--yes` without a terminal. */
176
+ writes: boolean;
177
+ /** Runs the probe, reporting and changing things only through `ctx`. */
178
+ run(ctx: ProbeContext): Promise<void>;
179
+ }
180
+ /** A plugin's probes by name (kebab-case), as returned from `createPlugin` next to `capabilities`. */
181
+ type PluginProbes = Record<string, Probe>;
182
+ /**
183
+ * One step of a provider's `setup` or `doctor`, in the shape the shared renderer prints (`printCheckRows`): an id, a
184
+ * title, `ok` / `fail` / `skip`, one line of detail and, for a failure, a line per problem.
185
+ */
186
+ type ProviderRow = CheckRow;
187
+ /** What a provider's `setup` and `doctor` are handed. */
188
+ interface ProviderActionContext {
104
189
  /**
105
- * Usage-analytics provider. `"none"` disables PostHog usage analytics while
106
- * leaving error reporting (Sentry) untouched. Default `"posthog"`.
190
+ * `--dry-run`: `setup` reports what it would change as `ok` rows and changes nothing. `doctor` never changes
191
+ * anything, so it ignores this.
107
192
  */
108
- analytics?: "posthog" | "none";
193
+ dryRun: boolean;
109
194
  }
110
- type ProviderOptions = Record<string, unknown>;
111
195
  /**
112
- * The shape a capability config package's default export must satisfy.
113
- * Config packages let teams share a pre-bundled provider + options across
114
- * repos (Level 1 of the shareable-configs story, issue #75).
115
- *
116
- * @example
117
- * // @acme/holocron-vault/index.ts
118
- * import type { CapabilityConfigPackage } from '@theholocron/cli'
119
- * export default {
120
- * provider: '1password',
121
- * options: { vault: 'acme-app' },
122
- * } satisfies CapabilityConfigPackage
196
+ * Something only one provider has (a Linear team's automation, a Discord server's roles) and no provider-neutral
197
+ * command can express. It reports one row per step and does not stop at the first failure: a step that fails is a
198
+ * `fail` row and the next step still runs. It never prints a token.
123
199
  */
124
- interface CapabilityConfigPackage {
125
- provider: string;
126
- options?: ProviderOptions;
200
+ type ProviderAction = (ctx: ProviderActionContext) => Promise<ProviderRow[]>;
201
+ /** A provider's `setup` and `doctor`, as `holocron provider <name> setup|doctor` finds them. */
202
+ interface ProviderActions {
203
+ /** Makes what the provider's own config block declares. Optional. */
204
+ setup?: ProviderAction;
205
+ /** Compares what the provider's own config block declares with what exists, read-only. Optional. */
206
+ doctor?: ProviderAction;
207
+ }
208
+ /** What a connection probe needs to check a provider's host and token: kyber's input, with the plugin's `verifyToken` as `verify`. */
209
+ export interface ConnectionProbeInput extends Omit<ConnectionProbeInput$1, "verify"> {
210
+ /** The plugin's `verifyToken`: asks the provider who the token belongs to. */
211
+ verify: (token: string) => Promise<VerifyTokenResult>;
127
212
  }
128
- type SingleEntry = string | [provider: string, options: ProviderOptions];
129
- type MultiEntry = Array<string | [provider: string, options: ProviderOptions]>;
130
- type RawProviderEntry = SingleEntry | MultiEntry;
131
- type RawProvidersConfig = Partial<Record<CapabilityKey, RawProviderEntry>>;
132
- type RepoProtection = "balanced" | "strict" | "none";
133
213
  /**
134
- * Raw `docs` config as written by the user. `build` is optional so the
135
- * field can be declared without committing to a build type yet; setup
136
- * will error if `docs` is present but `build` is absent.
214
+ * The `connection` probe every provider offers, for telling a network problem from a credential problem. The checks are
215
+ * kyber's `connectionProbe`; this types the result as the plugin system's {@link Probe} and `verify` as `VerifyTokenResult`.
137
216
  */
138
- interface DocsConfig {
139
- /**
140
- * GitHub Pages build source.
141
- * "workflow" → GitHub Actions (PUT { build_type: "workflow" })
142
- * "branch" → classic gh-pages branch (PUT { build_type: "legacy", source: { branch: "gh-pages", path: "/" } })
143
- * When absent, Pages is not managed by `holocron setup`.
144
- */
145
- build?: "workflow" | "branch";
146
- /**
147
- * Custom domain / CNAME (e.g. "docs.theholocron.dev").
148
- * When set and `homepage` is not explicitly provided, setup derives
149
- * `homepage` as `https://{domain}/` for package.json and the repo website field.
150
- */
151
- domain?: string;
152
- /** Enforce HTTPS. Only effective once the custom domain is DNS-verified. */
153
- https?: boolean;
217
+ export declare function connectionProbe(input: ConnectionProbeInput): Probe;
218
+ interface RoleSyncOutcome {
219
+ role: string;
220
+ team: string;
221
+ plan: RoleSyncPlan;
222
+ /** Members the role was given to (empty on a dry run). */
223
+ added: string[];
224
+ /** Members the role was taken from (empty on a dry run or with `keep`). */
225
+ removed: string[];
154
226
  }
155
- interface RepoProperties {
156
- lifecycle?: "active" | "experimental" | "deprecated";
157
- open_source?: boolean;
158
- runtime_environment?: "node" | "browser" | "universal" | "none";
159
- uses_external_packages?: boolean;
227
+ /** One person: their GitHub account and their member id on the notifications provider. */
228
+ interface MemberLink {
229
+ /** The GitHub user id, as a string. It survives a rename; the login does not. */
230
+ github: string;
231
+ /** The GitHub login when the link was made; for reports only. */
232
+ login: string;
233
+ /** The member's id on the notifications provider (for Discord, the user id). */
234
+ member: string;
160
235
  }
161
- interface RepoConfig {
162
- /** "owner/name" — the GitHub repository coordinate. Derived from the git remote when absent. */
163
- name?: string;
164
- /**
165
- * Branch protection preset applied by `holocron setup`. When omitted,
166
- * no protection is applied and no `branch_protection_level` property is set.
167
- * Required-status-check contexts for `"strict"` are derived from the task
168
- * manifest — `{ required: true }` tasks + top-level `extraRequiredChecks`
169
- * (see `astromech.requiredChecks()`).
170
- */
171
- protection?: RepoProtection;
172
- /**
173
- * GitHub teams granted repository access. Synced by `holocron setup`, which
174
- * also writes `.github/CODEOWNERS` for teams with write-or-higher permission.
175
- * String shorthand defaults to `push` (Write).
176
- */
177
- teams?: TeamEntry[];
178
- /** GitHub topics set on the repository. */
179
- topics?: string[];
180
- /** GitHub custom properties synced to the org dashboard. */
181
- properties?: RepoProperties;
236
+ /** The file that says which server member is which GitHub account. */
237
+ interface LinksFile {
238
+ /** The file format version. */
239
+ version: 1;
240
+ /** One entry per linked person. */
241
+ links: MemberLink[];
182
242
  }
183
- interface AppConfig {
184
- name: string;
185
- path: string;
186
- kind?: string;
243
+ interface RoleSyncPlan {
244
+ /** Team members who are linked and do not hold the role: give it to them. */
245
+ add: Array<{
246
+ member: string;
247
+ login: string;
248
+ }>;
249
+ /** Holders linked to a GitHub account that is no longer on the team: take it away. */
250
+ remove: Array<{
251
+ member: string;
252
+ login: string;
253
+ }>;
254
+ /** Team members with no link: the role cannot reach them until they link their account. */
255
+ unlinked: SourceTeamMember[];
256
+ /** Holders with no link at all. Left alone, because nothing says they should not have it. */
257
+ unknownHolders: Array<{
258
+ member: string;
259
+ name?: string;
260
+ }>;
261
+ /** Linked team members who already hold the role. */
262
+ inSync: number;
187
263
  }
188
- interface DoctorConfig {
189
- checks?: string[];
264
+ /** What {@link syncRoles} needs: the providers, the links, and the roles to keep equal to their teams. */
265
+ interface SyncRolesInput {
266
+ /** The provider that lists and changes who holds a role. */
267
+ notifications: Notifications;
268
+ /** The provider that lists a team's members. */
269
+ source: Source;
270
+ /** Who is which person, from the links file. */
271
+ links: LinksFile;
272
+ /** Each role and the team it follows. */
273
+ roles: ReadonlyArray<{
274
+ name: string;
275
+ team: string;
276
+ }>;
277
+ /** The organisation the teams are in; defaults to the source's own. */
278
+ org?: string;
279
+ /** Report what would change without changing anything. */
280
+ dryRun?: boolean;
281
+ /** Give the role to new team members but do not take it from people who left. */
282
+ keep?: boolean;
283
+ /** Where progress lines go; nowhere when left out. */
284
+ print?: (line: string) => void;
190
285
  }
191
- interface EnvConfig {
192
- /**
193
- * Namespace prefixes used by this project's env vars.
194
- * Listed from least- to most-specific (cascade model — last wins).
195
- * Tooling reads this to generate `.env.example`, validate required
196
- * vars, and produce documentation.
197
- *
198
- * @example
199
- * // Project-only prefix
200
- * namespaces: ["CLI_TEMPLATE"]
201
- *
202
- * // Org-wide defaults + project-specific overrides
203
- * namespaces: ["HOLOCRON", "MY_CLI"]
204
- */
205
- namespaces?: string[];
286
+ /** What {@link syncRoles} did. */
287
+ interface SyncRolesResult {
288
+ /** One entry per role whose plan could be made. */
289
+ roles: RoleSyncOutcome[];
290
+ /** Steps that failed; the run carried on past each. */
291
+ failures: Array<{
292
+ step: string;
293
+ message: string;
294
+ }>;
295
+ /** Roles given or taken. */
296
+ ok: number;
297
+ /** Already in sync, left alone, or only previewed. */
298
+ skipped: number;
206
299
  }
300
+ /** What a source provider needs to be able to do to feed a role sync, or the reason it cannot. */
301
+ export declare function sourceProblem(source: Source | undefined): string | undefined;
302
+ /** Reads the links file; a file that does not exist yet is an empty one, a damaged one throws. */
303
+ export declare function readLinks(source: Source, layout: NotificationsLayout, org: string | undefined, provider: string): Promise<LinksFile>;
207
304
  /**
208
- * A single Chromatic project entry in a monorepo `run-chromatic` config.
209
- * Each entry produces one matrix job in CI, publishing to a separate Chromatic project.
210
- *
211
- * The `tokenName` maps to a repository secret named `CHROMATIC_PROJECT_TOKEN_<TOKENNAME>`.
212
- * Additional fields correspond to chromaui/action inputs and are passed through directly.
213
- *
214
- * @see https://www.chromatic.com/docs/monorepos/
305
+ * The first role the layout declares for two different teams, or undefined. Names compare ignoring case, as
306
+ * the server does; the role would be synced against one team and then the other, so the last would win.
215
307
  */
216
- interface ChromaticProjectConfig {
217
- /**
218
- * Secret suffix. The CI job reads `CHROMATIC_PROJECT_TOKEN_<tokenName>`.
219
- * Must be uppercase (e.g. `"WEB"`, `"UI"`).
220
- */
221
- tokenName: string;
222
- /**
223
- * Path to run the Chromatic build from, relative to the repo root.
224
- * Typically the package directory (e.g. `"apps/web"`, `"packages/ui"`).
225
- */
226
- workingDir: string;
227
- /**
228
- * Script name to build Storybook. Defaults to `"build:storybook"`.
229
- * Must accept `--output-dir` pass-through (use `turbo run … --` at root).
230
- */
231
- buildScript?: string;
232
- /**
233
- * Path to the Storybook folder relative to `workingDir`, for TurboSnap.
234
- * Tells Chromatic where to find `.storybook/` when the Storybook config
235
- * is in a subdirectory. Corresponds to `--storybook-base-dir`.
236
- */
237
- storybookBaseDir?: string;
238
- /**
239
- * Glob patterns of files/dirs that should NOT trigger a TurboSnap bailout
240
- * when changed. Useful for ignoring non-UI changes in a monorepo
241
- * (e.g. `"./packages/!(ui)/**"` to focus TurboSnap on the UI package).
242
- * Corresponds to `--untraced`. Accepts a single glob string or array.
243
- */
244
- untraced?: string | string[];
245
- /**
246
- * Glob patterns matching story files to snapshot. When set, only matching
247
- * stories are captured. Corresponds to `--only-story-files`.
248
- * Cannot be combined with `onlyStoryNames`.
249
- */
250
- onlyStoryFiles?: string;
251
- /**
252
- * Exit with code 0 even when visual changes are detected.
253
- * Useful during initial setup before baselines are approved.
254
- * Corresponds to `--exit-zero-on-changes`.
255
- */
256
- exitZeroOnChanges?: boolean;
257
- }
308
+ export declare function roleTeamProblem(layout: {
309
+ roles?: ReadonlyArray<{
310
+ name: string;
311
+ team?: string;
312
+ }>;
313
+ }): string | undefined;
258
314
  /**
259
- * A single Storybook app in a deploy workflow config.
260
- * `name` becomes the sandbox sub-path (`_site/sandbox/<name>/`).
261
- * `path` is the working directory relative to the repo root; defaults to `"."` (repo root) when omitted.
315
+ * Makes each role's holders equal its team, one role after another. This is the sync itself, with no setup in
316
+ * front of it: the caller has already picked the providers, read the links and checked the layout. `holocron
317
+ * notifications sync-roles` and Sentinel's role sync are two callers of it. A step that fails is recorded and the
318
+ * run goes on; nothing here throws for a provider error. Idempotent: a role that already matches changes nothing.
319
+ * Lines go to `input.print` when it is given, and nowhere otherwise.
262
320
  */
263
- interface StorybookDeployProject {
264
- name?: string;
265
- path?: string;
321
+ export declare function syncRoles(input: SyncRolesInput): Promise<SyncRolesResult>;
322
+ /**
323
+ * Derived custom-properties (#677). Unlike the existing 6 GitHub
324
+ * custom-properties fields (`lifecycle`, `open_source`, `runtime_environment`,
325
+ * `uses_external_packages`, `monorepo`, `branch_protection_level`) — which
326
+ * mirror what `holocron.config.ts` already states explicitly — these four are
327
+ * *derived*: signal that isn't an explicit config field today (framework
328
+ * choice, repo archetype, capability drift). See
329
+ * `docs/wiki/specifications/tech-holocron-platform.spec.md` → "Custom-properties sync — field
330
+ * definitions (#677)" for the full design.
331
+ */
332
+ type HolocronProfile = "library" | "cli" | "plugin" | "template" | "app" | "docs" | "platform";
333
+ /** The `package.json` shape profile derivation reads — `@theholocron/pkg-utils`'s `PackageJson`, under the name Sentinel already imports. */
334
+ type PackageJsonLike = PackageJson;
335
+ /** What profile derivation reads to decide a repo's archetype. */
336
+ interface DeriveProfileInput {
337
+ /** The repo's root `package.json`, or `null` when it has none. */
338
+ rootPackageJson: PackageJsonLike | null;
339
+ /** The repository name, without the owner. */
340
+ repoName: string;
341
+ /** Whether the repo is a monorepo with several workspace packages. */
342
+ isMonorepo: boolean;
343
+ /** `packages/*` package.json contents, monorepo repos only — used to find the primary published artifact. */
344
+ workspacePackageJsons: PackageJsonLike[];
266
345
  }
267
346
  /**
268
- * Typed `with:` inputs for reusable workflows.
269
- *
270
- * `run-chromatic` accepts either a plain boolean (single-project) or a
271
- * `ChromaticProjectConfig[]` object (multi-project monorepo).
272
- *
273
- * `docs` / `storybook` are high-level deploy shorthand that `holocron setup`
274
- * translates to `type` / `storybook-projects` before writing the thin caller.
275
- * They also drive automatic `paths:` derivation so you never need to write
276
- * `paths:` manually for deploy entries.
347
+ * Repo archetype, in priority order:
348
+ * 1. `*-template` repo name → `template` (independent of package shape).
349
+ * 2. Monorepo whose primary published artifact is a CLI (some workspace
350
+ * package has `bin`) → `platform` — matches `holocron` itself: the CLI is
351
+ * the deliverable, the plugin packages are supporting infrastructure for
352
+ * it, not separate products.
353
+ * 3. Monorepo with no CLI but at least one non-private workspace package →
354
+ * `library` — matches `clients`/`configs`/`utils`/`themes`/
355
+ * `observability`: a family of published packages, none of them a CLI.
356
+ * Checked *before* falling into the root-package branch below, because
357
+ * these repos' own root `package.json` is private and often carries
358
+ * `@theholocron/astro-config` for a docs site built from the monorepo
359
+ * root — without this check they'd wrongly resolve to `docs` off that
360
+ * root-level signal alone, when the docs site is a secondary concern of
361
+ * a library collection, not what the repo fundamentally is.
362
+ * 4. Single-package repo with `package.json#bin` → `cli`.
363
+ * 5. Docs-only site (astro/starlight present, root package private, no
364
+ * publishable exports) → `docs`.
365
+ * 6. Private, non-publishable, non-docs → `app`.
366
+ * 7. Otherwise, a single publishable package → `library`.
277
367
  */
278
- type WorkflowWithConfig = Record<string, unknown> & {
279
- "run-chromatic"?: boolean | {
280
- projects: ChromaticProjectConfig[];
281
- };
282
- /**
283
- * Docs deployment shorthand. `true` uses the org-standard `docs/` directory;
284
- * `{ path: "custom" }` uses a custom directory. Both derive a `paths:` entry automatically.
285
- */
286
- docs?: true | {
287
- path: string;
288
- };
289
- /** Storybook apps to deploy alongside docs. Each entry's `path` is appended to `paths:`. */
290
- storybook?: StorybookDeployProject[];
291
- };
368
+ export declare function deriveProfile(input: DeriveProfileInput): HolocronProfile;
292
369
  /**
293
- * A `tasks` manifest entry in object form. A bare string entry is shorthand
294
- * for `{ name, ci: true, local: true }`.
370
+ * Detected build/framework tooling — the literal "does this repo need
371
+ * next/vite/tsdown" signal `holocron.config.ts` has no field for today
372
+ * (framework choice isn't a config concept, unlike `providers`/`tasks`).
373
+ * Curated table, not exhaustive by design — add to `KNOWN_STACK_DEPS` as new
374
+ * frameworks show up rather than trying to detect anything on npm.
295
375
  */
296
- interface TaskEntryConfig {
297
- name: string;
298
- with?: WorkflowWithConfig;
299
- paths?: string[];
300
- linters?: string[];
301
- /** Emit a `.github/workflows/<name>.yml` thin caller + include in `holocron ci`. Default `true`. */
302
- ci?: boolean;
303
- /** Write a `package.json` script + let `holocron run <name>` resolve the task. Default `true`. */
304
- local?: boolean;
305
- /** The task's CI check context is a required status check + part of `holocron ci`'s default run. */
306
- required?: boolean;
307
- }
308
- interface HolocronConfig {
309
- /** Project name. Derived from package.json when absent. */
310
- name?: string;
311
- description?: string;
312
- /** Project homepage URL. Synced to package.json#homepage and the GitHub repo's website field by `holocron sync`. */
313
- homepage?: string;
314
- /**
315
- * Active org name for namespaced keyring lookup. When set, token resolution
316
- * tries `<service>.<org>` before the unnamespaced `<service>` fallback, so
317
- * a single machine can hold credentials for multiple GitHub orgs without
318
- * collision. Overridden by `--org` CLI flag or `HOLOCRON_ORG` env var.
319
- */
320
- org?: string;
321
- /**
322
- * Org canonical domain (e.g. `"theholocron.dev"`). Subdomains are derived
323
- * from this — `preview: true` on a deploy workflow resolves the preview base
324
- * domain as `preview.<domain>`, giving URLs like `<repo>-pr-<n>.<domain>`.
325
- */
326
- domain?: string;
327
- /**
328
- * Repository identity and metadata. When set, `PluginLoader` injects
329
- * `repo.name` into every plugin's `RuntimeContext.repo` so plugins that
330
- * need a repo (github, etc.) don't require `--repo` on every invocation.
331
- * `--repo` on the command line still overrides.
332
- */
333
- repo?: RepoConfig;
334
- /**
335
- * The task manifest — what this repo runs. Each entry is a task name
336
- * (backed by a reusable workflow in `theholocron/.github`), or the object
337
- * form to pass `with:` inputs. `@theholocron/astromech` reads this as the
338
- * single source for `holocron run` / `holocron ci` / the generated CI
339
- * workflows / `package.json` scripts.
340
- *
341
- * Supported values (intent-facing vocabulary — epic #672, D3):
342
- * "verification.unitTests" | "verification.typeSafety" | "verification.performance" |
343
- * "sourceQuality.staticAnalysis" | "sourceQuality.formatting" |
344
- * "sourceQuality.structuredDataValidation" | "sourceQuality.deadCodeAnalysis" |
345
- * "security.secretDetection" | "security.codeScanning" |
346
- * "delivery.build" | "delivery.publish" | "delivery.deploy" | "delivery.bundleSize" |
347
- * "platform.repoSync" | "platform.commitStandards" | "platform.repoValidation" |
348
- * "knowledge.wiki" | "knowledge.docs" | "knowledge.components" |
349
- * "review" | "tag" | "stale" | "greetings" | "dependencies" | "bookkeeping"
350
- *
351
- * `holocron setup` writes `.github/workflows/<name>.yml` for each entry,
352
- * calling the corresponding reusable workflow in `theholocron/.github`.
353
- * Files are overwritten on each run — they are generated artifacts.
354
- *
355
- * ### delivery.deploy / knowledge.docs / knowledge.components
356
- * `delivery.deploy` uses `docs` and/or `storybook` in `with:` — setup
357
- * derives `paths:` automatically. `docs: true` uses the org-standard
358
- * `docs/` directory; `docs: { path: "custom" }` overrides it.
359
- * `knowledge.docs` / `knowledge.components` are the same underlying
360
- * mechanism, each dedicated to exactly one type — they imply the
361
- * corresponding shorthand, so a repo using them never has to spell out
362
- * `docs: true` / `storybook: […]` itself.
363
- *
364
- * ```ts
365
- * // Docs only (standard layout)
366
- * { name: "delivery.deploy", with: { docs: true } }
367
- * // …or equivalently, the dedicated task:
368
- * "knowledge.docs"
369
- *
370
- * // Docs + monorepo storybooks
371
- * {
372
- * name: "delivery.deploy",
373
- * with: {
374
- * docs: true,
375
- * storybook: [
376
- * { name: "web", path: "apps/web" },
377
- * { name: "ui", path: "packages/ui" },
378
- * ],
379
- * },
380
- * }
381
- *
382
- * // Non-standard docs location
383
- * { name: "delivery.deploy", with: { docs: { path: "packages/site" } } }
384
- * ```
385
- *
386
- * ### run-chromatic
387
- * For a single-project repo, use `"run-chromatic": true` with a
388
- * `CHROMATIC_PROJECT_TOKEN` repository secret.
389
- *
390
- * For monorepos with multiple Storybooks, use the object form:
391
- * ```ts
392
- * "run-chromatic": {
393
- * projects: [
394
- * { tokenName: "WEB", workingDir: "apps/web" },
395
- * { tokenName: "UI", workingDir: "packages/ui" },
396
- * ]
397
- * }
398
- * ```
399
- * Each `tokenName` maps to a repository secret named
400
- * `CHROMATIC_PROJECT_TOKEN_<TOKENNAME>`. `holocron setup` expands this
401
- * to the flat `run-chromatic: true` + `chromatic-projects: <json>` inputs
402
- * that the reusable workflow accepts.
403
- *
404
- * @example
405
- * ["sourceQuality.staticAnalysis", { "name": "delivery.publish", "with": { "run-build": false } }]
406
- * { "name": "delivery.deploy", "with": { "docs": true } }
407
- */
408
- tasks?: Array<string | TaskEntryConfig>;
409
- /**
410
- * Opt out of `holocron sync`'s `package.json` script writes. Default `true`.
411
- */
412
- syncScripts?: boolean;
413
- /**
414
- * The command the synced `"holocron"` `package.json` script runs. Default
415
- * `"holocron"` (the installed bin). This repo overrides it to run its own
416
- * build (`"node packages/cli/dist/cli.mjs"`).
417
- */
418
- holocronScript?: string;
419
- /**
420
- * Required status-check contexts not backed by a `required` task (codecov
421
- * gates, the bundle-build check, …). `holocron setup` appends these to the
422
- * task-derived list from `astromech.requiredChecks()`.
423
- */
424
- extraRequiredChecks?: string[];
425
- /**
426
- * Git hooks `holocron setup` installs. `true` / `{ prePush: true }` writes
427
- * `.husky/pre-push` (runs `holocron ci` before every push); `false` /
428
- * `{ prePush: false }` opts out. Omitted → on for `protection: "strict"`,
429
- * off otherwise. `--hooks` / `--no-hooks` on `holocron setup` override.
430
- */
431
- hooks?: boolean | {
432
- prePush?: boolean;
433
- };
434
- providers: RawProvidersConfig;
435
- apps?: AppConfig[];
436
- doctor?: DoctorConfig;
437
- /**
438
- * Agent runtime that determines where skills are installed by `holocron setup`.
439
- * Skills are installed to `.agents/skills/<name>/` (canonical) with a
440
- * relative symlink at the agent-specific path:
441
- * - `"claude"` → `.claude/skills/<name>` → `../../.agents/skills/<name>`
442
- * - `"codex"` | `"gemini"` → logged as unsupported; skipped gracefully.
443
- */
444
- agent?: "claude" | "codex" | "gemini";
445
- /**
446
- * Skill names from `@theholocron/skills` to install during `holocron setup`.
447
- * Installed paths are gitignored and managed by setup — do not commit them.
448
- *
449
- * @example
450
- * ["git-safety", "pr-workflow", "commit-standards"]
451
- */
452
- skills?: string[];
453
- /**
454
- * GitHub Pages configuration. When present, `holocron setup` calls the
455
- * Pages API using `HOLOCRON_DEPLOY_TOKEN` (requires `pages:write` + `repo` scope).
456
- * When absent, Pages is left as-is.
457
- *
458
- * @example
459
- * { build: "workflow", domain: "docs.theholocron.dev", https: true }
460
- */
461
- docs?: DocsConfig;
462
- /**
463
- * Environment variable namespace configuration.
464
- * Declares the prefix(es) this project uses for its env vars so that
465
- * tooling can generate `.env.example`, validate required vars, and
466
- * produce accurate documentation without hard-coding prefix strings.
467
- *
468
- * @example
469
- * { namespaces: ["HOLOCRON", "MY_CLI"] }
470
- */
471
- env?: EnvConfig;
472
- /**
473
- * Structured-logging config. Only the level belongs here — Axiom
474
- * credentials come from env vars, never a committed file.
475
- *
476
- * @example
477
- * { level: "debug" }
478
- */
479
- log?: LogConfig;
480
- /**
481
- * CLI self-telemetry override layer. Env var (`HOLOCRON_TELEMETRY=false`)
482
- * still wins; this is the committed way to opt a repo out or drop usage
483
- * analytics while keeping error reporting.
484
- *
485
- * @example
486
- * { enabled: false }
487
- * { analytics: "none" }
488
- */
489
- telemetry?: TelemetryConfig;
490
- }
491
- interface ResolvedTuple {
492
- provider: string;
493
- /** Resolved package name (`@theholocron/holocron-plugin-<provider>` for short refs). */
494
- packageName: string;
495
- options: ProviderOptions;
496
- }
497
- type ResolvedProviderEntry = {
498
- cardinality: "single";
499
- tuple: ResolvedTuple;
500
- } | {
501
- cardinality: "many";
502
- tuples: ResolvedTuple[];
503
- };
504
- type ResolvedProvidersConfig = Partial<Record<CapabilityKey, ResolvedProviderEntry>>;
505
- interface ResolvedHolocronConfig {
506
- name: string;
507
- description?: string;
508
- homepage?: string;
509
- org?: string;
510
- domain?: string;
511
- repo?: RepoConfig;
512
- tasks?: Array<string | TaskEntryConfig>;
513
- syncScripts?: boolean;
514
- holocronScript?: string;
515
- extraRequiredChecks?: string[];
516
- hooks?: boolean | {
517
- prePush?: boolean;
518
- };
519
- providers: ResolvedProvidersConfig;
520
- apps: AppConfig[];
521
- doctor: DoctorConfig;
522
- agent?: "claude" | "codex" | "gemini";
523
- skills?: string[];
524
- /** Resolved Pages config. `build` is guaranteed present when this field exists. */
525
- docs?: PagesConfig;
526
- env?: EnvConfig;
527
- log?: LogConfig;
528
- telemetry?: TelemetryConfig;
529
- }
530
- declare class ConfigError extends Error {
531
- name: string;
532
- }
376
+ export declare function deriveStack(pkg: PackageJsonLike | null): string[];
377
+ /** The provider capability keys actually wired in `providers: {}` — zero heuristics. */
378
+ export declare function deriveCapabilities(providers: ResolvedProvidersConfig | undefined): string[];
379
+ /** Whether a repo's capabilities include the required baseline (`source` and `ci`); `non-compliant` means drift. */
380
+ export declare function deriveCompliance(capabilities: readonly string[]): "compliant" | "non-compliant";
533
381
  /**
534
- * Resolve `"github"` → `"@theholocron/holocron-plugin-github"`.
535
- * Fully-qualified names (scoped or not) are honored verbatim, which
536
- * is how third-party plugins published outside the org work.
382
+ * The Phase B refinement `deriveCompliance()`'s own doc comment names —
383
+ * *why* a repo is non-compliant, not just that it is. `[]` when compliant.
384
+ * Same `REQUIRED_BASELINE` `deriveCompliance()` checks against — one
385
+ * table, not two independently-maintained baselines.
537
386
  */
538
- declare function resolvePluginPackage(provider: string): string;
539
- declare function resolveEntry(key: CapabilityKey, raw: RawProviderEntry): ResolvedProviderEntry;
540
- declare function resolveConfig(raw: HolocronConfig): ResolvedHolocronConfig;
541
- //#endregion
542
- //#region src/config/compose.d.ts
543
- type TaskEntry = NonNullable<HolocronConfig["tasks"]>[number];
544
- /** A single composable capability fragment. */
545
- interface Capability {
546
- /** Unique identifier — used for deduplication and dependency resolution. */
547
- id: string;
548
- /** Other capability IDs that must be present in the same compose() call. */
549
- requires?: string[];
550
- /** Task entries contributed by this capability. Merged by name; last writer wins. */
551
- tasks?: TaskEntry[];
552
- /** Provider config. Shallow-merged at the top level; later capabilities override per-key. */
553
- providers?: RawProvidersConfig;
554
- /**
555
- * Required status-check contexts **not** backed by a `required` task
556
- * (codecov gates, `Storybook Publish`, …). Unioned across all capabilities
557
- * onto the top-level `extraRequiredChecks`. Task-backed checks come from
558
- * `{ required: true }` task entries via `astromech.requiredChecks()`.
559
- */
560
- extraRequiredChecks?: string[];
561
- /** Repo config fragment. Scalar fields: last writer wins. properties/topics/teams: merged. */
562
- repo?: Partial<Omit<RepoConfig, "name">>;
563
- /** Org name. Last writer wins. */
564
- org?: string;
565
- /** Org canonical domain. Last writer wins. */
566
- domain?: string;
567
- /** Docs site config. Last writer wins. */
568
- docs?: DocsConfig;
569
- }
570
- /** The merged result of a compose() call. Spreads into defineConfig(). */
571
- interface ComposedPreset {
572
- tasks: TaskEntry[];
573
- providers: RawProvidersConfig;
574
- repo: Partial<Omit<RepoConfig, "name">>;
575
- /** Non-task required-check contexts, unioned across capabilities. */
576
- extraRequiredChecks: string[];
577
- org?: string;
578
- domain?: string;
579
- docs?: DocsConfig;
580
- }
387
+ export declare function missingCapabilities(capabilities: readonly string[]): string[];
581
388
  /**
582
- * Merge any number of capability fragments into a single preset object that
583
- * spreads directly into `defineConfig()`.
584
- *
585
- * - Accepts individual capabilities or nested arrays (for bundle presets).
586
- * - Deduplicates by `id` — when the same ID appears more than once, the last
587
- * occurrence wins. This lets callers override bundle defaults by listing an
588
- * explicit capability after the bundle.
589
- * - Validates all `requires` at call time and throws `ConfigError` if any are
590
- * unmet, listing every missing dependency in a single message.
591
- *
592
- * @example
593
- * // docs-only site — no typecheck
594
- * const preset = compose(node(), docs());
595
- *
596
- * // library with docs
597
- * const preset = compose(node(), typecheck(), docs());
598
- *
599
- * // nextjs() is a bundle that returns Capability[]
600
- * const preset = compose(node(), nextjs());
389
+ * Reads each workspace package's actual `package.json` content (not just
390
+ * `readWorkspacePackages()`'s `{ slug, name, dir }` — `deriveProfile()`'s
391
+ * `platform` detection needs `bin`, which that helper doesn't carry).
392
+ * Missing/invalid files are skipped, matching `readWorkspacePackages()`'s
393
+ * own soft-fail behavior.
601
394
  */
602
- declare function compose(...args: (Capability | Capability[])[]): ComposedPreset;
603
- //#endregion
604
- //#region src/config/define-config.d.ts
605
- declare function defineConfig(config: HolocronConfig): HolocronConfig;
606
- //#endregion
607
- //#region src/config/load-config.d.ts
608
- interface LoadedConfig {
609
- resolved: ResolvedHolocronConfig;
610
- /** Absolute path to the file the config was read from. */
611
- filepath: string;
612
- }
395
+ export declare function readWorkspacePackageJsons(repoRoot: string, workspacePackages: readonly WorkspacePackage[]): Promise<PackageJsonLike[]>;
396
+ /**
397
+ * The labels every repository gets from `repo setup`, with their GitHub colours (hex, no `#`) and descriptions. A
398
+ * plugin that makes labels of its own, such as Linear's setup, takes the colour of the one with the same name.
399
+ */
400
+ export declare const CANONICAL_LABELS: readonly [{
401
+ readonly name: "bug";
402
+ readonly color: "d73a4a";
403
+ readonly description: "Something isn't working";
404
+ }, {
405
+ readonly name: "chore";
406
+ readonly color: "ededed";
407
+ readonly description: "Maintenance, no user-facing change";
408
+ }, {
409
+ readonly name: "ci";
410
+ readonly color: "0075ca";
411
+ readonly description: "CI/CD pipeline changes";
412
+ }, {
413
+ readonly name: "dependencies";
414
+ readonly color: "0366d6";
415
+ readonly description: "Dependency update";
416
+ }, {
417
+ readonly name: "documentation";
418
+ readonly color: "0075ca";
419
+ readonly description: "Documentation only";
420
+ }, {
421
+ readonly name: "duplicate";
422
+ readonly color: "cfd3d7";
423
+ readonly description: "Already reported";
424
+ }, {
425
+ readonly name: "enhancement";
426
+ readonly color: "a2eeef";
427
+ readonly description: "New feature or request";
428
+ }, {
429
+ readonly name: "good first issue";
430
+ readonly color: "7057ff";
431
+ readonly description: "Good for newcomers";
432
+ }, {
433
+ readonly name: "help wanted";
434
+ readonly color: "008672";
435
+ readonly description: "Extra attention needed";
436
+ }, {
437
+ readonly name: "invalid";
438
+ readonly color: "e4e669";
439
+ readonly description: "Doesn't seem right";
440
+ }, {
441
+ readonly name: "performance";
442
+ readonly color: "fbca04";
443
+ readonly description: "Performance improvement";
444
+ }, {
445
+ readonly name: "question";
446
+ readonly color: "d876e3";
447
+ readonly description: "Further information requested";
448
+ }, {
449
+ readonly name: "refactor";
450
+ readonly color: "cfd3d7";
451
+ readonly description: "Code restructuring";
452
+ }, {
453
+ readonly name: "released";
454
+ readonly color: "ededed";
455
+ readonly description: "Included in a release";
456
+ }, {
457
+ readonly name: "test";
458
+ readonly color: "bfd4f2";
459
+ readonly description: "Test-related changes";
460
+ }, {
461
+ readonly name: "triage";
462
+ readonly color: "e4e669";
463
+ readonly description: "Needs investigation";
464
+ }, {
465
+ readonly name: "wontfix";
466
+ readonly color: "ffffff";
467
+ readonly description: "Won't be addressed";
468
+ }];
469
+ /**
470
+ * The closed list of area files `loadConfig` reads from `.holocron/` (the directory is `.<config name>`, set by kyber):
471
+ * `.holocron/notifications.*` fills `providers.notifications`' `layout`, `.holocron/repo.*` fills keys of `repo`, and `.holocron/org.*` fills provider options (`teamId`, `accountId`) a config leaves out.
472
+ * A file not on this list is never read.
473
+ */
474
+ export declare const HOLOCRON_AREAS: readonly ["notifications", "repo", "org"];
475
+ /**
476
+ * The areas a config in a subdirectory also reads from the repository root's `.holocron/` (SPEC-0069): only `org`,
477
+ * because its values are the organization's and every config needs them. `repo` and `notifications` describe the
478
+ * repository itself, so an app's config does not take them from the root.
479
+ */
480
+ export declare const SHARED_AREAS: readonly ["org"];
613
481
  /**
614
- * Read + parse + resolve `holocron.config.*` from the given directory.
615
- * Throws {@link ConfigFileError} when nothing is found or a file cannot
616
- * be loaded, or `ConfigError` when the config is invalid.
482
+ * Put the area files of `.holocron/` into the config as loaded, before `deriveDefaults` runs: `notifications` becomes
483
+ * 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
484
+ * is a `ConfigError` naming both (no merge, no precedence). With no area files the config is returned as it was.
617
485
  */
618
- declare function loadConfig(cwd: string): Promise<LoadedConfig>;
619
- //#endregion
620
- export { Analytics, AppConfig, Auth, AuthDescription, AuthError, AuthEvent, AuthEventType, AuthIdentity, AuthUser, CARDINALITY, Capability, CapabilityConfigPackage, CapabilityImpls, CapabilityKey, Cardinality, CardinalityFor, ChromaticProjectConfig, Ci, CiRun, CiRunFilter, CiRunStatus, ComposedPreset, ConfigError, ConfigFileError, ConnectionStringOptions, CreateAuthUserInput, Deployment, DeploymentProject, DeploymentProjectSettings, DeploymentRecord, DeploymentTarget, DeploymentTrigger, Dns, DnsRecord, DnsRecordType, DocsConfig, DoctorConfig, EnsureResult, EnvConfig, Environment, EnvironmentReviewer, Environments, Errors, FeatureResolverConfig, HolocronConfig, Issue, IssueSearchFilter, Issues, LabelDef, LifecycleResult, LifecycleSlot, LoadedConfig, LogConfig, Logs, MultiEntry, NormalizedAuthUser, Notifications, 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, WikiDnsRecord, WikiProvisionOpts, WikiProxyConfig, Workers, WorkflowWithConfig, compose, createFeatureResolver, createResolveToken, createRestClient, defineConfig, deleteToken, getToken, isMulti, listStoredProviders, loadConfig, resolveConfig, resolveEntry, resolvePluginPackage, setToken };
486
+ export declare function placeAreas(areas: ConfigDirArea[], raw: HolocronConfig): HolocronConfig;
487
+ export { AddedItem, Analytics, type AppConfig, Auth, AuthDescription, AuthError, AuthEvent, AuthEventType, AuthIdentity, AuthUser, BoardField, BoardFieldType, BoardItem, BoardItemInput, BoardRule, BoardState, BoardStatus, BoardStatusCategory, BoardSummary, BoardTemplate, BoardTemplateFile, BoardView, CARDINALITY, type Capability, type CapabilityConfigPackage, CapabilityImpls, CapabilityKey, Cardinality, CardinalityFor, type ChromaticProjectConfig, Ci, CiRun, CiRunFilter, CiRunStatus, type ComposedPreset, ConfigError, ConfigFileError, ConnectionStringOptions, CreateAuthUserInput, Credentials, type CredentialsConfig, CredentialsInspection, 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, ElevationRequiredError, EnsureDiscussionInput, EnsureRelayInput, EnsureRelayResult, EnsureReport, EnsureResult, EnsureWebhookResult, EnsuredDiscussion, EnsuredResource, EnsuredTunnel, type EnvConfig, Environment, EnvironmentReviewer, Environments, Errors, type EslintConfig, ExportInfo, type FeatureResolver, type FeatureResolverConfig, type GitHubAppConfig, type HolocronConfig, type HolocronProfile, IdeaRecord, Ideas, type IdeasConfig, ImportOptions, ImportResult, InspectRelayInput, Issue, IssueComment, IssueOrder, IssuePriority, IssueRecord, IssueSearchFilter, IssueSelector, Issues, LabelDef, LifecycleResult, LifecycleSlot, type LinksFile, type LoadedConfig, type LogConfig, Logs, LogsDataset, type MemberLink, MissingTokenError, Monitoring, MonitoringAlertChannelInput, MonitoringAlertChannelResult, MonitoringAlertChannelState, MonitoringAlertSettings, MonitoringAssertion, MonitoringAssertionComparison, MonitoringAssertionSource, MonitoringCheck, MonitoringCheckInput, MonitoringHttpMethod, MoveReport, type MultiEntry, NormalizedAuthUser, Notifications, NotificationsAccess, NotificationsApplicationLayout, NotificationsChannelLayout, NotificationsDelivery, NotificationsEveryoneLayout, NotificationsForumTag, NotificationsLayout, NotificationsLinksLayout, NotificationsMember, NotificationsMonitoringFeed, NotificationsOnboardingLayout, NotificationsPicture, NotificationsPinnedLayout, NotificationsPrsFeed, NotificationsServerLayout, NotificationsSignIn, NotificationsSignedIn, NotificationsWelcomeLayout, type OrgConfig, type PackageJsonLike, PagesConfig, ParseWebhookInput, type PluginProbes, type PluginToken, type Probe, type ProbeContext, type ProbeRow, Projects, type ProviderAction, type ProviderActionContext, type ProviderActions, ProviderApiError, ProviderIdentity, type ProviderOptions, type ProviderRow, PullRequest, REQUIRED_CAPABILITIES, type RawProviderEntry, type RawProvidersConfig, type ReadKeysLimitedInput, RelayState, type RepoConfig, type RepoProperties, type RepoProtection, RepoRef, type RepoSecrets, type RepoSecretsSync, RepoSettings, type RepoValidationConfig, type RepoVariables, type RepoVariablesSync, type RequestOptions, type ResolveTokenConfig, type ResolveTokenInput, ResolvedCapability, type ResolvedHolocronConfig, type ResolvedProviderEntry, type ResolvedProvidersConfig, type ResolvedTuple, type RestClient, type RestClientConfig, Ruleset, SecretScope, Secrets, ServerInspection, type SingleEntry, Source, SourceBranch, SourceFile, SourceRepoInfo, SourceRulesetDetail, SourceSecurity, SourceTeamMember, StatusCategory, Storage, StorageBranch, type StorybookDeployProject, SyncResult, type SyncRolesInput, type SyncRolesResult, type TaskEntry, type TaskEntryConfig, TeamEntry, TeamPermission, type TelemetryConfig, type TokenResolver, Tooling, ToolingDoctorReport, TrackerDoctorReport, TrackerUser, TunnelRoute, Tunnels, Vault, type VerifyTokenFailure, type VerifyTokenResult, type VerifyTokenSuccess, WebhookDashboardInfo, WebhookVerificationError, Wiki, WikiProvisionOpts, WikiProxyConfig, WorkerScriptState, Workers, type WorkflowWithConfig, compose, createRestClient, credentialsEnvironment, defineConfig, isMulti, loadConfig, resolveConfig, resolveEntry, resolvePluginPackage, resolveValue };