import assert from "node:assert/strict"; import test from "node:test"; import { callProbeComputers, formatFailure, startBridge, startCraftos, waitForComputers } from "./harness.js"; test("probe-computers talks to the real TrapOS mcp-computer program", async () => { const bridge = await startBridge(); const craftos = startCraftos("/programs/mcp-computer.lua", { mountRepo: true, shellArgs: ["ws://127.0.0.1:2001"], timeoutMs: 15_000, }); try { await waitForComputers(bridge.registry, 1, 12_000); const text = await callProbeComputers(); assert.equal(text, "pong from 0 (Label: null)"); } catch (error) { craftos.abort(); const result = await craftos.done; throw new Error(formatFailure(error instanceof Error ? error.message : String(error), result.output), { cause: error }); } finally { craftos.abort(); await craftos.done; await bridge.close(); } });