conare 0.3.3 → 0.3.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.
Files changed (2) hide show
  1. package/dist/index.js +170 -20
  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;
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;
1028
1028
  var init_dist = __esm(() => {
1029
1029
  import_sisteransi = __toESM(require_src(), 1);
1030
1030
  import_picocolors = __toESM(require_picocolors(), 1);
@@ -1148,6 +1148,30 @@ var init_dist = __esm(() => {
1148
1148
  return this.value.replaceAll(/./g, this._mask);
1149
1149
  }
1150
1150
  };
1151
+ OD = Object.defineProperty;
1152
+ LD = class LD extends x {
1153
+ constructor(u) {
1154
+ super(u, false), J(this, "options"), J(this, "cursor", 0), this.options = u.options, this.cursor = this.options.findIndex(({ value: t }) => t === u.initialValue), this.cursor === -1 && (this.cursor = 0), this.changeValue(), this.on("cursor", (t) => {
1155
+ switch (t) {
1156
+ case "left":
1157
+ case "up":
1158
+ this.cursor = this.cursor === 0 ? this.options.length - 1 : this.cursor - 1;
1159
+ break;
1160
+ case "down":
1161
+ case "right":
1162
+ this.cursor = this.cursor === this.options.length - 1 ? 0 : this.cursor + 1;
1163
+ break;
1164
+ }
1165
+ this.changeValue();
1166
+ });
1167
+ }
1168
+ get _value() {
1169
+ return this.options[this.cursor];
1170
+ }
1171
+ changeValue() {
1172
+ this.value = this._value.value;
1173
+ }
1174
+ };
1151
1175
  });
1152
1176
 
1153
1177
  // node_modules/@clack/prompts/dist/index.mjs
@@ -1212,6 +1236,37 @@ ${import_picocolors2.default.gray(o)}`;
1212
1236
  default:
1213
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}`}
1214
1238
  ${import_picocolors2.default.cyan(d2)}
1239
+ `;
1240
+ }
1241
+ } }).prompt();
1242
+ }, ve = (t) => {
1243
+ const n = (r2, i) => {
1244
+ const s = r2.label ?? String(r2.value);
1245
+ switch (i) {
1246
+ case "selected":
1247
+ return `${import_picocolors2.default.dim(s)}`;
1248
+ case "active":
1249
+ return `${import_picocolors2.default.green(k2)} ${s} ${r2.hint ? import_picocolors2.default.dim(`(${r2.hint})`) : ""}`;
1250
+ case "cancelled":
1251
+ return `${import_picocolors2.default.strikethrough(import_picocolors2.default.dim(s))}`;
1252
+ default:
1253
+ return `${import_picocolors2.default.dim(P2)} ${import_picocolors2.default.dim(s)}`;
1254
+ }
1255
+ };
1256
+ return new LD({ options: t.options, initialValue: t.initialValue, render() {
1257
+ const r2 = `${import_picocolors2.default.gray(o)}
1258
+ ${b2(this.state)} ${t.message}
1259
+ `;
1260
+ switch (this.state) {
1261
+ case "submit":
1262
+ return `${r2}${import_picocolors2.default.gray(o)} ${n(this.options[this.cursor], "selected")}`;
1263
+ case "cancel":
1264
+ return `${r2}${import_picocolors2.default.gray(o)} ${n(this.options[this.cursor], "cancelled")}
1265
+ ${import_picocolors2.default.gray(o)}`;
1266
+ default:
1267
+ 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(`
1268
+ ${import_picocolors2.default.cyan(o)} `)}
1269
+ ${import_picocolors2.default.cyan(d2)}
1215
1270
  `;
1216
1271
  }
1217
1272
  } }).prompt();
@@ -1281,7 +1336,7 @@ ${import_picocolors2.default.gray(de + _2.repeat(s + 2) + pe)}
1281
1336
  ${import_picocolors2.default.gray(d2)} ${t}
1282
1337
 
1283
1338
  `);
1284
- }, J, Y2 = ({ indicator: t = "dots" } = {}) => {
1339
+ }, J2, Y2 = ({ indicator: t = "dots" } = {}) => {
1285
1340
  const n = V2 ? ["◒", "◐", "◓", "◑"] : ["•", "o", "O", "0"], r2 = V2 ? 80 : 120, i = process.env.CI === "true";
1286
1341
  let s, c, a = false, l2 = "", $2, g2 = performance.now();
1287
1342
  const p2 = (m2) => {
@@ -1359,7 +1414,7 @@ var init_dist2 = __esm(() => {
1359
1414
  D = u("◆", "*");
1360
1415
  U2 = u("▲", "!");
1361
1416
  K2 = u("■", "x");
1362
- J = `${import_picocolors2.default.gray(o)} `;
1417
+ J2 = `${import_picocolors2.default.gray(o)} `;
1363
1418
  });
1364
1419
 
1365
1420
  // src/interactive.ts
@@ -1446,10 +1501,15 @@ async function confirmIndexCodebase() {
1446
1501
  }));
1447
1502
  }
1448
1503
  async function confirmBackgroundSync() {
1449
- return ensureValue(await ye({
1504
+ const value = ensureValue(await ve({
1450
1505
  message: "Auto-ingest new chats every 10 minutes?",
1451
- initialValue: true
1506
+ initialValue: "yes",
1507
+ options: [
1508
+ { value: "yes", label: "Yes" },
1509
+ { value: "no", label: "No" }
1510
+ ]
1452
1511
  }));
1512
+ return value === "yes";
1453
1513
  }
1454
1514
  var init_interactive = __esm(() => {
1455
1515
  init_dist2();
@@ -2077,7 +2137,7 @@ init_shared();
2077
2137
  init_api();
2078
2138
 
2079
2139
  // src/configure.ts
2080
- import { existsSync as existsSync6, mkdirSync as mkdirSync2, readFileSync as readFileSync7, writeFileSync as writeFileSync2 } from "node:fs";
2140
+ import { existsSync as existsSync6, mkdirSync as mkdirSync2, readFileSync as readFileSync7, writeFileSync as writeFileSync2, symlinkSync, readlinkSync, rmSync } from "node:fs";
2081
2141
  import { dirname, join as join7 } from "node:path";
2082
2142
  import { homedir as homedir5, platform as platform4 } from "node:os";
2083
2143
  import { spawnSync } from "node:child_process";
@@ -2137,6 +2197,75 @@ function configureJsonClient(path, apiKey, label) {
2137
2197
  upsertMcpServer(path, apiKey);
2138
2198
  return `${label} configured at ${path}`;
2139
2199
  }
2200
+ var SKILL_MD = `---
2201
+ slug: conare-memory
2202
+ name: Conare Memory
2203
+ description: Long-term memory for AI agents — automatically recalls past conversations, saves preferences, and searches across all your coding sessions. Works with Claude Code, Cursor, Codex, and more.
2204
+ homepage: https://conare.ai
2205
+ ---
2206
+
2207
+ # Conare Memory
2208
+
2209
+ Persistent memory across coding sessions. Your conversations, decisions, and preferences are automatically indexed and recalled in future sessions.
2210
+
2211
+ ## When To Use Each Tool
2212
+
2213
+ | Situation | Tool | Example |
2214
+ |-----------|------|---------|
2215
+ | Start of conversation | \`recall\` | Always call first with conversation context |
2216
+ | User asks about past work | \`memory_search\` | "What did we do last week?" |
2217
+ | User says "remember this" | \`memory_save\` | Save preferences, rules, decisions |
2218
+ | User says "forget this" | \`memory_forget\` | Remove a specific memory |
2219
+ | Browse what's stored | \`memory_list\` | "Show me recent memories" |
2220
+
2221
+ ## Critical Rules
2222
+
2223
+ 1. **Always call \`recall\` at conversation start** — pass a specific description of the conversation topic, not generic text
2224
+ 2. **\`memory_search\` is global** — it searches ALL memories across all projects. Use it when the user asks about specific topics or past conversations
2225
+ 3. **\`recall\` is scoped** — it returns project-relevant context + recent sessions + preferences. Use the \`project\` param when available
2226
+ 4. **Write descriptive queries** — "how does the billing webhook handle refunds" beats "billing"
2227
+ 5. **Rephrase and retry** — if first search misses, try different phrasing. Semantic search responds to synonyms and related concepts
2228
+
2229
+ ## Search Tips
2230
+
2231
+ - Use \`after\`/\`before\` (Unix ms) for time-scoped searches: "what did we work on this week?"
2232
+ - Use \`containerTag\` to filter by source: \`claude-chats\`, \`codex-chats\`, \`cursor-chats\`, \`codebase\`, \`preferences\`
2233
+ - Use \`project\` for cross-project filtering (partial names work: "conare" matches "fun/conare-memory-engine")
2234
+ - Keep \`limit\` low (3-5) for focused results, higher (10-15) for broad exploration
2235
+ - When user asks to "remember" something, save it with \`memory_save\` — it goes to the \`preferences\` container and gets surfaced by \`recall\` in future sessions
2236
+
2237
+ ## Setup
2238
+
2239
+ Install with a single command:
2240
+
2241
+ \`\`\`bash
2242
+ bunx conare@latest
2243
+ \`\`\`
2244
+
2245
+ The wizard handles everything: account creation, API key, MCP configuration, background sync setup.
2246
+
2247
+ For manual setup, visit [conare.ai](https://conare.ai).
2248
+ `;
2249
+ function installSkill() {
2250
+ const skillDir = join7(homedir5(), ".agents", "skills", "conare-memory");
2251
+ mkdirSync2(skillDir, { recursive: true });
2252
+ writeFileSync2(join7(skillDir, "SKILL.md"), SKILL_MD);
2253
+ const claudeSkillsDir = join7(homedir5(), ".claude", "skills");
2254
+ const claudeSkillDir = join7(claudeSkillsDir, "conare-memory");
2255
+ try {
2256
+ if (existsSync6(claudeSkillsDir)) {
2257
+ if (existsSync6(claudeSkillDir)) {
2258
+ try {
2259
+ if (readlinkSync(claudeSkillDir) === skillDir)
2260
+ return "Agent Skill installed";
2261
+ } catch {}
2262
+ rmSync(claudeSkillDir, { recursive: true, force: true });
2263
+ }
2264
+ symlinkSync(skillDir, claudeSkillDir);
2265
+ }
2266
+ } catch {}
2267
+ return "Agent Skill installed";
2268
+ }
2140
2269
  function configureMcp(apiKey, targets = ["claude", "cursor", "codex"]) {
2141
2270
  const results = [];
2142
2271
  if (targets.includes("claude")) {
@@ -2151,6 +2280,9 @@ function configureMcp(apiKey, targets = ["claude", "cursor", "codex"]) {
2151
2280
  if (targets.includes("openclaw")) {
2152
2281
  results.push(configureJsonClient(join7(homedir5(), ".openclaw", "mcp.json"), apiKey, "OpenClaw"));
2153
2282
  }
2283
+ try {
2284
+ results.push(installSkill());
2285
+ } catch {}
2154
2286
  return results;
2155
2287
  }
2156
2288
 
@@ -2179,7 +2311,7 @@ function getSavedApiKey() {
2179
2311
  }
2180
2312
 
2181
2313
  // src/sync.ts
2182
- import { existsSync as existsSync8, mkdirSync as mkdirSync4, writeFileSync as writeFileSync4, unlinkSync, readFileSync as readFileSync9, chmodSync, cpSync, rmSync, symlinkSync, readlinkSync, appendFileSync } from "node:fs";
2314
+ import { existsSync as existsSync8, mkdirSync as mkdirSync4, writeFileSync as writeFileSync4, unlinkSync, readFileSync as readFileSync9, chmodSync, cpSync, rmSync as rmSync2, symlinkSync as symlinkSync2, readlinkSync as readlinkSync2, appendFileSync } from "node:fs";
2183
2315
  import { join as join9, dirname as dirname2 } from "node:path";
2184
2316
  import { homedir as homedir7, platform as platform5 } from "node:os";
2185
2317
  import { execSync as execSync2 } from "node:child_process";
@@ -2380,18 +2512,29 @@ function persistBinary(apiKey) {
2380
2512
  writeFileSync4(CONFIG_PATH2, JSON.stringify({ apiKey }, null, 2) + `
2381
2513
  `);
2382
2514
  }
2515
+ function isValidJsBundle(path) {
2516
+ if (!existsSync8(path))
2517
+ return false;
2518
+ if (path.endsWith(".ts") || path.endsWith(".tsx"))
2519
+ return false;
2520
+ const head = readFileSync9(path, "utf-8").slice(0, 2000);
2521
+ if (/\btype\s+\{/.test(head) || /,\s*type\s+\w+/.test(head))
2522
+ return false;
2523
+ return true;
2524
+ }
2383
2525
  function findCliBundle() {
2384
- const entry = process.argv[1];
2385
- if (entry && existsSync8(entry))
2386
- return entry;
2387
- const candidates = [
2388
- join9(dirname2(new URL(import.meta.url).pathname), "index.js"),
2389
- join9(dirname2(new URL(import.meta.url).pathname), "..", "dist", "index.js")
2526
+ const dir = dirname2(new URL(import.meta.url).pathname);
2527
+ const distCandidates = [
2528
+ join9(dir, "index.js"),
2529
+ join9(dir, "..", "dist", "index.js")
2390
2530
  ];
2391
- for (const c of candidates) {
2392
- if (existsSync8(c))
2531
+ for (const c of distCandidates) {
2532
+ if (isValidJsBundle(c))
2393
2533
  return c;
2394
2534
  }
2535
+ const entry = process.argv[1];
2536
+ if (entry && isValidJsBundle(entry))
2537
+ return entry;
2395
2538
  return null;
2396
2539
  }
2397
2540
  function findSqlJs() {
@@ -2496,13 +2639,13 @@ exec "$NODE" "$CONARE_DIR/bin/conare-ingest.mjs" "$@"
2496
2639
  try {
2497
2640
  if (existsSync8(symlinkTarget)) {
2498
2641
  try {
2499
- const existing = readlinkSync(symlinkTarget);
2642
+ const existing = readlinkSync2(symlinkTarget);
2500
2643
  if (existing === wrapper)
2501
2644
  return "Global command: conare (already linked)";
2502
2645
  } catch {}
2503
2646
  unlinkSync(symlinkTarget);
2504
2647
  }
2505
- symlinkSync(wrapper, symlinkTarget);
2648
+ symlinkSync2(wrapper, symlinkTarget);
2506
2649
  return "Global command: conare (linked to /usr/local/bin)";
2507
2650
  } catch {
2508
2651
  const pathDirs = (process.env.PATH || "").split(":");
@@ -2553,15 +2696,19 @@ function setupWindows(intervalMinutes) {
2553
2696
  } catch {}
2554
2697
  execSync2(`schtasks /Create /TN "${TASK_NAME}" /TR "wscript.exe \\"${runVbs}\\"" /SC MINUTE /MO ${intervalMinutes} /F`, { stdio: "ignore" });
2555
2698
  }
2556
- function installSync(apiKey, intervalMinutes = 10) {
2699
+ function persistAndInstallGlobal(apiKey) {
2557
2700
  const messages = [];
2558
- const os = platform5();
2559
2701
  persistBinary(apiKey);
2560
2702
  messages.push("Persisted CLI to ~/.conare/bin/");
2561
2703
  messages.push("Saved config to ~/.conare/config.json");
2562
2704
  const globalMsg = installGlobalCommand();
2563
2705
  if (globalMsg)
2564
2706
  messages.push(globalMsg);
2707
+ return messages;
2708
+ }
2709
+ function installSync(apiKey, intervalMinutes = 10) {
2710
+ const messages = persistAndInstallGlobal(apiKey);
2711
+ const os = platform5();
2565
2712
  if (os === "darwin") {
2566
2713
  setupMacOS(intervalMinutes);
2567
2714
  messages.push(`Installed launchd agent (every ${intervalMinutes} min)`);
@@ -2632,7 +2779,7 @@ function uninstallSync() {
2632
2779
  unlinkSync(f);
2633
2780
  }
2634
2781
  if (existsSync8(BIN_DIR)) {
2635
- rmSync(BIN_DIR, { recursive: true, force: true });
2782
+ rmSync2(BIN_DIR, { recursive: true, force: true });
2636
2783
  messages.push("Removed ~/.conare/bin/");
2637
2784
  }
2638
2785
  if (messages.length === 0) {
@@ -3195,6 +3342,9 @@ Nothing new to index.`);
3195
3342
  log("");
3196
3343
  }
3197
3344
  if (!opts.dryRun && !opts.quiet) {
3345
+ try {
3346
+ persistAndInstallGlobal(apiKey);
3347
+ } catch {}
3198
3348
  const shouldSync = interactiveMode ? await confirmBackgroundSync() : true;
3199
3349
  if (shouldSync) {
3200
3350
  const syncSpinner = Y2();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "conare",
3
- "version": "0.3.3",
3
+ "version": "0.3.5",
4
4
  "description": "Conare CLI for ingesting AI chat history and configuring memory at conare.ai",
5
5
  "type": "module",
6
6
  "bin": {