md4ai 0.9.7 → 0.9.8
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 +32 -1
- package/package.json +1 -1
package/dist/index.bundled.js
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
|
|
5
|
+
get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
|
|
6
|
+
}) : x)(function(x) {
|
|
7
|
+
if (typeof require !== "undefined") return require.apply(this, arguments);
|
|
8
|
+
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
9
|
+
});
|
|
4
10
|
var __esm = (fn, res) => function __init() {
|
|
5
11
|
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
6
12
|
};
|
|
@@ -1645,7 +1651,7 @@ var CURRENT_VERSION;
|
|
|
1645
1651
|
var init_check_update = __esm({
|
|
1646
1652
|
"dist/check-update.js"() {
|
|
1647
1653
|
"use strict";
|
|
1648
|
-
CURRENT_VERSION = true ? "0.9.
|
|
1654
|
+
CURRENT_VERSION = true ? "0.9.8" : "0.0.0-dev";
|
|
1649
1655
|
}
|
|
1650
1656
|
});
|
|
1651
1657
|
|
|
@@ -2343,6 +2349,26 @@ function getProcessTable() {
|
|
|
2343
2349
|
return [];
|
|
2344
2350
|
}
|
|
2345
2351
|
}
|
|
2352
|
+
function detectSessionCwds(processes) {
|
|
2353
|
+
const { readlinkSync } = __require("node:fs");
|
|
2354
|
+
const cwdByTty = /* @__PURE__ */ new Map();
|
|
2355
|
+
const claudeProcs = processes.filter((p) => {
|
|
2356
|
+
const lower = p.args.toLowerCase();
|
|
2357
|
+
return lower.includes("/claude ") || lower.includes("/claude\n") || lower.endsWith("/claude") || lower.includes(" claude ") || lower === "claude" || lower.includes("/.claude/") || lower.includes("claude-code");
|
|
2358
|
+
});
|
|
2359
|
+
for (const proc of claudeProcs) {
|
|
2360
|
+
const tty = proc.tty === "?" ? "" : proc.tty;
|
|
2361
|
+
if (!tty || cwdByTty.has(tty))
|
|
2362
|
+
continue;
|
|
2363
|
+
try {
|
|
2364
|
+
const cwd = readlinkSync(`/proc/${proc.pid}/cwd`, { encoding: "utf-8" });
|
|
2365
|
+
if (cwd)
|
|
2366
|
+
cwdByTty.set(tty, cwd);
|
|
2367
|
+
} catch {
|
|
2368
|
+
}
|
|
2369
|
+
}
|
|
2370
|
+
return cwdByTty;
|
|
2371
|
+
}
|
|
2346
2372
|
var init_scan_processes = __esm({
|
|
2347
2373
|
"dist/mcp/scan-processes.js"() {
|
|
2348
2374
|
"use strict";
|
|
@@ -2406,6 +2432,7 @@ async function checkChromeCdp() {
|
|
|
2406
2432
|
}
|
|
2407
2433
|
function buildRows(configs, httpResults, cdpStatus) {
|
|
2408
2434
|
const processes = getProcessTable();
|
|
2435
|
+
const sessionCwds = detectSessionCwds(processes);
|
|
2409
2436
|
const rows = [];
|
|
2410
2437
|
for (const config2 of configs) {
|
|
2411
2438
|
const { required, missing } = checkEnvVars(config2);
|
|
@@ -2424,6 +2451,7 @@ function buildRows(configs, httpResults, cdpStatus) {
|
|
|
2424
2451
|
status,
|
|
2425
2452
|
pid: null,
|
|
2426
2453
|
session_tty: null,
|
|
2454
|
+
session_cwd: null,
|
|
2427
2455
|
uptime_seconds: null,
|
|
2428
2456
|
memory_mb: null,
|
|
2429
2457
|
env_vars_required: required.length ? required : null,
|
|
@@ -2443,6 +2471,7 @@ function buildRows(configs, httpResults, cdpStatus) {
|
|
|
2443
2471
|
status: "error",
|
|
2444
2472
|
pid: null,
|
|
2445
2473
|
session_tty: null,
|
|
2474
|
+
session_cwd: null,
|
|
2446
2475
|
uptime_seconds: null,
|
|
2447
2476
|
memory_mb: null,
|
|
2448
2477
|
env_vars_required: required,
|
|
@@ -2465,6 +2494,7 @@ function buildRows(configs, httpResults, cdpStatus) {
|
|
|
2465
2494
|
status: "stopped",
|
|
2466
2495
|
pid: null,
|
|
2467
2496
|
session_tty: null,
|
|
2497
|
+
session_cwd: null,
|
|
2468
2498
|
uptime_seconds: null,
|
|
2469
2499
|
memory_mb: null,
|
|
2470
2500
|
env_vars_required: required.length ? required : null,
|
|
@@ -2491,6 +2521,7 @@ function buildRows(configs, httpResults, cdpStatus) {
|
|
|
2491
2521
|
status: "running",
|
|
2492
2522
|
pid: match.pid,
|
|
2493
2523
|
session_tty: match.tty || null,
|
|
2524
|
+
session_cwd: (match.tty ? sessionCwds.get(match.tty) : null) ?? null,
|
|
2494
2525
|
uptime_seconds: match.uptimeSeconds,
|
|
2495
2526
|
memory_mb: match.memoryMb,
|
|
2496
2527
|
env_vars_required: required.length ? required : null,
|