claude-session-skill 1.1.0 → 1.1.2

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.
@@ -12,6 +12,11 @@ const SESSION_FILE_CONTENT = readFileSync(join(FIXTURES, "session-file.jsonl"),
12
12
  const SUMMARIES_CONTENT = readFileSync(join(FIXTURES, "summaries.json"), "utf-8");
13
13
  const NAMES_CONTENT = readFileSync(join(FIXTURES, "names.json"), "utf-8");
14
14
 
15
+ // Monotonically increasing counter for unique mtimes — avoids Date.now() collision
16
+ // when consecutive tests run within the same millisecond.
17
+ let _mtimeCounter = 1000;
18
+ function nextMtime() { return ++_mtimeCounter; }
19
+
15
20
  // ── Shared mock state (mutable so individual tests can override) ──────────────
16
21
 
17
22
  const readFileMock = mock(async (_path: string): Promise<string> => {
@@ -296,7 +301,7 @@ describe("nameSession", () => {
296
301
  beforeEach(resetMocks);
297
302
 
298
303
  function setupCacheWithSession(session: object = makeCacheSession()) {
299
- const namesMtime = Date.now();
304
+ const namesMtime = nextMtime();
300
305
  readFileMock.mockImplementation(async (path: string) => {
301
306
  if (String(path).endsWith("index.json")) return makeValidCache([session]);
302
307
  if (String(path).endsWith("names.json")) return "{}";
@@ -438,7 +443,7 @@ describe("clearSessionName", () => {
438
443
  function setupCacheWithNamedSession() {
439
444
  // Use Date.now() as mtime to guarantee cache bust across tests
440
445
  // (module-level _namesCache uses mtime equality check)
441
- const namesMtime = Date.now();
446
+ const namesMtime = nextMtime();
442
447
  readFileMock.mockImplementation(async (path: string) => {
443
448
  if (String(path).endsWith("index.json"))
444
449
  return makeValidCache([makeCacheSession({ name: "Login Fix Session" })]);
@@ -465,7 +470,7 @@ describe("clearSessionName", () => {
465
470
  });
466
471
 
467
472
  test("errors when session has no name to clear", async () => {
468
- const namesMtime = Date.now() + 1; // distinct from any prior test
473
+ const namesMtime = nextMtime(); // distinct from any prior test
469
474
  readFileMock.mockImplementation(async (path: string) => {
470
475
  if (String(path).endsWith("index.json")) return makeValidCache([makeCacheSession()]);
471
476
  if (String(path).endsWith("names.json")) return "{}"; // no names
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-session-skill",
3
- "version": "1.1.0",
3
+ "version": "1.1.2",
4
4
  "description": "Search, browse, and resume past Claude Code sessions with AI-generated summaries — plus an MCP server for any MCP-compatible client",
5
5
  "author": "ITeachYouAI <engineering@iteachyouai.com>",
6
6
  "license": "MIT",
@@ -45,7 +45,7 @@
45
45
  "start": "bun run session.ts",
46
46
  "test": "bun test",
47
47
  "typecheck": "bun x tsc --noEmit",
48
- "build": "bun build session.ts --outdir dist --target node && bun build mcp-server.ts --outdir dist --target node",
48
+ "build": "bun build session.ts --outdir dist --target node && bun build mcp-server.ts --outdir dist --target node && node -e \"const fs=require('fs');['dist/session.js','dist/mcp-server.js'].forEach(f=>{const c=fs.readFileSync(f,'utf8');if(!c.startsWith('#!'))fs.writeFileSync(f,'#!/usr/bin/env node\\n'+c);fs.chmodSync(f,0o755)})\"",
49
49
  "prepublishOnly": "bun test && bun run typecheck && bun run build",
50
50
  "list": "bun run session.ts list",
51
51
  "rebuild": "bun run session.ts rebuild"