-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
470 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
export enum SupportedCommands { | ||
claudeOpus = 'claude', | ||
opus = 'opus', | ||
claudeSonnet = 'claudes', | ||
opusShort = 'c', | ||
sonnet = 'sonnet', | ||
sonnetShort = 's', | ||
claudeHaiku = 'haiku', | ||
haikuShort = 'h', | ||
} | ||
|
||
const CLAUDE_OPUS_PREFIX_LIST = ['c. '] | ||
|
||
export const hasClaudeOpusPrefix = (prompt: string): string => { | ||
const prefixList = CLAUDE_OPUS_PREFIX_LIST | ||
for (let i = 0; i < prefixList.length; i++) { | ||
if (prompt.toLocaleLowerCase().startsWith(prefixList[i])) { | ||
return prefixList[i] | ||
} | ||
} | ||
return '' | ||
} | ||
|
||
export const hasPrefix = (prompt: string): string => { | ||
return ( | ||
hasClaudeOpusPrefix(prompt) | ||
) | ||
} |
Oops, something went wrong.