conare 0.6.3 → 0.6.5
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 +60 -357
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -126,9 +126,13 @@ function parseTimestampMs(value) {
|
|
|
126
126
|
const parsed = Date.parse(trimmed);
|
|
127
127
|
return Number.isFinite(parsed) ? parsed : null;
|
|
128
128
|
}
|
|
129
|
+
function setSaveAmount(amount) {
|
|
130
|
+
if (amount)
|
|
131
|
+
minSubstantive = SAVE_AMOUNT_FLOOR[amount];
|
|
132
|
+
}
|
|
129
133
|
function isNarration(text) {
|
|
130
134
|
const stripped = text.trim();
|
|
131
|
-
if (stripped.length <
|
|
135
|
+
if (stripped.length < minSubstantive)
|
|
132
136
|
return true;
|
|
133
137
|
if (stripped.length <= 300 && NARRATION_RE.test(stripped))
|
|
134
138
|
return true;
|
|
@@ -242,8 +246,14 @@ function clearIngested(source) {
|
|
|
242
246
|
}
|
|
243
247
|
var activeScope = null, MAX_MEMORY_CONTENT = 200000, TRUNCATED_USER_MSG = 3000, TRUNCATED_MARKER = `
|
|
244
248
|
|
|
245
|
-
...[truncated to fit Conare upload limit]`,
|
|
249
|
+
...[truncated to fit Conare upload limit]`, SAVE_AMOUNT_FLOOR, minSubstantive, NARRATION_RE, remoteCache, CASE_INSENSITIVE_FS;
|
|
246
250
|
var init_shared = __esm(() => {
|
|
251
|
+
SAVE_AMOUNT_FLOOR = {
|
|
252
|
+
essentials: 500,
|
|
253
|
+
balanced: 200,
|
|
254
|
+
everything: 0
|
|
255
|
+
};
|
|
256
|
+
minSubstantive = SAVE_AMOUNT_FLOOR.balanced;
|
|
247
257
|
NARRATION_RE = /^[\s\n]*(Let me |Now let me |Now I['\u2019]|Now add |Now fix |Now replace |Now integrate |Now update |Now pass |Now clean |Now build|Update the |Builds clean|Deployed\.|Wait, I |Let['\u2019]s test |Good —|Great\.|Perfect\.|Alright|OK,? let me|I[''\u2019]ll |Starting |I need to |Need |I found |I read |I[''\u2019]ve (loaded|confirmed|verified)|Context loaded|Next (I[''\u2019]|step)|Deps confirm|Diff check|Still missing|I[''\u2019]ll (do|check|inspect|trace|run|grab|pull|read|verify))/;
|
|
248
258
|
remoteCache = new Map;
|
|
249
259
|
CASE_INSENSITIVE_FS = process.platform === "darwin" || process.platform === "win32";
|
|
@@ -1023,21 +1033,6 @@ function Y(e, u, t) {
|
|
|
1023
1033
|
`).map((F) => lD(F, u, t)).join(`
|
|
1024
1034
|
`);
|
|
1025
1035
|
}
|
|
1026
|
-
function cD(e) {
|
|
1027
|
-
for (const u in e) {
|
|
1028
|
-
const t = u;
|
|
1029
|
-
if (!Object.hasOwn(e, t))
|
|
1030
|
-
continue;
|
|
1031
|
-
const F = e[t];
|
|
1032
|
-
switch (t) {
|
|
1033
|
-
case "aliases": {
|
|
1034
|
-
for (const s in F)
|
|
1035
|
-
Object.hasOwn(F, s) && (B.aliases.has(s) || B.aliases.set(s, F[s]));
|
|
1036
|
-
break;
|
|
1037
|
-
}
|
|
1038
|
-
}
|
|
1039
|
-
}
|
|
1040
|
-
}
|
|
1041
1036
|
function $(e, u) {
|
|
1042
1037
|
if (typeof e == "string")
|
|
1043
1038
|
return B.aliases.get(e) === u;
|
|
@@ -1245,14 +1240,7 @@ var import_sisteransi, import_picocolors, uD, W, tD, eD, FD = function() {
|
|
|
1245
1240
|
` && (s && o && (F += z(s)), i && (F += K(i)));
|
|
1246
1241
|
}
|
|
1247
1242
|
return F;
|
|
1248
|
-
}, 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),
|
|
1249
|
-
if (!u.has(e))
|
|
1250
|
-
throw TypeError("Cannot " + t);
|
|
1251
|
-
}, T = (e, u, t) => (q(e, u, "read from private field"), t ? t.call(e) : u.get(e)), wD = (e, u, t) => {
|
|
1252
|
-
if (u.has(e))
|
|
1253
|
-
throw TypeError("Cannot add the same private member more than once");
|
|
1254
|
-
u instanceof WeakSet ? u.add(e) : u.set(e, t);
|
|
1255
|
-
}, yD = (e, u, t, F) => (q(e, u, "write to private field"), F ? F.call(e, t) : u.set(e, t), t), A, _D, 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, WD, ND = (e, u, t) => (u in e) ? WD(e, u, { enumerable: true, configurable: true, writable: true, value: t }) : e[u] = t, Q = (e, u, t) => (ND(e, typeof u != "symbol" ? u + "" : u, t), t), ID, RD;
|
|
1243
|
+
}, 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;
|
|
1256
1244
|
var init_dist = __esm(() => {
|
|
1257
1245
|
import_sisteransi = __toESM(require_src(), 1);
|
|
1258
1246
|
import_picocolors = __toESM(require_picocolors(), 1);
|
|
@@ -1304,67 +1292,6 @@ var init_dist = __esm(() => {
|
|
|
1304
1292
|
AD = globalThis.process.platform.startsWith("win");
|
|
1305
1293
|
S = Symbol("clack:cancel");
|
|
1306
1294
|
gD = Object.defineProperty;
|
|
1307
|
-
dD = class dD extends x {
|
|
1308
|
-
get cursor() {
|
|
1309
|
-
return this.value ? 0 : 1;
|
|
1310
|
-
}
|
|
1311
|
-
get _value() {
|
|
1312
|
-
return this.cursor === 0;
|
|
1313
|
-
}
|
|
1314
|
-
constructor(u) {
|
|
1315
|
-
super(u, false), this.value = !!u.initialValue, this.on("value", () => {
|
|
1316
|
-
this.value = this._value;
|
|
1317
|
-
}), this.on("confirm", (t) => {
|
|
1318
|
-
this.output.write(import_sisteransi.cursor.move(0, -1)), this.value = t, this.state = "submit", this.close();
|
|
1319
|
-
}), this.on("cursor", () => {
|
|
1320
|
-
this.value = !this.value;
|
|
1321
|
-
});
|
|
1322
|
-
}
|
|
1323
|
-
};
|
|
1324
|
-
mD = Object.defineProperty;
|
|
1325
|
-
_D = class extends x {
|
|
1326
|
-
constructor(u) {
|
|
1327
|
-
super(u, false), Z(this, "options"), Z(this, "cursor", 0), wD(this, A, undefined);
|
|
1328
|
-
const { options: t } = u;
|
|
1329
|
-
yD(this, A, u.selectableGroups !== false), this.options = Object.entries(t).flatMap(([F, s]) => [{ value: F, group: true, label: F }, ...s.map((i) => ({ ...i, group: F }))]), this.value = [...u.initialValues ?? []], this.cursor = Math.max(this.options.findIndex(({ value: F }) => F === u.cursorAt), T(this, A) ? 0 : 1), this.on("cursor", (F) => {
|
|
1330
|
-
switch (F) {
|
|
1331
|
-
case "left":
|
|
1332
|
-
case "up": {
|
|
1333
|
-
this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
|
|
1334
|
-
const s = this.options[this.cursor]?.group === true;
|
|
1335
|
-
!T(this, A) && s && (this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1);
|
|
1336
|
-
break;
|
|
1337
|
-
}
|
|
1338
|
-
case "down":
|
|
1339
|
-
case "right": {
|
|
1340
|
-
this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
|
|
1341
|
-
const s = this.options[this.cursor]?.group === true;
|
|
1342
|
-
!T(this, A) && s && (this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1);
|
|
1343
|
-
break;
|
|
1344
|
-
}
|
|
1345
|
-
case "space":
|
|
1346
|
-
this.toggleValue();
|
|
1347
|
-
break;
|
|
1348
|
-
}
|
|
1349
|
-
});
|
|
1350
|
-
}
|
|
1351
|
-
getGroupItems(u) {
|
|
1352
|
-
return this.options.filter((t) => t.group === u);
|
|
1353
|
-
}
|
|
1354
|
-
isGroupSelected(u) {
|
|
1355
|
-
return this.getGroupItems(u).every((t) => this.value.includes(t.value));
|
|
1356
|
-
}
|
|
1357
|
-
toggleValue() {
|
|
1358
|
-
const u = this.options[this.cursor];
|
|
1359
|
-
if (u.group === true) {
|
|
1360
|
-
const t = u.value, F = this.getGroupItems(t);
|
|
1361
|
-
this.isGroupSelected(t) ? this.value = this.value.filter((s) => F.findIndex((i) => i.value === s) === -1) : this.value = [...this.value, ...F.map((s) => s.value)], this.value = Array.from(new Set(this.value));
|
|
1362
|
-
} else {
|
|
1363
|
-
const t = this.value.includes(u.value);
|
|
1364
|
-
this.value = t ? this.value.filter((F) => F !== u.value) : [...this.value, u.value];
|
|
1365
|
-
}
|
|
1366
|
-
}
|
|
1367
|
-
};
|
|
1368
1295
|
A = new WeakMap;
|
|
1369
1296
|
kD = Object.defineProperty;
|
|
1370
1297
|
SD = class extends x {
|
|
@@ -1444,67 +1371,15 @@ var init_dist = __esm(() => {
|
|
|
1444
1371
|
this.value = this._value.value;
|
|
1445
1372
|
}
|
|
1446
1373
|
};
|
|
1447
|
-
WD = Object.defineProperty;
|
|
1448
|
-
ID = class ID extends x {
|
|
1449
|
-
constructor(u) {
|
|
1450
|
-
super(u, false), Q(this, "options"), Q(this, "cursor", 0), this.options = u.options;
|
|
1451
|
-
const t = this.options.map(({ value: [F] }) => F?.toLowerCase());
|
|
1452
|
-
this.cursor = Math.max(t.indexOf(u.initialValue), 0), this.on("key", (F) => {
|
|
1453
|
-
if (!t.includes(F))
|
|
1454
|
-
return;
|
|
1455
|
-
const s = this.options.find(({ value: [i] }) => i?.toLowerCase() === F);
|
|
1456
|
-
s && (this.value = s.value, this.state = "submit", this.emit("submit"));
|
|
1457
|
-
});
|
|
1458
|
-
}
|
|
1459
|
-
};
|
|
1460
|
-
RD = class RD extends x {
|
|
1461
|
-
get valueWithCursor() {
|
|
1462
|
-
if (this.state === "submit")
|
|
1463
|
-
return this.value;
|
|
1464
|
-
if (this.cursor >= this.value.length)
|
|
1465
|
-
return `${this.value}█`;
|
|
1466
|
-
const u = this.value.slice(0, this.cursor), [t, ...F] = this.value.slice(this.cursor);
|
|
1467
|
-
return `${u}${import_picocolors.default.inverse(t)}${F.join("")}`;
|
|
1468
|
-
}
|
|
1469
|
-
get cursor() {
|
|
1470
|
-
return this._cursor;
|
|
1471
|
-
}
|
|
1472
|
-
constructor(u) {
|
|
1473
|
-
super(u), this.on("finalize", () => {
|
|
1474
|
-
this.value || (this.value = u.defaultValue);
|
|
1475
|
-
});
|
|
1476
|
-
}
|
|
1477
|
-
};
|
|
1478
1374
|
});
|
|
1479
1375
|
|
|
1480
1376
|
// node_modules/@clack/prompts/dist/index.mjs
|
|
1481
|
-
var exports_dist = {};
|
|
1482
|
-
__export(exports_dist, {
|
|
1483
|
-
updateSettings: () => cD,
|
|
1484
|
-
text: () => he,
|
|
1485
|
-
tasks: () => Te,
|
|
1486
|
-
stream: () => x2,
|
|
1487
|
-
spinner: () => Y2,
|
|
1488
|
-
selectKey: () => we,
|
|
1489
|
-
select: () => ve,
|
|
1490
|
-
password: () => ge,
|
|
1491
|
-
outro: () => Se,
|
|
1492
|
-
note: () => Me,
|
|
1493
|
-
multiselect: () => fe,
|
|
1494
|
-
log: () => M2,
|
|
1495
|
-
isCancel: () => pD,
|
|
1496
|
-
intro: () => Ie,
|
|
1497
|
-
groupMultiselect: () => be,
|
|
1498
|
-
group: () => Ce,
|
|
1499
|
-
confirm: () => ye,
|
|
1500
|
-
cancel: () => xe
|
|
1501
|
-
});
|
|
1502
1377
|
import { stripVTControlCharacters as S2 } from "node:util";
|
|
1503
1378
|
import y2 from "node:process";
|
|
1504
1379
|
function ce() {
|
|
1505
1380
|
return y2.platform !== "win32" ? y2.env.TERM !== "linux" : !!y2.env.CI || !!y2.env.WT_SESSION || !!y2.env.TERMINUS_SUBLIME || y2.env.ConEmuTask === "{cmd::Cmder}" || y2.env.TERM_PROGRAM === "Terminus-Sublime" || y2.env.TERM_PROGRAM === "vscode" || y2.env.TERM === "xterm-256color" || y2.env.TERM === "alacritty" || y2.env.TERMINAL_EMULATOR === "JetBrains-JediTerm";
|
|
1506
1381
|
}
|
|
1507
|
-
var import_picocolors2, import_sisteransi2, V2, u = (t, n) => V2 ? t : n, le, L2, W2, C, ue, o, d2, k2, P2, A2,
|
|
1382
|
+
var import_picocolors2, import_sisteransi2, V2, u = (t, n) => V2 ? t : n, le, L2, W2, C, ue, o, d2, k2, P2, A2, T, F, $e, _2, me, de, pe, q, D, U2, K2, b2 = (t) => {
|
|
1508
1383
|
switch (t) {
|
|
1509
1384
|
case "initial":
|
|
1510
1385
|
case "active":
|
|
@@ -1525,27 +1400,7 @@ var import_picocolors2, import_sisteransi2, V2, u = (t, n) => V2 ? t : n, le, L2
|
|
|
1525
1400
|
const j2 = v2 === 0 && $2, E = v2 === f.length - 1 && g2;
|
|
1526
1401
|
return j2 || E ? import_picocolors2.default.dim("...") : i(p2, v2 + l2 === n);
|
|
1527
1402
|
});
|
|
1528
|
-
},
|
|
1529
|
-
const n = `${import_picocolors2.default.gray(o)}
|
|
1530
|
-
${b2(this.state)} ${t.message}
|
|
1531
|
-
`, r2 = t.placeholder ? import_picocolors2.default.inverse(t.placeholder[0]) + import_picocolors2.default.dim(t.placeholder.slice(1)) : import_picocolors2.default.inverse(import_picocolors2.default.hidden("_")), i = this.value ? this.valueWithCursor : r2;
|
|
1532
|
-
switch (this.state) {
|
|
1533
|
-
case "error":
|
|
1534
|
-
return `${n.trim()}
|
|
1535
|
-
${import_picocolors2.default.yellow(o)} ${i}
|
|
1536
|
-
${import_picocolors2.default.yellow(d2)} ${import_picocolors2.default.yellow(this.error)}
|
|
1537
|
-
`;
|
|
1538
|
-
case "submit":
|
|
1539
|
-
return `${n}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.dim(this.value || t.placeholder)}`;
|
|
1540
|
-
case "cancel":
|
|
1541
|
-
return `${n}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(this.value ?? ""))}${this.value?.trim() ? `
|
|
1542
|
-
${import_picocolors2.default.gray(o)}` : ""}`;
|
|
1543
|
-
default:
|
|
1544
|
-
return `${n}${import_picocolors2.default.cyan(o)} ${i}
|
|
1545
|
-
${import_picocolors2.default.cyan(d2)}
|
|
1546
|
-
`;
|
|
1547
|
-
}
|
|
1548
|
-
} }).prompt(), ge = (t) => new MD({ validate: t.validate, mask: t.mask ?? $e, render() {
|
|
1403
|
+
}, ge = (t) => new MD({ validate: t.validate, mask: t.mask ?? $e, render() {
|
|
1549
1404
|
const n = `${import_picocolors2.default.gray(o)}
|
|
1550
1405
|
${b2(this.state)} ${t.message}
|
|
1551
1406
|
`, r2 = this.valueWithCursor, i = this.masked;
|
|
@@ -1565,25 +1420,7 @@ ${import_picocolors2.default.gray(o)}` : ""}`;
|
|
|
1565
1420
|
${import_picocolors2.default.cyan(d2)}
|
|
1566
1421
|
`;
|
|
1567
1422
|
}
|
|
1568
|
-
} }).prompt(),
|
|
1569
|
-
const n = t.active ?? "Yes", r2 = t.inactive ?? "No";
|
|
1570
|
-
return new dD({ active: n, inactive: r2, initialValue: t.initialValue ?? true, render() {
|
|
1571
|
-
const i = `${import_picocolors2.default.gray(o)}
|
|
1572
|
-
${b2(this.state)} ${t.message}
|
|
1573
|
-
`, s = this.value ? n : r2;
|
|
1574
|
-
switch (this.state) {
|
|
1575
|
-
case "submit":
|
|
1576
|
-
return `${i}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.dim(s)}`;
|
|
1577
|
-
case "cancel":
|
|
1578
|
-
return `${i}${import_picocolors2.default.gray(o)} ${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(s))}
|
|
1579
|
-
${import_picocolors2.default.gray(o)}`;
|
|
1580
|
-
default:
|
|
1581
|
-
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}`}
|
|
1582
|
-
${import_picocolors2.default.cyan(d2)}
|
|
1583
|
-
`;
|
|
1584
|
-
}
|
|
1585
|
-
} }).prompt();
|
|
1586
|
-
}, ve = (t) => {
|
|
1423
|
+
} }).prompt(), ve = (t) => {
|
|
1587
1424
|
const n = (r2, i) => {
|
|
1588
1425
|
const s = r2.label ?? String(r2.value);
|
|
1589
1426
|
switch (i) {
|
|
@@ -1611,35 +1448,13 @@ ${import_picocolors2.default.gray(o)}`;
|
|
|
1611
1448
|
return `${r2}${import_picocolors2.default.cyan(o)} ${G2({ cursor: this.cursor, options: this.options, maxItems: t.maxItems, style: (i, s) => n(i, s ? "active" : "inactive") }).join(`
|
|
1612
1449
|
${import_picocolors2.default.cyan(o)} `)}
|
|
1613
1450
|
${import_picocolors2.default.cyan(d2)}
|
|
1614
|
-
`;
|
|
1615
|
-
}
|
|
1616
|
-
} }).prompt();
|
|
1617
|
-
}, we = (t) => {
|
|
1618
|
-
const n = (r2, i = "inactive") => {
|
|
1619
|
-
const s = r2.label ?? String(r2.value);
|
|
1620
|
-
return i === "selected" ? `${import_picocolors2.default.dim(s)}` : i === "cancelled" ? `${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(s))}` : i === "active" ? `${import_picocolors2.default.bgCyan(import_picocolors2.default.gray(` ${r2.value} `))} ${s} ${r2.hint ? import_picocolors2.default.dim(`(${r2.hint})`) : ""}` : `${import_picocolors2.default.gray(import_picocolors2.default.bgWhite(import_picocolors2.default.inverse(` ${r2.value} `)))} ${s} ${r2.hint ? import_picocolors2.default.dim(`(${r2.hint})`) : ""}`;
|
|
1621
|
-
};
|
|
1622
|
-
return new ID({ options: t.options, initialValue: t.initialValue, render() {
|
|
1623
|
-
const r2 = `${import_picocolors2.default.gray(o)}
|
|
1624
|
-
${b2(this.state)} ${t.message}
|
|
1625
|
-
`;
|
|
1626
|
-
switch (this.state) {
|
|
1627
|
-
case "submit":
|
|
1628
|
-
return `${r2}${import_picocolors2.default.gray(o)} ${n(this.options.find((i) => i.value === this.value) ?? t.options[0], "selected")}`;
|
|
1629
|
-
case "cancel":
|
|
1630
|
-
return `${r2}${import_picocolors2.default.gray(o)} ${n(this.options[0], "cancelled")}
|
|
1631
|
-
${import_picocolors2.default.gray(o)}`;
|
|
1632
|
-
default:
|
|
1633
|
-
return `${r2}${import_picocolors2.default.cyan(o)} ${this.options.map((i, s) => n(i, s === this.cursor ? "active" : "inactive")).join(`
|
|
1634
|
-
${import_picocolors2.default.cyan(o)} `)}
|
|
1635
|
-
${import_picocolors2.default.cyan(d2)}
|
|
1636
1451
|
`;
|
|
1637
1452
|
}
|
|
1638
1453
|
} }).prompt();
|
|
1639
1454
|
}, fe = (t) => {
|
|
1640
1455
|
const n = (r2, i) => {
|
|
1641
1456
|
const s = r2.label ?? String(r2.value);
|
|
1642
|
-
return i === "active" ? `${import_picocolors2.default.cyan(A2)} ${s} ${r2.hint ? import_picocolors2.default.dim(`(${r2.hint})`) : ""}` : i === "selected" ? `${import_picocolors2.default.green(
|
|
1457
|
+
return i === "active" ? `${import_picocolors2.default.cyan(A2)} ${s} ${r2.hint ? import_picocolors2.default.dim(`(${r2.hint})`) : ""}` : i === "selected" ? `${import_picocolors2.default.green(T)} ${import_picocolors2.default.dim(s)} ${r2.hint ? import_picocolors2.default.dim(`(${r2.hint})`) : ""}` : i === "cancelled" ? `${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(s))}` : i === "active-selected" ? `${import_picocolors2.default.green(T)} ${s} ${r2.hint ? import_picocolors2.default.dim(`(${r2.hint})`) : ""}` : i === "submitted" ? `${import_picocolors2.default.dim(s)}` : `${import_picocolors2.default.dim(F)} ${import_picocolors2.default.dim(s)}`;
|
|
1643
1458
|
};
|
|
1644
1459
|
return new SD({ options: t.options, initialValues: t.initialValues, required: t.required ?? true, cursorAt: t.cursorAt, validate(r2) {
|
|
1645
1460
|
if (this.required && r2.length === 0)
|
|
@@ -1673,66 +1488,6 @@ ${s}
|
|
|
1673
1488
|
return `${r2}${import_picocolors2.default.cyan(o)} ${G2({ options: this.options, cursor: this.cursor, maxItems: t.maxItems, style: i }).join(`
|
|
1674
1489
|
${import_picocolors2.default.cyan(o)} `)}
|
|
1675
1490
|
${import_picocolors2.default.cyan(d2)}
|
|
1676
|
-
`;
|
|
1677
|
-
}
|
|
1678
|
-
} }).prompt();
|
|
1679
|
-
}, be = (t) => {
|
|
1680
|
-
const { selectableGroups: n = true } = t, r2 = (i, s, c = []) => {
|
|
1681
|
-
const a = i.label ?? String(i.value), l2 = typeof i.group == "string", $2 = l2 && (c[c.indexOf(i) + 1] ?? { group: true }), g2 = l2 && $2.group === true, p2 = l2 ? n ? `${g2 ? d2 : o} ` : " " : "";
|
|
1682
|
-
if (s === "active")
|
|
1683
|
-
return `${import_picocolors2.default.dim(p2)}${import_picocolors2.default.cyan(A2)} ${a} ${i.hint ? import_picocolors2.default.dim(`(${i.hint})`) : ""}`;
|
|
1684
|
-
if (s === "group-active")
|
|
1685
|
-
return `${p2}${import_picocolors2.default.cyan(A2)} ${import_picocolors2.default.dim(a)}`;
|
|
1686
|
-
if (s === "group-active-selected")
|
|
1687
|
-
return `${p2}${import_picocolors2.default.green(T2)} ${import_picocolors2.default.dim(a)}`;
|
|
1688
|
-
if (s === "selected") {
|
|
1689
|
-
const f = l2 || n ? import_picocolors2.default.green(T2) : "";
|
|
1690
|
-
return `${import_picocolors2.default.dim(p2)}${f} ${import_picocolors2.default.dim(a)} ${i.hint ? import_picocolors2.default.dim(`(${i.hint})`) : ""}`;
|
|
1691
|
-
}
|
|
1692
|
-
if (s === "cancelled")
|
|
1693
|
-
return `${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(a))}`;
|
|
1694
|
-
if (s === "active-selected")
|
|
1695
|
-
return `${import_picocolors2.default.dim(p2)}${import_picocolors2.default.green(T2)} ${a} ${i.hint ? import_picocolors2.default.dim(`(${i.hint})`) : ""}`;
|
|
1696
|
-
if (s === "submitted")
|
|
1697
|
-
return `${import_picocolors2.default.dim(a)}`;
|
|
1698
|
-
const v2 = l2 || n ? import_picocolors2.default.dim(F) : "";
|
|
1699
|
-
return `${import_picocolors2.default.dim(p2)}${v2} ${import_picocolors2.default.dim(a)}`;
|
|
1700
|
-
};
|
|
1701
|
-
return new _D({ options: t.options, initialValues: t.initialValues, required: t.required ?? true, cursorAt: t.cursorAt, selectableGroups: n, validate(i) {
|
|
1702
|
-
if (this.required && i.length === 0)
|
|
1703
|
-
return `Please select at least one option.
|
|
1704
|
-
${import_picocolors2.default.reset(import_picocolors2.default.dim(`Press ${import_picocolors2.default.gray(import_picocolors2.default.bgWhite(import_picocolors2.default.inverse(" space ")))} to select, ${import_picocolors2.default.gray(import_picocolors2.default.bgWhite(import_picocolors2.default.inverse(" enter ")))} to submit`))}`;
|
|
1705
|
-
}, render() {
|
|
1706
|
-
const i = `${import_picocolors2.default.gray(o)}
|
|
1707
|
-
${b2(this.state)} ${t.message}
|
|
1708
|
-
`;
|
|
1709
|
-
switch (this.state) {
|
|
1710
|
-
case "submit":
|
|
1711
|
-
return `${i}${import_picocolors2.default.gray(o)} ${this.options.filter(({ value: s }) => this.value.includes(s)).map((s) => r2(s, "submitted")).join(import_picocolors2.default.dim(", "))}`;
|
|
1712
|
-
case "cancel": {
|
|
1713
|
-
const s = this.options.filter(({ value: c }) => this.value.includes(c)).map((c) => r2(c, "cancelled")).join(import_picocolors2.default.dim(", "));
|
|
1714
|
-
return `${i}${import_picocolors2.default.gray(o)} ${s.trim() ? `${s}
|
|
1715
|
-
${import_picocolors2.default.gray(o)}` : ""}`;
|
|
1716
|
-
}
|
|
1717
|
-
case "error": {
|
|
1718
|
-
const s = this.error.split(`
|
|
1719
|
-
`).map((c, a) => a === 0 ? `${import_picocolors2.default.yellow(d2)} ${import_picocolors2.default.yellow(c)}` : ` ${c}`).join(`
|
|
1720
|
-
`);
|
|
1721
|
-
return `${i}${import_picocolors2.default.yellow(o)} ${this.options.map((c, a, l2) => {
|
|
1722
|
-
const $2 = this.value.includes(c.value) || c.group === true && this.isGroupSelected(`${c.value}`), g2 = a === this.cursor;
|
|
1723
|
-
return !g2 && typeof c.group == "string" && this.options[this.cursor].value === c.group ? r2(c, $2 ? "group-active-selected" : "group-active", l2) : g2 && $2 ? r2(c, "active-selected", l2) : $2 ? r2(c, "selected", l2) : r2(c, g2 ? "active" : "inactive", l2);
|
|
1724
|
-
}).join(`
|
|
1725
|
-
${import_picocolors2.default.yellow(o)} `)}
|
|
1726
|
-
${s}
|
|
1727
|
-
`;
|
|
1728
|
-
}
|
|
1729
|
-
default:
|
|
1730
|
-
return `${i}${import_picocolors2.default.cyan(o)} ${this.options.map((s, c, a) => {
|
|
1731
|
-
const l2 = this.value.includes(s.value) || s.group === true && this.isGroupSelected(`${s.value}`), $2 = c === this.cursor;
|
|
1732
|
-
return !$2 && typeof s.group == "string" && this.options[this.cursor].value === s.group ? r2(s, l2 ? "group-active-selected" : "group-active", a) : $2 && l2 ? r2(s, "active-selected", a) : l2 ? r2(s, "selected", a) : r2(s, $2 ? "active" : "inactive", a);
|
|
1733
|
-
}).join(`
|
|
1734
|
-
${import_picocolors2.default.cyan(o)} `)}
|
|
1735
|
-
${import_picocolors2.default.cyan(d2)}
|
|
1736
1491
|
`;
|
|
1737
1492
|
}
|
|
1738
1493
|
} }).prompt();
|
|
@@ -1762,7 +1517,7 @@ ${import_picocolors2.default.gray(de + _2.repeat(s + 2) + pe)}
|
|
|
1762
1517
|
${import_picocolors2.default.gray(d2)} ${t}
|
|
1763
1518
|
|
|
1764
1519
|
`);
|
|
1765
|
-
},
|
|
1520
|
+
}, J2, Y2 = ({ indicator: t = "dots" } = {}) => {
|
|
1766
1521
|
const n = V2 ? ["◒", "◐", "◓", "◑"] : ["•", "o", "O", "0"], r2 = V2 ? 80 : 120, i = process.env.CI === "true";
|
|
1767
1522
|
let s, c, a = false, l2 = "", $2, g2 = performance.now();
|
|
1768
1523
|
const p2 = (m2) => {
|
|
@@ -1812,28 +1567,6 @@ ${import_picocolors2.default.gray(d2)} ${t}
|
|
|
1812
1567
|
return { start: H2, stop: N2, message: (m2 = "") => {
|
|
1813
1568
|
l2 = R2(m2 ?? l2);
|
|
1814
1569
|
} };
|
|
1815
|
-
}, Ce = async (t, n) => {
|
|
1816
|
-
const r2 = {}, i = Object.keys(t);
|
|
1817
|
-
for (const s of i) {
|
|
1818
|
-
const c = t[s], a = await c({ results: r2 })?.catch((l2) => {
|
|
1819
|
-
throw l2;
|
|
1820
|
-
});
|
|
1821
|
-
if (typeof n?.onCancel == "function" && pD(a)) {
|
|
1822
|
-
r2[s] = "canceled", n.onCancel({ results: r2 });
|
|
1823
|
-
continue;
|
|
1824
|
-
}
|
|
1825
|
-
r2[s] = a;
|
|
1826
|
-
}
|
|
1827
|
-
return r2;
|
|
1828
|
-
}, Te = async (t) => {
|
|
1829
|
-
for (const n of t) {
|
|
1830
|
-
if (n.enabled === false)
|
|
1831
|
-
continue;
|
|
1832
|
-
const r2 = Y2();
|
|
1833
|
-
r2.start(n.title);
|
|
1834
|
-
const i = await n.task(r2.message);
|
|
1835
|
-
r2.stop(i || n.title);
|
|
1836
|
-
}
|
|
1837
1570
|
};
|
|
1838
1571
|
var init_dist2 = __esm(() => {
|
|
1839
1572
|
init_dist();
|
|
@@ -1851,57 +1584,18 @@ var init_dist2 = __esm(() => {
|
|
|
1851
1584
|
k2 = u("●", ">");
|
|
1852
1585
|
P2 = u("○", " ");
|
|
1853
1586
|
A2 = u("◻", "[•]");
|
|
1854
|
-
|
|
1587
|
+
T = u("◼", "[+]");
|
|
1855
1588
|
F = u("◻", "[ ]");
|
|
1856
1589
|
$e = u("▪", "•");
|
|
1857
1590
|
_2 = u("─", "-");
|
|
1858
1591
|
me = u("╮", "+");
|
|
1859
1592
|
de = u("├", "+");
|
|
1860
1593
|
pe = u("╯", "+");
|
|
1861
|
-
|
|
1594
|
+
q = u("●", "•");
|
|
1862
1595
|
D = u("◆", "*");
|
|
1863
1596
|
U2 = u("▲", "!");
|
|
1864
1597
|
K2 = u("■", "x");
|
|
1865
|
-
M2 = { message: (t = "", { symbol: n = import_picocolors2.default.gray(o) } = {}) => {
|
|
1866
|
-
const r2 = [`${import_picocolors2.default.gray(o)}`];
|
|
1867
|
-
if (t) {
|
|
1868
|
-
const [i, ...s] = t.split(`
|
|
1869
|
-
`);
|
|
1870
|
-
r2.push(`${n} ${i}`, ...s.map((c) => `${import_picocolors2.default.gray(o)} ${c}`));
|
|
1871
|
-
}
|
|
1872
|
-
process.stdout.write(`${r2.join(`
|
|
1873
|
-
`)}
|
|
1874
|
-
`);
|
|
1875
|
-
}, info: (t) => {
|
|
1876
|
-
M2.message(t, { symbol: import_picocolors2.default.blue(q2) });
|
|
1877
|
-
}, success: (t) => {
|
|
1878
|
-
M2.message(t, { symbol: import_picocolors2.default.green(D) });
|
|
1879
|
-
}, step: (t) => {
|
|
1880
|
-
M2.message(t, { symbol: import_picocolors2.default.green(C) });
|
|
1881
|
-
}, warn: (t) => {
|
|
1882
|
-
M2.message(t, { symbol: import_picocolors2.default.yellow(U2) });
|
|
1883
|
-
}, warning: (t) => {
|
|
1884
|
-
M2.warn(t);
|
|
1885
|
-
}, error: (t) => {
|
|
1886
|
-
M2.message(t, { symbol: import_picocolors2.default.red(K2) });
|
|
1887
|
-
} };
|
|
1888
1598
|
J2 = `${import_picocolors2.default.gray(o)} `;
|
|
1889
|
-
x2 = { message: async (t, { symbol: n = import_picocolors2.default.gray(o) } = {}) => {
|
|
1890
|
-
process.stdout.write(`${import_picocolors2.default.gray(o)}
|
|
1891
|
-
${n} `);
|
|
1892
|
-
let r2 = 3;
|
|
1893
|
-
for await (let i of t) {
|
|
1894
|
-
i = i.replace(/\n/g, `
|
|
1895
|
-
${J2}`), i.includes(`
|
|
1896
|
-
`) && (r2 = 3 + S2(i.slice(i.lastIndexOf(`
|
|
1897
|
-
`))).length);
|
|
1898
|
-
const s = S2(i).length;
|
|
1899
|
-
r2 + s < process.stdout.columns ? (r2 += s, process.stdout.write(i)) : (process.stdout.write(`
|
|
1900
|
-
${J2}${i.trimStart()}`), r2 = 3 + S2(i.trimStart()).length);
|
|
1901
|
-
}
|
|
1902
|
-
process.stdout.write(`
|
|
1903
|
-
`);
|
|
1904
|
-
}, info: (t) => x2.message(t, { symbol: import_picocolors2.default.blue(q2) }), success: (t) => x2.message(t, { symbol: import_picocolors2.default.green(D) }), step: (t) => x2.message(t, { symbol: import_picocolors2.default.green(C) }), warn: (t) => x2.message(t, { symbol: import_picocolors2.default.yellow(U2) }), warning: (t) => x2.warn(t), error: (t) => x2.message(t, { symbol: import_picocolors2.default.red(K2) }) };
|
|
1905
1599
|
});
|
|
1906
1600
|
|
|
1907
1601
|
// src/interactive.ts
|
|
@@ -1915,6 +1609,8 @@ __export(exports_interactive, {
|
|
|
1915
1609
|
showCountingToolDone: () => showCountingToolDone,
|
|
1916
1610
|
showCountingToolChats: () => showCountingToolChats,
|
|
1917
1611
|
showCountingLocalChats: () => showCountingLocalChats,
|
|
1612
|
+
selectSyncInterval: () => selectSyncInterval,
|
|
1613
|
+
selectSaveAmount: () => selectSaveAmount,
|
|
1918
1614
|
selectMcpTargets: () => selectMcpTargets,
|
|
1919
1615
|
selectChatSources: () => selectChatSources,
|
|
1920
1616
|
promptAuth: () => promptAuth,
|
|
@@ -2051,6 +1747,29 @@ async function confirmBackgroundSync() {
|
|
|
2051
1747
|
}));
|
|
2052
1748
|
return value === "yes";
|
|
2053
1749
|
}
|
|
1750
|
+
async function selectSaveAmount() {
|
|
1751
|
+
return ensureValue(await ve({
|
|
1752
|
+
message: "How much should Conare remember from each session?",
|
|
1753
|
+
initialValue: "balanced",
|
|
1754
|
+
options: [
|
|
1755
|
+
{ value: "essentials", label: "Essentials", hint: "only key decisions & bugs — leanest memory" },
|
|
1756
|
+
{ value: "balanced", label: "Balanced", hint: "recommended" },
|
|
1757
|
+
{ value: "everything", label: "Everything", hint: "full detail from every session" }
|
|
1758
|
+
]
|
|
1759
|
+
}));
|
|
1760
|
+
}
|
|
1761
|
+
async function selectSyncInterval() {
|
|
1762
|
+
const value = ensureValue(await ve({
|
|
1763
|
+
message: "How often should Conare index new chats?",
|
|
1764
|
+
initialValue: "10",
|
|
1765
|
+
options: [
|
|
1766
|
+
{ value: "5", label: "Every 5 minutes", hint: "freshest" },
|
|
1767
|
+
{ value: "10", label: "Every 10 minutes", hint: "recommended" },
|
|
1768
|
+
{ value: "30", label: "Every 30 minutes", hint: "lightest" }
|
|
1769
|
+
]
|
|
1770
|
+
}));
|
|
1771
|
+
return Number(value);
|
|
1772
|
+
}
|
|
2054
1773
|
var countingSpinner = null;
|
|
2055
1774
|
var init_interactive = __esm(() => {
|
|
2056
1775
|
init_dist2();
|
|
@@ -4217,6 +3936,14 @@ function clearSavedApiKey() {
|
|
|
4217
3936
|
}
|
|
4218
3937
|
return hadApiKey;
|
|
4219
3938
|
}
|
|
3939
|
+
function saveSaveAmount(amount) {
|
|
3940
|
+
const config = readConfig();
|
|
3941
|
+
config.saveAmount = amount;
|
|
3942
|
+
writeConfig(config);
|
|
3943
|
+
}
|
|
3944
|
+
function getSaveAmount() {
|
|
3945
|
+
return readConfig().saveAmount;
|
|
3946
|
+
}
|
|
4220
3947
|
function hasLegacyTeamConfig() {
|
|
4221
3948
|
const c = readConfig();
|
|
4222
3949
|
return !!(c.teamMode || c.orgId || (c.teamRemotePatterns?.length ?? 0) > 0);
|
|
@@ -5289,7 +5016,11 @@ async function main() {
|
|
|
5289
5016
|
const ingestibleTargets = interactiveTargets.filter((t) => INGESTIBLE_SOURCES.has(t.id));
|
|
5290
5017
|
showDetectedApps(ingestibleTargets);
|
|
5291
5018
|
selectedSources = await selectChatSources(ingestibleTargets);
|
|
5019
|
+
const saveAmount = await selectSaveAmount();
|
|
5020
|
+
saveSaveAmount(saveAmount);
|
|
5021
|
+
opts.syncInterval = await selectSyncInterval();
|
|
5292
5022
|
}
|
|
5023
|
+
setSaveAmount(getSaveAmount());
|
|
5293
5024
|
if (opts.uninstallSync) {
|
|
5294
5025
|
const messages = uninstallSync();
|
|
5295
5026
|
for (const msg of messages)
|
|
@@ -5592,24 +5323,7 @@ Nothing new to index.`);
|
|
|
5592
5323
|
ensureSyncInstalled(apiKey, opts.syncInterval);
|
|
5593
5324
|
} catch {}
|
|
5594
5325
|
}
|
|
5595
|
-
|
|
5596
|
-
if (allMemories.length > 2000 && !opts.dryRun && !opts.quiet) {
|
|
5597
|
-
if (hasTty) {
|
|
5598
|
-
const { confirm: confirm2 } = await Promise.resolve().then(() => (init_dist2(), exports_dist));
|
|
5599
|
-
const proceed = await confirm2({
|
|
5600
|
-
message: `That's ${allMemories.length.toLocaleString()} memories — this may take a while and use significant resources. Continue?`
|
|
5601
|
-
});
|
|
5602
|
-
if (!proceed || typeof proceed === "symbol") {
|
|
5603
|
-
log("Skipping upload for now. You can re-run `conare` anytime to upload.");
|
|
5604
|
-
log();
|
|
5605
|
-
skipUpload = true;
|
|
5606
|
-
}
|
|
5607
|
-
} else {
|
|
5608
|
-
log(`Warning: ${allMemories.length.toLocaleString()} memories detected. Skipping large upload in non-interactive mode.`);
|
|
5609
|
-
log("Re-run interactively or with --force to proceed.");
|
|
5610
|
-
skipUpload = true;
|
|
5611
|
-
}
|
|
5612
|
-
}
|
|
5326
|
+
const skipUpload = false;
|
|
5613
5327
|
let uploadedCount = 0;
|
|
5614
5328
|
if (allMemories.length === 0 || skipUpload) {
|
|
5615
5329
|
if (allMemories.length === 0)
|
|
@@ -5711,19 +5425,8 @@ Nothing new to index.`);
|
|
|
5711
5425
|
}
|
|
5712
5426
|
}
|
|
5713
5427
|
}
|
|
5714
|
-
const
|
|
5715
|
-
|
|
5716
|
-
return "Claude Code";
|
|
5717
|
-
if (t === "codex")
|
|
5718
|
-
return "Codex";
|
|
5719
|
-
if (t === "cursor")
|
|
5720
|
-
return "Cursor";
|
|
5721
|
-
if (t === "opencode")
|
|
5722
|
-
return "OpenCode";
|
|
5723
|
-
if (t === "grok")
|
|
5724
|
-
return "Grok";
|
|
5725
|
-
return t;
|
|
5726
|
-
});
|
|
5428
|
+
const targetLabels = new Map(MCP_TARGETS.map((t) => [t.id, t.label]));
|
|
5429
|
+
const configuredTools = selectedTargets.filter((t) => t !== "conare-skill").map((t) => targetLabels.get(t) ?? t);
|
|
5727
5430
|
const toolList = configuredTools.length > 0 ? configuredTools.join(", ") : "your AI tools";
|
|
5728
5431
|
const oneTool = configuredTools[0] ?? "your agent";
|
|
5729
5432
|
const dim = (s) => `\x1B[2m${s}\x1B[0m`;
|