@codesoul-co/hypha-kernel / index
- 包索引:
@codesoul-co/hypha-kernel - 源码:
packages/kernel/src/index.ts - 导出数: 85
模块用法
聚合 @codesoul-co/hypha-kernel 的公共入口导出;应用应从包入口导入这些 Symbol,不应依赖内部文件路径。
从包入口导入
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 或默认配置;应复用这些导出,避免在应用中复制内部值。
运行时校验示例
import { agenticReasoningModeSchema } from '@codesoul-co/hypha-kernel';
declare function loadExternalInput(): unknown;
const input: unknown = loadExternalInput();
const parsed = agenticReasoningModeSchema.parse(input);配置、网络请求或持久化数据等不可信输入应先通过 Runtime Schema,再传给只接受已校验契约的函数或类。
公共导出
| Symbol | 种类 | 签名 | 说明 |
|---|---|---|---|
BasicReActAgentRuntime | 类 | new BasicReActAgentRuntime(options?: BasicReActAgentRuntimeOptions): BasicReActAgentRuntime | Basic ReAct Agent Runtime 类,共公开 4 个构造函数或成员;精确签名见本条目的声明与成员表。 |
DefaultAgenticReasoner | 类 | new DefaultAgenticReasoner(now?: () => string): DefaultAgenticReasoner | Default Agentic Reasoner 类,共公开 2 个构造函数或成员;精确签名见本条目的声明与成员表。 |
DefaultContextBuilder | 类 | new DefaultContextBuilder(): DefaultContextBuilder | Default Context Builder 类,共公开 2 个构造函数或成员;精确签名见本条目的声明与成员表。 |
DefaultThinkingPlanner | 类 | new DefaultThinkingPlanner(now?: () => string): DefaultThinkingPlanner | Default Thinking Planner 类,共公开 2 个构造函数或成员;精确签名见本条目的声明与成员表。 |
DefaultVerifier | 类 | new DefaultVerifier(): DefaultVerifier | Default Verifier 类,共公开 2 个构造函数或成员;精确签名见本条目的声明与成员表。 |
InMemoryReActContinuationCheckpointStore | 类 | new InMemoryReActContinuationCheckpointStore(options?: InMemoryReActContinuationCheckpointStoreOptions): InMemoryReActContinuationCheckpointStore | In Memory ReAct Continuation Checkpoint Store 类,共公开 4 个构造函数或成员;精确签名见本条目的声明与成员表。 |
MemoryContextBuilder | 类 | new MemoryContextBuilder(options: MemoryContextBuilderOptions): MemoryContextBuilder | Memory Context Builder 类,共公开 2 个构造函数或成员;精确签名见本条目的声明与成员表。 |
ReActAgentRunner | 类 | new ReActAgentRunner(options: ReActAgentRunnerOptions): ReActAgentRunner | ReAct Agent Runner 类,共公开 2 个构造函数或成员;精确签名见本条目的声明与成员表。 |
ReActRunner | 类 | new ReActRunner(runtime: ReActAgentRuntime, options: ReActRunnerOptions): ReActRunner | ReAct Runner 类,共公开 2 个构造函数或成员;精确签名见本条目的声明与成员表。 |
ReasoningContextBuilder | 类 | new ReasoningContextBuilder(options?: ReasoningContextBuilderOptions): ReasoningContextBuilder | Reasoning Context Builder 类,共公开 2 个构造函数或成员;精确签名见本条目的声明与成员表。 |
SkillContextBuilder | 类 | new SkillContextBuilder(options: SkillContextBuilderOptions): SkillContextBuilder | Skill Context Builder 类,共公开 2 个构造函数或成员;精确签名见本条目的声明与成员表。 |
ToolRunnerActivityAdapter | 类 | new ToolRunnerActivityAdapter(runner: ToolRunner): ToolRunnerActivityAdapter | Tool 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: ReActAgentSpec | React Agent Spec 的有效示例值。 |
reactAgentSpecJsonSchema | 常量 | const reactAgentSpecJsonSchema: JsonSchema | React 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: JsonSchema | Re 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: JsonSchema | Re 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: ReasoningConfig | Reasoning Config 的有效示例值。 |
reasoningConfigJsonSchema | 常量 | const reasoningConfigJsonSchema: JsonSchema | Reasoning 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): ReActStep | Create ReAct Step 函数,提供 1 个公开调用签名;参数与返回类型见下表。 |
reActContinuationScopeHash | 函数 | reActContinuationScopeHash(context: ReActRunContext): string | Re Act Continuation Scope Hash 函数,提供 1 个公开调用签名;参数与返回类型见下表。 |
validateReActAction | 函数 | validateReActAction(input: unknown): ReActAction | Validate ReAct Action 函数,提供 1 个公开调用签名;参数与返回类型见下表。 |
validateReActAgentSpec | 函数 | validateReActAgentSpec(input: unknown): ReActAgentSpec | Validate ReAct Agent Spec 函数,提供 1 个公开调用签名;参数与返回类型见下表。 |
validateReActContinuationCheckpoint | 函数 | validateReActContinuationCheckpoint(input: unknown): ReActContinuationCheckpoint | Validate ReAct Continuation Checkpoint 函数,提供 1 个公开调用签名;参数与返回类型见下表。 |
validateReActExecutionBudget | 函数 | validateReActExecutionBudget(input: unknown): ReActExecutionBudget | Validate ReAct Execution Budget 函数,提供 1 个公开调用签名;参数与返回类型见下表。 |
validateReasoningConfig | 函数 | validateReasoningConfig(input: unknown): ReasoningConfig | Validate Reasoning Config 函数,提供 1 个公开调用签名;参数与返回类型见下表。 |
AgenticReasoner | 接口 | interface AgenticReasoner | Agentic Reasoner 接口,共包含 1 个公开字段或方法。 |
AgenticReasonerInput | 接口 | interface AgenticReasonerInput | Agentic Reasoner Input 接口,共包含 3 个公开字段或方法。 |
AgenticReasoningDecision | 接口 | interface AgenticReasoningDecision | Agentic Reasoning Decision 接口,共包含 11 个公开字段或方法。 |
BasicReActAgentRuntimeOptions | 接口 | interface BasicReActAgentRuntimeOptions | Basic ReAct Agent Runtime Options 接口,共包含 1 个公开字段或方法。 |
BuiltAgentContext | 接口 | interface BuiltAgentContext extends ReActRunContext | Built Agent Context 接口,共包含 18 个公开字段或方法。 |
ContextBudget | 接口 | interface ContextBudget | Context Budget 接口,共包含 4 个公开字段或方法。 |
ContextBuilder | 接口 | interface ContextBuilder | Context Builder 接口,共包含 1 个公开字段或方法。 |
ContextBuildInput | 接口 | interface ContextBuildInput | Context Build Input 接口,共包含 12 个公开字段或方法。 |
ContextProvenance | 接口 | interface ContextProvenance | Context Provenance 接口,共包含 6 个公开字段或方法。 |
EpisodicMemorySyncOptions | 接口 | interface EpisodicMemorySyncOptions | Episodic Memory Sync Options 接口,共包含 7 个公开字段或方法。 |
InMemoryReActContinuationCheckpointStoreOptions | 接口 | interface InMemoryReActContinuationCheckpointStoreOptions | In Memory ReAct Continuation Checkpoint Store Options 接口,共包含 3 个公开字段或方法。 |
MemoryContextBuilderOptions | 接口 | interface MemoryContextBuilderOptions | Memory Context Builder Options 接口,共包含 7 个公开字段或方法。 |
MemoryContextItem | 接口 | interface MemoryContextItem | Memory Context Item 接口,共包含 5 个公开字段或方法。 |
ReActAction | 接口 | interface ReActAction | ReAct Action 接口,共包含 5 个公开字段或方法。 |
ReActAgentRunnerOptions | 接口 | interface ReActAgentRunnerOptions extends Omit<ReActRunnerOptions, 'toolRunner'> | ReAct Agent Runner Options 接口,共包含 25 个公开字段或方法。 |
ReActAgentRuntime | 接口 | interface ReActAgentRuntime | ReAct Agent Runtime 接口,共包含 3 个公开字段或方法。 |
ReActAgentSpec | 接口 | interface ReActAgentSpec extends VersionedSpec, SpecMetadata | ReAct Agent Spec 接口,共包含 17 个公开字段或方法。 |
ReActContinuationCheckpoint | 接口 | interface ReActContinuationCheckpoint | ReAct Continuation Checkpoint 接口,共包含 19 个公开字段或方法。 |
ReActContinuationCheckpointPutResult | 接口 | interface ReActContinuationCheckpointPutResult | ReAct Continuation Checkpoint Put Result 接口,共包含 2 个公开字段或方法。 |
ReActContinuationCheckpointStore | 接口 | interface ReActContinuationCheckpointStore | ReAct Continuation Checkpoint Store 接口,共包含 3 个公开字段或方法。 |
ReActExecutionBudget | 接口 | interface ReActExecutionBudget | Global limits survive process restarts through ReActContinuationCheckpoint. quantumIterations only bounds one worker turn; it is not a new total budget. |
ReActObservation | 接口 | interface ReActObservation | ReAct Observation 接口,共包含 3 个公开字段或方法。 |
ReActRunContext | 接口 | interface ReActRunContext | ReAct Run Context 接口,共包含 14 个公开字段或方法。 |
ReActRunControl | 接口 | interface ReActRunControl | ReAct Run Control 接口,共包含 4 个公开字段或方法。 |
ReActRunnerOptions | 接口 | interface ReActRunnerOptions | ReAct Runner Options 接口,共包含 13 个公开字段或方法。 |
ReActRunResult | 接口 | interface ReActRunResult | ReAct Run Result 接口,共包含 8 个公开字段或方法。 |
ReActStep | 接口 | interface ReActStep | ReAct Step 接口,共包含 5 个公开字段或方法。 |
ReActSuspension | 接口 | interface ReActSuspension | ReAct Suspension 接口,共包含 4 个公开字段或方法。 |
ReasoningConfig | 接口 | interface ReasoningConfig | Reasoning Config 接口,共包含 7 个公开字段或方法。 |
ReasoningContextBuilderOptions | 接口 | interface ReasoningContextBuilderOptions | Reasoning Context Builder Options 接口,共包含 5 个公开字段或方法。 |
RequiredReasoningConfig | 接口 | interface RequiredReasoningConfig extends Required<Omit<ReasoningConfig, 'plannerRef' | 'reasonerRef' | 'metadata'>> | Required Reasoning Config 接口,共包含 7 个公开字段或方法。 |
SkillContextBuilderOptions | 接口 | interface SkillContextBuilderOptions | Skill Context Builder Options 接口,共包含 9 个公开字段或方法。 |
ThinkingPlan | 接口 | interface ThinkingPlan | Thinking Plan 接口,共包含 10 个公开字段或方法。 |
ThinkingPlanner | 接口 | interface ThinkingPlanner | Thinking Planner 接口,共包含 1 个公开字段或方法。 |
ThinkingPlannerInput | 接口 | interface ThinkingPlannerInput | Thinking Planner Input 接口,共包含 2 个公开字段或方法。 |
ToolActivityPort | 接口 | interface ToolActivityPort | Tool Activity Port 接口,共包含 2 个公开字段或方法。 |
ToolActivityRequest | 接口 | interface ToolActivityRequest | Tool Activity Request 接口,共包含 10 个公开字段或方法。 |
ToolActivityResult | 接口 | interface ToolActivityResult | Tool Activity Result 接口,共包含 7 个公开字段或方法。 |
Verifier | 接口 | interface Verifier | Verifier 接口,共包含 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
声明
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
声明
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
声明
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
声明
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
声明
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
声明
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
声明
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
声明
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
声明
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
声明
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
声明
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
声明
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
声明
export declare const agenticReasoningModeSchema: z.ZodEnum<["react", "fsm_react", "tot", "critique"]>;kernelSpecDefinitions
由 index 模块导出的 Kernel Spec Definitions 常量。
- 种类: 常量
- 导入:
import { kernelSpecDefinitions } from '@codesoul-co/hypha-kernel'; - 源码模块:
index
声明
export declare const kernelSpecDefinitions: readonly [SpecSchemaDefinition<ReActAgentSpec>, SpecSchemaDefinition<ReasoningConfig>];kernelSpecJsonSchemas
由 index 模块导出的 Kernel Spec JSON Schemas 常量。
- 种类: 常量
- 导入:
import { kernelSpecJsonSchemas } from '@codesoul-co/hypha-kernel'; - 源码模块:
index
声明
export declare const kernelSpecJsonSchemas: Record<string, JsonSchema>;REACT_PHASE_ORDER
由 index 模块导出的 REACT PHASE ORDER 常量。
- 种类: 常量
- 导入:
import { REACT_PHASE_ORDER } from '@codesoul-co/hypha-kernel'; - 源码模块:
index
声明
export declare const REACT_PHASE_ORDER: ReActPhase[];REACT_SUSPENSION_REASONS
由 index 模块导出的 REACT SUSPENSION REASONS 常量。
- 种类: 常量
- 导入:
import { REACT_SUSPENSION_REASONS } from '@codesoul-co/hypha-kernel'; - 源码模块:
index
声明
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
声明
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
声明
export declare const reactAgentSpecDefinition: SpecSchemaDefinition<ReActAgentSpec>;reactAgentSpecExample
React Agent Spec 的有效示例值。
- 种类: 常量
- 导入:
import { reactAgentSpecExample } from '@codesoul-co/hypha-kernel'; - 源码模块:
index
声明
export declare const reactAgentSpecExample: ReActAgentSpec;reactAgentSpecJsonSchema
React Agent Spec 的 JSON Schema。
- 种类: 常量
- 导入:
import { reactAgentSpecJsonSchema } from '@codesoul-co/hypha-kernel'; - 源码模块:
index
声明
export declare const reactAgentSpecJsonSchema: JsonSchema;reactAgentSpecSchema
React Agent Spec 的运行时 Schema。
- 种类: 常量
- 导入:
import { reactAgentSpecSchema } from '@codesoul-co/hypha-kernel'; - 源码模块:
index
声明
// 精确类型由包入口解析;完整编译器展开定义见源码链接。
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
声明
export declare const reActContinuationCheckpointJsonSchema: JsonSchema;reActContinuationCheckpointSchema
Re Act Continuation Checkpoint 的运行时 Schema。
- 种类: 常量
- 导入:
import { reActContinuationCheckpointSchema } from '@codesoul-co/hypha-kernel'; - 源码模块:
index
声明
// 精确类型由包入口解析;完整编译器展开定义见源码链接。
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
声明
export declare const reActExecutionBudgetJsonSchema: JsonSchema;reActExecutionBudgetSchema
Re Act Execution Budget 的运行时 Schema。
- 种类: 常量
- 导入:
import { reActExecutionBudgetSchema } from '@codesoul-co/hypha-kernel'; - 源码模块:
index
声明
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
声明
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
声明
export declare const reasoningConfigExample: ReasoningConfig;reasoningConfigJsonSchema
Reasoning Config 的 JSON Schema。
- 种类: 常量
- 导入:
import { reasoningConfigJsonSchema } from '@codesoul-co/hypha-kernel'; - 源码模块:
index
声明
export declare const reasoningConfigJsonSchema: JsonSchema;reasoningConfigSchema
Reasoning Config 的运行时 Schema。
- 种类: 常量
- 导入:
import { reasoningConfigSchema } from '@codesoul-co/hypha-kernel'; - 源码模块:
index
声明
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
声明
export declare const reasoningConfigSpecDefinition: SpecSchemaDefinition<ReasoningConfig>;reasoningPersistenceSchema
Reasoning Persistence 的运行时 Schema。
- 种类: 常量
- 导入:
import { reasoningPersistenceSchema } from '@codesoul-co/hypha-kernel'; - 源码模块:
index
声明
export declare const reasoningPersistenceSchema: z.ZodEnum<["summary_only", "events_only"]>;thinkingModeSchema
Thinking Mode 的运行时 Schema。
- 种类: 常量
- 导入:
import { thinkingModeSchema } from '@codesoul-co/hypha-kernel'; - 源码模块:
index
声明
export declare const thinkingModeSchema: z.ZodEnum<["none", "summary", "structured"]>;createEpisodicMemorySync
Create Episodic Memory Sync 函数,提供 1 个公开调用签名;参数与返回类型见下表。
- 种类: 函数
- 导入:
import { createEpisodicMemorySync } from '@codesoul-co/hypha-kernel'; - 源码模块:
index
声明
export declare function createEpisodicMemorySync(options: EpisodicMemorySyncOptions): NonNullable<ReActRunnerOptions['syncMemory']>;调用签名
createEpisodicMemorySync(options: EpisodicMemorySyncOptions): NonNullable<ReActRunnerOptions["syncMemory"]>参数
| 参数 | 类型 | 必需 | 说明 |
|---|---|---|---|
options | EpisodicMemorySyncOptions | 是 | 必需参数;接受的值由类型列定义。 |
返回值
- 类型:
(context: ReActRunContext, observation: ReActObservation) => Promise<void> - 说明: 返回值契约由上述类型定义。
createReActStep
Create ReAct Step 函数,提供 1 个公开调用签名;参数与返回类型见下表。
- 种类: 函数
- 导入:
import { createReActStep } from '@codesoul-co/hypha-kernel'; - 源码模块:
index
声明
export declare function createReActStep(id: string, phase: ReActPhase, input?: unknown): ReActStep;调用签名
createReActStep(id: string, phase: ReActPhase, input?: unknown): ReActStep参数
| 参数 | 类型 | 必需 | 说明 |
|---|---|---|---|
id | string | 是 | 必需参数;接受的值由类型列定义。 |
phase | ReActPhase | 是 | 必需参数;接受的值由类型列定义。 |
input | unknown | 否 | 可选参数;接受的值由类型列定义。 |
返回值
- 类型:
ReActStep - 说明: 返回值契约由上述类型定义。
reActContinuationScopeHash
Re Act Continuation Scope Hash 函数,提供 1 个公开调用签名;参数与返回类型见下表。
- 种类: 函数
- 导入:
import { reActContinuationScopeHash } from '@codesoul-co/hypha-kernel'; - 源码模块:
index
声明
export declare function reActContinuationScopeHash(context: ReActRunContext): string;调用签名
reActContinuationScopeHash(context: ReActRunContext): string参数
| 参数 | 类型 | 必需 | 说明 |
|---|---|---|---|
context | ReActRunContext | 是 | 必需参数;接受的值由类型列定义。 |
返回值
- 类型:
string - 说明: 返回值契约由上述类型定义。
validateReActAction
Validate ReAct Action 函数,提供 1 个公开调用签名;参数与返回类型见下表。
- 种类: 函数
- 导入:
import { validateReActAction } from '@codesoul-co/hypha-kernel'; - 源码模块:
index
声明
export declare function validateReActAction(input: unknown): ReActAction;调用签名
validateReActAction(input: unknown): ReActAction参数
| 参数 | 类型 | 必需 | 说明 |
|---|---|---|---|
input | unknown | 是 | 必需参数;接受的值由类型列定义。 |
返回值
- 类型:
ReActAction - 说明: 返回值契约由上述类型定义。
validateReActAgentSpec
Validate ReAct Agent Spec 函数,提供 1 个公开调用签名;参数与返回类型见下表。
- 种类: 函数
- 导入:
import { validateReActAgentSpec } from '@codesoul-co/hypha-kernel'; - 源码模块:
index
声明
export declare function validateReActAgentSpec(input: unknown): ReActAgentSpec;调用签名
validateReActAgentSpec(input: unknown): ReActAgentSpec参数
| 参数 | 类型 | 必需 | 说明 |
|---|---|---|---|
input | unknown | 是 | 必需参数;接受的值由类型列定义。 |
返回值
- 类型:
ReActAgentSpec - 说明: 返回值契约由上述类型定义。
validateReActContinuationCheckpoint
Validate ReAct Continuation Checkpoint 函数,提供 1 个公开调用签名;参数与返回类型见下表。
- 种类: 函数
- 导入:
import { validateReActContinuationCheckpoint } from '@codesoul-co/hypha-kernel'; - 源码模块:
index
声明
export declare function validateReActContinuationCheckpoint(input: unknown): ReActContinuationCheckpoint;调用签名
validateReActContinuationCheckpoint(input: unknown): ReActContinuationCheckpoint参数
| 参数 | 类型 | 必需 | 说明 |
|---|---|---|---|
input | unknown | 是 | 必需参数;接受的值由类型列定义。 |
返回值
- 类型:
ReActContinuationCheckpoint - 说明: 返回值契约由上述类型定义。
validateReActExecutionBudget
Validate ReAct Execution Budget 函数,提供 1 个公开调用签名;参数与返回类型见下表。
- 种类: 函数
- 导入:
import { validateReActExecutionBudget } from '@codesoul-co/hypha-kernel'; - 源码模块:
index
声明
export declare function validateReActExecutionBudget(input: unknown): ReActExecutionBudget;调用签名
validateReActExecutionBudget(input: unknown): ReActExecutionBudget参数
| 参数 | 类型 | 必需 | 说明 |
|---|---|---|---|
input | unknown | 是 | 必需参数;接受的值由类型列定义。 |
返回值
- 类型:
ReActExecutionBudget - 说明: 返回值契约由上述类型定义。
validateReasoningConfig
Validate Reasoning Config 函数,提供 1 个公开调用签名;参数与返回类型见下表。
- 种类: 函数
- 导入:
import { validateReasoningConfig } from '@codesoul-co/hypha-kernel'; - 源码模块:
index
声明
export declare function validateReasoningConfig(input: unknown): ReasoningConfig;调用签名
validateReasoningConfig(input: unknown): ReasoningConfig参数
| 参数 | 类型 | 必需 | 说明 |
|---|---|---|---|
input | unknown | 是 | 必需参数;接受的值由类型列定义。 |
返回值
- 类型:
ReasoningConfig - 说明: 返回值契约由上述类型定义。
AgenticReasoner
Agentic Reasoner 接口,共包含 1 个公开字段或方法。
- 种类: 接口
- 导入:
import type { AgenticReasoner } from '@codesoul-co/hypha-kernel'; - 源码模块:
index
声明
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
声明
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
声明
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
声明
export interface BasicReActAgentRuntimeOptions {
verifier?: Verifier;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
verifier | 属性 | verifier?: Verifier | 公开属性;类型、只读和可选状态以签名列为准。 |
BuiltAgentContext
Built Agent Context 接口,共包含 18 个公开字段或方法。
- 种类: 接口
- 导入:
import type { BuiltAgentContext } from '@codesoul-co/hypha-kernel'; - 源码模块:
index
声明
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
声明
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
声明
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
声明
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
声明
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
声明
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
声明
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
声明
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
声明
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
声明
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
声明
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?: boolean | 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. |
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
声明
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
声明
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
声明
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
声明
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
声明
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
声明
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
声明
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
声明
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
声明
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
声明
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?: boolean | 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. |
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
声明
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
声明
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
声明
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
声明
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
声明
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
声明
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
声明
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
声明
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
声明
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
声明
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
声明
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
声明
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
声明
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
声明
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
声明
export type AgenticReasoningMode = 'react' | 'fsm_react' | 'tot' | 'critique';ReActPhase
ReAct Phase 公共类型别名;完整类型表达式见声明。
- 种类: 类型
- 导入:
import type { ReActPhase } from '@codesoul-co/hypha-kernel'; - 源码模块:
index
声明
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
声明
export type ReActSuspensionReason = (typeof REACT_SUSPENSION_REASONS)[number];ReasoningPersistence
Reasoning Persistence 公共类型别名;完整类型表达式见声明。
- 种类: 类型
- 导入:
import type { ReasoningPersistence } from '@codesoul-co/hypha-kernel'; - 源码模块:
index
声明
export type ReasoningPersistence = 'summary_only' | 'events_only';ThinkingMode
Thinking Mode 公共类型别名;完整类型表达式见声明。
- 种类: 类型
- 导入:
import type { ThinkingMode } from '@codesoul-co/hypha-kernel'; - 源码模块:
index
声明
export type ThinkingMode = 'none' | 'summary' | 'structured';