fix(omp): avoid unsupported calculateCost import

Fix OMP installation by removing the unsupported calculateCost runtime import from pi-ai.
This commit is contained in:
Patrick Wozniak
2026-07-05 03:10:02 +02:00
committed by GitHub
parent 0f6fc17816
commit e123e84116
7 changed files with 135 additions and 4 deletions
+3 -2
View File
@@ -12,10 +12,11 @@
* Models are fetched from Command Code's Provider API at startup.
*/
import { AssistantMessageEventStream, calculateCost } from "@earendil-works/pi-ai"
import { AssistantMessageEventStream } from "@earendil-works/pi-ai"
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"
import { COMMAND_CODE_CLI_VERSION, createStreamCommandCode, DEFAULT_API_BASE } from "./src/core.ts"
import { calculateCommandCodeCost } from "./src/cost.ts"
import { DEFAULT_MODELS_URL, fetchCommandCodeModels } from "./src/models.ts"
import { getApiKey, login, refreshToken } from "./src/oauth.ts"
@@ -69,7 +70,7 @@ const MODEL_COSTS: Record<string, CommandCodeModelCost> = {
const streamCommandCode = createStreamCommandCode({
createStream: () => new AssistantMessageEventStream(),
calculateCost,
calculateCost: calculateCommandCodeCost,
apiBase: API_BASE,
})