tokentracker-cli 0.6.6 → 0.7.0

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.
@@ -10,6 +10,9 @@ const { ensureDir } = require("./fs");
10
10
  const DEFAULT_SOURCE = "codex";
11
11
  const DEFAULT_MODEL = "unknown";
12
12
  const BUCKET_SEPARATOR = "|";
13
+ const CLAUDE_MEM_OBSERVER_PATH_SEGMENT = "--claude-mem-observer-sessions";
14
+ const CLAUDE_MEM_OBSERVER_PROJECT_REF =
15
+ "https://local.tokentracker/claude-mem/observer-sessions";
13
16
 
14
17
  async function listRolloutFiles(sessionsDir) {
15
18
  const out = [];
@@ -1820,6 +1823,12 @@ async function resolveProjectMetaForPath(startDir, cache) {
1820
1823
  if (!startDir || typeof startDir !== "string") return null;
1821
1824
  if (cache && cache.has(startDir)) return cache.get(startDir);
1822
1825
 
1826
+ if (startDir.includes(CLAUDE_MEM_OBSERVER_PATH_SEGMENT)) {
1827
+ const meta = { projectRef: CLAUDE_MEM_OBSERVER_PROJECT_REF, repoRoot: startDir };
1828
+ if (cache) cache.set(startDir, meta);
1829
+ return meta;
1830
+ }
1831
+
1823
1832
  const visited = [];
1824
1833
  let current = startDir;
1825
1834
  const root = path.parse(startDir).root;
@@ -14,16 +14,18 @@ function isAccountLevelSource(source) {
14
14
 
15
15
  function normalizeUsageScope(value) {
16
16
  const raw = String(value || "").trim().toLowerCase();
17
- return raw === "all" || raw === "raw" ? "all" : "personal";
17
+ if (!raw || raw === "all" || raw === "raw") return "all";
18
+ if (raw === "personal" || raw === "local") return "personal";
19
+ return "all";
18
20
  }
19
21
 
20
- function filterRowsByUsageScope(rows, scope = "personal") {
22
+ function filterRowsByUsageScope(rows, scope = "all") {
21
23
  const normalizedScope = normalizeUsageScope(scope);
22
24
  if (normalizedScope === "all") return Array.isArray(rows) ? rows : [];
23
25
  return (Array.isArray(rows) ? rows : []).filter((row) => !isAccountLevelSource(row?.source));
24
26
  }
25
27
 
26
- function listExcludedSources(rows, scope = "personal") {
28
+ function listExcludedSources(rows, scope = "all") {
27
29
  const normalizedScope = normalizeUsageScope(scope);
28
30
  if (normalizedScope === "all") return [];
29
31
  const seen = new Set();