@flanksource/clicky-ui 0.2.4 → 0.2.6
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/Combobox.cjs +291 -0
- package/dist/components/Combobox.cjs.map +1 -0
- package/dist/components/Combobox.d.ts +59 -0
- package/dist/components/Combobox.d.ts.map +1 -0
- package/dist/components/Combobox.js +291 -0
- package/dist/components/Combobox.js.map +1 -0
- package/dist/components/FilterBar.cjs +153 -124
- package/dist/components/FilterBar.cjs.map +1 -1
- package/dist/components/FilterBar.d.ts +25 -1
- package/dist/components/FilterBar.d.ts.map +1 -1
- package/dist/components/FilterBar.js +153 -124
- package/dist/components/FilterBar.js.map +1 -1
- package/dist/components/FormatOptionsDropdown.cjs +62 -0
- package/dist/components/FormatOptionsDropdown.cjs.map +1 -0
- package/dist/components/FormatOptionsDropdown.d.ts +37 -0
- package/dist/components/FormatOptionsDropdown.d.ts.map +1 -0
- package/dist/components/FormatOptionsDropdown.js +62 -0
- package/dist/components/FormatOptionsDropdown.js.map +1 -0
- package/dist/components/SplitButton.cjs +87 -0
- package/dist/components/SplitButton.cjs.map +1 -0
- package/dist/components/SplitButton.d.ts +32 -0
- package/dist/components/SplitButton.d.ts.map +1 -0
- package/dist/components/SplitButton.js +87 -0
- package/dist/components/SplitButton.js.map +1 -0
- package/dist/components/icon-menu-picker.cjs +1 -1
- package/dist/components/icon-menu-picker.cjs.map +1 -1
- package/dist/components/icon-menu-picker.js +1 -1
- package/dist/components/icon-menu-picker.js.map +1 -1
- package/dist/components.cjs +7 -0
- package/dist/components.cjs.map +1 -1
- package/dist/components.d.ts +3 -0
- package/dist/components.d.ts.map +1 -1
- package/dist/components.js +7 -0
- package/dist/components.js.map +1 -1
- package/dist/data/Badge.d.ts +1 -1
- package/dist/data/ProgressBar.cjs +4 -2
- package/dist/data/ProgressBar.cjs.map +1 -1
- package/dist/data/ProgressBar.d.ts +1 -1
- package/dist/data/ProgressBar.d.ts.map +1 -1
- package/dist/data/ProgressBar.js +4 -2
- package/dist/data/ProgressBar.js.map +1 -1
- package/dist/data/StatusBreakdown.cjs +80 -0
- package/dist/data/StatusBreakdown.cjs.map +1 -0
- package/dist/data/StatusBreakdown.d.ts +36 -0
- package/dist/data/StatusBreakdown.d.ts.map +1 -0
- package/dist/data/StatusBreakdown.js +80 -0
- package/dist/data/StatusBreakdown.js.map +1 -0
- package/dist/data/TaskManager.cjs +162 -0
- package/dist/data/TaskManager.cjs.map +1 -0
- package/dist/data/TaskManager.d.ts +21 -0
- package/dist/data/TaskManager.d.ts.map +1 -0
- package/dist/data/TaskManager.js +162 -0
- package/dist/data/TaskManager.js.map +1 -0
- package/dist/data/TaskProgress.cjs +125 -0
- package/dist/data/TaskProgress.cjs.map +1 -0
- package/dist/data/TaskProgress.d.ts +20 -0
- package/dist/data/TaskProgress.d.ts.map +1 -0
- package/dist/data/TaskProgress.js +125 -0
- package/dist/data/TaskProgress.js.map +1 -0
- package/dist/data/TaskSnapshot.cjs +23 -0
- package/dist/data/TaskSnapshot.cjs.map +1 -0
- package/dist/data/TaskSnapshot.d.ts +49 -0
- package/dist/data/TaskSnapshot.d.ts.map +1 -0
- package/dist/data/TaskSnapshot.js +23 -0
- package/dist/data/TaskSnapshot.js.map +1 -0
- package/dist/data/TimeseriesGauge.cjs +144 -0
- package/dist/data/TimeseriesGauge.cjs.map +1 -0
- package/dist/data/TimeseriesGauge.d.ts +56 -0
- package/dist/data/TimeseriesGauge.d.ts.map +1 -0
- package/dist/data/TimeseriesGauge.js +144 -0
- package/dist/data/TimeseriesGauge.js.map +1 -0
- package/dist/data/TimeseriesPanel.axes.cjs +39 -0
- package/dist/data/TimeseriesPanel.axes.cjs.map +1 -0
- package/dist/data/TimeseriesPanel.axes.d.ts +28 -0
- package/dist/data/TimeseriesPanel.axes.d.ts.map +1 -0
- package/dist/data/TimeseriesPanel.axes.js +39 -0
- package/dist/data/TimeseriesPanel.axes.js.map +1 -0
- package/dist/data/TimeseriesPanel.cjs +324 -0
- package/dist/data/TimeseriesPanel.cjs.map +1 -0
- package/dist/data/TimeseriesPanel.d.ts +141 -0
- package/dist/data/TimeseriesPanel.d.ts.map +1 -0
- package/dist/data/TimeseriesPanel.js +324 -0
- package/dist/data/TimeseriesPanel.js.map +1 -0
- package/dist/data/Tree.cjs.map +1 -1
- package/dist/data/Tree.d.ts.map +1 -1
- package/dist/data/Tree.js.map +1 -1
- package/dist/data/TreeNode.cjs +44 -7
- package/dist/data/TreeNode.cjs.map +1 -1
- package/dist/data/TreeNode.d.ts +19 -1
- package/dist/data/TreeNode.d.ts.map +1 -1
- package/dist/data/TreeNode.js +44 -7
- package/dist/data/TreeNode.js.map +1 -1
- package/dist/data/diagnostics/DiagnosticsDetailPanel.cjs +66 -44
- package/dist/data/diagnostics/DiagnosticsDetailPanel.cjs.map +1 -1
- package/dist/data/diagnostics/DiagnosticsDetailPanel.d.ts +21 -1
- package/dist/data/diagnostics/DiagnosticsDetailPanel.d.ts.map +1 -1
- package/dist/data/diagnostics/DiagnosticsDetailPanel.js +65 -43
- package/dist/data/diagnostics/DiagnosticsDetailPanel.js.map +1 -1
- package/dist/data/diagnostics/DiagnosticsTree.cjs +2 -1
- package/dist/data/diagnostics/DiagnosticsTree.cjs.map +1 -1
- package/dist/data/diagnostics/DiagnosticsTree.js +2 -1
- package/dist/data/diagnostics/DiagnosticsTree.js.map +1 -1
- package/dist/data/diagnostics/FrameSourceWindow.cjs +37 -0
- package/dist/data/diagnostics/FrameSourceWindow.cjs.map +1 -0
- package/dist/data/diagnostics/FrameSourceWindow.d.ts +15 -0
- package/dist/data/diagnostics/FrameSourceWindow.d.ts.map +1 -0
- package/dist/data/diagnostics/FrameSourceWindow.js +37 -0
- package/dist/data/diagnostics/FrameSourceWindow.js.map +1 -0
- package/dist/data/diagnostics/JvmStackTrace.cjs +25 -12
- package/dist/data/diagnostics/JvmStackTrace.cjs.map +1 -1
- package/dist/data/diagnostics/JvmStackTrace.d.ts +8 -1
- package/dist/data/diagnostics/JvmStackTrace.d.ts.map +1 -1
- package/dist/data/diagnostics/JvmStackTrace.js +26 -13
- package/dist/data/diagnostics/JvmStackTrace.js.map +1 -1
- package/dist/data/diagnostics/ThreadCard.cjs +9 -2
- package/dist/data/diagnostics/ThreadCard.cjs.map +1 -1
- package/dist/data/diagnostics/ThreadCard.d.ts +3 -1
- package/dist/data/diagnostics/ThreadCard.d.ts.map +1 -1
- package/dist/data/diagnostics/ThreadCard.js +9 -2
- package/dist/data/diagnostics/ThreadCard.js.map +1 -1
- package/dist/data/diagnostics/jvm-stacktrace.cjs +10 -1
- package/dist/data/diagnostics/jvm-stacktrace.cjs.map +1 -1
- package/dist/data/diagnostics/jvm-stacktrace.d.ts.map +1 -1
- package/dist/data/diagnostics/jvm-stacktrace.js +10 -1
- package/dist/data/diagnostics/jvm-stacktrace.js.map +1 -1
- package/dist/data/diagnostics/utils.cjs +0 -12
- package/dist/data/diagnostics/utils.cjs.map +1 -1
- package/dist/data/diagnostics/utils.d.ts +1 -1
- package/dist/data/diagnostics/utils.d.ts.map +1 -1
- package/dist/data/diagnostics/utils.js +0 -12
- package/dist/data/diagnostics/utils.js.map +1 -1
- package/dist/data/task-status.cjs +108 -0
- package/dist/data/task-status.cjs.map +1 -0
- package/dist/data/task-status.d.ts +21 -0
- package/dist/data/task-status.d.ts.map +1 -0
- package/dist/data/task-status.js +108 -0
- package/dist/data/task-status.js.map +1 -0
- package/dist/data.cjs +27 -0
- package/dist/data.cjs.map +1 -1
- package/dist/data.d.ts +9 -1
- package/dist/data.d.ts.map +1 -1
- package/dist/data.js +27 -0
- package/dist/data.js.map +1 -1
- package/dist/hooks/use-task-run.cjs +137 -0
- package/dist/hooks/use-task-run.cjs.map +1 -0
- package/dist/hooks/use-task-run.d.ts +35 -0
- package/dist/hooks/use-task-run.d.ts.map +1 -0
- package/dist/hooks/use-task-run.js +137 -0
- package/dist/hooks/use-task-run.js.map +1 -0
- package/dist/hooks.cjs +3 -0
- package/dist/hooks.cjs.map +1 -1
- package/dist/hooks.d.ts +1 -0
- package/dist/hooks.d.ts.map +1 -1
- package/dist/hooks.js +3 -0
- package/dist/hooks.js.map +1 -1
- package/dist/index.cjs +43 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +43 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/color.cjs +33 -0
- package/dist/lib/color.cjs.map +1 -0
- package/dist/lib/color.d.ts +10 -0
- package/dist/lib/color.d.ts.map +1 -0
- package/dist/lib/color.js +33 -0
- package/dist/lib/color.js.map +1 -0
- package/dist/lib/format.cjs +77 -0
- package/dist/lib/format.cjs.map +1 -0
- package/dist/lib/format.d.ts +30 -0
- package/dist/lib/format.d.ts.map +1 -0
- package/dist/lib/format.js +77 -0
- package/dist/lib/format.js.map +1 -0
- package/dist/overlay/DropdownMenu.cjs +18 -2
- package/dist/overlay/DropdownMenu.cjs.map +1 -1
- package/dist/overlay/DropdownMenu.d.ts +3 -1
- package/dist/overlay/DropdownMenu.d.ts.map +1 -1
- package/dist/overlay/DropdownMenu.js +18 -2
- package/dist/overlay/DropdownMenu.js.map +1 -1
- package/dist/rpc/types.cjs.map +1 -1
- package/dist/rpc/types.d.ts +4 -0
- package/dist/rpc/types.d.ts.map +1 -1
- package/dist/rpc/types.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/utils.cjs +6 -0
- package/dist/utils.cjs.map +1 -1
- package/dist/utils.d.ts +1 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +6 -0
- package/dist/utils.js.map +1 -1
- package/package.json +4 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DiagnosticsTree.js","sources":["../../../src/data/diagnostics/DiagnosticsTree.tsx"],"sourcesContent":["import { Tree } from \"../Tree\";\nimport { Icon } from \"../Icon\";\nimport { UiDebug, UiServerProcess, UiLoader } from \"../../icons\";\nimport type { ProcessNode } from \"./types\";\nimport {\n countProcesses,\n formatBytes,\n processLabel,\n processStateColor,\n processStateIcon,\n} from \"./utils\";\n\nexport type DiagnosticsTreeProps = {\n /** Root process node. Missing root renders a waiting state. */\n root?: ProcessNode;\n /** Currently selected process id. */\n selectedPid?: number | null;\n /** Controlled expand-all state forwarded to Tree. */\n expandAll?: boolean | null;\n /** Called with the selected process id. */\n onSelect: (pid: number) => void;\n};\n\nexport function DiagnosticsTree({\n root,\n selectedPid,\n expandAll = null,\n onSelect,\n}: DiagnosticsTreeProps) {\n if (!root) {\n return (\n <div className=\"p-density-6 text-center text-muted-foreground\">\n <Icon icon={UiLoader} className=\"text-3xl text-blue-500\" />\n <p className=\"mt-density-2\">Waiting for process diagnostics...</p>\n </div>\n );\n }\n\n if (countProcesses(root) === 0) {\n return (\n <div className=\"p-density-6 text-center text-muted-foreground text-sm\">\n No processes available\n </div>\n );\n }\n\n return (\n <Tree<ProcessNode>\n roots={[root]}\n getChildren={(n) => n.children}\n getKey={(n) => n.pid}\n expandAll={expandAll}\n defaultOpen={(n, depth) => !!n.is_root || depth < 1}\n onSelect={(n) => onSelect(n.pid)}\n renderRow={({ node }) => {\n const selected = node.pid === selectedPid;\n const cpu = node.cpu_percent || 0;\n return (\n <>\n <Icon\n icon={node.is_root ? UiServerProcess : UiDebug}\n className={\n node.is_root ? \"text-base text-blue-600\" : \"text-base text-muted-foreground\"\n }\n />\n <span\n className={`truncate ${\n selected ? \"font-semibold text-primary\" : \"font-medium text-foreground\"\n }`}\n >\n {processLabel(node)}\n </span>\n <span className=\"text-xs text-muted-foreground shrink-0\">pid {node.pid}</span>\n <span className=\"flex-1\" />\n {node.status && (\n <span\n className={`inline-flex items-center gap-1 text-xs shrink-0 ${processStateColor(\n node.status,\n )}`}\n >\n <Icon icon={processStateIcon(node.status)} />\n {node.status}\n </span>\n )}\n <span className=\"text-xs text-muted-foreground shrink-0 tabular-nums\">\n {cpu.toFixed(1)}%\n </span>\n <span className=\"text-xs text-muted-foreground shrink-0 tabular-nums\">\n {formatBytes(node.rss)}\n </span>\n </>\n );\n }}\n rowClass={(node) =>\n node.pid === selectedPid ? \"bg-primary/10 border-l-2 border-primary\" : \"hover:bg-accent\"\n }\n />\n );\n}\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DiagnosticsTree.js","sources":["../../../src/data/diagnostics/DiagnosticsTree.tsx"],"sourcesContent":["import { Tree } from \"../Tree\";\nimport { Icon } from \"../Icon\";\nimport { UiDebug, UiServerProcess, UiLoader } from \"../../icons\";\nimport type { ProcessNode } from \"./types\";\nimport {\n countProcesses,\n formatBytes,\n processLabel,\n processStateColor,\n processStateIcon,\n} from \"./utils\";\n\nexport type DiagnosticsTreeProps = {\n /** Root process node. Missing root renders a waiting state. */\n root?: ProcessNode;\n /** Currently selected process id. */\n selectedPid?: number | null;\n /** Controlled expand-all state forwarded to Tree. */\n expandAll?: boolean | null;\n /** Called with the selected process id. */\n onSelect: (pid: number) => void;\n};\n\nexport function DiagnosticsTree({\n root,\n selectedPid,\n expandAll = null,\n onSelect,\n}: DiagnosticsTreeProps) {\n if (!root) {\n return (\n <div className=\"p-density-6 text-center text-muted-foreground\">\n <Icon icon={UiLoader} className=\"text-3xl text-blue-500\" />\n <p className=\"mt-density-2\">Waiting for process diagnostics...</p>\n </div>\n );\n }\n\n if (countProcesses(root) === 0) {\n return (\n <div className=\"p-density-6 text-center text-muted-foreground text-sm\">\n No processes available\n </div>\n );\n }\n\n return (\n <Tree<ProcessNode>\n roots={[root]}\n getChildren={(n) => n.children}\n getKey={(n) => n.pid}\n expandAll={expandAll}\n defaultOpen={(n, depth) => !!n.is_root || depth < 1}\n onSelect={(n) => onSelect(n.pid)}\n renderRow={({ node }) => {\n const selected = node.pid === selectedPid;\n const cpu = node.cpu_percent || 0;\n return (\n <>\n <Icon\n icon={node.is_root ? UiServerProcess : UiDebug}\n className={\n node.is_root ? \"text-base text-blue-600\" : \"text-base text-muted-foreground\"\n }\n />\n <span\n className={`truncate ${\n selected ? \"font-semibold text-primary\" : \"font-medium text-foreground\"\n }`}\n >\n {processLabel(node)}\n </span>\n <span className=\"text-xs text-muted-foreground shrink-0\">pid {node.pid}</span>\n <span className=\"flex-1\" />\n {node.status && (\n <span\n className={`inline-flex items-center gap-1 text-xs shrink-0 ${processStateColor(\n node.status,\n )}`}\n >\n <Icon icon={processStateIcon(node.status)} />\n {node.status}\n </span>\n )}\n <span className=\"text-xs text-muted-foreground shrink-0 tabular-nums\">\n {cpu.toFixed(1)}%\n </span>\n <span className=\"text-xs text-muted-foreground shrink-0 tabular-nums\">\n {formatBytes(node.rss)}\n </span>\n </>\n );\n }}\n rowClass={(node) =>\n node.pid === selectedPid ? \"bg-primary/10 border-l-2 border-primary\" : \"hover:bg-accent\"\n }\n />\n );\n}\n"],"names":[],"mappings":";;;;;;;;AAuBO,SAAS,gBAAgB;AAAA,EAC9B;AAAA,EACA;AAAA,EACA,YAAY;AAAA,EACZ;AACF,GAAyB;AACvB,MAAI,CAAC,MAAM;AACT,WACE,qBAAC,OAAA,EAAI,WAAU,iDACb,UAAA;AAAA,MAAA,oBAAC,MAAA,EAAK,MAAM,UAAU,WAAU,0BAAyB;AAAA,MACzD,oBAAC,KAAA,EAAE,WAAU,gBAAe,UAAA,qCAAA,CAAkC;AAAA,IAAA,GAChE;AAAA,EAEJ;AAEA,MAAI,eAAe,IAAI,MAAM,GAAG;AAC9B,WACE,oBAAC,OAAA,EAAI,WAAU,yDAAwD,UAAA,0BAEvE;AAAA,EAEJ;AAEA,SACE;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,OAAO,CAAC,IAAI;AAAA,MACZ,aAAa,CAAC,MAAM,EAAE;AAAA,MACtB,QAAQ,CAAC,MAAM,EAAE;AAAA,MACjB;AAAA,MACA,aAAa,CAAC,GAAG,UAAU,CAAC,CAAC,EAAE,WAAW,QAAQ;AAAA,MAClD,UAAU,CAAC,MAAM,SAAS,EAAE,GAAG;AAAA,MAC/B,WAAW,CAAC,EAAE,WAAW;AACvB,cAAM,WAAW,KAAK,QAAQ;AAC9B,cAAM,MAAM,KAAK,eAAe;AAChC,eACE,qBAAA,UAAA,EACE,UAAA;AAAA,UAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,MAAM,KAAK,UAAU,kBAAkB;AAAA,cACvC,WACE,KAAK,UAAU,4BAA4B;AAAA,YAAA;AAAA,UAAA;AAAA,UAG/C;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAW,YACT,WAAW,+BAA+B,6BAC5C;AAAA,cAEC,uBAAa,IAAI;AAAA,YAAA;AAAA,UAAA;AAAA,UAEpB,qBAAC,QAAA,EAAK,WAAU,0CAAyC,UAAA;AAAA,YAAA;AAAA,YAAK,KAAK;AAAA,UAAA,GAAI;AAAA,UACvE,oBAAC,QAAA,EAAK,WAAU,SAAA,CAAS;AAAA,UACxB,KAAK,UACJ;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,WAAW,mDAAmD;AAAA,gBAC5D,KAAK;AAAA,cAAA,CACN;AAAA,cAED,UAAA;AAAA,gBAAA,oBAAC,MAAA,EAAK,MAAM,iBAAiB,KAAK,MAAM,GAAG;AAAA,gBAC1C,KAAK;AAAA,cAAA;AAAA,YAAA;AAAA,UAAA;AAAA,UAGV,qBAAC,QAAA,EAAK,WAAU,uDACb,UAAA;AAAA,YAAA,IAAI,QAAQ,CAAC;AAAA,YAAE;AAAA,UAAA,GAClB;AAAA,8BACC,QAAA,EAAK,WAAU,uDACb,UAAA,YAAY,KAAK,GAAG,EAAA,CACvB;AAAA,QAAA,GACF;AAAA,MAEJ;AAAA,MACA,UAAU,CAAC,SACT,KAAK,QAAQ,cAAc,4CAA4C;AAAA,IAAA;AAAA,EAAA;AAI/E;"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
4
|
+
function frameHasSource(frame) {
|
|
5
|
+
return !!frame.sourceLines && frame.sourceLines.length > 0;
|
|
6
|
+
}
|
|
7
|
+
function FrameSourceWindow({ frame }) {
|
|
8
|
+
const lines = frame.sourceLines ?? [];
|
|
9
|
+
if (lines.length === 0) return null;
|
|
10
|
+
const start = frame.sourceStartLine ?? 0;
|
|
11
|
+
const numbers = frame.sourceLineNumbers;
|
|
12
|
+
const focal = frame.line ?? -1;
|
|
13
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "mx-3 mb-2 ml-12 overflow-x-auto rounded border border-border/60 bg-muted/30 py-1 font-mono text-[11px] leading-relaxed", children: lines.map((source, i) => {
|
|
14
|
+
const lineNumber = (numbers == null ? void 0 : numbers[i]) ?? start + i;
|
|
15
|
+
const isFocal = lineNumber === focal;
|
|
16
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
17
|
+
"div",
|
|
18
|
+
{
|
|
19
|
+
className: [
|
|
20
|
+
"grid min-w-max grid-cols-[3.5rem_minmax(24rem,1fr)] gap-3 px-2",
|
|
21
|
+
isFocal ? "bg-red-500/10 font-semibold text-red-800 dark:text-red-300" : "text-foreground"
|
|
22
|
+
].join(" "),
|
|
23
|
+
children: [
|
|
24
|
+
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "select-none text-right text-muted-foreground", children: [
|
|
25
|
+
isFocal ? ">" : "",
|
|
26
|
+
lineNumber
|
|
27
|
+
] }),
|
|
28
|
+
/* @__PURE__ */ jsxRuntime.jsx("code", { className: "whitespace-pre", children: source || " " })
|
|
29
|
+
]
|
|
30
|
+
},
|
|
31
|
+
`${lineNumber}-${i}`
|
|
32
|
+
);
|
|
33
|
+
}) });
|
|
34
|
+
}
|
|
35
|
+
exports.FrameSourceWindow = FrameSourceWindow;
|
|
36
|
+
exports.frameHasSource = frameHasSource;
|
|
37
|
+
//# sourceMappingURL=FrameSourceWindow.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FrameSourceWindow.cjs","sources":["../../../src/data/diagnostics/FrameSourceWindow.tsx"],"sourcesContent":["// FrameSourceWindow renders a decompiled / resolved source window beneath a\n// stack frame: a gutter of absolute line numbers with the focal line (the one\n// the frame points at) highlighted. It is the plain (non-Shiki) renderer shared\n// by the JVM thread-dump frames and the exception stack-trace frames so both\n// surfaces show inline source the same way.\n\nexport interface FrameSource {\n /** Source lines around the focal line. */\n sourceLines?: string[];\n /** Absolute line number for each entry in sourceLines (preferred gutter). */\n sourceLineNumbers?: number[];\n /** Line number of sourceLines[0] when sourceLineNumbers is absent. */\n sourceStartLine?: number;\n /** The frame's focal line, highlighted when it falls inside the window. */\n line?: number;\n}\n\nexport function frameHasSource(frame: FrameSource): boolean {\n return !!frame.sourceLines && frame.sourceLines.length > 0;\n}\n\nexport function FrameSourceWindow({ frame }: { frame: FrameSource }) {\n const lines = frame.sourceLines ?? [];\n if (lines.length === 0) return null;\n const start = frame.sourceStartLine ?? 0;\n const numbers = frame.sourceLineNumbers;\n const focal = frame.line ?? -1;\n\n return (\n <div className=\"mx-3 mb-2 ml-12 overflow-x-auto rounded border border-border/60 bg-muted/30 py-1 font-mono text-[11px] leading-relaxed\">\n {lines.map((source, i) => {\n const lineNumber = numbers?.[i] ?? start + i;\n const isFocal = lineNumber === focal;\n return (\n <div\n key={`${lineNumber}-${i}`}\n className={[\n \"grid min-w-max grid-cols-[3.5rem_minmax(24rem,1fr)] gap-3 px-2\",\n isFocal\n ? \"bg-red-500/10 font-semibold text-red-800 dark:text-red-300\"\n : \"text-foreground\",\n ].join(\" \")}\n >\n <span className=\"select-none text-right text-muted-foreground\">\n {isFocal ? \">\" : \"\"}\n {lineNumber}\n </span>\n <code className=\"whitespace-pre\">{source || \" \"}</code>\n </div>\n );\n })}\n </div>\n );\n}\n"],"names":["jsx","jsxs"],"mappings":";;;AAiBO,SAAS,eAAe,OAA6B;AAC1D,SAAO,CAAC,CAAC,MAAM,eAAe,MAAM,YAAY,SAAS;AAC3D;AAEO,SAAS,kBAAkB,EAAE,SAAiC;AACnE,QAAM,QAAQ,MAAM,eAAe,CAAA;AACnC,MAAI,MAAM,WAAW,EAAG,QAAO;AAC/B,QAAM,QAAQ,MAAM,mBAAmB;AACvC,QAAM,UAAU,MAAM;AACtB,QAAM,QAAQ,MAAM,QAAQ;AAE5B,SACEA,+BAAC,SAAI,WAAU,0HACZ,gBAAM,IAAI,CAAC,QAAQ,MAAM;AACxB,UAAM,cAAa,mCAAU,OAAM,QAAQ;AAC3C,UAAM,UAAU,eAAe;AAC/B,WACEC,2BAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QAEC,WAAW;AAAA,UACT;AAAA,UACA,UACI,+DACA;AAAA,QAAA,EACJ,KAAK,GAAG;AAAA,QAEV,UAAA;AAAA,UAAAA,2BAAAA,KAAC,QAAA,EAAK,WAAU,gDACb,UAAA;AAAA,YAAA,UAAU,MAAM;AAAA,YAChB;AAAA,UAAA,GACH;AAAA,UACAD,2BAAAA,IAAC,QAAA,EAAK,WAAU,kBAAkB,oBAAU,IAAA,CAAI;AAAA,QAAA;AAAA,MAAA;AAAA,MAZ3C,GAAG,UAAU,IAAI,CAAC;AAAA,IAAA;AAAA,EAe7B,CAAC,EAAA,CACH;AAEJ;;;"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface FrameSource {
|
|
2
|
+
/** Source lines around the focal line. */
|
|
3
|
+
sourceLines?: string[];
|
|
4
|
+
/** Absolute line number for each entry in sourceLines (preferred gutter). */
|
|
5
|
+
sourceLineNumbers?: number[];
|
|
6
|
+
/** Line number of sourceLines[0] when sourceLineNumbers is absent. */
|
|
7
|
+
sourceStartLine?: number;
|
|
8
|
+
/** The frame's focal line, highlighted when it falls inside the window. */
|
|
9
|
+
line?: number;
|
|
10
|
+
}
|
|
11
|
+
export declare function frameHasSource(frame: FrameSource): boolean;
|
|
12
|
+
export declare function FrameSourceWindow({ frame }: {
|
|
13
|
+
frame: FrameSource;
|
|
14
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
15
|
+
//# sourceMappingURL=FrameSourceWindow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FrameSourceWindow.d.ts","sourceRoot":"","sources":["../../../src/data/diagnostics/FrameSourceWindow.tsx"],"names":[],"mappings":"AAMA,MAAM,WAAW,WAAW;IAC1B,0CAA0C;IAC1C,WAAW,CAAC,EAAE,MAAM,EAAE,CAAC;IACvB,6EAA6E;IAC7E,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAC7B,sEAAsE;IACtE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,2EAA2E;IAC3E,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,WAAW,GAAG,OAAO,CAE1D;AAED,wBAAgB,iBAAiB,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAAE,WAAW,CAAA;CAAE,kDAgClE"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
function frameHasSource(frame) {
|
|
3
|
+
return !!frame.sourceLines && frame.sourceLines.length > 0;
|
|
4
|
+
}
|
|
5
|
+
function FrameSourceWindow({ frame }) {
|
|
6
|
+
const lines = frame.sourceLines ?? [];
|
|
7
|
+
if (lines.length === 0) return null;
|
|
8
|
+
const start = frame.sourceStartLine ?? 0;
|
|
9
|
+
const numbers = frame.sourceLineNumbers;
|
|
10
|
+
const focal = frame.line ?? -1;
|
|
11
|
+
return /* @__PURE__ */ jsx("div", { className: "mx-3 mb-2 ml-12 overflow-x-auto rounded border border-border/60 bg-muted/30 py-1 font-mono text-[11px] leading-relaxed", children: lines.map((source, i) => {
|
|
12
|
+
const lineNumber = (numbers == null ? void 0 : numbers[i]) ?? start + i;
|
|
13
|
+
const isFocal = lineNumber === focal;
|
|
14
|
+
return /* @__PURE__ */ jsxs(
|
|
15
|
+
"div",
|
|
16
|
+
{
|
|
17
|
+
className: [
|
|
18
|
+
"grid min-w-max grid-cols-[3.5rem_minmax(24rem,1fr)] gap-3 px-2",
|
|
19
|
+
isFocal ? "bg-red-500/10 font-semibold text-red-800 dark:text-red-300" : "text-foreground"
|
|
20
|
+
].join(" "),
|
|
21
|
+
children: [
|
|
22
|
+
/* @__PURE__ */ jsxs("span", { className: "select-none text-right text-muted-foreground", children: [
|
|
23
|
+
isFocal ? ">" : "",
|
|
24
|
+
lineNumber
|
|
25
|
+
] }),
|
|
26
|
+
/* @__PURE__ */ jsx("code", { className: "whitespace-pre", children: source || " " })
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
`${lineNumber}-${i}`
|
|
30
|
+
);
|
|
31
|
+
}) });
|
|
32
|
+
}
|
|
33
|
+
export {
|
|
34
|
+
FrameSourceWindow,
|
|
35
|
+
frameHasSource
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=FrameSourceWindow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FrameSourceWindow.js","sources":["../../../src/data/diagnostics/FrameSourceWindow.tsx"],"sourcesContent":["// FrameSourceWindow renders a decompiled / resolved source window beneath a\n// stack frame: a gutter of absolute line numbers with the focal line (the one\n// the frame points at) highlighted. It is the plain (non-Shiki) renderer shared\n// by the JVM thread-dump frames and the exception stack-trace frames so both\n// surfaces show inline source the same way.\n\nexport interface FrameSource {\n /** Source lines around the focal line. */\n sourceLines?: string[];\n /** Absolute line number for each entry in sourceLines (preferred gutter). */\n sourceLineNumbers?: number[];\n /** Line number of sourceLines[0] when sourceLineNumbers is absent. */\n sourceStartLine?: number;\n /** The frame's focal line, highlighted when it falls inside the window. */\n line?: number;\n}\n\nexport function frameHasSource(frame: FrameSource): boolean {\n return !!frame.sourceLines && frame.sourceLines.length > 0;\n}\n\nexport function FrameSourceWindow({ frame }: { frame: FrameSource }) {\n const lines = frame.sourceLines ?? [];\n if (lines.length === 0) return null;\n const start = frame.sourceStartLine ?? 0;\n const numbers = frame.sourceLineNumbers;\n const focal = frame.line ?? -1;\n\n return (\n <div className=\"mx-3 mb-2 ml-12 overflow-x-auto rounded border border-border/60 bg-muted/30 py-1 font-mono text-[11px] leading-relaxed\">\n {lines.map((source, i) => {\n const lineNumber = numbers?.[i] ?? start + i;\n const isFocal = lineNumber === focal;\n return (\n <div\n key={`${lineNumber}-${i}`}\n className={[\n \"grid min-w-max grid-cols-[3.5rem_minmax(24rem,1fr)] gap-3 px-2\",\n isFocal\n ? \"bg-red-500/10 font-semibold text-red-800 dark:text-red-300\"\n : \"text-foreground\",\n ].join(\" \")}\n >\n <span className=\"select-none text-right text-muted-foreground\">\n {isFocal ? \">\" : \"\"}\n {lineNumber}\n </span>\n <code className=\"whitespace-pre\">{source || \" \"}</code>\n </div>\n );\n })}\n </div>\n );\n}\n"],"names":[],"mappings":";AAiBO,SAAS,eAAe,OAA6B;AAC1D,SAAO,CAAC,CAAC,MAAM,eAAe,MAAM,YAAY,SAAS;AAC3D;AAEO,SAAS,kBAAkB,EAAE,SAAiC;AACnE,QAAM,QAAQ,MAAM,eAAe,CAAA;AACnC,MAAI,MAAM,WAAW,EAAG,QAAO;AAC/B,QAAM,QAAQ,MAAM,mBAAmB;AACvC,QAAM,UAAU,MAAM;AACtB,QAAM,QAAQ,MAAM,QAAQ;AAE5B,SACE,oBAAC,SAAI,WAAU,0HACZ,gBAAM,IAAI,CAAC,QAAQ,MAAM;AACxB,UAAM,cAAa,mCAAU,OAAM,QAAQ;AAC3C,UAAM,UAAU,eAAe;AAC/B,WACE;AAAA,MAAC;AAAA,MAAA;AAAA,QAEC,WAAW;AAAA,UACT;AAAA,UACA,UACI,+DACA;AAAA,QAAA,EACJ,KAAK,GAAG;AAAA,QAEV,UAAA;AAAA,UAAA,qBAAC,QAAA,EAAK,WAAU,gDACb,UAAA;AAAA,YAAA,UAAU,MAAM;AAAA,YAChB;AAAA,UAAA,GACH;AAAA,UACA,oBAAC,QAAA,EAAK,WAAU,kBAAkB,oBAAU,IAAA,CAAI;AAAA,QAAA;AAAA,MAAA;AAAA,MAZ3C,GAAG,UAAU,IAAI,CAAC;AAAA,IAAA;AAAA,EAe7B,CAAC,EAAA,CACH;AAEJ;"}
|
|
@@ -2,30 +2,43 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const Icon = require("../Icon.cjs");
|
|
5
|
+
const FrameSourceWindow = require("./FrameSourceWindow.cjs");
|
|
5
6
|
const UiLock = require("../../icons/components/UiLock.cjs");
|
|
6
7
|
const UiSync = require("../../icons/components/UiSync.cjs");
|
|
7
8
|
const UiWatch = require("../../icons/components/UiWatch.cjs");
|
|
8
9
|
const UiChip = require("../../icons/components/UiChip.cjs");
|
|
9
10
|
const UiDebugStepOver = require("../../icons/components/UiDebugStepOver.cjs");
|
|
10
11
|
const UiMethod = require("../../icons/components/UiMethod.cjs");
|
|
11
|
-
function JvmStackTrace({
|
|
12
|
+
function JvmStackTrace({
|
|
13
|
+
frames,
|
|
14
|
+
hideRuntimeOnly = false,
|
|
15
|
+
className,
|
|
16
|
+
resolveSource
|
|
17
|
+
}) {
|
|
12
18
|
const visibleFrames = hideRuntimeOnly ? frames.filter((frame) => frame.kind !== "frame" || !frame.runtime) : frames;
|
|
13
19
|
if (visibleFrames.length === 0) return null;
|
|
14
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className, children: visibleFrames.map((frame, index) =>
|
|
20
|
+
return /* @__PURE__ */ jsxRuntime.jsx("div", { className, children: visibleFrames.map((frame, index) => {
|
|
21
|
+
const resolved = resolveSource == null ? void 0 : resolveSource(frame);
|
|
22
|
+
const withSource = resolved ? { ...frame, ...resolved } : frame;
|
|
23
|
+
return /* @__PURE__ */ jsxRuntime.jsx(JvmStackFrameRow, { frame: withSource }, `${frame.functionName}-${index}`);
|
|
24
|
+
}) });
|
|
15
25
|
}
|
|
16
26
|
function JvmStackFrameRow({ frame }) {
|
|
17
27
|
const isAnno = frame.kind !== "frame";
|
|
18
28
|
const icon = isAnno ? frame.kind === "locked" ? UiLock.UiLock : frame.kind === "waiting_to_lock" ? UiSync.UiSync : UiWatch.UiWatch : frame.nativeMethod ? UiChip.UiChip : frame.runtime ? UiDebugStepOver.UiDebugStepOver : UiMethod.UiMethod;
|
|
19
|
-
return /* @__PURE__ */ jsxRuntime.
|
|
20
|
-
/* @__PURE__ */ jsxRuntime.
|
|
21
|
-
|
|
22
|
-
/* @__PURE__ */ jsxRuntime.jsx("
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: frame.runtime ? "text-muted-foreground" : "text-foreground", children: [
|
|
30
|
+
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-1.5", children: [
|
|
31
|
+
/* @__PURE__ */ jsxRuntime.jsx(Icon.Icon, { icon, className: "mt-0.5 shrink-0 text-[11px]" }),
|
|
32
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "min-w-0", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "break-all font-mono text-[11px] font-semibold leading-4", children: isAnno ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
33
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "opacity-70", children: frame.functionName }),
|
|
34
|
+
frame.annotationText && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-2 font-normal opacity-80", children: frame.annotationText })
|
|
35
|
+
] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
36
|
+
frame.displayName,
|
|
37
|
+
frame.location && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "ml-2 text-[10px] font-normal opacity-80", children: frame.location })
|
|
38
|
+
] }) }) })
|
|
39
|
+
] }),
|
|
40
|
+
!isAnno && FrameSourceWindow.frameHasSource(frame) && /* @__PURE__ */ jsxRuntime.jsx(FrameSourceWindow.FrameSourceWindow, { frame })
|
|
41
|
+
] });
|
|
29
42
|
}
|
|
30
43
|
exports.JvmStackFrameRow = JvmStackFrameRow;
|
|
31
44
|
exports.JvmStackTrace = JvmStackTrace;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JvmStackTrace.cjs","sources":["../../../src/data/diagnostics/JvmStackTrace.tsx"],"sourcesContent":["import { Icon } from \"../Icon\";\nimport { UiChip, UiDebugStepOver, UiLock, UiSync, UiMethod, UiWatch } from \"../../icons\";\nimport type { ParsedThreadFrame } from \"./jvm-stacktrace\";\n\nexport type JvmStackTraceProps = {\n frames: ParsedThreadFrame[];\n hideRuntimeOnly?: boolean;\n className?: string;\n};\n\nexport function JvmStackTrace({
|
|
1
|
+
{"version":3,"file":"JvmStackTrace.cjs","sources":["../../../src/data/diagnostics/JvmStackTrace.tsx"],"sourcesContent":["import { Icon } from \"../Icon\";\nimport { UiChip, UiDebugStepOver, UiLock, UiSync, UiMethod, UiWatch } from \"../../icons\";\nimport type { ParsedThreadFrame } from \"./jvm-stacktrace\";\nimport { FrameSourceWindow, frameHasSource } from \"./FrameSourceWindow\";\n\n// JvmFrameSourceResolver returns a source window for a frame, or undefined when\n// no source is available (a missing class must never blank out the frame). Used\n// to augment the rendered thread dump with decompiled source in place.\nexport type JvmFrameSourceResolver = (frame: ParsedThreadFrame) =>\n | { sourceLines: string[]; sourceLineNumbers?: number[]; sourceStartLine?: number }\n | undefined;\n\nexport type JvmStackTraceProps = {\n frames: ParsedThreadFrame[];\n hideRuntimeOnly?: boolean;\n className?: string;\n /** Optional resolver that supplies inline source under each frame. */\n resolveSource?: JvmFrameSourceResolver;\n};\n\nexport function JvmStackTrace({\n frames,\n hideRuntimeOnly = false,\n className,\n resolveSource,\n}: JvmStackTraceProps) {\n const visibleFrames = hideRuntimeOnly\n ? frames.filter((frame) => frame.kind !== \"frame\" || !frame.runtime)\n : frames;\n\n if (visibleFrames.length === 0) return null;\n\n return (\n <div className={className}>\n {visibleFrames.map((frame, index) => {\n const resolved = resolveSource?.(frame);\n const withSource = resolved ? { ...frame, ...resolved } : frame;\n return (\n <JvmStackFrameRow key={`${frame.functionName}-${index}`} frame={withSource} />\n );\n })}\n </div>\n );\n}\n\nexport function JvmStackFrameRow({ frame }: { frame: ParsedThreadFrame }) {\n const isAnno = frame.kind !== \"frame\";\n const icon = isAnno\n ? frame.kind === \"locked\"\n ? UiLock\n : frame.kind === \"waiting_to_lock\"\n ? UiSync\n : UiWatch\n : frame.nativeMethod\n ? UiChip\n : frame.runtime\n ? UiDebugStepOver\n : UiMethod;\n\n return (\n <div className={frame.runtime ? \"text-muted-foreground\" : \"text-foreground\"}>\n <div className=\"flex items-start gap-1.5\">\n <Icon icon={icon} className=\"mt-0.5 shrink-0 text-[11px]\" />\n <div className=\"min-w-0\">\n <div className=\"break-all font-mono text-[11px] font-semibold leading-4\">\n {isAnno ? (\n <>\n <span className=\"opacity-70\">{frame.functionName}</span>\n {frame.annotationText && (\n <span className=\"ml-2 font-normal opacity-80\">{frame.annotationText}</span>\n )}\n </>\n ) : (\n <>\n {frame.displayName}\n {frame.location && (\n <span className=\"ml-2 text-[10px] font-normal opacity-80\">{frame.location}</span>\n )}\n </>\n )}\n </div>\n </div>\n </div>\n {!isAnno && frameHasSource(frame) && <FrameSourceWindow frame={frame} />}\n </div>\n );\n}\n"],"names":["jsx","UiLock","UiSync","UiWatch","UiChip","UiDebugStepOver","UiMethod","jsxs","Icon","Fragment","frameHasSource","FrameSourceWindow"],"mappings":";;;;;;;;;;;AAoBO,SAAS,cAAc;AAAA,EAC5B;AAAA,EACA,kBAAkB;AAAA,EAClB;AAAA,EACA;AACF,GAAuB;AACrB,QAAM,gBAAgB,kBAClB,OAAO,OAAO,CAAC,UAAU,MAAM,SAAS,WAAW,CAAC,MAAM,OAAO,IACjE;AAEJ,MAAI,cAAc,WAAW,EAAG,QAAO;AAEvC,wCACG,OAAA,EAAI,WACF,wBAAc,IAAI,CAAC,OAAO,UAAU;AACnC,UAAM,WAAW,+CAAgB;AAC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+1,17 @@
|
|
|
1
1
|
import { ParsedThreadFrame } from './jvm-stacktrace';
|
|
2
|
+
export type JvmFrameSourceResolver = (frame: ParsedThreadFrame) => {
|
|
3
|
+
sourceLines: string[];
|
|
4
|
+
sourceLineNumbers?: number[];
|
|
5
|
+
sourceStartLine?: number;
|
|
6
|
+
} | undefined;
|
|
2
7
|
export type JvmStackTraceProps = {
|
|
3
8
|
frames: ParsedThreadFrame[];
|
|
4
9
|
hideRuntimeOnly?: boolean;
|
|
5
10
|
className?: string;
|
|
11
|
+
/** Optional resolver that supplies inline source under each frame. */
|
|
12
|
+
resolveSource?: JvmFrameSourceResolver;
|
|
6
13
|
};
|
|
7
|
-
export declare function JvmStackTrace({ frames, hideRuntimeOnly, className }: JvmStackTraceProps): import("react/jsx-runtime").JSX.Element | null;
|
|
14
|
+
export declare function JvmStackTrace({ frames, hideRuntimeOnly, className, resolveSource, }: JvmStackTraceProps): import("react/jsx-runtime").JSX.Element | null;
|
|
8
15
|
export declare function JvmStackFrameRow({ frame }: {
|
|
9
16
|
frame: ParsedThreadFrame;
|
|
10
17
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JvmStackTrace.d.ts","sourceRoot":"","sources":["../../../src/data/diagnostics/JvmStackTrace.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"JvmStackTrace.d.ts","sourceRoot":"","sources":["../../../src/data/diagnostics/JvmStackTrace.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAM1D,MAAM,MAAM,sBAAsB,GAAG,CAAC,KAAK,EAAE,iBAAiB,KAC1D;IAAE,WAAW,EAAE,MAAM,EAAE,CAAC;IAAC,iBAAiB,CAAC,EAAE,MAAM,EAAE,CAAC;IAAC,eAAe,CAAC,EAAE,MAAM,CAAA;CAAE,GACjF,SAAS,CAAC;AAEd,MAAM,MAAM,kBAAkB,GAAG;IAC/B,MAAM,EAAE,iBAAiB,EAAE,CAAC;IAC5B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,sEAAsE;IACtE,aAAa,CAAC,EAAE,sBAAsB,CAAC;CACxC,CAAC;AAEF,wBAAgB,aAAa,CAAC,EAC5B,MAAM,EACN,eAAuB,EACvB,SAAS,EACT,aAAa,GACd,EAAE,kBAAkB,kDAkBpB;AAED,wBAAgB,gBAAgB,CAAC,EAAE,KAAK,EAAE,EAAE;IAAE,KAAK,EAAE,iBAAiB,CAAA;CAAE,2CAyCvE"}
|
|
@@ -1,29 +1,42 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { Icon } from "../Icon.js";
|
|
3
|
+
import { frameHasSource, FrameSourceWindow } from "./FrameSourceWindow.js";
|
|
3
4
|
import { UiLock } from "../../icons/components/UiLock.js";
|
|
4
5
|
import { UiSync } from "../../icons/components/UiSync.js";
|
|
5
6
|
import { UiWatch } from "../../icons/components/UiWatch.js";
|
|
6
7
|
import { UiChip } from "../../icons/components/UiChip.js";
|
|
7
8
|
import { UiDebugStepOver } from "../../icons/components/UiDebugStepOver.js";
|
|
8
9
|
import { UiMethod } from "../../icons/components/UiMethod.js";
|
|
9
|
-
function JvmStackTrace({
|
|
10
|
+
function JvmStackTrace({
|
|
11
|
+
frames,
|
|
12
|
+
hideRuntimeOnly = false,
|
|
13
|
+
className,
|
|
14
|
+
resolveSource
|
|
15
|
+
}) {
|
|
10
16
|
const visibleFrames = hideRuntimeOnly ? frames.filter((frame) => frame.kind !== "frame" || !frame.runtime) : frames;
|
|
11
17
|
if (visibleFrames.length === 0) return null;
|
|
12
|
-
return /* @__PURE__ */ jsx("div", { className, children: visibleFrames.map((frame, index) =>
|
|
18
|
+
return /* @__PURE__ */ jsx("div", { className, children: visibleFrames.map((frame, index) => {
|
|
19
|
+
const resolved = resolveSource == null ? void 0 : resolveSource(frame);
|
|
20
|
+
const withSource = resolved ? { ...frame, ...resolved } : frame;
|
|
21
|
+
return /* @__PURE__ */ jsx(JvmStackFrameRow, { frame: withSource }, `${frame.functionName}-${index}`);
|
|
22
|
+
}) });
|
|
13
23
|
}
|
|
14
24
|
function JvmStackFrameRow({ frame }) {
|
|
15
25
|
const isAnno = frame.kind !== "frame";
|
|
16
26
|
const icon = isAnno ? frame.kind === "locked" ? UiLock : frame.kind === "waiting_to_lock" ? UiSync : UiWatch : frame.nativeMethod ? UiChip : frame.runtime ? UiDebugStepOver : UiMethod;
|
|
17
|
-
return /* @__PURE__ */
|
|
18
|
-
/* @__PURE__ */
|
|
19
|
-
|
|
20
|
-
/* @__PURE__ */ jsx("
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
return /* @__PURE__ */ jsxs("div", { className: frame.runtime ? "text-muted-foreground" : "text-foreground", children: [
|
|
28
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-start gap-1.5", children: [
|
|
29
|
+
/* @__PURE__ */ jsx(Icon, { icon, className: "mt-0.5 shrink-0 text-[11px]" }),
|
|
30
|
+
/* @__PURE__ */ jsx("div", { className: "min-w-0", children: /* @__PURE__ */ jsx("div", { className: "break-all font-mono text-[11px] font-semibold leading-4", children: isAnno ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
31
|
+
/* @__PURE__ */ jsx("span", { className: "opacity-70", children: frame.functionName }),
|
|
32
|
+
frame.annotationText && /* @__PURE__ */ jsx("span", { className: "ml-2 font-normal opacity-80", children: frame.annotationText })
|
|
33
|
+
] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
34
|
+
frame.displayName,
|
|
35
|
+
frame.location && /* @__PURE__ */ jsx("span", { className: "ml-2 text-[10px] font-normal opacity-80", children: frame.location })
|
|
36
|
+
] }) }) })
|
|
37
|
+
] }),
|
|
38
|
+
!isAnno && frameHasSource(frame) && /* @__PURE__ */ jsx(FrameSourceWindow, { frame })
|
|
39
|
+
] });
|
|
27
40
|
}
|
|
28
41
|
export {
|
|
29
42
|
JvmStackFrameRow,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"JvmStackTrace.js","sources":["../../../src/data/diagnostics/JvmStackTrace.tsx"],"sourcesContent":["import { Icon } from \"../Icon\";\nimport { UiChip, UiDebugStepOver, UiLock, UiSync, UiMethod, UiWatch } from \"../../icons\";\nimport type { ParsedThreadFrame } from \"./jvm-stacktrace\";\n\nexport type JvmStackTraceProps = {\n frames: ParsedThreadFrame[];\n hideRuntimeOnly?: boolean;\n className?: string;\n};\n\nexport function JvmStackTrace({
|
|
1
|
+
{"version":3,"file":"JvmStackTrace.js","sources":["../../../src/data/diagnostics/JvmStackTrace.tsx"],"sourcesContent":["import { Icon } from \"../Icon\";\nimport { UiChip, UiDebugStepOver, UiLock, UiSync, UiMethod, UiWatch } from \"../../icons\";\nimport type { ParsedThreadFrame } from \"./jvm-stacktrace\";\nimport { FrameSourceWindow, frameHasSource } from \"./FrameSourceWindow\";\n\n// JvmFrameSourceResolver returns a source window for a frame, or undefined when\n// no source is available (a missing class must never blank out the frame). Used\n// to augment the rendered thread dump with decompiled source in place.\nexport type JvmFrameSourceResolver = (frame: ParsedThreadFrame) =>\n | { sourceLines: string[]; sourceLineNumbers?: number[]; sourceStartLine?: number }\n | undefined;\n\nexport type JvmStackTraceProps = {\n frames: ParsedThreadFrame[];\n hideRuntimeOnly?: boolean;\n className?: string;\n /** Optional resolver that supplies inline source under each frame. */\n resolveSource?: JvmFrameSourceResolver;\n};\n\nexport function JvmStackTrace({\n frames,\n hideRuntimeOnly = false,\n className,\n resolveSource,\n}: JvmStackTraceProps) {\n const visibleFrames = hideRuntimeOnly\n ? frames.filter((frame) => frame.kind !== \"frame\" || !frame.runtime)\n : frames;\n\n if (visibleFrames.length === 0) return null;\n\n return (\n <div className={className}>\n {visibleFrames.map((frame, index) => {\n const resolved = resolveSource?.(frame);\n const withSource = resolved ? { ...frame, ...resolved } : frame;\n return (\n <JvmStackFrameRow key={`${frame.functionName}-${index}`} frame={withSource} />\n );\n })}\n </div>\n );\n}\n\nexport function JvmStackFrameRow({ frame }: { frame: ParsedThreadFrame }) {\n const isAnno = frame.kind !== \"frame\";\n const icon = isAnno\n ? frame.kind === \"locked\"\n ? UiLock\n : frame.kind === \"waiting_to_lock\"\n ? UiSync\n : UiWatch\n : frame.nativeMethod\n ? UiChip\n : frame.runtime\n ? UiDebugStepOver\n : UiMethod;\n\n return (\n <div className={frame.runtime ? \"text-muted-foreground\" : \"text-foreground\"}>\n <div className=\"flex items-start gap-1.5\">\n <Icon icon={icon} className=\"mt-0.5 shrink-0 text-[11px]\" />\n <div className=\"min-w-0\">\n <div className=\"break-all font-mono text-[11px] font-semibold leading-4\">\n {isAnno ? (\n <>\n <span className=\"opacity-70\">{frame.functionName}</span>\n {frame.annotationText && (\n <span className=\"ml-2 font-normal opacity-80\">{frame.annotationText}</span>\n )}\n </>\n ) : (\n <>\n {frame.displayName}\n {frame.location && (\n <span className=\"ml-2 text-[10px] font-normal opacity-80\">{frame.location}</span>\n )}\n </>\n )}\n </div>\n </div>\n </div>\n {!isAnno && frameHasSource(frame) && <FrameSourceWindow frame={frame} />}\n </div>\n );\n}\n"],"names":[],"mappings":";;;;;;;;;AAoBO,SAAS,cAAc;AAAA,EAC5B;AAAA,EACA,kBAAkB;AAAA,EAClB;AAAA,EACA;AACF,GAAuB;AACrB,QAAM,gBAAgB,kBAClB,OAAO,OAAO,CAAC,UAAU,MAAM,SAAS,WAAW,CAAC,MAAM,OAAO,IACjE;AAEJ,MAAI,cAAc,WAAW,EAAG,QAAO;AAEvC,6BACG,OAAA,EAAI,WACF,wBAAc,IAAI,CAAC,OAAO,UAAU;AACnC,UAAM,WAAW,+CAAgB;AACjC,UAAM,aAAa,WAAW,EAAE,GAAG,OAAO,GAAG,aAAa;AAC1D,WACE,oBAAC,oBAAwD,OAAO,WAAA,GAAzC,GAAG,MAAM,YAAY,IAAI,KAAK,EAAuB;AAAA,EAEhF,CAAC,EAAA,CACH;AAEJ;AAEO,SAAS,iBAAiB,EAAE,SAAuC;AACxE,QAAM,SAAS,MAAM,SAAS;AAC9B,QAAM,OAAO,SACT,MAAM,SAAS,WACb,SACA,MAAM,SAAS,oBACb,SACA,UACJ,MAAM,eACJ,SACA,MAAM,UACJ,kBACA;AAER,8BACG,OAAA,EAAI,WAAW,MAAM,UAAU,0BAA0B,mBACxD,UAAA;AAAA,IAAA,qBAAC,OAAA,EAAI,WAAU,4BACb,UAAA;AAAA,MAAA,oBAAC,MAAA,EAAK,MAAY,WAAU,8BAAA,CAA8B;AAAA,MAC1D,oBAAC,SAAI,WAAU,WACb,8BAAC,OAAA,EAAI,WAAU,2DACZ,UAAA,SACC,qBAAA,UAAA,EACE,UAAA;AAAA,QAAA,oBAAC,QAAA,EAAK,WAAU,cAAc,UAAA,MAAM,cAAa;AAAA,QAChD,MAAM,kBACL,oBAAC,UAAK,WAAU,+BAA+B,gBAAM,eAAA,CAAe;AAAA,MAAA,EAAA,CAExE,IAEA,qBAAA,UAAA,EACG,UAAA;AAAA,QAAA,MAAM;AAAA,QACN,MAAM,YACL,oBAAC,UAAK,WAAU,2CAA2C,gBAAM,SAAA,CAAS;AAAA,MAAA,EAAA,CAE9E,GAEJ,EAAA,CACF;AAAA,IAAA,GACF;AAAA,IACC,CAAC,UAAU,eAAe,KAAK,KAAK,oBAAC,qBAAkB,MAAA,CAAc;AAAA,EAAA,GACxE;AAEJ;"}
|
|
@@ -36,7 +36,7 @@ function threadStateDot(state) {
|
|
|
36
36
|
return "bg-muted-foreground/40";
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
function ThreadCard({ thread, search, hideRuntimeOnly }) {
|
|
39
|
+
function ThreadCard({ thread, search, hideRuntimeOnly, resolveSource }) {
|
|
40
40
|
const frames = hideRuntimeOnly ? thread.frames.filter((f) => f.kind !== "frame" || !f.runtime) : thread.frames;
|
|
41
41
|
const defaultOpen = thread.state === "runnable" || thread.state === "blocked" || !!search;
|
|
42
42
|
return /* @__PURE__ */ jsxRuntime.jsxs("details", { className: "border-0 bg-transparent", open: defaultOpen, children: [
|
|
@@ -69,7 +69,14 @@ function ThreadCard({ thread, search, hideRuntimeOnly }) {
|
|
|
69
69
|
] }),
|
|
70
70
|
thread.topFunction && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-[11px] text-muted-foreground", children: thread.topFunction })
|
|
71
71
|
] }) }),
|
|
72
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
72
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
73
|
+
JvmStackTrace.JvmStackTrace,
|
|
74
|
+
{
|
|
75
|
+
frames,
|
|
76
|
+
className: "space-y-0.5 py-1 pl-3",
|
|
77
|
+
...resolveSource ? { resolveSource } : {}
|
|
78
|
+
}
|
|
79
|
+
)
|
|
73
80
|
] });
|
|
74
81
|
}
|
|
75
82
|
exports.ThreadCard = ThreadCard;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThreadCard.cjs","sources":["../../../src/data/diagnostics/ThreadCard.tsx"],"sourcesContent":["import { JvmStackTrace } from \"./JvmStackTrace\";\nimport type { ParsedThread } from \"./jvm-stacktrace\";\n\nexport function threadStateBadge(state: string): string {\n switch (state) {\n case \"runnable\":\n return \"bg-green-50 text-green-700 dark:bg-green-500/20 dark:text-green-300\";\n case \"blocked\":\n return \"bg-red-50 text-red-700 dark:bg-red-500/20 dark:text-red-300\";\n case \"waiting\":\n case \"timed_waiting\":\n return \"bg-blue-50 text-blue-700 dark:bg-blue-500/20 dark:text-blue-300\";\n case \"new\":\n return \"bg-amber-50 text-amber-700 dark:bg-amber-500/20 dark:text-amber-300\";\n case \"terminated\":\n return \"bg-muted text-muted-foreground\";\n default:\n return \"bg-muted text-muted-foreground\";\n }\n}\n\nexport function threadStateDot(state: string): string {\n switch (state) {\n case \"runnable\":\n return \"bg-green-500\";\n case \"blocked\":\n return \"bg-red-500\";\n case \"waiting\":\n case \"timed_waiting\":\n return \"bg-blue-500\";\n case \"new\":\n return \"bg-amber-500\";\n case \"terminated\":\n return \"bg-muted-foreground/40\";\n default:\n return \"bg-muted-foreground/40\";\n }\n}\n\nexport type ThreadCardProps = {\n thread: ParsedThread;\n search: string;\n hideRuntimeOnly: boolean;\n};\n\nexport function ThreadCard({ thread, search, hideRuntimeOnly }: ThreadCardProps) {\n const frames = hideRuntimeOnly\n ? thread.frames.filter((f) => f.kind !== \"frame\" || !f.runtime)\n : thread.frames;\n const defaultOpen = thread.state === \"runnable\" || thread.state === \"blocked\" || !!search;\n\n return (\n <details className=\"border-0 bg-transparent\" open={defaultOpen}>\n <summary className=\"cursor-pointer list-none px-0 py-1\">\n <div className=\"flex items-center gap-2 flex-wrap\">\n <span className=\"font-mono text-xs font-semibold text-foreground\">#{thread.id}</span>\n <span className=\"truncate font-mono text-xs text-foreground\">{thread.name}</span>\n <span\n className={`inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[11px] ${threadStateBadge(\n thread.state,\n )}`}\n >\n <span className={`h-2 w-2 rounded-full ${threadStateDot(thread.state)}`} />\n {thread.rawState || thread.state}\n </span>\n {thread.daemon && (\n <span className=\"rounded-full bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground\">\n daemon\n </span>\n )}\n <span className=\"text-[11px] text-muted-foreground\">{frames.length}f</span>\n {thread.userFrameCount > 0 && (\n <span className=\"text-[11px] text-muted-foreground\">{thread.userFrameCount}u</span>\n )}\n {thread.topFunction && (\n <span className=\"truncate text-[11px] text-muted-foreground\">{thread.topFunction}</span>\n )}\n </div>\n </summary>\n <JvmStackTrace
|
|
1
|
+
{"version":3,"file":"ThreadCard.cjs","sources":["../../../src/data/diagnostics/ThreadCard.tsx"],"sourcesContent":["import { JvmStackTrace, type JvmFrameSourceResolver } from \"./JvmStackTrace\";\nimport type { ParsedThread } from \"./jvm-stacktrace\";\n\nexport function threadStateBadge(state: string): string {\n switch (state) {\n case \"runnable\":\n return \"bg-green-50 text-green-700 dark:bg-green-500/20 dark:text-green-300\";\n case \"blocked\":\n return \"bg-red-50 text-red-700 dark:bg-red-500/20 dark:text-red-300\";\n case \"waiting\":\n case \"timed_waiting\":\n return \"bg-blue-50 text-blue-700 dark:bg-blue-500/20 dark:text-blue-300\";\n case \"new\":\n return \"bg-amber-50 text-amber-700 dark:bg-amber-500/20 dark:text-amber-300\";\n case \"terminated\":\n return \"bg-muted text-muted-foreground\";\n default:\n return \"bg-muted text-muted-foreground\";\n }\n}\n\nexport function threadStateDot(state: string): string {\n switch (state) {\n case \"runnable\":\n return \"bg-green-500\";\n case \"blocked\":\n return \"bg-red-500\";\n case \"waiting\":\n case \"timed_waiting\":\n return \"bg-blue-500\";\n case \"new\":\n return \"bg-amber-500\";\n case \"terminated\":\n return \"bg-muted-foreground/40\";\n default:\n return \"bg-muted-foreground/40\";\n }\n}\n\nexport type ThreadCardProps = {\n thread: ParsedThread;\n search: string;\n hideRuntimeOnly: boolean;\n resolveSource?: JvmFrameSourceResolver;\n};\n\nexport function ThreadCard({ thread, search, hideRuntimeOnly, resolveSource }: ThreadCardProps) {\n const frames = hideRuntimeOnly\n ? thread.frames.filter((f) => f.kind !== \"frame\" || !f.runtime)\n : thread.frames;\n const defaultOpen = thread.state === \"runnable\" || thread.state === \"blocked\" || !!search;\n\n return (\n <details className=\"border-0 bg-transparent\" open={defaultOpen}>\n <summary className=\"cursor-pointer list-none px-0 py-1\">\n <div className=\"flex items-center gap-2 flex-wrap\">\n <span className=\"font-mono text-xs font-semibold text-foreground\">#{thread.id}</span>\n <span className=\"truncate font-mono text-xs text-foreground\">{thread.name}</span>\n <span\n className={`inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[11px] ${threadStateBadge(\n thread.state,\n )}`}\n >\n <span className={`h-2 w-2 rounded-full ${threadStateDot(thread.state)}`} />\n {thread.rawState || thread.state}\n </span>\n {thread.daemon && (\n <span className=\"rounded-full bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground\">\n daemon\n </span>\n )}\n <span className=\"text-[11px] text-muted-foreground\">{frames.length}f</span>\n {thread.userFrameCount > 0 && (\n <span className=\"text-[11px] text-muted-foreground\">{thread.userFrameCount}u</span>\n )}\n {thread.topFunction && (\n <span className=\"truncate text-[11px] text-muted-foreground\">{thread.topFunction}</span>\n )}\n </div>\n </summary>\n <JvmStackTrace\n frames={frames}\n className=\"space-y-0.5 py-1 pl-3\"\n {...(resolveSource ? { resolveSource } : {})}\n />\n </details>\n );\n}\n"],"names":["jsxs","jsx","JvmStackTrace"],"mappings":";;;;AAGO,SAAS,iBAAiB,OAAuB;AACtD,UAAQ,OAAA;AAAA,IACN,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AAAA,IACL,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT;AACE,aAAO;AAAA,EAAA;AAEb;AAEO,SAAS,eAAe,OAAuB;AACpD,UAAQ,OAAA;AAAA,IACN,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AAAA,IACL,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT;AACE,aAAO;AAAA,EAAA;AAEb;AASO,SAAS,WAAW,EAAE,QAAQ,QAAQ,iBAAiB,iBAAkC;AAC9F,QAAM,SAAS,kBACX,OAAO,OAAO,OAAO,CAAC,MAAM,EAAE,SAAS,WAAW,CAAC,EAAE,OAAO,IAC5D,OAAO;AACX,QAAM,cAAc,OAAO,UAAU,cAAc,OAAO,UAAU,aAAa,CAAC,CAAC;AAEnF,SACEA,2BAAAA,KAAC,WAAA,EAAQ,WAAU,2BAA0B,MAAM,aACjD,UAAA;AAAA,IA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sedThread } from './jvm-stacktrace';
|
|
2
3
|
export declare function threadStateBadge(state: string): string;
|
|
3
4
|
export declare function threadStateDot(state: string): string;
|
|
@@ -5,6 +6,7 @@ export type ThreadCardProps = {
|
|
|
5
6
|
thread: ParsedThread;
|
|
6
7
|
search: string;
|
|
7
8
|
hideRuntimeOnly: boolean;
|
|
9
|
+
resolveSource?: JvmFrameSourceResolver;
|
|
8
10
|
};
|
|
9
|
-
export declare function ThreadCard({ thread, search, hideRuntimeOnly }: ThreadCardProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare function ThreadCard({ thread, search, hideRuntimeOnly, resolveSource }: ThreadCardProps): import("react/jsx-runtime").JSX.Element;
|
|
10
12
|
//# sourceMappingURL=ThreadCard.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThreadCard.d.ts","sourceRoot":"","sources":["../../../src/data/diagnostics/ThreadCard.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ThreadCard.d.ts","sourceRoot":"","sources":["../../../src/data/diagnostics/ThreadCard.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,KAAK,sBAAsB,EAAE,MAAM,iBAAiB,CAAC;AAC7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAgBtD;AAED,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAgBpD;AAED,MAAM,MAAM,eAAe,GAAG;IAC5B,MAAM,EAAE,YAAY,CAAC;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,eAAe,EAAE,OAAO,CAAC;IACzB,aAAa,CAAC,EAAE,sBAAsB,CAAC;CACxC,CAAC;AAEF,wBAAgB,UAAU,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,eAAe,EAAE,aAAa,EAAE,EAAE,eAAe,2CAyC7F"}
|
|
@@ -34,7 +34,7 @@ function threadStateDot(state) {
|
|
|
34
34
|
return "bg-muted-foreground/40";
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
|
-
function ThreadCard({ thread, search, hideRuntimeOnly }) {
|
|
37
|
+
function ThreadCard({ thread, search, hideRuntimeOnly, resolveSource }) {
|
|
38
38
|
const frames = hideRuntimeOnly ? thread.frames.filter((f) => f.kind !== "frame" || !f.runtime) : thread.frames;
|
|
39
39
|
const defaultOpen = thread.state === "runnable" || thread.state === "blocked" || !!search;
|
|
40
40
|
return /* @__PURE__ */ jsxs("details", { className: "border-0 bg-transparent", open: defaultOpen, children: [
|
|
@@ -67,7 +67,14 @@ function ThreadCard({ thread, search, hideRuntimeOnly }) {
|
|
|
67
67
|
] }),
|
|
68
68
|
thread.topFunction && /* @__PURE__ */ jsx("span", { className: "truncate text-[11px] text-muted-foreground", children: thread.topFunction })
|
|
69
69
|
] }) }),
|
|
70
|
-
/* @__PURE__ */ jsx(
|
|
70
|
+
/* @__PURE__ */ jsx(
|
|
71
|
+
JvmStackTrace,
|
|
72
|
+
{
|
|
73
|
+
frames,
|
|
74
|
+
className: "space-y-0.5 py-1 pl-3",
|
|
75
|
+
...resolveSource ? { resolveSource } : {}
|
|
76
|
+
}
|
|
77
|
+
)
|
|
71
78
|
] });
|
|
72
79
|
}
|
|
73
80
|
export {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThreadCard.js","sources":["../../../src/data/diagnostics/ThreadCard.tsx"],"sourcesContent":["import { JvmStackTrace } from \"./JvmStackTrace\";\nimport type { ParsedThread } from \"./jvm-stacktrace\";\n\nexport function threadStateBadge(state: string): string {\n switch (state) {\n case \"runnable\":\n return \"bg-green-50 text-green-700 dark:bg-green-500/20 dark:text-green-300\";\n case \"blocked\":\n return \"bg-red-50 text-red-700 dark:bg-red-500/20 dark:text-red-300\";\n case \"waiting\":\n case \"timed_waiting\":\n return \"bg-blue-50 text-blue-700 dark:bg-blue-500/20 dark:text-blue-300\";\n case \"new\":\n return \"bg-amber-50 text-amber-700 dark:bg-amber-500/20 dark:text-amber-300\";\n case \"terminated\":\n return \"bg-muted text-muted-foreground\";\n default:\n return \"bg-muted text-muted-foreground\";\n }\n}\n\nexport function threadStateDot(state: string): string {\n switch (state) {\n case \"runnable\":\n return \"bg-green-500\";\n case \"blocked\":\n return \"bg-red-500\";\n case \"waiting\":\n case \"timed_waiting\":\n return \"bg-blue-500\";\n case \"new\":\n return \"bg-amber-500\";\n case \"terminated\":\n return \"bg-muted-foreground/40\";\n default:\n return \"bg-muted-foreground/40\";\n }\n}\n\nexport type ThreadCardProps = {\n thread: ParsedThread;\n search: string;\n hideRuntimeOnly: boolean;\n};\n\nexport function ThreadCard({ thread, search, hideRuntimeOnly }: ThreadCardProps) {\n const frames = hideRuntimeOnly\n ? thread.frames.filter((f) => f.kind !== \"frame\" || !f.runtime)\n : thread.frames;\n const defaultOpen = thread.state === \"runnable\" || thread.state === \"blocked\" || !!search;\n\n return (\n <details className=\"border-0 bg-transparent\" open={defaultOpen}>\n <summary className=\"cursor-pointer list-none px-0 py-1\">\n <div className=\"flex items-center gap-2 flex-wrap\">\n <span className=\"font-mono text-xs font-semibold text-foreground\">#{thread.id}</span>\n <span className=\"truncate font-mono text-xs text-foreground\">{thread.name}</span>\n <span\n className={`inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[11px] ${threadStateBadge(\n thread.state,\n )}`}\n >\n <span className={`h-2 w-2 rounded-full ${threadStateDot(thread.state)}`} />\n {thread.rawState || thread.state}\n </span>\n {thread.daemon && (\n <span className=\"rounded-full bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground\">\n daemon\n </span>\n )}\n <span className=\"text-[11px] text-muted-foreground\">{frames.length}f</span>\n {thread.userFrameCount > 0 && (\n <span className=\"text-[11px] text-muted-foreground\">{thread.userFrameCount}u</span>\n )}\n {thread.topFunction && (\n <span className=\"truncate text-[11px] text-muted-foreground\">{thread.topFunction}</span>\n )}\n </div>\n </summary>\n <JvmStackTrace
|
|
1
|
+
{"version":3,"file":"ThreadCard.js","sources":["../../../src/data/diagnostics/ThreadCard.tsx"],"sourcesContent":["import { JvmStackTrace, type JvmFrameSourceResolver } from \"./JvmStackTrace\";\nimport type { ParsedThread } from \"./jvm-stacktrace\";\n\nexport function threadStateBadge(state: string): string {\n switch (state) {\n case \"runnable\":\n return \"bg-green-50 text-green-700 dark:bg-green-500/20 dark:text-green-300\";\n case \"blocked\":\n return \"bg-red-50 text-red-700 dark:bg-red-500/20 dark:text-red-300\";\n case \"waiting\":\n case \"timed_waiting\":\n return \"bg-blue-50 text-blue-700 dark:bg-blue-500/20 dark:text-blue-300\";\n case \"new\":\n return \"bg-amber-50 text-amber-700 dark:bg-amber-500/20 dark:text-amber-300\";\n case \"terminated\":\n return \"bg-muted text-muted-foreground\";\n default:\n return \"bg-muted text-muted-foreground\";\n }\n}\n\nexport function threadStateDot(state: string): string {\n switch (state) {\n case \"runnable\":\n return \"bg-green-500\";\n case \"blocked\":\n return \"bg-red-500\";\n case \"waiting\":\n case \"timed_waiting\":\n return \"bg-blue-500\";\n case \"new\":\n return \"bg-amber-500\";\n case \"terminated\":\n return \"bg-muted-foreground/40\";\n default:\n return \"bg-muted-foreground/40\";\n }\n}\n\nexport type ThreadCardProps = {\n thread: ParsedThread;\n search: string;\n hideRuntimeOnly: boolean;\n resolveSource?: JvmFrameSourceResolver;\n};\n\nexport function ThreadCard({ thread, search, hideRuntimeOnly, resolveSource }: ThreadCardProps) {\n const frames = hideRuntimeOnly\n ? thread.frames.filter((f) => f.kind !== \"frame\" || !f.runtime)\n : thread.frames;\n const defaultOpen = thread.state === \"runnable\" || thread.state === \"blocked\" || !!search;\n\n return (\n <details className=\"border-0 bg-transparent\" open={defaultOpen}>\n <summary className=\"cursor-pointer list-none px-0 py-1\">\n <div className=\"flex items-center gap-2 flex-wrap\">\n <span className=\"font-mono text-xs font-semibold text-foreground\">#{thread.id}</span>\n <span className=\"truncate font-mono text-xs text-foreground\">{thread.name}</span>\n <span\n className={`inline-flex items-center gap-1 rounded-full px-2 py-0.5 text-[11px] ${threadStateBadge(\n thread.state,\n )}`}\n >\n <span className={`h-2 w-2 rounded-full ${threadStateDot(thread.state)}`} />\n {thread.rawState || thread.state}\n </span>\n {thread.daemon && (\n <span className=\"rounded-full bg-muted px-1.5 py-0.5 text-[10px] text-muted-foreground\">\n daemon\n </span>\n )}\n <span className=\"text-[11px] text-muted-foreground\">{frames.length}f</span>\n {thread.userFrameCount > 0 && (\n <span className=\"text-[11px] text-muted-foreground\">{thread.userFrameCount}u</span>\n )}\n {thread.topFunction && (\n <span className=\"truncate text-[11px] text-muted-foreground\">{thread.topFunction}</span>\n )}\n </div>\n </summary>\n <JvmStackTrace\n frames={frames}\n className=\"space-y-0.5 py-1 pl-3\"\n {...(resolveSource ? { resolveSource } : {})}\n />\n </details>\n );\n}\n"],"names":[],"mappings":";;AAGO,SAAS,iBAAiB,OAAuB;AACtD,UAAQ,OAAA;AAAA,IACN,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AAAA,IACL,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT;AACE,aAAO;AAAA,EAAA;AAEb;AAEO,SAAS,eAAe,OAAuB;AACpD,UAAQ,OAAA;AAAA,IACN,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AAAA,IACL,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT,KAAK;AACH,aAAO;AAAA,IACT;AACE,aAAO;AAAA,EAAA;AAEb;AASO,SAAS,WAAW,EAAE,QAAQ,QAAQ,iBAAiB,iBAAkC;AAC9F,QAAM,SAAS,kBACX,OAAO,OAAO,OAAO,CAAC,MAAM,EAAE,SAAS,WAAW,CAAC,EAAE,OAAO,IAC5D,OAAO;AACX,QAAM,cAAc,OAAO,UAAU,cAAc,OAAO,UAAU,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"frame",
|
|
74
74
|
runtime: isJvmRuntimeFrame(functionName),
|
|
75
|
-
nativeMethod: src === "Native Method"
|
|
75
|
+
nativeMethod: src === "Native Method",
|
|
76
|
+
...splitClassMethod(functionName)
|
|
76
77
|
};
|
|
77
78
|
const srcMatch = srcLineRe.exec(src);
|
|
78
79
|
if (((_b = srcMatch == null ? void 0 : srcMatch.groups) == null ? void 0 : _b.file) && srcMatch.groups.line) {
|
|
@@ -178,6 +179,14 @@ const runtimePrefixes = ["java.", "javax.", "sun.", "jdk.", "com.sun.", "oracle.
|
|
|
178
179
|
function isJvmRuntimeFrame(functionName) {
|
|
179
180
|
return runtimePrefixes.some((p) => functionName.startsWith(p));
|
|
180
181
|
}
|
|
182
|
+
function splitClassMethod(functionName) {
|
|
183
|
+
const lastDot = functionName.lastIndexOf(".");
|
|
184
|
+
if (lastDot <= 0) return {};
|
|
185
|
+
return {
|
|
186
|
+
class: functionName.slice(0, lastDot),
|
|
187
|
+
method: functionName.slice(lastDot + 1)
|
|
188
|
+
};
|
|
189
|
+
}
|
|
181
190
|
function sanitizeJvmFunctionName(functionName) {
|
|
182
191
|
const parts = functionName.split(".");
|
|
183
192
|
if (parts.length < 2) return functionName;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jvm-stacktrace.cjs","sources":["../../../src/data/diagnostics/jvm-stacktrace.ts"],"sourcesContent":["export interface ParsedThreadFrame {\n functionName: string;\n displayName: string;\n file?: string;\n line?: number;\n location?: string;\n kind: \"frame\" | \"locked\" | \"waiting_on\" | \"waiting_to_lock\" | \"parking\";\n runtime: boolean;\n nativeMethod: boolean;\n annotationText?: string;\n // Optional fully-qualified class name (e.g. \"com.example.admin.pas.Foo\").\n // Lets renderers filter or group by package without re-splitting\n // functionName. Populated by parseJavaStackTrace; left undefined by the\n // thread-dump parser since its frames are raw \"fn(src)\" pairs.\n class?: string;\n method?: string;\n // Optional source-context window populated by clicky.SourceResolver\n // (or its TS equivalent). sourceLines[line - sourceStartLine] is the focal\n // line. Empty/undefined when no resolver was attached.\n sourceLines?: string[];\n sourceLineNumbers?: number[];\n sourceStartLine?: number;\n sourceLanguage?: string;\n}\n\nexport interface ParsedThread {\n id: number;\n nid?: string;\n name: string;\n state: string;\n rawState: string;\n priority?: number;\n daemon?: boolean;\n frames: ParsedThreadFrame[];\n raw: string;\n userFrameCount: number;\n topFunction?: string;\n searchText: string;\n}\n\nconst headerRe = /^\"(?<name>[^\"]*)\"(?<rest>.*)$/;\nconst stateRe = /^\\s*java\\.lang\\.Thread\\.State:\\s+(?<state>[A-Z_]+)(?:\\s+\\((?<sub>[^)]+)\\))?/;\nconst frameRe = /^\\s*at\\s+(?<fn>[^\\s(]+)\\((?<src>[^)]+)\\)\\s*$/;\nconst srcLineRe = /^(?<file>[^:]+):(?<line>\\d+)$/;\nconst annotationRe =\n /^\\s*-\\s+(?<kind>locked|waiting on|waiting to lock|parking to wait for)\\b(?<rest>.*)$/;\n\nexport function parseJvmThreadDump(text: string): ParsedThread[] {\n const trimmed = text.trim();\n if (!trimmed) return [];\n\n // Split on blank lines OR on a new `\"...\"` header that follows immediately.\n const blocks = splitIntoThreadBlocks(trimmed);\n const threads: ParsedThread[] = [];\n\n for (const block of blocks) {\n const parsed = parseThreadBlock(block);\n if (parsed) threads.push(parsed);\n }\n return threads;\n}\n\nfunction splitIntoThreadBlocks(text: string): string[] {\n const out: string[] = [];\n let current: string[] = [];\n const lines = text.split(\"\\n\");\n for (const raw of lines) {\n const line = raw.replace(/\\r$/, \"\");\n if (line.startsWith('\"') && current.length > 0) {\n out.push(current.join(\"\\n\"));\n current = [line];\n } else {\n current.push(line);\n }\n }\n if (current.length > 0) out.push(current.join(\"\\n\"));\n return out;\n}\n\nfunction parseThreadBlock(block: string): ParsedThread | null {\n const lines = block.split(\"\\n\");\n const header = lines[0]?.trim() ?? \"\";\n const headerMatch = headerRe.exec(header);\n if (!headerMatch?.groups) return null;\n\n const name = headerMatch.groups.name;\n if (!name) return null;\n const rest = headerMatch.groups.rest ?? \"\";\n const idMatch = /#(\\d+)\\b/.exec(rest);\n const prioMatch = /\\bprio=(\\d+)/.exec(rest);\n const nidMatch = /\\bnid=(0x[0-9a-f]+)/i.exec(rest);\n const daemon = /\\bdaemon\\b/.test(rest);\n const headerStateTrail = extractHeaderStateTrail(rest);\n\n let rawState = headerStateTrail ?? \"\";\n let state = normalizeJvmState(rawState);\n const frames: ParsedThreadFrame[] = [];\n\n for (let i = 1; i < lines.length; i++) {\n const line = lines[i];\n if (line == null) continue;\n if (!line.trim()) continue;\n\n const stateMatch = stateRe.exec(line);\n if (stateMatch?.groups) {\n const primary = stateMatch.groups.state;\n if (!primary) continue;\n const sub = stateMatch.groups.sub;\n rawState = sub ? `${primary} (${sub})` : primary;\n state = normalizeJvmState(primary);\n continue;\n }\n\n const frameMatch = frameRe.exec(line);\n if (frameMatch?.groups) {\n const functionName = frameMatch.groups.fn;\n const src = frameMatch.groups.src;\n if (!functionName || !src) continue;\n const frame: ParsedThreadFrame = {\n functionName,\n displayName: sanitizeJvmFunctionName(functionName),\n kind: \"frame\",\n runtime: isJvmRuntimeFrame(functionName),\n nativeMethod: src === \"Native Method\",\n };\n const srcMatch = srcLineRe.exec(src);\n if (srcMatch?.groups?.file && srcMatch.groups.line) {\n frame.file = srcMatch.groups.file;\n frame.line = Number(srcMatch.groups.line);\n frame.location = `${frame.file}:${frame.line}`;\n } else if (src === \"Native Method\") {\n frame.location = \"Native Method\";\n } else {\n frame.location = src;\n }\n frames.push(frame);\n continue;\n }\n\n const annoMatch = annotationRe.exec(line);\n if (annoMatch?.groups?.kind) {\n const annotationKind = annoMatch.groups.kind;\n const kind = mapAnnotationKind(annotationKind);\n frames.push({\n functionName: annotationKind,\n displayName: annotationKind,\n kind,\n runtime: false,\n nativeMethod: false,\n annotationText: (annoMatch.groups.rest ?? \"\").trim(),\n });\n continue;\n }\n }\n\n const userFrameCount = frames.filter((f) => f.kind === \"frame\" && !f.runtime).length;\n const topFunction = frames.find((f) => f.kind === \"frame\")?.functionName;\n const searchText = [\n header,\n ...frames.map((f) => `${f.functionName} ${f.location ?? \"\"} ${f.annotationText ?? \"\"}`),\n ]\n .join(\"\\n\")\n .toLowerCase();\n\n return {\n id: idMatch ? Number(idMatch[1]) : deriveSyntheticId(name, rest),\n name,\n state: state || \"unknown\",\n rawState: rawState || \"\",\n daemon,\n frames,\n raw: block,\n userFrameCount,\n searchText,\n ...(nidMatch?.[1] !== undefined ? { nid: nidMatch[1] } : {}),\n ...(prioMatch?.[1] !== undefined ? { priority: Number(prioMatch[1]) } : {}),\n ...(topFunction !== undefined ? { topFunction } : {}),\n };\n}\n\nfunction extractHeaderStateTrail(rest: string): string | undefined {\n // Example header tails: \"... nid=0x1903 waiting on condition [0x...]\"\n // Capture the descriptor between nid=... and the trailing [address].\n const tail = rest.match(/nid=0x[0-9a-f]+\\s+(?<desc>[^[]+?)(?:\\s+\\[0x[0-9a-f]+\\])?\\s*$/i);\n return tail?.groups?.desc?.trim();\n}\n\nfunction deriveSyntheticId(name: string, rest: string): number {\n const tid = /\\btid=(0x[0-9a-f]+)/i.exec(rest);\n if (tid?.[1]) {\n // stable non-negative int derived from tid hex suffix\n const hex = tid[1].slice(2);\n const n = Number.parseInt(hex.slice(-8), 16);\n if (Number.isFinite(n)) return n;\n }\n // Fallback: hash of name\n let h = 0;\n for (let i = 0; i < name.length; i++) h = (h * 31 + name.charCodeAt(i)) | 0;\n return Math.abs(h);\n}\n\nfunction mapAnnotationKind(kind: string): ParsedThreadFrame[\"kind\"] {\n switch (kind) {\n case \"locked\":\n return \"locked\";\n case \"waiting on\":\n return \"waiting_on\";\n case \"waiting to lock\":\n return \"waiting_to_lock\";\n case \"parking to wait for\":\n return \"parking\";\n default:\n return \"frame\";\n }\n}\n\nexport function countThreadsByState(threads: ParsedThread[]): Map<string, number> {\n const counts = new Map<string, number>();\n for (const t of threads) counts.set(t.state, (counts.get(t.state) ?? 0) + 1);\n return counts;\n}\n\nfunction normalizeJvmState(value: string): string {\n if (!value) return \"\";\n const upper = value.trim().toUpperCase();\n if (upper.startsWith(\"RUNNABLE\")) return \"runnable\";\n if (upper.startsWith(\"TIMED_WAITING\")) return \"timed_waiting\";\n if (upper.startsWith(\"WAITING\")) return \"waiting\";\n if (upper.startsWith(\"BLOCKED\")) return \"blocked\";\n if (upper.startsWith(\"NEW\")) return \"new\";\n if (upper.startsWith(\"TERMINATED\")) return \"terminated\";\n // Header fragments like \"waiting on condition\", \"runnable\", \"sleeping\"\n const lower = value.trim().toLowerCase();\n if (lower.includes(\"runnable\")) return \"runnable\";\n if (lower.includes(\"waiting on condition\") || lower.includes(\"sleeping\")) return \"timed_waiting\";\n if (lower.includes(\"waiting\")) return \"waiting\";\n if (lower.includes(\"blocked\")) return \"blocked\";\n return lower.split(/\\s+/)[0] ?? \"\";\n}\n\nconst runtimePrefixes = [\"java.\", \"javax.\", \"sun.\", \"jdk.\", \"com.sun.\", \"or\" + \"acle.jrockit.\"];\nfunction isJvmRuntimeFrame(functionName: string): boolean {\n return runtimePrefixes.some((p) => functionName.startsWith(p));\n}\n\nfunction sanitizeJvmFunctionName(functionName: string): string {\n // e.g. \"com.example.App$Inner.method\" → \"App$Inner.method\"\n const parts = functionName.split(\".\");\n if (parts.length < 2) return functionName;\n const method = parts[parts.length - 1];\n const cls = parts[parts.length - 2];\n return `${cls}.${method}`;\n}\n"],"names":[],"mappings":";;AAwCA,MAAM,WAAW;AACjB,MAAM,UAAU;AAChB,MAAM,UAAU;AAChB,MAAM,YAAY;AAClB,MAAM,eACJ;AAEK,SAAS,mBAAmB,MAA8B;AAC/D,QAAM,UAAU,KAAK,KAAA;AACrB,MAAI,CAAC,QAAS,QAAO,CAAA;AAGrB,QAAM,SAAS,sBAAsB,OAAO;AAC5C,QAAM,UAA0B,CAAA;AAEhC,aAAW,SAAS,QAAQ;AAC1B,UAAM,SAAS,iBAAiB,KAAK;AACrC,QAAI,OAAQ,SAAQ,KAAK,MAAM;AAAA,EACjC;AACA,SAAO;AACT;A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AAS,wBAAwB,cAA8B;AAE7D,QAAM,QAAQ,aAAa,MAAM,GAAG;AACpC,MAAI,MAAM,SAAS,EAAG,QAAO;AAC7B,QAAM,SAAS,MAAM,MAAM,SAAS,CAAC;AACrC,QAAM,MAAM,MAAM,MAAM,SAAS,CAAC;AAClC,SAAO,GAAG,GAAG,IAAI,MAAM;AACzB;;;"}
|
|
1
|
+
{"version":3,"file":"jvm-stacktrace.cjs","sources":["../../../src/data/diagnostics/jvm-stacktrace.ts"],"sourcesContent":["export interface ParsedThreadFrame {\n functionName: string;\n displayName: string;\n file?: string;\n line?: number;\n location?: string;\n kind: \"frame\" | \"locked\" | \"waiting_on\" | \"waiting_to_lock\" | \"parking\";\n runtime: boolean;\n nativeMethod: boolean;\n annotationText?: string;\n // Optional fully-qualified class name (e.g. \"com.example.admin.pas.Foo\").\n // Lets renderers filter or group by package without re-splitting\n // functionName. Populated by parseJavaStackTrace; left undefined by the\n // thread-dump parser since its frames are raw \"fn(src)\" pairs.\n class?: string;\n method?: string;\n // Optional source-context window populated by clicky.SourceResolver\n // (or its TS equivalent). sourceLines[line - sourceStartLine] is the focal\n // line. Empty/undefined when no resolver was attached.\n sourceLines?: string[];\n sourceLineNumbers?: number[];\n sourceStartLine?: number;\n sourceLanguage?: string;\n}\n\nexport interface ParsedThread {\n id: number;\n nid?: string;\n name: string;\n state: string;\n rawState: string;\n priority?: number;\n daemon?: boolean;\n frames: ParsedThreadFrame[];\n raw: string;\n userFrameCount: number;\n topFunction?: string;\n searchText: string;\n}\n\nconst headerRe = /^\"(?<name>[^\"]*)\"(?<rest>.*)$/;\nconst stateRe = /^\\s*java\\.lang\\.Thread\\.State:\\s+(?<state>[A-Z_]+)(?:\\s+\\((?<sub>[^)]+)\\))?/;\nconst frameRe = /^\\s*at\\s+(?<fn>[^\\s(]+)\\((?<src>[^)]+)\\)\\s*$/;\nconst srcLineRe = /^(?<file>[^:]+):(?<line>\\d+)$/;\nconst annotationRe =\n /^\\s*-\\s+(?<kind>locked|waiting on|waiting to lock|parking to wait for)\\b(?<rest>.*)$/;\n\nexport function parseJvmThreadDump(text: string): ParsedThread[] {\n const trimmed = text.trim();\n if (!trimmed) return [];\n\n // Split on blank lines OR on a new `\"...\"` header that follows immediately.\n const blocks = splitIntoThreadBlocks(trimmed);\n const threads: ParsedThread[] = [];\n\n for (const block of blocks) {\n const parsed = parseThreadBlock(block);\n if (parsed) threads.push(parsed);\n }\n return threads;\n}\n\nfunction splitIntoThreadBlocks(text: string): string[] {\n const out: string[] = [];\n let current: string[] = [];\n const lines = text.split(\"\\n\");\n for (const raw of lines) {\n const line = raw.replace(/\\r$/, \"\");\n if (line.startsWith('\"') && current.length > 0) {\n out.push(current.join(\"\\n\"));\n current = [line];\n } else {\n current.push(line);\n }\n }\n if (current.length > 0) out.push(current.join(\"\\n\"));\n return out;\n}\n\nfunction parseThreadBlock(block: string): ParsedThread | null {\n const lines = block.split(\"\\n\");\n const header = lines[0]?.trim() ?? \"\";\n const headerMatch = headerRe.exec(header);\n if (!headerMatch?.groups) return null;\n\n const name = headerMatch.groups.name;\n if (!name) return null;\n const rest = headerMatch.groups.rest ?? \"\";\n const idMatch = /#(\\d+)\\b/.exec(rest);\n const prioMatch = /\\bprio=(\\d+)/.exec(rest);\n const nidMatch = /\\bnid=(0x[0-9a-f]+)/i.exec(rest);\n const daemon = /\\bdaemon\\b/.test(rest);\n const headerStateTrail = extractHeaderStateTrail(rest);\n\n let rawState = headerStateTrail ?? \"\";\n let state = normalizeJvmState(rawState);\n const frames: ParsedThreadFrame[] = [];\n\n for (let i = 1; i < lines.length; i++) {\n const line = lines[i];\n if (line == null) continue;\n if (!line.trim()) continue;\n\n const stateMatch = stateRe.exec(line);\n if (stateMatch?.groups) {\n const primary = stateMatch.groups.state;\n if (!primary) continue;\n const sub = stateMatch.groups.sub;\n rawState = sub ? `${primary} (${sub})` : primary;\n state = normalizeJvmState(primary);\n continue;\n }\n\n const frameMatch = frameRe.exec(line);\n if (frameMatch?.groups) {\n const functionName = frameMatch.groups.fn;\n const src = frameMatch.groups.src;\n if (!functionName || !src) continue;\n const frame: ParsedThreadFrame = {\n functionName,\n displayName: sanitizeJvmFunctionName(functionName),\n kind: \"frame\",\n runtime: isJvmRuntimeFrame(functionName),\n nativeMethod: src === \"Native Method\",\n ...splitClassMethod(functionName),\n };\n const srcMatch = srcLineRe.exec(src);\n if (srcMatch?.groups?.file && srcMatch.groups.line) {\n frame.file = srcMatch.groups.file;\n frame.line = Number(srcMatch.groups.line);\n frame.location = `${frame.file}:${frame.line}`;\n } else if (src === \"Native Method\") {\n frame.location = \"Native Method\";\n } else {\n frame.location = src;\n }\n frames.push(frame);\n continue;\n }\n\n const annoMatch = annotationRe.exec(line);\n if (annoMatch?.groups?.kind) {\n const annotationKind = annoMatch.groups.kind;\n const kind = mapAnnotationKind(annotationKind);\n frames.push({\n functionName: annotationKind,\n displayName: annotationKind,\n kind,\n runtime: false,\n nativeMethod: false,\n annotationText: (annoMatch.groups.rest ?? \"\").trim(),\n });\n continue;\n }\n }\n\n const userFrameCount = frames.filter((f) => f.kind === \"frame\" && !f.runtime).length;\n const topFunction = frames.find((f) => f.kind === \"frame\")?.functionName;\n const searchText = [\n header,\n ...frames.map((f) => `${f.functionName} ${f.location ?? \"\"} ${f.annotationText ?? \"\"}`),\n ]\n .join(\"\\n\")\n .toLowerCase();\n\n return {\n id: idMatch ? Number(idMatch[1]) : deriveSyntheticId(name, rest),\n name,\n state: state || \"unknown\",\n rawState: rawState || \"\",\n daemon,\n frames,\n raw: block,\n userFrameCount,\n searchText,\n ...(nidMatch?.[1] !== undefined ? { nid: nidMatch[1] } : {}),\n ...(prioMatch?.[1] !== undefined ? { priority: Number(prioMatch[1]) } : {}),\n ...(topFunction !== undefined ? { topFunction } : {}),\n };\n}\n\nfunction extractHeaderStateTrail(rest: string): string | undefined {\n // Example header tails: \"... nid=0x1903 waiting on condition [0x...]\"\n // Capture the descriptor between nid=... and the trailing [address].\n const tail = rest.match(/nid=0x[0-9a-f]+\\s+(?<desc>[^[]+?)(?:\\s+\\[0x[0-9a-f]+\\])?\\s*$/i);\n return tail?.groups?.desc?.trim();\n}\n\nfunction deriveSyntheticId(name: string, rest: string): number {\n const tid = /\\btid=(0x[0-9a-f]+)/i.exec(rest);\n if (tid?.[1]) {\n // stable non-negative int derived from tid hex suffix\n const hex = tid[1].slice(2);\n const n = Number.parseInt(hex.slice(-8), 16);\n if (Number.isFinite(n)) return n;\n }\n // Fallback: hash of name\n let h = 0;\n for (let i = 0; i < name.length; i++) h = (h * 31 + name.charCodeAt(i)) | 0;\n return Math.abs(h);\n}\n\nfunction mapAnnotationKind(kind: string): ParsedThreadFrame[\"kind\"] {\n switch (kind) {\n case \"locked\":\n return \"locked\";\n case \"waiting on\":\n return \"waiting_on\";\n case \"waiting to lock\":\n return \"waiting_to_lock\";\n case \"parking to wait for\":\n return \"parking\";\n default:\n return \"frame\";\n }\n}\n\nexport function countThreadsByState(threads: ParsedThread[]): Map<string, number> {\n const counts = new Map<string, number>();\n for (const t of threads) counts.set(t.state, (counts.get(t.state) ?? 0) + 1);\n return counts;\n}\n\nfunction normalizeJvmState(value: string): string {\n if (!value) return \"\";\n const upper = value.trim().toUpperCase();\n if (upper.startsWith(\"RUNNABLE\")) return \"runnable\";\n if (upper.startsWith(\"TIMED_WAITING\")) return \"timed_waiting\";\n if (upper.startsWith(\"WAITING\")) return \"waiting\";\n if (upper.startsWith(\"BLOCKED\")) return \"blocked\";\n if (upper.startsWith(\"NEW\")) return \"new\";\n if (upper.startsWith(\"TERMINATED\")) return \"terminated\";\n // Header fragments like \"waiting on condition\", \"runnable\", \"sleeping\"\n const lower = value.trim().toLowerCase();\n if (lower.includes(\"runnable\")) return \"runnable\";\n if (lower.includes(\"waiting on condition\") || lower.includes(\"sleeping\")) return \"timed_waiting\";\n if (lower.includes(\"waiting\")) return \"waiting\";\n if (lower.includes(\"blocked\")) return \"blocked\";\n return lower.split(/\\s+/)[0] ?? \"\";\n}\n\nconst runtimePrefixes = [\"java.\", \"javax.\", \"sun.\", \"jdk.\", \"com.sun.\", \"or\" + \"acle.jrockit.\"];\nfunction isJvmRuntimeFrame(functionName: string): boolean {\n return runtimePrefixes.some((p) => functionName.startsWith(p));\n}\n\n// splitClassMethod separates a JVM frame's `fully.qualified.Class.method` into\n// its class and method. The method is the last dot segment; everything before\n// is the (possibly inner) class. Returns no fields when the name has no dot, so\n// frames like a bare `<init>` are left without a class rather than guessed.\nfunction splitClassMethod(functionName: string): { class?: string; method?: string } {\n const lastDot = functionName.lastIndexOf(\".\");\n if (lastDot <= 0) return {};\n return {\n class: functionName.slice(0, lastDot),\n method: functionName.slice(lastDot + 1),\n };\n}\n\nfunction sanitizeJvmFunctionName(functionName: string): string {\n // e.g. \"com.example.App$Inner.method\" → \"App$Inner.method\"\n const parts = functionName.split(\".\");\n if (parts.length < 2) return functionName;\n const method = parts[parts.length - 1];\n const cls = parts[parts.length - 2];\n return `${cls}.${method}`;\n}\n"],"names":[],"mappings":";;AAwCA,MAAM,WAAW;AACjB,MAAM,UAAU;AAChB,MAAM,UAAU;AAChB,MAAM,YAAY;AAClB,MAAM,eACJ;AAEK,SAAS,mBAAmB,MAA8B;AAC/D,QAAM,UAAU,KAAK,KAAA;AACrB,MAAI,CAAC,QAAS,QAAO,CAAA;AAGrB,QAAM,SAAS,sBAAsB,OAAO;AAC5C,QAAM,UAA0B,CAAA;AAEhC,aAAW,SAAS,QAAQ;AAC1B,UAAM,SAAS,iBAAiB,KAAK;AACrC,QAAI,OAAQ,SAAQ,KAAK,MAAM;AAAA,EACjC;AACA,SAAO;AACT;AAEA,SAAS,sBAAsB,MAAwB;AACrD,QAAM,MAAgB,CAAA;AACtB,MAAI,UAAoB,CAAA;AACxB,QAAM,QAAQ,KAAK,MAAM,IAAI;AAC7B,aAAW,OAAO,OAAO;AACvB,UAAM,OAAO,IAAI,QAAQ,OAAO,EAAE;AAClC,QAAI,KAAK,WAAW,GAAG,KAAK,QAAQ,SAAS,GAAG;AAC9C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