Skip to content

Commit 7e6f20f

Browse files
committed
AIExtension.name enum
1 parent 3621778 commit 7e6f20f

2 files changed

Lines changed: 23 additions & 5 deletions

File tree

src/constants.ts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,27 @@ export interface Heartbeat {
124124
}
125125

126126
export interface AIExtension {
127-
name: string;
127+
name:
128+
| 'claude'
129+
| 'codex'
130+
| 'copilot'
131+
| 'cursor'
132+
| 'gemini'
133+
| 'codeium'
134+
| 'continue'
135+
| 'cody'
136+
| 'supermaven'
137+
| 'tabnine'
138+
| 'vscode-ai-toolkit'
139+
| 'factory'
140+
| 'opencode'
141+
| 'openclaw';
128142
extensionIds: string[];
129143
transcriptLogGlobs: string[];
130144
}
131145

132146
export interface ParsedGlob {
133-
aiName: string;
147+
aiName: AIExtension['name'];
134148
baseDir: string;
135149
filePattern: RegExp;
136150
isLiteral: boolean;

src/transcript-watcher.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import * as fsAsync from 'fs/promises';
33
import * as path from 'path';
44

55
import {
6+
AIExtension,
67
CursorRow,
78
ParsedGlob,
89
SqlJsInit,
@@ -113,7 +114,10 @@ export class TranscriptWatcher {
113114
return this.sqlJsPromise;
114115
}
115116

116-
private async processJSONLogFile(filePath: string, aiName: string): Promise<boolean> {
117+
private async processJSONLogFile(
118+
filePath: string,
119+
aiName: AIExtension['name'],
120+
): Promise<boolean> {
117121
try {
118122
if (!filePath.endsWith('.jsonl')) return false;
119123

@@ -178,7 +182,7 @@ export class TranscriptWatcher {
178182
return false;
179183
}
180184

181-
private async processSQLiteFile(filePath: string, aiName: string): Promise<boolean> {
185+
private async processSQLiteFile(filePath: string, aiName: AIExtension['name']): Promise<boolean> {
182186
try {
183187
if (!filePath.endsWith('.vscdb')) return false;
184188

@@ -490,7 +494,7 @@ export class TranscriptWatcher {
490494
return false;
491495
}
492496

493-
private parseGlob(glob: string, aiName: string): ParsedGlob | null {
497+
private parseGlob(glob: string, aiName: AIExtension['name']): ParsedGlob | null {
494498
const parts = glob.split('/');
495499
const baseParts: string[] = [];
496500
const patternParts: string[] = [];

0 commit comments

Comments
 (0)