cue-console 0.1.13 → 0.1.14
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 +2 -2
- package/src/lib/chat-logic.ts +15 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cue-console",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.14",
|
|
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",
|
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 {
|