From bc5936365aa7a91c6c6da1e754522da9ab495fab Mon Sep 17 00:00:00 2001 From: Dominik Jain Date: Wed, 15 Oct 2025 17:45:42 +0200 Subject: [PATCH] REPL: Reuse last input --- mcp-server/src/static/repl.html | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/mcp-server/src/static/repl.html b/mcp-server/src/static/repl.html index 24f7620..8ced2bb 100644 --- a/mcp-server/src/static/repl.html +++ b/mcp-server/src/static/repl.html @@ -171,7 +171,7 @@ -

Penpot MCP REPL

+

Penpot API REPL

@@ -183,25 +183,26 @@ $(document).ready(function () { let isExecuting = false; let entryCounter = 1; + let lastCode = ""; // store the last executed code // create the initial input entry createNewEntry(); function createNewEntry() { const entryId = `entry-${entryCounter}`; + const defaultCode = lastCode || ""; const entryHtml = ` -
-
In [${entryCounter}]:
-
- - +return 'This will be the result';">${escapeHtml(defaultCode)} + +
-
- `; + `; $("#repl-container").append(entryHtml); @@ -327,6 +328,9 @@ return 'This will be the result';"> $codeInput.prop("readonly", true); $(`#execute-btn-${entryNum}`).remove(); + // store the code for the next entry + lastCode = code; + // create a new entry for the next input createNewEntry();