diff --git a/.gitignore b/.gitignore new file mode 100644 index 00000000..5b217411 --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +node_modules/ +**/node_modules/ + diff --git a/css/ide.css b/css/ide.css index f6432a7b..1ca566c3 100755 --- a/css/ide.css +++ b/css/ide.css @@ -1,3 +1,9 @@ +html, body { + margin: 0; + padding: 0; + height: 100%; +} + .judge0-file-menu { min-width: 15rem !important; } @@ -16,10 +22,22 @@ #judge0-chat-messages { flex-grow: 1; overflow-y: auto; + padding: 0.5rem; } #judge0-chat-messages pre { overflow-x: auto; + max-width: 100%; +} + +.item.judge0-showRunButton{ + display:flex; + gap:10px; +} + +.item.judge0-showRunButton{ + display:flex; + gap:10px; } .judge0-user-message { @@ -48,3 +66,24 @@ display: none !important; } } + +@media (max-width: 600px) { + .judge0-file-menu { + min-width: 12rem !important; + } + + .item.judge0-showRunButton { + flex-direction: column; + gap: 5px; + } + + .judge0-user-message { + max-width: 95%; + margin-right: 0.5em !important; + } + + #judge0-chat-messages { + padding: 0.25rem; + } +} + diff --git a/index.html b/index.html index 6f363353..bb2417bc 100644 --- a/index.html +++ b/index.html @@ -38,15 +38,17 @@ - - - - - - - - - + + + + + + + + + + + @@ -95,6 +97,9 @@ + +
+ + Open Directory... +
+S Save
+
+ + Save to Local PC +
@@ -227,6 +284,8 @@ if ("serviceWorker" in navigator) { navigator.serviceWorker.register("sw.js").then(() => console.log("Service Worker Registered")); } + + diff --git a/js/ai.js b/js/ai.js index 7e9fe58f..5b8da999 100644 --- a/js/ai.js +++ b/js/ai.js @@ -1,7 +1,8 @@ "use strict"; import theme from "./theme.js"; import configuration from "./configuration.js"; -import { sourceEditor } from "./ide.js"; +// sourceEditor is accessed via window.sourceEditor (set by ide.js) to avoid double-loading ide.js + const THREAD = [ { @@ -69,7 +70,7 @@ document.addEventListener("DOMContentLoaded", function () { role: "user", content: ` User's code: -${sourceEditor.getValue()} +${window.sourceEditor ? window.sourceEditor.getValue() : "(editor not ready)"} User's message: ${userInputValue} diff --git a/js/configuration.js b/js/configuration.js index d7bf2cd9..b23c7772 100644 --- a/js/configuration.js +++ b/js/configuration.js @@ -21,7 +21,7 @@ const DEFAULT_CONFIGURATIONS = { showNavigation: true }, appOptions: { - showAIAssistant: true, + showAIAssistant: false, ioLayout: "stack", assistantLayout: "column", mainLayout: "row", @@ -73,7 +73,7 @@ const DEFAULT_CONFIGURATIONS = { showNavigation: true }, appOptions: { - showAIAssistant: true, + showAIAssistant: false, ioLayout: "stack", assistantLayout: "column", mainLayout: "row", @@ -99,7 +99,7 @@ const DEFAULT_CONFIGURATIONS = { showNavigation: true }, appOptions: { - showAIAssistant: true, + showAIAssistant: false, ioLayout: "stack", assistantLayout: "column", mainLayout: "row", @@ -125,7 +125,7 @@ const DEFAULT_CONFIGURATIONS = { showNavigation: true }, appOptions: { - showAIAssistant: true, + showAIAssistant: false, ioLayout: "stack", assistantLayout: "column", mainLayout: "row", diff --git a/js/csci.js b/js/csci.js new file mode 100644 index 00000000..d93dd899 --- /dev/null +++ b/js/csci.js @@ -0,0 +1,100 @@ + +//-------------------------------------------------- + +// Show a brief slide-in notification in the top-right corner +function showNotification(message, type) { + // type is "success", "error", or "warning" — maps to Semantic UI message colors + const colorClass = type === "success" ? "green" : type === "error" ? "red" : "yellow"; + + const note = document.createElement("div"); + note.className = `ui ${colorClass} message`; + note.style.cssText = ` + position: fixed; + top: 60px; + right: 20px; + z-index: 9999; + min-width: 250px; + max-width: 360px; + box-shadow: 0 2px 8px rgba(0,0,0,0.25); + transition: opacity 0.4s ease; + `; + note.innerText = message; + document.body.appendChild(note); + + // Fade out and remove after 3 seconds + setTimeout(() => { + note.style.opacity = "0"; + setTimeout(() => note.remove(), 400); + }, 3000); +} + +async function showSignInModal() { + $('#judge0-csci-sign-in-modal') + .modal({ closable: false }).modal('show'); +} + +async function hideSignInModal() { + $('#judge0-csci-sign-in-modal').modal('hide'); +} + +async function signIn() { + const username = document.getElementById("modal_username").value; + const password = document.getElementById("modal_password").value; + + try { + const response = await fetch("/ssh-sign-in", { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ username, password }) + }); + + const result = await response.json(); + console.log("Server response:", result); + + if (result.success) { + $('#judge0-csci-sign-in-modal').modal('hide'); + showNotification(`Connected to CSCI server as ${username}`, "success"); + } else { + showNotification("Login failed: " + result.error, "error"); + } + } catch (err) { + console.error("Fetch error:", err); + showNotification("Error connecting to server. See console for details.", "error"); + } +} + +async function signOut() { + const usernameInput = document.getElementById("modal_username"); + const passwordInput = document.getElementById("modal_password"); + + try { + const response = await fetch("/ssh-sign-out", { + method: "POST", + headers: { "Content-Type": "application/json" }, + body: JSON.stringify({ action: "exit" }) + }); + + if (!response.ok) { + throw new Error(`Server returned ${response.status}`); + } + + const result = await response.json(); + console.log("Server response:", result); + + showNotification("Disconnected from CSCI server.", "warning"); + + } catch (err) { + console.error("Error signing out:", err); + showNotification("Error signing out. See console for details.", "error"); + } finally { + if (usernameInput) usernameInput.value = ""; + if (passwordInput) passwordInput.value = ""; + } +} + +document.addEventListener("DOMContentLoaded", function () { + document.getElementById("judge0-csci-sign-in-btn").addEventListener("click", showSignInModal); + document.getElementById("judge0-csci-modal-sign-in-btn").addEventListener("click", signIn); + document.getElementById("judge0-csci-modal-sign-in-cancel-btn").addEventListener("click", hideSignInModal); + document.getElementById("judge0-csci-sign-out-btn").addEventListener("click", signOut); +}); diff --git a/js/ide.js b/js/ide.js index 50c5b74e..07a3dc5a 100755 --- a/js/ide.js +++ b/js/ide.js @@ -1,24 +1,22 @@ import { usePuter } from "./puter.js"; import configuration from "./configuration.js"; -const API_KEY = ""; - -const AUTH_HEADERS = API_KEY ? { - "Authorization": `Bearer ${API_KEY}` -} : {}; +// API key and auth are handled server-side by the ssh-bridge proxy — not needed here +const AUTH_HEADERS = {}; const CE = "CE"; const EXTRA_CE = "EXTRA_CE"; -const AUTHENTICATED_CE_BASE_URL = "https://ce.judge0.com"; -const AUTHENTICATED_EXTRA_CE_BASE_URL = "https://extra-ce.judge0.com"; +// Relative URL: browser calls /judge0/... on port 80, proxy forwards to localhost:2358 +const AUTHENTICATED_CE_BASE_URL = "/judge0"; +const AUTHENTICATED_EXTRA_CE_BASE_URL = "/judge0"; var AUTHENTICATED_BASE_URL = {}; AUTHENTICATED_BASE_URL[CE] = AUTHENTICATED_CE_BASE_URL; AUTHENTICATED_BASE_URL[EXTRA_CE] = AUTHENTICATED_EXTRA_CE_BASE_URL; -const UNAUTHENTICATED_CE_BASE_URL = "https://ce.judge0.com"; -const UNAUTHENTICATED_EXTRA_CE_BASE_URL = "https://extra-ce.judge0.com"; +const UNAUTHENTICATED_CE_BASE_URL = "/judge0"; +const UNAUTHENTICATED_EXTRA_CE_BASE_URL = "/judge0"; var UNAUTHENTICATED_BASE_URL = {}; UNAUTHENTICATED_BASE_URL[CE] = UNAUTHENTICATED_CE_BASE_URL; @@ -32,15 +30,32 @@ var fontSize = 13; var layout; +// variables to track the current file name and unsaved changes +var currentFileName = "Main.java"; +var hasUnsavedChanges = false; +var isSaving = false; +var sourceContainer = null; +var suppressDirty = true; // true while we are loading/setting initial content + +// For autosave functionality +var autosaveTimer = null; +var AUTOSAVE_MS = 5000; // 2–5 seconds (pick what you want) + export var sourceEditor; var stdinEditor; var stdoutEditor; +var compileOutEditor; +var runOutEditor; var $selectLanguage; var $compilerOptions; var $commandLineArguments; var $runBtn; +var $clearBtn; var $statusLine; +var $compileBtn; +var lastCompiledCode=null; + var timeStart; @@ -56,7 +71,17 @@ var layoutConfig = { type: configuration.get("appOptions.mainLayout"), content: [{ type: "component", - width: 66, + width: 15, + componentName: "fileExplorer", + id: "fileExplorer", + title: "Explorer", + isClosable: false, + componentState: { + readOnly: false + } + }, { + type: "component", + width: 51, componentName: "source", id: "source", title: "Source Code", @@ -92,9 +117,19 @@ var layoutConfig = { } } : null, configuration.get("appOptions.showOutput") ? { type: "component", - componentName: "stdout", - id: "stdout", - title: "Output", + componentName: "compileOut", + id: "compileOut", + title: "Compile", + isClosable: false, + componentState: { + readOnly: true + } + } : null, + configuration.get("appOptions.showOutput") ? { + type: "component", + componentName: "runOut", + id: "runOut", + title: "Runtime", isClosable: false, componentState: { readOnly: true @@ -120,11 +155,313 @@ function decode(bytes) { } } +var gDirectoryHandles = []; // supports multiple open root directories +var gOpenFileHandles = []; // tracker for individual files +var gCurrentFileHandle = null; +var isPickerActive = false; +var fileExplorerGLContainer = null; +var fileExplorerVisible = true; + +function injectExplorerStyles() { + if (document.getElementById('judge0-explorer-styles')) return; + const s = document.createElement('style'); + s.id = 'judge0-explorer-styles'; + s.textContent = ` + #judge0-file-explorer-container { + color: #cccccc; + font-size: 13px; + font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; + -webkit-user-select: none; user-select: none; + padding-bottom: 20px; + } + .exp-empty { padding: 20px 14px; color: #666; font-size: 12px; line-height: 1.7; } + .exp-empty i { font-size: 22px; display: block; margin-bottom: 10px; color: #444; } + .exp-root { margin-bottom: 2px; } + .exp-root-header { + display: flex; align-items: center; gap: 5px; + padding: 5px 8px; cursor: pointer; + font-size: 11px; font-weight: 700; + letter-spacing: 0.05em; text-transform: uppercase; + color: #888; background: rgba(255,255,255,0.03); + border-bottom: 1px solid rgba(255,255,255,0.05); + } + .exp-root-header:hover { background: rgba(255,255,255,0.07); color: #ccc; } + .exp-root-chevron { font-size: 10px; opacity: 0.6; flex-shrink: 0; transition: transform 0.1s; } + .exp-root-chevron.open { transform: rotate(90deg); } + .exp-root-label { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } + .exp-root-close { + opacity: 0; cursor: pointer; padding: 1px 4px; border-radius: 3px; color: #aaa; + } + .exp-root-header:hover .exp-root-close { opacity: 0.6; } + .exp-root-close:hover { opacity: 1 !important; color: #ff6b6b; background: rgba(255,80,80,0.1); } + + .exp-depth-line { + position: absolute; left: calc(var(--depth-indent) - 8px); + top: 0; bottom: 0; width: 1px; + background: rgba(255,255,255,0.08); pointer-events: none; + } + .exp-item { display: flex; align-items: center; min-height: 22px; cursor: pointer; color: #ccc; position: relative; } + .exp-item:hover { background: rgba(255,255,255,0.06); } + .exp-item.exp-active { background: #094771 !important; color: #fff; } + .exp-item-inner { display: flex; align-items: center; gap: 6px; flex: 1; overflow: hidden; padding: 0 8px; } + .exp-folder-icon { font-size: 13px; color: #dcb67a; flex-shrink: 0; margin-right: 4px; } + .exp-file-icon { font-size: 12px; flex-shrink: 0; opacity: 0.8; margin-right: 4px; } + .exp-file-icon.java { color: #f89820; } + .exp-file-icon.python { color: #3776ab; } + .exp-file-icon.js { color: #f7df1e; } + .exp-file-icon.html { color: #e34f26; } + .exp-file-icon.css { color: #1572b6; } + .exp-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; font-family: 'Inter', sans-serif; } + .exp-actions { display: none; gap: 3px; padding-right: 8px; } + .exp-item:hover .exp-actions { display: flex; } + .exp-btn { opacity: 0.5; cursor: pointer; font-size: 11px; color: #ccc; } + .exp-btn:hover { opacity: 1; color: #fff; } + .exp-children { display: none; position: relative; } + .exp-children.open { display: block; } + `; + document.head.appendChild(s); +} + +function getFileIcon(name) { + const ext = name.split('.').pop().toLowerCase(); + const map = { + js: 'file code outline yellow', + ts: 'file code outline blue', + py: 'file code outline python', + java: 'file code outline java', + html: 'file code outline html', + css: 'file code outline css', + sql: 'database orange', + txt: 'file alternate outline grey' + }; + return map[ext] || 'file outline grey'; +} + +function markActiveFile(fileHandle) { + const container = document.getElementById('judge0-file-explorer-container'); + if (!container) return; + container.querySelectorAll('.exp-item').forEach(el => el.classList.remove('exp-active')); + if (!fileHandle) return; + const match = container.querySelector(`.exp-item[data-name="${CSS.escape(fileHandle.name)}"]`); + if (match) match.classList.add('exp-active'); +} + +async function buildFileTree(dirHandle, parentEl, depth) { + try { + let entries = []; + for await (const entry of dirHandle.values()) entries.push(entry); + entries.sort((a,b) => (a.kind === b.kind) ? a.name.localeCompare(b.name) : (a.kind === 'directory' ? -1 : 1)); + + for (const entry of entries) { + const item = document.createElement('div'); + item.className = 'exp-item'; + item.dataset.name = entry.name; + const inner = document.createElement('div'); + inner.className = 'exp-item-inner'; + inner.style.setProperty('--depth-indent', (depth * 14 + 12) + 'px'); + inner.style.paddingLeft = 'var(--depth-indent)'; + + const icon = document.createElement('i'); + const nameSpan = document.createElement('span'); + nameSpan.className = 'exp-name'; + nameSpan.innerText = entry.name; + inner.appendChild(icon); + inner.appendChild(nameSpan); + + if (depth > 0) { + const line = document.createElement('div'); + line.className = 'exp-depth-line'; + item.appendChild(line); + } + + const actions = document.createElement('div'); + actions.className = 'exp-actions'; + const makeBtn = (ic, t, h) => { + const b = document.createElement('i'); b.className = ic + ' icon exp-btn'; b.title = t; + b.onclick = e => { e.stopPropagation(); h(); }; return b; + }; + + if (entry.kind === 'directory') { + icon.className = 'folder icon exp-folder-icon'; + actions.appendChild(makeBtn('plus', 'New File', async () => { + const n = prompt('File name:'); if (n) { await entry.getFileHandle(n, {create:true}); renderExplorerRoot(dirHandle, item.closest('.exp-root')); } + })); + } else { + icon.className = getFileIcon(entry.name) + ' exp-file-icon'; + if (gCurrentFileHandle && gCurrentFileHandle.name === entry.name) item.classList.add('exp-active'); + } + + actions.appendChild(makeBtn('trash alternate outline', 'Delete', async () => { + if (confirm(`Delete ${entry.name}?`)) { await dirHandle.removeEntry(entry.name, {recursive:true}); renderExplorerRoot(dirHandle, item.closest('.exp-root')); } + })); + + item.appendChild(inner); + item.appendChild(actions); + parentEl.appendChild(item); + + if (entry.kind === 'file') { + item.onclick = async () => { + try { const f = await entry.getFile(); openFile(await f.text(), entry.name); gCurrentFileHandle = entry; markActiveFile(entry); } + catch(e) { showError('Error', e.message); } + }; + } else { + const children = document.createElement('div'); + children.className = 'exp-children'; + parentEl.appendChild(children); + let loaded = false; + item.onclick = async () => { + const open = children.classList.toggle('open'); + icon.className = open ? 'folder open icon exp-folder-icon' : 'folder icon exp-folder-icon'; + if (open && !loaded) { await buildFileTree(entry, children, depth + 1); loaded = true; } + }; + } + } + } catch(e) { console.error(e); } +} + +async function renderExplorerRoot(handle, existingEl) { + const container = document.getElementById('judge0-file-explorer-container'); + if (!container) return; + if (existingEl) existingEl.remove(); + + const root = document.createElement('div'); + root.className = 'exp-root'; + const header = document.createElement('div'); + header.className = 'exp-root-header'; + header.innerHTML = `${handle.name}`; + + const body = document.createElement('div'); + body.className = 'exp-children open'; + + header.onclick = (e) => { + if (e.target.classList.contains('exp-root-close')) { + gDirectoryHandles = gDirectoryHandles.filter(h => h !== handle); + root.remove(); if (!gDirectoryHandles.length) showExplorerEmpty(); + return; + } + const open = body.classList.toggle('open'); + header.querySelector('.exp-root-chevron').classList.toggle('open', open); + }; + + root.appendChild(header); + root.appendChild(body); + container.appendChild(root); + await buildFileTree(handle, body, 0); +} + +function showExplorerEmpty() { + const c = document.getElementById('judge0-file-explorer-container'); + if (!c) return; c.innerHTML = `
No folder opened.
File → Open Directory...
`; +} + +function renderFileItem(handle, container) { + const item = document.createElement('div'); + item.className = 'exp-item'; + item.dataset.name = handle.name; + if (gCurrentFileHandle && gCurrentFileHandle.name === handle.name) item.classList.add('exp-active'); + const inner = document.createElement('div'); + inner.className = 'exp-item-inner'; + inner.style.paddingLeft = '12px'; + inner.innerHTML = `${handle.name}`; + item.onclick = async () => { + try { const f = await handle.getFile(); openFile(await f.text(), handle.name); gCurrentFileHandle = handle; markActiveFile(handle); } + catch(e) { showError('Error', e.message); } + }; + item.oncontextmenu = (e) => showContextMenu(e, handle); + item.appendChild(inner); + container.appendChild(item); +} + +async function refreshFileExplorer() { + injectExplorerStyles(); + const c = document.getElementById('judge0-file-explorer-container'); + if (!c) return; + c.innerHTML = ''; + if (gOpenFileHandles.length > 0) { + c.appendChild(Object.assign(document.createElement('div'), {className:'exp-section-header', innerText:'Opened Files'})); + for (const f of gOpenFileHandles) renderFileItem(f, c); + } + if (gDirectoryHandles.length > 0) { + c.appendChild(Object.assign(document.createElement('div'), {className:'exp-section-header', innerText:'Workspaces'})); + for (const d of gDirectoryHandles) await renderExplorerRoot(d); + } + if (gOpenFileHandles.length === 0 && gDirectoryHandles.length === 0) showExplorerEmpty(); +} + +async function createNewFile(dir) { + const n = prompt('New file name:'); + if (n && dir) { try { await dir.getFileHandle(n, {create:true}); refreshFileExplorer(); } catch(e) { showError('Create Error', e.message); } } +} + +async function createNewFolder(dir) { + const n = prompt('New folder name:'); + if (n && dir) { try { await dir.getDirectoryHandle(n, {create:true}); refreshFileExplorer(); } catch(e) { showError('Folder Error', e.message); } } +} + +function showContextMenu(e, entry, parent) { + e.preventDefault(); e.stopPropagation(); + let m = document.getElementById('ctx-menu'); + if (!m) { m = document.createElement('div'); m.id = 'ctx-menu'; document.body.appendChild(m); } + m.innerHTML = ''; + const add = (i, l, h) => { + const d = document.createElement('div'); d.className = 'ctx-item'; d.innerHTML = ` ${l}`; + d.onclick = () => { m.style.display = 'none'; h(); }; m.appendChild(d); + }; + if (!gDirectoryHandles.length && !gOpenFileHandles.length) { + add('folder open outline', 'Open Folder...', openDirectoryAction); + } else { + const target = (entry && entry.kind === 'directory') ? entry : (parent || gDirectoryHandles[0]); + if (target) { + add('file outline', 'New File...', () => createNewFile(target)); + add('folder outline', 'New Folder...', () => createNewFolder(target)); + } + if (entry) { + m.appendChild(Object.assign(document.createElement('div'), {className:'ctx-sep'})); + add('trash alternate outline red', 'Delete', async () => { + if (confirm(`Delete ${entry.name}?`)) { + try { + if (parent) await parent.removeEntry(entry.name, {recursive:true}); + else gOpenFileHandles = gOpenFileHandles.filter(f => f !== entry); + refreshFileExplorer(); + } catch(err) { showError('Delete Error', err.message); } + } + }); + } + } + m.style.left = e.clientX + 'px'; m.style.top = e.clientY + 'px'; m.style.display = 'block'; + const hide = () => { m.style.display = 'none'; document.removeEventListener('mousedown', hide); }; + setTimeout(() => document.addEventListener('mousedown', hide), 10); +} + +document.addEventListener('contextmenu', (e) => { + const c = document.getElementById('judge0-file-explorer-container'); + if (c && c.contains(e.target)) { + if (e.target === c || e.target.classList.contains('exp-empty') || e.target.classList.contains('exp-section-header')) { + showContextMenu(e, null, gDirectoryHandles[0]); + } + } +}); + +async function openDirectoryAction(e) { + if (e) { e.preventDefault(); e.stopImmediatePropagation(); } + if (isPickerActive || !window.showDirectoryPicker) return; + isPickerActive = true; + try { + const h = await window.showDirectoryPicker({ mode: 'readwrite' }); + if (!gDirectoryHandles.find(x => x.name === h.name)) { + gDirectoryHandles.push(h); + refreshFileExplorer(); + } + } catch (err) { if (err.name !== 'AbortError') showError('Error', err.message); } + finally { isPickerActive = false; } +} + + function showError(title, content) { $("#judge0-site-modal #title").html(title); $("#judge0-site-modal .content").html(content); - let reportTitle = encodeURIComponent(`Error on ${window.location.href}`); + let FTitle = encodeURIComponent(`Error on ${window.location.href}`); let reportBody = encodeURIComponent( `**Error Title**: ${title}\n` + `**Error Timestamp**: \`${new Date()}\`\n` + @@ -132,7 +469,7 @@ function showError(title, content) { `**Description**:\n${content}` ); - $("#report-problem-btn").attr("href", `https://github.com/judge0/ide/issues/new?title=${reportTitle}&body=${reportBody}`); + $("#report-problem-btn").attr("href", `https://github.com/judge0/ide/issues/new?title=${FTitle}&body=${reportBody}`); $("#judge0-site-modal").modal("show"); } @@ -156,16 +493,33 @@ function handleResult(data) { const status = data.status; const stdout = decode(data.stdout); - const compileOutput = decode(data.compile_output); + const stderr = decode(data.stderr); + const compileOutput = data.compile_output ? decode(data.compile_output) : null; const time = (data.time === null ? "-" : data.time + "s"); const memory = (data.memory === null ? "-" : data.memory + "KB"); $statusLine.html(`${status.description}, ${time}, ${memory} (TAT: ${tat}ms)`); - const output = [compileOutput, stdout].filter(x => x).join("\n").trimEnd(); - - stdoutEditor.setValue(output); - + /*const output = [compileOutput, stdout].filter(x => x).join("\n").trimEnd(); + stdoutEditor.setValue(output);*/ + + const runtimeOutput = [stdout, stderr].filter(x => x).join("\n").trimEnd(); + const compileText = (compileOutput || "").trimEnd(); + + // Compile tab: show compiler output or a friendly success message + if (compileOutEditor) { + compileOutEditor.setValue(compileText || "Compilation successful."); + const lastLine = compileOutEditor.getModel()?.getLineCount?.() ?? 1; + compileOutEditor.revealLine(lastLine); + } + // Runtime tab: show stdout + stderr (can be empty if program prints nothing) + if (runOutEditor) { + runOutEditor.setValue(runtimeOutput); + const lastLine = runOutEditor.getModel()?.getLineCount?.() ?? 1; + runOutEditor.revealLine(lastLine); + } + const output = [compileText, runtimeOutput].filter(x => x).join("\n").trimEnd(); + $runBtn.removeClass("loading"); window.top.postMessage(JSON.parse(JSON.stringify({ @@ -177,6 +531,20 @@ function handleResult(data) { })), "*"); } +// Clear I/O editors and status line before running new code +function clearIO() { + // Clear the I/O editors + if (stdinEditor) stdinEditor.setValue(""); + if (compileOutEditor) compileOutEditor.setValue(""); + if (runOutEditor) runOutEditor.setValue(""); + + // Optional: clear old status line + if ($statusLine) $statusLine.html(""); + + // Optional: stop a stuck spinner + if ($runBtn) $runBtn.removeClass("loading"); +} + async function getSelectedLanguage() { return getLanguage(getSelectedLanguageFlavor(), getSelectedLanguageId()) } @@ -189,19 +557,117 @@ function getSelectedLanguageFlavor() { return $selectLanguage.find(":selected").attr("flavor"); } -function run() { - if (sourceEditor.getValue().trim() === "") { +function compileOnly() { + const currentCode = sourceEditor.getValue().trim(); + + if (currentCode === "") { showError("Error", "Source code can't be empty!"); + lastCompiledCode = null; + updateRunButtonState(); return; + } + + lastCompiledCode = null; + updateRunButtonState(); + + if (compileOutEditor) compileOutEditor.setValue(""); + if (runOutEditor) runOutEditor.setValue(""); + + $statusLine.html("Compiling..."); + // Switch to Compile tab when compiling + const compileTab = layout.root.getItemsById("compileOut")[0]; + if (compileTab && compileTab.parent && compileTab.parent.header && compileTab.parent.header.parent) { + compileTab.parent.header.parent.setActiveContentItem(compileTab); + } + + let sourceValue = encode(sourceEditor.getValue()); + let languageId = getSelectedLanguageId(); + let flavor = getSelectedLanguageFlavor(); + + let data = { + source_code: sourceValue, + language_id: languageId, + stdin: encode(""), + redirect_stderr_to_stdout: false + }; + + $.ajax({ + url: `${AUTHENTICATED_BASE_URL[flavor]}/submissions?base64_encoded=true&wait=true`, + type: "POST", + contentType: "application/json", + data: JSON.stringify(data), + headers: AUTH_HEADERS, + success: function (data) { + const compileOutput = decode(data.compile_output); + + if (compileOutEditor) { + compileOutEditor.setValue( + compileOutput ? compileOutput : "Compilation successful." + ); + } + + if (runOutEditor) { + runOutEditor.setValue(""); + } + + $statusLine.html(data.status.description); + + // success only when there is no compile output + if (!compileOutput) { + lastCompiledCode = currentCode; + } else { + lastCompiledCode = null; + } + + updateRunButtonState(); + }, + error: function (jqXHR) { + lastCompiledCode = null; + updateRunButtonState(); + handleRunError(jqXHR); + } + }); +} + +function updateRunButtonState() { + if (!$runBtn) return; + + const currentCode = sourceEditor ? sourceEditor.getValue().trim() : ""; + const canRun = !!lastCompiledCode && currentCode === lastCompiledCode; + + $runBtn.prop("disabled", !canRun); + + if (canRun) { + $runBtn.removeClass("disabled"); + $runBtn.addClass("primary"); } else { - $runBtn.addClass("loading"); + $runBtn.addClass("disabled"); + $runBtn.removeClass("primary"); } +} + +function run() { + const currentCode = sourceEditor.getValue().trim(); - stdoutEditor.setValue(""); + if (!lastCompiledCode || currentCode !== lastCompiledCode) { + updateRunButtonState(); + return; + } + + $runBtn.addClass("loading"); + + //stdoutEditor.setValue(""); + if (compileOutEditor) compileOutEditor.setValue(""); + if (runOutEditor) runOutEditor.setValue(""); $statusLine.html(""); - let x = layout.root.getItemsById("stdout")[0]; - x.parent.header.parent.setActiveContentItem(x); + /*let x = layout.root.getItemsById("runOut")[0]; + x.parent.header.parent.setActiveContentItem(x);*/ + + const runtimeTab = layout.root.getItemsById("runOut")[0]; + if (runtimeTab && runtimeTab.parent && runtimeTab.parent.header && runtimeTab.parent.header.parent) { + runtimeTab.parent.header.parent.setActiveContentItem(runtimeTab); + } let sourceValue = encode(sourceEditor.getValue()); let stdinValue = encode(stdinEditor.getValue()); @@ -299,19 +765,68 @@ function fetchSubmission(flavor, region, submission_token, iteration) { }); } +// Helper function to update the source tab title with unsaved changes indicator and saving status +function updateSourceTabTitle() { + if (!sourceContainer) return; // source tab not ready yet + + var dot = hasUnsavedChanges ? " •" : ""; + var saving = isSaving ? " — Saving..." : ""; + sourceContainer.setTitle(currentFileName + dot + saving); +} + + function setSourceCodeName(name) { - $(".lm_title")[0].innerText = name; + currentFileName = name; + updateSourceTabTitle(); } -function getSourceCodeName() { +/*function setSourceCodeName(name) { + $(".lm_title")[0].innerText = name; +}*/ + +/*function getSourceCodeName() { return $(".lm_title")[0].innerText; -} +}*/ function openFile(content, filename) { clear(); + + suppressDirty = true; // prevent dirty flag during load sourceEditor.setValue(content); + suppressDirty = false; // now allow user edits to mark dirty + selectLanguageForExtension(filename.split(".").pop()); setSourceCodeName(filename); + + hasUnsavedChanges = false; // freshly loaded file = clean + updateSourceTabTitle(); // ensure correct title +} + +function saveNow(reason) { + if (!sourceEditor) return; + + isSaving = true; + updateSourceTabTitle(); + + var content = sourceEditor.getValue(); + + // MVP: save to localStorage (silent autosave) + localStorage.setItem("autosave:" + currentFileName, content); + + isSaving = false; + hasUnsavedChanges = false; + updateSourceTabTitle(); +} + +// Schedules an automatic save after the user stops typing +function scheduleAutosave() { + if (autosaveTimer) clearTimeout(autosaveTimer); + + autosaveTimer = setTimeout(function () { + // Only save if there are unsaved changes + if (!hasUnsavedChanges) return; + saveNow("idle"); + }, AUTOSAVE_MS); } function saveFile(content, filename) { @@ -325,16 +840,44 @@ function saveFile(content, filename) { URL.revokeObjectURL(link.href); } -async function openAction() { +// When opening a single file, use the File System Access API to keep a writable handle +async function openFilePickerAndHandle() { + if (isPickerActive) return; + if (!window.showOpenFilePicker) { + document.getElementById("open-file-input").click(); + return; + } + isPickerActive = true; + try { + const [fileHandle] = await window.showOpenFilePicker(); + const file = await fileHandle.getFile(); + openFile(await file.text(), file.name); + gCurrentFileHandle = fileHandle; + if (!gOpenFileHandles.find(o => o.name === fileHandle.name)) { + gOpenFileHandles.push(fileHandle); + refreshFileExplorer(); + } else { + markActiveFile(fileHandle); + } + } catch (err) { + if (err.name !== "AbortError") console.error(err); + } finally { + isPickerActive = false; + } +} + +async function openAction(e) { + if (e) e.preventDefault(); if (usePuter()) { gPuterFile = await puter.ui.showOpenFilePicker(); openFile(await (await gPuterFile.read()).text(), gPuterFile.name); } else { - document.getElementById("open-file-input").click(); + openFilePickerAndHandle(); } } -async function saveAction() { +async function saveAction(e) { + if (e) e.preventDefault(); if (usePuter()) { if (gPuterFile) { gPuterFile.write(sourceEditor.getValue()); @@ -342,15 +885,48 @@ async function saveAction() { gPuterFile = await puter.ui.showSaveFilePicker(sourceEditor.getValue(), getSourceCodeName()); setSourceCodeName(gPuterFile.name); } + hasUnsavedChanges = false; + updateSourceTabTitle(); } else { - saveFile(sourceEditor.getValue(), getSourceCodeName()); + if (gCurrentFileHandle && window.showSaveFilePicker) { + try { + const writable = await gCurrentFileHandle.createWritable(); + await writable.write(sourceEditor.getValue()); + await writable.close(); + hasUnsavedChanges = false; + updateSourceTabTitle(); + } catch (err) { + if (err.name !== "AbortError") showError("Save Error", err.message); + } + } else { + if (window.showSaveFilePicker) { + try { + const newHandle = await window.showSaveFilePicker({ suggestedName: currentFileName }); + const writable = await newHandle.createWritable(); + await writable.write(sourceEditor.getValue()); + await writable.close(); + gCurrentFileHandle = newHandle; + setSourceCodeName(newHandle.name); + hasUnsavedChanges = false; + updateSourceTabTitle(); + } catch (err) { + if (err.name !== "AbortError") showError("Save Error", err.message); + } + } else { + saveFile(sourceEditor.getValue(), currentFileName); + hasUnsavedChanges = false; + updateSourceTabTitle(); + } + } } } function setFontSizeForAllEditors(fontSize) { - sourceEditor.updateOptions({ fontSize: fontSize }); - stdinEditor.updateOptions({ fontSize: fontSize }); - stdoutEditor.updateOptions({ fontSize: fontSize }); + if (sourceEditor) sourceEditor.updateOptions({ fontSize }); + if (stdinEditor) stdinEditor.updateOptions({ fontSize }); + if (stdoutEditor) stdoutEditor.updateOptions({ fontSize }); + if (compileOutEditor) compileOutEditor.updateOptions({ fontSize }); + if (runOutEditor) runOutEditor.updateOptions({ fontSize }); } async function loadLangauges() { @@ -395,6 +971,7 @@ async function loadLangauges() { }).always(function () { options.sort((a, b) => a.text.localeCompare(b.text)); $selectLanguage.append(options); + $selectLanguage.parent(".ui.dropdown").dropdown("refresh"); resolve(); }); }); @@ -402,8 +979,11 @@ async function loadLangauges() { }; async function loadSelectedLanguage(skipSetDefaultSourceCodeName = false) { + if (!sourceEditor) { + console.warn("Editor not initialized yet"); + return; + } monaco.editor.setModelLanguage(sourceEditor.getModel(), $selectLanguage.find(":selected").attr("langauge_mode")); - if (!skipSetDefaultSourceCodeName) { setSourceCodeName((await getSelectedLanguage()).source_file); } @@ -495,13 +1075,27 @@ document.addEventListener("DOMContentLoaded", async function () { loadSelectedLanguage(skipSetDefaultSourceCodeName); }); - await loadLangauges(); + try { + await loadLangauges(); + } catch (e) { + console.warn("Could not load backend APIs. Skipping fetch to render UI...", e); + } + // Default editor language for MVP + const JAVA_ID = "91"; // replace after you confirm + $selectLanguage.parent(".ui.dropdown").dropdown("set selected", JAVA_ID); + loadSelectedLanguage(true); // ensure Monaco updates; true avoids filename reset $compilerOptions = $("#compiler-options"); $commandLineArguments = $("#command-line-arguments"); $runBtn = $("#run-btn"); + updateRunButtonState(); + + $clearBtn = $("#clear-btn"); + $compileBtn = $("#compile-btn"); $runBtn.click(run); + $clearBtn.click(clearIO); + $compileBtn.click(compileOnly); $("#open-file-input").change(function (e) { const selectedFile = e.target.files[0]; @@ -564,19 +1158,62 @@ document.addEventListener("DOMContentLoaded", async function () { layout = new GoldenLayout(layoutConfig, $("#judge0-site-content")); layout.registerComponent("source", function (container, state) { + sourceContainer = container; sourceEditor = monaco.editor.create(container.getElement()[0], { automaticLayout: true, scrollBeyondLastLine: true, readOnly: state.readOnly, - language: "cpp", + language: "java", minimap: { enabled: true - } + }, + + // Disable auto-indent + autoIndent: "none", + formatOnType: false, + formatOnPaste: false, + + //Disable automatic bracket/quote closing + autoClosingBrackets: "never", + autoClosingQuotes: "never", + autoSurround: "never", + + // Disable autocomplete + quickSuggestions: false, + suggestOnTriggerCharacters: false, + parameterHints: { enabled: false }, + acceptSuggestionOnEnter: "off", + tabCompletion: "off", + wordBasedSuggestions: false, + snippetSuggestions: "none" + }); + + // When the user types in the source editor, mark file as modified + sourceEditor.onDidChangeModelContent(function () { + if (suppressDirty) return; // ignore changes caused by setValue/openFile/init + hasUnsavedChanges = true; + updateSourceTabTitle(); + scheduleAutosave(); // schedule an autosave after user stops typing for a bit + }); + + // After initial editor setup/content load finishes, mark file as clean and enable dirty tracking + setTimeout(function () { + hasUnsavedChanges = false; + suppressDirty = false; + updateSourceTabTitle(); + }, 0); + + sourceEditor.addCommand(monaco.KeyMod.CtrlCmd | monaco.KeyCode.KeyS, function () { + saveNow("manual"); }); sourceEditor.addCommand(monaco.KeyMod.CtrlCmd | monaco.KeyCode.Enter, run); - monaco.languages.registerInlineCompletionsProvider('*', { + sourceEditor.onDidChangeModelContent(() => { + lastCompiledCode = null; + updateRunButtonState(); + }); + /*monaco.languages.registerInlineCompletionsProvider('*', { provideInlineCompletions: async (model, position) => { if (!puter.auth.isSignedIn() || !document.getElementById("judge0-inline-suggestions").checked || !configuration.get("appOptions.showAIAssistant")) { return; @@ -644,7 +1281,7 @@ document.addEventListener("DOMContentLoaded", async function () { }, handleItemDidShow: () => { }, freeInlineCompletions: () => { } - }); + });*/ }); layout.registerComponent("stdin", function (container, state) { @@ -671,10 +1308,55 @@ document.addEventListener("DOMContentLoaded", async function () { }); }); + layout.registerComponent("compileOut", function (container, state) { + compileOutEditor = monaco.editor.create(container.getElement()[0], { + automaticLayout: true, + scrollBeyondLastLine: false, + readOnly: true, + language: "plaintext", + minimap: { enabled: false + } + }); + }); + + layout.registerComponent("runOut", function (container, state) { + runOutEditor = monaco.editor.create(container.getElement()[0], { + automaticLayout: true, + scrollBeyondLastLine: false, + readOnly: true, + language: "plaintext", + minimap: { enabled: false + } + }); + }); + layout.registerComponent("ai", function (container, state) { container.getElement()[0].appendChild(document.getElementById("judge0-chat-container")); }); + layout.registerComponent("fileExplorer", function (container, state) { + fileExplorerGLContainer = container; + + let el = document.getElementById("judge0-file-explorer-container"); + if (!el) { + el = document.createElement("div"); + el.id = "judge0-file-explorer-container"; + } + el.style.cssText = 'height:100%; overflow-y:auto; font-family: inherit; box-sizing: border-box;'; + + // Empty state message + el.innerHTML = [ + '
', + '', + '
No directory opened.
', + '
File → Open Directory...
', + '
' + ].join(''); + + container.getElement()[0].style.overflow = 'hidden'; + container.getElement()[0].appendChild(el); + }); + layout.on("initialised", function () { setDefaults(); refreshLayoutSize(); @@ -704,8 +1386,12 @@ document.addEventListener("DOMContentLoaded", async function () { }); } - document.getElementById("judge0-open-file-btn").addEventListener("click", openAction); - document.getElementById("judge0-save-btn").addEventListener("click", saveAction); + $("#judge0-open-file-btn").on("mousedown", openAction); + $("#judge0-open-dir-btn").on("mousedown", openDirectoryAction); + $("#judge0-save-btn").on("mousedown", saveAction); + $("#judge0-save-local-btn").on("mousedown", (e) => { + saveFile(sourceEditor.getValue(), currentFileName); + }); window.onmessage = function (e) { if (!e.data) { @@ -752,113 +1438,14 @@ document.addEventListener("DOMContentLoaded", async function () { }); const DEFAULT_SOURCE = "\ -#include \n\ -#include \n\ -#include \n\ -#include \n\ -#include \n\ -#include \n\ -#include \n\ -\n\ -using Vertex = std::uint16_t;\n\ -using Cost = std::uint16_t;\n\ -using Edge = std::pair< Vertex, Cost >;\n\ -using Graph = std::vector< std::vector< Edge > >;\n\ -using CostTable = std::vector< std::uint64_t >;\n\ -\n\ -constexpr auto kInfiniteCost{ std::numeric_limits< CostTable::value_type >::max() };\n\ -\n\ -auto dijkstra( Vertex const start, Vertex const end, Graph const & graph, CostTable & costTable )\n\ -{\n\ - std::fill( costTable.begin(), costTable.end(), kInfiniteCost );\n\ - costTable[ start ] = 0;\n\ -\n\ - std::set< std::pair< CostTable::value_type, Vertex > > minHeap;\n\ - minHeap.emplace( 0, start );\n\ -\n\ - while ( !minHeap.empty() )\n\ - {\n\ - auto const vertexCost{ minHeap.begin()->first };\n\ - auto const vertex { minHeap.begin()->second };\n\ -\n\ - minHeap.erase( minHeap.begin() );\n\ -\n\ - if ( vertex == end )\n\ - {\n\ - break;\n\ - }\n\ -\n\ - for ( auto const & neighbourEdge : graph[ vertex ] )\n\ - {\n\ - auto const & neighbour{ neighbourEdge.first };\n\ - auto const & cost{ neighbourEdge.second };\n\ -\n\ - if ( costTable[ neighbour ] > vertexCost + cost )\n\ - {\n\ - minHeap.erase( { costTable[ neighbour ], neighbour } );\n\ - costTable[ neighbour ] = vertexCost + cost;\n\ - minHeap.emplace( costTable[ neighbour ], neighbour );\n\ - }\n\ - }\n\ +public class Main {\n\ + public static void main(String[] args) {\n\ + System.out.println(\"Hello, World!\");\n\ }\n\ -\n\ - return costTable[ end ];\n\ -}\n\ -\n\ -int main()\n\ -{\n\ - constexpr std::uint16_t maxVertices{ 10000 };\n\ -\n\ - Graph graph ( maxVertices );\n\ - CostTable costTable( maxVertices );\n\ -\n\ - std::uint16_t testCases;\n\ - std::cin >> testCases;\n\ -\n\ - while ( testCases-- > 0 )\n\ - {\n\ - for ( auto i{ 0 }; i < maxVertices; ++i )\n\ - {\n\ - graph[ i ].clear();\n\ - }\n\ -\n\ - std::uint16_t numberOfVertices;\n\ - std::uint16_t numberOfEdges;\n\ -\n\ - std::cin >> numberOfVertices >> numberOfEdges;\n\ -\n\ - for ( auto i{ 0 }; i < numberOfEdges; ++i )\n\ - {\n\ - Vertex from;\n\ - Vertex to;\n\ - Cost cost;\n\ -\n\ - std::cin >> from >> to >> cost;\n\ - graph[ from ].emplace_back( to, cost );\n\ - }\n\ -\n\ - Vertex start;\n\ - Vertex end;\n\ -\n\ - std::cin >> start >> end;\n\ -\n\ - auto const result{ dijkstra( start, end, graph, costTable ) };\n\ -\n\ - if ( result == kInfiniteCost )\n\ - {\n\ - std::cout << \"NO\\n\";\n\ - }\n\ - else\n\ - {\n\ - std::cout << result << '\\n';\n\ - }\n\ - }\n\ -\n\ - return 0;\n\ }\n\ "; -const DEFAULT_STDIN = "\ +/*const DEFAULT_STDIN = "\ 3\n\ 3 2\n\ 1 2 5\n\ @@ -872,11 +1459,12 @@ const DEFAULT_STDIN = "\ 3 1\n\ 1 2 4\n\ 1 3\n\ -"; +";*/ +const DEFAULT_STDIN = ""; const DEFAULT_COMPILER_OPTIONS = ""; const DEFAULT_CMD_ARGUMENTS = ""; -const DEFAULT_LANGUAGE_ID = 105; // C++ (GCC 14.1.0) (https://ce.judge0.com/languages/105) +const DEFAULT_LANGUAGE_ID = 62; // Java (OpenJDK 13.0.1) (https://ce.judge0.com/languages/62) function getEditorLanguageMode(languageName) { const DEFAULT_EDITOR_LANGUAGE_MODE = "plaintext"; diff --git a/js/server.cert b/js/server.cert new file mode 100644 index 00000000..7c9f3a0b --- /dev/null +++ b/js/server.cert @@ -0,0 +1,24 @@ +-----BEGIN CERTIFICATE----- +MIID9zCCAt+gAwIBAgIUWunv3pGPwCtG1ZwAbmiAl2G6JsEwDQYJKoZIhvcNAQEL +BQAwgYoxCzAJBgNVBAYTAlVTMQ4wDAYDVQQIDAVUZXhhczEQMA4GA1UEBwwHQWJp +bGVuZTEiMCAGA1UECgwZSGFyZGluLVNpbW1vbnMgVW5pdmVyc2l0eTEUMBIGA1UE +AwwLY3NjaSBzZXJ2ZXIxHzAdBgkqhkiG9w0BCQEWEGR3MjExMkBoc3V0eC5lZHUw +HhcNMjYwMzA3MDIwODIzWhcNMjYwNTA2MDIwODIzWjCBijELMAkGA1UEBhMCVVMx +DjAMBgNVBAgMBVRleGFzMRAwDgYDVQQHDAdBYmlsZW5lMSIwIAYDVQQKDBlIYXJk +aW4tU2ltbW9ucyBVbml2ZXJzaXR5MRQwEgYDVQQDDAtjc2NpIHNlcnZlcjEfMB0G +CSqGSIb3DQEJARYQZHcyMTEyQGhzdXR4LmVkdTCCASIwDQYJKoZIhvcNAQEBBQAD +ggEPADCCAQoCggEBANAusTQ6eqtk0PP/xc5ClQBvGI/tu6HutSb65OmR7bAjhqfA +SNUAmJHbbKUeA3LCF1Nvnsyfd65OoBjeoARhdThszzgxLCGFBXHCIm6sSuWRbKwW +aeHkxPIn3qVPL28HJMRulPlWglPYyguAMizhAWUxMfwYTjm27YVU61zgO5KLHjqs +JNXI4gYamBraBfBKvvnpoYVnqXR/Zguw7rnEbZnh4B3kDgKepN8XFXDb5Hp1QD1j +UUR6J0XQLVLSgAZzKSaO29rv3PvYcu7+4i8RaI16gwob585FdOaLL4DPXZzDKxXz +hwjlwiqHr5UC88wCssMWqrdP/CAaMGDq1ivIiFUCAwEAAaNTMFEwHQYDVR0OBBYE +FK5v0DKOAU5foyLmZ84NQIHnLyIEMB8GA1UdIwQYMBaAFK5v0DKOAU5foyLmZ84N +QIHnLyIEMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAJ4Zgx6W +ETYI24lhtZAl4WpG9myveZ0nZxLk3mTrHn3iO4xjftLnYRPyoAPrFKEYLh89rgNS +6pJ/VrSCbEVRiXhDX0ScSSJ5+BKfFMF7/ZCyv7pcJTHBBuIv5a/EbIOkUfZ+hZNU +jLguCiyAj+2Hxun2bGz9jdARQZrmJUqkQo0VzN759Vd2TGL1/jidJrA25j0KG0od +rgb+qxFYeHiQ/cVBONO0Yo5Fp0GhPcNp/c3//n/BKIUYkShLP9DtcWLc24+jYL+r +dm8vm+TPOd9yE020oQhtzSbFauDSTJBUYTVbFk0cvUeTvXqDZV71A3dKqyGORvCl +ftZ540Xxugq8pRM= +-----END CERTIFICATE----- diff --git a/js/server.key b/js/server.key new file mode 100644 index 00000000..c3ad5c34 --- /dev/null +++ b/js/server.key @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQDQLrE0OnqrZNDz +/8XOQpUAbxiP7buh7rUm+uTpke2wI4anwEjVAJiR22ylHgNywhdTb57Mn3euTqAY +3qAEYXU4bM84MSwhhQVxwiJurErlkWysFmnh5MTyJ96lTy9vByTEbpT5VoJT2MoL +gDIs4QFlMTH8GE45tu2FVOtc4DuSix46rCTVyOIGGpga2gXwSr756aGFZ6l0f2YL +sO65xG2Z4eAd5A4CnqTfFxVw2+R6dUA9Y1FEeidF0C1S0oAGcykmjtva79z72HLu +/uIvEWiNeoMKG+fORXTmiy+Az12cwysV84cI5cIqh6+VAvPMArLDFqq3T/wgGjBg +6tYryIhVAgMBAAECggEAAKV8eGCMG/cirPdI2nSbeNZfeabv07dliZry1gTVe5wI +oYG32C15y84mHrcipJsUrnYkxJbkLL7iwWEDly/kSMoRtKd2bx42H53ONJDFZMQY +Vcp2BrUKpYPZLaM6zvnzM8byIHoTyoXcTr/VqA0Ez5chBBrhN02pnCXg2zd5B+H0 +RYpew/iJwh7p4SEjwhQND9xktd1Dvz5qn9sUfwbtxxx5aqV2q6WusE+e54l0YiXU +SGNKze3NIXXjyBMBX1/+00D0tMnnO88EurNiHI9m2uHCiMlSb7W4PLgG7TLVE2x0 +7ynY4ljjS8S/xItlK4klz34tFmA3FDAk+uzr+57fUQKBgQDohdnU8flPxpBWDJ/t +mxmfcWVArJoWBudfQ4G5oApdDF/HbnbYOW7YzNggalEb7c19tOqQVIMXX4I6ryN/ +7NAalyYIumrlimPBbrw4jNLW1qC2rd8TVDSpQZxk0V71hh0DQgJQbZrjMAm9tRAa +C56Qu+KFmJPqWsj17Zdzq4n9LQKBgQDlM7MbQSYVgf9AHUx6Lm83i7fdsTU4Nqpu +2ir9nUfVYIhZ8uEs1zWqHS20Cn5NxF5BUQaqA/W6qAIqCTgwDdooCRSXEKgpfvn9 +9l6TD6we4XpL/M+75/FpmUdL+VWkx1ra8IWYfCEtZ+FHrWya8GyA1EWn4pmIJKSs +Nc7IWCvAyQKBgHGrbY/iMsTDBzBpv40Cc4Y0gxEYz8LQ4S7662H5UNeoAvKVl9eg +TAYELeu6zaffmsNHPBwOlH9Km3lgwPP6qsk09szxhOxtuNKI9c6XWULZbXugiBsE +4TGU94V5rPhN9cTv8f2rdzp0824gI5z37S5ICzbQHg9FDlTbL1zGkRCJAoGAXfji +eEwvxyWzd6ALmRSsuMNqMVTUkyWmnyiH88+mgg/AF9EDDZV3BTZNZMHgoxXd5z3H +U7Gn8E2uBXoeNWWYik2eyYkkyU6sRLnccMM+OLMNp1YR/eLNEhSsLLQfrx2lXJq8 +y5YpLCqpLPAn1Sa59eASZxD7DdyoP4sYKwArgDECgYBmMWBJUbmeE8HTzkqU5RKm +ZYRSaYFogQTsr63VnHxXXcupbzAC6ACB83fUDUcHwCBpTOnh5ALqnlYRdegR4/DN +1WnlKctMwjKpPiuNyPqOkXvdPML43k/cGlj3lukQGZz73ujbkQRtK5Kifap0290B +g5VPo9LmwiaO6caedDEeBA== +-----END PRIVATE KEY----- diff --git a/js/ssh-bridge.js b/js/ssh-bridge.js new file mode 100644 index 00000000..db9ac780 --- /dev/null +++ b/js/ssh-bridge.js @@ -0,0 +1,108 @@ +// SSH-server Bridge + +const express = require("express"); +const { Client } = require("ssh2"); +const { createProxyMiddleware } = require("http-proxy-middleware"); +const http = require("http"); +const path = require("path"); + +const app = express(); + +// Judge0 auth token — lives here on the server, never sent to the browser +const JUDGE0_AUTH_TOKEN = "yjjcWNpQGFQMkpmHQasOKegTvGL8yZ1sI4WM7YYkCuVoUwYt"; + +// Proxy all /judge0/* requests to the Judge0 backend on port 2358 +// The browser calls /judge0/languages → this strips /judge0 and forwards to localhost:2358/languages +// The proxy injects the X-Auth-Token header so the browser never needs to know the key +app.use("/judge0", createProxyMiddleware({ + target: "http://localhost:2358", + changeOrigin: true, + pathRewrite: { "^/judge0": "" }, + on: { + proxyReq: (proxyReq) => { + proxyReq.setHeader("X-Auth-Token", JUDGE0_AUTH_TOKEN); + } + } +})); + +// Enable JSON parsing +app.use(express.json({ limit: "10kb" })); + +// Serve frontend static files (index.html, js/, css/) from parent folder +app.use(express.static(path.join(__dirname, ".."))); + +// Optional: log every request +app.use((req, res, next) => { + console.log(`[${new Date().toISOString()}] ${req.method} ${req.url}`); + next(); +}); + +// Serve index.html at root +app.get("/", (req, res) => { + res.sendFile(path.join(__dirname, "..", "index.html")); +}); + +// Variable to hold active SSH session +let sshSession = null; + +// SSH endpoint for sign-in +app.post("/ssh-sign-in", (req, res) => { + const { username, password } = req.body; + + if (!username || !password) { + return res.json({ success: false, error: "Username or password missing" }); + } + + console.log(`[SSH LOGIN ATTEMPT] From ${req.ip} → username: ${username}`); + + const conn = new Client(); + let responded = false; + + conn.on("ready", () => { + console.log(`[SSH LOGIN SUCCESS] username: ${username}`); + sshSession = conn; // keep the session active for sign-out + if (!responded) { + responded = true; + res.json({ success: true, message: "SSH connection established" }); + } + }); + + conn.on("error", (err) => { + console.log(`[SSH LOGIN FAILED] username: ${username} → ${err.message}`); + if (!responded) { + responded = true; + res.json({ success: false, error: "SSH connection failed: " + err.message }); + } + }); + + conn.connect({ + host: "csci.hsutx.edu", + port: 22, + username, + password, + readyTimeout: 10000, + }); +}); + +// SSH endpoint for sign-out +app.post("/ssh-sign-out", (req, res) => { + console.log("Sign-out request received:", req.body); + + if (sshSession) { + try { + sshSession.end(); // safely close SSH session + sshSession = null; + return res.json({ success: true, message: "SSH session closed" }); + } catch (err) { + console.error("Error closing SSH session:", err); + return res.status(500).json({ success: false, message: "Failed to close SSH session" }); + } + } else { + return res.status(400).json({ success: false, message: "No active SSH session" }); + } +}); + +// Start HTTP server on port 80 +http.createServer(app).listen(80, "0.0.0.0", () => { + console.log("Server running on http://localhost:80"); +}); \ No newline at end of file diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 00000000..17f4c276 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,1110 @@ +{ + "name": "ide", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "dependencies": { + "cors": "^2.8.6", + "express": "^5.2.1", + "http-proxy-middleware": "^3.0.5", + "ssh2": "^1.17.0" + } + }, + "node_modules/@types/http-proxy": { + "version": "1.17.17", + "resolved": "https://registry.npmjs.org/@types/http-proxy/-/http-proxy-1.17.17.tgz", + "integrity": "sha512-ED6LB+Z1AVylNTu7hdzuBqOgMnvG/ld6wGCG8wFnAzKX5uyW2K3WD52v0gnLCTK/VLpXtKckgWuyScYK6cSPaw==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/node": { + "version": "25.5.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-25.5.0.tgz", + "integrity": "sha512-jp2P3tQMSxWugkCUKLRPVUpGaL5MVFwF8RDuSRztfwgN1wmqJeMSbKlnEtQqU8UrhTmzEmZdu2I6v2dpp7XIxw==", + "license": "MIT", + "dependencies": { + "undici-types": "~7.18.0" + } + }, + "node_modules/accepts": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz", + "integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==", + "license": "MIT", + "dependencies": { + "mime-types": "^3.0.0", + "negotiator": "^1.0.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/asn1": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", + "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", + "license": "MIT", + "dependencies": { + "safer-buffer": "~2.1.0" + } + }, + "node_modules/bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==", + "license": "BSD-3-Clause", + "dependencies": { + "tweetnacl": "^0.14.3" + } + }, + "node_modules/body-parser": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.2.2.tgz", + "integrity": "sha512-oP5VkATKlNwcgvxi0vM0p/D3n2C3EReYVX+DNYs5TjZFn/oQt2j+4sVJtSMr18pdRr8wjTcBl6LoV+FUwzPmNA==", + "license": "MIT", + "dependencies": { + "bytes": "^3.1.2", + "content-type": "^1.0.5", + "debug": "^4.4.3", + "http-errors": "^2.0.0", + "iconv-lite": "^0.7.0", + "on-finished": "^2.4.1", + "qs": "^6.14.1", + "raw-body": "^3.0.1", + "type-is": "^2.0.1" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/braces": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", + "license": "MIT", + "dependencies": { + "fill-range": "^7.1.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/buildcheck": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/buildcheck/-/buildcheck-0.0.7.tgz", + "integrity": "sha512-lHblz4ahamxpTmnsk+MNTRWsjYKv965MwOrSJyeD588rR3Jcu7swE+0wN5F+PbL5cjgu/9ObkhfzEPuofEMwLA==", + "optional": true, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/content-disposition": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.0.1.tgz", + "integrity": "sha512-oIXISMynqSqm241k6kcQ5UwttDILMK4BiurCfGEREw6+X9jkkpEe5T9FZaApyLGGOnFuyMWZpdolTXMtvEJ08Q==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz", + "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.2.2.tgz", + "integrity": "sha512-D76uU73ulSXrD1UXF4KE2TMxVVwhsnCgfAyTg9k8P6KGZjlXKrOLe4dJQKI3Bxi5wjesZoFXJWElNWBjPZMbhg==", + "license": "MIT", + "engines": { + "node": ">=6.6.0" + } + }, + "node_modules/cors": { + "version": "2.8.6", + "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.6.tgz", + "integrity": "sha512-tJtZBBHA6vjIAaF6EnIaq6laBBP9aq/Y3ouVJjEfoHbRBcHBAHYcMh/w8LDrk2PvIMMq8gmopa5D4V8RmbrxGw==", + "license": "MIT", + "dependencies": { + "object-assign": "^4", + "vary": "^1" + }, + "engines": { + "node": ">= 0.10" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/cpu-features": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/cpu-features/-/cpu-features-0.0.10.tgz", + "integrity": "sha512-9IkYqtX3YHPCzoVg1Py+o9057a3i0fp7S530UWokCSaFVTc7CwXPRiOjRjBQQ18ZCNafx78YfnG+HALxtVmOGA==", + "hasInstallScript": true, + "optional": true, + "dependencies": { + "buildcheck": "~0.0.6", + "nan": "^2.19.0" + }, + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", + "license": "MIT" + }, + "node_modules/encodeurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-2.0.0.tgz", + "integrity": "sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "license": "MIT" + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/eventemitter3": { + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", + "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", + "license": "MIT" + }, + "node_modules/express": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/express/-/express-5.2.1.tgz", + "integrity": "sha512-hIS4idWWai69NezIdRt2xFVofaF4j+6INOpJlVOLDO8zXGpUVEVzIYk12UUi2JzjEzWL3IOAxcTubgz9Po0yXw==", + "license": "MIT", + "dependencies": { + "accepts": "^2.0.0", + "body-parser": "^2.2.1", + "content-disposition": "^1.0.0", + "content-type": "^1.0.5", + "cookie": "^0.7.1", + "cookie-signature": "^1.2.1", + "debug": "^4.4.0", + "depd": "^2.0.0", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "finalhandler": "^2.1.0", + "fresh": "^2.0.0", + "http-errors": "^2.0.0", + "merge-descriptors": "^2.0.0", + "mime-types": "^3.0.0", + "on-finished": "^2.4.1", + "once": "^1.4.0", + "parseurl": "^1.3.3", + "proxy-addr": "^2.0.7", + "qs": "^6.14.0", + "range-parser": "^1.2.1", + "router": "^2.2.0", + "send": "^1.1.0", + "serve-static": "^2.2.0", + "statuses": "^2.0.1", + "type-is": "^2.0.1", + "vary": "^1.1.2" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/fill-range": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", + "license": "MIT", + "dependencies": { + "to-regex-range": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/finalhandler": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-2.1.1.tgz", + "integrity": "sha512-S8KoZgRZN+a5rNwqTxlZZePjT/4cnm0ROV70LedRHZ0p8u9fRID0hJUZQpkKLzro8LfmC8sx23bY6tVNxv8pQA==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.0", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "on-finished": "^2.4.1", + "parseurl": "^1.3.3", + "statuses": "^2.0.1" + }, + "engines": { + "node": ">= 18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/follow-redirects": { + "version": "1.15.11", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.11.tgz", + "integrity": "sha512-deG2P0JfjrTxl50XGCDyfI97ZGVCxIpfKYmfyrQ54n5FO/0gfIES8C/Psl6kWVDolizcaaxZJnTS0QSMxvnsBQ==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "license": "MIT", + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-2.0.0.tgz", + "integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/http-errors": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.1.tgz", + "integrity": "sha512-4FbRdAX+bSdmo4AUFuS0WNiPz8NgFt+r8ThgNWmlrjQjt1Q7ZR9+zTlce2859x4KSXrwIsaeTqDoKQmtP8pLmQ==", + "license": "MIT", + "dependencies": { + "depd": "~2.0.0", + "inherits": "~2.0.4", + "setprototypeof": "~1.2.0", + "statuses": "~2.0.2", + "toidentifier": "~1.0.1" + }, + "engines": { + "node": ">= 0.8" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/http-proxy": { + "version": "1.18.1", + "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz", + "integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==", + "license": "MIT", + "dependencies": { + "eventemitter3": "^4.0.0", + "follow-redirects": "^1.0.0", + "requires-port": "^1.0.0" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/http-proxy-middleware": { + "version": "3.0.5", + "resolved": "https://registry.npmjs.org/http-proxy-middleware/-/http-proxy-middleware-3.0.5.tgz", + "integrity": "sha512-GLZZm1X38BPY4lkXA01jhwxvDoOkkXqjgVyUzVxiEK4iuRu03PZoYHhHRwxnfhQMDuaxi3vVri0YgSro/1oWqg==", + "license": "MIT", + "dependencies": { + "@types/http-proxy": "^1.17.15", + "debug": "^4.3.6", + "http-proxy": "^1.18.1", + "is-glob": "^4.0.3", + "is-plain-object": "^5.0.0", + "micromatch": "^4.0.8" + }, + "engines": { + "node": "^14.15.0 || ^16.10.0 || >=18.0.0" + } + }, + "node_modules/iconv-lite": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.2.tgz", + "integrity": "sha512-im9DjEDQ55s9fL4EYzOAv0yMqmMBSZp6G0VvFyTMPKWxiSBHUj9NW/qqLmXUwXrrM7AvqSlTCfvqRb0cM8yYqw==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "license": "MIT", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", + "license": "MIT", + "dependencies": { + "is-extglob": "^2.1.1" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "license": "MIT", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/is-plain-object": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", + "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/is-promise": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-4.0.0.tgz", + "integrity": "sha512-hvpoI6korhJMnej285dSg6nu1+e6uxs7zG3BYAm5byqDsgJNWwxzM6z6iZiAgQR4TJ30JmBTOwqZUw3WlyH3AQ==", + "license": "MIT" + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/media-typer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.0.tgz", + "integrity": "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/merge-descriptors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-2.0.0.tgz", + "integrity": "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "license": "MIT", + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/mime-db": { + "version": "1.54.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.54.0.tgz", + "integrity": "sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.2.tgz", + "integrity": "sha512-Lbgzdk0h4juoQ9fCKXW4by0UJqj+nOOrI9MJ1sSj4nI8aI2eo1qmvQEie4VD1glsS250n15LsWsYtCugiStS5A==", + "license": "MIT", + "dependencies": { + "mime-db": "^1.54.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/nan": { + "version": "2.25.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.25.0.tgz", + "integrity": "sha512-0M90Ag7Xn5KMLLZ7zliPWP3rT90P6PN+IzVFS0VqmnPktBk3700xUVv8Ikm9EUaUE5SDWdp/BIxdENzVznpm1g==", + "license": "MIT", + "optional": true + }, + "node_modules/negotiator": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz", + "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "license": "MIT", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-to-regexp": { + "version": "8.3.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-8.3.0.tgz", + "integrity": "sha512-7jdwVIRtsP8MYpdXSwOS0YdD0Du+qOoF/AEPIt88PcCFrZCzx41oxku1jD88hZBwbNUIEfpqvuhjFaMAqMTWnA==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/picomatch": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.2.tgz", + "integrity": "sha512-V7+vQEJ06Z+c5tSye8S+nHUfI51xoXIXjHQ99cQtKUkQqqO1kO/KCJUfZXuB47h/YBlDhah2H3hdUGXn8ie0oA==", + "license": "MIT", + "engines": { + "node": ">=8.6" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "license": "MIT", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/qs": { + "version": "6.15.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.15.0.tgz", + "integrity": "sha512-mAZTtNCeetKMH+pSjrb76NAM8V9a05I9aBZOHztWy/UqcJdQYNsf59vrRKWnojAT9Y+GbIvoTBC++CPHqpDBhQ==", + "license": "BSD-3-Clause", + "dependencies": { + "side-channel": "^1.1.0" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-3.0.2.tgz", + "integrity": "sha512-K5zQjDllxWkf7Z5xJdV0/B0WTNqx6vxG70zJE4N0kBs4LovmEYWJzQGxC9bS9RAKu3bgM40lrd5zoLJ12MQ5BA==", + "license": "MIT", + "dependencies": { + "bytes": "~3.1.2", + "http-errors": "~2.0.1", + "iconv-lite": "~0.7.0", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/requires-port": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", + "integrity": "sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==", + "license": "MIT" + }, + "node_modules/router": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/router/-/router-2.2.0.tgz", + "integrity": "sha512-nLTrUKm2UyiL7rlhapu/Zl45FwNgkZGaCpZbIHajDYgwlJCOzLSk+cIPAnsEqV955GjILJnKbdQC1nVPz+gAYQ==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.0", + "depd": "^2.0.0", + "is-promise": "^4.0.0", + "parseurl": "^1.3.3", + "path-to-regexp": "^8.0.0" + }, + "engines": { + "node": ">= 18" + } + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "license": "MIT" + }, + "node_modules/send": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/send/-/send-1.2.1.tgz", + "integrity": "sha512-1gnZf7DFcoIcajTjTwjwuDjzuz4PPcY2StKPlsGAQ1+YH20IRVrBaXSWmdjowTJ6u8Rc01PoYOGHXfP1mYcZNQ==", + "license": "MIT", + "dependencies": { + "debug": "^4.4.3", + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "etag": "^1.8.1", + "fresh": "^2.0.0", + "http-errors": "^2.0.1", + "mime-types": "^3.0.2", + "ms": "^2.1.3", + "on-finished": "^2.4.1", + "range-parser": "^1.2.1", + "statuses": "^2.0.2" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/serve-static": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-2.2.1.tgz", + "integrity": "sha512-xRXBn0pPqQTVQiC8wyQrKs2MOlX24zQ0POGaj0kultvoOCstBQM5yvOhAVSUwOMjQtTvsPWoNCHfPGwaaQJhTw==", + "license": "MIT", + "dependencies": { + "encodeurl": "^2.0.0", + "escape-html": "^1.0.3", + "parseurl": "^1.3.3", + "send": "^1.2.0" + }, + "engines": { + "node": ">= 18" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/express" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "license": "ISC" + }, + "node_modules/side-channel": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/ssh2": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/ssh2/-/ssh2-1.17.0.tgz", + "integrity": "sha512-wPldCk3asibAjQ/kziWQQt1Wh3PgDFpC0XpwclzKcdT1vql6KeYxf5LIt4nlFkUeR8WuphYMKqUA56X4rjbfgQ==", + "hasInstallScript": true, + "dependencies": { + "asn1": "^0.2.6", + "bcrypt-pbkdf": "^1.0.2" + }, + "engines": { + "node": ">=10.16.0" + }, + "optionalDependencies": { + "cpu-features": "~0.0.10", + "nan": "^2.23.0" + } + }, + "node_modules/statuses": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.2.tgz", + "integrity": "sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "license": "MIT", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==", + "license": "Unlicense" + }, + "node_modules/type-is": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.0.1.tgz", + "integrity": "sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw==", + "license": "MIT", + "dependencies": { + "content-type": "^1.0.5", + "media-typer": "^1.1.0", + "mime-types": "^3.0.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/undici-types": { + "version": "7.18.2", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.18.2.tgz", + "integrity": "sha512-AsuCzffGHJybSaRrmr5eHr81mwJU3kjw6M+uprWvCXiNeN9SOGwQ3Jn8jb8m3Z6izVgknn1R0FTCEAP2QrLY/w==", + "license": "MIT" + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "license": "ISC" + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 00000000..f4ff9807 --- /dev/null +++ b/package.json @@ -0,0 +1,8 @@ +{ + "dependencies": { + "cors": "^2.8.6", + "express": "^5.2.1", + "http-proxy-middleware": "^3.0.5", + "ssh2": "^1.17.0" + } +}