feat(vscode): auto-refresh read-only agent view (#2832)

This commit is contained in:
Hunter Bown
2026-06-05 22:21:06 -07:00
committed by GitHub
parent e5974aa850
commit 50b773f1de
10 changed files with 197 additions and 59 deletions
+8
View File
@@ -48,11 +48,13 @@ function readRuntimeConfig() {
const host = config.get("runtimeHost", "127.0.0.1").trim() || "127.0.0.1";
const port = config.get("runtimePort", 7878);
const token = config.get("runtimeToken", "").trim();
const interval = config.get("agentViewRefreshIntervalSeconds", 15);
return {
commandPath,
host,
port,
token: token.length > 0 ? token : undefined,
agentViewRefreshIntervalSeconds: clampRefreshInterval(interval),
};
}
function runtimeBaseUrl(config) {
@@ -229,6 +231,12 @@ function readString(value) {
function readNumber(value) {
return typeof value === "number" && Number.isFinite(value) ? value : undefined;
}
function clampRefreshInterval(value) {
if (!Number.isFinite(value)) {
return 15;
}
return Math.max(0, Math.min(300, Math.floor(value)));
}
function shellQuote(value) {
if (/^[A-Za-z0-9_./:=+-]+$/.test(value)) {
return value;