MCPcopy Index your code
hub / github.com/anomalyco/opencode / remoteCost

Function remoteCost

packages/core/src/plugin/provider/opencode.ts:218–237  ·  view source on GitHub ↗
(input: NonNullable<(typeof ConfigProviderV1.Model.Type)["cost"]>)

Source from the content-addressed store, hash-verified

216}
217
218function remoteCost(input: NonNullable<(typeof ConfigProviderV1.Model.Type)["cost"]>) {
219 const base = {
220 input: input.input,
221 output: input.output,
222 cache: { read: input.cache_read ?? 0, write: input.cache_write ?? 0 },
223 }
224 if (!input.context_over_200k) return [base]
225 return [
226 base,
227 {
228 tier: { type: "context" as const, size: 200_000 },
229 input: input.context_over_200k.input,
230 output: input.context_over_200k.output,
231 cache: {
232 read: input.context_over_200k.cache_read ?? 0,
233 write: input.context_over_200k.cache_write ?? 0,
234 },
235 },
236 ]
237}
238
239function poll(http: HttpClient.HttpClient, server: string, deviceCode: string, interval: Duration.Duration) {
240 const loop = (wait: Duration.Duration): Effect.Effect<Credential.OAuth, unknown> =>

Callers 1

opencode.tsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected