@wrongstack/webui 0.68.0 → 0.73.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/index.html CHANGED
@@ -5,8 +5,8 @@
5
5
  <link rel="icon" type="image/svg+xml" href="/wrongstack.svg" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
  <title>WrongStack WebUI</title>
8
- <script type="module" crossorigin src="/assets/index-BeXRAkSS.js"></script>
9
- <link rel="modulepreload" crossorigin href="/assets/vendor-CzdG0ns2.js">
8
+ <script type="module" crossorigin src="/assets/index-BH3RI9-8.js"></script>
9
+ <link rel="modulepreload" crossorigin href="/assets/vendor-DBuK7aZd.js">
10
10
  <link rel="stylesheet" crossorigin href="/assets/vendor-DW1jimNH.css">
11
11
  <link rel="stylesheet" crossorigin href="/assets/index-C_0-qbQ-.css">
12
12
  </head>
package/dist/index.js CHANGED
@@ -1137,6 +1137,8 @@ function handleKeyOperationResult(msg) {
1137
1137
  const p = msg.payload;
1138
1138
  if (p.success) toast.success(p.message);
1139
1139
  else toast.error(p.message);
1140
+ const client2 = getWSClient(useConfigStore.getState().wsUrl);
1141
+ client2.listSavedProviders();
1140
1142
  }
1141
1143
  function handleContextCompacted(msg) {
1142
1144
  const payload = msg.payload;
@@ -1252,7 +1254,8 @@ function handleRunResult(msg) {
1252
1254
  const runStart = useChatStore.getState().runStart;
1253
1255
  if (runStart && payload.status === "done") {
1254
1256
  const all = useChatStore.getState().messages;
1255
- let lastAssistantIdx = -1, toolCount = 0;
1257
+ let lastAssistantIdx = -1;
1258
+ let toolCount = 0;
1256
1259
  for (let i = all.length - 1; i >= 0; i--) {
1257
1260
  const m = all[i];
1258
1261
  if (m.role === "assistant" && lastAssistantIdx === -1 && m.content) lastAssistantIdx = i;
@@ -5367,15 +5370,16 @@ function CollabPanel({ sessionId, className }) {
5367
5370
  const offs = [];
5368
5371
  offs.push(
5369
5372
  client2.on("collab.state", (msg) => {
5370
- if (msg?.payload?.sessionId === sessionId) {
5371
- setParticipants(msg.payload.participants ?? []);
5373
+ const p = msg.payload;
5374
+ if (p.sessionId === sessionId) {
5375
+ setParticipants(p.participants ?? []);
5372
5376
  }
5373
5377
  })
5374
5378
  );
5375
5379
  offs.push(
5376
5380
  client2.on("collab.participant.joined", (msg) => {
5377
- if (msg?.payload?.sessionId !== sessionId) return;
5378
5381
  const p = msg.payload;
5382
+ if (p.sessionId !== sessionId) return;
5379
5383
  setParticipants((prev) => {
5380
5384
  if (prev.some((x) => x.participantId === p.participantId)) return prev;
5381
5385
  return [...prev, { participantId: p.participantId, role: p.role, joinedAt: p.joinedAt }];
@@ -5384,15 +5388,17 @@ function CollabPanel({ sessionId, className }) {
5384
5388
  );
5385
5389
  offs.push(
5386
5390
  client2.on("collab.participant.left", (msg) => {
5387
- if (msg?.payload?.sessionId !== sessionId) return;
5388
- const id = msg.payload.participantId;
5389
- setParticipants((prev) => prev.filter((p) => p.participantId !== id));
5391
+ const p = msg.payload;
5392
+ if (p.sessionId !== sessionId) return;
5393
+ const id = p.participantId;
5394
+ setParticipants((prev) => prev.filter((p2) => p2.participantId !== id));
5390
5395
  })
5391
5396
  );
5392
5397
  offs.push(
5393
5398
  client2.on("error", (msg) => {
5394
- if (msg?.payload?.phase === "collab") {
5395
- setError(msg.payload.message);
5399
+ const p = msg.payload;
5400
+ if (p.phase === "collab") {
5401
+ setError(p.message);
5396
5402
  setJoined(false);
5397
5403
  }
5398
5404
  })
@@ -5401,26 +5407,30 @@ function CollabPanel({ sessionId, className }) {
5401
5407
  }));
5402
5408
  offs.push(
5403
5409
  client2.on("collab.annotation.added", (msg) => {
5404
- if (msg?.payload?.sessionId !== sessionId) return;
5405
- if (msg?.payload?.annotation?.resolved) return;
5410
+ const p = msg.payload;
5411
+ if (p.sessionId !== sessionId) return;
5412
+ if (p.annotation?.resolved) return;
5406
5413
  setOpenAnnotationCount((c) => c + 1);
5407
5414
  })
5408
5415
  );
5409
5416
  offs.push(
5410
5417
  client2.on("collab.annotation.resolved", (msg) => {
5411
- if (msg?.payload?.sessionId !== sessionId) return;
5418
+ const p = msg.payload;
5419
+ if (p.sessionId !== sessionId) return;
5412
5420
  setOpenAnnotationCount((c) => Math.max(0, c - 1));
5413
5421
  })
5414
5422
  );
5415
5423
  offs.push(
5416
5424
  client2.on("collab.pause.granted", (msg) => {
5417
- if (msg?.payload?.sessionId !== sessionId) return;
5425
+ const p = msg.payload;
5426
+ if (p.sessionId !== sessionId) return;
5418
5427
  setPaused(true);
5419
5428
  })
5420
5429
  );
5421
5430
  offs.push(
5422
5431
  client2.on("collab.pause.released", (msg) => {
5423
- if (msg?.payload?.sessionId !== sessionId) return;
5432
+ const p = msg.payload;
5433
+ if (p.sessionId !== sessionId) return;
5424
5434
  setPaused(false);
5425
5435
  })
5426
5436
  );
@@ -6359,8 +6369,6 @@ function QuickModelSwitcher() {
6359
6369
 
6360
6370
  // src/components/SettingsPanel/index.tsx
6361
6371
  import {
6362
- AlertCircle,
6363
- CheckCircle2 as CheckCircle26,
6364
6372
  Cpu as Cpu6,
6365
6373
  Globe as Globe3,
6366
6374
  Monitor as Monitor3,
@@ -6907,7 +6915,6 @@ function SettingsPanel() {
6907
6915
  const [isLoadingCatalog, setIsLoadingCatalog] = useState23(false);
6908
6916
  const [isLoadingModels, setIsLoadingModels] = useState23(false);
6909
6917
  const [isLoadingSaved, setIsLoadingSaved] = useState23(false);
6910
- const [operationStatus, setOperationStatus] = useState23(null);
6911
6918
  const [providerTab, setProviderTab] = useState23("catalog");
6912
6919
  const [catalogQuery, setCatalogQuery] = useState23("");
6913
6920
  const currentCatalogProvider = catalogProviders.find((p) => p.id === provider);
@@ -6935,19 +6942,10 @@ function SettingsPanel() {
6935
6942
  if (next.length > 0) setProviderTab("saved");
6936
6943
  }
6937
6944
  };
6938
- const handleKeyOperationResult2 = (msg) => {
6939
- if (msg.type === "key.operation_result") {
6940
- const payload = msg.payload;
6941
- setOperationStatus(payload);
6942
- setTimeout(() => setOperationStatus(null), 3e3);
6943
- wsClient.listSavedProviders();
6944
- }
6945
- };
6946
6945
  if (!wsConnected || !wsClient) return;
6947
6946
  const off1 = wsClient.on("provider.catalog", handleProviderCatalog);
6948
6947
  const off2 = wsClient.on("provider.models", handleProviderModels);
6949
6948
  const off3 = wsClient.on("providers.saved", handleSavedProviders);
6950
- const off4 = wsClient.on("key.operation_result", handleKeyOperationResult2);
6951
6949
  setIsLoadingCatalog(true);
6952
6950
  setIsLoadingSaved(true);
6953
6951
  wsClient.listProviders();
@@ -6956,7 +6954,6 @@ function SettingsPanel() {
6956
6954
  off1?.();
6957
6955
  off2?.();
6958
6956
  off3?.();
6959
- off4?.();
6960
6957
  };
6961
6958
  }, [wsConnected, wsClient]);
6962
6959
  const handleProviderSelect = useCallback5(
@@ -6974,7 +6971,7 @@ function SettingsPanel() {
6974
6971
  setModel(modelId);
6975
6972
  const currentProvider = useConfigStore.getState().provider;
6976
6973
  ws.switchModel?.(currentProvider, modelId);
6977
- setOperationStatus({ success: true, message: `Switching to ${currentProvider} / ${modelId}\u2026` });
6974
+ toast.success(`Switching to ${currentProvider} / ${modelId}\u2026`);
6978
6975
  },
6979
6976
  [setModel, ws]
6980
6977
  );
@@ -7032,41 +7029,26 @@ function SettingsPanel() {
7032
7029
  "Appearance"
7033
7030
  ] })
7034
7031
  ] }),
7035
- /* @__PURE__ */ jsxs32(TabsContent, { value: "provider", className: "space-y-4", children: [
7036
- operationStatus && /* @__PURE__ */ jsxs32(
7037
- "div",
7038
- {
7039
- className: cn(
7040
- "p-3 rounded-lg mb-4 flex items-center gap-2",
7041
- operationStatus.success ? "bg-green-500/10 text-green-600" : "bg-red-500/10 text-red-600"
7042
- ),
7043
- children: [
7044
- operationStatus.success ? /* @__PURE__ */ jsx37(CheckCircle26, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx37(AlertCircle, { className: "h-4 w-4" }),
7045
- operationStatus.message
7046
- ]
7047
- }
7048
- ),
7049
- /* @__PURE__ */ jsx37(
7050
- ProviderSection,
7051
- {
7052
- activeProvider: provider,
7053
- catalogProviders,
7054
- isLoadingCatalog,
7055
- savedProviders,
7056
- isLoadingSaved,
7057
- providerTab,
7058
- setProviderTab,
7059
- onSelectProvider: handleProviderSelect,
7060
- onAddKey: handleAddKey,
7061
- onDeleteKey: handleDeleteKey,
7062
- onSetActiveKey: handleSetActiveKey,
7063
- onAddProvider: handleAddProvider,
7064
- onRemoveProvider: handleRemoveProvider,
7065
- catalogQuery,
7066
- setCatalogQuery
7067
- }
7068
- )
7069
- ] }),
7032
+ /* @__PURE__ */ jsx37(TabsContent, { value: "provider", className: "space-y-4", children: /* @__PURE__ */ jsx37(
7033
+ ProviderSection,
7034
+ {
7035
+ activeProvider: provider,
7036
+ catalogProviders,
7037
+ isLoadingCatalog,
7038
+ savedProviders,
7039
+ isLoadingSaved,
7040
+ providerTab,
7041
+ setProviderTab,
7042
+ onSelectProvider: handleProviderSelect,
7043
+ onAddKey: handleAddKey,
7044
+ onDeleteKey: handleDeleteKey,
7045
+ onSetActiveKey: handleSetActiveKey,
7046
+ onAddProvider: handleAddProvider,
7047
+ onRemoveProvider: handleRemoveProvider,
7048
+ catalogQuery,
7049
+ setCatalogQuery
7050
+ }
7051
+ ) }),
7070
7052
  /* @__PURE__ */ jsx37(TabsContent, { value: "model", className: "space-y-4", children: /* @__PURE__ */ jsx37(
7071
7053
  ModelSection,
7072
7054
  {
@@ -7334,7 +7316,7 @@ import { useEffect as useEffect20, useState as useState25 } from "react";
7334
7316
 
7335
7317
  // src/components/Sidebar/ConfigSection.tsx
7336
7318
  import {
7337
- CheckCircle2 as CheckCircle27,
7319
+ CheckCircle2 as CheckCircle26,
7338
7320
  Circle,
7339
7321
  CircleDot,
7340
7322
  Database as Database2,
@@ -7418,7 +7400,7 @@ function ConfigSection({ formatDuration: formatDuration2 }) {
7418
7400
  ] }),
7419
7401
  /* @__PURE__ */ jsx39("div", { className: cn("relative h-1.5 w-full overflow-hidden rounded-full bg-muted", running > 0 && "bar-sweep"), title: `${pct}% complete`, children: /* @__PURE__ */ jsx39("div", { className: cn("h-full rounded-full transition-all duration-500", allDone ? "bg-[hsl(var(--success))]" : "bg-primary"), style: { width: `${Math.max(pct, running > 0 ? 4 : 0)}%` } }) }),
7420
7402
  /* @__PURE__ */ jsx39("ul", { className: "space-y-0.5 max-h-56 overflow-y-auto pr-1 -mx-1", children: todos.map((t) => {
7421
- const Icon2 = t.status === "completed" ? CheckCircle27 : t.status === "in_progress" ? CircleDot : Circle;
7403
+ const Icon2 = t.status === "completed" ? CheckCircle26 : t.status === "in_progress" ? CircleDot : Circle;
7422
7404
  const active = t.status === "in_progress";
7423
7405
  const tone2 = t.status === "completed" ? "text-[hsl(var(--success))] line-through opacity-60" : active ? "text-foreground" : "text-muted-foreground";
7424
7406
  return /* @__PURE__ */ jsxs34("li", { className: cn("flex items-start gap-2 text-xs leading-snug rounded-md px-1.5 py-1 transition-colors", active && "bg-primary/10 ring-1 ring-inset ring-primary/20", tone2), children: [