@qodalis/cli 2.0.0-beta.7 → 2.0.0-beta.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +2 -2
- package/public-api.d.mts +142 -83
- package/public-api.d.ts +142 -83
- package/public-api.js +3393 -964
- package/public-api.js.map +1 -1
- package/public-api.mjs +3385 -957
- package/public-api.mjs.map +1 -1
- package/wasm/qodalis_cli_wasm_bg.wasm +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qodalis/cli",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.9",
|
|
4
4
|
"description": "Framework-agnostic CLI engine for @qodalis terminal applications.",
|
|
5
5
|
"author": "Nicolae Lupei, Qodalis Solutions",
|
|
6
6
|
"license": "MIT",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
"./assets/*": "./assets/*"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@qodalis/cli-core": "2.0.0-beta.
|
|
33
|
+
"@qodalis/cli-core": "2.0.0-beta.9",
|
|
34
34
|
"@xterm/xterm": "^5.5.0",
|
|
35
35
|
"@xterm/addon-fit": "^0.10.0",
|
|
36
36
|
"@xterm/addon-web-links": "^0.11.0",
|
package/public-api.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
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,
|
|
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, ICliCompletionProvider, ICliFilePickerProvider, ICliGlobalParameterHandler, CliProvider, CliForegroundColor, CliBackgroundColor, CliLogLevel, CliPercentageProgressBarUpdateValueOptions, CliTextAnimatorOptions, ICliModule, CliModuleRegistry, Package, ICliPingServerService, CliLineOptions, CliSelectOption, CliSelectOptions, CliMultiSelectOption, CliMultiSelectOptions, CliNumberOptions, CliDateOptions, CliFilePickerOptions, CliFileResult, ICliProcessRegistry, ICliProcessRegisterOptions, ICliProcessEntry, ICliDragDropService, CliState, CliEngineSnapshot, CliServerConfig, CliServerCommandDescriptor, CliServerCapabilities, CliServerResponse, CliIcon } from '@qodalis/cli-core';
|
|
3
3
|
export { ICliUserSessionService_TOKEN, ICliUsersStoreService_TOKEN } from '@qodalis/cli-core';
|
|
4
4
|
import { ITheme, Terminal, ITerminalAddon, ITerminalOptions, ITerminalInitOnlyOptions } from '@xterm/xterm';
|
|
5
5
|
import { Subject, Observable, Subscription } from 'rxjs';
|
|
@@ -140,7 +140,7 @@ declare const CliBackgroundServiceRegistry_TOKEN = "cli-background-service-regis
|
|
|
140
140
|
*/
|
|
141
141
|
declare const CliPackageManagerService_TOKEN = "cli-package-manager-service";
|
|
142
142
|
|
|
143
|
-
declare const LIBRARY_VERSION = "2.0.0-beta.
|
|
143
|
+
declare const LIBRARY_VERSION = "2.0.0-beta.9";
|
|
144
144
|
declare const API_VERSION = 2;
|
|
145
145
|
|
|
146
146
|
declare class CliAliasCommandProcessor implements ICliCommandProcessor {
|
|
@@ -406,7 +406,6 @@ declare class CliUptimeCommandProcessor implements ICliCommandProcessor {
|
|
|
406
406
|
description: string;
|
|
407
407
|
author: _qodalis_cli_core.ICliCommandAuthor;
|
|
408
408
|
metadata?: CliProcessorMetadata;
|
|
409
|
-
private sessionStartTimes;
|
|
410
409
|
initialize(context: ICliExecutionContext): Promise<void>;
|
|
411
410
|
processCommand(_: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
|
|
412
411
|
writeDescription(context: ICliExecutionContext): void;
|
|
@@ -600,6 +599,7 @@ declare class CliNanoCommandProcessor implements ICliCommandProcessor {
|
|
|
600
599
|
processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
|
|
601
600
|
onData(data: string, context: ICliExecutionContext): Promise<void>;
|
|
602
601
|
writeDescription(context: ICliExecutionContext): void;
|
|
602
|
+
private setupHighlighting;
|
|
603
603
|
private render;
|
|
604
604
|
private renderPrompt;
|
|
605
605
|
private showStatus;
|
|
@@ -649,6 +649,43 @@ declare class CliKillCommandProcessor implements ICliCommandProcessor {
|
|
|
649
649
|
processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
|
|
650
650
|
}
|
|
651
651
|
|
|
652
|
+
declare class CliHtopCommandProcessor implements ICliCommandProcessor {
|
|
653
|
+
command: string;
|
|
654
|
+
description: string;
|
|
655
|
+
author: _qodalis_cli_core.ICliCommandAuthor;
|
|
656
|
+
metadata?: CliProcessorMetadata;
|
|
657
|
+
private context;
|
|
658
|
+
private registry;
|
|
659
|
+
private refreshTimer;
|
|
660
|
+
private rows;
|
|
661
|
+
private selectedIndex;
|
|
662
|
+
private scrollOffset;
|
|
663
|
+
private termCols;
|
|
664
|
+
private termRows;
|
|
665
|
+
private showingLogs;
|
|
666
|
+
private errorMessage;
|
|
667
|
+
private errorTimeout;
|
|
668
|
+
processCommand(_command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
|
|
669
|
+
onData(data: string, context: ICliExecutionContext): Promise<void>;
|
|
670
|
+
onResize(cols: number, rows: number, _context: ICliExecutionContext): void;
|
|
671
|
+
onDispose(_context: ICliExecutionContext): void;
|
|
672
|
+
writeDescription(context: ICliExecutionContext): void;
|
|
673
|
+
private refreshData;
|
|
674
|
+
private actionKill;
|
|
675
|
+
private actionStart;
|
|
676
|
+
private actionStop;
|
|
677
|
+
private actionRestart;
|
|
678
|
+
private actionLogs;
|
|
679
|
+
private moveSelection;
|
|
680
|
+
private get visibleRows();
|
|
681
|
+
private clampScroll;
|
|
682
|
+
private render;
|
|
683
|
+
private buildFooter;
|
|
684
|
+
private renderLogsOverlay;
|
|
685
|
+
private showError;
|
|
686
|
+
private exit;
|
|
687
|
+
}
|
|
688
|
+
|
|
652
689
|
declare const systemProcessors: ICliCommandProcessor[];
|
|
653
690
|
|
|
654
691
|
declare class CliThemeCommandProcessor implements ICliCommandProcessor {
|
|
@@ -947,53 +984,11 @@ declare class CliStateStoreManager implements ICliStateStoreManager {
|
|
|
947
984
|
name: string;
|
|
948
985
|
state: Record<string, any>;
|
|
949
986
|
}[];
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
promptText: string;
|
|
956
|
-
resolve: (value: any) => void;
|
|
957
|
-
buffer: string;
|
|
958
|
-
cursorPosition: number;
|
|
959
|
-
defaultValue?: boolean;
|
|
960
|
-
options?: CliSelectOption[];
|
|
961
|
-
selectedIndex?: number;
|
|
962
|
-
onChange?: (value: string) => void;
|
|
963
|
-
checkedIndices?: Set<number>;
|
|
964
|
-
numberOptions?: {
|
|
965
|
-
min?: number;
|
|
966
|
-
max?: number;
|
|
967
|
-
default?: number;
|
|
968
|
-
};
|
|
969
|
-
scrollOffset?: number;
|
|
970
|
-
maxVisible?: number;
|
|
971
|
-
displayLines?: number;
|
|
972
|
-
}
|
|
973
|
-
interface CliInputReaderHost {
|
|
974
|
-
readonly activeInputRequest: ActiveInputRequest | null;
|
|
975
|
-
setActiveInputRequest(request: ActiveInputRequest | null): void;
|
|
976
|
-
writeToTerminal(text: string): void;
|
|
977
|
-
getTerminalRows?(): number;
|
|
978
|
-
}
|
|
979
|
-
declare class CliInputReader implements ICliInputReader {
|
|
980
|
-
private readonly host;
|
|
981
|
-
constructor(host: CliInputReaderHost);
|
|
982
|
-
readLine(prompt: string): Promise<string | null>;
|
|
983
|
-
readPassword(prompt: string): Promise<string | null>;
|
|
984
|
-
readConfirm(prompt: string, defaultValue?: boolean): Promise<boolean | null>;
|
|
985
|
-
readSelect(prompt: string, options: CliSelectOption[], onChange?: (value: string) => void): Promise<string | null>;
|
|
986
|
-
readSelectInline(prompt: string, options: CliSelectOption[], onChange?: (value: string) => void): Promise<string | null>;
|
|
987
|
-
readMultiSelect(prompt: string, options: CliMultiSelectOption[]): Promise<string[] | null>;
|
|
988
|
-
readNumber(prompt: string, options?: {
|
|
989
|
-
min?: number;
|
|
990
|
-
max?: number;
|
|
991
|
-
default?: number;
|
|
992
|
-
}): Promise<number | null>;
|
|
993
|
-
renderSelectOptions(options: CliSelectOption[], selectedIndex: number, scrollOffset?: number, maxVisible?: number): number;
|
|
994
|
-
renderInlineSelectOptions(options: CliSelectOption[], selectedIndex: number): string;
|
|
995
|
-
renderMultiSelectOptions(options: CliSelectOption[], selectedIndex: number, checkedIndices: Set<number>, scrollOffset?: number, maxVisible?: number): number;
|
|
996
|
-
private createInputRequest;
|
|
987
|
+
/**
|
|
988
|
+
* Dispose all stores (completes their BehaviorSubjects).
|
|
989
|
+
* Called during engine teardown.
|
|
990
|
+
*/
|
|
991
|
+
dispose(): void;
|
|
997
992
|
}
|
|
998
993
|
|
|
999
994
|
/**
|
|
@@ -1042,7 +1037,7 @@ declare class CliCompletionEngine {
|
|
|
1042
1037
|
/**
|
|
1043
1038
|
* Reusable text buffer with cursor management.
|
|
1044
1039
|
* Eliminates duplicated line-editing logic across CommandLineMode,
|
|
1045
|
-
*
|
|
1040
|
+
* LineInputMode, and any future input mode.
|
|
1046
1041
|
*/
|
|
1047
1042
|
declare class CliLineBuffer {
|
|
1048
1043
|
private _text;
|
|
@@ -1086,6 +1081,28 @@ interface IInputMode {
|
|
|
1086
1081
|
* Called when this mode is no longer the active input mode.
|
|
1087
1082
|
*/
|
|
1088
1083
|
deactivate?(): void;
|
|
1084
|
+
/** Called when the terminal is resized while this mode is active. */
|
|
1085
|
+
onResize?(cols: number, rows: number): void;
|
|
1086
|
+
}
|
|
1087
|
+
/**
|
|
1088
|
+
* Host interface for input modes. Provides access to terminal I/O,
|
|
1089
|
+
* dimensions, and mode stack management.
|
|
1090
|
+
*/
|
|
1091
|
+
interface InputModeHost {
|
|
1092
|
+
/** Write raw text/ANSI to the terminal */
|
|
1093
|
+
writeToTerminal(text: string): void;
|
|
1094
|
+
/** Get terminal row count for scroll window sizing */
|
|
1095
|
+
getTerminalRows(): number;
|
|
1096
|
+
/** Get terminal column count for overflow calculations */
|
|
1097
|
+
getTerminalCols(): number;
|
|
1098
|
+
/** Push a mode onto the input mode stack */
|
|
1099
|
+
pushMode(mode: IInputMode): void;
|
|
1100
|
+
/** Pop the current mode from the input mode stack */
|
|
1101
|
+
popMode(): void;
|
|
1102
|
+
/** The xterm.js Terminal instance (for direct write when needed) */
|
|
1103
|
+
readonly terminal: Terminal;
|
|
1104
|
+
/** File picker provider for the current environment */
|
|
1105
|
+
readonly filePickerProvider: ICliFilePickerProvider;
|
|
1089
1106
|
}
|
|
1090
1107
|
|
|
1091
1108
|
interface PromptOptions {
|
|
@@ -1145,16 +1162,6 @@ interface CommandLineModeHost {
|
|
|
1145
1162
|
}): void;
|
|
1146
1163
|
}
|
|
1147
1164
|
|
|
1148
|
-
/**
|
|
1149
|
-
* Host interface for ReaderMode — provides access to the active input request.
|
|
1150
|
-
*/
|
|
1151
|
-
interface ReaderModeHost {
|
|
1152
|
-
readonly terminal: Terminal;
|
|
1153
|
-
getActiveInputRequest(): ActiveInputRequest | null;
|
|
1154
|
-
setActiveInputRequest(request: ActiveInputRequest | null): void;
|
|
1155
|
-
popMode(): void;
|
|
1156
|
-
}
|
|
1157
|
-
|
|
1158
1165
|
interface CliExecutionContextDeps {
|
|
1159
1166
|
services: ICliServiceProvider;
|
|
1160
1167
|
logger: ICliLogger;
|
|
@@ -1162,7 +1169,7 @@ interface CliExecutionContextDeps {
|
|
|
1162
1169
|
stateStoreManager: CliStateStoreManager;
|
|
1163
1170
|
translator: ICliTranslationService;
|
|
1164
1171
|
}
|
|
1165
|
-
declare class CliExecutionContext implements ICliExecutionContext,
|
|
1172
|
+
declare class CliExecutionContext implements ICliExecutionContext, InputModeHost, CommandLineModeHost {
|
|
1166
1173
|
terminal: Terminal;
|
|
1167
1174
|
executor: ICliCommandExecutorService;
|
|
1168
1175
|
userSession?: ICliUserSession;
|
|
@@ -1187,20 +1194,16 @@ declare class CliExecutionContext implements ICliExecutionContext, CliInputReade
|
|
|
1187
1194
|
readonly lineBuffer: CliLineBuffer;
|
|
1188
1195
|
readonly lineRenderer: CliTerminalLineRenderer;
|
|
1189
1196
|
readonly commandHistory: CliCommandHistory;
|
|
1190
|
-
|
|
1197
|
+
readonly filePickerProvider: ICliFilePickerProvider;
|
|
1191
1198
|
private readonly modeStack;
|
|
1199
|
+
private readonly stateStoreManager;
|
|
1192
1200
|
private readonly managedTimers;
|
|
1193
1201
|
private resizeDisposable;
|
|
1202
|
+
private windowKeydownListener?;
|
|
1194
1203
|
constructor(deps: CliExecutionContextDeps, terminal: Terminal, executor: ICliCommandExecutorService, cliOptions?: CliOptions);
|
|
1195
|
-
get activeInputRequest(): ActiveInputRequest | null;
|
|
1196
|
-
/**
|
|
1197
|
-
* Sets the active input request. When a non-null request is provided,
|
|
1198
|
-
* pushes ReaderMode onto the mode stack. ReaderMode pops itself on
|
|
1199
|
-
* completion, so passing null here does NOT pop the mode.
|
|
1200
|
-
*/
|
|
1201
|
-
setActiveInputRequest(request: ActiveInputRequest | null): void;
|
|
1202
1204
|
writeToTerminal(text: string): void;
|
|
1203
1205
|
getTerminalRows(): number;
|
|
1206
|
+
getTerminalCols(): number;
|
|
1204
1207
|
get currentLine(): string;
|
|
1205
1208
|
get cursorPosition(): number;
|
|
1206
1209
|
set cursorPosition(value: number);
|
|
@@ -1239,7 +1242,6 @@ declare class CliExecutionContext implements ICliExecutionContext, CliInputReade
|
|
|
1239
1242
|
getPromptLength(): number;
|
|
1240
1243
|
setPromptLength(value: number): void;
|
|
1241
1244
|
getExecutionContext(): ICliExecutionContext;
|
|
1242
|
-
getActiveInputRequest(): ActiveInputRequest | null;
|
|
1243
1245
|
private clearAllManagedTimers;
|
|
1244
1246
|
/**
|
|
1245
1247
|
* Dispose all resources. Called by CliEngine.destroy() when the
|
|
@@ -1263,7 +1265,6 @@ declare class CliCommandExecutor implements ICliCommandExecutorService {
|
|
|
1263
1265
|
protected readonly registry: ICliCommandProcessorRegistry;
|
|
1264
1266
|
private commandParser;
|
|
1265
1267
|
private globalParameters;
|
|
1266
|
-
private lastCapturingWriter?;
|
|
1267
1268
|
constructor(registry: ICliCommandProcessorRegistry);
|
|
1268
1269
|
registerGlobalParameter(handler: ICliGlobalParameterHandler): void;
|
|
1269
1270
|
getGlobalParameters(): ICliCommandParameterDescriptor[];
|
|
@@ -1271,6 +1272,8 @@ declare class CliCommandExecutor implements ICliCommandExecutorService {
|
|
|
1271
1272
|
private appendOutputToFile;
|
|
1272
1273
|
private writeOutputToFile;
|
|
1273
1274
|
private executeSingleCommand;
|
|
1275
|
+
private completeProcess;
|
|
1276
|
+
private failProcess;
|
|
1274
1277
|
private writeStderrToFile;
|
|
1275
1278
|
private appendStderrToFile;
|
|
1276
1279
|
showHelp(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
|
|
@@ -1408,6 +1411,13 @@ declare class CliTerminalWriter implements ICliTerminalWriter {
|
|
|
1408
1411
|
columns?: number;
|
|
1409
1412
|
padding?: number;
|
|
1410
1413
|
}): void;
|
|
1414
|
+
writeLink(text: string, url: string): void;
|
|
1415
|
+
writeBox(content: string | string[], options?: {
|
|
1416
|
+
title?: string;
|
|
1417
|
+
borderColor?: CliForegroundColor;
|
|
1418
|
+
padding?: number;
|
|
1419
|
+
}): void;
|
|
1420
|
+
writeIndented(text: string, level?: number): void;
|
|
1411
1421
|
writeTable(headers: string[], rows: string[][]): void;
|
|
1412
1422
|
}
|
|
1413
1423
|
|
|
@@ -1471,11 +1481,6 @@ declare class CliTerminalProgressBar implements ICliPercentageProgressBar {
|
|
|
1471
1481
|
complete(): void;
|
|
1472
1482
|
setText(text: string): void;
|
|
1473
1483
|
private updateProgressBar;
|
|
1474
|
-
/**
|
|
1475
|
-
* Returns an ANSI 256-color escape for a position in the progress bar.
|
|
1476
|
-
* Gradient: red (0%) -> yellow (50%) -> green (100%).
|
|
1477
|
-
*/
|
|
1478
|
-
private progressGradientColor;
|
|
1479
1484
|
private clearCurrentLine;
|
|
1480
1485
|
private calcLineCount;
|
|
1481
1486
|
}
|
|
@@ -1514,6 +1519,7 @@ declare class CliBoot {
|
|
|
1514
1519
|
private initializing;
|
|
1515
1520
|
private readonly moduleRegistry;
|
|
1516
1521
|
private readonly bootedModules;
|
|
1522
|
+
private readonly initializedProcessors;
|
|
1517
1523
|
constructor(registry: ICliCommandProcessorRegistry, services: ICliServiceProvider);
|
|
1518
1524
|
/**
|
|
1519
1525
|
* Get the module registry for external access.
|
|
@@ -1584,6 +1590,13 @@ declare class ScriptLoaderService {
|
|
|
1584
1590
|
content?: string;
|
|
1585
1591
|
error?: any;
|
|
1586
1592
|
}>;
|
|
1593
|
+
/**
|
|
1594
|
+
* Inject an inline script into the page.
|
|
1595
|
+
*
|
|
1596
|
+
* **Security:** This runs `code` in the host page context with full
|
|
1597
|
+
* DOM access. Only call with trusted content (e.g. verified UMD bundles
|
|
1598
|
+
* loaded via the package manager). Never pass user-supplied strings.
|
|
1599
|
+
*/
|
|
1587
1600
|
injectBodyScript(code: string): void;
|
|
1588
1601
|
/**
|
|
1589
1602
|
* Returns CDN URLs for a given npm package path.
|
|
@@ -1614,14 +1627,18 @@ declare class CliPackageManagerService {
|
|
|
1614
1627
|
private readonly storageKey;
|
|
1615
1628
|
QODALIS_COMMAND_PREFIX: string;
|
|
1616
1629
|
private store;
|
|
1630
|
+
/** In-memory cache; `null` means "not yet loaded from storage". */
|
|
1631
|
+
private cache;
|
|
1632
|
+
/** Whether the one-time localStorage migration has been checked. */
|
|
1633
|
+
private migrationDone;
|
|
1617
1634
|
constructor();
|
|
1618
1635
|
/**
|
|
1619
1636
|
* Set the key-value store instance for persistence.
|
|
1620
1637
|
*/
|
|
1621
1638
|
setStore(store: ICliKeyValueStore): void;
|
|
1622
1639
|
/**
|
|
1623
|
-
* Retrieves the list of packages
|
|
1624
|
-
*
|
|
1640
|
+
* Retrieves the list of packages.
|
|
1641
|
+
* Uses an in-memory cache after the first load.
|
|
1625
1642
|
*/
|
|
1626
1643
|
getPackages(): Promise<Package[]>;
|
|
1627
1644
|
/**
|
|
@@ -1651,6 +1668,24 @@ declare class CliDefaultPingServerService implements ICliPingServerService {
|
|
|
1651
1668
|
ping(): Promise<void>;
|
|
1652
1669
|
}
|
|
1653
1670
|
|
|
1671
|
+
/**
|
|
1672
|
+
* Factory-based input reader. Creates the appropriate input mode
|
|
1673
|
+
* and pushes it onto the mode stack for each request.
|
|
1674
|
+
*/
|
|
1675
|
+
declare class CliInputReader implements ICliInputReader {
|
|
1676
|
+
private readonly host;
|
|
1677
|
+
constructor(host: InputModeHost);
|
|
1678
|
+
readLine(prompt: string, options?: CliLineOptions): Promise<string | null>;
|
|
1679
|
+
readPassword(prompt: string): Promise<string | null>;
|
|
1680
|
+
readConfirm(prompt: string, defaultValue?: boolean): Promise<boolean | null>;
|
|
1681
|
+
readSelect(prompt: string, options: CliSelectOption[], selectOptions?: CliSelectOptions): Promise<string | null>;
|
|
1682
|
+
readSelectInline(prompt: string, options: CliSelectOption[], selectOptions?: CliSelectOptions): Promise<string | null>;
|
|
1683
|
+
readMultiSelect(prompt: string, options: CliMultiSelectOption[], selectOptions?: CliMultiSelectOptions): Promise<string[] | null>;
|
|
1684
|
+
readNumber(prompt: string, options?: CliNumberOptions): Promise<number | null>;
|
|
1685
|
+
readDate(prompt: string, options?: CliDateOptions): Promise<string | null>;
|
|
1686
|
+
readFile(prompt: string, options?: CliFilePickerOptions): Promise<CliFileResult[] | null>;
|
|
1687
|
+
}
|
|
1688
|
+
|
|
1654
1689
|
/**
|
|
1655
1690
|
* A terminal writer wrapper that captures "stdout-equivalent" output
|
|
1656
1691
|
* (`write`, `writeln`, `writeJson`, `writeObjectsAsTable`, `writeTable`)
|
|
@@ -1703,6 +1738,13 @@ declare class CapturingTerminalWriter implements ICliTerminalWriter {
|
|
|
1703
1738
|
columns?: number;
|
|
1704
1739
|
padding?: number;
|
|
1705
1740
|
}): void;
|
|
1741
|
+
writeLink(text: string, url: string): void;
|
|
1742
|
+
writeBox(content: string | string[], options?: {
|
|
1743
|
+
title?: string;
|
|
1744
|
+
borderColor?: CliForegroundColor;
|
|
1745
|
+
padding?: number;
|
|
1746
|
+
}): void;
|
|
1747
|
+
writeIndented(text: string, level?: number): void;
|
|
1706
1748
|
/**
|
|
1707
1749
|
* Returns true if any stdout-equivalent output was captured.
|
|
1708
1750
|
*/
|
|
@@ -1735,7 +1777,7 @@ declare class CliProcessRegistry implements ICliProcessRegistry {
|
|
|
1735
1777
|
private _currentPid;
|
|
1736
1778
|
private maxHistory;
|
|
1737
1779
|
get currentPid(): number | undefined;
|
|
1738
|
-
register(command: string): {
|
|
1780
|
+
register(command: string, options?: ICliProcessRegisterOptions): {
|
|
1739
1781
|
pid: number;
|
|
1740
1782
|
abortController: AbortController;
|
|
1741
1783
|
};
|
|
@@ -1857,6 +1899,11 @@ declare class CliStateStore implements ICliStateStore {
|
|
|
1857
1899
|
reset(): void;
|
|
1858
1900
|
persist(): Promise<void>;
|
|
1859
1901
|
initialize(): Promise<void>;
|
|
1902
|
+
/**
|
|
1903
|
+
* Complete the BehaviorSubject so all subscribers are notified
|
|
1904
|
+
* and no further emissions occur. Called during engine teardown.
|
|
1905
|
+
*/
|
|
1906
|
+
dispose(): void;
|
|
1860
1907
|
}
|
|
1861
1908
|
|
|
1862
1909
|
interface CliEngineOptions extends CliOptions {
|
|
@@ -1960,9 +2007,12 @@ declare class CliEngine {
|
|
|
1960
2007
|
* so intermediate resize events cannot leave stale artefacts.
|
|
1961
2008
|
*/
|
|
1962
2009
|
private deferResizeFix;
|
|
2010
|
+
/** Maximum time (ms) to wait for container layout before rejecting. */
|
|
2011
|
+
private static readonly LAYOUT_TIMEOUT_MS;
|
|
1963
2012
|
/**
|
|
1964
2013
|
* Wait until the container element has non-zero dimensions.
|
|
1965
2014
|
* xterm.js requires the host element to be laid out before open() is called.
|
|
2015
|
+
* Rejects after {@link LAYOUT_TIMEOUT_MS} if the container stays hidden.
|
|
1966
2016
|
*/
|
|
1967
2017
|
private waitForLayout;
|
|
1968
2018
|
}
|
|
@@ -1970,12 +2020,13 @@ declare class CliEngine {
|
|
|
1970
2020
|
declare class CliServerConnection {
|
|
1971
2021
|
private readonly _config;
|
|
1972
2022
|
private readonly _backgroundServices?;
|
|
2023
|
+
private readonly _logger?;
|
|
1973
2024
|
private _connected;
|
|
1974
2025
|
private _commands;
|
|
1975
2026
|
private _capabilities;
|
|
1976
2027
|
private _eventSocket;
|
|
1977
2028
|
onDisconnect?: () => void;
|
|
1978
|
-
constructor(_config: CliServerConfig, _backgroundServices?: ICliBackgroundServiceRegistry | undefined);
|
|
2029
|
+
constructor(_config: CliServerConfig, _backgroundServices?: ICliBackgroundServiceRegistry | undefined, _logger?: ICliLogger | undefined);
|
|
1979
2030
|
get config(): CliServerConfig;
|
|
1980
2031
|
get connected(): boolean;
|
|
1981
2032
|
get commands(): CliServerCommandDescriptor[];
|
|
@@ -2051,6 +2102,7 @@ declare class CliServerManager implements DefaultServerProvider {
|
|
|
2051
2102
|
private readonly registry;
|
|
2052
2103
|
readonly connections: Map<string, CliServerConnection>;
|
|
2053
2104
|
private _logger?;
|
|
2105
|
+
private _cliLogger?;
|
|
2054
2106
|
private _defaultServer;
|
|
2055
2107
|
private _backgroundServices?;
|
|
2056
2108
|
constructor(registry: ICliCommandProcessorRegistry);
|
|
@@ -2059,7 +2111,7 @@ declare class CliServerManager implements DefaultServerProvider {
|
|
|
2059
2111
|
connectAll(servers: CliServerConfig[], logger?: {
|
|
2060
2112
|
warn(msg: string): void;
|
|
2061
2113
|
info(msg: string): void;
|
|
2062
|
-
}, backgroundServices?: ICliBackgroundServiceRegistry): Promise<void>;
|
|
2114
|
+
}, backgroundServices?: ICliBackgroundServiceRegistry, cliLogger?: ICliLogger): Promise<void>;
|
|
2063
2115
|
reconnect(name: string): Promise<{
|
|
2064
2116
|
success: boolean;
|
|
2065
2117
|
commandCount: number;
|
|
@@ -2205,6 +2257,10 @@ interface ICliWasmAccelerator {
|
|
|
2205
2257
|
prefixMatch(candidates: string[], prefix: string): string[];
|
|
2206
2258
|
/** Longest common prefix of the given strings. */
|
|
2207
2259
|
commonPrefix(strings: string[]): string;
|
|
2260
|
+
/** Register a named rule set for syntax highlighting tokenization. */
|
|
2261
|
+
registerRuleSet(ruleSetId: string, rules: string): void;
|
|
2262
|
+
/** Tokenize a line using a previously registered rule set. Returns newline-separated "start,end,tokenType" entries. */
|
|
2263
|
+
tokenizeLine(line: string, ruleSetId: string): string;
|
|
2208
2264
|
}
|
|
2209
2265
|
|
|
2210
2266
|
/**
|
|
@@ -2218,6 +2274,9 @@ declare class JsFallbackAccelerator implements ICliWasmAccelerator {
|
|
|
2218
2274
|
text: string;
|
|
2219
2275
|
};
|
|
2220
2276
|
prefixMatch(candidates: string[], prefix: string): string[];
|
|
2277
|
+
private ruleSets;
|
|
2278
|
+
registerRuleSet(ruleSetId: string, rules: string): void;
|
|
2279
|
+
tokenizeLine(line: string, ruleSetId: string): string;
|
|
2221
2280
|
commonPrefix(strings: string[]): string;
|
|
2222
2281
|
}
|
|
2223
2282
|
|
|
@@ -2242,4 +2301,4 @@ declare function getAccelerator(): ICliWasmAccelerator;
|
|
|
2242
2301
|
*/
|
|
2243
2302
|
declare function isWasmAccelerated(): boolean;
|
|
2244
2303
|
|
|
2245
|
-
export { API_VERSION,
|
|
2304
|
+
export { API_VERSION, CLi_Name_Art, CapturingTerminalWriter, type CdnSourceName, CliAliasCommandProcessor, CliArgsParser, CliBackgroundServiceRegistry_TOKEN, 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, CliHelpCommandProcessor, CliHistoryCommandProcessor, CliHotKeysCommandProcessor, CliHtopCommandProcessor, CliInputReader, CliJsonCommandProcessor, 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, 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 };
|