@theholocron/cli 2.0.0-alpha.1 → 2.0.0-alpha.10

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.
@@ -1,2 +1,535 @@
1
- import { $ as Tooling, A as Environments, B as ProviderApiError, C as DeploymentTarget, D as DnsRecordType, E as DnsRecord, F as LifecycleSlot, G as ResolvedCapability, H as REQUIRED_CAPABILITIES, I as NormalizedAuthUser, J as Secrets, K as Ruleset, L as Notifications, M as IssueSearchFilter, N as Issues, O as Environment, P as LifecycleResult, Q as StorageBranch, R as Observability, S as DeploymentRecord, T as Dns, U as RepoRef, V as ProviderIdentity, W as RepoSettings, X as StatusCategory, Y as Source, Z as Storage, _ as ConnectionStringOptions, a as AuthEventType, at as WebhookVerificationError, b as DeploymentProject, c as CARDINALITY, d as Cardinality, et as ToolingDoctorReport, f as CardinalityFor, g as CiRunStatus, h as CiRunFilter, i as AuthEvent, it as WebhookDashboardInfo, j as Issue, k as EnvironmentReviewer, l as CapabilityImpls, m as CiRun, n as Auth, nt as TrackerUser, o as AuthIdentity, ot as isMulti, p as Ci, q as SecretScope, r as AuthDescription, rt as Vault, s as AuthUser, t as Analytics, tt as TrackerDoctorReport, u as CapabilityKey, v as CreateAuthUserInput, w as DeploymentTrigger, x as DeploymentProjectSettings, y as Deployment, z as ParseWebhookInput } from "../index-CSxf0Yc7.mjs";
2
- export { Analytics, Auth, AuthDescription, AuthEvent, AuthEventType, AuthIdentity, AuthUser, CARDINALITY, CapabilityImpls, CapabilityKey, Cardinality, CardinalityFor, Ci, CiRun, CiRunFilter, CiRunStatus, ConnectionStringOptions, CreateAuthUserInput, Deployment, DeploymentProject, DeploymentProjectSettings, DeploymentRecord, DeploymentTarget, DeploymentTrigger, Dns, DnsRecord, DnsRecordType, Environment, EnvironmentReviewer, Environments, Issue, IssueSearchFilter, Issues, LifecycleResult, LifecycleSlot, NormalizedAuthUser, Notifications, Observability, ParseWebhookInput, ProviderApiError, ProviderIdentity, REQUIRED_CAPABILITIES, RepoRef, RepoSettings, ResolvedCapability, Ruleset, SecretScope, Secrets, Source, StatusCategory, Storage, StorageBranch, Tooling, ToolingDoctorReport, TrackerDoctorReport, TrackerUser, Vault, WebhookDashboardInfo, WebhookVerificationError, isMulti };
1
+ //#region src/capabilities/index.d.ts
2
+ /**
3
+ * Capability interfaces — the contracts that providers implement.
4
+ *
5
+ * Each capability has a stable key (`'source'`, `'ci'`, …) and a
6
+ * cardinality (`'single'` = one provider; `'many'` = several active
7
+ * at once). The cardinality is part of the type contract via
8
+ * `CardinalityFor<K>` so config resolution + command code can branch
9
+ * statically.
10
+ *
11
+ * See `.notes/tech-architecture.spec.md` for the design narrative
12
+ * (status: proposed, issue: #74).
13
+ */
14
+ type CapabilityKey = "source" | "ci" | "secrets" | "environments" | "issues" | "deployment" | "storage" | "auth" | "vault" | "dns" | "tooling" | "notifications" | "analytics" | "observability";
15
+ type Cardinality = "single" | "many";
16
+ declare const CARDINALITY: {
17
+ readonly source: "single";
18
+ readonly ci: "single";
19
+ readonly secrets: "single";
20
+ readonly environments: "single";
21
+ readonly issues: "single";
22
+ readonly deployment: "single";
23
+ readonly storage: "single";
24
+ readonly auth: "single";
25
+ readonly vault: "single";
26
+ readonly dns: "single";
27
+ readonly tooling: "many";
28
+ readonly notifications: "many";
29
+ readonly analytics: "many";
30
+ readonly observability: "many";
31
+ };
32
+ /**
33
+ * No capabilities are strictly required — repos without secrets (e.g. org
34
+ * community health repos) legitimately omit vault. Plugins validate their
35
+ * own requirements at call time.
36
+ */
37
+ declare const REQUIRED_CAPABILITIES: readonly CapabilityKey[];
38
+ interface ProviderIdentity {
39
+ readonly key: CapabilityKey;
40
+ readonly providerName: string;
41
+ }
42
+ /**
43
+ * Surfaced from every capability call that hits a vendor API. Wraps
44
+ * the underlying error with `status` (HTTP) and `details` so
45
+ * orchestrators (`holocron setup`, `doctor`) can soft-skip rather
46
+ * than abort.
47
+ */
48
+ declare class ProviderApiError extends Error {
49
+ readonly status: number | undefined;
50
+ readonly details?: unknown | undefined;
51
+ name: string;
52
+ constructor(message: string, status: number | undefined, details?: unknown | undefined);
53
+ }
54
+ interface Ruleset {
55
+ id: number;
56
+ name: string;
57
+ enforcement: "active" | "evaluate" | "disabled";
58
+ target?: string;
59
+ }
60
+ interface RepoSettings {
61
+ allow_squash_merge?: boolean;
62
+ allow_merge_commit?: boolean;
63
+ allow_rebase_merge?: boolean;
64
+ allow_auto_merge?: boolean;
65
+ /** Always suggest updating PR branches when the base branch has new commits. */
66
+ allow_update_branch?: boolean;
67
+ delete_branch_on_merge?: boolean;
68
+ default_branch?: string;
69
+ has_issues?: boolean;
70
+ has_discussions?: boolean;
71
+ has_projects?: boolean;
72
+ has_wiki?: boolean;
73
+ }
74
+ interface RepoRef {
75
+ owner: string;
76
+ name: string;
77
+ defaultBranch: string;
78
+ }
79
+ interface Source extends ProviderIdentity {
80
+ readonly key: "source";
81
+ /** Auth sanity-check. Throws ProviderApiError on auth failure. */
82
+ whoami(): Promise<{
83
+ login: string;
84
+ }>;
85
+ getRepo(): Promise<RepoRef>;
86
+ listRulesets(): Promise<Ruleset[]>;
87
+ createRuleset(payload: Record<string, unknown>): Promise<Ruleset>;
88
+ updateRuleset(id: number, payload: Record<string, unknown>): Promise<Ruleset>;
89
+ updateRepoSettings(settings: RepoSettings): Promise<void>;
90
+ /**
91
+ * Classic branch protection — fallback for private repos on free plans
92
+ * where the Rulesets API (requires Team+) returns 403.
93
+ */
94
+ protectBranch(branch: string, payload: Record<string, unknown>): Promise<void>;
95
+ enableVulnerabilityAlerts(): Promise<void>;
96
+ enableAutomatedSecurityFixes(): Promise<void>;
97
+ enableSecretScanning(): Promise<void>;
98
+ enablePrivateVulnerabilityReporting(): Promise<void>;
99
+ /**
100
+ * Enables the dependency graph and automatic dependency snapshot
101
+ * submission. Also enables secret-scanning validity checks and
102
+ * non-provider pattern detection — these require GitHub Advanced
103
+ * Security at the org level; the call is accepted but may be a no-op
104
+ * until that is configured.
105
+ */
106
+ enableDependencyGraph(): Promise<void>;
107
+ /**
108
+ * Enables CodeQL default setup with the extended query suite and
109
+ * `threat_model: all` (scans both remote and local exploit paths).
110
+ * Triggers a new analysis run; returns the run id.
111
+ */
112
+ enableCodeScanning(): Promise<string>;
113
+ listWorkflowFiles(): Promise<string[]>;
114
+ readWorkflowFile(name: string): Promise<string | null>;
115
+ writeWorkflowFile(name: string, contents: string): Promise<void>;
116
+ removeWorkflowFile(name: string): Promise<void>;
117
+ /**
118
+ * Write an arbitrary file relative to the repo root. Used for
119
+ * provisioning config files that live outside `.github/workflows/`
120
+ * (e.g. `.github/dependabot.yml`).
121
+ */
122
+ writeRepoFile(path: string, contents: string): Promise<void>;
123
+ }
124
+ type CiRunStatus = "queued" | "in_progress" | "completed" | "cancelled" | "failure" | "success" | "skipped";
125
+ interface CiRun {
126
+ id: string | number;
127
+ workflowName: string;
128
+ branch: string;
129
+ sha: string;
130
+ status: CiRunStatus;
131
+ url: string;
132
+ startedAt: string;
133
+ completedAt?: string;
134
+ }
135
+ interface CiRunFilter {
136
+ branch?: string;
137
+ status?: CiRunStatus;
138
+ limit?: number;
139
+ }
140
+ interface Ci extends ProviderIdentity {
141
+ readonly key: "ci";
142
+ listRuns(filter?: CiRunFilter): Promise<CiRun[]>;
143
+ getRun(id: string | number): Promise<CiRun>;
144
+ }
145
+ type SecretScope = {
146
+ kind: "repo";
147
+ } | {
148
+ kind: "environment";
149
+ name: string;
150
+ } | {
151
+ kind: "organization";
152
+ name: string;
153
+ };
154
+ interface Secrets extends ProviderIdentity {
155
+ readonly key: "secrets";
156
+ /** List secret NAMES (not values) at the given scope. */
157
+ listSecrets(scope: SecretScope): Promise<string[]>;
158
+ /** Idempotent upsert. Adapter handles encryption. */
159
+ setSecret(scope: SecretScope, name: string, value: string): Promise<void>;
160
+ deleteSecret(scope: SecretScope, name: string): Promise<void>;
161
+ }
162
+ interface EnvironmentReviewer {
163
+ type: "User" | "Team";
164
+ /** Numeric id — GitHub's reviewer API silently ignores login strings. */
165
+ id: number;
166
+ }
167
+ interface Environment {
168
+ name: string;
169
+ reviewers?: EnvironmentReviewer[];
170
+ waitTimer?: number;
171
+ preventSelfReview?: boolean;
172
+ }
173
+ interface Environments extends ProviderIdentity {
174
+ readonly key: "environments";
175
+ listEnvironments(): Promise<Environment[]>;
176
+ upsertEnvironment(env: Environment): Promise<void>;
177
+ deleteEnvironment(name: string): Promise<void>;
178
+ }
179
+ type LifecycleSlot = "inProgress" | "inReview" | "done";
180
+ type StatusCategory = "open" | "in-progress" | "in-review" | "done" | "other";
181
+ interface TrackerUser {
182
+ id: string;
183
+ displayName: string;
184
+ emailAddress?: string;
185
+ }
186
+ interface Issue {
187
+ /** Human-readable key — "#42" for GitHub, "RANDO-42" for Jira. */
188
+ key: string;
189
+ /** Internal opaque id. */
190
+ id: string;
191
+ summary: string;
192
+ body?: string;
193
+ status: string;
194
+ statusCategory: StatusCategory;
195
+ assignee: TrackerUser | null;
196
+ updated: string;
197
+ url?: string;
198
+ }
199
+ interface IssueSearchFilter {
200
+ /** Restrict to issues assigned to a specific id, or 'currentUser'. */
201
+ assignee?: string | "currentUser";
202
+ /** Exclude issues in the `done` category. */
203
+ openOnly?: boolean;
204
+ /** Max number of issues to return. Adapters apply a sensible default. */
205
+ limit?: number;
206
+ }
207
+ interface LifecycleResult {
208
+ /** False when no API write happened (already at target state). */
209
+ transitioned: boolean;
210
+ /** Status name the issue is in after this call. */
211
+ status: string;
212
+ /** Adapter-specific note (e.g., "label set" / "closed (completed)"). */
213
+ via?: string;
214
+ }
215
+ interface TrackerDoctorReport {
216
+ /** "Authenticated as ..." subject for the spinner. */
217
+ authedAs: string;
218
+ /** Free-form "Project: RANDO" / "Repo: rando-id/rando" identifier. */
219
+ projectLabel: string;
220
+ /** Status values the adapter exposes. */
221
+ statuses: Array<{
222
+ name: string;
223
+ category: StatusCategory;
224
+ }>;
225
+ /**
226
+ * Per-lifecycle-slot readiness check. `resolved` indicates whether
227
+ * the configured value actually maps to something the tracker
228
+ * recognizes; the `note` is the rendered explanation.
229
+ */
230
+ lifecycle: Array<{
231
+ slot: LifecycleSlot;
232
+ value: string | null;
233
+ resolved: boolean;
234
+ note: string;
235
+ }>;
236
+ }
237
+ interface Issues extends ProviderIdentity {
238
+ readonly key: "issues";
239
+ /** Currently-authenticated user. */
240
+ getMyself(): Promise<TrackerUser>;
241
+ search(filter: IssueSearchFilter): Promise<Issue[]>;
242
+ get(key: string): Promise<Issue>;
243
+ create(input: {
244
+ summary: string;
245
+ body?: string;
246
+ labels?: string[]; /** Numeric id or exact title (case-insensitive). */
247
+ milestone?: string;
248
+ }): Promise<{
249
+ key: string;
250
+ }>;
251
+ /** Idempotent — `transitioned: false` if the issue is already at the target. */
252
+ transition(key: string, slot: LifecycleSlot): Promise<LifecycleResult>;
253
+ comment(key: string, body: string): Promise<void>;
254
+ doctor(): Promise<TrackerDoctorReport>;
255
+ }
256
+ /** Env-var scope on the deploy platform. */
257
+ type DeploymentTarget = "development" | "preview" | "production";
258
+ /**
259
+ * Named deployment trigger target — `undefined` means a branch
260
+ * preview (no named environment).
261
+ */
262
+ type DeploymentTrigger = "production" | "staging";
263
+ interface DeploymentProject {
264
+ id: string;
265
+ name: string;
266
+ framework?: string;
267
+ /** True when the project is linked to a Git provider. */
268
+ gitLinked?: boolean;
269
+ rootDirectory?: string | null;
270
+ }
271
+ interface DeploymentProjectSettings {
272
+ previewDeploymentsDisabled?: boolean;
273
+ /** Vercel-specific: whether the GitHub integration creates deployments
274
+ * for every push (false → only on-demand triggers). */
275
+ gitProviderCreateDeployments?: boolean;
276
+ }
277
+ interface DeploymentRecord {
278
+ id: string;
279
+ url: string;
280
+ /** Branch this deployment was made from (null if not git-sourced). */
281
+ branch: string | null;
282
+ /** Named environment if one was targeted; undefined for branch previews. */
283
+ target?: DeploymentTrigger;
284
+ status: "queued" | "building" | "ready" | "error" | "cancelled";
285
+ }
286
+ interface Deployment extends ProviderIdentity {
287
+ readonly key: "deployment";
288
+ listProjects(): Promise<DeploymentProject[]>;
289
+ /** Create if missing, otherwise return existing. Idempotent. */
290
+ ensureProject(input: {
291
+ name: string;
292
+ framework?: string; /** "owner/repo" — passed when linking to a Git provider. */
293
+ repo?: string;
294
+ rootDirectory?: string;
295
+ }): Promise<DeploymentProject>;
296
+ updateProjectSettings(projectId: string, settings: DeploymentProjectSettings): Promise<DeploymentProject>;
297
+ listEnvVars(projectId: string, target: DeploymentTarget): Promise<string[]>;
298
+ setEnvVar(projectId: string, target: DeploymentTarget, name: string, value: string): Promise<void>;
299
+ /**
300
+ * Kick off a deployment of the given branch. Omit `target` for a
301
+ * branch preview; pass `'production'` / `'staging'` to deploy into
302
+ * a named environment.
303
+ */
304
+ triggerDeployment(input: {
305
+ projectId: string;
306
+ branch: string;
307
+ target?: DeploymentTrigger;
308
+ }): Promise<DeploymentRecord>;
309
+ getDeployment(deploymentId: string): Promise<DeploymentRecord>;
310
+ }
311
+ interface StorageBranch {
312
+ id: string;
313
+ name: string;
314
+ /** Parent branch id; null for the root/main branch. */
315
+ parentId: string | null;
316
+ createdAt: string;
317
+ }
318
+ interface ConnectionStringOptions {
319
+ /** Use the pooled (PgBouncer) URL when available. Defaults to false. */
320
+ pooled?: boolean;
321
+ }
322
+ interface Storage extends ProviderIdentity {
323
+ readonly key: "storage";
324
+ /**
325
+ * Connection string for the given scope. Scope is provider-specific:
326
+ *
327
+ * - branch-based providers (Neon, PlanetScale): scope = branch
328
+ * name or id
329
+ * - flat providers (single Postgres instance): scope is ignored
330
+ *
331
+ * Callers (or the orchestrator) decide how a deploy target maps to
332
+ * a scope; the storage plugin doesn't own that mapping.
333
+ */
334
+ getConnectionString(scope: string, options?: ConnectionStringOptions): Promise<string>;
335
+ listBranches?(): Promise<StorageBranch[]>;
336
+ createBranch?(input: {
337
+ name: string;
338
+ from?: string;
339
+ }): Promise<StorageBranch>;
340
+ destroyBranch?(branch: string): Promise<void>;
341
+ /** Restore one branch to match another (e.g., reset preview → main). */
342
+ resetBranch?(input: {
343
+ branch: string;
344
+ from: string;
345
+ }): Promise<void>;
346
+ /**
347
+ * Provider-specific feature toggle. For Postgres providers this is
348
+ * `CREATE EXTENSION IF NOT EXISTS ...` per branch.
349
+ */
350
+ enableExtension?(input: {
351
+ branch: string;
352
+ extension: string;
353
+ }): Promise<void>;
354
+ }
355
+ interface AuthDescription {
356
+ provider: string;
357
+ /** Env-var names the app needs at runtime (CLERK_PUBLISHABLE_KEY, etc.). */
358
+ envKeys: string[];
359
+ }
360
+ interface AuthIdentity {
361
+ provider: string;
362
+ /** Provider-specific health signal (user count, role, account name, etc.). */
363
+ details?: Record<string, unknown>;
364
+ }
365
+ interface AuthUser {
366
+ id: string;
367
+ email: string;
368
+ }
369
+ interface CreateAuthUserInput {
370
+ email: string;
371
+ password: string;
372
+ firstName?: string;
373
+ lastName?: string;
374
+ }
375
+ interface WebhookDashboardInfo {
376
+ url: string;
377
+ }
378
+ interface Auth extends ProviderIdentity {
379
+ readonly key: "auth";
380
+ /** Env-var keys the runtime app needs. */
381
+ describe(): Promise<AuthDescription>;
382
+ /** Reachability probe — proves the configured key works. */
383
+ whoami(): Promise<AuthIdentity>;
384
+ /** Idempotent webhook backend provisioning (Clerk: Svix app). */
385
+ ensureWebhookApp?(): Promise<{
386
+ alreadyExists: boolean;
387
+ }>;
388
+ /** Deep-link to the provider's webhook config dashboard. */
389
+ getWebhookDashboardUrl?(): Promise<WebhookDashboardInfo>;
390
+ /** Seed a user (test fixtures, admin bootstrap). */
391
+ createUser?(input: CreateAuthUserInput): Promise<AuthUser>;
392
+ /** Wire the auth provider's webhook into the project's repo. */
393
+ syncWebhook?(input: {
394
+ repo: string;
395
+ secretRef: string;
396
+ }): Promise<void>;
397
+ }
398
+ type AuthEventType = "user.created" | "user.updated" | "user.deleted";
399
+ interface NormalizedAuthUser {
400
+ id: string;
401
+ email: string;
402
+ firstName?: string | null;
403
+ lastName?: string | null;
404
+ /** Provider-native fields preserved verbatim for consumers that need them. */
405
+ raw?: Record<string, unknown>;
406
+ }
407
+ interface AuthEvent {
408
+ type: AuthEventType;
409
+ user: NormalizedAuthUser;
410
+ /** ISO timestamp of when the event occurred. */
411
+ occurredAt: string;
412
+ }
413
+ interface ParseWebhookInput {
414
+ /** Raw request body (string or Buffer). */
415
+ body: string | Buffer;
416
+ /** Incoming HTTP headers — needed for signature verification. */
417
+ headers: Record<string, string | string[] | undefined>;
418
+ /** The signing secret the auth provider issued for this webhook endpoint. */
419
+ signingSecret: string;
420
+ }
421
+ declare class WebhookVerificationError extends Error {
422
+ name: string;
423
+ }
424
+ interface EnsureResult {
425
+ /** True when the resource already existed (idempotent no-op). */
426
+ alreadyExists: boolean;
427
+ }
428
+ interface Vault extends ProviderIdentity {
429
+ readonly key: "vault";
430
+ /**
431
+ * Read a secret by reference. The reference format is
432
+ * provider-specific (1P: "op://Vault/Item/field"; HashiCorp Vault:
433
+ * "kv/path#field"; etc.). Adapters validate the reference shape.
434
+ */
435
+ read(reference: string): Promise<string>;
436
+ /** Write or update a secret. */
437
+ write(reference: string, value: string): Promise<void>;
438
+ /** List secret keys available to the project. */
439
+ list(): Promise<string[]>;
440
+ /**
441
+ * Optional environment notion within the vault (e.g., 1P
442
+ * Environments — named KEY=VALUE bundles). Adapters without
443
+ * environments return [].
444
+ */
445
+ environments?(): Promise<string[]>;
446
+ /**
447
+ * Optional bulk read of an environment's KEY=VALUE pairs. Powers
448
+ * the `holocron secrets sync` flow where the orchestrator pulls a
449
+ * whole environment from the vault then fans the values out to
450
+ * destinations (CI secrets, deployment env vars, local .env).
451
+ */
452
+ readEnvironment?(environmentId: string): Promise<Record<string, string>>;
453
+ /**
454
+ * Optional — create the top-level project container in the vault
455
+ * if it does not exist. Idempotent: `alreadyExists: true` when the
456
+ * project was already there. Providers whose data model has no
457
+ * project notion (or that gate this behind a paid tier) omit this.
458
+ */
459
+ ensureProject?(name: string): Promise<EnsureResult>;
460
+ /**
461
+ * Optional — create a named environment/config inside a project
462
+ * (e.g., Doppler config `dev` / `stg` / `prd`). Idempotent.
463
+ * Providers whose data model has a single flat namespace omit this.
464
+ */
465
+ ensureEnvironment?(project: string, name: string): Promise<EnsureResult>;
466
+ }
467
+ type DnsRecordType = "A" | "AAAA" | "CNAME" | "TXT" | "MX" | "NS" | "SRV" | "CAA";
468
+ interface DnsRecord {
469
+ id?: string;
470
+ type: DnsRecordType;
471
+ name: string;
472
+ content: string;
473
+ ttl?: number;
474
+ priority?: number;
475
+ }
476
+ interface Dns extends ProviderIdentity {
477
+ readonly key: "dns";
478
+ listRecords(domain: string): Promise<DnsRecord[]>;
479
+ upsertRecord(domain: string, record: DnsRecord): Promise<DnsRecord>;
480
+ deleteRecord(domain: string, id: string): Promise<void>;
481
+ }
482
+ interface ToolingDoctorReport {
483
+ ok: boolean;
484
+ message: string;
485
+ }
486
+ interface Tooling extends ProviderIdentity {
487
+ readonly key: "tooling";
488
+ /** Sync the tool's authoritative state from the repo. */
489
+ sync(): Promise<void>;
490
+ doctor(): Promise<ToolingDoctorReport>;
491
+ }
492
+ interface Notifications extends ProviderIdentity {
493
+ readonly key: "notifications";
494
+ /**
495
+ * Send a message. `channel` is provider-specific (Slack channel id,
496
+ * Discord webhook url-name, etc.); adapters resolve from config.
497
+ */
498
+ send(channel: string, message: string): Promise<void>;
499
+ }
500
+ interface Analytics extends ProviderIdentity {
501
+ readonly key: "analytics";
502
+ describe(): Promise<{
503
+ provider: string;
504
+ dsnEnvKey: string;
505
+ }>;
506
+ }
507
+ interface Observability extends ProviderIdentity {
508
+ readonly key: "observability";
509
+ describe(): Promise<{
510
+ provider: string;
511
+ dsnEnvKey: string;
512
+ }>;
513
+ }
514
+ interface CapabilityImpls {
515
+ source: Source;
516
+ ci: Ci;
517
+ secrets: Secrets;
518
+ environments: Environments;
519
+ issues: Issues;
520
+ deployment: Deployment;
521
+ storage: Storage;
522
+ auth: Auth;
523
+ vault: Vault;
524
+ dns: Dns;
525
+ tooling: Tooling;
526
+ notifications: Notifications;
527
+ analytics: Analytics;
528
+ observability: Observability;
529
+ }
530
+ type CardinalityFor<K extends CapabilityKey> = (typeof CARDINALITY)[K];
531
+ /** Resolved runtime shape: single → one impl; many → array. */
532
+ type ResolvedCapability<K extends CapabilityKey> = CardinalityFor<K> extends "many" ? CapabilityImpls[K][] : CapabilityImpls[K];
533
+ declare function isMulti<K extends CapabilityKey>(key: K): CardinalityFor<K> extends "many" ? true : false;
534
+ //#endregion
535
+ export { Analytics, Auth, AuthDescription, AuthEvent, AuthEventType, AuthIdentity, AuthUser, CARDINALITY, CapabilityImpls, CapabilityKey, Cardinality, CardinalityFor, Ci, CiRun, CiRunFilter, CiRunStatus, ConnectionStringOptions, CreateAuthUserInput, Deployment, DeploymentProject, DeploymentProjectSettings, DeploymentRecord, DeploymentTarget, DeploymentTrigger, Dns, DnsRecord, DnsRecordType, EnsureResult, Environment, EnvironmentReviewer, Environments, Issue, IssueSearchFilter, Issues, LifecycleResult, LifecycleSlot, NormalizedAuthUser, Notifications, Observability, ParseWebhookInput, ProviderApiError, ProviderIdentity, REQUIRED_CAPABILITIES, RepoRef, RepoSettings, ResolvedCapability, Ruleset, SecretScope, Secrets, Source, StatusCategory, Storage, StorageBranch, Tooling, ToolingDoctorReport, TrackerDoctorReport, TrackerUser, Vault, WebhookDashboardInfo, WebhookVerificationError, isMulti };
@@ -1,2 +1,47 @@
1
- import { a as isMulti, i as WebhookVerificationError, n as ProviderApiError, r as REQUIRED_CAPABILITIES, t as CARDINALITY } from "../capabilities-QjjhVlDd.mjs";
1
+ //#region src/capabilities/index.ts
2
+ const CARDINALITY = {
3
+ source: "single",
4
+ ci: "single",
5
+ secrets: "single",
6
+ environments: "single",
7
+ issues: "single",
8
+ deployment: "single",
9
+ storage: "single",
10
+ auth: "single",
11
+ vault: "single",
12
+ dns: "single",
13
+ tooling: "many",
14
+ notifications: "many",
15
+ analytics: "many",
16
+ observability: "many"
17
+ };
18
+ /**
19
+ * No capabilities are strictly required — repos without secrets (e.g. org
20
+ * community health repos) legitimately omit vault. Plugins validate their
21
+ * own requirements at call time.
22
+ */
23
+ const REQUIRED_CAPABILITIES = [];
24
+ /**
25
+ * Surfaced from every capability call that hits a vendor API. Wraps
26
+ * the underlying error with `status` (HTTP) and `details` so
27
+ * orchestrators (`holocron setup`, `doctor`) can soft-skip rather
28
+ * than abort.
29
+ */
30
+ var ProviderApiError = class extends Error {
31
+ status;
32
+ details;
33
+ name = "ProviderApiError";
34
+ constructor(message, status, details) {
35
+ super(message);
36
+ this.status = status;
37
+ this.details = details;
38
+ }
39
+ };
40
+ var WebhookVerificationError = class extends Error {
41
+ name = "WebhookVerificationError";
42
+ };
43
+ function isMulti(key) {
44
+ return CARDINALITY[key] === "many";
45
+ }
46
+ //#endregion
2
47
  export { CARDINALITY, ProviderApiError, REQUIRED_CAPABILITIES, WebhookVerificationError, isMulti };