burgee 0.0.0 → 0.2.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 (114) hide show
  1. package/README.md +28 -1
  2. package/dist/agent.d.ts +19 -0
  3. package/dist/agent.js +25 -0
  4. package/dist/brand.d.ts +186 -0
  5. package/dist/brand.js +232 -0
  6. package/dist/cli.d.ts +51 -0
  7. package/dist/cli.js +105 -0
  8. package/dist/commander-argument.d.ts +22 -0
  9. package/dist/commander-argument.js +72 -0
  10. package/dist/commander-command.d.ts +345 -0
  11. package/dist/commander-command.js +1605 -0
  12. package/dist/commander-error.d.ts +10 -0
  13. package/dist/commander-error.js +20 -0
  14. package/dist/commander-help.d.ts +67 -0
  15. package/dist/commander-help.js +319 -0
  16. package/dist/commander-option.d.ts +58 -0
  17. package/dist/commander-option.js +164 -0
  18. package/dist/commander-suggest.d.ts +2 -0
  19. package/dist/commander-suggest.js +59 -0
  20. package/dist/commander.d.ts +18 -0
  21. package/dist/commander.js +12 -0
  22. package/dist/completions.d.ts +39 -0
  23. package/dist/completions.js +224 -0
  24. package/dist/config.d.ts +28 -0
  25. package/dist/config.js +98 -0
  26. package/dist/contrast.d.ts +70 -0
  27. package/dist/contrast.js +93 -0
  28. package/dist/execute.d.ts +97 -0
  29. package/dist/execute.js +433 -0
  30. package/dist/exit-code.d.ts +18 -0
  31. package/dist/exit-code.js +12 -0
  32. package/dist/help.d.ts +22 -0
  33. package/dist/help.js +158 -0
  34. package/dist/index.d.ts +16 -1
  35. package/dist/index.js +9 -2
  36. package/dist/manifest.d.ts +192 -0
  37. package/dist/manifest.js +55 -0
  38. package/dist/mcp.d.ts +40 -0
  39. package/dist/mcp.js +111 -0
  40. package/dist/names.d.ts +5 -0
  41. package/dist/names.js +6 -0
  42. package/dist/pkg.d.ts +5 -0
  43. package/dist/pkg.js +21 -0
  44. package/dist/precedence.d.ts +55 -0
  45. package/dist/precedence.js +100 -0
  46. package/dist/runtime.d.ts +27 -0
  47. package/dist/runtime.js +17 -0
  48. package/dist/schema.d.ts +71 -0
  49. package/dist/schema.js +108 -0
  50. package/dist/testing-helpers.d.ts +62 -0
  51. package/dist/testing-helpers.js +110 -0
  52. package/dist/testing.d.ts +10 -0
  53. package/dist/testing.js +3 -0
  54. package/dist/validate.d.ts +27 -0
  55. package/dist/validate.js +133 -0
  56. package/dist/yargs-burgee.d.ts +50 -0
  57. package/dist/yargs-burgee.js +104 -0
  58. package/dist/yargs-cliui.d.ts +56 -0
  59. package/dist/yargs-cliui.js +421 -0
  60. package/dist/yargs-command.d.ts +82 -0
  61. package/dist/yargs-command.js +414 -0
  62. package/dist/yargs-completion.d.ts +41 -0
  63. package/dist/yargs-completion.js +271 -0
  64. package/dist/yargs-factory.d.ts +193 -0
  65. package/dist/yargs-factory.js +1606 -0
  66. package/dist/yargs-helpers.d.ts +6 -0
  67. package/dist/yargs-helpers.js +2 -0
  68. package/dist/yargs-middleware.d.ts +32 -0
  69. package/dist/yargs-middleware.js +81 -0
  70. package/dist/yargs-parser.d.ts +41 -0
  71. package/dist/yargs-parser.js +929 -0
  72. package/dist/yargs-shim.d.ts +54 -0
  73. package/dist/yargs-shim.js +84 -0
  74. package/dist/yargs-usage.d.ts +42 -0
  75. package/dist/yargs-usage.js +479 -0
  76. package/dist/yargs-utils.d.ts +33 -0
  77. package/dist/yargs-utils.js +209 -0
  78. package/dist/yargs-validation.d.ts +26 -0
  79. package/dist/yargs-validation.js +261 -0
  80. package/dist/yargs-y18n.d.ts +21 -0
  81. package/dist/yargs-y18n.js +117 -0
  82. package/dist/yargs.d.ts +6 -0
  83. package/dist/yargs.js +8 -0
  84. package/locales/be.json +46 -0
  85. package/locales/cs.json +51 -0
  86. package/locales/de.json +46 -0
  87. package/locales/en.json +55 -0
  88. package/locales/es.json +46 -0
  89. package/locales/fi.json +49 -0
  90. package/locales/fr.json +53 -0
  91. package/locales/he.json +55 -0
  92. package/locales/hi.json +49 -0
  93. package/locales/hu.json +46 -0
  94. package/locales/id.json +50 -0
  95. package/locales/it.json +46 -0
  96. package/locales/ja.json +51 -0
  97. package/locales/ka.json +55 -0
  98. package/locales/ko.json +49 -0
  99. package/locales/nb.json +44 -0
  100. package/locales/nl.json +49 -0
  101. package/locales/nn.json +44 -0
  102. package/locales/pirate.json +13 -0
  103. package/locales/pl.json +49 -0
  104. package/locales/pt.json +45 -0
  105. package/locales/pt_BR.json +48 -0
  106. package/locales/ru.json +51 -0
  107. package/locales/th.json +46 -0
  108. package/locales/tr.json +48 -0
  109. package/locales/uk_UA.json +51 -0
  110. package/locales/uz.json +52 -0
  111. package/locales/zh_CN.json +48 -0
  112. package/locales/zh_TW.json +51 -0
  113. package/package.json +61 -8
  114. package/dist/index.js.map +0 -1
@@ -0,0 +1,72 @@
1
+ import { InvalidArgumentError } from './commander-error.js';
2
+ export class Argument {
3
+ description;
4
+ variadic = false;
5
+ parseArg = undefined;
6
+ defaultValue = undefined;
7
+ defaultValueDescription = undefined;
8
+ argChoices = undefined;
9
+ required;
10
+ _name;
11
+ constructor(name, description) {
12
+ this.description = description || '';
13
+ switch (name[0]) {
14
+ case '<':
15
+ this.required = true;
16
+ this._name = name.slice(1, -1);
17
+ break;
18
+ case '[':
19
+ this.required = false;
20
+ this._name = name.slice(1, -1);
21
+ break;
22
+ default:
23
+ this.required = true;
24
+ this._name = name;
25
+ break;
26
+ }
27
+ if (this._name.endsWith('...')) {
28
+ this.variadic = true;
29
+ this._name = this._name.slice(0, -3);
30
+ }
31
+ }
32
+ name() {
33
+ return this._name;
34
+ }
35
+ _collectValue(value, previous) {
36
+ if (previous === this.defaultValue || !Array.isArray(previous))
37
+ return [value];
38
+ previous.push(value);
39
+ return previous;
40
+ }
41
+ default(value, description) {
42
+ this.defaultValue = value;
43
+ this.defaultValueDescription = description;
44
+ return this;
45
+ }
46
+ argParser(fn) {
47
+ this.parseArg = fn;
48
+ return this;
49
+ }
50
+ choices(values) {
51
+ this.argChoices = values.slice();
52
+ this.parseArg = (arg, previous) => {
53
+ if (!this.argChoices?.includes(arg)) {
54
+ throw new InvalidArgumentError(`Allowed choices are ${this.argChoices?.join(', ')}.`);
55
+ }
56
+ return this.variadic ? this._collectValue(arg, previous) : arg;
57
+ };
58
+ return this;
59
+ }
60
+ argRequired() {
61
+ this.required = true;
62
+ return this;
63
+ }
64
+ argOptional() {
65
+ this.required = false;
66
+ return this;
67
+ }
68
+ }
69
+ export function humanReadableArgName(arg) {
70
+ const nameOutput = arg.name() + (arg.variadic ? '...' : '');
71
+ return arg.required ? `<${nameOutput}>` : `[${nameOutput}]`;
72
+ }
@@ -0,0 +1,345 @@
1
+ /**
2
+ * commander's `Command`, ported method for method from commander 15 and graded by
3
+ * commander's own suite through `compat-oracle`. The parse pipeline, the option
4
+ * grammar, every error string and exit code are commander's — that is what makes a
5
+ * user's existing program run unchanged (J2).
6
+ *
7
+ * burgee's additions sit beside it and never alter the default behaviour:
8
+ * - `manifest` projects the command tree, so plugins (`use`) and the generated
9
+ * surfaces read commander-syntax programs exactly like native ones (J7, J8);
10
+ * - `--json`, when the program has not declared that option itself, wraps the
11
+ * action's return value in the envelope (N-family);
12
+ * - `parse(argv, { stdout, stderr, exit })` injects the streams and the exit, and
13
+ * then reports through the E1 taxonomy — the harness's seam (T1).
14
+ */
15
+ import childProcess from 'node:child_process';
16
+ import { EventEmitter } from 'node:events';
17
+ import { Argument, type ParseArg } from './commander-argument.js';
18
+ import { CommanderError } from './commander-error.js';
19
+ import { Help } from './commander-help.js';
20
+ import { Option } from './commander-option.js';
21
+ import { type Effects, Manifest, type OptionSpec, type Plugin } from './manifest.js';
22
+ export interface OutputConfiguration {
23
+ writeOut: (str: string) => void;
24
+ writeErr: (str: string) => void;
25
+ outputError: (str: string, write: (str: string) => void) => void;
26
+ getOutHelpWidth: () => number | undefined;
27
+ getErrHelpWidth: () => number | undefined;
28
+ getOutHasColors: () => boolean | undefined;
29
+ getErrHasColors: () => boolean | undefined;
30
+ stripColor: (str: string) => string;
31
+ }
32
+ export interface ParseOptions {
33
+ from?: 'node' | 'electron' | 'user' | 'eval';
34
+ }
35
+ interface Writer {
36
+ write: (str: string) => unknown;
37
+ }
38
+ /** burgee's additions: inject the streams and the exit, and get E1 exit codes back (T1). */
39
+ export interface BurgeeParseOptions extends ParseOptions {
40
+ stdout?: Writer;
41
+ stderr?: Writer;
42
+ exit?: (code: number) => void;
43
+ }
44
+ export interface CommandOptions {
45
+ hidden?: boolean;
46
+ isDefault?: boolean;
47
+ /** @deprecated since v7, replaced by hidden */
48
+ noHelp?: boolean;
49
+ }
50
+ export interface ExecutableCommandOptions extends CommandOptions {
51
+ executableFile?: string;
52
+ }
53
+ export interface ErrorOptions {
54
+ code?: string;
55
+ exitCode?: number;
56
+ }
57
+ export interface OutputContext {
58
+ error?: boolean;
59
+ }
60
+ export type HookEvent = 'preSubcommand' | 'preAction' | 'postAction';
61
+ export type HookListener = (thisCommand: Command, actionCommand: Command) => void | Promise<void>;
62
+ export type AddHelpTextPosition = 'beforeAll' | 'before' | 'after' | 'afterAll';
63
+ export type AddHelpTextContext = {
64
+ error: boolean;
65
+ command: Command;
66
+ };
67
+ interface SavedState {
68
+ _name: string;
69
+ _optionValues: Record<string, unknown>;
70
+ _optionValueSources: Record<string, string | undefined>;
71
+ }
72
+ interface Burgee {
73
+ exit: ((code: number) => void) | undefined;
74
+ json: boolean;
75
+ }
76
+ export declare class Command extends EventEmitter {
77
+ commands: Command[];
78
+ options: Option[];
79
+ parent: Command | null;
80
+ registeredArguments: Argument[];
81
+ /** @deprecated old name for registeredArguments */
82
+ _args: Argument[];
83
+ /** cli args with options removed */
84
+ args: string[];
85
+ rawArgs: string[];
86
+ /** like .args but after custom processing and collecting variadic */
87
+ processedArgs: unknown[];
88
+ runningCommand: childProcess.ChildProcess | undefined;
89
+ _allowUnknownOption: boolean;
90
+ _allowExcessArguments: boolean;
91
+ _scriptPath: string | null;
92
+ _name: string;
93
+ _optionValues: Record<string, unknown>;
94
+ _optionValueSources: Record<string, string | undefined>;
95
+ _storeOptionsAsProperties: boolean;
96
+ _actionHandler: ((args: unknown[]) => unknown) | null;
97
+ _executableHandler: boolean;
98
+ _executableFile: string | null;
99
+ _executableDir: string | null;
100
+ _defaultCommandName: string | null;
101
+ _exitCallback: ((err: CommanderError) => void) | null;
102
+ _aliases: string[];
103
+ _combineFlagAndOptionalValue: boolean;
104
+ _description: string;
105
+ _summary: string;
106
+ _argsDescription: Record<string, string> | undefined;
107
+ _enablePositionalOptions: boolean;
108
+ _passThroughOptions: boolean;
109
+ _lifeCycleHooks: Partial<Record<HookEvent, HookListener[]>>;
110
+ _showHelpAfterError: boolean | string;
111
+ _showSuggestionAfterError: boolean;
112
+ _savedState: SavedState | null;
113
+ _outputConfiguration: OutputConfiguration;
114
+ _hidden: boolean;
115
+ /** Lazy created on demand; null once disabled. */
116
+ _helpOption: Option | null | undefined;
117
+ _addImplicitHelpCommand: boolean | undefined;
118
+ _helpCommand: Command | undefined;
119
+ _helpConfiguration: Partial<Help>;
120
+ _helpGroupHeading: string | undefined;
121
+ _defaultCommandGroup: string | undefined;
122
+ _defaultOptionGroup: string | undefined;
123
+ _version: string | undefined;
124
+ _versionOptionName: string | undefined;
125
+ _usage: string | undefined;
126
+ /** burgee: the root's projection, created on first use. */
127
+ _manifest: Manifest | undefined;
128
+ /** burgee: what this command does to the world (N6); declaring it exposes the command as an MCP tool. */
129
+ _effects: Effects | undefined;
130
+ /** burgee: set for the duration of a parse that injected the streams or the exit. */
131
+ _burgee: Burgee | undefined;
132
+ constructor(name?: string);
133
+ /** Copy settings useful to share between the root and its subcommands. */
134
+ copyInheritedSettings(sourceCommand: Command): this;
135
+ _getCommandAndAncestors(): Command[];
136
+ /**
137
+ * Define a command. With a description as the second argument it is an executable
138
+ * subcommand and `this` is returned; otherwise the new command is returned.
139
+ */
140
+ command(nameAndArgs: string, opts?: CommandOptions): Command;
141
+ command(nameAndArgs: string, description: string, opts?: ExecutableCommandOptions): this;
142
+ /** Factory for an unattached command; override to customise subcommands. */
143
+ createCommand(name?: string): Command;
144
+ createHelp(): Help;
145
+ configureHelp(): Partial<Help>;
146
+ configureHelp(configuration: Partial<Help>): this;
147
+ configureOutput(): OutputConfiguration;
148
+ configureOutput(configuration: Partial<OutputConfiguration>): this;
149
+ showHelpAfterError(displayHelp?: boolean | string): this;
150
+ showSuggestionAfterError(displaySuggestion?: boolean): this;
151
+ addCommand(cmd: Command, opts?: CommandOptions): this;
152
+ createArgument(name: string, description?: string): Argument;
153
+ argument(name: string, description?: string, parseArg?: ParseArg | unknown, defaultValue?: unknown): this;
154
+ arguments(names: string): this;
155
+ addArgument(argument: Argument): this;
156
+ /** Customise or disable the default help command (added by default when there are subcommands). */
157
+ helpCommand(enableOrNameAndArgs?: string | boolean, description?: string): this;
158
+ addHelpCommand(helpCommand: Command | string | boolean, deprecatedDescription?: string): this;
159
+ _getHelpCommand(): Command | null;
160
+ hook(event: HookEvent, listener: HookListener): this;
161
+ /** Replace the call to process.exit; defaults to throwing the CommanderError. */
162
+ exitOverride(fn?: (err: CommanderError) => void): this;
163
+ _exit(exitCode: number, code: string, message: string): never;
164
+ action(fn: (...args: any[]) => unknown): this;
165
+ createOption(flags: string, description?: string): Option;
166
+ /** Wrap parseArg to turn `commander.invalidArgument` into an error with context. */
167
+ _callParseArg(target: Option | Argument, value: string, previous: unknown, invalidArgumentMessage: string): unknown;
168
+ _registerOption(option: Option): void;
169
+ _registerCommand(command: Command): void;
170
+ addOption(option: Option): this;
171
+ _optionEx(config: {
172
+ mandatory?: boolean;
173
+ }, flags: string, description?: string, fn?: unknown, defaultValue?: unknown): this;
174
+ option(flags: string, description?: string, parseArg?: ParseArg | unknown, defaultValue?: unknown): this;
175
+ requiredOption(flags: string, description?: string, parseArg?: ParseArg | unknown, defaultValue?: unknown): this;
176
+ /** `-f80` as `--flag=80` (default) versus `-fb` as `-f -b`. */
177
+ combineFlagAndOptionalValue(combine?: boolean): this;
178
+ allowUnknownOption(allowUnknown?: boolean): this;
179
+ allowExcessArguments(allowExcess?: boolean): this;
180
+ /** Global options before subcommands only, so subcommands may reuse option names. */
181
+ enablePositionalOptions(positional?: boolean): this;
182
+ /** Options after the first command-argument are passed through, not parsed. */
183
+ passThroughOptions(passThrough?: boolean): this;
184
+ _checkForBrokenPassThrough(): void;
185
+ storeOptionsAsProperties(storeAsProperties?: boolean): this;
186
+ getOptionValue(key: string): unknown;
187
+ setOptionValue(key: string, value: unknown): this;
188
+ /** `source` is default | config | env | cli | implied. */
189
+ setOptionValueWithSource(key: string, value: unknown, source: string | undefined): this;
190
+ getOptionValueSource(key: string): string | undefined;
191
+ /** Globals overwrite locals, like optsWithGlobals. */
192
+ getOptionValueSourceWithGlobals(key: string): string | undefined;
193
+ /** User args from argv per `from`; sets `_scriptPath` and the default program name. */
194
+ _prepareUserArgs(argv: readonly string[] | undefined, parseOptions?: ParseOptions): string[];
195
+ /**
196
+ * Parse argv, set options and run commands. Use `parseAsync` when an action is async.
197
+ * With no arguments, parses process.argv and auto-detects Electron and `node --eval`.
198
+ */
199
+ parse(argv?: readonly string[], parseOptions?: BurgeeParseOptions): this;
200
+ parseAsync(argv?: readonly string[], parseOptions?: BurgeeParseOptions): Promise<this>;
201
+ _prepareForParse(): void;
202
+ /** Called lazily on first parse; available for subclasses to save custom state. */
203
+ saveStateBeforeParse(): void;
204
+ restoreStateBeforeParse(): void;
205
+ _checkForMissingExecutable(executableFile: string, executableDir: string, subcommandName: string): void;
206
+ _executeSubCommand(subcommand: Command, args: string[]): void;
207
+ _dispatchSubcommand(commandName: string, operands: string[], unknown: string[]): unknown;
208
+ /** `help foo`: invoke help directly if possible, or dispatch if necessary. */
209
+ _dispatchHelpCommand(subcommandName: string | undefined): unknown;
210
+ _checkNumberOfArguments(): void;
211
+ /** Process this.args against registeredArguments into this.processedArgs. */
212
+ _processArguments(): void;
213
+ /** Chain once we have a promise; call synchronously until then. */
214
+ _chainOrCall(promise: unknown, fn: () => unknown): unknown;
215
+ _chainOrCallHooks(promise: unknown, event: HookEvent): unknown;
216
+ _chainOrCallSubCommandHook(promise: unknown, subCommand: Command, event: HookEvent): unknown;
217
+ /** Process arguments in the context of this command; returns the action result in case it is a promise. */
218
+ _parseCommand(operands: string[], unknown: string[]): unknown;
219
+ _findCommand(name: string | undefined): Command | undefined;
220
+ _findOption(arg: string): Option | undefined;
221
+ /** Walks up the hierarchy so a subcommand can check after displaying help. */
222
+ _checkForMissingMandatoryOptions(): void;
223
+ _checkForConflictingLocalOptions(): void;
224
+ _checkForConflictingOptions(): void;
225
+ /**
226
+ * Parse options from `args`, removing known options, and return argv split into
227
+ * operands and unknown arguments. Side effect: stores option values on the command.
228
+ *
229
+ * --known kkk op => [op], []
230
+ * op --known kkk => [op], []
231
+ * sub --unknown uuu op => [sub], [--unknown uuu op]
232
+ * sub -- --unknown uuu op => [sub --unknown uuu op], []
233
+ */
234
+ parseOptions(args: string[]): {
235
+ operands: string[];
236
+ unknown: string[];
237
+ };
238
+ /** Local option values as key-value pairs. */
239
+ opts(): Record<string, unknown>;
240
+ /** Merged local and global option values; globals overwrite locals. */
241
+ optsWithGlobals(): Record<string, unknown>;
242
+ /** Display an error message and exit (or call exitOverride). */
243
+ error(message: string, errorOptions?: ErrorOptions): never;
244
+ /** Apply environment variables to options that have no value from the cli or client code. */
245
+ _parseOptionsEnv(): void;
246
+ /** Apply implied option values where the option is undefined or at its default. */
247
+ _parseOptionsImplied(): void;
248
+ missingArgument(name: string): never;
249
+ optionMissingArgument(option: Option): never;
250
+ missingMandatoryOptionValue(option: Option): never;
251
+ _conflictingOption(option: Option, conflictingOption: Option): never;
252
+ unknownOption(flag: string): void;
253
+ _excessArguments(receivedArgs: string[]): void;
254
+ unknownCommand(): never;
255
+ /** Get or set the version; registers `-V, --version` (or the given flags). */
256
+ version(): string | undefined;
257
+ version(str: string, flags?: string, description?: string): this;
258
+ description(): string;
259
+ description(str: string, argsDescription?: Record<string, string>): this;
260
+ /** Summary, used when listed as a subcommand of the parent. */
261
+ summary(): string;
262
+ summary(str: string): this;
263
+ /** Add an alias; only the first is shown in help. */
264
+ alias(): string | undefined;
265
+ alias(alias: string): this;
266
+ aliases(): string[];
267
+ aliases(aliases: string[]): this;
268
+ usage(): string;
269
+ usage(str: string): this;
270
+ name(): string;
271
+ name(str: string): this;
272
+ helpGroup(): string;
273
+ helpGroup(heading: string): this;
274
+ /** Default help group for subcommands added to this command. */
275
+ commandsGroup(): string;
276
+ commandsGroup(heading: string): this;
277
+ /** Default help group for options added to this command. */
278
+ optionsGroup(): string;
279
+ optionsGroup(heading: string): this;
280
+ _initOptionGroup(option: Option): void;
281
+ _initCommandGroup(cmd: Command): void;
282
+ /** Name the command from a script filename, such as process.argv[1] or import.meta.filename. */
283
+ nameFromFilename(filename: string): this;
284
+ executableDir(): string | null;
285
+ executableDir(dir: string): this;
286
+ helpInformation(contextOptions?: OutputContext): string;
287
+ _getOutputContext(contextOptions?: OutputContext): {
288
+ error: boolean;
289
+ write: (str: string) => void;
290
+ hasColors: boolean | undefined;
291
+ helpWidth: number | undefined;
292
+ };
293
+ /** Output built-in help plus any text added with `addHelpText`. */
294
+ outputHelp(contextOptions?: OutputContext | ((text: string) => string | Buffer)): void;
295
+ /** Customise the built-in help option, or pass false to disable it. */
296
+ helpOption(flags?: string | boolean, description?: string): this;
297
+ /** Lazily created; null once disabled with `helpOption(false)`. */
298
+ _getHelpOption(): Option | null;
299
+ addHelpOption(option: Option): this;
300
+ /** Output help and exit. */
301
+ help(contextOptions?: OutputContext | ((text: string) => string | Buffer)): never;
302
+ /** Extra help text: 'before'/'after' for this command, 'beforeAll'/'afterAll' for its subcommands too. */
303
+ addHelpText(position: AddHelpTextPosition, text: string | ((context: AddHelpTextContext) => string)): this;
304
+ _outputHelpIfRequested(args: string[]): void;
305
+ _root(): Command;
306
+ /**
307
+ * The manifest every surface reads. Projected from the command tree on each access,
308
+ * so it is never stale; plugin-contributed nodes are kept across projections.
309
+ */
310
+ get manifest(): Manifest;
311
+ _project(manifest: Manifest): void;
312
+ /** Options as the manifest describes them, on a null-prototype record. */
313
+ _optionSpecs(): Record<string, OptionSpec>;
314
+ /** burgee: declare what the command does to the world (N6). This is what exposes it as an MCP tool (N2). */
315
+ effects(value: Effects): this;
316
+ /**
317
+ * burgee: `--schema` and `--mcp` on a commander-syntax program, from its manifest (J2).
318
+ * Only when the program declares neither option itself; `--mcp` runs commands through
319
+ * this very program with the streams captured, so tool results are the `--json` envelope.
320
+ */
321
+ _burgeeSurface(userArgs: string[]): boolean | Promise<boolean>;
322
+ /** The surfaces after `completion`: `--schema` is synchronous, `--mcp` serves until stdin closes. */
323
+ _burgeeSurfaceRest(head: string[], declared: (flag: string) => boolean): boolean | Promise<boolean>;
324
+ /** Additive, and the point of the whole exercise: plugins commander has never had (#2505, unlanded). */
325
+ use(plugin: Plugin): this;
326
+ /** Inject the streams and the exit for one parse; returns commander's own parse options. */
327
+ _prepareBurgee(parseOptions?: BurgeeParseOptions): ParseOptions | undefined;
328
+ /** In burgee mode the whole run settles to one E1 exit; otherwise commander's behaviour, untouched. */
329
+ _runBurgee(run: () => unknown): unknown;
330
+ /** `--json` that no command in the chain declared is burgee's envelope, not an unknown option. */
331
+ _takeJson(unknown: string[]): void;
332
+ /** The action, wrapped in the plugin hooks and followed by the envelope or the rendering. */
333
+ _runAction(): unknown;
334
+ /** burgee: where every option value came from, from commander's own value sources (V3). */
335
+ _provenance(): Record<string, {
336
+ source: string;
337
+ }>;
338
+ _emitResult(value: unknown): void;
339
+ }
340
+ /**
341
+ * The common colour conventions: NO_COLOR and FORCE_COLOR=0/false disable, FORCE_COLOR
342
+ * and CLICOLOR_FORCE enable, otherwise undecided (the stream's TTY-ness decides).
343
+ */
344
+ export declare function useColor(): boolean | undefined;
345
+ export {};