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.
Files changed (2) hide show
  1. package/dist/index.js +31 -28
  2. 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 || (!hasTty ? savedApiKey : undefined);
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
- const authResult = await promptAuthFn({});
3187
- if (authResult === "__BROWSER_AUTH__") {
3188
- const authSpinner = clackSpinner();
3189
- authSpinner.start("Waiting for browser sign-in...");
3190
- try {
3191
- apiKey = await browserAuth();
3192
- authSpinner.stop("Signed in successfully.");
3193
- } catch (e2) {
3194
- authSpinner.stop(`Authentication failed: ${e2.message}`);
3195
- process.exit(1);
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
- const authResult = await promptAuth({
3274
- providedApiKey: opts.key
3275
- });
3276
- if (authResult === "__BROWSER_AUTH__") {
3277
- const authSpinner = Y2();
3278
- authSpinner.start("Waiting for browser sign-in...");
3279
- try {
3280
- apiKey = await browserAuth();
3281
- authSpinner.stop("Signed in successfully.");
3282
- } catch (e2) {
3283
- authSpinner.stop(`Authentication failed: ${e2.message}`);
3284
- process.exit(1);
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);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conare",
3
- "version": "0.3.8",
3
+ "version": "0.3.9",
4
4
  "description": "Conare CLI for ingesting AI chat history and configuring memory at conare.ai",
5
5
  "type": "module",
6
6
  "bin": {