Skip to content

@codesoul-co/hypha-harness / long-horizon-react-supervisor

模块用法

用于使用该功能边界的公共契约与操作。Long horizon react supervisor 模块公开 2 类、1 函数、11 接口、1 类型。

从包入口导入

ts
import {
  LongHorizonReActSupervisor,
  ServerIngressReActContinuationScheduler,
  reActContinuationIdempotencyKey,
} from '@codesoul-co/hypha-harness';

import type {
  CoordinateReActQuantumResultInput,
  EnqueueReActContinuationCommandRequest,
  LongHorizonReActQuantumInput,
  LongHorizonReActQuantumResult,
  LongHorizonReActSupervisorOptions,
  ReActContinuationCommandIngress,
  ReActContinuationIntent,
  ReActContinuationScheduler,
} from '@codesoul-co/hypha-harness';

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

使用要点

  • 12 个类型/接口用于应用代码、Adapter 或测试中的静态契约;请使用 import type,运行时不应依赖它们。
  • 2 个类提供可实例化的运行时实现;构造参数与公开方法在各自条目中完整列出。
  • 1 个函数是该模块的直接操作入口;每个 overload 的必需/可选参数与返回类型均在下方列出。

公共导出

Symbol种类签名说明
LongHorizonReActSupervisornew LongHorizonReActSupervisor(options: LongHorizonReActSupervisorOptions): LongHorizonReActSupervisorExecutes exactly one bounded ReAct quantum. It never hides an unbounded loop. A retryable quantum boundary is handed to a durable scheduler; global budget, deadline, and non-progress boundaries require an explicit operator/workflow decision.
ServerIngressReActContinuationSchedulernew ServerIngressReActContinuationScheduler(options: ServerIngressReActContinuationSchedulerOptions): ServerIngressReActContinuationSchedulerSends a complete continuation envelope through the Server command ingress. The ingress owns payload persistence and Queue reference/hash generation.
reActContinuationIdempotencyKey函数reActContinuationIdempotencyKey(input: ContinueReActCommandPayloadV1): stringRe Act Continuation Idempotency Key 函数,提供 1 个公开调用签名;参数与返回类型见下表。
CoordinateReActQuantumResultInput接口interface CoordinateReActQuantumResultInputCoordinate ReAct Quantum Result Input 接口,共包含 2 个公开字段或方法。
EnqueueReActContinuationCommandRequest接口interface EnqueueReActContinuationCommandRequestEnqueue ReAct Continuation Command Request 接口,共包含 13 个公开字段或方法。
LongHorizonReActQuantumInput接口interface LongHorizonReActQuantumInputLong Horizon ReAct Quantum Input 接口,共包含 3 个公开字段或方法。
LongHorizonReActQuantumResult接口interface LongHorizonReActQuantumResultLong Horizon ReAct Quantum Result 接口,共包含 4 个公开字段或方法。
LongHorizonReActSupervisorOptions接口interface LongHorizonReActSupervisorOptionsLong Horizon ReAct Supervisor Options 接口,共包含 3 个公开字段或方法。
ReActContinuationCommandIngress接口interface ReActContinuationCommandIngressReAct Continuation Command Ingress 接口,共包含 1 个公开字段或方法。
ReActContinuationIntent接口interface ReActContinuationIntentReAct Continuation Intent 接口,共包含 6 个公开字段或方法。
ReActContinuationScheduler接口interface ReActContinuationSchedulerReAct Continuation Scheduler 接口,共包含 1 个公开字段或方法。
ReActContinuationScheduleRequest接口interface ReActContinuationScheduleRequestReAct Continuation Schedule Request 接口,共包含 7 个公开字段或方法。
ReActContinuationScheduleResult接口interface ReActContinuationScheduleResultReAct Continuation Schedule Result 接口,共包含 2 个公开字段或方法。
ServerIngressReActContinuationSchedulerOptions接口interface ServerIngressReActContinuationSchedulerOptionsServer Ingress ReAct Continuation Scheduler Options 接口,共包含 2 个公开字段或方法。
LongHorizonReActDisposition类型type LongHorizonReActDisposition = 'completed' | 'continuation_scheduled' | 'continuation_required' | 'waiting_human' | 'cancelled' | 'failed'Long Horizon ReAct Disposition 公共类型别名;完整类型表达式见声明。

LongHorizonReActSupervisor

Executes exactly one bounded ReAct quantum. It never hides an unbounded loop. A retryable quantum boundary is handed to a durable scheduler; global budget, deadline, and non-progress boundaries require an explicit operator/workflow decision.

声明

text
export declare class LongHorizonReActSupervisor {
    constructor(options: LongHorizonReActSupervisorOptions);
    runQuantum(input: LongHorizonReActQuantumInput): Promise<LongHorizonReActQuantumResult>;
    coordinateResult(input: CoordinateReActQuantumResultInput): Promise<LongHorizonReActQuantumResult>;
}

公开成员

成员种类签名说明
constructor构造函数(options: LongHorizonReActSupervisorOptions): LongHorizonReActSupervisor创建该类的实例。
coordinateResult方法coordinateResult(input: CoordinateReActQuantumResultInput): Promise<LongHorizonReActQuantumResult>公开方法;参数与返回类型以签名列为准。
runQuantum方法runQuantum(input: LongHorizonReActQuantumInput): Promise<LongHorizonReActQuantumResult>公开方法;参数与返回类型以签名列为准。

ServerIngressReActContinuationScheduler

Sends a complete continuation envelope through the Server command ingress. The ingress owns payload persistence and Queue reference/hash generation.

  • 种类: 类
  • 导入: import { ServerIngressReActContinuationScheduler } from '@codesoul-co/hypha-harness';
  • 源码模块: long-horizon-react-supervisor

声明

text
export declare class ServerIngressReActContinuationScheduler implements ReActContinuationScheduler {
    constructor(options: ServerIngressReActContinuationSchedulerOptions);
    schedule(input: ReActContinuationScheduleRequest): Promise<ReActContinuationScheduleResult>;
}

公开成员

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

reActContinuationIdempotencyKey

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

声明

text
export declare function reActContinuationIdempotencyKey(input: ContinueReActCommandPayloadV1): string;

调用签名

text
reActContinuationIdempotencyKey(input: ContinueReActCommandPayloadV1): string

参数

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

返回值

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

CoordinateReActQuantumResultInput

Coordinate ReAct Quantum Result Input 接口,共包含 2 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { CoordinateReActQuantumResultInput } from '@codesoul-co/hypha-harness';
  • 源码模块: long-horizon-react-supervisor

声明

text
export interface CoordinateReActQuantumResultInput {
    react: ReActRunResult;
    continuation?: ReActContinuationIntent;
}

契约成员

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

EnqueueReActContinuationCommandRequest

Enqueue ReAct Continuation Command Request 接口,共包含 13 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { EnqueueReActContinuationCommandRequest } from '@codesoul-co/hypha-harness';
  • 源码模块: long-horizon-react-supervisor

声明

text
export interface EnqueueReActContinuationCommandRequest {
    id: string;
    commandType: 'continue_react';
    idempotencyKey: string;
    tenantId?: string;
    userId: string;
    workspaceId?: string;
    sessionId: string;
    targetRunId: string;
    priority?: number;
    maxAttempts?: number;
    payload: ContinueReActCommandPayloadV1;
    createdAt: string;
    availableAt: string;
}

契约成员

成员种类签名说明
availableAt属性availableAt: string公开属性;类型、只读和可选状态以签名列为准。
commandType属性commandType: "continue_react"公开属性;类型、只读和可选状态以签名列为准。
createdAt属性createdAt: string公开属性;类型、只读和可选状态以签名列为准。
id属性id: string公开属性;类型、只读和可选状态以签名列为准。
idempotencyKey属性idempotencyKey: string公开属性;类型、只读和可选状态以签名列为准。
maxAttempts属性maxAttempts?: number公开属性;类型、只读和可选状态以签名列为准。
payload属性payload: ContinueReActCommandPayloadV1公开属性;类型、只读和可选状态以签名列为准。
priority属性priority?: number公开属性;类型、只读和可选状态以签名列为准。
sessionId属性sessionId: string公开属性;类型、只读和可选状态以签名列为准。
targetRunId属性targetRunId: string公开属性;类型、只读和可选状态以签名列为准。
tenantId属性tenantId?: string公开属性;类型、只读和可选状态以签名列为准。
userId属性userId: string公开属性;类型、只读和可选状态以签名列为准。
workspaceId属性workspaceId?: string公开属性;类型、只读和可选状态以签名列为准。

LongHorizonReActQuantumInput

Long Horizon ReAct Quantum Input 接口,共包含 3 个公开字段或方法。

声明

text
export interface LongHorizonReActQuantumInput {
    context: ReActRunContext;
    control?: ReActRunControl;
    continuation?: ReActContinuationIntent;
}

契约成员

成员种类签名说明
context属性context: ReActRunContext公开属性;类型、只读和可选状态以签名列为准。
continuation属性continuation?: ReActContinuationIntent公开属性;类型、只读和可选状态以签名列为准。
control属性control?: ReActRunControl公开属性;类型、只读和可选状态以签名列为准。

LongHorizonReActQuantumResult

Long Horizon ReAct Quantum Result 接口,共包含 4 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { LongHorizonReActQuantumResult } from '@codesoul-co/hypha-harness';
  • 源码模块: long-horizon-react-supervisor

声明

text
export interface LongHorizonReActQuantumResult {
    disposition: LongHorizonReActDisposition;
    react: ReActRunResult;
    scheduledTaskId?: string;
    scheduleReused?: boolean;
}

契约成员

成员种类签名说明
disposition属性disposition: LongHorizonReActDisposition公开属性;类型、只读和可选状态以签名列为准。
react属性react: ReActRunResult公开属性;类型、只读和可选状态以签名列为准。
scheduledTaskId属性scheduledTaskId?: string公开属性;类型、只读和可选状态以签名列为准。
scheduleReused属性scheduleReused?: boolean公开属性;类型、只读和可选状态以签名列为准。

LongHorizonReActSupervisorOptions

Long Horizon ReAct Supervisor Options 接口,共包含 3 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { LongHorizonReActSupervisorOptions } from '@codesoul-co/hypha-harness';
  • 源码模块: long-horizon-react-supervisor

声明

text
export interface LongHorizonReActSupervisorOptions {
    runner: Pick<ReActRunner, 'run'>;
    scheduler?: ReActContinuationScheduler;
    now?: () => string;
}

契约成员

成员种类签名说明
now方法now?(): string公开方法;参数与返回类型以签名列为准。
runner属性runner: Pick<ReActRunner, "run">公开属性;类型、只读和可选状态以签名列为准。
scheduler属性scheduler?: ReActContinuationScheduler公开属性;类型、只读和可选状态以签名列为准。

ReActContinuationCommandIngress

ReAct Continuation Command Ingress 接口,共包含 1 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { ReActContinuationCommandIngress } from '@codesoul-co/hypha-harness';
  • 源码模块: long-horizon-react-supervisor

声明

text
export interface ReActContinuationCommandIngress {
    enqueue(request: EnqueueReActContinuationCommandRequest): Promise<Pick<SessionCommandRecord, 'id' | 'status'>>;
}

契约成员

成员种类签名说明
enqueue方法enqueue(request: EnqueueReActContinuationCommandRequest): Promise<Pick<SessionCommandRecord, "id" | "status">>公开方法;参数与返回类型以签名列为准。

ReActContinuationIntent

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

声明

text
export interface ReActContinuationIntent {
    tenantId?: string;
    workspaceId?: string;
    availableAt?: string;
    priority?: number;
    maxAttempts?: number;
    buildPayload(checkpoint: Readonly<ReActContinuationCheckpoint>): ContinueReActCommandPayloadV1 | Promise<ContinueReActCommandPayloadV1>;
}

契约成员

成员种类签名说明
availableAt属性availableAt?: string公开属性;类型、只读和可选状态以签名列为准。
buildPayload方法buildPayload(checkpoint: Readonly<ReActContinuationCheckpoint>): ContinueReActCommandPayloadV1 | Promise<ContinueReActCommandPayloadV1>公开方法;参数与返回类型以签名列为准。
maxAttempts属性maxAttempts?: number公开属性;类型、只读和可选状态以签名列为准。
priority属性priority?: number公开属性;类型、只读和可选状态以签名列为准。
tenantId属性tenantId?: string公开属性;类型、只读和可选状态以签名列为准。
workspaceId属性workspaceId?: string公开属性;类型、只读和可选状态以签名列为准。

ReActContinuationScheduler

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

声明

text
export interface ReActContinuationScheduler {
    schedule(request: ReActContinuationScheduleRequest): Promise<ReActContinuationScheduleResult>;
}

契约成员

成员种类签名说明
schedule方法schedule(request: ReActContinuationScheduleRequest): Promise<ReActContinuationScheduleResult>公开方法;参数与返回类型以签名列为准。

ReActContinuationScheduleRequest

ReAct Continuation Schedule Request 接口,共包含 7 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { ReActContinuationScheduleRequest } from '@codesoul-co/hypha-harness';
  • 源码模块: long-horizon-react-supervisor

声明

text
export interface ReActContinuationScheduleRequest {
    version: '1.0.0';
    tenantId?: string;
    workspaceId?: string;
    payload: ContinueReActCommandPayloadV1;
    availableAt: string;
    priority?: number;
    maxAttempts?: number;
}

契约成员

成员种类签名说明
availableAt属性availableAt: string公开属性;类型、只读和可选状态以签名列为准。
maxAttempts属性maxAttempts?: number公开属性;类型、只读和可选状态以签名列为准。
payload属性payload: ContinueReActCommandPayloadV1公开属性;类型、只读和可选状态以签名列为准。
priority属性priority?: number公开属性;类型、只读和可选状态以签名列为准。
tenantId属性tenantId?: string公开属性;类型、只读和可选状态以签名列为准。
version属性version: "1.0.0"公开属性;类型、只读和可选状态以签名列为准。
workspaceId属性workspaceId?: string公开属性;类型、只读和可选状态以签名列为准。

ReActContinuationScheduleResult

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

  • 种类: 接口
  • 导入: import type { ReActContinuationScheduleResult } from '@codesoul-co/hypha-harness';
  • 源码模块: long-horizon-react-supervisor

声明

text
export interface ReActContinuationScheduleResult {
    taskId: string;
    reused: boolean;
}

契约成员

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

ServerIngressReActContinuationSchedulerOptions

Server Ingress ReAct Continuation Scheduler Options 接口,共包含 2 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { ServerIngressReActContinuationSchedulerOptions } from '@codesoul-co/hypha-harness';
  • 源码模块: long-horizon-react-supervisor

声明

text
export interface ServerIngressReActContinuationSchedulerOptions {
    ingress: ReActContinuationCommandIngress;
    now?: () => string;
}

契约成员

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

LongHorizonReActDisposition

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

声明

text
export type LongHorizonReActDisposition = 'completed' | 'continuation_scheduled' | 'continuation_required' | 'waiting_human' | 'cancelled' | 'failed';