@theholocron/cli 5.0.0-alpha.5 → 5.0.0-alpha.500
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/README.md +660 -106
- package/dist/cli.mjs +31745 -7664
- package/dist/cli.mjs.map +1 -1
- package/dist/config-system-BqX0yRVh.mjs +839 -0
- package/dist/index-YQmgeAuP.d.mts +4980 -0
- package/dist/index.d.mts +710 -564
- package/dist/index.mjs +1108 -322
- package/dist/plugin/capabilities.d.mts +2 -741
- package/dist/plugin/capabilities.mjs +59 -4
- package/dist/presets.d.mts +224 -0
- package/dist/presets.mjs +441 -0
- package/package.json +49 -36
package/dist/index.d.mts
CHANGED
|
@@ -1,620 +1,766 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { AuthError,
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { $ as CoverageUploadInput, $i as RepoVariablesSync, $n as RelayState, $r as Workers, $t as Issues, A as Cache, Ai as DevConfig, An as NotificationsChannelLayout, Ar as ToolingOpenWant, At as EnsuredTunnel, B as ConnectionStringOptions, Bi as MultiEntry, Bn as NotificationsPinnedLayout, Br as Vault, Bt as IdeaRecord, C as BoardState, Ci as resolvePluginPackage, Cn as MonitoringStatusPageResult, Cr as ToolingDoctorReport, Ct as EnsureRelayInput, D as BoardTemplate, Di as CapabilityConfigPackage, Dn as Notifications, Dr as ToolingOpenInput, Dt as EnsureWebhookResult, E as BoardSummary, Ei as AppConfig, En as NormalizedAuthUser, Er as ToolingExportResult, Et as EnsureResult, F as CardinalityFor, Fi as EslintConfig, Fn as NotificationsLinksLayout, Fr as ToolingWorkspaceState, Ft as Errors, G as CoverageExpectations, Gi as RepoConfig, Gn as NotificationsSignedIn, Gr as WikiNavigationState, Gt as InspectRelayInput, H as CoverageConfigComponent, Hi as ProviderOptions, Hn as NotificationsReaction, Hr as Wiki, Ht as ImportOptions, I as Ci, Ii as GitHubAppConfig, In as NotificationsMember, Ir as TrackerDoctorReport, It as ErrorsInspection, J as CoverageStatusContext, Ji as RepoSecrets, Jn as PagesConfig, Jr as WikiProvisionOpts, Jt as IssueOrder, K as CoverageNameDiff, Ki as RepoProperties, Kn as NotificationsWelcomeLayout, Kr as WikiOrganizationState, Kt as Issue, L as CiRun, Li as HolocronConfig, Ln as NotificationsMonitoringFeed, Lr as TrackerUser, Lt as ErrorsOrgState, M as CapabilityImpls, Mi as DocsConfig, Mn as NotificationsEveryoneLayout, Mr as ToolingWorkspaceInput, Mt as EnvironmentEntry, N as CapabilityKey, Ni as DoctorConfig, Nn as NotificationsForumTag, Nr as ToolingWorkspaceResult, Nt as EnvironmentReviewer, O as BoardTemplateFile, Oi as ChromaticProjectConfig, On as NotificationsAccess, Or as ToolingOpenLaunch, Ot as EnsuredDiscussion, P as Cardinality, Pi as EnvConfig, Pn as NotificationsLayout, Pr as ToolingWorkspaceSide, Pt as Environments, Q as CoverageUploadGroup, Qi as RepoVariables, Qn as PullRequest, Qr as WorkerScriptState, Qt as IssueSelector, R as CiRunFilter, Ri as IdeasConfig, Rn as NotificationsOnboardingLayout, Rr as TunnelRoute, Rt as ErrorsProjectState, S as BoardRule, Si as resolveEntry, Sn as MonitoringStatusPageInput, Sr as Tooling, St as EnsureDiscussionInput, T as BoardStatusCategory, Ti as AgentOptions, Tn as MoveReport, Tr as ToolingExportIssue, Tt as EnsureReport, U as CoverageConfigDocumentation, Ui as RawProviderEntry, Un as NotificationsServerLayout, Ur as WikiInspection, Ut as ImportResult, V as Coverage, Vi as OrgConfig, Vn as NotificationsPrsFeed, Vr as WebhookDashboardInfo, Vt as Ideas, W as CoverageConfigInput, Wi as RawProvidersConfig, Wn as NotificationsSignIn, Wr as WikiInstanceState, Wt as InspectErrorsInput, X as CoverageTokenCheck, Xi as RepoSecretsSync, Xn as Projects, Xr as WikiPublishedState, Xt as IssueRecord, Y as CoverageStatusInput, Yi as RepoSecretsDeploy, Yn as ParseWebhookInput, Yr as WikiProxyConfig, Yt as IssuePriority, Z as CoverageUploadFlagResult, Zi as RepoValidationConfig, Zn as ProviderIdentity, Zr as WorkerDeploymentState, Zt as IssueSearchFilter, _ as BoardFieldType, _i as ComposedPreset, _n as MonitoringHeartbeatInput, _r as Storage, _t as DnsRecord, a as REQUIRED_CAPABILITIES, aa as StorybookDeployProject, ai as missingCapabilities, an as Monitoring, ar as SecretScope, at as DeployFunctionResult, b as BoardPullRequest, bi as credentialsEnvironment, bn as MonitoringHttpMethod, br as TeamEntry, bt as DuplicateDiscussion, c as AddedItem, ca as WorkflowWithConfig, ci as HolocronProfile, cn as MonitoringAlertChannelState, cr as ServerInspection, ct as Deployment, d as AuthDescription, di as ConfigFileError, dn as MonitoringAssertionComparison, dr as SourceFile, dt as DeploymentRecord, ea as ResolvedHolocronConfig, ei as KNOWN_STACK_DEPS, en as LabelDef, er as RepoRef, et as CoverageUploadResult, f as AuthEvent, fi as compose, fn as MonitoringAssertionSource, fr as SourceRepoInfo, ft as DeploymentTarget, g as BoardField, gi as Capability, gn as MonitoringDashboardState, gr as StatusCategory, gt as Dns, h as AuthUser, hi as LoadedConfig, hn as MonitoringDashboardInput, hr as SourceTeamMember, ht as DiscussionPost, i as ProviderApiError, ia as SingleEntry, ii as deriveStack, in as LogsDataset, ir as SecretAccess, it as DeployFunctionConfig, j as CacheTokenCheck, ji as DevServeConfig, jn as NotificationsDelivery, jr as ToolingWorkspaceFile, jt as Environment, k as BoardView, ki as CredentialsConfig, kn as NotificationsApplicationLayout, kr as ToolingOpenPlan, kt as EnsuredResource, l as Analytics, la as EnvironmentLayer, li as PackageJsonLike, ln as MonitoringAlertSettings, lr as Source, lt as DeploymentProject, m as AuthIdentity, mi as loadConfig, mn as MonitoringCheckInput, mr as SourceSecurity, mt as DiscussionPatch, n as ElevationRequiredError, na as ResolvedProvidersConfig, ni as deriveCompliance, nn as LifecycleSlot, nr as ResolvedCapability, nt as Credentials, o as WebhookVerificationError, oa as TaskEntryConfig, oi as readWorkspacePackageJsons, on as MonitoringAlertChannelInput, or as SecretVisibility, ot as DeployScriptConfig, p as AuthEventType, pi as defineConfig, pn as MonitoringCheck, pr as SourceRulesetDetail, pt as DeploymentTrigger, q as CoverageRepoReport, qi as RepoProtection, qn as OrganizationSecretScope, qr as WikiProbe, qt as IssueComment, r as MissingTokenError, ra as ResolvedTuple, ri as deriveProfile, rn as Logs, rr as Ruleset, rt as CredentialsInspection, s as isMulti, sa as TelemetryConfig, si as DeriveProfileInput, sn as MonitoringAlertChannelResult, sr as Secrets, st as DeployScriptResult, t as CARDINALITY, ta as ResolvedProviderEntry, ti as deriveCapabilities, tn as LifecycleResult, tr as RepoSettings, tt as CreateAuthUserInput, u as Auth, ui as StackName, un as MonitoringAssertion, ur as SourceBranch, ut as DeploymentProjectSettings, v as BoardItem, vi as TaskEntry, vn as MonitoringHeartbeatResult, vr as StorageBranch, vt as DnsRecordRequest, w as BoardStatus, wi as AgentName, wn as MonitoringStatusPageState, wr as ToolingExportInput, wt as EnsureRelayResult, x as BoardPullRequestChecks, xi as resolveConfig, xn as MonitoringStatusComponentInput, xr as TeamPermission, xt as EmojiCheck, y as BoardItemInput, yi as ConfigError, yn as MonitoringHeartbeatUnit, yr as SyncResult, yt as DnsRecordType, z as CiRunStatus, zi as LogConfig, zn as NotificationsPicture, zr as Tunnels, zt as ExportInfo } from "./index-YQmgeAuP.mjs";
|
|
2
|
+
import { AuthError, ResolveTokenConfig as ResolveTokenConfig$1, ResolveTokenInput, ResolveTokenInput as ResolveTokenInput$1, resolveValue } from "@theholocron/kyber/secrets";
|
|
3
|
+
import { DocsCoverageMode } from "@theholocron/astromech";
|
|
4
|
+
import { CheckRow } from "@theholocron/kyber/ui";
|
|
5
|
+
import "@theholocron/env-utils/lookup";
|
|
6
|
+
import { RequestOptions, RestClient, RestClientConfig, createRestClient } from "@theholocron/http-client";
|
|
7
|
+
import "@theholocron/kyber/plugins";
|
|
8
|
+
import { GitExec } from "@theholocron/git-utils";
|
|
9
|
+
import { ConnectionProbeInput as ConnectionProbeInput$1 } from "@theholocron/kyber/checks";
|
|
10
|
+
import { Stats } from "node:fs";
|
|
11
|
+
import "@theholocron/observability/core";
|
|
12
|
+
import { ConfigDirArea } from "@theholocron/datapad";
|
|
13
|
+
/** A plugin's `verifyToken` result when the provider accepted the token. */
|
|
14
|
+
interface VerifyTokenSuccess {
|
|
15
|
+
/** Always `true` for an accepted token. */
|
|
16
|
+
ok: true;
|
|
17
|
+
/** "workplace: acme" / "user: cnewton@x" — surfaced in success output. */
|
|
18
|
+
subject: string;
|
|
19
|
+
/** When the token stops working, ISO 8601 in UTC, for a provider that reports it. Absent when unknown or never. */
|
|
20
|
+
expiresAt?: string;
|
|
21
|
+
}
|
|
22
|
+
/** A plugin's `verifyToken` result when the provider rejected the token. */
|
|
23
|
+
interface VerifyTokenFailure {
|
|
24
|
+
/** Always `false` for a rejected token. */
|
|
25
|
+
ok: false;
|
|
26
|
+
/** Reason the token was rejected. Surfaces to the operator. */
|
|
27
|
+
message: string;
|
|
28
|
+
}
|
|
29
|
+
/** What a plugin's `verifyToken` returns: the token was accepted, or it was rejected with a reason. */
|
|
30
|
+
type VerifyTokenResult = VerifyTokenSuccess | VerifyTokenFailure;
|
|
31
|
+
/** What a layer's token must do about a permission: `required` it must have it, `absent` it must not. */
|
|
32
|
+
type PermissionRule = "required" | "absent";
|
|
33
|
+
/**
|
|
34
|
+
* When a token is due for rotation (#2157). `maxAgeDays` is the longest a token may go unrotated; `warnDays` is how
|
|
35
|
+
* many days before an expiry the check starts to fail. Both default to `DEFAULT_TOKEN_ROTATION`.
|
|
36
|
+
*/
|
|
37
|
+
interface TokenRotation {
|
|
38
|
+
/** The most days old a token may be, counted from when the provider says it was made (or became valid). */
|
|
39
|
+
maxAgeDays?: number;
|
|
40
|
+
/** Fail this many days before the token's own expiry, so it is rotated before it stops working. */
|
|
41
|
+
warnDays?: number;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* What a token must carry, declared once next to the plugin's `tokens` list. The permission names are the plugin's own
|
|
45
|
+
* (Cloudflare: `pages`, `dns`); a layer's rules say which are `required` and which `absent`, so a laptop token might
|
|
46
|
+
* need everything while `ci` needs one permission and must have none of the rest.
|
|
47
|
+
*/
|
|
48
|
+
interface TokenExpectation {
|
|
49
|
+
/**
|
|
50
|
+
* The layers that hold this token, for a token with no permission rules (a rotation-only check). Default: the layers
|
|
51
|
+
* `permissions` names. A layer in neither has no declared expectations.
|
|
52
|
+
*/
|
|
53
|
+
layers?: readonly EnvironmentLayer[];
|
|
54
|
+
/** Per layer, each permission's rule. A layer named here holds the token. */
|
|
55
|
+
permissions?: Readonly<Partial<Record<EnvironmentLayer, Readonly<Record<string, PermissionRule>>>>>;
|
|
56
|
+
/** When the token is due for rotation, in every layer that holds it. Default: `DEFAULT_TOKEN_ROTATION`. */
|
|
57
|
+
rotation?: TokenRotation;
|
|
58
|
+
}
|
|
59
|
+
/** One token a plugin takes, and where it is looked up. */
|
|
60
|
+
interface PluginToken {
|
|
61
|
+
/** The plugin's own environment variable, e.g. `HOLOCRON_ADMIN_TOKEN`. */
|
|
62
|
+
envName: string;
|
|
63
|
+
/** The vendor's own environment variable, e.g. `CLOUDFLARE_API_TOKEN`; read after `envName` and before the keyring. */
|
|
64
|
+
vendorEnvName?: string;
|
|
65
|
+
/** The OS keyring entry, e.g. `github.admin`. */
|
|
66
|
+
keyringKey: string;
|
|
67
|
+
/**
|
|
68
|
+
* `false` when the plugin's `verifyToken` does not apply to this token (it checks a different credential, such as
|
|
69
|
+
* a webhook URL), so `holocron doctor secrets --verify` reports it as set without calling the plugin. Default `true`.
|
|
70
|
+
*/
|
|
71
|
+
verifiable?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* How to check this token when the plugin's one `verifyToken` is for a different credential (the Discord bot token,
|
|
74
|
+
* where `verifyToken` checks a webhook). Wins over the plugin's `verifyToken`.
|
|
75
|
+
*/
|
|
76
|
+
verify?: (token: string) => Promise<VerifyTokenResult>;
|
|
77
|
+
/**
|
|
78
|
+
* `true` when the plugin only falls back to this token: nothing needs it unless a call names no better source (the
|
|
79
|
+
* Discord webhook a post uses when it names no channel). The checks that expect every token a plugin lists, such as
|
|
80
|
+
* `holocron doctor secrets`, do not expect it, and `holocron export tokens` marks it as optional when it has none.
|
|
81
|
+
* Default `false`.
|
|
82
|
+
*/
|
|
83
|
+
optional?: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Which layers hold this token and what it must and must not be able to do in each (#2149). One declaration that the
|
|
86
|
+
* token probes, the doctor and the docs check read through `tokenExpectations()`; see `TokenExpectation`.
|
|
87
|
+
*/
|
|
88
|
+
expect?: TokenExpectation;
|
|
89
|
+
}
|
|
90
|
+
/** Options for a token resolver, without the keyring lookup, which the CLI supplies itself. */
|
|
91
|
+
type ResolveTokenConfig = Omit<ResolveTokenConfig$1, "keyring" | "orgEnvName">;
|
|
92
|
+
/** Settings for a feature-specific token resolver: which env var and keyring entry it reads. */
|
|
10
93
|
interface FeatureResolverConfig {
|
|
11
94
|
/** Env var name for this feature, e.g. `"HOLOCRON_ISSUES_TOKEN"`. */
|
|
12
95
|
envName: string;
|
|
13
96
|
/** Keyring account key, e.g. `"github.issues"`. */
|
|
14
97
|
keyringKey: string;
|
|
98
|
+
/** The vendor named in the "no token" message. Default `GitHub`. */
|
|
99
|
+
vendor?: string;
|
|
15
100
|
}
|
|
101
|
+
/** A resolver from `createFeatureResolver`: call it for the token, or read `token` to see where it looks. */
|
|
102
|
+
type FeatureResolver = ((input?: ResolveTokenInput$1) => string) & {
|
|
103
|
+
/** The environment variable and keyring entry this resolver reads, for `holocron doctor secrets --verify`. */
|
|
104
|
+
readonly token: PluginToken;
|
|
105
|
+
};
|
|
106
|
+
/** A resolver from `createResolveToken`: call it for the token, or read `token` to see where it looks. */
|
|
107
|
+
type TokenResolver = ((input?: ResolveTokenInput$1) => string) & {
|
|
108
|
+
/** The environment variables and keyring entry this resolver reads, for `holocron doctor secrets --verify`. */
|
|
109
|
+
readonly token: PluginToken;
|
|
110
|
+
};
|
|
16
111
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
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.
|
|
112
|
+
* The holocron keyring: `get` answers `null` for "not stored" and for "keyring unavailable" alike, so callers fall
|
|
113
|
+
* through to env-var precedence, and remembers the answer for the process (`clearCache` forgets it); `set` and `delete`
|
|
114
|
+
* answer whether they did anything; `list` names the stored providers; `isAvailable` tells an outage from an empty keyring.
|
|
22
115
|
*/
|
|
23
|
-
declare
|
|
24
|
-
//#endregion
|
|
25
|
-
//#region src/auth/keyring.d.ts
|
|
116
|
+
export declare const keyring: import("@theholocron/kyber/secrets").Keyring;
|
|
26
117
|
/**
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
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.
|
|
118
|
+
* Kyber's `createResolveToken` with the keyring, the `HOLOCRON_ORG` variable and the `token` description
|
|
119
|
+
* `holocron doctor secrets --verify` reads filled in, so a plugin stays at a one-liner call site. The chain is the flag, the
|
|
120
|
+
* plugin's variable, the vendor's variable, the `credentials` providers' variables, the keyring.
|
|
43
121
|
*/
|
|
122
|
+
export declare function createResolveToken(config: ResolveTokenConfig): TokenResolver;
|
|
44
123
|
/**
|
|
45
|
-
*
|
|
46
|
-
*
|
|
124
|
+
* Kyber's `createFeatureResolver` for a strict, single-feature token: the flag, the feature's variable, the
|
|
125
|
+
* `credentials` providers' variable of that name, the keyring. No broad-token fallback; if the feature's token is absent
|
|
126
|
+
* the operation fails with a message naming the exact variable to set and `holocron new token`.
|
|
47
127
|
*/
|
|
48
|
-
declare function
|
|
128
|
+
export declare function createFeatureResolver(config: FeatureResolverConfig): FeatureResolver;
|
|
49
129
|
/**
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
130
|
+
* The flags and components `holocron sync` writes to `codecov.yml` for the workspace at `repoRoot`: the same
|
|
131
|
+
* functions the generator uses, so a coverage provider's `checkRepo()` compares with exactly what is written. A flag per
|
|
132
|
+
* package (none for `docs`), plus `documentation` when `docsCoverage` is `warn` or `required`; a component per package.
|
|
133
|
+
* Both lists are sorted. Plugins call this instead of importing the task runner.
|
|
53
134
|
*/
|
|
54
|
-
declare function
|
|
135
|
+
export declare function coverageExpectations(repoRoot: string, docsCoverage?: DocsCoverageMode): CoverageExpectations;
|
|
55
136
|
/**
|
|
56
|
-
*
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
* command output makes the situation clear either way.
|
|
137
|
+
* Puts issue keys in creation order without asking the tracker: issue numbers (`#12`, `ENG-12`) rise with creation inside
|
|
138
|
+
* one repository or team, so the trailing number is the order. `oldest` is ascending, `newest` descending; keys with the
|
|
139
|
+
* same number keep their place. A key with no trailing number is an error, because nothing can be said of its age.
|
|
60
140
|
*/
|
|
61
|
-
declare function
|
|
141
|
+
export declare function orderKeys(keys: readonly string[], order: IssueOrder): string[];
|
|
62
142
|
/**
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
143
|
+
* Keeps the first or last `limit` of a listing by creation time, returned oldest first. `createdAt` reads an item's
|
|
144
|
+
* ISO timestamp; items created in the same instant keep their listed order. The cut happens on what the listing already
|
|
145
|
+
* holds, so no request is spent on an item that is dropped.
|
|
66
146
|
*/
|
|
67
|
-
declare function
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
/**
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
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
|
-
};
|
|
147
|
+
export declare function pickByCreation<T>(items: readonly T[], createdAt: (item: T) => string, order: IssueOrder, limit: number): T[];
|
|
148
|
+
/** What {@link readKeysLimited} needs. */
|
|
149
|
+
interface ReadKeysLimitedInput<T> {
|
|
150
|
+
/** The issue keys to choose from. */
|
|
151
|
+
keys: readonly string[];
|
|
152
|
+
/** Which end of the creation order to take first. */
|
|
153
|
+
order: IssueOrder;
|
|
154
|
+
/** How many items to keep. */
|
|
155
|
+
limit: number;
|
|
156
|
+
/** The most issues fetched at once. */
|
|
157
|
+
concurrency: number;
|
|
158
|
+
/** Fetches one issue by key. */
|
|
159
|
+
fetch: (key: string) => Promise<T>;
|
|
160
|
+
/** Whether a fetched issue counts against the limit; false skips it without using the budget. */
|
|
161
|
+
keep: (item: T) => boolean;
|
|
89
162
|
}
|
|
90
163
|
/**
|
|
91
|
-
*
|
|
92
|
-
*
|
|
93
|
-
*
|
|
164
|
+
* Reads an explicit list of issues in creation order until `limit` of them are kept. The keys are sorted by number first
|
|
165
|
+
* (see {@link orderKeys}), then fetched in small steps of at most `concurrency`, each step no bigger than the places
|
|
166
|
+
* still open, so an issue that is later skipped (a pull request, a closed one) is replaced by the next key and nothing
|
|
167
|
+
* beyond the budget is fetched unless a skip made room. Within a step the fetches run together; the results keep the key
|
|
168
|
+
* order. The kept items come back oldest first, whichever end was chosen.
|
|
169
|
+
*/
|
|
170
|
+
export declare function readKeysLimited<T>(input: ReadKeysLimitedInput<T>): Promise<T[]>;
|
|
171
|
+
/**
|
|
172
|
+
* Calls a provider's optional `onProgress` hook with how many items are done of how many. A hook that throws is
|
|
173
|
+
* ignored, because a progress counter must never change or stop the read or write it reports on.
|
|
94
174
|
*
|
|
95
|
-
*
|
|
96
|
-
*
|
|
175
|
+
* @param onProgress - The hook from `ExportInfo` or `ImportOptions`; nothing happens when it is not given.
|
|
176
|
+
* @param done - How many items are finished.
|
|
177
|
+
* @param total - How many items there are.
|
|
97
178
|
*/
|
|
98
|
-
|
|
179
|
+
export declare function reportProgress(onProgress: ((done: number, total: number) => void) | undefined, done: number, total: number): void;
|
|
180
|
+
/** One line a probe reports: `info` for a fact, `ok` / `fail` for a result, `heading` to title the rows that follow. */
|
|
181
|
+
interface ProbeRow {
|
|
182
|
+
/** `ok` or `fail` for a result, `info` for a fact, `heading` to title the rows that follow. */
|
|
183
|
+
status: "ok" | "fail" | "info" | "heading";
|
|
184
|
+
/** The row's short title. */
|
|
185
|
+
label: string;
|
|
186
|
+
/** Further detail, when there is some. */
|
|
187
|
+
detail?: string;
|
|
188
|
+
}
|
|
189
|
+
/** What a probe is handed. Everything it prints or changes goes through this, so the runner can enforce the rules. */
|
|
190
|
+
interface ProbeContext {
|
|
191
|
+
/** What the person typed after the probe name (`probe deps who vitest` hands `["vitest"]`). */
|
|
192
|
+
args?: readonly string[];
|
|
193
|
+
/**
|
|
194
|
+
* `--lcov <path>`: where a probe that measures coverage also writes an lcov report, on top of the rows it prints.
|
|
195
|
+
* Relative to the repo root. Unset when the flag was not given.
|
|
196
|
+
*/
|
|
197
|
+
lcov?: string;
|
|
198
|
+
/** `--dry-run`: `write` calls are announced and skipped. */
|
|
199
|
+
dryRun: boolean;
|
|
200
|
+
/** Report one line. The text is scrubbed of secrets before it is printed. */
|
|
201
|
+
say(row: ProbeRow): void;
|
|
202
|
+
/**
|
|
203
|
+
* Change something on the provider. The only way to: on `--dry-run` it prints `would <label>` and does not call `fn`,
|
|
204
|
+
* and a probe that did not declare `writes: true` cannot call it.
|
|
205
|
+
*/
|
|
206
|
+
write<T>(label: string, fn: () => Promise<T>): Promise<T | undefined>;
|
|
207
|
+
/** Register how to undo something this probe made. Runs in reverse order on success, failure and Ctrl-C. */
|
|
208
|
+
cleanup(label: string, fn: () => Promise<void>): void;
|
|
209
|
+
/** Mark a value (a token, a signing secret) as one that must never be printed. */
|
|
210
|
+
secret(value: string | undefined): void;
|
|
211
|
+
}
|
|
212
|
+
/** A named, on-demand poke at a live provider. */
|
|
213
|
+
interface Probe {
|
|
214
|
+
/** One sentence for `holocron probe`'s listing. */
|
|
215
|
+
summary: string;
|
|
216
|
+
/** Whether it creates or changes anything on the provider. Asked about first, and needs `--yes` without a terminal. */
|
|
217
|
+
writes: boolean;
|
|
99
218
|
/**
|
|
100
|
-
*
|
|
101
|
-
*
|
|
219
|
+
* Where the probe's rows go. Unset, stdout. A probe whose own output is the data on stdout (a `NAME=value` stream
|
|
220
|
+
* for a pipe) sets `stderr`, so the rows never mix with it.
|
|
102
221
|
*/
|
|
103
|
-
|
|
222
|
+
reportsTo?: "stderr";
|
|
104
223
|
/**
|
|
105
|
-
*
|
|
106
|
-
*
|
|
224
|
+
* Whether the probe is about a token, so `holocron probe` may point it at a different one: `--token <provider>=<value>`,
|
|
225
|
+
* `--environment <layer or name>` (the provider's token from that vault Environment), or, on a terminal with neither,
|
|
226
|
+
* a question that asks which. Unset, the probe uses the token the provider normally resolves.
|
|
107
227
|
*/
|
|
108
|
-
|
|
228
|
+
acceptsToken?: boolean;
|
|
229
|
+
/** Runs the probe, reporting and changing things only through `ctx`. */
|
|
230
|
+
run(ctx: ProbeContext): Promise<void>;
|
|
109
231
|
}
|
|
110
|
-
|
|
232
|
+
/** A plugin's probes by name (kebab-case), as returned from `createPlugin` next to `capabilities`. */
|
|
233
|
+
type PluginProbes = Record<string, Probe>;
|
|
111
234
|
/**
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
* import type { CapabilityConfigPackage } from '@theholocron/cli'
|
|
119
|
-
* export default {
|
|
120
|
-
* provider: '1password',
|
|
121
|
-
* options: { vault: 'acme-app' },
|
|
122
|
-
* } satisfies CapabilityConfigPackage
|
|
123
|
-
*/
|
|
124
|
-
interface CapabilityConfigPackage {
|
|
125
|
-
provider: string;
|
|
126
|
-
options?: ProviderOptions;
|
|
127
|
-
}
|
|
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
|
-
/**
|
|
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.
|
|
137
|
-
*/
|
|
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;
|
|
154
|
-
}
|
|
155
|
-
interface RepoProperties {
|
|
156
|
-
lifecycle?: "active" | "experimental" | "deprecated";
|
|
157
|
-
open_source?: boolean;
|
|
158
|
-
runtime_environment?: "node" | "browser" | "universal" | "none";
|
|
159
|
-
uses_external_packages?: boolean;
|
|
160
|
-
}
|
|
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;
|
|
235
|
+
* One step of a provider's `setup` or `doctor`, in the shape the shared renderer prints (`printCheckRows`): an id, a
|
|
236
|
+
* title, `ok` / `fail` / `skip`, one line of detail and, for a failure, a line per problem.
|
|
237
|
+
*/
|
|
238
|
+
type ProviderRow = CheckRow;
|
|
239
|
+
/** What a provider's `setup` and `doctor` are handed. */
|
|
240
|
+
interface ProviderActionContext {
|
|
172
241
|
/**
|
|
173
|
-
*
|
|
174
|
-
*
|
|
175
|
-
* String shorthand defaults to `push` (Write).
|
|
242
|
+
* `--dry-run`: `setup` reports what it would change as `ok` rows and changes nothing. `doctor` never changes
|
|
243
|
+
* anything, so it ignores this.
|
|
176
244
|
*/
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
245
|
+
dryRun: boolean;
|
|
246
|
+
}
|
|
247
|
+
/**
|
|
248
|
+
* Something only one provider has (a Linear team's automation, a Discord server's roles) and no provider-neutral
|
|
249
|
+
* command can express. It reports one row per step and does not stop at the first failure: a step that fails is a
|
|
250
|
+
* `fail` row and the next step still runs. It never prints a token.
|
|
251
|
+
*/
|
|
252
|
+
type ProviderAction = (ctx: ProviderActionContext) => Promise<ProviderRow[]>;
|
|
253
|
+
/** A provider's `setup` and `doctor`, as `holocron provider <name> setup|doctor` finds them. */
|
|
254
|
+
interface ProviderActions {
|
|
255
|
+
/** Makes what the provider's own config block declares. Optional. */
|
|
256
|
+
setup?: ProviderAction;
|
|
257
|
+
/** Compares what the provider's own config block declares with what exists, read-only. Optional. */
|
|
258
|
+
doctor?: ProviderAction;
|
|
259
|
+
}
|
|
260
|
+
/** What a connection probe needs to check a provider's host and token: kyber's input, with the plugin's `verifyToken` as `verify`. */
|
|
261
|
+
export interface ConnectionProbeInput extends Omit<ConnectionProbeInput$1, "verify"> {
|
|
262
|
+
/** The plugin's `verifyToken`: asks the provider who the token belongs to. */
|
|
263
|
+
verify: (token: string) => Promise<VerifyTokenResult>;
|
|
182
264
|
}
|
|
183
|
-
|
|
265
|
+
/**
|
|
266
|
+
* The `connection` probe every provider offers, for telling a network problem from a credential problem. The checks are
|
|
267
|
+
* kyber's `connectionProbe`; this types the result as the plugin system's {@link Probe} and `verify` as `VerifyTokenResult`.
|
|
268
|
+
*/
|
|
269
|
+
export declare function connectionProbe(input: ConnectionProbeInput): Probe;
|
|
270
|
+
/**
|
|
271
|
+
* The first server emoji a layout gives two different pictures, or undefined. One name is one emoji, so it can be made
|
|
272
|
+
* from one file only; the same file written twice is fine.
|
|
273
|
+
*/
|
|
274
|
+
export declare function emojiConflictProblem(layout: NotificationsLayout): string | undefined;
|
|
275
|
+
/** One server emoji a layout's reactions name. */
|
|
276
|
+
interface LayoutEmoji {
|
|
277
|
+
/** The emoji's name, without colons. */
|
|
184
278
|
name: string;
|
|
185
|
-
|
|
186
|
-
|
|
279
|
+
/** The file in the repo it is made from when the server has none, as the layout wrote it. */
|
|
280
|
+
image?: string;
|
|
187
281
|
}
|
|
188
|
-
|
|
189
|
-
|
|
282
|
+
/**
|
|
283
|
+
* The server emoji a layout's forum reactions name (default and starter) and its `emojis` list, once each, in the order the layout first
|
|
284
|
+
* names them. A name that is given an `image` anywhere keeps it, so the picture can sit on any one of its uses.
|
|
285
|
+
*/
|
|
286
|
+
export declare function layoutEmojis(layout: NotificationsLayout | undefined): LayoutEmoji[];
|
|
287
|
+
/**
|
|
288
|
+
* Every reaction a layout writes that can name a server emoji: each forum's default and starter reactions and its tags'
|
|
289
|
+
* `emoji` (a tag's is a string, Unicode or `:name:`), then the layout's own `emojis` (server emoji made with no reaction
|
|
290
|
+
* naming them), in that order.
|
|
291
|
+
*/
|
|
292
|
+
export declare function layoutReactions(layout: NotificationsLayout | undefined): NotificationsReaction[];
|
|
293
|
+
/** Discord's limit for an emoji file ("256 KiB", its Emoji resource docs). */
|
|
294
|
+
export declare const MAX_EMOJI_BYTES: number;
|
|
295
|
+
/**
|
|
296
|
+
* 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
|
|
297
|
+
* first bytes, not the name, and a file Discord would refuse (larger than 256 KiB, or not a JPEG, PNG, GIF, WebP or
|
|
298
|
+
* AVIF image) is refused here, before anything is written. `read` is injected by tests.
|
|
299
|
+
*/
|
|
300
|
+
export declare function loadEmojiImage(source: string, baseDir?: string, read?: (path: string) => Promise<Uint8Array>): Promise<string>;
|
|
301
|
+
/** A Unicode emoji, kept as written. */
|
|
302
|
+
interface UnicodeReaction {
|
|
303
|
+
/** Tells it from a server emoji. */
|
|
304
|
+
kind: "unicode";
|
|
305
|
+
/** The emoji character, as written. */
|
|
306
|
+
value: string;
|
|
190
307
|
}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
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[];
|
|
308
|
+
/** One of the server's own emoji, by name. */
|
|
309
|
+
interface CustomReaction {
|
|
310
|
+
/** Tells it from a Unicode emoji. */
|
|
311
|
+
kind: "custom";
|
|
312
|
+
/** The emoji's name, without colons. */
|
|
313
|
+
name: string;
|
|
314
|
+
/** The file in the repo `setup` makes the emoji from when the server has none. */
|
|
315
|
+
image?: string;
|
|
206
316
|
}
|
|
317
|
+
/** A layout reaction after reading. */
|
|
318
|
+
type ParsedReaction = UnicodeReaction | CustomReaction;
|
|
319
|
+
/** A server emoji written as Discord shows it: `:name:`, the name 2 to 32 letters, digits and underscores. */
|
|
320
|
+
export declare const CUSTOM_EMOJI: RegExp;
|
|
207
321
|
/**
|
|
208
|
-
*
|
|
209
|
-
*
|
|
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/
|
|
322
|
+
* Reads a layout reaction. `":git_merge:"` (or `{ emoji: ":git_merge:", image }`) is a server emoji named `git_merge`;
|
|
323
|
+
* any other string is a Unicode emoji and kept as written. It does not judge a value: `reactionProblem()` does, before
|
|
324
|
+
* anything is applied, so an invalid `emoji` here is kept as the name it was given.
|
|
215
325
|
*/
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
/**
|
|
252
|
-
|
|
253
|
-
* Useful during initial setup before baselines are approved.
|
|
254
|
-
* Corresponds to `--exit-zero-on-changes`.
|
|
255
|
-
*/
|
|
256
|
-
exitZeroOnChanges?: boolean;
|
|
326
|
+
export declare function parseReaction(reaction: NotificationsReaction): ParsedReaction;
|
|
327
|
+
/** The folder a layout's emoji pictures live in, as the webhook avatar's files do. */
|
|
328
|
+
export declare const EMOJI_MEDIA_DIR = ".holocron/media/";
|
|
329
|
+
/**
|
|
330
|
+
* The first reason a reaction cannot work, or undefined; `noun` names it in the message (`` `defaultReaction` ``, "a
|
|
331
|
+
* starter reaction"). A Unicode emoji must be a character, not a word (`git_merge` without colons would be sent to
|
|
332
|
+
* Discord as text), a server emoji `:name:` with a name Discord allows, and an `image` a file under `.holocron/media/`
|
|
333
|
+
* (a path, not a URL, with no `..` out of it). A `null` a config wrote is refused, not read as absent.
|
|
334
|
+
*/
|
|
335
|
+
export declare function reactionProblem(noun: string, reaction: NotificationsReaction | null): string | undefined;
|
|
336
|
+
/** How a reaction is written in a layout and shown in a row: `:name:` for a server emoji, the character otherwise. */
|
|
337
|
+
export declare function reactionSpelling(reaction: NotificationsReaction): string;
|
|
338
|
+
/**
|
|
339
|
+
* The first reason a forum tag's `emoji` cannot work, or undefined. A string with no colon at either end is a Unicode
|
|
340
|
+
* 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
|
|
341
|
+
* must be `:name:` (2 to 32 letters, digits and underscores), and the layout must give that emoji a picture somewhere
|
|
342
|
+
* (`pictured`: the names an `image` is declared for, from `layoutEmojis()`), because a tag's `emoji` is only a name and
|
|
343
|
+
* `setup` makes the emoji before any channel.
|
|
344
|
+
*/
|
|
345
|
+
export declare function tagEmojiProblem(tagName: string, emoji: string | undefined, pictured: ReadonlySet<string>): string | undefined;
|
|
346
|
+
interface RoleSyncOutcome {
|
|
347
|
+
role: string;
|
|
348
|
+
team: string;
|
|
349
|
+
plan: RoleSyncPlan;
|
|
350
|
+
/** Members the role was given to (empty on a dry run). */
|
|
351
|
+
added: string[];
|
|
352
|
+
/** Members the role was taken from (empty on a dry run or with `keep`). */
|
|
353
|
+
removed: string[];
|
|
354
|
+
}
|
|
355
|
+
/** One person: their GitHub account and their member id on the notifications provider. */
|
|
356
|
+
interface MemberLink {
|
|
357
|
+
/** The GitHub user id, as a string. It survives a rename; the login does not. */
|
|
358
|
+
github: string;
|
|
359
|
+
/** The GitHub login when the link was made; for reports only. */
|
|
360
|
+
login: string;
|
|
361
|
+
/** The member's id on the notifications provider (for Discord, the user id). */
|
|
362
|
+
member: string;
|
|
257
363
|
}
|
|
364
|
+
/** The file that says which server member is which GitHub account. */
|
|
365
|
+
interface LinksFile {
|
|
366
|
+
/** The file format version. */
|
|
367
|
+
version: 1;
|
|
368
|
+
/** One entry per linked person. */
|
|
369
|
+
links: MemberLink[];
|
|
370
|
+
}
|
|
371
|
+
interface RoleSyncPlan {
|
|
372
|
+
/** Team members who are linked and do not hold the role: give it to them. */
|
|
373
|
+
add: Array<{
|
|
374
|
+
member: string;
|
|
375
|
+
login: string;
|
|
376
|
+
}>;
|
|
377
|
+
/** Holders linked to a GitHub account that is no longer on the team: take it away. */
|
|
378
|
+
remove: Array<{
|
|
379
|
+
member: string;
|
|
380
|
+
login: string;
|
|
381
|
+
}>;
|
|
382
|
+
/** Team members with no link: the role cannot reach them until they link their account. */
|
|
383
|
+
unlinked: SourceTeamMember[];
|
|
384
|
+
/** Holders with no link at all. Left alone, because nothing says they should not have it. */
|
|
385
|
+
unknownHolders: Array<{
|
|
386
|
+
member: string;
|
|
387
|
+
name?: string;
|
|
388
|
+
}>;
|
|
389
|
+
/** Linked team members who already hold the role. */
|
|
390
|
+
inSync: number;
|
|
391
|
+
}
|
|
392
|
+
/** What {@link syncRoles} needs: the providers, the links, and the roles to keep equal to their teams. */
|
|
393
|
+
interface SyncRolesInput {
|
|
394
|
+
/** The provider that lists and changes who holds a role. */
|
|
395
|
+
notifications: Notifications;
|
|
396
|
+
/** The provider that lists a team's members. */
|
|
397
|
+
source: Source;
|
|
398
|
+
/** Who is which person, from the links file. */
|
|
399
|
+
links: LinksFile;
|
|
400
|
+
/** Each role and the team it follows. */
|
|
401
|
+
roles: ReadonlyArray<{
|
|
402
|
+
name: string;
|
|
403
|
+
team: string;
|
|
404
|
+
}>;
|
|
405
|
+
/** The organisation the teams are in; defaults to the source's own. */
|
|
406
|
+
org?: string;
|
|
407
|
+
/** Report what would change without changing anything. */
|
|
408
|
+
dryRun?: boolean;
|
|
409
|
+
/** Give the role to new team members but do not take it from people who left. */
|
|
410
|
+
keep?: boolean;
|
|
411
|
+
/** Where progress lines go; nowhere when left out. */
|
|
412
|
+
print?: (line: string) => void;
|
|
413
|
+
}
|
|
414
|
+
/** What {@link syncRoles} did. */
|
|
415
|
+
interface SyncRolesResult {
|
|
416
|
+
/** One entry per role whose plan could be made. */
|
|
417
|
+
roles: RoleSyncOutcome[];
|
|
418
|
+
/** Steps that failed; the run carried on past each. */
|
|
419
|
+
failures: Array<{
|
|
420
|
+
step: string;
|
|
421
|
+
message: string;
|
|
422
|
+
}>;
|
|
423
|
+
/** Roles given or taken. */
|
|
424
|
+
ok: number;
|
|
425
|
+
/** Already in sync, left alone, or only previewed. */
|
|
426
|
+
skipped: number;
|
|
427
|
+
}
|
|
428
|
+
/** What a source provider needs to be able to do to feed a role sync, or the reason it cannot. */
|
|
429
|
+
export declare function sourceProblem(source: Source | undefined): string | undefined;
|
|
430
|
+
/** Reads the links file; a file that does not exist yet is an empty one, a damaged one throws. */
|
|
431
|
+
export declare function readLinks(source: Source, layout: NotificationsLayout, org: string | undefined, provider: string): Promise<LinksFile>;
|
|
258
432
|
/**
|
|
259
|
-
*
|
|
260
|
-
*
|
|
261
|
-
* `path` is the working directory relative to the repo root; defaults to `"."` (repo root) when omitted.
|
|
433
|
+
* The first role the layout declares for two different teams, or undefined. Names compare ignoring case, as
|
|
434
|
+
* the server does; the role would be synced against one team and then the other, so the last would win.
|
|
262
435
|
*/
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
436
|
+
export declare function roleTeamProblem(layout: {
|
|
437
|
+
roles?: ReadonlyArray<{
|
|
438
|
+
name: string;
|
|
439
|
+
team?: string;
|
|
440
|
+
}>;
|
|
441
|
+
}): string | undefined;
|
|
442
|
+
/**
|
|
443
|
+
* Makes each role's holders equal its team, one role after another. This is the sync itself, with no setup in
|
|
444
|
+
* front of it: the caller has already picked the providers, read the links and checked the layout. `holocron
|
|
445
|
+
* sync roles` and Sentinel's role sync are two callers of it. A step that fails is recorded and the
|
|
446
|
+
* run goes on; nothing here throws for a provider error. Idempotent: a role that already matches changes nothing.
|
|
447
|
+
* Lines go to `input.print` when it is given, and nowhere otherwise.
|
|
448
|
+
*/
|
|
449
|
+
export declare function syncRoles(input: SyncRolesInput): Promise<SyncRolesResult>;
|
|
450
|
+
/** Why a pull request moves an item's status. */
|
|
451
|
+
type PullRequestStatusReason = "pull-request-open" | "checks-green" | "checks-failed";
|
|
452
|
+
/** The status change a pull request asks for. */
|
|
453
|
+
interface PullRequestStatusChange {
|
|
454
|
+
/** The item's `issues` key. */
|
|
455
|
+
key: string;
|
|
456
|
+
/** The item's title, for the printed line. */
|
|
457
|
+
title: string;
|
|
458
|
+
/** The status it holds now. */
|
|
459
|
+
from: string;
|
|
460
|
+
/** The template's status it is set to. */
|
|
461
|
+
to: string;
|
|
462
|
+
/** The category of `to`. */
|
|
463
|
+
category: Extract<BoardStatusCategory, "active" | "review">;
|
|
464
|
+
/** Which rule applies. */
|
|
465
|
+
reason: PullRequestStatusReason;
|
|
466
|
+
}
|
|
467
|
+
/** A rule applies, but the template has no status of the category to set. Reported, never guessed. */
|
|
468
|
+
interface PullRequestStatusUnresolved {
|
|
469
|
+
/** The item's `issues` key. */
|
|
470
|
+
key: string;
|
|
471
|
+
/** The item's title. */
|
|
472
|
+
title: string;
|
|
473
|
+
/** The category the rule wanted. */
|
|
474
|
+
category: PullRequestStatusChange["category"];
|
|
475
|
+
/** Which rule applies. */
|
|
476
|
+
reason: PullRequestStatusReason;
|
|
266
477
|
}
|
|
478
|
+
/** What {@link planPullRequestStatus} decided: a change or an unresolved rule (it returns `undefined` for nothing). */
|
|
479
|
+
type PullRequestStatusPlan = {
|
|
480
|
+
kind: "change";
|
|
481
|
+
change: PullRequestStatusChange;
|
|
482
|
+
} | {
|
|
483
|
+
kind: "unresolved";
|
|
484
|
+
unresolved: PullRequestStatusUnresolved;
|
|
485
|
+
};
|
|
267
486
|
/**
|
|
268
|
-
*
|
|
487
|
+
* Decide the status an item's linked pull requests ask for (spec `tech-board-status-automation`, #2388). Pure: it reads
|
|
488
|
+
* one item and the template and touches nothing; status only, never priority or any other field.
|
|
269
489
|
*
|
|
270
|
-
*
|
|
271
|
-
* `
|
|
490
|
+
* - an open linked pull request (a draft counts) puts the item in `active`;
|
|
491
|
+
* - an open one whose aggregate check is `success` puts it in `review`;
|
|
492
|
+
* - when the item is in `review` and no open pull request is green, a `failure` moves it back to `active`, while
|
|
493
|
+
* `pending` and `none` leave it, so a re-run after a push does not flicker the board;
|
|
494
|
+
* - no open pull request: no change (closed and merged ones are `planReconcile()`'s, through the closed issue).
|
|
272
495
|
*
|
|
273
|
-
*
|
|
274
|
-
*
|
|
275
|
-
*
|
|
276
|
-
*
|
|
277
|
-
*/
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
/**
|
|
290
|
-
|
|
291
|
-
|
|
496
|
+
* Left to `planReconcile()`, which runs first: a closed item, an item with an open blocker or in `blocked`, and an
|
|
497
|
+
* item with no status (reported there, not set). An item in `done` is left alone. Where the template has no status of
|
|
498
|
+
* the wanted category the rule comes back as `unresolved` and nothing is guessed; where a category has several statuses
|
|
499
|
+
* the first in template order is used. Applying the change and planning again gives no change.
|
|
500
|
+
*/
|
|
501
|
+
export declare function planPullRequestStatus(item: BoardItem, template: BoardTemplate): PullRequestStatusPlan | undefined;
|
|
502
|
+
/** Why an item's status is changed. */
|
|
503
|
+
type ReconcileReason = "blocked" | "unblocked" | "closed" | PullRequestStatusReason;
|
|
504
|
+
/** One status change `reconcile` makes. */
|
|
505
|
+
interface ReconcileChange {
|
|
506
|
+
/** The item's `issues` key. */
|
|
507
|
+
key: string;
|
|
508
|
+
/** The item's title, for the printed line. */
|
|
509
|
+
title: string;
|
|
510
|
+
/** The status it holds now, or undefined for none. */
|
|
511
|
+
from?: string;
|
|
512
|
+
/** The template's status it is set to. */
|
|
513
|
+
to: string;
|
|
514
|
+
/** The category of `to`. */
|
|
515
|
+
category: Extract<BoardStatusCategory, "blocked" | "planned" | "done" | "active" | "review">;
|
|
516
|
+
/** Which rule applies. */
|
|
517
|
+
reason: ReconcileReason;
|
|
518
|
+
}
|
|
519
|
+
/** An item a rule applies to, but whose template has no status of the category to set. Reported, never guessed. */
|
|
520
|
+
interface ReconcileUnresolved {
|
|
521
|
+
/** The item's `issues` key. */
|
|
522
|
+
key: string;
|
|
523
|
+
/** The item's title. */
|
|
524
|
+
title: string;
|
|
525
|
+
/** The category the rule wanted. */
|
|
526
|
+
category: ReconcileChange["category"];
|
|
527
|
+
/** Which rule applies. */
|
|
528
|
+
reason: ReconcileReason;
|
|
529
|
+
}
|
|
530
|
+
/** What {@link planReconcile} decided. */
|
|
531
|
+
interface ReconcilePlan {
|
|
532
|
+
/** The status changes to make, in the items' order. */
|
|
533
|
+
changes: ReconcileChange[];
|
|
534
|
+
/** Open items with no status: reported, not set, since they need a decision and not a rule. */
|
|
535
|
+
unset: BoardItem[];
|
|
536
|
+
/** Items a rule applies to whose template lacks a status of the category. */
|
|
537
|
+
unresolved: ReconcileUnresolved[];
|
|
538
|
+
}
|
|
292
539
|
/**
|
|
293
|
-
*
|
|
294
|
-
*
|
|
540
|
+
* Decide the status changes that keep a board true (spec `command-project`, "Keeping a board true"). Pure: it reads
|
|
541
|
+
* the items and the template and touches nothing. Status only, never priority or any other field.
|
|
542
|
+
*
|
|
543
|
+
* - closed or merged, not in a `done` status: set to `done` (whatever the blockers say);
|
|
544
|
+
* - open with no status: not changed, listed in `unset` (it needs a decision, not a rule; this holds even when it has a
|
|
545
|
+
* blocker);
|
|
546
|
+
* - open with an open blocker, not in a `blocked` status: set to `blocked`;
|
|
547
|
+
* - open, in a `blocked` status, with no open blocker: set to `planned` (the status it held before is unknown).
|
|
548
|
+
*
|
|
549
|
+
* Where a category has several statuses the first in template order is used; where it has none the item is listed in
|
|
550
|
+
* `unresolved` and nothing is guessed. An item's category is read from the template by its status name, falling back
|
|
551
|
+
* to the one the provider reports. Applying the changes and planning again gives no change.
|
|
295
552
|
*/
|
|
296
|
-
|
|
553
|
+
export declare function planReconcile(items: readonly BoardItem[], template: BoardTemplate): ReconcilePlan;
|
|
554
|
+
/** One board a repo keeps: which template it follows and what it is called. */
|
|
555
|
+
interface BoardDeclaration {
|
|
556
|
+
/** The template's name, a built-in or a file in the templates directory. */
|
|
557
|
+
template: string;
|
|
558
|
+
/** The board's name, which is how it is found among the open boards. */
|
|
297
559
|
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
560
|
}
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
/**
|
|
494
|
-
|
|
495
|
-
|
|
561
|
+
/** The options of `providers.projects`, with their defaults filled in. */
|
|
562
|
+
interface ProjectOptions {
|
|
563
|
+
/** Whoever the boards belong to (a GitHub organization): the `org` option, else the config's `org`. */
|
|
564
|
+
owner: string;
|
|
565
|
+
/** The boards this repo keeps, template to name. Empty when the option is absent. */
|
|
566
|
+
boards: BoardDeclaration[];
|
|
567
|
+
/** The directory holding the repo's own template files, relative to the repo root. */
|
|
568
|
+
templatesDir: string;
|
|
496
569
|
}
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
570
|
+
/** What {@link resolveProjectOptions} made: the options, or every problem with them. */
|
|
571
|
+
type ResolveProjectOptionsResult = {
|
|
572
|
+
ok: true;
|
|
573
|
+
options: ProjectOptions;
|
|
500
574
|
} | {
|
|
501
|
-
|
|
502
|
-
|
|
575
|
+
ok: false;
|
|
576
|
+
problems: string[];
|
|
503
577
|
};
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
name:
|
|
578
|
+
/** Where a repo's own template files live unless the `templates` option says otherwise. */
|
|
579
|
+
export declare const DEFAULT_TEMPLATES_DIR = ".holocron/projects";
|
|
580
|
+
/**
|
|
581
|
+
* Read the options of `providers.projects`: `org` (the owner, defaulting to `fallbackOwner`, the config's org), `boards`
|
|
582
|
+
* (a list of `{ template, name }`, nothing else about a board is written in the config) and `templates` (the directory
|
|
583
|
+
* of template files). Every problem is listed at once, and two boards with the same name are one.
|
|
584
|
+
*/
|
|
585
|
+
export declare function resolveProjectOptions(options: Readonly<Record<string, unknown>>, fallbackOwner: string): ResolveProjectOptionsResult;
|
|
586
|
+
/** The templates that ship in `@theholocron/cli`, by name. A repo's own template with the same name replaces one. */
|
|
587
|
+
export declare const BUILTIN_TEMPLATES: Readonly<Record<string, BoardTemplate>>;
|
|
588
|
+
/**
|
|
589
|
+
* The labels every repository gets from `setup`, with their GitHub colours (hex, no `#`) and descriptions. A
|
|
590
|
+
* plugin that makes labels of its own, such as Linear's setup, takes the colour of the one with the same name.
|
|
591
|
+
*/
|
|
592
|
+
export declare const CANONICAL_LABELS: readonly [{
|
|
593
|
+
readonly name: "bug";
|
|
594
|
+
readonly color: "d73a4a";
|
|
595
|
+
readonly description: "Something isn't working";
|
|
596
|
+
}, {
|
|
597
|
+
readonly name: "chore";
|
|
598
|
+
readonly color: "ededed";
|
|
599
|
+
readonly description: "Maintenance, no user-facing change";
|
|
600
|
+
}, {
|
|
601
|
+
readonly name: "ci";
|
|
602
|
+
readonly color: "0075ca";
|
|
603
|
+
readonly description: "CI/CD pipeline changes";
|
|
604
|
+
}, {
|
|
605
|
+
readonly name: "dependencies";
|
|
606
|
+
readonly color: "0366d6";
|
|
607
|
+
readonly description: "Dependency update";
|
|
608
|
+
}, {
|
|
609
|
+
readonly name: "documentation";
|
|
610
|
+
readonly color: "0075ca";
|
|
611
|
+
readonly description: "Documentation only";
|
|
612
|
+
}, {
|
|
613
|
+
readonly name: "duplicate";
|
|
614
|
+
readonly color: "cfd3d7";
|
|
615
|
+
readonly description: "Already reported";
|
|
616
|
+
}, {
|
|
617
|
+
readonly name: "enhancement";
|
|
618
|
+
readonly color: "a2eeef";
|
|
619
|
+
readonly description: "New feature or request";
|
|
620
|
+
}, {
|
|
621
|
+
readonly name: "good first issue";
|
|
622
|
+
readonly color: "7057ff";
|
|
623
|
+
readonly description: "Good for newcomers";
|
|
624
|
+
}, {
|
|
625
|
+
readonly name: "help wanted";
|
|
626
|
+
readonly color: "008672";
|
|
627
|
+
readonly description: "Extra attention needed";
|
|
628
|
+
}, {
|
|
629
|
+
readonly name: "invalid";
|
|
630
|
+
readonly color: "e4e669";
|
|
631
|
+
readonly description: "Doesn't seem right";
|
|
632
|
+
}, {
|
|
633
|
+
readonly name: "performance";
|
|
634
|
+
readonly color: "fbca04";
|
|
635
|
+
readonly description: "Performance improvement";
|
|
636
|
+
}, {
|
|
637
|
+
readonly name: "question";
|
|
638
|
+
readonly color: "d876e3";
|
|
639
|
+
readonly description: "Further information requested";
|
|
640
|
+
}, {
|
|
641
|
+
readonly name: "refactor";
|
|
642
|
+
readonly color: "cfd3d7";
|
|
643
|
+
readonly description: "Code restructuring";
|
|
644
|
+
}, {
|
|
645
|
+
readonly name: "released";
|
|
646
|
+
readonly color: "ededed";
|
|
647
|
+
readonly description: "Included in a release";
|
|
648
|
+
}, {
|
|
649
|
+
readonly name: "test";
|
|
650
|
+
readonly color: "bfd4f2";
|
|
651
|
+
readonly description: "Test-related changes";
|
|
652
|
+
}, {
|
|
653
|
+
readonly name: "triage";
|
|
654
|
+
readonly color: "e4e669";
|
|
655
|
+
readonly description: "Needs investigation";
|
|
656
|
+
}, {
|
|
657
|
+
readonly name: "wontfix";
|
|
658
|
+
readonly color: "ffffff";
|
|
659
|
+
readonly description: "Won't be addressed";
|
|
660
|
+
}];
|
|
661
|
+
/** What one token must carry in one layer, as `tokenExpectations()` reads it from a plugin's `PluginToken.expect`. */
|
|
662
|
+
interface LayerTokenExpectation {
|
|
663
|
+
/** The token's plugin environment variable (`PluginToken.envName`), its identity in the plugin's list. */
|
|
664
|
+
envName: string;
|
|
665
|
+
/** The layer that holds it. */
|
|
666
|
+
layer: EnvironmentLayer;
|
|
667
|
+
/** Every permission with its rule. Empty for a layer that holds the token with no permission rules. */
|
|
668
|
+
rules: Readonly<Record<string, PermissionRule>>;
|
|
669
|
+
/** The permissions the token must have, in declaration order. */
|
|
670
|
+
required: readonly string[];
|
|
671
|
+
/** The permissions the token must not have, in declaration order. */
|
|
672
|
+
absent: readonly string[];
|
|
673
|
+
/** When the token is due for rotation: the declared policy over `DEFAULT_TOKEN_ROTATION`. */
|
|
674
|
+
rotation: Required<TokenRotation>;
|
|
675
|
+
}
|
|
676
|
+
/** Which of the declared expectations to return; both left out returns all of them. */
|
|
677
|
+
interface TokenExpectationFilter {
|
|
678
|
+
/** Only this layer. */
|
|
679
|
+
layer?: string;
|
|
680
|
+
/** Only the token with this `envName`. */
|
|
681
|
+
envName?: string;
|
|
532
682
|
}
|
|
533
683
|
/**
|
|
534
|
-
*
|
|
535
|
-
*
|
|
536
|
-
*
|
|
537
|
-
*/
|
|
538
|
-
declare function
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
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;
|
|
684
|
+
* Reads what a plugin's tokens declare (`PluginToken.expect`) as one entry per token and layer that holds it, in the
|
|
685
|
+
* order of `ENVIRONMENT_LAYERS`. The one reader the token probes, the doctor and the docs check share, so none of them
|
|
686
|
+
* walks the declaration itself. A token with no `expect` yields nothing; a layer no token holds is never listed.
|
|
687
|
+
*/
|
|
688
|
+
export declare function tokenExpectations(tokens: readonly PluginToken[], filter?: TokenExpectationFilter): LayerTokenExpectation[];
|
|
689
|
+
/** When a provider says a token was made and when it stops working. Each is an ISO date or time, left out when unknown. */
|
|
690
|
+
interface TokenLifetime {
|
|
691
|
+
/** When the token was made, or became valid when that is all the provider says (Cloudflare `not_before`). */
|
|
692
|
+
createdAt?: string;
|
|
693
|
+
/** When the token expires. Unset for a token that never does. */
|
|
694
|
+
expiresAt?: string;
|
|
580
695
|
}
|
|
696
|
+
/** The rotation policy of a token that declares none: a token is due after 90 days, and an expiry is flagged 14 days ahead. */
|
|
697
|
+
export declare const DEFAULT_TOKEN_ROTATION: Required<TokenRotation>;
|
|
581
698
|
/**
|
|
582
|
-
*
|
|
583
|
-
*
|
|
584
|
-
*
|
|
585
|
-
*
|
|
586
|
-
*
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
*
|
|
591
|
-
*
|
|
592
|
-
*
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
*
|
|
597
|
-
*
|
|
699
|
+
* Rows saying whether a token is due for rotation, from what its provider exposes. Provider-neutral: a token probe reads
|
|
700
|
+
* the lifetime however its provider offers it and hands it here, with the layer's `rotation` from `tokenExpectations()`.
|
|
701
|
+
* `lifetime` is `undefined` when the provider exposes nothing (the row says so rather than passing), and a date the
|
|
702
|
+
* provider gave that does not parse is an `info` row, never a pass. An expired or near-expiry token fails, and so does
|
|
703
|
+
* one older than `maxAgeDays`. Only dates are printed, never the token.
|
|
704
|
+
*/
|
|
705
|
+
export declare function tokenRotationRows(lifetime: TokenLifetime | undefined, rotation: Required<TokenRotation>, now: Date): ProbeRow[];
|
|
706
|
+
/**
|
|
707
|
+
* What stdout is. A token is never written to a `terminal` (it would sit in scrollback) or to `other` (a redirect to
|
|
708
|
+
* a regular file, which would leave plaintext tokens on disk without the protections of the file option); only a
|
|
709
|
+
* `pipe` receives the lines. On a terminal they go to the file option instead, or the clipboard when asked.
|
|
710
|
+
*/
|
|
711
|
+
type AuthExportOutKind = "terminal" | "pipe" | "other";
|
|
712
|
+
/**
|
|
713
|
+
* What file descriptor `fd` (stdout) is, for deciding where tokens may go: a `terminal`, a `pipe` (a FIFO, or the
|
|
714
|
+
* socket some shells and runners use for one), or `other` (a regular file, a device, or anything that cannot be
|
|
715
|
+
* inspected). Only a pipe is safe to write the lines to, so anything unknown is `other`.
|
|
716
|
+
*/
|
|
717
|
+
export declare function stdoutKind(isTerminal: boolean, fd?: number, stat?: (fd: number) => Pick<Stats, "isFIFO" | "isSocket">): AuthExportOutKind;
|
|
718
|
+
/**
|
|
719
|
+
* The vault Environment `holocron sync secrets --env <environment>` reads. A layer word (`local`, `dev`, `ci`, `prod`) is the
|
|
720
|
+
* Environment of that layer of this repository, `<org/repo> - <layer>`; any other text is a literal Environment name.
|
|
721
|
+
* A literal name wins only when it is not exactly a layer word, so an Environment that is itself called `prod` cannot be
|
|
722
|
+
* addressed by that name (spec `tech-environment-layers`, #2069).
|
|
598
723
|
*
|
|
599
|
-
*
|
|
600
|
-
*
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
724
|
+
* @param id - The `--env` value the user gave.
|
|
725
|
+
* @param input - Where the repository is (its `origin` remote is read there), and optionally how to read it.
|
|
726
|
+
* @throws {ConfigError} For a layer word when the remote cannot be read (the message names the `environment` option).
|
|
727
|
+
*/
|
|
728
|
+
export declare function resolveEnvironmentId(id: string, input: {
|
|
729
|
+
repoRoot: string;
|
|
730
|
+
gitExec?: GitExec;
|
|
731
|
+
}): Promise<string>;
|
|
732
|
+
/** The line that says how to fix a credentials path the version control ignore rules do not cover. */
|
|
733
|
+
export declare function ignoreAdvice(isDefault: boolean, choose: string): string;
|
|
734
|
+
/** The file `export tokens` and `new github-app` write by default, relative to the repository root. */
|
|
735
|
+
export declare const PRIVATE_CREDENTIALS_FILE = ".holocron/.private/.credentials";
|
|
736
|
+
/** Where a credentials file goes: its absolute path, and whether it is the default one in the private directory. */
|
|
737
|
+
interface CredentialsFileTarget {
|
|
738
|
+
path: string;
|
|
739
|
+
/** True when no `--file` was given, so the file is in `.holocron/.private/` and a missing ignore rule is fixed by `sync`. */
|
|
740
|
+
isDefault: boolean;
|
|
741
|
+
}
|
|
742
|
+
/**
|
|
743
|
+
* The credentials file for a command: `file` (relative to `base`) when given, else `.holocron/.private/.credentials`
|
|
744
|
+
* under `base`. The default's directory is created when missing (owner-only), because the ignore check can only ask
|
|
745
|
+
* about a path whose directory exists and the file cannot be written without it.
|
|
746
|
+
*/
|
|
747
|
+
export declare function resolveCredentialsFile(base: string, file: string | undefined, makeDir?: (dir: string) => void): CredentialsFileTarget;
|
|
748
|
+
/**
|
|
749
|
+
* The closed list of area files `loadConfig` reads from `.holocron/` (the directory is `.<config name>`, set by kyber):
|
|
750
|
+
* `.holocron/notifications.*` fills `providers.notifications`' `layout`, `.holocron/repo.*` fills keys of `repo`, and `.holocron/org.*` fills provider options (`teamId`, `accountId`) a config leaves out.
|
|
751
|
+
* A file not on this list is never read.
|
|
752
|
+
*/
|
|
753
|
+
export declare const HOLOCRON_AREAS: readonly ["notifications", "repo", "org"];
|
|
754
|
+
/**
|
|
755
|
+
* The areas a config in a subdirectory also reads from the repository root's `.holocron/` (SPEC-0069): only `org`,
|
|
756
|
+
* because its values are the organization's and every config needs them. `repo` and `notifications` describe the
|
|
757
|
+
* repository itself, so an app's config does not take them from the root.
|
|
758
|
+
*/
|
|
759
|
+
export declare const SHARED_AREAS: readonly ["org"];
|
|
760
|
+
/**
|
|
761
|
+
* Put the area files of `.holocron/` into the config as loaded, before `deriveDefaults` runs: `notifications` becomes
|
|
762
|
+
* 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
|
|
763
|
+
* is a `ConfigError` naming both (no merge, no precedence). With no area files the config is returned as it was.
|
|
764
|
+
*/
|
|
765
|
+
export declare function placeAreas(areas: ConfigDirArea[], raw: HolocronConfig): HolocronConfig;
|
|
766
|
+
export { 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 ComposedPreset, ConfigError, ConfigFileError, ConnectionStringOptions, 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, 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 GitHubAppConfig, type HolocronConfig, type HolocronProfile, IdeaRecord, Ideas, type IdeasConfig, ImportOptions, ImportResult, InspectErrorsInput, InspectRelayInput, Issue, IssueComment, IssueOrder, IssuePriority, IssueRecord, IssueSearchFilter, IssueSelector, Issues, KNOWN_STACK_DEPS, LabelDef, type LayerTokenExpectation, type LayoutEmoji, LifecycleResult, LifecycleSlot, type LinksFile, type LoadedConfig, type LogConfig, Logs, LogsDataset, type MemberLink, MissingTokenError, Monitoring, MonitoringAlertChannelInput, MonitoringAlertChannelResult, MonitoringAlertChannelState, MonitoringAlertSettings, MonitoringAssertion, MonitoringAssertionComparison, MonitoringAssertionSource, MonitoringCheck, MonitoringCheckInput, MonitoringDashboardInput, MonitoringDashboardState, MonitoringHeartbeatInput, MonitoringHeartbeatResult, MonitoringHeartbeatUnit, MonitoringHttpMethod, MonitoringStatusComponentInput, MonitoringStatusPageInput, MonitoringStatusPageResult, MonitoringStatusPageState, MoveReport, type MultiEntry, NormalizedAuthUser, Notifications, NotificationsAccess, NotificationsApplicationLayout, NotificationsChannelLayout, NotificationsDelivery, NotificationsEveryoneLayout, NotificationsForumTag, NotificationsLayout, NotificationsLinksLayout, NotificationsMember, NotificationsMonitoringFeed, NotificationsOnboardingLayout, NotificationsPicture, NotificationsPinnedLayout, NotificationsPrsFeed, NotificationsReaction, NotificationsServerLayout, NotificationsSignIn, NotificationsSignedIn, NotificationsWelcomeLayout, type OrgConfig, 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, type PullRequestStatusChange, type PullRequestStatusPlan, type PullRequestStatusReason, type PullRequestStatusUnresolved, REQUIRED_CAPABILITIES, type RawProviderEntry, type RawProvidersConfig, type ReadKeysLimitedInput, type ReconcileChange, type ReconcilePlan, type ReconcileReason, type ReconcileUnresolved, RelayState, type RepoConfig, type RepoProperties, type RepoProtection, RepoRef, type RepoSecrets, type RepoSecretsDeploy, type RepoSecretsSync, RepoSettings, type RepoValidationConfig, type RepoVariables, type RepoVariablesSync, type RequestOptions, type ResolveProjectOptionsResult, type ResolveTokenConfig, type ResolveTokenInput, ResolvedCapability, type ResolvedHolocronConfig, type ResolvedProviderEntry, type ResolvedProvidersConfig, type ResolvedTuple, type RestClient, type RestClientConfig, Ruleset, SecretAccess, SecretScope, SecretVisibility, Secrets, ServerInspection, type SingleEntry, Source, SourceBranch, SourceFile, SourceRepoInfo, 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, 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, resolveConfig, resolveEntry, resolvePluginPackage, resolveValue };
|