@codesoul-co/hypha-inference / reasoning-registry
- Package index:
@codesoul-co/hypha-inference - Source:
packages/inference/src/reasoning-registry.ts - Exports: 6
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
| Symbol | Kind | Signature | Description |
|---|---|---|---|
ReasoningStrategyRegistry | class | new ReasoningStrategyRegistry(): ReasoningStrategyRegistry | Reasoning Strategy Registry class with 7 public constructor or member entries; its exact declarations are listed below. |
ReasoningStrategy | interface | interface ReasoningStrategy | Reasoning Strategy interface with 3 public fields or methods. |
ReasoningStrategyContext | interface | interface ReasoningStrategyContext | Reasoning Strategy Context interface with 3 public fields or methods. |
ReasoningStrategyDescriptor | interface | interface ReasoningStrategyDescriptor | Reasoning Strategy Descriptor interface with 9 public fields or methods. |
ReasoningStrategyReference | interface | interface ReasoningStrategyReference | Reasoning Strategy Reference interface with 9 public fields or methods. |
ReasoningStrategyRuntime | interface | interface ReasoningStrategyRuntime | Reasoning 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
| Member | Kind | Signature | Description |
|---|---|---|---|
constructor | constructor | (): ReasoningStrategyRegistry | Creates an instance of this class. |
get | method | get(idOrAlias: string): ReasoningStrategy | null | Public method; parameters and return type are shown in the signature. |
has | method | has(idOrAlias: string): boolean | Public method; parameters and return type are shown in the signature. |
list | method | list(): ReasoningStrategyDescriptor[] | Public method; parameters and return type are shown in the signature. |
register | method | register(strategy: ReasoningStrategy, options?: { replace?: boolean; }): void | Public method; parameters and return type are shown in the signature. |
require | method | require(idOrAlias: string): ReasoningStrategy | Public method; parameters and return type are shown in the signature. |
unregister | method | unregister(id: string): boolean | Public 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
| Member | Kind | Signature | Description |
|---|---|---|---|
descriptor | property | descriptor: ReasoningStrategyDescriptor | Public property; its type, readonly modifier and optionality are shown in the signature. |
execute | method | execute(context: ReasoningStrategyContext): Promise<InferenceResponse> | Public method; parameters and return type are shown in the signature. |
stream | method | stream?(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
| Member | Kind | Signature | Description |
|---|---|---|---|
options | property | options: ReasoningOptions | Public property; its type, readonly modifier and optionality are shown in the signature. |
request | property | request: ReasoningRequest<unknown> | Public property; its type, readonly modifier and optionality are shown in the signature. |
runtime | property | runtime: ReasoningStrategyRuntime | Public 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
| Member | Kind | Signature | Description |
|---|---|---|---|
aliases | property | aliases?: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
capabilities | property | capabilities: { branching: boolean; graph: boolean; aggregation: boolean; streaming: boolean; toolLoop: boolean; } | Public property; its type, readonly modifier and optionality are shown in the signature. |
description | property | description: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
id | property | id: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
metadata | property | metadata?: Record<string, unknown> | Public property; its type, readonly modifier and optionality are shown in the signature. |
method | property | method: ReasoningMethod | Public property; its type, readonly modifier and optionality are shown in the signature. |
name | property | name: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
references | property | references: ReasoningStrategyReference[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
version | property | version: string | Public 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
| Member | Kind | Signature | Description |
|---|---|---|---|
kind | property | kind: "repository" | "paper" | "documentation" | Public property; its type, readonly modifier and optionality are shown in the signature. |
license | property | license?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
notes | property | notes?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
official | property | official: boolean | Public property; its type, readonly modifier and optionality are shown in the signature. |
repository | property | repository?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
revision | property | revision?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
title | property | title: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
url | property | url: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
usage | property | usage: "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
| Member | Kind | Signature | Description |
|---|---|---|---|
aggregate | method | aggregate(responses: InferenceResponse[], defaultAggregation?: ReasoningOptions["aggregation"]): Promise<InferenceResponse> | Public method; parameters and return type are shown in the signature. |
assertBudget | method | assertBudget(nodeCount?: number): void | Public method; parameters and return type are shown in the signature. |
callProvider | method | callProvider(metadata: Record<string, unknown>): Promise<InferenceResponse> | Public method; parameters and return type are shown in the signature. |
maxNodes | property | readonly maxNodes: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
modelCalls | property | readonly modelCalls: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
score | method | score(response: InferenceResponse, node: ThoughtNode): Promise<number> | Public method; parameters and return type are shown in the signature. |
trace | method | trace(event: ReasoningTraceEvent): Promise<void> | Public method; parameters and return type are shown in the signature. |
withReasoningMetadata | method | withReasoningMetadata(response: InferenceResponse, reasoning: Record<string, unknown>): InferenceResponse | Public method; parameters and return type are shown in the signature. |
