@cortexkit/aft 0.57.1 → 0.58.0

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.
Files changed (50) hide show
  1. package/dist/adapters/opencode.d.ts +27 -0
  2. package/dist/adapters/opencode.d.ts.map +1 -1
  3. package/dist/adapters/pi.d.ts.map +1 -1
  4. package/dist/adapters/types.d.ts +14 -0
  5. package/dist/adapters/types.d.ts.map +1 -1
  6. package/dist/commands/backups.d.ts +7 -0
  7. package/dist/commands/backups.d.ts.map +1 -0
  8. package/dist/commands/doctor.d.ts +35 -1
  9. package/dist/commands/doctor.d.ts.map +1 -1
  10. package/dist/commands/index.d.ts.map +1 -1
  11. package/dist/commands/setup.d.ts +26 -0
  12. package/dist/commands/setup.d.ts.map +1 -1
  13. package/dist/doctor/features.d.ts +39 -0
  14. package/dist/doctor/features.d.ts.map +1 -0
  15. package/dist/doctor/opencode.d.ts +10 -0
  16. package/dist/doctor/opencode.d.ts.map +1 -1
  17. package/dist/index.js +3442 -732
  18. package/dist/lib/binary-install.d.ts +42 -0
  19. package/dist/lib/binary-install.d.ts.map +1 -0
  20. package/dist/lib/binary-probe.d.ts.map +1 -1
  21. package/dist/lib/bridge-tool-failures.d.ts.map +1 -1
  22. package/dist/lib/cli-logger.d.ts +34 -0
  23. package/dist/lib/cli-logger.d.ts.map +1 -0
  24. package/dist/lib/config-migration.d.ts +37 -0
  25. package/dist/lib/config-migration.d.ts.map +1 -0
  26. package/dist/lib/diagnostics.d.ts +14 -1
  27. package/dist/lib/diagnostics.d.ts.map +1 -1
  28. package/dist/lib/feature-plan.d.ts +111 -0
  29. package/dist/lib/feature-plan.d.ts.map +1 -0
  30. package/dist/lib/fs-errors.d.ts +34 -0
  31. package/dist/lib/fs-errors.d.ts.map +1 -0
  32. package/dist/lib/jsonc.d.ts.map +1 -1
  33. package/dist/lib/omp-helpers.d.ts +1 -1
  34. package/dist/lib/omp-helpers.d.ts.map +1 -1
  35. package/dist/lib/onnx-fix.d.ts.map +1 -1
  36. package/dist/lib/onnx.d.ts +18 -0
  37. package/dist/lib/onnx.d.ts.map +1 -1
  38. package/dist/lib/plugin-load.d.ts +51 -0
  39. package/dist/lib/plugin-load.d.ts.map +1 -0
  40. package/dist/lib/sanitize.d.ts +6 -0
  41. package/dist/lib/sanitize.d.ts.map +1 -1
  42. package/dist/setup/feature-list.d.ts +89 -0
  43. package/dist/setup/feature-list.d.ts.map +1 -0
  44. package/dist/setup/feature-wizard.d.ts +69 -0
  45. package/dist/setup/feature-wizard.d.ts.map +1 -0
  46. package/dist/setup/host-generation.d.ts +6 -0
  47. package/dist/setup/host-generation.d.ts.map +1 -1
  48. package/dist/setup/opencode-config.d.ts +53 -0
  49. package/dist/setup/opencode-config.d.ts.map +1 -1
  50. package/package.json +3 -2
@@ -0,0 +1,42 @@
1
+ /**
2
+ * The binary already sitting in the versioned cache for `version`, if any.
3
+ *
4
+ * A file here is not proof of a usable binary: the quick version probe can
5
+ * time out on the first run of a freshly copied binary (macOS assesses every
6
+ * new executable, which has taken seconds), and an entry written before
7
+ * identity sidecars existed is only trusted after it is asked its version.
8
+ * Callers use this to say "checking the cached binary" rather than "not
9
+ * found, downloading" when the downloader will in fact reuse the file.
10
+ */
11
+ export declare function cachedBinaryFor(version: string): string | null;
12
+ /**
13
+ * Obtain the native binary matching this CLI. Setup and `doctor --fix` both
14
+ * come through here, so a clean machine gets the same download (and the same
15
+ * failure explanation) from either command.
16
+ */
17
+ /** Downloads the binary for a `v`-prefixed tag; resolves to its path or null. */
18
+ export type BinaryDownloader = (tag: string) => Promise<string | null>;
19
+ export type BinaryFailureCause = "permission" | "network" | "missing_asset" | "checksum" | "unsupported_platform" | "other";
20
+ export type BinaryObtainResult = {
21
+ ok: true;
22
+ path: string;
23
+ } | {
24
+ ok: false;
25
+ cause: BinaryFailureCause;
26
+ message: string;
27
+ };
28
+ /**
29
+ * Classify why a download failed from the error it threw or the lines it
30
+ * logged. The downloader reports its cause only through the log, so every
31
+ * line is considered; the first recognised cause wins, in order of how
32
+ * specific it is.
33
+ */
34
+ export declare function classifyBinaryFailure(tag: string, evidence: string[]): {
35
+ cause: BinaryFailureCause;
36
+ message: string;
37
+ };
38
+ /** Download the binary for `version`, reporting the real cause on failure. */
39
+ export declare function obtainAftBinary(version: string, download?: BinaryDownloader): Promise<BinaryObtainResult>;
40
+ /** The command a user runs to retry the binary install from another command. */
41
+ export declare const BINARY_RETRY_COMMAND = "npx @cortexkit/aft doctor --fix";
42
+ //# sourceMappingURL=binary-install.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"binary-install.d.ts","sourceRoot":"","sources":["../../src/lib/binary-install.ts"],"names":[],"mappings":"AAOA;;;;;;;;;GASG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAQ9D;AAED;;;;GAIG;AAEH,iFAAiF;AACjF,MAAM,MAAM,gBAAgB,GAAG,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;AAEvE,MAAM,MAAM,kBAAkB,GAC1B,YAAY,GACZ,SAAS,GACT,eAAe,GACf,UAAU,GACV,sBAAsB,GACtB,OAAO,CAAC;AAEZ,MAAM,MAAM,kBAAkB,GAC1B;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GAC1B;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,kBAAkB,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAa9D;;;;;GAKG;AACH,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,MAAM,EACX,QAAQ,EAAE,MAAM,EAAE,GACjB;IAAE,KAAK,EAAE,kBAAkB,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAqChD;AAED,8EAA8E;AAC9E,wBAAsB,eAAe,CACnC,OAAO,EAAE,MAAM,EACf,QAAQ,GA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AAE,MAAM,GAAG,MAAM,EAAE,CAW3E;AAED;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,EAAE,gBAAgB,CAAC,EAAE,MAAM,GAAG,MAAM,CAM1F;AAED,wBAAgB,aAAa,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAEtE"}
@@ -1 +1 @@
1
- {"version":3,"file":"bridge-tool-failures.d.ts","sourceRoot":"","sources":["../../src/lib/bridge-tool-failures.ts"],"names":[],"mappings":"AAIA,sEAAsE;AACtE,eAAO,MAAM,qBAAqB,QAAkB,CAAC;AAErD,eAAO,MAAM,wBAAwB,KAAK,CAAC;AAO3C,wBAAgB,0BAA0B,IAAI,MAAM,CAGnD;AAED,gEAAgE;AAChE,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAuBvE;AAED,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC;AAmEpC;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,MAAM,GAAG,GAAG,CAAC,cAAc,EAAE,MAAM,CAAC,CAcxF;AAQD;;GAEG;AACH,wBAAgB,kCAAkC,CAChD,MAAM,EAAE,GAAG,CAAC,cAAc,EAAE,MAAM,CAAC,EACnC,OAAO,CAAC,EAAE;IAAE,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,GAChC,MAAM,CAqBR;AAED;;GAEG;AACH,wBAAgB,wCAAwC,CACtD,OAAO,GAAE,MAAqC,EAC9C,OAAO,CAAC,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,GACpD,MAAM,CAKR"}
1
+ {"version":3,"file":"bridge-tool-failures.d.ts","sourceRoot":"","sources":["../../src/lib/bridge-tool-failures.ts"],"names":[],"mappings":"AAIA,sEAAsE;AACtE,eAAO,MAAM,qBAAqB,QAAkB,CAAC;AAErD,eAAO,MAAM,wBAAwB,KAAK,CAAC;AAO3C,wBAAgB,0BAA0B,IAAI,MAAM,CAEnD;AAED,gEAAgE;AAChE,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAuBvE;AAED,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC;AAmEpC;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,OAAO,EAAE,MAAM,GAAG,GAAG,CAAC,cAAc,EAAE,MAAM,CAAC,CAcxF;AAQD;;GAEG;AACH,wBAAgB,kCAAkC,CAChD,MAAM,EAAE,GAAG,CAAC,cAAc,EAAE,MAAM,CAAC,EACnC,OAAO,CAAC,EAAE;IAAE,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,GAChC,MAAM,CAqBR;AAED;;GAEG;AACH,wBAAgB,wCAAwC,CACtD,OAAO,GAAE,MAAqC,EAC9C,OAAO,CAAC,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAC;IAAC,UAAU,CAAC,EAAE,MAAM,CAAA;CAAE,GACpD,MAAM,CAKR"}
@@ -0,0 +1,34 @@
1
+ import { type Logger } from "@cortexkit/aft-bridge";
2
+ /**
3
+ * The CLI's own log for messages from the shared bridge package.
4
+ *
5
+ * The bridge logs through a host-provided logger and, when none is set, prints
6
+ * `[aft-bridge] …` lines straight to stderr. Inside the setup and doctor
7
+ * screens those raw lines break the prompt layout, so the CLI installs this
8
+ * logger: every bridge line goes to `aft-cli.log` under the AFT log directory,
9
+ * and is echoed to stderr only with `--verbose`.
10
+ *
11
+ * Code that needs to know WHY a bridge operation failed (the binary download
12
+ * reports its cause only through the log) can listen for lines while the
13
+ * operation runs with {@link captureBridgeLog}.
14
+ */
15
+ export type BridgeLogLevel = "info" | "warn" | "error";
16
+ /** Path of the CLI log. Tests write to the temp directory, never the live log directory. */
17
+ export declare function cliLogPath(): string;
18
+ export declare const cliLogger: Logger;
19
+ /**
20
+ * Route bridge log lines to the CLI log. Idempotent; `verbose` only ever turns
21
+ * echoing on, so a later call without options keeps an earlier `--verbose`.
22
+ */
23
+ export declare function installCliLogger(options?: {
24
+ verbose?: boolean;
25
+ }): void;
26
+ /** Run `fn` and return every bridge log line it produced alongside its result. */
27
+ export declare function captureBridgeLog<T>(fn: () => Promise<T>): Promise<{
28
+ result: T;
29
+ lines: {
30
+ level: BridgeLogLevel;
31
+ message: string;
32
+ }[];
33
+ }>;
34
+ //# sourceMappingURL=cli-logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli-logger.d.ts","sourceRoot":"","sources":["../../src/lib/cli-logger.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,KAAK,MAAM,EAGZ,MAAM,uBAAuB,CAAC;AAE/B;;;;;;;;;;;;GAYG;AAEH,MAAM,MAAM,cAAc,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAOvD,4FAA4F;AAC5F,wBAAgB,UAAU,IAAI,MAAM,CAGnC;AAyBD,eAAO,MAAM,SAAS,EAAE,MAKvB,CAAC;AAEF;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,GAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAO,GAAG,IAAI,CAK1E;AAED,kFAAkF;AAClF,wBAAsB,gBAAgB,CAAC,CAAC,EACtC,EAAE,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GACnB,OAAO,CAAC;IAAE,MAAM,EAAE,CAAC,CAAC;IAAC,KAAK,EAAE;QAAE,KAAK,EAAE,cAAc,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,EAAE,CAAA;CAAE,CAAC,CAU7E"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Preview and report the retired-key config migration that `doctor --fix`
3
+ * runs through the native `aft fix-config`.
4
+ *
5
+ * The preview applies the shared TypeScript translation (kept equal to the
6
+ * native one by the config parity fixtures) to a copy of each file, so the
7
+ * plan can say what will change before anything is written. The report after
8
+ * the run diffs each file as it was before against what the binary wrote, so
9
+ * the user sees exactly what happened to their config, not a guess.
10
+ */
11
+ export type ConfigTier = "user" | "project";
12
+ export interface ConfigMigrationTarget {
13
+ path: string;
14
+ tier: ConfigTier;
15
+ }
16
+ export interface ConfigChange {
17
+ kind: "removed" | "added" | "changed";
18
+ key: string;
19
+ before?: unknown;
20
+ after?: unknown;
21
+ }
22
+ export interface ConfigMigrationPreview extends ConfigMigrationTarget {
23
+ changes: ConfigChange[];
24
+ }
25
+ type Json = Record<string, unknown>;
26
+ /** Parse a config file into plain data, or null when it is missing or unreadable. */
27
+ export declare function readPlainConfig(path: string): Json | null;
28
+ /** The files the migration touches: the user file and the project file at `cwd`, when present. */
29
+ export declare function configMigrationTargets(userConfigPath: string, cwd?: string): ConfigMigrationTarget[];
30
+ /** Leaf-level differences between two config objects; arrays compare as whole values. */
31
+ export declare function diffConfig(before: Json, after: Json, prefix?: string): ConfigChange[];
32
+ /** Files that still use retired keys, with the changes the migration will make to each. */
33
+ export declare function previewConfigMigration(targets: ConfigMigrationTarget[]): ConfigMigrationPreview[];
34
+ /** One readable line per change, e.g. `removed tool_surface ("recommended")`. */
35
+ export declare function describeConfigChange(change: ConfigChange): string;
36
+ export {};
37
+ //# sourceMappingURL=config-migration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-migration.d.ts","sourceRoot":"","sources":["../../src/lib/config-migration.ts"],"names":[],"mappings":"AAIA;;;;;;;;;GASG;AAEH,MAAM,MAAM,UAAU,GAAG,MAAM,GAAG,SAAS,CAAC;AAE5C,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,UAAU,CAAC;CAClB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,SAAS,GAAG,OAAO,GAAG,SAAS,CAAC;IACtC,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,sBAAuB,SAAQ,qBAAqB;IACnE,OAAO,EAAE,YAAY,EAAE,CAAC;CACzB;AAED,KAAK,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAMpC,qFAAqF;AACrF,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAQzD;AAED,kGAAkG;AAClG,wBAAgB,sBAAsB,CACpC,cAAc,EAAE,MAAM,EACtB,GAAG,GAAE,MAAsB,GAC1B,qBAAqB,EAAE,CAQzB;AAED,yFAAyF;AACzF,wBAAgB,UAAU,CAAC,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,SAAK,GAAG,YAAY,EAAE,CA0BjF;AAED,2FAA2F;AAC3F,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,qBAAqB,EAAE,GAAG,sBAAsB,EAAE,CA0BjG;AAMD,iFAAiF;AACjF,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,CAWjE"}
@@ -3,6 +3,7 @@ import { type BinaryCacheInfo } from "./binary-cache.js";
3
3
  import { type BuildBreakerSuspension } from "./build-breaker.js";
4
4
  import type { LegacyPartitionDuplicationSummary } from "./legacy-storage.js";
5
5
  import { type LspCacheReport } from "./lsp-cache.js";
6
+ import { type PluginLoadBlockerCode, type PluginLoadEvaluation } from "./plugin-load.js";
6
7
  export interface DiagnosticReport {
7
8
  timestamp: string;
8
9
  platform: string;
@@ -19,7 +20,7 @@ export interface DiagnosticReport {
19
20
  }
20
21
  export type DiagnosticIssueSeverity = "high" | "medium" | "low" | "info";
21
22
  export interface DiagnosticIssue {
22
- code: "binary_missing" | "host_missing" | "plugin_missing" | "config_parse_error" | "plugin_cli_version_skew" | "onnx_missing" | "onnx_incompatible";
23
+ code: "binary_missing" | "host_missing" | "plugin_missing" | "config_parse_error" | "plugin_cli_version_skew" | "onnx_missing" | "onnx_incompatible" | PluginLoadBlockerCode;
23
24
  severity: DiagnosticIssueSeverity;
24
25
  scope: string;
25
26
  message: string;
@@ -74,9 +75,21 @@ export interface HarnessDiagnostic {
74
75
  exists: boolean;
75
76
  sizeKb: number;
76
77
  };
78
+ /**
79
+ * What the plugin will do with this config at startup: the conditions that
80
+ * stop it from loading at all, and the effective semantic backend. Optional
81
+ * so hand-built reports (tests, older callers) still type-check.
82
+ */
83
+ pluginLoad?: PluginLoadEvaluation;
77
84
  }
78
85
  export declare function collectDiagnostics(adapters: HarnessAdapter[]): Promise<DiagnosticReport>;
79
86
  export declare function renderDiagnosticsMarkdown(report: DiagnosticReport): string;
87
+ /**
88
+ * The plugin/CLI version-skew issue for one harness, or null when there is
89
+ * none. Doctor prints it in the harness section as well as under "Issues
90
+ * found", so both places carry the same text.
91
+ */
92
+ export declare function pluginVersionSkewFor(report: DiagnosticReport, harness: HarnessDiagnostic): DiagnosticIssue | null;
80
93
  export declare function collectDiagnosticIssues(report: DiagnosticReport): DiagnosticIssue[];
81
94
  export declare function findPluginCliVersionSkews(report: DiagnosticReport): DiagnosticIssue[];
82
95
  export declare function formatDiagnosticIssuesSection(report: DiagnosticReport): string[];
@@ -1 +1 @@
1
- {"version":3,"file":"diagnostics.d.ts","sourceRoot":"","sources":["../../src/lib/diagnostics.ts"],"names":[],"mappings":"AAcA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,KAAK,eAAe,EAAsB,MAAM,mBAAmB,CAAC;AAE7E,OAAO,EAAE,KAAK,sBAAsB,EAA+B,MAAM,oBAAoB,CAAC;AAG9F,OAAO,KAAK,EAAE,iCAAiC,EAAE,MAAM,qBAAqB,CAAC;AAE7E,OAAO,EAAqB,KAAK,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAcxE,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,M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ACpC,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;QAC1B,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;QAC7B,gBAAgB,EAAE,OAAO,GAAG,IAAI,CAAC;QACjC,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,EAAE,MAAM,CAAC;QACpB;;;;WAIG;QACH,gBAAgB,EAAE,OAAO,CAAC;QAC1B,WAAW,EAAE,MAAM,CAAC;KACrB,CAAC;IACF,OAAO,EAAE;QACP,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,EAAE,OAAO,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF;;;;OAIG;IACH,UAAU,CAAC,EAAE,oBAAoB,CAAC;CACnC;AAED,wBAAsB,kBAAkB,CAAC,QAAQ,EAAE,cAAc,EAAE,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAuB9F;AAyHD,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,CAiF1E;AAuFD;;;;GAIG;AACH,wBAAgB,oBAAoB,CAClC,MAAM,EAAE,gBAAgB,EACxB,OAAO,EAAE,iBAAiB,GACzB,eAAe,GAAG,IAAI,CAGxB;AAED,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,gBAAgB,GAAG,eAAe,EAAE,CAmHnF;AAED,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,gBAAgB,GAAG,eAAe,EAAE,CAIrF;AAED,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,gBAAgB,GAAG,MAAM,EAAE,CAUhF;AAED,yDAAyD;AACzD,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CA0C/D"}
@@ -0,0 +1,111 @@
1
+ /**
2
+ * Types and invocation helpers for the feature plan owned by the native
3
+ * binary (`aft setup --plan`). The CLI renders the plan and sends choices
4
+ * back; it never derives feature state itself.
5
+ */
6
+ export declare const SETUP_PLAN_VERSION = 1;
7
+ /**
8
+ * Row kinds. A `setting` is a boolean setting of a tool (the bash settings);
9
+ * its prerequisite is the tool it configures.
10
+ */
11
+ export type FeatureKind = "tool" | "index" | "capability" | "setting";
12
+ export type FeatureEffective = "off" | "building" | "ready" | "unavailable";
13
+ export interface PlanFeature {
14
+ id: string;
15
+ kind: FeatureKind;
16
+ group: string;
17
+ order: number;
18
+ label: string;
19
+ description: string;
20
+ binding: {
21
+ path: string;
22
+ tool_name: string | null;
23
+ };
24
+ default: boolean;
25
+ configured: boolean;
26
+ source: "default" | "config";
27
+ proposed: boolean;
28
+ effective: FeatureEffective;
29
+ reason: string | null;
30
+ available: boolean;
31
+ unavailable_reason: string | null;
32
+ cost_note: string | null;
33
+ prerequisites: string[];
34
+ }
35
+ export interface SetupPlan {
36
+ plan_version: number;
37
+ features: PlanFeature[];
38
+ }
39
+ export interface SetupAnswers {
40
+ plan_version: number;
41
+ selections: Record<string, boolean>;
42
+ }
43
+ /** Result of one native setup invocation. */
44
+ export interface NativeResult {
45
+ ok: boolean;
46
+ stdout: string;
47
+ stderr: string;
48
+ status: number | null;
49
+ /** True when no native binary was found, so nothing ran at all. */
50
+ missingBinary?: boolean;
51
+ }
52
+ /** Why a native command could not run when no binary is installed. */
53
+ export declare const MISSING_BINARY_MESSAGE = "the AFT binary is not installed";
54
+ export type NativeRunner = (args: string[], input?: string) => NativeResult;
55
+ /** Run the native binary with `args`, capturing output. */
56
+ export declare function runNative(args: string[], input?: string): NativeResult;
57
+ /** A runner pinned to one binary, for a caller that just installed it. */
58
+ export declare function nativeRunnerFor(binary: string): NativeRunner;
59
+ /** Native arguments carrying an explicit harness selector, when one was given. */
60
+ export declare function harnessArgs(harness: string | null | undefined): string[];
61
+ /** The `--harness` value the user passed, if any. Never inferred from installed hosts. */
62
+ export declare function explicitHarness(argv: string[]): string | null;
63
+ export type PlanLoad = {
64
+ ok: true;
65
+ plan: SetupPlan;
66
+ warnings: string;
67
+ } | {
68
+ ok: false;
69
+ error: string;
70
+ /** The binary refused the configuration itself (it needs `aft doctor --fix`). */
71
+ configRejected: boolean;
72
+ /** No binary was installed, so no plan could be produced. */
73
+ missingBinary?: boolean;
74
+ };
75
+ /**
76
+ * The native binary names its own commands as `aft doctor --fix` / `aft setup`,
77
+ * but a user running this CLI through npx has no `aft` on PATH. Rewrite those
78
+ * suggestions to the command they can actually run.
79
+ */
80
+ export declare function withCliCommands(text: string): string;
81
+ /** Load and validate the plan. Unknown plan versions are refused. */
82
+ export declare function loadFeaturePlan(harness: string | null, run?: NativeRunner): PlanLoad;
83
+ /**
84
+ * Write answers through the binary. `alreadyWarned` tells the binary this
85
+ * setup operation already reported its load warnings (from the plan call), so
86
+ * the write does not repeat them.
87
+ */
88
+ export declare function writeFeatureAnswers(answers: SetupAnswers, harness: string | null, alreadyWarned: boolean, run?: NativeRunner): NativeResult;
89
+ /** One file's outcome from `aft fix-config`. */
90
+ export interface ConfigFixFile {
91
+ path: string;
92
+ tier: "user" | "project";
93
+ status: "rewritten" | "unchanged" | "failed";
94
+ notes: string[];
95
+ error: string | null;
96
+ }
97
+ export type ConfigFixRun = {
98
+ ok: true;
99
+ files: ConfigFixFile[];
100
+ } | {
101
+ ok: false;
102
+ error: string;
103
+ missingBinary: boolean;
104
+ };
105
+ /**
106
+ * Run the configuration migration (`aft fix-config`). Per-file outcomes are
107
+ * returned even when some files failed; `ok:false` means the run produced no
108
+ * usable report at all.
109
+ */
110
+ export declare function runConfigFix(run?: NativeRunner): ConfigFixRun;
111
+ //# sourceMappingURL=feature-plan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"feature-plan.d.ts","sourceRoot":"","sources":["../../src/lib/feature-plan.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AAEH,eAAO,MAAM,kBAAkB,IAAI,CAAC;AAEpC;;;GAGG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,OAAO,GAAG,YAAY,GAAG,SAAS,CAAC;AACtE,MAAM,MAAM,gBAAgB,GAAG,KAAK,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E,MAAM,GAAG,SAAS,CAAC;IACzB,MAAM,EAAE,WAAW,GAAG,WAAW,GAAG,QAAQ,CAAC;IAC7C,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,MAAM,MAAM,YAAY,GACpB;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,aAAa,EAAE,CAAA;CAAE,GACpC;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,OAAO,CAAA;CAAE,CAAC;AAEzD;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,GAAG,GAAE,YAAwB,GAAG,YAAY,CAaxE"}
@@ -0,0 +1,34 @@
1
+ /** Injectable filesystem facts, so the message can be tested for any owner. */
2
+ export interface PermissionFacts {
3
+ /** Owner uid of an existing path, or null when it cannot be read. */
4
+ ownerUid(path: string): number | null;
5
+ /** The uid this process runs as, or null where uids do not exist (Windows). */
6
+ currentUid(): number | null;
7
+ /** A user name for a uid, or null when it cannot be resolved. */
8
+ userName(uid: number): string | null;
9
+ exists(path: string): boolean;
10
+ home(): string;
11
+ }
12
+ /** True for EACCES/EPERM/EROFS errors, or text carrying one of those codes. */
13
+ export declare function isPermissionError(error: unknown): boolean;
14
+ /** The path a Node fs error names, from `error.path` or the quoted path in its message. */
15
+ export declare function errorPath(error: unknown): string | null;
16
+ /** Show paths under the home directory as `~/…`, which is how users type them. */
17
+ export declare function tildePath(path: string, home?: string): string;
18
+ /**
19
+ * Describe a failed write to `target`.
20
+ *
21
+ * The owner shown is the nearest existing path (the file itself, or the first
22
+ * directory above a file that does not exist yet). When another user owns it,
23
+ * the fix widens to the highest directory below home that the same foreign
24
+ * owner holds, because `sudo npm i -g` usually takes the whole tree
25
+ * (`~/.config/opencode`, not just one file inside it).
26
+ */
27
+ export declare function describePermissionProblem(target: string, facts?: PermissionFacts): string;
28
+ /**
29
+ * One line for any filesystem error. Permission errors get the owner and fix
30
+ * command; everything else keeps its own message. `fallbackPath` is used when
31
+ * the error does not name a path itself.
32
+ */
33
+ export declare function formatFsError(error: unknown, fallbackPath?: string, facts?: PermissionFacts): string;
34
+ //# sourceMappingURL=fs-errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fs-errors.d.ts","sourceRoot":"","sources":["../../src/lib/fs-errors.ts"],"names":[],"mappings":"AAiBA,+EAA+E;AAC/E,MAAM,WAAW,eAAe;IAC9B,qEAAqE;IACrE,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IACtC,+EAA+E;IAC/E,UAAU,IAAI,MAAM,GAAG,IAAI,CAAC;IAC5B,iEAAiE;IACjE,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;IACrC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAC9B,IAAI,IAAI,MAAM,CAAC;CAChB;AA6CD,+EAA+E;AAC/E,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAIzD;AAED,2FAA2F;AAC3F,wBAAgB,SAAS,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAcvD;AAED,kFAAkF;AAClF,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,MAAkB,GAAG,MAAM,CAGxE;AASD;;;;;;;;GAQG;AACH,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,MAAM,EACd,KAAK,GAAE,eAA8B,GACpC,MAAM,CA4BR;AAED;;;;GAIG;AACH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,OAAO,EACd,YAAY,CAAC,EAAE,MAAM,EACrB,KAAK,GAAE,eAA8B,GACpC,MAAM,CAMR"}
@@ -1 +1 @@
1
- {"version":3,"file":"jsonc.d.ts","sourceRoot":"","sources":["../../src/lib/jsonc.ts"],"names":[],"mappings":"AAIA,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AAED,8EAA8E;AAC9E,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG;IAC3C,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACtC,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAcA;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC9B,MAAM,GAAE,WAAoB,GAC3B,IAAI,CAKN;AAED,wDAAwD;AACxD,eAAO,MAAM,cAAc,gFACoD,CAAC;AAEhF,MAAM,MAAM,eAAe,GAAG,OAAO,GAAG,SAAS,GAAG,WAAW,CAAC;AAEhE;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,WAAW,GAClB;IAAE,MAAM,EAAE,eAAe,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CA4C9C"}
@@ -1,4 +1,4 @@
1
- import { spawnSync } from "node:child_process";
1
+ import { spawnSync } from "@cortexkit/aft-bridge";
2
2
  export interface OmpBinaryInfo {
3
3
  path: string;
4
4
  source: "path" | "home" | "package";
@@ -1 +1 @@
1
- {"version":3,"file":"omp-helpers.d.ts","sourceRoot":"","sources":["../../src/lib/omp-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAO/C,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,SAAS,CAAC;CACrC;AAED,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,OAAO,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,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,CAAC,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAAC;CAC3D;AA6ED,wBAAsB,UAAU,CAC9B,QAAQ,EAAE,cAAc,EAAE,EAC1B,MAAM,EAAE,gBAAgB,EACxB,OAAO,GAAE,cAAmB,GAC3B,OAAO,CAAC,aAAa,GAAG,IAAI,CAAC,CAgF/B"}
@@ -12,7 +12,25 @@ export declare function getOnnxLibraryName(): string;
12
12
  */
13
13
  export declare function getManualInstallHint(): string;
14
14
  export declare function findIgnoredWindowsSystemOnnxRuntime(): string | null;
15
+ /** A system runtime the bridge resolver will skip, and why. */
16
+ export interface IgnoredSystemOnnxRuntime {
17
+ path: string;
18
+ reason: string;
19
+ }
20
+ export interface SystemOnnxRuntimeInspection {
21
+ /** The system runtime the bridge resolver would use, if any. */
22
+ path: string | null;
23
+ /** The first candidate skipped because it cannot be loaded. */
24
+ ignored: IgnoredSystemOnnxRuntime | null;
25
+ }
15
26
  export declare function findSystemOnnxRuntime(): string | null;
27
+ /**
28
+ * Mirror of the bridge resolver's system search, including its loadability
29
+ * probe, so doctor reports the runtime AFT will really use. A library whose
30
+ * required dependencies are missing is reported as ignored with the reason
31
+ * instead of as a compatible system runtime.
32
+ */
33
+ export declare function inspectSystemOnnxRuntime(searchPathsOverride?: string[]): SystemOnnxRuntimeInspection;
16
34
  export declare function findCachedOnnxRuntime(storageDir: string): string | null;
17
35
  /**
18
36
  * Detect an installed ONNX Runtime's advertised version by walking the
@@ -1 +1 @@
1
- {"version":3,"file":"onnx.d.ts","sourceRoot":"","sources":["../../src/lib/onnx.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,oBAAoB,WAAW,CAAC;AAE7C,wBAAgB,kBAAkB,IAAI,MAAM,CAI3C;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,IAAI,MAAM,CAa7C;AAkDD,wBAAgB,mCAAmC,IAAI,MAAM,GAAG,IAAI,CAcnE;AAED,wBAAg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+DAA+D;AAC/D,eAAO,MAAM,kBAAkB,IAAI,CAAC;AACpC,eAAO,MAAM,sBAAsB,KAAK,CAAC;AAEzC,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAM/D"}
@@ -0,0 +1,51 @@
1
+ import { type ConfigErrorCode } from "@cortexkit/aft-bridge";
2
+ /**
3
+ * What the plugin will do with the AFT config it loads at startup.
4
+ *
5
+ * `doctor` used to read the config only for display, so a config the plugin
6
+ * cannot use still reported "registered, healthy". This mirrors the plugin's
7
+ * startup config checks: retired keys the policy rejects, a file that does not
8
+ * parse, and a `subc.connection_file` that points at no file. On any of them
9
+ * the plugin still loads and registers its tools, but in its config error
10
+ * state: every AFT tool call fails with the error. The text of that error
11
+ * comes from the same `@cortexkit/aft-bridge` helpers the plugins use, so
12
+ * doctor quotes exactly what the model sees. It also derives the effective
13
+ * semantic backend, which decides whether ONNX Runtime is needed at all.
14
+ */
15
+ export type PluginLoadBlockerCode = ConfigErrorCode;
16
+ export interface PluginLoadBlocker {
17
+ code: PluginLoadBlockerCode;
18
+ /** The config file responsible. */
19
+ path: string;
20
+ /** Doctor's description, quoting the error every AFT tool call returns. */
21
+ message: string;
22
+ /** The exact text every AFT tool call fails with while this condition holds. */
23
+ toolCallError: string;
24
+ /** Exactly what the user (or `doctor --fix`) does about it. */
25
+ remediation: string;
26
+ /** True when `doctor --fix` repairs it (the retired-key migration). */
27
+ fixable: boolean;
28
+ }
29
+ export interface PluginLoadEvaluation {
30
+ blockers: PluginLoadBlocker[];
31
+ /** Whether the semantic index resolves on. */
32
+ semanticIndex: boolean;
33
+ /** The effective `semantic.backend` (`fastembed` when unset). */
34
+ semanticBackend: string;
35
+ /** True only for the local backend with the semantic index on. */
36
+ onnxRequired: boolean;
37
+ }
38
+ /** Same resolution as the plugin's transport factory: `~` and relative paths are under home. */
39
+ export declare function resolveSubcConnectionPath(raw: string, home?: string): string;
40
+ export interface PluginLoadInput {
41
+ userConfigPath: string;
42
+ /** Project directory whose `.cortexkit/aft.jsonc` the plugin also loads. */
43
+ projectDirectory?: string;
44
+ /** Harness id for `harnesses.<id>` overrides ("opencode" | "pi" | "omp"). */
45
+ harness: string;
46
+ /** Plugin version whose retired-key policy applies. */
47
+ pluginVersion: string;
48
+ home?: string;
49
+ }
50
+ export declare function evaluatePluginLoad(input: PluginLoadInput): PluginLoadEvaluation;
51
+ //# sourceMappingURL=plugin-load.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin-load.d.ts","sourceRoot":"","sources":["../../src/lib/plugin-load.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,eAAe,EAWrB,MAAM,uBAAuB,CAAC;AAK/B;;;;;;;;;;;;GAYG;AAEH,MAAM,MAAM,qBAAqB,GAAG,eAAe,CAAC;AAEpD,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,qBAAqB,CAAC;IAC5B,mCAAmC;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,2EAA2E;IAC3E,OAAO,EAAE,MAAM,CAAC;IAChB,gFAAgF;IAChF,aAAa,EAAE,MAAM,CAAC;IACtB,+DAA+D;IAC/D,WAAW,EAAE,MAAM,CAAC;IACpB,uEAAuE;IACvE,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,iBAAiB,EAAE,CAAC;IAC9B,8CAA8C;IAC9C,aAAa,EAAE,OAAO,CAAC;IACvB,iEAAiE;IACjE,eAAe,EAAE,MAAM,CAAC;IACxB,kEAAkE;IAClE,YAAY,EAAE,OAAO,CAAC;CACvB;AAsBD,gGAAgG;AAChG,wBAAgB,yBAAyB,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAE5E;AAiBD,MAAM,WAAW,eAAe;IAC9B,cAAc,EAAE,MAAM,CAAC;IACvB,4EAA4E;IAC5E,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,6EAA6E;IAC7E,OAAO,EAAE,MAAM,CAAC;IAChB,uDAAuD;IACvD,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,eAAe,GAAG,oBAAoB,CAsF/E"}
@@ -1,4 +1,10 @@
1
1
  export declare function escapeRegex(value: string): string;
2
+ /**
3
+ * Mask credentials only (tokens, URL userinfo, credential key/values, email
4
+ * addresses), leaving paths alone. `sanitizeContent` adds the path and
5
+ * username passes on top.
6
+ */
7
+ export declare function redactSecrets(content: string): string;
2
8
  /**
3
9
  * Strip personally identifiable path segments and usernames from arbitrary
4
10
  * text. Used on log contents, diagnostic JSON blocks, and the final issue body
@@ -1 +1 @@
1
- {"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../src/lib/sanitize.ts"],"names":[],"mappings":"AAGA,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEjD;AAmFD;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAkCvD;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAarD"}
1
+ {"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../src/lib/sanitize.ts"],"names":[],"mappings":"AAGA,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEjD;AAiED;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CA+CrD;AAED;;;;GAIG;AACH,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAkCvD;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAarD"}
@@ -0,0 +1,89 @@
1
+ import type { Readable, Writable } from "node:stream";
2
+ /**
3
+ * The grouped feature checklist for setup.
4
+ *
5
+ * Clack's own group multiselect prints a row's description as a hint in
6
+ * parentheses after the label, only for checked or focused rows, and wraps a
7
+ * long hint with the wrong tree prefix (the continuation line loses the `│`
8
+ * that joins the group). This renderer puts each description on its own
9
+ * indented line under the label, word-wrapped to the terminal width with the
10
+ * same tree prefix on every line, so a row renders the same whatever its state
11
+ * and the tree never breaks. Rows show only the label and description.
12
+ */
13
+ export interface FeatureRow {
14
+ value: string;
15
+ label: string;
16
+ description: string;
17
+ }
18
+ /**
19
+ * How rows depend on each other. `requires` maps a setting row to the tool row
20
+ * it configures: while that tool is unchecked the setting does not apply, is
21
+ * drawn as not applicable and cannot be toggled, and keeps its value so
22
+ * checking the tool again restores it. `implies` maps a row to a row it needs:
23
+ * checking the row checks its prerequisite, and unchecking the prerequisite
24
+ * unchecks the row.
25
+ */
26
+ export interface SelectionRules {
27
+ requires: ReadonlyMap<string, string>;
28
+ implies: ReadonlyMap<string, string>;
29
+ /** Display name of a required row, for the not-applicable note. */
30
+ labels?: ReadonlyMap<string, string>;
31
+ }
32
+ export declare const NO_RULES: SelectionRules;
33
+ /**
34
+ * The selection after one toggle, with the rules applied: a row that does not
35
+ * apply keeps its previous value, a newly checked row checks its prerequisite,
36
+ * and a newly unchecked prerequisite unchecks the rows that need it.
37
+ */
38
+ export declare function applySelectionRules(previous: readonly string[], next: readonly string[], rules: SelectionRules): string[];
39
+ /**
40
+ * A finished selection made consistent: every checked row's prerequisite is
41
+ * checked. Used on whatever the prompt returns, so answers never ask for a
42
+ * row without the row it needs.
43
+ */
44
+ export declare function normalizeSelection(picked: readonly string[], rules: SelectionRules): string[];
45
+ /** Rows that do not apply under `selected`, each mapped to the unchecked row it requires. */
46
+ export declare function inapplicableRows(selected: ReadonlySet<string>, rules: SelectionRules): Map<string, string>;
47
+ /** Word-wrap plain text to `width` columns; a word longer than a line is split. */
48
+ export declare function wrapWords(text: string, width: number): string[];
49
+ export type RowState = "active" | "selected" | "active-selected" | "inactive";
50
+ /**
51
+ * A group checkbox's state. `partial` is a group with some rows checked and
52
+ * some not: clack draws it the same as an empty group, which made a mostly-on
53
+ * group (say Editing with only aft_move and aft_delete off) look switched off.
54
+ */
55
+ export type GroupState = RowState | "partial" | "active-partial";
56
+ /**
57
+ * One feature row as terminal lines, without the guide bar. `last` marks the
58
+ * final row of its group, which closes the tree branch. `requires` names the
59
+ * unchecked row this one depends on: the row is then drawn as not applicable,
60
+ * with an empty dim checkbox whatever its remembered value.
61
+ */
62
+ export declare function renderRowLines(row: FeatureRow, state: RowState, last: boolean, columns: number, requires?: string): string[];
63
+ /**
64
+ * A group header: the group name with a checkbox that reflects its rows (all,
65
+ * some or none checked). Pressing space on a partial group checks every row,
66
+ * which is clack's toggle for any group that is not fully checked.
67
+ */
68
+ export declare function renderGroupLine(name: string, state: GroupState): string;
69
+ /** The header state for a group given how many of its rows are checked. */
70
+ export declare function groupState(active: boolean, checked: number, total: number): GroupState;
71
+ /**
72
+ * A complete static frame of the checklist: message, every group and row, and
73
+ * the key help. Used for the prompt's first paint and by tests; the live
74
+ * prompt scrolls the same lines when they do not fit the terminal.
75
+ */
76
+ export declare function renderFeatureList(message: string, groups: Record<string, FeatureRow[]>, selected: ReadonlySet<string>, columns: number, cursor?: string | null, rules?: SelectionRules): string;
77
+ /** Terminal streams for the prompt; tests pass their own to render at a fixed width. */
78
+ export interface PromptStreams {
79
+ input?: Readable;
80
+ output?: Writable & {
81
+ columns?: number;
82
+ };
83
+ }
84
+ /**
85
+ * Show the checklist and return the checked row values; calls `onCancel` on
86
+ * cancel. `rules` keeps dependent rows consistent as the user toggles.
87
+ */
88
+ export declare function promptFeatureList(message: string, groups: Record<string, FeatureRow[]>, initial: string[], onCancel: () => never, streams?: PromptStreams, rules?: SelectionRules): Promise<string[]>;
89
+ //# sourceMappingURL=feature-list.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"feature-list.d.ts","sourceRoot":"","sources":["../../src/setup/feature-list.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ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