@wrongstack/webui 0.87.0 → 0.89.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/server/entry.js +30 -10
- package/dist/server/entry.js.map +1 -1
- package/dist/server/index.js +30 -10
- package/dist/server/index.js.map +1 -1
- package/package.json +5 -5
package/dist/server/entry.js
CHANGED
|
@@ -172,6 +172,7 @@ import {
|
|
|
172
172
|
atomicWrite as atomicWrite3,
|
|
173
173
|
createDefaultPipelines,
|
|
174
174
|
DEFAULT_CONTEXT_WINDOW_MODE_ID,
|
|
175
|
+
DEFAULT_SESSION_PRUNE_DAYS,
|
|
175
176
|
DEFAULT_TOOLS_CONFIG,
|
|
176
177
|
listContextWindowModes,
|
|
177
178
|
repairToolUseAdjacency,
|
|
@@ -2059,7 +2060,7 @@ async function startWebUI(opts = {}) {
|
|
|
2059
2060
|
const events = new EventBus();
|
|
2060
2061
|
events.setLogger(logger);
|
|
2061
2062
|
const sessionStore = new DefaultSessionStore2({ dir: wpaths.projectSessions });
|
|
2062
|
-
sessionStore.prune(
|
|
2063
|
+
sessionStore.prune(DEFAULT_SESSION_PRUNE_DAYS).then((count) => {
|
|
2063
2064
|
if (count > 0) logger.info(`Pruned ${count} old session${count === 1 ? "" : "s"}.`);
|
|
2064
2065
|
}).catch(() => void 0);
|
|
2065
2066
|
const sessionReader = new DefaultSessionReader({ store: sessionStore });
|
|
@@ -2353,7 +2354,10 @@ async function startWebUI(opts = {}) {
|
|
|
2353
2354
|
if (typeof rawObj === "object" && rawObj !== null) {
|
|
2354
2355
|
const obj = rawObj;
|
|
2355
2356
|
if ("__proto__" in obj || "constructor" in obj || "prototype" in obj) {
|
|
2356
|
-
send(ws, {
|
|
2357
|
+
send(ws, {
|
|
2358
|
+
type: "error",
|
|
2359
|
+
payload: { phase: "parse", message: "Invalid message object" }
|
|
2360
|
+
});
|
|
2357
2361
|
} else {
|
|
2358
2362
|
await handleMessage(ws, client, rawObj);
|
|
2359
2363
|
}
|
|
@@ -2954,10 +2958,7 @@ async function startWebUI(opts = {}) {
|
|
|
2954
2958
|
break;
|
|
2955
2959
|
}
|
|
2956
2960
|
const removed = expectDefined2(context.todos[targetIdx]);
|
|
2957
|
-
const next = [
|
|
2958
|
-
...context.todos.slice(0, targetIdx),
|
|
2959
|
-
...context.todos.slice(targetIdx + 1)
|
|
2960
|
-
];
|
|
2961
|
+
const next = [...context.todos.slice(0, targetIdx), ...context.todos.slice(targetIdx + 1)];
|
|
2961
2962
|
context.state.replaceTodos(next);
|
|
2962
2963
|
sendResult(ws, true, `Removed: ${removed.content}`);
|
|
2963
2964
|
broadcast(clients, { type: "todos.updated", payload: { todos: next } });
|
|
@@ -2971,12 +2972,26 @@ async function startWebUI(opts = {}) {
|
|
|
2971
2972
|
const plan = await loadPlan(planPath);
|
|
2972
2973
|
send(ws, {
|
|
2973
2974
|
type: "plan.updated",
|
|
2974
|
-
payload: {
|
|
2975
|
+
payload: {
|
|
2976
|
+
plan: plan ?? {
|
|
2977
|
+
version: 1,
|
|
2978
|
+
sessionId: session.id,
|
|
2979
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2980
|
+
items: []
|
|
2981
|
+
}
|
|
2982
|
+
}
|
|
2975
2983
|
});
|
|
2976
2984
|
} catch {
|
|
2977
2985
|
send(ws, {
|
|
2978
2986
|
type: "plan.updated",
|
|
2979
|
-
payload: {
|
|
2987
|
+
payload: {
|
|
2988
|
+
plan: {
|
|
2989
|
+
version: 1,
|
|
2990
|
+
sessionId: session.id,
|
|
2991
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2992
|
+
items: []
|
|
2993
|
+
}
|
|
2994
|
+
}
|
|
2980
2995
|
});
|
|
2981
2996
|
}
|
|
2982
2997
|
} else {
|
|
@@ -3136,9 +3151,14 @@ async function startWebUI(opts = {}) {
|
|
|
3136
3151
|
}
|
|
3137
3152
|
default:
|
|
3138
3153
|
if (msg.type.startsWith("autophase.")) {
|
|
3139
|
-
await autoPhaseHandler.handleMessage(
|
|
3154
|
+
await autoPhaseHandler.handleMessage(
|
|
3155
|
+
msg
|
|
3156
|
+
);
|
|
3140
3157
|
} else {
|
|
3141
|
-
send(ws, {
|
|
3158
|
+
send(ws, {
|
|
3159
|
+
type: "error",
|
|
3160
|
+
payload: { phase: "handleMessage", message: `Unknown message type: ${msg.type}` }
|
|
3161
|
+
});
|
|
3142
3162
|
}
|
|
3143
3163
|
}
|
|
3144
3164
|
}
|