Skip to content

Open-source Grok Bot alternative for named AI teammates. Local-first desktop, web, and mobile clients with per-bot tools, instructions, and memory. Independent fork of T3 Code.

588 B
Raw Blame
import { Option, Schema } from "effect";
import type { ProviderInstanceConfig } from "@akeru/contracts";

export type ProviderConfig = Schema.JsonObject;

const decodeConfig = Schema.decodeUnknownOption(Schema.Record(Schema.String, Schema.Json));

/** Provider blobs cross RPC as opaque data; settings only edit JSON object fields. */
export function providerConfig(config: ProviderInstanceConfig["config"]): ProviderConfig {
  return Option.getOrElse(decodeConfig(config), () => ({}));
}

export type MutableProviderConfig = { -readonly [K in keyof ProviderConfig]: ProviderConfig[K] };