Skip to content

@codesoul-co/hypha-inference / reasoning-registry

Using this module

Use the Reasoning registry module for registering and resolving versioned capabilities or implementations. It exports 1 class, 5 interfaces.

Import from the package entrypoint

ts
import {
  ReasoningStrategyRegistry,
} from '@codesoul-co/hypha-inference';

import type {
  ReasoningStrategy,
  ReasoningStrategyContext,
  ReasoningStrategyDescriptor,
  ReasoningStrategyReference,
  ReasoningStrategyRuntime,
} from '@codesoul-co/hypha-inference';

Usage patterns

  • Use the 5 type/interface exports 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
ReasoningStrategyRegistryclassnew ReasoningStrategyRegistry(): ReasoningStrategyRegistryReasoning Strategy Registry class with 7 public constructor or member entries; its exact declarations are listed below.
ReasoningStrategyinterfaceinterface ReasoningStrategyReasoning Strategy interface with 3 public fields or methods.
ReasoningStrategyContextinterfaceinterface ReasoningStrategyContextReasoning Strategy Context interface with 3 public fields or methods.
ReasoningStrategyDescriptorinterfaceinterface ReasoningStrategyDescriptorReasoning Strategy Descriptor interface with 9 public fields or methods.
ReasoningStrategyReferenceinterfaceinterface ReasoningStrategyReferenceReasoning Strategy Reference interface with 9 public fields or methods.
ReasoningStrategyRuntimeinterfaceinterface ReasoningStrategyRuntimeReasoning Strategy Runtime interface with 8 public fields or methods.

ReasoningStrategyRegistry

Reasoning Strategy Registry class with 7 public constructor or member entries; its exact declarations are listed below.

  • Kind: class
  • Import: import { ReasoningStrategyRegistry } from '@codesoul-co/hypha-inference';
  • Source module: reasoning-registry

Declaration

text
export declare class ReasoningStrategyRegistry {
    register(strategy: ReasoningStrategy, options?: {
            replace?: boolean;
        }): void;
    unregister(id: string): boolean;
    get(idOrAlias: string): ReasoningStrategy | null;
    require(idOrAlias: string): ReasoningStrategy;
    has(idOrAlias: string): boolean;
    list(): ReasoningStrategyDescriptor[];
}

Public members

MemberKindSignatureDescription
constructorconstructor(): ReasoningStrategyRegistryCreates an instance of this class.
getmethodget(idOrAlias: string): ReasoningStrategy | nullPublic method; parameters and return type are shown in the signature.
hasmethodhas(idOrAlias: string): booleanPublic method; parameters and return type are shown in the signature.
listmethodlist(): ReasoningStrategyDescriptor[]Public method; parameters and return type are shown in the signature.
registermethodregister(strategy: ReasoningStrategy, options?: { replace?: boolean; }): voidPublic method; parameters and return type are shown in the signature.
requiremethodrequire(idOrAlias: string): ReasoningStrategyPublic method; parameters and return type are shown in the signature.
unregistermethodunregister(id: string): booleanPublic method; parameters and return type are shown in the signature.

ReasoningStrategy

Reasoning Strategy interface with 3 public fields or methods.

  • Kind: interface
  • Import: import type { ReasoningStrategy } from '@codesoul-co/hypha-inference';
  • Source module: reasoning-registry

Declaration

text
export interface ReasoningStrategy {
    descriptor: ReasoningStrategyDescriptor;
    execute(context: ReasoningStrategyContext): Promise<InferenceResponse>;
    stream?(context: ReasoningStrategyContext): AsyncIterable<InferenceResponse>;
}

Contract members

MemberKindSignatureDescription
descriptorpropertydescriptor: ReasoningStrategyDescriptorPublic property; its type, readonly modifier and optionality are shown in the signature.
executemethodexecute(context: ReasoningStrategyContext): Promise<InferenceResponse>Public method; parameters and return type are shown in the signature.
streammethodstream?(context: ReasoningStrategyContext): AsyncIterable<InferenceResponse>Public method; parameters and return type are shown in the signature.

ReasoningStrategyContext

Reasoning Strategy Context interface with 3 public fields or methods.

  • Kind: interface
  • Import: import type { ReasoningStrategyContext } from '@codesoul-co/hypha-inference';
  • Source module: reasoning-registry

Declaration

text
export interface ReasoningStrategyContext {
    request: ReasoningRequest;
    options: ReasoningOptions;
    runtime: ReasoningStrategyRuntime;
}

Contract members

MemberKindSignatureDescription
optionspropertyoptions: ReasoningOptionsPublic property; its type, readonly modifier and optionality are shown in the signature.
requestpropertyrequest: ReasoningRequest<unknown>Public property; its type, readonly modifier and optionality are shown in the signature.
runtimepropertyruntime: ReasoningStrategyRuntimePublic property; its type, readonly modifier and optionality are shown in the signature.

ReasoningStrategyDescriptor

Reasoning Strategy Descriptor interface with 9 public fields or methods.

  • Kind: interface
  • Import: import type { ReasoningStrategyDescriptor } from '@codesoul-co/hypha-inference';
  • Source module: reasoning-registry

Declaration

text
export interface ReasoningStrategyDescriptor {
    id: string;
    version: string;
    method: ReasoningMethod;
    name: string;
    description: string;
    aliases?: string[];
    references: ReasoningStrategyReference[];
    capabilities: {
        branching: boolean;
        graph: boolean;
        aggregation: boolean;
        streaming: boolean;
        toolLoop: boolean;
    };
    metadata?: Record<string, unknown>;
}

Contract members

MemberKindSignatureDescription
aliasespropertyaliases?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
capabilitiespropertycapabilities: { branching: boolean; graph: boolean; aggregation: boolean; streaming: boolean; toolLoop: boolean; }Public property; its type, readonly modifier and optionality are shown in the signature.
descriptionpropertydescription: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
idpropertyid: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
metadatapropertymetadata?: Record<string, unknown>Public property; its type, readonly modifier and optionality are shown in the signature.
methodpropertymethod: ReasoningMethodPublic property; its type, readonly modifier and optionality are shown in the signature.
namepropertyname: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
referencespropertyreferences: ReasoningStrategyReference[]Public property; its type, readonly modifier and optionality are shown in the signature.
versionpropertyversion: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

ReasoningStrategyReference

Reasoning Strategy Reference interface with 9 public fields or methods.

  • Kind: interface
  • Import: import type { ReasoningStrategyReference } from '@codesoul-co/hypha-inference';
  • Source module: reasoning-registry

Declaration

text
export interface ReasoningStrategyReference {
    kind: 'repository' | 'paper' | 'documentation';
    title: string;
    url: string;
    repository?: string;
    revision?: string;
    license?: string;
    official: boolean;
    usage: 'adapted' | 'referenced';
    notes?: string;
}

Contract members

MemberKindSignatureDescription
kindpropertykind: "repository" | "paper" | "documentation"Public property; its type, readonly modifier and optionality are shown in the signature.
licensepropertylicense?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
notespropertynotes?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
officialpropertyofficial: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
repositorypropertyrepository?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
revisionpropertyrevision?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
titlepropertytitle: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
urlpropertyurl: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
usagepropertyusage: "referenced" | "adapted"Public property; its type, readonly modifier and optionality are shown in the signature.

ReasoningStrategyRuntime

Reasoning Strategy Runtime interface with 8 public fields or methods.

  • Kind: interface
  • Import: import type { ReasoningStrategyRuntime } from '@codesoul-co/hypha-inference';
  • Source module: reasoning-registry

Declaration

text
export interface ReasoningStrategyRuntime {
    callProvider(metadata: Record<string, unknown>): Promise<InferenceResponse>;
    aggregate(responses: InferenceResponse[], defaultAggregation?: ReasoningOptions['aggregation']): Promise<InferenceResponse>;
    score(response: InferenceResponse, node: ThoughtNode): Promise<number>;
    withReasoningMetadata(response: InferenceResponse, reasoning: Record<string, unknown>): InferenceResponse;
    trace(event: ReasoningTraceEvent): Promise<void>;
    assertBudget(nodeCount?: number): void;
    readonly modelCalls: number;
    readonly maxNodes: number;
}

Contract members

MemberKindSignatureDescription
aggregatemethodaggregate(responses: InferenceResponse[], defaultAggregation?: ReasoningOptions["aggregation"]): Promise<InferenceResponse>Public method; parameters and return type are shown in the signature.
assertBudgetmethodassertBudget(nodeCount?: number): voidPublic method; parameters and return type are shown in the signature.
callProvidermethodcallProvider(metadata: Record<string, unknown>): Promise<InferenceResponse>Public method; parameters and return type are shown in the signature.
maxNodespropertyreadonly maxNodes: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
modelCallspropertyreadonly modelCalls: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
scoremethodscore(response: InferenceResponse, node: ThoughtNode): Promise<number>Public method; parameters and return type are shown in the signature.
tracemethodtrace(event: ReasoningTraceEvent): Promise<void>Public method; parameters and return type are shown in the signature.
withReasoningMetadatamethodwithReasoningMetadata(response: InferenceResponse, reasoning: Record<string, unknown>): InferenceResponsePublic method; parameters and return type are shown in the signature.