md4ai 0.9.10 → 0.10.1
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 +107 -11
- package/package.json +5 -5
package/dist/index.bundled.js
CHANGED
|
@@ -1723,7 +1723,7 @@ var CURRENT_VERSION;
|
|
|
1723
1723
|
var init_check_update = __esm({
|
|
1724
1724
|
"dist/check-update.js"() {
|
|
1725
1725
|
"use strict";
|
|
1726
|
-
CURRENT_VERSION = true ? "0.
|
|
1726
|
+
CURRENT_VERSION = true ? "0.10.1" : "0.0.0-dev";
|
|
1727
1727
|
}
|
|
1728
1728
|
});
|
|
1729
1729
|
|
|
@@ -3903,30 +3903,122 @@ async function updateCommand(options) {
|
|
|
3903
3903
|
spawnPostUpdate();
|
|
3904
3904
|
}
|
|
3905
3905
|
|
|
3906
|
+
// dist/commands/start.js
|
|
3907
|
+
init_check_update();
|
|
3908
|
+
init_map();
|
|
3909
|
+
init_mcp_watch();
|
|
3910
|
+
import chalk23 from "chalk";
|
|
3911
|
+
import { resolve as resolve6 } from "node:path";
|
|
3912
|
+
async function fetchLatestVersion2() {
|
|
3913
|
+
try {
|
|
3914
|
+
const controller = new AbortController();
|
|
3915
|
+
const timeout = setTimeout(() => controller.abort(), 5e3);
|
|
3916
|
+
const res = await fetch("https://registry.npmjs.org/md4ai/latest", {
|
|
3917
|
+
signal: controller.signal
|
|
3918
|
+
});
|
|
3919
|
+
clearTimeout(timeout);
|
|
3920
|
+
if (!res.ok)
|
|
3921
|
+
return null;
|
|
3922
|
+
const data = await res.json();
|
|
3923
|
+
return data.version ?? null;
|
|
3924
|
+
} catch {
|
|
3925
|
+
return null;
|
|
3926
|
+
}
|
|
3927
|
+
}
|
|
3928
|
+
function isNewer3(a, b) {
|
|
3929
|
+
const pa = a.split(".").map(Number);
|
|
3930
|
+
const pb = b.split(".").map(Number);
|
|
3931
|
+
for (let i = 0; i < 3; i++) {
|
|
3932
|
+
if ((pa[i] ?? 0) > (pb[i] ?? 0))
|
|
3933
|
+
return true;
|
|
3934
|
+
if ((pa[i] ?? 0) < (pb[i] ?? 0))
|
|
3935
|
+
return false;
|
|
3936
|
+
}
|
|
3937
|
+
return false;
|
|
3938
|
+
}
|
|
3939
|
+
async function startCommand() {
|
|
3940
|
+
const projectRoot = resolve6(process.cwd());
|
|
3941
|
+
console.log("");
|
|
3942
|
+
console.log(chalk23.bold.cyan(` MD4AI v${CURRENT_VERSION}`));
|
|
3943
|
+
console.log(chalk23.dim(` ${projectRoot}`));
|
|
3944
|
+
console.log("");
|
|
3945
|
+
console.log(chalk23.blue(" \u2460 Checking for updates..."));
|
|
3946
|
+
const latest = await fetchLatestVersion2();
|
|
3947
|
+
if (latest && isNewer3(latest, CURRENT_VERSION)) {
|
|
3948
|
+
console.log(chalk23.yellow(` Update available: v${CURRENT_VERSION} \u2192 v${latest}`));
|
|
3949
|
+
if (process.stdin.isTTY) {
|
|
3950
|
+
const { confirm: confirm4 } = await import("@inquirer/prompts");
|
|
3951
|
+
const wantUpdate = await confirm4({
|
|
3952
|
+
message: `Install md4ai v${latest} now?`,
|
|
3953
|
+
default: true
|
|
3954
|
+
});
|
|
3955
|
+
if (wantUpdate) {
|
|
3956
|
+
const { execFileSync: execFileSync7 } = await import("node:child_process");
|
|
3957
|
+
console.log(chalk23.blue("\n Installing...\n"));
|
|
3958
|
+
try {
|
|
3959
|
+
execFileSync7("npm", ["install", "-g", "md4ai"], {
|
|
3960
|
+
stdio: "inherit",
|
|
3961
|
+
timeout: 6e4
|
|
3962
|
+
});
|
|
3963
|
+
console.log(chalk23.green(" Updated successfully."));
|
|
3964
|
+
console.log(chalk23.dim(" Restarting with the new version...\n"));
|
|
3965
|
+
const { spawn: spawn2 } = await import("node:child_process");
|
|
3966
|
+
const child = spawn2("md4ai", ["start"], { stdio: "inherit", shell: false });
|
|
3967
|
+
child.on("exit", (code) => process.exit(code ?? 0));
|
|
3968
|
+
return;
|
|
3969
|
+
} catch {
|
|
3970
|
+
console.log(chalk23.yellow(" Update failed \u2014 continuing with current version.\n"));
|
|
3971
|
+
}
|
|
3972
|
+
} else {
|
|
3973
|
+
console.log("");
|
|
3974
|
+
}
|
|
3975
|
+
} else {
|
|
3976
|
+
console.log(chalk23.dim(" Run md4ai update to install it.\n"));
|
|
3977
|
+
}
|
|
3978
|
+
} else if (latest) {
|
|
3979
|
+
console.log(chalk23.green(" You're on the latest version.\n"));
|
|
3980
|
+
} else {
|
|
3981
|
+
console.log(chalk23.dim(" Could not reach npm registry \u2014 skipping.\n"));
|
|
3982
|
+
}
|
|
3983
|
+
console.log(chalk23.blue(" \u2461 Scanning project files..."));
|
|
3984
|
+
console.log("");
|
|
3985
|
+
await mapCommand(projectRoot, {});
|
|
3986
|
+
if (!process.stdin.isTTY) {
|
|
3987
|
+
console.log(chalk23.dim("\n Non-interactive mode \u2014 skipping MCP monitor."));
|
|
3988
|
+
return;
|
|
3989
|
+
}
|
|
3990
|
+
console.log("");
|
|
3991
|
+
console.log(chalk23.blue(" \u2462 Starting MCP monitor..."));
|
|
3992
|
+
console.log("");
|
|
3993
|
+
await mcpWatchCommand();
|
|
3994
|
+
}
|
|
3995
|
+
|
|
3906
3996
|
// dist/commands/config.js
|
|
3907
3997
|
init_config();
|
|
3908
|
-
import
|
|
3998
|
+
import chalk24 from "chalk";
|
|
3909
3999
|
var ALLOWED_KEYS = ["vercel-token"];
|
|
3910
4000
|
var KEY_MAP = {
|
|
3911
4001
|
"vercel-token": "vercelToken"
|
|
3912
4002
|
};
|
|
3913
4003
|
async function configSetCommand(key, value) {
|
|
3914
4004
|
if (!ALLOWED_KEYS.includes(key)) {
|
|
3915
|
-
console.error(
|
|
4005
|
+
console.error(chalk24.red(`Unknown config key: ${key}`));
|
|
3916
4006
|
console.log(` Allowed keys: ${ALLOWED_KEYS.join(", ")}`);
|
|
3917
4007
|
process.exit(1);
|
|
3918
4008
|
}
|
|
3919
4009
|
const credKey = KEY_MAP[key];
|
|
3920
4010
|
await mergeCredentials({ [credKey]: value });
|
|
3921
|
-
console.log(
|
|
4011
|
+
console.log(chalk24.green(`Saved ${key}.`));
|
|
3922
4012
|
}
|
|
3923
4013
|
|
|
3924
4014
|
// dist/index.js
|
|
3925
4015
|
init_check_update();
|
|
3926
4016
|
var program = new Command();
|
|
3927
4017
|
program.name("md4ai").description("MD4AI \u2014 Claude tooling visualiser").version(CURRENT_VERSION).addHelpText("after", `
|
|
3928
|
-
|
|
3929
|
-
md4ai
|
|
4018
|
+
Quick start:
|
|
4019
|
+
md4ai start Check for updates, scan project, and start MCP monitoring
|
|
4020
|
+
md4ai Same as md4ai start (when run in a linked project folder)`);
|
|
4021
|
+
program.command("start").description("Check for updates, scan project, and start MCP monitoring \u2014 the all-in-one command").action(startCommand);
|
|
3930
4022
|
program.command("login").description("Log in to MD4AI with email and password").action(loginCommand);
|
|
3931
4023
|
program.command("logout").description("Log out and clear stored credentials").action(logoutCommand);
|
|
3932
4024
|
program.command("status").description("Show login status, device count, folder count, last sync").action(statusCommand);
|
|
@@ -3949,9 +4041,13 @@ var admin = program.command("admin").description("Admin commands for managing th
|
|
|
3949
4041
|
admin.command("update-tool").description("Add or update a tool in the master registry").requiredOption("--name <name>", "Canonical tool name (e.g. next, playwright)").option("--display <display>", 'Human-friendly display name (e.g. "Next.js")').option("--category <category>", "Tool category (framework|runtime|cli|mcp|package|database|other)").option("--stable <version>", "Latest stable version").option("--beta <version>", "Latest beta/RC version").option("--source <url>", "Source of truth URL for checking versions").option("--install <url>", "Download/install link").option("--notes <text>", "Compatibility notes or warnings").action(adminUpdateToolCommand);
|
|
3950
4042
|
admin.command("list-tools").description("List all tools in the master registry").action(adminListToolsCommand);
|
|
3951
4043
|
admin.command("fetch-versions").description("Fetch latest stable and beta versions from npm and GitHub").action(adminFetchVersionsCommand);
|
|
3952
|
-
|
|
3953
|
-
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
|
|
4044
|
+
if (process.argv.length <= 2) {
|
|
4045
|
+
void startCommand();
|
|
4046
|
+
} else {
|
|
4047
|
+
program.parse();
|
|
4048
|
+
const ran = program.args[0];
|
|
4049
|
+
const skipAutoCheck = ["update", "check-update", "mcp-watch", "start"];
|
|
4050
|
+
if (!skipAutoCheck.includes(ran)) {
|
|
4051
|
+
autoCheckForUpdate();
|
|
4052
|
+
}
|
|
3957
4053
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "md4ai",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.1",
|
|
4
4
|
"description": "CLI for MD4AI — scan Claude projects and sync to your dashboard",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -33,15 +33,15 @@
|
|
|
33
33
|
"node": ">=22"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@inquirer/prompts": "^
|
|
36
|
+
"@inquirer/prompts": "^8.3.0",
|
|
37
37
|
"@supabase/supabase-js": "^2.98.0",
|
|
38
|
-
"chalk": "^5.
|
|
39
|
-
"commander": "^14.0.
|
|
38
|
+
"chalk": "^5.6.2",
|
|
39
|
+
"commander": "^14.0.3",
|
|
40
40
|
"jszip": "^3.10.1"
|
|
41
41
|
},
|
|
42
42
|
"devDependencies": {
|
|
43
43
|
"@md4ai/shared": "workspace:*",
|
|
44
|
-
"@types/node": "^22.
|
|
44
|
+
"@types/node": "^22.15.31",
|
|
45
45
|
"esbuild": "^0.27.3",
|
|
46
46
|
"typescript": "^5.7.0"
|
|
47
47
|
}
|