cue-console 0.1.13 → 0.1.15
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cue-console",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.15",
|
|
4
4
|
"description": "Cue Hub console launcher (Next.js UI)",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"keywords": ["mcp", "cue", "console", "nextjs"],
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@dicebear/core": "^9.2.4",
|
|
39
39
|
"@dicebear/thumbs": "^9.2.4",
|
|
40
40
|
"@fontsource-variable/source-sans-3": "^5.2.8",
|
|
41
|
-
"better-sqlite3": "^12.
|
|
41
|
+
"better-sqlite3": "^12.6.0",
|
|
42
42
|
"class-variance-authority": "^0.7.1",
|
|
43
43
|
"clsx": "^2.1.1",
|
|
44
44
|
"lucide-react": "^0.562.0",
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
useMemo,
|
|
5
|
+
useRef,
|
|
5
6
|
useState,
|
|
6
7
|
type ChangeEvent,
|
|
7
8
|
type ClipboardEvent,
|
|
@@ -147,6 +148,7 @@ export function ChatComposer({
|
|
|
147
148
|
}, [onBack]);
|
|
148
149
|
|
|
149
150
|
const [dragIndex, setDragIndex] = useState<number | null>(null);
|
|
151
|
+
const isComposingRef = useRef(false);
|
|
150
152
|
|
|
151
153
|
const submitOrQueue = () => {
|
|
152
154
|
if (busy) return;
|
|
@@ -412,6 +414,12 @@ export function ChatComposer({
|
|
|
412
414
|
}
|
|
413
415
|
value={input}
|
|
414
416
|
onPaste={handlePaste}
|
|
417
|
+
onCompositionStart={() => {
|
|
418
|
+
isComposingRef.current = true;
|
|
419
|
+
}}
|
|
420
|
+
onCompositionEnd={() => {
|
|
421
|
+
isComposingRef.current = false;
|
|
422
|
+
}}
|
|
415
423
|
onChange={(e) => {
|
|
416
424
|
const next = e.target.value;
|
|
417
425
|
setInput(next);
|
|
@@ -508,7 +516,7 @@ export function ChatComposer({
|
|
|
508
516
|
}
|
|
509
517
|
}
|
|
510
518
|
|
|
511
|
-
if (e.key === "Enter" && !e.shiftKey) {
|
|
519
|
+
if (e.key === "Enter" && !e.shiftKey && !isComposingRef.current) {
|
|
512
520
|
e.preventDefault();
|
|
513
521
|
submitOrQueue();
|
|
514
522
|
}
|
package/src/lib/chat-logic.ts
CHANGED
|
@@ -12,7 +12,21 @@ export function isPauseRequest(req: CueRequest): boolean {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
export function filterPendingRequests(requests: CueRequest[]): CueRequest[] {
|
|
15
|
-
|
|
15
|
+
const now = Date.now();
|
|
16
|
+
const TIMEOUT_MS = 10 * 60 * 1000; // 10 minutes
|
|
17
|
+
|
|
18
|
+
return requests.filter((r) => {
|
|
19
|
+
if (r.status !== "PENDING") return false;
|
|
20
|
+
|
|
21
|
+
// Filter out requests older than 10 minutes
|
|
22
|
+
if (r.created_at) {
|
|
23
|
+
const createdTime = new Date(r.created_at).getTime();
|
|
24
|
+
const age = now - createdTime;
|
|
25
|
+
if (age > TIMEOUT_MS) return false;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return true;
|
|
29
|
+
});
|
|
16
30
|
}
|
|
17
31
|
|
|
18
32
|
export function getLatestPendingRequest(requests: CueRequest[]): CueRequest | null {
|