@codesoul-co/hypha-memory / context-gateway
- Package index:
@codesoul-co/hypha-memory - Source:
packages/memory/src/context-gateway.ts - Exports: 6
Using this module
Use the Context gateway module for using the public contracts and operations for this capability boundary. It exports 1 class, 4 interfaces, 1 type.
Import from the package entrypoint
ts
import {
DefaultMemoryContextGateway,
} from '@codesoul-co/hypha-memory';
import type {
ContextGatewayRequest,
ContextGatewayResult,
DefaultMemoryContextGatewayOptions,
MemoryContextGateway,
ContextGatewayConsumer,
} from '@codesoul-co/hypha-memory';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 |
|---|---|---|---|
DefaultMemoryContextGateway | class | new DefaultMemoryContextGateway(options: DefaultMemoryContextGatewayOptions): DefaultMemoryContextGateway | Canonical Context entry point shared by Chat, Workflow, and Harness consumers. |
ContextGatewayRequest | interface | interface ContextGatewayRequest extends ResolvedContextBuildInput | Context Gateway Request interface with 20 public fields or methods. |
ContextGatewayResult | interface | interface ContextGatewayResult | Context Gateway Result interface with 4 public fields or methods. |
DefaultMemoryContextGatewayOptions | interface | interface DefaultMemoryContextGatewayOptions | Default Memory Context Gateway Options interface with 5 public fields or methods. |
MemoryContextGateway | interface | interface MemoryContextGateway | Memory Context Gateway interface with 1 public fields or methods. |
ContextGatewayConsumer | type | type ContextGatewayConsumer = 'chat' | 'workflow' | 'harness' | Public type alias for Context Gateway Consumer; the declaration contains its complete type expression. |
DefaultMemoryContextGateway
Canonical Context entry point shared by Chat, Workflow, and Harness consumers.
- Kind: class
- Import:
import { DefaultMemoryContextGateway } from '@codesoul-co/hypha-memory'; - Source module:
context-gateway
Declaration
text
export declare class DefaultMemoryContextGateway implements MemoryContextGateway {
constructor(options: DefaultMemoryContextGatewayOptions);
build(request: ContextGatewayRequest, signal?: AbortSignal): Promise<ContextGatewayResult>;
}Public members
| Member | Kind | Signature | Description |
|---|---|---|---|
build | method | build(request: ContextGatewayRequest, signal?: AbortSignal): Promise<ContextGatewayResult> | Public method; parameters and return type are shown in the signature. |
constructor | constructor | (options: DefaultMemoryContextGatewayOptions): DefaultMemoryContextGateway | Creates an instance of this class. |
ContextGatewayRequest
Context Gateway Request interface with 20 public fields or methods.
- Kind: interface
- Import:
import type { ContextGatewayRequest } from '@codesoul-co/hypha-memory'; - Source module:
context-gateway
Declaration
text
export interface ContextGatewayRequest extends ResolvedContextBuildInput {
consumer: ContextGatewayConsumer;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
consumer | property | consumer: ContextGatewayConsumer | Public property; its type, readonly modifier and optionality are shown in the signature. |
explicitSourceRefs | property | explicitSourceRefs?: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
messageCursor | property | messageCursor?: 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. |
modelContextWindowTokens | property | modelContextWindowTokens: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
operationId | property | operationId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
previousContextHash | property | previousContextHash?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
principal | property | principal: MemoryPrincipal | Public property; its type, readonly modifier and optionality are shown in the signature. |
profile | property | profile: ContextProfileSpec | Public property; its type, readonly modifier and optionality are shown in the signature. |
profileRef | property | profileRef: MemoryContractSpecRef | Public property; its type, readonly modifier and optionality are shown in the signature. |
query | property | query?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
reservedInstructionTokens | property | reservedInstructionTokens: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
reservedOutputTokens | property | reservedOutputTokens: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
reservedSystemTokens | property | reservedSystemTokens: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
runId | property | runId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
runtimeStateRef | property | runtimeStateRef?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
scope | property | scope: ManagedMemoryScope | Public property; its type, readonly modifier and optionality are shown in the signature. |
stateId | property | stateId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
stepId | property | stepId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
tokenizerRef | property | tokenizerRef?: MemoryContractSpecRef | Public property; its type, readonly modifier and optionality are shown in the signature. |
ContextGatewayResult
Context Gateway Result interface with 4 public fields or methods.
- Kind: interface
- Import:
import type { ContextGatewayResult } from '@codesoul-co/hypha-memory'; - Source module:
context-gateway
Declaration
text
export interface ContextGatewayResult {
envelope: ContextEnvelope;
explanation: ContextBuildExplanation;
sourceItemCount: number;
consumer: ContextGatewayConsumer;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
consumer | property | consumer: ContextGatewayConsumer | Public property; its type, readonly modifier and optionality are shown in the signature. |
envelope | property | envelope: ContextEnvelope | Public property; its type, readonly modifier and optionality are shown in the signature. |
explanation | property | explanation: ContextBuildExplanation | Public property; its type, readonly modifier and optionality are shown in the signature. |
sourceItemCount | property | sourceItemCount: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
DefaultMemoryContextGatewayOptions
Default Memory Context Gateway Options interface with 5 public fields or methods.
- Kind: interface
- Import:
import type { DefaultMemoryContextGatewayOptions } from '@codesoul-co/hypha-memory'; - Source module:
context-gateway
Declaration
text
export interface DefaultMemoryContextGatewayOptions {
resolver: ContextSourceResolverRegistry;
builder: MemoryContextBuilder;
injection: ContextInjectionGateway;
activityHook?: MemoryActivityHarnessHook;
eventContext?: (request: ContextGatewayRequest) => MemoryActivityRequest['eventContext'];
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
activityHook | property | activityHook?: MemoryActivityHarnessHook | Public property; its type, readonly modifier and optionality are shown in the signature. |
builder | property | builder: MemoryContextBuilder | Public property; its type, readonly modifier and optionality are shown in the signature. |
eventContext | method | eventContext?(request: ContextGatewayRequest): MemoryActivityRequest["eventContext"] | Public method; parameters and return type are shown in the signature. |
injection | property | injection: ContextInjectionGateway | Public property; its type, readonly modifier and optionality are shown in the signature. |
resolver | property | resolver: ContextSourceResolverRegistry | Public property; its type, readonly modifier and optionality are shown in the signature. |
MemoryContextGateway
Memory Context Gateway interface with 1 public fields or methods.
- Kind: interface
- Import:
import type { MemoryContextGateway } from '@codesoul-co/hypha-memory'; - Source module:
context-gateway
Declaration
text
export interface MemoryContextGateway {
build(request: ContextGatewayRequest, signal?: AbortSignal): Promise<ContextGatewayResult>;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
build | method | build(request: ContextGatewayRequest, signal?: AbortSignal): Promise<ContextGatewayResult> | Public method; parameters and return type are shown in the signature. |
ContextGatewayConsumer
Public type alias for Context Gateway Consumer; the declaration contains its complete type expression.
- Kind: type
- Import:
import type { ContextGatewayConsumer } from '@codesoul-co/hypha-memory'; - Source module:
context-gateway
Declaration
text
export type ContextGatewayConsumer = 'chat' | 'workflow' | 'harness';