24 lines
662 B
Lua
24 lines
662 B
Lua
local createMcpComputer = require('/apis/libmcpcomputer');
|
|
local createVersion = require('/apis/libversion');
|
|
|
|
local WS_URL_SETTING = 'mcp-computer.ws-url';
|
|
|
|
local url = settings.get(WS_URL_SETTING);
|
|
if type(url) ~= 'string' or url == '' then
|
|
print('mcp-computer-server: ' .. WS_URL_SETTING .. ' not set, daemon inactive.');
|
|
return;
|
|
end
|
|
|
|
if not http or not http.websocket then
|
|
print('mcp-computer-server: HTTP/WebSocket unavailable, daemon inactive.');
|
|
return;
|
|
end
|
|
|
|
createMcpComputer().startSession({
|
|
eventloop = _G.bootEventLoop,
|
|
url = url,
|
|
os = os,
|
|
});
|
|
|
|
print('mcp-computer-server v' .. createVersion().forSelf() .. ' started (' .. url .. ').');
|