- Cleaned up old tests

- Changed `node:buffer` and `node:streams` imports to native `WebWorkers` imports;
- Fixed tests that used old `toPtr` and `fromPtr` functions to use the new NodePointer class methods
- Exposed pointer resolution helper functions to the consumer
This commit is contained in:
2026-11-20 12:22:23 +01:00
parent 2cf84ccd2f
commit d825299e26
20 changed files with 152 additions and 738 deletions
+7 -1
View File
@@ -1,6 +1,6 @@
import { COMMAND_REGISTRY } from "@core/command_registry";
import { createErrorResult, type Result } from "@core/result";
import { getCurrentSession } from "@core/session_manager";
import { getCurrentSession, type SessionState } from "@core/session_manager";
import { withExitCode, withHistory, type ShellState } from "@core/shell_state";
import { SIGNAL_MAP } from "@core/signal";
import type { ShellError } from "@core/util/errors";
@@ -11,6 +11,7 @@ import { ProcessManager } from "./process_manager";
export class Shell {
private _State: Readonly<ShellState>;
private _Session: SessionState;
private _ProcessManager: ProcessManager = new ProcessManager();
private _EventEmitter: EventEmitter<ShellEventMap> = new EventEmitter();
private _GlobalKeyMap: ReadonlyMap<string, SIGNAL_MAP>;
@@ -19,6 +20,7 @@ export class Shell {
constructor(state: ShellState) {
this._State = Object.freeze(state);
this._Session = state.sessionStack[state.sessionStack.length - 1]!;
//Temporary solution for sigint keybind
const map = new Map();
@@ -103,6 +105,10 @@ export class Shell {
return this._State;
}
public get Session(): Readonly<SessionState> {
return this._Session;
}
public on<K extends keyof ShellEventMap>(type: K, handler: (payload: ShellEventMap[K]) => void): () => void {
return this._EventEmitter.on(type, handler);
}