(function () { const vscode = acquireVsCodeApi(); const input = document.getElementById("cmd"); const out = document.getElementById("out"); const runBtn = document.getElementById("run"); const clearBtn = document.getElementById("clear"); function run() { const text = input.value; out.textContent = "…"; vscode.postMessage({ type: "run", text: text }); } runBtn.addEventListener("click", run); clearBtn.addEventListener("click", function () { out.textContent = ""; }); window.addEventListener("message", function (event) { const msg = event.data; if (msg && msg.type === "result") { out.textContent = typeof msg.text === "string" ? msg.text : String(msg.text); } }); })();