md4ai 0.8.2 → 0.8.4
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/index.bundled.js +27 -10
- package/package.json +1 -1
package/dist/index.bundled.js
CHANGED
|
@@ -1262,7 +1262,7 @@ var CURRENT_VERSION;
|
|
|
1262
1262
|
var init_check_update = __esm({
|
|
1263
1263
|
"dist/check-update.js"() {
|
|
1264
1264
|
"use strict";
|
|
1265
|
-
CURRENT_VERSION = true ? "0.8.
|
|
1265
|
+
CURRENT_VERSION = true ? "0.8.4" : "0.0.0-dev";
|
|
1266
1266
|
}
|
|
1267
1267
|
});
|
|
1268
1268
|
|
|
@@ -1691,7 +1691,18 @@ async function checkHttpServer(url) {
|
|
|
1691
1691
|
return "unreachable";
|
|
1692
1692
|
}
|
|
1693
1693
|
}
|
|
1694
|
-
function
|
|
1694
|
+
async function checkChromeCdp() {
|
|
1695
|
+
try {
|
|
1696
|
+
const controller = new AbortController();
|
|
1697
|
+
const timeout = setTimeout(() => controller.abort(), 2e3);
|
|
1698
|
+
await fetch("http://localhost:9222/json/version", { signal: controller.signal });
|
|
1699
|
+
clearTimeout(timeout);
|
|
1700
|
+
return "reachable";
|
|
1701
|
+
} catch {
|
|
1702
|
+
return "unreachable";
|
|
1703
|
+
}
|
|
1704
|
+
}
|
|
1705
|
+
function buildRows(configs, httpResults, cdpStatus) {
|
|
1695
1706
|
const processes = getProcessTable();
|
|
1696
1707
|
const rows = [];
|
|
1697
1708
|
for (const config of configs) {
|
|
@@ -1738,6 +1749,8 @@ function buildRows(configs, httpResults) {
|
|
|
1738
1749
|
});
|
|
1739
1750
|
continue;
|
|
1740
1751
|
}
|
|
1752
|
+
const isChromeDevtools = config.name === "chrome-devtools" || (config.args ?? []).some((a) => a.includes("chrome-devtools"));
|
|
1753
|
+
const cdpDetail = isChromeDevtools && cdpStatus ? cdpStatus === "reachable" ? "Chrome CDP reachable" : "Chrome not reachable on port 9222" : null;
|
|
1741
1754
|
const matches = findProcessesForConfig(config, processes);
|
|
1742
1755
|
if (matches.length === 0) {
|
|
1743
1756
|
rows.push({
|
|
@@ -1754,7 +1767,7 @@ function buildRows(configs, httpResults) {
|
|
|
1754
1767
|
memory_mb: null,
|
|
1755
1768
|
env_vars_required: required.length ? required : null,
|
|
1756
1769
|
env_vars_missing: null,
|
|
1757
|
-
error_detail:
|
|
1770
|
+
error_detail: cdpDetail
|
|
1758
1771
|
});
|
|
1759
1772
|
} else {
|
|
1760
1773
|
for (const match of matches) {
|
|
@@ -1772,7 +1785,7 @@ function buildRows(configs, httpResults) {
|
|
|
1772
1785
|
memory_mb: match.memoryMb,
|
|
1773
1786
|
env_vars_required: required.length ? required : null,
|
|
1774
1787
|
env_vars_missing: null,
|
|
1775
|
-
error_detail:
|
|
1788
|
+
error_detail: cdpDetail
|
|
1776
1789
|
});
|
|
1777
1790
|
}
|
|
1778
1791
|
}
|
|
@@ -1862,7 +1875,7 @@ async function mcpWatchCommand() {
|
|
|
1862
1875
|
await new Promise((r) => setTimeout(r, 1e3));
|
|
1863
1876
|
console.log(chalk18.dim(" Previous watcher stopped.\n"));
|
|
1864
1877
|
}
|
|
1865
|
-
process.stdout.write(`\x1B]0
|
|
1878
|
+
process.stdout.write(`\x1B]0;MCP mon\x07`);
|
|
1866
1879
|
console.log(chalk18.blue(`Starting MCP monitor for ${deviceName}...`));
|
|
1867
1880
|
console.log("");
|
|
1868
1881
|
console.log(chalk18.dim(" View this in the online dashboard at:"));
|
|
@@ -1882,11 +1895,15 @@ async function mcpWatchCommand() {
|
|
|
1882
1895
|
const configs = await readAllMcpConfigs();
|
|
1883
1896
|
const httpConfigs = configs.filter((c) => c.type === "http" && c.url);
|
|
1884
1897
|
const httpResults = /* @__PURE__ */ new Map();
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1898
|
+
const hasChromeDevtools = configs.some((c) => c.name === "chrome-devtools" || (c.args ?? []).some((a) => a.includes("chrome-devtools")));
|
|
1899
|
+
const [, cdpStatus] = await Promise.all([
|
|
1900
|
+
Promise.all(httpConfigs.map(async (c) => {
|
|
1901
|
+
const result = await checkHttpServer(c.url);
|
|
1902
|
+
httpResults.set(c.name, result);
|
|
1903
|
+
})),
|
|
1904
|
+
hasChromeDevtools ? checkChromeCdp() : Promise.resolve(null)
|
|
1905
|
+
]);
|
|
1906
|
+
const rows = buildRows(configs, httpResults, cdpStatus);
|
|
1890
1907
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
1891
1908
|
await supabase.from("mcp_server_status").delete().eq("device_id", deviceId);
|
|
1892
1909
|
if (rows.length > 0) {
|