@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.
- package/dist/localAgentLogs.js +5 -1
- package/package.json +1 -1
package/dist/localAgentLogs.js
CHANGED
|
@@ -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
|
}
|