@wrongstack/webui 0.1.10 → 0.3.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/assets/index-C1jTV4WR.js +609 -0
- package/dist/assets/index-CRAjL4S_.css +1 -0
- package/dist/index.css +3 -0
- package/dist/index.css.map +1 -1
- package/dist/index.html +2 -2
- package/dist/index.js +419 -352
- package/dist/index.js.map +1 -1
- package/dist/server/entry.js +52 -10
- package/dist/server/entry.js.map +1 -1
- package/dist/server/index.js +52 -10
- package/dist/server/index.js.map +1 -1
- package/package.json +4 -4
- package/dist/assets/index-CK6FOYAW.js +0 -609
- package/dist/assets/index-DE-kgcG1.css +0 -1
package/dist/index.js
CHANGED
|
@@ -47,6 +47,7 @@ function playCompletionChime() {
|
|
|
47
47
|
var ctx;
|
|
48
48
|
var init_chime = __esm({
|
|
49
49
|
"src/lib/chime.ts"() {
|
|
50
|
+
"use strict";
|
|
50
51
|
ctx = null;
|
|
51
52
|
}
|
|
52
53
|
});
|
|
@@ -230,6 +231,7 @@ var WrongStackWebSocketClient = class {
|
|
|
230
231
|
maxReconnectAttempts = 10;
|
|
231
232
|
reconnectDelay = 1e3;
|
|
232
233
|
shouldReconnect = true;
|
|
234
|
+
reconnectTimer = null;
|
|
233
235
|
messageQueue = [];
|
|
234
236
|
pendingConfirms = /* @__PURE__ */ new Map();
|
|
235
237
|
sessionId = null;
|
|
@@ -271,8 +273,10 @@ var WrongStackWebSocketClient = class {
|
|
|
271
273
|
const connectTimeout = setTimeout(() => {
|
|
272
274
|
reject(new Error("Connection timeout"));
|
|
273
275
|
}, 1e4);
|
|
276
|
+
let established = false;
|
|
274
277
|
this.ws.onopen = () => {
|
|
275
278
|
clearTimeout(connectTimeout);
|
|
279
|
+
established = true;
|
|
276
280
|
console.log("[WS Client] Connected");
|
|
277
281
|
this.reconnectAttempts = 0;
|
|
278
282
|
this.lastErrorText = void 0;
|
|
@@ -291,9 +295,20 @@ var WrongStackWebSocketClient = class {
|
|
|
291
295
|
this.ws.onerror = (error) => {
|
|
292
296
|
console.error("[WS Client] Error", error);
|
|
293
297
|
this.lastErrorText = "Connection error (see browser devtools)";
|
|
298
|
+
if (!established) {
|
|
299
|
+
clearTimeout(connectTimeout);
|
|
300
|
+
reject(new Error(this.lastErrorText));
|
|
301
|
+
}
|
|
294
302
|
};
|
|
295
303
|
this.ws.onclose = (ev) => {
|
|
296
304
|
console.log("[WS Client] Disconnected", ev.code, ev.reason);
|
|
305
|
+
if (!established) {
|
|
306
|
+
clearTimeout(connectTimeout);
|
|
307
|
+
const reason = ev.reason || `Closed with code ${ev.code}`;
|
|
308
|
+
this.lastErrorText = reason;
|
|
309
|
+
reject(new Error(reason));
|
|
310
|
+
return;
|
|
311
|
+
}
|
|
297
312
|
if (ev.reason && !this.lastErrorText) {
|
|
298
313
|
this.lastErrorText = `${ev.reason} (code ${ev.code})`;
|
|
299
314
|
} else if (!this.lastErrorText && ev.code !== 1e3) {
|
|
@@ -302,7 +317,6 @@ var WrongStackWebSocketClient = class {
|
|
|
302
317
|
this.attemptReconnect();
|
|
303
318
|
};
|
|
304
319
|
} catch (err) {
|
|
305
|
-
clearTimeout(globalThis.connectTimeout);
|
|
306
320
|
this.lastErrorText = err instanceof Error ? err.message : String(err);
|
|
307
321
|
this.setStatus({ state: "closed", error: this.lastErrorText });
|
|
308
322
|
reject(err);
|
|
@@ -312,6 +326,7 @@ var WrongStackWebSocketClient = class {
|
|
|
312
326
|
attemptReconnect() {
|
|
313
327
|
if (!this.shouldReconnect || this.reconnectAttempts >= this.maxReconnectAttempts) {
|
|
314
328
|
console.log("[WS Client] Not reconnecting");
|
|
329
|
+
this.reconnectTimer = null;
|
|
315
330
|
this.setStatus({ state: "closed", error: this.lastErrorText ?? "Disconnected" });
|
|
316
331
|
return;
|
|
317
332
|
}
|
|
@@ -325,7 +340,7 @@ var WrongStackWebSocketClient = class {
|
|
|
325
340
|
nextRetryAt,
|
|
326
341
|
lastError: this.lastErrorText
|
|
327
342
|
});
|
|
328
|
-
setTimeout(async () => {
|
|
343
|
+
this.reconnectTimer = setTimeout(async () => {
|
|
329
344
|
if (this.shouldReconnect) {
|
|
330
345
|
try {
|
|
331
346
|
await this.connect();
|
|
@@ -338,6 +353,10 @@ var WrongStackWebSocketClient = class {
|
|
|
338
353
|
/** Force an immediate reconnect attempt, bypassing the backoff timer. */
|
|
339
354
|
retryNow() {
|
|
340
355
|
if (this.currentStatus.state === "open") return;
|
|
356
|
+
if (this.reconnectTimer) {
|
|
357
|
+
clearTimeout(this.reconnectTimer);
|
|
358
|
+
this.reconnectTimer = null;
|
|
359
|
+
}
|
|
341
360
|
this.reconnectAttempts = 0;
|
|
342
361
|
void this.connect().catch(() => void 0);
|
|
343
362
|
}
|
|
@@ -536,6 +555,10 @@ var WrongStackWebSocketClient = class {
|
|
|
536
555
|
}
|
|
537
556
|
disconnect() {
|
|
538
557
|
this.shouldReconnect = false;
|
|
558
|
+
if (this.reconnectTimer) {
|
|
559
|
+
clearTimeout(this.reconnectTimer);
|
|
560
|
+
this.reconnectTimer = null;
|
|
561
|
+
}
|
|
539
562
|
this.ws?.close();
|
|
540
563
|
this.ws = null;
|
|
541
564
|
}
|
|
@@ -3093,14 +3116,14 @@ import {
|
|
|
3093
3116
|
User,
|
|
3094
3117
|
XCircle as XCircle2
|
|
3095
3118
|
} from "lucide-react";
|
|
3096
|
-
import { useState as useState7 } from "react";
|
|
3119
|
+
import { memo as memo3, useState as useState7 } from "react";
|
|
3097
3120
|
import ReactMarkdown from "react-markdown";
|
|
3098
3121
|
import remarkGfm from "remark-gfm";
|
|
3099
3122
|
|
|
3100
3123
|
// src/components/DiffView.tsx
|
|
3101
|
-
import { useMemo as useMemo2 } from "react";
|
|
3124
|
+
import { memo, useMemo as useMemo2 } from "react";
|
|
3102
3125
|
import { jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
|
|
3103
|
-
|
|
3126
|
+
var DiffView = memo(function DiffView2({ oldText, newText, caption }) {
|
|
3104
3127
|
const rows = useMemo2(() => computeDiff(oldText, newText), [oldText, newText]);
|
|
3105
3128
|
if (rows === null) {
|
|
3106
3129
|
return /* @__PURE__ */ jsx8("div", { className: "text-xs text-muted-foreground italic px-3 py-2", children: "Diff omitted (file too large to render inline)." });
|
|
@@ -3158,7 +3181,7 @@ function DiffView({ oldText, newText, caption }) {
|
|
|
3158
3181
|
i
|
|
3159
3182
|
)) })
|
|
3160
3183
|
] });
|
|
3161
|
-
}
|
|
3184
|
+
});
|
|
3162
3185
|
var MAX_LINES = 5e3;
|
|
3163
3186
|
function computeDiff(oldText, newText) {
|
|
3164
3187
|
const a = oldText.split("\n");
|
|
@@ -3219,7 +3242,7 @@ function diffFromToolInput(toolName, input) {
|
|
|
3219
3242
|
|
|
3220
3243
|
// src/components/ToolResult.tsx
|
|
3221
3244
|
import { ChevronDown, ChevronRight, ChevronsDown, ChevronsUp } from "lucide-react";
|
|
3222
|
-
import { useMemo as useMemo3, useState as useState6 } from "react";
|
|
3245
|
+
import { memo as memo2, useMemo as useMemo3, useState as useState6 } from "react";
|
|
3223
3246
|
import { Fragment as Fragment3, jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
|
|
3224
3247
|
var LONG_OUTPUT_THRESHOLD = 25;
|
|
3225
3248
|
var LONG_PEEK_LINES = 12;
|
|
@@ -3295,7 +3318,12 @@ function CollapsibleText({
|
|
|
3295
3318
|
)
|
|
3296
3319
|
] });
|
|
3297
3320
|
}
|
|
3298
|
-
|
|
3321
|
+
var ToolResult = memo2(function ToolResult2({
|
|
3322
|
+
toolName,
|
|
3323
|
+
result,
|
|
3324
|
+
isError,
|
|
3325
|
+
className
|
|
3326
|
+
}) {
|
|
3299
3327
|
const shape = useMemo3(() => detectShape(toolName, result), [toolName, result]);
|
|
3300
3328
|
if (shape.kind === "json") {
|
|
3301
3329
|
return /* @__PURE__ */ jsx9(JsonResult, { value: shape.value, isError, className });
|
|
@@ -3351,7 +3379,7 @@ function ToolResult({ toolName, result, isError, className }) {
|
|
|
3351
3379
|
showLineNumbers: true
|
|
3352
3380
|
}
|
|
3353
3381
|
);
|
|
3354
|
-
}
|
|
3382
|
+
});
|
|
3355
3383
|
function detectShape(toolName, result) {
|
|
3356
3384
|
const trimmed = result.trim();
|
|
3357
3385
|
if (/^\s*\d+→/m.test(result.slice(0, 200))) {
|
|
@@ -3657,7 +3685,7 @@ function formatToolDuration(ms) {
|
|
|
3657
3685
|
const s = Math.floor(ms % 6e4 / 1e3);
|
|
3658
3686
|
return `${m}m ${s}s`;
|
|
3659
3687
|
}
|
|
3660
|
-
|
|
3688
|
+
var MessageBubble = memo3(function MessageBubble2({
|
|
3661
3689
|
message,
|
|
3662
3690
|
isFirst = false,
|
|
3663
3691
|
isContinuation = false
|
|
@@ -4056,7 +4084,7 @@ function MessageBubble({
|
|
|
4056
4084
|
]
|
|
4057
4085
|
}
|
|
4058
4086
|
);
|
|
4059
|
-
}
|
|
4087
|
+
});
|
|
4060
4088
|
|
|
4061
4089
|
// src/components/ModePicker.tsx
|
|
4062
4090
|
import { Check as Check2, ChevronDown as ChevronDown3 } from "lucide-react";
|
|
@@ -4305,7 +4333,7 @@ function SearchOverlay() {
|
|
|
4305
4333
|
|
|
4306
4334
|
// src/components/ToolGroup.tsx
|
|
4307
4335
|
import { CheckCircle2 as CheckCircle23, ChevronDown as ChevronDown4, ChevronRight as ChevronRight3, Loader2 as Loader22, Terminal as Terminal2, XCircle as XCircle3 } from "lucide-react";
|
|
4308
|
-
import { useState as useState10 } from "react";
|
|
4336
|
+
import { memo as memo4, useState as useState10 } from "react";
|
|
4309
4337
|
import { jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
4310
4338
|
function formatDuration(ms) {
|
|
4311
4339
|
if (ms < 1e3) return `${ms}ms`;
|
|
@@ -4314,7 +4342,11 @@ function formatDuration(ms) {
|
|
|
4314
4342
|
const s = Math.floor(ms % 6e4 / 1e3);
|
|
4315
4343
|
return `${m}m${s}s`;
|
|
4316
4344
|
}
|
|
4317
|
-
|
|
4345
|
+
var ToolGroup = memo4(function ToolGroup2({
|
|
4346
|
+
tools,
|
|
4347
|
+
defaultOpen = false,
|
|
4348
|
+
isContinuation = false
|
|
4349
|
+
}) {
|
|
4318
4350
|
const [open, setOpen] = useState10(defaultOpen);
|
|
4319
4351
|
if (tools.length === 1) {
|
|
4320
4352
|
return /* @__PURE__ */ jsx13(MessageBubble, { message: tools[0], isFirst: true, isContinuation });
|
|
@@ -4359,7 +4391,7 @@ function ToolGroup({ tools, defaultOpen = false, isContinuation = false }) {
|
|
|
4359
4391
|
open && /* @__PURE__ */ jsx13("div", { className: "space-y-2 pl-3 border-l-2 border-border/40 ml-2", children: tools.map((tool) => /* @__PURE__ */ jsx13(MessageBubble, { message: tool, isFirst: false }, tool.id)) })
|
|
4360
4392
|
] })
|
|
4361
4393
|
] });
|
|
4362
|
-
}
|
|
4394
|
+
});
|
|
4363
4395
|
|
|
4364
4396
|
// src/components/WelcomeScreen.tsx
|
|
4365
4397
|
import {
|
|
@@ -5507,10 +5539,46 @@ function ConnectionBanner() {
|
|
|
5507
5539
|
);
|
|
5508
5540
|
}
|
|
5509
5541
|
|
|
5542
|
+
// src/components/ErrorBoundary.tsx
|
|
5543
|
+
import { AlertTriangle as AlertTriangle3, RefreshCw } from "lucide-react";
|
|
5544
|
+
import { Component } from "react";
|
|
5545
|
+
import { jsx as jsx20, jsxs as jsxs19 } from "react/jsx-runtime";
|
|
5546
|
+
var ErrorBoundary = class extends Component {
|
|
5547
|
+
state = { error: null };
|
|
5548
|
+
static getDerivedStateFromError(error) {
|
|
5549
|
+
return { error };
|
|
5550
|
+
}
|
|
5551
|
+
componentDidCatch(error, info) {
|
|
5552
|
+
console.error("[ErrorBoundary]", error, info.componentStack);
|
|
5553
|
+
this.props.onError?.(error, info);
|
|
5554
|
+
}
|
|
5555
|
+
handleReset = () => {
|
|
5556
|
+
this.setState({ error: null });
|
|
5557
|
+
};
|
|
5558
|
+
render() {
|
|
5559
|
+
if (this.state.error) {
|
|
5560
|
+
return /* @__PURE__ */ jsx20("div", { className: "flex items-center justify-center h-screen bg-background", children: /* @__PURE__ */ jsxs19("div", { className: "flex flex-col items-center gap-4 p-8 max-w-md text-center", children: [
|
|
5561
|
+
/* @__PURE__ */ jsx20(AlertTriangle3, { className: "h-12 w-12 text-destructive" }),
|
|
5562
|
+
/* @__PURE__ */ jsx20("h1", { className: "text-lg font-semibold", children: "Something went wrong" }),
|
|
5563
|
+
/* @__PURE__ */ jsx20("p", { className: "text-sm text-muted-foreground", children: "A rendering error occurred. Your session is still active on the server \u2014 reloading will pick up where you left off." }),
|
|
5564
|
+
/* @__PURE__ */ jsx20("pre", { className: "text-xs font-mono text-muted-foreground bg-muted/50 rounded p-3 max-h-32 overflow-auto w-full text-left", children: this.state.error.message }),
|
|
5565
|
+
/* @__PURE__ */ jsxs19("div", { className: "flex gap-2", children: [
|
|
5566
|
+
/* @__PURE__ */ jsxs19(Button, { size: "sm", variant: "outline", onClick: () => window.location.reload(), children: [
|
|
5567
|
+
/* @__PURE__ */ jsx20(RefreshCw, { className: "h-4 w-4 mr-1" }),
|
|
5568
|
+
"Reload page"
|
|
5569
|
+
] }),
|
|
5570
|
+
/* @__PURE__ */ jsx20(Button, { size: "sm", onClick: this.handleReset, children: "Try again" })
|
|
5571
|
+
] })
|
|
5572
|
+
] }) });
|
|
5573
|
+
}
|
|
5574
|
+
return this.props.children;
|
|
5575
|
+
}
|
|
5576
|
+
};
|
|
5577
|
+
|
|
5510
5578
|
// src/components/QuickModelSwitcher.tsx
|
|
5511
5579
|
import { ArrowRight as ArrowRight2, Cpu as Cpu3, Search as Search4 } from "lucide-react";
|
|
5512
5580
|
import { useEffect as useEffect14, useMemo as useMemo5, useRef as useRef9, useState as useState14 } from "react";
|
|
5513
|
-
import { jsx as
|
|
5581
|
+
import { jsx as jsx21, jsxs as jsxs20 } from "react/jsx-runtime";
|
|
5514
5582
|
function QuickModelSwitcher() {
|
|
5515
5583
|
const open = useUIStore((s) => s.modelSwitcherOpen);
|
|
5516
5584
|
const setOpen = useUIStore((s) => s.setModelSwitcherOpen);
|
|
@@ -5604,7 +5672,7 @@ function QuickModelSwitcher() {
|
|
|
5604
5672
|
setOpen(false);
|
|
5605
5673
|
};
|
|
5606
5674
|
if (!open) return null;
|
|
5607
|
-
return /* @__PURE__ */
|
|
5675
|
+
return /* @__PURE__ */ jsx21(
|
|
5608
5676
|
"div",
|
|
5609
5677
|
{
|
|
5610
5678
|
className: "fixed inset-0 z-50 flex items-start justify-center bg-background/60 backdrop-blur-sm pt-[15vh]",
|
|
@@ -5614,10 +5682,10 @@ function QuickModelSwitcher() {
|
|
|
5614
5682
|
onKeyDown: (e) => {
|
|
5615
5683
|
if (e.key === "Escape") setOpen(false);
|
|
5616
5684
|
},
|
|
5617
|
-
children: /* @__PURE__ */
|
|
5618
|
-
/* @__PURE__ */
|
|
5619
|
-
/* @__PURE__ */
|
|
5620
|
-
/* @__PURE__ */
|
|
5685
|
+
children: /* @__PURE__ */ jsxs20("div", { className: "w-full max-w-xl rounded-xl border bg-popover shadow-2xl overflow-hidden", children: [
|
|
5686
|
+
/* @__PURE__ */ jsxs20("div", { className: "flex items-center gap-2 border-b px-3 py-2", children: [
|
|
5687
|
+
/* @__PURE__ */ jsx21(Search4, { className: "h-4 w-4 text-muted-foreground" }),
|
|
5688
|
+
/* @__PURE__ */ jsx21(
|
|
5621
5689
|
"input",
|
|
5622
5690
|
{
|
|
5623
5691
|
ref: inputRef,
|
|
@@ -5645,9 +5713,9 @@ function QuickModelSwitcher() {
|
|
|
5645
5713
|
className: "flex-1 bg-transparent outline-none text-sm placeholder:text-muted-foreground"
|
|
5646
5714
|
}
|
|
5647
5715
|
),
|
|
5648
|
-
/* @__PURE__ */
|
|
5716
|
+
/* @__PURE__ */ jsx21("span", { className: "text-[10px] text-muted-foreground font-mono", children: "\u2191\u2193 \xB7 Enter \xB7 Esc" })
|
|
5649
5717
|
] }),
|
|
5650
|
-
/* @__PURE__ */
|
|
5718
|
+
/* @__PURE__ */ jsx21("div", { className: "max-h-[50vh] overflow-y-auto py-1", children: candidates.length === 0 ? /* @__PURE__ */ jsx21("div", { className: "px-4 py-8 text-center text-sm text-muted-foreground", children: saved.length === 0 ? "No saved providers \u2014 register a key in Settings first." : "Loading models\u2026" }) : candidates.map((c, idx) => /* @__PURE__ */ jsxs20(
|
|
5651
5719
|
"button",
|
|
5652
5720
|
{
|
|
5653
5721
|
type: "button",
|
|
@@ -5659,7 +5727,7 @@ function QuickModelSwitcher() {
|
|
|
5659
5727
|
c.isCurrent && "font-medium"
|
|
5660
5728
|
),
|
|
5661
5729
|
children: [
|
|
5662
|
-
/* @__PURE__ */
|
|
5730
|
+
/* @__PURE__ */ jsx21(
|
|
5663
5731
|
Cpu3,
|
|
5664
5732
|
{
|
|
5665
5733
|
className: cn(
|
|
@@ -5668,19 +5736,19 @@ function QuickModelSwitcher() {
|
|
|
5668
5736
|
)
|
|
5669
5737
|
}
|
|
5670
5738
|
),
|
|
5671
|
-
/* @__PURE__ */
|
|
5672
|
-
/* @__PURE__ */
|
|
5673
|
-
/* @__PURE__ */
|
|
5674
|
-
/* @__PURE__ */
|
|
5675
|
-
/* @__PURE__ */
|
|
5739
|
+
/* @__PURE__ */ jsxs20("div", { className: "min-w-0 flex-1", children: [
|
|
5740
|
+
/* @__PURE__ */ jsxs20("div", { className: "truncate", children: [
|
|
5741
|
+
/* @__PURE__ */ jsx21("span", { className: "text-muted-foreground", children: c.provider }),
|
|
5742
|
+
/* @__PURE__ */ jsx21("span", { className: "mx-1 text-muted-foreground/40", children: "\xB7" }),
|
|
5743
|
+
/* @__PURE__ */ jsx21("span", { children: c.modelName })
|
|
5676
5744
|
] }),
|
|
5677
|
-
c.contextWindow && /* @__PURE__ */
|
|
5745
|
+
c.contextWindow && /* @__PURE__ */ jsxs20("div", { className: "text-[10px] text-muted-foreground font-mono", children: [
|
|
5678
5746
|
c.model,
|
|
5679
5747
|
" \xB7 ctx ",
|
|
5680
5748
|
c.contextWindow.toLocaleString()
|
|
5681
5749
|
] })
|
|
5682
5750
|
] }),
|
|
5683
|
-
c.isCurrent ? /* @__PURE__ */
|
|
5751
|
+
c.isCurrent ? /* @__PURE__ */ jsx21("span", { className: "text-[10px] uppercase tracking-wide text-primary font-semibold", children: "active" }) : /* @__PURE__ */ jsx21(ArrowRight2, { className: "h-3.5 w-3.5 text-muted-foreground opacity-0 group-hover:opacity-100" })
|
|
5684
5752
|
]
|
|
5685
5753
|
},
|
|
5686
5754
|
`${c.provider}:${c.model}`
|
|
@@ -5705,7 +5773,7 @@ import {
|
|
|
5705
5773
|
Network,
|
|
5706
5774
|
Palette,
|
|
5707
5775
|
Plus,
|
|
5708
|
-
RefreshCw,
|
|
5776
|
+
RefreshCw as RefreshCw2,
|
|
5709
5777
|
Sun as Sun3,
|
|
5710
5778
|
Trash2 as Trash22,
|
|
5711
5779
|
X as X5
|
|
@@ -5714,7 +5782,7 @@ import { useState as useState16, useEffect as useEffect16, useCallback as useCal
|
|
|
5714
5782
|
|
|
5715
5783
|
// src/components/ThemeProvider.tsx
|
|
5716
5784
|
import { createContext, useContext, useEffect as useEffect15, useState as useState15 } from "react";
|
|
5717
|
-
import { jsx as
|
|
5785
|
+
import { jsx as jsx22 } from "react/jsx-runtime";
|
|
5718
5786
|
var ThemeProviderContext = createContext(void 0);
|
|
5719
5787
|
function ThemeProvider({
|
|
5720
5788
|
children,
|
|
@@ -5746,7 +5814,7 @@ function ThemeProvider({
|
|
|
5746
5814
|
setStoreTheme(newTheme);
|
|
5747
5815
|
}
|
|
5748
5816
|
};
|
|
5749
|
-
return /* @__PURE__ */
|
|
5817
|
+
return /* @__PURE__ */ jsx22(ThemeProviderContext.Provider, { value, children });
|
|
5750
5818
|
}
|
|
5751
5819
|
function useTheme() {
|
|
5752
5820
|
const context = useContext(ThemeProviderContext);
|
|
@@ -5758,10 +5826,10 @@ function useTheme() {
|
|
|
5758
5826
|
|
|
5759
5827
|
// src/components/ui/input.tsx
|
|
5760
5828
|
import * as React4 from "react";
|
|
5761
|
-
import { jsx as
|
|
5829
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
5762
5830
|
var Input = React4.forwardRef(
|
|
5763
5831
|
({ className, type, ...props }, ref) => {
|
|
5764
|
-
return /* @__PURE__ */
|
|
5832
|
+
return /* @__PURE__ */ jsx23(
|
|
5765
5833
|
"input",
|
|
5766
5834
|
{
|
|
5767
5835
|
type,
|
|
@@ -5780,9 +5848,9 @@ Input.displayName = "Input";
|
|
|
5780
5848
|
// src/components/ui/tabs.tsx
|
|
5781
5849
|
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
5782
5850
|
import * as React5 from "react";
|
|
5783
|
-
import { jsx as
|
|
5851
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
5784
5852
|
var Tabs = TabsPrimitive.Root;
|
|
5785
|
-
var TabsList = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
5853
|
+
var TabsList = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx24(
|
|
5786
5854
|
TabsPrimitive.List,
|
|
5787
5855
|
{
|
|
5788
5856
|
ref,
|
|
@@ -5794,7 +5862,7 @@ var TabsList = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__
|
|
|
5794
5862
|
}
|
|
5795
5863
|
));
|
|
5796
5864
|
TabsList.displayName = TabsPrimitive.List.displayName;
|
|
5797
|
-
var TabsTrigger = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
5865
|
+
var TabsTrigger = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx24(
|
|
5798
5866
|
TabsPrimitive.Trigger,
|
|
5799
5867
|
{
|
|
5800
5868
|
ref,
|
|
@@ -5806,7 +5874,7 @@ var TabsTrigger = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
5806
5874
|
}
|
|
5807
5875
|
));
|
|
5808
5876
|
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
5809
|
-
var TabsContent = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */
|
|
5877
|
+
var TabsContent = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE__ */ jsx24(
|
|
5810
5878
|
TabsPrimitive.Content,
|
|
5811
5879
|
{
|
|
5812
5880
|
ref,
|
|
@@ -5820,7 +5888,7 @@ var TabsContent = React5.forwardRef(({ className, ...props }, ref) => /* @__PURE
|
|
|
5820
5888
|
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
|
5821
5889
|
|
|
5822
5890
|
// src/components/SettingsPanel.tsx
|
|
5823
|
-
import { Fragment as Fragment7, jsx as
|
|
5891
|
+
import { Fragment as Fragment7, jsx as jsx25, jsxs as jsxs21 } from "react/jsx-runtime";
|
|
5824
5892
|
function SettingsPanel() {
|
|
5825
5893
|
const { setCurrentView } = useUIStore();
|
|
5826
5894
|
const { provider, model, setProvider, setModel, wsConnected } = useConfigStore();
|
|
@@ -5969,52 +6037,52 @@ function SettingsPanel() {
|
|
|
5969
6037
|
},
|
|
5970
6038
|
{}
|
|
5971
6039
|
);
|
|
5972
|
-
return /* @__PURE__ */
|
|
5973
|
-
/* @__PURE__ */
|
|
5974
|
-
/* @__PURE__ */
|
|
5975
|
-
/* @__PURE__ */
|
|
6040
|
+
return /* @__PURE__ */ jsxs21("div", { className: "flex flex-col h-full", children: [
|
|
6041
|
+
/* @__PURE__ */ jsxs21("header", { className: "flex items-center justify-between px-4 py-3 border-b bg-card shrink-0", children: [
|
|
6042
|
+
/* @__PURE__ */ jsx25("h1", { className: "text-lg font-semibold", children: "Settings" }),
|
|
6043
|
+
/* @__PURE__ */ jsx25(Button, { variant: "ghost", size: "icon", onClick: () => setCurrentView("chat"), children: /* @__PURE__ */ jsx25(X5, { className: "h-4 w-4" }) })
|
|
5976
6044
|
] }),
|
|
5977
|
-
/* @__PURE__ */
|
|
5978
|
-
/* @__PURE__ */
|
|
5979
|
-
/* @__PURE__ */
|
|
5980
|
-
/* @__PURE__ */
|
|
6045
|
+
/* @__PURE__ */ jsx25(ScrollArea, { className: "flex-1", children: /* @__PURE__ */ jsx25("div", { className: "p-6 max-w-2xl mx-auto", children: /* @__PURE__ */ jsxs21(Tabs, { defaultValue: "provider", children: [
|
|
6046
|
+
/* @__PURE__ */ jsxs21(TabsList, { className: "w-full justify-start mb-6 grid grid-cols-4", children: [
|
|
6047
|
+
/* @__PURE__ */ jsxs21(TabsTrigger, { value: "provider", className: "gap-2", children: [
|
|
6048
|
+
/* @__PURE__ */ jsx25(Network, { className: "h-4 w-4" }),
|
|
5981
6049
|
"Provider"
|
|
5982
6050
|
] }),
|
|
5983
|
-
/* @__PURE__ */
|
|
5984
|
-
/* @__PURE__ */
|
|
6051
|
+
/* @__PURE__ */ jsxs21(TabsTrigger, { value: "model", className: "gap-2", children: [
|
|
6052
|
+
/* @__PURE__ */ jsx25(Cpu4, { className: "h-4 w-4" }),
|
|
5985
6053
|
"Model"
|
|
5986
6054
|
] }),
|
|
5987
|
-
/* @__PURE__ */
|
|
5988
|
-
/* @__PURE__ */
|
|
6055
|
+
/* @__PURE__ */ jsxs21(TabsTrigger, { value: "connection", className: "gap-2", children: [
|
|
6056
|
+
/* @__PURE__ */ jsx25(Globe2, { className: "h-4 w-4" }),
|
|
5989
6057
|
"Connection"
|
|
5990
6058
|
] }),
|
|
5991
|
-
/* @__PURE__ */
|
|
5992
|
-
/* @__PURE__ */
|
|
6059
|
+
/* @__PURE__ */ jsxs21(TabsTrigger, { value: "appearance", className: "gap-2", children: [
|
|
6060
|
+
/* @__PURE__ */ jsx25(Palette, { className: "h-4 w-4" }),
|
|
5993
6061
|
"Appearance"
|
|
5994
6062
|
] })
|
|
5995
6063
|
] }),
|
|
5996
|
-
/* @__PURE__ */
|
|
5997
|
-
/* @__PURE__ */
|
|
5998
|
-
/* @__PURE__ */
|
|
6064
|
+
/* @__PURE__ */ jsxs21(TabsContent, { value: "provider", className: "space-y-4", children: [
|
|
6065
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex gap-2 mb-4", children: [
|
|
6066
|
+
/* @__PURE__ */ jsxs21(
|
|
5999
6067
|
Button,
|
|
6000
6068
|
{
|
|
6001
6069
|
variant: providerTab === "catalog" ? "default" : "outline",
|
|
6002
6070
|
size: "sm",
|
|
6003
6071
|
onClick: () => setProviderTab("catalog"),
|
|
6004
6072
|
children: [
|
|
6005
|
-
/* @__PURE__ */
|
|
6073
|
+
/* @__PURE__ */ jsx25(Globe2, { className: "h-4 w-4 mr-1" }),
|
|
6006
6074
|
"Catalog"
|
|
6007
6075
|
]
|
|
6008
6076
|
}
|
|
6009
6077
|
),
|
|
6010
|
-
/* @__PURE__ */
|
|
6078
|
+
/* @__PURE__ */ jsxs21(
|
|
6011
6079
|
Button,
|
|
6012
6080
|
{
|
|
6013
6081
|
variant: providerTab === "saved" ? "default" : "outline",
|
|
6014
6082
|
size: "sm",
|
|
6015
6083
|
onClick: () => setProviderTab("saved"),
|
|
6016
6084
|
children: [
|
|
6017
|
-
/* @__PURE__ */
|
|
6085
|
+
/* @__PURE__ */ jsx25(Key, { className: "h-4 w-4 mr-1" }),
|
|
6018
6086
|
"Saved (",
|
|
6019
6087
|
savedProviders.length,
|
|
6020
6088
|
")"
|
|
@@ -6022,7 +6090,7 @@ function SettingsPanel() {
|
|
|
6022
6090
|
}
|
|
6023
6091
|
)
|
|
6024
6092
|
] }),
|
|
6025
|
-
operationStatus && /* @__PURE__ */
|
|
6093
|
+
operationStatus && /* @__PURE__ */ jsxs21(
|
|
6026
6094
|
"div",
|
|
6027
6095
|
{
|
|
6028
6096
|
className: cn(
|
|
@@ -6030,13 +6098,13 @@ function SettingsPanel() {
|
|
|
6030
6098
|
operationStatus.success ? "bg-green-500/10 text-green-600" : "bg-red-500/10 text-red-600"
|
|
6031
6099
|
),
|
|
6032
6100
|
children: [
|
|
6033
|
-
operationStatus.success ? /* @__PURE__ */
|
|
6101
|
+
operationStatus.success ? /* @__PURE__ */ jsx25(CheckCircle24, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx25(AlertCircle, { className: "h-4 w-4" }),
|
|
6034
6102
|
operationStatus.message
|
|
6035
6103
|
]
|
|
6036
6104
|
}
|
|
6037
6105
|
),
|
|
6038
|
-
providerTab === "catalog" && /* @__PURE__ */
|
|
6039
|
-
/* @__PURE__ */
|
|
6106
|
+
providerTab === "catalog" && /* @__PURE__ */ jsxs21("div", { className: "space-y-4", children: [
|
|
6107
|
+
/* @__PURE__ */ jsx25(
|
|
6040
6108
|
Input,
|
|
6041
6109
|
{
|
|
6042
6110
|
placeholder: `Search ${catalogProviders.length} providers (name / id / family)\u2026`,
|
|
@@ -6045,19 +6113,19 @@ function SettingsPanel() {
|
|
|
6045
6113
|
className: "text-sm"
|
|
6046
6114
|
}
|
|
6047
6115
|
),
|
|
6048
|
-
isLoadingCatalog && catalogProviders.length === 0 ? /* @__PURE__ */
|
|
6049
|
-
/* @__PURE__ */
|
|
6050
|
-
/* @__PURE__ */
|
|
6051
|
-
] }) : filteredCatalog.length === 0 && catalogQuery ? /* @__PURE__ */
|
|
6116
|
+
isLoadingCatalog && catalogProviders.length === 0 ? /* @__PURE__ */ jsxs21("div", { className: "flex items-center justify-center py-8", children: [
|
|
6117
|
+
/* @__PURE__ */ jsx25(Loader24, { className: "h-6 w-6 animate-spin text-muted-foreground" }),
|
|
6118
|
+
/* @__PURE__ */ jsx25("span", { className: "ml-2 text-muted-foreground", children: "Loading catalog..." })
|
|
6119
|
+
] }) : filteredCatalog.length === 0 && catalogQuery ? /* @__PURE__ */ jsxs21("div", { className: "text-center py-8 text-muted-foreground text-sm", children: [
|
|
6052
6120
|
'No providers match "',
|
|
6053
|
-
/* @__PURE__ */
|
|
6121
|
+
/* @__PURE__ */ jsx25("span", { className: "font-mono", children: catalogQuery }),
|
|
6054
6122
|
'".'
|
|
6055
|
-
] }) : /* @__PURE__ */
|
|
6123
|
+
] }) : /* @__PURE__ */ jsx25(Fragment7, { children: families.map((family) => {
|
|
6056
6124
|
const providers = catalogByFamily[family];
|
|
6057
6125
|
if (!providers?.length) return null;
|
|
6058
|
-
return /* @__PURE__ */
|
|
6059
|
-
/* @__PURE__ */
|
|
6060
|
-
/* @__PURE__ */
|
|
6126
|
+
return /* @__PURE__ */ jsxs21("div", { className: "space-y-2", children: [
|
|
6127
|
+
/* @__PURE__ */ jsx25("h3", { className: "text-sm font-semibold text-muted-foreground uppercase tracking-wider", children: family }),
|
|
6128
|
+
/* @__PURE__ */ jsx25("div", { className: "grid grid-cols-1 gap-2", children: providers.map((p) => /* @__PURE__ */ jsxs21(
|
|
6061
6129
|
"button",
|
|
6062
6130
|
{
|
|
6063
6131
|
type: "button",
|
|
@@ -6067,28 +6135,28 @@ function SettingsPanel() {
|
|
|
6067
6135
|
provider === p.id ? "border-primary bg-primary/5 ring-2 ring-primary/20" : "border-border hover:bg-muted"
|
|
6068
6136
|
),
|
|
6069
6137
|
children: [
|
|
6070
|
-
/* @__PURE__ */
|
|
6071
|
-
/* @__PURE__ */
|
|
6072
|
-
/* @__PURE__ */
|
|
6073
|
-
/* @__PURE__ */
|
|
6138
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex w-full justify-between items-start", children: [
|
|
6139
|
+
/* @__PURE__ */ jsxs21("div", { children: [
|
|
6140
|
+
/* @__PURE__ */ jsx25("span", { className: "font-medium", children: p.name }),
|
|
6141
|
+
/* @__PURE__ */ jsxs21("span", { className: "ml-2 text-xs text-muted-foreground", children: [
|
|
6074
6142
|
"(",
|
|
6075
6143
|
p.id,
|
|
6076
6144
|
")"
|
|
6077
6145
|
] })
|
|
6078
6146
|
] }),
|
|
6079
|
-
/* @__PURE__ */
|
|
6080
|
-
p.hasApiKey && /* @__PURE__ */
|
|
6081
|
-
/* @__PURE__ */
|
|
6147
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex items-center gap-2", children: [
|
|
6148
|
+
p.hasApiKey && /* @__PURE__ */ jsxs21("span", { className: "text-xs bg-green-500/10 text-green-600 px-2 py-0.5 rounded", children: [
|
|
6149
|
+
/* @__PURE__ */ jsx25(Key, { className: "h-3 w-3 inline mr-1" }),
|
|
6082
6150
|
"Configured"
|
|
6083
6151
|
] }),
|
|
6084
|
-
p.envVars[0] && /* @__PURE__ */
|
|
6152
|
+
p.envVars[0] && /* @__PURE__ */ jsxs21("span", { className: "text-xs text-muted-foreground", children: [
|
|
6085
6153
|
"ENV: ",
|
|
6086
6154
|
p.envVars[0]
|
|
6087
6155
|
] }),
|
|
6088
|
-
provider === p.id && /* @__PURE__ */
|
|
6156
|
+
provider === p.id && /* @__PURE__ */ jsx25(CheckCircle24, { className: "h-4 w-4 text-primary" })
|
|
6089
6157
|
] })
|
|
6090
6158
|
] }),
|
|
6091
|
-
/* @__PURE__ */
|
|
6159
|
+
/* @__PURE__ */ jsxs21("div", { className: "text-xs text-muted-foreground mt-1", children: [
|
|
6092
6160
|
p.modelCount,
|
|
6093
6161
|
" models",
|
|
6094
6162
|
p.apiBase && ` \xB7 ${p.apiBase}`
|
|
@@ -6100,25 +6168,25 @@ function SettingsPanel() {
|
|
|
6100
6168
|
] }, family);
|
|
6101
6169
|
}) })
|
|
6102
6170
|
] }),
|
|
6103
|
-
providerTab === "saved" && /* @__PURE__ */
|
|
6104
|
-
/* @__PURE__ */
|
|
6105
|
-
/* @__PURE__ */
|
|
6106
|
-
/* @__PURE__ */
|
|
6171
|
+
providerTab === "saved" && /* @__PURE__ */ jsxs21("div", { className: "space-y-4", children: [
|
|
6172
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex justify-between items-center", children: [
|
|
6173
|
+
/* @__PURE__ */ jsx25("p", { className: "text-sm text-muted-foreground", children: "Manage your API keys and provider configurations" }),
|
|
6174
|
+
/* @__PURE__ */ jsxs21(
|
|
6107
6175
|
Button,
|
|
6108
6176
|
{
|
|
6109
6177
|
size: "sm",
|
|
6110
6178
|
variant: "outline",
|
|
6111
6179
|
onClick: () => setShowAddProviderForm(!showAddProviderForm),
|
|
6112
6180
|
children: [
|
|
6113
|
-
/* @__PURE__ */
|
|
6181
|
+
/* @__PURE__ */ jsx25(Plus, { className: "h-4 w-4 mr-1" }),
|
|
6114
6182
|
"Add Provider"
|
|
6115
6183
|
]
|
|
6116
6184
|
}
|
|
6117
6185
|
)
|
|
6118
6186
|
] }),
|
|
6119
|
-
showAddProviderForm && /* @__PURE__ */
|
|
6120
|
-
/* @__PURE__ */
|
|
6121
|
-
/* @__PURE__ */
|
|
6187
|
+
showAddProviderForm && /* @__PURE__ */ jsxs21("div", { className: "p-4 border rounded-lg space-y-3 bg-muted/50", children: [
|
|
6188
|
+
/* @__PURE__ */ jsx25("h4", { className: "font-medium", children: "Add Custom Provider" }),
|
|
6189
|
+
/* @__PURE__ */ jsx25(
|
|
6122
6190
|
Input,
|
|
6123
6191
|
{
|
|
6124
6192
|
placeholder: "Provider ID (e.g. my-llm-server)",
|
|
@@ -6126,21 +6194,21 @@ function SettingsPanel() {
|
|
|
6126
6194
|
onChange: (e) => setNewProviderId(e.target.value)
|
|
6127
6195
|
}
|
|
6128
6196
|
),
|
|
6129
|
-
/* @__PURE__ */
|
|
6197
|
+
/* @__PURE__ */ jsxs21(
|
|
6130
6198
|
"select",
|
|
6131
6199
|
{
|
|
6132
6200
|
className: "flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm",
|
|
6133
6201
|
value: newProviderFamily,
|
|
6134
6202
|
onChange: (e) => setNewProviderFamily(e.target.value),
|
|
6135
6203
|
children: [
|
|
6136
|
-
/* @__PURE__ */
|
|
6137
|
-
/* @__PURE__ */
|
|
6138
|
-
/* @__PURE__ */
|
|
6139
|
-
/* @__PURE__ */
|
|
6204
|
+
/* @__PURE__ */ jsx25("option", { value: "anthropic", children: "Anthropic" }),
|
|
6205
|
+
/* @__PURE__ */ jsx25("option", { value: "openai", children: "OpenAI" }),
|
|
6206
|
+
/* @__PURE__ */ jsx25("option", { value: "openai-compatible", children: "OpenAI Compatible" }),
|
|
6207
|
+
/* @__PURE__ */ jsx25("option", { value: "google", children: "Google" })
|
|
6140
6208
|
]
|
|
6141
6209
|
}
|
|
6142
6210
|
),
|
|
6143
|
-
/* @__PURE__ */
|
|
6211
|
+
/* @__PURE__ */ jsx25(
|
|
6144
6212
|
Input,
|
|
6145
6213
|
{
|
|
6146
6214
|
placeholder: "Base URL (optional, e.g. http://localhost:11434/v1)",
|
|
@@ -6148,7 +6216,7 @@ function SettingsPanel() {
|
|
|
6148
6216
|
onChange: (e) => setNewProviderBaseUrl(e.target.value)
|
|
6149
6217
|
}
|
|
6150
6218
|
),
|
|
6151
|
-
/* @__PURE__ */
|
|
6219
|
+
/* @__PURE__ */ jsx25(
|
|
6152
6220
|
Input,
|
|
6153
6221
|
{
|
|
6154
6222
|
type: "password",
|
|
@@ -6157,8 +6225,8 @@ function SettingsPanel() {
|
|
|
6157
6225
|
onChange: (e) => setNewProviderApiKey(e.target.value)
|
|
6158
6226
|
}
|
|
6159
6227
|
),
|
|
6160
|
-
/* @__PURE__ */
|
|
6161
|
-
/* @__PURE__ */
|
|
6228
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex gap-2", children: [
|
|
6229
|
+
/* @__PURE__ */ jsx25(
|
|
6162
6230
|
Button,
|
|
6163
6231
|
{
|
|
6164
6232
|
size: "sm",
|
|
@@ -6167,7 +6235,7 @@ function SettingsPanel() {
|
|
|
6167
6235
|
children: "Add"
|
|
6168
6236
|
}
|
|
6169
6237
|
),
|
|
6170
|
-
/* @__PURE__ */
|
|
6238
|
+
/* @__PURE__ */ jsx25(
|
|
6171
6239
|
Button,
|
|
6172
6240
|
{
|
|
6173
6241
|
size: "sm",
|
|
@@ -6178,59 +6246,59 @@ function SettingsPanel() {
|
|
|
6178
6246
|
)
|
|
6179
6247
|
] })
|
|
6180
6248
|
] }),
|
|
6181
|
-
isLoadingSaved ? /* @__PURE__ */
|
|
6182
|
-
/* @__PURE__ */
|
|
6183
|
-
/* @__PURE__ */
|
|
6184
|
-
/* @__PURE__ */
|
|
6185
|
-
] }) : savedProviders.map((sp) => /* @__PURE__ */
|
|
6186
|
-
/* @__PURE__ */
|
|
6187
|
-
/* @__PURE__ */
|
|
6188
|
-
/* @__PURE__ */
|
|
6189
|
-
sp.family && /* @__PURE__ */
|
|
6249
|
+
isLoadingSaved ? /* @__PURE__ */ jsx25("div", { className: "flex items-center justify-center py-8", children: /* @__PURE__ */ jsx25(Loader24, { className: "h-6 w-6 animate-spin text-muted-foreground" }) }) : savedProviders.length === 0 ? /* @__PURE__ */ jsxs21("div", { className: "text-center py-8 text-muted-foreground", children: [
|
|
6250
|
+
/* @__PURE__ */ jsx25(Key, { className: "h-8 w-8 mx-auto mb-2 opacity-50" }),
|
|
6251
|
+
/* @__PURE__ */ jsx25("p", { children: "No saved providers yet" }),
|
|
6252
|
+
/* @__PURE__ */ jsx25("p", { className: "text-sm", children: "Add a provider to get started" })
|
|
6253
|
+
] }) : savedProviders.map((sp) => /* @__PURE__ */ jsxs21("div", { className: "border rounded-lg p-4 space-y-3", children: [
|
|
6254
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex justify-between items-start", children: [
|
|
6255
|
+
/* @__PURE__ */ jsxs21("div", { children: [
|
|
6256
|
+
/* @__PURE__ */ jsx25("h4", { className: "font-medium", children: sp.id }),
|
|
6257
|
+
sp.family && /* @__PURE__ */ jsx25("span", { className: "text-xs text-muted-foreground", children: sp.family })
|
|
6190
6258
|
] }),
|
|
6191
|
-
/* @__PURE__ */
|
|
6259
|
+
/* @__PURE__ */ jsx25("div", { className: "flex gap-2", children: /* @__PURE__ */ jsx25(
|
|
6192
6260
|
Button,
|
|
6193
6261
|
{
|
|
6194
6262
|
size: "icon",
|
|
6195
6263
|
variant: "ghost",
|
|
6196
6264
|
onClick: () => handleRemoveProvider(sp.id),
|
|
6197
|
-
children: /* @__PURE__ */
|
|
6265
|
+
children: /* @__PURE__ */ jsx25(Trash22, { className: "h-4 w-4 text-destructive" })
|
|
6198
6266
|
}
|
|
6199
6267
|
) })
|
|
6200
6268
|
] }),
|
|
6201
|
-
sp.baseUrl && /* @__PURE__ */
|
|
6202
|
-
/* @__PURE__ */
|
|
6269
|
+
sp.baseUrl && /* @__PURE__ */ jsxs21("div", { className: "text-xs text-muted-foreground", children: [
|
|
6270
|
+
/* @__PURE__ */ jsx25(Globe2, { className: "h-3 w-3 inline mr-1" }),
|
|
6203
6271
|
sp.baseUrl
|
|
6204
6272
|
] }),
|
|
6205
|
-
/* @__PURE__ */
|
|
6206
|
-
/* @__PURE__ */
|
|
6207
|
-
/* @__PURE__ */
|
|
6208
|
-
/* @__PURE__ */
|
|
6273
|
+
/* @__PURE__ */ jsxs21("div", { className: "space-y-2", children: [
|
|
6274
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex justify-between items-center", children: [
|
|
6275
|
+
/* @__PURE__ */ jsx25("span", { className: "text-sm font-medium", children: "API Keys" }),
|
|
6276
|
+
/* @__PURE__ */ jsxs21(
|
|
6209
6277
|
Button,
|
|
6210
6278
|
{
|
|
6211
6279
|
size: "sm",
|
|
6212
6280
|
variant: "ghost",
|
|
6213
6281
|
onClick: () => setShowAddKeyForm(showAddKeyForm === sp.id ? null : sp.id),
|
|
6214
6282
|
children: [
|
|
6215
|
-
/* @__PURE__ */
|
|
6283
|
+
/* @__PURE__ */ jsx25(Plus, { className: "h-3 w-3 mr-1" }),
|
|
6216
6284
|
"Add Key"
|
|
6217
6285
|
]
|
|
6218
6286
|
}
|
|
6219
6287
|
)
|
|
6220
6288
|
] }),
|
|
6221
|
-
sp.apiKeys.length === 0 && !showAddKeyForm && /* @__PURE__ */
|
|
6222
|
-
sp.apiKeys.map((key) => /* @__PURE__ */
|
|
6289
|
+
sp.apiKeys.length === 0 && !showAddKeyForm && /* @__PURE__ */ jsx25("p", { className: "text-xs text-muted-foreground", children: "No keys configured" }),
|
|
6290
|
+
sp.apiKeys.map((key) => /* @__PURE__ */ jsxs21(
|
|
6223
6291
|
"div",
|
|
6224
6292
|
{
|
|
6225
6293
|
className: "flex items-center justify-between p-2 bg-muted/50 rounded",
|
|
6226
6294
|
children: [
|
|
6227
|
-
/* @__PURE__ */
|
|
6228
|
-
/* @__PURE__ */
|
|
6229
|
-
key.isActive && /* @__PURE__ */
|
|
6230
|
-
/* @__PURE__ */
|
|
6295
|
+
/* @__PURE__ */ jsxs21("div", { children: [
|
|
6296
|
+
/* @__PURE__ */ jsx25("span", { className: "text-sm font-medium", children: key.label }),
|
|
6297
|
+
key.isActive && /* @__PURE__ */ jsx25("span", { className: "ml-2 text-xs bg-green-500/10 text-green-600 px-1.5 py-0.5 rounded", children: "Active" }),
|
|
6298
|
+
/* @__PURE__ */ jsx25("div", { className: "text-xs text-muted-foreground font-mono", children: key.maskedKey })
|
|
6231
6299
|
] }),
|
|
6232
|
-
/* @__PURE__ */
|
|
6233
|
-
!key.isActive && /* @__PURE__ */
|
|
6300
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex gap-1", children: [
|
|
6301
|
+
!key.isActive && /* @__PURE__ */ jsx25(
|
|
6234
6302
|
Button,
|
|
6235
6303
|
{
|
|
6236
6304
|
size: "sm",
|
|
@@ -6239,13 +6307,13 @@ function SettingsPanel() {
|
|
|
6239
6307
|
children: "Set Active"
|
|
6240
6308
|
}
|
|
6241
6309
|
),
|
|
6242
|
-
/* @__PURE__ */
|
|
6310
|
+
/* @__PURE__ */ jsx25(
|
|
6243
6311
|
Button,
|
|
6244
6312
|
{
|
|
6245
6313
|
size: "icon",
|
|
6246
6314
|
variant: "ghost",
|
|
6247
6315
|
onClick: () => handleDeleteKey(sp.id, key.label),
|
|
6248
|
-
children: /* @__PURE__ */
|
|
6316
|
+
children: /* @__PURE__ */ jsx25(Trash22, { className: "h-3 w-3 text-destructive" })
|
|
6249
6317
|
}
|
|
6250
6318
|
)
|
|
6251
6319
|
] })
|
|
@@ -6253,8 +6321,8 @@ function SettingsPanel() {
|
|
|
6253
6321
|
},
|
|
6254
6322
|
key.label
|
|
6255
6323
|
)),
|
|
6256
|
-
showAddKeyForm === sp.id && /* @__PURE__ */
|
|
6257
|
-
/* @__PURE__ */
|
|
6324
|
+
showAddKeyForm === sp.id && /* @__PURE__ */ jsxs21("div", { className: "p-3 border rounded space-y-2 bg-background", children: [
|
|
6325
|
+
/* @__PURE__ */ jsx25(
|
|
6258
6326
|
Input,
|
|
6259
6327
|
{
|
|
6260
6328
|
placeholder: "Key label (e.g. default, production)",
|
|
@@ -6262,8 +6330,8 @@ function SettingsPanel() {
|
|
|
6262
6330
|
onChange: (e) => setNewKeyLabel(e.target.value)
|
|
6263
6331
|
}
|
|
6264
6332
|
),
|
|
6265
|
-
/* @__PURE__ */
|
|
6266
|
-
/* @__PURE__ */
|
|
6333
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex gap-2", children: [
|
|
6334
|
+
/* @__PURE__ */ jsx25(
|
|
6267
6335
|
Input,
|
|
6268
6336
|
{
|
|
6269
6337
|
type: showNewKeyValue ? "text" : "password",
|
|
@@ -6272,18 +6340,18 @@ function SettingsPanel() {
|
|
|
6272
6340
|
onChange: (e) => setNewKeyValue(e.target.value)
|
|
6273
6341
|
}
|
|
6274
6342
|
),
|
|
6275
|
-
/* @__PURE__ */
|
|
6343
|
+
/* @__PURE__ */ jsx25(
|
|
6276
6344
|
Button,
|
|
6277
6345
|
{
|
|
6278
6346
|
size: "icon",
|
|
6279
6347
|
variant: "ghost",
|
|
6280
6348
|
onClick: () => setShowNewKeyValue(!showNewKeyValue),
|
|
6281
|
-
children: showNewKeyValue ? /* @__PURE__ */
|
|
6349
|
+
children: showNewKeyValue ? /* @__PURE__ */ jsx25(EyeOff, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx25(Eye, { className: "h-4 w-4" })
|
|
6282
6350
|
}
|
|
6283
6351
|
)
|
|
6284
6352
|
] }),
|
|
6285
|
-
/* @__PURE__ */
|
|
6286
|
-
/* @__PURE__ */
|
|
6353
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex gap-2", children: [
|
|
6354
|
+
/* @__PURE__ */ jsx25(
|
|
6287
6355
|
Button,
|
|
6288
6356
|
{
|
|
6289
6357
|
size: "sm",
|
|
@@ -6292,7 +6360,7 @@ function SettingsPanel() {
|
|
|
6292
6360
|
children: "Save Key"
|
|
6293
6361
|
}
|
|
6294
6362
|
),
|
|
6295
|
-
/* @__PURE__ */
|
|
6363
|
+
/* @__PURE__ */ jsx25(
|
|
6296
6364
|
Button,
|
|
6297
6365
|
{
|
|
6298
6366
|
size: "sm",
|
|
@@ -6311,13 +6379,13 @@ function SettingsPanel() {
|
|
|
6311
6379
|
] }, sp.id))
|
|
6312
6380
|
] })
|
|
6313
6381
|
] }),
|
|
6314
|
-
/* @__PURE__ */
|
|
6315
|
-
/* @__PURE__ */
|
|
6316
|
-
/* @__PURE__ */
|
|
6317
|
-
/* @__PURE__ */
|
|
6318
|
-
/* @__PURE__ */
|
|
6382
|
+
/* @__PURE__ */ jsx25(TabsContent, { value: "model", className: "space-y-4", children: provider ? /* @__PURE__ */ jsxs21(Fragment7, { children: [
|
|
6383
|
+
/* @__PURE__ */ jsxs21("div", { className: "flex items-center justify-between", children: [
|
|
6384
|
+
/* @__PURE__ */ jsxs21("div", { children: [
|
|
6385
|
+
/* @__PURE__ */ jsx25("p", { className: "text-sm font-medium", children: currentCatalogProvider?.name || provider }),
|
|
6386
|
+
/* @__PURE__ */ jsx25("p", { className: "text-xs text-muted-foreground", children: provider })
|
|
6319
6387
|
] }),
|
|
6320
|
-
/* @__PURE__ */
|
|
6388
|
+
/* @__PURE__ */ jsx25(
|
|
6321
6389
|
Button,
|
|
6322
6390
|
{
|
|
6323
6391
|
variant: "ghost",
|
|
@@ -6326,15 +6394,15 @@ function SettingsPanel() {
|
|
|
6326
6394
|
setIsLoadingModels(true);
|
|
6327
6395
|
ws.listProviderModels?.(provider);
|
|
6328
6396
|
},
|
|
6329
|
-
children: /* @__PURE__ */
|
|
6397
|
+
children: /* @__PURE__ */ jsx25(RefreshCw2, { className: cn("h-4 w-4", isLoadingModels && "animate-spin") })
|
|
6330
6398
|
}
|
|
6331
6399
|
)
|
|
6332
6400
|
] }),
|
|
6333
|
-
isLoadingModels && !catalogModels[provider] ? /* @__PURE__ */
|
|
6334
|
-
/* @__PURE__ */
|
|
6335
|
-
/* @__PURE__ */
|
|
6336
|
-
] }) : /* @__PURE__ */
|
|
6337
|
-
(catalogModels[provider] || []).map((m) => /* @__PURE__ */
|
|
6401
|
+
isLoadingModels && !catalogModels[provider] ? /* @__PURE__ */ jsxs21("div", { className: "flex items-center justify-center py-8", children: [
|
|
6402
|
+
/* @__PURE__ */ jsx25(Loader24, { className: "h-6 w-6 animate-spin text-muted-foreground" }),
|
|
6403
|
+
/* @__PURE__ */ jsx25("span", { className: "ml-2 text-muted-foreground", children: "Loading models..." })
|
|
6404
|
+
] }) : /* @__PURE__ */ jsxs21("div", { className: "space-y-1", children: [
|
|
6405
|
+
(catalogModels[provider] || []).map((m) => /* @__PURE__ */ jsxs21(
|
|
6338
6406
|
"button",
|
|
6339
6407
|
{
|
|
6340
6408
|
type: "button",
|
|
@@ -6344,47 +6412,47 @@ function SettingsPanel() {
|
|
|
6344
6412
|
model === m.id ? "border-primary bg-primary/5 ring-2 ring-primary/20" : "border-border hover:bg-muted"
|
|
6345
6413
|
),
|
|
6346
6414
|
children: [
|
|
6347
|
-
/* @__PURE__ */
|
|
6348
|
-
/* @__PURE__ */
|
|
6349
|
-
/* @__PURE__ */
|
|
6415
|
+
/* @__PURE__ */ jsxs21("div", { children: [
|
|
6416
|
+
/* @__PURE__ */ jsx25("span", { className: "font-medium", children: m.name || m.id }),
|
|
6417
|
+
/* @__PURE__ */ jsx25("div", { className: "flex gap-2 mt-1", children: m.capabilities.map((cap) => /* @__PURE__ */ jsx25("span", { className: "text-xs bg-muted px-1.5 py-0.5 rounded", children: cap }, cap)) })
|
|
6350
6418
|
] }),
|
|
6351
|
-
/* @__PURE__ */
|
|
6352
|
-
m.contextWindow && /* @__PURE__ */
|
|
6419
|
+
/* @__PURE__ */ jsxs21("div", { className: "text-right text-xs text-muted-foreground", children: [
|
|
6420
|
+
m.contextWindow && /* @__PURE__ */ jsxs21("div", { children: [
|
|
6353
6421
|
m.contextWindow / 1e3,
|
|
6354
6422
|
"k context"
|
|
6355
6423
|
] }),
|
|
6356
|
-
m.inputCost && m.outputCost && /* @__PURE__ */
|
|
6424
|
+
m.inputCost && m.outputCost && /* @__PURE__ */ jsxs21("div", { children: [
|
|
6357
6425
|
"$",
|
|
6358
6426
|
m.inputCost,
|
|
6359
6427
|
"/$",
|
|
6360
6428
|
m.outputCost
|
|
6361
6429
|
] }),
|
|
6362
|
-
model === m.id && /* @__PURE__ */
|
|
6430
|
+
model === m.id && /* @__PURE__ */ jsx25(CheckCircle24, { className: "h-4 w-4 text-primary mt-1" })
|
|
6363
6431
|
] })
|
|
6364
6432
|
]
|
|
6365
6433
|
},
|
|
6366
6434
|
m.id
|
|
6367
6435
|
)),
|
|
6368
|
-
catalogModels[provider]?.length === 0 && /* @__PURE__ */
|
|
6436
|
+
catalogModels[provider]?.length === 0 && /* @__PURE__ */ jsx25("p", { className: "text-sm text-muted-foreground text-center py-4", children: "No models found for this provider. The catalog might be empty or still loading." })
|
|
6369
6437
|
] })
|
|
6370
|
-
] }) : /* @__PURE__ */
|
|
6371
|
-
/* @__PURE__ */
|
|
6372
|
-
/* @__PURE__ */
|
|
6438
|
+
] }) : /* @__PURE__ */ jsxs21("div", { className: "text-center py-8 text-muted-foreground", children: [
|
|
6439
|
+
/* @__PURE__ */ jsx25(Cpu4, { className: "h-8 w-8 mx-auto mb-2 opacity-50" }),
|
|
6440
|
+
/* @__PURE__ */ jsx25("p", { children: "Select a provider first" })
|
|
6373
6441
|
] }) }),
|
|
6374
|
-
/* @__PURE__ */
|
|
6375
|
-
/* @__PURE__ */
|
|
6376
|
-
/* @__PURE__ */
|
|
6442
|
+
/* @__PURE__ */ jsxs21(TabsContent, { value: "connection", className: "space-y-4", children: [
|
|
6443
|
+
/* @__PURE__ */ jsxs21("div", { className: "space-y-3", children: [
|
|
6444
|
+
/* @__PURE__ */ jsxs21(
|
|
6377
6445
|
"label",
|
|
6378
6446
|
{
|
|
6379
6447
|
htmlFor: "websocket-url",
|
|
6380
6448
|
className: "text-sm font-medium flex items-center gap-2",
|
|
6381
6449
|
children: [
|
|
6382
|
-
/* @__PURE__ */
|
|
6450
|
+
/* @__PURE__ */ jsx25(Globe2, { className: "h-4 w-4 text-muted-foreground" }),
|
|
6383
6451
|
"WebSocket Server URL"
|
|
6384
6452
|
]
|
|
6385
6453
|
}
|
|
6386
6454
|
),
|
|
6387
|
-
/* @__PURE__ */
|
|
6455
|
+
/* @__PURE__ */ jsx25(
|
|
6388
6456
|
Input,
|
|
6389
6457
|
{
|
|
6390
6458
|
id: "websocket-url",
|
|
@@ -6394,70 +6462,70 @@ function SettingsPanel() {
|
|
|
6394
6462
|
className: "font-mono text-sm"
|
|
6395
6463
|
}
|
|
6396
6464
|
),
|
|
6397
|
-
/* @__PURE__ */
|
|
6465
|
+
/* @__PURE__ */ jsx25("p", { className: "text-xs text-muted-foreground", children: "URL of the WrongStack WebSocket server. The server runs alongside the CLI." })
|
|
6398
6466
|
] }),
|
|
6399
|
-
/* @__PURE__ */
|
|
6400
|
-
/* @__PURE__ */
|
|
6401
|
-
/* @__PURE__ */
|
|
6467
|
+
/* @__PURE__ */ jsxs21("div", { className: "p-4 rounded-lg border bg-muted/50", children: [
|
|
6468
|
+
/* @__PURE__ */ jsx25("h4", { className: "text-sm font-medium mb-2", children: "Starting the WebSocket Server" }),
|
|
6469
|
+
/* @__PURE__ */ jsxs21("p", { className: "text-xs text-muted-foreground mb-3", children: [
|
|
6402
6470
|
"Standalone: run ",
|
|
6403
|
-
/* @__PURE__ */
|
|
6471
|
+
/* @__PURE__ */ jsx25("code", { className: "bg-muted px-1 py-0.5 rounded", children: "./dev.ps1" }),
|
|
6404
6472
|
" ",
|
|
6405
6473
|
"from the repo root, or set WS_HOST/WS_PORT before launching",
|
|
6406
6474
|
" ",
|
|
6407
|
-
/* @__PURE__ */
|
|
6475
|
+
/* @__PURE__ */ jsx25("code", { className: "bg-muted px-1 py-0.5 rounded", children: "node packages/webui/dist/server/entry.js" }),
|
|
6408
6476
|
". Or alongside the CLI:",
|
|
6409
6477
|
" ",
|
|
6410
|
-
/* @__PURE__ */
|
|
6478
|
+
/* @__PURE__ */ jsx25("code", { className: "bg-muted px-1 py-0.5 rounded", children: "wstack --webui" }),
|
|
6411
6479
|
"."
|
|
6412
6480
|
] })
|
|
6413
6481
|
] })
|
|
6414
6482
|
] }),
|
|
6415
|
-
/* @__PURE__ */
|
|
6416
|
-
/* @__PURE__ */
|
|
6417
|
-
/* @__PURE__ */
|
|
6418
|
-
/* @__PURE__ */
|
|
6419
|
-
/* @__PURE__ */
|
|
6483
|
+
/* @__PURE__ */ jsxs21(TabsContent, { value: "appearance", className: "space-y-4", children: [
|
|
6484
|
+
/* @__PURE__ */ jsxs21("div", { children: [
|
|
6485
|
+
/* @__PURE__ */ jsx25("h3", { className: "text-sm font-semibold mb-3", children: "Theme" }),
|
|
6486
|
+
/* @__PURE__ */ jsxs21("div", { className: "grid grid-cols-3 gap-2 max-w-md", children: [
|
|
6487
|
+
/* @__PURE__ */ jsxs21(
|
|
6420
6488
|
Button,
|
|
6421
6489
|
{
|
|
6422
6490
|
variant: theme === "light" ? "default" : "outline",
|
|
6423
6491
|
size: "sm",
|
|
6424
6492
|
onClick: () => setTheme("light"),
|
|
6425
6493
|
children: [
|
|
6426
|
-
/* @__PURE__ */
|
|
6494
|
+
/* @__PURE__ */ jsx25(Sun3, { className: "h-4 w-4 mr-1" }),
|
|
6427
6495
|
"Light"
|
|
6428
6496
|
]
|
|
6429
6497
|
}
|
|
6430
6498
|
),
|
|
6431
|
-
/* @__PURE__ */
|
|
6499
|
+
/* @__PURE__ */ jsxs21(
|
|
6432
6500
|
Button,
|
|
6433
6501
|
{
|
|
6434
6502
|
variant: theme === "dark" ? "default" : "outline",
|
|
6435
6503
|
size: "sm",
|
|
6436
6504
|
onClick: () => setTheme("dark"),
|
|
6437
6505
|
children: [
|
|
6438
|
-
/* @__PURE__ */
|
|
6506
|
+
/* @__PURE__ */ jsx25(Moon3, { className: "h-4 w-4 mr-1" }),
|
|
6439
6507
|
"Dark"
|
|
6440
6508
|
]
|
|
6441
6509
|
}
|
|
6442
6510
|
),
|
|
6443
|
-
/* @__PURE__ */
|
|
6511
|
+
/* @__PURE__ */ jsxs21(
|
|
6444
6512
|
Button,
|
|
6445
6513
|
{
|
|
6446
6514
|
variant: theme === "system" ? "default" : "outline",
|
|
6447
6515
|
size: "sm",
|
|
6448
6516
|
onClick: () => setTheme("system"),
|
|
6449
6517
|
children: [
|
|
6450
|
-
/* @__PURE__ */
|
|
6518
|
+
/* @__PURE__ */ jsx25(Monitor3, { className: "h-4 w-4 mr-1" }),
|
|
6451
6519
|
"System"
|
|
6452
6520
|
]
|
|
6453
6521
|
}
|
|
6454
6522
|
)
|
|
6455
6523
|
] }),
|
|
6456
|
-
/* @__PURE__ */
|
|
6524
|
+
/* @__PURE__ */ jsx25("p", { className: "text-xs text-muted-foreground mt-2", children: "System follows your OS-level light/dark preference." })
|
|
6457
6525
|
] }),
|
|
6458
|
-
/* @__PURE__ */
|
|
6459
|
-
/* @__PURE__ */
|
|
6460
|
-
/* @__PURE__ */
|
|
6526
|
+
/* @__PURE__ */ jsxs21("div", { className: "pt-2 border-t", children: [
|
|
6527
|
+
/* @__PURE__ */ jsx25("h3", { className: "text-sm font-semibold mb-3 mt-3", children: "Preferences" }),
|
|
6528
|
+
/* @__PURE__ */ jsx25(
|
|
6461
6529
|
PreferenceToggle,
|
|
6462
6530
|
{
|
|
6463
6531
|
label: "Compact density",
|
|
@@ -6466,7 +6534,7 @@ function SettingsPanel() {
|
|
|
6466
6534
|
onChange: () => useUIStore.getState().toggleCompactMode()
|
|
6467
6535
|
}
|
|
6468
6536
|
),
|
|
6469
|
-
/* @__PURE__ */
|
|
6537
|
+
/* @__PURE__ */ jsx25(
|
|
6470
6538
|
PreferenceToggle,
|
|
6471
6539
|
{
|
|
6472
6540
|
label: "Sound on completion",
|
|
@@ -6501,12 +6569,12 @@ function PreferenceToggle({
|
|
|
6501
6569
|
}
|
|
6502
6570
|
}
|
|
6503
6571
|
};
|
|
6504
|
-
return /* @__PURE__ */
|
|
6505
|
-
/* @__PURE__ */
|
|
6506
|
-
/* @__PURE__ */
|
|
6507
|
-
hint && /* @__PURE__ */
|
|
6572
|
+
return /* @__PURE__ */ jsxs21("div", { className: "flex items-start justify-between gap-3 py-2", children: [
|
|
6573
|
+
/* @__PURE__ */ jsxs21("div", { className: "min-w-0 flex-1", children: [
|
|
6574
|
+
/* @__PURE__ */ jsx25("div", { className: "text-sm font-medium", children: label }),
|
|
6575
|
+
hint && /* @__PURE__ */ jsx25("div", { className: "text-xs text-muted-foreground mt-0.5", children: hint })
|
|
6508
6576
|
] }),
|
|
6509
|
-
/* @__PURE__ */
|
|
6577
|
+
/* @__PURE__ */ jsx25(
|
|
6510
6578
|
"button",
|
|
6511
6579
|
{
|
|
6512
6580
|
type: "button",
|
|
@@ -6517,7 +6585,7 @@ function PreferenceToggle({
|
|
|
6517
6585
|
"shrink-0 relative inline-flex h-5 w-9 rounded-full border transition-colors",
|
|
6518
6586
|
on ? "bg-primary border-primary" : "bg-muted border-input hover:bg-muted/80"
|
|
6519
6587
|
),
|
|
6520
|
-
children: /* @__PURE__ */
|
|
6588
|
+
children: /* @__PURE__ */ jsx25(
|
|
6521
6589
|
"span",
|
|
6522
6590
|
{
|
|
6523
6591
|
className: cn(
|
|
@@ -6534,7 +6602,7 @@ function PreferenceToggle({
|
|
|
6534
6602
|
// src/components/ShortcutsOverlay.tsx
|
|
6535
6603
|
import { Keyboard as Keyboard2, X as X6 } from "lucide-react";
|
|
6536
6604
|
import { useEffect as useEffect17 } from "react";
|
|
6537
|
-
import { jsx as
|
|
6605
|
+
import { jsx as jsx26, jsxs as jsxs22 } from "react/jsx-runtime";
|
|
6538
6606
|
var SHORTCUTS = [
|
|
6539
6607
|
{
|
|
6540
6608
|
section: "Global",
|
|
@@ -6603,7 +6671,7 @@ function ShortcutsOverlay() {
|
|
|
6603
6671
|
return () => window.removeEventListener("keydown", onKey);
|
|
6604
6672
|
}, [setOpen]);
|
|
6605
6673
|
if (!open) return null;
|
|
6606
|
-
return /* @__PURE__ */
|
|
6674
|
+
return /* @__PURE__ */ jsx26(
|
|
6607
6675
|
"div",
|
|
6608
6676
|
{
|
|
6609
6677
|
className: "fixed inset-0 z-50 bg-background/60 backdrop-blur-sm flex items-center justify-center px-4",
|
|
@@ -6611,49 +6679,49 @@ function ShortcutsOverlay() {
|
|
|
6611
6679
|
onKeyDown: (e) => {
|
|
6612
6680
|
if (e.key === "Escape") setOpen(false);
|
|
6613
6681
|
},
|
|
6614
|
-
children: /* @__PURE__ */
|
|
6682
|
+
children: /* @__PURE__ */ jsxs22(
|
|
6615
6683
|
"div",
|
|
6616
6684
|
{
|
|
6617
6685
|
onClick: (e) => e.stopPropagation(),
|
|
6618
6686
|
onKeyDown: (e) => e.stopPropagation(),
|
|
6619
6687
|
className: "w-full max-w-2xl rounded-xl border bg-popover shadow-2xl overflow-hidden flex flex-col max-h-[80vh]",
|
|
6620
6688
|
children: [
|
|
6621
|
-
/* @__PURE__ */
|
|
6622
|
-
/* @__PURE__ */
|
|
6623
|
-
/* @__PURE__ */
|
|
6624
|
-
/* @__PURE__ */
|
|
6689
|
+
/* @__PURE__ */ jsxs22("div", { className: "flex items-center justify-between px-5 py-4 border-b", children: [
|
|
6690
|
+
/* @__PURE__ */ jsxs22("div", { className: "flex items-center gap-2", children: [
|
|
6691
|
+
/* @__PURE__ */ jsx26(Keyboard2, { className: "h-4 w-4 text-muted-foreground" }),
|
|
6692
|
+
/* @__PURE__ */ jsx26("h2", { className: "text-sm font-semibold", children: "Keyboard shortcuts" })
|
|
6625
6693
|
] }),
|
|
6626
|
-
/* @__PURE__ */
|
|
6694
|
+
/* @__PURE__ */ jsx26(
|
|
6627
6695
|
"button",
|
|
6628
6696
|
{
|
|
6629
6697
|
type: "button",
|
|
6630
6698
|
onClick: () => setOpen(false),
|
|
6631
6699
|
className: "text-muted-foreground hover:text-foreground p-1 rounded hover:bg-muted",
|
|
6632
|
-
children: /* @__PURE__ */
|
|
6700
|
+
children: /* @__PURE__ */ jsx26(X6, { className: "h-4 w-4" })
|
|
6633
6701
|
}
|
|
6634
6702
|
)
|
|
6635
6703
|
] }),
|
|
6636
|
-
/* @__PURE__ */
|
|
6637
|
-
/* @__PURE__ */
|
|
6638
|
-
/* @__PURE__ */
|
|
6704
|
+
/* @__PURE__ */ jsx26("div", { className: "overflow-y-auto px-5 py-4 space-y-6", children: SHORTCUTS.map((group) => /* @__PURE__ */ jsxs22("div", { children: [
|
|
6705
|
+
/* @__PURE__ */ jsx26("div", { className: "text-[10px] uppercase tracking-wider text-muted-foreground mb-2", children: group.section }),
|
|
6706
|
+
/* @__PURE__ */ jsx26("div", { className: "grid grid-cols-1 gap-1.5", children: group.items.map((s) => /* @__PURE__ */ jsxs22(
|
|
6639
6707
|
"div",
|
|
6640
6708
|
{
|
|
6641
6709
|
className: "flex items-center justify-between gap-3 text-sm px-2 py-1.5 rounded hover:bg-muted/40",
|
|
6642
6710
|
children: [
|
|
6643
|
-
/* @__PURE__ */
|
|
6644
|
-
/* @__PURE__ */
|
|
6645
|
-
ki > 0 && /* @__PURE__ */
|
|
6646
|
-
/* @__PURE__ */
|
|
6711
|
+
/* @__PURE__ */ jsx26("span", { className: "text-foreground/80", children: s.description }),
|
|
6712
|
+
/* @__PURE__ */ jsx26("span", { className: "flex items-center gap-1 shrink-0", children: s.keys.map((k, ki) => /* @__PURE__ */ jsxs22("span", { className: "flex items-center gap-1", children: [
|
|
6713
|
+
ki > 0 && /* @__PURE__ */ jsx26("span", { className: "text-muted-foreground/40 text-xs", children: "+" }),
|
|
6714
|
+
/* @__PURE__ */ jsx26("kbd", { className: "font-mono text-[10px] border rounded px-1.5 py-0.5 bg-background", children: k })
|
|
6647
6715
|
] }, k)) })
|
|
6648
6716
|
]
|
|
6649
6717
|
},
|
|
6650
6718
|
s.description
|
|
6651
6719
|
)) })
|
|
6652
6720
|
] }, group.section)) }),
|
|
6653
|
-
/* @__PURE__ */
|
|
6721
|
+
/* @__PURE__ */ jsxs22("div", { className: "border-t px-5 py-3 text-xs text-muted-foreground", children: [
|
|
6654
6722
|
"Press",
|
|
6655
6723
|
" ",
|
|
6656
|
-
/* @__PURE__ */
|
|
6724
|
+
/* @__PURE__ */ jsx26("kbd", { className: "font-mono text-[10px] border rounded px-1 py-0.5 bg-background", children: "?" }),
|
|
6657
6725
|
" ",
|
|
6658
6726
|
"any time to reopen this list."
|
|
6659
6727
|
] })
|
|
@@ -6676,7 +6744,7 @@ import {
|
|
|
6676
6744
|
MessageSquare,
|
|
6677
6745
|
PanelLeftClose,
|
|
6678
6746
|
Pin as Pin2,
|
|
6679
|
-
RefreshCw as
|
|
6747
|
+
RefreshCw as RefreshCw3,
|
|
6680
6748
|
RotateCcw as RotateCcw5,
|
|
6681
6749
|
Search as Search5,
|
|
6682
6750
|
Settings as SettingsIcon2,
|
|
@@ -6688,7 +6756,7 @@ import {
|
|
|
6688
6756
|
Zap as Zap3
|
|
6689
6757
|
} from "lucide-react";
|
|
6690
6758
|
import { useEffect as useEffect18, useState as useState17 } from "react";
|
|
6691
|
-
import { Fragment as Fragment8, jsx as
|
|
6759
|
+
import { Fragment as Fragment8, jsx as jsx27, jsxs as jsxs23 } from "react/jsx-runtime";
|
|
6692
6760
|
function Sidebar() {
|
|
6693
6761
|
const { toggleSidebar, currentView, setCurrentView } = useUIStore();
|
|
6694
6762
|
const sidebarWidth = useUIStore((s) => s.sidebarWidth);
|
|
@@ -6800,13 +6868,13 @@ function Sidebar() {
|
|
|
6800
6868
|
document.body.style.cursor = "col-resize";
|
|
6801
6869
|
document.body.style.userSelect = "none";
|
|
6802
6870
|
};
|
|
6803
|
-
return /* @__PURE__ */
|
|
6871
|
+
return /* @__PURE__ */ jsxs23(
|
|
6804
6872
|
"aside",
|
|
6805
6873
|
{
|
|
6806
6874
|
style: { width: `${sidebarWidth}px` },
|
|
6807
6875
|
className: "relative border-r bg-card flex flex-col shrink-0",
|
|
6808
6876
|
children: [
|
|
6809
|
-
/* @__PURE__ */
|
|
6877
|
+
/* @__PURE__ */ jsxs23(
|
|
6810
6878
|
"div",
|
|
6811
6879
|
{
|
|
6812
6880
|
onMouseDown: startDrag,
|
|
@@ -6814,56 +6882,56 @@ function Sidebar() {
|
|
|
6814
6882
|
className: "group/handle absolute top-0 right-0 h-full w-2 cursor-col-resize z-10 flex items-center justify-end",
|
|
6815
6883
|
title: "Drag to resize \xB7 double-click to reset",
|
|
6816
6884
|
children: [
|
|
6817
|
-
/* @__PURE__ */
|
|
6818
|
-
/* @__PURE__ */
|
|
6819
|
-
/* @__PURE__ */
|
|
6820
|
-
/* @__PURE__ */
|
|
6821
|
-
/* @__PURE__ */
|
|
6885
|
+
/* @__PURE__ */ jsx27("div", { className: "h-full w-px bg-border group-hover/handle:bg-primary/60 group-hover/handle:w-0.5 transition-all" }),
|
|
6886
|
+
/* @__PURE__ */ jsxs23("div", { className: "absolute right-0 top-1/2 -translate-y-1/2 flex flex-col gap-0.5 opacity-0 group-hover/handle:opacity-100 transition-opacity pr-0.5", children: [
|
|
6887
|
+
/* @__PURE__ */ jsx27("span", { className: "h-1 w-1 rounded-full bg-primary/70" }),
|
|
6888
|
+
/* @__PURE__ */ jsx27("span", { className: "h-1 w-1 rounded-full bg-primary/70" }),
|
|
6889
|
+
/* @__PURE__ */ jsx27("span", { className: "h-1 w-1 rounded-full bg-primary/70" })
|
|
6822
6890
|
] })
|
|
6823
6891
|
]
|
|
6824
6892
|
}
|
|
6825
6893
|
),
|
|
6826
|
-
/* @__PURE__ */
|
|
6827
|
-
/* @__PURE__ */
|
|
6828
|
-
/* @__PURE__ */
|
|
6829
|
-
/* @__PURE__ */
|
|
6894
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex items-center justify-between px-4 py-3 border-b", children: [
|
|
6895
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex items-center gap-2", children: [
|
|
6896
|
+
/* @__PURE__ */ jsx27("div", { className: "w-6 h-6 rounded bg-primary flex items-center justify-center", children: /* @__PURE__ */ jsx27(Zap3, { className: "h-4 w-4 text-primary-foreground" }) }),
|
|
6897
|
+
/* @__PURE__ */ jsx27("span", { className: "text-sm font-semibold tracking-tight", children: "WrongStack" })
|
|
6830
6898
|
] }),
|
|
6831
|
-
/* @__PURE__ */
|
|
6899
|
+
/* @__PURE__ */ jsx27(Button, { variant: "ghost", size: "icon", onClick: toggleSidebar, children: /* @__PURE__ */ jsx27(PanelLeftClose, { className: "h-4 w-4" }) })
|
|
6832
6900
|
] }),
|
|
6833
|
-
/* @__PURE__ */
|
|
6901
|
+
/* @__PURE__ */ jsxs23(
|
|
6834
6902
|
Tabs,
|
|
6835
6903
|
{
|
|
6836
6904
|
value: currentView === "settings" ? "chat" : currentView,
|
|
6837
6905
|
onValueChange: (v) => setCurrentView(v),
|
|
6838
6906
|
className: "flex-1 flex flex-col",
|
|
6839
6907
|
children: [
|
|
6840
|
-
/* @__PURE__ */
|
|
6841
|
-
/* @__PURE__ */
|
|
6908
|
+
/* @__PURE__ */ jsxs23(TabsList, { className: "w-full rounded-none bg-transparent p-2 h-auto grid grid-cols-2", children: [
|
|
6909
|
+
/* @__PURE__ */ jsxs23(
|
|
6842
6910
|
TabsTrigger,
|
|
6843
6911
|
{
|
|
6844
6912
|
value: "chat",
|
|
6845
6913
|
className: "flex-col gap-1.5 py-2 data-[state=active]:bg-primary/10",
|
|
6846
6914
|
children: [
|
|
6847
|
-
/* @__PURE__ */
|
|
6848
|
-
/* @__PURE__ */
|
|
6915
|
+
/* @__PURE__ */ jsx27(MessageSquare, { className: "h-4 w-4" }),
|
|
6916
|
+
/* @__PURE__ */ jsx27("span", { className: "text-xs", children: "Chat" })
|
|
6849
6917
|
]
|
|
6850
6918
|
}
|
|
6851
6919
|
),
|
|
6852
|
-
/* @__PURE__ */
|
|
6920
|
+
/* @__PURE__ */ jsxs23(
|
|
6853
6921
|
TabsTrigger,
|
|
6854
6922
|
{
|
|
6855
6923
|
value: "history",
|
|
6856
6924
|
className: "flex-col gap-1.5 py-2 data-[state=active]:bg-primary/10",
|
|
6857
6925
|
children: [
|
|
6858
|
-
/* @__PURE__ */
|
|
6859
|
-
/* @__PURE__ */
|
|
6926
|
+
/* @__PURE__ */ jsx27(History, { className: "h-4 w-4" }),
|
|
6927
|
+
/* @__PURE__ */ jsx27("span", { className: "text-xs", children: "History" })
|
|
6860
6928
|
]
|
|
6861
6929
|
}
|
|
6862
6930
|
)
|
|
6863
6931
|
] }),
|
|
6864
|
-
/* @__PURE__ */
|
|
6865
|
-
/* @__PURE__ */
|
|
6866
|
-
/* @__PURE__ */
|
|
6932
|
+
/* @__PURE__ */ jsxs23(TabsContent, { value: "chat", className: "flex-1 flex flex-col m-0 overflow-hidden", children: [
|
|
6933
|
+
/* @__PURE__ */ jsxs23("div", { className: "px-4 py-3 border-b", children: [
|
|
6934
|
+
/* @__PURE__ */ jsxs23(
|
|
6867
6935
|
"div",
|
|
6868
6936
|
{
|
|
6869
6937
|
className: cn(
|
|
@@ -6871,95 +6939,95 @@ function Sidebar() {
|
|
|
6871
6939
|
wsConnected ? "bg-green-500/10 text-green-600 dark:text-green-400" : "bg-yellow-500/10 text-yellow-600 dark:text-yellow-400"
|
|
6872
6940
|
),
|
|
6873
6941
|
children: [
|
|
6874
|
-
wsConnected ? /* @__PURE__ */
|
|
6875
|
-
/* @__PURE__ */
|
|
6942
|
+
wsConnected ? /* @__PURE__ */ jsx27(Wifi3, { className: "h-4 w-4" }) : /* @__PURE__ */ jsx27(WifiOff4, { className: "h-4 w-4" }),
|
|
6943
|
+
/* @__PURE__ */ jsx27("span", { className: "font-medium", children: wsConnected ? "Connected" : "Disconnected" })
|
|
6876
6944
|
]
|
|
6877
6945
|
}
|
|
6878
6946
|
),
|
|
6879
|
-
/* @__PURE__ */
|
|
6947
|
+
/* @__PURE__ */ jsx27("div", { className: "text-xs text-muted-foreground mt-2 px-1 font-mono", children: wsUrl })
|
|
6880
6948
|
] }),
|
|
6881
|
-
/* @__PURE__ */
|
|
6949
|
+
/* @__PURE__ */ jsxs23(
|
|
6882
6950
|
"button",
|
|
6883
6951
|
{
|
|
6884
6952
|
type: "button",
|
|
6885
6953
|
onClick: () => setCurrentView("settings"),
|
|
6886
6954
|
className: "px-4 py-3 border-b text-left hover:bg-muted/40 transition-colors",
|
|
6887
6955
|
children: [
|
|
6888
|
-
/* @__PURE__ */
|
|
6889
|
-
/* @__PURE__ */
|
|
6890
|
-
/* @__PURE__ */
|
|
6891
|
-
/* @__PURE__ */
|
|
6892
|
-
/* @__PURE__ */
|
|
6956
|
+
/* @__PURE__ */ jsx27("div", { className: "text-[10px] uppercase tracking-wider text-muted-foreground mb-1", children: "Active model" }),
|
|
6957
|
+
/* @__PURE__ */ jsxs23("div", { className: "font-mono text-xs truncate", children: [
|
|
6958
|
+
/* @__PURE__ */ jsx27("span", { className: "text-muted-foreground", children: provider || "\u2014" }),
|
|
6959
|
+
/* @__PURE__ */ jsx27("span", { className: "text-muted-foreground/40 mx-1", children: "/" }),
|
|
6960
|
+
/* @__PURE__ */ jsx27("span", { className: "font-medium", children: model || "\u2014" })
|
|
6893
6961
|
] })
|
|
6894
6962
|
]
|
|
6895
6963
|
}
|
|
6896
6964
|
),
|
|
6897
|
-
/* @__PURE__ */
|
|
6898
|
-
/* @__PURE__ */
|
|
6899
|
-
/* @__PURE__ */
|
|
6965
|
+
/* @__PURE__ */ jsxs23("div", { className: "px-4 py-3 border-b space-y-3", children: [
|
|
6966
|
+
/* @__PURE__ */ jsxs23("h3", { className: "text-sm font-medium flex items-center gap-2", children: [
|
|
6967
|
+
/* @__PURE__ */ jsx27(Database2, { className: "h-4 w-4 text-muted-foreground" }),
|
|
6900
6968
|
"Session"
|
|
6901
6969
|
] }),
|
|
6902
|
-
/* @__PURE__ */
|
|
6903
|
-
/* @__PURE__ */
|
|
6904
|
-
/* @__PURE__ */
|
|
6905
|
-
/* @__PURE__ */
|
|
6970
|
+
/* @__PURE__ */ jsxs23("div", { className: "grid grid-cols-2 gap-2 text-xs", children: [
|
|
6971
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex flex-col p-2 rounded-lg bg-muted/50", children: [
|
|
6972
|
+
/* @__PURE__ */ jsx27("span", { className: "text-muted-foreground", children: "Messages" }),
|
|
6973
|
+
/* @__PURE__ */ jsx27("span", { className: "text-lg font-semibold", children: messages.length })
|
|
6906
6974
|
] }),
|
|
6907
|
-
/* @__PURE__ */
|
|
6908
|
-
/* @__PURE__ */
|
|
6909
|
-
/* @__PURE__ */
|
|
6975
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex flex-col p-2 rounded-lg bg-muted/50", children: [
|
|
6976
|
+
/* @__PURE__ */ jsx27("span", { className: "text-muted-foreground", children: "Duration" }),
|
|
6977
|
+
/* @__PURE__ */ jsx27("span", { className: "text-lg font-semibold", children: formatDuration2(session?.startedAt ?? null) })
|
|
6910
6978
|
] }),
|
|
6911
|
-
/* @__PURE__ */
|
|
6912
|
-
/* @__PURE__ */
|
|
6913
|
-
/* @__PURE__ */
|
|
6979
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex flex-col p-2 rounded-lg bg-muted/50", children: [
|
|
6980
|
+
/* @__PURE__ */ jsx27("span", { className: "text-muted-foreground", children: "Input" }),
|
|
6981
|
+
/* @__PURE__ */ jsx27("span", { className: "text-lg font-semibold", children: totalTokens.input.toLocaleString() })
|
|
6914
6982
|
] }),
|
|
6915
|
-
/* @__PURE__ */
|
|
6916
|
-
/* @__PURE__ */
|
|
6917
|
-
/* @__PURE__ */
|
|
6983
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex flex-col p-2 rounded-lg bg-muted/50", children: [
|
|
6984
|
+
/* @__PURE__ */ jsx27("span", { className: "text-muted-foreground", children: "Output" }),
|
|
6985
|
+
/* @__PURE__ */ jsx27("span", { className: "text-lg font-semibold", children: totalTokens.output.toLocaleString() })
|
|
6918
6986
|
] })
|
|
6919
6987
|
] }),
|
|
6920
|
-
cost > 0 && /* @__PURE__ */
|
|
6921
|
-
/* @__PURE__ */
|
|
6922
|
-
/* @__PURE__ */
|
|
6988
|
+
cost > 0 && /* @__PURE__ */ jsxs23("div", { className: "flex justify-between items-center p-2 rounded-lg bg-green-500/10", children: [
|
|
6989
|
+
/* @__PURE__ */ jsx27("span", { className: "text-sm text-muted-foreground", children: "Cost" }),
|
|
6990
|
+
/* @__PURE__ */ jsxs23("span", { className: "text-lg font-semibold text-green-600 dark:text-green-400", children: [
|
|
6923
6991
|
"$",
|
|
6924
6992
|
cost.toFixed(4)
|
|
6925
6993
|
] })
|
|
6926
6994
|
] })
|
|
6927
6995
|
] }),
|
|
6928
|
-
todos.length > 0 && /* @__PURE__ */
|
|
6929
|
-
/* @__PURE__ */
|
|
6930
|
-
/* @__PURE__ */
|
|
6931
|
-
/* @__PURE__ */
|
|
6996
|
+
todos.length > 0 && /* @__PURE__ */ jsxs23("div", { className: "px-4 py-3 border-b space-y-2", children: [
|
|
6997
|
+
/* @__PURE__ */ jsxs23("h3", { className: "text-sm font-medium flex items-center justify-between", children: [
|
|
6998
|
+
/* @__PURE__ */ jsxs23("span", { className: "flex items-center gap-2", children: [
|
|
6999
|
+
/* @__PURE__ */ jsx27(ListTodo, { className: "h-4 w-4 text-muted-foreground" }),
|
|
6932
7000
|
"Todos"
|
|
6933
7001
|
] }),
|
|
6934
|
-
/* @__PURE__ */
|
|
7002
|
+
/* @__PURE__ */ jsxs23("span", { className: "text-[10px] text-muted-foreground tabular-nums", children: [
|
|
6935
7003
|
todos.filter((t) => t.status === "completed").length,
|
|
6936
7004
|
"/",
|
|
6937
7005
|
todos.length
|
|
6938
7006
|
] })
|
|
6939
7007
|
] }),
|
|
6940
|
-
/* @__PURE__ */
|
|
7008
|
+
/* @__PURE__ */ jsx27("ul", { className: "space-y-1 max-h-48 overflow-y-auto pr-1", children: todos.map((t) => {
|
|
6941
7009
|
const Icon2 = t.status === "completed" ? CheckCircle25 : t.status === "in_progress" ? CircleDot : Circle;
|
|
6942
7010
|
const tone2 = t.status === "completed" ? "text-green-600 dark:text-green-400 line-through opacity-70" : t.status === "in_progress" ? "text-amber-600 dark:text-amber-400" : "text-muted-foreground";
|
|
6943
|
-
return /* @__PURE__ */
|
|
7011
|
+
return /* @__PURE__ */ jsxs23(
|
|
6944
7012
|
"li",
|
|
6945
7013
|
{
|
|
6946
7014
|
className: cn("flex items-start gap-2 text-xs leading-snug", tone2),
|
|
6947
7015
|
children: [
|
|
6948
|
-
/* @__PURE__ */
|
|
6949
|
-
/* @__PURE__ */
|
|
7016
|
+
/* @__PURE__ */ jsx27(Icon2, { className: "h-3.5 w-3.5 mt-0.5 shrink-0" }),
|
|
7017
|
+
/* @__PURE__ */ jsx27("span", { className: "break-words", children: t.status === "in_progress" && t.activeForm ? t.activeForm : t.content })
|
|
6950
7018
|
]
|
|
6951
7019
|
},
|
|
6952
7020
|
t.id
|
|
6953
7021
|
);
|
|
6954
7022
|
}) })
|
|
6955
7023
|
] }),
|
|
6956
|
-
pinnedRows.length > 0 && /* @__PURE__ */
|
|
6957
|
-
/* @__PURE__ */
|
|
6958
|
-
/* @__PURE__ */
|
|
6959
|
-
/* @__PURE__ */
|
|
7024
|
+
pinnedRows.length > 0 && /* @__PURE__ */ jsxs23("div", { className: "px-4 py-3 border-b space-y-2", children: [
|
|
7025
|
+
/* @__PURE__ */ jsxs23("h3", { className: "text-sm font-medium flex items-center justify-between", children: [
|
|
7026
|
+
/* @__PURE__ */ jsxs23("span", { className: "flex items-center gap-2", children: [
|
|
7027
|
+
/* @__PURE__ */ jsx27(Pin2, { className: "h-4 w-4 text-amber-500" }),
|
|
6960
7028
|
"Pinned"
|
|
6961
7029
|
] }),
|
|
6962
|
-
/* @__PURE__ */
|
|
7030
|
+
/* @__PURE__ */ jsx27(
|
|
6963
7031
|
"button",
|
|
6964
7032
|
{
|
|
6965
7033
|
type: "button",
|
|
@@ -6969,9 +7037,9 @@ function Sidebar() {
|
|
|
6969
7037
|
}
|
|
6970
7038
|
)
|
|
6971
7039
|
] }),
|
|
6972
|
-
/* @__PURE__ */
|
|
7040
|
+
/* @__PURE__ */ jsx27("ul", { className: "space-y-1 max-h-48 overflow-y-auto pr-1", children: pinnedRows.map((m) => {
|
|
6973
7041
|
const preview = m.content.replace(/\s+/g, " ").slice(0, 80);
|
|
6974
|
-
return /* @__PURE__ */
|
|
7042
|
+
return /* @__PURE__ */ jsx27("li", { children: /* @__PURE__ */ jsxs23(
|
|
6975
7043
|
"button",
|
|
6976
7044
|
{
|
|
6977
7045
|
type: "button",
|
|
@@ -6994,8 +7062,8 @@ function Sidebar() {
|
|
|
6994
7062
|
) }, m.id);
|
|
6995
7063
|
}) })
|
|
6996
7064
|
] }),
|
|
6997
|
-
/* @__PURE__ */
|
|
6998
|
-
/* @__PURE__ */
|
|
7065
|
+
/* @__PURE__ */ jsxs23("div", { className: "px-4 py-3 border-b space-y-2", children: [
|
|
7066
|
+
/* @__PURE__ */ jsxs23(
|
|
6999
7067
|
Button,
|
|
7000
7068
|
{
|
|
7001
7069
|
variant: "outline",
|
|
@@ -7006,12 +7074,12 @@ function Sidebar() {
|
|
|
7006
7074
|
client2?.clearContext?.();
|
|
7007
7075
|
},
|
|
7008
7076
|
children: [
|
|
7009
|
-
/* @__PURE__ */
|
|
7077
|
+
/* @__PURE__ */ jsx27(Trash23, { className: "h-4 w-4 mr-2" }),
|
|
7010
7078
|
"Clear context"
|
|
7011
7079
|
]
|
|
7012
7080
|
}
|
|
7013
7081
|
),
|
|
7014
|
-
/* @__PURE__ */
|
|
7082
|
+
/* @__PURE__ */ jsxs23(
|
|
7015
7083
|
Button,
|
|
7016
7084
|
{
|
|
7017
7085
|
variant: "outline",
|
|
@@ -7020,12 +7088,12 @@ function Sidebar() {
|
|
|
7020
7088
|
onClick: () => client2?.newSession?.(),
|
|
7021
7089
|
disabled: !wsConnected,
|
|
7022
7090
|
children: [
|
|
7023
|
-
/* @__PURE__ */
|
|
7091
|
+
/* @__PURE__ */ jsx27(RotateCcw5, { className: "h-4 w-4 mr-2" }),
|
|
7024
7092
|
"New session"
|
|
7025
7093
|
]
|
|
7026
7094
|
}
|
|
7027
7095
|
),
|
|
7028
|
-
/* @__PURE__ */
|
|
7096
|
+
/* @__PURE__ */ jsxs23(
|
|
7029
7097
|
Button,
|
|
7030
7098
|
{
|
|
7031
7099
|
variant: "outline",
|
|
@@ -7034,14 +7102,14 @@ function Sidebar() {
|
|
|
7034
7102
|
onClick: () => client2?.compactContext?.(),
|
|
7035
7103
|
disabled: !wsConnected,
|
|
7036
7104
|
children: [
|
|
7037
|
-
/* @__PURE__ */
|
|
7105
|
+
/* @__PURE__ */ jsx27(Database2, { className: "h-4 w-4 mr-2" }),
|
|
7038
7106
|
"Compact context"
|
|
7039
7107
|
]
|
|
7040
7108
|
}
|
|
7041
7109
|
)
|
|
7042
7110
|
] }),
|
|
7043
|
-
/* @__PURE__ */
|
|
7044
|
-
/* @__PURE__ */
|
|
7111
|
+
/* @__PURE__ */ jsx27("div", { className: "flex-1" }),
|
|
7112
|
+
/* @__PURE__ */ jsx27("div", { className: "px-3 py-3 border-t", children: /* @__PURE__ */ jsxs23(
|
|
7045
7113
|
Button,
|
|
7046
7114
|
{
|
|
7047
7115
|
variant: "ghost",
|
|
@@ -7049,16 +7117,16 @@ function Sidebar() {
|
|
|
7049
7117
|
className: "w-full justify-start",
|
|
7050
7118
|
onClick: () => setCurrentView("settings"),
|
|
7051
7119
|
children: [
|
|
7052
|
-
/* @__PURE__ */
|
|
7120
|
+
/* @__PURE__ */ jsx27(SettingsIcon2, { className: "h-4 w-4 mr-2" }),
|
|
7053
7121
|
"Settings"
|
|
7054
7122
|
]
|
|
7055
7123
|
}
|
|
7056
7124
|
) })
|
|
7057
7125
|
] }),
|
|
7058
|
-
/* @__PURE__ */
|
|
7059
|
-
/* @__PURE__ */
|
|
7060
|
-
/* @__PURE__ */
|
|
7061
|
-
/* @__PURE__ */
|
|
7126
|
+
/* @__PURE__ */ jsxs23(TabsContent, { value: "history", className: "flex-1 m-0 flex flex-col overflow-hidden", children: [
|
|
7127
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex items-center justify-between px-4 py-2 border-b", children: [
|
|
7128
|
+
/* @__PURE__ */ jsx27("span", { className: "text-xs uppercase tracking-wider text-muted-foreground", children: "Recent sessions" }),
|
|
7129
|
+
/* @__PURE__ */ jsx27(
|
|
7062
7130
|
Button,
|
|
7063
7131
|
{
|
|
7064
7132
|
variant: "ghost",
|
|
@@ -7067,13 +7135,13 @@ function Sidebar() {
|
|
|
7067
7135
|
onClick: () => listSessions(50),
|
|
7068
7136
|
disabled: !wsConnected,
|
|
7069
7137
|
title: "Refresh",
|
|
7070
|
-
children: historyLoading ? /* @__PURE__ */
|
|
7138
|
+
children: historyLoading ? /* @__PURE__ */ jsx27(Loader25, { className: "h-3.5 w-3.5 animate-spin" }) : /* @__PURE__ */ jsx27(RefreshCw3, { className: "h-3.5 w-3.5" })
|
|
7071
7139
|
}
|
|
7072
7140
|
)
|
|
7073
7141
|
] }),
|
|
7074
|
-
historyEntries.length > 3 && /* @__PURE__ */
|
|
7075
|
-
/* @__PURE__ */
|
|
7076
|
-
/* @__PURE__ */
|
|
7142
|
+
historyEntries.length > 3 && /* @__PURE__ */ jsx27("div", { className: "px-3 py-2 border-b", children: /* @__PURE__ */ jsxs23("div", { className: "relative", children: [
|
|
7143
|
+
/* @__PURE__ */ jsx27(Search5, { className: "absolute left-2 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-muted-foreground/60" }),
|
|
7144
|
+
/* @__PURE__ */ jsx27(
|
|
7077
7145
|
"input",
|
|
7078
7146
|
{
|
|
7079
7147
|
type: "text",
|
|
@@ -7083,28 +7151,28 @@ function Sidebar() {
|
|
|
7083
7151
|
className: "w-full pl-7 pr-7 py-1 text-xs rounded-md bg-muted/40 border border-transparent focus:bg-background focus:border-input focus:outline-none focus:ring-1 focus:ring-ring placeholder:text-muted-foreground/50"
|
|
7084
7152
|
}
|
|
7085
7153
|
),
|
|
7086
|
-
historyQuery && /* @__PURE__ */
|
|
7154
|
+
historyQuery && /* @__PURE__ */ jsx27(
|
|
7087
7155
|
"button",
|
|
7088
7156
|
{
|
|
7089
7157
|
type: "button",
|
|
7090
7158
|
onClick: () => setHistoryQuery(""),
|
|
7091
7159
|
className: "absolute right-1 top-1/2 -translate-y-1/2 text-muted-foreground/60 hover:text-foreground p-0.5",
|
|
7092
7160
|
title: "Clear filter",
|
|
7093
|
-
children: /* @__PURE__ */
|
|
7161
|
+
children: /* @__PURE__ */ jsx27(X7, { className: "h-3 w-3" })
|
|
7094
7162
|
}
|
|
7095
7163
|
)
|
|
7096
7164
|
] }) }),
|
|
7097
|
-
historyError && /* @__PURE__ */
|
|
7098
|
-
/* @__PURE__ */
|
|
7099
|
-
/* @__PURE__ */
|
|
7100
|
-
/* @__PURE__ */
|
|
7101
|
-
/* @__PURE__ */
|
|
7102
|
-
] }) : groupedHistory.length === 0 ? /* @__PURE__ */
|
|
7103
|
-
/* @__PURE__ */
|
|
7104
|
-
/* @__PURE__ */
|
|
7105
|
-
/* @__PURE__ */
|
|
7106
|
-
] }) : /* @__PURE__ */
|
|
7107
|
-
/* @__PURE__ */
|
|
7165
|
+
historyError && /* @__PURE__ */ jsx27("div", { className: "px-4 py-2 text-xs text-destructive bg-destructive/5 border-b", children: historyError }),
|
|
7166
|
+
/* @__PURE__ */ jsx27(ScrollArea, { className: "flex-1", children: historyEntries.length === 0 && !historyLoading ? /* @__PURE__ */ jsxs23("div", { className: "text-center text-muted-foreground py-8 px-4", children: [
|
|
7167
|
+
/* @__PURE__ */ jsx27(History, { className: "h-8 w-8 mx-auto mb-3 opacity-20" }),
|
|
7168
|
+
/* @__PURE__ */ jsx27("p", { className: "text-sm font-medium", children: "No history yet" }),
|
|
7169
|
+
/* @__PURE__ */ jsx27("p", { className: "text-xs mt-1", children: "Your conversations will appear here" })
|
|
7170
|
+
] }) : groupedHistory.length === 0 ? /* @__PURE__ */ jsxs23("div", { className: "text-center text-muted-foreground py-8 px-4", children: [
|
|
7171
|
+
/* @__PURE__ */ jsx27(Search5, { className: "h-8 w-8 mx-auto mb-3 opacity-20" }),
|
|
7172
|
+
/* @__PURE__ */ jsx27("p", { className: "text-sm font-medium", children: "No matches" }),
|
|
7173
|
+
/* @__PURE__ */ jsx27("p", { className: "text-xs mt-1", children: "Try a different filter" })
|
|
7174
|
+
] }) : /* @__PURE__ */ jsx27("div", { className: "p-2 space-y-3", children: groupedHistory.map((group) => /* @__PURE__ */ jsxs23("div", { className: "space-y-1", children: [
|
|
7175
|
+
/* @__PURE__ */ jsxs23(
|
|
7108
7176
|
"div",
|
|
7109
7177
|
{
|
|
7110
7178
|
className: cn(
|
|
@@ -7112,10 +7180,10 @@ function Sidebar() {
|
|
|
7112
7180
|
group.star ? "text-amber-500" : "text-muted-foreground/80"
|
|
7113
7181
|
),
|
|
7114
7182
|
children: [
|
|
7115
|
-
group.star && /* @__PURE__ */
|
|
7183
|
+
group.star && /* @__PURE__ */ jsx27(Star, { className: "h-3 w-3 fill-current" }),
|
|
7116
7184
|
group.label,
|
|
7117
7185
|
" ",
|
|
7118
|
-
/* @__PURE__ */
|
|
7186
|
+
/* @__PURE__ */ jsxs23("span", { className: "text-muted-foreground/50 font-normal normal-case ml-1", children: [
|
|
7119
7187
|
"(",
|
|
7120
7188
|
group.rows.length,
|
|
7121
7189
|
")"
|
|
@@ -7123,7 +7191,7 @@ function Sidebar() {
|
|
|
7123
7191
|
]
|
|
7124
7192
|
}
|
|
7125
7193
|
),
|
|
7126
|
-
group.rows.map((entry) => /* @__PURE__ */
|
|
7194
|
+
group.rows.map((entry) => /* @__PURE__ */ jsxs23(
|
|
7127
7195
|
"div",
|
|
7128
7196
|
{
|
|
7129
7197
|
className: cn(
|
|
@@ -7131,7 +7199,7 @@ function Sidebar() {
|
|
|
7131
7199
|
entry.isCurrent ? "bg-primary/5 border-primary/40" : "bg-card border-border/60 hover:bg-muted/40 hover:border-primary/40"
|
|
7132
7200
|
),
|
|
7133
7201
|
children: [
|
|
7134
|
-
/* @__PURE__ */
|
|
7202
|
+
/* @__PURE__ */ jsx27(
|
|
7135
7203
|
"button",
|
|
7136
7204
|
{
|
|
7137
7205
|
type: "button",
|
|
@@ -7143,8 +7211,8 @@ function Sidebar() {
|
|
|
7143
7211
|
setRenameDraft(sessionNicknames[entry.id] ?? entry.title ?? "");
|
|
7144
7212
|
},
|
|
7145
7213
|
className: "block w-full rounded-md px-3 py-2 pr-16 text-left disabled:cursor-default focus:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
7146
|
-
children: /* @__PURE__ */
|
|
7147
|
-
renamingId === entry.id ? /* @__PURE__ */
|
|
7214
|
+
children: /* @__PURE__ */ jsxs23("div", { className: "min-w-0 flex-1", children: [
|
|
7215
|
+
renamingId === entry.id ? /* @__PURE__ */ jsx27(
|
|
7148
7216
|
"input",
|
|
7149
7217
|
{
|
|
7150
7218
|
value: renameDraft,
|
|
@@ -7167,7 +7235,7 @@ function Sidebar() {
|
|
|
7167
7235
|
placeholder: entry.title || "Nickname",
|
|
7168
7236
|
className: "w-full text-sm bg-background border border-input rounded px-1.5 py-0.5 focus:outline-none focus:ring-1 focus:ring-ring"
|
|
7169
7237
|
}
|
|
7170
|
-
) : /* @__PURE__ */
|
|
7238
|
+
) : /* @__PURE__ */ jsx27(
|
|
7171
7239
|
"div",
|
|
7172
7240
|
{
|
|
7173
7241
|
className: "font-medium truncate text-foreground",
|
|
@@ -7177,30 +7245,30 @@ Double-click to rename`,
|
|
|
7177
7245
|
children: sessionNicknames[entry.id] || entry.title || "(empty)"
|
|
7178
7246
|
}
|
|
7179
7247
|
),
|
|
7180
|
-
/* @__PURE__ */
|
|
7248
|
+
/* @__PURE__ */ jsxs23("div", { className: "text-[10px] text-muted-foreground font-mono truncate mt-0.5", children: [
|
|
7181
7249
|
entry.provider,
|
|
7182
7250
|
"/",
|
|
7183
7251
|
entry.model
|
|
7184
7252
|
] }),
|
|
7185
|
-
/* @__PURE__ */
|
|
7186
|
-
/* @__PURE__ */
|
|
7187
|
-
entry.tokenTotal > 0 && /* @__PURE__ */
|
|
7188
|
-
/* @__PURE__ */
|
|
7189
|
-
/* @__PURE__ */
|
|
7253
|
+
/* @__PURE__ */ jsxs23("div", { className: "flex items-center gap-2 text-[10px] text-muted-foreground/80 mt-0.5", children: [
|
|
7254
|
+
/* @__PURE__ */ jsx27("span", { children: formatRelative(entry.startedAt) }),
|
|
7255
|
+
entry.tokenTotal > 0 && /* @__PURE__ */ jsxs23(Fragment8, { children: [
|
|
7256
|
+
/* @__PURE__ */ jsx27("span", { children: "\xB7" }),
|
|
7257
|
+
/* @__PURE__ */ jsxs23("span", { className: "tabular-nums", children: [
|
|
7190
7258
|
entry.tokenTotal.toLocaleString(),
|
|
7191
7259
|
" tok"
|
|
7192
7260
|
] })
|
|
7193
7261
|
] }),
|
|
7194
|
-
entry.isCurrent && /* @__PURE__ */
|
|
7195
|
-
/* @__PURE__ */
|
|
7196
|
-
/* @__PURE__ */
|
|
7262
|
+
entry.isCurrent && /* @__PURE__ */ jsxs23(Fragment8, { children: [
|
|
7263
|
+
/* @__PURE__ */ jsx27("span", { children: "\xB7" }),
|
|
7264
|
+
/* @__PURE__ */ jsx27("span", { className: "text-primary font-medium", children: "active" })
|
|
7197
7265
|
] })
|
|
7198
7266
|
] })
|
|
7199
7267
|
] })
|
|
7200
7268
|
}
|
|
7201
7269
|
),
|
|
7202
|
-
/* @__PURE__ */
|
|
7203
|
-
/* @__PURE__ */
|
|
7270
|
+
/* @__PURE__ */ jsxs23("div", { className: "absolute right-2 top-2 flex items-center gap-1", children: [
|
|
7271
|
+
/* @__PURE__ */ jsx27(
|
|
7204
7272
|
"button",
|
|
7205
7273
|
{
|
|
7206
7274
|
type: "button",
|
|
@@ -7210,7 +7278,7 @@ Double-click to rename`,
|
|
|
7210
7278
|
favoriteSessionIds.includes(entry.id) ? "opacity-100 text-amber-500" : "opacity-0 group-hover:opacity-100 text-muted-foreground"
|
|
7211
7279
|
),
|
|
7212
7280
|
title: favoriteSessionIds.includes(entry.id) ? "Unfavorite" : "Mark as favorite",
|
|
7213
|
-
children: /* @__PURE__ */
|
|
7281
|
+
children: /* @__PURE__ */ jsx27(
|
|
7214
7282
|
Star,
|
|
7215
7283
|
{
|
|
7216
7284
|
className: cn(
|
|
@@ -7221,7 +7289,7 @@ Double-click to rename`,
|
|
|
7221
7289
|
)
|
|
7222
7290
|
}
|
|
7223
7291
|
),
|
|
7224
|
-
!entry.isCurrent && /* @__PURE__ */
|
|
7292
|
+
!entry.isCurrent && /* @__PURE__ */ jsx27(
|
|
7225
7293
|
"button",
|
|
7226
7294
|
{
|
|
7227
7295
|
type: "button",
|
|
@@ -7232,7 +7300,7 @@ Double-click to rename`,
|
|
|
7232
7300
|
},
|
|
7233
7301
|
className: "opacity-0 group-hover:opacity-100 transition-opacity text-muted-foreground hover:text-destructive",
|
|
7234
7302
|
title: "Delete session",
|
|
7235
|
-
children: /* @__PURE__ */
|
|
7303
|
+
children: /* @__PURE__ */ jsx27(Trash23, { className: "h-3.5 w-3.5" })
|
|
7236
7304
|
}
|
|
7237
7305
|
)
|
|
7238
7306
|
] })
|
|
@@ -7251,7 +7319,7 @@ Double-click to rename`,
|
|
|
7251
7319
|
}
|
|
7252
7320
|
|
|
7253
7321
|
// src/App.tsx
|
|
7254
|
-
import { jsx as
|
|
7322
|
+
import { jsx as jsx28, jsxs as jsxs24 } from "react/jsx-runtime";
|
|
7255
7323
|
function AppInner() {
|
|
7256
7324
|
const { theme } = useTheme();
|
|
7257
7325
|
const { currentView, sidebarOpen, toggleSidebar, setSearchOpen, setSidebarOpen } = useUIStore();
|
|
@@ -7261,7 +7329,6 @@ function AppInner() {
|
|
|
7261
7329
|
const sessionTitle = useSessionStore((s) => s.session?.title);
|
|
7262
7330
|
const sessionId = useSessionStore((s) => s.session?.id);
|
|
7263
7331
|
const nickname = useUIStore((s) => sessionId ? s.sessionNicknames[sessionId] : void 0);
|
|
7264
|
-
const ws = useWebSocket();
|
|
7265
7332
|
useEffect19(() => {
|
|
7266
7333
|
if (typeof window === "undefined") return;
|
|
7267
7334
|
const mq = window.matchMedia("(max-width: 768px)");
|
|
@@ -7318,10 +7385,10 @@ function AppInner() {
|
|
|
7318
7385
|
if (e.key.toLowerCase() === "l") {
|
|
7319
7386
|
e.preventDefault();
|
|
7320
7387
|
useChatStore.getState().clearMessages();
|
|
7321
|
-
|
|
7388
|
+
getWSClient(useConfigStore.getState().wsUrl)?.clearContext?.();
|
|
7322
7389
|
} else if (e.key.toLowerCase() === "n") {
|
|
7323
7390
|
e.preventDefault();
|
|
7324
|
-
|
|
7391
|
+
getWSClient(useConfigStore.getState().wsUrl)?.newSession?.();
|
|
7325
7392
|
} else if (e.key.toLowerCase() === "e") {
|
|
7326
7393
|
e.preventDefault();
|
|
7327
7394
|
downloadChatAsMarkdown();
|
|
@@ -7387,28 +7454,28 @@ function AppInner() {
|
|
|
7387
7454
|
};
|
|
7388
7455
|
window.addEventListener("keydown", onKey);
|
|
7389
7456
|
return () => window.removeEventListener("keydown", onKey);
|
|
7390
|
-
}, [toggleSidebar, setSearchOpen
|
|
7391
|
-
return /* @__PURE__ */
|
|
7392
|
-
sidebarOpen && /* @__PURE__ */
|
|
7393
|
-
/* @__PURE__ */
|
|
7394
|
-
/* @__PURE__ */
|
|
7395
|
-
currentView === "chat" && /* @__PURE__ */
|
|
7396
|
-
currentView === "settings" && /* @__PURE__ */
|
|
7457
|
+
}, [toggleSidebar, setSearchOpen]);
|
|
7458
|
+
return /* @__PURE__ */ jsxs24("div", { className: cn("flex h-screen", theme), children: [
|
|
7459
|
+
sidebarOpen && /* @__PURE__ */ jsx28(Sidebar, {}),
|
|
7460
|
+
/* @__PURE__ */ jsxs24("main", { className: "flex-1 flex flex-col overflow-hidden", children: [
|
|
7461
|
+
/* @__PURE__ */ jsx28(ConnectionBanner, {}),
|
|
7462
|
+
currentView === "chat" && /* @__PURE__ */ jsx28(ChatView, {}),
|
|
7463
|
+
currentView === "settings" && /* @__PURE__ */ jsx28(SettingsPanel, {})
|
|
7397
7464
|
] }),
|
|
7398
|
-
/* @__PURE__ */
|
|
7399
|
-
/* @__PURE__ */
|
|
7400
|
-
/* @__PURE__ */
|
|
7401
|
-
/* @__PURE__ */
|
|
7402
|
-
/* @__PURE__ */
|
|
7465
|
+
/* @__PURE__ */ jsx28(ConfirmDialog, {}),
|
|
7466
|
+
/* @__PURE__ */ jsx28(CommandPalette, {}),
|
|
7467
|
+
/* @__PURE__ */ jsx28(ShortcutsOverlay, {}),
|
|
7468
|
+
/* @__PURE__ */ jsx28(QuickModelSwitcher, {}),
|
|
7469
|
+
/* @__PURE__ */ jsx28(Toaster, {})
|
|
7403
7470
|
] });
|
|
7404
7471
|
}
|
|
7405
7472
|
function App() {
|
|
7406
|
-
return /* @__PURE__ */
|
|
7473
|
+
return /* @__PURE__ */ jsx28(ErrorBoundary, { children: /* @__PURE__ */ jsx28(ThemeProvider, { defaultTheme: "system", children: /* @__PURE__ */ jsx28(AppInner, {}) }) });
|
|
7407
7474
|
}
|
|
7408
7475
|
|
|
7409
7476
|
// src/main.tsx
|
|
7410
|
-
import { jsx as
|
|
7477
|
+
import { jsx as jsx29 } from "react/jsx-runtime";
|
|
7411
7478
|
ReactDOM.createRoot(document.getElementById("root")).render(
|
|
7412
|
-
/* @__PURE__ */
|
|
7479
|
+
/* @__PURE__ */ jsx29(React7.StrictMode, { children: /* @__PURE__ */ jsx29(App, {}) })
|
|
7413
7480
|
);
|
|
7414
7481
|
//# sourceMappingURL=index.js.map
|