@wrongstack/webui 0.84.1 → 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/index.js
CHANGED
|
@@ -171,6 +171,7 @@ import {
|
|
|
171
171
|
atomicWrite as atomicWrite3,
|
|
172
172
|
createDefaultPipelines,
|
|
173
173
|
DEFAULT_CONTEXT_WINDOW_MODE_ID,
|
|
174
|
+
DEFAULT_SESSION_PRUNE_DAYS,
|
|
174
175
|
DEFAULT_TOOLS_CONFIG,
|
|
175
176
|
listContextWindowModes,
|
|
176
177
|
repairToolUseAdjacency,
|
|
@@ -2066,7 +2067,7 @@ async function startWebUI(opts = {}) {
|
|
|
2066
2067
|
const events = new EventBus();
|
|
2067
2068
|
events.setLogger(logger);
|
|
2068
2069
|
const sessionStore = new DefaultSessionStore2({ dir: wpaths.projectSessions });
|
|
2069
|
-
sessionStore.prune(
|
|
2070
|
+
sessionStore.prune(DEFAULT_SESSION_PRUNE_DAYS).then((count) => {
|
|
2070
2071
|
if (count > 0) logger.info(`Pruned ${count} old session${count === 1 ? "" : "s"}.`);
|
|
2071
2072
|
}).catch(() => void 0);
|
|
2072
2073
|
const sessionReader = new DefaultSessionReader({ store: sessionStore });
|
|
@@ -2360,7 +2361,10 @@ async function startWebUI(opts = {}) {
|
|
|
2360
2361
|
if (typeof rawObj === "object" && rawObj !== null) {
|
|
2361
2362
|
const obj = rawObj;
|
|
2362
2363
|
if ("__proto__" in obj || "constructor" in obj || "prototype" in obj) {
|
|
2363
|
-
send(ws, {
|
|
2364
|
+
send(ws, {
|
|
2365
|
+
type: "error",
|
|
2366
|
+
payload: { phase: "parse", message: "Invalid message object" }
|
|
2367
|
+
});
|
|
2364
2368
|
} else {
|
|
2365
2369
|
await handleMessage(ws, client, rawObj);
|
|
2366
2370
|
}
|
|
@@ -2961,10 +2965,7 @@ async function startWebUI(opts = {}) {
|
|
|
2961
2965
|
break;
|
|
2962
2966
|
}
|
|
2963
2967
|
const removed = expectDefined2(context.todos[targetIdx]);
|
|
2964
|
-
const next = [
|
|
2965
|
-
...context.todos.slice(0, targetIdx),
|
|
2966
|
-
...context.todos.slice(targetIdx + 1)
|
|
2967
|
-
];
|
|
2968
|
+
const next = [...context.todos.slice(0, targetIdx), ...context.todos.slice(targetIdx + 1)];
|
|
2968
2969
|
context.state.replaceTodos(next);
|
|
2969
2970
|
sendResult(ws, true, `Removed: ${removed.content}`);
|
|
2970
2971
|
broadcast(clients, { type: "todos.updated", payload: { todos: next } });
|
|
@@ -2978,12 +2979,26 @@ async function startWebUI(opts = {}) {
|
|
|
2978
2979
|
const plan = await loadPlan(planPath);
|
|
2979
2980
|
send(ws, {
|
|
2980
2981
|
type: "plan.updated",
|
|
2981
|
-
payload: {
|
|
2982
|
+
payload: {
|
|
2983
|
+
plan: plan ?? {
|
|
2984
|
+
version: 1,
|
|
2985
|
+
sessionId: session.id,
|
|
2986
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2987
|
+
items: []
|
|
2988
|
+
}
|
|
2989
|
+
}
|
|
2982
2990
|
});
|
|
2983
2991
|
} catch {
|
|
2984
2992
|
send(ws, {
|
|
2985
2993
|
type: "plan.updated",
|
|
2986
|
-
payload: {
|
|
2994
|
+
payload: {
|
|
2995
|
+
plan: {
|
|
2996
|
+
version: 1,
|
|
2997
|
+
sessionId: session.id,
|
|
2998
|
+
updatedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
2999
|
+
items: []
|
|
3000
|
+
}
|
|
3001
|
+
}
|
|
2987
3002
|
});
|
|
2988
3003
|
}
|
|
2989
3004
|
} else {
|
|
@@ -3143,9 +3158,14 @@ async function startWebUI(opts = {}) {
|
|
|
3143
3158
|
}
|
|
3144
3159
|
default:
|
|
3145
3160
|
if (msg.type.startsWith("autophase.")) {
|
|
3146
|
-
await autoPhaseHandler.handleMessage(
|
|
3161
|
+
await autoPhaseHandler.handleMessage(
|
|
3162
|
+
msg
|
|
3163
|
+
);
|
|
3147
3164
|
} else {
|
|
3148
|
-
send(ws, {
|
|
3165
|
+
send(ws, {
|
|
3166
|
+
type: "error",
|
|
3167
|
+
payload: { phase: "handleMessage", message: `Unknown message type: ${msg.type}` }
|
|
3168
|
+
});
|
|
3149
3169
|
}
|
|
3150
3170
|
}
|
|
3151
3171
|
}
|