Skip to content

@codesoul-co/hypha-kernel / index

模块用法

聚合 @codesoul-co/hypha-kernel 的公共入口导出;应用应从包入口导入这些 Symbol,不应依赖内部文件路径。

从包入口导入

ts
import {
  BasicReActAgentRuntime,
  DefaultAgenticReasoner,
  DefaultContextBuilder,
  DefaultThinkingPlanner,
  DefaultVerifier,
  InMemoryReActContinuationCheckpointStore,
  MemoryContextBuilder,
  ReActAgentRunner,
} from '@codesoul-co/hypha-kernel';

import type {
  AgenticReasoner,
  AgenticReasonerInput,
  AgenticReasoningDecision,
  BasicReActAgentRuntimeOptions,
  BuiltAgentContext,
  ContextBudget,
  ContextBuilder,
  ContextBuildInput,
} from '@codesoul-co/hypha-kernel';

// 完整导出列表见下方。

使用要点

  • 44 个类型/接口用于应用代码、Adapter 或测试中的静态契约;请使用 import type,运行时不应依赖它们。
  • 12 个类提供可实例化的运行时实现;构造参数与公开方法在各自条目中完整列出。
  • 8 个函数是该模块的直接操作入口;每个 overload 的必需/可选参数与返回类型均在下方列出。
  • 21 个常量/枚举提供稳定值、Schema、Definition 或默认配置;应复用这些导出,避免在应用中复制内部值。

运行时校验示例

ts
import { agenticReasoningModeSchema } from '@codesoul-co/hypha-kernel';

declare function loadExternalInput(): unknown;
const input: unknown = loadExternalInput();
const parsed = agenticReasoningModeSchema.parse(input);

配置、网络请求或持久化数据等不可信输入应先通过 Runtime Schema,再传给只接受已校验契约的函数或类。

公共导出

Symbol种类签名说明
BasicReActAgentRuntimenew BasicReActAgentRuntime(options?: BasicReActAgentRuntimeOptions): BasicReActAgentRuntimeBasic ReAct Agent Runtime 类,共公开 4 个构造函数或成员;精确签名见本条目的声明与成员表。
DefaultAgenticReasonernew DefaultAgenticReasoner(now?: () => string): DefaultAgenticReasonerDefault Agentic Reasoner 类,共公开 2 个构造函数或成员;精确签名见本条目的声明与成员表。
DefaultContextBuildernew DefaultContextBuilder(): DefaultContextBuilderDefault Context Builder 类,共公开 2 个构造函数或成员;精确签名见本条目的声明与成员表。
DefaultThinkingPlannernew DefaultThinkingPlanner(now?: () => string): DefaultThinkingPlannerDefault Thinking Planner 类,共公开 2 个构造函数或成员;精确签名见本条目的声明与成员表。
DefaultVerifiernew DefaultVerifier(): DefaultVerifierDefault Verifier 类,共公开 2 个构造函数或成员;精确签名见本条目的声明与成员表。
InMemoryReActContinuationCheckpointStorenew InMemoryReActContinuationCheckpointStore(options?: InMemoryReActContinuationCheckpointStoreOptions): InMemoryReActContinuationCheckpointStoreIn Memory ReAct Continuation Checkpoint Store 类,共公开 4 个构造函数或成员;精确签名见本条目的声明与成员表。
MemoryContextBuildernew MemoryContextBuilder(options: MemoryContextBuilderOptions): MemoryContextBuilderMemory Context Builder 类,共公开 2 个构造函数或成员;精确签名见本条目的声明与成员表。
ReActAgentRunnernew ReActAgentRunner(options: ReActAgentRunnerOptions): ReActAgentRunnerReAct Agent Runner 类,共公开 2 个构造函数或成员;精确签名见本条目的声明与成员表。
ReActRunnernew ReActRunner(runtime: ReActAgentRuntime, options: ReActRunnerOptions): ReActRunnerReAct Runner 类,共公开 2 个构造函数或成员;精确签名见本条目的声明与成员表。
ReasoningContextBuildernew ReasoningContextBuilder(options?: ReasoningContextBuilderOptions): ReasoningContextBuilderReasoning Context Builder 类,共公开 2 个构造函数或成员;精确签名见本条目的声明与成员表。
SkillContextBuildernew SkillContextBuilder(options: SkillContextBuilderOptions): SkillContextBuilderSkill Context Builder 类,共公开 2 个构造函数或成员;精确签名见本条目的声明与成员表。
ToolRunnerActivityAdapternew ToolRunnerActivityAdapter(runner: ToolRunner): ToolRunnerActivityAdapterTool Runner Activity Adapter 类,共公开 3 个构造函数或成员;精确签名见本条目的声明与成员表。
agenticReasoningModeSchema常量const agenticReasoningModeSchema: z.ZodEnum<["react", "fsm_react", "tot", "critique"]>Agentic Reasoning Mode 的运行时 Schema。
kernelSpecDefinitions常量const kernelSpecDefinitions: readonly [SpecSchemaDefinition<ReActAgentSpec>, SpecSchemaDefinition<ReasoningConfig>]index 模块导出的 Kernel Spec Definitions 常量。
kernelSpecJsonSchemas常量const kernelSpecJsonSchemas: Record<string, JsonSchema>index 模块导出的 Kernel Spec JSON Schemas 常量。
REACT_PHASE_ORDER常量const REACT_PHASE_ORDER: ReActPhase[]index 模块导出的 REACT PHASE ORDER 常量。
REACT_SUSPENSION_REASONS常量const REACT_SUSPENSION_REASONS: readonly ["quantum_exhausted", "iteration_budget_exhausted", "model_call_budget_exhausted", "tool_call_budget_exhausted", "token_budget_exhausted", "non_progress", "deadline_exceeded"]index 模块导出的 REACT SUSPENSION REASONS 常量。
reActActionSchema常量const reActActionSchema: z.ZodEffects<z.ZodObject<{ type: z.ZodEnum<["tool", "model", "finish", "human_review"]>; toolCallId: z.ZodOptional<z.ZodString>; target: z.ZodOptional<z.ZodString>; input: z.ZodOptional<z.ZodEffects<z.ZodUnknown, unknown, unknown>>; reason: z.ZodOptional<z.ZodString>; }, "strict", z.ZodTypeAny, { type: "human_review" | "tool" | "model" | "finish"; reason?: string | undefined; toolCallId?: ...Re Act Action 的运行时 Schema。
reactAgentSpecDefinition常量const reactAgentSpecDefinition: SpecSchemaDefinition<ReActAgentSpec>React Agent Spec 的运行时校验入口,组合 Parser、Example 与 JSON Schema。
reactAgentSpecExample常量const reactAgentSpecExample: ReActAgentSpecReact Agent Spec 的有效示例值。
reactAgentSpecJsonSchema常量const reactAgentSpecJsonSchema: JsonSchemaReact Agent Spec 的 JSON Schema。
reactAgentSpecSchema常量const reactAgentSpecSchema: z.ZodObject<{ id: z.ZodString; version: z.ZodString; description: z.ZodOptional<z.ZodString>; owner: z.ZodOptional<z.ZodString>; tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; createdAt: z.ZodOptional<z.ZodString>; updatedAt: z.ZodOptional<z.ZodString>; } & { name: z.ZodString; modelAlias: z.ZodString; systemInstructions: z.ZodOptional<z.ZodString>; promptRefs: z.ZodOptional<z.Zo...React Agent Spec 的运行时 Schema。
reActContinuationCheckpointJsonSchema常量const reActContinuationCheckpointJsonSchema: JsonSchemaRe Act Continuation Checkpoint 的 JSON Schema。
reActContinuationCheckpointSchema常量const reActContinuationCheckpointSchema: z.ZodEffects<z.ZodObject<{ version: z.ZodLiteral<"1.0.0">; runId: z.ZodString; stepId: z.ZodString; scopeHash: z.ZodString; agentRef: z.ZodObject<{ id: z.ZodString; version: z.ZodString; }, "strict", z.ZodTypeAny, { version: string; id: string; }, { version: string; id: string; }>; nextPhase: z.ZodEnum<["reason", "act"]>; messages: z.ZodArray<z.ZodObject<{ role: z.ZodEnum<[...Re Act Continuation Checkpoint 的运行时 Schema。
reActExecutionBudgetJsonSchema常量const reActExecutionBudgetJsonSchema: JsonSchemaRe Act Execution Budget 的 JSON Schema。
reActExecutionBudgetSchema常量const reActExecutionBudgetSchema: z.ZodObject<{ maxIterations: z.ZodNumber; maxModelCalls: z.ZodNumber; maxToolCalls: z.ZodNumber; maxTotalTokens: z.ZodOptional<z.ZodNumber>; maxConsecutiveNoProgress: z.ZodNumber; quantumIterations: z.ZodNumber; deadlineAt: z.ZodOptional<z.ZodString>; }, "strict", z.ZodTypeAny, { maxIterations: number; maxModelCalls: number; maxToolCalls: number; maxConsecutiveNoProgress: number; ...Re Act Execution Budget 的运行时 Schema。
reactPhaseSchema常量const reactPhaseSchema: z.ZodEnum<["observe", "reason", "select_action", "policy_check", "act", "observe_result", "verify", "memory_sync", "complete", "fail", "human_review", "suspend", "cancel"]>React Phase 的运行时 Schema。
reasoningConfigExample常量const reasoningConfigExample: ReasoningConfigReasoning Config 的有效示例值。
reasoningConfigJsonSchema常量const reasoningConfigJsonSchema: JsonSchemaReasoning Config 的 JSON Schema。
reasoningConfigSchema常量const reasoningConfigSchema: z.ZodObject<{ thinkingMode: z.ZodOptional<z.ZodEnum<["none", "summary", "structured"]>>; agenticMode: z.ZodOptional<z.ZodEnum<["react", "fsm_react", "tot", "critique"]>>; maxSteps: z.ZodOptional<z.ZodNumber>; persist: z.ZodOptional<z.ZodEnum<["summary_only", "events_only"]>>; plannerRef: z.ZodOptional<z.ZodString>; reasonerRef: z.ZodOptional<z.ZodString>; metadata: z.ZodOptional<z.ZodR...Reasoning Config 的运行时 Schema。
reasoningConfigSpecDefinition常量const reasoningConfigSpecDefinition: SpecSchemaDefinition<ReasoningConfig>Reasoning Config Spec 的运行时校验入口,组合 Parser、Example 与 JSON Schema。
reasoningPersistenceSchema常量const reasoningPersistenceSchema: z.ZodEnum<["summary_only", "events_only"]>Reasoning Persistence 的运行时 Schema。
thinkingModeSchema常量const thinkingModeSchema: z.ZodEnum<["none", "summary", "structured"]>Thinking Mode 的运行时 Schema。
createEpisodicMemorySync函数createEpisodicMemorySync(options: EpisodicMemorySyncOptions): NonNullable<ReActRunnerOptions["syncMemory"]>Create Episodic Memory Sync 函数,提供 1 个公开调用签名;参数与返回类型见下表。
createReActStep函数createReActStep(id: string, phase: ReActPhase, input?: unknown): ReActStepCreate ReAct Step 函数,提供 1 个公开调用签名;参数与返回类型见下表。
reActContinuationScopeHash函数reActContinuationScopeHash(context: ReActRunContext): stringRe Act Continuation Scope Hash 函数,提供 1 个公开调用签名;参数与返回类型见下表。
validateReActAction函数validateReActAction(input: unknown): ReActActionValidate ReAct Action 函数,提供 1 个公开调用签名;参数与返回类型见下表。
validateReActAgentSpec函数validateReActAgentSpec(input: unknown): ReActAgentSpecValidate ReAct Agent Spec 函数,提供 1 个公开调用签名;参数与返回类型见下表。
validateReActContinuationCheckpoint函数validateReActContinuationCheckpoint(input: unknown): ReActContinuationCheckpointValidate ReAct Continuation Checkpoint 函数,提供 1 个公开调用签名;参数与返回类型见下表。
validateReActExecutionBudget函数validateReActExecutionBudget(input: unknown): ReActExecutionBudgetValidate ReAct Execution Budget 函数,提供 1 个公开调用签名;参数与返回类型见下表。
validateReasoningConfig函数validateReasoningConfig(input: unknown): ReasoningConfigValidate Reasoning Config 函数,提供 1 个公开调用签名;参数与返回类型见下表。
AgenticReasoner接口interface AgenticReasonerAgentic Reasoner 接口,共包含 1 个公开字段或方法。
AgenticReasonerInput接口interface AgenticReasonerInputAgentic Reasoner Input 接口,共包含 3 个公开字段或方法。
AgenticReasoningDecision接口interface AgenticReasoningDecisionAgentic Reasoning Decision 接口,共包含 11 个公开字段或方法。
BasicReActAgentRuntimeOptions接口interface BasicReActAgentRuntimeOptionsBasic ReAct Agent Runtime Options 接口,共包含 1 个公开字段或方法。
BuiltAgentContext接口interface BuiltAgentContext extends ReActRunContextBuilt Agent Context 接口,共包含 18 个公开字段或方法。
ContextBudget接口interface ContextBudgetContext Budget 接口,共包含 4 个公开字段或方法。
ContextBuilder接口interface ContextBuilderContext Builder 接口,共包含 1 个公开字段或方法。
ContextBuildInput接口interface ContextBuildInputContext Build Input 接口,共包含 12 个公开字段或方法。
ContextProvenance接口interface ContextProvenanceContext Provenance 接口,共包含 6 个公开字段或方法。
EpisodicMemorySyncOptions接口interface EpisodicMemorySyncOptionsEpisodic Memory Sync Options 接口,共包含 7 个公开字段或方法。
InMemoryReActContinuationCheckpointStoreOptions接口interface InMemoryReActContinuationCheckpointStoreOptionsIn Memory ReAct Continuation Checkpoint Store Options 接口,共包含 3 个公开字段或方法。
MemoryContextBuilderOptions接口interface MemoryContextBuilderOptionsMemory Context Builder Options 接口,共包含 7 个公开字段或方法。
MemoryContextItem接口interface MemoryContextItemMemory Context Item 接口,共包含 5 个公开字段或方法。
ReActAction接口interface ReActActionReAct Action 接口,共包含 5 个公开字段或方法。
ReActAgentRunnerOptions接口interface ReActAgentRunnerOptions extends Omit<ReActRunnerOptions, 'toolRunner'>ReAct Agent Runner Options 接口,共包含 25 个公开字段或方法。
ReActAgentRuntime接口interface ReActAgentRuntimeReAct Agent Runtime 接口,共包含 3 个公开字段或方法。
ReActAgentSpec接口interface ReActAgentSpec extends VersionedSpec, SpecMetadataReAct Agent Spec 接口,共包含 17 个公开字段或方法。
ReActContinuationCheckpoint接口interface ReActContinuationCheckpointReAct Continuation Checkpoint 接口,共包含 19 个公开字段或方法。
ReActContinuationCheckpointPutResult接口interface ReActContinuationCheckpointPutResultReAct Continuation Checkpoint Put Result 接口,共包含 2 个公开字段或方法。
ReActContinuationCheckpointStore接口interface ReActContinuationCheckpointStoreReAct Continuation Checkpoint Store 接口,共包含 3 个公开字段或方法。
ReActExecutionBudget接口interface ReActExecutionBudgetGlobal limits survive process restarts through ReActContinuationCheckpoint. quantumIterations only bounds one worker turn; it is not a new total budget.
ReActObservation接口interface ReActObservationReAct Observation 接口,共包含 3 个公开字段或方法。
ReActRunContext接口interface ReActRunContextReAct Run Context 接口,共包含 14 个公开字段或方法。
ReActRunControl接口interface ReActRunControlReAct Run Control 接口,共包含 4 个公开字段或方法。
ReActRunnerOptions接口interface ReActRunnerOptionsReAct Runner Options 接口,共包含 13 个公开字段或方法。
ReActRunResult接口interface ReActRunResultReAct Run Result 接口,共包含 8 个公开字段或方法。
ReActStep接口interface ReActStepReAct Step 接口,共包含 5 个公开字段或方法。
ReActSuspension接口interface ReActSuspensionReAct Suspension 接口,共包含 4 个公开字段或方法。
ReasoningConfig接口interface ReasoningConfigReasoning Config 接口,共包含 7 个公开字段或方法。
ReasoningContextBuilderOptions接口interface ReasoningContextBuilderOptionsReasoning Context Builder Options 接口,共包含 5 个公开字段或方法。
RequiredReasoningConfig接口interface RequiredReasoningConfig extends Required<Omit<ReasoningConfig, 'plannerRef' | 'reasonerRef' | 'metadata'>>Required Reasoning Config 接口,共包含 7 个公开字段或方法。
SkillContextBuilderOptions接口interface SkillContextBuilderOptionsSkill Context Builder Options 接口,共包含 9 个公开字段或方法。
ThinkingPlan接口interface ThinkingPlanThinking Plan 接口,共包含 10 个公开字段或方法。
ThinkingPlanner接口interface ThinkingPlannerThinking Planner 接口,共包含 1 个公开字段或方法。
ThinkingPlannerInput接口interface ThinkingPlannerInputThinking Planner Input 接口,共包含 2 个公开字段或方法。
ToolActivityPort接口interface ToolActivityPortTool Activity Port 接口,共包含 2 个公开字段或方法。
ToolActivityRequest接口interface ToolActivityRequestTool Activity Request 接口,共包含 10 个公开字段或方法。
ToolActivityResult接口interface ToolActivityResultTool Activity Result 接口,共包含 7 个公开字段或方法。
Verifier接口interface VerifierVerifier 接口,共包含 1 个公开字段或方法。
AgenticReasoningMode类型type AgenticReasoningMode = 'react' | 'fsm_react' | 'tot' | 'critique'Agentic Reasoning Mode 公共类型别名;完整类型表达式见声明。
ReActPhase类型type ReActPhase = 'observe' | 'reason' | 'select_action' | 'policy_check' | 'act' | 'observe_result' | 'verify' | 'memory_sync' | 'complete' | 'fail' | 'human_review' | 'suspend' | 'cancel'ReAct Phase 公共类型别名;完整类型表达式见声明。
ReActSuspensionReason类型type ReActSuspensionReason = (typeof REACT_SUSPENSION_REASONS)[number]ReAct Suspension Reason 公共类型别名;完整类型表达式见声明。
ReasoningPersistence类型type ReasoningPersistence = 'summary_only' | 'events_only'Reasoning Persistence 公共类型别名;完整类型表达式见声明。
ThinkingMode类型type ThinkingMode = 'none' | 'summary' | 'structured'Thinking Mode 公共类型别名;完整类型表达式见声明。

BasicReActAgentRuntime

Basic ReAct Agent Runtime 类,共公开 4 个构造函数或成员;精确签名见本条目的声明与成员表。

  • 种类: 类
  • 导入: import { BasicReActAgentRuntime } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export declare class BasicReActAgentRuntime implements ReActAgentRuntime {
    constructor(options?: BasicReActAgentRuntimeOptions);
    reason(context: ReActRunContext): Promise<InferenceRequest>;
    selectAction(response: InferenceResponse): Promise<ReActAction>;
    verify(context: ReActRunContext, observation: ReActObservation): Promise<ReActAction>;
}

公开成员

成员种类签名说明
constructor构造函数(options?: BasicReActAgentRuntimeOptions): BasicReActAgentRuntime创建该类的实例。
reason方法reason(context: ReActRunContext): Promise<InferenceRequest>公开方法;参数与返回类型以签名列为准。
selectAction方法selectAction(response: InferenceResponse): Promise<ReActAction>公开方法;参数与返回类型以签名列为准。
verify方法verify(context: ReActRunContext, observation: ReActObservation): Promise<ReActAction>公开方法;参数与返回类型以签名列为准。

DefaultAgenticReasoner

Default Agentic Reasoner 类,共公开 2 个构造函数或成员;精确签名见本条目的声明与成员表。

  • 种类: 类
  • 导入: import { DefaultAgenticReasoner } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export declare class DefaultAgenticReasoner implements AgenticReasoner {
    constructor(now?: () => string);
    decide(input: AgenticReasonerInput): Promise<AgenticReasoningDecision>;
}

公开成员

成员种类签名说明
constructor构造函数(now?: () => string): DefaultAgenticReasoner创建该类的实例。
decide方法decide(input: AgenticReasonerInput): Promise<AgenticReasoningDecision>公开方法;参数与返回类型以签名列为准。

DefaultContextBuilder

Default Context Builder 类,共公开 2 个构造函数或成员;精确签名见本条目的声明与成员表。

  • 种类: 类
  • 导入: import { DefaultContextBuilder } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export declare class DefaultContextBuilder implements ContextBuilder {
    build(input: ContextBuildInput): Promise<BuiltAgentContext>;
}

公开成员

成员种类签名说明
build方法build(input: ContextBuildInput): Promise<BuiltAgentContext>公开方法;参数与返回类型以签名列为准。
constructor构造函数(): DefaultContextBuilder创建该类的实例。

DefaultThinkingPlanner

Default Thinking Planner 类,共公开 2 个构造函数或成员;精确签名见本条目的声明与成员表。

  • 种类: 类
  • 导入: import { DefaultThinkingPlanner } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export declare class DefaultThinkingPlanner implements ThinkingPlanner {
    constructor(now?: () => string);
    plan(input: ThinkingPlannerInput): Promise<ThinkingPlan>;
}

公开成员

成员种类签名说明
constructor构造函数(now?: () => string): DefaultThinkingPlanner创建该类的实例。
plan方法plan(input: ThinkingPlannerInput): Promise<ThinkingPlan>公开方法;参数与返回类型以签名列为准。

DefaultVerifier

Default Verifier 类,共公开 2 个构造函数或成员;精确签名见本条目的声明与成员表。

  • 种类: 类
  • 导入: import { DefaultVerifier } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export declare class DefaultVerifier implements Verifier {
    verify(_context: ReActRunContext, observation: ReActObservation): Promise<ReActAction>;
}

公开成员

成员种类签名说明
constructor构造函数(): DefaultVerifier创建该类的实例。
verify方法verify(_context: ReActRunContext, observation: ReActObservation): Promise<ReActAction>公开方法;参数与返回类型以签名列为准。

InMemoryReActContinuationCheckpointStore

In Memory ReAct Continuation Checkpoint Store 类,共公开 4 个构造函数或成员;精确签名见本条目的声明与成员表。

  • 种类: 类
  • 导入: import { InMemoryReActContinuationCheckpointStore } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export declare class InMemoryReActContinuationCheckpointStore implements ReActContinuationCheckpointStore {
    constructor(options?: InMemoryReActContinuationCheckpointStoreOptions);
    put(input: ReActContinuationCheckpoint, idempotencyKey: string): Promise<ReActContinuationCheckpointPutResult>;
    get(runId: string, stepId: string, expectedScopeHash: string): Promise<ReActContinuationCheckpoint | null>;
    delete(runId: string, stepId: string, expectedScopeHash: string, expectedStepSequence?: number): Promise<boolean>;
}

公开成员

成员种类签名说明
constructor构造函数(options?: InMemoryReActContinuationCheckpointStoreOptions): InMemoryReActContinuationCheckpointStore创建该类的实例。
delete方法delete(runId: string, stepId: string, expectedScopeHash: string, expectedStepSequence?: number): Promise<boolean>公开方法;参数与返回类型以签名列为准。
get方法get(runId: string, stepId: string, expectedScopeHash: string): Promise<ReActContinuationCheckpoint | null>公开方法;参数与返回类型以签名列为准。
put方法put(input: ReActContinuationCheckpoint, idempotencyKey: string): Promise<ReActContinuationCheckpointPutResult>公开方法;参数与返回类型以签名列为准。

MemoryContextBuilder

Memory Context Builder 类,共公开 2 个构造函数或成员;精确签名见本条目的声明与成员表。

  • 种类: 类
  • 导入: import { MemoryContextBuilder } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export declare class MemoryContextBuilder implements ContextBuilder {
    constructor(options: MemoryContextBuilderOptions);
    build(input: ContextBuildInput): Promise<BuiltAgentContext>;
}

公开成员

成员种类签名说明
build方法build(input: ContextBuildInput): Promise<BuiltAgentContext>公开方法;参数与返回类型以签名列为准。
constructor构造函数(options: MemoryContextBuilderOptions): MemoryContextBuilder创建该类的实例。

ReActAgentRunner

ReAct Agent Runner 类,共公开 2 个构造函数或成员;精确签名见本条目的声明与成员表。

  • 种类: 类
  • 导入: import { ReActAgentRunner } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export declare class ReActAgentRunner {
    constructor(options: ReActAgentRunnerOptions);
    run(input: ContextBuildInput, control?: ReActRunControl): Promise<ReActRunResult>;
}

公开成员

成员种类签名说明
constructor构造函数(options: ReActAgentRunnerOptions): ReActAgentRunner创建该类的实例。
run方法run(input: ContextBuildInput, control?: ReActRunControl): Promise<ReActRunResult>公开方法;参数与返回类型以签名列为准。

ReActRunner

ReAct Runner 类,共公开 2 个构造函数或成员;精确签名见本条目的声明与成员表。

  • 种类: 类
  • 导入: import { ReActRunner } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export declare class ReActRunner {
    constructor(runtime: ReActAgentRuntime, options: ReActRunnerOptions);
    run(context: ReActRunContext, control?: ReActRunControl): Promise<ReActRunResult>;
}

公开成员

成员种类签名说明
constructor构造函数(runtime: ReActAgentRuntime, options: ReActRunnerOptions): ReActRunner创建该类的实例。
run方法run(context: ReActRunContext, control?: ReActRunControl): Promise<ReActRunResult>公开方法;参数与返回类型以签名列为准。

ReasoningContextBuilder

Reasoning Context Builder 类,共公开 2 个构造函数或成员;精确签名见本条目的声明与成员表。

  • 种类: 类
  • 导入: import { ReasoningContextBuilder } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export declare class ReasoningContextBuilder implements ContextBuilder {
    constructor(options?: ReasoningContextBuilderOptions);
    build(input: ContextBuildInput): Promise<BuiltAgentContext>;
}

公开成员

成员种类签名说明
build方法build(input: ContextBuildInput): Promise<BuiltAgentContext>公开方法;参数与返回类型以签名列为准。
constructor构造函数(options?: ReasoningContextBuilderOptions): ReasoningContextBuilder创建该类的实例。

SkillContextBuilder

Skill Context Builder 类,共公开 2 个构造函数或成员;精确签名见本条目的声明与成员表。

  • 种类: 类
  • 导入: import { SkillContextBuilder } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export declare class SkillContextBuilder implements ContextBuilder {
    constructor(options: SkillContextBuilderOptions);
    build(input: ContextBuildInput): Promise<BuiltAgentContext>;
}

公开成员

成员种类签名说明
build方法build(input: ContextBuildInput): Promise<BuiltAgentContext>公开方法;参数与返回类型以签名列为准。
constructor构造函数(options: SkillContextBuilderOptions): SkillContextBuilder创建该类的实例。

ToolRunnerActivityAdapter

Tool Runner Activity Adapter 类,共公开 3 个构造函数或成员;精确签名见本条目的声明与成员表。

  • 种类: 类
  • 导入: import { ToolRunnerActivityAdapter } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export declare class ToolRunnerActivityAdapter implements ToolActivityPort {
    constructor(runner: ToolRunner);
    execute(request: ToolActivityRequest): Promise<ToolActivityResult>;
    cancel(invocationId: string, reason?: string): Promise<ToolActivityResult | null>;
}

公开成员

成员种类签名说明
cancel方法cancel(invocationId: string, reason?: string): Promise<ToolActivityResult | null>公开方法;参数与返回类型以签名列为准。
constructor构造函数(runner: ToolRunner): ToolRunnerActivityAdapter创建该类的实例。
execute方法execute(request: ToolActivityRequest): Promise<ToolActivityResult>公开方法;参数与返回类型以签名列为准。

agenticReasoningModeSchema

Agentic Reasoning Mode 的运行时 Schema。

  • 种类: 常量
  • 导入: import { agenticReasoningModeSchema } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export declare const agenticReasoningModeSchema: z.ZodEnum<["react", "fsm_react", "tot", "critique"]>;

kernelSpecDefinitions

index 模块导出的 Kernel Spec Definitions 常量。

  • 种类: 常量
  • 导入: import { kernelSpecDefinitions } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export declare const kernelSpecDefinitions: readonly [SpecSchemaDefinition<ReActAgentSpec>, SpecSchemaDefinition<ReasoningConfig>];

kernelSpecJsonSchemas

index 模块导出的 Kernel Spec JSON Schemas 常量。

  • 种类: 常量
  • 导入: import { kernelSpecJsonSchemas } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export declare const kernelSpecJsonSchemas: Record<string, JsonSchema>;

REACT_PHASE_ORDER

index 模块导出的 REACT PHASE ORDER 常量。

  • 种类: 常量
  • 导入: import { REACT_PHASE_ORDER } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export declare const REACT_PHASE_ORDER: ReActPhase[];

REACT_SUSPENSION_REASONS

index 模块导出的 REACT SUSPENSION REASONS 常量。

  • 种类: 常量
  • 导入: import { REACT_SUSPENSION_REASONS } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export declare const REACT_SUSPENSION_REASONS: readonly ["quantum_exhausted", "iteration_budget_exhausted", "model_call_budget_exhausted", "tool_call_budget_exhausted", "token_budget_exhausted", "non_progress", "deadline_exceeded"];

reActActionSchema

Re Act Action 的运行时 Schema。

  • 种类: 常量
  • 导入: import { reActActionSchema } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export declare const reActActionSchema: z.ZodEffects<z.ZodObject<{ type: z.ZodEnum<["tool", "model", "finish", "human_review"]>; toolCallId: z.ZodOptional<z.ZodString>; target: z.ZodOptional<z.ZodString>; input: z.ZodOptional<z.ZodEffects<z.ZodUnknown, unknown, unknown>>; reason: z.ZodOptional<z.ZodString>; }, "strict", z.ZodTypeAny, { type: "human_review" | "tool" | "model" | "finish"; reason?: string | undefined; toolCallId?: string | undefined; target?: string | undefined; input?: unknown; }, { type: "human_review" | "tool" | "model" | "finish"; reason?: string | undefined; toolCallId?: string | undefined; target?: string | undefined; input?: unknown; }>, { type: "human_review" | "tool" | "model" | "finish"; reason?: string | undefined; toolCallId?: string | undefined; target?: string | undefined; input?: unknown; }, { type: "human_review" | "tool" | "model" | "finish"; reason?: string | undefined; toolCallId?: string | undefined; target?: string | undefined; input?: unknown; }>;

reactAgentSpecDefinition

React Agent Spec 的运行时校验入口,组合 Parser、Example 与 JSON Schema。

  • 种类: 常量
  • 导入: import { reactAgentSpecDefinition } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export declare const reactAgentSpecDefinition: SpecSchemaDefinition<ReActAgentSpec>;

reactAgentSpecExample

React Agent Spec 的有效示例值。

  • 种类: 常量
  • 导入: import { reactAgentSpecExample } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export declare const reactAgentSpecExample: ReActAgentSpec;

reactAgentSpecJsonSchema

React Agent Spec 的 JSON Schema。

  • 种类: 常量
  • 导入: import { reactAgentSpecJsonSchema } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export declare const reactAgentSpecJsonSchema: JsonSchema;

reactAgentSpecSchema

React Agent Spec 的运行时 Schema。

  • 种类: 常量
  • 导入: import { reactAgentSpecSchema } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
// 精确类型由包入口解析;完整编译器展开定义见源码链接。
export declare const reactAgentSpecSchema: (typeof import('@codesoul-co/hypha-kernel'))['reactAgentSpecSchema'];

该常量的编译器展开类型已压缩;它的公共名称、顶层类型与源码位置仍保留在本条目中。相关输入/输出字段请使用同模块导出的接口、类型或 Runtime Schema。

reActContinuationCheckpointJsonSchema

Re Act Continuation Checkpoint 的 JSON Schema。

  • 种类: 常量
  • 导入: import { reActContinuationCheckpointJsonSchema } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export declare const reActContinuationCheckpointJsonSchema: JsonSchema;

reActContinuationCheckpointSchema

Re Act Continuation Checkpoint 的运行时 Schema。

  • 种类: 常量
  • 导入: import { reActContinuationCheckpointSchema } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
// 精确类型由包入口解析;完整编译器展开定义见源码链接。
export declare const reActContinuationCheckpointSchema: (typeof import('@codesoul-co/hypha-kernel'))['reActContinuationCheckpointSchema'];

该常量的编译器展开类型已压缩;它的公共名称、顶层类型与源码位置仍保留在本条目中。相关输入/输出字段请使用同模块导出的接口、类型或 Runtime Schema。

reActExecutionBudgetJsonSchema

Re Act Execution Budget 的 JSON Schema。

  • 种类: 常量
  • 导入: import { reActExecutionBudgetJsonSchema } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export declare const reActExecutionBudgetJsonSchema: JsonSchema;

reActExecutionBudgetSchema

Re Act Execution Budget 的运行时 Schema。

  • 种类: 常量
  • 导入: import { reActExecutionBudgetSchema } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export declare const reActExecutionBudgetSchema: z.ZodObject<{ maxIterations: z.ZodNumber; maxModelCalls: z.ZodNumber; maxToolCalls: z.ZodNumber; maxTotalTokens: z.ZodOptional<z.ZodNumber>; maxConsecutiveNoProgress: z.ZodNumber; quantumIterations: z.ZodNumber; deadlineAt: z.ZodOptional<z.ZodString>; }, "strict", z.ZodTypeAny, { maxIterations: number; maxModelCalls: number; maxToolCalls: number; maxConsecutiveNoProgress: number; quantumIterations: number; maxTotalTokens?: number | undefined; deadlineAt?: string | undefined; }, { maxIterations: number; maxModelCalls: number; maxToolCalls: number; maxConsecutiveNoProgress: number; quantumIterations: number; maxTotalTokens?: number | undefined; deadlineAt?: string | undefined; }>;

reactPhaseSchema

React Phase 的运行时 Schema。

  • 种类: 常量
  • 导入: import { reactPhaseSchema } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export declare const reactPhaseSchema: z.ZodEnum<["observe", "reason", "select_action", "policy_check", "act", "observe_result", "verify", "memory_sync", "complete", "fail", "human_review", "suspend", "cancel"]>;

reasoningConfigExample

Reasoning Config 的有效示例值。

  • 种类: 常量
  • 导入: import { reasoningConfigExample } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export declare const reasoningConfigExample: ReasoningConfig;

reasoningConfigJsonSchema

Reasoning Config 的 JSON Schema。

  • 种类: 常量
  • 导入: import { reasoningConfigJsonSchema } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export declare const reasoningConfigJsonSchema: JsonSchema;

reasoningConfigSchema

Reasoning Config 的运行时 Schema。

  • 种类: 常量
  • 导入: import { reasoningConfigSchema } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export declare const reasoningConfigSchema: z.ZodObject<{ thinkingMode: z.ZodOptional<z.ZodEnum<["none", "summary", "structured"]>>; agenticMode: z.ZodOptional<z.ZodEnum<["react", "fsm_react", "tot", "critique"]>>; maxSteps: z.ZodOptional<z.ZodNumber>; persist: z.ZodOptional<z.ZodEnum<["summary_only", "events_only"]>>; plannerRef: z.ZodOptional<z.ZodString>; reasonerRef: z.ZodOptional<z.ZodString>; metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>; }, "strip", z.ZodTypeAny, { thinkingMode?: "none" | "summary" | "structured" | undefined; agenticMode?: "react" | "fsm_react" | "tot" | "critique" | undefined; maxSteps?: number | undefined; persist?: "summary_only" | "events_only" | undefined; plannerRef?: string | undefined; reasonerRef?: string | undefined; metadata?: Record<string, unknown> | undefined; }, { thinkingMode?: "none" | "summary" | "structured" | undefined; agenticMode?: "react" | "fsm_react" | "tot" | "critique" | undefined; maxSteps?: number | undefined; persist?: "summary_only" | "events_only" | undefined; plannerRef?: string | undefined; reasonerRef?: string | undefined; metadata?: Record<string, unknown> | undefined; }>;

reasoningConfigSpecDefinition

Reasoning Config Spec 的运行时校验入口,组合 Parser、Example 与 JSON Schema。

  • 种类: 常量
  • 导入: import { reasoningConfigSpecDefinition } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export declare const reasoningConfigSpecDefinition: SpecSchemaDefinition<ReasoningConfig>;

reasoningPersistenceSchema

Reasoning Persistence 的运行时 Schema。

  • 种类: 常量
  • 导入: import { reasoningPersistenceSchema } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export declare const reasoningPersistenceSchema: z.ZodEnum<["summary_only", "events_only"]>;

thinkingModeSchema

Thinking Mode 的运行时 Schema。

  • 种类: 常量
  • 导入: import { thinkingModeSchema } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export declare const thinkingModeSchema: z.ZodEnum<["none", "summary", "structured"]>;

createEpisodicMemorySync

Create Episodic Memory Sync 函数,提供 1 个公开调用签名;参数与返回类型见下表。

  • 种类: 函数
  • 导入: import { createEpisodicMemorySync } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export declare function createEpisodicMemorySync(options: EpisodicMemorySyncOptions): NonNullable<ReActRunnerOptions['syncMemory']>;

调用签名

text
createEpisodicMemorySync(options: EpisodicMemorySyncOptions): NonNullable<ReActRunnerOptions["syncMemory"]>

参数

参数类型必需说明
optionsEpisodicMemorySyncOptions必需参数;接受的值由类型列定义。

返回值

  • 类型: (context: ReActRunContext, observation: ReActObservation) => Promise<void>
  • 说明: 返回值契约由上述类型定义。

createReActStep

Create ReAct Step 函数,提供 1 个公开调用签名;参数与返回类型见下表。

  • 种类: 函数
  • 导入: import { createReActStep } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export declare function createReActStep(id: string, phase: ReActPhase, input?: unknown): ReActStep;

调用签名

text
createReActStep(id: string, phase: ReActPhase, input?: unknown): ReActStep

参数

参数类型必需说明
idstring必需参数;接受的值由类型列定义。
phaseReActPhase必需参数;接受的值由类型列定义。
inputunknown可选参数;接受的值由类型列定义。

返回值

  • 类型: ReActStep
  • 说明: 返回值契约由上述类型定义。

reActContinuationScopeHash

Re Act Continuation Scope Hash 函数,提供 1 个公开调用签名;参数与返回类型见下表。

  • 种类: 函数
  • 导入: import { reActContinuationScopeHash } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export declare function reActContinuationScopeHash(context: ReActRunContext): string;

调用签名

text
reActContinuationScopeHash(context: ReActRunContext): string

参数

参数类型必需说明
contextReActRunContext必需参数;接受的值由类型列定义。

返回值

  • 类型: string
  • 说明: 返回值契约由上述类型定义。

validateReActAction

Validate ReAct Action 函数,提供 1 个公开调用签名;参数与返回类型见下表。

  • 种类: 函数
  • 导入: import { validateReActAction } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export declare function validateReActAction(input: unknown): ReActAction;

调用签名

text
validateReActAction(input: unknown): ReActAction

参数

参数类型必需说明
inputunknown必需参数;接受的值由类型列定义。

返回值

  • 类型: ReActAction
  • 说明: 返回值契约由上述类型定义。

validateReActAgentSpec

Validate ReAct Agent Spec 函数,提供 1 个公开调用签名;参数与返回类型见下表。

  • 种类: 函数
  • 导入: import { validateReActAgentSpec } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export declare function validateReActAgentSpec(input: unknown): ReActAgentSpec;

调用签名

text
validateReActAgentSpec(input: unknown): ReActAgentSpec

参数

参数类型必需说明
inputunknown必需参数;接受的值由类型列定义。

返回值

  • 类型: ReActAgentSpec
  • 说明: 返回值契约由上述类型定义。

validateReActContinuationCheckpoint

Validate ReAct Continuation Checkpoint 函数,提供 1 个公开调用签名;参数与返回类型见下表。

  • 种类: 函数
  • 导入: import { validateReActContinuationCheckpoint } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export declare function validateReActContinuationCheckpoint(input: unknown): ReActContinuationCheckpoint;

调用签名

text
validateReActContinuationCheckpoint(input: unknown): ReActContinuationCheckpoint

参数

参数类型必需说明
inputunknown必需参数;接受的值由类型列定义。

返回值

  • 类型: ReActContinuationCheckpoint
  • 说明: 返回值契约由上述类型定义。

validateReActExecutionBudget

Validate ReAct Execution Budget 函数,提供 1 个公开调用签名;参数与返回类型见下表。

  • 种类: 函数
  • 导入: import { validateReActExecutionBudget } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export declare function validateReActExecutionBudget(input: unknown): ReActExecutionBudget;

调用签名

text
validateReActExecutionBudget(input: unknown): ReActExecutionBudget

参数

参数类型必需说明
inputunknown必需参数;接受的值由类型列定义。

返回值

  • 类型: ReActExecutionBudget
  • 说明: 返回值契约由上述类型定义。

validateReasoningConfig

Validate Reasoning Config 函数,提供 1 个公开调用签名;参数与返回类型见下表。

  • 种类: 函数
  • 导入: import { validateReasoningConfig } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export declare function validateReasoningConfig(input: unknown): ReasoningConfig;

调用签名

text
validateReasoningConfig(input: unknown): ReasoningConfig

参数

参数类型必需说明
inputunknown必需参数;接受的值由类型列定义。

返回值

  • 类型: ReasoningConfig
  • 说明: 返回值契约由上述类型定义。

AgenticReasoner

Agentic Reasoner 接口,共包含 1 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { AgenticReasoner } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export interface AgenticReasoner {
    decide(input: AgenticReasonerInput): Promise<AgenticReasoningDecision>;
}

契约成员

成员种类签名说明
decide方法decide(input: AgenticReasonerInput): Promise<AgenticReasoningDecision>公开方法;参数与返回类型以签名列为准。

AgenticReasonerInput

Agentic Reasoner Input 接口,共包含 3 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { AgenticReasonerInput } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export interface AgenticReasonerInput {
    context: BuiltAgentContext;
    config: RequiredReasoningConfig;
    thinkingPlan?: ThinkingPlan;
}

契约成员

成员种类签名说明
config属性config: RequiredReasoningConfig公开属性;类型、只读和可选状态以签名列为准。
context属性context: BuiltAgentContext公开属性;类型、只读和可选状态以签名列为准。
thinkingPlan属性thinkingPlan?: ThinkingPlan公开属性;类型、只读和可选状态以签名列为准。

AgenticReasoningDecision

Agentic Reasoning Decision 接口,共包含 11 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { AgenticReasoningDecision } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export interface AgenticReasoningDecision {
    id: string;
    mode: AgenticReasoningMode;
    recommendedPhase: ReActPhase;
    actionType: 'reason' | ReActAction['type'];
    toolCandidates: string[];
    requiresHumanReview: boolean;
    verificationStrategy: string;
    rationale: string;
    confidence?: number;
    createdAt: string;
    metadata?: Record<string, unknown>;
}

契约成员

成员种类签名说明
actionType属性actionType: "human_review" | "tool" | "model" | "reason" | "finish"公开属性;类型、只读和可选状态以签名列为准。
confidence属性confidence?: number公开属性;类型、只读和可选状态以签名列为准。
createdAt属性createdAt: string公开属性;类型、只读和可选状态以签名列为准。
id属性id: string公开属性;类型、只读和可选状态以签名列为准。
metadata属性metadata?: Record<string, unknown>公开属性;类型、只读和可选状态以签名列为准。
mode属性mode: AgenticReasoningMode公开属性;类型、只读和可选状态以签名列为准。
rationale属性rationale: string公开属性;类型、只读和可选状态以签名列为准。
recommendedPhase属性recommendedPhase: ReActPhase公开属性;类型、只读和可选状态以签名列为准。
requiresHumanReview属性requiresHumanReview: boolean公开属性;类型、只读和可选状态以签名列为准。
toolCandidates属性toolCandidates: string[]公开属性;类型、只读和可选状态以签名列为准。
verificationStrategy属性verificationStrategy: string公开属性;类型、只读和可选状态以签名列为准。

BasicReActAgentRuntimeOptions

Basic ReAct Agent Runtime Options 接口,共包含 1 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { BasicReActAgentRuntimeOptions } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export interface BasicReActAgentRuntimeOptions {
    verifier?: Verifier;
}

契约成员

成员种类签名说明
verifier属性verifier?: Verifier公开属性;类型、只读和可选状态以签名列为准。

BuiltAgentContext

Built Agent Context 接口,共包含 18 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { BuiltAgentContext } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export interface BuiltAgentContext extends ReActRunContext {
    sourceInput?: unknown;
    contextBudget?: ContextBudget;
    contextProvenance?: ContextProvenance[];
    memoryContext?: MemoryContextItem[];
}

契约成员

成员种类签名说明
activeSkills属性activeSkills?: LoadedSkillContext[]公开属性;类型、只读和可选状态以签名列为准。
agent属性agent: ReActAgentSpec公开属性;类型、只读和可选状态以签名列为准。
contextBudget属性contextBudget?: ContextBudget公开属性;类型、只读和可选状态以签名列为准。
contextProvenance属性contextProvenance?: ContextProvenance[]公开属性;类型、只读和可选状态以签名列为准。
contextSpec属性contextSpec?: ContextSpec公开属性;类型、只读和可选状态以签名列为准。
memoryContext属性memoryContext?: MemoryContextItem[]公开属性;类型、只读和可选状态以签名列为准。
memoryScope属性memoryScope?: MemoryScope公开属性;类型、只读和可选状态以签名列为准。
messages属性messages: ModelMessage[]公开属性;类型、只读和可选状态以签名列为准。
metadata属性metadata?: Record<string, unknown>公开属性;类型、只读和可选状态以签名列为准。
reasoningConfig属性reasoningConfig?: ReasoningConfig公开属性;类型、只读和可选状态以签名列为准。
reasoningDecision属性reasoningDecision?: AgenticReasoningDecision公开属性;类型、只读和可选状态以签名列为准。
rejectedSkills属性rejectedSkills?: { skillId: string; reason: string; }[]公开属性;类型、只读和可选状态以签名列为准。
runId属性runId: string公开属性;类型、只读和可选状态以签名列为准。
sourceInput属性sourceInput?: unknown公开属性;类型、只读和可选状态以签名列为准。
stepId属性stepId: string公开属性;类型、只读和可选状态以签名列为准。
thinkingPlan属性thinkingPlan?: ThinkingPlan公开属性;类型、只读和可选状态以签名列为准。
toolExecutionScope属性toolExecutionScope?: ToolExecutionScope公开属性;类型、只读和可选状态以签名列为准。
toolPrincipal属性toolPrincipal?: ToolPrincipal公开属性;类型、只读和可选状态以签名列为准。

ContextBudget

Context Budget 接口,共包含 4 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { ContextBudget } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export interface ContextBudget {
    maxMessages?: number;
    maxMemoryItems?: number;
    maxMemoryChars?: number;
    maxTotalChars?: number;
}

契约成员

成员种类签名说明
maxMemoryChars属性maxMemoryChars?: number公开属性;类型、只读和可选状态以签名列为准。
maxMemoryItems属性maxMemoryItems?: number公开属性;类型、只读和可选状态以签名列为准。
maxMessages属性maxMessages?: number公开属性;类型、只读和可选状态以签名列为准。
maxTotalChars属性maxTotalChars?: number公开属性;类型、只读和可选状态以签名列为准。

ContextBuilder

Context Builder 接口,共包含 1 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { ContextBuilder } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export interface ContextBuilder {
    build(input: ContextBuildInput): Promise<BuiltAgentContext>;
}

契约成员

成员种类签名说明
build方法build(input: ContextBuildInput): Promise<BuiltAgentContext>公开方法;参数与返回类型以签名列为准。

ContextBuildInput

Context Build Input 接口,共包含 12 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { ContextBuildInput } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export interface ContextBuildInput<TInput = unknown> {
    runId: string;
    stepId: string;
    sessionId?: string;
    userId?: string;
    agent: ReActAgentSpec;
    input: TInput;
    messages?: ModelMessage[];
    memoryScope?: MemoryScope;
    contextSpec?: ContextSpec;
    metadata?: Record<string, unknown>;
    toolExecutionScope?: ToolExecutionScope;
    toolPrincipal?: ToolPrincipal;
}

契约成员

成员种类签名说明
agent属性agent: ReActAgentSpec公开属性;类型、只读和可选状态以签名列为准。
contextSpec属性contextSpec?: ContextSpec公开属性;类型、只读和可选状态以签名列为准。
input属性input: TInput公开属性;类型、只读和可选状态以签名列为准。
memoryScope属性memoryScope?: MemoryScope公开属性;类型、只读和可选状态以签名列为准。
messages属性messages?: ModelMessage[]公开属性;类型、只读和可选状态以签名列为准。
metadata属性metadata?: Record<string, unknown>公开属性;类型、只读和可选状态以签名列为准。
runId属性runId: string公开属性;类型、只读和可选状态以签名列为准。
sessionId属性sessionId?: string公开属性;类型、只读和可选状态以签名列为准。
stepId属性stepId: string公开属性;类型、只读和可选状态以签名列为准。
toolExecutionScope属性toolExecutionScope?: ToolExecutionScope公开属性;类型、只读和可选状态以签名列为准。
toolPrincipal属性toolPrincipal?: ToolPrincipal公开属性;类型、只读和可选状态以签名列为准。
userId属性userId?: string公开属性;类型、只读和可选状态以签名列为准。

ContextProvenance

Context Provenance 接口,共包含 6 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { ContextProvenance } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export interface ContextProvenance {
    source: 'memory' | 'input' | 'system' | 'skill';
    id: string;
    type?: string;
    score?: number;
    provenance?: Record<string, unknown>;
    includedAt: string;
}

契约成员

成员种类签名说明
id属性id: string公开属性;类型、只读和可选状态以签名列为准。
includedAt属性includedAt: string公开属性;类型、只读和可选状态以签名列为准。
provenance属性provenance?: Record<string, unknown>公开属性;类型、只读和可选状态以签名列为准。
score属性score?: number公开属性;类型、只读和可选状态以签名列为准。
source属性source: "memory" | "skill" | "system" | "input"公开属性;类型、只读和可选状态以签名列为准。
type属性type?: string公开属性;类型、只读和可选状态以签名列为准。

EpisodicMemorySyncOptions

Episodic Memory Sync Options 接口,共包含 7 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { EpisodicMemorySyncOptions } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export interface EpisodicMemorySyncOptions {
    memory: Pick<MemoryManager, 'write'>;
    now?: () => string;
    source?: string;
    idPrefix?: string;
    confidence?: number;
    visibility?: MemoryRecord['visibility'];
    allowLongTerm?: boolean;
}

契约成员

成员种类签名说明
allowLongTerm属性allowLongTerm?: boolean公开属性;类型、只读和可选状态以签名列为准。
confidence属性confidence?: number公开属性;类型、只读和可选状态以签名列为准。
idPrefix属性idPrefix?: string公开属性;类型、只读和可选状态以签名列为准。
memory属性memory: Pick<MemoryManager, "write">公开属性;类型、只读和可选状态以签名列为准。
now方法now?(): string公开方法;参数与返回类型以签名列为准。
source属性source?: string公开属性;类型、只读和可选状态以签名列为准。
visibility属性visibility?: "workspace" | "private" | "public"公开属性;类型、只读和可选状态以签名列为准。

InMemoryReActContinuationCheckpointStoreOptions

In Memory ReAct Continuation Checkpoint Store Options 接口,共包含 3 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { InMemoryReActContinuationCheckpointStoreOptions } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export interface InMemoryReActContinuationCheckpointStoreOptions {
    maxCheckpoints?: number;
    maxIdempotencyRecords?: number;
    maxCheckpointBytes?: number;
}

契约成员

成员种类签名说明
maxCheckpointBytes属性maxCheckpointBytes?: number公开属性;类型、只读和可选状态以签名列为准。
maxCheckpoints属性maxCheckpoints?: number公开属性;类型、只读和可选状态以签名列为准。
maxIdempotencyRecords属性maxIdempotencyRecords?: number公开属性;类型、只读和可选状态以签名列为准。

MemoryContextBuilderOptions

Memory Context Builder Options 接口,共包含 7 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { MemoryContextBuilderOptions } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export interface MemoryContextBuilderOptions {
    memory: Pick<MemoryManager, 'search'>;
    embeddings?: EmbeddingProvider;
    baseBuilder?: ContextBuilder;
    budget?: ContextBudget;
    memoryTypes?: MemoryType[];
    now?: () => string;
    query?: MemorySearchQuery | ((input: ContextBuildInput, base: BuiltAgentContext) => MemorySearchQuery | Promise<MemorySearchQuery>);
}

契约成员

成员种类签名说明
baseBuilder属性baseBuilder?: ContextBuilder公开属性;类型、只读和可选状态以签名列为准。
budget属性budget?: ContextBudget公开属性;类型、只读和可选状态以签名列为准。
embeddings属性embeddings?: EmbeddingProvider公开属性;类型、只读和可选状态以签名列为准。
memory属性memory: Pick<MemoryManager, "search">公开属性;类型、只读和可选状态以签名列为准。
memoryTypes属性memoryTypes?: MemoryType[]公开属性;类型、只读和可选状态以签名列为准。
now方法now?(): string公开方法;参数与返回类型以签名列为准。
query属性query?: MemorySearchQuery | ((input: ContextBuildInput, base: BuiltAgentContext) => MemorySearchQuery | Promise<MemorySearchQuery>)公开属性;类型、只读和可选状态以签名列为准。

MemoryContextItem

Memory Context Item 接口,共包含 5 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { MemoryContextItem } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export interface MemoryContextItem {
    id: string;
    type: MemoryType;
    content: string;
    score?: number;
    provenance: Record<string, unknown>;
}

契约成员

成员种类签名说明
content属性content: string公开属性;类型、只读和可选状态以签名列为准。
id属性id: string公开属性;类型、只读和可选状态以签名列为准。
provenance属性provenance: Record<string, unknown>公开属性;类型、只读和可选状态以签名列为准。
score属性score?: number公开属性;类型、只读和可选状态以签名列为准。
type属性type: MemoryType公开属性;类型、只读和可选状态以签名列为准。

ReActAction

ReAct Action 接口,共包含 5 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { ReActAction } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export interface ReActAction {
    type: 'tool' | 'model' | 'finish' | 'human_review';
    toolCallId?: string;
    target?: string;
    input?: unknown;
    reason?: string;
}

契约成员

成员种类签名说明
input属性input?: unknown公开属性;类型、只读和可选状态以签名列为准。
reason属性reason?: string公开属性;类型、只读和可选状态以签名列为准。
target属性target?: string公开属性;类型、只读和可选状态以签名列为准。
toolCallId属性toolCallId?: string公开属性;类型、只读和可选状态以签名列为准。
type属性type: "human_review" | "tool" | "model" | "finish"公开属性;类型、只读和可选状态以签名列为准。

ReActAgentRunnerOptions

ReAct Agent Runner Options 接口,共包含 25 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { ReActAgentRunnerOptions } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export interface ReActAgentRunnerOptions extends Omit<ReActRunnerOptions, 'toolRunner'> {
    toolRunner?: ToolRunner;
    contextBuilder?: ContextBuilder;
    verifier?: Verifier;
    runtime?: ReActAgentRuntime;
    thinkingPlanner?: ThinkingPlanner;
    agenticReasoner?: AgenticReasoner;
    reasoningConfig?: ReasoningConfig;
    skillRegistry?: SkillRegistry;
    skillSelector?: SkillSelector;
    skillContextLoader?: SkillContextLoader;
    skillPolicy?: SkillPolicy;
    allowedSkills?: SkillContextBuilderOptions['allowedSkills'];
    requiredSkills?: SkillContextBuilderOptions['requiredSkills'];
}

契约成员

成员种类签名说明
agenticReasoner属性agenticReasoner?: AgenticReasoner公开属性;类型、只读和可选状态以签名列为准。
allowedSkills属性allowedSkills?: string[] | ((input: ContextBuildInput, base: BuiltAgentContext) => string[] | undefined | Promise<string[] | undefined>)公开属性;类型、只读和可选状态以签名列为准。
checkpointStore属性checkpointStore?: ReActContinuationCheckpointStore公开属性;类型、只读和可选状态以签名列为准。
contextBuilder属性contextBuilder?: ContextBuilder公开属性;类型、只读和可选状态以签名列为准。
continueAfterTool属性continueAfterTool?: boolean公开属性;类型、只读和可选状态以签名列为准。
executionBudget属性executionBudget?: Partial<ReActExecutionBudget>公开属性;类型、只读和可选状态以签名列为准。
inference属性inference: InferenceProvider公开属性;类型、只读和可选状态以签名列为准。
maxIterations属性maxIterations?: number公开属性;类型、只读和可选状态以签名列为准。
now方法now?(): string公开方法;参数与返回类型以签名列为准。
onCheckpoint方法onCheckpoint?(checkpoint: ReActContinuationCheckpoint): Promise<void> | void公开方法;参数与返回类型以签名列为准。
onResume方法onResume?(checkpoint: ReActContinuationCheckpoint): Promise<void> | void公开方法;参数与返回类型以签名列为准。
onStep方法onStep?(step: ReActStep): Promise<void> | void公开方法;参数与返回类型以签名列为准。
reasoningConfig属性reasoningConfig?: ReasoningConfig公开属性;类型、只读和可选状态以签名列为准。
requiredSkills属性requiredSkills?: string[] | ((input: ContextBuildInput, base: BuiltAgentContext) => string[] | undefined | Promise<string[] | undefined>)公开属性;类型、只读和可选状态以签名列为准。
resolveToolExecutionScope方法resolveToolExecutionScope?(context: ReActRunContext, action: ReActAction): ToolExecutionScope | undefined公开方法;参数与返回类型以签名列为准。
retainCheckpointUntilOutcome属性retainCheckpointUntilOutcome?: booleanKeep the latest durable checkpoint until an outer transaction records the terminal/waiting outcome. Production quantum executors use this to avoid an unrecoverable gap between Runner completion and Event persistence.
runtime属性runtime?: ReActAgentRuntime公开属性;类型、只读和可选状态以签名列为准。
skillContextLoader属性skillContextLoader?: SkillContextLoader公开属性;类型、只读和可选状态以签名列为准。
skillPolicy属性skillPolicy?: SkillPolicy公开属性;类型、只读和可选状态以签名列为准。
skillRegistry属性skillRegistry?: SkillRegistry公开属性;类型、只读和可选状态以签名列为准。
skillSelector属性skillSelector?: SkillSelector公开属性;类型、只读和可选状态以签名列为准。
syncMemory方法syncMemory?(context: ReActRunContext, observation: ReActObservation): Promise<void>公开方法;参数与返回类型以签名列为准。
thinkingPlanner属性thinkingPlanner?: ThinkingPlanner公开属性;类型、只读和可选状态以签名列为准。
toolRunner属性toolRunner?: ToolRunner公开属性;类型、只读和可选状态以签名列为准。
verifier属性verifier?: Verifier公开属性;类型、只读和可选状态以签名列为准。

ReActAgentRuntime

ReAct Agent Runtime 接口,共包含 3 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { ReActAgentRuntime } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export interface ReActAgentRuntime {
    reason(context: ReActRunContext): Promise<InferenceRequest>;
    selectAction(response: InferenceResponse): Promise<ReActAction>;
    verify(context: ReActRunContext, observation: ReActObservation): Promise<ReActAction>;
}

契约成员

成员种类签名说明
reason方法reason(context: ReActRunContext): Promise<InferenceRequest>公开方法;参数与返回类型以签名列为准。
selectAction方法selectAction(response: InferenceResponse): Promise<ReActAction>公开方法;参数与返回类型以签名列为准。
verify方法verify(context: ReActRunContext, observation: ReActObservation): Promise<ReActAction>公开方法;参数与返回类型以签名列为准。

ReActAgentSpec

ReAct Agent Spec 接口,共包含 17 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { ReActAgentSpec } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export interface ReActAgentSpec extends VersionedSpec, SpecMetadata {
    name: string;
    modelAlias: string;
    systemInstructions?: string;
    promptRefs?: AgentPromptRef[];
    skillRefs?: SkillRef[];
    toolRefs?: string[];
    memoryProfileRef?: string;
    policyRefs?: string[];
    contextSpecRef?: SpecRef;
    reasoning?: ReasoningConfig;
}

契约成员

成员种类签名说明
contextSpecRef属性contextSpecRef?: SpecRef公开属性;类型、只读和可选状态以签名列为准。
createdAt属性createdAt?: string公开属性;类型、只读和可选状态以签名列为准。
description属性description?: string公开属性;类型、只读和可选状态以签名列为准。
id属性id: string公开属性;类型、只读和可选状态以签名列为准。
memoryProfileRef属性memoryProfileRef?: string公开属性;类型、只读和可选状态以签名列为准。
modelAlias属性modelAlias: string公开属性;类型、只读和可选状态以签名列为准。
name属性name: string公开属性;类型、只读和可选状态以签名列为准。
owner属性owner?: string公开属性;类型、只读和可选状态以签名列为准。
policyRefs属性policyRefs?: string[]公开属性;类型、只读和可选状态以签名列为准。
promptRefs属性promptRefs?: AgentPromptRef[]公开属性;类型、只读和可选状态以签名列为准。
reasoning属性reasoning?: ReasoningConfig公开属性;类型、只读和可选状态以签名列为准。
skillRefs属性skillRefs?: SkillRef[]公开属性;类型、只读和可选状态以签名列为准。
systemInstructions属性systemInstructions?: string公开属性;类型、只读和可选状态以签名列为准。
tags属性tags?: string[]公开属性;类型、只读和可选状态以签名列为准。
toolRefs属性toolRefs?: string[]公开属性;类型、只读和可选状态以签名列为准。
updatedAt属性updatedAt?: string公开属性;类型、只读和可选状态以签名列为准。
version属性version: string公开属性;类型、只读和可选状态以签名列为准。

ReActContinuationCheckpoint

ReAct Continuation Checkpoint 接口,共包含 19 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { ReActContinuationCheckpoint } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export interface ReActContinuationCheckpoint {
    version: '1.0.0';
    runId: string;
    stepId: string;
    scopeHash: string;
    agentRef: SpecRef;
    nextPhase: 'reason' | 'act';
    messages: ModelMessage[];
    iterations: number;
    modelCalls: number;
    toolCalls: number;
    totalTokens: number;
    toolInvocationSequence: number;
    stepSequence: number;
    consecutiveNoProgress: number;
    lastProgressFingerprint?: string;
    pendingAction?: ReActAction;
    pendingToolInvocationId?: string;
    createdAt: string;
    updatedAt: string;
}

契约成员

成员种类签名说明
agentRef属性agentRef: SpecRef公开属性;类型、只读和可选状态以签名列为准。
consecutiveNoProgress属性consecutiveNoProgress: number公开属性;类型、只读和可选状态以签名列为准。
createdAt属性createdAt: string公开属性;类型、只读和可选状态以签名列为准。
iterations属性iterations: number公开属性;类型、只读和可选状态以签名列为准。
lastProgressFingerprint属性lastProgressFingerprint?: string公开属性;类型、只读和可选状态以签名列为准。
messages属性messages: ModelMessage[]公开属性;类型、只读和可选状态以签名列为准。
modelCalls属性modelCalls: number公开属性;类型、只读和可选状态以签名列为准。
nextPhase属性nextPhase: "reason" | "act"公开属性;类型、只读和可选状态以签名列为准。
pendingAction属性pendingAction?: ReActAction公开属性;类型、只读和可选状态以签名列为准。
pendingToolInvocationId属性pendingToolInvocationId?: string公开属性;类型、只读和可选状态以签名列为准。
runId属性runId: string公开属性;类型、只读和可选状态以签名列为准。
scopeHash属性scopeHash: string公开属性;类型、只读和可选状态以签名列为准。
stepId属性stepId: string公开属性;类型、只读和可选状态以签名列为准。
stepSequence属性stepSequence: number公开属性;类型、只读和可选状态以签名列为准。
toolCalls属性toolCalls: number公开属性;类型、只读和可选状态以签名列为准。
toolInvocationSequence属性toolInvocationSequence: number公开属性;类型、只读和可选状态以签名列为准。
totalTokens属性totalTokens: number公开属性;类型、只读和可选状态以签名列为准。
updatedAt属性updatedAt: string公开属性;类型、只读和可选状态以签名列为准。
version属性version: "1.0.0"公开属性;类型、只读和可选状态以签名列为准。

ReActContinuationCheckpointPutResult

ReAct Continuation Checkpoint Put Result 接口,共包含 2 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { ReActContinuationCheckpointPutResult } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export interface ReActContinuationCheckpointPutResult {
    checkpoint: ReActContinuationCheckpoint;
    reused: boolean;
}

契约成员

成员种类签名说明
checkpoint属性checkpoint: ReActContinuationCheckpoint公开属性;类型、只读和可选状态以签名列为准。
reused属性reused: boolean公开属性;类型、只读和可选状态以签名列为准。

ReActContinuationCheckpointStore

ReAct Continuation Checkpoint Store 接口,共包含 3 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { ReActContinuationCheckpointStore } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export interface ReActContinuationCheckpointStore {
    put(checkpoint: ReActContinuationCheckpoint, idempotencyKey: string): Promise<ReActContinuationCheckpointPutResult>;
    get(runId: string, stepId: string, expectedScopeHash: string): Promise<ReActContinuationCheckpoint | null>;
    delete(runId: string, stepId: string, expectedScopeHash: string, expectedStepSequence?: number): Promise<boolean>;
}

契约成员

成员种类签名说明
delete方法delete(runId: string, stepId: string, expectedScopeHash: string, expectedStepSequence?: number): Promise<boolean>公开方法;参数与返回类型以签名列为准。
get方法get(runId: string, stepId: string, expectedScopeHash: string): Promise<ReActContinuationCheckpoint | null>公开方法;参数与返回类型以签名列为准。
put方法put(checkpoint: ReActContinuationCheckpoint, idempotencyKey: string): Promise<ReActContinuationCheckpointPutResult>公开方法;参数与返回类型以签名列为准。

ReActExecutionBudget

Global limits survive process restarts through ReActContinuationCheckpoint. quantumIterations only bounds one worker turn; it is not a new total budget.

  • 种类: 接口
  • 导入: import type { ReActExecutionBudget } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export interface ReActExecutionBudget {
    maxIterations: number;
    maxModelCalls: number;
    maxToolCalls: number;
    maxTotalTokens?: number;
    maxConsecutiveNoProgress: number;
    quantumIterations: number;
    deadlineAt?: string;
}

契约成员

成员种类签名说明
deadlineAt属性deadlineAt?: string公开属性;类型、只读和可选状态以签名列为准。
maxConsecutiveNoProgress属性maxConsecutiveNoProgress: number公开属性;类型、只读和可选状态以签名列为准。
maxIterations属性maxIterations: number公开属性;类型、只读和可选状态以签名列为准。
maxModelCalls属性maxModelCalls: number公开属性;类型、只读和可选状态以签名列为准。
maxToolCalls属性maxToolCalls: number公开属性;类型、只读和可选状态以签名列为准。
maxTotalTokens属性maxTotalTokens?: number公开属性;类型、只读和可选状态以签名列为准。
quantumIterations属性quantumIterations: number公开属性;类型、只读和可选状态以签名列为准。

ReActObservation

ReAct Observation 接口,共包含 3 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { ReActObservation } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export interface ReActObservation<TValue = unknown> {
    source: 'model' | 'tool' | 'memory' | 'human' | 'system';
    value: TValue;
    provenance?: Record<string, unknown>;
}

契约成员

成员种类签名说明
provenance属性provenance?: Record<string, unknown>公开属性;类型、只读和可选状态以签名列为准。
source属性source: "memory" | "system" | "human" | "tool" | "model"公开属性;类型、只读和可选状态以签名列为准。
value属性value: TValue公开属性;类型、只读和可选状态以签名列为准。

ReActRunContext

ReAct Run Context 接口,共包含 14 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { ReActRunContext } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export interface ReActRunContext {
    runId: string;
    stepId: string;
    agent: ReActAgentSpec;
    messages: ModelMessage[];
    memoryScope?: MemoryScope;
    contextSpec?: ContextSpec;
    metadata?: Record<string, unknown>;
    reasoningConfig?: ReasoningConfig;
    thinkingPlan?: ThinkingPlan;
    reasoningDecision?: AgenticReasoningDecision;
    activeSkills?: LoadedSkillContext[];
    rejectedSkills?: Array<{
        skillId: string;
        reason: string;
    }>;
    toolExecutionScope?: ToolExecutionScope;
    toolPrincipal?: ToolPrincipal;
}

契约成员

成员种类签名说明
activeSkills属性activeSkills?: LoadedSkillContext[]公开属性;类型、只读和可选状态以签名列为准。
agent属性agent: ReActAgentSpec公开属性;类型、只读和可选状态以签名列为准。
contextSpec属性contextSpec?: ContextSpec公开属性;类型、只读和可选状态以签名列为准。
memoryScope属性memoryScope?: MemoryScope公开属性;类型、只读和可选状态以签名列为准。
messages属性messages: ModelMessage[]公开属性;类型、只读和可选状态以签名列为准。
metadata属性metadata?: Record<string, unknown>公开属性;类型、只读和可选状态以签名列为准。
reasoningConfig属性reasoningConfig?: ReasoningConfig公开属性;类型、只读和可选状态以签名列为准。
reasoningDecision属性reasoningDecision?: AgenticReasoningDecision公开属性;类型、只读和可选状态以签名列为准。
rejectedSkills属性rejectedSkills?: { skillId: string; reason: string; }[]公开属性;类型、只读和可选状态以签名列为准。
runId属性runId: string公开属性;类型、只读和可选状态以签名列为准。
stepId属性stepId: string公开属性;类型、只读和可选状态以签名列为准。
thinkingPlan属性thinkingPlan?: ThinkingPlan公开属性;类型、只读和可选状态以签名列为准。
toolExecutionScope属性toolExecutionScope?: ToolExecutionScope公开属性;类型、只读和可选状态以签名列为准。
toolPrincipal属性toolPrincipal?: ToolPrincipal公开属性;类型、只读和可选状态以签名列为准。

ReActRunControl

ReAct Run Control 接口,共包含 4 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { ReActRunControl } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export interface ReActRunControl {
    checkpoint?: ReActContinuationCheckpoint;
    executionBudget?: Partial<ReActExecutionBudget>;
    abortSignal?: AbortSignal;
    resumeFromCheckpointStore?: boolean;
}

契约成员

成员种类签名说明
abortSignal属性abortSignal?: AbortSignal公开属性;类型、只读和可选状态以签名列为准。
checkpoint属性checkpoint?: ReActContinuationCheckpoint公开属性;类型、只读和可选状态以签名列为准。
executionBudget属性executionBudget?: Partial<ReActExecutionBudget>公开属性;类型、只读和可选状态以签名列为准。
resumeFromCheckpointStore属性resumeFromCheckpointStore?: boolean公开属性;类型、只读和可选状态以签名列为准。

ReActRunnerOptions

ReAct Runner Options 接口,共包含 13 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { ReActRunnerOptions } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export interface ReActRunnerOptions {
    inference: InferenceProvider;
    toolRunner?: ToolRunner;
    maxIterations?: number;
    executionBudget?: Partial<ReActExecutionBudget>;
    checkpointStore?: ReActContinuationCheckpointStore;
    continueAfterTool?: boolean;
    onStep?: (step: ReActStep) => Promise<void> | void;
    onCheckpoint?: (checkpoint: ReActContinuationCheckpoint) => Promise<void> | void;
    onResume?: (checkpoint: ReActContinuationCheckpoint) => Promise<void> | void;
    syncMemory?: (context: ReActRunContext, observation: ReActObservation) => Promise<void>;
    /**
     * Keep the latest durable checkpoint until an outer transaction records the
     * terminal/waiting outcome. Production quantum executors use this to avoid
     * an unrecoverable gap between Runner completion and Event persistence.
     */
    retainCheckpointUntilOutcome?: boolean;
    resolveToolExecutionScope?: (context: ReActRunContext, action: ReActAction) => ToolExecutionScope | undefined;
    now?: () => string;
}

契约成员

成员种类签名说明
checkpointStore属性checkpointStore?: ReActContinuationCheckpointStore公开属性;类型、只读和可选状态以签名列为准。
continueAfterTool属性continueAfterTool?: boolean公开属性;类型、只读和可选状态以签名列为准。
executionBudget属性executionBudget?: Partial<ReActExecutionBudget>公开属性;类型、只读和可选状态以签名列为准。
inference属性inference: InferenceProvider公开属性;类型、只读和可选状态以签名列为准。
maxIterations属性maxIterations?: number公开属性;类型、只读和可选状态以签名列为准。
now方法now?(): string公开方法;参数与返回类型以签名列为准。
onCheckpoint方法onCheckpoint?(checkpoint: ReActContinuationCheckpoint): Promise<void> | void公开方法;参数与返回类型以签名列为准。
onResume方法onResume?(checkpoint: ReActContinuationCheckpoint): Promise<void> | void公开方法;参数与返回类型以签名列为准。
onStep方法onStep?(step: ReActStep): Promise<void> | void公开方法;参数与返回类型以签名列为准。
resolveToolExecutionScope方法resolveToolExecutionScope?(context: ReActRunContext, action: ReActAction): ToolExecutionScope | undefined公开方法;参数与返回类型以签名列为准。
retainCheckpointUntilOutcome属性retainCheckpointUntilOutcome?: booleanKeep the latest durable checkpoint until an outer transaction records the terminal/waiting outcome. Production quantum executors use this to avoid an unrecoverable gap between Runner completion and Event persistence.
syncMemory方法syncMemory?(context: ReActRunContext, observation: ReActObservation): Promise<void>公开方法;参数与返回类型以签名列为准。
toolRunner属性toolRunner?: ToolRunner公开属性;类型、只读和可选状态以签名列为准。

ReActRunResult

ReAct Run Result 接口,共包含 8 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { ReActRunResult } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export interface ReActRunResult {
    runId: string;
    status: 'completed' | 'failed' | 'human_review_required' | 'suspended' | 'cancelled';
    steps: ReActStep[];
    output?: unknown;
    finalAction?: ReActAction;
    checkpoint?: ReActContinuationCheckpoint;
    suspension?: ReActSuspension;
    error?: unknown;
}

契约成员

成员种类签名说明
checkpoint属性checkpoint?: ReActContinuationCheckpoint公开属性;类型、只读和可选状态以签名列为准。
error属性error?: unknown公开属性;类型、只读和可选状态以签名列为准。
finalAction属性finalAction?: ReActAction公开属性;类型、只读和可选状态以签名列为准。
output属性output?: unknown公开属性;类型、只读和可选状态以签名列为准。
runId属性runId: string公开属性;类型、只读和可选状态以签名列为准。
status属性status: "completed" | "cancelled" | "failed" | "suspended" | "human_review_required"公开属性;类型、只读和可选状态以签名列为准。
steps属性steps: ReActStep[]公开属性;类型、只读和可选状态以签名列为准。
suspension属性suspension?: ReActSuspension公开属性;类型、只读和可选状态以签名列为准。

ReActStep

ReAct Step 接口,共包含 5 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { ReActStep } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export interface ReActStep {
    id: string;
    phase: ReActPhase;
    input?: unknown;
    output?: unknown;
    traceEventId?: string;
}

契约成员

成员种类签名说明
id属性id: string公开属性;类型、只读和可选状态以签名列为准。
input属性input?: unknown公开属性;类型、只读和可选状态以签名列为准。
output属性output?: unknown公开属性;类型、只读和可选状态以签名列为准。
phase属性phase: ReActPhase公开属性;类型、只读和可选状态以签名列为准。
traceEventId属性traceEventId?: string公开属性;类型、只读和可选状态以签名列为准。

ReActSuspension

ReAct Suspension 接口,共包含 4 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { ReActSuspension } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export interface ReActSuspension {
    reason: ReActSuspensionReason;
    retryable: boolean;
    requiresHumanReview: boolean;
    message: string;
}

契约成员

成员种类签名说明
message属性message: string公开属性;类型、只读和可选状态以签名列为准。
reason属性reason: "quantum_exhausted" | "iteration_budget_exhausted" | "model_call_budget_exhausted" | "tool_call_budget_exhausted" | "token_budget_exhausted" | "non_progress" | "deadline_exceeded"公开属性;类型、只读和可选状态以签名列为准。
requiresHumanReview属性requiresHumanReview: boolean公开属性;类型、只读和可选状态以签名列为准。
retryable属性retryable: boolean公开属性;类型、只读和可选状态以签名列为准。

ReasoningConfig

Reasoning Config 接口,共包含 7 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { ReasoningConfig } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export interface ReasoningConfig {
    thinkingMode?: ThinkingMode;
    agenticMode?: AgenticReasoningMode;
    maxSteps?: number;
    persist?: ReasoningPersistence;
    plannerRef?: string;
    reasonerRef?: string;
    metadata?: Record<string, unknown>;
}

契约成员

成员种类签名说明
agenticMode属性agenticMode?: AgenticReasoningMode公开属性;类型、只读和可选状态以签名列为准。
maxSteps属性maxSteps?: number公开属性;类型、只读和可选状态以签名列为准。
metadata属性metadata?: Record<string, unknown>公开属性;类型、只读和可选状态以签名列为准。
persist属性persist?: ReasoningPersistence公开属性;类型、只读和可选状态以签名列为准。
plannerRef属性plannerRef?: string公开属性;类型、只读和可选状态以签名列为准。
reasonerRef属性reasonerRef?: string公开属性;类型、只读和可选状态以签名列为准。
thinkingMode属性thinkingMode?: ThinkingMode公开属性;类型、只读和可选状态以签名列为准。

ReasoningContextBuilderOptions

Reasoning Context Builder Options 接口,共包含 5 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { ReasoningContextBuilderOptions } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export interface ReasoningContextBuilderOptions {
    baseBuilder?: ContextBuilder;
    planner?: ThinkingPlanner;
    reasoner?: AgenticReasoner;
    config?: ReasoningConfig;
    now?: () => string;
}

契约成员

成员种类签名说明
baseBuilder属性baseBuilder?: ContextBuilder公开属性;类型、只读和可选状态以签名列为准。
config属性config?: ReasoningConfig公开属性;类型、只读和可选状态以签名列为准。
now方法now?(): string公开方法;参数与返回类型以签名列为准。
planner属性planner?: ThinkingPlanner公开属性;类型、只读和可选状态以签名列为准。
reasoner属性reasoner?: AgenticReasoner公开属性;类型、只读和可选状态以签名列为准。

RequiredReasoningConfig

Required Reasoning Config 接口,共包含 7 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { RequiredReasoningConfig } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export interface RequiredReasoningConfig extends Required<Omit<ReasoningConfig, 'plannerRef' | 'reasonerRef' | 'metadata'>> {
    plannerRef?: string;
    reasonerRef?: string;
    metadata?: Record<string, unknown>;
}

契约成员

成员种类签名说明
agenticMode属性agenticMode?: AgenticReasoningMode公开属性;类型、只读和可选状态以签名列为准。
maxSteps属性maxSteps?: number公开属性;类型、只读和可选状态以签名列为准。
metadata属性metadata?: Record<string, unknown>公开属性;类型、只读和可选状态以签名列为准。
persist属性persist?: ReasoningPersistence公开属性;类型、只读和可选状态以签名列为准。
plannerRef属性plannerRef?: string公开属性;类型、只读和可选状态以签名列为准。
reasonerRef属性reasonerRef?: string公开属性;类型、只读和可选状态以签名列为准。
thinkingMode属性thinkingMode?: ThinkingMode公开属性;类型、只读和可选状态以签名列为准。

SkillContextBuilderOptions

Skill Context Builder Options 接口,共包含 9 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { SkillContextBuilderOptions } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export interface SkillContextBuilderOptions {
    registry: SkillRegistry;
    baseBuilder?: ContextBuilder;
    selector?: SkillSelector;
    contextLoader?: SkillContextLoader;
    policy?: SkillPolicy;
    allowedSkills?: string[] | ((input: ContextBuildInput, base: BuiltAgentContext) => string[] | undefined | Promise<string[] | undefined>);
    requiredSkills?: string[] | ((input: ContextBuildInput, base: BuiltAgentContext) => string[] | undefined | Promise<string[] | undefined>);
    availableToolRefs?: string[] | ((input: ContextBuildInput, base: BuiltAgentContext) => string[] | Promise<string[]>);
    now?: () => string;
}

契约成员

成员种类签名说明
allowedSkills属性allowedSkills?: string[] | ((input: ContextBuildInput, base: BuiltAgentContext) => string[] | undefined | Promise<string[] | undefined>)公开属性;类型、只读和可选状态以签名列为准。
availableToolRefs属性availableToolRefs?: string[] | ((input: ContextBuildInput, base: BuiltAgentContext) => string[] | Promise<string[]>)公开属性;类型、只读和可选状态以签名列为准。
baseBuilder属性baseBuilder?: ContextBuilder公开属性;类型、只读和可选状态以签名列为准。
contextLoader属性contextLoader?: SkillContextLoader公开属性;类型、只读和可选状态以签名列为准。
now方法now?(): string公开方法;参数与返回类型以签名列为准。
policy属性policy?: SkillPolicy公开属性;类型、只读和可选状态以签名列为准。
registry属性registry: SkillRegistry公开属性;类型、只读和可选状态以签名列为准。
requiredSkills属性requiredSkills?: string[] | ((input: ContextBuildInput, base: BuiltAgentContext) => string[] | undefined | Promise<string[] | undefined>)公开属性;类型、只读和可选状态以签名列为准。
selector属性selector?: SkillSelector公开属性;类型、只读和可选状态以签名列为准。

ThinkingPlan

Thinking Plan 接口,共包含 10 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { ThinkingPlan } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export interface ThinkingPlan {
    id: string;
    mode: Exclude<ThinkingMode, 'none'>;
    intent: string;
    constraints: string[];
    successCriteria: string[];
    plan: string[];
    risks: string[];
    summary: string;
    createdAt: string;
    metadata?: Record<string, unknown>;
}

契约成员

成员种类签名说明
constraints属性constraints: string[]公开属性;类型、只读和可选状态以签名列为准。
createdAt属性createdAt: string公开属性;类型、只读和可选状态以签名列为准。
id属性id: string公开属性;类型、只读和可选状态以签名列为准。
intent属性intent: string公开属性;类型、只读和可选状态以签名列为准。
metadata属性metadata?: Record<string, unknown>公开属性;类型、只读和可选状态以签名列为准。
mode属性mode: "structured" | "summary"公开属性;类型、只读和可选状态以签名列为准。
plan属性plan: string[]公开属性;类型、只读和可选状态以签名列为准。
risks属性risks: string[]公开属性;类型、只读和可选状态以签名列为准。
successCriteria属性successCriteria: string[]公开属性;类型、只读和可选状态以签名列为准。
summary属性summary: string公开属性;类型、只读和可选状态以签名列为准。

ThinkingPlanner

Thinking Planner 接口,共包含 1 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { ThinkingPlanner } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export interface ThinkingPlanner {
    plan(input: ThinkingPlannerInput): Promise<ThinkingPlan>;
}

契约成员

成员种类签名说明
plan方法plan(input: ThinkingPlannerInput): Promise<ThinkingPlan>公开方法;参数与返回类型以签名列为准。

ThinkingPlannerInput

Thinking Planner Input 接口,共包含 2 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { ThinkingPlannerInput } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export interface ThinkingPlannerInput {
    context: BuiltAgentContext;
    config: RequiredReasoningConfig;
}

契约成员

成员种类签名说明
config属性config: RequiredReasoningConfig公开属性;类型、只读和可选状态以签名列为准。
context属性context: BuiltAgentContext公开属性;类型、只读和可选状态以签名列为准。

ToolActivityPort

Tool Activity Port 接口,共包含 2 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { ToolActivityPort } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export interface ToolActivityPort {
    execute(request: ToolActivityRequest): Promise<ToolActivityResult>;
    cancel(invocationId: string, reason?: string): Promise<ToolActivityResult | null>;
}

契约成员

成员种类签名说明
cancel方法cancel(invocationId: string, reason?: string): Promise<ToolActivityResult | null>公开方法;参数与返回类型以签名列为准。
execute方法execute(request: ToolActivityRequest): Promise<ToolActivityResult>公开方法;参数与返回类型以签名列为准。

ToolActivityRequest

Tool Activity Request 接口,共包含 10 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { ToolActivityRequest } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export interface ToolActivityRequest {
    operationId: string;
    invocationId: string;
    runId: string;
    stateAttemptId: string;
    toolRef: SpecRef;
    input: unknown;
    principal: ToolPrincipal;
    deadlineAt?: string;
    idempotencyKey?: string;
    contractSnapshotRef?: string;
}

契约成员

成员种类签名说明
contractSnapshotRef属性contractSnapshotRef?: string公开属性;类型、只读和可选状态以签名列为准。
deadlineAt属性deadlineAt?: string公开属性;类型、只读和可选状态以签名列为准。
idempotencyKey属性idempotencyKey?: string公开属性;类型、只读和可选状态以签名列为准。
input属性input: unknown公开属性;类型、只读和可选状态以签名列为准。
invocationId属性invocationId: string公开属性;类型、只读和可选状态以签名列为准。
operationId属性operationId: string公开属性;类型、只读和可选状态以签名列为准。
principal属性principal: ToolPrincipal公开属性;类型、只读和可选状态以签名列为准。
runId属性runId: string公开属性;类型、只读和可选状态以签名列为准。
stateAttemptId属性stateAttemptId: string公开属性;类型、只读和可选状态以签名列为准。
toolRef属性toolRef: SpecRef公开属性;类型、只读和可选状态以签名列为准。

ToolActivityResult

Tool Activity Result 接口,共包含 7 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { ToolActivityResult } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export interface ToolActivityResult {
    invocationId: string;
    status: 'completed' | 'failed' | 'denied' | 'waiting_approval' | 'cancelled' | 'conflict';
    output?: unknown;
    artifactRefs?: string[];
    approvalRequestRef?: string;
    eventIds: string[];
    error?: NormalizedToolError;
}

契约成员

成员种类签名说明
approvalRequestRef属性approvalRequestRef?: string公开属性;类型、只读和可选状态以签名列为准。
artifactRefs属性artifactRefs?: string[]公开属性;类型、只读和可选状态以签名列为准。
error属性error?: NormalizedToolError公开属性;类型、只读和可选状态以签名列为准。
eventIds属性eventIds: string[]公开属性;类型、只读和可选状态以签名列为准。
invocationId属性invocationId: string公开属性;类型、只读和可选状态以签名列为准。
output属性output?: unknown公开属性;类型、只读和可选状态以签名列为准。
status属性status: "completed" | "cancelled" | "failed" | "denied" | "conflict" | "waiting_approval"公开属性;类型、只读和可选状态以签名列为准。

Verifier

Verifier 接口,共包含 1 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { Verifier } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export interface Verifier {
    verify(context: ReActRunContext, observation: ReActObservation): Promise<ReActAction>;
}

契约成员

成员种类签名说明
verify方法verify(context: ReActRunContext, observation: ReActObservation): Promise<ReActAction>公开方法;参数与返回类型以签名列为准。

AgenticReasoningMode

Agentic Reasoning Mode 公共类型别名;完整类型表达式见声明。

  • 种类: 类型
  • 导入: import type { AgenticReasoningMode } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export type AgenticReasoningMode = 'react' | 'fsm_react' | 'tot' | 'critique';

ReActPhase

ReAct Phase 公共类型别名;完整类型表达式见声明。

  • 种类: 类型
  • 导入: import type { ReActPhase } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export type ReActPhase = 'observe' | 'reason' | 'select_action' | 'policy_check' | 'act' | 'observe_result' | 'verify' | 'memory_sync' | 'complete' | 'fail' | 'human_review' | 'suspend' | 'cancel';

ReActSuspensionReason

ReAct Suspension Reason 公共类型别名;完整类型表达式见声明。

  • 种类: 类型
  • 导入: import type { ReActSuspensionReason } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export type ReActSuspensionReason = (typeof REACT_SUSPENSION_REASONS)[number];

ReasoningPersistence

Reasoning Persistence 公共类型别名;完整类型表达式见声明。

  • 种类: 类型
  • 导入: import type { ReasoningPersistence } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export type ReasoningPersistence = 'summary_only' | 'events_only';

ThinkingMode

Thinking Mode 公共类型别名;完整类型表达式见声明。

  • 种类: 类型
  • 导入: import type { ThinkingMode } from '@codesoul-co/hypha-kernel';
  • 源码模块: index

声明

text
export type ThinkingMode = 'none' | 'summary' | 'structured';