@theholocron/cli 5.0.0-alpha.417 → 5.0.0-alpha.418

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 CHANGED
@@ -422,6 +422,22 @@ export declare function resolveEnvironmentId(id: string, input: {
422
422
  repoRoot: string;
423
423
  gitExec?: GitExec;
424
424
  }): Promise<string>;
425
+ /** The line that says how to fix a credentials path the version control ignore rules do not cover. */
426
+ export declare function ignoreAdvice(isDefault: boolean, choose: string): string;
427
+ /** The file `auth export` and `github-app create` write by default, relative to the repository root. */
428
+ export declare const PRIVATE_CREDENTIALS_FILE = ".holocron/.private/.credentials";
429
+ /** Where a credentials file goes: its absolute path, and whether it is the default one in the private directory. */
430
+ interface CredentialsFileTarget {
431
+ path: string;
432
+ /** True when no `--file` was given, so the file is in `.holocron/.private/` and a missing ignore rule is fixed by `repo sync`. */
433
+ isDefault: boolean;
434
+ }
435
+ /**
436
+ * The credentials file for a command: `file` (relative to `base`) when given, else `.holocron/.private/.credentials`
437
+ * under `base`. The default's directory is created when missing (owner-only), because the ignore check can only ask
438
+ * about a path whose directory exists and the file cannot be written without it.
439
+ */
440
+ export declare function resolveCredentialsFile(base: string, file: string | undefined, makeDir?: (dir: string) => void): CredentialsFileTarget;
425
441
  /**
426
442
  * The closed list of area files `loadConfig` reads from `.holocron/` (the directory is `.<config name>`, set by kyber):
427
443
  * `.holocron/notifications.*` fills `providers.notifications`' `layout`, `.holocron/repo.*` fills keys of `repo`, and `.holocron/org.*` fills provider options (`teamId`, `accountId`) a config leaves out.
package/dist/index.mjs CHANGED
@@ -6,9 +6,9 @@ import { describeError, style } from "@theholocron/kyber/ui";
6
6
  import { errorMessage } from "@theholocron/misc-utils";
7
7
  import { createRestClient } from "@theholocron/http-client";
8
8
  import { connectionProbe as connectionProbe$1 } from "@theholocron/kyber/checks";
9
- import { join } from "node:path";
9
+ import { dirname, join, resolve } from "node:path";
10
10
  import { readPackageJson } from "@theholocron/pkg-utils";
11
- import { fstatSync } from "node:fs";
11
+ import { fstatSync, mkdirSync } from "node:fs";
12
12
  // src/auth/auth.ts
13
13
  /**
14
14
  * The CLI's credentials: the OS keyring every plugin's bootstrap token lives in, and the two token resolvers built on
@@ -584,4 +584,32 @@ async function resolveEnvironmentId(id, input) {
584
584
  if (!isEnvironmentLayer(id)) return id;
585
585
  return layerEnvironment(await repoSlug(input.repoRoot, input.gitExec), id);
586
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 };
587
+ // src/private-dir/ignore-advice/ignore-advice.ts
588
+ /** The line that says how to fix a credentials path the version control ignore rules do not cover. */
589
+ function ignoreAdvice(isDefault, choose) {
590
+ return isDefault ? "the private directory's ignore rule is missing: run `holocron repo sync` to add it" : `add it to .gitignore, or ${choose}`;
591
+ }
592
+ /** The file `auth export` and `github-app create` write by default, relative to the repository root. */
593
+ const PRIVATE_CREDENTIALS_FILE = `.holocron/.private/.credentials`;
594
+ // src/private-dir/resolve-credentials-file/resolve-credentials-file.ts
595
+ /**
596
+ * The credentials file for a command: `file` (relative to `base`) when given, else `.holocron/.private/.credentials`
597
+ * under `base`. The default's directory is created when missing (owner-only), because the ignore check can only ask
598
+ * about a path whose directory exists and the file cannot be written without it.
599
+ */
600
+ function resolveCredentialsFile(base, file, makeDir = (dir) => void mkdirSync(dir, {
601
+ recursive: true,
602
+ mode: 448
603
+ })) {
604
+ if (file) return {
605
+ path: resolve(base, file),
606
+ isDefault: false
607
+ };
608
+ const path = resolve(base, PRIVATE_CREDENTIALS_FILE);
609
+ makeDir(dirname(path));
610
+ return {
611
+ path,
612
+ isDefault: true
613
+ };
614
+ }
615
+ export { AuthError, CANONICAL_LABELS, CARDINALITY, ConfigError, ConfigFileError, ElevationRequiredError, HOLOCRON_AREAS, KNOWN_STACK_DEPS, MissingTokenError, PRIVATE_CREDENTIALS_FILE, ProviderApiError, REQUIRED_CAPABILITIES, SHARED_AREAS, WebhookVerificationError, compose, connectionProbe, createFeatureResolver, createResolveToken, createRestClient, credentialsEnvironment, defineConfig, deriveCapabilities, deriveCompliance, deriveProfile, deriveStack, ignoreAdvice, isMulti, keyring, loadConfig, missingCapabilities, orderKeys, pickByCreation, placeAreas, readKeysLimited, readLinks, readWorkspacePackageJsons, reportProgress, resolveConfig, resolveCredentialsFile, resolveEntry, resolveEnvironmentId, resolvePluginPackage, resolveValue, roleTeamProblem, sourceProblem, stdoutKind, syncRoles };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theholocron/cli",
3
- "version": "5.0.0-alpha.417",
3
+ "version": "5.0.0-alpha.418",
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/astromech": "5.0.0-alpha.417",
63
- "@theholocron/dagobah": "5.0.0-alpha.417",
62
+ "@theholocron/astromech": "5.0.0-alpha.418",
64
63
  "@theholocron/env-utils": "^1.17.0-alpha.4",
64
+ "@theholocron/datapad": "5.0.0-alpha.418",
65
+ "@theholocron/fs-utils": "^1.17.0-alpha.4",
65
66
  "@theholocron/git-utils": "^1.17.0-alpha.4",
66
- "@theholocron/datapad": "5.0.0-alpha.417",
67
+ "@theholocron/github-client": "^1.58.0-alpha.27",
67
68
  "@theholocron/http-client": "^1.58.0-alpha.27",
68
69
  "@theholocron/json-utils": "^1.17.0-alpha.4",
69
- "@theholocron/github-client": "^1.58.0-alpha.27",
70
- "@theholocron/fs-utils": "^1.17.0-alpha.4",
70
+ "@theholocron/kyber": "5.0.0-alpha.418",
71
71
  "@theholocron/misc-utils": "^1.17.0-alpha.4",
72
- "@theholocron/kyber": "5.0.0-alpha.417",
72
+ "@theholocron/pkg-utils": "^1.17.0-alpha.4",
73
73
  "@theholocron/observability": "^0.7.0-alpha.4",
74
- "@theholocron/pkg-utils": "^1.17.0-alpha.4"
74
+ "@theholocron/dagobah": "5.0.0-alpha.418"
75
75
  },
76
76
  "devDependencies": {
77
77
  "@types/node": "^26",