oh-my-adhd 0.2.21 → 0.2.23

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.
@@ -1,5 +1,5 @@
1
1
  import { z } from "zod";
2
- import { getThreads, getThread, getPages, isSensitivePath } from "../../lib/brain.js";
2
+ import { getThreads, getThread, getPages, isSensitivePath, SCHEMA_VERSION } from "../../lib/brain.js";
3
3
  import fs from "fs/promises";
4
4
  import path from "path";
5
5
  import os from "os";
@@ -15,7 +15,7 @@ export function registerWikiExport(server) {
15
15
  })));
16
16
  const exportData = {
17
17
  exportedAt: new Date().toISOString(),
18
- schemaVersion: 1,
18
+ schemaVersion: SCHEMA_VERSION,
19
19
  stats: { threads: threads.length, pages: pages.length },
20
20
  threads: threadContents,
21
21
  pages,
@@ -123,8 +123,7 @@ export function registerWikiImport(server) {
123
123
  }
124
124
  // Project only allowed ThreadMeta fields — no arbitrary spread
125
125
  const meta = { id, title };
126
- if (typeof thread.updatedAt === "string")
127
- meta.updatedAt = thread.updatedAt;
126
+ meta.updatedAt = typeof thread.updatedAt === "string" ? thread.updatedAt : new Date().toISOString();
128
127
  if (typeof thread.is_open === "boolean")
129
128
  meta.is_open = thread.is_open;
130
129
  if (typeof thread.is_done === "boolean")
@@ -145,7 +144,8 @@ export function registerWikiImport(server) {
145
144
  existingIds.add(id); // prevent duplicate IDs within same import
146
145
  importedThreads++;
147
146
  }
148
- // Write updated manifest atomically inside lock
147
+ // Sort by updatedAt desc matches saveCapture/updateManifestEntry behavior
148
+ manifest.sort((a, b) => new Date(b.updatedAt).getTime() - new Date(a.updatedAt).getTime());
149
149
  const tmp = manifestFile + ".tmp";
150
150
  await fs.writeFile(tmp, JSON.stringify(manifest, null, 2), "utf-8");
151
151
  await fs.rename(tmp, manifestFile);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "oh-my-adhd",
3
- "version": "0.2.21",
3
+ "version": "0.2.23",
4
4
  "description": "ADHD second brain — zero-friction capture, auto context restore, unstick. MCP-native Claude Code plugin.",
5
5
  "author": "Yeachan Heo",
6
6
  "repository": {