@wasabeef/agentnote 0.1.1 → 0.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.
Files changed (2) hide show
  1. package/dist/cli.js +14 -6
  2. package/package.json +1 -1
package/dist/cli.js CHANGED
@@ -63,7 +63,7 @@ async function sessionFile() {
63
63
 
64
64
  // src/agents/claude-code.ts
65
65
  import { readFile, writeFile, mkdir } from "node:fs/promises";
66
- import { existsSync, globSync } from "node:fs";
66
+ import { existsSync, readdirSync } from "node:fs";
67
67
  import { join as join2 } from "node:path";
68
68
  import { homedir } from "node:os";
69
69
  var HOOK_COMMAND = "$(npm bin 2>/dev/null)/agentnote hook 2>/dev/null || agentnote hook 2>/dev/null || npx --yes @wasabeef/agentnote hook";
@@ -196,11 +196,19 @@ var claudeCode = {
196
196
  findTranscript(sessionId) {
197
197
  if (!isValidSessionId(sessionId)) return null;
198
198
  const claudeDir = join2(homedir(), ".claude", "projects");
199
- const pattern = join2(claudeDir, "**", "sessions", `${sessionId}.jsonl`);
200
- const matches = globSync(pattern);
201
- if (matches.length === 0) return null;
202
- const match = matches[0];
203
- return isValidTranscriptPath(match) ? match : null;
199
+ if (!existsSync(claudeDir)) return null;
200
+ try {
201
+ for (const project of readdirSync(claudeDir)) {
202
+ const sessionsDir = join2(claudeDir, project, "sessions");
203
+ if (!existsSync(sessionsDir)) continue;
204
+ const candidate = join2(sessionsDir, `${sessionId}.jsonl`);
205
+ if (existsSync(candidate) && isValidTranscriptPath(candidate)) {
206
+ return candidate;
207
+ }
208
+ }
209
+ } catch {
210
+ }
211
+ return null;
204
212
  },
205
213
  async extractInteractions(transcriptPath) {
206
214
  if (!isValidTranscriptPath(transcriptPath) || !existsSync(transcriptPath)) return [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wasabeef/agentnote",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "description": "Remember why your code changed. Link AI agent sessions to git commits.",
5
5
  "type": "module",
6
6
  "bin": {