codexmeter 1.0.27 → 1.0.28

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codexmeter",
3
- "version": "1.0.27",
3
+ "version": "1.0.28",
4
4
  "description": "Local telemetry dashboard for Codex CLI usage",
5
5
  "type": "module",
6
6
  "bin": {
package/server/ingest.js CHANGED
@@ -104,8 +104,8 @@ export async function runIngest(codexHome, state, opts = {}) {
104
104
  rollout_path: t.rollout_path,
105
105
  source_raw: t.source_raw,
106
106
  cwd_raw: t.cwd_raw,
107
- repo_key: deriveRepoKey(nc),
108
- repo_label: deriveRepoLabel(nc),
107
+ repo_key: deriveRepoKey(nc, t.git_origin_url),
108
+ repo_label: deriveRepoLabel(nc, t.git_origin_url),
109
109
  started_at: t.created_at,
110
110
  ended_at: t.updated_at,
111
111
  elapsed_seconds: null,
@@ -25,13 +25,15 @@ export function normalizeCwd(cwd) {
25
25
  return p;
26
26
  }
27
27
 
28
- export function deriveRepoKey(normalizedCwd) {
29
- const label = deriveRepoLabel(normalizedCwd);
28
+ export function deriveRepoKey(normalizedCwd, gitOriginUrl) {
29
+ const label = deriveRepoLabel(normalizedCwd, gitOriginUrl);
30
30
  return label === 'unknown' ? 'unknown' : `repo:${label}`;
31
31
  }
32
32
 
33
- export function deriveRepoLabel(normalizedCwd) {
33
+ export function deriveRepoLabel(normalizedCwd, gitOriginUrl) {
34
34
  if (!normalizedCwd) return 'unknown';
35
+ const originLabel = deriveOriginRepoLabel(gitOriginUrl);
36
+ if (originLabel) return originLabel;
35
37
  const worktreeMatch = normalizedCwd.match(/\.codex\/worktrees\/[^/]+\/([^/]+)/);
36
38
  if (worktreeMatch) return collapseWorktreeLabel(worktreeMatch[1]);
37
39
  if (normalizedCwd.includes('.codex')) return '.codex';
@@ -46,6 +48,15 @@ function collapseWorktreeLabel(label) {
46
48
  .replace(/-worktrees?-[a-z0-9._-]+$/i, '') || 'unknown';
47
49
  }
48
50
 
51
+ function deriveOriginRepoLabel(gitOriginUrl) {
52
+ const clean = String(gitOriginUrl || '')
53
+ .trim()
54
+ .replace(/\\/g, '/')
55
+ .replace(/[?#].*$/, '')
56
+ .replace(/\/+$/, '');
57
+ return clean.split('/').pop()?.replace(/\.git$/i, '').toLowerCase() || null;
58
+ }
59
+
49
60
  export function classifyAgentFamily(agentRole) {
50
61
  if (!agentRole) return 'generic';
51
62
  if (AGENT_FAMILY_MAP[agentRole]) return AGENT_FAMILY_MAP[agentRole];
@@ -54,6 +54,7 @@ export function readThreads(codexHome, onProgress) {
54
54
  parent_thread_id: row.parent_thread_id || null,
55
55
  cli_version: row.cli_version || '',
56
56
  git_branch: row.git_branch || null,
57
+ git_origin_url: row.git_origin_url || null,
57
58
  });
58
59
  read++;
59
60
  if (onProgress && read % 200 === 0) {