@burdenoff/microfe-vibecontrols 2026.529.11 → 2026.529.13
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/components/agents/ConnectionLogPanel.js +206 -0
- package/dist/components/agents/ConnectionLogPanel.js.map +1 -0
- package/dist/components/logs/LogViewer.js +121 -122
- package/dist/components/logs/LogViewer.js.map +1 -1
- package/dist/generated/wspace-operations.js +804 -766
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.js.map +1 -1
- package/dist/index.js +10 -10
- package/dist/pages/AgentDetailsPage.js +813 -784
- package/dist/pages/AgentDetailsPage.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { useGetAgentConnectionEventsQuery as e } from "../../generated/wspace-operations.js";
|
|
2
|
+
import { useCallback as t, useMemo as n, useState as r } from "react";
|
|
3
|
+
import { jsx as i, jsxs as a } from "react/jsx-runtime";
|
|
4
|
+
//#region src/components/agents/ConnectionLogPanel.tsx
|
|
5
|
+
var o = {
|
|
6
|
+
info: "text-status-info-text",
|
|
7
|
+
warn: "text-status-warning-text",
|
|
8
|
+
error: "text-status-danger-text",
|
|
9
|
+
debug: "text-fg-muted"
|
|
10
|
+
}, s = {
|
|
11
|
+
info: "bg-status-info-bg",
|
|
12
|
+
warn: "bg-status-warning-bg",
|
|
13
|
+
error: "bg-status-danger-bg",
|
|
14
|
+
debug: "bg-bg-muted"
|
|
15
|
+
};
|
|
16
|
+
function c(e) {
|
|
17
|
+
try {
|
|
18
|
+
return new Date(e).toISOString().replace("T", " ").replace("Z", "");
|
|
19
|
+
} catch {
|
|
20
|
+
return e;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
function l(e) {
|
|
24
|
+
return e.map((e) => {
|
|
25
|
+
let t = e.detailsJson ? `\n details: ${e.detailsJson}` : "";
|
|
26
|
+
return `[${e.timestamp}] #${e.sequence} ${e.level.toUpperCase().padEnd(5)} ${e.step.padEnd(28)} ${e.message}${t}`;
|
|
27
|
+
}).join("\n");
|
|
28
|
+
}
|
|
29
|
+
function u(e, t, n) {
|
|
30
|
+
return JSON.stringify({
|
|
31
|
+
exportedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
32
|
+
agentId: t,
|
|
33
|
+
agentName: n,
|
|
34
|
+
count: e.length,
|
|
35
|
+
events: e.map((e) => ({
|
|
36
|
+
id: e.id,
|
|
37
|
+
timestamp: e.timestamp,
|
|
38
|
+
sequence: e.sequence,
|
|
39
|
+
step: e.step,
|
|
40
|
+
level: e.level,
|
|
41
|
+
message: e.message,
|
|
42
|
+
details: e.detailsJson ? JSON.parse(e.detailsJson) : null
|
|
43
|
+
}))
|
|
44
|
+
}, null, 2);
|
|
45
|
+
}
|
|
46
|
+
function d(e, t, n) {
|
|
47
|
+
let r = new Blob([n], { type: t }), i = URL.createObjectURL(r), a = document.createElement("a");
|
|
48
|
+
a.href = i, a.download = e, document.body.appendChild(a), a.click(), document.body.removeChild(a), URL.revokeObjectURL(i);
|
|
49
|
+
}
|
|
50
|
+
function f({ agentId: f, agentName: p }) {
|
|
51
|
+
let { data: m, loading: h, error: g, refetch: _ } = e({
|
|
52
|
+
variables: {
|
|
53
|
+
agentId: f,
|
|
54
|
+
limit: 200
|
|
55
|
+
},
|
|
56
|
+
pollInterval: 3e3,
|
|
57
|
+
fetchPolicy: "cache-and-network"
|
|
58
|
+
}), [v, y] = r("none"), b = n(() => (m?.vibecontrolsAgentConnectionEvents ?? []).map((e) => ({
|
|
59
|
+
id: e.id,
|
|
60
|
+
timestamp: e.timestamp,
|
|
61
|
+
sequence: e.sequence,
|
|
62
|
+
step: e.step,
|
|
63
|
+
level: e.level,
|
|
64
|
+
message: e.message,
|
|
65
|
+
detailsJson: e.detailsJson ?? null
|
|
66
|
+
})), [m]), x = t(async (e) => {
|
|
67
|
+
let t = e === "text" ? l(b) : u(b, f, p);
|
|
68
|
+
try {
|
|
69
|
+
await navigator.clipboard.writeText(t), y(e), setTimeout(() => y("none"), 1500);
|
|
70
|
+
} catch {
|
|
71
|
+
d(`agent-${f}-connection-log.${e === "text" ? "txt" : "json"}`, e === "text" ? "text/plain" : "application/json", t);
|
|
72
|
+
}
|
|
73
|
+
}, [
|
|
74
|
+
b,
|
|
75
|
+
f,
|
|
76
|
+
p
|
|
77
|
+
]), S = t((e) => {
|
|
78
|
+
let t = e === "text" ? l(b) : u(b, f, p), n = (/* @__PURE__ */ new Date()).toISOString().replace(/[:.]/g, "-");
|
|
79
|
+
d(`agent-${p ?? f}-connection-log-${n}.${e === "text" ? "txt" : "json"}`, e === "text" ? "text/plain" : "application/json", t);
|
|
80
|
+
}, [
|
|
81
|
+
b,
|
|
82
|
+
f,
|
|
83
|
+
p
|
|
84
|
+
]);
|
|
85
|
+
return /* @__PURE__ */ a("div", {
|
|
86
|
+
className: "flex flex-col h-full",
|
|
87
|
+
children: [
|
|
88
|
+
/* @__PURE__ */ a("div", {
|
|
89
|
+
className: "flex items-center justify-between p-4 border-b border-border-default",
|
|
90
|
+
children: [/* @__PURE__ */ a("div", { children: [/* @__PURE__ */ i("h3", {
|
|
91
|
+
className: "text-fg-default font-semibold text-base",
|
|
92
|
+
children: "Connection Log"
|
|
93
|
+
}), /* @__PURE__ */ i("p", {
|
|
94
|
+
className: "text-fg-muted text-xs mt-0.5",
|
|
95
|
+
children: h && b.length === 0 ? "Loading…" : `${b.length} event${b.length === 1 ? "" : "s"} · auto-refresh every 3s`
|
|
96
|
+
})] }), /* @__PURE__ */ a("div", {
|
|
97
|
+
className: "flex gap-2",
|
|
98
|
+
children: [
|
|
99
|
+
/* @__PURE__ */ i("button", {
|
|
100
|
+
type: "button",
|
|
101
|
+
onClick: () => _(),
|
|
102
|
+
className: "px-3 py-1.5 text-xs rounded bg-bg-subtle hover:bg-bg-muted text-fg-default border border-border-default",
|
|
103
|
+
children: "Refresh"
|
|
104
|
+
}),
|
|
105
|
+
/* @__PURE__ */ i("button", {
|
|
106
|
+
type: "button",
|
|
107
|
+
onClick: () => x("text"),
|
|
108
|
+
className: "px-3 py-1.5 text-xs rounded bg-bg-subtle hover:bg-bg-muted text-fg-default border border-border-default",
|
|
109
|
+
children: v === "text" ? "Copied!" : "Copy text"
|
|
110
|
+
}),
|
|
111
|
+
/* @__PURE__ */ i("button", {
|
|
112
|
+
type: "button",
|
|
113
|
+
onClick: () => x("json"),
|
|
114
|
+
className: "px-3 py-1.5 text-xs rounded bg-bg-subtle hover:bg-bg-muted text-fg-default border border-border-default",
|
|
115
|
+
children: v === "json" ? "Copied!" : "Copy JSON"
|
|
116
|
+
}),
|
|
117
|
+
/* @__PURE__ */ i("button", {
|
|
118
|
+
type: "button",
|
|
119
|
+
onClick: () => S("text"),
|
|
120
|
+
className: "px-3 py-1.5 text-xs rounded bg-action-primary hover:bg-action-primary-hover text-action-primary-text border border-action-primary",
|
|
121
|
+
children: "Export .txt"
|
|
122
|
+
}),
|
|
123
|
+
/* @__PURE__ */ i("button", {
|
|
124
|
+
type: "button",
|
|
125
|
+
onClick: () => S("json"),
|
|
126
|
+
className: "px-3 py-1.5 text-xs rounded bg-action-primary hover:bg-action-primary-hover text-action-primary-text border border-action-primary",
|
|
127
|
+
children: "Export .json"
|
|
128
|
+
})
|
|
129
|
+
]
|
|
130
|
+
})]
|
|
131
|
+
}),
|
|
132
|
+
g && /* @__PURE__ */ a("div", {
|
|
133
|
+
className: "m-4 p-3 rounded bg-status-danger-bg text-status-danger-text text-sm",
|
|
134
|
+
children: ["Failed to load events: ", g.message]
|
|
135
|
+
}),
|
|
136
|
+
/* @__PURE__ */ a("div", {
|
|
137
|
+
className: "flex-1 overflow-auto p-4",
|
|
138
|
+
children: [b.length === 0 && !h && /* @__PURE__ */ a("div", {
|
|
139
|
+
className: "text-fg-muted text-sm text-center py-12",
|
|
140
|
+
children: [
|
|
141
|
+
"No connection events recorded for this agent yet.",
|
|
142
|
+
/* @__PURE__ */ i("br", {}),
|
|
143
|
+
"Events appear here every time the platform probes, registers, or syncs the agent."
|
|
144
|
+
]
|
|
145
|
+
}), /* @__PURE__ */ i("ol", {
|
|
146
|
+
className: "space-y-2",
|
|
147
|
+
children: b.map((e) => {
|
|
148
|
+
let t = o[e.level] ?? o.info, n = s[e.level] ?? s.info, r = (() => {
|
|
149
|
+
if (!e.detailsJson) return null;
|
|
150
|
+
try {
|
|
151
|
+
return JSON.stringify(JSON.parse(e.detailsJson), null, 2);
|
|
152
|
+
} catch {
|
|
153
|
+
return e.detailsJson;
|
|
154
|
+
}
|
|
155
|
+
})();
|
|
156
|
+
return /* @__PURE__ */ i("li", {
|
|
157
|
+
className: "rounded border border-border-default bg-bg-subtle",
|
|
158
|
+
children: /* @__PURE__ */ a("div", {
|
|
159
|
+
className: "flex items-start gap-3 p-3",
|
|
160
|
+
children: [/* @__PURE__ */ i("div", {
|
|
161
|
+
className: `px-2 py-0.5 rounded text-[10px] uppercase font-mono ${n} ${t} shrink-0`,
|
|
162
|
+
children: e.level
|
|
163
|
+
}), /* @__PURE__ */ a("div", {
|
|
164
|
+
className: "flex-1 min-w-0",
|
|
165
|
+
children: [
|
|
166
|
+
/* @__PURE__ */ a("div", {
|
|
167
|
+
className: "flex items-center gap-2 text-xs text-fg-muted font-mono",
|
|
168
|
+
children: [
|
|
169
|
+
/* @__PURE__ */ a("span", { children: ["#", e.sequence] }),
|
|
170
|
+
/* @__PURE__ */ i("span", { children: "·" }),
|
|
171
|
+
/* @__PURE__ */ i("span", { children: c(e.timestamp) }),
|
|
172
|
+
/* @__PURE__ */ i("span", { children: "·" }),
|
|
173
|
+
/* @__PURE__ */ i("span", {
|
|
174
|
+
className: "text-fg-default font-medium",
|
|
175
|
+
children: e.step
|
|
176
|
+
})
|
|
177
|
+
]
|
|
178
|
+
}),
|
|
179
|
+
/* @__PURE__ */ i("div", {
|
|
180
|
+
className: "text-sm text-fg-default mt-1 break-words",
|
|
181
|
+
children: e.message
|
|
182
|
+
}),
|
|
183
|
+
r && /* @__PURE__ */ a("details", {
|
|
184
|
+
className: "mt-2",
|
|
185
|
+
children: [/* @__PURE__ */ i("summary", {
|
|
186
|
+
className: "text-xs text-fg-muted cursor-pointer hover:text-fg-default",
|
|
187
|
+
children: "Details"
|
|
188
|
+
}), /* @__PURE__ */ i("pre", {
|
|
189
|
+
className: "mt-2 p-2 rounded bg-bg-default text-xs text-fg-default overflow-x-auto whitespace-pre-wrap break-words",
|
|
190
|
+
children: r
|
|
191
|
+
})]
|
|
192
|
+
})
|
|
193
|
+
]
|
|
194
|
+
})]
|
|
195
|
+
})
|
|
196
|
+
}, e.id);
|
|
197
|
+
})
|
|
198
|
+
})]
|
|
199
|
+
})
|
|
200
|
+
]
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
//#endregion
|
|
204
|
+
export { f as ConnectionLogPanel };
|
|
205
|
+
|
|
206
|
+
//# sourceMappingURL=ConnectionLogPanel.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConnectionLogPanel.js","names":[],"sources":["../../../src/components/agents/ConnectionLogPanel.tsx"],"sourcesContent":["import { useCallback, useMemo, useState } from 'react';\nimport { useGetAgentConnectionEventsQuery } from '@/generated/wspace-operations';\n\ninterface Props {\n agentId: string;\n agentName?: string;\n}\n\ninterface EventRow {\n id: string;\n timestamp: string;\n sequence: number;\n step: string;\n level: string;\n message: string;\n detailsJson?: string | null;\n}\n\nconst LEVEL_COLOR: Record<string, string> = {\n info: 'text-status-info-text',\n warn: 'text-status-warning-text',\n error: 'text-status-danger-text',\n debug: 'text-fg-muted',\n};\n\nconst LEVEL_BG: Record<string, string> = {\n info: 'bg-status-info-bg',\n warn: 'bg-status-warning-bg',\n error: 'bg-status-danger-bg',\n debug: 'bg-bg-muted',\n};\n\nfunction formatTimestamp(iso: string): string {\n try {\n return new Date(iso).toISOString().replace('T', ' ').replace('Z', '');\n } catch {\n return iso;\n }\n}\n\nfunction eventsAsText(rows: EventRow[]): string {\n return rows\n .map((e) => {\n const detail = e.detailsJson ? `\\n details: ${e.detailsJson}` : '';\n return `[${e.timestamp}] #${e.sequence} ${e.level.toUpperCase().padEnd(5)} ${e.step.padEnd(28)} ${e.message}${detail}`;\n })\n .join('\\n');\n}\n\nfunction eventsAsJson(rows: EventRow[], agentId: string, agentName?: string): string {\n return JSON.stringify(\n {\n exportedAt: new Date().toISOString(),\n agentId,\n agentName,\n count: rows.length,\n events: rows.map((e) => ({\n id: e.id,\n timestamp: e.timestamp,\n sequence: e.sequence,\n step: e.step,\n level: e.level,\n message: e.message,\n details: e.detailsJson ? JSON.parse(e.detailsJson) : null,\n })),\n },\n null,\n 2,\n );\n}\n\nfunction downloadBlob(filename: string, mime: string, body: string): void {\n const blob = new Blob([body], { type: mime });\n const url = URL.createObjectURL(blob);\n const a = document.createElement('a');\n a.href = url;\n a.download = filename;\n document.body.appendChild(a);\n a.click();\n document.body.removeChild(a);\n URL.revokeObjectURL(url);\n}\n\nexport function ConnectionLogPanel({ agentId, agentName }: Props) {\n // Poll every 3s while the panel is mounted so the operator sees new\n // events appear as the svc records them — no manual refresh needed\n // while debugging \"stuck\" agents.\n const { data, loading, error, refetch } = useGetAgentConnectionEventsQuery({\n variables: { agentId, limit: 200 },\n pollInterval: 3000,\n fetchPolicy: 'cache-and-network',\n });\n const [copied, setCopied] = useState<'none' | 'text' | 'json'>('none');\n\n const events: EventRow[] = useMemo(() => {\n const raw = data?.vibecontrolsAgentConnectionEvents ?? [];\n return raw.map((e: { id: string; timestamp: string; sequence: number; step: string; level: string; message: string; detailsJson?: string | null }) => ({\n id: e.id,\n timestamp: e.timestamp,\n sequence: e.sequence,\n step: e.step,\n level: e.level,\n message: e.message,\n detailsJson: e.detailsJson ?? null,\n }));\n }, [data]);\n\n const handleCopy = useCallback(\n async (mode: 'text' | 'json') => {\n const body = mode === 'text' ? eventsAsText(events) : eventsAsJson(events, agentId, agentName);\n try {\n await navigator.clipboard.writeText(body);\n setCopied(mode);\n setTimeout(() => setCopied('none'), 1500);\n } catch {\n /* clipboard denied — fall back to download */\n downloadBlob(`agent-${agentId}-connection-log.${mode === 'text' ? 'txt' : 'json'}`, mode === 'text' ? 'text/plain' : 'application/json', body);\n }\n },\n [events, agentId, agentName],\n );\n\n const handleDownload = useCallback(\n (mode: 'text' | 'json') => {\n const body = mode === 'text' ? eventsAsText(events) : eventsAsJson(events, agentId, agentName);\n const stamp = new Date().toISOString().replace(/[:.]/g, '-');\n downloadBlob(\n `agent-${agentName ?? agentId}-connection-log-${stamp}.${mode === 'text' ? 'txt' : 'json'}`,\n mode === 'text' ? 'text/plain' : 'application/json',\n body,\n );\n },\n [events, agentId, agentName],\n );\n\n return (\n <div className=\"flex flex-col h-full\">\n <div className=\"flex items-center justify-between p-4 border-b border-border-default\">\n <div>\n <h3 className=\"text-fg-default font-semibold text-base\">Connection Log</h3>\n <p className=\"text-fg-muted text-xs mt-0.5\">\n {loading && events.length === 0\n ? 'Loading…'\n : `${events.length} event${events.length === 1 ? '' : 's'} · auto-refresh every 3s`}\n </p>\n </div>\n <div className=\"flex gap-2\">\n <button\n type=\"button\"\n onClick={() => refetch()}\n className=\"px-3 py-1.5 text-xs rounded bg-bg-subtle hover:bg-bg-muted text-fg-default border border-border-default\"\n >\n Refresh\n </button>\n <button\n type=\"button\"\n onClick={() => handleCopy('text')}\n className=\"px-3 py-1.5 text-xs rounded bg-bg-subtle hover:bg-bg-muted text-fg-default border border-border-default\"\n >\n {copied === 'text' ? 'Copied!' : 'Copy text'}\n </button>\n <button\n type=\"button\"\n onClick={() => handleCopy('json')}\n className=\"px-3 py-1.5 text-xs rounded bg-bg-subtle hover:bg-bg-muted text-fg-default border border-border-default\"\n >\n {copied === 'json' ? 'Copied!' : 'Copy JSON'}\n </button>\n <button\n type=\"button\"\n onClick={() => handleDownload('text')}\n className=\"px-3 py-1.5 text-xs rounded bg-action-primary hover:bg-action-primary-hover text-action-primary-text border border-action-primary\"\n >\n Export .txt\n </button>\n <button\n type=\"button\"\n onClick={() => handleDownload('json')}\n className=\"px-3 py-1.5 text-xs rounded bg-action-primary hover:bg-action-primary-hover text-action-primary-text border border-action-primary\"\n >\n Export .json\n </button>\n </div>\n </div>\n\n {error && (\n <div className=\"m-4 p-3 rounded bg-status-danger-bg text-status-danger-text text-sm\">\n Failed to load events: {error.message}\n </div>\n )}\n\n <div className=\"flex-1 overflow-auto p-4\">\n {events.length === 0 && !loading && (\n <div className=\"text-fg-muted text-sm text-center py-12\">\n No connection events recorded for this agent yet.\n <br />\n Events appear here every time the platform probes, registers, or syncs the agent.\n </div>\n )}\n <ol className=\"space-y-2\">\n {events.map((e) => {\n const levelColor = LEVEL_COLOR[e.level] ?? LEVEL_COLOR.info;\n const levelBg = LEVEL_BG[e.level] ?? LEVEL_BG.info;\n const details = (() => {\n if (!e.detailsJson) return null;\n try {\n return JSON.stringify(JSON.parse(e.detailsJson), null, 2);\n } catch {\n return e.detailsJson;\n }\n })();\n return (\n <li\n key={e.id}\n className=\"rounded border border-border-default bg-bg-subtle\"\n >\n <div className=\"flex items-start gap-3 p-3\">\n <div className={`px-2 py-0.5 rounded text-[10px] uppercase font-mono ${levelBg} ${levelColor} shrink-0`}>\n {e.level}\n </div>\n <div className=\"flex-1 min-w-0\">\n <div className=\"flex items-center gap-2 text-xs text-fg-muted font-mono\">\n <span>#{e.sequence}</span>\n <span>·</span>\n <span>{formatTimestamp(e.timestamp)}</span>\n <span>·</span>\n <span className=\"text-fg-default font-medium\">{e.step}</span>\n </div>\n <div className=\"text-sm text-fg-default mt-1 break-words\">{e.message}</div>\n {details && (\n <details className=\"mt-2\">\n <summary className=\"text-xs text-fg-muted cursor-pointer hover:text-fg-default\">\n Details\n </summary>\n <pre className=\"mt-2 p-2 rounded bg-bg-default text-xs text-fg-default overflow-x-auto whitespace-pre-wrap break-words\">\n {details}\n </pre>\n </details>\n )}\n </div>\n </div>\n </li>\n );\n })}\n </ol>\n </div>\n </div>\n );\n}\n"],"mappings":";;;;AAkBA,IAAM,IAAsC;CAC1C,MAAM;CACN,MAAM;CACN,OA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AAuD,EAAQ,GAAG,EAAW;mBAC1F,EAAE;SACC,CAAA,EACN,kBAAC,OAAD;SAAK,WAAU;mBAAf;UACE,kBAAC,OAAD;WAAK,WAAU;qBAAf;YACE,kBAAC,QAAD,EAAA,UAAA,CAAM,KAAE,EAAE,SAAgB,EAAA,CAAA;YAC1B,kBAAC,QAAD,EAAA,UAAM,KAAQ,CAAA;YACd,kBAAC,QAAD,EAAA,UAAO,EAAgB,EAAE,UAAU,EAAQ,CAAA;YAC3C,kBAAC,QAAD,EAAA,UAAM,KAAQ,CAAA;YACd,kBAAC,QAAD;aAAM,WAAU;uBAA+B,EAAE;aAAY,CAAA;YACzD;;UACN,kBAAC,OAAD;WAAK,WAAU;qBAA4C,EAAE;WAAc,CAAA;UAC1E,KACC,kBAAC,WAAD;WAAS,WAAU;qBAAnB,CACE,kBAAC,WAAD;YAAS,WAAU;sBAA6D;YAEtE,CAAA,EACV,kBAAC,OAAD;YAAK,WAAU;sBACZ;YACG,CAAA,CACE;;UAER;WACF;;OACH,EA5BE,EAAE,GA4BJ;OAEP;KACC,CAAA,CACD;;GACF"}
|
|
@@ -1,94 +1,93 @@
|
|
|
1
1
|
import { useVibeControls as e } from "../../providers/VibeControlsProvider.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import { jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback as t, useEffect as n, useRef as r, useState as i } from "react";
|
|
3
|
+
import { useI18n as a } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
4
|
+
import { Download as o, Pause as s, Play as c, RefreshCw as l, Search as u, Trash2 as d } from "lucide-react";
|
|
5
|
+
import { getStoredAuthToken as f, getStoredWorkspaceToken as p } from "@burdenoff/fe-libs/shared/graphql";
|
|
6
|
+
import { jsx as m, jsxs as h } from "react/jsx-runtime";
|
|
8
7
|
//#region src/components/logs/LogViewer.tsx
|
|
9
|
-
function
|
|
8
|
+
function g(e) {
|
|
10
9
|
return `${e.timestamp}:${e.level}:${e.source}:${e.message}`;
|
|
11
10
|
}
|
|
12
|
-
var
|
|
11
|
+
var _ = {
|
|
13
12
|
debug: "text-text-tertiary",
|
|
14
13
|
info: "text-status-info-text",
|
|
15
14
|
warn: "text-status-warning-text",
|
|
16
15
|
error: "text-status-error-text"
|
|
17
|
-
},
|
|
16
|
+
}, v = {
|
|
18
17
|
debug: "bg-bg-tertiary/30",
|
|
19
18
|
info: "bg-status-info-bg/10",
|
|
20
19
|
warn: "bg-status-warning-bg/10",
|
|
21
20
|
error: "bg-status-error-bg/10"
|
|
22
|
-
},
|
|
23
|
-
let { t:
|
|
24
|
-
let n =
|
|
21
|
+
}, y = ({ agentId: y, profile: b, level: x = "info", source: S, maxEntries: C = 1e3, className: w = "", compact: T = !1 }) => {
|
|
22
|
+
let { t: E } = a(), { apiGatewayUrl: D, workspaceId: O } = e(), [k, A] = i([]), [j, M] = i(!1), [N, P] = i(!1), [F, I] = i(x), [L, R] = i(""), [z, B] = i(null), [V, H] = i(!1), U = r(null), W = r(!0), G = (e, t) => {
|
|
23
|
+
let n = E(e);
|
|
25
24
|
return n === e ? t : n;
|
|
26
|
-
},
|
|
27
|
-
if (!
|
|
28
|
-
let e =
|
|
29
|
-
|
|
30
|
-
}, []),
|
|
31
|
-
|
|
32
|
-
}, []),
|
|
33
|
-
if (
|
|
34
|
-
|
|
25
|
+
}, K = t(() => {
|
|
26
|
+
if (!U.current) return;
|
|
27
|
+
let e = U.current;
|
|
28
|
+
W.current = e.scrollHeight - e.scrollTop - e.clientHeight < 50;
|
|
29
|
+
}, []), q = t(() => {
|
|
30
|
+
U.current && (U.current.scrollTop = U.current.scrollHeight);
|
|
31
|
+
}, []), J = t(async () => {
|
|
32
|
+
if (y) {
|
|
33
|
+
H(!0);
|
|
35
34
|
try {
|
|
36
|
-
let e =
|
|
35
|
+
let e = f(), t = p(), n = await (await fetch(D ? `${D}/workspaces/graphql` : "/workspaces/graphql", {
|
|
37
36
|
method: "POST",
|
|
38
37
|
headers: {
|
|
39
38
|
"Content-Type": "application/json",
|
|
40
39
|
...e ? { Authorization: `Bearer ${e}` } : {},
|
|
41
|
-
...
|
|
42
|
-
...
|
|
40
|
+
...t ? { "X-Workspace-Authorization": `Bearer ${t}` } : {},
|
|
41
|
+
...O ? { "x-workspace-id": O } : {}
|
|
43
42
|
},
|
|
44
43
|
body: JSON.stringify({
|
|
45
|
-
query: "query AgentLogs($agentId: ID!, $
|
|
44
|
+
query: "query AgentLogs($agentId: ID!, $profile: String, $query: JSON) {\n agentLogsGet(agentId: $agentId, profile: $profile, query: $query) {\n ok\n status\n data\n error\n }\n }",
|
|
46
45
|
variables: {
|
|
47
|
-
agentId:
|
|
48
|
-
|
|
46
|
+
agentId: y,
|
|
47
|
+
profile: b,
|
|
49
48
|
query: {
|
|
50
|
-
level:
|
|
49
|
+
level: F,
|
|
51
50
|
limit: 200,
|
|
52
|
-
...
|
|
51
|
+
...S ? { source: S } : {}
|
|
53
52
|
}
|
|
54
53
|
}
|
|
55
54
|
})
|
|
56
|
-
})).json(),
|
|
57
|
-
if (!
|
|
58
|
-
let
|
|
59
|
-
|
|
55
|
+
})).json(), r = n.data?.agentLogsGet;
|
|
56
|
+
if (!r?.ok) throw Error(r?.error || n.errors?.[0]?.message || "Failed to fetch logs");
|
|
57
|
+
let i = (r.data?.entries ?? []).slice().sort((e, t) => new Date(e.timestamp).getTime() - new Date(t.timestamp).getTime());
|
|
58
|
+
A((e) => {
|
|
60
59
|
let t = /* @__PURE__ */ new Map();
|
|
61
|
-
for (let n of e) t.set(
|
|
62
|
-
for (let e of
|
|
63
|
-
return Array.from(t.values()).sort((e, t) => new Date(e.timestamp).getTime() - new Date(t.timestamp).getTime()).slice(-
|
|
64
|
-
}),
|
|
60
|
+
for (let n of e) t.set(g(n), n);
|
|
61
|
+
for (let e of i) t.set(g(e), e);
|
|
62
|
+
return Array.from(t.values()).sort((e, t) => new Date(e.timestamp).getTime() - new Date(t.timestamp).getTime()).slice(-C);
|
|
63
|
+
}), M(!0), B(null), W.current && requestAnimationFrame(q);
|
|
65
64
|
} catch (e) {
|
|
66
|
-
|
|
65
|
+
M(!1), B(e instanceof Error ? e.message : G("logs.fetchFailed", "Failed to fetch logs"));
|
|
67
66
|
} finally {
|
|
68
|
-
|
|
67
|
+
H(!1);
|
|
69
68
|
}
|
|
70
69
|
}
|
|
71
70
|
}, [
|
|
71
|
+
y,
|
|
72
72
|
b,
|
|
73
|
-
|
|
74
|
-
|
|
73
|
+
D,
|
|
74
|
+
S,
|
|
75
|
+
F,
|
|
75
76
|
C,
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
K,
|
|
80
|
-
k
|
|
77
|
+
q,
|
|
78
|
+
G,
|
|
79
|
+
O
|
|
81
80
|
]);
|
|
82
|
-
|
|
83
|
-
|
|
81
|
+
n(() => {
|
|
82
|
+
A([]), M(!1), B(null);
|
|
84
83
|
}, [
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
]),
|
|
89
|
-
if (!
|
|
84
|
+
y,
|
|
85
|
+
S,
|
|
86
|
+
F
|
|
87
|
+
]), n(() => {
|
|
88
|
+
if (!y || N) return;
|
|
90
89
|
let e = !1, t = async () => {
|
|
91
|
-
e || await
|
|
90
|
+
e || await J();
|
|
92
91
|
};
|
|
93
92
|
t();
|
|
94
93
|
let n = window.setInterval(() => {
|
|
@@ -98,14 +97,14 @@ var v = {
|
|
|
98
97
|
e = !0, window.clearInterval(n);
|
|
99
98
|
};
|
|
100
99
|
}, [
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
100
|
+
y,
|
|
101
|
+
J,
|
|
102
|
+
N
|
|
104
103
|
]);
|
|
105
|
-
let
|
|
106
|
-
let e = new Blob([
|
|
104
|
+
let Y = L ? k.filter((e) => e.message.toLowerCase().includes(L.toLowerCase()) || e.source.toLowerCase().includes(L.toLowerCase())) : k, X = () => A([]), Z = () => {
|
|
105
|
+
let e = new Blob([Y.map((e) => JSON.stringify(e)).join("\n")], { type: "application/x-ndjson" }), t = URL.createObjectURL(e), n = document.createElement("a");
|
|
107
106
|
n.href = t, n.download = `agent-logs-${(/* @__PURE__ */ new Date()).toISOString().slice(0, 19).replace(/:/g, "-")}.jsonl`, n.click(), URL.revokeObjectURL(t);
|
|
108
|
-
},
|
|
107
|
+
}, Q = (e) => {
|
|
109
108
|
try {
|
|
110
109
|
let t = new Date(e);
|
|
111
110
|
return t.toLocaleTimeString("en-US", {
|
|
@@ -118,129 +117,129 @@ var v = {
|
|
|
118
117
|
return e;
|
|
119
118
|
}
|
|
120
119
|
};
|
|
121
|
-
return /* @__PURE__ */
|
|
122
|
-
className: `flex flex-col overflow-hidden rounded-lg border border-border-primary bg-bg-elevated ${
|
|
120
|
+
return /* @__PURE__ */ h("div", {
|
|
121
|
+
className: `flex flex-col overflow-hidden rounded-lg border border-border-primary bg-bg-elevated ${w}`,
|
|
123
122
|
children: [
|
|
124
|
-
/* @__PURE__ */
|
|
123
|
+
/* @__PURE__ */ h("div", {
|
|
125
124
|
className: "flex flex-wrap items-center gap-2 border-b border-border-primary bg-bg-secondary/50 px-3 py-2",
|
|
126
125
|
children: [
|
|
127
|
-
/* @__PURE__ */
|
|
126
|
+
/* @__PURE__ */ h("div", {
|
|
128
127
|
className: "mr-2 flex items-center gap-1.5",
|
|
129
|
-
children: [/* @__PURE__ */
|
|
128
|
+
children: [/* @__PURE__ */ m("div", { className: `size-2 rounded-full ${j ? "animate-pulse bg-status-success-bg" : "bg-status-error-bg"}` }), /* @__PURE__ */ m("span", {
|
|
130
129
|
className: "text-xs text-text-tertiary",
|
|
131
|
-
children:
|
|
130
|
+
children: j ? G("logs.live", "Live") : G("logs.disconnected", "Disconnected")
|
|
132
131
|
})]
|
|
133
132
|
}),
|
|
134
|
-
/* @__PURE__ */
|
|
135
|
-
value:
|
|
136
|
-
onChange: (e) =>
|
|
133
|
+
/* @__PURE__ */ h("select", {
|
|
134
|
+
value: F,
|
|
135
|
+
onChange: (e) => I(e.target.value),
|
|
137
136
|
className: "rounded border border-border-secondary bg-bg-tertiary px-2 py-1 text-xs text-text-primary",
|
|
138
|
-
"aria-label":
|
|
137
|
+
"aria-label": G("logs.levelFilter", "Log level filter"),
|
|
139
138
|
children: [
|
|
140
|
-
/* @__PURE__ */
|
|
139
|
+
/* @__PURE__ */ m("option", {
|
|
141
140
|
value: "debug",
|
|
142
141
|
children: "DEBUG+"
|
|
143
142
|
}),
|
|
144
|
-
/* @__PURE__ */
|
|
143
|
+
/* @__PURE__ */ m("option", {
|
|
145
144
|
value: "info",
|
|
146
145
|
children: "INFO+"
|
|
147
146
|
}),
|
|
148
|
-
/* @__PURE__ */
|
|
147
|
+
/* @__PURE__ */ m("option", {
|
|
149
148
|
value: "warn",
|
|
150
149
|
children: "WARN+"
|
|
151
150
|
}),
|
|
152
|
-
/* @__PURE__ */
|
|
151
|
+
/* @__PURE__ */ m("option", {
|
|
153
152
|
value: "error",
|
|
154
153
|
children: "ERROR"
|
|
155
154
|
})
|
|
156
155
|
]
|
|
157
156
|
}),
|
|
158
|
-
/* @__PURE__ */
|
|
157
|
+
/* @__PURE__ */ h("div", {
|
|
159
158
|
className: "relative min-w-[120px] max-w-xs flex-1",
|
|
160
|
-
children: [/* @__PURE__ */
|
|
159
|
+
children: [/* @__PURE__ */ m(u, {
|
|
161
160
|
size: 12,
|
|
162
161
|
className: "absolute left-2 top-1/2 -translate-y-1/2 text-text-tertiary"
|
|
163
|
-
}), /* @__PURE__ */
|
|
162
|
+
}), /* @__PURE__ */ m("input", {
|
|
164
163
|
"aria-label": "control",
|
|
165
164
|
type: "text",
|
|
166
|
-
placeholder:
|
|
167
|
-
value:
|
|
168
|
-
onChange: (e) =>
|
|
165
|
+
placeholder: G("logs.filterLogs", "Filter logs..."),
|
|
166
|
+
value: L,
|
|
167
|
+
onChange: (e) => R(e.target.value),
|
|
169
168
|
className: "w-full rounded border border-border-secondary bg-bg-tertiary py-1 pl-6 pr-2 text-xs text-text-primary placeholder:text-text-tertiary"
|
|
170
169
|
})]
|
|
171
170
|
}),
|
|
172
|
-
/* @__PURE__ */
|
|
171
|
+
/* @__PURE__ */ h("div", {
|
|
173
172
|
className: "ml-auto flex items-center gap-1",
|
|
174
173
|
children: [
|
|
175
|
-
/* @__PURE__ */
|
|
174
|
+
/* @__PURE__ */ h("span", {
|
|
176
175
|
className: "text-xs text-text-tertiary",
|
|
177
176
|
children: [
|
|
178
|
-
|
|
177
|
+
Y.length,
|
|
179
178
|
" ",
|
|
180
|
-
|
|
179
|
+
G("logs.entries", "entries")
|
|
181
180
|
]
|
|
182
181
|
}),
|
|
183
|
-
/* @__PURE__ */
|
|
182
|
+
/* @__PURE__ */ m("button", {
|
|
184
183
|
type: "button",
|
|
185
|
-
onClick: () => void
|
|
186
|
-
disabled:
|
|
184
|
+
onClick: () => void J(),
|
|
185
|
+
disabled: V,
|
|
187
186
|
className: "rounded p-1 text-text-tertiary transition-colors hover:bg-bg-tertiary disabled:opacity-50",
|
|
188
|
-
title:
|
|
189
|
-
children: /* @__PURE__ */
|
|
187
|
+
title: G("common.refresh", "Refresh"),
|
|
188
|
+
children: /* @__PURE__ */ m(l, {
|
|
190
189
|
size: 14,
|
|
191
|
-
className:
|
|
190
|
+
className: V ? "animate-spin" : ""
|
|
192
191
|
})
|
|
193
192
|
}),
|
|
194
|
-
/* @__PURE__ */
|
|
193
|
+
/* @__PURE__ */ m("button", {
|
|
195
194
|
type: "button",
|
|
196
|
-
onClick: () =>
|
|
197
|
-
className: `rounded p-1 transition-colors hover:bg-bg-tertiary ${
|
|
198
|
-
title:
|
|
199
|
-
children:
|
|
195
|
+
onClick: () => P((e) => !e),
|
|
196
|
+
className: `rounded p-1 transition-colors hover:bg-bg-tertiary ${N ? "text-status-warning-text" : "text-text-tertiary"}`,
|
|
197
|
+
title: N ? G("logs.resume", "Resume") : G("logs.pause", "Pause"),
|
|
198
|
+
children: m(N ? c : s, { size: 14 })
|
|
200
199
|
}),
|
|
201
|
-
/* @__PURE__ */
|
|
200
|
+
/* @__PURE__ */ m("button", {
|
|
202
201
|
type: "button",
|
|
203
|
-
onClick:
|
|
202
|
+
onClick: X,
|
|
204
203
|
className: "rounded p-1 text-text-tertiary transition-colors hover:bg-bg-tertiary",
|
|
205
|
-
title:
|
|
206
|
-
children: /* @__PURE__ */
|
|
204
|
+
title: G("logs.clear", "Clear"),
|
|
205
|
+
children: /* @__PURE__ */ m(d, { size: 14 })
|
|
207
206
|
}),
|
|
208
|
-
/* @__PURE__ */
|
|
207
|
+
/* @__PURE__ */ m("button", {
|
|
209
208
|
type: "button",
|
|
210
|
-
onClick:
|
|
209
|
+
onClick: Z,
|
|
211
210
|
className: "rounded p-1 text-text-tertiary transition-colors hover:bg-bg-tertiary",
|
|
212
|
-
title:
|
|
213
|
-
children: /* @__PURE__ */
|
|
211
|
+
title: G("logs.export", "Export"),
|
|
212
|
+
children: /* @__PURE__ */ m(o, { size: 14 })
|
|
214
213
|
})
|
|
215
214
|
]
|
|
216
215
|
})
|
|
217
216
|
]
|
|
218
217
|
}),
|
|
219
|
-
|
|
218
|
+
z ? /* @__PURE__ */ m("div", {
|
|
220
219
|
role: "alert",
|
|
221
220
|
className: "border-b border-border-primary bg-status-error-bg/10 px-3 py-2 text-xs text-status-error-text",
|
|
222
|
-
children:
|
|
221
|
+
children: z
|
|
223
222
|
}) : null,
|
|
224
|
-
/* @__PURE__ */
|
|
225
|
-
ref:
|
|
226
|
-
onScroll:
|
|
227
|
-
className: `overflow-y-auto font-mono text-xs leading-relaxed ${
|
|
228
|
-
style: { maxHeight:
|
|
229
|
-
children:
|
|
223
|
+
/* @__PURE__ */ m("div", {
|
|
224
|
+
ref: U,
|
|
225
|
+
onScroll: K,
|
|
226
|
+
className: `overflow-y-auto font-mono text-xs leading-relaxed ${T ? "max-h-[300px]" : "min-h-[400px] flex-1"}`,
|
|
227
|
+
style: { maxHeight: T ? "300px" : void 0 },
|
|
228
|
+
children: Y.length === 0 ? /* @__PURE__ */ m("div", {
|
|
230
229
|
className: "flex h-full min-h-[200px] items-center justify-center text-text-tertiary",
|
|
231
|
-
children:
|
|
232
|
-
}) :
|
|
233
|
-
className: `flex gap-2 border-b border-border-primary/30 px-3 py-0.5 hover:bg-bg-tertiary/50 ${
|
|
230
|
+
children: j ? G("logs.waitingForEntries", "Waiting for log entries...") : G("logs.connectToAgent", "Connect to an agent to view logs")
|
|
231
|
+
}) : Y.map((e, t) => /* @__PURE__ */ h("div", {
|
|
232
|
+
className: `flex gap-2 border-b border-border-primary/30 px-3 py-0.5 hover:bg-bg-tertiary/50 ${v[e.level] ?? ""}`,
|
|
234
233
|
children: [
|
|
235
|
-
/* @__PURE__ */
|
|
234
|
+
/* @__PURE__ */ m("span", {
|
|
236
235
|
className: "w-[85px] shrink-0 text-text-tertiary",
|
|
237
|
-
children:
|
|
236
|
+
children: Q(e.timestamp)
|
|
238
237
|
}),
|
|
239
|
-
/* @__PURE__ */
|
|
240
|
-
className: `w-[42px] shrink-0 uppercase font-semibold ${
|
|
238
|
+
/* @__PURE__ */ m("span", {
|
|
239
|
+
className: `w-[42px] shrink-0 uppercase font-semibold ${_[e.level] ?? "text-text-primary"}`,
|
|
241
240
|
children: e.level
|
|
242
241
|
}),
|
|
243
|
-
/* @__PURE__ */
|
|
242
|
+
/* @__PURE__ */ h("span", {
|
|
244
243
|
className: "w-[100px] shrink-0 truncate text-text-secondary",
|
|
245
244
|
title: e.source,
|
|
246
245
|
children: [
|
|
@@ -249,9 +248,9 @@ var v = {
|
|
|
249
248
|
"]"
|
|
250
249
|
]
|
|
251
250
|
}),
|
|
252
|
-
/* @__PURE__ */
|
|
251
|
+
/* @__PURE__ */ h("span", {
|
|
253
252
|
className: "flex-1 break-all text-text-primary",
|
|
254
|
-
children: [e.message, e.metadata && Object.keys(e.metadata).length > 0 ? /* @__PURE__ */
|
|
253
|
+
children: [e.message, e.metadata && Object.keys(e.metadata).length > 0 ? /* @__PURE__ */ m("span", {
|
|
255
254
|
className: "ml-2 text-text-tertiary",
|
|
256
255
|
children: JSON.stringify(e.metadata)
|
|
257
256
|
}) : null]
|
|
@@ -263,6 +262,6 @@ var v = {
|
|
|
263
262
|
});
|
|
264
263
|
};
|
|
265
264
|
//#endregion
|
|
266
|
-
export {
|
|
265
|
+
export { y as LogViewer };
|
|
267
266
|
|
|
268
267
|
//# sourceMappingURL=LogViewer.js.map
|