copyrun 0.1.0 → 0.2.0

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.
@@ -112,7 +112,7 @@ import { existsSync, readFileSync } from "fs";
112
112
  import { join } from "path";
113
113
 
114
114
  // src/config.ts
115
- var VERSION = "0.1.0";
115
+ var VERSION = "0.2.0";
116
116
  var DIR = process.env.COPYRUN_HOME ?? join2(homedir(), ".copyrun");
117
117
 
118
118
  // src/autopilot-worker.ts
@@ -127,8 +127,8 @@ function log(line) {
127
127
  }
128
128
  function recordedCli() {
129
129
  try {
130
- const p = JSON.parse(readFileSync2(join3(HOME, "config.json"), "utf8")).autopilot?.cli;
131
- return typeof p === "string" && p.endsWith(".js") && existsSync2(p) ? p : void 0;
130
+ const cfg = JSON.parse(readFileSync2(join3(HOME, "config.json"), "utf8"));
131
+ return [cfg.autopilot?.cli, cfg.memory?.cli].find((p) => typeof p === "string" && p.endsWith(".js") && existsSync2(p));
132
132
  } catch {
133
133
  return void 0;
134
134
  }
@@ -208,6 +208,14 @@ function fileOne(sessionId, transcript) {
208
208
  }
209
209
  function main() {
210
210
  const args = process.argv.slice(2);
211
+ if (args[0] === "--index") {
212
+ const r = cli(["memory", "index", "--quiet", "--json"]);
213
+ const body = lastJson(r.stdout);
214
+ if (body && typeof body.total === "number") {
215
+ if (body.added || body.updated || body.dropped) log(`memory index: ${body.total} sessions (${Number(body.added) || 0} new, ${Number(body.updated) || 0} updated${body.dropped ? `, ${Number(body.dropped)} dropped by the size cap` : ""}); on this machine only`);
216
+ } else if (r.status !== 0) log(`memory index: failed (${why(body, r)})`);
217
+ return;
218
+ }
211
219
  if (args[0] === "--sweep") {
212
220
  if (args[1] === "codex" || args[1] === "cursor") sweep(args[1], args[2], args[3]);
213
221
  return;