@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.
- package/dist/cli.js +14 -6
- 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,
|
|
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
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
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 [];
|