opencami 1.7.0 → 1.8.2
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/README.md +4 -2
- package/dist/client/assets/{CSPContext-a-MQmQQt.js → CSPContext-DeJH85nm.js} +1 -1
- package/dist/client/assets/{DirectionContext-DRcND-Cm.js → DirectionContext-CxhRpXkm.js} +1 -1
- package/dist/client/assets/_sessionKey-CQE0brGK.js +23 -0
- package/dist/client/assets/agents-CMTFd_sG.js +2 -0
- package/dist/client/assets/agents-screen-BNQGEqcW.js +1 -0
- package/dist/client/assets/bots-B6oGzCxP.js +2 -0
- package/dist/client/assets/bots-screen-Be3cfGgq.js +1 -0
- package/dist/client/assets/button-D9Plv7hu.js +1 -0
- package/dist/client/assets/composite-B2KCZKKL.js +1 -0
- package/dist/client/assets/{connect-BX1MWO82.js → connect-DuJfnyNK.js} +1 -1
- package/dist/client/assets/dashboard-00GpXm5V.js +1 -0
- package/dist/client/assets/event-DD8Cz4O9.js +1 -0
- package/dist/client/assets/file-explorer-screen-CxwemBES.js +1 -0
- package/dist/client/assets/files-DyBJVXBu.js +2 -0
- package/dist/client/assets/{index-BlC2sH55.js → index-DtGzE-ea.js} +1 -1
- package/dist/client/assets/{index-Dg0mbvtv.js → index-Yo5UhdZV.js} +1 -1
- package/dist/client/assets/keyboard-shortcuts-dialog-BZwd-iyV.js +1 -0
- package/dist/client/assets/{main-CEuT8-Qi.js → main-CgwdHc9W.js} +16 -8
- package/dist/client/assets/{markdown-DKD6ZLRJ.js → markdown-DtWnt4NA.js} +1 -1
- package/dist/client/assets/memory-l756yiNq.js +2 -0
- package/dist/client/assets/memory-screen-BQtVRuzE.js +1 -0
- package/dist/client/assets/menu-BsS6CDf_.js +1 -0
- package/dist/client/assets/{opencami-logo-DA69yVKc.js → opencami-logo-Bmge6-FB.js} +1 -1
- package/dist/client/assets/popupStateMapping-D0ZbJR_o.js +1 -0
- package/dist/client/assets/{proxy-Cawf6X0W.js → proxy-CYZeDXoy.js} +1 -1
- package/dist/client/assets/{react-K9goXsVv.js → react-DODKNyyU.js} +1 -1
- package/dist/client/assets/search-dialog-DW91SK30.js +1 -0
- package/dist/client/assets/session-export-dialog-CliO9Ob-.js +1 -0
- package/dist/client/assets/settings-dialog-C1u52aju.js +1 -0
- package/dist/client/assets/skills-8T_avaVb.js +2 -0
- package/dist/client/assets/{skills-panel-DFL-3BRH.js → skills-panel-DSiH-DLs.js} +1 -1
- package/dist/client/assets/styles-DvaLh0o1.css +1 -0
- package/dist/client/assets/switch-DbgQPO6i.js +1 -0
- package/dist/client/assets/tabs-BsAvZnlD.js +1 -0
- package/dist/client/assets/tooltip-DLmutB5C.js +1 -0
- package/dist/client/assets/use-file-explorer-state-Cg_yDYJl.js +12 -0
- package/dist/client/assets/useBaseUiId-KQTzRPLp.js +1 -0
- package/dist/client/assets/useCompositeItem-BPY2_hF_.js +1 -0
- package/dist/client/assets/{useControlled-Cl9XA2_f.js → useControlled-B5pEEz2V.js} +1 -1
- package/dist/client/assets/{useMutation-C5bTdeC1.js → useMutation-BsQD6FKe.js} +1 -1
- package/dist/client/assets/useQuery-CmAJuY2W.js +1 -0
- package/dist/client/assets/visuallyHidden-COI6QeQH.js +1 -0
- package/dist/client/sw.js +5 -164
- package/dist/server/assets/{_sessionKey-BBG3ZUlo.js → _sessionKey-Bq_fl7uv.js} +878 -755
- package/dist/server/assets/_tanstack-start-manifest_v-BMCAWon2.js +4 -0
- package/dist/server/assets/dashboard-GCKodTiJ.js +214 -0
- package/dist/server/assets/{index-BgMPaOsU.js → index-C2hVqxBl.js} +2 -1
- package/dist/server/assets/{router-Bl2uabfY.js → router-bN_iTo0B.js} +485 -189
- package/dist/server/assets/{search-dialog-BtSQW9SR.js → search-dialog-DReM5ZD2.js} +3 -2
- package/dist/server/assets/settings-dialog-BUOrQN3Z.js +1511 -0
- package/dist/server/server.js +2 -2
- package/package.json +1 -1
- package/dist/client/assets/_sessionKey-BAmpzUOP.js +0 -23
- package/dist/client/assets/agents-BkeWu_3a.js +0 -2
- package/dist/client/assets/agents-screen-Cb76bcxn.js +0 -1
- package/dist/client/assets/bots-CyJwr-JU.js +0 -2
- package/dist/client/assets/bots-screen-CzNjLsQH.js +0 -1
- package/dist/client/assets/button-DNC5N25i.js +0 -1
- package/dist/client/assets/composite-Bliqcmg4.js +0 -1
- package/dist/client/assets/file-explorer-screen-CpY1O_ag.js +0 -1
- package/dist/client/assets/files-HiN5rXWq.js +0 -2
- package/dist/client/assets/keyboard-shortcuts-dialog-C2Hq19LN.js +0 -1
- package/dist/client/assets/memory-lhzf-8Q4.js +0 -2
- package/dist/client/assets/memory-screen-Zq9qfnJK.js +0 -1
- package/dist/client/assets/menu-47ooFeSm.js +0 -1
- package/dist/client/assets/owner-CFRNz_Tp.js +0 -1
- package/dist/client/assets/popupStateMapping-D5k-jOeY.js +0 -1
- package/dist/client/assets/search-dialog-C5Yae9rb.js +0 -1
- package/dist/client/assets/session-export-dialog-CBeTfbll.js +0 -1
- package/dist/client/assets/settings-dialog-CoeG9M1b.js +0 -1
- package/dist/client/assets/skills-BEkw619A.js +0 -2
- package/dist/client/assets/styles-D4EBtWYc.css +0 -1
- package/dist/client/assets/switch-DAFvLxNX.js +0 -1
- package/dist/client/assets/tabs-B2Y_7MvG.js +0 -1
- package/dist/client/assets/tooltip-D57Pal0B.js +0 -1
- package/dist/client/assets/use-file-explorer-state-DppKEjcl.js +0 -12
- package/dist/client/assets/useButton-DVAfkehQ.js +0 -1
- package/dist/client/assets/useCompositeItem-CzdGhGcj.js +0 -1
- package/dist/client/assets/visuallyHidden-CO3ZD5AQ.js +0 -1
- package/dist/server/assets/_tanstack-start-manifest_v-DmMFarHb.js +0 -4
- package/dist/server/assets/settings-dialog-D3fOAswX.js +0 -1173
|
@@ -7,15 +7,23 @@ import { readFileSync, existsSync } from "node:fs";
|
|
|
7
7
|
import path, { join, resolve, relative, extname } from "node:path";
|
|
8
8
|
import os, { homedir } from "node:os";
|
|
9
9
|
import { json } from "@tanstack/router-core/ssr/client";
|
|
10
|
+
import { PassThrough, Readable } from "node:stream";
|
|
10
11
|
import { execSync } from "node:child_process";
|
|
11
12
|
import { readFile, mkdir, writeFile, rename, stat, readdir, rm, realpath, lstat } from "node:fs/promises";
|
|
12
13
|
import { posix } from "path";
|
|
13
|
-
const appCss = "/assets/styles-
|
|
14
|
+
const appCss = "/assets/styles-DvaLh0o1.css";
|
|
14
15
|
const swRegisterScript = `
|
|
15
16
|
(() => {
|
|
16
17
|
// Skip PWA service worker inside Capacitor native shell — they conflict
|
|
17
18
|
// with the native networking layer and caching.
|
|
18
19
|
if (window.Capacitor && window.Capacitor.isNativePlatform && window.Capacitor.isNativePlatform()) return;
|
|
20
|
+
// Unregister any existing service workers — old SW was breaking SSE streaming
|
|
21
|
+
if ('serviceWorker' in navigator) {
|
|
22
|
+
navigator.serviceWorker.getRegistrations().then((regs) => {
|
|
23
|
+
regs.forEach((reg) => reg.unregister());
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
if (false) { // SW disabled — causes streaming issues
|
|
19
27
|
if ('serviceWorker' in navigator) {
|
|
20
28
|
window.addEventListener('load', () => {
|
|
21
29
|
navigator.serviceWorker.register('/sw.js', { scope: '/' })
|
|
@@ -37,6 +45,7 @@ const swRegisterScript = `
|
|
|
37
45
|
.catch((err) => console.warn('[SW] Registration failed:', err));
|
|
38
46
|
});
|
|
39
47
|
}
|
|
48
|
+
}
|
|
40
49
|
})()
|
|
41
50
|
`;
|
|
42
51
|
const themeScript = `
|
|
@@ -211,7 +220,7 @@ function NotFoundRedirect() {
|
|
|
211
220
|
}
|
|
212
221
|
return null;
|
|
213
222
|
}
|
|
214
|
-
const Route$
|
|
223
|
+
const Route$B = createRootRoute({
|
|
215
224
|
notFoundComponent: NotFoundRedirect,
|
|
216
225
|
head: () => ({
|
|
217
226
|
meta: [
|
|
@@ -319,12 +328,12 @@ function RootDocument({ children }) {
|
|
|
319
328
|
] })
|
|
320
329
|
] });
|
|
321
330
|
}
|
|
322
|
-
const $$splitComponentImporter$
|
|
323
|
-
const Route$
|
|
324
|
-
component: lazyRouteComponent($$splitComponentImporter$
|
|
331
|
+
const $$splitComponentImporter$9 = () => import("./skills-Cy8xclXY.js");
|
|
332
|
+
const Route$A = createFileRoute("/skills")({
|
|
333
|
+
component: lazyRouteComponent($$splitComponentImporter$9, "component")
|
|
325
334
|
});
|
|
326
|
-
const $$splitComponentImporter$
|
|
327
|
-
const Route$
|
|
335
|
+
const $$splitComponentImporter$8 = () => import("./new-Dzk5YxE9.js");
|
|
336
|
+
const Route$z = createFileRoute("/new")({
|
|
328
337
|
beforeLoad: function redirectToNewChat() {
|
|
329
338
|
throw redirect({
|
|
330
339
|
to: "/chat/$sessionKey",
|
|
@@ -334,34 +343,38 @@ const Route$v = createFileRoute("/new")({
|
|
|
334
343
|
replace: true
|
|
335
344
|
});
|
|
336
345
|
},
|
|
346
|
+
component: lazyRouteComponent($$splitComponentImporter$8, "component")
|
|
347
|
+
});
|
|
348
|
+
const $$splitComponentImporter$7 = () => import("./memory-BqZOoD7Q.js");
|
|
349
|
+
const Route$y = createFileRoute("/memory")({
|
|
337
350
|
component: lazyRouteComponent($$splitComponentImporter$7, "component")
|
|
338
351
|
});
|
|
339
|
-
const $$splitComponentImporter$6 = () => import("./
|
|
340
|
-
const Route$
|
|
352
|
+
const $$splitComponentImporter$6 = () => import("./files-DYdXlQDr.js");
|
|
353
|
+
const Route$x = createFileRoute("/files")({
|
|
341
354
|
component: lazyRouteComponent($$splitComponentImporter$6, "component")
|
|
342
355
|
});
|
|
343
|
-
const $$splitComponentImporter$5 = () => import("./
|
|
344
|
-
const Route$
|
|
356
|
+
const $$splitComponentImporter$5 = () => import("./dashboard-GCKodTiJ.js");
|
|
357
|
+
const Route$w = createFileRoute("/dashboard")({
|
|
345
358
|
component: lazyRouteComponent($$splitComponentImporter$5, "component")
|
|
346
359
|
});
|
|
347
360
|
const $$splitComponentImporter$4 = () => import("./connect-CbgijWz4.js");
|
|
348
|
-
const Route$
|
|
361
|
+
const Route$v = createFileRoute("/connect")({
|
|
349
362
|
component: lazyRouteComponent($$splitComponentImporter$4, "component")
|
|
350
363
|
});
|
|
351
364
|
const $$splitComponentImporter$3 = () => import("./bots-Byt6jv0a.js");
|
|
352
|
-
const Route$
|
|
365
|
+
const Route$u = createFileRoute("/bots")({
|
|
353
366
|
component: lazyRouteComponent($$splitComponentImporter$3, "component")
|
|
354
367
|
});
|
|
355
368
|
const $$splitComponentImporter$2 = () => import("./agents-CmQ4vvXm.js");
|
|
356
|
-
const Route$
|
|
369
|
+
const Route$t = createFileRoute("/agents")({
|
|
357
370
|
component: lazyRouteComponent($$splitComponentImporter$2, "component")
|
|
358
371
|
});
|
|
359
|
-
const $$splitComponentImporter$1 = () => import("./index-
|
|
360
|
-
const Route$
|
|
372
|
+
const $$splitComponentImporter$1 = () => import("./index-C2hVqxBl.js");
|
|
373
|
+
const Route$s = createFileRoute("/")({
|
|
361
374
|
component: lazyRouteComponent($$splitComponentImporter$1, "component")
|
|
362
375
|
});
|
|
363
|
-
const $$splitComponentImporter = () => import("./_sessionKey-
|
|
364
|
-
const Route$
|
|
376
|
+
const $$splitComponentImporter = () => import("./_sessionKey-Bq_fl7uv.js").then((n) => n.$);
|
|
377
|
+
const Route$r = createFileRoute("/chat/$sessionKey")({
|
|
365
378
|
component: lazyRouteComponent($$splitComponentImporter, "component")
|
|
366
379
|
});
|
|
367
380
|
function getGatewayConfig() {
|
|
@@ -623,10 +636,12 @@ class PersistentGatewayConnection {
|
|
|
623
636
|
}
|
|
624
637
|
}
|
|
625
638
|
let _instance = null;
|
|
639
|
+
const _g = globalThis;
|
|
626
640
|
function getPersistentConnection() {
|
|
627
|
-
if (!
|
|
628
|
-
|
|
641
|
+
if (!_g.__opencamiGatewayInstance) {
|
|
642
|
+
_g.__opencamiGatewayInstance = new PersistentGatewayConnection();
|
|
629
643
|
}
|
|
644
|
+
_instance = _g.__opencamiGatewayInstance;
|
|
630
645
|
return _instance;
|
|
631
646
|
}
|
|
632
647
|
async function gatewayRpc(method, params) {
|
|
@@ -728,7 +743,7 @@ async function ttsEdge(text, voice) {
|
|
|
728
743
|
}
|
|
729
744
|
});
|
|
730
745
|
}
|
|
731
|
-
const Route$
|
|
746
|
+
const Route$q = createFileRoute("/api/tts")({
|
|
732
747
|
server: {
|
|
733
748
|
handlers: {
|
|
734
749
|
POST: async ({ request }) => {
|
|
@@ -883,7 +898,7 @@ async function sttOpenAI(audioBlob, apiKey, language) {
|
|
|
883
898
|
const data = await res.json();
|
|
884
899
|
return { text: data.text || "" };
|
|
885
900
|
}
|
|
886
|
-
const Route$
|
|
901
|
+
const Route$p = createFileRoute("/api/stt")({
|
|
887
902
|
server: {
|
|
888
903
|
handlers: {
|
|
889
904
|
POST: async ({ request }) => {
|
|
@@ -985,7 +1000,7 @@ const Route$m = createFileRoute("/api/stt")({
|
|
|
985
1000
|
}
|
|
986
1001
|
}
|
|
987
1002
|
});
|
|
988
|
-
const Route$
|
|
1003
|
+
const Route$o = createFileRoute("/api/stream")({
|
|
989
1004
|
server: {
|
|
990
1005
|
handlers: {
|
|
991
1006
|
GET: async ({ request }) => {
|
|
@@ -997,88 +1012,86 @@ const Route$l = createFileRoute("/api/stream")({
|
|
|
997
1012
|
{ status: 400, headers: { "content-type": "application/json" } }
|
|
998
1013
|
);
|
|
999
1014
|
}
|
|
1015
|
+
const pass = new PassThrough();
|
|
1000
1016
|
const encoder = new TextEncoder();
|
|
1001
|
-
let unsubscribe = null;
|
|
1002
1017
|
let closed = false;
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
try {
|
|
1009
|
-
controller.enqueue(
|
|
1010
|
-
encoder.encode(`event: ${event}
|
|
1018
|
+
let unsubscribe = null;
|
|
1019
|
+
function sendSSE(event, data) {
|
|
1020
|
+
if (closed) return;
|
|
1021
|
+
try {
|
|
1022
|
+
pass.write(encoder.encode(`event: ${event}
|
|
1011
1023
|
data: ${JSON.stringify(data)}
|
|
1012
1024
|
|
|
1013
|
-
`)
|
|
1014
|
-
|
|
1015
|
-
|
|
1025
|
+
`));
|
|
1026
|
+
} catch {
|
|
1027
|
+
}
|
|
1028
|
+
}
|
|
1029
|
+
function cleanup() {
|
|
1030
|
+
if (closed) return;
|
|
1031
|
+
closed = true;
|
|
1032
|
+
if (unsubscribe) {
|
|
1033
|
+
unsubscribe();
|
|
1034
|
+
unsubscribe = null;
|
|
1035
|
+
}
|
|
1036
|
+
try {
|
|
1037
|
+
pass.end();
|
|
1038
|
+
} catch {
|
|
1039
|
+
}
|
|
1040
|
+
}
|
|
1041
|
+
pass.write(encoder.encode(": connected\n\n"));
|
|
1042
|
+
let gotAgentStream = false;
|
|
1043
|
+
unsubscribe = subscribeGatewayEvents(sessionKey, (evt) => {
|
|
1044
|
+
if (evt.event === "agent") {
|
|
1045
|
+
const payload = evt.payload;
|
|
1046
|
+
const agentStream = payload.stream;
|
|
1047
|
+
if (agentStream === "assistant") {
|
|
1048
|
+
gotAgentStream = true;
|
|
1049
|
+
const data = payload.data ?? payload;
|
|
1050
|
+
const text = typeof data.delta === "string" ? data.delta : typeof data.text === "string" ? data.text : typeof payload.text === "string" ? payload.text : typeof payload.delta === "string" ? payload.delta : "";
|
|
1051
|
+
if (text) {
|
|
1052
|
+
sendSSE("delta", { text, sessionKey });
|
|
1053
|
+
}
|
|
1054
|
+
} else if (agentStream === "tool") {
|
|
1055
|
+
gotAgentStream = true;
|
|
1056
|
+
const tdata = payload.data ?? payload;
|
|
1057
|
+
sendSSE("tool", {
|
|
1058
|
+
name: tdata.name ?? tdata.toolName ?? payload.name ?? "",
|
|
1059
|
+
status: tdata.phase ?? tdata.status ?? payload.phase ?? "running",
|
|
1060
|
+
id: tdata.id ?? tdata.toolCallId ?? payload.id ?? "",
|
|
1061
|
+
sessionKey
|
|
1062
|
+
});
|
|
1063
|
+
} else if (agentStream === "lifecycle") {
|
|
1064
|
+
const ldata = payload.data ?? payload;
|
|
1065
|
+
const phase = ldata.phase ?? payload.phase;
|
|
1066
|
+
if (phase === "end" || phase === "error") {
|
|
1067
|
+
sendSSE("done", {
|
|
1068
|
+
sessionKey,
|
|
1069
|
+
status: phase,
|
|
1070
|
+
error: phase === "error" ? payload.error : void 0
|
|
1071
|
+
});
|
|
1072
|
+
cleanup();
|
|
1016
1073
|
}
|
|
1017
1074
|
}
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
sendSSE("delta", { text, sessionKey });
|
|
1029
|
-
}
|
|
1030
|
-
} else if (agentStream === "tool") {
|
|
1031
|
-
gotAgentStream = true;
|
|
1032
|
-
const tdata = payload.data ?? payload;
|
|
1033
|
-
sendSSE("tool", {
|
|
1034
|
-
name: tdata.name ?? tdata.toolName ?? payload.name ?? "",
|
|
1035
|
-
status: tdata.phase ?? tdata.status ?? payload.phase ?? "running",
|
|
1036
|
-
id: tdata.id ?? tdata.toolCallId ?? payload.id ?? "",
|
|
1037
|
-
sessionKey
|
|
1038
|
-
});
|
|
1039
|
-
} else if (agentStream === "lifecycle") {
|
|
1040
|
-
const ldata = payload.data ?? payload;
|
|
1041
|
-
const phase = ldata.phase ?? payload.phase;
|
|
1042
|
-
if (phase === "end" || phase === "error") {
|
|
1043
|
-
sendSSE("done", {
|
|
1044
|
-
sessionKey,
|
|
1045
|
-
status: phase,
|
|
1046
|
-
error: phase === "error" ? payload.error : void 0
|
|
1047
|
-
});
|
|
1048
|
-
}
|
|
1049
|
-
}
|
|
1050
|
-
} else if (evt.event === "chat") {
|
|
1051
|
-
const payload = evt.payload;
|
|
1052
|
-
const kind = payload.kind;
|
|
1053
|
-
if (kind === "delta" && !gotAgentStream) {
|
|
1054
|
-
const text = typeof payload.text === "string" ? payload.text : typeof payload.delta === "string" ? payload.delta : "";
|
|
1055
|
-
if (text) {
|
|
1056
|
-
sendSSE("delta", { text, sessionKey });
|
|
1057
|
-
}
|
|
1058
|
-
} else if (kind === "final") {
|
|
1059
|
-
sendSSE("done", { sessionKey, status: "end" });
|
|
1060
|
-
}
|
|
1075
|
+
} else if (evt.event === "chat") {
|
|
1076
|
+
const payload = evt.payload;
|
|
1077
|
+
const state = payload.state ?? payload.kind;
|
|
1078
|
+
const msg = payload.message;
|
|
1079
|
+
if (state === "delta" && !gotAgentStream) {
|
|
1080
|
+
const content = Array.isArray(msg?.content) ? msg.content : [];
|
|
1081
|
+
const firstBlock = content[0];
|
|
1082
|
+
const text = typeof firstBlock?.text === "string" ? firstBlock.text : typeof payload.text === "string" ? payload.text : typeof payload.delta === "string" ? payload.delta : "";
|
|
1083
|
+
if (text) {
|
|
1084
|
+
sendSSE("delta", { text, sessionKey });
|
|
1061
1085
|
}
|
|
1062
|
-
})
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
closed = true;
|
|
1066
|
-
if (unsubscribe) {
|
|
1067
|
-
unsubscribe();
|
|
1068
|
-
unsubscribe = null;
|
|
1086
|
+
} else if (state === "final") {
|
|
1087
|
+
sendSSE("done", { sessionKey, status: "end" });
|
|
1088
|
+
cleanup();
|
|
1069
1089
|
}
|
|
1070
1090
|
}
|
|
1071
1091
|
});
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
if (unsubscribe) {
|
|
1076
|
-
unsubscribe();
|
|
1077
|
-
unsubscribe = null;
|
|
1078
|
-
}
|
|
1079
|
-
});
|
|
1080
|
-
}
|
|
1081
|
-
return new Response(stream, {
|
|
1092
|
+
request.signal?.addEventListener("abort", cleanup);
|
|
1093
|
+
const webStream = Readable.toWeb(pass);
|
|
1094
|
+
return new Response(webStream, {
|
|
1082
1095
|
headers: {
|
|
1083
1096
|
"content-type": "text/event-stream",
|
|
1084
1097
|
"cache-control": "no-cache, no-transform",
|
|
@@ -1144,7 +1157,7 @@ function parseSearchResults(output) {
|
|
|
1144
1157
|
return { slug: line.trim(), displayName: line.trim(), version: "", summary: "" };
|
|
1145
1158
|
});
|
|
1146
1159
|
}
|
|
1147
|
-
const Route$
|
|
1160
|
+
const Route$n = createFileRoute("/api/skills")({
|
|
1148
1161
|
server: {
|
|
1149
1162
|
handlers: {
|
|
1150
1163
|
GET: async ({ request }) => {
|
|
@@ -1263,7 +1276,7 @@ function normalizeSessions(payload) {
|
|
|
1263
1276
|
});
|
|
1264
1277
|
return { sessions: normalized };
|
|
1265
1278
|
}
|
|
1266
|
-
const Route$
|
|
1279
|
+
const Route$m = createFileRoute("/api/sessions")({
|
|
1267
1280
|
server: {
|
|
1268
1281
|
handlers: {
|
|
1269
1282
|
GET: async () => {
|
|
@@ -1416,7 +1429,7 @@ const Route$j = createFileRoute("/api/sessions")({
|
|
|
1416
1429
|
}
|
|
1417
1430
|
}
|
|
1418
1431
|
});
|
|
1419
|
-
const Route$
|
|
1432
|
+
const Route$l = createFileRoute("/api/send")({
|
|
1420
1433
|
server: {
|
|
1421
1434
|
handlers: {
|
|
1422
1435
|
POST: async ({ request }) => {
|
|
@@ -1482,7 +1495,7 @@ const Route$i = createFileRoute("/api/send")({
|
|
|
1482
1495
|
}
|
|
1483
1496
|
}
|
|
1484
1497
|
});
|
|
1485
|
-
const Route$
|
|
1498
|
+
const Route$k = createFileRoute("/api/ping")({
|
|
1486
1499
|
server: {
|
|
1487
1500
|
handlers: {
|
|
1488
1501
|
GET: async () => {
|
|
@@ -1506,7 +1519,7 @@ const categories = { "core": [{ "id": "cami", "name": "Cami", "emoji": "🦎", "
|
|
|
1506
1519
|
const personasData = {
|
|
1507
1520
|
categories
|
|
1508
1521
|
};
|
|
1509
|
-
const Route$
|
|
1522
|
+
const Route$j = createFileRoute("/api/personas")({
|
|
1510
1523
|
server: {
|
|
1511
1524
|
handlers: {
|
|
1512
1525
|
GET: async () => {
|
|
@@ -1551,7 +1564,7 @@ function resolveSessionsDir() {
|
|
|
1551
1564
|
)
|
|
1552
1565
|
};
|
|
1553
1566
|
}
|
|
1554
|
-
const Route$
|
|
1567
|
+
const Route$i = createFileRoute("/api/paths")({
|
|
1555
1568
|
server: {
|
|
1556
1569
|
handlers: {
|
|
1557
1570
|
GET: () => {
|
|
@@ -1576,7 +1589,7 @@ function parseModelName(modelId) {
|
|
|
1576
1589
|
return word.charAt(0).toUpperCase() + word.slice(1);
|
|
1577
1590
|
}).join(" ");
|
|
1578
1591
|
}
|
|
1579
|
-
const Route$
|
|
1592
|
+
const Route$h = createFileRoute("/api/models")({
|
|
1580
1593
|
server: {
|
|
1581
1594
|
handlers: {
|
|
1582
1595
|
GET: async () => {
|
|
@@ -1755,11 +1768,13 @@ async function testApiKey(apiKey) {
|
|
|
1755
1768
|
}
|
|
1756
1769
|
function getLlmConfig(request) {
|
|
1757
1770
|
const headerKey = request.headers.get("X-OpenAI-API-Key");
|
|
1758
|
-
const
|
|
1771
|
+
const headerBaseUrl = request.headers.get("X-LLM-Base-URL")?.trim() || null;
|
|
1772
|
+
const baseUrl = headerBaseUrl || process.env.LLM_BASE_URL?.trim() || null;
|
|
1759
1773
|
const isOpenRouter = baseUrl?.includes("openrouter.ai");
|
|
1760
|
-
const
|
|
1774
|
+
const isKilocode = baseUrl?.includes("kilo.ai");
|
|
1775
|
+
const envKey = isOpenRouter ? process.env.OPENROUTER_API_KEY?.trim() || process.env.OPENAI_API_KEY?.trim() : isKilocode ? process.env.KILOCODE_API_KEY?.trim() || process.env.OPENAI_API_KEY?.trim() : process.env.OPENAI_API_KEY?.trim();
|
|
1761
1776
|
const apiKey = headerKey?.trim() || envKey || null;
|
|
1762
|
-
const model = request.headers.get("X-LLM-Model")?.trim() || null;
|
|
1777
|
+
const model = request.headers.get("X-LLM-Model")?.trim() || process.env.LLM_MODEL?.trim() || null;
|
|
1763
1778
|
return { apiKey, baseUrl, model };
|
|
1764
1779
|
}
|
|
1765
1780
|
function generateHeuristicTitle(message) {
|
|
@@ -1782,7 +1797,7 @@ function generateHeuristicTitle(message) {
|
|
|
1782
1797
|
}
|
|
1783
1798
|
return title || message.slice(0, 50);
|
|
1784
1799
|
}
|
|
1785
|
-
const Route$
|
|
1800
|
+
const Route$g = createFileRoute("/api/llm-features")({
|
|
1786
1801
|
server: {
|
|
1787
1802
|
handlers: {
|
|
1788
1803
|
/**
|
|
@@ -1792,10 +1807,12 @@ const Route$d = createFileRoute("/api/llm-features")({
|
|
|
1792
1807
|
try {
|
|
1793
1808
|
const hasEnvKey = Boolean(process.env.OPENAI_API_KEY?.trim());
|
|
1794
1809
|
const hasOpenRouterKey = Boolean(process.env.OPENROUTER_API_KEY?.trim());
|
|
1810
|
+
const hasKilocodeKey = Boolean(process.env.KILOCODE_API_KEY?.trim());
|
|
1795
1811
|
return json({
|
|
1796
1812
|
ok: true,
|
|
1797
1813
|
hasEnvKey,
|
|
1798
|
-
hasOpenRouterKey
|
|
1814
|
+
hasOpenRouterKey,
|
|
1815
|
+
hasKilocodeKey
|
|
1799
1816
|
});
|
|
1800
1817
|
} catch (err) {
|
|
1801
1818
|
return json({
|
|
@@ -1934,7 +1951,7 @@ const Route$d = createFileRoute("/api/llm-features")({
|
|
|
1934
1951
|
}
|
|
1935
1952
|
}
|
|
1936
1953
|
});
|
|
1937
|
-
const Route$
|
|
1954
|
+
const Route$f = createFileRoute("/api/history")({
|
|
1938
1955
|
server: {
|
|
1939
1956
|
handlers: {
|
|
1940
1957
|
GET: async ({ request }) => {
|
|
@@ -1997,7 +2014,7 @@ function parseFollowUps(text) {
|
|
|
1997
2014
|
const lines = text.split("\n").map((line) => line.trim()).filter((line) => line.length > 0).map((line) => line.replace(/^\d+[.)\s]+/, "").trim()).map((line) => line.replace(/^[-•*]\s*/, "").trim()).map((line) => line.replace(/^["']|["']$/g, "").trim()).filter((line) => line.length > 0 && line.length < 150);
|
|
1998
2015
|
return lines.slice(0, 3);
|
|
1999
2016
|
}
|
|
2000
|
-
const Route$
|
|
2017
|
+
const Route$e = createFileRoute("/api/follow-ups")({
|
|
2001
2018
|
server: {
|
|
2002
2019
|
handlers: {
|
|
2003
2020
|
POST: async ({ request }) => {
|
|
@@ -2108,7 +2125,7 @@ function parsePatch(value) {
|
|
|
2108
2125
|
if (Object.keys(patch).length === 0) return null;
|
|
2109
2126
|
return patch;
|
|
2110
2127
|
}
|
|
2111
|
-
const Route$
|
|
2128
|
+
const Route$d = createFileRoute("/api/cron")({
|
|
2112
2129
|
server: {
|
|
2113
2130
|
handlers: {
|
|
2114
2131
|
GET: async ({ request }) => {
|
|
@@ -2185,7 +2202,7 @@ function resolveModel(m) {
|
|
|
2185
2202
|
if (typeof m === "object" && "primary" in m) return m.primary;
|
|
2186
2203
|
return void 0;
|
|
2187
2204
|
}
|
|
2188
|
-
const Route$
|
|
2205
|
+
const Route$c = createFileRoute("/api/agents")({
|
|
2189
2206
|
server: {
|
|
2190
2207
|
handlers: {
|
|
2191
2208
|
GET: async () => {
|
|
@@ -2605,7 +2622,7 @@ function validateFilename(filename) {
|
|
|
2605
2622
|
return true;
|
|
2606
2623
|
}
|
|
2607
2624
|
const MAX_FILE_SIZE = 100 * 1024 * 1024;
|
|
2608
|
-
const Route$
|
|
2625
|
+
const Route$b = createFileRoute("/api/files/upload")({
|
|
2609
2626
|
server: {
|
|
2610
2627
|
handlers: {
|
|
2611
2628
|
POST: async ({ request }) => {
|
|
@@ -2700,7 +2717,7 @@ const Route$8 = createFileRoute("/api/files/upload")({
|
|
|
2700
2717
|
}
|
|
2701
2718
|
});
|
|
2702
2719
|
const MAX_TEXT_SIZE$1 = 5 * 1024 * 1024;
|
|
2703
|
-
const Route$
|
|
2720
|
+
const Route$a = createFileRoute("/api/files/save")({
|
|
2704
2721
|
server: {
|
|
2705
2722
|
handlers: {
|
|
2706
2723
|
POST: async ({ request }) => {
|
|
@@ -2742,7 +2759,7 @@ const Route$7 = createFileRoute("/api/files/save")({
|
|
|
2742
2759
|
}
|
|
2743
2760
|
}
|
|
2744
2761
|
});
|
|
2745
|
-
const Route$
|
|
2762
|
+
const Route$9 = createFileRoute("/api/files/rename")({
|
|
2746
2763
|
server: {
|
|
2747
2764
|
handlers: {
|
|
2748
2765
|
POST: async ({ request }) => {
|
|
@@ -2885,7 +2902,7 @@ const TEXT_EXTENSIONS = /* @__PURE__ */ new Set([
|
|
|
2885
2902
|
"diff",
|
|
2886
2903
|
"patch"
|
|
2887
2904
|
]);
|
|
2888
|
-
const Route$
|
|
2905
|
+
const Route$8 = createFileRoute("/api/files/read")({
|
|
2889
2906
|
server: {
|
|
2890
2907
|
handlers: {
|
|
2891
2908
|
GET: async ({ request }) => {
|
|
@@ -2977,7 +2994,7 @@ function validateFolderName(path2) {
|
|
|
2977
2994
|
throw new Error("Invalid folder name");
|
|
2978
2995
|
}
|
|
2979
2996
|
}
|
|
2980
|
-
const Route$
|
|
2997
|
+
const Route$7 = createFileRoute("/api/files/mkdir")({
|
|
2981
2998
|
server: {
|
|
2982
2999
|
handlers: {
|
|
2983
3000
|
POST: async ({ request }) => {
|
|
@@ -3026,7 +3043,7 @@ const Route$4 = createFileRoute("/api/files/mkdir")({
|
|
|
3026
3043
|
}
|
|
3027
3044
|
}
|
|
3028
3045
|
});
|
|
3029
|
-
const Route$
|
|
3046
|
+
const Route$6 = createFileRoute("/api/files/list")({
|
|
3030
3047
|
server: {
|
|
3031
3048
|
handlers: {
|
|
3032
3049
|
GET: async ({ request }) => {
|
|
@@ -3061,7 +3078,7 @@ const Route$3 = createFileRoute("/api/files/list")({
|
|
|
3061
3078
|
}
|
|
3062
3079
|
}
|
|
3063
3080
|
});
|
|
3064
|
-
const Route$
|
|
3081
|
+
const Route$5 = createFileRoute("/api/files/info")({
|
|
3065
3082
|
server: {
|
|
3066
3083
|
handlers: {
|
|
3067
3084
|
GET: async ({ request }) => {
|
|
@@ -3182,7 +3199,7 @@ function isStaticAsset(filename) {
|
|
|
3182
3199
|
const staticExts = ["png", "jpg", "jpeg", "gif", "webp", "svg", "css", "js", "woff", "woff2", "ttf", "otf"];
|
|
3183
3200
|
return staticExts.includes(ext);
|
|
3184
3201
|
}
|
|
3185
|
-
const Route$
|
|
3202
|
+
const Route$4 = createFileRoute("/api/files/download")({
|
|
3186
3203
|
server: {
|
|
3187
3204
|
handlers: {
|
|
3188
3205
|
GET: async ({ request }) => {
|
|
@@ -3248,7 +3265,7 @@ const Route$1 = createFileRoute("/api/files/download")({
|
|
|
3248
3265
|
}
|
|
3249
3266
|
}
|
|
3250
3267
|
});
|
|
3251
|
-
const Route = createFileRoute("/api/files/delete")({
|
|
3268
|
+
const Route$3 = createFileRoute("/api/files/delete")({
|
|
3252
3269
|
server: {
|
|
3253
3270
|
handlers: {
|
|
3254
3271
|
DELETE: async ({ request }) => {
|
|
@@ -3306,176 +3323,452 @@ const Route = createFileRoute("/api/files/delete")({
|
|
|
3306
3323
|
}
|
|
3307
3324
|
}
|
|
3308
3325
|
});
|
|
3309
|
-
|
|
3326
|
+
function clampPercent(value) {
|
|
3327
|
+
if (!Number.isFinite(value)) return 0;
|
|
3328
|
+
return Math.max(0, Math.min(100, value));
|
|
3329
|
+
}
|
|
3330
|
+
function sampleCpuTimes() {
|
|
3331
|
+
const cpus = os.cpus();
|
|
3332
|
+
let idle = 0;
|
|
3333
|
+
let total = 0;
|
|
3334
|
+
for (const cpu of cpus) {
|
|
3335
|
+
idle += cpu.times.idle;
|
|
3336
|
+
total += cpu.times.user + cpu.times.nice + cpu.times.sys + cpu.times.idle + cpu.times.irq;
|
|
3337
|
+
}
|
|
3338
|
+
return { idle, total };
|
|
3339
|
+
}
|
|
3340
|
+
async function getCpuUsagePercent(sampleMs = 500) {
|
|
3341
|
+
const start = sampleCpuTimes();
|
|
3342
|
+
await new Promise((resolve2) => setTimeout(resolve2, sampleMs));
|
|
3343
|
+
const end = sampleCpuTimes();
|
|
3344
|
+
const idleDelta = end.idle - start.idle;
|
|
3345
|
+
const totalDelta = end.total - start.total;
|
|
3346
|
+
if (totalDelta <= 0) return 0;
|
|
3347
|
+
return clampPercent((totalDelta - idleDelta) / totalDelta * 100);
|
|
3348
|
+
}
|
|
3349
|
+
function getDiskStats() {
|
|
3350
|
+
try {
|
|
3351
|
+
const raw = execSync("df -k / | tail -1", {
|
|
3352
|
+
encoding: "utf8",
|
|
3353
|
+
stdio: ["ignore", "pipe", "ignore"]
|
|
3354
|
+
}).trim();
|
|
3355
|
+
const parts = raw.split(/\s+/);
|
|
3356
|
+
if (parts.length < 5) return { used: 0, total: 0 };
|
|
3357
|
+
const totalKb = Number(parts[1]);
|
|
3358
|
+
const usedKb = Number(parts[2]);
|
|
3359
|
+
if (!Number.isFinite(totalKb) || totalKb <= 0) return { used: 0, total: 0 };
|
|
3360
|
+
const total = totalKb * 1024;
|
|
3361
|
+
const used = usedKb * 1024;
|
|
3362
|
+
return { used, total };
|
|
3363
|
+
} catch {
|
|
3364
|
+
return { used: 0, total: 0 };
|
|
3365
|
+
}
|
|
3366
|
+
}
|
|
3367
|
+
function formatUptime(seconds) {
|
|
3368
|
+
const d = Math.floor(seconds / 86400);
|
|
3369
|
+
const h = Math.floor(seconds % 86400 / 3600);
|
|
3370
|
+
const m = Math.floor(seconds % 3600 / 60);
|
|
3371
|
+
const parts = [];
|
|
3372
|
+
if (d > 0) parts.push(`${d}d`);
|
|
3373
|
+
if (h > 0) parts.push(`${h}h`);
|
|
3374
|
+
parts.push(`${m}m`);
|
|
3375
|
+
return parts.join(" ");
|
|
3376
|
+
}
|
|
3377
|
+
function formatBytesCompact(bytes) {
|
|
3378
|
+
const units = ["B", "KB", "MB", "GB", "TB"];
|
|
3379
|
+
let value = Math.max(0, bytes);
|
|
3380
|
+
let unitIndex = 0;
|
|
3381
|
+
while (value >= 1024 && unitIndex < units.length - 1) {
|
|
3382
|
+
value /= 1024;
|
|
3383
|
+
unitIndex += 1;
|
|
3384
|
+
}
|
|
3385
|
+
const digits = value >= 100 ? 0 : value >= 10 ? 1 : 2;
|
|
3386
|
+
return `${value.toFixed(digits)} ${units[unitIndex]}`;
|
|
3387
|
+
}
|
|
3388
|
+
function getNetworkIo() {
|
|
3389
|
+
try {
|
|
3390
|
+
const netRaw = execSync("cat /proc/net/dev", {
|
|
3391
|
+
encoding: "utf8",
|
|
3392
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
3393
|
+
timeout: 3e3
|
|
3394
|
+
});
|
|
3395
|
+
const lines = netRaw.split("\n").map((line) => line.trim()).filter(Boolean);
|
|
3396
|
+
let selected = null;
|
|
3397
|
+
for (const line of lines.slice(2)) {
|
|
3398
|
+
const [ifaceRaw, dataRaw] = line.split(":");
|
|
3399
|
+
if (!ifaceRaw || !dataRaw) continue;
|
|
3400
|
+
const iface = ifaceRaw.trim();
|
|
3401
|
+
const fields = dataRaw.trim().split(/\s+/);
|
|
3402
|
+
if (fields.length < 16) continue;
|
|
3403
|
+
const rx = Number(fields[0]);
|
|
3404
|
+
const tx = Number(fields[8]);
|
|
3405
|
+
if (!Number.isFinite(rx) || !Number.isFinite(tx)) continue;
|
|
3406
|
+
const entry = { iface, rx, tx };
|
|
3407
|
+
if (iface !== "lo") {
|
|
3408
|
+
selected = entry;
|
|
3409
|
+
break;
|
|
3410
|
+
}
|
|
3411
|
+
if (!selected) selected = entry;
|
|
3412
|
+
}
|
|
3413
|
+
if (!selected) return { rx: "0 MB", tx: "0 MB" };
|
|
3414
|
+
return {
|
|
3415
|
+
rx: formatBytesCompact(selected.rx),
|
|
3416
|
+
tx: formatBytesCompact(selected.tx)
|
|
3417
|
+
};
|
|
3418
|
+
} catch {
|
|
3419
|
+
return { rx: "0 MB", tx: "0 MB" };
|
|
3420
|
+
}
|
|
3421
|
+
}
|
|
3422
|
+
function getTopProcesses() {
|
|
3423
|
+
try {
|
|
3424
|
+
const procs = execSync("ps aux --sort=-%cpu | head -6 | tail -5", {
|
|
3425
|
+
encoding: "utf8",
|
|
3426
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
3427
|
+
timeout: 3e3
|
|
3428
|
+
});
|
|
3429
|
+
return procs.split("\n").map((line) => line.trim()).filter(Boolean).map((line) => {
|
|
3430
|
+
const parts = line.split(/\s+/);
|
|
3431
|
+
if (parts.length < 11) return null;
|
|
3432
|
+
const cpu = Number(parts[2]);
|
|
3433
|
+
const mem = Number(parts[3]);
|
|
3434
|
+
const command = parts.slice(10).join(" ");
|
|
3435
|
+
const name = command.split("/").pop()?.split(" ")[0] || command;
|
|
3436
|
+
if (!Number.isFinite(cpu) || !Number.isFinite(mem)) return null;
|
|
3437
|
+
return {
|
|
3438
|
+
name: name.slice(0, 30),
|
|
3439
|
+
cpu,
|
|
3440
|
+
mem
|
|
3441
|
+
};
|
|
3442
|
+
}).filter(
|
|
3443
|
+
(p) => p !== null
|
|
3444
|
+
);
|
|
3445
|
+
} catch {
|
|
3446
|
+
return [];
|
|
3447
|
+
}
|
|
3448
|
+
}
|
|
3449
|
+
async function getSystemStats() {
|
|
3450
|
+
const totalRam = os.totalmem();
|
|
3451
|
+
const freeRam = os.freemem();
|
|
3452
|
+
const usedRam = Math.max(0, totalRam - freeRam);
|
|
3453
|
+
const [cpuUsage, disk] = await Promise.all([
|
|
3454
|
+
getCpuUsagePercent(500),
|
|
3455
|
+
Promise.resolve(getDiskStats())
|
|
3456
|
+
]);
|
|
3457
|
+
const cpus = os.cpus();
|
|
3458
|
+
const cpuModel = cpus[0]?.model ?? "Unknown CPU";
|
|
3459
|
+
const cores = cpus.length;
|
|
3460
|
+
return {
|
|
3461
|
+
cpu: cpuUsage,
|
|
3462
|
+
ram: { used: usedRam, total: totalRam },
|
|
3463
|
+
disk,
|
|
3464
|
+
load: os.loadavg().map((v) => Number(v.toFixed(2))),
|
|
3465
|
+
uptime: formatUptime(os.uptime()),
|
|
3466
|
+
network: getNetworkIo(),
|
|
3467
|
+
topProcesses: getTopProcesses(),
|
|
3468
|
+
cpuModel,
|
|
3469
|
+
cores
|
|
3470
|
+
};
|
|
3471
|
+
}
|
|
3472
|
+
async function getGatewayStats() {
|
|
3473
|
+
try {
|
|
3474
|
+
const sessionsJson = execSync("openclaw sessions list --json 2>/dev/null", {
|
|
3475
|
+
encoding: "utf8",
|
|
3476
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
3477
|
+
timeout: 5e3
|
|
3478
|
+
});
|
|
3479
|
+
const sessionsData = JSON.parse(sessionsJson);
|
|
3480
|
+
const activeSessions = sessionsData.count ?? sessionsData.sessions?.length ?? 0;
|
|
3481
|
+
return { activeSessions, tokensToday: 0, costToday: 0 };
|
|
3482
|
+
} catch {
|
|
3483
|
+
return { activeSessions: 0, tokensToday: 0, costToday: 0 };
|
|
3484
|
+
}
|
|
3485
|
+
}
|
|
3486
|
+
async function getCronOverview() {
|
|
3487
|
+
try {
|
|
3488
|
+
const cronJson = execSync("openclaw cron list --json 2>/dev/null", {
|
|
3489
|
+
encoding: "utf8",
|
|
3490
|
+
stdio: ["ignore", "pipe", "ignore"],
|
|
3491
|
+
timeout: 5e3
|
|
3492
|
+
});
|
|
3493
|
+
const data = JSON.parse(cronJson);
|
|
3494
|
+
const jobs = data.jobs ?? [];
|
|
3495
|
+
return jobs.map((job) => {
|
|
3496
|
+
const schedule = job.schedule;
|
|
3497
|
+
const state = job.state;
|
|
3498
|
+
let scheduleStr = "—";
|
|
3499
|
+
if (schedule) {
|
|
3500
|
+
if (schedule.expr) scheduleStr = String(schedule.expr);
|
|
3501
|
+
else if (schedule.kind === "every" && schedule.everyMs)
|
|
3502
|
+
scheduleStr = `every ${Number(schedule.everyMs) / 1e3 / 60}m`;
|
|
3503
|
+
else if (schedule.kind === "at") scheduleStr = `at ${schedule.at}`;
|
|
3504
|
+
else if (schedule.kind) scheduleStr = String(schedule.kind);
|
|
3505
|
+
}
|
|
3506
|
+
let nextRun = null;
|
|
3507
|
+
if (state?.nextRunAtMs && Number(state.nextRunAtMs) > 0) {
|
|
3508
|
+
nextRun = new Date(Number(state.nextRunAtMs)).toISOString();
|
|
3509
|
+
}
|
|
3510
|
+
let lastRun = null;
|
|
3511
|
+
if (state?.lastRunAtMs && Number(state.lastRunAtMs) > 0) {
|
|
3512
|
+
lastRun = new Date(Number(state.lastRunAtMs)).toISOString();
|
|
3513
|
+
}
|
|
3514
|
+
const rawStatus = state?.lastStatus;
|
|
3515
|
+
const lastStatus = rawStatus === "ok" ? "ok" : rawStatus === "error" ? "error" : rawStatus === "idle" ? "idle" : "unknown";
|
|
3516
|
+
return {
|
|
3517
|
+
id: String(job.id ?? ""),
|
|
3518
|
+
name: String(job.name ?? job.id ?? "Unnamed"),
|
|
3519
|
+
schedule: scheduleStr,
|
|
3520
|
+
enabled: Boolean(job.enabled ?? true),
|
|
3521
|
+
nextRun,
|
|
3522
|
+
lastRun,
|
|
3523
|
+
lastStatus
|
|
3524
|
+
};
|
|
3525
|
+
});
|
|
3526
|
+
} catch {
|
|
3527
|
+
return [];
|
|
3528
|
+
}
|
|
3529
|
+
}
|
|
3530
|
+
const Route$2 = createFileRoute("/api/dashboard/system")({
|
|
3531
|
+
server: {
|
|
3532
|
+
handlers: {
|
|
3533
|
+
GET: async () => {
|
|
3534
|
+
try {
|
|
3535
|
+
const data = await getSystemStats();
|
|
3536
|
+
return json(data);
|
|
3537
|
+
} catch (err) {
|
|
3538
|
+
return json(
|
|
3539
|
+
{ error: err instanceof Error ? err.message : String(err) },
|
|
3540
|
+
{ status: 500 }
|
|
3541
|
+
);
|
|
3542
|
+
}
|
|
3543
|
+
}
|
|
3544
|
+
}
|
|
3545
|
+
}
|
|
3546
|
+
});
|
|
3547
|
+
const Route$1 = createFileRoute("/api/dashboard/gateway")({
|
|
3548
|
+
server: {
|
|
3549
|
+
handlers: {
|
|
3550
|
+
GET: async () => {
|
|
3551
|
+
try {
|
|
3552
|
+
const data = await getGatewayStats();
|
|
3553
|
+
return json(data);
|
|
3554
|
+
} catch (err) {
|
|
3555
|
+
return json(
|
|
3556
|
+
{ error: err instanceof Error ? err.message : String(err) },
|
|
3557
|
+
{ status: 500 }
|
|
3558
|
+
);
|
|
3559
|
+
}
|
|
3560
|
+
}
|
|
3561
|
+
}
|
|
3562
|
+
}
|
|
3563
|
+
});
|
|
3564
|
+
const Route = createFileRoute("/api/dashboard/crons")({
|
|
3565
|
+
server: {
|
|
3566
|
+
handlers: {
|
|
3567
|
+
GET: async () => {
|
|
3568
|
+
try {
|
|
3569
|
+
const data = await getCronOverview();
|
|
3570
|
+
return json({ jobs: data });
|
|
3571
|
+
} catch (err) {
|
|
3572
|
+
return json(
|
|
3573
|
+
{ error: err instanceof Error ? err.message : String(err) },
|
|
3574
|
+
{ status: 500 }
|
|
3575
|
+
);
|
|
3576
|
+
}
|
|
3577
|
+
}
|
|
3578
|
+
}
|
|
3579
|
+
}
|
|
3580
|
+
});
|
|
3581
|
+
const SkillsRoute = Route$A.update({
|
|
3310
3582
|
id: "/skills",
|
|
3311
3583
|
path: "/skills",
|
|
3312
|
-
getParentRoute: () => Route$
|
|
3584
|
+
getParentRoute: () => Route$B
|
|
3313
3585
|
});
|
|
3314
|
-
const NewRoute = Route$
|
|
3586
|
+
const NewRoute = Route$z.update({
|
|
3315
3587
|
id: "/new",
|
|
3316
3588
|
path: "/new",
|
|
3317
|
-
getParentRoute: () => Route$
|
|
3589
|
+
getParentRoute: () => Route$B
|
|
3318
3590
|
});
|
|
3319
|
-
const MemoryRoute = Route$
|
|
3591
|
+
const MemoryRoute = Route$y.update({
|
|
3320
3592
|
id: "/memory",
|
|
3321
3593
|
path: "/memory",
|
|
3322
|
-
getParentRoute: () => Route$
|
|
3594
|
+
getParentRoute: () => Route$B
|
|
3323
3595
|
});
|
|
3324
|
-
const FilesRoute = Route$
|
|
3596
|
+
const FilesRoute = Route$x.update({
|
|
3325
3597
|
id: "/files",
|
|
3326
3598
|
path: "/files",
|
|
3327
|
-
getParentRoute: () => Route$
|
|
3599
|
+
getParentRoute: () => Route$B
|
|
3600
|
+
});
|
|
3601
|
+
const DashboardRoute = Route$w.update({
|
|
3602
|
+
id: "/dashboard",
|
|
3603
|
+
path: "/dashboard",
|
|
3604
|
+
getParentRoute: () => Route$B
|
|
3328
3605
|
});
|
|
3329
|
-
const ConnectRoute = Route$
|
|
3606
|
+
const ConnectRoute = Route$v.update({
|
|
3330
3607
|
id: "/connect",
|
|
3331
3608
|
path: "/connect",
|
|
3332
|
-
getParentRoute: () => Route$
|
|
3609
|
+
getParentRoute: () => Route$B
|
|
3333
3610
|
});
|
|
3334
|
-
const BotsRoute = Route$
|
|
3611
|
+
const BotsRoute = Route$u.update({
|
|
3335
3612
|
id: "/bots",
|
|
3336
3613
|
path: "/bots",
|
|
3337
|
-
getParentRoute: () => Route$
|
|
3614
|
+
getParentRoute: () => Route$B
|
|
3338
3615
|
});
|
|
3339
|
-
const AgentsRoute = Route$
|
|
3616
|
+
const AgentsRoute = Route$t.update({
|
|
3340
3617
|
id: "/agents",
|
|
3341
3618
|
path: "/agents",
|
|
3342
|
-
getParentRoute: () => Route$
|
|
3619
|
+
getParentRoute: () => Route$B
|
|
3343
3620
|
});
|
|
3344
|
-
const IndexRoute = Route$
|
|
3621
|
+
const IndexRoute = Route$s.update({
|
|
3345
3622
|
id: "/",
|
|
3346
3623
|
path: "/",
|
|
3347
|
-
getParentRoute: () => Route$
|
|
3624
|
+
getParentRoute: () => Route$B
|
|
3348
3625
|
});
|
|
3349
|
-
const ChatSessionKeyRoute = Route$
|
|
3626
|
+
const ChatSessionKeyRoute = Route$r.update({
|
|
3350
3627
|
id: "/chat/$sessionKey",
|
|
3351
3628
|
path: "/chat/$sessionKey",
|
|
3352
|
-
getParentRoute: () => Route$
|
|
3629
|
+
getParentRoute: () => Route$B
|
|
3353
3630
|
});
|
|
3354
|
-
const ApiTtsRoute = Route$
|
|
3631
|
+
const ApiTtsRoute = Route$q.update({
|
|
3355
3632
|
id: "/api/tts",
|
|
3356
3633
|
path: "/api/tts",
|
|
3357
|
-
getParentRoute: () => Route$
|
|
3634
|
+
getParentRoute: () => Route$B
|
|
3358
3635
|
});
|
|
3359
|
-
const ApiSttRoute = Route$
|
|
3636
|
+
const ApiSttRoute = Route$p.update({
|
|
3360
3637
|
id: "/api/stt",
|
|
3361
3638
|
path: "/api/stt",
|
|
3362
|
-
getParentRoute: () => Route$
|
|
3639
|
+
getParentRoute: () => Route$B
|
|
3363
3640
|
});
|
|
3364
|
-
const ApiStreamRoute = Route$
|
|
3641
|
+
const ApiStreamRoute = Route$o.update({
|
|
3365
3642
|
id: "/api/stream",
|
|
3366
3643
|
path: "/api/stream",
|
|
3367
|
-
getParentRoute: () => Route$
|
|
3644
|
+
getParentRoute: () => Route$B
|
|
3368
3645
|
});
|
|
3369
|
-
const ApiSkillsRoute = Route$
|
|
3646
|
+
const ApiSkillsRoute = Route$n.update({
|
|
3370
3647
|
id: "/api/skills",
|
|
3371
3648
|
path: "/api/skills",
|
|
3372
|
-
getParentRoute: () => Route$
|
|
3649
|
+
getParentRoute: () => Route$B
|
|
3373
3650
|
});
|
|
3374
|
-
const ApiSessionsRoute = Route$
|
|
3651
|
+
const ApiSessionsRoute = Route$m.update({
|
|
3375
3652
|
id: "/api/sessions",
|
|
3376
3653
|
path: "/api/sessions",
|
|
3377
|
-
getParentRoute: () => Route$
|
|
3654
|
+
getParentRoute: () => Route$B
|
|
3378
3655
|
});
|
|
3379
|
-
const ApiSendRoute = Route$
|
|
3656
|
+
const ApiSendRoute = Route$l.update({
|
|
3380
3657
|
id: "/api/send",
|
|
3381
3658
|
path: "/api/send",
|
|
3382
|
-
getParentRoute: () => Route$
|
|
3659
|
+
getParentRoute: () => Route$B
|
|
3383
3660
|
});
|
|
3384
|
-
const ApiPingRoute = Route$
|
|
3661
|
+
const ApiPingRoute = Route$k.update({
|
|
3385
3662
|
id: "/api/ping",
|
|
3386
3663
|
path: "/api/ping",
|
|
3387
|
-
getParentRoute: () => Route$
|
|
3664
|
+
getParentRoute: () => Route$B
|
|
3388
3665
|
});
|
|
3389
|
-
const ApiPersonasRoute = Route$
|
|
3666
|
+
const ApiPersonasRoute = Route$j.update({
|
|
3390
3667
|
id: "/api/personas",
|
|
3391
3668
|
path: "/api/personas",
|
|
3392
|
-
getParentRoute: () => Route$
|
|
3669
|
+
getParentRoute: () => Route$B
|
|
3393
3670
|
});
|
|
3394
|
-
const ApiPathsRoute = Route$
|
|
3671
|
+
const ApiPathsRoute = Route$i.update({
|
|
3395
3672
|
id: "/api/paths",
|
|
3396
3673
|
path: "/api/paths",
|
|
3397
|
-
getParentRoute: () => Route$
|
|
3674
|
+
getParentRoute: () => Route$B
|
|
3398
3675
|
});
|
|
3399
|
-
const ApiModelsRoute = Route$
|
|
3676
|
+
const ApiModelsRoute = Route$h.update({
|
|
3400
3677
|
id: "/api/models",
|
|
3401
3678
|
path: "/api/models",
|
|
3402
|
-
getParentRoute: () => Route$
|
|
3679
|
+
getParentRoute: () => Route$B
|
|
3403
3680
|
});
|
|
3404
|
-
const ApiLlmFeaturesRoute = Route$
|
|
3681
|
+
const ApiLlmFeaturesRoute = Route$g.update({
|
|
3405
3682
|
id: "/api/llm-features",
|
|
3406
3683
|
path: "/api/llm-features",
|
|
3407
|
-
getParentRoute: () => Route$
|
|
3684
|
+
getParentRoute: () => Route$B
|
|
3408
3685
|
});
|
|
3409
|
-
const ApiHistoryRoute = Route$
|
|
3686
|
+
const ApiHistoryRoute = Route$f.update({
|
|
3410
3687
|
id: "/api/history",
|
|
3411
3688
|
path: "/api/history",
|
|
3412
|
-
getParentRoute: () => Route$
|
|
3689
|
+
getParentRoute: () => Route$B
|
|
3413
3690
|
});
|
|
3414
|
-
const ApiFollowUpsRoute = Route$
|
|
3691
|
+
const ApiFollowUpsRoute = Route$e.update({
|
|
3415
3692
|
id: "/api/follow-ups",
|
|
3416
3693
|
path: "/api/follow-ups",
|
|
3417
|
-
getParentRoute: () => Route$
|
|
3694
|
+
getParentRoute: () => Route$B
|
|
3418
3695
|
});
|
|
3419
|
-
const ApiCronRoute = Route$
|
|
3696
|
+
const ApiCronRoute = Route$d.update({
|
|
3420
3697
|
id: "/api/cron",
|
|
3421
3698
|
path: "/api/cron",
|
|
3422
|
-
getParentRoute: () => Route$
|
|
3699
|
+
getParentRoute: () => Route$B
|
|
3423
3700
|
});
|
|
3424
|
-
const ApiAgentsRoute = Route$
|
|
3701
|
+
const ApiAgentsRoute = Route$c.update({
|
|
3425
3702
|
id: "/api/agents",
|
|
3426
3703
|
path: "/api/agents",
|
|
3427
|
-
getParentRoute: () => Route$
|
|
3704
|
+
getParentRoute: () => Route$B
|
|
3428
3705
|
});
|
|
3429
|
-
const ApiFilesUploadRoute = Route$
|
|
3706
|
+
const ApiFilesUploadRoute = Route$b.update({
|
|
3430
3707
|
id: "/api/files/upload",
|
|
3431
3708
|
path: "/api/files/upload",
|
|
3432
|
-
getParentRoute: () => Route$
|
|
3709
|
+
getParentRoute: () => Route$B
|
|
3433
3710
|
});
|
|
3434
|
-
const ApiFilesSaveRoute = Route$
|
|
3711
|
+
const ApiFilesSaveRoute = Route$a.update({
|
|
3435
3712
|
id: "/api/files/save",
|
|
3436
3713
|
path: "/api/files/save",
|
|
3437
|
-
getParentRoute: () => Route$
|
|
3714
|
+
getParentRoute: () => Route$B
|
|
3438
3715
|
});
|
|
3439
|
-
const ApiFilesRenameRoute = Route$
|
|
3716
|
+
const ApiFilesRenameRoute = Route$9.update({
|
|
3440
3717
|
id: "/api/files/rename",
|
|
3441
3718
|
path: "/api/files/rename",
|
|
3442
|
-
getParentRoute: () => Route$
|
|
3719
|
+
getParentRoute: () => Route$B
|
|
3443
3720
|
});
|
|
3444
|
-
const ApiFilesReadRoute = Route$
|
|
3721
|
+
const ApiFilesReadRoute = Route$8.update({
|
|
3445
3722
|
id: "/api/files/read",
|
|
3446
3723
|
path: "/api/files/read",
|
|
3447
|
-
getParentRoute: () => Route$
|
|
3724
|
+
getParentRoute: () => Route$B
|
|
3448
3725
|
});
|
|
3449
|
-
const ApiFilesMkdirRoute = Route$
|
|
3726
|
+
const ApiFilesMkdirRoute = Route$7.update({
|
|
3450
3727
|
id: "/api/files/mkdir",
|
|
3451
3728
|
path: "/api/files/mkdir",
|
|
3452
|
-
getParentRoute: () => Route$
|
|
3729
|
+
getParentRoute: () => Route$B
|
|
3453
3730
|
});
|
|
3454
|
-
const ApiFilesListRoute = Route$
|
|
3731
|
+
const ApiFilesListRoute = Route$6.update({
|
|
3455
3732
|
id: "/api/files/list",
|
|
3456
3733
|
path: "/api/files/list",
|
|
3457
|
-
getParentRoute: () => Route$
|
|
3734
|
+
getParentRoute: () => Route$B
|
|
3458
3735
|
});
|
|
3459
|
-
const ApiFilesInfoRoute = Route$
|
|
3736
|
+
const ApiFilesInfoRoute = Route$5.update({
|
|
3460
3737
|
id: "/api/files/info",
|
|
3461
3738
|
path: "/api/files/info",
|
|
3462
|
-
getParentRoute: () => Route$
|
|
3739
|
+
getParentRoute: () => Route$B
|
|
3463
3740
|
});
|
|
3464
|
-
const ApiFilesDownloadRoute = Route$
|
|
3741
|
+
const ApiFilesDownloadRoute = Route$4.update({
|
|
3465
3742
|
id: "/api/files/download",
|
|
3466
3743
|
path: "/api/files/download",
|
|
3467
|
-
getParentRoute: () => Route$
|
|
3744
|
+
getParentRoute: () => Route$B
|
|
3468
3745
|
});
|
|
3469
|
-
const ApiFilesDeleteRoute = Route.update({
|
|
3746
|
+
const ApiFilesDeleteRoute = Route$3.update({
|
|
3470
3747
|
id: "/api/files/delete",
|
|
3471
3748
|
path: "/api/files/delete",
|
|
3472
|
-
getParentRoute: () => Route$
|
|
3749
|
+
getParentRoute: () => Route$B
|
|
3750
|
+
});
|
|
3751
|
+
const ApiDashboardSystemRoute = Route$2.update({
|
|
3752
|
+
id: "/api/dashboard/system",
|
|
3753
|
+
path: "/api/dashboard/system",
|
|
3754
|
+
getParentRoute: () => Route$B
|
|
3755
|
+
});
|
|
3756
|
+
const ApiDashboardGatewayRoute = Route$1.update({
|
|
3757
|
+
id: "/api/dashboard/gateway",
|
|
3758
|
+
path: "/api/dashboard/gateway",
|
|
3759
|
+
getParentRoute: () => Route$B
|
|
3760
|
+
});
|
|
3761
|
+
const ApiDashboardCronsRoute = Route.update({
|
|
3762
|
+
id: "/api/dashboard/crons",
|
|
3763
|
+
path: "/api/dashboard/crons",
|
|
3764
|
+
getParentRoute: () => Route$B
|
|
3473
3765
|
});
|
|
3474
3766
|
const rootRouteChildren = {
|
|
3475
3767
|
IndexRoute,
|
|
3476
3768
|
AgentsRoute,
|
|
3477
3769
|
BotsRoute,
|
|
3478
3770
|
ConnectRoute,
|
|
3771
|
+
DashboardRoute,
|
|
3479
3772
|
FilesRoute,
|
|
3480
3773
|
MemoryRoute,
|
|
3481
3774
|
NewRoute,
|
|
@@ -3496,6 +3789,9 @@ const rootRouteChildren = {
|
|
|
3496
3789
|
ApiSttRoute,
|
|
3497
3790
|
ApiTtsRoute,
|
|
3498
3791
|
ChatSessionKeyRoute,
|
|
3792
|
+
ApiDashboardCronsRoute,
|
|
3793
|
+
ApiDashboardGatewayRoute,
|
|
3794
|
+
ApiDashboardSystemRoute,
|
|
3499
3795
|
ApiFilesDeleteRoute,
|
|
3500
3796
|
ApiFilesDownloadRoute,
|
|
3501
3797
|
ApiFilesInfoRoute,
|
|
@@ -3506,7 +3802,7 @@ const rootRouteChildren = {
|
|
|
3506
3802
|
ApiFilesSaveRoute,
|
|
3507
3803
|
ApiFilesUploadRoute
|
|
3508
3804
|
};
|
|
3509
|
-
const routeTree = Route$
|
|
3805
|
+
const routeTree = Route$B._addFileChildren(rootRouteChildren)._addFileTypes();
|
|
3510
3806
|
const getRouter = () => {
|
|
3511
3807
|
const router2 = createRouter({
|
|
3512
3808
|
routeTree,
|
|
@@ -3521,7 +3817,7 @@ const router = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProper
|
|
|
3521
3817
|
getRouter
|
|
3522
3818
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
3523
3819
|
export {
|
|
3524
|
-
Route$
|
|
3525
|
-
Route$
|
|
3820
|
+
Route$s as R,
|
|
3821
|
+
Route$r as a,
|
|
3526
3822
|
router as r
|
|
3527
3823
|
};
|