kodingo-cli 1.0.6 → 1.0.7

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/cli.js CHANGED
@@ -16,6 +16,7 @@ const init_1 = require("./commands/init");
16
16
  const install_hook_1 = require("./commands/install-hook");
17
17
  const update_1 = require("./commands/update");
18
18
  const sync_1 = require("./commands/sync");
19
+ const aging_1 = require("./commands/aging");
19
20
  const program = new commander_1.Command();
20
21
  program.name("kodingo").description("Kodingo CLI").version("1.0.4");
21
22
  // ── init ──────────────────────────────────────────────────────────────────────
@@ -34,6 +35,13 @@ program
34
35
  .action(async () => {
35
36
  await (0, sync_1.syncCommand)();
36
37
  });
38
+ // ── aging ─────────────────────────────────────────────────────────────────────
39
+ program
40
+ .command("aging")
41
+ .description("List stale memory records not updated in 90+ days")
42
+ .action(async () => {
43
+ await (0, aging_1.agingCommand)();
44
+ });
37
45
  // ── capture ───────────────────────────────────────────────────────────────────
38
46
  program
39
47
  .command("capture")
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.agingCommand = agingCommand;
4
+ const persistence_config_1 = require("../utils/persistence-config");
5
+ async function agingCommand() {
6
+ const persistence = (0, persistence_config_1.getPersistence)();
7
+ await persistence.initDb();
8
+ const NINETY_DAYS_MS = 90 * 24 * 60 * 60 * 1000;
9
+ const cutoff = new Date(Date.now() - NINETY_DAYS_MS);
10
+ const results = await persistence.queryMemory("", 200, undefined, {
11
+ includeNonCanonical: true,
12
+ });
13
+ const stale = results.filter((r) => {
14
+ const updated = r.updatedAt instanceof Date ? r.updatedAt : new Date(r.updatedAt);
15
+ return ((r.status === "proposed" || r.status === "ignored") &&
16
+ updated < cutoff);
17
+ });
18
+ if (stale.length === 0) {
19
+ console.log("No stale memories found. Everything is fresh.");
20
+ return;
21
+ }
22
+ console.log(`Found ${stale.length} stale memory record${stale.length === 1 ? "" : "s"} (not updated in 90+ days):\n`);
23
+ for (const r of stale) {
24
+ const updated = r.updatedAt instanceof Date ? r.updatedAt : new Date(r.updatedAt);
25
+ const daysAgo = Math.floor((Date.now() - updated.getTime()) / (1000 * 60 * 60 * 24));
26
+ const title = r.title || r.content.slice(0, 60);
27
+ console.log(` [${r.status.toUpperCase()}] ${title}`);
28
+ console.log(` ID: ${r.id}`);
29
+ console.log(` Symbol: ${r.symbol ?? "none"}`);
30
+ console.log(` Last updated: ${updated.toLocaleDateString()} (${daysAgo} days ago)`);
31
+ console.log(` Run: kodingo deny ${r.id} OR kodingo affirm ${r.id}\n`);
32
+ }
33
+ console.log(`Tip: review these records and affirm, deny, or ignore them to keep your memory base clean.`);
34
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kodingo-cli",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "description": "Kodingo CLI",
5
5
  "license": "MIT",
6
6
  "private": false,