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