Skip to content

@codesoul-co/hypha-core / modules/sandbox-provider/registry

Using this module

Use the Registry module for binding external or local providers to Hypha ports. It exports 1 class, 1 interface.

Import from the package entrypoint

ts
import {
  SandboxProviderRegistry,
} from '@codesoul-co/hypha-core';

import type {
  SandboxProviderRegistration,
} from '@codesoul-co/hypha-core';

Usage patterns

  • Use the 1 type/interface export as static contracts in application code, adapters, or tests. Import them with import type; they do not exist at runtime.
  • The module exposes 1 class as constructable runtime implementations. Each symbol entry lists its constructor and public methods.

Public exports

SymbolKindSignatureDescription
SandboxProviderRegistryclassnew SandboxProviderRegistry(): SandboxProviderRegistryProvider-neutral DI registry. It selects only from explicit Environment fields and never imports a concrete adapter into core.
SandboxProviderRegistrationinterfaceinterface SandboxProviderRegistrationSandbox Provider Registration interface with 2 public fields or methods.

SandboxProviderRegistry

Provider-neutral DI registry. It selects only from explicit Environment fields and never imports a concrete adapter into core.

Declaration

text
export declare class SandboxProviderRegistry {
    register(factory: SandboxProviderFactory): void;
    unregister(providerType: SandboxProviderType, providerId: string): boolean;
    list(providerType?: SandboxProviderType): SandboxProviderRegistration[];
    resolve(selection: SandboxProviderSelection): SandboxProviderFactory;
    create(selection: SandboxProviderSelection): Promise<SandboxProvider>;
}

Public members

MemberKindSignatureDescription
constructorconstructor(): SandboxProviderRegistryCreates an instance of this class.
createmethodcreate(selection: SandboxProviderSelection): Promise<SandboxProvider>Public method; parameters and return type are shown in the signature.
listmethodlist(providerType?: SandboxProviderType): SandboxProviderRegistration[]Public method; parameters and return type are shown in the signature.
registermethodregister(factory: SandboxProviderFactory): voidPublic method; parameters and return type are shown in the signature.
resolvemethodresolve(selection: SandboxProviderSelection): SandboxProviderFactoryPublic method; parameters and return type are shown in the signature.
unregistermethodunregister(providerType: SandboxProviderType, providerId: string): booleanPublic method; parameters and return type are shown in the signature.

SandboxProviderRegistration

Sandbox Provider Registration interface with 2 public fields or methods.

Declaration

text
export interface SandboxProviderRegistration {
    providerType: SandboxProviderType;
    providerId: string;
}

Contract members

MemberKindSignatureDescription
providerIdpropertyproviderId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
providerTypepropertyproviderType: "mock" | "local_process" | "docker" | "remote_sandbox" | "custom"Public property; its type, readonly modifier and optionality are shown in the signature.