MCPcopy Create free account
hub / github.com/gnmyt/Nexterm / constructor

Method constructor

server/lib/ScriptLayer.js:16–31  ·  view source on GitHub ↗
(stream, ws, script, sessionId)

Source from the content-addressed store, hash-verified

14
15class ScriptLayer {
16 constructor(stream, ws, script, sessionId) {
17 this.stream = stream;
18 this.sessionId = sessionId;
19 this.script = script;
20 this.step = 1;
21 this.pending = null;
22 this.buffer = "";
23 this.running = false;
24 this.handlers = new Set();
25 this.events = [];
26 this.commandQueue = [];
27 this.commandIndex = 0;
28 this.suppressOutput = true;
29 this.onData = this.onData.bind(this);
30 this.onClose = this.onClose.bind(this);
31 }
32
33 broadcast(type, payload = {}) {
34 const msg = SCRIPT_MAGIC + JSON.stringify({ type, ...payload });

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected