@theholocron/cli 5.0.0-alpha.519 → 5.0.0-alpha.520
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +3 -84
- package/dist/index.mjs +81 -278
- package/dist/presets.mjs +1 -1
- package/package.json +10 -10
- package/dist/{config-system-WSiPSdwj.mjs → config-system-D_ZIb8Dw.mjs} +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { $ as CoverageUploadGroup, $i as CredentialsConfig, $n as NotificationsPinnedLayout, $r as ToolingOpenPlan, $t as IssueCreateInput, A as Cache, Aa as SingleEntry, Ai as readWorkspacePackageJsons, An as MonitoringHeartbeatInput, Ar as SecretVisibility, At as EnsureWebhookResult, B as ConnectionStringOptions, Bi as Capability, Bn as Notifications, Br as StatusCategory, Bt as ErrorsOrgState, C as BoardState, Ca as RepoValidationConfig, Ci as Workers, Cn as MonitoringAssertion, Cr as RelayState, Ct as EnsureDiscussionInput, D as BoardTemplate, Da as ResolvedProviderEntry, Di as deriveProfile, Dn as MonitoringCheckInput, Dr as Ruleset, Dt as EnsureRelaySourceResult, E as BoardSummary, Ea as ResolvedHolocronConfig, Ei as deriveCompliance, En as MonitoringCheck, Er as ResolvedCapability, Et as EnsureRelaySourceInput, F as CardinalityFor, Fa as EnvironmentLayer, Fi as ConfigFileError, Fn as MonitoringStatusPageInput, Fr as SourceFile, Ft as EnvironmentEntry, G as CoverageConfigInput, Gi as resolveConfig, Gn as NotificationsEveryoneLayout, Gr as TeamPermission, Gt as ImportOptions, H as Coverage, Hi as TaskEntry, Hn as NotificationsApplicationLayout, Hr as StorageBranch, Ht as ExportInfo, I as Ci, Ii as compose, In as MonitoringStatusPageResult, Ir as SourceRepoInfo, It as EnvironmentReviewer, J as CoverageRepoReport, Ji as AgentName, Jn as NotificationsLinksLayout, Jr as ToolingExportInput, Jt as InspectRelayInput, K as CoverageExpectations, Ki as resolveEntry, Kn as NotificationsForumTag, Kr as Tooling, Kt as ImportResult, L as CiRun, Li as defineConfig, Ln as MonitoringStatusPageState, Lr as SourceRulesetDetail, Lt as Environments, M as CapabilityImpls, Ma as TaskEntryConfig, Mi as HolocronProfile, Mn as MonitoringHeartbeatUnit, Mr as ServerInspection, Mt as EnsuredResource, N as CapabilityKey, Na as TelemetryConfig, Ni as PackageJsonLike, Nn as MonitoringHttpMethod, Nr as Source, Nt as EnsuredTunnel, O as BoardTemplateFile, Oa as ResolvedProvidersConfig, Oi as deriveStack, On as MonitoringDashboardInput, Or as SecretAccess, Ot as EnsureReport, P as Cardinality, Pa as WorkflowWithConfig, Pi as StackName, Pn as MonitoringStatusComponentInput, Pr as SourceBranch, Pt as Environment, Q as CoverageUploadFlagResult, Qi as ChromaticProjectConfig, Qn as NotificationsPicture, Qr as ToolingOpenLaunch, Qt as IssueComment, R as CiRunFilter, Ri as loadConfig, Rn as MoveReport, Rr as SourceSecurity, Rt as Errors, S as BoardRule, Sa as RepoSecretsSync, Si as WorkerScriptState, Sn as MonitoringAlertSettings, Sr as RelaySourceState, St as EmojiCheck, T as BoardStatusCategory, Ta as RepoVariablesSync, Ti as deriveCapabilities, Tn as MonitoringAssertionSource, Tr as RepoSettings, Tt as EnsureRelayResult, U as CoverageConfigComponent, Ui as ConfigError, Un as NotificationsChannelLayout, Ur as SyncResult, Ut as IdeaRecord, V as CoreIssueKind, Vi as ComposedPreset, Vn as NotificationsAccess, Vr as Storage, Vt as ErrorsProjectState, W as CoverageConfigDocumentation, Wi as credentialsEnvironment, Wn as NotificationsDelivery, Wr as TeamEntry, Wt as Ideas, X as CoverageStatusInput, Xi as AppConfig, Xn as NotificationsMonitoringFeed, Xr as ToolingExportResult, Xt as Issue, Y as CoverageStatusContext, Yi as AgentOptions, Yn as NotificationsMember, Yr as ToolingExportIssue, Yt as InspectRelaySourceInput, Z as CoverageTokenCheck, Zi as CapabilityConfigPackage, Zn as NotificationsOnboardingLayout, Zr as ToolingOpenInput, Zt as IssueClearable, _ as BoardFieldType, _a as RepoLabels, _i as WikiProbe, _n as LogsDataset, _r as PullRequestLink, _t as Dns, a as REQUIRED_CAPABILITIES, aa as EslintConfig, ai as ToolingWorkspaceState, an as IssuePriority, ar as NotificationsSignedIn, at as DeployFunctionConfig, b as BoardPullRequest, ba as RepoSecrets, bi as WikiPublishedState, bn as MonitoringAlertChannelResult, br as RelaySourceCapability, bt as DnsRecordType, c as AddedItem, ca as IdeasConfig, ci as TunnelRoute, cn as IssueSelector, cr as PagesConfig, ct as DeployScriptResult, d as AuthDescription, da as OrgConfig, di as WebhookDashboardInfo, dn as IssueUpdateResult, dr as ProviderIdentity, dt as DeploymentProjectSettings, ea as DevConfig, ei as ToolingOpenWant, en as IssueEffort, er as NotificationsPrsFeed, et as CoverageUploadInput, f as AuthEvent, fa as OrgIssueType, fi as Wiki, fn as Issues, fr as PullRequest, ft as DeploymentRecord, g as BoardField, ga as RepoConfig, gi as WikiOrganizationState, gn as Logs, gr as PullRequestInput, gt as DiscussionPost, h as AuthUser, ha as RawProvidersConfig, hi as WikiNavigationState, hn as LifecycleSlot, hr as PullRequestFields, ht as DiscussionPatch, i as ProviderApiError, ia as EnvConfig, ii as ToolingWorkspaceSide, in as IssuePatch, ir as NotificationsSignIn, it as CredentialsInspection, j as CacheTokenCheck, ja as StorybookDeployProject, ji as DeriveProfileInput, jn as MonitoringHeartbeatResult, jr as Secrets, jt as EnsuredDiscussion, k as BoardView, ka as ResolvedTuple, ki as missingCapabilities, kn as MonitoringDashboardState, kr as SecretScope, kt as EnsureResult, l as Analytics, la as LogConfig, li as Tunnels, ln as IssueTypeDeclaration, lr as ParseWebhookInput, lt as Deployment, m as AuthIdentity, ma as RawProviderEntry, mi as WikiInstanceState, mn as LifecycleResult, mr as PullRequestChecksState, mt as DeploymentTrigger, n as ElevationRequiredError, na as DocsConfig, ni as ToolingWorkspaceInput, nn as IssueKind, nr as NotificationsRelaySource, nt as CreateAuthUserInput, o as WebhookVerificationError, oa as GitHubAppConfig, oi as TrackerDoctorReport, on as IssueRecord, or as NotificationsWelcomeLayout, ot as DeployFunctionResult, p as AuthEventType, pa as ProviderOptions, pi as WikiInspection, pn as LabelDef, pr as PullRequestChecks, pt as DeploymentTarget, q as CoverageNameDiff, qi as resolvePluginPackage, qn as NotificationsLayout, qr as ToolingDoctorReport, qt as InspectErrorsInput, r as MissingTokenError, ra as DoctorConfig, ri as ToolingWorkspaceResult, rn as IssueOrder, rr as NotificationsServerLayout, rt as Credentials, s as isMulti, sa as HolocronConfig, si as TrackerUser, sn as IssueSearchFilter, sr as OrganizationSecretScope, st as DeployScriptConfig, t as CARDINALITY, ta as DevServeConfig, ti as ToolingWorkspaceFile, tn as IssueFields, tr as NotificationsReaction, tt as CoverageUploadResult, u as Auth, ua as MultiEntry, ui as Vault, un as IssueTypeInfo, ur as Projects, ut as DeploymentProject, v as BoardItem, va as RepoProperties, vi as WikiProvisionOpts, vn as Monitoring, vr as PullRequestPatch, vt as DnsRecord, w as BoardStatus, wa as RepoVariables, wi as KNOWN_STACK_DEPS, wn as MonitoringAssertionComparison, wr as RepoRef, wt as EnsureRelayInput, x as BoardPullRequestChecks, xa as RepoSecretsDeploy, xi as WorkerDeploymentState, xn as MonitoringAlertChannelState, xr as RelaySourceMethods, xt as DuplicateDiscussion, y as BoardItemInput, ya as RepoProtection, yi as WikiProxyConfig, yn as MonitoringAlertChannelInput, yr as PullRequestResult, yt as DnsRecordRequest, z as CiRunStatus, zi as LoadedConfig, zn as NormalizedAuthUser, zr as SourceTeamMember, zt as ErrorsInspection } from "./index-DFp_iLFu.mjs";
|
|
2
2
|
import { AuthError, ResolveTokenConfig as ResolveTokenConfig$1, ResolveTokenInput, ResolveTokenInput as ResolveTokenInput$1, resolveValue } from "@theholocron/kyber/secrets";
|
|
3
3
|
import { DocsCoverageMode } from "@theholocron/astromech";
|
|
4
|
+
import { CheckRow } from "@theholocron/kyber/ui";
|
|
5
|
+
import "@theholocron/env-utils/lookup";
|
|
4
6
|
import { RequestOptions, RestClient, RestClientConfig, createRestClient } from "@theholocron/http-client";
|
|
5
7
|
import "@theholocron/kyber/plugins";
|
|
6
8
|
import { GitExec } from "@theholocron/git-utils";
|
|
7
|
-
import "@theholocron/env-utils/lookup";
|
|
8
9
|
import { ConnectionProbeInput as ConnectionProbeInput$1 } from "@theholocron/kyber/checks";
|
|
9
|
-
import { CheckRow } from "@theholocron/kyber/ui";
|
|
10
10
|
import { Stats } from "node:fs";
|
|
11
11
|
import "@theholocron/observability/core";
|
|
12
12
|
import { ConfigDirArea } from "@theholocron/datapad";
|
|
@@ -133,10 +133,6 @@ export declare function createFeatureResolver(config: FeatureResolverConfig): Fe
|
|
|
133
133
|
* Both lists are sorted. Plugins call this instead of importing the task runner.
|
|
134
134
|
*/
|
|
135
135
|
export declare function coverageExpectations(repoRoot: string, docsCoverage?: DocsCoverageMode): CoverageExpectations;
|
|
136
|
-
/** What a failed Type call means: a refusal of the token, a rate limit, a name that already exists, or anything else. */
|
|
137
|
-
export type TypeErrorKind = "refused" | "rate-limit" | "conflict" | "other";
|
|
138
|
-
/** Reads a thrown error as one of the four things `ensureIssueTypes()` acts on differently. */
|
|
139
|
-
export declare function classifyTypeError(err: unknown): TypeErrorKind;
|
|
140
136
|
/**
|
|
141
137
|
* Puts issue keys in creation order without asking the tracker: issue numbers (`#12`, `ENG-12`) rise with creation inside
|
|
142
138
|
* one repository or team, so the trailing number is the order. `oldest` is ascending, `newest` descending; keys with the
|
|
@@ -271,83 +267,6 @@ export interface ConnectionProbeInput extends Omit<ConnectionProbeInput$1, "veri
|
|
|
271
267
|
* kyber's `connectionProbe`; this types the result as the plugin system's {@link Probe} and `verify` as `VerifyTokenResult`.
|
|
272
268
|
*/
|
|
273
269
|
export declare function connectionProbe(input: ConnectionProbeInput): Probe;
|
|
274
|
-
/** What {@link ensureIssueTypes} needs. */
|
|
275
|
-
interface EnsureIssueTypesInput {
|
|
276
|
-
/** The Types the org area declares (`config.issueTypes`); none or an empty list is a `skip` row and no write. */
|
|
277
|
-
declared: readonly OrgIssueType[] | undefined;
|
|
278
|
-
/** The loaded `issues` provider, or `undefined` when none could be loaded. */
|
|
279
|
-
issues: Issues | undefined;
|
|
280
|
-
/** Why there is no `issues` provider, when that is so (a plugin that failed to load). */
|
|
281
|
-
missingReason?: string;
|
|
282
|
-
/**
|
|
283
|
-
* Who is asking. `apply` is a person who wanted it done: a refusal, an unreadable list and the limit are `fail` rows
|
|
284
|
-
* and no terminal without `yes` throws `NonInteractiveError`. `setup` is one step of many: the same cases are `skip`
|
|
285
|
-
* rows (a contributor without the permission still passes), and no terminal without `yes` is a `skip` row saying to
|
|
286
|
-
* pass `--yes`.
|
|
287
|
-
*/
|
|
288
|
-
caller: "apply" | "setup";
|
|
289
|
-
/** Also set `description` and `color` on an existing Type that differs. Never `enabled`, never the name. */
|
|
290
|
-
update: boolean;
|
|
291
|
-
/** Write without asking. */
|
|
292
|
-
yes?: boolean;
|
|
293
|
-
/** Read and report only. */
|
|
294
|
-
dryRun?: boolean;
|
|
295
|
-
/** Whether a terminal can be asked. Defaults to whether stdin is one. */
|
|
296
|
-
interactive?: boolean;
|
|
297
|
-
/** Asks the yes/no question. Defaults to an inquirer prompt. */
|
|
298
|
-
confirm?: (message: string) => Promise<boolean>;
|
|
299
|
-
}
|
|
300
|
-
/** What {@link ensureIssueTypes} did. The caller prints `rows` (`printCheckRows`). */
|
|
301
|
-
interface EnsureIssueTypesReport {
|
|
302
|
-
/** `skip` when there was nothing it could do, `cancelled` when the answer was no. */
|
|
303
|
-
status: "ok" | "fail" | "skip" | "cancelled";
|
|
304
|
-
/** One row per declared Type, or the one row that says why nothing was done. */
|
|
305
|
-
rows: CheckRow[];
|
|
306
|
-
/** The names made, or on a dry run the names that would be. */
|
|
307
|
-
created: string[];
|
|
308
|
-
/** The names whose description or colour was set, or on a dry run would be. */
|
|
309
|
-
updated: string[];
|
|
310
|
-
}
|
|
311
|
-
/** The most Types GitHub documents for an organization, the three defaults included (Decision 12; not verified). */
|
|
312
|
-
export declare const MAX_ISSUE_TYPES = 25;
|
|
313
|
-
/** Reads the declared Types against the organization and, unless `dryRun`, writes the difference. See the file comment. */
|
|
314
|
-
export declare function ensureIssueTypes(input: EnsureIssueTypesInput): Promise<EnsureIssueTypesReport>;
|
|
315
|
-
/** One field of an existing Type that differs from the declaration. */
|
|
316
|
-
interface TypeChange {
|
|
317
|
-
/** Which field differs. */
|
|
318
|
-
field: "description" | "color";
|
|
319
|
-
/** The value the organization has now. */
|
|
320
|
-
was: string;
|
|
321
|
-
/** The value the declaration states. */
|
|
322
|
-
to: string;
|
|
323
|
-
}
|
|
324
|
-
/** What to do about one declared Type. */
|
|
325
|
-
type TypeAction = {
|
|
326
|
-
kind: "create";
|
|
327
|
-
declared: IssueTypeDeclaration;
|
|
328
|
-
} | {
|
|
329
|
-
kind: "update";
|
|
330
|
-
declared: IssueTypeDeclaration;
|
|
331
|
-
existing: IssueTypeInfo;
|
|
332
|
-
changes: TypeChange[];
|
|
333
|
-
} | {
|
|
334
|
-
kind: "exists";
|
|
335
|
-
declared: IssueTypeDeclaration;
|
|
336
|
-
existing: IssueTypeInfo;
|
|
337
|
-
};
|
|
338
|
-
/** The plan: one action per declared Type, in declaration order. */
|
|
339
|
-
interface IssueTypesPlan {
|
|
340
|
-
/** One action per declared Type. */
|
|
341
|
-
actions: TypeAction[];
|
|
342
|
-
/** The Types the organization has now plus those the plan would make. */
|
|
343
|
-
total: number;
|
|
344
|
-
}
|
|
345
|
-
/**
|
|
346
|
-
* Compares the declared Types with the organization's, by name ignoring case. A missing one is made; with `update` an
|
|
347
|
-
* existing one whose stated description or colour differs is updated (only those two fields, only when the declaration
|
|
348
|
-
* states them). `enabled` and the name are never compared: a Type is never renamed, turned on or off, or deleted.
|
|
349
|
-
*/
|
|
350
|
-
export declare function planIssueTypes(declared: readonly IssueTypeDeclaration[], existing: readonly IssueTypeInfo[], update: boolean): IssueTypesPlan;
|
|
351
270
|
/**
|
|
352
271
|
* The first server emoji a layout gives two different pictures, or undefined. One name is one emoji, so it can be made
|
|
353
272
|
* from one file only; the same file written twice is fine.
|
|
@@ -886,4 +805,4 @@ export declare const SHARED_AREAS: readonly ["org"];
|
|
|
886
805
|
* is a `ConfigError` naming both (no merge, no precedence). With no area files the config is returned as it was.
|
|
887
806
|
*/
|
|
888
807
|
export declare function placeAreas(areas: ConfigDirArea[], raw: HolocronConfig): HolocronConfig;
|
|
889
|
-
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,
|
|
808
|
+
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, MissingTokenError, Monitoring, MonitoringAlertChannelInput, MonitoringAlertChannelResult, MonitoringAlertChannelState, MonitoringAlertSettings, MonitoringAssertion, MonitoringAssertionComparison, MonitoringAssertionSource, MonitoringCheck, MonitoringCheckInput, MonitoringDashboardInput, MonitoringDashboardState, MonitoringHeartbeatInput, MonitoringHeartbeatResult, MonitoringHeartbeatUnit, MonitoringHttpMethod, MonitoringStatusComponentInput, MonitoringStatusPageInput, MonitoringStatusPageResult, MonitoringStatusPageState, MoveReport, type MultiEntry, NormalizedAuthUser, Notifications, NotificationsAccess, NotificationsApplicationLayout, NotificationsChannelLayout, NotificationsDelivery, NotificationsEveryoneLayout, NotificationsForumTag, NotificationsLayout, NotificationsLinksLayout, NotificationsMember, NotificationsMonitoringFeed, NotificationsOnboardingLayout, NotificationsPicture, NotificationsPinnedLayout, NotificationsPrsFeed, NotificationsReaction, 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 ReconcileChange, type ReconcilePlan, type ReconcileReason, type ReconcileUnresolved, RelaySourceCapability, RelaySourceMethods, RelaySourceState, RelayState, type RepoConfig, 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, Ruleset, SecretAccess, SecretScope, SecretVisibility, Secrets, ServerInspection, type SingleEntry, Source, SourceBranch, SourceFile, SourceRepoInfo, SourceRulesetDetail, SourceSecurity, SourceTeamMember, type StackName, StatusCategory, Storage, StorageBranch, type StorybookDeployProject, SyncResult, type SyncRolesInput, type SyncRolesResult, type TaskEntry, type TaskEntryConfig, TeamEntry, TeamPermission, type TelemetryConfig, type TokenExpectation, type TokenExpectationFilter, type TokenLifetime, type TokenResolver, type TokenRotation, Tooling, ToolingDoctorReport, ToolingExportInput, ToolingExportIssue, ToolingExportResult, ToolingOpenInput, ToolingOpenLaunch, ToolingOpenPlan, ToolingOpenWant, ToolingWorkspaceFile, ToolingWorkspaceInput, ToolingWorkspaceResult, ToolingWorkspaceSide, ToolingWorkspaceState, TrackerDoctorReport, TrackerUser, TunnelRoute, Tunnels, type UnicodeReaction, Vault, type VerifyTokenFailure, type VerifyTokenResult, type VerifyTokenSuccess, WebhookDashboardInfo, WebhookVerificationError, Wiki, WikiInspection, WikiInstanceState, WikiNavigationState, WikiOrganizationState, WikiProbe, WikiProvisionOpts, WikiProxyConfig, WikiPublishedState, WorkerDeploymentState, WorkerScriptState, Workers, type WorkflowWithConfig, compose, createRestClient, credentialsEnvironment, defineConfig, deriveCapabilities, deriveCompliance, deriveProfile, deriveStack, isMulti, loadConfig, missingCapabilities, readWorkspacePackageJsons, resolveConfig, resolveEntry, resolvePluginPackage, resolveValue };
|
package/dist/index.mjs
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import { a as placeAreas, c as ConfigError, d as resolveEntry, f as resolvePluginPackage, g as layerEnvironment, h as isEnvironmentLayer, i as loadConfig, l as credentialsEnvironment, m as ENVIRONMENT_LAYERS, n as compose, o as HOLOCRON_AREAS, p as repoSlug, r as defineConfig, s as SHARED_AREAS, t as ConfigFileError, u as resolveConfig } from "./config-system-WSiPSdwj.mjs";
|
|
2
1
|
import { CARDINALITY, ElevationRequiredError, MissingTokenError, ProviderApiError, REQUIRED_CAPABILITIES, WebhookVerificationError, isMulti } from "./plugin/capabilities.mjs";
|
|
2
|
+
import { a as placeAreas, c as ConfigError, d as resolveEntry, f as resolvePluginPackage, g as layerEnvironment, h as isEnvironmentLayer, i as loadConfig, l as credentialsEnvironment, m as ENVIRONMENT_LAYERS, n as compose, o as HOLOCRON_AREAS, p as repoSlug, r as defineConfig, s as SHARED_AREAS, t as ConfigFileError, u as resolveConfig } from "./config-system-D_ZIb8Dw.mjs";
|
|
3
3
|
import { Entry, findCredentials } from "@napi-rs/keyring";
|
|
4
4
|
import { AuthError, createFeatureResolver as createFeatureResolver$1, createKeyring, createResolveToken as createResolveToken$1, resolveValue } from "@theholocron/kyber/secrets";
|
|
5
5
|
import { DOCUMENTATION_FLAG, codecovFlagNames, readWorkspacePackages } from "@theholocron/astromech";
|
|
6
|
-
import { createRestClient } from "@theholocron/http-client";
|
|
7
|
-
import { connectionProbe as connectionProbe$1 } from "@theholocron/kyber/checks";
|
|
8
|
-
import { confirm } from "@inquirer/prompts";
|
|
9
|
-
import { NonInteractiveError, describeError, style } from "@theholocron/kyber/ui";
|
|
10
6
|
import { dirname, join, posix, resolve } from "node:path";
|
|
11
7
|
import { readFile } from "node:fs/promises";
|
|
8
|
+
import { describeError, style } from "@theholocron/kyber/ui";
|
|
12
9
|
import { errorMessage } from "@theholocron/misc-utils";
|
|
10
|
+
import { createRestClient } from "@theholocron/http-client";
|
|
11
|
+
import { connectionProbe as connectionProbe$1 } from "@theholocron/kyber/checks";
|
|
13
12
|
import { readPackageJson } from "@theholocron/pkg-utils";
|
|
14
13
|
import { fstatSync, mkdirSync } from "node:fs";
|
|
15
14
|
// src/auth/auth.ts
|
|
@@ -82,278 +81,6 @@ function coverageExpectations(repoRoot, docsCoverage = "off") {
|
|
|
82
81
|
components: packages.map((pkg) => pkg.slug).sort()
|
|
83
82
|
};
|
|
84
83
|
}
|
|
85
|
-
// src/plugin/issues-provider/order-keys/order-keys.ts
|
|
86
|
-
/**
|
|
87
|
-
* Puts issue keys in creation order without asking the tracker: issue numbers (`#12`, `ENG-12`) rise with creation inside
|
|
88
|
-
* one repository or team, so the trailing number is the order. `oldest` is ascending, `newest` descending; keys with the
|
|
89
|
-
* same number keep their place. A key with no trailing number is an error, because nothing can be said of its age.
|
|
90
|
-
*/
|
|
91
|
-
function orderKeys(keys, order) {
|
|
92
|
-
const numbered = keys.map((key, index) => {
|
|
93
|
-
const match = /(\d+)\s*$/.exec(key);
|
|
94
|
-
if (!match) throw new Error(`Cannot order "${key}" by creation: it has no issue number.`);
|
|
95
|
-
return {
|
|
96
|
-
key,
|
|
97
|
-
index,
|
|
98
|
-
n: Number(match[1])
|
|
99
|
-
};
|
|
100
|
-
});
|
|
101
|
-
const sign = order === "newest" ? -1 : 1;
|
|
102
|
-
return numbered.sort((a, b) => sign * (a.n - b.n) || a.index - b.index).map((e) => e.key);
|
|
103
|
-
}
|
|
104
|
-
// src/plugin/issues-provider/pick-by-creation/pick-by-creation.ts
|
|
105
|
-
/**
|
|
106
|
-
* Keeps the first or last `limit` of a listing by creation time, returned oldest first. `createdAt` reads an item's
|
|
107
|
-
* ISO timestamp; items created in the same instant keep their listed order. The cut happens on what the listing already
|
|
108
|
-
* holds, so no request is spent on an item that is dropped.
|
|
109
|
-
*/
|
|
110
|
-
function pickByCreation(items, createdAt, order, limit) {
|
|
111
|
-
const ascending = items.map((item, index) => ({
|
|
112
|
-
item,
|
|
113
|
-
index,
|
|
114
|
-
at: Date.parse(createdAt(item))
|
|
115
|
-
})).sort((a, b) => a.at - b.at || a.index - b.index).map((e) => e.item);
|
|
116
|
-
return order === "newest" ? ascending.slice(Math.max(ascending.length - limit, 0)) : ascending.slice(0, limit);
|
|
117
|
-
}
|
|
118
|
-
// src/plugin/issues-provider/read-keys-limited/read-keys-limited.ts
|
|
119
|
-
/**
|
|
120
|
-
* Reads an explicit list of issues in creation order until `limit` of them are kept. The keys are sorted by number first
|
|
121
|
-
* (see {@link orderKeys}), then fetched in small steps of at most `concurrency`, each step no bigger than the places
|
|
122
|
-
* still open, so an issue that is later skipped (a pull request, a closed one) is replaced by the next key and nothing
|
|
123
|
-
* beyond the budget is fetched unless a skip made room. Within a step the fetches run together; the results keep the key
|
|
124
|
-
* order. The kept items come back oldest first, whichever end was chosen.
|
|
125
|
-
*/
|
|
126
|
-
async function readKeysLimited(input) {
|
|
127
|
-
const { keys, order, limit, concurrency, fetch, keep } = input;
|
|
128
|
-
const ordered = orderKeys(keys, order);
|
|
129
|
-
const kept = [];
|
|
130
|
-
let next = 0;
|
|
131
|
-
while (kept.length < limit && next < ordered.length) {
|
|
132
|
-
const step = ordered.slice(next, next + Math.min(concurrency, limit - kept.length));
|
|
133
|
-
next += step.length;
|
|
134
|
-
const fetched = await Promise.all(step.map((key) => fetch(key)));
|
|
135
|
-
for (const item of fetched) if (keep(item)) kept.push(item);
|
|
136
|
-
}
|
|
137
|
-
return order === "newest" ? kept.reverse() : kept;
|
|
138
|
-
}
|
|
139
|
-
// src/plugin/issues-provider/report-progress/report-progress.ts
|
|
140
|
-
/**
|
|
141
|
-
* Calls a provider's optional `onProgress` hook with how many items are done of how many. A hook that throws is
|
|
142
|
-
* ignored, because a progress counter must never change or stop the read or write it reports on.
|
|
143
|
-
*
|
|
144
|
-
* @param onProgress - The hook from `ExportInfo` or `ImportOptions`; nothing happens when it is not given.
|
|
145
|
-
* @param done - How many items are finished.
|
|
146
|
-
* @param total - How many items there are.
|
|
147
|
-
*/
|
|
148
|
-
function reportProgress(onProgress, done, total) {
|
|
149
|
-
try {
|
|
150
|
-
onProgress?.(done, total);
|
|
151
|
-
} catch {}
|
|
152
|
-
}
|
|
153
|
-
// src/plugin/probes/connection-probe/connection-probe.ts
|
|
154
|
-
/**
|
|
155
|
-
* The `connection` probe every provider offers, for telling a network problem from a credential problem. The checks are
|
|
156
|
-
* kyber's `connectionProbe`; this types the result as the plugin system's {@link Probe} and `verify` as `VerifyTokenResult`.
|
|
157
|
-
*/
|
|
158
|
-
function connectionProbe(input) {
|
|
159
|
-
return connectionProbe$1(input);
|
|
160
|
-
}
|
|
161
|
-
// src/commands/issue-types/classify-type-error/classify-type-error.ts
|
|
162
|
-
/** Reads a thrown error as one of the four things `ensureIssueTypes()` acts on differently. */
|
|
163
|
-
function classifyTypeError(err) {
|
|
164
|
-
if (!(err instanceof ProviderApiError)) return "other";
|
|
165
|
-
if (err.status === 429 || err.status === 403 && /rate limit/i.test(`${err.message} ${String(err.details)}`)) return "rate-limit";
|
|
166
|
-
if (err.status === 401 || err.status === 403) return "refused";
|
|
167
|
-
if (err.status === 409 || err.status === 422) return "conflict";
|
|
168
|
-
return "other";
|
|
169
|
-
}
|
|
170
|
-
// src/commands/issue-types/plan-issue-types/plan-issue-types.ts
|
|
171
|
-
/**
|
|
172
|
-
* Compares the declared Types with the organization's, by name ignoring case. A missing one is made; with `update` an
|
|
173
|
-
* existing one whose stated description or colour differs is updated (only those two fields, only when the declaration
|
|
174
|
-
* states them). `enabled` and the name are never compared: a Type is never renamed, turned on or off, or deleted.
|
|
175
|
-
*/
|
|
176
|
-
function planIssueTypes(declared, existing, update) {
|
|
177
|
-
const byName = new Map(existing.map((t) => [t.name.toLowerCase(), t]));
|
|
178
|
-
const actions = declared.map((d) => {
|
|
179
|
-
const have = byName.get(d.name.toLowerCase());
|
|
180
|
-
if (!have) return {
|
|
181
|
-
kind: "create",
|
|
182
|
-
declared: d
|
|
183
|
-
};
|
|
184
|
-
const changes = [];
|
|
185
|
-
if (update) {
|
|
186
|
-
if (d.description !== void 0 && d.description !== (have.description ?? "")) changes.push({
|
|
187
|
-
field: "description",
|
|
188
|
-
was: have.description ?? "",
|
|
189
|
-
to: d.description
|
|
190
|
-
});
|
|
191
|
-
if (d.color !== void 0 && d.color !== (have.color ?? "")) changes.push({
|
|
192
|
-
field: "color",
|
|
193
|
-
was: have.color ?? "",
|
|
194
|
-
to: d.color
|
|
195
|
-
});
|
|
196
|
-
}
|
|
197
|
-
return changes.length > 0 ? {
|
|
198
|
-
kind: "update",
|
|
199
|
-
declared: d,
|
|
200
|
-
existing: have,
|
|
201
|
-
changes
|
|
202
|
-
} : {
|
|
203
|
-
kind: "exists",
|
|
204
|
-
declared: d,
|
|
205
|
-
existing: have
|
|
206
|
-
};
|
|
207
|
-
});
|
|
208
|
-
return {
|
|
209
|
-
actions,
|
|
210
|
-
total: existing.length + actions.filter((a) => a.kind === "create").length
|
|
211
|
-
};
|
|
212
|
-
}
|
|
213
|
-
// src/commands/issue-types/ensure-issue-types/ensure-issue-types.ts
|
|
214
|
-
/**
|
|
215
|
-
* Makes the organization's issue Types match the org area's `issueTypes` (spec `tech-org-issue-types`, #2512).
|
|
216
|
-
*
|
|
217
|
-
* One function for both callers, `holocron apply issue-types` and the `setup` step (`caller`). It reads the list
|
|
218
|
-
* (`Issues.listTypes`), plans (`planIssueTypes()`: a missing name is made, and with `update` an existing Type's
|
|
219
|
-
* description or colour is brought in line), checks the limit, asks once, then writes in declaration order through
|
|
220
|
-
* `createType` / `updateType`. It never deletes, renames or changes `enabled`. It prints nothing and returns the rows;
|
|
221
|
-
* the caller shows them with `printCheckRows`.
|
|
222
|
-
*/
|
|
223
|
-
/** The most Types GitHub documents for an organization, the three defaults included (Decision 12; not verified). */
|
|
224
|
-
const MAX_ISSUE_TYPES = 25;
|
|
225
|
-
const WRITE_PERMISSION = "creating or changing issue Types needs an organization admin and the organization permission Issue types: write (HOLOCRON_ORG_TOKEN)";
|
|
226
|
-
const READ_PERMISSION = "reading the organization's issue Types needs the organization permission Issue types: read (HOLOCRON_ORG_TOKEN)";
|
|
227
|
-
const row = (id, title, status, detail, problems = []) => ({
|
|
228
|
-
id: `issue-types:${id}`,
|
|
229
|
-
title,
|
|
230
|
-
status,
|
|
231
|
-
detail,
|
|
232
|
-
problems
|
|
233
|
-
});
|
|
234
|
-
const toDeclaration = (t) => ({
|
|
235
|
-
name: t.name,
|
|
236
|
-
...t.description !== void 0 ? { description: t.description } : {},
|
|
237
|
-
...t.color !== void 0 ? { color: t.color } : {},
|
|
238
|
-
...t.enabled !== void 0 ? { enabled: t.enabled } : {}
|
|
239
|
-
});
|
|
240
|
-
/** Reads the declared Types against the organization and, unless `dryRun`, writes the difference. See the file comment. */
|
|
241
|
-
async function ensureIssueTypes(input) {
|
|
242
|
-
const created = [];
|
|
243
|
-
const updated = [];
|
|
244
|
-
const refused = input.caller === "setup" ? "skip" : "fail";
|
|
245
|
-
const stop = (status, detail, problems = []) => ({
|
|
246
|
-
status,
|
|
247
|
-
rows: [row("types", "issue types", status, detail, problems)],
|
|
248
|
-
created,
|
|
249
|
-
updated
|
|
250
|
-
});
|
|
251
|
-
const declared = input.declared ?? [];
|
|
252
|
-
if (declared.length === 0) return stop("skip", "no issueTypes declared in the org area");
|
|
253
|
-
const issues = input.issues;
|
|
254
|
-
if (!issues) return stop(refused, input.missingReason ?? "no `issues` provider to read the Types with");
|
|
255
|
-
if (!issues.listTypes || !issues.createType) return stop("skip", `the \`${issues.providerName}\` provider has no issue Types`);
|
|
256
|
-
let existing;
|
|
257
|
-
try {
|
|
258
|
-
existing = await issues.listTypes();
|
|
259
|
-
} catch (err) {
|
|
260
|
-
return stop(refused, classifyTypeError(err) === "refused" ? READ_PERMISSION : describeError(err));
|
|
261
|
-
}
|
|
262
|
-
if (existing === void 0) return stop(refused, `cannot read the organization's issue Types: ${READ_PERMISSION}`);
|
|
263
|
-
const plan = planIssueTypes(declared, existing, input.update);
|
|
264
|
-
const creates = plan.actions.filter((a) => a.kind === "create");
|
|
265
|
-
if (creates.length > 0 && plan.total > 25) return stop(refused, `${existing.length} Types exist and ${creates.length} more would be made: ${plan.total} is over the limit of 25; nothing was written`);
|
|
266
|
-
const todo = plan.actions.filter((a) => a.kind !== "exists");
|
|
267
|
-
if (input.dryRun || todo.length === 0) {
|
|
268
|
-
const rows = plan.actions.map((a) => describeAction(a));
|
|
269
|
-
const names = (kind) => plan.actions.filter((a) => a.kind === kind).map((a) => a.declared.name);
|
|
270
|
-
return {
|
|
271
|
-
status: "ok",
|
|
272
|
-
rows,
|
|
273
|
-
created: input.dryRun ? names("create") : [],
|
|
274
|
-
updated: input.dryRun ? names("update") : []
|
|
275
|
-
};
|
|
276
|
-
}
|
|
277
|
-
if (!input.yes) {
|
|
278
|
-
if (!(input.interactive ?? Boolean(process.stdin.isTTY))) {
|
|
279
|
-
if (input.caller === "apply") throw new NonInteractiveError("`apply issue-types` changes the organization's issue Types; pass --yes to run it without asking");
|
|
280
|
-
return stop("skip", "changing the organization's issue Types needs an answer: pass --yes");
|
|
281
|
-
}
|
|
282
|
-
if (!await (input.confirm ?? ((message) => confirm({
|
|
283
|
-
message,
|
|
284
|
-
default: false
|
|
285
|
-
})))(`Change the organization's issue Types?\n${todo.map((a) => ` ${describeAction(a).detail} ${a.declared.name}`).join("\n")}`)) return {
|
|
286
|
-
status: "cancelled",
|
|
287
|
-
rows: [row("types", "issue types", "skip", "cancelled; nothing was changed")],
|
|
288
|
-
created,
|
|
289
|
-
updated
|
|
290
|
-
};
|
|
291
|
-
}
|
|
292
|
-
const rows = [];
|
|
293
|
-
let limited = false;
|
|
294
|
-
let refusedOnce = false;
|
|
295
|
-
for (const action of plan.actions) {
|
|
296
|
-
const name = action.declared.name;
|
|
297
|
-
if (action.kind === "exists") {
|
|
298
|
-
rows.push(describeAction(action));
|
|
299
|
-
continue;
|
|
300
|
-
}
|
|
301
|
-
if (limited) {
|
|
302
|
-
rows.push(row(name, name, "skip", "left: stopped at a rate limit"));
|
|
303
|
-
continue;
|
|
304
|
-
}
|
|
305
|
-
if (refusedOnce) {
|
|
306
|
-
rows.push(row(name, name, refused, "not written: the token was refused"));
|
|
307
|
-
continue;
|
|
308
|
-
}
|
|
309
|
-
try {
|
|
310
|
-
if (action.kind === "create") {
|
|
311
|
-
await issues.createType(toDeclaration(action.declared));
|
|
312
|
-
created.push(name);
|
|
313
|
-
rows.push(row(name, name, "ok", "created"));
|
|
314
|
-
} else {
|
|
315
|
-
const patch = Object.fromEntries(action.changes.map((c) => [c.field, c.to]));
|
|
316
|
-
await issues.updateType?.(action.existing.id, patch);
|
|
317
|
-
updated.push(name);
|
|
318
|
-
rows.push(row(name, name, "ok", `updated ${action.changes.map((c) => c.field).join(", ")}`));
|
|
319
|
-
}
|
|
320
|
-
} catch (err) {
|
|
321
|
-
const kind = classifyTypeError(err);
|
|
322
|
-
if (kind === "rate-limit") {
|
|
323
|
-
limited = true;
|
|
324
|
-
rows.push(row(name, name, "fail", "rate limited: stopped; run it again to finish"));
|
|
325
|
-
} else if (kind === "refused") {
|
|
326
|
-
refusedOnce = true;
|
|
327
|
-
rows.push(row(name, name, refused, WRITE_PERMISSION));
|
|
328
|
-
} else if (kind === "conflict" && action.kind === "create" && await nowExists(issues, name)) rows.push(row(name, name, "ok", "exists (made in the meantime)"));
|
|
329
|
-
else rows.push(row(name, name, "fail", describeError(err)));
|
|
330
|
-
}
|
|
331
|
-
}
|
|
332
|
-
return {
|
|
333
|
-
status: rows.some((r) => r.status === "fail") ? "fail" : rows.every((r) => r.status === "skip") ? "skip" : "ok",
|
|
334
|
-
rows,
|
|
335
|
-
created,
|
|
336
|
-
updated
|
|
337
|
-
};
|
|
338
|
-
}
|
|
339
|
-
/** After a 409 or 422 on create: whether the name is in the organization's list now. */
|
|
340
|
-
async function nowExists(issues, name) {
|
|
341
|
-
try {
|
|
342
|
-
return (await issues.listTypes?.() ?? []).some((t) => t.name.toLowerCase() === name.toLowerCase());
|
|
343
|
-
} catch {
|
|
344
|
-
return false;
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
/** The row of an action that is not carried out (a dry run, or the list shown before asking), or that needs none. */
|
|
348
|
-
function describeAction(action) {
|
|
349
|
-
const name = action.declared.name;
|
|
350
|
-
if (action.kind === "create") return row(name, name, "skip", "would create");
|
|
351
|
-
if (action.kind === "update") {
|
|
352
|
-
const fields = action.changes.map((c) => c.field).join(", ");
|
|
353
|
-
return row(name, name, "skip", `would update ${fields}`, action.changes.map((c) => `${c.field}: was ${JSON.stringify(c.was)}, to ${JSON.stringify(c.to)}`));
|
|
354
|
-
}
|
|
355
|
-
return row(name, name, "ok", action.existing.enabled ? "exists" : "exists (turned off in the organization)");
|
|
356
|
-
}
|
|
357
84
|
// src/commands/notifications-reaction/layout-reactions/layout-reactions.ts
|
|
358
85
|
/**
|
|
359
86
|
* Every reaction a layout writes that can name a server emoji: each forum's default and starter reactions and its tags'
|
|
@@ -509,6 +236,82 @@ function tagEmojiProblem(tagName, emoji, pictured) {
|
|
|
509
236
|
if (pictured.has(emoji.slice(1, -1))) return void 0;
|
|
510
237
|
return `${noun} \`${emoji}\` has no picture: give the emoji an \`image\` in \`emojis\` or a reaction so \`setup\` can make it`;
|
|
511
238
|
}
|
|
239
|
+
// src/plugin/issues-provider/order-keys/order-keys.ts
|
|
240
|
+
/**
|
|
241
|
+
* Puts issue keys in creation order without asking the tracker: issue numbers (`#12`, `ENG-12`) rise with creation inside
|
|
242
|
+
* one repository or team, so the trailing number is the order. `oldest` is ascending, `newest` descending; keys with the
|
|
243
|
+
* same number keep their place. A key with no trailing number is an error, because nothing can be said of its age.
|
|
244
|
+
*/
|
|
245
|
+
function orderKeys(keys, order) {
|
|
246
|
+
const numbered = keys.map((key, index) => {
|
|
247
|
+
const match = /(\d+)\s*$/.exec(key);
|
|
248
|
+
if (!match) throw new Error(`Cannot order "${key}" by creation: it has no issue number.`);
|
|
249
|
+
return {
|
|
250
|
+
key,
|
|
251
|
+
index,
|
|
252
|
+
n: Number(match[1])
|
|
253
|
+
};
|
|
254
|
+
});
|
|
255
|
+
const sign = order === "newest" ? -1 : 1;
|
|
256
|
+
return numbered.sort((a, b) => sign * (a.n - b.n) || a.index - b.index).map((e) => e.key);
|
|
257
|
+
}
|
|
258
|
+
// src/plugin/issues-provider/pick-by-creation/pick-by-creation.ts
|
|
259
|
+
/**
|
|
260
|
+
* Keeps the first or last `limit` of a listing by creation time, returned oldest first. `createdAt` reads an item's
|
|
261
|
+
* ISO timestamp; items created in the same instant keep their listed order. The cut happens on what the listing already
|
|
262
|
+
* holds, so no request is spent on an item that is dropped.
|
|
263
|
+
*/
|
|
264
|
+
function pickByCreation(items, createdAt, order, limit) {
|
|
265
|
+
const ascending = items.map((item, index) => ({
|
|
266
|
+
item,
|
|
267
|
+
index,
|
|
268
|
+
at: Date.parse(createdAt(item))
|
|
269
|
+
})).sort((a, b) => a.at - b.at || a.index - b.index).map((e) => e.item);
|
|
270
|
+
return order === "newest" ? ascending.slice(Math.max(ascending.length - limit, 0)) : ascending.slice(0, limit);
|
|
271
|
+
}
|
|
272
|
+
// src/plugin/issues-provider/read-keys-limited/read-keys-limited.ts
|
|
273
|
+
/**
|
|
274
|
+
* Reads an explicit list of issues in creation order until `limit` of them are kept. The keys are sorted by number first
|
|
275
|
+
* (see {@link orderKeys}), then fetched in small steps of at most `concurrency`, each step no bigger than the places
|
|
276
|
+
* still open, so an issue that is later skipped (a pull request, a closed one) is replaced by the next key and nothing
|
|
277
|
+
* beyond the budget is fetched unless a skip made room. Within a step the fetches run together; the results keep the key
|
|
278
|
+
* order. The kept items come back oldest first, whichever end was chosen.
|
|
279
|
+
*/
|
|
280
|
+
async function readKeysLimited(input) {
|
|
281
|
+
const { keys, order, limit, concurrency, fetch, keep } = input;
|
|
282
|
+
const ordered = orderKeys(keys, order);
|
|
283
|
+
const kept = [];
|
|
284
|
+
let next = 0;
|
|
285
|
+
while (kept.length < limit && next < ordered.length) {
|
|
286
|
+
const step = ordered.slice(next, next + Math.min(concurrency, limit - kept.length));
|
|
287
|
+
next += step.length;
|
|
288
|
+
const fetched = await Promise.all(step.map((key) => fetch(key)));
|
|
289
|
+
for (const item of fetched) if (keep(item)) kept.push(item);
|
|
290
|
+
}
|
|
291
|
+
return order === "newest" ? kept.reverse() : kept;
|
|
292
|
+
}
|
|
293
|
+
// src/plugin/issues-provider/report-progress/report-progress.ts
|
|
294
|
+
/**
|
|
295
|
+
* Calls a provider's optional `onProgress` hook with how many items are done of how many. A hook that throws is
|
|
296
|
+
* ignored, because a progress counter must never change or stop the read or write it reports on.
|
|
297
|
+
*
|
|
298
|
+
* @param onProgress - The hook from `ExportInfo` or `ImportOptions`; nothing happens when it is not given.
|
|
299
|
+
* @param done - How many items are finished.
|
|
300
|
+
* @param total - How many items there are.
|
|
301
|
+
*/
|
|
302
|
+
function reportProgress(onProgress, done, total) {
|
|
303
|
+
try {
|
|
304
|
+
onProgress?.(done, total);
|
|
305
|
+
} catch {}
|
|
306
|
+
}
|
|
307
|
+
// src/plugin/probes/connection-probe/connection-probe.ts
|
|
308
|
+
/**
|
|
309
|
+
* The `connection` probe every provider offers, for telling a network problem from a credential problem. The checks are
|
|
310
|
+
* kyber's `connectionProbe`; this types the result as the plugin system's {@link Probe} and `verify` as `VerifyTokenResult`.
|
|
311
|
+
*/
|
|
312
|
+
function connectionProbe(input) {
|
|
313
|
+
return connectionProbe$1(input);
|
|
314
|
+
}
|
|
512
315
|
// src/commands/notifications-sync-roles/links.ts
|
|
513
316
|
const EMPTY_LINKS = {
|
|
514
317
|
version: 1,
|
|
@@ -1479,4 +1282,4 @@ function resolveCredentialsFile(base, file, makeDir = (dir) => void mkdirSync(di
|
|
|
1479
1282
|
isDefault: true
|
|
1480
1283
|
};
|
|
1481
1284
|
}
|
|
1482
|
-
export { AREA_LABEL_COLOR, AREA_PREFIX, AuthError, BUILTIN_TEMPLATES, CANONICAL_LABELS, CARDINALITY, CUSTOM_EMOJI, ConfigError, ConfigFileError, DEFAULT_TEMPLATES_DIR, DEFAULT_TOKEN_ROTATION, EMOJI_MEDIA_DIR, ElevationRequiredError, HOLOCRON_AREAS, KNOWN_STACK_DEPS, MAX_EMOJI_BYTES,
|
|
1285
|
+
export { AREA_LABEL_COLOR, AREA_PREFIX, AuthError, BUILTIN_TEMPLATES, CANONICAL_LABELS, CARDINALITY, CUSTOM_EMOJI, ConfigError, ConfigFileError, DEFAULT_TEMPLATES_DIR, DEFAULT_TOKEN_ROTATION, EMOJI_MEDIA_DIR, ElevationRequiredError, HOLOCRON_AREAS, KNOWN_STACK_DEPS, MAX_EMOJI_BYTES, MissingTokenError, PRIVATE_CREDENTIALS_FILE, ProviderApiError, REQUIRED_CAPABILITIES, SHARED_AREAS, WebhookVerificationError, areaForScope, areaLabelDefs, areaLabelsForFiles, areaLabelsForTitle, compose, connectionProbe, coverageExpectations, createFeatureResolver, createResolveToken, createRestClient, credentialsEnvironment, defineConfig, deriveCapabilities, deriveCompliance, deriveProfile, deriveStack, emojiConflictProblem, ignoreAdvice, isMulti, keyring, layoutEmojis, layoutReactions, loadConfig, loadEmojiImage, missingCapabilities, orderKeys, parseReaction, pathMatches, pickByCreation, placeAreas, planPullRequestStatus, planReconcile, reactionProblem, reactionSpelling, readKeysLimited, readLinks, readWorkspacePackageJsons, reportProgress, resolveConfig, resolveCredentialsFile, resolveEntry, resolveEnvironmentId, resolvePluginPackage, resolveProjectOptions, resolveValue, roleTeamProblem, sourceProblem, stdoutKind, syncRoles, tagEmojiProblem, titleScopes, tokenExpectations, tokenRotationRows };
|
package/dist/presets.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theholocron/cli",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.520",
|
|
4
4
|
"description": "The Holocron CLI - a pluggable, capability-based orchestrator for spinning up and operating software projects.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cli",
|
|
@@ -59,19 +59,19 @@
|
|
|
59
59
|
"posthog-node": "^5.74.0",
|
|
60
60
|
"tsx": "4.23.15",
|
|
61
61
|
"yargs": "^18.1.0",
|
|
62
|
-
"@theholocron/astromech": "5.0.0-alpha.
|
|
63
|
-
"@theholocron/dagobah": "5.0.0-alpha.
|
|
62
|
+
"@theholocron/astromech": "5.0.0-alpha.520",
|
|
63
|
+
"@theholocron/dagobah": "5.0.0-alpha.520",
|
|
64
64
|
"@theholocron/env-utils": "^1.17.0-alpha.5",
|
|
65
|
-
"@theholocron/datapad": "5.0.0-alpha.519",
|
|
66
|
-
"@theholocron/fs-utils": "^1.17.0-alpha.5",
|
|
67
65
|
"@theholocron/git-utils": "^1.17.0-alpha.5",
|
|
68
|
-
"@theholocron/kyber": "5.0.0-alpha.519",
|
|
69
66
|
"@theholocron/github-client": "^1.58.0-alpha.52",
|
|
67
|
+
"@theholocron/datapad": "5.0.0-alpha.520",
|
|
70
68
|
"@theholocron/json-utils": "^1.17.0-alpha.5",
|
|
69
|
+
"@theholocron/http-client": "^1.58.0-alpha.52",
|
|
70
|
+
"@theholocron/fs-utils": "^1.17.0-alpha.5",
|
|
71
|
+
"@theholocron/kyber": "5.0.0-alpha.520",
|
|
71
72
|
"@theholocron/misc-utils": "^1.17.0-alpha.5",
|
|
72
|
-
"@theholocron/observability": "^0.7.0-alpha.6",
|
|
73
73
|
"@theholocron/pkg-utils": "^1.17.0-alpha.5",
|
|
74
|
-
"@theholocron/
|
|
74
|
+
"@theholocron/observability": "^0.7.0-alpha.6"
|
|
75
75
|
},
|
|
76
76
|
"devDependencies": {
|
|
77
77
|
"@types/node": "^26",
|
|
@@ -85,9 +85,9 @@
|
|
|
85
85
|
"typescript": "^6.0.3",
|
|
86
86
|
"vitest": "^5.1.0",
|
|
87
87
|
"@theholocron/eslint-config": "^8.9.0-alpha.22",
|
|
88
|
-
"@theholocron/
|
|
88
|
+
"@theholocron/vitest-config": "^8.9.0-alpha.22",
|
|
89
89
|
"@theholocron/tsconfig": "^8.9.0-alpha.22",
|
|
90
|
-
"@theholocron/
|
|
90
|
+
"@theholocron/rollup-plugin-transform-template": "^8.9.0-alpha.22"
|
|
91
91
|
},
|
|
92
92
|
"engines": {
|
|
93
93
|
"node": ">=22.0.0"
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { CARDINALITY, REQUIRED_CAPABILITIES } from "./plugin/capabilities.mjs";
|
|
2
2
|
import { resolveTaskName } from "@theholocron/astromech";
|
|
3
|
+
import { basename, dirname } from "node:path";
|
|
3
4
|
import { resolvePluginPackage as resolvePluginPackage$1 } from "@theholocron/kyber/plugins";
|
|
4
5
|
import { ConfigError, ConfigError as ConfigError$1, ConfigFileError, createConfigSystem, lastWins, mergeByKey, shallowMerge, union } from "@theholocron/kyber/config";
|
|
5
6
|
import { readGitRemote } from "@theholocron/git-utils";
|
|
6
|
-
import { basename, dirname } from "node:path";
|
|
7
7
|
import { readPackageJson } from "@theholocron/pkg-utils";
|
|
8
8
|
import { loadTasksConfig } from "@theholocron/astromech/config";
|
|
9
9
|
// src/credentials-environments/derives-environment/derives-environment.ts
|