@qodalis/cli 2.0.0-beta.12 → 2.0.0-beta.14
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/assets/cli-panel.css +78 -1
- package/package.json +2 -2
- package/public-api.d.mts +195 -22
- package/public-api.d.ts +195 -22
- package/public-api.js +1027 -453
- package/public-api.js.map +1 -1
- package/public-api.mjs +1023 -455
- package/public-api.mjs.map +1 -1
- package/wasm/qodalis_cli_wasm_bg.wasm +0 -0
package/assets/cli-panel.css
CHANGED
|
@@ -873,10 +873,25 @@
|
|
|
873
873
|
}
|
|
874
874
|
|
|
875
875
|
.cli-panel-status-item.status-text {
|
|
876
|
-
color: var(--cli-panel-accent, #818cf8);
|
|
877
876
|
max-width: 200px;
|
|
878
877
|
}
|
|
879
878
|
|
|
879
|
+
.cli-panel-status-item.status-text.level-info {
|
|
880
|
+
color: var(--cli-panel-accent, #818cf8);
|
|
881
|
+
}
|
|
882
|
+
|
|
883
|
+
.cli-panel-status-item.status-text.level-success {
|
|
884
|
+
color: var(--cli-status-idle, #3fb950);
|
|
885
|
+
}
|
|
886
|
+
|
|
887
|
+
.cli-panel-status-item.status-text.level-warn {
|
|
888
|
+
color: var(--cli-status-running, #f0883e);
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
.cli-panel-status-item.status-text.level-error {
|
|
892
|
+
color: var(--cli-status-error, #f85149);
|
|
893
|
+
}
|
|
894
|
+
|
|
880
895
|
.cli-panel-status-item.status-running {
|
|
881
896
|
color: var(--cli-status-running, #f0883e);
|
|
882
897
|
}
|
|
@@ -893,6 +908,68 @@
|
|
|
893
908
|
background-color: var(--cli-btn-hover-bg, rgba(129, 140, 248, 0.12));
|
|
894
909
|
}
|
|
895
910
|
|
|
911
|
+
/* ─── Compact status indicators (vertical positions) ───── */
|
|
912
|
+
|
|
913
|
+
.cli-panel-status-indicators-compact {
|
|
914
|
+
display: none;
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
.cli-panel-wrapper[data-position="left"] .cli-panel-status-indicators-compact,
|
|
918
|
+
.cli-panel-wrapper[data-position="right"] .cli-panel-status-indicators-compact {
|
|
919
|
+
display: flex;
|
|
920
|
+
flex-direction: column;
|
|
921
|
+
align-items: center;
|
|
922
|
+
gap: 10px;
|
|
923
|
+
padding: 12px 0;
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
.cli-panel-status-compact-item {
|
|
927
|
+
display: flex;
|
|
928
|
+
align-items: center;
|
|
929
|
+
justify-content: center;
|
|
930
|
+
width: 20px;
|
|
931
|
+
height: 20px;
|
|
932
|
+
cursor: default;
|
|
933
|
+
color: var(--cli-panel-text-secondary, rgba(255, 255, 255, 0.6));
|
|
934
|
+
font-size: 12px;
|
|
935
|
+
}
|
|
936
|
+
|
|
937
|
+
.cli-panel-status-compact-item.status-clickable {
|
|
938
|
+
cursor: pointer;
|
|
939
|
+
border-radius: 4px;
|
|
940
|
+
}
|
|
941
|
+
|
|
942
|
+
.cli-panel-status-compact-item.status-clickable:hover {
|
|
943
|
+
background-color: var(--cli-btn-hover-bg, rgba(129, 140, 248, 0.12));
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
.cli-panel-status-compact-item.status-muted {
|
|
947
|
+
color: var(--cli-panel-text-secondary, rgba(255, 255, 255, 0.4));
|
|
948
|
+
}
|
|
949
|
+
|
|
950
|
+
.cli-panel-status-compact-dot {
|
|
951
|
+
width: 6px;
|
|
952
|
+
height: 6px;
|
|
953
|
+
border-radius: 50%;
|
|
954
|
+
flex-shrink: 0;
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
.cli-panel-status-compact-dot.level-info {
|
|
958
|
+
background: var(--cli-panel-accent, #818cf8);
|
|
959
|
+
}
|
|
960
|
+
|
|
961
|
+
.cli-panel-status-compact-dot.level-success {
|
|
962
|
+
background: var(--cli-status-idle, #3fb950);
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
.cli-panel-status-compact-dot.level-warn {
|
|
966
|
+
background: var(--cli-status-running, #f0883e);
|
|
967
|
+
}
|
|
968
|
+
|
|
969
|
+
.cli-panel-status-compact-dot.level-error {
|
|
970
|
+
background: var(--cli-status-error, #f85149);
|
|
971
|
+
}
|
|
972
|
+
|
|
896
973
|
/* ─── Tab dot ────────────────────────────────────────────── */
|
|
897
974
|
|
|
898
975
|
.cli-panel-tab-dot {
|
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.14",
|
|
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.14",
|
|
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,7 +1,8 @@
|
|
|
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, ICliCompletionProvider, ICliFilePickerProvider, CliFullScreenOptions, ICliProcessRegistry, ICliBackgroundService, ICliServiceContext, ICliBackgroundServiceInfo, ICliServiceLogEntry, CliServiceEventHandler, ICliGlobalParameterHandler, CliForegroundColor, CliBackgroundColor, CliProvider, CliTableOptions, CliLogLevel, CliPercentageProgressBarUpdateValueOptions, CliTextAnimatorOptions, ICliModule, CliModuleRegistry, Package, ICliPingServerService, CliLineOptions, CliSelectOption, CliSelectOptions, CliMultiSelectOption, CliMultiSelectOptions, CliNumberOptions, CliDateOptions, CliFilePickerOptions, CliFileResult, ICliProcessRegisterOptions, ICliProcessEntry, ICliDragDropService, CliState, CliEngineSnapshot, CliServerConfig, CliServerCommandDescriptor, CliServerCapabilities, CliServerResponse, CliServerOutput, CliIcon } 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, ICliHttpClient, ICliNotifier, ICliManagedInterval, ICliManagedTimer, ICliKeyValueStore, ICliCompletionProvider, ICliFilePickerProvider, CliFullScreenOptions, ICliProcessRegistry, ICliBackgroundService, ICliServiceContext, ICliBackgroundServiceInfo, ICliServiceLogEntry, CliServiceEventHandler, ICliGlobalParameterHandler, CliForegroundColor, CliBackgroundColor, CliProvider, CliTableOptions, CliLogLevel, CliPercentageProgressBarUpdateValueOptions, CliTextAnimatorOptions, ICliModule, CliModuleRegistry, Package, ICliPingServerService, CliLineOptions, CliSelectOption, CliSelectOptions, CliMultiSelectOption, CliMultiSelectOptions, CliNumberOptions, CliDateOptions, CliFilePickerOptions, CliFileResult, ICliProcessRegisterOptions, ICliProcessEntry, ICliDragDropService, CliHttpRequestOptions, CliNotification, ICliPermissionRegistry, CliPermissionDefinition, CliState, CliEngineSnapshot, CliServerConfig, ICliServerAuthService, CliServerCommandDescriptor, CliServerCapabilities, CliServerResponse, CliServerOutput, 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
|
+
import * as rxjs from 'rxjs';
|
|
5
6
|
import { Subject, Observable, Subscription } from 'rxjs';
|
|
6
7
|
import { FitAddon } from '@xterm/addon-fit';
|
|
7
8
|
import { SerializeAddon } from '@xterm/addon-serialize';
|
|
@@ -141,8 +142,18 @@ declare const CliBackgroundServiceRegistry_TOKEN = "cli-background-service-regis
|
|
|
141
142
|
* Used as a key in the service provider to retrieve the package manager.
|
|
142
143
|
*/
|
|
143
144
|
declare const CliPackageManagerService_TOKEN = "cli-package-manager-service";
|
|
145
|
+
/**
|
|
146
|
+
* Framework-agnostic token for the CLI key-value store.
|
|
147
|
+
* Used as a key in the service provider to retrieve the persistent storage.
|
|
148
|
+
*/
|
|
149
|
+
declare const CliKeyValueStore_TOKEN = "cli-key-value-store";
|
|
150
|
+
/**
|
|
151
|
+
* Framework-agnostic token for the syntax highlighter registry.
|
|
152
|
+
* Used as a key in the service provider to retrieve the syntax highlighter registry.
|
|
153
|
+
*/
|
|
154
|
+
declare const SyntaxHighlighterRegistry_TOKEN = "syntax-highlighter-registry";
|
|
144
155
|
|
|
145
|
-
declare const LIBRARY_VERSION = "2.0.0-beta.
|
|
156
|
+
declare const LIBRARY_VERSION = "2.0.0-beta.14";
|
|
146
157
|
declare const API_VERSION = 2;
|
|
147
158
|
|
|
148
159
|
declare class CliAliasCommandProcessor implements ICliCommandProcessor {
|
|
@@ -152,7 +163,11 @@ declare class CliAliasCommandProcessor implements ICliCommandProcessor {
|
|
|
152
163
|
processors?: ICliCommandProcessor[] | undefined;
|
|
153
164
|
metadata?: CliProcessorMetadata | undefined;
|
|
154
165
|
stateConfiguration?: CliStateConfiguration | undefined;
|
|
166
|
+
/** Shared aliases (used when no auth module is loaded) */
|
|
155
167
|
userAliases: Record<string, string>;
|
|
168
|
+
private aliasState;
|
|
169
|
+
/** Aliases visible to the current principal */
|
|
170
|
+
aliasesFor(context: Pick<ICliExecutionContext, 'services'>): Record<string, string>;
|
|
156
171
|
private stateSubscription?;
|
|
157
172
|
constructor();
|
|
158
173
|
writeDescription(context: ICliExecutionContext): void;
|
|
@@ -910,9 +925,8 @@ declare class CliCommandExecutionContext implements ICliExecutionContext {
|
|
|
910
925
|
translator: ICliTranslationService;
|
|
911
926
|
reader: ICliInputReader;
|
|
912
927
|
readonly backgroundServices: ICliBackgroundServiceRegistry;
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
getStatusText(): string | undefined;
|
|
928
|
+
http: ICliHttpClient;
|
|
929
|
+
notifier: ICliNotifier;
|
|
916
930
|
get promptLength(): number;
|
|
917
931
|
set promptLength(value: number);
|
|
918
932
|
get currentLine(): string;
|
|
@@ -1114,6 +1128,11 @@ interface InputModeHost {
|
|
|
1114
1128
|
interface PromptOptions {
|
|
1115
1129
|
userName?: string;
|
|
1116
1130
|
hideUserName?: boolean;
|
|
1131
|
+
/**
|
|
1132
|
+
* Shown (dimmed) instead of the user name when an auth module is loaded
|
|
1133
|
+
* but nobody is signed in, e.g. `anonymous:/$`. Empty/undefined: nothing.
|
|
1134
|
+
*/
|
|
1135
|
+
anonymousName?: string;
|
|
1117
1136
|
contextProcessor?: string;
|
|
1118
1137
|
pathProvider?: () => string | null;
|
|
1119
1138
|
}
|
|
@@ -1193,6 +1212,8 @@ declare class CliExecutionContext implements ICliExecutionContext, InputModeHost
|
|
|
1193
1212
|
readonly services: ICliServiceProvider;
|
|
1194
1213
|
readonly translator: ICliTranslationService;
|
|
1195
1214
|
readonly backgroundServices: ICliBackgroundServiceRegistry;
|
|
1215
|
+
http: ICliHttpClient;
|
|
1216
|
+
readonly notifier: ICliNotifier;
|
|
1196
1217
|
promptPathProvider?: () => string | null;
|
|
1197
1218
|
readonly completionEngine: CliCompletionEngine;
|
|
1198
1219
|
promptLength: number;
|
|
@@ -1210,11 +1231,6 @@ declare class CliExecutionContext implements ICliExecutionContext, InputModeHost
|
|
|
1210
1231
|
* Set by the command executor at start/end of executeCommand().
|
|
1211
1232
|
*/
|
|
1212
1233
|
isExecuting: boolean;
|
|
1213
|
-
private _statusText?;
|
|
1214
|
-
readonly statusTextChange$: Subject<string | undefined>;
|
|
1215
|
-
setStatusText(text: string): void;
|
|
1216
|
-
clearStatusText(): void;
|
|
1217
|
-
getStatusText(): string | undefined;
|
|
1218
1234
|
readonly lineBuffer: CliLineBuffer;
|
|
1219
1235
|
readonly lineRenderer: CliTerminalLineRenderer;
|
|
1220
1236
|
readonly commandHistory: CliCommandHistory;
|
|
@@ -1412,6 +1428,14 @@ declare class CliCommandExecutor implements ICliCommandExecutorService {
|
|
|
1412
1428
|
* parameter. In that case the global handler must be skipped so the
|
|
1413
1429
|
* processor can handle the flag itself.
|
|
1414
1430
|
*/
|
|
1431
|
+
/**
|
|
1432
|
+
* Runs all registered {@link ICliCommandGuard}s that apply to this command,
|
|
1433
|
+
* in priority order. Returns the block message of the first guard that
|
|
1434
|
+
* denies the command, or `undefined` when every guard allows it.
|
|
1435
|
+
* A guard that throws is treated as a denial (fail closed).
|
|
1436
|
+
*/
|
|
1437
|
+
private runGuards;
|
|
1438
|
+
private guardDenial;
|
|
1415
1439
|
private processorOwnsParameter;
|
|
1416
1440
|
}
|
|
1417
1441
|
|
|
@@ -1557,18 +1581,58 @@ declare function expandEnvironmentVars(command: string, context: ICliExecutionCo
|
|
|
1557
1581
|
* and `get()` returns an array of resolved values.
|
|
1558
1582
|
*/
|
|
1559
1583
|
declare class CliServiceContainer implements ICliServiceProvider {
|
|
1560
|
-
/** Stores single-value providers (resolved
|
|
1584
|
+
/** Stores single-value providers (resolved singletons). */
|
|
1561
1585
|
private readonly services;
|
|
1562
1586
|
/** Stores multi-provider arrays. */
|
|
1563
1587
|
private readonly multiServices;
|
|
1588
|
+
/** Tokens that cannot be overwritten by subsequent `set()` calls. */
|
|
1589
|
+
private readonly sealedTokens;
|
|
1590
|
+
/** Stores provider recipes for transient tokens (re-resolved on every get). */
|
|
1591
|
+
private readonly transientRecipes;
|
|
1564
1592
|
/**
|
|
1565
1593
|
* Retrieve a service by its token.
|
|
1594
|
+
* Returns `undefined` when no provider is registered for the token.
|
|
1595
|
+
* For multi-provider tokens, returns the last registered value (use `getAll` for the full array).
|
|
1596
|
+
*
|
|
1597
|
+
* @param token The token used to register the service.
|
|
1598
|
+
* @returns The resolved service instance, or `undefined` if not registered.
|
|
1599
|
+
*/
|
|
1600
|
+
get<T>(token: any): T | undefined;
|
|
1601
|
+
/**
|
|
1602
|
+
* Retrieve all registered services for a multi-provider token.
|
|
1603
|
+
* Returns an empty array when no provider is registered for the token.
|
|
1604
|
+
*
|
|
1605
|
+
* @param token The token used to register the service.
|
|
1606
|
+
* @returns Array of all resolved service instances.
|
|
1607
|
+
*/
|
|
1608
|
+
getAll<T>(token: any): T[];
|
|
1609
|
+
/**
|
|
1610
|
+
* Retrieve a service by its token, throwing if not registered.
|
|
1611
|
+
* Use this when the service is required and its absence is a programming error.
|
|
1612
|
+
* For multi-provider tokens, returns the last registered value (use `getAll` for the full array).
|
|
1566
1613
|
*
|
|
1567
1614
|
* @param token The token used to register the service.
|
|
1568
|
-
* @returns The resolved service instance
|
|
1615
|
+
* @returns The resolved service instance.
|
|
1569
1616
|
* @throws Error if the token has not been registered.
|
|
1570
1617
|
*/
|
|
1571
|
-
|
|
1618
|
+
getRequired<T>(token: any): T;
|
|
1619
|
+
/**
|
|
1620
|
+
* Check whether a service is registered for the given token.
|
|
1621
|
+
*/
|
|
1622
|
+
has(token: any): boolean;
|
|
1623
|
+
/**
|
|
1624
|
+
* Mark a token as sealed so it cannot be overwritten by future `set()` calls.
|
|
1625
|
+
* Only available on the concrete container — not exposed on `ICliServiceProvider`.
|
|
1626
|
+
*/
|
|
1627
|
+
seal(token: any): void;
|
|
1628
|
+
/**
|
|
1629
|
+
* Mark multiple tokens as sealed at once.
|
|
1630
|
+
*/
|
|
1631
|
+
sealAll(tokens: any[]): void;
|
|
1632
|
+
/**
|
|
1633
|
+
* Check whether a token is sealed.
|
|
1634
|
+
*/
|
|
1635
|
+
isSealed(token: any): boolean;
|
|
1572
1636
|
/**
|
|
1573
1637
|
* Register one or more providers.
|
|
1574
1638
|
*
|
|
@@ -1587,6 +1651,10 @@ declare class CliServiceContainer implements ICliServiceProvider {
|
|
|
1587
1651
|
type: string;
|
|
1588
1652
|
multi: boolean;
|
|
1589
1653
|
}[];
|
|
1654
|
+
/**
|
|
1655
|
+
* Convert a token to a human-readable string for diagnostics/errors.
|
|
1656
|
+
*/
|
|
1657
|
+
private tokenToString;
|
|
1590
1658
|
/**
|
|
1591
1659
|
* Describe a resolved value for diagnostic display.
|
|
1592
1660
|
*/
|
|
@@ -1597,6 +1665,9 @@ declare class CliServiceContainer implements ICliServiceProvider {
|
|
|
1597
1665
|
private registerProvider;
|
|
1598
1666
|
/**
|
|
1599
1667
|
* Resolve a provider definition to a concrete value.
|
|
1668
|
+
*
|
|
1669
|
+
* Note: `deps` are resolved eagerly at registration time, so
|
|
1670
|
+
* dependency tokens must be registered before the provider that needs them.
|
|
1600
1671
|
*/
|
|
1601
1672
|
private resolveProvider;
|
|
1602
1673
|
}
|
|
@@ -1750,6 +1821,13 @@ declare class CliBoot {
|
|
|
1750
1821
|
getModuleRegistry(): CliModuleRegistry;
|
|
1751
1822
|
boot(context: CliExecutionContext, modules: ICliModule[]): Promise<void>;
|
|
1752
1823
|
private bootModule;
|
|
1824
|
+
/**
|
|
1825
|
+
* Sub-processors of an `extendsProcessor` processor are merged into the
|
|
1826
|
+
* processor it extends, so they belong to that one: re-parent them so they
|
|
1827
|
+
* inherit its access rules (`requiredPermissions` etc.) and help/root
|
|
1828
|
+
* lookups resolve to the registered processor.
|
|
1829
|
+
*/
|
|
1830
|
+
private adoptMergedSubProcessors;
|
|
1753
1831
|
private buildCoreModule;
|
|
1754
1832
|
/**
|
|
1755
1833
|
* Topologically sort modules by their dependencies using DFS.
|
|
@@ -1971,6 +2049,57 @@ declare class CliDragDropService implements ICliDragDropService {
|
|
|
1971
2049
|
destroy(): void;
|
|
1972
2050
|
}
|
|
1973
2051
|
|
|
2052
|
+
/**
|
|
2053
|
+
* Default HTTP client implementation.
|
|
2054
|
+
*
|
|
2055
|
+
* Wraps the global `fetch()` and automatically merges an abort signal
|
|
2056
|
+
* so that in-flight requests are cancelled when the user presses Ctrl+C.
|
|
2057
|
+
*
|
|
2058
|
+
* Created per-command by the executor — each instance is bound to the
|
|
2059
|
+
* command's own AbortSignal.
|
|
2060
|
+
*/
|
|
2061
|
+
declare class CliHttpClient implements ICliHttpClient {
|
|
2062
|
+
private readonly signal?;
|
|
2063
|
+
constructor(signal?: AbortSignal | undefined);
|
|
2064
|
+
fetch(url: string, init?: RequestInit): Promise<Response>;
|
|
2065
|
+
get<T = any>(url: string, options?: CliHttpRequestOptions): Promise<T>;
|
|
2066
|
+
post<T = any>(url: string, body?: any, options?: CliHttpRequestOptions): Promise<T>;
|
|
2067
|
+
put<T = any>(url: string, body?: any, options?: CliHttpRequestOptions): Promise<T>;
|
|
2068
|
+
patch<T = any>(url: string, body?: any, options?: CliHttpRequestOptions): Promise<T>;
|
|
2069
|
+
delete<T = any>(url: string, options?: CliHttpRequestOptions): Promise<T>;
|
|
2070
|
+
head(url: string, options?: CliHttpRequestOptions): Promise<Response>;
|
|
2071
|
+
options<T = any>(url: string, options?: CliHttpRequestOptions): Promise<T>;
|
|
2072
|
+
private jsonRequest;
|
|
2073
|
+
private isRawBody;
|
|
2074
|
+
/**
|
|
2075
|
+
* Merge the command signal with any additional signals (caller, timeout).
|
|
2076
|
+
* Uses AbortSignal.any() when available, falls back to a manual composite
|
|
2077
|
+
* controller for older browsers (pre-Chrome 116 / Safari 17.4).
|
|
2078
|
+
*/
|
|
2079
|
+
private mergeSignal;
|
|
2080
|
+
}
|
|
2081
|
+
|
|
2082
|
+
declare class CliNotifier implements ICliNotifier {
|
|
2083
|
+
private _current;
|
|
2084
|
+
private readonly _change$;
|
|
2085
|
+
readonly change$: rxjs.Observable<CliNotification | undefined>;
|
|
2086
|
+
get current(): CliNotification | undefined;
|
|
2087
|
+
info(message: string): void;
|
|
2088
|
+
success(message: string): void;
|
|
2089
|
+
warn(message: string): void;
|
|
2090
|
+
error(message: string): void;
|
|
2091
|
+
clear(): void;
|
|
2092
|
+
private set;
|
|
2093
|
+
}
|
|
2094
|
+
|
|
2095
|
+
/** Default {@link ICliPermissionRegistry}: permissions declared by modules. */
|
|
2096
|
+
declare class CliPermissionRegistry implements ICliPermissionRegistry {
|
|
2097
|
+
private readonly definitions;
|
|
2098
|
+
register(definitions: CliPermissionDefinition[], module?: string): void;
|
|
2099
|
+
list(): CliPermissionDefinition[];
|
|
2100
|
+
get(name: string): CliPermissionDefinition | undefined;
|
|
2101
|
+
}
|
|
2102
|
+
|
|
1974
2103
|
declare class OverlayAddon implements ITerminalAddon {
|
|
1975
2104
|
private terminal;
|
|
1976
2105
|
private overlayNode;
|
|
@@ -2049,6 +2178,12 @@ interface CliEngineOptions extends CliOptions {
|
|
|
2049
2178
|
terminalOptions?: Partial<ITerminalOptions & ITerminalInitOnlyOptions>;
|
|
2050
2179
|
/** Optional snapshot to restore on start() */
|
|
2051
2180
|
snapshot?: CliEngineSnapshot;
|
|
2181
|
+
/**
|
|
2182
|
+
* Explicit URL of `qodalis_cli_wasm_bg.wasm` (optional accelerator). When
|
|
2183
|
+
* omitted it is looked up next to the page (`document.baseURI`), then at
|
|
2184
|
+
* `/assets/wasm/` and `/wasm/`; the CLI works without it.
|
|
2185
|
+
*/
|
|
2186
|
+
wasmUrl?: string;
|
|
2052
2187
|
}
|
|
2053
2188
|
declare class CliEngine {
|
|
2054
2189
|
private readonly container;
|
|
@@ -2218,6 +2353,7 @@ declare class CliServerConnection {
|
|
|
2218
2353
|
private readonly _config;
|
|
2219
2354
|
private readonly _backgroundServices?;
|
|
2220
2355
|
private readonly _logger?;
|
|
2356
|
+
private readonly _authService?;
|
|
2221
2357
|
private _connected;
|
|
2222
2358
|
private _commands;
|
|
2223
2359
|
private _capabilities;
|
|
@@ -2226,6 +2362,8 @@ declare class CliServerConnection {
|
|
|
2226
2362
|
private _basePath;
|
|
2227
2363
|
private _wsReconnectAttempts;
|
|
2228
2364
|
private _wsReconnectTimer;
|
|
2365
|
+
/** True once this connection registered its `server-events:<name>` background service */
|
|
2366
|
+
private _eventServiceRegistered;
|
|
2229
2367
|
private static readonly WS_MAX_RECONNECT_ATTEMPTS;
|
|
2230
2368
|
private static readonly WS_MAX_RECONNECT_DELAY_MS;
|
|
2231
2369
|
private _healthCheckTimer;
|
|
@@ -2234,12 +2372,23 @@ declare class CliServerConnection {
|
|
|
2234
2372
|
private static readonly HEALTH_CHECK_MAX_ATTEMPTS;
|
|
2235
2373
|
onDisconnect?: () => void;
|
|
2236
2374
|
onReconnected?: () => void;
|
|
2237
|
-
constructor(_config: CliServerConfig, _backgroundServices?: ICliBackgroundServiceRegistry | undefined, _logger?: ICliLogger | undefined);
|
|
2375
|
+
constructor(_config: CliServerConfig, _backgroundServices?: ICliBackgroundServiceRegistry | undefined, _logger?: ICliLogger | undefined, _authService?: ICliServerAuthService | undefined);
|
|
2238
2376
|
get config(): CliServerConfig;
|
|
2239
2377
|
get connected(): boolean;
|
|
2240
2378
|
get commands(): CliServerCommandDescriptor[];
|
|
2241
2379
|
get capabilities(): CliServerCapabilities | null;
|
|
2242
2380
|
get apiVersion(): number;
|
|
2381
|
+
/**
|
|
2382
|
+
* Resolve auth headers for this server connection.
|
|
2383
|
+
* Uses the auth service (which merges config headers with registered
|
|
2384
|
+
* ICliServerAuthTokenProviders), or falls back to config headers directly.
|
|
2385
|
+
*/
|
|
2386
|
+
resolveAuthHeaders(): Record<string, string>;
|
|
2387
|
+
/**
|
|
2388
|
+
* WebSocket URL for this server with auth: single-use upgrade params from
|
|
2389
|
+
* auth providers when available, otherwise headers copied into the URL.
|
|
2390
|
+
*/
|
|
2391
|
+
buildWebSocketUrl(path: string): Promise<string>;
|
|
2243
2392
|
connect(): Promise<void>;
|
|
2244
2393
|
disconnect(): void;
|
|
2245
2394
|
startHealthCheck(): void;
|
|
@@ -2254,6 +2403,13 @@ declare class CliServerConnection {
|
|
|
2254
2403
|
ping(): Promise<boolean>;
|
|
2255
2404
|
private connectEventSocket;
|
|
2256
2405
|
private connectEventSocketDirect;
|
|
2406
|
+
private connectEventSocketDirectAsync;
|
|
2407
|
+
/**
|
|
2408
|
+
* The server closes the event socket with 4401 when the session behind it
|
|
2409
|
+
* ended (logout, revoke, expiry). Retrying with the same credentials cannot
|
|
2410
|
+
* succeed; the auth layer reconnects the server when the session changes.
|
|
2411
|
+
*/
|
|
2412
|
+
private isSessionEndedClose;
|
|
2257
2413
|
private handleServerDisconnect;
|
|
2258
2414
|
private closeEventSocket;
|
|
2259
2415
|
private closeEventSocketDirect;
|
|
@@ -2288,6 +2444,7 @@ declare class CliServerProxyProcessor implements ICliCommandProcessor {
|
|
|
2288
2444
|
metadata?: CliProcessorMetadata;
|
|
2289
2445
|
parameters?: ICliCommandParameterDescriptor[];
|
|
2290
2446
|
processors?: ICliCommandProcessor[];
|
|
2447
|
+
acceptsRawInput?: boolean;
|
|
2291
2448
|
/** Full command path from root to this processor (e.g. ["aws", "lambda", "list"]) */
|
|
2292
2449
|
private readonly commandPath;
|
|
2293
2450
|
constructor(connection: CliServerConnection, descriptor: CliServerCommandDescriptor, serverName: string, isNested?: boolean, parentPath?: string[]);
|
|
@@ -2316,6 +2473,7 @@ declare class CliServerMultiProxyProcessor implements ICliCommandProcessor {
|
|
|
2316
2473
|
metadata?: CliProcessorMetadata;
|
|
2317
2474
|
parameters?: ICliCommandParameterDescriptor[];
|
|
2318
2475
|
processors?: ICliCommandProcessor[];
|
|
2476
|
+
acceptsRawInput?: boolean;
|
|
2319
2477
|
/** Full command path from root to this processor */
|
|
2320
2478
|
private readonly commandPath;
|
|
2321
2479
|
constructor(entries: MultiProxyEntry[], provider: DefaultServerProvider, parentPath?: string[]);
|
|
@@ -2325,13 +2483,17 @@ declare class CliServerMultiProxyProcessor implements ICliCommandProcessor {
|
|
|
2325
2483
|
declare const CliServerManager_TOKEN = "cli-server-manager";
|
|
2326
2484
|
declare class CliServerManager implements DefaultServerProvider {
|
|
2327
2485
|
private readonly registry;
|
|
2486
|
+
private readonly authService?;
|
|
2328
2487
|
readonly connections: Map<string, CliServerConnection>;
|
|
2329
2488
|
private _logger?;
|
|
2330
2489
|
private _cliLogger?;
|
|
2331
2490
|
private _defaultServer;
|
|
2491
|
+
/** Bare-name aliases this manager registered (only these are ever removed) */
|
|
2492
|
+
private readonly _bareAliases;
|
|
2332
2493
|
private _backgroundServices?;
|
|
2333
|
-
constructor(registry: ICliCommandProcessorRegistry);
|
|
2494
|
+
constructor(registry: ICliCommandProcessorRegistry, authService?: ICliServerAuthService | undefined);
|
|
2334
2495
|
get defaultServer(): string | null;
|
|
2496
|
+
preferredServer(): string | null;
|
|
2335
2497
|
setDefaultServer(name: string | null): void;
|
|
2336
2498
|
connectAll(servers: CliServerConfig[], logger?: {
|
|
2337
2499
|
warn(msg: string): void;
|
|
@@ -2370,19 +2532,24 @@ declare class CliSshCommandProcessor implements ICliCommandProcessor {
|
|
|
2370
2532
|
valueRequired: boolean;
|
|
2371
2533
|
metadata: CliProcessorMetadata;
|
|
2372
2534
|
parameters?: ICliCommandParameterDescriptor[];
|
|
2373
|
-
private socket;
|
|
2374
|
-
private context;
|
|
2375
|
-
private resolved;
|
|
2376
2535
|
processCommand(command: CliProcessCommand, context: ICliExecutionContext): Promise<void>;
|
|
2377
|
-
|
|
2378
|
-
|
|
2379
|
-
|
|
2536
|
+
/**
|
|
2537
|
+
* Full-screen handler for one session: input, resize and disposal go to
|
|
2538
|
+
* that session's socket only.
|
|
2539
|
+
*/
|
|
2540
|
+
private fullScreenHandler;
|
|
2380
2541
|
private resolveServer;
|
|
2381
2542
|
private executeInteractive;
|
|
2382
2543
|
private executeOneShot;
|
|
2544
|
+
/** `ssh <server> <cmd...>` → `<cmd...>` exactly as typed */
|
|
2545
|
+
private remoteCommandFromRaw;
|
|
2383
2546
|
private buildShellUrl;
|
|
2384
2547
|
private cleanup;
|
|
2385
2548
|
}
|
|
2549
|
+
declare function describeShellClose(event: {
|
|
2550
|
+
code?: number;
|
|
2551
|
+
reason?: string;
|
|
2552
|
+
}, serverName: string): string | null;
|
|
2386
2553
|
|
|
2387
2554
|
/**
|
|
2388
2555
|
* Result of executing a command through the test harness.
|
|
@@ -2434,7 +2601,13 @@ declare class CliTestHarness {
|
|
|
2434
2601
|
userSession?: ICliUserSession;
|
|
2435
2602
|
/** Reader responses — set via setReaderResponses() for interactive commands */
|
|
2436
2603
|
private readerResponses;
|
|
2604
|
+
private userSessionProvider?;
|
|
2437
2605
|
constructor();
|
|
2606
|
+
/**
|
|
2607
|
+
* Resolve `context.userSession` on every command from this function
|
|
2608
|
+
* (e.g. a session service), instead of the value set via setUserSession().
|
|
2609
|
+
*/
|
|
2610
|
+
setUserSessionProvider(provider: () => ICliUserSession | undefined): void;
|
|
2438
2611
|
/**
|
|
2439
2612
|
* Register a service in the test container.
|
|
2440
2613
|
*/
|
|
@@ -2527,4 +2700,4 @@ declare function getAccelerator(): ICliWasmAccelerator;
|
|
|
2527
2700
|
*/
|
|
2528
2701
|
declare function isWasmAccelerated(): boolean;
|
|
2529
2702
|
|
|
2530
|
-
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, CliFullScreenManager, 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, CliTimerManager, 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, type InitializeServicesOptions, type InitializeServicesResult, JsFallbackAccelerator, LIBRARY_VERSION, type MultiProxyEntry, OverlayAddon, type ParsedArg, type ParsedToken, ProcessExitedError, ScriptLoaderService, type TerminalSetupResult, type ThemeState, appendOutputToFile, appendStderrToFile, builtinProcessors, computeDiff, contextGlobalParameter, createServerModule, executeOnServer, expandEnvironmentVars, formatDiff, getAccelerator, getCliNameArt, getGreetingBasedOnTime, getTerminalOptions, groupBy, helpGlobalParameter, hotkeysInfo, initWasmAccelerator, initializeServices, initializeTerminal, isWasmAccelerated, miscProcessors, openLink, reconcileArgs, renderServerResponse, renderSingleOutput, substituteVars, systemProcessors, themeInfos, themes, tryExecuteScript, versionGlobalParameter, waitForLayout, welcomeModule, writeOutputToFile, writeStderrToFile };
|
|
2703
|
+
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, CliFullScreenManager, CliHelpCommandProcessor, CliHistoryCommandProcessor, CliHotKeysCommandProcessor, CliHtopCommandProcessor, CliHttpClient, CliInputReader, CliJsonCommandProcessor, CliKeyValueStore, CliKeyValueStore_TOKEN, CliKillCommandProcessor, CliLogger, CliLoremCommandProcessor, CliModuleRegistry_TOKEN, CliNanoCommandProcessor, CliNotifier, CliOpenCommandProcessor, CliPackageManagerService, CliPackageManagerService_TOKEN, CliPackagesCommandProcessor, CliPermissionRegistry, 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, CliTimerManager, 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, type InitializeServicesOptions, type InitializeServicesResult, JsFallbackAccelerator, LIBRARY_VERSION, type MultiProxyEntry, OverlayAddon, type ParsedArg, type ParsedToken, ProcessExitedError, ScriptLoaderService, SyntaxHighlighterRegistry_TOKEN, type TerminalSetupResult, type ThemeState, appendOutputToFile, appendStderrToFile, builtinProcessors, computeDiff, contextGlobalParameter, createServerModule, describeShellClose, executeOnServer, expandEnvironmentVars, formatDiff, getAccelerator, getCliNameArt, getGreetingBasedOnTime, getTerminalOptions, groupBy, helpGlobalParameter, hotkeysInfo, initWasmAccelerator, initializeServices, initializeTerminal, isWasmAccelerated, miscProcessors, openLink, reconcileArgs, renderServerResponse, renderSingleOutput, substituteVars, systemProcessors, themeInfos, themes, tryExecuteScript, versionGlobalParameter, waitForLayout, welcomeModule, writeOutputToFile, writeStderrToFile };
|