import { type AuthClientPresentationMetadata, type AuthEnvironmentScope, type DesktopSshEnvironmentBootstrap, type DesktopSshEnvironmentTarget, EnvironmentId, } from "@t3tools/contracts"; import * as Context from "effect/Context"; import type * as Effect from "effect/Effect"; import type * as Option from "effect/Option"; import type { ConnectionAttemptError } from "../connection/model.ts"; export interface PreparedSshEnvironment { readonly bootstrap: DesktopSshEnvironmentBootstrap; readonly bearerToken: string; } export interface ProvisionedSshEnvironment extends PreparedSshEnvironment { readonly environmentId: EnvironmentId; readonly label: string; } export class CloudSession extends Context.Service< CloudSession, { readonly clerkToken: Effect.Effect; } >()("@t3tools/client-runtime/platform/capabilities/CloudSession") {} export class RelayDeviceIdentity extends Context.Service< RelayDeviceIdentity, { readonly deviceId: Effect.Effect, ConnectionAttemptError>; } >()("@t3tools/client-runtime/platform/capabilities/RelayDeviceIdentity") {} export class ClientPresentation extends Context.Service< ClientPresentation, { readonly metadata: AuthClientPresentationMetadata; readonly scopes: ReadonlyArray; } >()("@t3tools/client-runtime/platform/capabilities/ClientPresentation") {} export class PrimaryEnvironmentAuth extends Context.Service< PrimaryEnvironmentAuth, { readonly bearerToken: Effect.Effect, ConnectionAttemptError>; } >()("@t3tools/client-runtime/platform/capabilities/PrimaryEnvironmentAuth") {} export class SshEnvironmentGateway extends Context.Service< SshEnvironmentGateway, { readonly provision: ( target: DesktopSshEnvironmentTarget, ) => Effect.Effect; readonly prepare: (input: { readonly connectionId: string; readonly expectedEnvironmentId: EnvironmentId; readonly target: DesktopSshEnvironmentTarget; }) => Effect.Effect; readonly disconnect: ( target: DesktopSshEnvironmentTarget, ) => Effect.Effect; } >()("@t3tools/client-runtime/platform/capabilities/SshEnvironmentGateway") {}