fix(ci): satisfy provider audit checks

This commit is contained in:
Patrick Wozniak
2026-08-18 11:01:12 +02:00
parent c04f3907b5
commit 864538e146
5 changed files with 8 additions and 8 deletions
+4 -4
View File
@@ -1,6 +1,5 @@
import { mkdir, readFile, rename, rm, writeFile } from "node:fs/promises"
import { dirname } from "node:path"
import type { Api } from "@earendil-works/pi-ai"
export const DEFAULT_PROVIDER_API_BASE = "https://api.commandcode.ai/provider/v1"
export const DEFAULT_MODELS_URL = `${DEFAULT_PROVIDER_API_BASE}/models`
@@ -9,6 +8,7 @@ export const DEFAULT_MODELS_TIMEOUT_MS = 10_000
const DEFAULT_MAX_OUTPUT_TOKENS = 65_536
const MODEL_CACHE_VERSION = 1
export type CommandCodeApi = "openai-completions" | "anthropic-messages"
export type CommandCodeInputType = "text" | "image"
/**
@@ -161,17 +161,17 @@ interface ApiModel {
export interface CommandCodeModel {
id: string
name: string
api: Api
api: CommandCodeApi
reasoning: boolean
contextWindow: number
maxTokens: number
}
export function apiForModelId(id: string): Api {
export function apiForModelId(id: string): CommandCodeApi {
return id.startsWith("claude-") ? "anthropic-messages" : "openai-completions"
}
export function baseUrlForModel(apiBase: string, api: Api): string {
export function baseUrlForModel(apiBase: string, api: CommandCodeApi): string {
const normalized = apiBase.replace(/\/+$/g, "")
if (api !== "anthropic-messages") return normalized
return normalized.endsWith("/v1") ? normalized.slice(0, -3) : normalized