INNER CODE UNIT · TypeScript

current

Core-Mate/OpenGUI · deepseek-harness-plugin/src/index.ts:419

  let current = (): Config => baseConfig
  let lastRaw: Config | undefined
  let lastProfile: ResolvedPiAiProviderProfile | undefined
  const profile = (): ResolvedPiAiProviderProfile | undefined => {
    const raw = current()
    if (raw === lastRaw) return lastProfile
    lastRaw = raw
    lastProfile = configuredProfile(raw)
    return lastProfile
  }

  const resolveApiKey = async (_provider: string, active: ResolvedPiAiProviderProfile): Promise<string> => {
    const ref = credentialRef(active.apiKeyEnv ?? API_KEY_ENV)
    const credentials = ctx.get('credentials')
    const hit = credentials === undefined ? undefined : await credentials.resolve(ref)
    if (hit !== undefined) return assertUsableApiKey(hit.value, name, ref)
    throw new LlmError(`coremate-mobile: no credential stored for ${ref}`, 'MISSING_CREDENTIAL')
  }

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…