@hop-top/kit 0.5.0-alpha.6 → 0.5.0-alpha.7

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 (70) hide show
  1. package/CHANGELOG.md +36 -0
  2. package/LICENSE-cobra.txt +174 -0
  3. package/NOTICE +15 -0
  4. package/README.md +3 -3
  5. package/dist/{alias-BOj0-VAr.d.ts → alias-BsJ2jGqQ.d.ts} +9 -1
  6. package/dist/alias.d.ts +1 -1
  7. package/dist/alias.js +4 -2
  8. package/dist/chunk-263IZ6Z6.js +915 -0
  9. package/dist/{chunk-S45UHXQF.js → chunk-DIDN4X5C.js} +8 -6
  10. package/dist/{chunk-7FDIN5KE.js → chunk-GHPJJV5L.js} +8 -4
  11. package/dist/chunk-JKMQSAJP.js +174 -0
  12. package/dist/chunk-JZ22ZUFA.js +1131 -0
  13. package/dist/{chunk-GAZPYCQD.js → chunk-NLMS7HGP.js} +93 -35
  14. package/dist/chunk-QQQYCWSC.js +240 -0
  15. package/dist/chunk-XJTRY453.js +868 -0
  16. package/dist/cli.js +6 -4
  17. package/dist/completion-sDKVXPUL.d.ts +109 -0
  18. package/dist/completion-values-By-mnjNt.d.ts +142 -0
  19. package/dist/completion-values.d.ts +1 -0
  20. package/dist/completion-values.js +29 -0
  21. package/dist/completion.d.ts +2 -1
  22. package/dist/completion.js +23 -2
  23. package/dist/compliance-AxFf-uMy.d.ts +60 -0
  24. package/dist/compliance.d.ts +1 -0
  25. package/dist/compliance.js +17 -0
  26. package/dist/config-CaK60ByQ.d.ts +241 -0
  27. package/dist/config.d.ts +1 -1
  28. package/dist/config.js +4 -2
  29. package/dist/index.d.ts +7 -5
  30. package/dist/index.js +26 -18
  31. package/dist/log-CkaxMX3U.d.ts +115 -0
  32. package/dist/log.d.ts +1 -1
  33. package/dist/log.js +2 -2
  34. package/dist/toolspec-UrWnoJ3Y.d.ts +336 -0
  35. package/dist/toolspec.d.ts +2 -1
  36. package/dist/toolspec.js +27 -2
  37. package/package.json +19 -3
  38. package/src/alias.test.ts +110 -1
  39. package/src/alias.ts +19 -4
  40. package/src/cli.ts +5 -0
  41. package/src/completion-scripts.ts +16 -0
  42. package/src/completion-values.test.ts +70 -10
  43. package/src/completion-values.ts +170 -66
  44. package/src/completion.conformance.test.ts +297 -0
  45. package/src/completion.test.ts +256 -145
  46. package/src/completion.ts +764 -121
  47. package/src/config-merge.test.ts +425 -0
  48. package/src/config.test.ts +41 -0
  49. package/src/config.ts +265 -18
  50. package/src/index.test.ts +2 -1
  51. package/src/index.ts +5 -1
  52. package/src/log.test.ts +270 -1
  53. package/src/log.ts +172 -44
  54. package/src/published-types.test.ts +18 -0
  55. package/src/toolspec-internal.ts +197 -0
  56. package/src/toolspec-manifest.test.ts +82 -0
  57. package/src/toolspec-manifest.ts +404 -0
  58. package/src/toolspec-spec-schemas.ts +12 -0
  59. package/src/toolspec-spec.test.ts +273 -0
  60. package/src/toolspec-spec.ts +458 -0
  61. package/src/toolspec.from-command.test.ts +216 -0
  62. package/src/toolspec.ts +159 -0
  63. package/test/toolspec/fixture.ts +73 -0
  64. package/dist/chunk-6RFRV4VP.js +0 -128
  65. package/dist/chunk-IQXEISMC.js +0 -142
  66. package/dist/chunk-W7ERKNSQ.js +0 -171
  67. package/dist/completion-CVnPcWMZ.d.ts +0 -32
  68. package/dist/config-Bm9fBXch.d.ts +0 -134
  69. package/dist/log-uKjHsK-c.d.ts +0 -62
  70. package/dist/toolspec-DPBr18Ub.d.ts +0 -106
package/dist/cli.js CHANGED
@@ -22,7 +22,9 @@
22
22
 
23
23
 
24
24
 
25
- var _chunk7FDIN5KEjs = require('./chunk-7FDIN5KE.js');
25
+ var _chunkGHPJJV5Ljs = require('./chunk-GHPJJV5L.js');
26
+ require('./chunk-72XZWQX7.js');
27
+ require('./chunk-POR5L2DG.js');
26
28
  require('./chunk-QPUCXQXT.js');
27
29
 
28
30
 
@@ -32,8 +34,8 @@ require('./chunk-QPUCXQXT.js');
32
34
 
33
35
 
34
36
  var _chunkKVG7YCTSjs = require('./chunk-KVG7YCTS.js');
35
- require('./chunk-72XZWQX7.js');
36
- require('./chunk-POR5L2DG.js');
37
+ require('./chunk-JZ22ZUFA.js');
38
+ require('./chunk-JKMQSAJP.js');
37
39
  require('./chunk-R5U7XKVJ.js');
38
40
 
39
41
 
@@ -65,4 +67,4 @@ require('./chunk-R5U7XKVJ.js');
65
67
 
66
68
 
67
69
 
68
- exports.Dark = _chunk7FDIN5KEjs.Dark; exports.ErrOffline = _chunkKVG7YCTSjs.ErrOffline; exports.HintSet = _chunk7FDIN5KEjs.HintSet; exports.Neon = _chunk7FDIN5KEjs.Neon; exports.OfflineError = _chunkKVG7YCTSjs.OfflineError; exports.active = _chunk7FDIN5KEjs.active; exports.applyHelpTheme = _chunk7FDIN5KEjs.applyHelpTheme; exports.buildTheme = _chunk7FDIN5KEjs.buildTheme; exports.channel = _chunk7FDIN5KEjs.channel; exports.createCLI = _chunk7FDIN5KEjs.createCLI; exports.getCommandGroup = _chunk7FDIN5KEjs.getCommandGroup; exports.getStreamDefs = _chunk7FDIN5KEjs.getStreamDefs; exports.guardFetch = _chunkKVG7YCTSjs.guardFetch; exports.hintsEnabled = _chunk7FDIN5KEjs.hintsEnabled; exports.isOffline = _chunkKVG7YCTSjs.isOffline; exports.isOfflineError = _chunkKVG7YCTSjs.isOfflineError; exports.isQuiet = _chunk7FDIN5KEjs.isQuiet; exports.registerStream = _chunk7FDIN5KEjs.registerStream; exports.registerUpgradeHints = _chunk7FDIN5KEjs.registerUpgradeHints; exports.registerVersionHints = _chunk7FDIN5KEjs.registerVersionHints; exports.renderHints = _chunk7FDIN5KEjs.renderHints; exports.setCommandGroup = _chunk7FDIN5KEjs.setCommandGroup; exports.streamFlagName = _chunk7FDIN5KEjs.streamFlagName; exports.streamLabel = _chunk7FDIN5KEjs.streamLabel; exports.streamOutput = _chunk7FDIN5KEjs.streamOutput; exports.verboseCount = _chunk7FDIN5KEjs.verboseCount; exports.verbosityFlagSpec = _chunk7FDIN5KEjs.verbosityFlagSpec; exports.verbosityShorthand = _chunk7FDIN5KEjs.verbosityShorthand; exports.withOffline = _chunkKVG7YCTSjs.withOffline;
70
+ exports.Dark = _chunkGHPJJV5Ljs.Dark; exports.ErrOffline = _chunkKVG7YCTSjs.ErrOffline; exports.HintSet = _chunkGHPJJV5Ljs.HintSet; exports.Neon = _chunkGHPJJV5Ljs.Neon; exports.OfflineError = _chunkKVG7YCTSjs.OfflineError; exports.active = _chunkGHPJJV5Ljs.active; exports.applyHelpTheme = _chunkGHPJJV5Ljs.applyHelpTheme; exports.buildTheme = _chunkGHPJJV5Ljs.buildTheme; exports.channel = _chunkGHPJJV5Ljs.channel; exports.createCLI = _chunkGHPJJV5Ljs.createCLI; exports.getCommandGroup = _chunkGHPJJV5Ljs.getCommandGroup; exports.getStreamDefs = _chunkGHPJJV5Ljs.getStreamDefs; exports.guardFetch = _chunkKVG7YCTSjs.guardFetch; exports.hintsEnabled = _chunkGHPJJV5Ljs.hintsEnabled; exports.isOffline = _chunkKVG7YCTSjs.isOffline; exports.isOfflineError = _chunkKVG7YCTSjs.isOfflineError; exports.isQuiet = _chunkGHPJJV5Ljs.isQuiet; exports.registerStream = _chunkGHPJJV5Ljs.registerStream; exports.registerUpgradeHints = _chunkGHPJJV5Ljs.registerUpgradeHints; exports.registerVersionHints = _chunkGHPJJV5Ljs.registerVersionHints; exports.renderHints = _chunkGHPJJV5Ljs.renderHints; exports.setCommandGroup = _chunkGHPJJV5Ljs.setCommandGroup; exports.streamFlagName = _chunkGHPJJV5Ljs.streamFlagName; exports.streamLabel = _chunkGHPJJV5Ljs.streamLabel; exports.streamOutput = _chunkGHPJJV5Ljs.streamOutput; exports.verboseCount = _chunkGHPJJV5Ljs.verboseCount; exports.verbosityFlagSpec = _chunkGHPJJV5Ljs.verbosityFlagSpec; exports.verbosityShorthand = _chunkGHPJJV5Ljs.verbosityShorthand; exports.withOffline = _chunkKVG7YCTSjs.withOffline;
@@ -0,0 +1,109 @@
1
+ import { Command } from 'commander';
2
+ import { C as Completer } from './completion-values-By-mnjNt.js';
3
+
4
+ /**
5
+ * @module completion
6
+ * @package @hop-top/kit
7
+ *
8
+ * Shell completion for Commander-based CLIs, in cobra's protocol so a
9
+ * TS kit CLI completes like a Go or Rust one
10
+ * (`contracts/completion-v1`, Go canonical):
11
+ *
12
+ * - `completion bash|zsh|fish|powershell [--no-descriptions]` writes
13
+ * cobra v1.10.2's scripts byte for byte ({@link completionCommand}).
14
+ * - The scripts call back into the hidden `__complete` /
15
+ * `__completeNoDesc` entry point. {@link installCompletionRequest}
16
+ * (done by `createCLI` and {@link completionCommand}) answers it
17
+ * before commander parses, so no hook or action runs on tab. It walks
18
+ * the live command tree: subcommands, aliases, each command's own and
19
+ * inherited flags, choices and the completers bound with
20
+ * {@link bindFlag} / {@link bindArgs}.
21
+ *
22
+ * Wire format: one completion per line (`value`, or
23
+ * `value<TAB>description`), then `:<directive>`; stderr carries
24
+ * `Completion ended with directive: <name>`. Exit code 0.
25
+ *
26
+ * Commander has no public accessor for a few facts read here; they are
27
+ * typed locally in {@link CommanderInternals} (commander 15).
28
+ */
29
+
30
+ /** Name of the hidden command a shell script calls for completions. */
31
+ declare const REQUEST_CMD = "__complete";
32
+ /** Name of the hidden command that returns completions without descriptions. */
33
+ declare const NO_DESC_REQUEST_CMD = "__completeNoDesc";
34
+ /** A shell `completion` writes a script for. */
35
+ type Shell = 'bash' | 'zsh' | 'fish' | 'powershell';
36
+ /** Every shell, in the order the `completion` command lists them. */
37
+ declare const SHELLS: readonly Shell[];
38
+ /** The `completion <shell>` script for program `name`, cobra's byte for byte. */
39
+ declare function renderCompletionScript(shell: Shell, name: string, includeDescriptions?: boolean): string;
40
+ /** Generate a bash completion script (cobra V2; needs bash-completion). */
41
+ declare function generateBashCompletion(program: Command, includeDescriptions?: boolean): string;
42
+ /** Generate a zsh completion script for the given program. */
43
+ declare function generateZshCompletion(program: Command, includeDescriptions?: boolean): string;
44
+ /** Generate a fish completion script for the given program. */
45
+ declare function generateFishCompletion(program: Command, includeDescriptions?: boolean): string;
46
+ /** Generate a PowerShell completion script for the given program. */
47
+ declare function generatePowerShellCompletion(program: Command, includeDescriptions?: boolean): string;
48
+ /**
49
+ * cobra's `completion` command: `completion bash|zsh|fish|powershell
50
+ * [--no-descriptions]`, each printing the script to stdout. Add it to
51
+ * the program (kit puts it in the hidden `management` group). It also
52
+ * installs the `__complete` entry point on `program`.
53
+ */
54
+ declare function completionCommand(program: Command): Command;
55
+ /**
56
+ * Binds `completer` as the value completion of `cmd`'s own flag `flag`
57
+ * (long name, with or without `--`). An unknown flag is silent and the
58
+ * first binding wins, as with cobra's `RegisterFlagCompletionFunc`. A
59
+ * flag subcommands inherit is bound on the command declaring it.
60
+ */
61
+ declare function bindFlag(cmd: Command, flag: string, completer: Completer): void;
62
+ /** Binds `completer` as the completion of `cmd`'s positional arguments; replaces an earlier binding. */
63
+ declare function bindArgs(cmd: Command, completer: Completer): void;
64
+ /**
65
+ * Records `name` as a root-level alias of the command at `target` (a
66
+ * space-separated path), so root argument completion offers it as
67
+ * `name<TAB>alias for <target>`. `bridgeAliases` calls this.
68
+ */
69
+ declare function registerRootAlias(root: Command, name: string, target: string): void;
70
+ /** Where a request writes. */
71
+ interface CompletionIO {
72
+ out(s: string): void;
73
+ err(s: string): void;
74
+ }
75
+ /**
76
+ * Makes `program.parse` / `parseAsync` answer `__complete` and
77
+ * `__completeNoDesc` requests themselves, before commander parses, so
78
+ * no hook, option handler or action runs on tab. Idempotent.
79
+ */
80
+ declare function installCompletionRequest(program: Command): void;
81
+ /**
82
+ * Answers a completion request: `words` are the words after
83
+ * `__complete` (the last is the word being completed). Writes one
84
+ * completion per line, then `:<directive>`, to `io.out`, and the
85
+ * directive's name to `io.err`, in cobra's format.
86
+ */
87
+ declare function completeRequest(program: Command, words: string[], noDesc?: boolean, io?: CompletionIO): Promise<void>;
88
+
89
+ type completion_CompletionIO = CompletionIO;
90
+ declare const completion_NO_DESC_REQUEST_CMD: typeof NO_DESC_REQUEST_CMD;
91
+ declare const completion_REQUEST_CMD: typeof REQUEST_CMD;
92
+ declare const completion_SHELLS: typeof SHELLS;
93
+ type completion_Shell = Shell;
94
+ declare const completion_bindArgs: typeof bindArgs;
95
+ declare const completion_bindFlag: typeof bindFlag;
96
+ declare const completion_completeRequest: typeof completeRequest;
97
+ declare const completion_completionCommand: typeof completionCommand;
98
+ declare const completion_generateBashCompletion: typeof generateBashCompletion;
99
+ declare const completion_generateFishCompletion: typeof generateFishCompletion;
100
+ declare const completion_generatePowerShellCompletion: typeof generatePowerShellCompletion;
101
+ declare const completion_generateZshCompletion: typeof generateZshCompletion;
102
+ declare const completion_installCompletionRequest: typeof installCompletionRequest;
103
+ declare const completion_registerRootAlias: typeof registerRootAlias;
104
+ declare const completion_renderCompletionScript: typeof renderCompletionScript;
105
+ declare namespace completion {
106
+ export { type completion_CompletionIO as CompletionIO, completion_NO_DESC_REQUEST_CMD as NO_DESC_REQUEST_CMD, completion_REQUEST_CMD as REQUEST_CMD, completion_SHELLS as SHELLS, type completion_Shell as Shell, completion_bindArgs as bindArgs, completion_bindFlag as bindFlag, completion_completeRequest as completeRequest, completion_completionCommand as completionCommand, completion_generateBashCompletion as generateBashCompletion, completion_generateFishCompletion as generateFishCompletion, completion_generatePowerShellCompletion as generatePowerShellCompletion, completion_generateZshCompletion as generateZshCompletion, completion_installCompletionRequest as installCompletionRequest, completion_registerRootAlias as registerRootAlias, completion_renderCompletionScript as renderCompletionScript };
107
+ }
108
+
109
+ export { type CompletionIO as C, NO_DESC_REQUEST_CMD as N, REQUEST_CMD as R, SHELLS as S, type Shell as a, bindArgs as b, completion as c, bindFlag as d, completeRequest as e, completionCommand as f, generateBashCompletion as g, generateFishCompletion as h, generatePowerShellCompletion as i, generateZshCompletion as j, installCompletionRequest as k, renderCompletionScript as l, registerRootAlias as r };
@@ -0,0 +1,142 @@
1
+ /**
2
+ * @module completion-values
3
+ * @package @hop-top/kit
4
+ *
5
+ * Dynamic value completion for Commander-based CLIs. Ports Go
6
+ * `console/cli/completion`; behaviour is pinned by
7
+ * `contracts/completion-v1/completers.json`.
8
+ *
9
+ * A {@link Completer} turns the word being completed into
10
+ * {@link CompletionItem}s. `bindFlag` / `bindArgs` (in `completion`)
11
+ * attach one to a flag or to a command's positional arguments; the
12
+ * scripts `completion <shell>` writes call back into the program's
13
+ * hidden `__complete` entry point, which runs the bound completer and
14
+ * prints the result through {@link resolveCompletions} in cobra's wire
15
+ * format.
16
+ *
17
+ * Contract:
18
+ * - Prefix matching in static, config-key and the dimension half of
19
+ * prefixed completers is case-insensitive; an empty prefix returns
20
+ * every item. {@link funcCompleter} sees the raw prefix, unfiltered.
21
+ * - A completer fails by throwing (or rejecting); the bridge turns that
22
+ * into {@link ShellCompDirective.Error}.
23
+ * - {@link fileCompleter} and {@link dirCompleter} yield a directive,
24
+ * not suggestions: filter by extension (the extensions travel as the
25
+ * completions), directories only, or plain file completion when no
26
+ * extension is given.
27
+ */
28
+ interface CompletionItem {
29
+ value: string;
30
+ description?: string;
31
+ }
32
+ /** What a completer knows about the command line it completes. */
33
+ interface CompletionContext {
34
+ /** Space-separated path of the command below the root; empty for the root. */
35
+ commandPath: string;
36
+ /** Positional arguments already given, flags removed. */
37
+ args: string[];
38
+ }
39
+ /** What a file completer asks the shell for. */
40
+ type FileFilter = {
41
+ kind: 'extensions';
42
+ extensions: string[];
43
+ } | {
44
+ kind: 'dirs';
45
+ };
46
+ interface Completer {
47
+ complete(prefix: string, ctx?: CompletionContext): CompletionItem[] | Promise<CompletionItem[]>;
48
+ /** Set by {@link fileCompleter} and {@link dirCompleter}. */
49
+ readonly fileFilter?: FileFilter;
50
+ }
51
+ /** cobra's shell directive bits, read by the scripts from the `:<n>` line. */
52
+ declare const ShellCompDirective: {
53
+ readonly Default: 0;
54
+ readonly Error: 1;
55
+ readonly NoSpace: 2;
56
+ readonly NoFileComp: 4;
57
+ readonly FilterFileExt: 8;
58
+ readonly FilterDirs: 16;
59
+ readonly KeepOrder: 32;
60
+ };
61
+ /** cobra's name for a directive, as printed on stderr after a request. */
62
+ declare function directiveName(d: number): string;
63
+ /** Completions in wire form plus the directive. */
64
+ interface ResolvedCompletions {
65
+ /** `value`, or `value\tdescription` when there is one. */
66
+ completions: string[];
67
+ directive: number;
68
+ }
69
+ /**
70
+ * Runs `c` for `toComplete` and converts the result to the shell wire
71
+ * format: values with any description joined by a tab, plus the
72
+ * directive (no file completion on success, error when `c` fails).
73
+ */
74
+ declare function resolveCompletions(c: Completer, toComplete: string, ctx?: CompletionContext): Promise<ResolvedCompletions>;
75
+ /** `value`, or `value\tdescription` when there is one. */
76
+ declare function withDescription(i: CompletionItem): string;
77
+ /**
78
+ * Maps flag names and argument positions to completers, for sharing
79
+ * completers across a command tree (Go `Registry`). A lookup table
80
+ * only: `bindFlag` / `bindArgs` wire a completer into completion.
81
+ */
82
+ declare class CompletionRegistry {
83
+ private flags;
84
+ private args;
85
+ register(flag: string, completer: Completer): void;
86
+ registerArg(cmd: string, pos: number, completer: Completer): void;
87
+ forFlag(flag: string): Completer | undefined;
88
+ forArg(cmd: string, pos: number): Completer | undefined;
89
+ }
90
+ /** Completer from pre-defined CompletionItems. */
91
+ declare function staticCompleter(...items: CompletionItem[]): Completer;
92
+ /** Completer from plain string values. */
93
+ declare function staticValues(...values: string[]): Completer;
94
+ /**
95
+ * Completer backed by a callback. The callback sees the raw prefix;
96
+ * nothing is filtered for it. Throw (or reject) to fail.
97
+ */
98
+ declare function funcCompleter(fn: (prefix: string, ctx: CompletionContext) => CompletionItem[] | Promise<CompletionItem[]>): Completer;
99
+ /**
100
+ * Completer for dimensioned values like `env:prod`. While no colon is
101
+ * typed it suggests `dimension:` (matched case-insensitively); after
102
+ * the first colon it delegates the rest to `values` and re-prepends
103
+ * the declared `dimension:`.
104
+ */
105
+ declare function prefixedCompleter(dimension: string, values: Completer): Completer;
106
+ /**
107
+ * Completer that suggests config keys: the dotted leaf keys of
108
+ * `config`, lowercased, matched case-insensitively.
109
+ */
110
+ declare function configKeysCompleter(config: Record<string, unknown>): Completer;
111
+ /**
112
+ * Completer that asks the shell for files with these extensions (e.g.
113
+ * `.yaml`); none means any file. Its items are the extensions, which
114
+ * travel as the completions of a filter-by-extension directive.
115
+ */
116
+ declare function fileCompleter(...extensions: string[]): Completer;
117
+ /** Completer that asks the shell for directories only. */
118
+ declare function dirCompleter(): Completer;
119
+
120
+ type completionValues_Completer = Completer;
121
+ type completionValues_CompletionContext = CompletionContext;
122
+ type completionValues_CompletionItem = CompletionItem;
123
+ type completionValues_CompletionRegistry = CompletionRegistry;
124
+ declare const completionValues_CompletionRegistry: typeof CompletionRegistry;
125
+ type completionValues_FileFilter = FileFilter;
126
+ type completionValues_ResolvedCompletions = ResolvedCompletions;
127
+ declare const completionValues_ShellCompDirective: typeof ShellCompDirective;
128
+ declare const completionValues_configKeysCompleter: typeof configKeysCompleter;
129
+ declare const completionValues_dirCompleter: typeof dirCompleter;
130
+ declare const completionValues_directiveName: typeof directiveName;
131
+ declare const completionValues_fileCompleter: typeof fileCompleter;
132
+ declare const completionValues_funcCompleter: typeof funcCompleter;
133
+ declare const completionValues_prefixedCompleter: typeof prefixedCompleter;
134
+ declare const completionValues_resolveCompletions: typeof resolveCompletions;
135
+ declare const completionValues_staticCompleter: typeof staticCompleter;
136
+ declare const completionValues_staticValues: typeof staticValues;
137
+ declare const completionValues_withDescription: typeof withDescription;
138
+ declare namespace completionValues {
139
+ export { type completionValues_Completer as Completer, type completionValues_CompletionContext as CompletionContext, type completionValues_CompletionItem as CompletionItem, completionValues_CompletionRegistry as CompletionRegistry, type completionValues_FileFilter as FileFilter, type completionValues_ResolvedCompletions as ResolvedCompletions, completionValues_ShellCompDirective as ShellCompDirective, completionValues_configKeysCompleter as configKeysCompleter, completionValues_dirCompleter as dirCompleter, completionValues_directiveName as directiveName, completionValues_fileCompleter as fileCompleter, completionValues_funcCompleter as funcCompleter, completionValues_prefixedCompleter as prefixedCompleter, completionValues_resolveCompletions as resolveCompletions, completionValues_staticCompleter as staticCompleter, completionValues_staticValues as staticValues, completionValues_withDescription as withDescription };
140
+ }
141
+
142
+ export { type Completer as C, type FileFilter as F, type ResolvedCompletions as R, ShellCompDirective as S, type CompletionContext as a, type CompletionItem as b, completionValues as c, CompletionRegistry as d, configKeysCompleter as e, dirCompleter as f, directiveName as g, fileCompleter as h, funcCompleter as i, staticValues as j, prefixedCompleter as p, resolveCompletions as r, staticCompleter as s, withDescription as w };
@@ -0,0 +1 @@
1
+ export { C as Completer, a as CompletionContext, b as CompletionItem, d as CompletionRegistry, F as FileFilter, R as ResolvedCompletions, S as ShellCompDirective, e as configKeysCompleter, f as dirCompleter, g as directiveName, h as fileCompleter, i as funcCompleter, p as prefixedCompleter, r as resolveCompletions, s as staticCompleter, j as staticValues, w as withDescription } from './completion-values-By-mnjNt.js';
@@ -0,0 +1,29 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+ var _chunkJKMQSAJPjs = require('./chunk-JKMQSAJP.js');
15
+ require('./chunk-R5U7XKVJ.js');
16
+
17
+
18
+
19
+
20
+
21
+
22
+
23
+
24
+
25
+
26
+
27
+
28
+
29
+ exports.CompletionRegistry = _chunkJKMQSAJPjs.CompletionRegistry; exports.ShellCompDirective = _chunkJKMQSAJPjs.ShellCompDirective; exports.configKeysCompleter = _chunkJKMQSAJPjs.configKeysCompleter; exports.dirCompleter = _chunkJKMQSAJPjs.dirCompleter; exports.directiveName = _chunkJKMQSAJPjs.directiveName; exports.fileCompleter = _chunkJKMQSAJPjs.fileCompleter; exports.funcCompleter = _chunkJKMQSAJPjs.funcCompleter; exports.prefixedCompleter = _chunkJKMQSAJPjs.prefixedCompleter; exports.resolveCompletions = _chunkJKMQSAJPjs.resolveCompletions; exports.staticCompleter = _chunkJKMQSAJPjs.staticCompleter; exports.staticValues = _chunkJKMQSAJPjs.staticValues; exports.withDescription = _chunkJKMQSAJPjs.withDescription;
@@ -1,2 +1,3 @@
1
1
  import 'commander';
2
- export { a as completionCommand, g as generateBashCompletion, b as generateFishCompletion, d as generateZshCompletion } from './completion-CVnPcWMZ.js';
2
+ import './completion-values-By-mnjNt.js';
3
+ export { C as CompletionIO, N as NO_DESC_REQUEST_CMD, R as REQUEST_CMD, S as SHELLS, a as Shell, b as bindArgs, d as bindFlag, e as completeRequest, f as completionCommand, g as generateBashCompletion, h as generateFishCompletion, i as generatePowerShellCompletion, j as generateZshCompletion, k as installCompletionRequest, r as registerRootAlias, l as renderCompletionScript } from './completion-sDKVXPUL.js';
@@ -3,11 +3,32 @@
3
3
 
4
4
 
5
5
 
6
- var _chunk6RFRV4VPjs = require('./chunk-6RFRV4VP.js');
6
+
7
+
8
+
9
+
10
+
11
+
12
+
13
+
14
+
15
+
16
+ var _chunkJZ22ZUFAjs = require('./chunk-JZ22ZUFA.js');
17
+ require('./chunk-JKMQSAJP.js');
7
18
  require('./chunk-R5U7XKVJ.js');
8
19
 
9
20
 
10
21
 
11
22
 
12
23
 
13
- exports.completionCommand = _chunk6RFRV4VPjs.completionCommand; exports.generateBashCompletion = _chunk6RFRV4VPjs.generateBashCompletion; exports.generateFishCompletion = _chunk6RFRV4VPjs.generateFishCompletion; exports.generateZshCompletion = _chunk6RFRV4VPjs.generateZshCompletion;
24
+
25
+
26
+
27
+
28
+
29
+
30
+
31
+
32
+
33
+
34
+ exports.NO_DESC_REQUEST_CMD = _chunkJZ22ZUFAjs.NO_DESC_REQUEST_CMD; exports.REQUEST_CMD = _chunkJZ22ZUFAjs.REQUEST_CMD; exports.SHELLS = _chunkJZ22ZUFAjs.SHELLS; exports.bindArgs = _chunkJZ22ZUFAjs.bindArgs; exports.bindFlag = _chunkJZ22ZUFAjs.bindFlag; exports.completeRequest = _chunkJZ22ZUFAjs.completeRequest; exports.completionCommand = _chunkJZ22ZUFAjs.completionCommand; exports.generateBashCompletion = _chunkJZ22ZUFAjs.generateBashCompletion; exports.generateFishCompletion = _chunkJZ22ZUFAjs.generateFishCompletion; exports.generatePowerShellCompletion = _chunkJZ22ZUFAjs.generatePowerShellCompletion; exports.generateZshCompletion = _chunkJZ22ZUFAjs.generateZshCompletion; exports.installCompletionRequest = _chunkJZ22ZUFAjs.installCompletionRequest; exports.registerRootAlias = _chunkJZ22ZUFAjs.registerRootAlias; exports.renderCompletionScript = _chunkJZ22ZUFAjs.renderCompletionScript;
@@ -0,0 +1,60 @@
1
+ /**
2
+ * compliance.ts — 12-factor AI CLI compliance checker.
3
+ *
4
+ * Static checks analyse a toolspec YAML. Runtime checks execute
5
+ * the binary. Port of Go hop.top/kit/compliance.
6
+ */
7
+ declare enum Factor {
8
+ SelfDescribing = 1,
9
+ StructuredIO = 2,
10
+ StreamDiscipline = 3,
11
+ ContractsErrors = 4,
12
+ Preview = 5,
13
+ Idempotency = 6,
14
+ StateTransparency = 7,
15
+ SafeDelegation = 8,
16
+ ObservableOps = 9,
17
+ Provenance = 10,
18
+ Evolution = 11,
19
+ AuthLifecycle = 12,
20
+ ConsentingTelemetry = 13
21
+ }
22
+ declare function factorName(f: Factor): string;
23
+ interface CheckResult {
24
+ factor: Factor;
25
+ name: string;
26
+ status: "pass" | "fail" | "skip" | "warn";
27
+ details?: string;
28
+ suggestion?: string;
29
+ }
30
+ interface Report {
31
+ binary: string;
32
+ toolspec: string;
33
+ results: CheckResult[];
34
+ score: number;
35
+ total: number;
36
+ }
37
+ /** Run static checks against a toolspec YAML file. */
38
+ declare function runStatic(toolspecPath: string): CheckResult[];
39
+ /** Run runtime checks against a binary + toolspec. */
40
+ declare function runRuntime(binaryPath: string, toolspecPath: string): CheckResult[];
41
+ /** Run both static + runtime checks. If binaryPath is empty,
42
+ * only static checks run. */
43
+ declare function run(binaryPath: string, toolspecPath: string): Report;
44
+ /** Render report as text or JSON string. */
45
+ declare function formatReport(r: Report, format?: string): string;
46
+
47
+ type compliance_CheckResult = CheckResult;
48
+ type compliance_Factor = Factor;
49
+ declare const compliance_Factor: typeof Factor;
50
+ type compliance_Report = Report;
51
+ declare const compliance_factorName: typeof factorName;
52
+ declare const compliance_formatReport: typeof formatReport;
53
+ declare const compliance_run: typeof run;
54
+ declare const compliance_runRuntime: typeof runRuntime;
55
+ declare const compliance_runStatic: typeof runStatic;
56
+ declare namespace compliance {
57
+ export { type compliance_CheckResult as CheckResult, compliance_Factor as Factor, type compliance_Report as Report, compliance_factorName as factorName, compliance_formatReport as formatReport, compliance_run as run, compliance_runRuntime as runRuntime, compliance_runStatic as runStatic };
58
+ }
59
+
60
+ export { type CheckResult as C, Factor as F, type Report as R, formatReport as a, runRuntime as b, compliance as c, runStatic as d, factorName as f, run as r };
@@ -0,0 +1 @@
1
+ export { C as CheckResult, F as Factor, R as Report, f as factorName, a as formatReport, r as run, b as runRuntime, d as runStatic } from './compliance-AxFf-uMy.js';
@@ -0,0 +1,17 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
+
3
+
4
+
5
+
6
+
7
+
8
+ var _chunkXJTRY453js = require('./chunk-XJTRY453.js');
9
+ require('./chunk-R5U7XKVJ.js');
10
+
11
+
12
+
13
+
14
+
15
+
16
+
17
+ exports.Factor = _chunkXJTRY453js.Factor; exports.factorName = _chunkXJTRY453js.factorName; exports.formatReport = _chunkXJTRY453js.formatReport; exports.run = _chunkXJTRY453js.run; exports.runRuntime = _chunkXJTRY453js.runRuntime; exports.runStatic = _chunkXJTRY453js.runStatic;