@agent-finops/core 0.2.0 → 0.2.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.
@@ -1,5 +1,5 @@
1
1
  import { readdir, readFile, stat } from "node:fs/promises";
2
- import { basename, join } from "node:path";
2
+ import { basename, join, resolve } from "node:path";
3
3
  import { homedir } from "node:os";
4
4
  import { estimateTokenCostUsd } from "./modelPricing.js";
5
5
  /** Parse one Claude Code transcript (JSONL). Exported for tests. */
@@ -208,6 +208,10 @@ async function listJsonlFiles(root) {
208
208
  function projectFromCwd(cwd) {
209
209
  if (!cwd)
210
210
  return undefined;
211
+ // Sessions launched from the home directory aren't a "project" — labeling
212
+ // them with the username reads like a data bug on the by-project table.
213
+ if (resolve(cwd) === resolve(homedir()))
214
+ return "(home)";
211
215
  const name = basename(cwd);
212
216
  return name.length > 0 ? name : undefined;
213
217
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agent-finops/core",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",