conare 0.3.7 → 0.3.9
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 +34 -78
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1024,7 +1024,7 @@ var import_sisteransi, import_picocolors, uD, W, tD, eD, FD = function() {
|
|
|
1024
1024
|
` && (s && o && (F += z(s)), i && (F += K(i)));
|
|
1025
1025
|
}
|
|
1026
1026
|
return F;
|
|
1027
|
-
}, xD, B, AD, S, gD, vD = (e, u, t) => (u in e) ? gD(e, u, { enumerable: true, configurable: true, writable: true, value: t }) : e[u] = t, h = (e, u, t) => (vD(e, typeof u != "symbol" ? u + "" : u, t), t),
|
|
1027
|
+
}, xD, B, AD, S, gD, vD = (e, u, t) => (u in e) ? gD(e, u, { enumerable: true, configurable: true, writable: true, value: t }) : e[u] = t, h = (e, u, t) => (vD(e, typeof u != "symbol" ? u + "" : u, t), t), A, kD, $D = (e, u, t) => (u in e) ? kD(e, u, { enumerable: true, configurable: true, writable: true, value: t }) : e[u] = t, H = (e, u, t) => ($D(e, typeof u != "symbol" ? u + "" : u, t), t), SD, TD, jD = (e, u, t) => (u in e) ? TD(e, u, { enumerable: true, configurable: true, writable: true, value: t }) : e[u] = t, U = (e, u, t) => (jD(e, typeof u != "symbol" ? u + "" : u, t), t), MD, OD, PD = (e, u, t) => (u in e) ? OD(e, u, { enumerable: true, configurable: true, writable: true, value: t }) : e[u] = t, J = (e, u, t) => (PD(e, typeof u != "symbol" ? u + "" : u, t), t), LD;
|
|
1028
1028
|
var init_dist = __esm(() => {
|
|
1029
1029
|
import_sisteransi = __toESM(require_src(), 1);
|
|
1030
1030
|
import_picocolors = __toESM(require_picocolors(), 1);
|
|
@@ -1076,23 +1076,6 @@ var init_dist = __esm(() => {
|
|
|
1076
1076
|
AD = globalThis.process.platform.startsWith("win");
|
|
1077
1077
|
S = Symbol("clack:cancel");
|
|
1078
1078
|
gD = Object.defineProperty;
|
|
1079
|
-
dD = class dD extends x {
|
|
1080
|
-
get cursor() {
|
|
1081
|
-
return this.value ? 0 : 1;
|
|
1082
|
-
}
|
|
1083
|
-
get _value() {
|
|
1084
|
-
return this.cursor === 0;
|
|
1085
|
-
}
|
|
1086
|
-
constructor(u) {
|
|
1087
|
-
super(u, false), this.value = !!u.initialValue, this.on("value", () => {
|
|
1088
|
-
this.value = this._value;
|
|
1089
|
-
}), this.on("confirm", (t) => {
|
|
1090
|
-
this.output.write(import_sisteransi.cursor.move(0, -1)), this.value = t, this.state = "submit", this.close();
|
|
1091
|
-
}), this.on("cursor", () => {
|
|
1092
|
-
this.value = !this.value;
|
|
1093
|
-
});
|
|
1094
|
-
}
|
|
1095
|
-
};
|
|
1096
1079
|
A = new WeakMap;
|
|
1097
1080
|
kD = Object.defineProperty;
|
|
1098
1081
|
SD = class extends x {
|
|
@@ -1221,25 +1204,7 @@ ${import_picocolors2.default.gray(o)}` : ""}`;
|
|
|
1221
1204
|
${import_picocolors2.default.cyan(d2)}
|
|
1222
1205
|
`;
|
|
1223
1206
|
}
|
|
1224
|
-
} }).prompt(),
|
|
1225
|
-
const n = t.active ?? "Yes", r2 = t.inactive ?? "No";
|
|
1226
|
-
return new dD({ active: n, inactive: r2, initialValue: t.initialValue ?? true, render() {
|
|
1227
|
-
const i = `${import_picocolors2.default.gray(o)}
|
|
1228
|
-
${b2(this.state)} ${t.message}
|
|
1229
|
-
`, s = this.value ? n : r2;
|
|
1230
|
-
switch (this.state) {
|
|
1231
|
-
case "submit":
|
|
1232
|
-
return `${i}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.dim(s)}`;
|
|
1233
|
-
case "cancel":
|
|
1234
|
-
return `${i}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(s))}
|
|
1235
|
-
${import_picocolors2.default.gray(o)}`;
|
|
1236
|
-
default:
|
|
1237
|
-
return `${i}${import_picocolors2.default.cyan(o)} ${this.value ? `${import_picocolors2.default.green(k2)} ${n}` : `${import_picocolors2.default.dim(P2)} ${import_picocolors2.default.dim(n)}`} ${import_picocolors2.default.dim("/")} ${this.value ? `${import_picocolors2.default.dim(P2)} ${import_picocolors2.default.dim(r2)}` : `${import_picocolors2.default.green(k2)} ${r2}`}
|
|
1238
|
-
${import_picocolors2.default.cyan(d2)}
|
|
1239
|
-
`;
|
|
1240
|
-
}
|
|
1241
|
-
} }).prompt();
|
|
1242
|
-
}, ve = (t) => {
|
|
1207
|
+
} }).prompt(), ve = (t) => {
|
|
1243
1208
|
const n = (r2, i) => {
|
|
1244
1209
|
const s = r2.label ?? String(r2.value);
|
|
1245
1210
|
switch (i) {
|
|
@@ -1475,18 +1440,6 @@ async function promptAuth(options) {
|
|
|
1475
1440
|
if (options.providedApiKey) {
|
|
1476
1441
|
return options.providedApiKey;
|
|
1477
1442
|
}
|
|
1478
|
-
if (options.savedApiKey) {
|
|
1479
|
-
const useSaved = await ye({
|
|
1480
|
-
message: `Use saved API key ending in ${options.savedApiKey.slice(-6)}?`,
|
|
1481
|
-
initialValue: true
|
|
1482
|
-
});
|
|
1483
|
-
if (pD(useSaved)) {
|
|
1484
|
-
xe("Setup cancelled.");
|
|
1485
|
-
process.exit(0);
|
|
1486
|
-
}
|
|
1487
|
-
if (useSaved)
|
|
1488
|
-
return options.savedApiKey;
|
|
1489
|
-
}
|
|
1490
1443
|
const method = await ve({
|
|
1491
1444
|
message: "How would you like to authenticate?",
|
|
1492
1445
|
options: [
|
|
@@ -1544,7 +1497,7 @@ async function selectMcpTargets(targets) {
|
|
|
1544
1497
|
}));
|
|
1545
1498
|
}
|
|
1546
1499
|
async function confirmIndexCodebase() {
|
|
1547
|
-
return ensureValue(await
|
|
1500
|
+
return ensureValue(await confirm({
|
|
1548
1501
|
message: "Index this codebase too?",
|
|
1549
1502
|
initialValue: false
|
|
1550
1503
|
}));
|
|
@@ -3225,24 +3178,26 @@ async function runInstall() {
|
|
|
3225
3178
|
}
|
|
3226
3179
|
}
|
|
3227
3180
|
const savedApiKey = getSavedApiKey();
|
|
3228
|
-
let apiKey = key || process.env.CONARE_API_KEY || savedApiKey;
|
|
3229
3181
|
const hasTty = !!process.stdin.isTTY && !!process.stdout.isTTY;
|
|
3182
|
+
let apiKey = key || process.env.CONARE_API_KEY || savedApiKey;
|
|
3230
3183
|
if (!apiKey && hasTty) {
|
|
3231
3184
|
const { promptAuth: promptAuthFn } = await Promise.resolve().then(() => (init_interactive(), exports_interactive));
|
|
3232
3185
|
const { spinner: clackSpinner } = await Promise.resolve().then(() => (init_interactive(), exports_interactive));
|
|
3233
|
-
|
|
3234
|
-
|
|
3235
|
-
|
|
3236
|
-
|
|
3237
|
-
|
|
3238
|
-
|
|
3239
|
-
|
|
3240
|
-
|
|
3241
|
-
|
|
3242
|
-
|
|
3186
|
+
if (!apiKey) {
|
|
3187
|
+
const authResult = await promptAuthFn({});
|
|
3188
|
+
if (authResult === "__BROWSER_AUTH__") {
|
|
3189
|
+
const authSpinner = clackSpinner();
|
|
3190
|
+
authSpinner.start("Waiting for browser sign-in...");
|
|
3191
|
+
try {
|
|
3192
|
+
apiKey = await browserAuth();
|
|
3193
|
+
authSpinner.stop("Signed in successfully.");
|
|
3194
|
+
} catch (e2) {
|
|
3195
|
+
authSpinner.stop(`Authentication failed: ${e2.message}`);
|
|
3196
|
+
process.exit(1);
|
|
3197
|
+
}
|
|
3198
|
+
} else {
|
|
3199
|
+
apiKey = authResult || "";
|
|
3243
3200
|
}
|
|
3244
|
-
} else {
|
|
3245
|
-
apiKey = authResult || "";
|
|
3246
3201
|
}
|
|
3247
3202
|
}
|
|
3248
3203
|
if (!apiKey) {
|
|
@@ -3316,22 +3271,23 @@ async function main() {
|
|
|
3316
3271
|
};
|
|
3317
3272
|
});
|
|
3318
3273
|
startSetup();
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3274
|
+
if (!apiKey) {
|
|
3275
|
+
const authResult = await promptAuth({
|
|
3276
|
+
providedApiKey: opts.key
|
|
3277
|
+
});
|
|
3278
|
+
if (authResult === "__BROWSER_AUTH__") {
|
|
3279
|
+
const authSpinner = Y2();
|
|
3280
|
+
authSpinner.start("Waiting for browser sign-in...");
|
|
3281
|
+
try {
|
|
3282
|
+
apiKey = await browserAuth();
|
|
3283
|
+
authSpinner.stop("Signed in successfully.");
|
|
3284
|
+
} catch (e2) {
|
|
3285
|
+
authSpinner.stop(`Authentication failed: ${e2.message}`);
|
|
3286
|
+
process.exit(1);
|
|
3287
|
+
}
|
|
3288
|
+
} else {
|
|
3289
|
+
apiKey = authResult || apiKey;
|
|
3332
3290
|
}
|
|
3333
|
-
} else {
|
|
3334
|
-
apiKey = authResult || apiKey;
|
|
3335
3291
|
}
|
|
3336
3292
|
showDetectedApps(interactiveTargets);
|
|
3337
3293
|
selectedSources = await selectChatSources(interactiveTargets);
|