@codesoul-co/hypha-harness / runtime
- 包索引:
@codesoul-co/hypha-harness - 源码:
packages/harness/src/runtime.ts - 导出数: 20
模块用法
用于执行该边界的运行时行为。Runtime 模块公开 3 类、4 函数、13 接口。
从包入口导入
import {
EventFirstRuntime,
HarnessedReActFSMRunner,
RunManager,
projectAudit,
projectReplay,
projectRun,
projectSession,
} from '@codesoul-co/hypha-harness';
import type {
AppendRunEventInput,
AuditProjection,
CreateRunInput,
CreateSessionInput,
HarnessedReActFSMRunInput,
HarnessedReActFSMRunnerOptions,
HarnessedReActFSMRunResult,
RegressionProjection,
} from '@codesoul-co/hypha-harness';
// 完整导出列表见下方。使用要点
- 13 个类型/接口用于应用代码、Adapter 或测试中的静态契约;请使用
import type,运行时不应依赖它们。 - 3 个类提供可实例化的运行时实现;构造参数与公开方法在各自条目中完整列出。
- 4 个函数是该模块的直接操作入口;每个 overload 的必需/可选参数与返回类型均在下方列出。
公共导出
| Symbol | 种类 | 签名 | 说明 |
|---|---|---|---|
EventFirstRuntime | 类 | new EventFirstRuntime(events?: EventStore): EventFirstRuntime | Event First Runtime 类,共公开 10 个构造函数或成员;精确签名见本条目的声明与成员表。 |
HarnessedReActFSMRunner | 类 | new HarnessedReActFSMRunner(options: HarnessedReActFSMRunnerOptions): HarnessedReActFSMRunner | Harnessed ReAct FSM Runner 类,共公开 2 个构造函数或成员;精确签名见本条目的声明与成员表。 |
RunManager | 类 | new RunManager(options?: RunManagerOptions): RunManager | Run Manager 类,共公开 36 个构造函数或成员;精确签名见本条目的声明与成员表。 |
projectAudit | 函数 | projectAudit(events: FrameworkEvent[]): AuditProjection | Project Audit 函数,提供 1 个公开调用签名;参数与返回类型见下表。 |
projectReplay | 函数 | projectReplay(events: FrameworkEvent[]): ReplayProjection | Project Replay 函数,提供 1 个公开调用签名;参数与返回类型见下表。 |
projectRun | 函数 | projectRun(events: FrameworkEvent[]): RuntimeRun | null | Project Run 函数,提供 1 个公开调用签名;参数与返回类型见下表。 |
projectSession | 函数 | projectSession(events: FrameworkEvent[]): RuntimeSession | null | Project Session 函数,提供 1 个公开调用签名;参数与返回类型见下表。 |
AppendRunEventInput | 接口 | interface AppendRunEventInput | Append Run Event Input 接口,共包含 11 个公开字段或方法。 |
AuditProjection | 接口 | interface AuditProjection | Audit Projection 接口,共包含 8 个公开字段或方法。 |
CreateRunInput | 接口 | interface CreateRunInput | Create Run Input 接口,共包含 9 个公开字段或方法。 |
CreateSessionInput | 接口 | interface CreateSessionInput | Create Session Input 接口,共包含 6 个公开字段或方法。 |
HarnessedReActFSMRunInput | 接口 | interface HarnessedReActFSMRunInput extends ContextBuildInput<TInput> | Harnessed ReAct FSM Run Input 接口,共包含 16 个公开字段或方法。 |
HarnessedReActFSMRunnerOptions | 接口 | interface HarnessedReActFSMRunnerOptions | Harnessed ReAct FSM Runner Options 接口,共包含 22 个公开字段或方法。 |
HarnessedReActFSMRunResult | 接口 | interface HarnessedReActFSMRunResult | Harnessed ReAct FSM Run Result 接口,共包含 4 个公开字段或方法。 |
RegressionProjection | 接口 | interface RegressionProjection | Regression Projection 接口,共包含 8 个公开字段或方法。 |
ReplayProjection | 接口 | interface ReplayProjection | Replay Projection 接口,共包含 16 个公开字段或方法。 |
RunExecutionContext | 接口 | interface RunExecutionContext | Run Execution Context 接口,共包含 4 个公开字段或方法。 |
RunManagerOptions | 接口 | interface RunManagerOptions | Run Manager Options 接口,共包含 2 个公开字段或方法。 |
RuntimeRun | 接口 | interface RuntimeRun | Runtime Run 接口,共包含 12 个公开字段或方法。 |
RuntimeSession | 接口 | interface RuntimeSession | Runtime Session 接口,共包含 8 个公开字段或方法。 |
EventFirstRuntime
Event First Runtime 类,共公开 10 个构造函数或成员;精确签名见本条目的声明与成员表。
- 种类: 类
- 导入:
import { EventFirstRuntime } from '@codesoul-co/hypha-harness'; - 源码模块:
runtime
声明
export declare class EventFirstRuntime {
constructor(events?: EventStore);
createSession(input: CreateSessionInput): Promise<RuntimeSession>;
createRun(input: CreateRunInput): Promise<RuntimeRun>;
appendRunEvent(input: AppendRunEventInput): Promise<FrameworkEvent>;
projectSession(sessionId: string): Promise<RuntimeSession | null>;
projectRun(runId: string): Promise<RuntimeRun | null>;
projectReplay(runId: string): Promise<ReplayProjection>;
projectAudit(runId: string): Promise<AuditProjection>;
projectRegression(runId: string): Promise<RegressionProjection>;
listEvents(runId: string): Promise<FrameworkEvent[]>;
}公开成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
appendRunEvent | 方法 | appendRunEvent(input: AppendRunEventInput): Promise<FrameworkEvent> | 公开方法;参数与返回类型以签名列为准。 |
constructor | 构造函数 | (events?: EventStore): EventFirstRuntime | 创建该类的实例。 |
createRun | 方法 | createRun(input: CreateRunInput): Promise<RuntimeRun> | 公开方法;参数与返回类型以签名列为准。 |
createSession | 方法 | createSession(input: CreateSessionInput): Promise<RuntimeSession> | 公开方法;参数与返回类型以签名列为准。 |
listEvents | 方法 | listEvents(runId: string): Promise<FrameworkEvent[]> | 公开方法;参数与返回类型以签名列为准。 |
projectAudit | 方法 | projectAudit(runId: string): Promise<AuditProjection> | 公开方法;参数与返回类型以签名列为准。 |
projectRegression | 方法 | projectRegression(runId: string): Promise<RegressionProjection> | 公开方法;参数与返回类型以签名列为准。 |
projectReplay | 方法 | projectReplay(runId: string): Promise<ReplayProjection> | 公开方法;参数与返回类型以签名列为准。 |
projectRun | 方法 | projectRun(runId: string): Promise<RuntimeRun | null> | 公开方法;参数与返回类型以签名列为准。 |
projectSession | 方法 | projectSession(sessionId: string): Promise<RuntimeSession | null> | 公开方法;参数与返回类型以签名列为准。 |
HarnessedReActFSMRunner
Harnessed ReAct FSM Runner 类,共公开 2 个构造函数或成员;精确签名见本条目的声明与成员表。
- 种类: 类
- 导入:
import { HarnessedReActFSMRunner } from '@codesoul-co/hypha-harness'; - 源码模块:
runtime
声明
export declare class HarnessedReActFSMRunner {
constructor(options: HarnessedReActFSMRunnerOptions);
run(input: HarnessedReActFSMRunInput): Promise<HarnessedReActFSMRunResult>;
}公开成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
constructor | 构造函数 | (options: HarnessedReActFSMRunnerOptions): HarnessedReActFSMRunner | 创建该类的实例。 |
run | 方法 | run(input: HarnessedReActFSMRunInput): Promise<HarnessedReActFSMRunResult> | 公开方法;参数与返回类型以签名列为准。 |
RunManager
Run Manager 类,共公开 36 个构造函数或成员;精确签名见本条目的声明与成员表。
- 种类: 类
- 导入:
import { RunManager } from '@codesoul-co/hypha-harness'; - 源码模块:
runtime
声明
export declare class RunManager {
constructor(options?: RunManagerOptions);
eventRuntime(): EventFirstRuntime;
createSession(input: CreateSessionInput): Promise<RuntimeSession>;
createRun(input: CreateRunInput): Promise<RuntimeRun>;
appendRunEvent(input: AppendRunEventInput): Promise<FrameworkEvent>;
startRun(run: RuntimeRun, timestamp?: string): Promise<FrameworkEvent>;
recordTransitionAccepted(context: RunExecutionContext, transition: StateTransition): Promise<FrameworkEvent>;
recordStateEntered(context: RunExecutionContext, record: FSMStateEnteredRecord): Promise<FrameworkEvent>;
recordContextBuildStarted(context: RunExecutionContext): Promise<FrameworkEvent>;
recordContextBuildCompleted(context: RunExecutionContext, payload: Record<string, unknown>): Promise<FrameworkEvent>;
recordSkillSelected(context: RunExecutionContext, payload: Record<string, unknown>): Promise<FrameworkEvent>;
recordSkillLoaded(context: RunExecutionContext, payload: Record<string, unknown>): Promise<FrameworkEvent>;
recordSkillCompleted(context: RunExecutionContext, payload: Record<string, unknown>): Promise<FrameworkEvent>;
recordThinkingStarted(context: RunExecutionContext, payload: Record<string, unknown>): Promise<FrameworkEvent>;
recordThinkingCompleted(context: RunExecutionContext, payload: Record<string, unknown>): Promise<FrameworkEvent>;
recordAgentDeliberationStarted(context: RunExecutionContext, payload: Record<string, unknown>): Promise<FrameworkEvent>;
recordAgentDeliberationCompleted(context: RunExecutionContext, payload: Record<string, unknown>): Promise<FrameworkEvent>;
recordReasoningDecision(context: RunExecutionContext, payload: Record<string, unknown>): Promise<FrameworkEvent>;
recordReactStep(context: RunExecutionContext, step: ReActStep): Promise<FrameworkEvent>;
recordReactContinuationCheckpoint(context: RunExecutionContext, checkpoint: ReActContinuationCheckpoint): Promise<FrameworkEvent>;
recordReactContinuationResumed(context: RunExecutionContext, checkpoint: ReActContinuationCheckpoint, resumedAt: string): Promise<FrameworkEvent>;
recordReactContinuationSuspended(context: RunExecutionContext, result: ReActRunResult): Promise<FrameworkEvent>;
completeRun(context: RunExecutionContext, output: unknown, timestamp?: string): Promise<FrameworkEvent>;
waitForHumanReview(context: RunExecutionContext, payload?: Record<string, unknown>, timestamp?: string): Promise<FrameworkEvent>;
recordHumanReviewRequested(context: RunExecutionContext, payload?: Record<string, unknown>, timestamp?: string): Promise<FrameworkEvent>;
recordHumanReviewApproved(context: RunExecutionContext, payload?: Record<string, unknown>, timestamp?: string): Promise<FrameworkEvent>;
recordHumanReviewRejected(context: RunExecutionContext, payload?: Record<string, unknown>, timestamp?: string): Promise<FrameworkEvent>;
recordContextCompacted(context: RunExecutionContext, payload?: Record<string, unknown>, timestamp?: string): Promise<FrameworkEvent>;
cancelRun(context: RunExecutionContext, reason?: string, timestamp?: string): Promise<FrameworkEvent>;
failRun(context: RunExecutionContext, error: unknown, timestamp?: string): Promise<FrameworkEvent>;
listEvents(runId: string): Promise<FrameworkEvent[]>;
projectRun(runId: string): Promise<RuntimeRun | null>;
projectSession(sessionId: string): Promise<RuntimeSession | null>;
projectReplay(runId: string): Promise<ReplayProjection>;
projectAudit(runId: string): Promise<AuditProjection>;
projectRegression(runId: string): Promise<RegressionProjection>;
}公开成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
appendRunEvent | 方法 | appendRunEvent(input: AppendRunEventInput): Promise<FrameworkEvent> | 公开方法;参数与返回类型以签名列为准。 |
cancelRun | 方法 | cancelRun(context: RunExecutionContext, reason?: string, timestamp?: string): Promise<FrameworkEvent> | 公开方法;参数与返回类型以签名列为准。 |
completeRun | 方法 | completeRun(context: RunExecutionContext, output: unknown, timestamp?: string): Promise<FrameworkEvent> | 公开方法;参数与返回类型以签名列为准。 |
constructor | 构造函数 | (options?: RunManagerOptions): RunManager | 创建该类的实例。 |
createRun | 方法 | createRun(input: CreateRunInput): Promise<RuntimeRun> | 公开方法;参数与返回类型以签名列为准。 |
createSession | 方法 | createSession(input: CreateSessionInput): Promise<RuntimeSession> | 公开方法;参数与返回类型以签名列为准。 |
eventRuntime | 方法 | eventRuntime(): EventFirstRuntime | 公开方法;参数与返回类型以签名列为准。 |
failRun | 方法 | failRun(context: RunExecutionContext, error: unknown, timestamp?: string): Promise<FrameworkEvent> | 公开方法;参数与返回类型以签名列为准。 |
listEvents | 方法 | listEvents(runId: string): Promise<FrameworkEvent[]> | 公开方法;参数与返回类型以签名列为准。 |
projectAudit | 方法 | projectAudit(runId: string): Promise<AuditProjection> | 公开方法;参数与返回类型以签名列为准。 |
projectRegression | 方法 | projectRegression(runId: string): Promise<RegressionProjection> | 公开方法;参数与返回类型以签名列为准。 |
projectReplay | 方法 | projectReplay(runId: string): Promise<ReplayProjection> | 公开方法;参数与返回类型以签名列为准。 |
projectRun | 方法 | projectRun(runId: string): Promise<RuntimeRun | null> | 公开方法;参数与返回类型以签名列为准。 |
projectSession | 方法 | projectSession(sessionId: string): Promise<RuntimeSession | null> | 公开方法;参数与返回类型以签名列为准。 |
recordAgentDeliberationCompleted | 方法 | recordAgentDeliberationCompleted(context: RunExecutionContext, payload: Record<string, unknown>): Promise<FrameworkEvent> | 公开方法;参数与返回类型以签名列为准。 |
recordAgentDeliberationStarted | 方法 | recordAgentDeliberationStarted(context: RunExecutionContext, payload: Record<string, unknown>): Promise<FrameworkEvent> | 公开方法;参数与返回类型以签名列为准。 |
recordContextBuildCompleted | 方法 | recordContextBuildCompleted(context: RunExecutionContext, payload: Record<string, unknown>): Promise<FrameworkEvent> | 公开方法;参数与返回类型以签名列为准。 |
recordContextBuildStarted | 方法 | recordContextBuildStarted(context: RunExecutionContext): Promise<FrameworkEvent> | 公开方法;参数与返回类型以签名列为准。 |
recordContextCompacted | 方法 | recordContextCompacted(context: RunExecutionContext, payload?: Record<string, unknown>, timestamp?: string): Promise<FrameworkEvent> | 公开方法;参数与返回类型以签名列为准。 |
recordHumanReviewApproved | 方法 | recordHumanReviewApproved(context: RunExecutionContext, payload?: Record<string, unknown>, timestamp?: string): Promise<FrameworkEvent> | 公开方法;参数与返回类型以签名列为准。 |
recordHumanReviewRejected | 方法 | recordHumanReviewRejected(context: RunExecutionContext, payload?: Record<string, unknown>, timestamp?: string): Promise<FrameworkEvent> | 公开方法;参数与返回类型以签名列为准。 |
recordHumanReviewRequested | 方法 | recordHumanReviewRequested(context: RunExecutionContext, payload?: Record<string, unknown>, timestamp?: string): Promise<FrameworkEvent> | 公开方法;参数与返回类型以签名列为准。 |
recordReactContinuationCheckpoint | 方法 | recordReactContinuationCheckpoint(context: RunExecutionContext, checkpoint: ReActContinuationCheckpoint): Promise<FrameworkEvent> | 公开方法;参数与返回类型以签名列为准。 |
recordReactContinuationResumed | 方法 | recordReactContinuationResumed(context: RunExecutionContext, checkpoint: ReActContinuationCheckpoint, resumedAt: string): Promise<FrameworkEvent> | 公开方法;参数与返回类型以签名列为准。 |
recordReactContinuationSuspended | 方法 | recordReactContinuationSuspended(context: RunExecutionContext, result: ReActRunResult): Promise<FrameworkEvent> | 公开方法;参数与返回类型以签名列为准。 |
recordReactStep | 方法 | recordReactStep(context: RunExecutionContext, step: ReActStep): Promise<FrameworkEvent> | 公开方法;参数与返回类型以签名列为准。 |
recordReasoningDecision | 方法 | recordReasoningDecision(context: RunExecutionContext, payload: Record<string, unknown>): Promise<FrameworkEvent> | 公开方法;参数与返回类型以签名列为准。 |
recordSkillCompleted | 方法 | recordSkillCompleted(context: RunExecutionContext, payload: Record<string, unknown>): Promise<FrameworkEvent> | 公开方法;参数与返回类型以签名列为准。 |
recordSkillLoaded | 方法 | recordSkillLoaded(context: RunExecutionContext, payload: Record<string, unknown>): Promise<FrameworkEvent> | 公开方法;参数与返回类型以签名列为准。 |
recordSkillSelected | 方法 | recordSkillSelected(context: RunExecutionContext, payload: Record<string, unknown>): Promise<FrameworkEvent> | 公开方法;参数与返回类型以签名列为准。 |
recordStateEntered | 方法 | recordStateEntered(context: RunExecutionContext, record: FSMStateEnteredRecord): Promise<FrameworkEvent> | 公开方法;参数与返回类型以签名列为准。 |
recordThinkingCompleted | 方法 | recordThinkingCompleted(context: RunExecutionContext, payload: Record<string, unknown>): Promise<FrameworkEvent> | 公开方法;参数与返回类型以签名列为准。 |
recordThinkingStarted | 方法 | recordThinkingStarted(context: RunExecutionContext, payload: Record<string, unknown>): Promise<FrameworkEvent> | 公开方法;参数与返回类型以签名列为准。 |
recordTransitionAccepted | 方法 | recordTransitionAccepted(context: RunExecutionContext, transition: StateTransition): Promise<FrameworkEvent> | 公开方法;参数与返回类型以签名列为准。 |
startRun | 方法 | startRun(run: RuntimeRun, timestamp?: string): Promise<FrameworkEvent> | 公开方法;参数与返回类型以签名列为准。 |
waitForHumanReview | 方法 | waitForHumanReview(context: RunExecutionContext, payload?: Record<string, unknown>, timestamp?: string): Promise<FrameworkEvent> | 公开方法;参数与返回类型以签名列为准。 |
projectAudit
Project Audit 函数,提供 1 个公开调用签名;参数与返回类型见下表。
- 种类: 函数
- 导入:
import { projectAudit } from '@codesoul-co/hypha-harness'; - 源码模块:
runtime
声明
export declare function projectAudit(events: FrameworkEvent[]): AuditProjection;调用签名
projectAudit(events: FrameworkEvent[]): AuditProjection参数
| 参数 | 类型 | 必需 | 说明 |
|---|---|---|---|
events | FrameworkEvent<unknown>[] | 是 | 必需参数;接受的值由类型列定义。 |
返回值
- 类型:
AuditProjection - 说明: 返回值契约由上述类型定义。
projectReplay
Project Replay 函数,提供 1 个公开调用签名;参数与返回类型见下表。
- 种类: 函数
- 导入:
import { projectReplay } from '@codesoul-co/hypha-harness'; - 源码模块:
runtime
声明
export declare function projectReplay(events: FrameworkEvent[]): ReplayProjection;调用签名
projectReplay(events: FrameworkEvent[]): ReplayProjection参数
| 参数 | 类型 | 必需 | 说明 |
|---|---|---|---|
events | FrameworkEvent<unknown>[] | 是 | 必需参数;接受的值由类型列定义。 |
返回值
- 类型:
ReplayProjection - 说明: 返回值契约由上述类型定义。
projectRun
Project Run 函数,提供 1 个公开调用签名;参数与返回类型见下表。
- 种类: 函数
- 导入:
import { projectRun } from '@codesoul-co/hypha-harness'; - 源码模块:
runtime
声明
export declare function projectRun(events: FrameworkEvent[]): RuntimeRun | null;调用签名
projectRun(events: FrameworkEvent[]): RuntimeRun | null参数
| 参数 | 类型 | 必需 | 说明 |
|---|---|---|---|
events | FrameworkEvent<unknown>[] | 是 | 必需参数;接受的值由类型列定义。 |
返回值
- 类型:
RuntimeRun - 说明: 返回值契约由上述类型定义。
projectSession
Project Session 函数,提供 1 个公开调用签名;参数与返回类型见下表。
- 种类: 函数
- 导入:
import { projectSession } from '@codesoul-co/hypha-harness'; - 源码模块:
runtime
声明
export declare function projectSession(events: FrameworkEvent[]): RuntimeSession | null;调用签名
projectSession(events: FrameworkEvent[]): RuntimeSession | null参数
| 参数 | 类型 | 必需 | 说明 |
|---|---|---|---|
events | FrameworkEvent<unknown>[] | 是 | 必需参数;接受的值由类型列定义。 |
返回值
- 类型:
RuntimeSession - 说明: 返回值契约由上述类型定义。
AppendRunEventInput
Append Run Event Input 接口,共包含 11 个公开字段或方法。
- 种类: 接口
- 导入:
import type { AppendRunEventInput } from '@codesoul-co/hypha-harness'; - 源码模块:
runtime
声明
export interface AppendRunEventInput<TPayload = unknown> {
id: string;
type: FrameworkEvent['type'];
runId: string;
sessionId: string;
userId: string;
payload: TPayload;
stepId?: string;
fsmState?: string;
agentId?: string;
timestamp?: string;
metadata?: Record<string, unknown>;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
agentId | 属性 | agentId?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
fsmState | 属性 | fsmState?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
id | 属性 | id: string | 公开属性;类型、只读和可选状态以签名列为准。 |
metadata | 属性 | metadata?: Record<string, unknown> | 公开属性;类型、只读和可选状态以签名列为准。 |
payload | 属性 | payload: TPayload | 公开属性;类型、只读和可选状态以签名列为准。 |
runId | 属性 | runId: string | 公开属性;类型、只读和可选状态以签名列为准。 |
sessionId | 属性 | sessionId: string | 公开属性;类型、只读和可选状态以签名列为准。 |
stepId | 属性 | stepId?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
timestamp | 属性 | timestamp?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
type | 属性 | type: import("/Users/erwin/Downloads/codespace/Hypha/packages/core/dist/events").FrameworkEventType | 公开属性;类型、只读和可选状态以签名列为准。 |
userId | 属性 | userId: string | 公开属性;类型、只读和可选状态以签名列为准。 |
AuditProjection
Audit Projection 接口,共包含 8 个公开字段或方法。
- 种类: 接口
- 导入:
import type { AuditProjection } from '@codesoul-co/hypha-harness'; - 源码模块:
runtime
声明
export interface AuditProjection {
runId: string;
eventCount: number;
policyDecisionCount: number;
memoryWriteCount: number;
reasoningDecisionCount: number;
skillActivationCount: number;
toolCallCount: number;
missingRunIds: string[];
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
eventCount | 属性 | eventCount: number | 公开属性;类型、只读和可选状态以签名列为准。 |
memoryWriteCount | 属性 | memoryWriteCount: number | 公开属性;类型、只读和可选状态以签名列为准。 |
missingRunIds | 属性 | missingRunIds: string[] | 公开属性;类型、只读和可选状态以签名列为准。 |
policyDecisionCount | 属性 | policyDecisionCount: number | 公开属性;类型、只读和可选状态以签名列为准。 |
reasoningDecisionCount | 属性 | reasoningDecisionCount: number | 公开属性;类型、只读和可选状态以签名列为准。 |
runId | 属性 | runId: string | 公开属性;类型、只读和可选状态以签名列为准。 |
skillActivationCount | 属性 | skillActivationCount: number | 公开属性;类型、只读和可选状态以签名列为准。 |
toolCallCount | 属性 | toolCallCount: number | 公开属性;类型、只读和可选状态以签名列为准。 |
CreateRunInput
Create Run Input 接口,共包含 9 个公开字段或方法。
- 种类: 接口
- 导入:
import type { CreateRunInput } from '@codesoul-co/hypha-harness'; - 源码模块:
runtime
声明
export interface CreateRunInput {
id: string;
sessionId: string;
userId: string;
domainPackRef?: SpecRef;
workflowRef?: SpecRef;
agentRef?: SpecRef;
input?: unknown;
metadata?: Record<string, unknown>;
timestamp?: string;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
agentRef | 属性 | agentRef?: SpecRef | 公开属性;类型、只读和可选状态以签名列为准。 |
domainPackRef | 属性 | domainPackRef?: SpecRef | 公开属性;类型、只读和可选状态以签名列为准。 |
id | 属性 | id: string | 公开属性;类型、只读和可选状态以签名列为准。 |
input | 属性 | input?: unknown | 公开属性;类型、只读和可选状态以签名列为准。 |
metadata | 属性 | metadata?: Record<string, unknown> | 公开属性;类型、只读和可选状态以签名列为准。 |
sessionId | 属性 | sessionId: string | 公开属性;类型、只读和可选状态以签名列为准。 |
timestamp | 属性 | timestamp?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
userId | 属性 | userId: string | 公开属性;类型、只读和可选状态以签名列为准。 |
workflowRef | 属性 | workflowRef?: SpecRef | 公开属性;类型、只读和可选状态以签名列为准。 |
CreateSessionInput
Create Session Input 接口,共包含 6 个公开字段或方法。
- 种类: 接口
- 导入:
import type { CreateSessionInput } from '@codesoul-co/hypha-harness'; - 源码模块:
runtime
声明
export interface CreateSessionInput {
id: string;
userId: string;
domainPackRef?: SpecRef;
sessionProfileRef?: SpecRef;
metadata?: Record<string, unknown>;
timestamp?: string;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
domainPackRef | 属性 | domainPackRef?: SpecRef | 公开属性;类型、只读和可选状态以签名列为准。 |
id | 属性 | id: string | 公开属性;类型、只读和可选状态以签名列为准。 |
metadata | 属性 | metadata?: Record<string, unknown> | 公开属性;类型、只读和可选状态以签名列为准。 |
sessionProfileRef | 属性 | sessionProfileRef?: SpecRef | 公开属性;类型、只读和可选状态以签名列为准。 |
timestamp | 属性 | timestamp?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
userId | 属性 | userId: string | 公开属性;类型、只读和可选状态以签名列为准。 |
HarnessedReActFSMRunInput
Harnessed ReAct FSM Run Input 接口,共包含 16 个公开字段或方法。
- 种类: 接口
- 导入:
import type { HarnessedReActFSMRunInput } from '@codesoul-co/hypha-harness'; - 源码模块:
runtime
声明
export interface HarnessedReActFSMRunInput<TInput = unknown> extends ContextBuildInput<TInput> {
sessionId: string;
userId: string;
domainPackRef?: SpecRef;
workflowRef?: SpecRef;
createSession?: boolean;
resumeFromCheckpoint?: boolean;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
agent | 属性 | agent: ReActAgentSpec | 公开属性;类型、只读和可选状态以签名列为准。 |
contextSpec | 属性 | contextSpec?: ContextSpec | 公开属性;类型、只读和可选状态以签名列为准。 |
createSession | 属性 | createSession?: boolean | 公开属性;类型、只读和可选状态以签名列为准。 |
domainPackRef | 属性 | domainPackRef?: SpecRef | 公开属性;类型、只读和可选状态以签名列为准。 |
input | 属性 | input: TInput | 公开属性;类型、只读和可选状态以签名列为准。 |
memoryScope | 属性 | memoryScope?: MemoryScope | 公开属性;类型、只读和可选状态以签名列为准。 |
messages | 属性 | messages?: ModelMessage[] | 公开属性;类型、只读和可选状态以签名列为准。 |
metadata | 属性 | metadata?: Record<string, unknown> | 公开属性;类型、只读和可选状态以签名列为准。 |
resumeFromCheckpoint | 属性 | resumeFromCheckpoint?: boolean | 公开属性;类型、只读和可选状态以签名列为准。 |
runId | 属性 | runId: string | 公开属性;类型、只读和可选状态以签名列为准。 |
sessionId | 属性 | sessionId: string | 公开属性;类型、只读和可选状态以签名列为准。 |
stepId | 属性 | stepId: string | 公开属性;类型、只读和可选状态以签名列为准。 |
toolExecutionScope | 属性 | toolExecutionScope?: ToolExecutionScope | 公开属性;类型、只读和可选状态以签名列为准。 |
toolPrincipal | 属性 | toolPrincipal?: ToolPrincipal | 公开属性;类型、只读和可选状态以签名列为准。 |
userId | 属性 | userId: string | 公开属性;类型、只读和可选状态以签名列为准。 |
workflowRef | 属性 | workflowRef?: SpecRef | 公开属性;类型、只读和可选状态以签名列为准。 |
HarnessedReActFSMRunnerOptions
Harnessed ReAct FSM Runner Options 接口,共包含 22 个公开字段或方法。
- 种类: 接口
- 导入:
import type { HarnessedReActFSMRunnerOptions } from '@codesoul-co/hypha-harness'; - 源码模块:
runtime
声明
export interface HarnessedReActFSMRunnerOptions {
inference: InferenceProvider;
toolRunner?: ToolRunner;
runManager?: RunManager;
fsmSpec?: FSMProcessSpec;
contextBuilder?: ContextBuilder;
skillRegistry?: SkillRegistry;
skillSelector?: SkillSelector;
skillContextLoader?: SkillContextLoader;
skillPolicy?: SkillPolicy;
allowedSkills?: SkillContextBuilderOptions['allowedSkills'];
requiredSkills?: SkillContextBuilderOptions['requiredSkills'];
thinkingPlanner?: ThinkingPlanner;
agenticReasoner?: AgenticReasoner;
reasoningConfig?: ReasoningConfig;
verifier?: Verifier;
reactRuntime?: ReActAgentRuntime;
maxIterations?: number;
executionBudget?: Partial<ReActExecutionBudget>;
reactCheckpointStore?: ReActContinuationCheckpointStore;
continueAfterTool?: boolean;
resolveToolExecutionScope?: (input: {
fsmState: string;
context: BuiltAgentContext;
toolId: string;
}) => ToolExecutionScope | undefined;
now?: () => string;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
agenticReasoner | 属性 | agenticReasoner?: AgenticReasoner | 公开属性;类型、只读和可选状态以签名列为准。 |
allowedSkills | 属性 | allowedSkills?: string[] | ((input: ContextBuildInput, base: BuiltAgentContext) => string[] | undefined | Promise<string[] | undefined>) | 公开属性;类型、只读和可选状态以签名列为准。 |
contextBuilder | 属性 | contextBuilder?: ContextBuilder | 公开属性;类型、只读和可选状态以签名列为准。 |
continueAfterTool | 属性 | continueAfterTool?: boolean | 公开属性;类型、只读和可选状态以签名列为准。 |
executionBudget | 属性 | executionBudget?: Partial<ReActExecutionBudget> | 公开属性;类型、只读和可选状态以签名列为准。 |
fsmSpec | 属性 | fsmSpec?: FSMProcessSpec | 公开属性;类型、只读和可选状态以签名列为准。 |
inference | 属性 | inference: InferenceProvider | 公开属性;类型、只读和可选状态以签名列为准。 |
maxIterations | 属性 | maxIterations?: number | 公开属性;类型、只读和可选状态以签名列为准。 |
now | 方法 | now?(): string | 公开方法;参数与返回类型以签名列为准。 |
reactCheckpointStore | 属性 | reactCheckpointStore?: ReActContinuationCheckpointStore | 公开属性;类型、只读和可选状态以签名列为准。 |
reactRuntime | 属性 | reactRuntime?: ReActAgentRuntime | 公开属性;类型、只读和可选状态以签名列为准。 |
reasoningConfig | 属性 | reasoningConfig?: ReasoningConfig | 公开属性;类型、只读和可选状态以签名列为准。 |
requiredSkills | 属性 | requiredSkills?: string[] | ((input: ContextBuildInput, base: BuiltAgentContext) => string[] | undefined | Promise<string[] | undefined>) | 公开属性;类型、只读和可选状态以签名列为准。 |
resolveToolExecutionScope | 方法 | resolveToolExecutionScope?(input: { fsmState: string; context: BuiltAgentContext; toolId: string; }): ToolExecutionScope | undefined | 公开方法;参数与返回类型以签名列为准。 |
runManager | 属性 | runManager?: RunManager | 公开属性;类型、只读和可选状态以签名列为准。 |
skillContextLoader | 属性 | skillContextLoader?: SkillContextLoader | 公开属性;类型、只读和可选状态以签名列为准。 |
skillPolicy | 属性 | skillPolicy?: SkillPolicy | 公开属性;类型、只读和可选状态以签名列为准。 |
skillRegistry | 属性 | skillRegistry?: SkillRegistry | 公开属性;类型、只读和可选状态以签名列为准。 |
skillSelector | 属性 | skillSelector?: SkillSelector | 公开属性;类型、只读和可选状态以签名列为准。 |
thinkingPlanner | 属性 | thinkingPlanner?: ThinkingPlanner | 公开属性;类型、只读和可选状态以签名列为准。 |
toolRunner | 属性 | toolRunner?: ToolRunner | 公开属性;类型、只读和可选状态以签名列为准。 |
verifier | 属性 | verifier?: Verifier | 公开属性;类型、只读和可选状态以签名列为准。 |
HarnessedReActFSMRunResult
Harnessed ReAct FSM Run Result 接口,共包含 4 个公开字段或方法。
- 种类: 接口
- 导入:
import type { HarnessedReActFSMRunResult } from '@codesoul-co/hypha-harness'; - 源码模块:
runtime
声明
export interface HarnessedReActFSMRunResult {
run: RuntimeRun;
react: ReActRunResult;
fsmSnapshot: ReturnType<FSMRuntime['getSnapshot']>;
events: FrameworkEvent[];
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
events | 属性 | events: FrameworkEvent<unknown>[] | 公开属性;类型、只读和可选状态以签名列为准。 |
fsmSnapshot | 属性 | fsmSnapshot: import("/Users/erwin/Downloads/codespace/Hypha/packages/fsm/dist/index").FSMSnapshot | 公开属性;类型、只读和可选状态以签名列为准。 |
react | 属性 | react: ReActRunResult | 公开属性;类型、只读和可选状态以签名列为准。 |
run | 属性 | run: RuntimeRun | 公开属性;类型、只读和可选状态以签名列为准。 |
RegressionProjection
Regression Projection 接口,共包含 8 个公开字段或方法。
- 种类: 接口
- 导入:
import type { RegressionProjection } from '@codesoul-co/hypha-harness'; - 源码模块:
runtime
声明
export interface RegressionProjection {
runId: string;
eventTypes: string[];
statePath: string[];
toolCalls: Array<{
toolId?: unknown;
status: string;
}>;
memoryWriteCount: number;
reasoningDecisionCount: number;
skillActivationCount: number;
finalOutput?: unknown;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
eventTypes | 属性 | eventTypes: string[] | 公开属性;类型、只读和可选状态以签名列为准。 |
finalOutput | 属性 | finalOutput?: unknown | 公开属性;类型、只读和可选状态以签名列为准。 |
memoryWriteCount | 属性 | memoryWriteCount: number | 公开属性;类型、只读和可选状态以签名列为准。 |
reasoningDecisionCount | 属性 | reasoningDecisionCount: number | 公开属性;类型、只读和可选状态以签名列为准。 |
runId | 属性 | runId: string | 公开属性;类型、只读和可选状态以签名列为准。 |
skillActivationCount | 属性 | skillActivationCount: number | 公开属性;类型、只读和可选状态以签名列为准。 |
statePath | 属性 | statePath: string[] | 公开属性;类型、只读和可选状态以签名列为准。 |
toolCalls | 属性 | toolCalls: { toolId?: unknown; status: string; }[] | 公开属性;类型、只读和可选状态以签名列为准。 |
ReplayProjection
Replay Projection 接口,共包含 16 个公开字段或方法。
- 种类: 接口
- 导入:
import type { ReplayProjection } from '@codesoul-co/hypha-harness'; - 源码模块:
runtime
声明
export interface ReplayProjection {
runId: string;
events: FrameworkEvent[];
statePath: string[];
toolCallEventIds: string[];
policyDecisionEventIds: string[];
memoryEventIds: string[];
reasoningEventIds: string[];
skillEventIds: string[];
modelCalls: FrameworkEvent[];
toolCalls: FrameworkEvent[];
memoryReads: FrameworkEvent[];
memoryWrites: FrameworkEvent[];
reasoningEvents: FrameworkEvent[];
skillEvents: FrameworkEvent[];
policyDecisions: FrameworkEvent[];
finalOutput?: unknown;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
events | 属性 | events: FrameworkEvent<unknown>[] | 公开属性;类型、只读和可选状态以签名列为准。 |
finalOutput | 属性 | finalOutput?: unknown | 公开属性;类型、只读和可选状态以签名列为准。 |
memoryEventIds | 属性 | memoryEventIds: string[] | 公开属性;类型、只读和可选状态以签名列为准。 |
memoryReads | 属性 | memoryReads: FrameworkEvent<unknown>[] | 公开属性;类型、只读和可选状态以签名列为准。 |
memoryWrites | 属性 | memoryWrites: FrameworkEvent<unknown>[] | 公开属性;类型、只读和可选状态以签名列为准。 |
modelCalls | 属性 | modelCalls: FrameworkEvent<unknown>[] | 公开属性;类型、只读和可选状态以签名列为准。 |
policyDecisionEventIds | 属性 | policyDecisionEventIds: string[] | 公开属性;类型、只读和可选状态以签名列为准。 |
policyDecisions | 属性 | policyDecisions: FrameworkEvent<unknown>[] | 公开属性;类型、只读和可选状态以签名列为准。 |
reasoningEventIds | 属性 | reasoningEventIds: string[] | 公开属性;类型、只读和可选状态以签名列为准。 |
reasoningEvents | 属性 | reasoningEvents: FrameworkEvent<unknown>[] | 公开属性;类型、只读和可选状态以签名列为准。 |
runId | 属性 | runId: string | 公开属性;类型、只读和可选状态以签名列为准。 |
skillEventIds | 属性 | skillEventIds: string[] | 公开属性;类型、只读和可选状态以签名列为准。 |
skillEvents | 属性 | skillEvents: FrameworkEvent<unknown>[] | 公开属性;类型、只读和可选状态以签名列为准。 |
statePath | 属性 | statePath: string[] | 公开属性;类型、只读和可选状态以签名列为准。 |
toolCallEventIds | 属性 | toolCallEventIds: string[] | 公开属性;类型、只读和可选状态以签名列为准。 |
toolCalls | 属性 | toolCalls: FrameworkEvent<unknown>[] | 公开属性;类型、只读和可选状态以签名列为准。 |
RunExecutionContext
Run Execution Context 接口,共包含 4 个公开字段或方法。
- 种类: 接口
- 导入:
import type { RunExecutionContext } from '@codesoul-co/hypha-harness'; - 源码模块:
runtime
声明
export interface RunExecutionContext {
runId: string;
sessionId: string;
userId: string;
agentId?: string;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
agentId | 属性 | agentId?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
runId | 属性 | runId: string | 公开属性;类型、只读和可选状态以签名列为准。 |
sessionId | 属性 | sessionId: string | 公开属性;类型、只读和可选状态以签名列为准。 |
userId | 属性 | userId: string | 公开属性;类型、只读和可选状态以签名列为准。 |
RunManagerOptions
Run Manager Options 接口,共包含 2 个公开字段或方法。
- 种类: 接口
- 导入:
import type { RunManagerOptions } from '@codesoul-co/hypha-harness'; - 源码模块:
runtime
声明
export interface RunManagerOptions {
runtime?: EventFirstRuntime;
operationalTelemetry?: RuntimeOperationalTelemetry;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
operationalTelemetry | 属性 | operationalTelemetry?: RuntimeOperationalTelemetry | 公开属性;类型、只读和可选状态以签名列为准。 |
runtime | 属性 | runtime?: EventFirstRuntime | 公开属性;类型、只读和可选状态以签名列为准。 |
RuntimeRun
Runtime Run 接口,共包含 12 个公开字段或方法。
- 种类: 接口
- 导入:
import type { RuntimeRun } from '@codesoul-co/hypha-harness'; - 源码模块:
runtime
声明
export interface RuntimeRun {
id: string;
sessionId: string;
userId: string;
domainPackRef?: SpecRef;
workflowRef?: SpecRef;
agentRef?: SpecRef;
status: 'queued' | 'running' | 'waiting_human' | 'completed' | 'failed' | 'cancelled';
createdAt: string;
updatedAt: string;
completedAt?: string;
input?: unknown;
output?: unknown;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
agentRef | 属性 | agentRef?: SpecRef | 公开属性;类型、只读和可选状态以签名列为准。 |
completedAt | 属性 | completedAt?: string | 公开属性;类型、只读和可选状态以签名列为准。 |
createdAt | 属性 | createdAt: string | 公开属性;类型、只读和可选状态以签名列为准。 |
domainPackRef | 属性 | domainPackRef?: SpecRef | 公开属性;类型、只读和可选状态以签名列为准。 |
id | 属性 | id: string | 公开属性;类型、只读和可选状态以签名列为准。 |
input | 属性 | input?: unknown | 公开属性;类型、只读和可选状态以签名列为准。 |
output | 属性 | output?: unknown | 公开属性;类型、只读和可选状态以签名列为准。 |
sessionId | 属性 | sessionId: string | 公开属性;类型、只读和可选状态以签名列为准。 |
status | 属性 | status: "completed" | "queued" | "running" | "cancelled" | "failed" | "waiting_human" | 公开属性;类型、只读和可选状态以签名列为准。 |
updatedAt | 属性 | updatedAt: string | 公开属性;类型、只读和可选状态以签名列为准。 |
userId | 属性 | userId: string | 公开属性;类型、只读和可选状态以签名列为准。 |
workflowRef | 属性 | workflowRef?: SpecRef | 公开属性;类型、只读和可选状态以签名列为准。 |
RuntimeSession
Runtime Session 接口,共包含 8 个公开字段或方法。
- 种类: 接口
- 导入:
import type { RuntimeSession } from '@codesoul-co/hypha-harness'; - 源码模块:
runtime
声明
export interface RuntimeSession {
id: string;
userId: string;
domainPackRef?: SpecRef;
sessionProfileRef?: SpecRef;
metadata: Record<string, unknown>;
status: 'active' | 'closed';
createdAt: string;
updatedAt: string;
}契约成员
| 成员 | 种类 | 签名 | 说明 |
|---|---|---|---|
createdAt | 属性 | createdAt: string | 公开属性;类型、只读和可选状态以签名列为准。 |
domainPackRef | 属性 | domainPackRef?: SpecRef | 公开属性;类型、只读和可选状态以签名列为准。 |
id | 属性 | id: string | 公开属性;类型、只读和可选状态以签名列为准。 |
metadata | 属性 | metadata: Record<string, unknown> | 公开属性;类型、只读和可选状态以签名列为准。 |
sessionProfileRef | 属性 | sessionProfileRef?: SpecRef | 公开属性;类型、只读和可选状态以签名列为准。 |
status | 属性 | status: "active" | "closed" | 公开属性;类型、只读和可选状态以签名列为准。 |
updatedAt | 属性 | updatedAt: string | 公开属性;类型、只读和可选状态以签名列为准。 |
userId | 属性 | userId: string | 公开属性;类型、只读和可选状态以签名列为准。 |
