Skip to content

@codesoul-co/hypha-core / schemas

模块用法

用于声明并运行时校验契约。Schemas 模块公开 52 常量、12 函数、1 接口。

从包入口导入

ts
import {
  auditPolicySpecSchema,
  contextSourceSpecJsonSchema,
  contextSourceSpecSchema,
  contextSpecDefinition,
  contextSpecExample,
  contextSpecJsonSchema,
  contextSpecSchema,
  coreSpecDefinitions,
} from '@codesoul-co/hypha-core';

import type {
  SpecSchemaDefinition,
} from '@codesoul-co/hypha-core';

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

使用要点

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

运行时校验示例

ts
import { auditPolicySpecSchema } from '@codesoul-co/hypha-core';

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

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

公共导出

Symbol种类签名说明
auditPolicySpecSchema常量const auditPolicySpecSchema: z.ZodObject<{ enabled: z.ZodBoolean; includeInput: z.ZodOptional<z.ZodBoolean>; includeOutput: z.ZodOptional<z.ZodBoolean>; redactPaths: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, "strip", z.ZodTypeAny, { enabled: boolean; includeInput?: boolean | undefined; includeOutput?: boolean | undefined; redactPaths?: string[] | undefined; }, { enabled: boolean; includeInput?: boolean | ...Audit Policy Spec 的运行时 Schema。
contextSourceSpecJsonSchema常量const contextSourceSpecJsonSchema: JsonSchemaContext Source Spec 的 JSON Schema。
contextSourceSpecSchema常量const contextSourceSpecSchema: z.ZodObject<{ id: z.ZodString; version: z.ZodString; } & { name: z.ZodOptional<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>; } & { type: z.ZodEnum<["memory", "artifact", "skill", "domain", "mcp", "user_input", ...Context Source Spec 的运行时 Schema。
contextSpecDefinition常量const contextSpecDefinition: SpecSchemaDefinition<ContextSpec>Context Spec 的运行时校验入口,组合 Parser、Example 与 JSON Schema。
contextSpecExample常量const contextSpecExample: ContextSpecContext Spec 的有效示例值。
contextSpecJsonSchema常量const contextSpecJsonSchema: JsonSchemaContext Spec 的 JSON Schema。
contextSpecSchema常量const contextSpecSchema: z.ZodObject<{ id: z.ZodString; version: z.ZodString; } & { name: z.ZodOptional<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>; } & { sources: z.ZodArray<z.ZodObject<{ id: z.ZodString; version: z.ZodString; } & { name: ...Context Spec 的运行时 Schema。
coreSpecDefinitions常量const coreSpecDefinitions: readonly [SpecSchemaDefinition<PolicySpec>, SpecSchemaDefinition<OutputContractSpec>, SpecSchemaDefinition<ContextSpec>, SpecSchemaDefinition<TraceSpec>, SpecSchemaDefinition<EvaluationSpec>, SpecSchemaDefinition<ReplaySpec>, SpecSchemaDefinition<RegressionSpec>, SpecSchemaDefinition<DeploymentSpec>, SpecSchemaDefinition<HarnessedAgentSystemSpec>]schemas 模块导出的 Core Spec Definitions 常量。
coreSpecJsonSchemas常量const coreSpecJsonSchemas: Record<string, JsonSchema>schemas 模块导出的 Core Spec JSON Schemas 常量。
deploymentSpecDefinition常量const deploymentSpecDefinition: SpecSchemaDefinition<DeploymentSpec>Deployment Spec 的运行时校验入口,组合 Parser、Example 与 JSON Schema。
deploymentSpecExample常量const deploymentSpecExample: DeploymentSpecDeployment Spec 的有效示例值。
deploymentSpecJsonSchema常量const deploymentSpecJsonSchema: JsonSchemaDeployment Spec 的 JSON Schema。
deploymentSpecSchema常量const deploymentSpecSchema: z.ZodObject<{ id: z.ZodString; version: z.ZodString; } & { name: z.ZodOptional<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>; } & { mode: z.ZodEnum<["local", "self_hosted", "managed"]>; runtimeMode: z.ZodOptional<z...Deployment Spec 的运行时 Schema。
evaluationSpecDefinition常量const evaluationSpecDefinition: SpecSchemaDefinition<EvaluationSpec>Evaluation Spec 的运行时校验入口,组合 Parser、Example 与 JSON Schema。
evaluationSpecExample常量const evaluationSpecExample: EvaluationSpecEvaluation Spec 的有效示例值。
evaluationSpecJsonSchema常量const evaluationSpecJsonSchema: { allOf: { if: { properties: { type: { const: string; }; }; }; then: { required: string[]; }; }[]; type?: string; properties?: Record<string, JsonSchema>; required?: string[]; items?: JsonSchema; enum?: unknown[]; additionalProperties?: boolean | JsonSchema; }Evaluation Spec 的 JSON Schema。
evaluationSpecSchema常量const evaluationSpecSchema: z.ZodEffects<z.ZodObject<{ id: z.ZodString; version: z.ZodString; } & { name: z.ZodOptional<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>; } & { type: z.ZodEnum<["schema", "output_contract", "tool_trace", "policy",...Evaluation Spec 的运行时 Schema。
harnessedAgentSystemSpecDefinition常量const harnessedAgentSystemSpecDefinition: SpecSchemaDefinition<HarnessedAgentSystemSpec>Harnessed Agent System Spec 的运行时校验入口,组合 Parser、Example 与 JSON Schema。
harnessedAgentSystemSpecExample常量const harnessedAgentSystemSpecExample: HarnessedAgentSystemSpecHarnessed Agent System Spec 的有效示例值。
harnessedAgentSystemSpecJsonSchema常量const harnessedAgentSystemSpecJsonSchema: JsonSchemaHarnessed Agent System Spec 的 JSON Schema。
harnessedAgentSystemSpecSchema常量const harnessedAgentSystemSpecSchema: z.ZodObject<{ id: z.ZodString; version: z.ZodString; } & { name: z.ZodOptional<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>; } & { agentRef: z.ZodObject<{ id: z.ZodString; version: z.ZodOptional<z.ZodStr...Harnessed Agent System Spec 的运行时 Schema。
humanReviewPolicySpecSchema常量const humanReviewPolicySpecSchema: z.ZodObject<{ required: z.ZodBoolean; reason: z.ZodOptional<z.ZodString>; approverRole: z.ZodOptional<z.ZodString>; timeoutPolicy: z.ZodOptional<z.ZodObject<{ timeoutMs: z.ZodNumber; onTimeout: z.ZodOptional<z.ZodEnum<["fail", "retry", "human_review"]>>; }, "strip", z.ZodTypeAny, { timeoutMs: number; onTimeout?: "fail" | "retry" | "human_review" | undefined; }, { timeoutMs: numbe...Human Review Policy Spec 的运行时 Schema。
jsonSchemaSchema常量const jsonSchemaSchema: z.ZodType<JsonSchema, z.ZodTypeDef, JsonSchema>JSON schema 的运行时 Schema。
outputContractSpecDefinition常量const outputContractSpecDefinition: SpecSchemaDefinition<OutputContractSpec>Output Contract Spec 的运行时校验入口,组合 Parser、Example 与 JSON Schema。
outputContractSpecExample常量const outputContractSpecExample: OutputContractSpecOutput Contract Spec 的有效示例值。
outputContractSpecJsonSchema常量const outputContractSpecJsonSchema: JsonSchemaOutput Contract Spec 的 JSON Schema。
outputContractSpecSchema常量const outputContractSpecSchema: z.ZodObject<{ id: z.ZodString; version: z.ZodString; } & { name: z.ZodOptional<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>; } & { schema: z.ZodType<JsonSchema, z.ZodTypeDef, JsonSchema>; }, "strip", z.ZodType...Output Contract Spec 的运行时 Schema。
policyRuleSpecJsonSchema常量const policyRuleSpecJsonSchema: JsonSchemaPolicy Rule Spec 的 JSON Schema。
policyRuleSpecSchema常量const policyRuleSpecSchema: z.ZodObject<{ id: z.ZodString; version: z.ZodString; } & { name: z.ZodOptional<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>; } & { effect: z.ZodEnum<["allow", "deny", "require_human_review"]>; expression: z.ZodOpt...Policy Rule Spec 的运行时 Schema。
policySpecDefinition常量const policySpecDefinition: SpecSchemaDefinition<PolicySpec>Policy Spec 的运行时校验入口,组合 Parser、Example 与 JSON Schema。
policySpecExample常量const policySpecExample: PolicySpecPolicy Spec 的有效示例值。
policySpecJsonSchema常量const policySpecJsonSchema: JsonSchemaPolicy Spec 的 JSON Schema。
policySpecSchema常量const policySpecSchema: z.ZodObject<{ id: z.ZodString; version: z.ZodString; } & { name: z.ZodOptional<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>; } & { rules: z.ZodArray<z.ZodObject<{ id: z.ZodString; version: z.ZodString; } & { name: z.Z...Policy Spec 的运行时 Schema。
regressionSpecDefinition常量const regressionSpecDefinition: SpecSchemaDefinition<RegressionSpec>Regression Spec 的运行时校验入口,组合 Parser、Example 与 JSON Schema。
regressionSpecExample常量const regressionSpecExample: RegressionSpecRegression Spec 的有效示例值。
regressionSpecJsonSchema常量const regressionSpecJsonSchema: JsonSchemaRegression Spec 的 JSON Schema。
regressionSpecSchema常量const regressionSpecSchema: z.ZodObject<{ id: z.ZodString; version: z.ZodString; } & { name: z.ZodOptional<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>; } & { fixtureRefs: z.ZodArray<z.ZodObject<{ id: z.ZodString; version: z.ZodOptional<z.Zo...Regression Spec 的运行时 Schema。
replaySpecDefinition常量const replaySpecDefinition: SpecSchemaDefinition<ReplaySpec>Replay Spec 的运行时校验入口,组合 Parser、Example 与 JSON Schema。
replaySpecExample常量const replaySpecExample: ReplaySpecReplay Spec 的有效示例值。
replaySpecJsonSchema常量const replaySpecJsonSchema: JsonSchemaReplay Spec 的 JSON Schema。
replaySpecSchema常量const replaySpecSchema: z.ZodObject<{ id: z.ZodString; version: z.ZodString; } & { name: z.ZodOptional<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>; } & { captureModelIO: z.ZodOptional<z.ZodBoolean>; captureToolIO: z.ZodOptional<z.ZodBoolean...Replay Spec 的运行时 Schema。
retryPolicySpecSchema常量const retryPolicySpecSchema: z.ZodObject<{ maxAttempts: z.ZodNumber; backoffMs: z.ZodOptional<z.ZodNumber>; maxBackoffMs: z.ZodOptional<z.ZodNumber>; jitterRatio: z.ZodOptional<z.ZodNumber>; maxElapsedMs: z.ZodOptional<z.ZodNumber>; retryableCodes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, "strip", z.ZodTypeAny, { maxAttempts: number; backoffMs?: number | undefined; maxBackoffMs?: number | undefined; jitt...Retry Policy Spec 的运行时 Schema。
riskLevelSchema常量const riskLevelSchema: z.ZodEnum<["low", "medium", "high", "critical"]>Risk Level 的运行时 Schema。
sideEffectLevelSchema常量const sideEffectLevelSchema: z.ZodEnum<["none", "read", "write", "external_effect", "irreversible"]>Side Effect Level 的运行时 Schema。
specMetadataSchema常量const specMetadataSchema: z.ZodObject<{ name: z.ZodOptional<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>; }, "strip", z.ZodTypeAny, { name?: string | undefined; description?: string | undefined; tags?: string[] | undefined; createdAt?: strin...Spec Metadata 的运行时 Schema。
specRefSchema常量const specRefSchema: z.ZodObject<{ id: z.ZodString; version: z.ZodOptional<z.ZodString>; revision: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { id: string; revision?: string | undefined; version?: string | undefined; }, { id: string; revision?: string | undefined; version?: string | undefined; }>Spec Ref 的运行时 Schema。
timeoutPolicySpecSchema常量const timeoutPolicySpecSchema: z.ZodObject<{ timeoutMs: z.ZodNumber; onTimeout: z.ZodOptional<z.ZodEnum<["fail", "retry", "human_review"]>>; }, "strip", z.ZodTypeAny, { timeoutMs: number; onTimeout?: "fail" | "retry" | "human_review" | undefined; }, { timeoutMs: number; onTimeout?: "fail" | "retry" | "human_review" | undefined; }>Timeout Policy Spec 的运行时 Schema。
traceSpecDefinition常量const traceSpecDefinition: SpecSchemaDefinition<TraceSpec>Trace Spec 的运行时校验入口,组合 Parser、Example 与 JSON Schema。
traceSpecExample常量const traceSpecExample: TraceSpecTrace Spec 的有效示例值。
traceSpecJsonSchema常量const traceSpecJsonSchema: JsonSchemaTrace Spec 的 JSON Schema。
traceSpecSchema常量const traceSpecSchema: z.ZodObject<{ id: z.ZodString; version: z.ZodString; } & { name: z.ZodOptional<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>; } & { eventTypes: z.ZodArray<z.ZodString, "many">; retentionPolicy: z.ZodOptional<z.ZodString...Trace Spec 的运行时 Schema。
versionedSpecSchema常量const versionedSpecSchema: z.ZodObject<{ id: z.ZodString; version: z.ZodString; }, "strip", z.ZodTypeAny, { id: string; version: string; }, { id: string; version: string; }>Versioned Spec 的运行时 Schema。
assertSpecSchemaDefinition函数assertSpecSchemaDefinition(definition: SpecSchemaDefinition<unknown>): voidAssert Spec Schema Definition 函数,提供 1 个公开调用签名;参数与返回类型见下表。
defineSpecSchema函数defineSpecSchema<TSpec>(definition: { id: string; zod: ZodType<TSpec>; jsonSchema: JsonSchema; example: TSpec; }): SpecSchemaDefinition<TSpec>Define Spec 的运行时 Schema。
exportSpecJsonSchemas函数exportSpecJsonSchemas(definitions: readonly SpecSchemaDefinition<unknown>[]): Record<string, JsonSchema>Export Spec JSON Schemas 函数,提供 1 个公开调用签名;参数与返回类型见下表。
validateContextSpec函数validateContextSpec(input: unknown): ContextSpecValidate Context Spec 函数,提供 1 个公开调用签名;参数与返回类型见下表。
validateDeploymentSpec函数validateDeploymentSpec(input: unknown): DeploymentSpecValidate Deployment Spec 函数,提供 1 个公开调用签名;参数与返回类型见下表。
validateEvaluationSpec函数validateEvaluationSpec(input: unknown): EvaluationSpecValidate Evaluation Spec 函数,提供 1 个公开调用签名;参数与返回类型见下表。
validateHarnessedAgentSystemSpec函数validateHarnessedAgentSystemSpec(input: unknown): HarnessedAgentSystemSpecValidate Harnessed Agent System Spec 函数,提供 1 个公开调用签名;参数与返回类型见下表。
validateOutputContractSpec函数validateOutputContractSpec(input: unknown): OutputContractSpecValidate Output Contract Spec 函数,提供 1 个公开调用签名;参数与返回类型见下表。
validatePolicySpec函数validatePolicySpec(input: unknown): PolicySpecValidate Policy Spec 函数,提供 1 个公开调用签名;参数与返回类型见下表。
validateRegressionSpec函数validateRegressionSpec(input: unknown): RegressionSpecValidate Regression Spec 函数,提供 1 个公开调用签名;参数与返回类型见下表。
validateReplaySpec函数validateReplaySpec(input: unknown): ReplaySpecValidate Replay Spec 函数,提供 1 个公开调用签名;参数与返回类型见下表。
validateTraceSpec函数validateTraceSpec(input: unknown): TraceSpecValidate Trace Spec 函数,提供 1 个公开调用签名;参数与返回类型见下表。
SpecSchemaDefinition接口interface SpecSchemaDefinitionSpec Schema Definition 接口,共包含 5 个公开字段或方法。

auditPolicySpecSchema

Audit Policy Spec 的运行时 Schema。

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

声明

text
export declare const auditPolicySpecSchema: z.ZodObject<{ enabled: z.ZodBoolean; includeInput: z.ZodOptional<z.ZodBoolean>; includeOutput: z.ZodOptional<z.ZodBoolean>; redactPaths: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, "strip", z.ZodTypeAny, { enabled: boolean; includeInput?: boolean | undefined; includeOutput?: boolean | undefined; redactPaths?: string[] | undefined; }, { enabled: boolean; includeInput?: boolean | undefined; includeOutput?: boolean | undefined; redactPaths?: string[] | undefined; }>;

contextSourceSpecJsonSchema

Context Source Spec 的 JSON Schema。

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

声明

text
export declare const contextSourceSpecJsonSchema: JsonSchema;

contextSourceSpecSchema

Context Source Spec 的运行时 Schema。

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

声明

text
export declare const contextSourceSpecSchema: z.ZodObject<{ id: z.ZodString; version: z.ZodString; } & { name: z.ZodOptional<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>; } & { type: z.ZodEnum<["memory", "artifact", "skill", "domain", "mcp", "user_input", "system"]>; provenanceRequired: z.ZodOptional<z.ZodBoolean>; trustLevel: z.ZodOptional<z.ZodEnum<["trusted", "reviewed", "untrusted"]>>; }, "strip", z.ZodTypeAny, { id: string; type: "system" | "memory" | "artifact" | "skill" | "mcp" | "user_input" | "domain"; version: string; name?: string | undefined; description?: string | undefined; tags?: string[] | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; owner?: string | undefined; provenanceRequired?: boolean | undefined; trustLevel?: "trusted" | "reviewed" | "untrusted" | undefined; }, { id: string; type: "system" | "memory" | "artifact" | "skill" | "mcp" | "user_input" | "domain"; version: string; name?: string | undefined; description?: string | undefined; tags?: string[] | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; owner?: string | undefined; provenanceRequired?: boolean | undefined; trustLevel?: "trusted" | "reviewed" | "untrusted" | undefined; }>;

contextSpecDefinition

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

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

声明

text
export declare const contextSpecDefinition: SpecSchemaDefinition<ContextSpec>;

contextSpecExample

Context Spec 的有效示例值。

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

声明

text
export declare const contextSpecExample: ContextSpec;

contextSpecJsonSchema

Context Spec 的 JSON Schema。

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

声明

text
export declare const contextSpecJsonSchema: JsonSchema;

contextSpecSchema

Context Spec 的运行时 Schema。

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

声明

text
export declare const contextSpecSchema: z.ZodObject<{ id: z.ZodString; version: z.ZodString; } & { name: z.ZodOptional<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>; } & { sources: z.ZodArray<z.ZodObject<{ id: z.ZodString; version: z.ZodString; } & { name: z.ZodOptional<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>; } & { type: z.ZodEnum<["memory", "artifact", "skill", "domain", "mcp", "user_input", "system"]>; provenanceRequired: z.ZodOptional<z.ZodBoolean>; trustLevel: z.ZodOptional<z.ZodEnum<["trusted", "reviewed", "untrusted"]>>; }, "strip", z.ZodTypeAny, { id: string; type: "system" | "memory" | "artifact" | "skill" | "mcp" | "user_input" | "domain"; version: string; name?: string | undefined; description?: string | undefined; tags?: string[] | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; owner?: string | undefined; provenanceRequired?: boolean | undefined; trustLevel?: "trusted" | "reviewed" | "untrusted" | undefined; }, { id: string; type: "system" | "memory" | "artifact" | "skill" | "mcp" | "user_input" | "domain"; version: string; name?: string | undefined; description?: string | undefined; tags?: string[] | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; owner?: string | undefined; provenanceRequired?: boolean | undefined; trustLevel?: "trusted" | "reviewed" | "untrusted" | undefined; }>, "many">; tokenBudget: z.ZodOptional<z.ZodNumber>; provenancePolicy: z.ZodOptional<z.ZodEnum<["required", "best_effort", "none"]>>; instructionBoundaryPolicy: z.ZodOptional<z.ZodEnum<["strict", "tagged", "none"]>>; }, "strip", z.ZodTypeAny, { id: string; version: string; sources: { id: string; type: "system" | "memory" | "artifact" | "skill" | "mcp" | "user_input" | "domain"; version: string; name?: string | undefined; description?: string | undefined; tags?: string[] | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; owner?: string | undefined; provenanceRequired?: boolean | undefined; trustLevel?: "trusted" | "reviewed" | "untrusted" | undefined; }[]; name?: string | undefined; description?: string | undefined; tags?: string[] | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; owner?: string | undefined; tokenBudget?: number | undefined; provenancePolicy?: "required" | "none" | "best_effort" | undefined; instructionBoundaryPolicy?: "strict" | "none" | "tagged" | undefined; }, { id: string; version: string; sources: { id: string; type: "system" | "memory" | "artifact" | "skill" | "mcp" | "user_input" | "domain"; version: string; name?: string | undefined; description?: string | undefined; tags?: string[] | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; owner?: string | undefined; provenanceRequired?: boolean | undefined; trustLevel?: "trusted" | "reviewed" | "untrusted" | undefined; }[]; name?: string | undefined; description?: string | undefined; tags?: string[] | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; owner?: string | undefined; tokenBudget?: number | undefined; provenancePolicy?: "required" | "none" | "best_effort" | undefined; instructionBoundaryPolicy?: "strict" | "none" | "tagged" | undefined; }>;

coreSpecDefinitions

schemas 模块导出的 Core Spec Definitions 常量。

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

声明

text
export declare const coreSpecDefinitions: readonly [SpecSchemaDefinition<PolicySpec>, SpecSchemaDefinition<OutputContractSpec>, SpecSchemaDefinition<ContextSpec>, SpecSchemaDefinition<TraceSpec>, SpecSchemaDefinition<EvaluationSpec>, SpecSchemaDefinition<ReplaySpec>, SpecSchemaDefinition<RegressionSpec>, SpecSchemaDefinition<DeploymentSpec>, SpecSchemaDefinition<HarnessedAgentSystemSpec>];

coreSpecJsonSchemas

schemas 模块导出的 Core Spec JSON Schemas 常量。

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

声明

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

deploymentSpecDefinition

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

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

声明

text
export declare const deploymentSpecDefinition: SpecSchemaDefinition<DeploymentSpec>;

deploymentSpecExample

Deployment Spec 的有效示例值。

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

声明

text
export declare const deploymentSpecExample: DeploymentSpec;

deploymentSpecJsonSchema

Deployment Spec 的 JSON Schema。

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

声明

text
export declare const deploymentSpecJsonSchema: JsonSchema;

deploymentSpecSchema

Deployment Spec 的运行时 Schema。

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

声明

text
export declare const deploymentSpecSchema: z.ZodObject<{ id: z.ZodString; version: z.ZodString; } & { name: z.ZodOptional<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>; } & { mode: z.ZodEnum<["local", "self_hosted", "managed"]>; runtimeMode: z.ZodOptional<z.ZodEnum<["single-user", "multi-user"]>>; configRefs: z.ZodOptional<z.ZodArray<z.ZodObject<{ id: z.ZodString; version: z.ZodOptional<z.ZodString>; revision: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { id: string; revision?: string | undefined; version?: string | undefined; }, { id: string; revision?: string | undefined; version?: string | undefined; }>, "many">>; }, "strip", z.ZodTypeAny, { id: string; version: string; mode: "managed" | "local" | "self_hosted"; name?: string | undefined; description?: string | undefined; tags?: string[] | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; owner?: string | undefined; runtimeMode?: "single-user" | "multi-user" | undefined; configRefs?: { id: string; revision?: string | undefined; version?: string | undefined; }[] | undefined; }, { id: string; version: string; mode: "managed" | "local" | "self_hosted"; name?: string | undefined; description?: string | undefined; tags?: string[] | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; owner?: string | undefined; runtimeMode?: "single-user" | "multi-user" | undefined; configRefs?: { id: string; revision?: string | undefined; version?: string | undefined; }[] | undefined; }>;

evaluationSpecDefinition

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

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

声明

text
export declare const evaluationSpecDefinition: SpecSchemaDefinition<EvaluationSpec>;

evaluationSpecExample

Evaluation Spec 的有效示例值。

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

声明

text
export declare const evaluationSpecExample: EvaluationSpec;

evaluationSpecJsonSchema

Evaluation Spec 的 JSON Schema。

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

声明

text
export declare const evaluationSpecJsonSchema: { allOf: { if: { properties: { type: { const: string; }; }; }; then: { required: string[]; }; }[]; type?: string; properties?: Record<string, JsonSchema>; required?: string[]; items?: JsonSchema; enum?: unknown[]; additionalProperties?: boolean | JsonSchema; };

evaluationSpecSchema

Evaluation Spec 的运行时 Schema。

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

声明

text
export declare const evaluationSpecSchema: z.ZodEffects<z.ZodObject<{ id: z.ZodString; version: z.ZodString; } & { name: z.ZodOptional<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>; } & { type: z.ZodEnum<["schema", "output_contract", "tool_trace", "policy", "process", "cost", "latency", "regression", "human"]>; rubric: z.ZodOptional<z.ZodType<JsonSchema, z.ZodTypeDef, JsonSchema>>; deterministic: z.ZodOptional<z.ZodBoolean>; }, "strip", z.ZodTypeAny, { id: string; type: "schema" | "human" | "policy" | "process" | "output_contract" | "tool_trace" | "cost" | "latency" | "regression"; version: string; name?: string | undefined; description?: string | undefined; tags?: string[] | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; deterministic?: boolean | undefined; owner?: string | undefined; rubric?: JsonSchema | undefined; }, { id: string; type: "schema" | "human" | "policy" | "process" | "output_contract" | "tool_trace" | "cost" | "latency" | "regression"; version: string; name?: string | undefined; description?: string | undefined; tags?: string[] | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; deterministic?: boolean | undefined; owner?: string | undefined; rubric?: JsonSchema | undefined; }>, { id: string; type: "schema" | "human" | "policy" | "process" | "output_contract" | "tool_trace" | "cost" | "latency" | "regression"; version: string; name?: string | undefined; description?: string | undefined; tags?: string[] | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; deterministic?: boolean | undefined; owner?: string | undefined; rubric?: JsonSchema | undefined; }, { id: string; type: "schema" | "human" | "policy" | "process" | "output_contract" | "tool_trace" | "cost" | "latency" | "regression"; version: string; name?: string | undefined; description?: string | undefined; tags?: string[] | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; deterministic?: boolean | undefined; owner?: string | undefined; rubric?: JsonSchema | undefined; }>;

harnessedAgentSystemSpecDefinition

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

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

声明

text
export declare const harnessedAgentSystemSpecDefinition: SpecSchemaDefinition<HarnessedAgentSystemSpec>;

harnessedAgentSystemSpecExample

Harnessed Agent System Spec 的有效示例值。

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

声明

text
export declare const harnessedAgentSystemSpecExample: HarnessedAgentSystemSpec;

harnessedAgentSystemSpecJsonSchema

Harnessed Agent System Spec 的 JSON Schema。

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

声明

text
export declare const harnessedAgentSystemSpecJsonSchema: JsonSchema;

harnessedAgentSystemSpecSchema

Harnessed Agent System Spec 的运行时 Schema。

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

声明

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

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

humanReviewPolicySpecSchema

Human Review Policy Spec 的运行时 Schema。

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

声明

text
export declare const humanReviewPolicySpecSchema: z.ZodObject<{ required: z.ZodBoolean; reason: z.ZodOptional<z.ZodString>; approverRole: z.ZodOptional<z.ZodString>; timeoutPolicy: z.ZodOptional<z.ZodObject<{ timeoutMs: z.ZodNumber; onTimeout: z.ZodOptional<z.ZodEnum<["fail", "retry", "human_review"]>>; }, "strip", z.ZodTypeAny, { timeoutMs: number; onTimeout?: "fail" | "retry" | "human_review" | undefined; }, { timeoutMs: number; onTimeout?: "fail" | "retry" | "human_review" | undefined; }>>; }, "strip", z.ZodTypeAny, { required: boolean; reason?: string | undefined; approverRole?: string | undefined; timeoutPolicy?: { timeoutMs: number; onTimeout?: "fail" | "retry" | "human_review" | undefined; } | undefined; }, { required: boolean; reason?: string | undefined; approverRole?: string | undefined; timeoutPolicy?: { timeoutMs: number; onTimeout?: "fail" | "retry" | "human_review" | undefined; } | undefined; }>;

jsonSchemaSchema

JSON schema 的运行时 Schema。

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

声明

text
export declare const jsonSchemaSchema: z.ZodType<JsonSchema, z.ZodTypeDef, JsonSchema>;

outputContractSpecDefinition

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

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

声明

text
export declare const outputContractSpecDefinition: SpecSchemaDefinition<OutputContractSpec>;

outputContractSpecExample

Output Contract Spec 的有效示例值。

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

声明

text
export declare const outputContractSpecExample: OutputContractSpec;

outputContractSpecJsonSchema

Output Contract Spec 的 JSON Schema。

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

声明

text
export declare const outputContractSpecJsonSchema: JsonSchema;

outputContractSpecSchema

Output Contract Spec 的运行时 Schema。

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

声明

text
export declare const outputContractSpecSchema: z.ZodObject<{ id: z.ZodString; version: z.ZodString; } & { name: z.ZodOptional<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>; } & { schema: z.ZodType<JsonSchema, z.ZodTypeDef, JsonSchema>; }, "strip", z.ZodTypeAny, { id: string; schema: JsonSchema; version: string; name?: string | undefined; description?: string | undefined; tags?: string[] | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; owner?: string | undefined; }, { id: string; schema: JsonSchema; version: string; name?: string | undefined; description?: string | undefined; tags?: string[] | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; owner?: string | undefined; }>;

policyRuleSpecJsonSchema

Policy Rule Spec 的 JSON Schema。

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

声明

text
export declare const policyRuleSpecJsonSchema: JsonSchema;

policyRuleSpecSchema

Policy Rule Spec 的运行时 Schema。

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

声明

text
export declare const policyRuleSpecSchema: z.ZodObject<{ id: z.ZodString; version: z.ZodString; } & { name: z.ZodOptional<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>; } & { effect: z.ZodEnum<["allow", "deny", "require_human_review"]>; expression: z.ZodOptional<z.ZodString>; sideEffectLevels: z.ZodOptional<z.ZodArray<z.ZodEnum<["none", "read", "write", "external_effect", "irreversible"]>, "many">>; scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, "strip", z.ZodTypeAny, { id: string; effect: "allow" | "deny" | "require_human_review"; version: string; name?: string | undefined; description?: string | undefined; tags?: string[] | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; owner?: string | undefined; expression?: string | undefined; sideEffectLevels?: ("external_effect" | "irreversible" | "read" | "write" | "none")[] | undefined; scopes?: string[] | undefined; }, { id: string; effect: "allow" | "deny" | "require_human_review"; version: string; name?: string | undefined; description?: string | undefined; tags?: string[] | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; owner?: string | undefined; expression?: string | undefined; sideEffectLevels?: ("external_effect" | "irreversible" | "read" | "write" | "none")[] | undefined; scopes?: string[] | undefined; }>;

policySpecDefinition

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

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

声明

text
export declare const policySpecDefinition: SpecSchemaDefinition<PolicySpec>;

policySpecExample

Policy Spec 的有效示例值。

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

声明

text
export declare const policySpecExample: PolicySpec;

policySpecJsonSchema

Policy Spec 的 JSON Schema。

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

声明

text
export declare const policySpecJsonSchema: JsonSchema;

policySpecSchema

Policy Spec 的运行时 Schema。

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

声明

text
export declare const policySpecSchema: z.ZodObject<{ id: z.ZodString; version: z.ZodString; } & { name: z.ZodOptional<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>; } & { rules: z.ZodArray<z.ZodObject<{ id: z.ZodString; version: z.ZodString; } & { name: z.ZodOptional<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>; } & { effect: z.ZodEnum<["allow", "deny", "require_human_review"]>; expression: z.ZodOptional<z.ZodString>; sideEffectLevels: z.ZodOptional<z.ZodArray<z.ZodEnum<["none", "read", "write", "external_effect", "irreversible"]>, "many">>; scopes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, "strip", z.ZodTypeAny, { id: string; effect: "allow" | "deny" | "require_human_review"; version: string; name?: string | undefined; description?: string | undefined; tags?: string[] | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; owner?: string | undefined; expression?: string | undefined; sideEffectLevels?: ("external_effect" | "irreversible" | "read" | "write" | "none")[] | undefined; scopes?: string[] | undefined; }, { id: string; effect: "allow" | "deny" | "require_human_review"; version: string; name?: string | undefined; description?: string | undefined; tags?: string[] | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; owner?: string | undefined; expression?: string | undefined; sideEffectLevels?: ("external_effect" | "irreversible" | "read" | "write" | "none")[] | undefined; scopes?: string[] | undefined; }>, "many">; defaultEffect: z.ZodOptional<z.ZodEnum<["allow", "deny"]>>; }, "strip", z.ZodTypeAny, { id: string; version: string; rules: { id: string; effect: "allow" | "deny" | "require_human_review"; version: string; name?: string | undefined; description?: string | undefined; tags?: string[] | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; owner?: string | undefined; expression?: string | undefined; sideEffectLevels?: ("external_effect" | "irreversible" | "read" | "write" | "none")[] | undefined; scopes?: string[] | undefined; }[]; name?: string | undefined; description?: string | undefined; tags?: string[] | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; owner?: string | undefined; defaultEffect?: "allow" | "deny" | undefined; }, { id: string; version: string; rules: { id: string; effect: "allow" | "deny" | "require_human_review"; version: string; name?: string | undefined; description?: string | undefined; tags?: string[] | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; owner?: string | undefined; expression?: string | undefined; sideEffectLevels?: ("external_effect" | "irreversible" | "read" | "write" | "none")[] | undefined; scopes?: string[] | undefined; }[]; name?: string | undefined; description?: string | undefined; tags?: string[] | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; owner?: string | undefined; defaultEffect?: "allow" | "deny" | undefined; }>;

regressionSpecDefinition

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

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

声明

text
export declare const regressionSpecDefinition: SpecSchemaDefinition<RegressionSpec>;

regressionSpecExample

Regression Spec 的有效示例值。

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

声明

text
export declare const regressionSpecExample: RegressionSpec;

regressionSpecJsonSchema

Regression Spec 的 JSON Schema。

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

声明

text
export declare const regressionSpecJsonSchema: JsonSchema;

regressionSpecSchema

Regression Spec 的运行时 Schema。

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

声明

text
export declare const regressionSpecSchema: z.ZodObject<{ id: z.ZodString; version: z.ZodString; } & { name: z.ZodOptional<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>; } & { fixtureRefs: z.ZodArray<z.ZodObject<{ id: z.ZodString; version: z.ZodOptional<z.ZodString>; revision: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { id: string; revision?: string | undefined; version?: string | undefined; }, { id: string; revision?: string | undefined; version?: string | undefined; }>, "many">; requiredChecks: z.ZodArray<z.ZodEnum<["event_types", "state_path", "tool_calls", "policy_decisions", "output_contract"]>, "many">; }, "strip", z.ZodTypeAny, { id: string; version: string; fixtureRefs: { id: string; revision?: string | undefined; version?: string | undefined; }[]; requiredChecks: ("output_contract" | "state_path" | "event_types" | "tool_calls" | "policy_decisions")[]; name?: string | undefined; description?: string | undefined; tags?: string[] | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; owner?: string | undefined; }, { id: string; version: string; fixtureRefs: { id: string; revision?: string | undefined; version?: string | undefined; }[]; requiredChecks: ("output_contract" | "state_path" | "event_types" | "tool_calls" | "policy_decisions")[]; name?: string | undefined; description?: string | undefined; tags?: string[] | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; owner?: string | undefined; }>;

replaySpecDefinition

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

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

声明

text
export declare const replaySpecDefinition: SpecSchemaDefinition<ReplaySpec>;

replaySpecExample

Replay Spec 的有效示例值。

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

声明

text
export declare const replaySpecExample: ReplaySpec;

replaySpecJsonSchema

Replay Spec 的 JSON Schema。

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

声明

text
export declare const replaySpecJsonSchema: JsonSchema;

replaySpecSchema

Replay Spec 的运行时 Schema。

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

声明

text
export declare const replaySpecSchema: z.ZodObject<{ id: z.ZodString; version: z.ZodString; } & { name: z.ZodOptional<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>; } & { captureModelIO: z.ZodOptional<z.ZodBoolean>; captureToolIO: z.ZodOptional<z.ZodBoolean>; captureMemoryReadSet: z.ZodOptional<z.ZodBoolean>; capturePolicyDecisions: z.ZodOptional<z.ZodBoolean>; snapshotPolicy: z.ZodOptional<z.ZodEnum<["none", "state_path", "full"]>>; }, "strip", z.ZodTypeAny, { id: string; version: string; name?: string | undefined; description?: string | undefined; tags?: string[] | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; owner?: string | undefined; captureModelIO?: boolean | undefined; captureToolIO?: boolean | undefined; captureMemoryReadSet?: boolean | undefined; capturePolicyDecisions?: boolean | undefined; snapshotPolicy?: "none" | "full" | "state_path" | undefined; }, { id: string; version: string; name?: string | undefined; description?: string | undefined; tags?: string[] | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; owner?: string | undefined; captureModelIO?: boolean | undefined; captureToolIO?: boolean | undefined; captureMemoryReadSet?: boolean | undefined; capturePolicyDecisions?: boolean | undefined; snapshotPolicy?: "none" | "full" | "state_path" | undefined; }>;

retryPolicySpecSchema

Retry Policy Spec 的运行时 Schema。

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

声明

text
export declare const retryPolicySpecSchema: z.ZodObject<{ maxAttempts: z.ZodNumber; backoffMs: z.ZodOptional<z.ZodNumber>; maxBackoffMs: z.ZodOptional<z.ZodNumber>; jitterRatio: z.ZodOptional<z.ZodNumber>; maxElapsedMs: z.ZodOptional<z.ZodNumber>; retryableCodes: z.ZodOptional<z.ZodArray<z.ZodString, "many">>; }, "strip", z.ZodTypeAny, { maxAttempts: number; backoffMs?: number | undefined; maxBackoffMs?: number | undefined; jitterRatio?: number | undefined; maxElapsedMs?: number | undefined; retryableCodes?: string[] | undefined; }, { maxAttempts: number; backoffMs?: number | undefined; maxBackoffMs?: number | undefined; jitterRatio?: number | undefined; maxElapsedMs?: number | undefined; retryableCodes?: string[] | undefined; }>;

riskLevelSchema

Risk Level 的运行时 Schema。

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

声明

text
export declare const riskLevelSchema: z.ZodEnum<["low", "medium", "high", "critical"]>;

sideEffectLevelSchema

Side Effect Level 的运行时 Schema。

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

声明

text
export declare const sideEffectLevelSchema: z.ZodEnum<["none", "read", "write", "external_effect", "irreversible"]>;

specMetadataSchema

Spec Metadata 的运行时 Schema。

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

声明

text
export declare const specMetadataSchema: z.ZodObject<{ name: z.ZodOptional<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>; }, "strip", z.ZodTypeAny, { name?: string | undefined; description?: string | undefined; tags?: string[] | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; owner?: string | undefined; }, { name?: string | undefined; description?: string | undefined; tags?: string[] | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; owner?: string | undefined; }>;

specRefSchema

Spec Ref 的运行时 Schema。

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

声明

text
export declare const specRefSchema: z.ZodObject<{ id: z.ZodString; version: z.ZodOptional<z.ZodString>; revision: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { id: string; revision?: string | undefined; version?: string | undefined; }, { id: string; revision?: string | undefined; version?: string | undefined; }>;

timeoutPolicySpecSchema

Timeout Policy Spec 的运行时 Schema。

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

声明

text
export declare const timeoutPolicySpecSchema: z.ZodObject<{ timeoutMs: z.ZodNumber; onTimeout: z.ZodOptional<z.ZodEnum<["fail", "retry", "human_review"]>>; }, "strip", z.ZodTypeAny, { timeoutMs: number; onTimeout?: "fail" | "retry" | "human_review" | undefined; }, { timeoutMs: number; onTimeout?: "fail" | "retry" | "human_review" | undefined; }>;

traceSpecDefinition

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

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

声明

text
export declare const traceSpecDefinition: SpecSchemaDefinition<TraceSpec>;

traceSpecExample

Trace Spec 的有效示例值。

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

声明

text
export declare const traceSpecExample: TraceSpec;

traceSpecJsonSchema

Trace Spec 的 JSON Schema。

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

声明

text
export declare const traceSpecJsonSchema: JsonSchema;

traceSpecSchema

Trace Spec 的运行时 Schema。

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

声明

text
export declare const traceSpecSchema: z.ZodObject<{ id: z.ZodString; version: z.ZodString; } & { name: z.ZodOptional<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>; } & { eventTypes: z.ZodArray<z.ZodString, "many">; retentionPolicy: z.ZodOptional<z.ZodString>; redactionPolicy: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { id: string; version: string; eventTypes: string[]; name?: string | undefined; description?: string | undefined; tags?: string[] | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; owner?: string | undefined; retentionPolicy?: string | undefined; redactionPolicy?: string | undefined; }, { id: string; version: string; eventTypes: string[]; name?: string | undefined; description?: string | undefined; tags?: string[] | undefined; createdAt?: string | undefined; updatedAt?: string | undefined; owner?: string | undefined; retentionPolicy?: string | undefined; redactionPolicy?: string | undefined; }>;

versionedSpecSchema

Versioned Spec 的运行时 Schema。

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

声明

text
export declare const versionedSpecSchema: z.ZodObject<{ id: z.ZodString; version: z.ZodString; }, "strip", z.ZodTypeAny, { id: string; version: string; }, { id: string; version: string; }>;

assertSpecSchemaDefinition

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

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

声明

text
export declare function assertSpecSchemaDefinition(definition: SpecSchemaDefinition<unknown>): void;

调用签名

text
assertSpecSchemaDefinition(definition: SpecSchemaDefinition<unknown>): void

参数

参数类型必需说明
definitionSpecSchemaDefinition<unknown>必需参数;接受的值由类型列定义。

返回值

  • 类型: void
  • 说明: 不返回值。

defineSpecSchema

Define Spec 的运行时 Schema。

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

声明

text
export declare function defineSpecSchema<TSpec>(definition: {
    id: string;
    zod: ZodType<TSpec>;
    jsonSchema: JsonSchema;
    example: TSpec;
}): SpecSchemaDefinition<TSpec>;

调用签名

text
defineSpecSchema<TSpec>(definition: { id: string; zod: ZodType<TSpec>; jsonSchema: JsonSchema; example: TSpec; }): SpecSchemaDefinition<TSpec>

参数

参数类型必需说明
definition{ id: string; zod: ZodType<TSpec>; jsonSchema: JsonSchema; example: TSpec; }必需参数;接受的值由类型列定义。

返回值

  • 类型: SpecSchemaDefinition<TSpec>
  • 说明: 返回值契约由上述类型定义。

exportSpecJsonSchemas

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

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

声明

text
export declare function exportSpecJsonSchemas(definitions: readonly SpecSchemaDefinition<unknown>[]): Record<string, JsonSchema>;

调用签名

text
exportSpecJsonSchemas(definitions: readonly SpecSchemaDefinition<unknown>[]): Record<string, JsonSchema>

参数

参数类型必需说明
definitionsreadonly SpecSchemaDefinition<unknown>[]必需参数;接受的值由类型列定义。

返回值

  • 类型: Record<string, JsonSchema>
  • 说明: 返回值契约由上述类型定义。

validateContextSpec

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

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

声明

text
export declare function validateContextSpec(input: unknown): ContextSpec;

调用签名

text
validateContextSpec(input: unknown): ContextSpec

参数

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

返回值

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

validateDeploymentSpec

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

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

声明

text
export declare function validateDeploymentSpec(input: unknown): DeploymentSpec;

调用签名

text
validateDeploymentSpec(input: unknown): DeploymentSpec

参数

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

返回值

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

validateEvaluationSpec

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

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

声明

text
export declare function validateEvaluationSpec(input: unknown): EvaluationSpec;

调用签名

text
validateEvaluationSpec(input: unknown): EvaluationSpec

参数

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

返回值

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

validateHarnessedAgentSystemSpec

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

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

声明

text
export declare function validateHarnessedAgentSystemSpec(input: unknown): HarnessedAgentSystemSpec;

调用签名

text
validateHarnessedAgentSystemSpec(input: unknown): HarnessedAgentSystemSpec

参数

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

返回值

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

validateOutputContractSpec

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

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

声明

text
export declare function validateOutputContractSpec(input: unknown): OutputContractSpec;

调用签名

text
validateOutputContractSpec(input: unknown): OutputContractSpec

参数

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

返回值

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

validatePolicySpec

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

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

声明

text
export declare function validatePolicySpec(input: unknown): PolicySpec;

调用签名

text
validatePolicySpec(input: unknown): PolicySpec

参数

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

返回值

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

validateRegressionSpec

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

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

声明

text
export declare function validateRegressionSpec(input: unknown): RegressionSpec;

调用签名

text
validateRegressionSpec(input: unknown): RegressionSpec

参数

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

返回值

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

validateReplaySpec

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

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

声明

text
export declare function validateReplaySpec(input: unknown): ReplaySpec;

调用签名

text
validateReplaySpec(input: unknown): ReplaySpec

参数

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

返回值

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

validateTraceSpec

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

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

声明

text
export declare function validateTraceSpec(input: unknown): TraceSpec;

调用签名

text
validateTraceSpec(input: unknown): TraceSpec

参数

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

返回值

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

SpecSchemaDefinition

Spec Schema Definition 接口,共包含 5 个公开字段或方法。

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

声明

text
export interface SpecSchemaDefinition<TSpec> {
    id: string;
    zod: ZodType<TSpec>;
    jsonSchema: JsonSchema;
    example: TSpec;
    parse(input: unknown): TSpec;
}

契约成员

成员种类签名说明
example属性example: TSpec公开属性;类型、只读和可选状态以签名列为准。
id属性id: string公开属性;类型、只读和可选状态以签名列为准。
jsonSchema属性jsonSchema: JsonSchema公开属性;类型、只读和可选状态以签名列为准。
parse方法parse(input: unknown): TSpec公开方法;参数与返回类型以签名列为准。
zod属性zod: z.ZodType<TSpec, z.ZodTypeDef, TSpec>公开属性;类型、只读和可选状态以签名列为准。