Skip to content

@codesoul-co/hypha-core / contracts/react-continuation

模块用法

用于声明并运行时校验契约。React continuation 模块公开 2 常量、5 接口、2 类型。

从包入口导入

ts
import {
  CONTINUE_REACT_COMMAND_PAYLOAD_VERSION,
  REACT_QUANTUM_DESCRIPTOR_VERSION,
} from '@codesoul-co/hypha-core';

import type {
  ContinuationReActQuantumDescriptor,
  ContinueReActCommandPayloadV1,
  InitialReActQuantumDescriptor,
  ReActGlobalBudget,
  ReActQuantumDescriptorBase,
  ContinueReActCommandPayload,
  ReActQuantumDescriptor,
} from '@codesoul-co/hypha-core';

使用要点

  • 7 个类型/接口用于应用代码、Adapter 或测试中的静态契约;请使用 import type,运行时不应依赖它们。
  • 2 个常量/枚举提供稳定值、Schema、Definition 或默认配置;应复用这些导出,避免在应用中复制内部值。

公共导出

Symbol种类签名说明
CONTINUE_REACT_COMMAND_PAYLOAD_VERSION常量const CONTINUE_REACT_COMMAND_PAYLOAD_VERSION: "1.0.0"contracts/react-continuation 模块导出的 CONTINUE REACT COMMAND PAYLOAD VERSION 常量。
REACT_QUANTUM_DESCRIPTOR_VERSION常量const REACT_QUANTUM_DESCRIPTOR_VERSION: "1.0.0"contracts/react-continuation 模块导出的 REACT QUANTUM DESCRIPTOR VERSION 常量。
ContinuationReActQuantumDescriptor接口interface ContinuationReActQuantumDescriptor extends ReActQuantumDescriptorBaseContinuation ReAct Quantum Descriptor 接口,共包含 29 个公开字段或方法。
ContinueReActCommandPayloadV1接口interface ContinueReActCommandPayloadV1Continue ReAct Command Payload V1 接口,共包含 24 个公开字段或方法。
InitialReActQuantumDescriptor接口interface InitialReActQuantumDescriptor extends ReActQuantumDescriptorBaseInitial ReAct Quantum Descriptor 接口,共包含 22 个公开字段或方法。
ReActGlobalBudget接口interface ReActGlobalBudgetReAct Global Budget 接口,共包含 4 个公开字段或方法。
ReActQuantumDescriptorBase接口interface ReActQuantumDescriptorBaseReAct Quantum Descriptor Base 接口,共包含 21 个公开字段或方法。
ContinueReActCommandPayload类型type ContinueReActCommandPayload = ContinueReActCommandPayloadV1Continue ReAct Command Payload 公共类型别名;完整类型表达式见声明。
ReActQuantumDescriptor类型type ReActQuantumDescriptor = InitialReActQuantumDescriptor | ContinuationReActQuantumDescriptorReAct Quantum Descriptor 公共类型别名;完整类型表达式见声明。

CONTINUE_REACT_COMMAND_PAYLOAD_VERSION

contracts/react-continuation 模块导出的 CONTINUE REACT COMMAND PAYLOAD VERSION 常量。

  • 种类: 常量
  • 导入: import { CONTINUE_REACT_COMMAND_PAYLOAD_VERSION } from '@codesoul-co/hypha-core';
  • 源码模块: contracts/react-continuation

声明

text
export declare const CONTINUE_REACT_COMMAND_PAYLOAD_VERSION: "1.0.0";

REACT_QUANTUM_DESCRIPTOR_VERSION

contracts/react-continuation 模块导出的 REACT QUANTUM DESCRIPTOR VERSION 常量。

声明

text
export declare const REACT_QUANTUM_DESCRIPTOR_VERSION: "1.0.0";

ContinuationReActQuantumDescriptor

Continuation ReAct Quantum Descriptor 接口,共包含 29 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { ContinuationReActQuantumDescriptor } from '@codesoul-co/hypha-core';
  • 源码模块: contracts/react-continuation

声明

text
export interface ContinuationReActQuantumDescriptor extends ReActQuantumDescriptorBase {
    trigger: 'continuation';
    commandId: string;
    commandPayloadHash: string;
    claimToken: string;
    leaseEpoch: number;
    checkpointRef: string;
    checkpointHash: string;
    checkpointSequence: number;
}

契约成员

成员种类签名说明
agentRef属性agentRef: SpecRef公开属性;类型、只读和可选状态以签名列为准。
cancellationRevision属性cancellationRevision: number公开属性;类型、只读和可选状态以签名列为准。
capabilitySnapshotHash属性capabilitySnapshotHash: string公开属性;类型、只读和可选状态以签名列为准。
capabilitySnapshotRef属性capabilitySnapshotRef: string公开属性;类型、只读和可选状态以签名列为准。
checkpointHash属性checkpointHash: string公开属性;类型、只读和可选状态以签名列为准。
checkpointRef属性checkpointRef: string公开属性;类型、只读和可选状态以签名列为准。
checkpointSequence属性checkpointSequence: number公开属性;类型、只读和可选状态以签名列为准。
claimToken属性claimToken: string公开属性;类型、只读和可选状态以签名列为准。
commandId属性commandId: string公开属性;类型、只读和可选状态以签名列为准。
commandPayloadHash属性commandPayloadHash: string公开属性;类型、只读和可选状态以签名列为准。
createdAt属性createdAt: string公开属性;类型、只读和可选状态以签名列为准。
deadlineAt属性deadlineAt?: string公开属性;类型、只读和可选状态以签名列为准。
domainPackRef属性domainPackRef: SpecRef公开属性;类型、只读和可选状态以签名列为准。
executionRef属性executionRef?: string公开属性;类型、只读和可选状态以签名列为准。
globalBudget属性globalBudget: ReActGlobalBudget公开属性;类型、只读和可选状态以签名列为准。
leaseEpoch属性leaseEpoch: number公开属性;类型、只读和可选状态以签名列为准。
memoryContextRef属性memoryContextRef?: string公开属性;类型、只读和可选状态以签名列为准。
pendingOperationReceipts属性pendingOperationReceipts?: string[]公开属性;类型、只读和可选状态以签名列为准。
promptSnapshotHash属性promptSnapshotHash: string公开属性;类型、只读和可选状态以签名列为准。
promptSnapshotRef属性promptSnapshotRef: string公开属性;类型、只读和可选状态以签名列为准。
runId属性runId: string公开属性;类型、只读和可选状态以签名列为准。
scopeHash属性scopeHash: string公开属性;类型、只读和可选状态以签名列为准。
sessionId属性sessionId: string公开属性;类型、只读和可选状态以签名列为准。
stepId属性stepId: string公开属性;类型、只读和可选状态以签名列为准。
trigger属性trigger: "continuation"公开属性;类型、只读和可选状态以签名列为准。
userId属性userId: string公开属性;类型、只读和可选状态以签名列为准。
version属性version: "1.0.0"公开属性;类型、只读和可选状态以签名列为准。
workflowRef属性workflowRef?: SpecRef公开属性;类型、只读和可选状态以签名列为准。
workspaceRef属性workspaceRef?: string公开属性;类型、只读和可选状态以签名列为准。

ContinueReActCommandPayloadV1

Continue ReAct Command Payload V1 接口,共包含 24 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { ContinueReActCommandPayloadV1 } from '@codesoul-co/hypha-core';
  • 源码模块: contracts/react-continuation

声明

text
export interface ContinueReActCommandPayloadV1 {
    version: typeof CONTINUE_REACT_COMMAND_PAYLOAD_VERSION;
    runId: string;
    sessionId: string;
    userId: string;
    stepId: string;
    checkpointRef: string;
    checkpointHash: string;
    checkpointSequence: number;
    scopeHash: string;
    agentRef: SpecRef;
    domainPackRef: SpecRef;
    workflowRef?: SpecRef;
    promptSnapshotRef: string;
    promptSnapshotHash: string;
    capabilitySnapshotRef: string;
    capabilitySnapshotHash: string;
    memoryContextRef?: string;
    workspaceRef?: string;
    executionRef?: string;
    pendingOperationReceipts?: string[];
    globalBudget: ReActGlobalBudget;
    deadlineAt?: string;
    cancellationRevision: number;
    createdAt: string;
}

契约成员

成员种类签名说明
agentRef属性agentRef: SpecRef公开属性;类型、只读和可选状态以签名列为准。
cancellationRevision属性cancellationRevision: number公开属性;类型、只读和可选状态以签名列为准。
capabilitySnapshotHash属性capabilitySnapshotHash: string公开属性;类型、只读和可选状态以签名列为准。
capabilitySnapshotRef属性capabilitySnapshotRef: string公开属性;类型、只读和可选状态以签名列为准。
checkpointHash属性checkpointHash: string公开属性;类型、只读和可选状态以签名列为准。
checkpointRef属性checkpointRef: string公开属性;类型、只读和可选状态以签名列为准。
checkpointSequence属性checkpointSequence: number公开属性;类型、只读和可选状态以签名列为准。
createdAt属性createdAt: string公开属性;类型、只读和可选状态以签名列为准。
deadlineAt属性deadlineAt?: string公开属性;类型、只读和可选状态以签名列为准。
domainPackRef属性domainPackRef: SpecRef公开属性;类型、只读和可选状态以签名列为准。
executionRef属性executionRef?: string公开属性;类型、只读和可选状态以签名列为准。
globalBudget属性globalBudget: ReActGlobalBudget公开属性;类型、只读和可选状态以签名列为准。
memoryContextRef属性memoryContextRef?: string公开属性;类型、只读和可选状态以签名列为准。
pendingOperationReceipts属性pendingOperationReceipts?: string[]公开属性;类型、只读和可选状态以签名列为准。
promptSnapshotHash属性promptSnapshotHash: string公开属性;类型、只读和可选状态以签名列为准。
promptSnapshotRef属性promptSnapshotRef: string公开属性;类型、只读和可选状态以签名列为准。
runId属性runId: string公开属性;类型、只读和可选状态以签名列为准。
scopeHash属性scopeHash: string公开属性;类型、只读和可选状态以签名列为准。
sessionId属性sessionId: string公开属性;类型、只读和可选状态以签名列为准。
stepId属性stepId: string公开属性;类型、只读和可选状态以签名列为准。
userId属性userId: string公开属性;类型、只读和可选状态以签名列为准。
version属性version: "1.0.0"公开属性;类型、只读和可选状态以签名列为准。
workflowRef属性workflowRef?: SpecRef公开属性;类型、只读和可选状态以签名列为准。
workspaceRef属性workspaceRef?: string公开属性;类型、只读和可选状态以签名列为准。

InitialReActQuantumDescriptor

Initial ReAct Quantum Descriptor 接口,共包含 22 个公开字段或方法。

  • 种类: 接口
  • 导入: import type { InitialReActQuantumDescriptor } from '@codesoul-co/hypha-core';
  • 源码模块: contracts/react-continuation

声明

text
export interface InitialReActQuantumDescriptor extends ReActQuantumDescriptorBase {
    trigger: 'initial';
}

契约成员

成员种类签名说明
agentRef属性agentRef: SpecRef公开属性;类型、只读和可选状态以签名列为准。
cancellationRevision属性cancellationRevision: number公开属性;类型、只读和可选状态以签名列为准。
capabilitySnapshotHash属性capabilitySnapshotHash: string公开属性;类型、只读和可选状态以签名列为准。
capabilitySnapshotRef属性capabilitySnapshotRef: string公开属性;类型、只读和可选状态以签名列为准。
createdAt属性createdAt: string公开属性;类型、只读和可选状态以签名列为准。
deadlineAt属性deadlineAt?: string公开属性;类型、只读和可选状态以签名列为准。
domainPackRef属性domainPackRef: SpecRef公开属性;类型、只读和可选状态以签名列为准。
executionRef属性executionRef?: string公开属性;类型、只读和可选状态以签名列为准。
globalBudget属性globalBudget: ReActGlobalBudget公开属性;类型、只读和可选状态以签名列为准。
memoryContextRef属性memoryContextRef?: string公开属性;类型、只读和可选状态以签名列为准。
pendingOperationReceipts属性pendingOperationReceipts?: string[]公开属性;类型、只读和可选状态以签名列为准。
promptSnapshotHash属性promptSnapshotHash: string公开属性;类型、只读和可选状态以签名列为准。
promptSnapshotRef属性promptSnapshotRef: string公开属性;类型、只读和可选状态以签名列为准。
runId属性runId: string公开属性;类型、只读和可选状态以签名列为准。
scopeHash属性scopeHash: string公开属性;类型、只读和可选状态以签名列为准。
sessionId属性sessionId: string公开属性;类型、只读和可选状态以签名列为准。
stepId属性stepId: string公开属性;类型、只读和可选状态以签名列为准。
trigger属性trigger: "initial"公开属性;类型、只读和可选状态以签名列为准。
userId属性userId: string公开属性;类型、只读和可选状态以签名列为准。
version属性version: "1.0.0"公开属性;类型、只读和可选状态以签名列为准。
workflowRef属性workflowRef?: SpecRef公开属性;类型、只读和可选状态以签名列为准。
workspaceRef属性workspaceRef?: string公开属性;类型、只读和可选状态以签名列为准。

ReActGlobalBudget

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

声明

text
export interface ReActGlobalBudget {
    iterations: number;
    modelCalls: number;
    toolCalls: number;
    totalTokens: number;
}

契约成员

成员种类签名说明
iterations属性iterations: number公开属性;类型、只读和可选状态以签名列为准。
modelCalls属性modelCalls: number公开属性;类型、只读和可选状态以签名列为准。
toolCalls属性toolCalls: number公开属性;类型、只读和可选状态以签名列为准。
totalTokens属性totalTokens: number公开属性;类型、只读和可选状态以签名列为准。

ReActQuantumDescriptorBase

ReAct Quantum Descriptor Base 接口,共包含 21 个公开字段或方法。

声明

text
export interface ReActQuantumDescriptorBase {
    version: typeof REACT_QUANTUM_DESCRIPTOR_VERSION;
    runId: string;
    sessionId: string;
    userId: string;
    stepId: string;
    scopeHash: string;
    agentRef: SpecRef;
    domainPackRef: SpecRef;
    workflowRef?: SpecRef;
    promptSnapshotRef: string;
    promptSnapshotHash: string;
    capabilitySnapshotRef: string;
    capabilitySnapshotHash: string;
    memoryContextRef?: string;
    workspaceRef?: string;
    executionRef?: string;
    pendingOperationReceipts?: string[];
    globalBudget: ReActGlobalBudget;
    deadlineAt?: string;
    cancellationRevision: number;
    createdAt: string;
}

契约成员

成员种类签名说明
agentRef属性agentRef: SpecRef公开属性;类型、只读和可选状态以签名列为准。
cancellationRevision属性cancellationRevision: number公开属性;类型、只读和可选状态以签名列为准。
capabilitySnapshotHash属性capabilitySnapshotHash: string公开属性;类型、只读和可选状态以签名列为准。
capabilitySnapshotRef属性capabilitySnapshotRef: string公开属性;类型、只读和可选状态以签名列为准。
createdAt属性createdAt: string公开属性;类型、只读和可选状态以签名列为准。
deadlineAt属性deadlineAt?: string公开属性;类型、只读和可选状态以签名列为准。
domainPackRef属性domainPackRef: SpecRef公开属性;类型、只读和可选状态以签名列为准。
executionRef属性executionRef?: string公开属性;类型、只读和可选状态以签名列为准。
globalBudget属性globalBudget: ReActGlobalBudget公开属性;类型、只读和可选状态以签名列为准。
memoryContextRef属性memoryContextRef?: string公开属性;类型、只读和可选状态以签名列为准。
pendingOperationReceipts属性pendingOperationReceipts?: string[]公开属性;类型、只读和可选状态以签名列为准。
promptSnapshotHash属性promptSnapshotHash: string公开属性;类型、只读和可选状态以签名列为准。
promptSnapshotRef属性promptSnapshotRef: string公开属性;类型、只读和可选状态以签名列为准。
runId属性runId: string公开属性;类型、只读和可选状态以签名列为准。
scopeHash属性scopeHash: string公开属性;类型、只读和可选状态以签名列为准。
sessionId属性sessionId: string公开属性;类型、只读和可选状态以签名列为准。
stepId属性stepId: string公开属性;类型、只读和可选状态以签名列为准。
userId属性userId: string公开属性;类型、只读和可选状态以签名列为准。
version属性version: "1.0.0"公开属性;类型、只读和可选状态以签名列为准。
workflowRef属性workflowRef?: SpecRef公开属性;类型、只读和可选状态以签名列为准。
workspaceRef属性workspaceRef?: string公开属性;类型、只读和可选状态以签名列为准。

ContinueReActCommandPayload

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

声明

text
export type ContinueReActCommandPayload = ContinueReActCommandPayloadV1;

ReActQuantumDescriptor

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

声明

text
export type ReActQuantumDescriptor = InitialReActQuantumDescriptor | ContinuationReActQuantumDescriptor;