@qodalis/cli 2.0.0-beta.1

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.
@@ -0,0 +1,2302 @@
1
+ import * as _qodalis_cli_core from '@qodalis/cli-core';
2
+ import { ICliCommandProcessor, ICliCommandParameterDescriptor, ICliCommandProcessorRegistry, ICliCommandChildProcessor, CliProcessorMetadata, CliStateConfiguration, ICliExecutionContext, CliProcessCommand, ICliCommandAuthor, CliThemeInfo, ICliExecutionProcess, ICliUserSession, ICliSpinner, ICliPercentageProgressBar, ICliTextAnimator, ICliTerminalWriter, ICliCommandExecutorService, ICliClipboard, ICliStateStore, CliOptions, ICliLogger, ICliServiceProvider, ICliTranslationService, ICliInputReader, ICliBackgroundServiceRegistry, ICliManagedInterval, ICliManagedTimer, ICliKeyValueStore, CliSelectOption, CliMultiSelectOption, ICliCompletionProvider, ICliGlobalParameterHandler, CliProvider, CliForegroundColor, CliBackgroundColor, CliLogLevel, CliPercentageProgressBarUpdateValueOptions, CliTextAnimatorOptions, ICliModule, CliModuleRegistry, Package, ICliPingServerService, ICliProcessRegistry, ICliProcessEntry, ICliDragDropService, CliState, CliEngineSnapshot, CliServerConfig, CliServerCommandDescriptor, CliServerCapabilities, CliServerResponse, CliIcon } from '@qodalis/cli-core';
3
+ export { ICliUserSessionService_TOKEN, ICliUsersStoreService_TOKEN } from '@qodalis/cli-core';
4
+ import { ITheme, Terminal, ITerminalAddon, ITerminalOptions, ITerminalInitOnlyOptions } from '@xterm/xterm';
5
+ import { Subject, Observable, Subscription } from 'rxjs';
6
+
7
+ type ParsedArg = {
8
+ name: string;
9
+ value: any;
10
+ };
11
+ type ParsedToken = {
12
+ kind: 'flag';
13
+ name: string;
14
+ value: string | number | boolean;
15
+ hasEquals: boolean;
16
+ } | {
17
+ kind: 'word';
18
+ value: string;
19
+ };
20
+ type CommandParserOutput = {
21
+ commandName: string;
22
+ args: ParsedArg[];
23
+ tokens: ParsedToken[];
24
+ };
25
+ type CommandPart = {
26
+ /** 'command' for a command to execute, or the operator string */
27
+ type: 'command' | '&&' | '||' | '2>>' | '2>' | '>>' | '>' | '|' | ';';
28
+ value: string;
29
+ };
30
+ /**
31
+ * A utility class for parsing command strings into command names and arguments.
32
+ */
33
+ declare class CommandParser {
34
+ /** Operators recognized during command-line splitting. */
35
+ private static readonly OPERATORS;
36
+ /**
37
+ * Split a raw command line into commands and operators.
38
+ * Respects single and double quotes — operators inside quoted strings
39
+ * are treated as literal text, not as operators.
40
+ * @param input - The full raw input string.
41
+ * @returns An array of command parts with their types.
42
+ */
43
+ static splitByOperators(input: string): CommandPart[];
44
+ /**
45
+ * Parse a command string into a full command name and arguments.
46
+ * @param command - The full command string.
47
+ * @returns An object containing the full command name and arguments.
48
+ */
49
+ parse(command: string): CommandParserOutput;
50
+ /**
51
+ * Parse individual values to their appropriate type.
52
+ * @param value - The value to parse.
53
+ * @returns The parsed value.
54
+ */
55
+ private parseValue;
56
+ }
57
+
58
+ declare class CliArgsParser {
59
+ static convertToRecord(args: ParsedArg[], processor: ICliCommandProcessor): Record<string, any>;
60
+ }
61
+
62
+ /**
63
+ * Re-interprets parsed tokens using processor parameter descriptors to support
64
+ * `--param value` (space-separated) argument format in addition to `--param=value`.
65
+ *
66
+ * When a flag has no explicit `=` value and the matching descriptor's type is
67
+ * not boolean, the next word token is consumed as the flag's value.
68
+ *
69
+ * @param tokens - Ordered tokens from the parser.
70
+ * @param descriptors - Parameter descriptors from the matched processor.
71
+ * @returns Reconciled args array and remaining command parts.
72
+ */
73
+ declare function reconcileArgs(tokens: ParsedToken[], descriptors: ICliCommandParameterDescriptor[] | undefined): {
74
+ args: ParsedArg[];
75
+ commandParts: string[];
76
+ };
77
+
78
+ declare const groupBy: <T, K>(list: T[], keySelector: (item: T) => K) => Map<K, T[]>;
79
+
80
+ declare const getGreetingBasedOnTime: (date?: Date) => "☀️ Good morning! Wishing you a productive day ahead!" | "🌤️ Good afternoon! Keep up the great work!" | "🌆 Good evening! Hope you had a fantastic day!" | "🌙 Good night! Rest well and see you tomorrow!";
81
+
82
+ declare const openLink: (link: string) => void;
83
+
84
+ declare class ProcessExitedError extends Error {
85
+ code: number;
86
+ constructor(code: number);
87
+ }
88
+
89
+ declare class CliCommandProcessorRegistry implements ICliCommandProcessorRegistry {
90
+ readonly processors: ICliCommandProcessor[];
91
+ constructor(initialProcessors?: ICliCommandProcessor[]);
92
+ registerProcessor(processor: ICliCommandProcessor): void;
93
+ unregisterProcessor(processor: ICliCommandProcessor): void;
94
+ findProcessor(mainCommand: string, chainCommands: string[]): ICliCommandProcessor | undefined;
95
+ /**
96
+ * Recursively searches for a processor matching the given command.
97
+ * @param mainCommand The main command name.
98
+ * @param chainCommands The remaining chain commands (if any).
99
+ * @param processors The list of available processors.
100
+ * @returns The matching processor or undefined if not found.
101
+ */
102
+ findProcessorInCollection(mainCommand: string, chainCommands: string[], processors: ICliCommandProcessor[]): ICliCommandProcessor | undefined;
103
+ getRootProcessor(child: ICliCommandChildProcessor): ICliCommandProcessor;
104
+ private getProcessorByName;
105
+ }
106
+
107
+ /**
108
+ * Framework-agnostic token for the CLI command processor registry.
109
+ * Used as a key in the service provider to retrieve the registry.
110
+ */
111
+ declare const CliProcessorsRegistry_TOKEN = "cli-processors-registry";
112
+ /**
113
+ * Framework-agnostic token for the CLI state store manager.
114
+ * Used as a key in the service provider to retrieve the state store manager.
115
+ */
116
+ declare const CliStateStoreManager_TOKEN = "cli-state-store-manager";
117
+ /**
118
+ * Framework-agnostic token for the CLI command history service.
119
+ * Used as a key in the service provider to retrieve the command history.
120
+ */
121
+ declare const CliCommandHistory_TOKEN = "cli-command-history";
122
+ /**
123
+ * Framework-agnostic token for the CLI ping server service.
124
+ * Used as a key in the service provider to retrieve the ping server service.
125
+ */
126
+ declare const ICliPingServerService_TOKEN = "cli-ping-server-service";
127
+ /**
128
+ * Framework-agnostic token for the CLI module registry.
129
+ * Used as a key in the service provider to retrieve the module registry.
130
+ */
131
+ declare const CliModuleRegistry_TOKEN = "cli-module-registry";
132
+ /**
133
+ * Framework-agnostic token for the CLI background service registry.
134
+ * Used as a key in the service provider to retrieve the background service registry.
135
+ */
136
+ declare const CliBackgroundServiceRegistry_TOKEN = "cli-background-service-registry";
137
+ /**
138
+ * Framework-agnostic token for the CLI package manager service.
139
+ * Used as a key in the service provider to retrieve the package manager.
140
+ */
141
+ declare const CliPackageManagerService_TOKEN = "cli-package-manager-service";
142
+
143
+ declare const LIBRARY_VERSION = "2.0.0-beta.1";
144
+ declare const API_VERSION = 2;
145
+
146
+ declare class CliAliasCommandProcessor implements ICliCommandProcessor {
147
+ command: string;
148
+ author: _qodalis_cli_core.ICliCommandAuthor;
149
+ description: string;
150
+ processors?: ICliCommandProcessor[] | undefined;
151
+ metadata?: CliProcessorMetadata | undefined;
152
+ stateConfiguration?: CliStateConfiguration | undefined;
153
+ userAliases: Record<string, string>;
154
+ private stateSubscription?;
155
+ constructor();
156
+ writeDescription(context: ICliExecutionContext): void;
157
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
158
+ initialize(context: ICliExecutionContext): Promise<void>;
159
+ }
160
+
161
+ declare class CliBase64CommandProcessor implements ICliCommandProcessor {
162
+ command: string;
163
+ aliases: string[];
164
+ description: string;
165
+ author: _qodalis_cli_core.ICliCommandAuthor;
166
+ processors?: ICliCommandProcessor[];
167
+ metadata?: CliProcessorMetadata;
168
+ constructor();
169
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
170
+ writeDescription(context: ICliExecutionContext): void;
171
+ }
172
+
173
+ declare class CliCalCommandProcessor implements ICliCommandProcessor {
174
+ command: string;
175
+ aliases: string[];
176
+ description: string;
177
+ author: _qodalis_cli_core.ICliCommandAuthor;
178
+ metadata?: CliProcessorMetadata;
179
+ parameters: {
180
+ name: string;
181
+ aliases: string[];
182
+ description: string;
183
+ type: "number";
184
+ required: boolean;
185
+ }[];
186
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
187
+ writeDescription(context: ICliExecutionContext): void;
188
+ }
189
+
190
+ declare class CliClearCommandProcessor implements ICliCommandProcessor {
191
+ command: string;
192
+ aliases: string[];
193
+ description?: string | undefined;
194
+ author: _qodalis_cli_core.ICliCommandAuthor;
195
+ metadata?: CliProcessorMetadata | undefined;
196
+ processCommand(_: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
197
+ writeDescription(context: ICliExecutionContext): void;
198
+ }
199
+
200
+ declare class CliClipboardCommandProcessor implements ICliCommandProcessor {
201
+ command: string;
202
+ aliases: string[];
203
+ description: string;
204
+ author: _qodalis_cli_core.ICliCommandAuthor;
205
+ processors?: ICliCommandProcessor[];
206
+ metadata?: CliProcessorMetadata;
207
+ constructor();
208
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
209
+ writeDescription(context: ICliExecutionContext): void;
210
+ }
211
+
212
+ declare class CliColorCommandProcessor implements ICliCommandProcessor {
213
+ command: string;
214
+ aliases: string[];
215
+ description: string;
216
+ author: _qodalis_cli_core.ICliCommandAuthor;
217
+ acceptsRawInput: boolean;
218
+ valueRequired: boolean;
219
+ metadata?: CliProcessorMetadata;
220
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
221
+ writeDescription(context: ICliExecutionContext): void;
222
+ private parseHex;
223
+ private parseRgb;
224
+ private parseHsl;
225
+ private rgbToHex;
226
+ private rgbToHsl;
227
+ private hslToRgb;
228
+ }
229
+
230
+ declare class CliConvertCommandProcessor implements ICliCommandProcessor {
231
+ command: string;
232
+ aliases: string[];
233
+ description: string;
234
+ author: _qodalis_cli_core.ICliCommandAuthor;
235
+ acceptsRawInput: boolean;
236
+ valueRequired: boolean;
237
+ metadata?: CliProcessorMetadata;
238
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
239
+ writeDescription(context: ICliExecutionContext): void;
240
+ private isTemperatureUnit;
241
+ private tempLabel;
242
+ private convertTemperature;
243
+ }
244
+
245
+ declare class CliEchoCommandProcessor implements ICliCommandProcessor {
246
+ command: string;
247
+ aliases: string[];
248
+ description: string;
249
+ acceptsRawInput: boolean;
250
+ author: _qodalis_cli_core.ICliCommandAuthor;
251
+ metadata?: CliProcessorMetadata | undefined;
252
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
253
+ /** Remove surrounding quotes from the text. */
254
+ private stripQuotes;
255
+ /** Interpret common escape sequences like a POSIX echo -e. */
256
+ private interpretEscapes;
257
+ writeDescription(context: ICliExecutionContext): void;
258
+ }
259
+
260
+ declare class CliEvalCommandProcessor implements ICliCommandProcessor {
261
+ command: string;
262
+ aliases: string[];
263
+ description: string;
264
+ author: _qodalis_cli_core.ICliCommandAuthor;
265
+ acceptsRawInput: boolean;
266
+ metadata?: CliProcessorMetadata | undefined;
267
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
268
+ writeDescription(context: ICliExecutionContext): void;
269
+ }
270
+
271
+ declare class CliHashCommandProcessor implements ICliCommandProcessor {
272
+ command: string;
273
+ description: string;
274
+ author: _qodalis_cli_core.ICliCommandAuthor;
275
+ processors?: ICliCommandProcessor[];
276
+ metadata?: CliProcessorMetadata;
277
+ constructor();
278
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
279
+ writeDescription(context: ICliExecutionContext): void;
280
+ }
281
+
282
+ declare class CliHexCommandProcessor implements ICliCommandProcessor {
283
+ command: string;
284
+ description: string;
285
+ author: _qodalis_cli_core.ICliCommandAuthor;
286
+ processors?: ICliCommandProcessor[];
287
+ metadata?: CliProcessorMetadata;
288
+ constructor();
289
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
290
+ writeDescription(context: ICliExecutionContext): void;
291
+ }
292
+
293
+ declare class CliJsonCommandProcessor implements ICliCommandProcessor {
294
+ command: string;
295
+ description: string;
296
+ author: _qodalis_cli_core.ICliCommandAuthor;
297
+ processors?: ICliCommandProcessor[];
298
+ metadata?: CliProcessorMetadata;
299
+ constructor();
300
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
301
+ writeDescription(context: ICliExecutionContext): void;
302
+ }
303
+
304
+ declare class CliJwtCommandProcessor implements ICliCommandProcessor {
305
+ command: string;
306
+ description: string;
307
+ author: _qodalis_cli_core.ICliCommandAuthor;
308
+ processors?: ICliCommandProcessor[];
309
+ metadata?: CliProcessorMetadata;
310
+ constructor();
311
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
312
+ writeDescription(context: ICliExecutionContext): void;
313
+ private base64UrlDecode;
314
+ }
315
+
316
+ declare class CliLoremCommandProcessor implements ICliCommandProcessor {
317
+ command: string;
318
+ aliases: string[];
319
+ description: string;
320
+ author: _qodalis_cli_core.ICliCommandAuthor;
321
+ processors?: ICliCommandProcessor[];
322
+ metadata?: CliProcessorMetadata;
323
+ constructor();
324
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
325
+ writeDescription(context: ICliExecutionContext): void;
326
+ private generateWords;
327
+ }
328
+
329
+ declare class CliOpenCommandProcessor implements ICliCommandProcessor {
330
+ command: string;
331
+ description: string;
332
+ author: _qodalis_cli_core.ICliCommandAuthor;
333
+ acceptsRawInput: boolean;
334
+ valueRequired: boolean;
335
+ metadata?: CliProcessorMetadata;
336
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
337
+ writeDescription(context: ICliExecutionContext): void;
338
+ }
339
+
340
+ declare class CliRandomCommandProcessor implements ICliCommandProcessor {
341
+ command: string;
342
+ aliases: string[];
343
+ description: string;
344
+ author: _qodalis_cli_core.ICliCommandAuthor;
345
+ processors?: ICliCommandProcessor[];
346
+ metadata?: CliProcessorMetadata;
347
+ constructor();
348
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
349
+ writeDescription(context: ICliExecutionContext): void;
350
+ }
351
+
352
+ declare class CliScreenCommandProcessor implements ICliCommandProcessor {
353
+ command: string;
354
+ aliases: string[];
355
+ description: string;
356
+ author: _qodalis_cli_core.ICliCommandAuthor;
357
+ metadata?: CliProcessorMetadata;
358
+ processCommand(_: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
359
+ writeDescription(context: ICliExecutionContext): void;
360
+ }
361
+
362
+ declare class CliSeqCommandProcessor implements ICliCommandProcessor {
363
+ command: string;
364
+ aliases: string[];
365
+ description: string;
366
+ author: _qodalis_cli_core.ICliCommandAuthor;
367
+ acceptsRawInput: boolean;
368
+ valueRequired: boolean;
369
+ metadata?: CliProcessorMetadata;
370
+ parameters: ({
371
+ name: string;
372
+ aliases: string[];
373
+ description: string;
374
+ type: "number";
375
+ required: boolean;
376
+ } | {
377
+ name: string;
378
+ aliases: string[];
379
+ description: string;
380
+ type: "string";
381
+ required: boolean;
382
+ })[];
383
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
384
+ writeDescription(context: ICliExecutionContext): void;
385
+ }
386
+
387
+ declare class CliSleepCommandProcessor implements ICliCommandProcessor {
388
+ command: string;
389
+ aliases: string[];
390
+ description?: string | undefined;
391
+ author: _qodalis_cli_core.ICliCommandAuthor;
392
+ metadata?: CliProcessorMetadata | undefined;
393
+ valueRequired?: boolean | undefined;
394
+ constructor();
395
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
396
+ writeDescription(context: ICliExecutionContext): void;
397
+ }
398
+
399
+ declare class CliTimeCommandProcessor implements ICliCommandProcessor {
400
+ command: string;
401
+ aliases: string[];
402
+ description: string;
403
+ author: _qodalis_cli_core.ICliCommandAuthor;
404
+ version: string;
405
+ processors?: ICliCommandProcessor[] | undefined;
406
+ metadata?: CliProcessorMetadata | undefined;
407
+ constructor();
408
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
409
+ writeDescription(context: ICliExecutionContext): void;
410
+ }
411
+
412
+ declare class CliTimestampCommandProcessor implements ICliCommandProcessor {
413
+ command: string;
414
+ aliases: string[];
415
+ description: string;
416
+ author: _qodalis_cli_core.ICliCommandAuthor;
417
+ processors?: ICliCommandProcessor[];
418
+ metadata?: CliProcessorMetadata;
419
+ constructor();
420
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
421
+ writeDescription(context: ICliExecutionContext): void;
422
+ }
423
+
424
+ declare class CliUnAliasCommandProcessor implements ICliCommandProcessor {
425
+ command: string;
426
+ author: _qodalis_cli_core.ICliCommandAuthor;
427
+ description: string;
428
+ valueRequired?: boolean | undefined;
429
+ stateConfiguration?: CliStateConfiguration | undefined;
430
+ metadata?: CliProcessorMetadata | undefined;
431
+ writeDescription(context: ICliExecutionContext): void;
432
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
433
+ }
434
+
435
+ declare class CliUnameCommandProcessor implements ICliCommandProcessor {
436
+ command: string;
437
+ aliases: string[];
438
+ description?: string | undefined;
439
+ author: _qodalis_cli_core.ICliCommandAuthor;
440
+ metadata?: CliProcessorMetadata | undefined;
441
+ writeDescription(context: ICliExecutionContext): void;
442
+ processCommand(_: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
443
+ parseUserAgent(userAgent: string): {
444
+ browserName: string;
445
+ version: string;
446
+ os: string;
447
+ };
448
+ }
449
+
450
+ declare class CliUptimeCommandProcessor implements ICliCommandProcessor {
451
+ command: string;
452
+ description: string;
453
+ author: _qodalis_cli_core.ICliCommandAuthor;
454
+ metadata?: CliProcessorMetadata;
455
+ private sessionStartTimes;
456
+ initialize(context: ICliExecutionContext): Promise<void>;
457
+ processCommand(_: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
458
+ writeDescription(context: ICliExecutionContext): void;
459
+ }
460
+
461
+ declare class CliUrlCommandProcessor implements ICliCommandProcessor {
462
+ command: string;
463
+ description: string;
464
+ author: _qodalis_cli_core.ICliCommandAuthor;
465
+ processors?: ICliCommandProcessor[];
466
+ metadata?: CliProcessorMetadata;
467
+ constructor();
468
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
469
+ writeDescription(context: ICliExecutionContext): void;
470
+ }
471
+
472
+ declare class CliYesCommandProcessor implements ICliCommandProcessor {
473
+ command: string;
474
+ description: string;
475
+ author: _qodalis_cli_core.ICliCommandAuthor;
476
+ acceptsRawInput: boolean;
477
+ metadata?: CliProcessorMetadata;
478
+ parameters: {
479
+ name: string;
480
+ aliases: string[];
481
+ description: string;
482
+ type: "number";
483
+ required: boolean;
484
+ }[];
485
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
486
+ writeDescription(context: ICliExecutionContext): void;
487
+ }
488
+
489
+ declare class CliCaptureCommandProcessor implements ICliCommandProcessor {
490
+ command: string;
491
+ description: string;
492
+ aliases: string[];
493
+ author: ICliCommandAuthor;
494
+ metadata: CliProcessorMetadata;
495
+ parameters: ICliCommandParameterDescriptor[];
496
+ processCommand(cmd: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
497
+ private sanitizeCssColor;
498
+ private toHtml;
499
+ private escapeHtml;
500
+ private download;
501
+ }
502
+
503
+ declare class CliSnippetCommandProcessor implements ICliCommandProcessor {
504
+ command: string;
505
+ description: string;
506
+ aliases: string[];
507
+ author: ICliCommandAuthor;
508
+ metadata: CliProcessorMetadata;
509
+ stateConfiguration: CliStateConfiguration;
510
+ processors: ICliCommandChildProcessor[];
511
+ processCommand(_: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
512
+ }
513
+
514
+ declare class CliDiffCommandProcessor implements ICliCommandProcessor {
515
+ command: string;
516
+ description: string;
517
+ author: ICliCommandAuthor;
518
+ metadata: CliProcessorMetadata;
519
+ parameters: ICliCommandParameterDescriptor[];
520
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
521
+ }
522
+
523
+ type DiffType = 'same' | 'add' | 'remove';
524
+ interface DiffLine {
525
+ type: DiffType;
526
+ text: string;
527
+ }
528
+ /**
529
+ * Compute line-by-line diff using LCS (longest common subsequence).
530
+ */
531
+ declare function computeDiff(left: string, right: string): DiffLine[];
532
+ /**
533
+ * Format diff with ANSI colors. Only shows lines near changes (contextLines around each change).
534
+ */
535
+ declare function formatDiff(lines: DiffLine[], contextLines?: number): string[];
536
+
537
+ declare class CliHelpCommandProcessor implements ICliCommandProcessor {
538
+ command: string;
539
+ aliases: string[];
540
+ description: string;
541
+ acceptsRawInput?: boolean | undefined;
542
+ author: _qodalis_cli_core.ICliCommandAuthor;
543
+ metadata?: CliProcessorMetadata | undefined;
544
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
545
+ writeDescription(context: ICliExecutionContext): void;
546
+ private translateDescription;
547
+ private writeProcessorDescription;
548
+ private formatModuleName;
549
+ private writeParameter;
550
+ }
551
+
552
+ declare class CliVersionCommandProcessor implements ICliCommandProcessor {
553
+ command: string;
554
+ aliases: string[];
555
+ description?: string | undefined;
556
+ processors?: ICliCommandProcessor[] | undefined;
557
+ author?: ICliCommandAuthor | undefined;
558
+ metadata?: CliProcessorMetadata | undefined;
559
+ processCommand(_: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
560
+ writeDescription(context: ICliExecutionContext): void;
561
+ }
562
+
563
+ declare class CliFeedbackCommandProcessor implements ICliCommandProcessor {
564
+ command: string;
565
+ aliases: string[];
566
+ description?: string | undefined;
567
+ processors?: ICliCommandChildProcessor[] | undefined;
568
+ author?: ICliCommandAuthor | undefined;
569
+ metadata?: CliProcessorMetadata | undefined;
570
+ constructor();
571
+ processCommand(_: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
572
+ writeDescription(context: ICliExecutionContext): void;
573
+ }
574
+
575
+ declare class CliHistoryCommandProcessor implements ICliCommandProcessor {
576
+ command: string;
577
+ aliases: string[];
578
+ description?: string | undefined;
579
+ processors?: ICliCommandProcessor[] | undefined;
580
+ author?: ICliCommandAuthor | undefined;
581
+ metadata?: CliProcessorMetadata | undefined;
582
+ constructor();
583
+ processCommand(_: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
584
+ writeDescription(context: ICliExecutionContext): void;
585
+ }
586
+
587
+ declare class CliHotKeysCommandProcessor implements ICliCommandProcessor {
588
+ command: string;
589
+ aliases: string[];
590
+ description: string;
591
+ processors?: ICliCommandProcessor[] | undefined;
592
+ author: _qodalis_cli_core.ICliCommandAuthor;
593
+ metadata?: CliProcessorMetadata | undefined;
594
+ processCommand(_: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
595
+ writeDescription(context: ICliExecutionContext): void;
596
+ }
597
+
598
+ declare class CliPackagesCommandProcessor implements ICliCommandProcessor {
599
+ readonly command = "pkg";
600
+ readonly aliases: string[];
601
+ description: string;
602
+ author: _qodalis_cli_core.ICliCommandAuthor;
603
+ readonly version = "1.0.3";
604
+ readonly processors?: ICliCommandProcessor[] | undefined;
605
+ readonly metadata?: CliProcessorMetadata | undefined;
606
+ stateConfiguration?: CliStateConfiguration | undefined;
607
+ private registeredDependencies;
608
+ private scriptsLoader;
609
+ private packagesManager;
610
+ private registry;
611
+ private createAbortSignal;
612
+ constructor();
613
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
614
+ writeDescription?(context: ICliExecutionContext): void;
615
+ initialize(context: ICliExecutionContext): Promise<void>;
616
+ private removePackage;
617
+ private addPackage;
618
+ private doAddPackage;
619
+ private updatePackage;
620
+ private injectScriptWithCdnFallback;
621
+ private registerPackageDependencies;
622
+ private resolvePackageCdnPath;
623
+ private waitForGlobal;
624
+ }
625
+
626
+ declare class CliDebugCommandProcessor implements ICliCommandProcessor {
627
+ command: string;
628
+ description: string;
629
+ author: _qodalis_cli_core.ICliCommandAuthor;
630
+ metadata?: CliProcessorMetadata;
631
+ processors?: ICliCommandProcessor[];
632
+ processCommand(_: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
633
+ writeDescription(context: ICliExecutionContext): void;
634
+ private countProcessors;
635
+ }
636
+
637
+ declare class CliNanoCommandProcessor implements ICliCommandProcessor {
638
+ command: string;
639
+ aliases: string[];
640
+ description: string;
641
+ author: _qodalis_cli_core.ICliCommandAuthor;
642
+ acceptsRawInput: boolean;
643
+ metadata: CliProcessorMetadata;
644
+ private buffer;
645
+ private renderer;
646
+ private filePath;
647
+ private fs;
648
+ private context;
649
+ private resizeDisposable;
650
+ private statusMessage;
651
+ private statusTimeout;
652
+ private inputMode;
653
+ private inputBuffer;
654
+ private searchNeedle;
655
+ private replaceWith;
656
+ private replaceAllMode;
657
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
658
+ onData(data: string, context: ICliExecutionContext): Promise<void>;
659
+ writeDescription(context: ICliExecutionContext): void;
660
+ private render;
661
+ private renderPrompt;
662
+ private showStatus;
663
+ private handleTextPrompt;
664
+ private getPromptLabel;
665
+ private handleReplaceConfirm;
666
+ private exitEditor;
667
+ private handleExitSavePrompt;
668
+ private writeOut;
669
+ private save;
670
+ private readFileIntoBuffer;
671
+ private cleanup;
672
+ }
673
+
674
+ declare class CliServicesCommandProcessor implements ICliCommandProcessor {
675
+ command: string;
676
+ aliases: string[];
677
+ description: string;
678
+ author: _qodalis_cli_core.ICliCommandAuthor;
679
+ processors?: ICliCommandProcessor[];
680
+ metadata?: CliProcessorMetadata;
681
+ constructor();
682
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
683
+ writeDescription(context: ICliExecutionContext): void;
684
+ }
685
+
686
+ declare class CliPsCommandProcessor implements ICliCommandProcessor {
687
+ command: string;
688
+ description: string;
689
+ author: _qodalis_cli_core.ICliCommandAuthor;
690
+ metadata: {
691
+ icon: string;
692
+ sealed: boolean;
693
+ };
694
+ processCommand(_command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
695
+ }
696
+
697
+ declare class CliKillCommandProcessor implements ICliCommandProcessor {
698
+ command: string;
699
+ description: string;
700
+ author: _qodalis_cli_core.ICliCommandAuthor;
701
+ valueRequired: boolean;
702
+ metadata: {
703
+ icon: string;
704
+ sealed: boolean;
705
+ };
706
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
707
+ }
708
+
709
+ declare const systemProcessors: ICliCommandProcessor[];
710
+
711
+ declare class CliThemeCommandProcessor implements ICliCommandProcessor {
712
+ command: string;
713
+ aliases: string[];
714
+ description: string;
715
+ author?: ICliCommandAuthor | undefined;
716
+ version?: string | undefined;
717
+ processors?: ICliCommandProcessor[] | undefined;
718
+ metadata?: CliProcessorMetadata | undefined;
719
+ stateConfiguration?: CliStateConfiguration | undefined;
720
+ private themeOptions;
721
+ private defaultTheme;
722
+ constructor();
723
+ initialize(context: ICliExecutionContext): Promise<void>;
724
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
725
+ private renderThemePreview;
726
+ private applyStyles;
727
+ private saveTheme;
728
+ writeDescription?(context: ICliExecutionContext): void;
729
+ }
730
+
731
+ type ThemeState = {
732
+ selectedTheme?: string;
733
+ customOptions?: ITheme;
734
+ };
735
+ declare const themes: {
736
+ [x: string]: ITheme;
737
+ default: ITheme;
738
+ classic: ITheme;
739
+ dracula: ITheme;
740
+ monokai: ITheme;
741
+ solarizedDark: ITheme;
742
+ solarizedLight: ITheme;
743
+ gruvboxDark: ITheme;
744
+ gruvboxLight: ITheme;
745
+ nord: ITheme;
746
+ oneDark: ITheme;
747
+ material: ITheme;
748
+ highContrastLight: ITheme;
749
+ tokyoNight: ITheme;
750
+ catppuccinMocha: ITheme;
751
+ catppuccinFrappe: ITheme;
752
+ rosePine: ITheme;
753
+ kanagawa: ITheme;
754
+ everforestDark: ITheme;
755
+ ayuDark: ITheme;
756
+ catppuccinLatte: ITheme;
757
+ rosePineDawn: ITheme;
758
+ everforestLight: ITheme;
759
+ githubLight: ITheme;
760
+ cyberpunk: ITheme;
761
+ retroGreen: ITheme;
762
+ retroAmber: ITheme;
763
+ matrix: ITheme;
764
+ synthwave: ITheme;
765
+ highContrastDark: ITheme;
766
+ yellow: ITheme;
767
+ };
768
+ declare const themeInfos: Record<string, CliThemeInfo>;
769
+
770
+ declare class CliConfigureCommandProcessor implements ICliCommandProcessor {
771
+ command: string;
772
+ description: string;
773
+ author?: ICliCommandAuthor | undefined;
774
+ version?: string | undefined;
775
+ processors?: ICliCommandProcessor[] | undefined;
776
+ metadata?: CliProcessorMetadata | undefined;
777
+ stateConfiguration?: CliStateConfiguration | undefined;
778
+ constructor();
779
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
780
+ initialize(context: ICliExecutionContext): Promise<void>;
781
+ writeDescription?(context: ICliExecutionContext): void;
782
+ private showMainMenu;
783
+ private showCategoryMenu;
784
+ private editOption;
785
+ private setConfigValue;
786
+ private getConfigValue;
787
+ private getAllOptions;
788
+ private applySystemSettings;
789
+ private buildListProcessor;
790
+ private buildGetProcessor;
791
+ private buildSetProcessor;
792
+ private buildResetProcessor;
793
+ private coerceValue;
794
+ private getLanguageLabel;
795
+ private static buildDefaults;
796
+ }
797
+
798
+ interface ConfigureState {
799
+ system: Record<string, any>;
800
+ plugins: Record<string, Record<string, any>>;
801
+ }
802
+
803
+ declare class CliPingCommandProcessor implements ICliCommandProcessor {
804
+ command: string;
805
+ description: string;
806
+ author: ICliCommandAuthor;
807
+ acceptsRawInput: boolean;
808
+ metadata: CliProcessorMetadata;
809
+ parameters: {
810
+ name: string;
811
+ aliases: string[];
812
+ description: string;
813
+ required: boolean;
814
+ type: "number";
815
+ }[];
816
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
817
+ writeDescription(context: ICliExecutionContext): void;
818
+ private normalizeUrl;
819
+ private sleep;
820
+ }
821
+
822
+ /**
823
+ * `export` — set environment variables.
824
+ *
825
+ * Usage:
826
+ * export VAR=value
827
+ * export VAR="value with spaces"
828
+ */
829
+ declare class CliExportCommandProcessor implements ICliCommandProcessor {
830
+ command: string;
831
+ description: string;
832
+ author: _qodalis_cli_core.ICliCommandAuthor;
833
+ acceptsRawInput: boolean;
834
+ metadata: {
835
+ icon: string;
836
+ module: string;
837
+ };
838
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
839
+ writeDescription(context: ICliExecutionContext): void;
840
+ }
841
+ /**
842
+ * `unset` — remove environment variables.
843
+ */
844
+ declare class CliUnsetCommandProcessor implements ICliCommandProcessor {
845
+ command: string;
846
+ description: string;
847
+ author: _qodalis_cli_core.ICliCommandAuthor;
848
+ acceptsRawInput: boolean;
849
+ metadata: {
850
+ icon: string;
851
+ module: string;
852
+ };
853
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
854
+ writeDescription(context: ICliExecutionContext): void;
855
+ }
856
+ /**
857
+ * `env` / `printenv` — display environment variables.
858
+ */
859
+ declare class CliEnvCommandProcessor implements ICliCommandProcessor {
860
+ command: string;
861
+ aliases: string[];
862
+ description: string;
863
+ author: _qodalis_cli_core.ICliCommandAuthor;
864
+ acceptsRawInput: boolean;
865
+ metadata: {
866
+ icon: string;
867
+ module: string;
868
+ };
869
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
870
+ writeDescription(context: ICliExecutionContext): void;
871
+ }
872
+
873
+ declare class CliFontSizeCommandProcessor implements ICliCommandProcessor {
874
+ command: string;
875
+ description: string;
876
+ aliases: string[];
877
+ author: ICliCommandAuthor;
878
+ metadata: CliProcessorMetadata;
879
+ stateConfiguration: CliStateConfiguration;
880
+ processors: ICliCommandProcessor[];
881
+ initialize(context: ICliExecutionContext): Promise<void>;
882
+ processCommand(_: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
883
+ private getCurrent;
884
+ private setFontSize;
885
+ }
886
+
887
+ declare const miscProcessors: (CliAliasCommandProcessor | CliBase64CommandProcessor | CliCalCommandProcessor | CliClearCommandProcessor | CliClipboardCommandProcessor | CliColorCommandProcessor | CliConvertCommandProcessor | CliEchoCommandProcessor | CliEvalCommandProcessor | CliHashCommandProcessor | CliHexCommandProcessor | CliJsonCommandProcessor | CliJwtCommandProcessor | CliLoremCommandProcessor | CliOpenCommandProcessor | CliRandomCommandProcessor | CliScreenCommandProcessor | CliSeqCommandProcessor | CliSleepCommandProcessor | CliTimeCommandProcessor | CliTimestampCommandProcessor | CliUnAliasCommandProcessor | CliUnameCommandProcessor | CliUptimeCommandProcessor | CliUrlCommandProcessor | CliYesCommandProcessor)[];
888
+ declare const builtinProcessors: ICliCommandProcessor[];
889
+
890
+ declare class CliExecutionProcess implements ICliExecutionProcess {
891
+ private readonly context;
892
+ exited?: boolean | undefined;
893
+ exitCode?: number | undefined;
894
+ running: boolean;
895
+ data: any | undefined;
896
+ /**
897
+ * Whether `output()` was explicitly called during this command's execution.
898
+ * Used by the executor to decide whether to auto-capture terminal output.
899
+ */
900
+ outputCalled: boolean;
901
+ constructor(context: ICliExecutionContext);
902
+ exit(code?: number, options?: {
903
+ silent?: boolean;
904
+ }): void;
905
+ output(data: any): void;
906
+ start(): void;
907
+ end(): void;
908
+ }
909
+
910
+ declare class CliCommandExecutionContext implements ICliExecutionContext {
911
+ readonly context: ICliExecutionContext;
912
+ userSession?: ICliUserSession | undefined;
913
+ spinner?: ICliSpinner | undefined;
914
+ progressBar: ICliPercentageProgressBar;
915
+ textAnimator?: ICliTextAnimator | undefined;
916
+ onAbort: Subject<void>;
917
+ signal?: AbortSignal;
918
+ terminal: Terminal;
919
+ writer: ICliTerminalWriter;
920
+ executor: ICliCommandExecutorService;
921
+ clipboard: ICliClipboard;
922
+ state: ICliStateStore;
923
+ options?: CliOptions | undefined;
924
+ setContextProcessor: (processor: ICliCommandProcessor | undefined, silent?: boolean, fullScreen?: boolean) => void;
925
+ process: ICliExecutionProcess;
926
+ logger: ICliLogger;
927
+ services: ICliServiceProvider;
928
+ translator: ICliTranslationService;
929
+ reader: ICliInputReader;
930
+ readonly backgroundServices: ICliBackgroundServiceRegistry;
931
+ get promptLength(): number;
932
+ set promptLength(value: number);
933
+ get currentLine(): string;
934
+ setCurrentLine: (line: string) => void;
935
+ get cursorPosition(): number;
936
+ set cursorPosition(value: number);
937
+ clearLine: () => void;
938
+ showPrompt: (options?: {
939
+ reset?: boolean;
940
+ newLine?: boolean;
941
+ keepCurrentLine?: boolean;
942
+ }) => void;
943
+ clearCurrentLine: () => void;
944
+ refreshCurrentLine: () => void;
945
+ enterFullScreenMode: (processor: ICliCommandProcessor) => void;
946
+ exitFullScreenMode: () => void;
947
+ createInterval: (callback: () => void, ms: number) => ICliManagedInterval;
948
+ createTimeout: (callback: () => void, ms: number) => ICliManagedTimer;
949
+ constructor(context: ICliExecutionContext, processor: ICliCommandProcessor);
950
+ }
951
+
952
+ declare class CliCommandHistory {
953
+ private readonly store;
954
+ private readonly storageKey;
955
+ private commandHistory;
956
+ constructor(store: ICliKeyValueStore);
957
+ addCommand(command: string): Promise<void>;
958
+ getLastIndex(): number;
959
+ getHistory(): string[];
960
+ clearHistory(): Promise<void>;
961
+ setHistory(commands: string[]): Promise<void>;
962
+ getCommand(index: number): string | undefined;
963
+ /**
964
+ * Search history for commands containing the query string (case-insensitive).
965
+ * Returns matching commands in chronological order (oldest first).
966
+ */
967
+ search(query: string): string[];
968
+ /**
969
+ * Find the index of the most recent command that starts with the given prefix,
970
+ * searching backward from `fromIndex` (exclusive).
971
+ * Returns -1 if no match found.
972
+ */
973
+ searchBackward(prefix: string, fromIndex: number): number;
974
+ /**
975
+ * Find the index of the next command that starts with the given prefix,
976
+ * searching forward from `fromIndex` (exclusive).
977
+ * Returns -1 if no match found.
978
+ */
979
+ searchForward(prefix: string, fromIndex: number): number;
980
+ private saveHistory;
981
+ private loadHistory;
982
+ initialize(): Promise<void>;
983
+ }
984
+
985
+ interface ICliStateStoreManager {
986
+ getProcessorStateStore(processor: ICliCommandProcessor): ICliStateStore;
987
+ getStateStore(name: string, defaultState?: Record<string, any>): ICliStateStore;
988
+ getStoreEntries(): {
989
+ name: string;
990
+ state: Record<string, any>;
991
+ }[];
992
+ }
993
+ declare class CliStateStoreManager implements ICliStateStoreManager {
994
+ private readonly services;
995
+ private readonly registry;
996
+ private stores;
997
+ constructor(services: ICliServiceProvider, registry: ICliCommandProcessorRegistry);
998
+ getStateStore(name: string, defaultState?: Record<string, any>): ICliStateStore;
999
+ getProcessorStateStore(processor: ICliCommandProcessor): ICliStateStore;
1000
+ /**
1001
+ * Returns all store names and their current state values.
1002
+ */
1003
+ getStoreEntries(): {
1004
+ name: string;
1005
+ state: Record<string, any>;
1006
+ }[];
1007
+ }
1008
+
1009
+ type ActiveInputRequestType = 'line' | 'password' | 'confirm' | 'select' | 'select-inline' | 'multi-select' | 'number';
1010
+ interface ActiveInputRequest {
1011
+ type: ActiveInputRequestType;
1012
+ promptText: string;
1013
+ resolve: (value: any) => void;
1014
+ buffer: string;
1015
+ cursorPosition: number;
1016
+ defaultValue?: boolean;
1017
+ options?: CliSelectOption[];
1018
+ selectedIndex?: number;
1019
+ onChange?: (value: string) => void;
1020
+ checkedIndices?: Set<number>;
1021
+ numberOptions?: {
1022
+ min?: number;
1023
+ max?: number;
1024
+ default?: number;
1025
+ };
1026
+ scrollOffset?: number;
1027
+ maxVisible?: number;
1028
+ displayLines?: number;
1029
+ }
1030
+ interface CliInputReaderHost {
1031
+ readonly activeInputRequest: ActiveInputRequest | null;
1032
+ setActiveInputRequest(request: ActiveInputRequest | null): void;
1033
+ writeToTerminal(text: string): void;
1034
+ getTerminalRows?(): number;
1035
+ }
1036
+ declare class CliInputReader implements ICliInputReader {
1037
+ private readonly host;
1038
+ constructor(host: CliInputReaderHost);
1039
+ readLine(prompt: string): Promise<string | null>;
1040
+ readPassword(prompt: string): Promise<string | null>;
1041
+ readConfirm(prompt: string, defaultValue?: boolean): Promise<boolean | null>;
1042
+ readSelect(prompt: string, options: CliSelectOption[], onChange?: (value: string) => void): Promise<string | null>;
1043
+ readSelectInline(prompt: string, options: CliSelectOption[], onChange?: (value: string) => void): Promise<string | null>;
1044
+ readMultiSelect(prompt: string, options: CliMultiSelectOption[]): Promise<string[] | null>;
1045
+ readNumber(prompt: string, options?: {
1046
+ min?: number;
1047
+ max?: number;
1048
+ default?: number;
1049
+ }): Promise<number | null>;
1050
+ renderSelectOptions(options: CliSelectOption[], selectedIndex: number, scrollOffset?: number, maxVisible?: number): number;
1051
+ renderInlineSelectOptions(options: CliSelectOption[], selectedIndex: number): string;
1052
+ renderMultiSelectOptions(options: CliSelectOption[], selectedIndex: number, checkedIndices: Set<number>, scrollOffset?: number, maxVisible?: number): number;
1053
+ private createInputRequest;
1054
+ }
1055
+
1056
+ /**
1057
+ * Manages tab-completion by querying registered providers in priority order.
1058
+ * Implements bash-style behavior:
1059
+ * - First Tab: complete common prefix (or single match fully)
1060
+ * - Second Tab: display all candidates
1061
+ */
1062
+ declare class CliCompletionEngine {
1063
+ private providers;
1064
+ private lastCandidates;
1065
+ private tabCount;
1066
+ private lastInput;
1067
+ setProviders(providers: ICliCompletionProvider[]): void;
1068
+ addProvider(provider: ICliCompletionProvider): void;
1069
+ /**
1070
+ * Reset tab state. Call on any non-tab keypress.
1071
+ */
1072
+ resetState(): void;
1073
+ /**
1074
+ * Process a tab press. Returns the completion result.
1075
+ */
1076
+ complete(input: string, cursor: number): Promise<{
1077
+ /** What to do */
1078
+ action: 'complete' | 'show-candidates' | 'none';
1079
+ /** Replacement text for the token (when action = 'complete') */
1080
+ replacement?: string;
1081
+ /** Where the token starts in the input */
1082
+ tokenStart?: number;
1083
+ /** The original token */
1084
+ token?: string;
1085
+ /** All candidates (when action = 'show-candidates') */
1086
+ candidates?: string[];
1087
+ }>;
1088
+ private buildContext;
1089
+ private tokenize;
1090
+ private fetchCompletions;
1091
+ /**
1092
+ * Return the single best completion string for ghost-text display.
1093
+ * Returns null if there is no clear best match or multiple candidates.
1094
+ */
1095
+ completeSingle(input: string, cursor: number): Promise<string | null>;
1096
+ private commonPrefix;
1097
+ }
1098
+
1099
+ /**
1100
+ * Reusable text buffer with cursor management.
1101
+ * Eliminates duplicated line-editing logic across CommandLineMode,
1102
+ * ReaderMode, and any future input mode.
1103
+ */
1104
+ declare class CliLineBuffer {
1105
+ private _text;
1106
+ private _cursorPosition;
1107
+ get text(): string;
1108
+ get cursorPosition(): number;
1109
+ set cursorPosition(value: number);
1110
+ insert(str: string): void;
1111
+ deleteCharBefore(): void;
1112
+ deleteCharAt(): void;
1113
+ moveCursorLeft(): void;
1114
+ moveCursorRight(): void;
1115
+ moveHome(): void;
1116
+ moveEnd(): void;
1117
+ clear(): void;
1118
+ setText(str: string): void;
1119
+ }
1120
+
1121
+ /**
1122
+ * State machine interface for terminal input routing.
1123
+ * Each mode handles its own key events and data.
1124
+ */
1125
+ interface IInputMode {
1126
+ /**
1127
+ * Handle raw terminal data (characters, escape sequences, control chars).
1128
+ * Called by terminal.onData.
1129
+ */
1130
+ handleInput(data: string): Promise<void>;
1131
+ /**
1132
+ * Handle keyboard events before they reach onData.
1133
+ * Called by terminal.attachCustomKeyEventHandler for 'keydown' events.
1134
+ * Return false to prevent the key from reaching onData.
1135
+ * Return true to let the key pass through to onData.
1136
+ */
1137
+ handleKeyEvent(event: KeyboardEvent): boolean;
1138
+ /**
1139
+ * Called when this mode becomes the active input mode.
1140
+ */
1141
+ activate?(): void;
1142
+ /**
1143
+ * Called when this mode is no longer the active input mode.
1144
+ */
1145
+ deactivate?(): void;
1146
+ }
1147
+
1148
+ interface PromptOptions {
1149
+ userName?: string;
1150
+ hideUserName?: boolean;
1151
+ contextProcessor?: string;
1152
+ pathProvider?: () => string | null;
1153
+ }
1154
+ /**
1155
+ * Handles prompt rendering and line display for the CLI.
1156
+ * Encapsulates all terminal escape sequences for line editing.
1157
+ */
1158
+ declare class CliTerminalLineRenderer {
1159
+ private readonly terminal;
1160
+ private readonly writer;
1161
+ constructor(terminal: Terminal, writer: ICliTerminalWriter);
1162
+ /**
1163
+ * Builds the prompt string (user:path$ ) with ANSI color codes.
1164
+ */
1165
+ getPromptString(options: PromptOptions): string;
1166
+ /**
1167
+ * Writes the prompt to the terminal and returns the visible prompt length
1168
+ * (number of columns the prompt occupies).
1169
+ */
1170
+ renderPrompt(options: PromptOptions): number;
1171
+ /**
1172
+ * Clears and redraws the current line (prompt + user input + cursor positioning).
1173
+ */
1174
+ refreshLine(currentLine: string, cursorPosition: number, promptLength: number, promptString: string, previousContentLength?: number): void;
1175
+ /**
1176
+ * Clears the current terminal line.
1177
+ */
1178
+ clearLine(contentLength: number): void;
1179
+ }
1180
+
1181
+ /**
1182
+ * Host interface for CommandLineMode — provides access to
1183
+ * the execution context's services without a circular dependency.
1184
+ */
1185
+ interface CommandLineModeHost {
1186
+ readonly terminal: Terminal;
1187
+ readonly lineBuffer: CliLineBuffer;
1188
+ readonly lineRenderer: CliTerminalLineRenderer;
1189
+ readonly completionEngine: CliCompletionEngine;
1190
+ readonly commandHistory: CliCommandHistory;
1191
+ getPromptOptions(): PromptOptions;
1192
+ getPromptLength(): number;
1193
+ setPromptLength(value: number): void;
1194
+ getExecutionContext(): ICliExecutionContext;
1195
+ isProgressRunning(): boolean;
1196
+ isRawModeActive(): boolean;
1197
+ abort(): void;
1198
+ showPrompt(options?: {
1199
+ reset?: boolean;
1200
+ newLine?: boolean;
1201
+ keepCurrentLine?: boolean;
1202
+ }): void;
1203
+ }
1204
+
1205
+ /**
1206
+ * Host interface for ReaderMode — provides access to the active input request.
1207
+ */
1208
+ interface ReaderModeHost {
1209
+ readonly terminal: Terminal;
1210
+ getActiveInputRequest(): ActiveInputRequest | null;
1211
+ setActiveInputRequest(request: ActiveInputRequest | null): void;
1212
+ popMode(): void;
1213
+ }
1214
+
1215
+ interface CliExecutionContextDeps {
1216
+ services: ICliServiceProvider;
1217
+ logger: ICliLogger;
1218
+ commandHistory: CliCommandHistory;
1219
+ stateStoreManager: CliStateStoreManager;
1220
+ translator: ICliTranslationService;
1221
+ }
1222
+ declare class CliExecutionContext implements ICliExecutionContext, CliInputReaderHost, CommandLineModeHost, ReaderModeHost {
1223
+ terminal: Terminal;
1224
+ executor: ICliCommandExecutorService;
1225
+ userSession?: ICliUserSession;
1226
+ contextProcessor?: ICliCommandProcessor;
1227
+ readonly writer: ICliTerminalWriter;
1228
+ readonly spinner: ICliSpinner;
1229
+ readonly textAnimator: ICliTextAnimator;
1230
+ readonly progressBar: ICliPercentageProgressBar;
1231
+ readonly options?: CliOptions;
1232
+ readonly onAbort: Subject<void>;
1233
+ readonly state: ICliStateStore;
1234
+ readonly clipboard: ICliClipboard;
1235
+ readonly process: ICliExecutionProcess;
1236
+ readonly logger: ICliLogger;
1237
+ readonly services: ICliServiceProvider;
1238
+ readonly translator: ICliTranslationService;
1239
+ readonly backgroundServices: ICliBackgroundServiceRegistry;
1240
+ promptPathProvider?: () => string | null;
1241
+ readonly completionEngine: CliCompletionEngine;
1242
+ promptLength: number;
1243
+ readonly reader: ICliInputReader;
1244
+ readonly lineBuffer: CliLineBuffer;
1245
+ readonly lineRenderer: CliTerminalLineRenderer;
1246
+ readonly commandHistory: CliCommandHistory;
1247
+ private _activeInputRequest;
1248
+ private readonly modeStack;
1249
+ private readonly managedTimers;
1250
+ private resizeDisposable;
1251
+ constructor(deps: CliExecutionContextDeps, terminal: Terminal, executor: ICliCommandExecutorService, cliOptions?: CliOptions);
1252
+ get activeInputRequest(): ActiveInputRequest | null;
1253
+ /**
1254
+ * Sets the active input request. When a non-null request is provided,
1255
+ * pushes ReaderMode onto the mode stack. ReaderMode pops itself on
1256
+ * completion, so passing null here does NOT pop the mode.
1257
+ */
1258
+ setActiveInputRequest(request: ActiveInputRequest | null): void;
1259
+ writeToTerminal(text: string): void;
1260
+ getTerminalRows(): number;
1261
+ get currentLine(): string;
1262
+ get cursorPosition(): number;
1263
+ set cursorPosition(value: number);
1264
+ initializeTerminalListeners(): void;
1265
+ setContextProcessor: (processor: ICliCommandProcessor | undefined, silent?: boolean, fullScreen?: boolean) => void;
1266
+ setCurrentLine(line: string): void;
1267
+ clearLine(): void;
1268
+ showPrompt(options?: {
1269
+ reset?: boolean;
1270
+ newLine?: boolean;
1271
+ keepCurrentLine?: boolean;
1272
+ }): void;
1273
+ clearCurrentLine(): void;
1274
+ refreshCurrentLine(previousContentLength?: number): void;
1275
+ /**
1276
+ * Redraw the prompt after a terminal resize.
1277
+ * Called by CliEngine.safeFit() when terminal columns change.
1278
+ * No-op when progress indicators, raw mode, or input requests are active.
1279
+ *
1280
+ * Uses the buffer's `isWrapped` flags to walk backwards from the cursor
1281
+ * and find the first visual line of the current logical line. This tells
1282
+ * us exactly how many rows the prompt (+ user input) spans after xterm
1283
+ * reflow, so we can clear them all — including reflow artefacts that the
1284
+ * simple `ceil(contentLength / cols)` calculation would miss.
1285
+ */
1286
+ handleTerminalResize(): void;
1287
+ isRawModeActive(): boolean;
1288
+ enterFullScreenMode(processor: ICliCommandProcessor): void;
1289
+ exitFullScreenMode(): void;
1290
+ createInterval(callback: () => void, ms: number): ICliManagedInterval;
1291
+ createTimeout(callback: () => void, ms: number): ICliManagedTimer;
1292
+ isProgressRunning(): boolean;
1293
+ abort(): void;
1294
+ setSession(session: ICliUserSession): void;
1295
+ getPromptOptions(): PromptOptions;
1296
+ getPromptLength(): number;
1297
+ setPromptLength(value: number): void;
1298
+ getExecutionContext(): ICliExecutionContext;
1299
+ getActiveInputRequest(): ActiveInputRequest | null;
1300
+ private clearAllManagedTimers;
1301
+ /**
1302
+ * Dispose all resources. Called by CliEngine.destroy() when the
1303
+ * CLI component is being torn down.
1304
+ */
1305
+ dispose(): void;
1306
+ private get currentMode();
1307
+ pushMode(mode: IInputMode): void;
1308
+ popMode(): void;
1309
+ }
1310
+
1311
+ /**
1312
+ * Extended execution context interface used internally by the command executor.
1313
+ * The concrete implementation (e.g. CliExecutionContext in angular-cli) provides these.
1314
+ */
1315
+ interface ICliExecutionHost extends ICliExecutionContext {
1316
+ contextProcessor?: ICliCommandProcessor;
1317
+ abort?(): void;
1318
+ }
1319
+ declare class CliCommandExecutor implements ICliCommandExecutorService {
1320
+ protected readonly registry: ICliCommandProcessorRegistry;
1321
+ private commandParser;
1322
+ private globalParameters;
1323
+ private lastCapturingWriter?;
1324
+ constructor(registry: ICliCommandProcessorRegistry);
1325
+ registerGlobalParameter(handler: ICliGlobalParameterHandler): void;
1326
+ getGlobalParameters(): ICliCommandParameterDescriptor[];
1327
+ executeCommand(command: string, context: ICliExecutionContext): Promise<void>;
1328
+ private appendOutputToFile;
1329
+ private writeOutputToFile;
1330
+ private executeSingleCommand;
1331
+ private writeStderrToFile;
1332
+ private appendStderrToFile;
1333
+ showHelp(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
1334
+ /**
1335
+ * Attempt to execute a file path as a script.
1336
+ * Returns true if the file was found and executed, false otherwise.
1337
+ * Requires the @qodalis/cli-files plugin for filesystem access.
1338
+ */
1339
+ private tryExecuteScript;
1340
+ private substituteVars;
1341
+ /**
1342
+ * Expand $VAR and ${VAR} references using the global environment store.
1343
+ * Variables inside single-quoted strings are NOT expanded (like bash).
1344
+ */
1345
+ private expandEnvironmentVars;
1346
+ /**
1347
+ * Validates the command arguments before execution.
1348
+ * @param context The current CLI execution context.
1349
+ * @param processor The processor to validate.
1350
+ * @param args The command arguments.
1351
+ * @param hasPositionalInput Whether the command has positional or piped input.
1352
+ * When true, required-parameter checks are skipped because the processor
1353
+ * will parse the positional text itself.
1354
+ * @returns True if the arguments are valid, false otherwise.
1355
+ */
1356
+ private validateBeforeExecution;
1357
+ /**
1358
+ * Returns true when the processor (or one of its ancestors) declares a
1359
+ * parameter whose name or aliases overlap with the global handler's
1360
+ * parameter. In that case the global handler must be skipped so the
1361
+ * processor can handle the flag itself.
1362
+ */
1363
+ private processorOwnsParameter;
1364
+ }
1365
+
1366
+ /**
1367
+ * --version / -v : prints the processor's version and halts execution.
1368
+ */
1369
+ declare const versionGlobalParameter: ICliGlobalParameterHandler;
1370
+ /**
1371
+ * --help / -h : shows help for the current command and halts execution.
1372
+ */
1373
+ declare const helpGlobalParameter: ICliGlobalParameterHandler;
1374
+ /**
1375
+ * --context : sets the processor as the active context processor and halts execution.
1376
+ */
1377
+ declare const contextGlobalParameter: ICliGlobalParameterHandler;
1378
+
1379
+ /**
1380
+ * A simple Map-based service container implementing ICliServiceProvider.
1381
+ *
1382
+ * Supports three provider types:
1383
+ * - `useValue` : registers a static value
1384
+ * - `useFactory` : registers a factory function, invoked once on first `get`
1385
+ * - `useClass` : registers a class constructor, instantiated once on first `get`
1386
+ *
1387
+ * When `multi: true`, multiple providers for the same token are accumulated
1388
+ * and `get()` returns an array of resolved values.
1389
+ */
1390
+ declare class CliServiceContainer implements ICliServiceProvider {
1391
+ /** Stores single-value providers (resolved or pending). */
1392
+ private readonly services;
1393
+ /** Stores multi-provider arrays. */
1394
+ private readonly multiServices;
1395
+ /**
1396
+ * Retrieve a service by its token.
1397
+ *
1398
+ * @param token The token used to register the service.
1399
+ * @returns The resolved service instance (or array for multi providers).
1400
+ * @throws Error if the token has not been registered.
1401
+ */
1402
+ get<T>(token: any): T;
1403
+ /**
1404
+ * Register one or more providers.
1405
+ *
1406
+ * @param definition A single CliProvider or an array of CliProviders.
1407
+ */
1408
+ set(definition: CliProvider | CliProvider[]): void;
1409
+ /**
1410
+ * Returns all registered service tokens (single + multi providers).
1411
+ */
1412
+ getRegisteredTokens(): string[];
1413
+ /**
1414
+ * Returns detailed info for each registered service: token name, value type, and multi flag.
1415
+ */
1416
+ getRegisteredServiceDetails(): {
1417
+ token: string;
1418
+ type: string;
1419
+ multi: boolean;
1420
+ }[];
1421
+ /**
1422
+ * Describe a resolved value for diagnostic display.
1423
+ */
1424
+ private describeValue;
1425
+ /**
1426
+ * Register a single provider.
1427
+ */
1428
+ private registerProvider;
1429
+ /**
1430
+ * Resolve a provider definition to a concrete value.
1431
+ */
1432
+ private resolveProvider;
1433
+ }
1434
+
1435
+ declare class CliTerminalWriter implements ICliTerminalWriter {
1436
+ readonly terminal: Terminal;
1437
+ constructor(terminal: Terminal);
1438
+ write(text: string): void;
1439
+ writeln(text?: string): void;
1440
+ writeSuccess(message: string): void;
1441
+ writeInfo(message: string): void;
1442
+ writeWarning(message: string): void;
1443
+ writeError(message: string): void;
1444
+ private writeLog;
1445
+ writeDivider(options?: {
1446
+ color?: CliForegroundColor;
1447
+ length?: number;
1448
+ char?: string;
1449
+ }): void;
1450
+ wrapInColor(text: string, color: CliForegroundColor): string;
1451
+ wrapInBackgroundColor(text: string, color: CliBackgroundColor): string;
1452
+ writeJson(json: any): void;
1453
+ writeToFile(fileName: string, content: string): void;
1454
+ writeObjectsAsTable(objects: any[]): void;
1455
+ writeList(items: string[], options?: {
1456
+ ordered?: boolean;
1457
+ prefix?: string;
1458
+ color?: CliForegroundColor;
1459
+ }): void;
1460
+ writeKeyValue(entries: Record<string, string> | [string, string][], options?: {
1461
+ separator?: string;
1462
+ keyColor?: CliForegroundColor;
1463
+ }): void;
1464
+ writeColumns(items: string[], options?: {
1465
+ columns?: number;
1466
+ padding?: number;
1467
+ }): void;
1468
+ writeTable(headers: string[], rows: string[][]): void;
1469
+ }
1470
+
1471
+ declare class CliClipboard implements ICliClipboard {
1472
+ private readonly context;
1473
+ constructor(context: ICliExecutionContext);
1474
+ write(text: string): Promise<void>;
1475
+ read(): Promise<string>;
1476
+ }
1477
+
1478
+ declare class CliLogger implements ICliLogger {
1479
+ private CliLogLevel;
1480
+ constructor();
1481
+ setCliLogLevel(level: CliLogLevel): void;
1482
+ log(...args: any[]): void;
1483
+ info(...args: any[]): void;
1484
+ warn(...args: any[]): void;
1485
+ error(...args: any[]): void;
1486
+ debug(...args: any[]): void;
1487
+ }
1488
+
1489
+ declare class CliTerminalSpinner implements ICliSpinner {
1490
+ private terminal;
1491
+ isRunning: boolean;
1492
+ text: string;
1493
+ context?: ICliExecutionContext;
1494
+ constructor(terminal: Terminal);
1495
+ private spinnerInterval?;
1496
+ private spinnerFrames;
1497
+ private spinnerColors;
1498
+ private spinnerIndex;
1499
+ private savedCurrentLine;
1500
+ private lastContentLength;
1501
+ private lastLineCount;
1502
+ private resizeDisposable?;
1503
+ show(text?: string): void;
1504
+ hide(): void;
1505
+ setText(text: string): void;
1506
+ private clearCurrentLine;
1507
+ private calcLineCount;
1508
+ }
1509
+
1510
+ declare class CliTerminalProgressBar implements ICliPercentageProgressBar {
1511
+ private terminal;
1512
+ isRunning: boolean;
1513
+ context?: ICliExecutionContext;
1514
+ private text;
1515
+ private progressBarInterval?;
1516
+ private progress;
1517
+ private total;
1518
+ private progressText;
1519
+ private progressTextPlainLength;
1520
+ private savedCurrentLine;
1521
+ private tickCount;
1522
+ private lastLineCount;
1523
+ private resizeDisposable?;
1524
+ constructor(terminal: Terminal);
1525
+ show(text?: string): void;
1526
+ hide(): void;
1527
+ update(progress: number, options?: CliPercentageProgressBarUpdateValueOptions): void;
1528
+ complete(): void;
1529
+ setText(text: string): void;
1530
+ private updateProgressBar;
1531
+ /**
1532
+ * Returns an ANSI 256-color escape for a position in the progress bar.
1533
+ * Gradient: red (0%) -> yellow (50%) -> green (100%).
1534
+ */
1535
+ private progressGradientColor;
1536
+ private clearCurrentLine;
1537
+ private calcLineCount;
1538
+ }
1539
+
1540
+ declare class CliTerminalTextAnimator implements ICliTextAnimator {
1541
+ private terminal;
1542
+ isRunning: boolean;
1543
+ context?: ICliExecutionContext;
1544
+ private animationInterval?;
1545
+ private text;
1546
+ private textColor;
1547
+ constructor(terminal: Terminal);
1548
+ show(text?: string): void;
1549
+ showText(text: string, options?: CliTextAnimatorOptions): Promise<void>;
1550
+ /**
1551
+ * Hide the animation and reset the state.
1552
+ */
1553
+ hide(): void;
1554
+ }
1555
+
1556
+ interface CliWelcomeMessageConfig {
1557
+ /** Custom message to display instead of the default */
1558
+ message?: string;
1559
+ /** When to show the welcome message (default: 'always') */
1560
+ show?: 'always' | 'once' | 'daily' | 'never';
1561
+ }
1562
+ interface ICliWelcomeModule extends ICliModule {
1563
+ configure(config: CliWelcomeMessageConfig): ICliModule;
1564
+ }
1565
+ declare const welcomeModule: ICliWelcomeModule;
1566
+
1567
+ declare class CliBoot {
1568
+ private readonly registry;
1569
+ private readonly services;
1570
+ private initialized;
1571
+ private initializing;
1572
+ private readonly moduleRegistry;
1573
+ private readonly bootedModules;
1574
+ constructor(registry: ICliCommandProcessorRegistry, services: ICliServiceProvider);
1575
+ /**
1576
+ * Get the module registry for external access.
1577
+ */
1578
+ getModuleRegistry(): CliModuleRegistry;
1579
+ boot(context: CliExecutionContext, modules: ICliModule[]): Promise<void>;
1580
+ private bootModule;
1581
+ private buildCoreModule;
1582
+ /**
1583
+ * Topologically sort modules by their dependencies using DFS.
1584
+ * Modules with no dependencies come first.
1585
+ * Circular dependencies are detected and reported. Missing dependencies
1586
+ * cause the dependent module to be skipped.
1587
+ */
1588
+ private topologicalSort;
1589
+ private filterByVersion;
1590
+ private bootShared;
1591
+ private initializeProcessorsInternal;
1592
+ }
1593
+
1594
+ type CdnSourceName = string;
1595
+ type SourceKind = 'registry' | 'file';
1596
+ interface SourceEntry {
1597
+ url: string;
1598
+ kind: SourceKind;
1599
+ }
1600
+ declare class ScriptLoaderService {
1601
+ private sources;
1602
+ private primary;
1603
+ constructor();
1604
+ /**
1605
+ * Registers a custom package source.
1606
+ */
1607
+ addSource(name: string, url: string, kind?: SourceKind): void;
1608
+ /**
1609
+ * Returns all registered source names.
1610
+ */
1611
+ getSources(): string[];
1612
+ /**
1613
+ * Returns the full source entry for a given name, or undefined if not found.
1614
+ */
1615
+ getSource(name: string): SourceEntry | undefined;
1616
+ /**
1617
+ * Returns the base URL for a given source name, or undefined if not found.
1618
+ */
1619
+ getSourceUrl(name: string): string | undefined;
1620
+ /**
1621
+ * Returns all sources of a given kind.
1622
+ */
1623
+ getSourcesByKind(kind: SourceKind): {
1624
+ name: string;
1625
+ url: string;
1626
+ }[];
1627
+ /**
1628
+ * Sets the preferred CDN source. The other sources become fallbacks.
1629
+ */
1630
+ setCdnSource(preferred: CdnSourceName): void;
1631
+ /**
1632
+ * Returns the current preferred CDN source name.
1633
+ */
1634
+ getCdnSource(): CdnSourceName;
1635
+ injectScript(src: string): Promise<void>;
1636
+ getScript(src: string, options?: {
1637
+ onProgress?: (progress: number) => void;
1638
+ signal?: AbortSignal;
1639
+ }): Promise<{
1640
+ xhr: XMLHttpRequest;
1641
+ content?: string;
1642
+ error?: any;
1643
+ }>;
1644
+ injectBodyScript(code: string): void;
1645
+ /**
1646
+ * Returns CDN URLs for a given npm package path.
1647
+ * The first entry is the primary source, the rest are fallbacks.
1648
+ * Only includes 'file' kind sources (CDNs and file servers).
1649
+ */
1650
+ getCdnUrls(packagePath: string): string[];
1651
+ /**
1652
+ * Tries to fetch a script from multiple CDN sources, falling back on failure.
1653
+ */
1654
+ getScriptWithFallback(packagePath: string, options?: {
1655
+ onProgress?: (progress: number) => void;
1656
+ signal?: AbortSignal;
1657
+ }): Promise<{
1658
+ xhr: XMLHttpRequest;
1659
+ content?: string;
1660
+ error?: any;
1661
+ }>;
1662
+ /**
1663
+ * Tries to inject a script tag from multiple CDN sources, falling back on failure.
1664
+ */
1665
+ injectScriptWithFallback(packagePath: string): Promise<void>;
1666
+ private getScriptFromUrls;
1667
+ private injectScriptFromUrls;
1668
+ }
1669
+
1670
+ declare class CliPackageManagerService {
1671
+ private readonly storageKey;
1672
+ QODALIS_COMMAND_PREFIX: string;
1673
+ private store;
1674
+ constructor();
1675
+ /**
1676
+ * Set the key-value store instance for persistence.
1677
+ */
1678
+ setStore(store: ICliKeyValueStore): void;
1679
+ /**
1680
+ * Retrieves the list of packages
1681
+ * @returns {Package[]} Array of packages
1682
+ */
1683
+ getPackages(): Promise<Package[]>;
1684
+ /**
1685
+ * Retrieves a package by name from the list.
1686
+ */
1687
+ getPackage(packageName: string): Promise<Package | undefined>;
1688
+ /**
1689
+ * Checks if a package with the given name exists in the list.
1690
+ */
1691
+ hasPackage(packageName: string): Promise<boolean>;
1692
+ /**
1693
+ * Adds a new package to the list and saves it in storage.
1694
+ */
1695
+ addPackage(pkg: Package): Promise<void>;
1696
+ /**
1697
+ * Removes a package by name and saves the updated list in storage.
1698
+ */
1699
+ removePackage(packageName: string): Promise<Package>;
1700
+ /**
1701
+ * Updates an existing package in the list.
1702
+ */
1703
+ updatePackage(pkg: Package): Promise<void>;
1704
+ private savePackages;
1705
+ }
1706
+
1707
+ declare class CliDefaultPingServerService implements ICliPingServerService {
1708
+ ping(): Promise<void>;
1709
+ }
1710
+
1711
+ /**
1712
+ * A terminal writer wrapper that captures "stdout-equivalent" output
1713
+ * (`write`, `writeln`, `writeJson`, `writeObjectsAsTable`, `writeTable`)
1714
+ * while passing everything through to the underlying writer unchanged.
1715
+ *
1716
+ * Diagnostic methods (`writeError`, `writeWarning`, `writeInfo`, `writeSuccess`)
1717
+ * are NOT captured — they are the equivalent of stderr.
1718
+ *
1719
+ * After a command finishes, the executor can retrieve the captured data to use
1720
+ * as implicit pipeline output when the command did not call `process.output()`.
1721
+ */
1722
+ declare class CapturingTerminalWriter implements ICliTerminalWriter {
1723
+ private readonly inner;
1724
+ /** Raw text lines captured from write/writeln calls. */
1725
+ private _lines;
1726
+ /** Structured data captured from writeJson calls. */
1727
+ private _jsonValues;
1728
+ /** Structured data captured from writeObjectsAsTable calls. */
1729
+ private _tableObjects;
1730
+ /** Raw text lines captured from writeError/writeWarning calls. */
1731
+ private _stderrLines;
1732
+ constructor(inner: ICliTerminalWriter);
1733
+ write(text: string): void;
1734
+ writeln(text?: string): void;
1735
+ writeJson(json: any): void;
1736
+ writeObjectsAsTable(objects: any[]): void;
1737
+ writeTable(headers: string[], rows: string[][]): void;
1738
+ writeSuccess(message: string): void;
1739
+ writeInfo(message: string): void;
1740
+ writeWarning(message: string): void;
1741
+ writeError(message: string): void;
1742
+ wrapInColor(text: string, color: CliForegroundColor): string;
1743
+ wrapInBackgroundColor(text: string, color: CliBackgroundColor): string;
1744
+ writeToFile(fileName: string, content: string): void;
1745
+ writeDivider(options?: {
1746
+ color?: CliForegroundColor;
1747
+ length?: number;
1748
+ char?: string;
1749
+ }): void;
1750
+ writeList(items: string[], options?: {
1751
+ ordered?: boolean;
1752
+ prefix?: string;
1753
+ color?: CliForegroundColor;
1754
+ }): void;
1755
+ writeKeyValue(entries: Record<string, string> | [string, string][], options?: {
1756
+ separator?: string;
1757
+ keyColor?: CliForegroundColor;
1758
+ }): void;
1759
+ writeColumns(items: string[], options?: {
1760
+ columns?: number;
1761
+ padding?: number;
1762
+ }): void;
1763
+ /**
1764
+ * Returns true if any stdout-equivalent output was captured.
1765
+ */
1766
+ hasOutput(): boolean;
1767
+ /**
1768
+ * Returns the captured data in the most useful form:
1769
+ *
1770
+ * 1. If structured JSON was written (via `writeJson`), return the last
1771
+ * JSON value (preserving its original type — object, array, etc.).
1772
+ * 2. If objects were written as a table, return the last array of objects.
1773
+ * 3. Otherwise return the captured text lines joined with newlines,
1774
+ * with ANSI codes stripped and whitespace trimmed.
1775
+ * 4. Returns `undefined` if nothing was captured.
1776
+ */
1777
+ getCapturedData(): any | undefined;
1778
+ /**
1779
+ * Returns true if any stderr-equivalent output was captured.
1780
+ */
1781
+ hasStderr(): boolean;
1782
+ /**
1783
+ * Returns captured stderr text joined with newlines, or undefined if empty.
1784
+ */
1785
+ getCapturedStderr(): string | undefined;
1786
+ }
1787
+
1788
+ declare const CliProcessRegistry_TOKEN = "cli-process-registry";
1789
+ declare class CliProcessRegistry implements ICliProcessRegistry {
1790
+ private nextPid;
1791
+ private processes;
1792
+ private _currentPid;
1793
+ private maxHistory;
1794
+ get currentPid(): number | undefined;
1795
+ register(command: string): {
1796
+ pid: number;
1797
+ abortController: AbortController;
1798
+ };
1799
+ complete(pid: number, exitCode: number): void;
1800
+ fail(pid: number): void;
1801
+ kill(pid: number): boolean;
1802
+ list(): ICliProcessEntry[];
1803
+ private pruneHistory;
1804
+ }
1805
+
1806
+ /**
1807
+ * Global environment variable store for the CLI session.
1808
+ *
1809
+ * Variables set here are available to all commands via `$VAR` / `${VAR}`
1810
+ * substitution in the executor. Commands can also read/write the store
1811
+ * directly through the service provider.
1812
+ */
1813
+ interface ICliEnvironment {
1814
+ /** Get a variable value (undefined if not set). */
1815
+ get(name: string): string | undefined;
1816
+ /** Set a variable. */
1817
+ set(name: string, value: string): void;
1818
+ /** Remove a variable. */
1819
+ unset(name: string): void;
1820
+ /** Get all variables as a record. */
1821
+ getAll(): Record<string, string>;
1822
+ /** Check if a variable is set. */
1823
+ has(name: string): boolean;
1824
+ }
1825
+ declare const ICliEnvironment_TOKEN = "cli-environment";
1826
+ /**
1827
+ * Default in-memory implementation.
1828
+ * Seeded with some standard variables on construction.
1829
+ */
1830
+ declare class CliEnvironment implements ICliEnvironment {
1831
+ private readonly vars;
1832
+ constructor();
1833
+ get(name: string): string | undefined;
1834
+ set(name: string, value: string): void;
1835
+ unset(name: string): void;
1836
+ getAll(): Record<string, string>;
1837
+ has(name: string): boolean;
1838
+ }
1839
+
1840
+ declare class CliDragDropService implements ICliDragDropService {
1841
+ private readonly _container;
1842
+ private readonly _subject;
1843
+ private readonly _dragOver;
1844
+ private readonly _drop;
1845
+ constructor(_container: HTMLElement);
1846
+ get onFileDrop(): Observable<File[]>;
1847
+ destroy(): void;
1848
+ }
1849
+
1850
+ declare class OverlayAddon implements ITerminalAddon {
1851
+ private terminal;
1852
+ private overlayNode;
1853
+ private overlayTimeout?;
1854
+ constructor();
1855
+ activate(terminal: Terminal): void;
1856
+ dispose(): void;
1857
+ showOverlay(msg: string, timeout?: number): void;
1858
+ }
1859
+
1860
+ declare const getCliNameArt: (cols: number) => string;
1861
+ /** @deprecated Use getCliNameArt(cols) instead */
1862
+ declare const CLi_Name_Art = "\n ____ _ _ _ _____ _ _____\n / __ \\ | | | (_) / ____| | |_ _|\n | | | | ___ __| | __ _| |_ ___ | | | | | |\n | | | |/ _ \\ / _` |/ _` | | / __| | | | | | |\n | |__| | (_) | (_| | (_| | | \\__ \\ | |____| |____ _| |_\n \\___\\_\\\\___/ \\__,_|\\__,_|_|_|___/ \\_____|______|_____|\n";
1863
+ declare const hotkeysInfo: {
1864
+ key: string;
1865
+ description: string;
1866
+ }[];
1867
+
1868
+ declare class CliKeyValueStore implements ICliKeyValueStore {
1869
+ private dbName;
1870
+ private storeName;
1871
+ private db;
1872
+ constructor();
1873
+ /**
1874
+ * Initializes the IndexedDB instance.
1875
+ */
1876
+ initialize(): Promise<void>;
1877
+ /**
1878
+ * Retrieves a value by key.
1879
+ * @param key - The key to retrieve the value for.
1880
+ * @returns A promise resolving to the value or undefined if not found.
1881
+ */
1882
+ get<T = any>(key: string): Promise<T | undefined>;
1883
+ /**
1884
+ * Sets a key-value pair in the store.
1885
+ * @param key - The key to set.
1886
+ * @param value - The value to store.
1887
+ * @returns A promise resolving when the value is stored.
1888
+ */
1889
+ set(key: string, value: any): Promise<void>;
1890
+ /**
1891
+ * Removes a key-value pair by key.
1892
+ * @param key - The key to remove.
1893
+ * @returns A promise resolving when the key is removed.
1894
+ */
1895
+ remove(key: string): Promise<void>;
1896
+ /**
1897
+ * Clears all key-value pairs from the store.
1898
+ * @returns A promise resolving when the store is cleared.
1899
+ */
1900
+ clear(): Promise<void>;
1901
+ }
1902
+
1903
+ declare class CliStateStore implements ICliStateStore {
1904
+ private readonly services;
1905
+ readonly name: string;
1906
+ private readonly initialState;
1907
+ private state$;
1908
+ private storageKey;
1909
+ constructor(services: ICliServiceProvider, name: string, initialState: CliState);
1910
+ getState<T extends CliState = CliState>(): T;
1911
+ updateState(newState: Partial<CliState>): void;
1912
+ select<K>(selector: (state: CliState) => K): Observable<K>;
1913
+ subscribe(callback: (state: CliState) => void): Subscription;
1914
+ reset(): void;
1915
+ persist(): Promise<void>;
1916
+ initialize(): Promise<void>;
1917
+ }
1918
+
1919
+ interface CliEngineOptions extends CliOptions {
1920
+ terminalOptions?: Partial<ITerminalOptions & ITerminalInitOnlyOptions>;
1921
+ /** Optional snapshot to restore on start() */
1922
+ snapshot?: CliEngineSnapshot;
1923
+ }
1924
+ declare class CliEngine {
1925
+ private readonly container;
1926
+ private readonly options?;
1927
+ private terminal;
1928
+ private fitAddon;
1929
+ private serializeAddon;
1930
+ private executionContext;
1931
+ private registry;
1932
+ private userModules;
1933
+ private pendingServices;
1934
+ private resizeObserver?;
1935
+ private resizeListener?;
1936
+ private wheelListener?;
1937
+ private resizeVersion;
1938
+ private resizeScheduled;
1939
+ private bootService?;
1940
+ private dragDropService?;
1941
+ constructor(container: HTMLElement, options?: CliEngineOptions | undefined);
1942
+ /**
1943
+ * Register a CLI module to be loaded on start().
1944
+ */
1945
+ registerModule(module: ICliModule): void;
1946
+ /**
1947
+ * Register multiple CLI modules to be loaded on start().
1948
+ */
1949
+ registerModules(modules: ICliModule[]): void;
1950
+ /**
1951
+ * Register a command processor to be loaded on start().
1952
+ * @deprecated Use registerModule() instead.
1953
+ */
1954
+ registerProcessor(processor: ICliCommandProcessor): void;
1955
+ /**
1956
+ * Register multiple command processors to be loaded on start().
1957
+ * @deprecated Use registerModule() instead.
1958
+ */
1959
+ registerProcessors(processors: ICliCommandProcessor[]): void;
1960
+ /**
1961
+ * Register a service to be available in the service container.
1962
+ * Must be called before start().
1963
+ * @deprecated Use registerModule() with services instead.
1964
+ */
1965
+ registerService(token: string, value: any): void;
1966
+ /**
1967
+ * Initialize the terminal, wire up services, boot modules, and show welcome message.
1968
+ */
1969
+ start(): Promise<void>;
1970
+ /**
1971
+ * Clean up terminal and event listeners.
1972
+ */
1973
+ destroy(): void;
1974
+ /**
1975
+ * Focus the terminal and fit to container.
1976
+ */
1977
+ focus(): void;
1978
+ /**
1979
+ * Get the underlying xterm.js Terminal instance.
1980
+ */
1981
+ getTerminal(): Terminal;
1982
+ /**
1983
+ * Get the execution context.
1984
+ */
1985
+ getContext(): CliExecutionContext;
1986
+ /**
1987
+ * Get the command processor registry.
1988
+ */
1989
+ getRegistry(): CliCommandProcessorRegistry;
1990
+ /**
1991
+ * Execute a command programmatically.
1992
+ */
1993
+ execute(command: string): Promise<void>;
1994
+ /**
1995
+ * Capture a snapshot of the current engine state.
1996
+ * Can only be called after start().
1997
+ */
1998
+ snapshot(): CliEngineSnapshot;
1999
+ /**
2000
+ * Restore engine state from a snapshot.
2001
+ * Note: If the target terminal has different dimensions than the snapshot
2002
+ * source, the restored content may reflow differently.
2003
+ */
2004
+ private restoreSnapshot;
2005
+ private getTerminalOptions;
2006
+ private initializeTerminal;
2007
+ private handleResize;
2008
+ /**
2009
+ * Call fitAddon.fit() only when the container has non-zero dimensions.
2010
+ * Prevents xterm from reflowing to minimal columns when the container
2011
+ * is hidden (e.g., via [hidden] or display:none on an ancestor).
2012
+ */
2013
+ private safeFit;
2014
+ /**
2015
+ * Chain write callbacks until the resize version stabilises.
2016
+ * Only the very last callback (version match) applies the fix,
2017
+ * so intermediate resize events cannot leave stale artefacts.
2018
+ */
2019
+ private deferResizeFix;
2020
+ /**
2021
+ * Wait until the container element has non-zero dimensions.
2022
+ * xterm.js requires the host element to be laid out before open() is called.
2023
+ */
2024
+ private waitForLayout;
2025
+ }
2026
+
2027
+ declare class CliServerConnection {
2028
+ private readonly _config;
2029
+ private readonly _backgroundServices?;
2030
+ private _connected;
2031
+ private _commands;
2032
+ private _capabilities;
2033
+ private _eventSocket;
2034
+ onDisconnect?: () => void;
2035
+ constructor(_config: CliServerConfig, _backgroundServices?: ICliBackgroundServiceRegistry | undefined);
2036
+ get config(): CliServerConfig;
2037
+ get connected(): boolean;
2038
+ get commands(): CliServerCommandDescriptor[];
2039
+ get capabilities(): CliServerCapabilities | null;
2040
+ connect(): Promise<void>;
2041
+ disconnect(): void;
2042
+ fetchCommands(): Promise<CliServerCommandDescriptor[]>;
2043
+ fetchCapabilities(): Promise<CliServerCapabilities | null>;
2044
+ execute(command: CliProcessCommand): Promise<CliServerResponse>;
2045
+ ping(): Promise<boolean>;
2046
+ private connectEventSocket;
2047
+ private connectEventSocketDirect;
2048
+ private handleServerDisconnect;
2049
+ private closeEventSocket;
2050
+ private closeEventSocketDirect;
2051
+ private httpFetch;
2052
+ private normalizeUrl;
2053
+ private toWebSocketUrl;
2054
+ }
2055
+
2056
+ /**
2057
+ * Execute a command on a specific server connection and render the response.
2058
+ * Shared by both single-proxy and multi-proxy processors.
2059
+ */
2060
+ declare function executeOnServer(connection: CliServerConnection, serverName: string, descriptor: CliServerCommandDescriptor, command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
2061
+ /**
2062
+ * Render a CliServerResponse to the terminal.
2063
+ */
2064
+ declare function renderServerResponse(response: CliServerResponse, context: ICliExecutionContext): void;
2065
+ declare class CliServerProxyProcessor implements ICliCommandProcessor {
2066
+ private readonly connection;
2067
+ private readonly descriptor;
2068
+ private readonly serverName;
2069
+ command: string;
2070
+ aliases?: string[];
2071
+ description?: string;
2072
+ version?: string;
2073
+ metadata?: CliProcessorMetadata;
2074
+ parameters?: ICliCommandParameterDescriptor[];
2075
+ processors?: ICliCommandProcessor[];
2076
+ constructor(connection: CliServerConnection, descriptor: CliServerCommandDescriptor, serverName: string);
2077
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
2078
+ }
2079
+
2080
+ interface MultiProxyEntry {
2081
+ serverName: string;
2082
+ connection: CliServerConnection;
2083
+ descriptor: CliServerCommandDescriptor;
2084
+ }
2085
+ interface DefaultServerProvider {
2086
+ readonly defaultServer: string | null;
2087
+ }
2088
+ /**
2089
+ * Proxy processor registered as a bare alias when the same command
2090
+ * exists on multiple connected servers. Dispatches to the default
2091
+ * server when one is set, prompts the user otherwise, and falls back
2092
+ * to the next reachable server when the preferred one is down.
2093
+ */
2094
+ declare class CliServerMultiProxyProcessor implements ICliCommandProcessor {
2095
+ private readonly entries;
2096
+ private readonly provider;
2097
+ command: string;
2098
+ description?: string;
2099
+ metadata?: CliProcessorMetadata;
2100
+ parameters?: ICliCommandParameterDescriptor[];
2101
+ processors?: ICliCommandProcessor[];
2102
+ constructor(entries: MultiProxyEntry[], provider: DefaultServerProvider);
2103
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
2104
+ }
2105
+
2106
+ declare const CliServerManager_TOKEN = "cli-server-manager";
2107
+ declare class CliServerManager implements DefaultServerProvider {
2108
+ private readonly registry;
2109
+ readonly connections: Map<string, CliServerConnection>;
2110
+ private _logger?;
2111
+ private _defaultServer;
2112
+ private _backgroundServices?;
2113
+ constructor(registry: ICliCommandProcessorRegistry);
2114
+ get defaultServer(): string | null;
2115
+ setDefaultServer(name: string | null): void;
2116
+ connectAll(servers: CliServerConfig[], logger?: {
2117
+ warn(msg: string): void;
2118
+ info(msg: string): void;
2119
+ }, backgroundServices?: ICliBackgroundServiceRegistry): Promise<void>;
2120
+ reconnect(name: string): Promise<{
2121
+ success: boolean;
2122
+ commandCount: number;
2123
+ }>;
2124
+ getConnection(name: string): CliServerConnection | undefined;
2125
+ private handleDisconnect;
2126
+ private unregisterServerProcessors;
2127
+ private unregisterBareAliases;
2128
+ private registerProxyProcessors;
2129
+ private registerBareAliases;
2130
+ }
2131
+
2132
+ declare function createServerModule(): ICliModule;
2133
+
2134
+ declare class CliServerCommandProcessor implements ICliCommandProcessor {
2135
+ command: string;
2136
+ description: string;
2137
+ metadata: {
2138
+ icon: CliIcon;
2139
+ module: string;
2140
+ sealed: boolean;
2141
+ };
2142
+ processors: ICliCommandChildProcessor[];
2143
+ processCommand(_command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
2144
+ }
2145
+
2146
+ declare class CliSshCommandProcessor implements ICliCommandProcessor {
2147
+ command: string;
2148
+ description: string;
2149
+ acceptsRawInput: boolean;
2150
+ valueRequired: boolean;
2151
+ metadata: CliProcessorMetadata;
2152
+ parameters?: ICliCommandParameterDescriptor[];
2153
+ private socket;
2154
+ private context;
2155
+ processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
2156
+ onData(data: string, context: ICliExecutionContext): Promise<void>;
2157
+ onResize(cols: number, rows: number, _context: ICliExecutionContext): void;
2158
+ onDispose(_context: ICliExecutionContext): void;
2159
+ private resolveServer;
2160
+ private executeInteractive;
2161
+ private executeOneShot;
2162
+ private buildShellUrl;
2163
+ private cleanup;
2164
+ }
2165
+
2166
+ /**
2167
+ * Result of executing a command through the test harness.
2168
+ */
2169
+ interface CliTestResult {
2170
+ /** All stdout-equivalent lines (write, writeln, writeJson, etc.) */
2171
+ stdout: string[];
2172
+ /** All stderr-equivalent lines (writeError, writeWarning) */
2173
+ stderr: string[];
2174
+ /** The full stdout joined with newlines */
2175
+ output: string;
2176
+ /** The exit code of the last command (0 = success) */
2177
+ exitCode: number | undefined;
2178
+ /** Pipeline data produced by process.output() or auto-captured */
2179
+ data: any;
2180
+ /** Captured table outputs from writeTable() calls */
2181
+ tables: {
2182
+ headers: string[];
2183
+ rows: string[][];
2184
+ }[];
2185
+ /** Captured list outputs from writeList() calls */
2186
+ lists: string[][];
2187
+ }
2188
+ /**
2189
+ * A headless CLI test harness that enables integration testing of the full
2190
+ * command execution pipeline without xterm.js or DOM dependencies.
2191
+ *
2192
+ * Usage:
2193
+ * ```typescript
2194
+ * const harness = new CliTestHarness();
2195
+ * harness.registerProcessor(new MyProcessor());
2196
+ * const result = await harness.execute('mycommand --flag value');
2197
+ * expect(result.output).toContain('expected text');
2198
+ * ```
2199
+ *
2200
+ * For pipes:
2201
+ * ```typescript
2202
+ * const result = await harness.execute('echo hello world | grep hello');
2203
+ * expect(result.output).toContain('hello world');
2204
+ * ```
2205
+ */
2206
+ declare class CliTestHarness {
2207
+ readonly registry: CliCommandProcessorRegistry;
2208
+ readonly executor: CliCommandExecutor;
2209
+ readonly services: CliServiceContainer;
2210
+ private readonly stateStoreManager;
2211
+ private readonly processRegistry;
2212
+ /** Current user session — set via setUserSession() */
2213
+ userSession?: ICliUserSession;
2214
+ /** Reader responses — set via setReaderResponses() for interactive commands */
2215
+ private readerResponses;
2216
+ constructor();
2217
+ /**
2218
+ * Register a service in the test container.
2219
+ */
2220
+ registerService(token: any, value: any): void;
2221
+ /**
2222
+ * Register a command processor. If the processor has an `initialize()`
2223
+ * method, it will be called with a context wired to the harness services.
2224
+ */
2225
+ registerProcessor(processor: ICliCommandProcessor): void;
2226
+ /**
2227
+ * Register multiple command processors.
2228
+ */
2229
+ registerProcessors(processors: ICliCommandProcessor[]): void;
2230
+ /**
2231
+ * Initialize all registered processors that have an `initialize()` method.
2232
+ * Call this after registering all services and processors.
2233
+ */
2234
+ initializeProcessors(): Promise<void>;
2235
+ /**
2236
+ * Set the active user session. Commands that check `context.userSession`
2237
+ * will see this session.
2238
+ */
2239
+ setUserSession(session: ICliUserSession): void;
2240
+ /**
2241
+ * Queue reader responses for interactive prompts (readLine, readPassword, etc.).
2242
+ * Responses are consumed in order.
2243
+ */
2244
+ setReaderResponses(...responses: any[]): void;
2245
+ /**
2246
+ * Execute a command string through the full parsing → execution → piping pipeline.
2247
+ * Returns captured stdout, stderr, exit code, and pipeline data.
2248
+ */
2249
+ execute(command: string): Promise<CliTestResult>;
2250
+ private createContext;
2251
+ }
2252
+
2253
+ interface ICliWasmAccelerator {
2254
+ /** Search for needle starting from (startRow, startCol). Returns [row, col] or [-1, -1]. */
2255
+ textSearch(text: string, needle: string, startRow: number, startCol: number, caseSensitive: boolean, wrap: boolean): [number, number];
2256
+ /** Replace all occurrences. Returns { count, text }. */
2257
+ textReplaceAll(text: string, needle: string, replacement: string, caseSensitive: boolean): {
2258
+ count: number;
2259
+ text: string;
2260
+ };
2261
+ /** Filter candidates by prefix (case-insensitive), return sorted matches. */
2262
+ prefixMatch(candidates: string[], prefix: string): string[];
2263
+ /** Longest common prefix of the given strings. */
2264
+ commonPrefix(strings: string[]): string;
2265
+ }
2266
+
2267
+ /**
2268
+ * Pure-JS implementation of ICliWasmAccelerator.
2269
+ * Used as the fallback when the WASM module is not available.
2270
+ */
2271
+ declare class JsFallbackAccelerator implements ICliWasmAccelerator {
2272
+ textSearch(text: string, needle: string, startRow: number, startCol: number, caseSensitive: boolean, wrap: boolean): [number, number];
2273
+ textReplaceAll(text: string, needle: string, replacement: string, caseSensitive: boolean): {
2274
+ count: number;
2275
+ text: string;
2276
+ };
2277
+ prefixMatch(candidates: string[], prefix: string): string[];
2278
+ commonPrefix(strings: string[]): string;
2279
+ }
2280
+
2281
+ /**
2282
+ * Attempt to load the WASM accelerator module.
2283
+ * Searches for the .wasm binary at common asset paths.
2284
+ * Falls back silently to JsFallbackAccelerator on failure.
2285
+ * Safe to call multiple times — only the first call performs the load.
2286
+ *
2287
+ * @param wasmUrl Optional explicit URL to the .wasm binary.
2288
+ */
2289
+ declare function initWasmAccelerator(wasmUrl?: string): Promise<ICliWasmAccelerator>;
2290
+ /**
2291
+ * Synchronously return the cached accelerator.
2292
+ * If not yet initialized, creates a JsFallbackAccelerator immediately.
2293
+ * Intended for use in hot paths where async loading is not acceptable.
2294
+ */
2295
+ declare function getAccelerator(): ICliWasmAccelerator;
2296
+ /**
2297
+ * Returns true if the WASM accelerator was loaded successfully.
2298
+ * Returns false if using the JS fallback.
2299
+ */
2300
+ declare function isWasmAccelerated(): boolean;
2301
+
2302
+ export { API_VERSION, type ActiveInputRequest, type ActiveInputRequestType, CLi_Name_Art, CapturingTerminalWriter, type CdnSourceName, CliAliasCommandProcessor, CliArgsParser, CliBackgroundServiceRegistry_TOKEN, CliBase64CommandProcessor, CliBoot, CliCalCommandProcessor, CliCaptureCommandProcessor, CliClearCommandProcessor, CliClipboard, CliClipboardCommandProcessor, CliColorCommandProcessor, CliCommandExecutionContext, CliCommandExecutor, CliCommandHistory, CliCommandHistory_TOKEN, CliCommandProcessorRegistry, CliConfigureCommandProcessor, CliConvertCommandProcessor, CliDebugCommandProcessor, CliDefaultPingServerService, CliDiffCommandProcessor, CliDragDropService, CliEchoCommandProcessor, CliEngine, type CliEngineOptions, CliEnvCommandProcessor, CliEnvironment, CliEvalCommandProcessor, CliExecutionContext, type CliExecutionContextDeps, CliExecutionProcess, CliExportCommandProcessor, CliFeedbackCommandProcessor, CliFontSizeCommandProcessor, CliHashCommandProcessor, CliHelpCommandProcessor, CliHexCommandProcessor, CliHistoryCommandProcessor, CliHotKeysCommandProcessor, CliInputReader, type CliInputReaderHost, CliJsonCommandProcessor, CliJwtCommandProcessor, CliKeyValueStore, CliKillCommandProcessor, CliLogger, CliLoremCommandProcessor, CliModuleRegistry_TOKEN, CliNanoCommandProcessor, CliOpenCommandProcessor, CliPackageManagerService, CliPackageManagerService_TOKEN, CliPackagesCommandProcessor, CliPingCommandProcessor, CliProcessRegistry, CliProcessRegistry_TOKEN, CliProcessorsRegistry_TOKEN, CliPsCommandProcessor, CliRandomCommandProcessor, CliScreenCommandProcessor, CliSeqCommandProcessor, CliServerCommandProcessor, CliServerConnection, CliServerManager, CliServerManager_TOKEN, CliServerMultiProxyProcessor, CliServerProxyProcessor, CliServiceContainer, CliServicesCommandProcessor, CliSleepCommandProcessor, CliSnippetCommandProcessor, CliSshCommandProcessor, CliStateStore, CliStateStoreManager, CliStateStoreManager_TOKEN, CliTerminalProgressBar, CliTerminalSpinner, CliTerminalTextAnimator, CliTerminalWriter, CliTestHarness, type CliTestResult, CliThemeCommandProcessor, CliTimeCommandProcessor, CliTimestampCommandProcessor, CliUnAliasCommandProcessor, CliUnameCommandProcessor, CliUnsetCommandProcessor, CliUptimeCommandProcessor, CliUrlCommandProcessor, CliVersionCommandProcessor, type CliWelcomeMessageConfig, CliYesCommandProcessor, CommandParser, type CommandParserOutput, type CommandPart, type ConfigureState, type DefaultServerProvider, type DiffLine, type DiffType, type ICliEnvironment, ICliEnvironment_TOKEN, type ICliExecutionHost, ICliPingServerService_TOKEN, type ICliStateStoreManager, type ICliWasmAccelerator, JsFallbackAccelerator, LIBRARY_VERSION, type MultiProxyEntry, OverlayAddon, type ParsedArg, type ParsedToken, ProcessExitedError, ScriptLoaderService, type ThemeState, builtinProcessors, computeDiff, contextGlobalParameter, createServerModule, executeOnServer, formatDiff, getAccelerator, getCliNameArt, getGreetingBasedOnTime, groupBy, helpGlobalParameter, hotkeysInfo, initWasmAccelerator, isWasmAccelerated, miscProcessors, openLink, reconcileArgs, renderServerResponse, systemProcessors, themeInfos, themes, versionGlobalParameter, welcomeModule };