feat: expand ai commit agent support (#1928)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Co-authored-by: brennanb2025 <brennankbenson@gmail.com>
This commit is contained in:
co-authored by
Copilot
brennanb2025
parent
363ddb5ef6
commit
03b889512b
@@ -0,0 +1,27 @@
|
||||
export const LOCAL_COMMIT_MESSAGE_HOST_KEY = 'local'
|
||||
export const UNKNOWN_COMMIT_MESSAGE_HOST_KEY = 'unknown'
|
||||
export const RUNTIME_COMMIT_MESSAGE_HOST_KEY_PREFIX = 'runtime:'
|
||||
|
||||
export function getCommitMessageModelDiscoveryHostKey(
|
||||
connectionId: string | null | undefined
|
||||
): string {
|
||||
if (connectionId === undefined) {
|
||||
return UNKNOWN_COMMIT_MESSAGE_HOST_KEY
|
||||
}
|
||||
return connectionId ? `ssh:${connectionId}` : LOCAL_COMMIT_MESSAGE_HOST_KEY
|
||||
}
|
||||
|
||||
export function getCommitMessageModelDiscoveryHostKeyForScope(
|
||||
scope: string | null | undefined
|
||||
): string {
|
||||
if (scope === undefined) {
|
||||
return UNKNOWN_COMMIT_MESSAGE_HOST_KEY
|
||||
}
|
||||
if (!scope) {
|
||||
return LOCAL_COMMIT_MESSAGE_HOST_KEY
|
||||
}
|
||||
if (scope.startsWith(RUNTIME_COMMIT_MESSAGE_HOST_KEY_PREFIX)) {
|
||||
return scope
|
||||
}
|
||||
return getCommitMessageModelDiscoveryHostKey(scope)
|
||||
}
|
||||
Reference in New Issue
Block a user