@qodalis/cli 2.4.0 → 2.4.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.
- package/assets/cli-panel.css +36 -0
- package/package.json +2 -2
- package/public-api.d.mts +25 -2
- package/public-api.d.ts +25 -2
- package/public-api.js +34 -7
- package/public-api.js.map +1 -1
- package/public-api.mjs +34 -8
- package/public-api.mjs.map +1 -1
package/assets/cli-panel.css
CHANGED
|
@@ -1283,6 +1283,42 @@
|
|
|
1283
1283
|
margin-top: 1px;
|
|
1284
1284
|
}
|
|
1285
1285
|
|
|
1286
|
+
/* Stop button of a running service: a finger-sized target on touch screens */
|
|
1287
|
+
.cli-panel-svc-stop {
|
|
1288
|
+
appearance: none;
|
|
1289
|
+
flex-shrink: 0;
|
|
1290
|
+
align-self: center;
|
|
1291
|
+
min-width: 44px;
|
|
1292
|
+
min-height: 32px;
|
|
1293
|
+
margin: -6px 0;
|
|
1294
|
+
padding: 0 10px;
|
|
1295
|
+
background: transparent;
|
|
1296
|
+
border: 1px solid var(--cli-panel-border, rgba(255, 255, 255, 0.12));
|
|
1297
|
+
border-radius: calc(var(--cli-panel-radius, 8px) - 2px);
|
|
1298
|
+
color: var(--cli-panel-text-secondary, #94a3b8);
|
|
1299
|
+
font-family: inherit;
|
|
1300
|
+
font-size: 11px;
|
|
1301
|
+
line-height: 1;
|
|
1302
|
+
cursor: pointer;
|
|
1303
|
+
touch-action: manipulation;
|
|
1304
|
+
transition:
|
|
1305
|
+
background-color 0.15s ease,
|
|
1306
|
+
border-color 0.15s ease,
|
|
1307
|
+
color 0.15s ease;
|
|
1308
|
+
}
|
|
1309
|
+
|
|
1310
|
+
.cli-panel-svc-stop:hover,
|
|
1311
|
+
.cli-panel-svc-stop:focus-visible {
|
|
1312
|
+
color: var(--cli-panel-danger, #f87171);
|
|
1313
|
+
border-color: var(--cli-panel-danger, #f87171);
|
|
1314
|
+
background-color: color-mix(in srgb, var(--cli-panel-danger, #f87171) 14%, transparent);
|
|
1315
|
+
}
|
|
1316
|
+
|
|
1317
|
+
.cli-panel-svc-stop:focus-visible {
|
|
1318
|
+
outline: 2px solid var(--cli-panel-accent, #818cf8);
|
|
1319
|
+
outline-offset: 1px;
|
|
1320
|
+
}
|
|
1321
|
+
|
|
1286
1322
|
.cli-panel-srv-meta {
|
|
1287
1323
|
display: flex;
|
|
1288
1324
|
flex-direction: column;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qodalis/cli",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.1",
|
|
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.4.
|
|
33
|
+
"@qodalis/cli-core": "2.4.1",
|
|
34
34
|
"@xterm/xterm": "^6.0.0",
|
|
35
35
|
"@xterm/addon-fit": "^0.11.0",
|
|
36
36
|
"@xterm/addon-web-links": "^0.12.0",
|
package/public-api.d.mts
CHANGED
|
@@ -165,7 +165,7 @@ declare const CliKeyValueStore_TOKEN: any;
|
|
|
165
165
|
*/
|
|
166
166
|
declare const SyntaxHighlighterRegistry_TOKEN: any;
|
|
167
167
|
|
|
168
|
-
declare const LIBRARY_VERSION = "2.4.
|
|
168
|
+
declare const LIBRARY_VERSION = "2.4.1";
|
|
169
169
|
declare const API_VERSION = 2;
|
|
170
170
|
|
|
171
171
|
declare class CliAliasCommandProcessor implements ICliCommandProcessor {
|
|
@@ -3589,6 +3589,8 @@ interface CliPanelContextMenu {
|
|
|
3589
3589
|
tabId: number;
|
|
3590
3590
|
}
|
|
3591
3591
|
interface CliPanelServiceDetail {
|
|
3592
|
+
/** Process id in the engine's process registry (`ps`), the handle of the stop button. */
|
|
3593
|
+
pid?: number;
|
|
3592
3594
|
name: string;
|
|
3593
3595
|
status: string;
|
|
3594
3596
|
description?: string;
|
|
@@ -3782,6 +3784,12 @@ declare const GLOBAL_POLL_MS = 2000;
|
|
|
3782
3784
|
declare function computeTabStatus(engines: Iterable<CliEngine>): CliPanelTabStatus;
|
|
3783
3785
|
/** Services, servers and uptime of one engine. */
|
|
3784
3786
|
declare function computeGlobalStatus(engine: CliEngine | undefined, now?: number): CliPanelGlobalStatus;
|
|
3787
|
+
/**
|
|
3788
|
+
* Kill process `pid` of the engine, as `kill <pid>` does: a background
|
|
3789
|
+
* service is stopped (and shows as killed in `ps`). False when the engine
|
|
3790
|
+
* has no process registry or no running process with that pid.
|
|
3791
|
+
*/
|
|
3792
|
+
declare function killProcess(engine: CliEngine | undefined, pid: number): boolean;
|
|
3785
3793
|
interface CliPanelStatusTrackerListener {
|
|
3786
3794
|
onTabStatus(tabId: number, status: CliPanelTabStatus): void;
|
|
3787
3795
|
onGlobalStatus(status: CliPanelGlobalStatus): void;
|
|
@@ -3803,6 +3811,8 @@ declare class CliPanelStatusTracker {
|
|
|
3803
3811
|
unregisterPane(paneId: number): void;
|
|
3804
3812
|
unregisterTab(tabId: number): void;
|
|
3805
3813
|
setActiveTab(tabId: number): void;
|
|
3814
|
+
/** The engine the global status (services, servers) is computed from: the first pane of the active tab. */
|
|
3815
|
+
get globalEngine(): CliEngine | undefined;
|
|
3806
3816
|
/** Recompute everything now. */
|
|
3807
3817
|
refresh(): void;
|
|
3808
3818
|
destroy(): void;
|
|
@@ -3916,6 +3926,12 @@ declare class CliPanelController implements ICliPanelRef<CliEngine> {
|
|
|
3916
3926
|
openContextMenu(tabId: number, x: number, y: number): void;
|
|
3917
3927
|
closeContextMenu(): void;
|
|
3918
3928
|
togglePositionDropdown(): void;
|
|
3929
|
+
/**
|
|
3930
|
+
* Stop a running background service listed in the services dropdown, as
|
|
3931
|
+
* `kill <pid>` does; the list refreshes. False when nothing was running
|
|
3932
|
+
* under that pid.
|
|
3933
|
+
*/
|
|
3934
|
+
killProcess(pid: number): boolean;
|
|
3919
3935
|
/** `anchor` is the clicked status item; the dropdown is placed next to it. */
|
|
3920
3936
|
toggleServicesDropdown(anchor?: Element | null): void;
|
|
3921
3937
|
toggleServersDropdown(anchor?: Element | null): void;
|
|
@@ -4029,6 +4045,7 @@ declare const PANEL_LABELS: {
|
|
|
4029
4045
|
readonly closePane: "Close pane";
|
|
4030
4046
|
readonly servicesHeader: "Background Services";
|
|
4031
4047
|
readonly servicesEmpty: "No services registered";
|
|
4048
|
+
readonly stopService: "Stop";
|
|
4032
4049
|
readonly serversHeader: "Server Connections";
|
|
4033
4050
|
readonly serversEmpty: "No servers configured";
|
|
4034
4051
|
};
|
|
@@ -4112,6 +4129,12 @@ interface PanelDropdownRow {
|
|
|
4112
4129
|
status: string;
|
|
4113
4130
|
/** Extra lines under the status (servers: API version, command count). */
|
|
4114
4131
|
meta: string[];
|
|
4132
|
+
/** Stop button of a running service (`controller.killProcess(pid)`); absent for stopped services and servers. */
|
|
4133
|
+
stop?: {
|
|
4134
|
+
pid: number;
|
|
4135
|
+
label: string;
|
|
4136
|
+
title: string;
|
|
4137
|
+
};
|
|
4115
4138
|
}
|
|
4116
4139
|
interface PanelStatusDropdown {
|
|
4117
4140
|
kind: 'services' | 'servers';
|
|
@@ -4123,5 +4146,5 @@ interface PanelStatusDropdown {
|
|
|
4123
4146
|
/** The open services or servers dropdown, or null when neither is open. */
|
|
4124
4147
|
declare function openStatusDropdown(s: CliPanelSnapshot): PanelStatusDropdown | null;
|
|
4125
4148
|
|
|
4126
|
-
export { API_VERSION, CLI_ENV_GLOBAL_PERMISSION, CLI_FRAMEWORK_SERVICE, CLOSE_GLYPH, CLOSE_ICON, CapturingTerminalWriter, CliAliasCommandProcessor, CliArgsParser, CliBackgroundServiceRegistry_TOKEN, CliBoot, CliBootLog, CliBootLog_TOKEN, CliCalCommandProcessor, CliCaptureCommandProcessor, CliClearCommandProcessor, CliClipboard, CliClipboardCommandProcessor, CliColorCommandProcessor, CliCommandExecutionContext, CliCommandExecutor, CliCommandHistory, CliCommandHistory_TOKEN, CliCommandProcessorRegistry, CliConfigureCommandProcessor, CliConvertCommandProcessor, CliDebugCommandProcessor, CliDefaultPingServerService, CliDiffCommandProcessor, CliDragDropService, CliEchoCommandProcessor, CliEngine, CliEnvCommandProcessor, CliEnvironment, CliEvalCommandProcessor, CliEventsCommandProcessor, CliExecutionContext, CliExecutionProcess, CliExportCommandProcessor, CliFalseCommandProcessor, 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, CliPanelController, CliPanelStatusTracker, CliPermissionRegistry, CliPingCommandProcessor, CliProcessRegistry, CliProcessRegistry_TOKEN, CliProcessorsRegistry_TOKEN, CliPsCommandProcessor, CliRandomCommandProcessor, CliScreenCommandProcessor, CliScriptSyntaxError, CliSeqCommandProcessor, CliServerCommandProcessor, CliServerConnection, CliServerManager, CliServerManager_TOKEN, CliServerMultiProxyProcessor, CliServerProxyProcessor, CliServiceContainer, CliServicesCommandProcessor, CliSleepCommandProcessor, CliSnippetCommandProcessor, CliSshCommandProcessor, CliStateStore, CliStateStoreManager, CliStateStoreManager_TOKEN, CliTerminalProgressBar, CliTerminalSpinner, CliTerminalTextAnimator, CliTerminalWriter, CliTestCommandProcessor, CliTestHarness, CliThemeCommandProcessor, CliTimeCommandProcessor, CliTimerManager, CliTimestampCommandProcessor, CliTrueCommandProcessor, CliUnAliasCommandProcessor, CliUnameCommandProcessor, CliUnsetCommandProcessor, CliUptimeCommandProcessor, CliVersionCommandProcessor, CliYesCommandProcessor, CommandParser, DEFAULT_CLI_NAME, DEFAULT_GLOBAL_STATUS, DEFAULT_PANEL_HEIGHT, DEFAULT_PANEL_WIDTH, DEFAULT_TAB_STATUS, ERROR_ICON, EXEC_POLL_MS, GLOBAL_POLL_MS, HIDE_ICON, HIDE_TAB_TERMINAL_ICON, ICliEnvironment_TOKEN, ICliPingServerService_TOKEN, ICliScriptRunner_TOKEN, JsFallbackAccelerator, LIBRARY_VERSION, MAXIMIZE_ICON, MIN_PANEL_SIZE, MIN_PANE_WIDTH_PERCENT, OverlayAddon, PANEL_LABELS, PANEL_POSITIONS, ProcessExitedError, RESTORE_ICON, SERVICES_ICON, SUCCESS_ICON, SVG_COMMON_ATTRS, SVG_VIEW_BOX, ScriptLoaderService, SyntaxHighlighterRegistry_TOKEN, TERMINAL_ICON, UPTIME_ICON, appendOutputToFile, appendStderrToFile, applyEnvironmentChange, builtinProcessors, capitalize, clampPanelSize, cliScriptRunner, collapseChevronIcon, computeDiff, computeGlobalStatus, computeTabStatus, contextGlobalParameter, contextMenuItems, contextMenuStyle, createCliEngine, createServerModule, defaultFontSize, describeShellClose, distributePaneWidths, dropdownAnchorStyle, executeOnServer, expandBraces, expandEnvironmentVars, expandGlobs, formatDiff, formatUptime, getAccelerator, getCliNameArt, getGreetingBasedOnTime, getTerminalOptions, glowLineClass, greetingModule, groupBy, handleRenameKey, helpGlobalParameter, hideTabChevronIcon, hotkeysInfo, initWasmAccelerator, initializeServices, initializeTerminal, isHorizontalPosition, isWasmAccelerated, joinClasses, matchGlob, mergeCliOptions, miscProcessors, nextRowsCommand, normalizePaneWidths, openLink, openStatusDropdown, paneClass, paneStyle, panelBranding, panelTabClass, panelTabDotClass, panelWrapperClass, panelWrapperStyle, panesContainerClass, panesContainerWidth, parseAssignments, parseScript, positionDropdownItemClass, positionIcon, positionOptions, reconcileArgs, renderServerResponse, renderSingleOutput, resizePaneWidths, resizedPanelSize, resolveCliBranding, resolveCliHostConfig, runContextMenuAction, runScript, splitWords, statusIndicators, substituteCommands, substituteVars, svgAttrs, systemProcessors, tabDotClass, themeInfos, themes, tryExecuteScript, versionGlobalParameter, waitForLayout, welcomeModule, writeOutputToFile, writeStderrToFile };
|
|
4149
|
+
export { API_VERSION, CLI_ENV_GLOBAL_PERMISSION, CLI_FRAMEWORK_SERVICE, CLOSE_GLYPH, CLOSE_ICON, CapturingTerminalWriter, CliAliasCommandProcessor, CliArgsParser, CliBackgroundServiceRegistry_TOKEN, CliBoot, CliBootLog, CliBootLog_TOKEN, CliCalCommandProcessor, CliCaptureCommandProcessor, CliClearCommandProcessor, CliClipboard, CliClipboardCommandProcessor, CliColorCommandProcessor, CliCommandExecutionContext, CliCommandExecutor, CliCommandHistory, CliCommandHistory_TOKEN, CliCommandProcessorRegistry, CliConfigureCommandProcessor, CliConvertCommandProcessor, CliDebugCommandProcessor, CliDefaultPingServerService, CliDiffCommandProcessor, CliDragDropService, CliEchoCommandProcessor, CliEngine, CliEnvCommandProcessor, CliEnvironment, CliEvalCommandProcessor, CliEventsCommandProcessor, CliExecutionContext, CliExecutionProcess, CliExportCommandProcessor, CliFalseCommandProcessor, 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, CliPanelController, CliPanelStatusTracker, CliPermissionRegistry, CliPingCommandProcessor, CliProcessRegistry, CliProcessRegistry_TOKEN, CliProcessorsRegistry_TOKEN, CliPsCommandProcessor, CliRandomCommandProcessor, CliScreenCommandProcessor, CliScriptSyntaxError, CliSeqCommandProcessor, CliServerCommandProcessor, CliServerConnection, CliServerManager, CliServerManager_TOKEN, CliServerMultiProxyProcessor, CliServerProxyProcessor, CliServiceContainer, CliServicesCommandProcessor, CliSleepCommandProcessor, CliSnippetCommandProcessor, CliSshCommandProcessor, CliStateStore, CliStateStoreManager, CliStateStoreManager_TOKEN, CliTerminalProgressBar, CliTerminalSpinner, CliTerminalTextAnimator, CliTerminalWriter, CliTestCommandProcessor, CliTestHarness, CliThemeCommandProcessor, CliTimeCommandProcessor, CliTimerManager, CliTimestampCommandProcessor, CliTrueCommandProcessor, CliUnAliasCommandProcessor, CliUnameCommandProcessor, CliUnsetCommandProcessor, CliUptimeCommandProcessor, CliVersionCommandProcessor, CliYesCommandProcessor, CommandParser, DEFAULT_CLI_NAME, DEFAULT_GLOBAL_STATUS, DEFAULT_PANEL_HEIGHT, DEFAULT_PANEL_WIDTH, DEFAULT_TAB_STATUS, ERROR_ICON, EXEC_POLL_MS, GLOBAL_POLL_MS, HIDE_ICON, HIDE_TAB_TERMINAL_ICON, ICliEnvironment_TOKEN, ICliPingServerService_TOKEN, ICliScriptRunner_TOKEN, JsFallbackAccelerator, LIBRARY_VERSION, MAXIMIZE_ICON, MIN_PANEL_SIZE, MIN_PANE_WIDTH_PERCENT, OverlayAddon, PANEL_LABELS, PANEL_POSITIONS, ProcessExitedError, RESTORE_ICON, SERVICES_ICON, SUCCESS_ICON, SVG_COMMON_ATTRS, SVG_VIEW_BOX, ScriptLoaderService, SyntaxHighlighterRegistry_TOKEN, TERMINAL_ICON, UPTIME_ICON, appendOutputToFile, appendStderrToFile, applyEnvironmentChange, builtinProcessors, capitalize, clampPanelSize, cliScriptRunner, collapseChevronIcon, computeDiff, computeGlobalStatus, computeTabStatus, contextGlobalParameter, contextMenuItems, contextMenuStyle, createCliEngine, createServerModule, defaultFontSize, describeShellClose, distributePaneWidths, dropdownAnchorStyle, executeOnServer, expandBraces, expandEnvironmentVars, expandGlobs, formatDiff, formatUptime, getAccelerator, getCliNameArt, getGreetingBasedOnTime, getTerminalOptions, glowLineClass, greetingModule, groupBy, handleRenameKey, helpGlobalParameter, hideTabChevronIcon, hotkeysInfo, initWasmAccelerator, initializeServices, initializeTerminal, isHorizontalPosition, isWasmAccelerated, joinClasses, killProcess, matchGlob, mergeCliOptions, miscProcessors, nextRowsCommand, normalizePaneWidths, openLink, openStatusDropdown, paneClass, paneStyle, panelBranding, panelTabClass, panelTabDotClass, panelWrapperClass, panelWrapperStyle, panesContainerClass, panesContainerWidth, parseAssignments, parseScript, positionDropdownItemClass, positionIcon, positionOptions, reconcileArgs, renderServerResponse, renderSingleOutput, resizePaneWidths, resizedPanelSize, resolveCliBranding, resolveCliHostConfig, runContextMenuAction, runScript, splitWords, statusIndicators, substituteCommands, substituteVars, svgAttrs, systemProcessors, tabDotClass, themeInfos, themes, tryExecuteScript, versionGlobalParameter, waitForLayout, welcomeModule, writeOutputToFile, writeStderrToFile };
|
|
4127
4150
|
export type { AnchorRect, CdnSourceName, CliBootLogOptions, CliEngineOptions, CliEnvironmentChange, CliEnvironmentProfile, CliEnvironmentScope, CliEnvironmentSnapshot, CliEnvironmentSource, CliExecutionContextDeps, CliHiddenServerCommand, CliHostConfig, CliPanelCallbacks, CliPanelContextMenu, CliPanelControlledState, CliPanelControllerOptions, CliPanelExecutionState, CliPanelGlobalStatus, CliPanelPane, CliPanelServerDetail, CliPanelServerState, CliPanelServiceDetail, CliPanelSnapshot, CliPanelStatusTrackerListener, CliPanelTab, CliPanelTabStatus, CliPanelViewport, CliTestResult, CliWelcomeMessageConfig, CommandParserOutput, CommandPart, ConfigureState, CreateCliEngineConfig, DefaultServerProvider, DiffLine, DiffType, ICliEnvironment, ICliExecutionHost, ICliScriptRunOptions, ICliScriptRunner, ICliStateStoreManager, ICliWasmAccelerator, InitializeServicesOptions, InitializeServicesResult, MultiProxyEntry, PanelContextMenuAction, PanelContextMenuItem, PanelDropdownRow, PanelPositionOption, PanelStatusDropdown, PanelStatusIndicator, ParsedArg, ParsedToken, ResolvedCliBranding, SvgIcon, SvgShape, TerminalSetupResult, ThemeState };
|
package/public-api.d.ts
CHANGED
|
@@ -165,7 +165,7 @@ declare const CliKeyValueStore_TOKEN: any;
|
|
|
165
165
|
*/
|
|
166
166
|
declare const SyntaxHighlighterRegistry_TOKEN: any;
|
|
167
167
|
|
|
168
|
-
declare const LIBRARY_VERSION = "2.4.
|
|
168
|
+
declare const LIBRARY_VERSION = "2.4.1";
|
|
169
169
|
declare const API_VERSION = 2;
|
|
170
170
|
|
|
171
171
|
declare class CliAliasCommandProcessor implements ICliCommandProcessor {
|
|
@@ -3589,6 +3589,8 @@ interface CliPanelContextMenu {
|
|
|
3589
3589
|
tabId: number;
|
|
3590
3590
|
}
|
|
3591
3591
|
interface CliPanelServiceDetail {
|
|
3592
|
+
/** Process id in the engine's process registry (`ps`), the handle of the stop button. */
|
|
3593
|
+
pid?: number;
|
|
3592
3594
|
name: string;
|
|
3593
3595
|
status: string;
|
|
3594
3596
|
description?: string;
|
|
@@ -3782,6 +3784,12 @@ declare const GLOBAL_POLL_MS = 2000;
|
|
|
3782
3784
|
declare function computeTabStatus(engines: Iterable<CliEngine>): CliPanelTabStatus;
|
|
3783
3785
|
/** Services, servers and uptime of one engine. */
|
|
3784
3786
|
declare function computeGlobalStatus(engine: CliEngine | undefined, now?: number): CliPanelGlobalStatus;
|
|
3787
|
+
/**
|
|
3788
|
+
* Kill process `pid` of the engine, as `kill <pid>` does: a background
|
|
3789
|
+
* service is stopped (and shows as killed in `ps`). False when the engine
|
|
3790
|
+
* has no process registry or no running process with that pid.
|
|
3791
|
+
*/
|
|
3792
|
+
declare function killProcess(engine: CliEngine | undefined, pid: number): boolean;
|
|
3785
3793
|
interface CliPanelStatusTrackerListener {
|
|
3786
3794
|
onTabStatus(tabId: number, status: CliPanelTabStatus): void;
|
|
3787
3795
|
onGlobalStatus(status: CliPanelGlobalStatus): void;
|
|
@@ -3803,6 +3811,8 @@ declare class CliPanelStatusTracker {
|
|
|
3803
3811
|
unregisterPane(paneId: number): void;
|
|
3804
3812
|
unregisterTab(tabId: number): void;
|
|
3805
3813
|
setActiveTab(tabId: number): void;
|
|
3814
|
+
/** The engine the global status (services, servers) is computed from: the first pane of the active tab. */
|
|
3815
|
+
get globalEngine(): CliEngine | undefined;
|
|
3806
3816
|
/** Recompute everything now. */
|
|
3807
3817
|
refresh(): void;
|
|
3808
3818
|
destroy(): void;
|
|
@@ -3916,6 +3926,12 @@ declare class CliPanelController implements ICliPanelRef<CliEngine> {
|
|
|
3916
3926
|
openContextMenu(tabId: number, x: number, y: number): void;
|
|
3917
3927
|
closeContextMenu(): void;
|
|
3918
3928
|
togglePositionDropdown(): void;
|
|
3929
|
+
/**
|
|
3930
|
+
* Stop a running background service listed in the services dropdown, as
|
|
3931
|
+
* `kill <pid>` does; the list refreshes. False when nothing was running
|
|
3932
|
+
* under that pid.
|
|
3933
|
+
*/
|
|
3934
|
+
killProcess(pid: number): boolean;
|
|
3919
3935
|
/** `anchor` is the clicked status item; the dropdown is placed next to it. */
|
|
3920
3936
|
toggleServicesDropdown(anchor?: Element | null): void;
|
|
3921
3937
|
toggleServersDropdown(anchor?: Element | null): void;
|
|
@@ -4029,6 +4045,7 @@ declare const PANEL_LABELS: {
|
|
|
4029
4045
|
readonly closePane: "Close pane";
|
|
4030
4046
|
readonly servicesHeader: "Background Services";
|
|
4031
4047
|
readonly servicesEmpty: "No services registered";
|
|
4048
|
+
readonly stopService: "Stop";
|
|
4032
4049
|
readonly serversHeader: "Server Connections";
|
|
4033
4050
|
readonly serversEmpty: "No servers configured";
|
|
4034
4051
|
};
|
|
@@ -4112,6 +4129,12 @@ interface PanelDropdownRow {
|
|
|
4112
4129
|
status: string;
|
|
4113
4130
|
/** Extra lines under the status (servers: API version, command count). */
|
|
4114
4131
|
meta: string[];
|
|
4132
|
+
/** Stop button of a running service (`controller.killProcess(pid)`); absent for stopped services and servers. */
|
|
4133
|
+
stop?: {
|
|
4134
|
+
pid: number;
|
|
4135
|
+
label: string;
|
|
4136
|
+
title: string;
|
|
4137
|
+
};
|
|
4115
4138
|
}
|
|
4116
4139
|
interface PanelStatusDropdown {
|
|
4117
4140
|
kind: 'services' | 'servers';
|
|
@@ -4123,5 +4146,5 @@ interface PanelStatusDropdown {
|
|
|
4123
4146
|
/** The open services or servers dropdown, or null when neither is open. */
|
|
4124
4147
|
declare function openStatusDropdown(s: CliPanelSnapshot): PanelStatusDropdown | null;
|
|
4125
4148
|
|
|
4126
|
-
export { API_VERSION, CLI_ENV_GLOBAL_PERMISSION, CLI_FRAMEWORK_SERVICE, CLOSE_GLYPH, CLOSE_ICON, CapturingTerminalWriter, CliAliasCommandProcessor, CliArgsParser, CliBackgroundServiceRegistry_TOKEN, CliBoot, CliBootLog, CliBootLog_TOKEN, CliCalCommandProcessor, CliCaptureCommandProcessor, CliClearCommandProcessor, CliClipboard, CliClipboardCommandProcessor, CliColorCommandProcessor, CliCommandExecutionContext, CliCommandExecutor, CliCommandHistory, CliCommandHistory_TOKEN, CliCommandProcessorRegistry, CliConfigureCommandProcessor, CliConvertCommandProcessor, CliDebugCommandProcessor, CliDefaultPingServerService, CliDiffCommandProcessor, CliDragDropService, CliEchoCommandProcessor, CliEngine, CliEnvCommandProcessor, CliEnvironment, CliEvalCommandProcessor, CliEventsCommandProcessor, CliExecutionContext, CliExecutionProcess, CliExportCommandProcessor, CliFalseCommandProcessor, 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, CliPanelController, CliPanelStatusTracker, CliPermissionRegistry, CliPingCommandProcessor, CliProcessRegistry, CliProcessRegistry_TOKEN, CliProcessorsRegistry_TOKEN, CliPsCommandProcessor, CliRandomCommandProcessor, CliScreenCommandProcessor, CliScriptSyntaxError, CliSeqCommandProcessor, CliServerCommandProcessor, CliServerConnection, CliServerManager, CliServerManager_TOKEN, CliServerMultiProxyProcessor, CliServerProxyProcessor, CliServiceContainer, CliServicesCommandProcessor, CliSleepCommandProcessor, CliSnippetCommandProcessor, CliSshCommandProcessor, CliStateStore, CliStateStoreManager, CliStateStoreManager_TOKEN, CliTerminalProgressBar, CliTerminalSpinner, CliTerminalTextAnimator, CliTerminalWriter, CliTestCommandProcessor, CliTestHarness, CliThemeCommandProcessor, CliTimeCommandProcessor, CliTimerManager, CliTimestampCommandProcessor, CliTrueCommandProcessor, CliUnAliasCommandProcessor, CliUnameCommandProcessor, CliUnsetCommandProcessor, CliUptimeCommandProcessor, CliVersionCommandProcessor, CliYesCommandProcessor, CommandParser, DEFAULT_CLI_NAME, DEFAULT_GLOBAL_STATUS, DEFAULT_PANEL_HEIGHT, DEFAULT_PANEL_WIDTH, DEFAULT_TAB_STATUS, ERROR_ICON, EXEC_POLL_MS, GLOBAL_POLL_MS, HIDE_ICON, HIDE_TAB_TERMINAL_ICON, ICliEnvironment_TOKEN, ICliPingServerService_TOKEN, ICliScriptRunner_TOKEN, JsFallbackAccelerator, LIBRARY_VERSION, MAXIMIZE_ICON, MIN_PANEL_SIZE, MIN_PANE_WIDTH_PERCENT, OverlayAddon, PANEL_LABELS, PANEL_POSITIONS, ProcessExitedError, RESTORE_ICON, SERVICES_ICON, SUCCESS_ICON, SVG_COMMON_ATTRS, SVG_VIEW_BOX, ScriptLoaderService, SyntaxHighlighterRegistry_TOKEN, TERMINAL_ICON, UPTIME_ICON, appendOutputToFile, appendStderrToFile, applyEnvironmentChange, builtinProcessors, capitalize, clampPanelSize, cliScriptRunner, collapseChevronIcon, computeDiff, computeGlobalStatus, computeTabStatus, contextGlobalParameter, contextMenuItems, contextMenuStyle, createCliEngine, createServerModule, defaultFontSize, describeShellClose, distributePaneWidths, dropdownAnchorStyle, executeOnServer, expandBraces, expandEnvironmentVars, expandGlobs, formatDiff, formatUptime, getAccelerator, getCliNameArt, getGreetingBasedOnTime, getTerminalOptions, glowLineClass, greetingModule, groupBy, handleRenameKey, helpGlobalParameter, hideTabChevronIcon, hotkeysInfo, initWasmAccelerator, initializeServices, initializeTerminal, isHorizontalPosition, isWasmAccelerated, joinClasses, matchGlob, mergeCliOptions, miscProcessors, nextRowsCommand, normalizePaneWidths, openLink, openStatusDropdown, paneClass, paneStyle, panelBranding, panelTabClass, panelTabDotClass, panelWrapperClass, panelWrapperStyle, panesContainerClass, panesContainerWidth, parseAssignments, parseScript, positionDropdownItemClass, positionIcon, positionOptions, reconcileArgs, renderServerResponse, renderSingleOutput, resizePaneWidths, resizedPanelSize, resolveCliBranding, resolveCliHostConfig, runContextMenuAction, runScript, splitWords, statusIndicators, substituteCommands, substituteVars, svgAttrs, systemProcessors, tabDotClass, themeInfos, themes, tryExecuteScript, versionGlobalParameter, waitForLayout, welcomeModule, writeOutputToFile, writeStderrToFile };
|
|
4149
|
+
export { API_VERSION, CLI_ENV_GLOBAL_PERMISSION, CLI_FRAMEWORK_SERVICE, CLOSE_GLYPH, CLOSE_ICON, CapturingTerminalWriter, CliAliasCommandProcessor, CliArgsParser, CliBackgroundServiceRegistry_TOKEN, CliBoot, CliBootLog, CliBootLog_TOKEN, CliCalCommandProcessor, CliCaptureCommandProcessor, CliClearCommandProcessor, CliClipboard, CliClipboardCommandProcessor, CliColorCommandProcessor, CliCommandExecutionContext, CliCommandExecutor, CliCommandHistory, CliCommandHistory_TOKEN, CliCommandProcessorRegistry, CliConfigureCommandProcessor, CliConvertCommandProcessor, CliDebugCommandProcessor, CliDefaultPingServerService, CliDiffCommandProcessor, CliDragDropService, CliEchoCommandProcessor, CliEngine, CliEnvCommandProcessor, CliEnvironment, CliEvalCommandProcessor, CliEventsCommandProcessor, CliExecutionContext, CliExecutionProcess, CliExportCommandProcessor, CliFalseCommandProcessor, 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, CliPanelController, CliPanelStatusTracker, CliPermissionRegistry, CliPingCommandProcessor, CliProcessRegistry, CliProcessRegistry_TOKEN, CliProcessorsRegistry_TOKEN, CliPsCommandProcessor, CliRandomCommandProcessor, CliScreenCommandProcessor, CliScriptSyntaxError, CliSeqCommandProcessor, CliServerCommandProcessor, CliServerConnection, CliServerManager, CliServerManager_TOKEN, CliServerMultiProxyProcessor, CliServerProxyProcessor, CliServiceContainer, CliServicesCommandProcessor, CliSleepCommandProcessor, CliSnippetCommandProcessor, CliSshCommandProcessor, CliStateStore, CliStateStoreManager, CliStateStoreManager_TOKEN, CliTerminalProgressBar, CliTerminalSpinner, CliTerminalTextAnimator, CliTerminalWriter, CliTestCommandProcessor, CliTestHarness, CliThemeCommandProcessor, CliTimeCommandProcessor, CliTimerManager, CliTimestampCommandProcessor, CliTrueCommandProcessor, CliUnAliasCommandProcessor, CliUnameCommandProcessor, CliUnsetCommandProcessor, CliUptimeCommandProcessor, CliVersionCommandProcessor, CliYesCommandProcessor, CommandParser, DEFAULT_CLI_NAME, DEFAULT_GLOBAL_STATUS, DEFAULT_PANEL_HEIGHT, DEFAULT_PANEL_WIDTH, DEFAULT_TAB_STATUS, ERROR_ICON, EXEC_POLL_MS, GLOBAL_POLL_MS, HIDE_ICON, HIDE_TAB_TERMINAL_ICON, ICliEnvironment_TOKEN, ICliPingServerService_TOKEN, ICliScriptRunner_TOKEN, JsFallbackAccelerator, LIBRARY_VERSION, MAXIMIZE_ICON, MIN_PANEL_SIZE, MIN_PANE_WIDTH_PERCENT, OverlayAddon, PANEL_LABELS, PANEL_POSITIONS, ProcessExitedError, RESTORE_ICON, SERVICES_ICON, SUCCESS_ICON, SVG_COMMON_ATTRS, SVG_VIEW_BOX, ScriptLoaderService, SyntaxHighlighterRegistry_TOKEN, TERMINAL_ICON, UPTIME_ICON, appendOutputToFile, appendStderrToFile, applyEnvironmentChange, builtinProcessors, capitalize, clampPanelSize, cliScriptRunner, collapseChevronIcon, computeDiff, computeGlobalStatus, computeTabStatus, contextGlobalParameter, contextMenuItems, contextMenuStyle, createCliEngine, createServerModule, defaultFontSize, describeShellClose, distributePaneWidths, dropdownAnchorStyle, executeOnServer, expandBraces, expandEnvironmentVars, expandGlobs, formatDiff, formatUptime, getAccelerator, getCliNameArt, getGreetingBasedOnTime, getTerminalOptions, glowLineClass, greetingModule, groupBy, handleRenameKey, helpGlobalParameter, hideTabChevronIcon, hotkeysInfo, initWasmAccelerator, initializeServices, initializeTerminal, isHorizontalPosition, isWasmAccelerated, joinClasses, killProcess, matchGlob, mergeCliOptions, miscProcessors, nextRowsCommand, normalizePaneWidths, openLink, openStatusDropdown, paneClass, paneStyle, panelBranding, panelTabClass, panelTabDotClass, panelWrapperClass, panelWrapperStyle, panesContainerClass, panesContainerWidth, parseAssignments, parseScript, positionDropdownItemClass, positionIcon, positionOptions, reconcileArgs, renderServerResponse, renderSingleOutput, resizePaneWidths, resizedPanelSize, resolveCliBranding, resolveCliHostConfig, runContextMenuAction, runScript, splitWords, statusIndicators, substituteCommands, substituteVars, svgAttrs, systemProcessors, tabDotClass, themeInfos, themes, tryExecuteScript, versionGlobalParameter, waitForLayout, welcomeModule, writeOutputToFile, writeStderrToFile };
|
|
4127
4150
|
export type { AnchorRect, CdnSourceName, CliBootLogOptions, CliEngineOptions, CliEnvironmentChange, CliEnvironmentProfile, CliEnvironmentScope, CliEnvironmentSnapshot, CliEnvironmentSource, CliExecutionContextDeps, CliHiddenServerCommand, CliHostConfig, CliPanelCallbacks, CliPanelContextMenu, CliPanelControlledState, CliPanelControllerOptions, CliPanelExecutionState, CliPanelGlobalStatus, CliPanelPane, CliPanelServerDetail, CliPanelServerState, CliPanelServiceDetail, CliPanelSnapshot, CliPanelStatusTrackerListener, CliPanelTab, CliPanelTabStatus, CliPanelViewport, CliTestResult, CliWelcomeMessageConfig, CommandParserOutput, CommandPart, ConfigureState, CreateCliEngineConfig, DefaultServerProvider, DiffLine, DiffType, ICliEnvironment, ICliExecutionHost, ICliScriptRunOptions, ICliScriptRunner, ICliStateStoreManager, ICliWasmAccelerator, InitializeServicesOptions, InitializeServicesResult, MultiProxyEntry, PanelContextMenuAction, PanelContextMenuItem, PanelDropdownRow, PanelPositionOption, PanelStatusDropdown, PanelStatusIndicator, ParsedArg, ParsedToken, ResolvedCliBranding, SvgIcon, SvgShape, TerminalSetupResult, ThemeState };
|
package/public-api.js
CHANGED
|
@@ -519,7 +519,7 @@ var CliKeyValueStore_TOKEN = cliCore.createCliToken("cli-key-value-store");
|
|
|
519
519
|
var SyntaxHighlighterRegistry_TOKEN = cliCore.createCliToken("syntax-highlighter-registry");
|
|
520
520
|
|
|
521
521
|
// src/lib/version.ts
|
|
522
|
-
var LIBRARY_VERSION = "2.4.
|
|
522
|
+
var LIBRARY_VERSION = "2.4.1";
|
|
523
523
|
var API_VERSION = 2;
|
|
524
524
|
var ANONYMOUS = "\0anonymous";
|
|
525
525
|
function aliasOwner(context2) {
|
|
@@ -14843,6 +14843,7 @@ var CliTerminalSpinner = class {
|
|
|
14843
14843
|
}, 80);
|
|
14844
14844
|
}
|
|
14845
14845
|
hide() {
|
|
14846
|
+
if (!this.isRunning) return;
|
|
14846
14847
|
this.isRunning = false;
|
|
14847
14848
|
if (this.spinnerInterval) {
|
|
14848
14849
|
clearInterval(this.spinnerInterval);
|
|
@@ -20205,8 +20206,8 @@ var CliBootLog = class {
|
|
|
20205
20206
|
if (this.problems.length > 0) {
|
|
20206
20207
|
this.terminal.write("\r\n");
|
|
20207
20208
|
}
|
|
20208
|
-
|
|
20209
|
-
|
|
20209
|
+
const output2 = this.captured.join("").replace(/(?:\s|\x1b\[[0-9;?]*[A-Za-z])+$/, "");
|
|
20210
|
+
if (output2) {
|
|
20210
20211
|
this.terminal.write(output2 + RESET4 + "\r\n\r\n");
|
|
20211
20212
|
}
|
|
20212
20213
|
}
|
|
@@ -23942,6 +23943,7 @@ function computeGlobalStatus(engine, now = Date.now()) {
|
|
|
23942
23943
|
total: services.length
|
|
23943
23944
|
};
|
|
23944
23945
|
serviceDetails = services.map((s) => ({
|
|
23946
|
+
pid: s.pid,
|
|
23945
23947
|
name: s.name,
|
|
23946
23948
|
status: s.status,
|
|
23947
23949
|
description: s.description
|
|
@@ -23988,6 +23990,15 @@ function computeGlobalStatus(engine, now = Date.now()) {
|
|
|
23988
23990
|
const uptime = engine.startedAt ? now - engine.startedAt : 0;
|
|
23989
23991
|
return { serviceCount, serviceDetails, serverState, serverDetails, uptime };
|
|
23990
23992
|
}
|
|
23993
|
+
function killProcess(engine, pid) {
|
|
23994
|
+
const context2 = engine?.getContext();
|
|
23995
|
+
let registry;
|
|
23996
|
+
try {
|
|
23997
|
+
registry = context2?.services?.get?.(CliProcessRegistry_TOKEN);
|
|
23998
|
+
} catch {
|
|
23999
|
+
}
|
|
24000
|
+
return registry?.kill(pid) ?? false;
|
|
24001
|
+
}
|
|
23991
24002
|
var CliPanelStatusTracker = class {
|
|
23992
24003
|
constructor(listener) {
|
|
23993
24004
|
this.listener = listener;
|
|
@@ -24052,6 +24063,11 @@ var CliPanelStatusTracker = class {
|
|
|
24052
24063
|
this.activeTabId = tabId;
|
|
24053
24064
|
this.refreshGlobal();
|
|
24054
24065
|
}
|
|
24066
|
+
/** The engine the global status (services, servers) is computed from: the first pane of the active tab. */
|
|
24067
|
+
get globalEngine() {
|
|
24068
|
+
const entry = this.activeTabId != null ? this.tabs.get(this.activeTabId) : void 0;
|
|
24069
|
+
return entry?.engines.values().next().value;
|
|
24070
|
+
}
|
|
24055
24071
|
/** Recompute everything now. */
|
|
24056
24072
|
refresh() {
|
|
24057
24073
|
for (const tabId of this.tabs.keys()) this.refreshTab(tabId);
|
|
@@ -24088,9 +24104,7 @@ var CliPanelStatusTracker = class {
|
|
|
24088
24104
|
this.listener.onTabStatus(tabId, next);
|
|
24089
24105
|
}
|
|
24090
24106
|
refreshGlobal() {
|
|
24091
|
-
const
|
|
24092
|
-
const engine = entry?.engines.values().next().value;
|
|
24093
|
-
const next = computeGlobalStatus(engine);
|
|
24107
|
+
const next = computeGlobalStatus(this.globalEngine);
|
|
24094
24108
|
if (sameJson(next, this.globalStatus)) return;
|
|
24095
24109
|
this.globalStatus = next;
|
|
24096
24110
|
this.listener.onGlobalStatus(next);
|
|
@@ -24572,6 +24586,16 @@ var CliPanelController = class {
|
|
|
24572
24586
|
serversDropdownOpen: false
|
|
24573
24587
|
});
|
|
24574
24588
|
}
|
|
24589
|
+
/**
|
|
24590
|
+
* Stop a running background service listed in the services dropdown, as
|
|
24591
|
+
* `kill <pid>` does; the list refreshes. False when nothing was running
|
|
24592
|
+
* under that pid.
|
|
24593
|
+
*/
|
|
24594
|
+
killProcess(pid) {
|
|
24595
|
+
const killed = killProcess(this.tracker.globalEngine, pid);
|
|
24596
|
+
if (killed) this.tracker.refresh();
|
|
24597
|
+
return killed;
|
|
24598
|
+
}
|
|
24575
24599
|
/** `anchor` is the clicked status item; the dropdown is placed next to it. */
|
|
24576
24600
|
toggleServicesDropdown(anchor) {
|
|
24577
24601
|
const open = !this.snapshot.servicesDropdownOpen;
|
|
@@ -25000,6 +25024,7 @@ var PANEL_LABELS = {
|
|
|
25000
25024
|
closePane: "Close pane",
|
|
25001
25025
|
servicesHeader: "Background Services",
|
|
25002
25026
|
servicesEmpty: "No services registered",
|
|
25027
|
+
stopService: "Stop",
|
|
25003
25028
|
serversHeader: "Server Connections",
|
|
25004
25029
|
serversEmpty: "No servers configured"
|
|
25005
25030
|
};
|
|
@@ -25180,7 +25205,8 @@ function openStatusDropdown(s) {
|
|
|
25180
25205
|
name: svc.name,
|
|
25181
25206
|
description: svc.description,
|
|
25182
25207
|
status: svc.status,
|
|
25183
|
-
meta: []
|
|
25208
|
+
meta: [],
|
|
25209
|
+
stop: svc.status === "running" && svc.pid !== void 0 ? { pid: svc.pid, label: PANEL_LABELS.stopService, title: `${PANEL_LABELS.stopService} ${svc.name} (kill ${svc.pid})` } : void 0
|
|
25184
25210
|
}))
|
|
25185
25211
|
};
|
|
25186
25212
|
}
|
|
@@ -25390,6 +25416,7 @@ exports.initializeTerminal = initializeTerminal;
|
|
|
25390
25416
|
exports.isHorizontalPosition = isHorizontalPosition;
|
|
25391
25417
|
exports.isWasmAccelerated = isWasmAccelerated;
|
|
25392
25418
|
exports.joinClasses = joinClasses;
|
|
25419
|
+
exports.killProcess = killProcess;
|
|
25393
25420
|
exports.matchGlob = matchGlob;
|
|
25394
25421
|
exports.mergeCliOptions = mergeCliOptions;
|
|
25395
25422
|
exports.miscProcessors = miscProcessors;
|