@devness/useai 0.5.25 → 0.5.27

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 +112 -21
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -2681,7 +2681,7 @@ var VERSION;
2681
2681
  var init_version = __esm({
2682
2682
  "../shared/dist/constants/version.js"() {
2683
2683
  "use strict";
2684
- VERSION = "0.5.25";
2684
+ VERSION = "0.5.27";
2685
2685
  }
2686
2686
  });
2687
2687
 
@@ -16663,7 +16663,7 @@ function shortenPath(p) {
16663
16663
  }
16664
16664
  function createSetupRunner(config2) {
16665
16665
  const { productName, tools: allTools, resolveTools: resolveTools2, instructionsText } = config2;
16666
- function showManualHints(installedTools) {
16666
+ function showManualHints2(installedTools) {
16667
16667
  const hints = installedTools.map((t) => ({ name: t.name, hint: t.getManualHint() })).filter((h) => h.hint !== null);
16668
16668
  if (hints.length === 0)
16669
16669
  return;
@@ -16751,7 +16751,7 @@ ${source_default.bold("Examples:")}
16751
16751
  console.log(source_default.red(` \u2717 ${tool.name.padEnd(18)} \u2014 ${err.message}`));
16752
16752
  }
16753
16753
  }
16754
- showManualHints(tools);
16754
+ showManualHints2(tools);
16755
16755
  console.log();
16756
16756
  return;
16757
16757
  }
@@ -16817,7 +16817,7 @@ ${source_default.bold("Examples:")}
16817
16817
  } catch {
16818
16818
  }
16819
16819
  }
16820
- showManualHints([...toInstall, ...alreadyConfigured]);
16820
+ showManualHints2([...toInstall, ...alreadyConfigured]);
16821
16821
  console.log(`
16822
16822
  Done! ${productName} MCP server configured in ${source_default.bold(String(toInstall.length))} tool${toInstall.length === 1 ? "" : "s"}.
16823
16823
  `);
@@ -17061,7 +17061,22 @@ var setup_exports = {};
17061
17061
  __export(setup_exports, {
17062
17062
  runSetup: () => runSetup
17063
17063
  });
17064
- async function daemonInstallFlow(tools, explicit) {
17064
+ function showManualHints(installedTools) {
17065
+ const hints = installedTools.map((t) => ({ name: t.name, hint: t.getManualHint() })).filter((h) => h.hint !== null);
17066
+ if (hints.length === 0) return;
17067
+ console.log(source_default.yellow(`
17068
+ \u26A0 Manual setup needed for ${hints.length} tool${hints.length === 1 ? "" : "s"}:
17069
+ `));
17070
+ for (const { name, hint } of hints) {
17071
+ console.log(` ${source_default.bold(name)}: ${hint}`);
17072
+ }
17073
+ console.log(source_default.dim("\n \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\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510"));
17074
+ for (const line of USEAI_INSTRUCTIONS_TEXT.split("\n")) {
17075
+ console.log(source_default.dim(" \u2502 ") + line);
17076
+ }
17077
+ console.log(source_default.dim(" \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\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n"));
17078
+ }
17079
+ async function daemonInstallFlow(tools, autoYes, explicit) {
17065
17080
  console.log(source_default.dim(" Ensuring UseAI daemon is running..."));
17066
17081
  const daemonOk = await ensureDaemon();
17067
17082
  let useDaemon = true;
@@ -17084,30 +17099,105 @@ async function daemonInstallFlow(tools, explicit) {
17084
17099
  }
17085
17100
  }
17086
17101
  }
17087
- const targetTools = explicit ? tools : tools.filter((t) => t.detect());
17088
- if (targetTools.length === 0) {
17089
- console.log(source_default.red("\n No AI tools detected on this machine."));
17102
+ if (explicit) {
17103
+ console.log();
17104
+ let configuredCount2 = 0;
17105
+ for (const tool of tools) {
17106
+ try {
17107
+ configureToolDaemon(tool, useDaemon);
17108
+ configuredCount2++;
17109
+ } catch (e) {
17110
+ console.log(source_default.red(` \u2717 ${tool.name.padEnd(18)} \u2014 ${e.message}`));
17111
+ }
17112
+ }
17113
+ installHooksAndFinish(tools, configuredCount2, useDaemon);
17090
17114
  return;
17091
17115
  }
17092
- let configuredCount = 0;
17116
+ console.log(source_default.dim("\n Scanning for AI tools...\n"));
17117
+ const detected = tools.filter((t) => t.detect());
17118
+ if (detected.length === 0) {
17119
+ console.log(source_default.red(" No AI tools detected on this machine."));
17120
+ return;
17121
+ }
17122
+ const alreadyConfigured = detected.filter((t) => t.isConfigured());
17123
+ const unconfigured = detected.filter((t) => !t.isConfigured());
17124
+ console.log(` Found ${source_default.bold(String(detected.length))} AI tool${detected.length === 1 ? "" : "s"} on this machine:
17125
+ `);
17126
+ for (const tool of alreadyConfigured) {
17127
+ console.log(source_default.green(` \u2705 ${tool.name}`) + source_default.dim(" (already configured)"));
17128
+ }
17129
+ for (const tool of unconfigured) {
17130
+ console.log(source_default.dim(` \u2610 ${tool.name}`));
17131
+ }
17093
17132
  console.log();
17094
- for (const tool of targetTools) {
17095
- try {
17096
- if (useDaemon && tool.supportsUrl) {
17097
- tool.installHttp();
17098
- console.log(source_default.green(` \u2713 ${tool.name.padEnd(18)} \u2192 ${source_default.dim("HTTP (daemon)")}`));
17099
- } else if (useDaemon && !tool.supportsUrl) {
17100
- tool.install();
17101
- console.log(source_default.green(` \u2713 ${tool.name.padEnd(18)} \u2192 ${source_default.dim("stdio (no URL support)")}`));
17102
- } else {
17103
- tool.install();
17104
- console.log(source_default.green(` \u2713 ${tool.name.padEnd(18)} \u2192 ${source_default.dim("stdio")}`));
17133
+ if (unconfigured.length === 0) {
17134
+ console.log(source_default.green(" All detected tools are already configured."));
17135
+ for (const tool of alreadyConfigured) {
17136
+ try {
17137
+ configureToolDaemon(tool, useDaemon);
17138
+ } catch {
17105
17139
  }
17140
+ }
17141
+ installHooksAndFinish(alreadyConfigured, alreadyConfigured.length, useDaemon);
17142
+ return;
17143
+ }
17144
+ let toInstall;
17145
+ if (autoYes) {
17146
+ toInstall = unconfigured;
17147
+ } else {
17148
+ let selected;
17149
+ try {
17150
+ selected = await dist_default4({
17151
+ message: "Select tools to configure:",
17152
+ choices: unconfigured.map((t) => ({
17153
+ name: t.name,
17154
+ value: t.id,
17155
+ checked: true
17156
+ }))
17157
+ });
17158
+ } catch {
17159
+ console.log("\n");
17160
+ return;
17161
+ }
17162
+ toInstall = unconfigured.filter((t) => selected.includes(t.id));
17163
+ }
17164
+ if (toInstall.length === 0) {
17165
+ console.log(source_default.dim(" No tools selected."));
17166
+ return;
17167
+ }
17168
+ console.log(`
17169
+ Configuring ${toInstall.length} tool${toInstall.length === 1 ? "" : "s"}...
17170
+ `);
17171
+ let configuredCount = 0;
17172
+ for (const tool of toInstall) {
17173
+ try {
17174
+ configureToolDaemon(tool, useDaemon);
17106
17175
  configuredCount++;
17107
17176
  } catch (e) {
17108
17177
  console.log(source_default.red(` \u2717 ${tool.name.padEnd(18)} \u2014 ${e.message}`));
17109
17178
  }
17110
17179
  }
17180
+ for (const tool of alreadyConfigured) {
17181
+ try {
17182
+ configureToolDaemon(tool, useDaemon);
17183
+ } catch {
17184
+ }
17185
+ }
17186
+ installHooksAndFinish([...toInstall, ...alreadyConfigured], configuredCount, useDaemon);
17187
+ }
17188
+ function configureToolDaemon(tool, useDaemon) {
17189
+ if (useDaemon && tool.supportsUrl) {
17190
+ tool.installHttp();
17191
+ console.log(source_default.green(` \u2713 ${tool.name.padEnd(18)} \u2192 ${source_default.dim("HTTP (daemon)")}`));
17192
+ } else if (useDaemon && !tool.supportsUrl) {
17193
+ tool.install();
17194
+ console.log(source_default.green(` \u2713 ${tool.name.padEnd(18)} \u2192 ${source_default.dim("stdio (no URL support)")}`));
17195
+ } else {
17196
+ tool.install();
17197
+ console.log(source_default.green(` \u2713 ${tool.name.padEnd(18)} \u2192 ${source_default.dim("stdio")}`));
17198
+ }
17199
+ }
17200
+ function installHooksAndFinish(allTools, configuredCount, useDaemon) {
17111
17201
  try {
17112
17202
  const hooksInstalled = installClaudeCodeHooks();
17113
17203
  if (hooksInstalled) {
@@ -17116,6 +17206,7 @@ async function daemonInstallFlow(tools, explicit) {
17116
17206
  } catch {
17117
17207
  console.log(source_default.yellow(" \u26A0 Could not install Claude Code hooks"));
17118
17208
  }
17209
+ showManualHints(allTools);
17119
17210
  const mode = useDaemon ? "daemon mode" : "stdio mode";
17120
17211
  console.log(`
17121
17212
  Done! UseAI configured in ${source_default.bold(String(configuredCount))} tool${configuredCount === 1 ? "" : "s"} (${mode}).`);
@@ -17285,7 +17376,7 @@ async function runSetup(args) {
17285
17376
  } else if (isStdio) {
17286
17377
  await shared.installFlow(tools, autoYes, explicit);
17287
17378
  } else {
17288
- await daemonInstallFlow(tools, explicit);
17379
+ await daemonInstallFlow(tools, autoYes, explicit);
17289
17380
  }
17290
17381
  }
17291
17382
  var shared;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devness/useai",
3
- "version": "0.5.25",
3
+ "version": "0.5.27",
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",