codeusage-cli 0.1.17 → 0.1.19

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/index.cjs +11 -5
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -28452,6 +28452,9 @@ ${validation.error}
28452
28452
  Detected project: ${detectedProject}`));
28453
28453
  const hookSpinner = ora(`Registering ${providerInfo.displayName} hooks...`).start();
28454
28454
  try {
28455
+ if (options.force) {
28456
+ await unregisterHooks(hookScope, cwd, selectedProvider);
28457
+ }
28455
28458
  await registerHooks(hookScope, cwd, selectedProvider);
28456
28459
  hookSpinner.succeed(`${providerInfo.displayName} hooks registered`);
28457
28460
  } catch (err) {
@@ -29128,6 +29131,9 @@ Cleaning up...`));
29128
29131
  `));
29129
29132
  });
29130
29133
 
29134
+ // src/hooks/stop.ts
29135
+ var import_path6 = __toESM(require("path"));
29136
+
29131
29137
  // src/lib/session-log.ts
29132
29138
  var import_promises14 = __toESM(require("fs/promises"));
29133
29139
  var import_path4 = __toESM(require("path"));
@@ -29795,7 +29801,7 @@ async function getGitRoot(cwd) {
29795
29801
  const { stdout } = await execa("git", ["rev-parse", "--show-toplevel"], {
29796
29802
  cwd
29797
29803
  });
29798
- return stdout.trim();
29804
+ return import_path4.default.normalize(stdout.trim());
29799
29805
  } catch {
29800
29806
  return null;
29801
29807
  }
@@ -29812,7 +29818,7 @@ function getSessionParser(providerId) {
29812
29818
  return SESSION_PARSERS[providerId];
29813
29819
  }
29814
29820
  function getClaudeProjectHash(cwd) {
29815
- return cwd.replace(/[/ ]/g, "-");
29821
+ return cwd.replace(/[^\w-]/g, "-");
29816
29822
  }
29817
29823
  async function findLatestClaudeSession(projectPath) {
29818
29824
  try {
@@ -30282,7 +30288,7 @@ function calculateDelta(current, previous) {
30282
30288
  }
30283
30289
 
30284
30290
  // src/hooks/stop.ts
30285
- var CLI_VERSION = "0.1.17";
30291
+ var CLI_VERSION = "0.1.19";
30286
30292
  var hookStopCommand = new Command("stop").description("Handle AI coding tool stop hook (internal)").option("--dry-run", "Parse session but don't send to API").option("--provider <provider>", "Provider ID (claude_code or codex)").action(async (options) => {
30287
30293
  if (!isConfigured()) {
30288
30294
  return;
@@ -30310,7 +30316,7 @@ var hookStopCommand = new Command("stop").description("Handle AI coding tool sto
30310
30316
  let projectSlug = config2.project_overrides[effectiveCwd];
30311
30317
  if (!projectSlug) {
30312
30318
  projectSlug = await detectProjectSlug(effectiveCwd);
30313
- if (projectSlug === effectiveCwd.split("/").pop()) {
30319
+ if (projectSlug === import_path6.default.basename(effectiveCwd)) {
30314
30320
  console.log(source_default.dim("Tip: Set a project name: codeusage project set <name>"));
30315
30321
  }
30316
30322
  }
@@ -30452,7 +30458,7 @@ var hookNotificationCommand = new Command("notification").description("Handle AI
30452
30458
 
30453
30459
  // src/index.ts
30454
30460
  var program2 = new Command;
30455
- program2.name("codeusage").description("CLI for Codeusage - AI coding tool intelligence platform").version("0.1.17");
30461
+ program2.name("codeusage").description("CLI for Codeusage - AI coding tool intelligence platform").version("0.1.18");
30456
30462
  program2.addCommand(initCommand);
30457
30463
  program2.addCommand(statusCommand);
30458
30464
  program2.addCommand(projectCommand);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeusage-cli",
3
- "version": "0.1.17",
3
+ "version": "0.1.19",
4
4
  "description": "CLI for Codeusage - AI coding tool intelligence platform",
5
5
  "author": "Hashim",
6
6
  "license": "MIT",