@wrongstack/webui 0.281.3 → 0.282.0

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.
Files changed (45) hide show
  1. package/dist/assets/{AnalyticsDashboard-Cb08RPms.js → AnalyticsDashboard-BrQc2ss-.js} +1 -1
  2. package/dist/assets/AutoPhaseView-8NTdnZ0a.js +1 -0
  3. package/dist/assets/{CodeEditor-CSTcX3Za.js → CodeEditor-C-pJLtUR.js} +1 -1
  4. package/dist/assets/{DebugDashboard-D6-znhBO.js → DebugDashboard-BHpiEOcf.js} +1 -1
  5. package/dist/assets/{DesignGalleryView-yKa55dpM.js → DesignGalleryView-M6Hp7s9b.js} +1 -1
  6. package/dist/assets/KanbanView-nMv98m0N.js +1 -0
  7. package/dist/assets/{MailboxDetailView-DbX_cNcu.js → MailboxDetailView-g3IQx4DB.js} +1 -1
  8. package/dist/assets/OfficeMapPanel-D3VE7UCd.js +4 -0
  9. package/dist/assets/{ProcessMonitor-DvPiHdzj.js → ProcessMonitor-CbfQYneY.js} +1 -1
  10. package/dist/assets/{QueuePanel-BVvnJXHh.js → QueuePanel-eGK1SSKx.js} +1 -1
  11. package/dist/assets/{RefreshDebugView-pmMPOier.js → RefreshDebugView-BXq2P3wo.js} +1 -1
  12. package/dist/assets/{SddBoardView-CGJbbRrh.js → SddBoardView-DvuH4f4e.js} +2 -2
  13. package/dist/assets/{SddFlowGraph-WW0qCx0t.js → SddFlowGraph-CtMpzU4S.js} +1 -1
  14. package/dist/assets/SddWizard-G55Yw9Bb.js +1 -0
  15. package/dist/assets/{SessionsDashboard-VwXvmSxS.js → SessionsDashboard-Dqsrp5CK.js} +1 -1
  16. package/dist/assets/SkillDetailView-CX9zeWBG.js +2 -0
  17. package/dist/assets/{SpecsView-BRdxB6rh.js → SpecsView-BnUsqkrG.js} +1 -1
  18. package/dist/assets/{TerminalPanel-CAcbPNO_.js → TerminalPanel-BCpddej2.js} +1 -1
  19. package/dist/assets/{chat-store-YPRVJGbn.js → chat-store-CIMOL6-x.js} +1 -1
  20. package/dist/assets/{i18n-BJCOtLro.js → i18n-CNo6A2vu.js} +1 -1
  21. package/dist/assets/index-BhO3caLf.js +146 -0
  22. package/dist/assets/index-D7_FeyCA.css +1 -0
  23. package/dist/assets/{session-store-Do0MGnXu.js → session-store-DN1UYDL9.js} +1 -1
  24. package/dist/assets/ui-store-BdOsq6T-.js +1 -0
  25. package/dist/assets/utils-DBns3uMk.js +1 -0
  26. package/dist/assets/{vendor-Bhf0nZ3B.js → vendor-Ch4m_qLI.js} +25 -25
  27. package/dist/assets/{ws-client-D9IQ9580.js → ws-client-BAV7SLzK.js} +1 -1
  28. package/dist/assets/{xyflow-Bp8EMwkC.js → xyflow-D5_yey7w.js} +3 -3
  29. package/dist/index.html +9 -9
  30. package/dist/index.js +6154 -5253
  31. package/dist/index.js.map +1 -1
  32. package/dist/server/entry.js +345 -13
  33. package/dist/server/entry.js.map +1 -1
  34. package/dist/server/index.js +345 -13
  35. package/dist/server/index.js.map +1 -1
  36. package/dist/types.d.ts +18 -3
  37. package/package.json +6 -6
  38. package/dist/assets/AutoPhaseView--Ec4Mom8.js +0 -1
  39. package/dist/assets/OfficeMapPanel-BMxzEv_S.js +0 -4
  40. package/dist/assets/SddWizard-Cen90k6M.js +0 -1
  41. package/dist/assets/SkillDetailView-CjUeZv6V.js +0 -2
  42. package/dist/assets/index-BSuiEQIC.js +0 -145
  43. package/dist/assets/index-CMiinLaB.css +0 -1
  44. package/dist/assets/ui-store-D3gGpJWY.js +0 -1
  45. package/dist/assets/utils-sFCTikqz.js +0 -1
@@ -5720,7 +5720,16 @@ function setupEvents(deps2) {
5720
5720
  });
5721
5721
  });
5722
5722
  events.on("provider.response", (e) => {
5723
- broadcast2(clients, { type: "provider.response", payload: sessionPayload2({ sessionId: e.sessionId, usage: e.usage, stopReason: e.stopReason, messageId: "current" }) });
5723
+ broadcast2(clients, {
5724
+ type: "provider.response",
5725
+ payload: sessionPayload2({
5726
+ sessionId: e.sessionId,
5727
+ content: e.content,
5728
+ usage: e.usage,
5729
+ stopReason: e.stopReason,
5730
+ messageId: "current"
5731
+ })
5732
+ });
5724
5733
  });
5725
5734
  events.on("ctx.pct", (e) => {
5726
5735
  broadcast2(clients, {
@@ -8702,12 +8711,13 @@ function createConnectionHandler(opts) {
8702
8711
  void opts.sessionStartPayload().then(async (payload) => {
8703
8712
  const enriched = { ...payload };
8704
8713
  try {
8705
- const live = opts.context.messages ?? [];
8714
+ const replay = await opts.loadReplay?.();
8715
+ const live = replay?.messages ?? opts.context.messages ?? [];
8706
8716
  const slice = live.length > REPLAY_MESSAGE_CAP ? live.slice(-REPLAY_MESSAGE_CAP) : live;
8707
8717
  if (slice.length > 0) {
8708
8718
  enriched.replayMessages = slice;
8709
8719
  }
8710
- const total = opts.tokenCounter.total();
8720
+ const total = replay?.usage ?? opts.tokenCounter.total();
8711
8721
  if (total.input + total.output + (total.cacheRead ?? 0) + (total.cacheWrite ?? 0) > 0) {
8712
8722
  enriched.replayUsage = {
8713
8723
  input: total.input,
@@ -8834,8 +8844,8 @@ async function handleGoalGet(projectRoot, broadcast2) {
8834
8844
  }
8835
8845
 
8836
8846
  // src/server/handlers/worklist-handlers.ts
8837
- function sendResult2(ws, ctx, ok, message) {
8838
- ctx.send(ws, { type: ok ? "ok" : "error", message });
8847
+ function sendResult2(ws, ctx, ok2, message) {
8848
+ ctx.send(ws, { type: ok2 ? "ok" : "error", message });
8839
8849
  }
8840
8850
  function sessionPayload(ctx, payload) {
8841
8851
  const provided = payload["sessionId"];
@@ -9056,6 +9066,295 @@ async function handleWorklistMessage(ctx, ws, msg) {
9056
9066
  }
9057
9067
  }
9058
9068
 
9069
+ // src/server/kanban-routes.ts
9070
+ import {
9071
+ addColumn,
9072
+ addTask,
9073
+ assignTask,
9074
+ copyTaskToBoard,
9075
+ createBoard,
9076
+ duplicateBoard,
9077
+ generateBoardFromDescription,
9078
+ getBoard,
9079
+ getTask,
9080
+ listBoards,
9081
+ moveTask,
9082
+ parseLinesIntoTasks,
9083
+ removeBoard,
9084
+ removeColumn,
9085
+ removeTask,
9086
+ transferTaskToBoard,
9087
+ updateBoard,
9088
+ updateTask
9089
+ } from "@wrongstack/core";
9090
+ function ok(ws, type, data) {
9091
+ send(ws, { type, payload: { success: true, data: data ?? null } });
9092
+ }
9093
+ function fail(ws, type, message) {
9094
+ send(ws, { type, payload: { success: false, error: message } });
9095
+ }
9096
+ async function handleKanbanRoute(ws, msg, ctx) {
9097
+ if (!msg.type.startsWith("kanban.")) return false;
9098
+ const payload = msg.payload;
9099
+ const type = msg.type;
9100
+ try {
9101
+ switch (type) {
9102
+ case "kanban.list":
9103
+ ok(ws, type, await listBoards(ctx.projectRoot));
9104
+ return true;
9105
+ case "kanban.get": {
9106
+ const boardId = payload?.boardId;
9107
+ if (!boardId) {
9108
+ fail(ws, type, "boardId required");
9109
+ return true;
9110
+ }
9111
+ const board = await getBoard(ctx.projectRoot, boardId);
9112
+ board ? ok(ws, type, board) : fail(ws, type, `Board not found: ${boardId}`);
9113
+ return true;
9114
+ }
9115
+ case "kanban.create": {
9116
+ const title = payload?.title;
9117
+ if (!title) {
9118
+ fail(ws, type, "title required");
9119
+ return true;
9120
+ }
9121
+ ok(
9122
+ ws,
9123
+ type,
9124
+ await createBoard(ctx.projectRoot, {
9125
+ title,
9126
+ ...payload?.description ? { description: payload.description } : {},
9127
+ ...payload?.tags ? { tags: payload.tags } : {},
9128
+ ...payload?.columns ? { columns: payload.columns } : {}
9129
+ })
9130
+ );
9131
+ return true;
9132
+ }
9133
+ case "kanban.update": {
9134
+ const boardId = payload?.boardId;
9135
+ if (!boardId) {
9136
+ fail(ws, type, "boardId required");
9137
+ return true;
9138
+ }
9139
+ const board = await updateBoard(ctx.projectRoot, boardId, {
9140
+ ...payload?.title ? { title: payload.title } : {},
9141
+ ...payload?.description ? { description: payload.description } : {},
9142
+ ...payload?.tags ? { tags: payload.tags } : {},
9143
+ ...payload?.columns ? { columns: payload.columns } : {}
9144
+ });
9145
+ board ? ok(ws, type, board) : fail(ws, type, `Board not found: ${boardId}`);
9146
+ return true;
9147
+ }
9148
+ case "kanban.duplicate": {
9149
+ const boardId = payload?.boardId;
9150
+ if (!boardId) {
9151
+ fail(ws, type, "boardId required");
9152
+ return true;
9153
+ }
9154
+ const board = await duplicateBoard(ctx.projectRoot, boardId, {
9155
+ ...payload?.title ? { title: payload.title } : {},
9156
+ ...typeof payload?.includeTasks === "boolean" ? { includeTasks: payload.includeTasks } : {},
9157
+ ...typeof payload?.includeCompletedTasks === "boolean" ? { includeCompletedTasks: payload.includeCompletedTasks } : {},
9158
+ ...typeof payload?.preserveAssignment === "boolean" ? { preserveAssignment: payload.preserveAssignment } : {}
9159
+ });
9160
+ board ? ok(ws, type, board) : fail(ws, type, `Board not found: ${boardId}`);
9161
+ return true;
9162
+ }
9163
+ case "kanban.delete": {
9164
+ const boardId = payload?.boardId;
9165
+ if (!boardId) {
9166
+ fail(ws, type, "boardId required");
9167
+ return true;
9168
+ }
9169
+ ok(ws, type, { removed: await removeBoard(ctx.projectRoot, boardId) });
9170
+ return true;
9171
+ }
9172
+ case "kanban.generate": {
9173
+ const description = payload?.description;
9174
+ if (!description) {
9175
+ fail(ws, type, "description required");
9176
+ return true;
9177
+ }
9178
+ const board = await createBoard(
9179
+ ctx.projectRoot,
9180
+ generateBoardFromDescription({
9181
+ description,
9182
+ ...payload?.title ? { title: payload.title } : {},
9183
+ ...payload?.context ? { context: payload.context } : {}
9184
+ })
9185
+ );
9186
+ for (const taskInput of parseLinesIntoTasks(
9187
+ description,
9188
+ board.columns[0]?.id ?? "backlog"
9189
+ )) {
9190
+ await addTask(ctx.projectRoot, board.id, taskInput);
9191
+ }
9192
+ ok(ws, type, await getBoard(ctx.projectRoot, board.id) ?? board);
9193
+ return true;
9194
+ }
9195
+ case "kanban.task.add": {
9196
+ const boardId = payload?.boardId;
9197
+ const title = payload?.title;
9198
+ if (!boardId || !title) {
9199
+ fail(ws, type, "boardId and title required");
9200
+ return true;
9201
+ }
9202
+ const result = await addTask(ctx.projectRoot, boardId, {
9203
+ title,
9204
+ columnId: payload?.columnId ?? "backlog",
9205
+ ...payload?.description ? { description: payload.description } : {},
9206
+ ...payload?.priority ? { priority: payload.priority } : {},
9207
+ ...payload?.assignedAgent ? { assignedAgent: payload.assignedAgent } : {},
9208
+ ...payload?.labels ? { labels: payload.labels } : {}
9209
+ });
9210
+ result ? ok(ws, type, result.task) : fail(ws, type, `Board not found: ${boardId}`);
9211
+ return true;
9212
+ }
9213
+ case "kanban.task.update": {
9214
+ const boardId = payload?.boardId;
9215
+ const taskId = payload?.taskId;
9216
+ if (!boardId || !taskId) {
9217
+ fail(ws, type, "boardId and taskId required");
9218
+ return true;
9219
+ }
9220
+ const board = await updateTask(ctx.projectRoot, boardId, taskId, {
9221
+ ...payload?.title ? { title: payload.title } : {},
9222
+ ...payload?.description ? { description: payload.description } : {},
9223
+ ...payload?.columnId ? { columnId: payload.columnId } : {},
9224
+ ...payload?.priority ? { priority: payload.priority } : {},
9225
+ ...payload?.status ? { status: payload.status } : {},
9226
+ ...payload?.assignedAgent ? { assignedAgent: payload.assignedAgent } : {},
9227
+ ...payload?.labels ? { labels: payload.labels } : {}
9228
+ });
9229
+ board ? ok(ws, type, findTask(board.tasks, taskId)) : fail(ws, type, "Board or task not found");
9230
+ return true;
9231
+ }
9232
+ case "kanban.task.move": {
9233
+ const boardId = payload?.boardId;
9234
+ const taskId = payload?.taskId;
9235
+ const columnId = payload?.columnId;
9236
+ if (!boardId || !taskId || !columnId) {
9237
+ fail(ws, type, "boardId, taskId, columnId required");
9238
+ return true;
9239
+ }
9240
+ const board = await moveTask(
9241
+ ctx.projectRoot,
9242
+ boardId,
9243
+ taskId,
9244
+ columnId,
9245
+ payload?.order
9246
+ );
9247
+ board ? ok(ws, type, findTask(board.tasks, taskId)) : fail(ws, type, "Move failed");
9248
+ return true;
9249
+ }
9250
+ case "kanban.task.copy":
9251
+ case "kanban.task.transfer": {
9252
+ const boardId = payload?.boardId;
9253
+ const taskId = payload?.taskId;
9254
+ const targetBoardId = payload?.targetBoardId;
9255
+ if (!boardId || !taskId || !targetBoardId) {
9256
+ fail(ws, type, "boardId, taskId, targetBoardId required");
9257
+ return true;
9258
+ }
9259
+ const result = type === "kanban.task.copy" ? await copyTaskToBoard(ctx.projectRoot, boardId, taskId, targetBoardId, {
9260
+ ...payload?.targetColumnId ? { targetColumnId: payload.targetColumnId } : {},
9261
+ ...typeof payload?.preserveAssignment === "boolean" ? { preserveAssignment: payload.preserveAssignment } : {},
9262
+ ...typeof payload?.preserveDependencies === "boolean" ? { preserveDependencies: payload.preserveDependencies } : {}
9263
+ }) : await transferTaskToBoard(ctx.projectRoot, boardId, taskId, targetBoardId, {
9264
+ ...payload?.targetColumnId ? { targetColumnId: payload.targetColumnId } : {},
9265
+ ...typeof payload?.preserveAssignment === "boolean" ? { preserveAssignment: payload.preserveAssignment } : {},
9266
+ ...typeof payload?.preserveDependencies === "boolean" ? { preserveDependencies: payload.preserveDependencies } : {}
9267
+ });
9268
+ result ? ok(ws, type, result.targetBoard) : fail(ws, type, "Board or task not found");
9269
+ return true;
9270
+ }
9271
+ case "kanban.task.assign": {
9272
+ const boardId = payload?.boardId;
9273
+ const taskId = payload?.taskId;
9274
+ if (!boardId || !taskId) {
9275
+ fail(ws, type, "boardId and taskId required");
9276
+ return true;
9277
+ }
9278
+ const board = await assignTask(ctx.projectRoot, boardId, taskId, {
9279
+ ...payload?.agentId ? { agentId: payload.agentId } : {},
9280
+ ...payload?.name ? { name: payload.name } : {},
9281
+ ...payload?.role ? { role: payload.role } : {},
9282
+ ...payload?.provider ? { provider: payload.provider } : {},
9283
+ ...payload?.model ? { model: payload.model } : {},
9284
+ ...payload?.fallbackProfile ? { fallbackProfile: payload.fallbackProfile } : {},
9285
+ ...payload?.fallbackModels ? { fallbackModels: payload.fallbackModels } : {},
9286
+ ...payload?.tools ? { tools: payload.tools } : {},
9287
+ ...payload?.allowedCapabilities ? { allowedCapabilities: payload.allowedCapabilities } : {}
9288
+ });
9289
+ board ? ok(ws, type, findTask(board.tasks, taskId)) : fail(ws, type, "Board or task not found");
9290
+ return true;
9291
+ }
9292
+ case "kanban.task.dispatch":
9293
+ fail(
9294
+ ws,
9295
+ type,
9296
+ "Kanban agent dispatch is only available from the CLI-hosted WebUI runtime."
9297
+ );
9298
+ return true;
9299
+ case "kanban.task.remove": {
9300
+ const boardId = payload?.boardId;
9301
+ const taskId = payload?.taskId;
9302
+ if (!boardId || !taskId) {
9303
+ fail(ws, type, "boardId and taskId required");
9304
+ return true;
9305
+ }
9306
+ const board = await removeTask(ctx.projectRoot, boardId, taskId);
9307
+ board ? ok(ws, type, { removed: true }) : fail(ws, type, "Board or task not found");
9308
+ return true;
9309
+ }
9310
+ case "kanban.task.get": {
9311
+ const boardId = payload?.boardId;
9312
+ const taskId = payload?.taskId;
9313
+ if (!boardId || !taskId) {
9314
+ fail(ws, type, "boardId and taskId required");
9315
+ return true;
9316
+ }
9317
+ const task = await getTask(ctx.projectRoot, boardId, taskId);
9318
+ task ? ok(ws, type, task) : fail(ws, type, "Task not found");
9319
+ return true;
9320
+ }
9321
+ case "kanban.column.add": {
9322
+ const boardId = payload?.boardId;
9323
+ const title = payload?.title;
9324
+ if (!boardId || !title) {
9325
+ fail(ws, type, "boardId and title required");
9326
+ return true;
9327
+ }
9328
+ const result = await addColumn(ctx.projectRoot, boardId, { title });
9329
+ result ? ok(ws, type, result.board.columns) : fail(ws, type, `Board not found: ${boardId}`);
9330
+ return true;
9331
+ }
9332
+ case "kanban.column.remove": {
9333
+ const boardId = payload?.boardId;
9334
+ const columnId = payload?.columnId;
9335
+ if (!boardId || !columnId) {
9336
+ fail(ws, type, "boardId and columnId required");
9337
+ return true;
9338
+ }
9339
+ const board = await removeColumn(ctx.projectRoot, boardId, columnId, {
9340
+ moveTasksToColumnId: payload?.moveTasksToColumnId
9341
+ });
9342
+ board ? ok(ws, type, { removed: true }) : fail(ws, type, `Column not found: ${columnId}`);
9343
+ return true;
9344
+ }
9345
+ default:
9346
+ fail(ws, type, `Unknown kanban message type: ${type}`);
9347
+ return true;
9348
+ }
9349
+ } catch (err) {
9350
+ fail(ws, type, err instanceof Error ? err.message : String(err));
9351
+ return true;
9352
+ }
9353
+ }
9354
+ function findTask(tasks, taskId) {
9355
+ return tasks.find((task) => task.id === taskId || task.id.startsWith(taskId));
9356
+ }
9357
+
9059
9358
  // src/server/mailbox-routes.ts
9060
9359
  async function handleMailboxRoute(ws, msg, handlers) {
9061
9360
  switch (msg.type) {
@@ -9540,6 +9839,7 @@ function createMessageDispatcher(opts) {
9540
9839
  if (await handleSpecsRoute(ws, msg, routes.specsRoutes)) return;
9541
9840
  if (await handleSddBoardRoute(ws, msg, routes.sddBoardRoutes)) return;
9542
9841
  if (await handleSddWizardRoute(ws, msg, routes.sddWizardRoutes)) return;
9842
+ if (await handleKanbanRoute(ws, msg, { projectRoot: state.getProjectRoot() })) return;
9543
9843
  if (msg.type.startsWith("worktree.") && await deps2.worktreeHandler.handleMessage(
9544
9844
  msg
9545
9845
  ))
@@ -9554,7 +9854,10 @@ function createMessageDispatcher(opts) {
9554
9854
  case "collab.resume":
9555
9855
  case "collab.grant_control":
9556
9856
  case "collab.inject_tool": {
9557
- deps2.collabHandler.handleMessage(ws, msg);
9857
+ deps2.collabHandler.handleMessage(
9858
+ ws,
9859
+ msg
9860
+ );
9558
9861
  return;
9559
9862
  }
9560
9863
  // Integrated terminal — interactive pty transport, bypasses the agent loop.
@@ -9582,7 +9885,10 @@ function createMessageDispatcher(opts) {
9582
9885
  runLock.set(thisRun);
9583
9886
  try {
9584
9887
  const maxIt = typeof deps2.context.meta["maxIterations"] === "number" ? deps2.context.meta["maxIterations"] : void 0;
9585
- const result = await deps2.agent.run(content, { signal: thisRun.signal, maxIterations: maxIt });
9888
+ const result = await deps2.agent.run(content, {
9889
+ signal: thisRun.signal,
9890
+ maxIterations: maxIt
9891
+ });
9586
9892
  send(ws, {
9587
9893
  type: "run.result",
9588
9894
  payload: sessionPayload2({
@@ -9722,22 +10028,43 @@ function createMessageDispatcher(opts) {
9722
10028
  break;
9723
10029
  // Design Studio — shared handlers (design-handlers.ts).
9724
10030
  case "design.list":
9725
- await handleDesignList(ws, { projectRoot: state.getProjectRoot(), agentMeta: deps2.context });
10031
+ await handleDesignList(ws, {
10032
+ projectRoot: state.getProjectRoot(),
10033
+ agentMeta: deps2.context
10034
+ });
9726
10035
  break;
9727
10036
  case "design.use":
9728
- await handleDesignUse(ws, { projectRoot: state.getProjectRoot(), agentMeta: deps2.context }, msg);
10037
+ await handleDesignUse(
10038
+ ws,
10039
+ { projectRoot: state.getProjectRoot(), agentMeta: deps2.context },
10040
+ msg
10041
+ );
9729
10042
  break;
9730
10043
  case "design.state":
9731
- await handleDesignState(ws, { projectRoot: state.getProjectRoot(), agentMeta: deps2.context });
10044
+ await handleDesignState(ws, {
10045
+ projectRoot: state.getProjectRoot(),
10046
+ agentMeta: deps2.context
10047
+ });
9732
10048
  break;
9733
10049
  case "design.set":
9734
- await handleDesignSet(ws, { projectRoot: state.getProjectRoot(), agentMeta: deps2.context }, msg);
10050
+ await handleDesignSet(
10051
+ ws,
10052
+ { projectRoot: state.getProjectRoot(), agentMeta: deps2.context },
10053
+ msg
10054
+ );
9735
10055
  break;
9736
10056
  case "design.materialize":
9737
- await handleDesignMaterialize(ws, { projectRoot: state.getProjectRoot(), agentMeta: deps2.context }, msg);
10057
+ await handleDesignMaterialize(
10058
+ ws,
10059
+ { projectRoot: state.getProjectRoot(), agentMeta: deps2.context },
10060
+ msg
10061
+ );
9738
10062
  break;
9739
10063
  case "design.verify":
9740
- await handleDesignVerify(ws, { projectRoot: state.getProjectRoot(), agentMeta: deps2.context });
10064
+ await handleDesignVerify(ws, {
10065
+ projectRoot: state.getProjectRoot(),
10066
+ agentMeta: deps2.context
10067
+ });
9741
10068
  break;
9742
10069
  case "diag.get": {
9743
10070
  if (!ensureCurrentSession(ws, msg, "diag.get")) return;
@@ -11930,6 +12257,11 @@ async function startWebUI(opts = {}) {
11930
12257
  sessionStartPayload,
11931
12258
  tokenCounter,
11932
12259
  context,
12260
+ loadReplay: async () => {
12261
+ await session.flush().catch(() => void 0);
12262
+ const data = await sessionStore.load(session.id);
12263
+ return { messages: data.messages, usage: data.usage };
12264
+ },
11933
12265
  clients,
11934
12266
  pendingConfirms,
11935
12267
  autoPhaseHandler,