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.

1013 B
Raw Blame
import * as Context from "effect/Context";
import type * as Effect from "effect/Effect";
import * as Layer from "effect/Layer";
import type * as Option from "effect/Option";

import type { ConnectionProfile } from "./catalog.ts";
import type { ConnectionAttemptError } from "./model.ts";

export class ConnectionProfileStore extends Context.Service<
  ConnectionProfileStore,
  {
    readonly get: (
      connectionId: string,
    ) => Effect.Effect<Option.Option<ConnectionProfile>, ConnectionAttemptError>;
    readonly put: (profile: ConnectionProfile) => Effect.Effect<void, ConnectionAttemptError>;
    readonly remove: (connectionId: string) => Effect.Effect<void, ConnectionAttemptError>;
  }
>()("@akeru/client-runtime/connection/profileStore/ConnectionProfileStore") {}

export const make = (service: ConnectionProfileStore["Service"]) =>
  ConnectionProfileStore.of(service);

export const layer = (service: ConnectionProfileStore["Service"]) =>
  Layer.succeed(ConnectionProfileStore, make(service));