conare 0.3.7 → 0.3.8

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 +6 -53
  2. 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), dD, 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;
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(), ye = (t) => {
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 ye({
1500
+ return ensureValue(await confirm({
1548
1501
  message: "Index this codebase too?",
1549
1502
  initialValue: false
1550
1503
  }));
@@ -3225,12 +3178,12 @@ 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 || (!hasTty ? savedApiKey : undefined);
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
- const authResult = await promptAuthFn({ savedApiKey });
3186
+ const authResult = await promptAuthFn({});
3234
3187
  if (authResult === "__BROWSER_AUTH__") {
3235
3188
  const authSpinner = clackSpinner();
3236
3189
  authSpinner.start("Waiting for browser sign-in...");
@@ -3315,9 +3268,9 @@ async function main() {
3315
3268
  detectedCount: detected?.sessionCount
3316
3269
  };
3317
3270
  });
3271
+ apiKey = opts.key || configFileKey || process.env.CONARE_API_KEY;
3318
3272
  startSetup();
3319
3273
  const authResult = await promptAuth({
3320
- savedApiKey,
3321
3274
  providedApiKey: opts.key
3322
3275
  });
3323
3276
  if (authResult === "__BROWSER_AUTH__") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conare",
3
- "version": "0.3.7",
3
+ "version": "0.3.8",
4
4
  "description": "Conare CLI for ingesting AI chat history and configuring memory at conare.ai",
5
5
  "type": "module",
6
6
  "bin": {