feat(workspace-terminal): use environment shell command

This commit is contained in:
2026-05-25 06:13:11 +00:00
parent 0eb4611ea6
commit fed3247eea
8 changed files with 1492 additions and 877 deletions
+5
View File
@@ -37,12 +37,17 @@
]
},
"release": {
"targets": {
"npm": {
"registries": [
"https://verdaccio.lossless.digital",
"https://registry.npmjs.org"
],
"accessLevel": "public"
}
}
},
"schemaVersion": 2
},
"@git.zone/tsdoc": {
"legal": "\n## License and Legal Information\n\nThis repository contains open-source code that is licensed under the MIT License. A copy of the MIT License can be found in the [license](license) file within this repository. \n\n**Please note:** The MIT License does not grant permission to use the trade names, trademarks, service marks, or product names of the project, except as required for reasonable and customary use in describing the origin of the work and reproducing the content of the NOTICE file.\n\n### Trademarks\n\nThis project is owned and maintained by Task Venture Capital GmbH. The names and logos associated with Task Venture Capital GmbH and any related products or services are trademarks of Task Venture Capital GmbH and are not included within the scope of the MIT license granted herein. Use of these trademarks must comply with Task Venture Capital GmbH's Trademark Guidelines, and any usage must be approved in writing by Task Venture Capital GmbH.\n\n### Company Information\n\nTask Venture Capital GmbH \nRegistered at District court Bremen HRB 35230 HB, Germany\n\nFor any legal inquiries or if you require further information, please contact us via email at hello@task.vc.\n\nBy using this repository, you acknowledge that you have read this section, agree to comply with its terms, and understand that the licensing of the code does not imply endorsement by Task Venture Capital GmbH of any derivative works.\n"
+14
View File
@@ -1,5 +1,19 @@
# Changelog
## Pending
### Features
- let execution environments provide their native terminal shell command
- Add shell command metadata to the execution environment contract.
- Keep WebContainer terminals on `jsh` while allowing backend environments to provide a different shell.
- Update workspace terminal shell tab labels and setup prompt handling to use the environment shell metadata.
## 2026-05-21 - 3.81.1 - fix(package)
include postinstall helper script in published package
- add the scripts directory to package files so postinstall can resolve update-monaco-version.cjs after installation
## 2026-04-17 - 3.81.0 - feat(dees-updater)
enhance updater progress and completion views with version metadata cards
+7 -6
View File
@@ -1,6 +1,6 @@
{
"name": "@design.estate/dees-catalog",
"version": "3.81.0",
"version": "3.81.1",
"private": false,
"description": "A comprehensive library that provides dynamic web components for building sophisticated and modern web applications using JavaScript and TypeScript.",
"main": "dist_ts_web/index.js",
@@ -45,12 +45,12 @@
"xterm-addon-fit": "^0.8.0"
},
"devDependencies": {
"@git.zone/tsbuild": "^4.4.0",
"@git.zone/tsbundle": "^2.10.0",
"@git.zone/tstest": "^3.6.3",
"@git.zone/tswatch": "^3.3.2",
"@git.zone/tsbuild": "^4.4.2",
"@git.zone/tsbundle": "^2.10.4",
"@git.zone/tstest": "^3.6.6",
"@git.zone/tswatch": "^3.3.5",
"@push.rocks/projectinfo": "^5.1.0",
"@types/node": "^25.6.0"
"@types/node": "^25.9.1"
},
"files": [
"ts/**/*",
@@ -60,6 +60,7 @@
"dist_ts/**/*",
"dist_ts_web/**/*",
"assets/**/*",
"scripts/**/*",
"cli.js",
".smartconfig.json",
"readme.md"
+1404 -857
View File
File diff suppressed because it is too large Load Diff
@@ -1,5 +1,11 @@
import * as webcontainer from '@tempfix/webcontainer__api';
import type { IExecutionEnvironment, IFileEntry, IFileWatcher, IProcessHandle } from '../interfaces/IExecutionEnvironment.js';
import type {
IExecutionEnvironment,
IFileEntry,
IFileWatcher,
IProcessHandle,
IShellCommand,
} from '../interfaces/IExecutionEnvironment.js';
/**
* WebContainer-based execution environment.
@@ -154,6 +160,14 @@ export class WebContainerEnvironment implements IExecutionEnvironment {
};
}
public getShellCommand(): IShellCommand {
return {
command: 'jsh',
label: 'jsh',
prompt: '~/',
};
}
// ============ WebContainer-specific methods ============
/**
@@ -29,6 +29,17 @@ export interface IProcessHandle {
kill(): void;
}
export interface IShellCommand {
/** Executable to start for an interactive shell session. */
command: string;
/** Optional command arguments. */
args?: string[];
/** Optional display label for terminal tabs. */
label?: string;
/** Optional prompt marker used for setup commands. */
prompt?: string;
}
/**
* Abstract execution environment interface.
* Implementations can target WebContainer (browser), Backend API (server), or Mock (testing).
@@ -93,12 +104,18 @@ export interface IExecutionEnvironment {
/**
* Spawn a new process
* @param command - Command to run (e.g., 'jsh', 'node', 'npm')
* @param command - Command to run (e.g., 'node', 'npm')
* @param args - Optional arguments
* @returns Process handle with I/O streams
*/
spawn(command: string, args?: string[]): Promise<IProcessHandle>;
/**
* Return the environment-native interactive shell command.
* Implementations should provide this when terminal shells need a specific executable.
*/
getShellCommand?(): IShellCommand | Promise<IShellCommand>;
// ============ Lifecycle ============
/**
@@ -12,7 +12,7 @@ import * as domtools from '@design.estate/dees-domtools';
import type { Terminal } from 'xterm';
import { themeDefaultStyles } from '../../00theme.js';
import type { IExecutionEnvironment } from '../../00group-runtime/index.js';
import type { IExecutionEnvironment, IShellCommand } from '../../00group-runtime/index.js';
import { WebContainerEnvironment } from '../../00group-runtime/index.js';
import '../../00group-utility/dees-icon/dees-icon.js';
import '../../00group-feedback/dees-actionbar/dees-actionbar.js';
@@ -660,6 +660,22 @@ export class DeesWorkspaceTerminal extends DeesElement {
}
}
private async getShellCommand(): Promise<IShellCommand> {
if (this.executionEnvironment && !this.executionEnvironment.ready) {
await this.executionEnvironment.init();
}
if (this.executionEnvironment?.getShellCommand) {
return await this.executionEnvironment.getShellCommand();
}
return {
command: 'jsh',
label: 'jsh',
prompt: '~/',
};
}
private handleProcessExit(tabId: string, exitCode: number): void {
const tab = this.tabManager.getTab(tabId);
if (!tab) return;
@@ -723,10 +739,11 @@ export class DeesWorkspaceTerminal extends DeesElement {
* Create a new shell tab
*/
public async createShellTab(label?: string): Promise<string> {
const shellCommand = await this.getShellCommand();
const tab = this.tabManager.createTab(
{
type: 'shell',
label: label || `bash ${this.tabManager.getTabCount() + 1}`,
label: label || `${shellCommand.label || shellCommand.command} ${this.tabManager.getTabCount() + 1}`,
closeable: this.tabManager.getTabCount() > 0, // First tab not closeable
},
this.isBright
@@ -739,11 +756,11 @@ export class DeesWorkspaceTerminal extends DeesElement {
// Wait for DOM update then spawn shell
await this.updateComplete;
await this.spawnProcessForTab(tab, 'jsh');
await this.spawnProcessForTab(tab, shellCommand.command, shellCommand.args || []);
// Run setup command if this is the first tab
if (this.tabManager.getTabCount() === 1 && this.setupCommand) {
await this.waitForPrompt(tab.terminal, '~/');
await this.waitForPrompt(tab.terminal, shellCommand.prompt || '~/');
if (tab.inputWriter) {
tab.inputWriter.write(this.setupCommand);
}
@@ -6,7 +6,7 @@ import type { IProcessHandle } from '../../00group-runtime/index.js';
* Type of terminal tab based on its source/purpose
*/
export type TTerminalTabType =
| 'shell' // Default interactive shell (jsh)
| 'shell' // Environment-native interactive shell
| 'script' // Script from package.json
| 'package-update' // Package update process
| 'custom'; // External process from API
@@ -75,7 +75,7 @@ export interface ICreateTerminalTabOptions {
/** Whether the tab can be closed (default: true for non-shell) */
closeable?: boolean;
/** Command to spawn (default: 'jsh' for shell type) */
/** Command to spawn (shell type uses the execution environment shell by default) */
command?: string;
/** Command arguments */