UNPKG

handie-cua

Version:

A shell package for machine and session management

38 lines (37 loc) 1.06 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); class HandieSession { constructor(id) { this.updateCallbacks = []; this.id = id; } async newTask(options) { // This is a shell implementation console.log('New task created:', options.task); } on(event, callback) { if (event === 'update') { this.updateCallbacks.push(callback); } } } class HandieMachine { constructor(id, streamUrl) { this.id = id; this.streamUrl = streamUrl; } async runNewSession(options) { // This is a shell implementation const sessionId = `session_${Date.now()}`; return new HandieSession(sessionId); } } const handie = { spawnMachine: async (options) => { // This is a shell implementation const machineId = `machine_${Date.now()}`; const streamUrl = `https://stream.handie-cua.com/${machineId}`; return new HandieMachine(machineId, streamUrl); }, }; module.exports = handie;