md4ai 0.7.2 → 0.7.3

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.
@@ -1131,7 +1131,7 @@ var init_scanner = __esm({
1131
1131
 
1132
1132
  // dist/check-update.js
1133
1133
  import chalk8 from "chalk";
1134
- async function checkForUpdate() {
1134
+ async function fetchLatest() {
1135
1135
  try {
1136
1136
  const controller = new AbortController();
1137
1137
  const timeout = setTimeout(() => controller.abort(), 3e3);
@@ -1140,22 +1140,40 @@ async function checkForUpdate() {
1140
1140
  });
1141
1141
  clearTimeout(timeout);
1142
1142
  if (!res.ok)
1143
- return;
1143
+ return null;
1144
1144
  const data = await res.json();
1145
- const latest = data.version;
1145
+ return data.version ?? null;
1146
+ } catch {
1147
+ return null;
1148
+ }
1149
+ }
1150
+ function printUpdateBanner(latest) {
1151
+ console.log("");
1152
+ console.log(chalk8.yellow("\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510"));
1153
+ console.log(chalk8.yellow("\u2502") + chalk8.bold(" Update available! ") + chalk8.dim(`${CURRENT_VERSION}`) + chalk8.white(" \u2192 ") + chalk8.green.bold(`${latest}`) + " " + chalk8.yellow("\u2502"));
1154
+ console.log(chalk8.yellow("\u2502") + " " + chalk8.yellow("\u2502"));
1155
+ console.log(chalk8.yellow("\u2502") + " Run: " + chalk8.cyan("md4ai update") + " " + chalk8.yellow("\u2502"));
1156
+ console.log(chalk8.yellow("\u2502") + " " + chalk8.yellow("\u2502"));
1157
+ console.log(chalk8.yellow("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518"));
1158
+ console.log("");
1159
+ }
1160
+ async function checkForUpdate() {
1161
+ const latest = await fetchLatest();
1162
+ if (!latest)
1163
+ return;
1164
+ if (latest !== CURRENT_VERSION && isNewer(latest, CURRENT_VERSION)) {
1165
+ printUpdateBanner(latest);
1166
+ } else {
1167
+ console.log(chalk8.green(`md4ai v${CURRENT_VERSION} \u2014 you're on the latest version.`));
1168
+ }
1169
+ }
1170
+ async function autoCheckForUpdate() {
1171
+ try {
1172
+ const latest = await fetchLatest();
1146
1173
  if (!latest)
1147
1174
  return;
1148
1175
  if (latest !== CURRENT_VERSION && isNewer(latest, CURRENT_VERSION)) {
1149
- console.log("");
1150
- console.log(chalk8.yellow("\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510"));
1151
- console.log(chalk8.yellow("\u2502") + chalk8.bold(" Update available! ") + chalk8.dim(`${CURRENT_VERSION}`) + chalk8.white(" \u2192 ") + chalk8.green.bold(`${latest}`) + " " + chalk8.yellow("\u2502"));
1152
- console.log(chalk8.yellow("\u2502") + " " + chalk8.yellow("\u2502"));
1153
- console.log(chalk8.yellow("\u2502") + " Run: " + chalk8.cyan("md4ai update") + " " + chalk8.yellow("\u2502"));
1154
- console.log(chalk8.yellow("\u2502") + " " + chalk8.yellow("\u2502"));
1155
- console.log(chalk8.yellow("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518"));
1156
- console.log("");
1157
- } else {
1158
- console.log(chalk8.green(`md4ai v${CURRENT_VERSION} \u2014 you're on the latest version.`));
1176
+ printUpdateBanner(latest);
1159
1177
  }
1160
1178
  } catch {
1161
1179
  }
@@ -1175,7 +1193,7 @@ var CURRENT_VERSION;
1175
1193
  var init_check_update = __esm({
1176
1194
  "dist/check-update.js"() {
1177
1195
  "use strict";
1178
- CURRENT_VERSION = true ? "0.7.2" : "0.0.0-dev";
1196
+ CURRENT_VERSION = true ? "0.7.3" : "0.0.0-dev";
1179
1197
  }
1180
1198
  });
1181
1199
 
@@ -3101,3 +3119,8 @@ admin.command("update-tool").description("Add or update a tool in the master reg
3101
3119
  admin.command("list-tools").description("List all tools in the master registry").action(adminListToolsCommand);
3102
3120
  admin.command("fetch-versions").description("Fetch latest stable and beta versions from npm and GitHub").action(adminFetchVersionsCommand);
3103
3121
  program.parse();
3122
+ var ran = program.args[0];
3123
+ var skipAutoCheck = ["update", "check-update", "mcp-watch"];
3124
+ if (!skipAutoCheck.includes(ran)) {
3125
+ autoCheckForUpdate();
3126
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "md4ai",
3
- "version": "0.7.2",
3
+ "version": "0.7.3",
4
4
  "description": "CLI for MD4AI — scan Claude projects and sync to your dashboard",
5
5
  "type": "module",
6
6
  "bin": {