claude-code-wakatime 3.0.0 → 3.0.1

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/index.js CHANGED
@@ -41020,7 +41020,7 @@ var Options = class {
41020
41020
  };
41021
41021
 
41022
41022
  // src/version.ts
41023
- var VERSION = "2.2.0";
41023
+ var VERSION = "3.0.0";
41024
41024
 
41025
41025
  // src/dependencies.ts
41026
41026
  var import_adm_zip = __toESM(require_adm_zip());
@@ -41566,21 +41566,20 @@ function updateState() {
41566
41566
  import_fs2.default.mkdirSync(import_path2.default.dirname(STATE_FILE), { recursive: true });
41567
41567
  import_fs2.default.writeFileSync(STATE_FILE, JSON.stringify({ lastHeartbeatAt: Utils.timestamp() }, null, 2));
41568
41568
  }
41569
+ function getEntityFile(inp) {
41570
+ if (!inp?.transcript_path) return;
41571
+ return getModifiedFile(inp.transcript_path);
41572
+ }
41569
41573
  function sendHeartbeat(inp) {
41570
41574
  const projectFolder = inp?.cwd;
41571
41575
  try {
41572
- let entity = "claude code";
41573
- if (inp?.transcript_path) {
41574
- const modifiedFile = getModifiedFile(inp.transcript_path);
41575
- if (modifiedFile) {
41576
- entity = modifiedFile;
41577
- }
41578
- }
41576
+ const entity = getEntityFile(inp);
41577
+ if (!entity) return;
41579
41578
  const args = [
41580
41579
  "--entity",
41581
41580
  entity,
41582
41581
  "--entity-type",
41583
- entity === "claude code" ? "app" : "file",
41582
+ "file",
41584
41583
  "--category",
41585
41584
  "ai coding",
41586
41585
  "--plugin",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "claude-code-wakatime",
3
- "version": "3.0.0",
3
+ "version": "3.0.1",
4
4
  "description": "WakaTime plugin for Claude Code",
5
5
  "bin": {
6
6
  "claude-code-wakatime": "dist/index.js"
@@ -10,9 +10,9 @@
10
10
  "prebuild": "node scripts/generate-version.js",
11
11
  "build": "esbuild src/index.ts --bundle --platform=node --outfile=dist/index.js",
12
12
  "watch": "npm run prebuild && tsc --watch",
13
- "release:major": "npm version major && npm publish && git push && git push --tags",
14
- "release:minor": "npm version minor && npm publish && git push && git push --tags",
15
- "release:patch": "npm version patch && npm publish && git push && git push --tags"
13
+ "release:major": "npm run build && npm version major && npm publish && git push && git push --tags",
14
+ "release:minor": "npm run build && npm version minor && npm publish && git push && git push --tags",
15
+ "release:patch": "npm run build && npm version patch && npm publish && git push && git push --tags"
16
16
  },
17
17
  "repository": {
18
18
  "type": "git",
package/src/index.ts CHANGED
@@ -180,22 +180,22 @@ function updateState() {
180
180
  fs.writeFileSync(STATE_FILE, JSON.stringify({ lastHeartbeatAt: Utils.timestamp() } as State, null, 2));
181
181
  }
182
182
 
183
+ function getEntityFile(inp: Input | undefined): string | undefined {
184
+ if (!inp?.transcript_path) return;
185
+ return getModifiedFile(inp.transcript_path);
186
+ }
187
+
183
188
  function sendHeartbeat(inp: Input | undefined) {
184
189
  const projectFolder = inp?.cwd;
185
190
  try {
186
- let entity = 'claude code';
187
- if (inp?.transcript_path) {
188
- const modifiedFile = getModifiedFile(inp.transcript_path);
189
- if (modifiedFile) {
190
- entity = modifiedFile;
191
- }
192
- }
191
+ const entity = getEntityFile(inp);
192
+ if (!entity) return;
193
193
 
194
194
  const args: string[] = [
195
195
  '--entity',
196
196
  entity,
197
197
  '--entity-type',
198
- entity === 'claude code' ? 'app' : 'file',
198
+ 'file',
199
199
  '--category',
200
200
  'ai coding',
201
201
  '--plugin',