@theholocron/cli 5.0.0-alpha.414 → 5.0.0-alpha.416

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.
@@ -13,9 +13,53 @@ const DERIVING = /* @__PURE__ */ new Set(["1password"]);
13
13
  function derivesEnvironment(provider) {
14
14
  return DERIVING.has(provider);
15
15
  }
16
+ // src/credentials-environments/layer-environment/layer-environment.ts
17
+ /** The layer words, in the order the docs list them. */
18
+ const ENVIRONMENT_LAYERS = [
19
+ "local",
20
+ "dev",
21
+ "ci",
22
+ "prod"
23
+ ];
24
+ /** Whether `value` is exactly one of the layer words (case-sensitive: `Prod` is a literal Environment name). */
25
+ function isEnvironmentLayer(value) {
26
+ return typeof value === "string" && ENVIRONMENT_LAYERS.includes(value);
27
+ }
28
+ /**
29
+ * The Environment a layer of a repository is kept in: `<org/repo> - <layer>`. The one place the name is built, for the
30
+ * `credentials` providers (`environmentLayers()`) and for the config entries that name a `layer`.
31
+ */
32
+ function layerEnvironment(slug, layer) {
33
+ return `${slug} - ${layer}`;
34
+ }
35
+ // src/config/validate-environment-choice/validate-environment-choice.ts
36
+ /**
37
+ * Check that an entry names its vault Environment one way: a literal `environment`, or a `layer` the name is derived
38
+ * from (spec `tech-environment-layers`, #2069). Both together are an error, and so is a `layer` that is not a layer word
39
+ * or an `environment` that is blank. With neither, the entry is an error unless `required` is false.
40
+ *
41
+ * @param entry - The `environment` and `layer` the entry sets.
42
+ * @param what - How a message names the entry, e.g. "a `repo.secrets.deploy` entry".
43
+ * @param required - Whether the entry must name one of the two. Default true.
44
+ * @returns What the entry names (the environment, else the layer), for the rest of its messages; `undefined` for neither.
45
+ * @throws {ConfigError} Naming the entry and the problem.
46
+ */
47
+ function validateEnvironmentChoice(entry, what, required = true) {
48
+ const { environment, layer } = entry;
49
+ if (environment !== void 0 && layer !== void 0) throw new ConfigError(`${what} sets both \`layer\` and \`environment\`: name the Environment one way`);
50
+ if (layer !== void 0) {
51
+ if (!isEnvironmentLayer(layer)) throw new ConfigError(`${what} has \`layer\` ${JSON.stringify(layer)}: use ${ENVIRONMENT_LAYERS.map((l) => `"${l}"`).join(", ")}, or \`environment\` for a literal name`);
52
+ return layer;
53
+ }
54
+ if (environment !== void 0) {
55
+ if (typeof environment !== "string" || environment.trim() === "") throw new ConfigError(`${what} needs the name of a vault environment, got an empty \`environment\``);
56
+ return environment;
57
+ }
58
+ if (required) throw new ConfigError(`${what} needs the name of a vault environment (\`environment\`) or a \`layer\``);
59
+ }
16
60
  // src/config/validate-secrets-deploy/validate-secrets-deploy.ts
17
61
  /**
18
- * Check `repo.secrets.deploy`: each entry names a vault environment and at least one of a non-empty `keys` list and a
62
+ * Check `repo.secrets.deploy`: each entry names a vault environment (or a `layer`) and at least one of a non-empty `keys` list and a
19
63
  * non-empty `prefix`. An entry with neither would mean "all keys", which a deployment never gets (spec
20
64
  * `tech-deployment-key-allowlist`, #2061), so it is an error here and not a silent skip.
21
65
  *
@@ -24,14 +68,25 @@ function derivesEnvironment(provider) {
24
68
  */
25
69
  function validateSecretsDeploy(secrets) {
26
70
  for (const entry of secrets?.deploy ?? []) {
27
- if (typeof entry.environment !== "string" || entry.environment.trim() === "") throw new ConfigError("a `repo.secrets.deploy` entry needs the name of a vault environment");
28
- const label = `\`repo.secrets.deploy\` entry for ${JSON.stringify(entry.environment)}`;
71
+ const named = validateEnvironmentChoice(entry, "a `repo.secrets.deploy` entry");
72
+ const label = `\`repo.secrets.deploy\` entry for ${JSON.stringify(named)}`;
29
73
  const { keys, prefix } = entry;
30
74
  if (keys !== void 0 && (!Array.isArray(keys) || keys.some((k) => typeof k !== "string" || k === ""))) throw new ConfigError(`${label} has \`keys\` that is not a list of key names`);
31
75
  if (prefix !== void 0 && (typeof prefix !== "string" || prefix === "")) throw new ConfigError(`${label} has an empty \`prefix\``);
32
76
  if ((keys === void 0 || keys.length === 0) && prefix === void 0) throw new ConfigError(`${label} needs \`keys\` (a list of names) or \`prefix\` (such as "SENTINEL_"): a deployment never receives every key`);
33
77
  }
34
78
  }
79
+ // src/config/validate-secrets-sync/validate-secrets-sync.ts
80
+ /**
81
+ * Check `repo.secrets.sync`: each entry names its vault environment one way, a literal `environment` or a `layer`
82
+ * (spec `tech-environment-layers`, #2069).
83
+ *
84
+ * @param secrets - `repo.secrets`, if the config has it.
85
+ * @throws {ConfigError} Naming the first problem found.
86
+ */
87
+ function validateSecretsSync(secrets) {
88
+ for (const entry of secrets?.sync ?? []) validateEnvironmentChoice(entry, "a `repo.secrets.sync` entry");
89
+ }
35
90
  // src/config/validate-variables-sync/validate-variables-sync.ts
36
91
  /** GitHub treats variable names as case-insensitive, so every comparison goes through this. */
37
92
  const key = (name) => name.toUpperCase();
@@ -48,8 +103,8 @@ function validateVariablesSync(variables) {
48
103
  if (!entries || entries.length === 0) return;
49
104
  if (variables?.prune === true) throw new ConfigError("`repo.variables.prune` cannot be combined with `repo.variables.sync`: pruning would delete the variables the sync writes");
50
105
  for (const entry of entries) {
51
- if (typeof entry.environment !== "string" || entry.environment.trim() === "") throw new ConfigError("a `repo.variables.sync` entry needs the name of a vault environment");
52
- const label = `\`repo.variables.sync\` entry for ${JSON.stringify(entry.environment)}`;
106
+ const named = validateEnvironmentChoice(entry, "a `repo.variables.sync` entry");
107
+ const label = `\`repo.variables.sync\` entry for ${JSON.stringify(named)}`;
53
108
  if (!Array.isArray(entry.keys) || entry.keys.length === 0 || entry.keys.some((k) => typeof k !== "string" || k === "")) throw new ConfigError(`${label} needs \`keys\`, a list of variable names`);
54
109
  const scope = entry.scope ?? "repo";
55
110
  const org = scope.startsWith("org=") ? scope.slice(4) : void 0;
@@ -130,14 +185,11 @@ const HOSTNAME = /^[A-Za-z0-9]([A-Za-z0-9-]*[A-Za-z0-9])?(\.[A-Za-z0-9]([A-Za-z0
130
185
  function validateGitHubApps(apps) {
131
186
  if (!Array.isArray(apps)) throw new ConfigError$1("`githubApps` must be a list of { name, manifest, environment }");
132
187
  apps.forEach((app, idx) => {
133
- for (const key of [
134
- "name",
135
- "manifest",
136
- "environment"
137
- ]) {
188
+ for (const key of ["name", "manifest"]) {
138
189
  const value = app?.[key];
139
190
  if (typeof value !== "string" || value.trim() === "") throw new ConfigError$1(`\`githubApps[${idx}].${key}\` must be a non-empty string`);
140
191
  }
192
+ validateEnvironmentChoice(app, `\`githubApps[${idx}]\``);
141
193
  });
142
194
  }
143
195
  /** Throws a {@link ConfigError} naming the first thing wrong with the `ideas` block. */
@@ -154,7 +206,7 @@ function validateIdeas(ideas) {
154
206
  /** Throws a {@link ConfigError} naming the first thing wrong with the `dev` block. */
155
207
  function validateDev(dev) {
156
208
  const nonEmpty = (value) => typeof value === "string" && value.trim() !== "";
157
- if (dev.environment !== void 0 && !nonEmpty(dev.environment)) throw new ConfigError$1("`dev.environment` must be the name of a vault environment, got an empty value");
209
+ validateEnvironmentChoice(dev, "`dev`", false);
158
210
  if (dev.tunnel !== void 0) {
159
211
  if (!nonEmpty(dev.tunnel.name)) throw new ConfigError$1("`dev.tunnel.name` must be a name, got an empty value");
160
212
  if (typeof dev.tunnel.hostname !== "string" || !HOSTNAME.test(dev.tunnel.hostname)) throw new ConfigError$1(`\`dev.tunnel.hostname\` must be a hostname such as sentinel-dev.example.dev (no scheme or path), got ${JSON.stringify(dev.tunnel.hostname)}`);
@@ -169,6 +221,11 @@ function validateDev(dev) {
169
221
  if (serve.logging !== void 0 && !(nonEmpty(serve.logging.tokenVar) && nonEmpty(serve.logging.datasetVar))) throw new ConfigError$1("`dev.serve.logging` needs a `tokenVar` and a `datasetVar`, both variable names");
170
222
  }
171
223
  }
224
+ /** Throws a {@link ConfigError} when the `vault` entry's options name an Environment two ways, or a `layer` that is no layer word. */
225
+ function validateVaultLayer(entry) {
226
+ if (entry?.cardinality !== "single") return;
227
+ validateEnvironmentChoice(entry.tuple.options, "the `vault` provider's options", false);
228
+ }
172
229
  /** The values `repoValidation.docsCoverage` accepts. */
173
230
  const DOCS_COVERAGE_MODES = [
174
231
  "off",
@@ -210,6 +267,8 @@ function resolveConfig(raw) {
210
267
  if (raw.ideas !== void 0) validateIdeas(raw.ideas);
211
268
  validateVariablesSync(raw.repo?.variables);
212
269
  validateSecretsDeploy(raw.repo?.secrets);
270
+ validateSecretsSync(raw.repo?.secrets);
271
+ validateVaultLayer(providers.vault);
213
272
  const credentialsEntry = providers.credentials;
214
273
  if (credentialsEntry?.cardinality === "many") for (const tuple of credentialsEntry.tuples) {
215
274
  const own = tuple.options.environment;
@@ -246,6 +305,16 @@ function resolveConfig(raw) {
246
305
  eslint: raw.eslint
247
306
  };
248
307
  }
308
+ // src/credentials-environments/repo-slug/repo-slug.ts
309
+ /**
310
+ * The `<org>/<repo>` of the repository at `cwd`, from its `origin` remote. A remote that is missing or cannot be
311
+ * parsed is a `ConfigError` that names the `environment` option as the fix.
312
+ */
313
+ async function repoSlug(cwd, exec) {
314
+ const remote = await readGitRemote(cwd, exec ? { exec } : {});
315
+ if (!remote) throw new ConfigError(`cannot derive the 1Password Environment name: the \`origin\` remote of ${cwd} is missing or not an owner/repo URL. Give the \`credentials\` provider an \`environment\` option to name it.`);
316
+ return remote.slug;
317
+ }
249
318
  // src/config/compose/merge-sync/merge-sync.ts
250
319
  /**
251
320
  * Merge two lists of `repo.secrets.sync` (or `repo.variables.sync`) entries. An entry is the same sync when its
@@ -255,7 +324,11 @@ function resolveConfig(raw) {
255
324
  function mergeSync(a, b) {
256
325
  const merged = /* @__PURE__ */ new Map();
257
326
  for (const entry of [...a ?? [], ...b ?? []]) {
258
- const id = `${entry.environment}\0${entry.scope ?? "repo"}`;
327
+ const id = JSON.stringify([
328
+ entry.environment,
329
+ entry.layer,
330
+ entry.scope ?? "repo"
331
+ ]);
259
332
  const have = merged.get(id);
260
333
  merged.set(id, have ? {
261
334
  ...have,
@@ -558,6 +631,68 @@ function placeAreas(areas, raw) {
558
631
  else if (area.area === "org") result = placeOrg(result, area);
559
632
  return result;
560
633
  }
634
+ // src/config/resolve-layers/resolve-layers.ts
635
+ /**
636
+ * Turns every `layer` in a loaded config into the `environment` it names (spec `tech-environment-layers`, #2069), so
637
+ * the commands and doctors that read Environments see one literal name and none of them derives it again. The name is
638
+ * `layerEnvironment()` over the `origin` remote of `input.repoRoot`, read at most once and only when an entry names a
639
+ * layer. A remote that cannot be read is a `ConfigError` naming the `environment` option (`repoSlug()`); nothing is
640
+ * guessed. Covers `repo.secrets.sync`, `repo.secrets.deploy`, `repo.variables.sync`, `githubApps`, `dev` and the
641
+ * `vault` provider's `layer` option. Returns a new config; the one passed in is not changed.
642
+ *
643
+ * @param config - The resolved config, validated by `resolveConfig()`.
644
+ * @param input - Where to read the remote, and how.
645
+ * @returns The config with each `layer` replaced by its `environment`.
646
+ */
647
+ async function resolveLayers(config, input) {
648
+ let slug;
649
+ const named = async (entry) => {
650
+ if (entry.layer === void 0) return entry;
651
+ const { layer, ...rest } = entry;
652
+ slug ??= repoSlug(input.repoRoot, input.gitExec);
653
+ return {
654
+ ...rest,
655
+ environment: layerEnvironment(await slug, layer)
656
+ };
657
+ };
658
+ const all = (list) => Promise.all(list.map(named));
659
+ const out = { ...config };
660
+ const { repo } = config;
661
+ if (repo) {
662
+ const next = { ...repo };
663
+ if (repo.secrets) {
664
+ next.secrets = { ...repo.secrets };
665
+ if (repo.secrets.sync) next.secrets.sync = await all(repo.secrets.sync);
666
+ if (repo.secrets.deploy) next.secrets.deploy = await all(repo.secrets.deploy);
667
+ }
668
+ if (repo.variables?.sync) next.variables = {
669
+ ...repo.variables,
670
+ sync: await all(repo.variables.sync)
671
+ };
672
+ out.repo = next;
673
+ }
674
+ if (config.githubApps) out.githubApps = await all(config.githubApps);
675
+ if (config.dev) out.dev = await named(config.dev);
676
+ const vault = config.providers.vault;
677
+ if (vault?.cardinality === "single" && vault.tuple.options.layer !== void 0) {
678
+ const { layer, ...options } = vault.tuple.options;
679
+ const resolved = await named({ layer });
680
+ out.providers = {
681
+ ...config.providers,
682
+ vault: {
683
+ cardinality: "single",
684
+ tuple: {
685
+ ...vault.tuple,
686
+ options: {
687
+ ...options,
688
+ environment: resolved.environment
689
+ }
690
+ }
691
+ }
692
+ };
693
+ }
694
+ return out;
695
+ }
561
696
  // src/config/config-system.ts
562
697
  /**
563
698
  * Holocron's config system: `defineConfig`, `loadConfig` and `compose`, all built from one
@@ -592,8 +727,20 @@ const defineConfig = system.defineConfig;
592
727
  * `@theholocron/datapad`'s own doc comment for the stop conditions).
593
728
  * Throws `ConfigFileError` when nothing is found or a file cannot
594
729
  * be loaded, or `ConfigError` when the config fails schema checks.
730
+ *
731
+ * Every `layer` an entry names becomes the `environment` it stands for (`resolveLayers()`, spec
732
+ * `tech-environment-layers`, #2069), read from the `origin` remote at `cwd`; `input` lets a test pass a fake remote.
595
733
  */
596
- const loadConfig = system.loadConfig;
734
+ async function loadConfig(cwd, input = {}) {
735
+ const loaded = await system.loadConfig(cwd);
736
+ return {
737
+ ...loaded,
738
+ resolved: await resolveLayers(loaded.resolved, {
739
+ repoRoot: cwd,
740
+ ...input
741
+ })
742
+ };
743
+ }
597
744
  /**
598
745
  * Merge any number of capability fragments into a single preset object that
599
746
  * spreads directly into `defineConfig()`.
@@ -616,4 +763,4 @@ const loadConfig = system.loadConfig;
616
763
  * const preset = compose(node(), nextjs());
617
764
  */
618
765
  const compose = system.compose;
619
- export { placeAreas as a, ConfigError$1 as c, resolveEntry as d, resolvePluginPackage$1 as f, loadConfig as i, credentialsEnvironment as l, compose as n, HOLOCRON_AREAS as o, defineConfig as r, SHARED_AREAS as s, ConfigFileError as t, resolveConfig as u };
766
+ export { placeAreas as a, repoSlug as c, resolveConfig as d, resolveEntry as f, layerEnvironment as h, loadConfig as i, ConfigError$1 as l, isEnvironmentLayer as m, compose as n, HOLOCRON_AREAS as o, resolvePluginPackage$1 as p, defineConfig as r, SHARED_AREAS as s, ConfigFileError as t, credentialsEnvironment as u };
@@ -1,8 +1,11 @@
1
1
  import { ProviderApiError } from "@theholocron/http-client";
2
2
  import { ConfigError as ConfigError$1, ConfigFileError } from "@theholocron/kyber/config";
3
+ import { GitExec } from "@theholocron/git-utils";
3
4
  import { PackageJson } from "@theholocron/pkg-utils";
4
5
  import { DocsCoverageMode, WorkspacePackage } from "@theholocron/astromech";
5
6
  import { LogLevel } from "@theholocron/observability/core";
7
+ /** The layer words a config entry may name instead of an Environment (spec `tech-environment-layers`, #2069). */
8
+ type EnvironmentLayer = "local" | "dev" | "ci" | "prod";
6
9
  /** Structured-logging config. The Axiom **token** never lives here — only in
7
10
  * env vars or the OS keyring — but the non-secret dataset name may. */
8
11
  interface LogConfig {
@@ -139,7 +142,12 @@ interface RepoVariables {
139
142
  */
140
143
  interface RepoVariablesSync {
141
144
  /** The vault environment id, as given to `holocron secrets sync <environmentId>`. */
142
- environment: string;
145
+ environment?: string;
146
+ /**
147
+ * The layer to name instead of `environment`: the Environment is `<org/repo> - <layer>`, from the repository's
148
+ * `origin` remote (spec `tech-environment-layers`, #2069). Set one of `layer` and `environment`, never both.
149
+ */
150
+ layer?: EnvironmentLayer;
143
151
  /** The vault keys written as variables, by name. Required: a key the environment gains by mistake is never published. */
144
152
  keys: string[];
145
153
  /** Where the variables land: `"repo"` (the default) or `"org=<name>"`. */
@@ -179,7 +187,12 @@ interface RepoSecrets {
179
187
  */
180
188
  interface RepoSecretsDeploy {
181
189
  /** The vault environment id, as given to `holocron secrets sync <environmentId>`. */
182
- environment: string;
190
+ environment?: string;
191
+ /**
192
+ * The layer to name instead of `environment`: the Environment is `<org/repo> - <layer>`, from the repository's
193
+ * `origin` remote (spec `tech-environment-layers`, #2069). Set one of `layer` and `environment`, never both.
194
+ */
195
+ layer?: EnvironmentLayer;
183
196
  /** Exact key names to send. */
184
197
  keys?: string[];
185
198
  /** A name prefix to send, such as `SENTINEL_` or `COMLINK_`. Case-sensitive. */
@@ -188,7 +201,12 @@ interface RepoSecretsDeploy {
188
201
  /** One vault environment that `holocron secrets sync` pushes into GitHub secrets, declared so the doctor can check them. */
189
202
  interface RepoSecretsSync {
190
203
  /** The vault environment id, as given to `holocron secrets sync <environmentId>`. */
191
- environment: string;
204
+ environment?: string;
205
+ /**
206
+ * The layer to name instead of `environment`: the Environment is `<org/repo> - <layer>`, from the repository's
207
+ * `origin` remote (spec `tech-environment-layers`, #2069). Set one of `layer` and `environment`, never both.
208
+ */
209
+ layer?: EnvironmentLayer;
192
210
  /**
193
211
  * The vault keys pushed to GitHub (the `--github-secret` allowlist). Omit it for every key the vault
194
212
  * environment holds, which the doctor then asks the `vault` provider to list.
@@ -332,7 +350,12 @@ interface GitHubAppConfig {
332
350
  * The vault environment (a 1Password Environment) that holds the instance's `SENTINEL_GITHUB_APP_ID` and
333
351
  * `SENTINEL_GITHUB_APP_PRIVATE_KEY` (or the older bare `GITHUB_APP_ID` and `GITHUB_APP_PRIVATE_KEY`). A name, not a secret, so it is committed.
334
352
  */
335
- environment: string;
353
+ environment?: string;
354
+ /**
355
+ * The layer to name instead of `environment`: the Environment is `<org/repo> - <layer>`, from the repository's
356
+ * `origin` remote (spec `tech-environment-layers`, #2069). Set one of `layer` and `environment`, never both.
357
+ */
358
+ layer?: EnvironmentLayer;
336
359
  }
337
360
  /**
338
361
  * The `ideas` block: the state that files an idea as an issue. Where the ideas are kept is the `ideas` provider's
@@ -360,6 +383,11 @@ interface DevConfig {
360
383
  * secret, so it is committed.
361
384
  */
362
385
  environment?: string;
386
+ /**
387
+ * The layer to name instead of `environment`: the Environment is `<org/repo> - <layer>`, from the repository's
388
+ * `origin` remote (spec `tech-environment-layers`, #2069). Set one of `layer` and `environment`, never both.
389
+ */
390
+ layer?: EnvironmentLayer;
363
391
  /** The named tunnel to the application: its name, and the public hostname it serves (not a secret). */
364
392
  tunnel?: {
365
393
  /** The tunnel's name. A second run finds the first one's tunnel by it. */
@@ -947,6 +975,13 @@ interface LoadedConfig {
947
975
  /** Absolute path to the file the config was read from. */
948
976
  filepath: string;
949
977
  }
978
+ /** What `resolveLayers()` reads besides the config. */
979
+ interface ResolveLayersInput {
980
+ /** Where the repository (or a directory inside it) is: its `origin` remote is read here. */
981
+ repoRoot: string;
982
+ /** Reads the remote. Defaults to `git` itself; a test passes a fake. */
983
+ gitExec?: GitExec;
984
+ }
950
985
  /** Returns the config unchanged; it exists to type and autocomplete a `holocron.config.ts`. */
951
986
  declare const defineConfig: (config: HolocronConfig) => HolocronConfig;
952
987
  /**
@@ -957,8 +992,11 @@ declare const defineConfig: (config: HolocronConfig) => HolocronConfig;
957
992
  * `@theholocron/datapad`'s own doc comment for the stop conditions).
958
993
  * Throws `ConfigFileError` when nothing is found or a file cannot
959
994
  * be loaded, or `ConfigError` when the config fails schema checks.
995
+ *
996
+ * Every `layer` an entry names becomes the `environment` it stands for (`resolveLayers()`, spec
997
+ * `tech-environment-layers`, #2069), read from the `origin` remote at `cwd`; `input` lets a test pass a fake remote.
960
998
  */
961
- declare const loadConfig: (cwd: string) => Promise<LoadedConfig>;
999
+ declare function loadConfig(cwd: string, input?: Omit<ResolveLayersInput, "repoRoot">): Promise<LoadedConfig>;
962
1000
  /**
963
1001
  * Merge any number of capability fragments into a single preset object that
964
1002
  * spreads directly into `defineConfig()`.
package/dist/index.d.mts CHANGED
@@ -1,10 +1,11 @@
1
- import { $ as DnsRecord, $n as deriveCapabilities, $r as ResolvedTuple, $t as NotificationsEveryoneLayout, A as Cardinality, An as SourceRulesetDetail, Ar as EnvConfig, At as LabelDef, B as DeployFunctionConfig, Bn as ToolingDoctorReport, Br as RawProvidersConfig, Bt as MonitoringAssertion, C as BoardStatusCategory, Cn as SecretScope, Cr as CapabilityConfigPackage, Ct as IssueComment, D as BoardView, Dn as SourceBranch, Dr as DevServeConfig, Dt as IssueSearchFilter, E as BoardTemplateFile, En as Source, Er as DevConfig, Et as IssueRecord, F as CiRunStatus, Fn as StorageBranch, Fr as LogConfig, Ft as Monitoring, G as DeploymentProject, Gn as Vault, Gr as RepoSecretsDeploy, Gt as MonitoringHttpMethod, H as DeployScriptConfig, Hn as TrackerUser, Hr as RepoProperties, Ht as MonitoringAssertionSource, I as ConnectionStringOptions, In as SyncResult, Ir as MultiEntry, It as MonitoringAlertChannelInput, J as DeploymentTarget, Jn as WikiProvisionOpts, Jr as RepoVariables, Jt as Notifications, K as DeploymentProjectSettings, Kn as WebhookDashboardInfo, Kr as RepoSecretsSync, Kt as MoveReport, L as CreateAuthUserInput, Ln as TeamEntry, Lr as OrgConfig, Lt as MonitoringAlertChannelResult, M as Ci, Mn as SourceTeamMember, Mr as GitHubAppConfig, Mt as LifecycleSlot, N as CiRun, Nn as StatusCategory, Nr as HolocronConfig, Nt as Logs, O as CapabilityImpls, On as SourceFile, Or as DocsConfig, Ot as IssueSelector, P as CiRunFilter, Pn as Storage, Pr as IdeasConfig, Pt as LogsDataset, Q as Dns, Qn as KNOWN_STACK_DEPS, Qr as ResolvedProvidersConfig, Qt as NotificationsDelivery, R as Credentials, Rn as TeamPermission, Rr as ProviderOptions, Rt as MonitoringAlertChannelState, S as BoardStatus, Sn as Ruleset, Sr as AppConfig, St as Issue, T as BoardTemplate, Tn as ServerInspection, Tr as CredentialsConfig, Tt as IssuePriority, U as DeployScriptResult, Un as TunnelRoute, Ur as RepoProtection, Ut as MonitoringCheck, V as DeployFunctionResult, Vn as TrackerDoctorReport, Vr as RepoConfig, Vt as MonitoringAssertionComparison, W as Deployment, Wn as Tunnels, Wr as RepoSecrets, Wt as MonitoringCheckInput, X as DiscussionPatch, Xn as WorkerScriptState, Xr as ResolvedHolocronConfig, Xt as NotificationsApplicationLayout, Y as DeploymentTrigger, Yn as WikiProxyConfig, Yr as RepoVariablesSync, Yt as NotificationsAccess, Z as DiscussionPost, Zn as Workers, Zr as ResolvedProviderEntry, Zt as NotificationsChannelLayout, _ as BoardFieldType, _n as PullRequest, _r as ConfigError, _t as IdeaRecord, a as REQUIRED_CAPABILITIES, an as NotificationsOnboardingLayout, ar as DeriveProfileInput, at as EnsureRelayResult, b as BoardRule, bn as RepoSettings, br as resolveEntry, bt as ImportResult, c as AddedItem, cn as NotificationsPrsFeed, cr as StackName, ct as EnsureWebhookResult, d as AuthDescription, dn as NotificationsSignedIn, dr as defineConfig, dt as EnsuredTunnel, ei as SingleEntry, en as NotificationsForumTag, er as deriveCompliance, et as DnsRecordRequest, f as AuthEvent, fn as NotificationsWelcomeLayout, fr as loadConfig, ft as Environment, g as BoardField, gn as ProviderIdentity, gr as TaskEntry, gt as ExportInfo, h as AuthUser, hn as Projects, hr as ComposedPreset, ht as Errors, i as ProviderApiError, ii as WorkflowWithConfig, in as NotificationsMonitoringFeed, ir as readWorkspacePackageJsons, it as EnsureRelayInput, j as CardinalityFor, jn as SourceSecurity, jr as EslintConfig, jt as LifecycleResult, k as CapabilityKey, kn as SourceRepoInfo, kr as DoctorConfig, kt as Issues, l as Analytics, ln as NotificationsServerLayout, lr as ConfigFileError, lt as EnsuredDiscussion, m as AuthIdentity, mn as ParseWebhookInput, mr as Capability, mt as Environments, n as ElevationRequiredError, ni as TaskEntryConfig, nn as NotificationsLinksLayout, nr as deriveStack, nt as DuplicateDiscussion, o as WebhookVerificationError, on as NotificationsPicture, or as HolocronProfile, ot as EnsureReport, p as AuthEventType, pn as PagesConfig, pr as LoadedConfig, pt as EnvironmentReviewer, q as DeploymentRecord, qn as Wiki, qr as RepoValidationConfig, qt as NormalizedAuthUser, r as MissingTokenError, ri as TelemetryConfig, rn as NotificationsMember, rr as missingCapabilities, rt as EnsureDiscussionInput, s as isMulti, sn as NotificationsPinnedLayout, sr as PackageJsonLike, st as EnsureResult, t as CARDINALITY, ti as StorybookDeployProject, tn as NotificationsLayout, tr as deriveProfile, tt as DnsRecordType, u as Auth, un as NotificationsSignIn, ur as compose, ut as EnsuredResource, v as BoardItem, vn as RelayState, vr as credentialsEnvironment, vt as Ideas, w as BoardSummary, wn as Secrets, wr as ChromaticProjectConfig, wt as IssueOrder, x as BoardState, xn as ResolvedCapability, xr as resolvePluginPackage, xt as InspectRelayInput, y as BoardItemInput, yn as RepoRef, yr as resolveConfig, yt as ImportOptions, z as CredentialsInspection, zn as Tooling, zr as RawProviderEntry, zt as MonitoringAlertSettings } from "./index-D39ic8yM.mjs";
1
+ import { $ as DnsRecord, $n as deriveCapabilities, $r as ResolvedTuple, $t as NotificationsEveryoneLayout, A as Cardinality, An as SourceRulesetDetail, Ar as EnvConfig, At as LabelDef, B as DeployFunctionConfig, Bn as ToolingDoctorReport, Br as RawProvidersConfig, Bt as MonitoringAssertion, C as BoardStatusCategory, Cn as SecretScope, Cr as CapabilityConfigPackage, Ct as IssueComment, D as BoardView, Dn as SourceBranch, Dr as DevServeConfig, Dt as IssueSearchFilter, E as BoardTemplateFile, En as Source, Er as DevConfig, Et as IssueRecord, F as CiRunStatus, Fn as StorageBranch, Fr as LogConfig, Ft as Monitoring, G as DeploymentProject, Gn as Vault, Gr as RepoSecretsDeploy, Gt as MonitoringHttpMethod, H as DeployScriptConfig, Hn as TrackerUser, Hr as RepoProperties, Ht as MonitoringAssertionSource, I as ConnectionStringOptions, In as SyncResult, Ir as MultiEntry, It as MonitoringAlertChannelInput, J as DeploymentTarget, Jn as WikiProvisionOpts, Jr as RepoVariables, Jt as Notifications, K as DeploymentProjectSettings, Kn as WebhookDashboardInfo, Kr as RepoSecretsSync, Kt as MoveReport, L as CreateAuthUserInput, Ln as TeamEntry, Lr as OrgConfig, Lt as MonitoringAlertChannelResult, M as Ci, Mn as SourceTeamMember, Mr as GitHubAppConfig, Mt as LifecycleSlot, N as CiRun, Nn as StatusCategory, Nr as HolocronConfig, Nt as Logs, O as CapabilityImpls, On as SourceFile, Or as DocsConfig, Ot as IssueSelector, P as CiRunFilter, Pn as Storage, Pr as IdeasConfig, Pt as LogsDataset, Q as Dns, Qn as KNOWN_STACK_DEPS, Qr as ResolvedProvidersConfig, Qt as NotificationsDelivery, R as Credentials, Rn as TeamPermission, Rr as ProviderOptions, Rt as MonitoringAlertChannelState, S as BoardStatus, Sn as Ruleset, Sr as AppConfig, St as Issue, T as BoardTemplate, Tn as ServerInspection, Tr as CredentialsConfig, Tt as IssuePriority, U as DeployScriptResult, Un as TunnelRoute, Ur as RepoProtection, Ut as MonitoringCheck, V as DeployFunctionResult, Vn as TrackerDoctorReport, Vr as RepoConfig, Vt as MonitoringAssertionComparison, W as Deployment, Wn as Tunnels, Wr as RepoSecrets, Wt as MonitoringCheckInput, X as DiscussionPatch, Xn as WorkerScriptState, Xr as ResolvedHolocronConfig, Xt as NotificationsApplicationLayout, Y as DeploymentTrigger, Yn as WikiProxyConfig, Yr as RepoVariablesSync, Yt as NotificationsAccess, Z as DiscussionPost, Zn as Workers, Zr as ResolvedProviderEntry, Zt as NotificationsChannelLayout, _ as BoardFieldType, _n as PullRequest, _r as ConfigError, _t as IdeaRecord, a as REQUIRED_CAPABILITIES, an as NotificationsOnboardingLayout, ar as DeriveProfileInput, at as EnsureRelayResult, b as BoardRule, bn as RepoSettings, br as resolveEntry, bt as ImportResult, c as AddedItem, cn as NotificationsPrsFeed, cr as StackName, ct as EnsureWebhookResult, d as AuthDescription, dn as NotificationsSignedIn, dr as defineConfig, dt as EnsuredTunnel, ei as SingleEntry, en as NotificationsForumTag, er as deriveCompliance, et as DnsRecordRequest, f as AuthEvent, fn as NotificationsWelcomeLayout, fr as loadConfig, ft as Environment, g as BoardField, gn as ProviderIdentity, gr as TaskEntry, gt as ExportInfo, h as AuthUser, hn as Projects, hr as ComposedPreset, ht as Errors, i as ProviderApiError, ii as WorkflowWithConfig, in as NotificationsMonitoringFeed, ir as readWorkspacePackageJsons, it as EnsureRelayInput, j as CardinalityFor, jn as SourceSecurity, jr as EslintConfig, jt as LifecycleResult, k as CapabilityKey, kn as SourceRepoInfo, kr as DoctorConfig, kt as Issues, l as Analytics, ln as NotificationsServerLayout, lr as ConfigFileError, lt as EnsuredDiscussion, m as AuthIdentity, mn as ParseWebhookInput, mr as Capability, mt as Environments, n as ElevationRequiredError, ni as TaskEntryConfig, nn as NotificationsLinksLayout, nr as deriveStack, nt as DuplicateDiscussion, o as WebhookVerificationError, on as NotificationsPicture, or as HolocronProfile, ot as EnsureReport, p as AuthEventType, pn as PagesConfig, pr as LoadedConfig, pt as EnvironmentReviewer, q as DeploymentRecord, qn as Wiki, qr as RepoValidationConfig, qt as NormalizedAuthUser, r as MissingTokenError, ri as TelemetryConfig, rn as NotificationsMember, rr as missingCapabilities, rt as EnsureDiscussionInput, s as isMulti, sn as NotificationsPinnedLayout, sr as PackageJsonLike, st as EnsureResult, t as CARDINALITY, ti as StorybookDeployProject, tn as NotificationsLayout, tr as deriveProfile, tt as DnsRecordType, u as Auth, un as NotificationsSignIn, ur as compose, ut as EnsuredResource, v as BoardItem, vn as RelayState, vr as credentialsEnvironment, vt as Ideas, w as BoardSummary, wn as Secrets, wr as ChromaticProjectConfig, wt as IssueOrder, x as BoardState, xn as ResolvedCapability, xr as resolvePluginPackage, xt as InspectRelayInput, y as BoardItemInput, yn as RepoRef, yr as resolveConfig, yt as ImportOptions, z as CredentialsInspection, zn as Tooling, zr as RawProviderEntry, zt as MonitoringAlertSettings } from "./index-C4pFARzT.mjs";
2
2
  import { AuthError, ResolveTokenConfig as ResolveTokenConfig$1, ResolveTokenInput, ResolveTokenInput as ResolveTokenInput$1, resolveValue } from "@theholocron/kyber/secrets";
3
3
  import { CheckRow } from "@theholocron/kyber/ui";
4
4
  import { RequestOptions, RestClient, RestClientConfig, createRestClient } from "@theholocron/http-client";
5
5
  import "@theholocron/kyber/plugins";
6
- import "@theholocron/git-utils";
6
+ import { GitExec } from "@theholocron/git-utils";
7
7
  import { ConnectionProbeInput as ConnectionProbeInput$1 } from "@theholocron/kyber/checks";
8
+ import { Stats } from "node:fs";
8
9
  import "@theholocron/observability/core";
9
10
  import { ConfigDirArea } from "@theholocron/datapad";
10
11
  /** A plugin's `verifyToken` result when the provider accepted the token. */
@@ -172,6 +173,11 @@ interface Probe {
172
173
  summary: string;
173
174
  /** Whether it creates or changes anything on the provider. Asked about first, and needs `--yes` without a terminal. */
174
175
  writes: boolean;
176
+ /**
177
+ * Where the probe's rows go. Unset, stdout. A probe whose own output is the data on stdout (a `NAME=value` stream
178
+ * for a pipe) sets `stderr`, so the rows never mix with it.
179
+ */
180
+ reportsTo?: "stderr";
175
181
  /** Runs the probe, reporting and changing things only through `ctx`. */
176
182
  run(ctx: ProbeContext): Promise<void>;
177
183
  }
@@ -390,6 +396,32 @@ export declare const CANONICAL_LABELS: readonly [{
390
396
  readonly color: "ffffff";
391
397
  readonly description: "Won't be addressed";
392
398
  }];
399
+ /**
400
+ * What stdout is. A token is never written to a `terminal` (it would sit in scrollback) or to `other` (a redirect to
401
+ * a regular file, which would leave plaintext tokens on disk without the protections of the file option); only a
402
+ * `pipe` receives the lines. On a terminal they go to the file option instead, or the clipboard when asked.
403
+ */
404
+ type AuthExportOutKind = "terminal" | "pipe" | "other";
405
+ /**
406
+ * What file descriptor `fd` (stdout) is, for deciding where tokens may go: a `terminal`, a `pipe` (a FIFO, or the
407
+ * socket some shells and runners use for one), or `other` (a regular file, a device, or anything that cannot be
408
+ * inspected). Only a pipe is safe to write the lines to, so anything unknown is `other`.
409
+ */
410
+ export declare function stdoutKind(isTerminal: boolean, fd?: number, stat?: (fd: number) => Pick<Stats, "isFIFO" | "isSocket">): AuthExportOutKind;
411
+ /**
412
+ * The vault Environment `holocron secrets sync <environmentId>` reads. A layer word (`local`, `dev`, `ci`, `prod`) is the
413
+ * Environment of that layer of this repository, `<org/repo> - <layer>`; any other text is a literal Environment name.
414
+ * A literal name wins only when it is not exactly a layer word, so an Environment that is itself called `prod` cannot be
415
+ * addressed by that name (spec `tech-environment-layers`, #2069).
416
+ *
417
+ * @param id - The positional the user gave.
418
+ * @param input - Where the repository is (its `origin` remote is read there), and optionally how to read it.
419
+ * @throws {ConfigError} For a layer word when the remote cannot be read (the message names the `environment` option).
420
+ */
421
+ export declare function resolveEnvironmentId(id: string, input: {
422
+ repoRoot: string;
423
+ gitExec?: GitExec;
424
+ }): Promise<string>;
393
425
  /**
394
426
  * The closed list of area files `loadConfig` reads from `.holocron/` (the directory is `.<config name>`, set by kyber):
395
427
  * `.holocron/notifications.*` fills `providers.notifications`' `layout`, `.holocron/repo.*` fills keys of `repo`, and `.holocron/org.*` fills provider options (`teamId`, `accountId`) a config leaves out.
@@ -408,4 +440,4 @@ export declare const SHARED_AREAS: readonly ["org"];
408
440
  * is a `ConfigError` naming both (no merge, no precedence). With no area files the config is returned as it was.
409
441
  */
410
442
  export declare function placeAreas(areas: ConfigDirArea[], raw: HolocronConfig): HolocronConfig;
411
- export { AddedItem, Analytics, type AppConfig, Auth, AuthDescription, AuthError, AuthEvent, AuthEventType, AuthIdentity, AuthUser, BoardField, BoardFieldType, BoardItem, BoardItemInput, BoardRule, BoardState, BoardStatus, BoardStatusCategory, BoardSummary, BoardTemplate, BoardTemplateFile, BoardView, CARDINALITY, type Capability, type CapabilityConfigPackage, CapabilityImpls, CapabilityKey, Cardinality, CardinalityFor, type ChromaticProjectConfig, Ci, CiRun, CiRunFilter, CiRunStatus, type ComposedPreset, ConfigError, ConfigFileError, ConnectionStringOptions, CreateAuthUserInput, Credentials, type CredentialsConfig, CredentialsInspection, DeployFunctionConfig, DeployFunctionResult, DeployScriptConfig, DeployScriptResult, Deployment, DeploymentProject, DeploymentProjectSettings, DeploymentRecord, DeploymentTarget, DeploymentTrigger, type DeriveProfileInput, type DevConfig, type DevServeConfig, DiscussionPatch, DiscussionPost, Dns, DnsRecord, DnsRecordRequest, DnsRecordType, type DocsConfig, type DoctorConfig, DuplicateDiscussion, ElevationRequiredError, EnsureDiscussionInput, EnsureRelayInput, EnsureRelayResult, EnsureReport, EnsureResult, EnsureWebhookResult, EnsuredDiscussion, EnsuredResource, EnsuredTunnel, type EnvConfig, Environment, EnvironmentReviewer, Environments, Errors, type EslintConfig, ExportInfo, type FeatureResolver, type FeatureResolverConfig, type GitHubAppConfig, type HolocronConfig, type HolocronProfile, IdeaRecord, Ideas, type IdeasConfig, ImportOptions, ImportResult, InspectRelayInput, Issue, IssueComment, IssueOrder, IssuePriority, IssueRecord, IssueSearchFilter, IssueSelector, Issues, KNOWN_STACK_DEPS, LabelDef, LifecycleResult, LifecycleSlot, type LinksFile, type LoadedConfig, type LogConfig, Logs, LogsDataset, type MemberLink, MissingTokenError, Monitoring, MonitoringAlertChannelInput, MonitoringAlertChannelResult, MonitoringAlertChannelState, MonitoringAlertSettings, MonitoringAssertion, MonitoringAssertionComparison, MonitoringAssertionSource, MonitoringCheck, MonitoringCheckInput, MonitoringHttpMethod, MoveReport, type MultiEntry, NormalizedAuthUser, Notifications, NotificationsAccess, NotificationsApplicationLayout, NotificationsChannelLayout, NotificationsDelivery, NotificationsEveryoneLayout, NotificationsForumTag, NotificationsLayout, NotificationsLinksLayout, NotificationsMember, NotificationsMonitoringFeed, NotificationsOnboardingLayout, NotificationsPicture, NotificationsPinnedLayout, NotificationsPrsFeed, NotificationsServerLayout, NotificationsSignIn, NotificationsSignedIn, NotificationsWelcomeLayout, type OrgConfig, type PackageJsonLike, PagesConfig, ParseWebhookInput, type PluginProbes, type PluginToken, type Probe, type ProbeContext, type ProbeRow, Projects, type ProviderAction, type ProviderActionContext, type ProviderActions, ProviderApiError, ProviderIdentity, type ProviderOptions, type ProviderRow, PullRequest, REQUIRED_CAPABILITIES, type RawProviderEntry, type RawProvidersConfig, type ReadKeysLimitedInput, RelayState, type RepoConfig, type RepoProperties, type RepoProtection, RepoRef, type RepoSecrets, type RepoSecretsDeploy, type RepoSecretsSync, RepoSettings, type RepoValidationConfig, type RepoVariables, type RepoVariablesSync, type RequestOptions, type ResolveTokenConfig, type ResolveTokenInput, ResolvedCapability, type ResolvedHolocronConfig, type ResolvedProviderEntry, type ResolvedProvidersConfig, type ResolvedTuple, type RestClient, type RestClientConfig, Ruleset, SecretScope, Secrets, ServerInspection, type SingleEntry, Source, SourceBranch, SourceFile, SourceRepoInfo, SourceRulesetDetail, SourceSecurity, SourceTeamMember, type StackName, StatusCategory, Storage, StorageBranch, type StorybookDeployProject, SyncResult, type SyncRolesInput, type SyncRolesResult, type TaskEntry, type TaskEntryConfig, TeamEntry, TeamPermission, type TelemetryConfig, type TokenResolver, Tooling, ToolingDoctorReport, TrackerDoctorReport, TrackerUser, TunnelRoute, Tunnels, Vault, type VerifyTokenFailure, type VerifyTokenResult, type VerifyTokenSuccess, WebhookDashboardInfo, WebhookVerificationError, Wiki, WikiProvisionOpts, WikiProxyConfig, WorkerScriptState, Workers, type WorkflowWithConfig, compose, createRestClient, credentialsEnvironment, defineConfig, deriveCapabilities, deriveCompliance, deriveProfile, deriveStack, isMulti, loadConfig, missingCapabilities, readWorkspacePackageJsons, resolveConfig, resolveEntry, resolvePluginPackage, resolveValue };
443
+ export { AddedItem, Analytics, type AppConfig, Auth, AuthDescription, AuthError, AuthEvent, AuthEventType, type AuthExportOutKind, AuthIdentity, AuthUser, BoardField, BoardFieldType, BoardItem, BoardItemInput, BoardRule, BoardState, BoardStatus, BoardStatusCategory, BoardSummary, BoardTemplate, BoardTemplateFile, BoardView, CARDINALITY, type Capability, type CapabilityConfigPackage, CapabilityImpls, CapabilityKey, Cardinality, CardinalityFor, type ChromaticProjectConfig, Ci, CiRun, CiRunFilter, CiRunStatus, type ComposedPreset, ConfigError, ConfigFileError, ConnectionStringOptions, CreateAuthUserInput, Credentials, type CredentialsConfig, CredentialsInspection, DeployFunctionConfig, DeployFunctionResult, DeployScriptConfig, DeployScriptResult, Deployment, DeploymentProject, DeploymentProjectSettings, DeploymentRecord, DeploymentTarget, DeploymentTrigger, type DeriveProfileInput, type DevConfig, type DevServeConfig, DiscussionPatch, DiscussionPost, Dns, DnsRecord, DnsRecordRequest, DnsRecordType, type DocsConfig, type DoctorConfig, DuplicateDiscussion, ElevationRequiredError, EnsureDiscussionInput, EnsureRelayInput, EnsureRelayResult, EnsureReport, EnsureResult, EnsureWebhookResult, EnsuredDiscussion, EnsuredResource, EnsuredTunnel, type EnvConfig, Environment, EnvironmentReviewer, Environments, Errors, type EslintConfig, ExportInfo, type FeatureResolver, type FeatureResolverConfig, type GitHubAppConfig, type HolocronConfig, type HolocronProfile, IdeaRecord, Ideas, type IdeasConfig, ImportOptions, ImportResult, InspectRelayInput, Issue, IssueComment, IssueOrder, IssuePriority, IssueRecord, IssueSearchFilter, IssueSelector, Issues, KNOWN_STACK_DEPS, LabelDef, LifecycleResult, LifecycleSlot, type LinksFile, type LoadedConfig, type LogConfig, Logs, LogsDataset, type MemberLink, MissingTokenError, Monitoring, MonitoringAlertChannelInput, MonitoringAlertChannelResult, MonitoringAlertChannelState, MonitoringAlertSettings, MonitoringAssertion, MonitoringAssertionComparison, MonitoringAssertionSource, MonitoringCheck, MonitoringCheckInput, MonitoringHttpMethod, MoveReport, type MultiEntry, NormalizedAuthUser, Notifications, NotificationsAccess, NotificationsApplicationLayout, NotificationsChannelLayout, NotificationsDelivery, NotificationsEveryoneLayout, NotificationsForumTag, NotificationsLayout, NotificationsLinksLayout, NotificationsMember, NotificationsMonitoringFeed, NotificationsOnboardingLayout, NotificationsPicture, NotificationsPinnedLayout, NotificationsPrsFeed, NotificationsServerLayout, NotificationsSignIn, NotificationsSignedIn, NotificationsWelcomeLayout, type OrgConfig, type PackageJsonLike, PagesConfig, ParseWebhookInput, type PluginProbes, type PluginToken, type Probe, type ProbeContext, type ProbeRow, Projects, type ProviderAction, type ProviderActionContext, type ProviderActions, ProviderApiError, ProviderIdentity, type ProviderOptions, type ProviderRow, PullRequest, REQUIRED_CAPABILITIES, type RawProviderEntry, type RawProvidersConfig, type ReadKeysLimitedInput, RelayState, type RepoConfig, type RepoProperties, type RepoProtection, RepoRef, type RepoSecrets, type RepoSecretsDeploy, type RepoSecretsSync, RepoSettings, type RepoValidationConfig, type RepoVariables, type RepoVariablesSync, type RequestOptions, type ResolveTokenConfig, type ResolveTokenInput, ResolvedCapability, type ResolvedHolocronConfig, type ResolvedProviderEntry, type ResolvedProvidersConfig, type ResolvedTuple, type RestClient, type RestClientConfig, Ruleset, SecretScope, Secrets, ServerInspection, type SingleEntry, Source, SourceBranch, SourceFile, SourceRepoInfo, SourceRulesetDetail, SourceSecurity, SourceTeamMember, type StackName, StatusCategory, Storage, StorageBranch, type StorybookDeployProject, SyncResult, type SyncRolesInput, type SyncRolesResult, type TaskEntry, type TaskEntryConfig, TeamEntry, TeamPermission, type TelemetryConfig, type TokenResolver, Tooling, ToolingDoctorReport, TrackerDoctorReport, TrackerUser, TunnelRoute, Tunnels, Vault, type VerifyTokenFailure, type VerifyTokenResult, type VerifyTokenSuccess, WebhookDashboardInfo, WebhookVerificationError, Wiki, WikiProvisionOpts, WikiProxyConfig, WorkerScriptState, Workers, type WorkflowWithConfig, compose, createRestClient, credentialsEnvironment, defineConfig, deriveCapabilities, deriveCompliance, deriveProfile, deriveStack, isMulti, loadConfig, missingCapabilities, readWorkspacePackageJsons, resolveConfig, resolveEntry, resolvePluginPackage, resolveValue };
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
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, i as loadConfig, l as credentialsEnvironment, n as compose, o as HOLOCRON_AREAS, r as defineConfig, s as SHARED_AREAS, t as ConfigFileError, u as resolveConfig } from "./config-system-DYqb53Rd.mjs";
2
+ import { a as placeAreas, c as repoSlug, d as resolveConfig, f as resolveEntry, h as layerEnvironment, i as loadConfig, l as ConfigError, m as isEnvironmentLayer, n as compose, o as HOLOCRON_AREAS, p as resolvePluginPackage, r as defineConfig, s as SHARED_AREAS, t as ConfigFileError, u as credentialsEnvironment } from "./config-system-c8Ngywp-.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 { describeError, style } from "@theholocron/kyber/ui";
@@ -8,6 +8,7 @@ import { createRestClient } from "@theholocron/http-client";
8
8
  import { connectionProbe as connectionProbe$1 } from "@theholocron/kyber/checks";
9
9
  import { join } from "node:path";
10
10
  import { readPackageJson } from "@theholocron/pkg-utils";
11
+ import { fstatSync } from "node:fs";
11
12
  // src/auth/auth.ts
12
13
  /**
13
14
  * The CLI's credentials: the OS keyring every plugin's bootstrap token lives in, and the two token resolvers built on
@@ -553,4 +554,34 @@ const CANONICAL_LABELS = [
553
554
  description: "Won't be addressed"
554
555
  }
555
556
  ];
556
- export { AuthError, CANONICAL_LABELS, CARDINALITY, ConfigError, ConfigFileError, ElevationRequiredError, HOLOCRON_AREAS, KNOWN_STACK_DEPS, MissingTokenError, ProviderApiError, REQUIRED_CAPABILITIES, SHARED_AREAS, WebhookVerificationError, compose, connectionProbe, createFeatureResolver, createResolveToken, createRestClient, credentialsEnvironment, defineConfig, deriveCapabilities, deriveCompliance, deriveProfile, deriveStack, isMulti, keyring, loadConfig, missingCapabilities, orderKeys, pickByCreation, placeAreas, readKeysLimited, readLinks, readWorkspacePackageJsons, reportProgress, resolveConfig, resolveEntry, resolvePluginPackage, resolveValue, roleTeamProblem, sourceProblem, syncRoles };
557
+ // src/commands/auth-export/stdout-kind/stdout-kind.ts
558
+ /**
559
+ * What file descriptor `fd` (stdout) is, for deciding where tokens may go: a `terminal`, a `pipe` (a FIFO, or the
560
+ * socket some shells and runners use for one), or `other` (a regular file, a device, or anything that cannot be
561
+ * inspected). Only a pipe is safe to write the lines to, so anything unknown is `other`.
562
+ */
563
+ function stdoutKind(isTerminal, fd = 1, stat = fstatSync) {
564
+ if (isTerminal) return "terminal";
565
+ try {
566
+ const s = stat(fd);
567
+ return s.isFIFO() || s.isSocket() ? "pipe" : "other";
568
+ } catch {
569
+ return "other";
570
+ }
571
+ }
572
+ // src/commands/secrets-sync/resolve-environment-id/resolve-environment-id.ts
573
+ /**
574
+ * The vault Environment `holocron secrets sync <environmentId>` reads. A layer word (`local`, `dev`, `ci`, `prod`) is the
575
+ * Environment of that layer of this repository, `<org/repo> - <layer>`; any other text is a literal Environment name.
576
+ * A literal name wins only when it is not exactly a layer word, so an Environment that is itself called `prod` cannot be
577
+ * addressed by that name (spec `tech-environment-layers`, #2069).
578
+ *
579
+ * @param id - The positional the user gave.
580
+ * @param input - Where the repository is (its `origin` remote is read there), and optionally how to read it.
581
+ * @throws {ConfigError} For a layer word when the remote cannot be read (the message names the `environment` option).
582
+ */
583
+ async function resolveEnvironmentId(id, input) {
584
+ if (!isEnvironmentLayer(id)) return id;
585
+ return layerEnvironment(await repoSlug(input.repoRoot, input.gitExec), id);
586
+ }
587
+ export { AuthError, CANONICAL_LABELS, CARDINALITY, ConfigError, ConfigFileError, ElevationRequiredError, HOLOCRON_AREAS, KNOWN_STACK_DEPS, MissingTokenError, ProviderApiError, REQUIRED_CAPABILITIES, SHARED_AREAS, WebhookVerificationError, compose, connectionProbe, createFeatureResolver, createResolveToken, createRestClient, credentialsEnvironment, defineConfig, deriveCapabilities, deriveCompliance, deriveProfile, deriveStack, isMulti, keyring, loadConfig, missingCapabilities, orderKeys, pickByCreation, placeAreas, readKeysLimited, readLinks, readWorkspacePackageJsons, reportProgress, resolveConfig, resolveEntry, resolveEnvironmentId, resolvePluginPackage, resolveValue, roleTeamProblem, sourceProblem, stdoutKind, syncRoles };
@@ -1,2 +1,2 @@
1
- import { $ as DnsRecord, $t as NotificationsEveryoneLayout, A as Cardinality, An as SourceRulesetDetail, At as LabelDef, B as DeployFunctionConfig, Bn as ToolingDoctorReport, Bt as MonitoringAssertion, C as BoardStatusCategory, Cn as SecretScope, Ct as IssueComment, D as BoardView, Dn as SourceBranch, Dt as IssueSearchFilter, E as BoardTemplateFile, En as Source, Et as IssueRecord, F as CiRunStatus, Fn as StorageBranch, Ft as Monitoring, G as DeploymentProject, Gn as Vault, Gt as MonitoringHttpMethod, H as DeployScriptConfig, Hn as TrackerUser, Ht as MonitoringAssertionSource, I as ConnectionStringOptions, In as SyncResult, It as MonitoringAlertChannelInput, J as DeploymentTarget, Jn as WikiProvisionOpts, Jt as Notifications, K as DeploymentProjectSettings, Kn as WebhookDashboardInfo, Kt as MoveReport, L as CreateAuthUserInput, Ln as TeamEntry, Lt as MonitoringAlertChannelResult, M as Ci, Mn as SourceTeamMember, Mt as LifecycleSlot, N as CiRun, Nn as StatusCategory, Nt as Logs, O as CapabilityImpls, On as SourceFile, Ot as IssueSelector, P as CiRunFilter, Pn as Storage, Pt as LogsDataset, Q as Dns, Qt as NotificationsDelivery, R as Credentials, Rn as TeamPermission, Rt as MonitoringAlertChannelState, S as BoardStatus, Sn as Ruleset, St as Issue, T as BoardTemplate, Tn as ServerInspection, Tt as IssuePriority, U as DeployScriptResult, Un as TunnelRoute, Ut as MonitoringCheck, V as DeployFunctionResult, Vn as TrackerDoctorReport, Vt as MonitoringAssertionComparison, W as Deployment, Wn as Tunnels, Wt as MonitoringCheckInput, X as DiscussionPatch, Xn as WorkerScriptState, Xt as NotificationsApplicationLayout, Y as DeploymentTrigger, Yn as WikiProxyConfig, Yt as NotificationsAccess, Z as DiscussionPost, Zn as Workers, Zt as NotificationsChannelLayout, _ as BoardFieldType, _n as PullRequest, _t as IdeaRecord, a as REQUIRED_CAPABILITIES, an as NotificationsOnboardingLayout, at as EnsureRelayResult, b as BoardRule, bn as RepoSettings, bt as ImportResult, c as AddedItem, cn as NotificationsPrsFeed, ct as EnsureWebhookResult, d as AuthDescription, dn as NotificationsSignedIn, dt as EnsuredTunnel, en as NotificationsForumTag, et as DnsRecordRequest, f as AuthEvent, fn as NotificationsWelcomeLayout, ft as Environment, g as BoardField, gn as ProviderIdentity, gt as ExportInfo, h as AuthUser, hn as Projects, ht as Errors, i as ProviderApiError, in as NotificationsMonitoringFeed, it as EnsureRelayInput, j as CardinalityFor, jn as SourceSecurity, jt as LifecycleResult, k as CapabilityKey, kn as SourceRepoInfo, kt as Issues, l as Analytics, ln as NotificationsServerLayout, lt as EnsuredDiscussion, m as AuthIdentity, mn as ParseWebhookInput, mt as Environments, n as ElevationRequiredError, nn as NotificationsLinksLayout, nt as DuplicateDiscussion, o as WebhookVerificationError, on as NotificationsPicture, ot as EnsureReport, p as AuthEventType, pn as PagesConfig, pt as EnvironmentReviewer, q as DeploymentRecord, qn as Wiki, qt as NormalizedAuthUser, r as MissingTokenError, rn as NotificationsMember, rt as EnsureDiscussionInput, s as isMulti, sn as NotificationsPinnedLayout, st as EnsureResult, t as CARDINALITY, tn as NotificationsLayout, tt as DnsRecordType, u as Auth, un as NotificationsSignIn, ut as EnsuredResource, v as BoardItem, vn as RelayState, vt as Ideas, w as BoardSummary, wn as Secrets, wt as IssueOrder, x as BoardState, xn as ResolvedCapability, xt as InspectRelayInput, y as BoardItemInput, yn as RepoRef, yt as ImportOptions, z as CredentialsInspection, zn as Tooling, zt as MonitoringAlertSettings } from "../index-D39ic8yM.mjs";
1
+ import { $ as DnsRecord, $t as NotificationsEveryoneLayout, A as Cardinality, An as SourceRulesetDetail, At as LabelDef, B as DeployFunctionConfig, Bn as ToolingDoctorReport, Bt as MonitoringAssertion, C as BoardStatusCategory, Cn as SecretScope, Ct as IssueComment, D as BoardView, Dn as SourceBranch, Dt as IssueSearchFilter, E as BoardTemplateFile, En as Source, Et as IssueRecord, F as CiRunStatus, Fn as StorageBranch, Ft as Monitoring, G as DeploymentProject, Gn as Vault, Gt as MonitoringHttpMethod, H as DeployScriptConfig, Hn as TrackerUser, Ht as MonitoringAssertionSource, I as ConnectionStringOptions, In as SyncResult, It as MonitoringAlertChannelInput, J as DeploymentTarget, Jn as WikiProvisionOpts, Jt as Notifications, K as DeploymentProjectSettings, Kn as WebhookDashboardInfo, Kt as MoveReport, L as CreateAuthUserInput, Ln as TeamEntry, Lt as MonitoringAlertChannelResult, M as Ci, Mn as SourceTeamMember, Mt as LifecycleSlot, N as CiRun, Nn as StatusCategory, Nt as Logs, O as CapabilityImpls, On as SourceFile, Ot as IssueSelector, P as CiRunFilter, Pn as Storage, Pt as LogsDataset, Q as Dns, Qt as NotificationsDelivery, R as Credentials, Rn as TeamPermission, Rt as MonitoringAlertChannelState, S as BoardStatus, Sn as Ruleset, St as Issue, T as BoardTemplate, Tn as ServerInspection, Tt as IssuePriority, U as DeployScriptResult, Un as TunnelRoute, Ut as MonitoringCheck, V as DeployFunctionResult, Vn as TrackerDoctorReport, Vt as MonitoringAssertionComparison, W as Deployment, Wn as Tunnels, Wt as MonitoringCheckInput, X as DiscussionPatch, Xn as WorkerScriptState, Xt as NotificationsApplicationLayout, Y as DeploymentTrigger, Yn as WikiProxyConfig, Yt as NotificationsAccess, Z as DiscussionPost, Zn as Workers, Zt as NotificationsChannelLayout, _ as BoardFieldType, _n as PullRequest, _t as IdeaRecord, a as REQUIRED_CAPABILITIES, an as NotificationsOnboardingLayout, at as EnsureRelayResult, b as BoardRule, bn as RepoSettings, bt as ImportResult, c as AddedItem, cn as NotificationsPrsFeed, ct as EnsureWebhookResult, d as AuthDescription, dn as NotificationsSignedIn, dt as EnsuredTunnel, en as NotificationsForumTag, et as DnsRecordRequest, f as AuthEvent, fn as NotificationsWelcomeLayout, ft as Environment, g as BoardField, gn as ProviderIdentity, gt as ExportInfo, h as AuthUser, hn as Projects, ht as Errors, i as ProviderApiError, in as NotificationsMonitoringFeed, it as EnsureRelayInput, j as CardinalityFor, jn as SourceSecurity, jt as LifecycleResult, k as CapabilityKey, kn as SourceRepoInfo, kt as Issues, l as Analytics, ln as NotificationsServerLayout, lt as EnsuredDiscussion, m as AuthIdentity, mn as ParseWebhookInput, mt as Environments, n as ElevationRequiredError, nn as NotificationsLinksLayout, nt as DuplicateDiscussion, o as WebhookVerificationError, on as NotificationsPicture, ot as EnsureReport, p as AuthEventType, pn as PagesConfig, pt as EnvironmentReviewer, q as DeploymentRecord, qn as Wiki, qt as NormalizedAuthUser, r as MissingTokenError, rn as NotificationsMember, rt as EnsureDiscussionInput, s as isMulti, sn as NotificationsPinnedLayout, st as EnsureResult, t as CARDINALITY, tn as NotificationsLayout, tt as DnsRecordType, u as Auth, un as NotificationsSignIn, ut as EnsuredResource, v as BoardItem, vn as RelayState, vt as Ideas, w as BoardSummary, wn as Secrets, wt as IssueOrder, x as BoardState, xn as ResolvedCapability, xt as InspectRelayInput, y as BoardItemInput, yn as RepoRef, yt as ImportOptions, z as CredentialsInspection, zn as Tooling, zt as MonitoringAlertSettings } from "../index-C4pFARzT.mjs";
2
2
  export { AddedItem, Analytics, Auth, AuthDescription, AuthEvent, AuthEventType, AuthIdentity, AuthUser, BoardField, BoardFieldType, BoardItem, BoardItemInput, BoardRule, BoardState, BoardStatus, BoardStatusCategory, BoardSummary, BoardTemplate, BoardTemplateFile, BoardView, CARDINALITY, CapabilityImpls, CapabilityKey, Cardinality, CardinalityFor, Ci, CiRun, CiRunFilter, CiRunStatus, ConnectionStringOptions, CreateAuthUserInput, Credentials, CredentialsInspection, DeployFunctionConfig, DeployFunctionResult, DeployScriptConfig, DeployScriptResult, Deployment, DeploymentProject, DeploymentProjectSettings, DeploymentRecord, DeploymentTarget, DeploymentTrigger, DiscussionPatch, DiscussionPost, Dns, DnsRecord, DnsRecordRequest, DnsRecordType, DuplicateDiscussion, ElevationRequiredError, EnsureDiscussionInput, EnsureRelayInput, EnsureRelayResult, EnsureReport, EnsureResult, EnsureWebhookResult, EnsuredDiscussion, EnsuredResource, EnsuredTunnel, Environment, EnvironmentReviewer, Environments, Errors, ExportInfo, IdeaRecord, Ideas, ImportOptions, ImportResult, InspectRelayInput, Issue, IssueComment, IssueOrder, IssuePriority, IssueRecord, IssueSearchFilter, IssueSelector, Issues, LabelDef, LifecycleResult, LifecycleSlot, Logs, LogsDataset, MissingTokenError, Monitoring, MonitoringAlertChannelInput, MonitoringAlertChannelResult, MonitoringAlertChannelState, MonitoringAlertSettings, MonitoringAssertion, MonitoringAssertionComparison, MonitoringAssertionSource, MonitoringCheck, MonitoringCheckInput, MonitoringHttpMethod, MoveReport, NormalizedAuthUser, Notifications, NotificationsAccess, NotificationsApplicationLayout, NotificationsChannelLayout, NotificationsDelivery, NotificationsEveryoneLayout, NotificationsForumTag, NotificationsLayout, NotificationsLinksLayout, NotificationsMember, NotificationsMonitoringFeed, NotificationsOnboardingLayout, NotificationsPicture, NotificationsPinnedLayout, NotificationsPrsFeed, NotificationsServerLayout, NotificationsSignIn, NotificationsSignedIn, NotificationsWelcomeLayout, PagesConfig, ParseWebhookInput, Projects, ProviderApiError, ProviderIdentity, PullRequest, REQUIRED_CAPABILITIES, RelayState, RepoRef, RepoSettings, ResolvedCapability, Ruleset, SecretScope, Secrets, ServerInspection, Source, SourceBranch, SourceFile, SourceRepoInfo, SourceRulesetDetail, SourceSecurity, SourceTeamMember, StatusCategory, Storage, StorageBranch, SyncResult, TeamEntry, TeamPermission, Tooling, ToolingDoctorReport, TrackerDoctorReport, TrackerUser, TunnelRoute, Tunnels, Vault, WebhookDashboardInfo, WebhookVerificationError, Wiki, WikiProvisionOpts, WikiProxyConfig, WorkerScriptState, Workers, isMulti };
@@ -1,4 +1,4 @@
1
- import { hr as ComposedPreset, mr as Capability, ur as compose } from "./index-D39ic8yM.mjs";
1
+ import { hr as ComposedPreset, mr as Capability, ur as compose } from "./index-C4pFARzT.mjs";
2
2
  /** Options for the audit capability. */
3
3
  interface AuditOptions {
4
4
  /** Enable Knip unused-export analysis (default: false). */
package/dist/presets.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { n as compose } from "./config-system-DYqb53Rd.mjs";
1
+ import { n as compose } from "./config-system-c8Ngywp-.mjs";
2
2
  import { DEFAULT_ORG } from "@theholocron/astromech";
3
3
  // src/presets/capabilities/audit.ts
4
4
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theholocron/cli",
3
- "version": "5.0.0-alpha.414",
3
+ "version": "5.0.0-alpha.416",
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.61.2",
60
60
  "tsx": "4.23.15",
61
61
  "yargs": "^18.1.0",
62
- "@theholocron/dagobah": "5.0.0-alpha.414",
63
- "@theholocron/astromech": "5.0.0-alpha.414",
64
- "@theholocron/datapad": "5.0.0-alpha.414",
62
+ "@theholocron/astromech": "5.0.0-alpha.416",
63
+ "@theholocron/dagobah": "5.0.0-alpha.416",
64
+ "@theholocron/datapad": "5.0.0-alpha.416",
65
65
  "@theholocron/git-utils": "^1.17.0-alpha.4",
66
66
  "@theholocron/github-client": "^1.58.0-alpha.27",
67
- "@theholocron/fs-utils": "^1.17.0-alpha.4",
68
67
  "@theholocron/env-utils": "^1.17.0-alpha.4",
69
- "@theholocron/http-client": "^1.58.0-alpha.27",
68
+ "@theholocron/fs-utils": "^1.17.0-alpha.4",
70
69
  "@theholocron/json-utils": "^1.17.0-alpha.4",
71
- "@theholocron/kyber": "5.0.0-alpha.414",
70
+ "@theholocron/kyber": "5.0.0-alpha.416",
72
71
  "@theholocron/misc-utils": "^1.17.0-alpha.4",
73
- "@theholocron/pkg-utils": "^1.17.0-alpha.4",
74
- "@theholocron/observability": "^0.7.0-alpha.4"
72
+ "@theholocron/observability": "^0.7.0-alpha.4",
73
+ "@theholocron/http-client": "^1.58.0-alpha.27",
74
+ "@theholocron/pkg-utils": "^1.17.0-alpha.4"
75
75
  },
76
76
  "devDependencies": {
77
77
  "@types/node": "^26",
@@ -86,8 +86,8 @@
86
86
  "vitest": "^5.1.0",
87
87
  "@theholocron/rollup-plugin-transform-template": "^8.9.0-alpha.16",
88
88
  "@theholocron/tsconfig": "^8.9.0-alpha.16",
89
- "@theholocron/eslint-config": "^8.9.0-alpha.16",
90
- "@theholocron/vitest-config": "^8.9.0-alpha.16"
89
+ "@theholocron/vitest-config": "^8.9.0-alpha.16",
90
+ "@theholocron/eslint-config": "^8.9.0-alpha.16"
91
91
  },
92
92
  "engines": {
93
93
  "node": ">=22.0.0"