@wasabeef/agentnote 0.1.1 → 0.1.3

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 +18 -18
  2. package/package.json +3 -3
package/dist/cli.js CHANGED
@@ -63,10 +63,10 @@ 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
- var HOOK_COMMAND = "$(npm bin 2>/dev/null)/agentnote hook 2>/dev/null || agentnote hook 2>/dev/null || npx --yes @wasabeef/agentnote hook";
69
+ var HOOK_COMMAND = "npx --yes @wasabeef/agentnote hook";
70
70
  var HOOKS_CONFIG = {
71
71
  SessionStart: [
72
72
  { hooks: [{ type: "command", command: HOOK_COMMAND, async: true }] }
@@ -80,7 +80,7 @@ var HOOKS_CONFIG = {
80
80
  PreToolUse: [
81
81
  {
82
82
  matcher: "Bash",
83
- hooks: [{ type: "command", if: "Bash(git commit *)", command: HOOK_COMMAND }]
83
+ hooks: [{ type: "command", if: "Bash(*git commit*)", command: HOOK_COMMAND }]
84
84
  }
85
85
  ],
86
86
  PostToolUse: [
@@ -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 [];
@@ -260,7 +268,7 @@ jobs:
260
268
  - uses: actions/checkout@v4
261
269
  with:
262
270
  fetch-depth: 0
263
- - uses: wasabeef/agentnote@v1
271
+ - uses: wasabeef/agentnote@v0
264
272
  `;
265
273
  async function init(args2) {
266
274
  const skipHooks = args2.includes("--no-hooks");
@@ -1091,18 +1099,10 @@ var HELP = `
1091
1099
  agentnote \u2014 remember why your code changed
1092
1100
 
1093
1101
  usage:
1094
- agentnote init [options] set up hooks, workflow, and notes auto-fetch
1095
- --hooks hooks only
1096
- --action workflow only
1097
- --no-action skip workflow
1102
+ agentnote init set up hooks, workflow, and notes auto-fetch
1098
1103
  agentnote show [commit] show session details for a commit
1099
1104
  agentnote log [n] list recent commits with session info
1100
- agentnote pr [base] [options] generate report for a PR
1101
- --json structured JSON
1102
- --format chat chat-style transcript
1103
- --update <pr#> insert into PR description
1104
1105
  agentnote status show current tracking state
1105
- agentnote commit [args] git commit with session context (optional)
1106
1106
  agentnote version print version
1107
1107
  agentnote help show this help
1108
1108
  `.trim();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wasabeef/agentnote",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Remember why your code changed. Link AI agent sessions to git commits.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -10,8 +10,8 @@
10
10
  "build": "esbuild src/cli.ts --bundle --platform=node --format=esm --outfile=dist/cli.js --banner:js='#!/usr/bin/env node'",
11
11
  "dev": "tsx src/cli.ts",
12
12
  "lint": "tsc --noEmit",
13
- "test": "node --import tsx/esm --test 'src/**/*.test.ts'",
14
- "test:coverage": "node --import tsx/esm --test --experimental-test-coverage 'src/**/*.test.ts'",
13
+ "test": "find src -name '*.test.ts' | xargs node --import tsx/esm --test",
14
+ "test:coverage": "find src -name '*.test.ts' | xargs node --import tsx/esm --test --experimental-test-coverage",
15
15
  "prepublishOnly": "npm run build"
16
16
  },
17
17
  "files": [