@devness/useai 0.5.42 → 0.5.43

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.
Files changed (2) hide show
  1. package/dist/index.js +106 -24
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -404,16 +404,33 @@ var init_utilities = __esm({
404
404
  });
405
405
 
406
406
  // ../../node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/index.js
407
+ var source_exports = {};
408
+ __export(source_exports, {
409
+ Chalk: () => Chalk,
410
+ backgroundColorNames: () => backgroundColorNames,
411
+ backgroundColors: () => backgroundColorNames,
412
+ chalkStderr: () => chalkStderr,
413
+ colorNames: () => colorNames,
414
+ colors: () => colorNames,
415
+ default: () => source_default,
416
+ foregroundColorNames: () => foregroundColorNames,
417
+ foregroundColors: () => foregroundColorNames,
418
+ modifierNames: () => modifierNames,
419
+ modifiers: () => modifierNames,
420
+ supportsColor: () => stdoutColor,
421
+ supportsColorStderr: () => stderrColor
422
+ });
407
423
  function createChalk(options) {
408
424
  return chalkFactory(options);
409
425
  }
410
- var stdoutColor, stderrColor, GENERATOR, STYLER, IS_EMPTY, levelMapping, styles2, applyOptions, chalkFactory, getModelAnsi, usedModels, proto, createStyler, createBuilder, applyStyle, chalk, chalkStderr, source_default;
426
+ var stdoutColor, stderrColor, GENERATOR, STYLER, IS_EMPTY, levelMapping, styles2, applyOptions, Chalk, chalkFactory, getModelAnsi, usedModels, proto, createStyler, createBuilder, applyStyle, chalk, chalkStderr, source_default;
411
427
  var init_source = __esm({
412
428
  "../../node_modules/.pnpm/chalk@5.6.2/node_modules/chalk/source/index.js"() {
413
429
  "use strict";
414
430
  init_ansi_styles();
415
431
  init_supports_color();
416
432
  init_utilities();
433
+ init_ansi_styles();
417
434
  ({ stdout: stdoutColor, stderr: stderrColor } = supports_color_default);
418
435
  GENERATOR = /* @__PURE__ */ Symbol("GENERATOR");
419
436
  STYLER = /* @__PURE__ */ Symbol("STYLER");
@@ -432,6 +449,11 @@ var init_source = __esm({
432
449
  const colorLevel = stdoutColor ? stdoutColor.level : 0;
433
450
  object3.level = options.level === void 0 ? colorLevel : options.level;
434
451
  };
452
+ Chalk = class {
453
+ constructor(options) {
454
+ return chalkFactory(options);
455
+ }
456
+ };
435
457
  chalkFactory = (options) => {
436
458
  const chalk2 = (...strings) => strings.join(" ");
437
459
  applyOptions(chalk2, options);
@@ -662,7 +684,7 @@ var VERSION;
662
684
  var init_version = __esm({
663
685
  "../shared/dist/constants/version.js"() {
664
686
  "use strict";
665
- VERSION = "0.5.42";
687
+ VERSION = "0.5.43";
666
688
  }
667
689
  });
668
690
 
@@ -14227,6 +14249,13 @@ var require_dist = __commonJS({
14227
14249
  });
14228
14250
 
14229
14251
  // src/tools.ts
14252
+ var tools_exports = {};
14253
+ __export(tools_exports, {
14254
+ AI_TOOLS: () => AI_TOOLS,
14255
+ MCP_HTTP_URL: () => MCP_HTTP_URL,
14256
+ USEAI_INSTRUCTIONS_TEXT: () => USEAI_INSTRUCTIONS_TEXT,
14257
+ resolveTools: () => resolveTools
14258
+ });
14230
14259
  import { createToolRegistry } from "@devness/mcp-setup/dist/registry.js";
14231
14260
  import { existsSync as existsSync6, readFileSync as readFileSync4, writeFileSync as writeFileSync4, mkdirSync as mkdirSync4 } from "fs";
14232
14261
  import { dirname as dirname2 } from "path";
@@ -35739,46 +35768,99 @@ if (subcommand === "mcp" || subcommand?.startsWith("--") || !subcommand && proce
35739
35768
  process.exit(0);
35740
35769
  }
35741
35770
  if (subcommand === "update") {
35742
- const { fetchLatestVersion: fetchLatestVersion2, fetchDaemonHealth: fetchDaemonHealth2, killDaemon: killDaemon2, ensureDaemon: ensureDaemon2, VERSION: VERSION3 } = await Promise.resolve().then(() => (init_dist(), dist_exports));
35743
- console.log(`Current version: ${VERSION3}`);
35744
- console.log("Checking for updates...");
35771
+ const { default: chalk2 } = await Promise.resolve().then(() => (init_source(), source_exports));
35772
+ const { fetchLatestVersion: fetchLatestVersion2, fetchDaemonHealth: fetchDaemonHealth2, killDaemon: killDaemon2, ensureDaemon: ensureDaemon2, installClaudeCodeHooks: installClaudeCodeHooks2, VERSION: VERSION3 } = await Promise.resolve().then(() => (init_dist(), dist_exports));
35773
+ const { AI_TOOLS: AI_TOOLS2 } = await Promise.resolve().then(() => (init_tools(), tools_exports));
35774
+ console.log(chalk2.dim(" Checking for updates..."));
35745
35775
  const latest = await fetchLatestVersion2();
35746
35776
  if (!latest) {
35747
- console.error("Failed to fetch latest version from npm.");
35777
+ console.log(chalk2.red(" \u2717 Could not reach npm registry"));
35748
35778
  process.exit(1);
35749
35779
  }
35750
- console.log(`Latest version: ${latest}`);
35751
35780
  const healthBefore = await fetchDaemonHealth2();
35752
- const runningVersion = healthBefore?.version;
35753
- if (runningVersion) {
35754
- console.log(`Running daemon: ${runningVersion}`);
35755
- }
35781
+ const runningVersion = healthBefore?.version ?? VERSION3;
35756
35782
  if (runningVersion === latest && VERSION3 === latest) {
35757
- console.log("Already up to date.");
35783
+ console.log(chalk2.green(` \u2713 Already up to date (v${latest})`));
35758
35784
  process.exit(0);
35759
35785
  }
35760
- console.log("Stopping daemon...");
35786
+ console.log(` ${chalk2.dim("Current:")} v${runningVersion}`);
35787
+ console.log(` ${chalk2.dim("Latest:")} v${latest}`);
35788
+ console.log();
35789
+ const configuredTools = AI_TOOLS2.filter((t) => {
35790
+ try {
35791
+ return t.isConfigured();
35792
+ } catch {
35793
+ return false;
35794
+ }
35795
+ });
35796
+ if (configuredTools.length > 0) {
35797
+ console.log(chalk2.dim(" Removing MCP configs from configured tools..."));
35798
+ for (const tool of configuredTools) {
35799
+ try {
35800
+ tool.remove();
35801
+ console.log(chalk2.dim(` \u21BB ${tool.name}`));
35802
+ } catch {
35803
+ console.log(chalk2.red(` \u2717 Failed to remove ${tool.name}`));
35804
+ }
35805
+ }
35806
+ console.log();
35807
+ }
35808
+ console.log(chalk2.dim(" Stopping daemon..."));
35761
35809
  await killDaemon2();
35762
- console.log("Clearing npx cache...");
35810
+ console.log(chalk2.dim(" Clearing npx cache..."));
35763
35811
  const { execSync: execSync4 } = await import("child_process");
35764
35812
  try {
35765
35813
  execSync4("npm cache clean --force", { stdio: "ignore", timeout: 15e3 });
35766
35814
  } catch {
35767
35815
  }
35768
- console.log("Restarting daemon...");
35769
- const ok = await ensureDaemon2({ preferOnline: true });
35770
- if (!ok) {
35771
- console.error("Daemon failed to start after update.");
35816
+ console.log(chalk2.dim(" Starting updated daemon..."));
35817
+ const daemonOk = await ensureDaemon2({ preferOnline: true });
35818
+ if (!daemonOk) {
35819
+ console.log(chalk2.red(" \u2717 Failed to start updated daemon"));
35820
+ if (configuredTools.length > 0) {
35821
+ console.log(chalk2.dim("\n Reinstalling MCP configs (stdio fallback)..."));
35822
+ for (const tool of configuredTools) {
35823
+ try {
35824
+ tool.install();
35825
+ console.log(chalk2.green(` \u2713 ${tool.name} \u2192 ${chalk2.dim("stdio")}`));
35826
+ } catch {
35827
+ console.log(chalk2.red(` \u2717 ${tool.name}`));
35828
+ }
35829
+ }
35830
+ }
35772
35831
  process.exit(1);
35773
35832
  }
35774
35833
  const healthAfter = await fetchDaemonHealth2();
35775
- const newVersion = healthAfter?.version;
35776
- console.log(`Daemon now running: ${newVersion ?? "unknown"}`);
35777
- if (newVersion === latest) {
35778
- console.log("Update successful!");
35779
- } else {
35780
- console.log("Warning: daemon version does not match latest. You may need to retry.");
35834
+ const newVersion = healthAfter?.version ?? "unknown";
35835
+ console.log(chalk2.green(`
35836
+ \u2713 Daemon updated: v${runningVersion} \u2192 v${newVersion}`));
35837
+ if (configuredTools.length > 0) {
35838
+ console.log(chalk2.dim("\n Reinstalling MCP configs..."));
35839
+ for (const tool of configuredTools) {
35840
+ try {
35841
+ if (tool.supportsUrl) {
35842
+ tool.installHttp();
35843
+ console.log(chalk2.green(` \u2713 ${tool.name} \u2192 ${chalk2.dim("HTTP (daemon)")}`));
35844
+ } else {
35845
+ tool.install();
35846
+ console.log(chalk2.green(` \u2713 ${tool.name} \u2192 ${chalk2.dim("stdio")}`));
35847
+ }
35848
+ } catch {
35849
+ console.log(chalk2.red(` \u2717 ${tool.name}`));
35850
+ }
35851
+ }
35781
35852
  }
35853
+ try {
35854
+ const hooksInstalled = installClaudeCodeHooks2();
35855
+ if (hooksInstalled) {
35856
+ console.log(chalk2.green(" \u2713 Claude Code hooks reinstalled"));
35857
+ }
35858
+ } catch {
35859
+ }
35860
+ console.log(`
35861
+ Done! UseAI updated to v${newVersion} in ${chalk2.bold(String(configuredTools.length))} tool${configuredTools.length === 1 ? "" : "s"}.`);
35862
+ console.log(chalk2.dim(` Dashboard: http://127.0.0.1:19200/dashboard
35863
+ `));
35782
35864
  process.exit(0);
35783
35865
  }
35784
35866
  if (subcommand === "daemon") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devness/useai",
3
- "version": "0.5.42",
3
+ "version": "0.5.43",
4
4
  "description": "Track your AI-assisted development workflow. MCP server that records usage metrics across all your AI tools.",
5
5
  "keywords": [
6
6
  "mcp",