conare 0.3.8 → 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 +31 -28
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -3179,23 +3179,25 @@ async function runInstall() {
|
|
|
3179
3179
|
}
|
|
3180
3180
|
const savedApiKey = getSavedApiKey();
|
|
3181
3181
|
const hasTty = !!process.stdin.isTTY && !!process.stdout.isTTY;
|
|
3182
|
-
let apiKey = key || process.env.CONARE_API_KEY ||
|
|
3182
|
+
let apiKey = key || process.env.CONARE_API_KEY || savedApiKey;
|
|
3183
3183
|
if (!apiKey && hasTty) {
|
|
3184
3184
|
const { promptAuth: promptAuthFn } = await Promise.resolve().then(() => (init_interactive(), exports_interactive));
|
|
3185
3185
|
const { spinner: clackSpinner } = await Promise.resolve().then(() => (init_interactive(), exports_interactive));
|
|
3186
|
-
|
|
3187
|
-
|
|
3188
|
-
|
|
3189
|
-
|
|
3190
|
-
|
|
3191
|
-
|
|
3192
|
-
|
|
3193
|
-
|
|
3194
|
-
|
|
3195
|
-
|
|
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 || "";
|
|
3196
3200
|
}
|
|
3197
|
-
} else {
|
|
3198
|
-
apiKey = authResult || "";
|
|
3199
3201
|
}
|
|
3200
3202
|
}
|
|
3201
3203
|
if (!apiKey) {
|
|
@@ -3268,23 +3270,24 @@ async function main() {
|
|
|
3268
3270
|
detectedCount: detected?.sessionCount
|
|
3269
3271
|
};
|
|
3270
3272
|
});
|
|
3271
|
-
apiKey = opts.key || configFileKey || process.env.CONARE_API_KEY;
|
|
3272
3273
|
startSetup();
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
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;
|
|
3285
3290
|
}
|
|
3286
|
-
} else {
|
|
3287
|
-
apiKey = authResult || apiKey;
|
|
3288
3291
|
}
|
|
3289
3292
|
showDetectedApps(interactiveTargets);
|
|
3290
3293
|
selectedSources = await selectChatSources(interactiveTargets);
|