@devness/useai 0.5.26 → 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.
- package/dist/index.js +94 -19
- 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.
|
|
2684
|
+
VERSION = "0.5.27";
|
|
2685
2685
|
}
|
|
2686
2686
|
});
|
|
2687
2687
|
|
|
@@ -17076,7 +17076,7 @@ function showManualHints(installedTools) {
|
|
|
17076
17076
|
}
|
|
17077
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
17078
|
}
|
|
17079
|
-
async function daemonInstallFlow(tools, explicit) {
|
|
17079
|
+
async function daemonInstallFlow(tools, autoYes, explicit) {
|
|
17080
17080
|
console.log(source_default.dim(" Ensuring UseAI daemon is running..."));
|
|
17081
17081
|
const daemonOk = await ensureDaemon();
|
|
17082
17082
|
let useDaemon = true;
|
|
@@ -17099,30 +17099,105 @@ async function daemonInstallFlow(tools, explicit) {
|
|
|
17099
17099
|
}
|
|
17100
17100
|
}
|
|
17101
17101
|
}
|
|
17102
|
-
|
|
17103
|
-
|
|
17104
|
-
|
|
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);
|
|
17105
17114
|
return;
|
|
17106
17115
|
}
|
|
17107
|
-
|
|
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
|
+
}
|
|
17108
17132
|
console.log();
|
|
17109
|
-
|
|
17110
|
-
|
|
17111
|
-
|
|
17112
|
-
|
|
17113
|
-
|
|
17114
|
-
}
|
|
17115
|
-
tool.install();
|
|
17116
|
-
console.log(source_default.green(` \u2713 ${tool.name.padEnd(18)} \u2192 ${source_default.dim("stdio (no URL support)")}`));
|
|
17117
|
-
} else {
|
|
17118
|
-
tool.install();
|
|
17119
|
-
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 {
|
|
17120
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);
|
|
17121
17175
|
configuredCount++;
|
|
17122
17176
|
} catch (e) {
|
|
17123
17177
|
console.log(source_default.red(` \u2717 ${tool.name.padEnd(18)} \u2014 ${e.message}`));
|
|
17124
17178
|
}
|
|
17125
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) {
|
|
17126
17201
|
try {
|
|
17127
17202
|
const hooksInstalled = installClaudeCodeHooks();
|
|
17128
17203
|
if (hooksInstalled) {
|
|
@@ -17131,7 +17206,7 @@ async function daemonInstallFlow(tools, explicit) {
|
|
|
17131
17206
|
} catch {
|
|
17132
17207
|
console.log(source_default.yellow(" \u26A0 Could not install Claude Code hooks"));
|
|
17133
17208
|
}
|
|
17134
|
-
showManualHints(
|
|
17209
|
+
showManualHints(allTools);
|
|
17135
17210
|
const mode = useDaemon ? "daemon mode" : "stdio mode";
|
|
17136
17211
|
console.log(`
|
|
17137
17212
|
Done! UseAI configured in ${source_default.bold(String(configuredCount))} tool${configuredCount === 1 ? "" : "s"} (${mode}).`);
|
|
@@ -17301,7 +17376,7 @@ async function runSetup(args) {
|
|
|
17301
17376
|
} else if (isStdio) {
|
|
17302
17377
|
await shared.installFlow(tools, autoYes, explicit);
|
|
17303
17378
|
} else {
|
|
17304
|
-
await daemonInstallFlow(tools, explicit);
|
|
17379
|
+
await daemonInstallFlow(tools, autoYes, explicit);
|
|
17305
17380
|
}
|
|
17306
17381
|
}
|
|
17307
17382
|
var shared;
|