@codesoul-co/hypha-core / modules/execution-output/contracts
模块用法
用于声明并运行时校验契约。Contracts 模块公开 17 常量、4 函数。
从包入口导入
import {
collectedExecutionOutputJsonSchema,
collectedExecutionOutputSchema,
executionOutputCollectionItemJsonSchema,
executionOutputCollectionItemSchema,
executionOutputCollectionPlanExample,
executionOutputCollectionPlanJsonSchema,
executionOutputCollectionPlanSchema,
executionOutputCollectionPolicyExample,
} from '@codesoul-co/hypha-core';
// 完整导出列表见下方。使用要点
- 4 个函数是该模块的直接操作入口;每个 overload 的必需/可选参数与返回类型均在下方列出。
- 17 个常量/枚举提供稳定值、Schema、Definition 或默认配置;应复用这些导出,避免在应用中复制内部值。
运行时校验示例
import { collectedExecutionOutputSchema } from '@codesoul-co/hypha-core';
declare function loadExternalInput(): unknown;
const input: unknown = loadExternalInput();
const parsed = collectedExecutionOutputSchema.parse(input);配置、网络请求或持久化数据等不可信输入应先通过 Runtime Schema,再传给只接受已校验契约的函数或类。
公共导出
| Symbol | 种类 | 签名 | 说明 |
|---|---|---|---|
collectedExecutionOutputJsonSchema | 常量 | const collectedExecutionOutputJsonSchema: JsonSchema | Collected Execution Output 的 JSON Schema。 |
collectedExecutionOutputSchema | 常量 | const collectedExecutionOutputSchema: z.ZodObject<{ relativePath: z.ZodEffects<z.ZodString, string, string>; artifactRef: z.ZodString; versionId: z.ZodString; contentHash: z.ZodString; sizeBytes: z.ZodNumber; status: z.ZodEnum<["draft", "final"]>; }, "strict", z.ZodTypeAny, { versionId: string; status: "draft" | "final"; contentHash: string; sizeBytes: number; relativePath: string; artifactRef: string; }, { versio... | Collected Execution Output 的运行时 Schema。 |
executionOutputCollectionItemJsonSchema | 常量 | const executionOutputCollectionItemJsonSchema: JsonSchema | Execution Output Collection Item 的 JSON Schema。 |
executionOutputCollectionItemSchema | 常量 | const executionOutputCollectionItemSchema: z.ZodObject<{ relativePath: z.ZodEffects<z.ZodString, string, string>; contentHash: z.ZodString; sizeBytes: z.ZodNumber; kind: z.ZodEnum<["document", "code", "dataset", "image", "audio", "video", "table", "report", "archive", "patch", "snapshot", "test_report", "build_output", "log", "tool_output", "execution_receipt", "other"]>; mimeType: z.ZodOptional<z.ZodString>; exis... | Execution Output Collection Item 的运行时 Schema。 |
executionOutputCollectionPlanExample | 常量 | const executionOutputCollectionPlanExample: ExecutionOutputCollectionPlan | Execution Output Collection Plan 的有效示例值。 |
executionOutputCollectionPlanJsonSchema | 常量 | const executionOutputCollectionPlanJsonSchema: JsonSchema | Execution Output Collection Plan 的 JSON Schema。 |
executionOutputCollectionPlanSchema | 常量 | const executionOutputCollectionPlanSchema: z.ZodEffects<z.ZodObject<{ executionId: z.ZodString; status: z.ZodEnum<["cancelled", "completed", "failed", "timed_out", "oom_killed", "resource_exceeded", "quarantined"]>; items: z.ZodArray<z.ZodObject<{ relativePath: z.ZodEffects<z.ZodString, string, string>; contentHash: z.ZodString; sizeBytes: z.ZodNumber; kind: z.ZodEnum<["document", "code", "dataset", "image", "audi... | Execution Output Collection Plan 的运行时 Schema。 |
executionOutputCollectionPolicyExample | 常量 | const executionOutputCollectionPolicyExample: ExecutionOutputCollectionPolicy | Execution Output Collection Policy 的有效示例值。 |
executionOutputCollectionPolicyJsonSchema | 常量 | const executionOutputCollectionPolicyJsonSchema: JsonSchema | Execution Output Collection Policy 的 JSON Schema。 |
executionOutputCollectionPolicySchema | 常量 | const executionOutputCollectionPolicySchema: z.ZodEffects<z.ZodObject<{ includePatterns: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>; excludePatterns: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>; maxArtifacts: z.ZodOptional<z.ZodNumber>; maxTotalBytes: z.ZodOptional<z.ZodNumber>; classifyByExtension: z.ZodOptional<z.ZodBoolean>; finalizeOnSuccess: z... | Execution Output Collection Policy 的运行时 Schema。 |
executionOutputCollectionResultJsonSchema | 常量 | const executionOutputCollectionResultJsonSchema: JsonSchema | Execution Output Collection Result 的 JSON Schema。 |
executionOutputCollectionResultSchema | 常量 | const executionOutputCollectionResultSchema: z.ZodEffects<z.ZodObject<{ executionId: z.ZodString; collected: z.ZodArray<z.ZodObject<{ relativePath: z.ZodEffects<z.ZodString, string, string>; artifactRef: z.ZodString; versionId: z.ZodString; contentHash: z.ZodString; sizeBytes: z.ZodNumber; status: z.ZodEnum<["draft", "final"]>; }, "strict", z.ZodTypeAny, { versionId: string; status: "draft" | "final"; contentHash:... | Execution Output Collection Result 的运行时 Schema。 |
executionOutputJsonSchemas | 常量 | const executionOutputJsonSchemas: Record<string, JsonSchema> | 由 modules/execution-output/contracts 模块导出的 Execution Output JSON Schemas 常量。 |
executionOutputPatternSchema | 常量 | const executionOutputPatternSchema: z.ZodEffects<z.ZodString, string, string> | Execution Output Pattern 的运行时 Schema。 |
executionOutputSkippedSchema | 常量 | const executionOutputSkippedSchema: z.ZodObject<{ not_included: z.ZodNumber; excluded: z.ZodNumber; unsupported_mutation: z.ZodNumber; missing_integrity_evidence: z.ZodNumber; artifact_limit: z.ZodNumber; byte_limit: z.ZodNumber; }, "strict", z.ZodTypeAny, { not_included: number; excluded: number; unsupported_mutation: number; missing_integrity_evidence: number; artifact_limit: number; byte_limit: number; }, { not... | Execution Output Skipped 的运行时 Schema。 |
executionOutputSkipReasonSchema | 常量 | const executionOutputSkipReasonSchema: z.ZodEnum<["not_included", "excluded", "unsupported_mutation", "missing_integrity_evidence", "artifact_limit", "byte_limit"]> | Execution Output Skip Reason 的运行时 Schema。 |
executionOutputTerminalStatusSchema | 常量 | const executionOutputTerminalStatusSchema: z.ZodEnum<["cancelled", "completed", "failed", "timed_out", "oom_killed", "resource_exceeded", "quarantined"]> | Execution Output Terminal Status 的运行时 Schema。 |
emptyExecutionOutputSkipCounts | 函数 | emptyExecutionOutputSkipCounts(): Record<ExecutionOutputSkipReason, number> | Empty Execution Output Skip Counts 函数,提供 1 个公开调用签名;参数与返回类型见下表。 |
validateExecutionOutputCollectionPlan | 函数 | validateExecutionOutputCollectionPlan(input: unknown): ExecutionOutputCollectionPlan | Validate Execution Output Collection Plan 函数,提供 1 个公开调用签名;参数与返回类型见下表。 |
validateExecutionOutputCollectionPolicy | 函数 | validateExecutionOutputCollectionPolicy(input: unknown): ExecutionOutputCollectionPolicy | Validate Execution Output Collection Policy 函数,提供 1 个公开调用签名;参数与返回类型见下表。 |
validateExecutionOutputCollectionResult | 函数 | validateExecutionOutputCollectionResult(input: unknown): ExecutionOutputCollectionResult | Validate Execution Output Collection Result 函数,提供 1 个公开调用签名;参数与返回类型见下表。 |
collectedExecutionOutputJsonSchema
Collected Execution Output 的 JSON Schema。
- 种类: 常量
- 导入:
import { collectedExecutionOutputJsonSchema } from '@codesoul-co/hypha-core'; - 源码模块:
modules/execution-output/contracts
声明
export declare const collectedExecutionOutputJsonSchema: JsonSchema;collectedExecutionOutputSchema
Collected Execution Output 的运行时 Schema。
- 种类: 常量
- 导入:
import { collectedExecutionOutputSchema } from '@codesoul-co/hypha-core'; - 源码模块:
modules/execution-output/contracts
声明
export declare const collectedExecutionOutputSchema: z.ZodObject<{ relativePath: z.ZodEffects<z.ZodString, string, string>; artifactRef: z.ZodString; versionId: z.ZodString; contentHash: z.ZodString; sizeBytes: z.ZodNumber; status: z.ZodEnum<["draft", "final"]>; }, "strict", z.ZodTypeAny, { versionId: string; status: "draft" | "final"; contentHash: string; sizeBytes: number; relativePath: string; artifactRef: string; }, { versionId: string; status: "draft" | "final"; contentHash: string; sizeBytes: number; relativePath: string; artifactRef: string; }>;executionOutputCollectionItemJsonSchema
Execution Output Collection Item 的 JSON Schema。
- 种类: 常量
- 导入:
import { executionOutputCollectionItemJsonSchema } from '@codesoul-co/hypha-core'; - 源码模块:
modules/execution-output/contracts
声明
export declare const executionOutputCollectionItemJsonSchema: JsonSchema;executionOutputCollectionItemSchema
Execution Output Collection Item 的运行时 Schema。
- 种类: 常量
- 导入:
import { executionOutputCollectionItemSchema } from '@codesoul-co/hypha-core'; - 源码模块:
modules/execution-output/contracts
声明
export declare const executionOutputCollectionItemSchema: z.ZodObject<{ relativePath: z.ZodEffects<z.ZodString, string, string>; contentHash: z.ZodString; sizeBytes: z.ZodNumber; kind: z.ZodEnum<["document", "code", "dataset", "image", "audio", "video", "table", "report", "archive", "patch", "snapshot", "test_report", "build_output", "log", "tool_output", "execution_receipt", "other"]>; mimeType: z.ZodOptional<z.ZodString>; existingArtifactRef: z.ZodOptional<z.ZodString>; }, "strict", z.ZodTypeAny, { contentHash: string; sizeBytes: number; kind: "code" | "log" | "snapshot" | "other" | "image" | "document" | "dataset" | "audio" | "video" | "table" | "report" | "archive" | "patch" | "test_report" | "build_output" | "tool_output" | "execution_receipt"; relativePath: string; mimeType?: string | undefined; existingArtifactRef?: string | undefined; }, { contentHash: string; sizeBytes: number; kind: "code" | "log" | "snapshot" | "other" | "image" | "document" | "dataset" | "audio" | "video" | "table" | "report" | "archive" | "patch" | "test_report" | "build_output" | "tool_output" | "execution_receipt"; relativePath: string; mimeType?: string | undefined; existingArtifactRef?: string | undefined; }>;executionOutputCollectionPlanExample
Execution Output Collection Plan 的有效示例值。
- 种类: 常量
- 导入:
import { executionOutputCollectionPlanExample } from '@codesoul-co/hypha-core'; - 源码模块:
modules/execution-output/contracts
声明
export declare const executionOutputCollectionPlanExample: ExecutionOutputCollectionPlan;executionOutputCollectionPlanJsonSchema
Execution Output Collection Plan 的 JSON Schema。
- 种类: 常量
- 导入:
import { executionOutputCollectionPlanJsonSchema } from '@codesoul-co/hypha-core'; - 源码模块:
modules/execution-output/contracts
声明
export declare const executionOutputCollectionPlanJsonSchema: JsonSchema;executionOutputCollectionPlanSchema
Execution Output Collection Plan 的运行时 Schema。
- 种类: 常量
- 导入:
import { executionOutputCollectionPlanSchema } from '@codesoul-co/hypha-core'; - 源码模块:
modules/execution-output/contracts
声明
// 精确类型由包入口解析;完整编译器展开定义见源码链接。
export declare const executionOutputCollectionPlanSchema: (typeof import('@codesoul-co/hypha-core'))['executionOutputCollectionPlanSchema'];该常量的编译器展开类型已压缩;它的公共名称、顶层类型与源码位置仍保留在本条目中。相关输入/输出字段请使用同模块导出的接口、类型或 Runtime Schema。
executionOutputCollectionPolicyExample
Execution Output Collection Policy 的有效示例值。
- 种类: 常量
- 导入:
import { executionOutputCollectionPolicyExample } from '@codesoul-co/hypha-core'; - 源码模块:
modules/execution-output/contracts
声明
export declare const executionOutputCollectionPolicyExample: ExecutionOutputCollectionPolicy;executionOutputCollectionPolicyJsonSchema
Execution Output Collection Policy 的 JSON Schema。
- 种类: 常量
- 导入:
import { executionOutputCollectionPolicyJsonSchema } from '@codesoul-co/hypha-core'; - 源码模块:
modules/execution-output/contracts
声明
export declare const executionOutputCollectionPolicyJsonSchema: JsonSchema;executionOutputCollectionPolicySchema
Execution Output Collection Policy 的运行时 Schema。
- 种类: 常量
- 导入:
import { executionOutputCollectionPolicySchema } from '@codesoul-co/hypha-core'; - 源码模块:
modules/execution-output/contracts
声明
export declare const executionOutputCollectionPolicySchema: z.ZodEffects<z.ZodObject<{ includePatterns: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>; excludePatterns: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodString, string, string>, "many">>; maxArtifacts: z.ZodOptional<z.ZodNumber>; maxTotalBytes: z.ZodOptional<z.ZodNumber>; classifyByExtension: z.ZodOptional<z.ZodBoolean>; finalizeOnSuccess: z.ZodOptional<z.ZodBoolean>; }, "strict", z.ZodTypeAny, { excludePatterns?: string[] | undefined; includePatterns?: string[] | undefined; maxArtifacts?: number | undefined; maxTotalBytes?: number | undefined; classifyByExtension?: boolean | undefined; finalizeOnSuccess?: boolean | undefined; }, { excludePatterns?: string[] | undefined; includePatterns?: string[] | undefined; maxArtifacts?: number | undefined; maxTotalBytes?: number | undefined; classifyByExtension?: boolean | undefined; finalizeOnSuccess?: boolean | undefined; }>, { excludePatterns?: string[] | undefined; includePatterns?: string[] | undefined; maxArtifacts?: number | undefined; maxTotalBytes?: number | undefined; classifyByExtension?: boolean | undefined; finalizeOnSuccess?: boolean | undefined; }, { excludePatterns?: string[] | undefined; includePatterns?: string[] | undefined; maxArtifacts?: number | undefined; maxTotalBytes?: number | undefined; classifyByExtension?: boolean | undefined; finalizeOnSuccess?: boolean | undefined; }>;executionOutputCollectionResultJsonSchema
Execution Output Collection Result 的 JSON Schema。
- 种类: 常量
- 导入:
import { executionOutputCollectionResultJsonSchema } from '@codesoul-co/hypha-core'; - 源码模块:
modules/execution-output/contracts
声明
export declare const executionOutputCollectionResultJsonSchema: JsonSchema;executionOutputCollectionResultSchema
Execution Output Collection Result 的运行时 Schema。
- 种类: 常量
- 导入:
import { executionOutputCollectionResultSchema } from '@codesoul-co/hypha-core'; - 源码模块:
modules/execution-output/contracts
声明
export declare const executionOutputCollectionResultSchema: z.ZodEffects<z.ZodObject<{ executionId: z.ZodString; collected: z.ZodArray<z.ZodObject<{ relativePath: z.ZodEffects<z.ZodString, string, string>; artifactRef: z.ZodString; versionId: z.ZodString; contentHash: z.ZodString; sizeBytes: z.ZodNumber; status: z.ZodEnum<["draft", "final"]>; }, "strict", z.ZodTypeAny, { versionId: string; status: "draft" | "final"; contentHash: string; sizeBytes: number; relativePath: string; artifactRef: string; }, { versionId: string; status: "draft" | "final"; contentHash: string; sizeBytes: number; relativePath: string; artifactRef: string; }>, "many">; existingArtifactRefs: z.ZodArray<z.ZodString, "many">; artifactRefs: z.ZodArray<z.ZodString, "many">; finalizedArtifactRefs: z.ZodArray<z.ZodString, "many">; }, "strict", z.ZodTypeAny, { executionId: string; artifactRefs: string[]; existingArtifactRefs: string[]; collected: { versionId: string; status: "draft" | "final"; contentHash: string; sizeBytes: number; relativePath: string; artifactRef: string; }[]; finalizedArtifactRefs: string[]; }, { executionId: string; artifactRefs: string[]; existingArtifactRefs: string[]; collected: { versionId: string; status: "draft" | "final"; contentHash: string; sizeBytes: number; relativePath: string; artifactRef: string; }[]; finalizedArtifactRefs: string[]; }>, { executionId: string; artifactRefs: string[]; existingArtifactRefs: string[]; collected: { versionId: string; status: "draft" | "final"; contentHash: string; sizeBytes: number; relativePath: string; artifactRef: string; }[]; finalizedArtifactRefs: string[]; }, { executionId: string; artifactRefs: string[]; existingArtifactRefs: string[]; collected: { versionId: string; status: "draft" | "final"; contentHash: string; sizeBytes: number; relativePath: string; artifactRef: string; }[]; finalizedArtifactRefs: string[]; }>;executionOutputJsonSchemas
由 modules/execution-output/contracts 模块导出的 Execution Output JSON Schemas 常量。
- 种类: 常量
- 导入:
import { executionOutputJsonSchemas } from '@codesoul-co/hypha-core'; - 源码模块:
modules/execution-output/contracts
声明
export declare const executionOutputJsonSchemas: Record<string, JsonSchema>;executionOutputPatternSchema
Execution Output Pattern 的运行时 Schema。
- 种类: 常量
- 导入:
import { executionOutputPatternSchema } from '@codesoul-co/hypha-core'; - 源码模块:
modules/execution-output/contracts
声明
export declare const executionOutputPatternSchema: z.ZodEffects<z.ZodString, string, string>;executionOutputSkippedSchema
Execution Output Skipped 的运行时 Schema。
- 种类: 常量
- 导入:
import { executionOutputSkippedSchema } from '@codesoul-co/hypha-core'; - 源码模块:
modules/execution-output/contracts
声明
export declare const executionOutputSkippedSchema: z.ZodObject<{ not_included: z.ZodNumber; excluded: z.ZodNumber; unsupported_mutation: z.ZodNumber; missing_integrity_evidence: z.ZodNumber; artifact_limit: z.ZodNumber; byte_limit: z.ZodNumber; }, "strict", z.ZodTypeAny, { not_included: number; excluded: number; unsupported_mutation: number; missing_integrity_evidence: number; artifact_limit: number; byte_limit: number; }, { not_included: number; excluded: number; unsupported_mutation: number; missing_integrity_evidence: number; artifact_limit: number; byte_limit: number; }>;executionOutputSkipReasonSchema
Execution Output Skip Reason 的运行时 Schema。
- 种类: 常量
- 导入:
import { executionOutputSkipReasonSchema } from '@codesoul-co/hypha-core'; - 源码模块:
modules/execution-output/contracts
声明
export declare const executionOutputSkipReasonSchema: z.ZodEnum<["not_included", "excluded", "unsupported_mutation", "missing_integrity_evidence", "artifact_limit", "byte_limit"]>;executionOutputTerminalStatusSchema
Execution Output Terminal Status 的运行时 Schema。
- 种类: 常量
- 导入:
import { executionOutputTerminalStatusSchema } from '@codesoul-co/hypha-core'; - 源码模块:
modules/execution-output/contracts
声明
export declare const executionOutputTerminalStatusSchema: z.ZodEnum<["cancelled", "completed", "failed", "timed_out", "oom_killed", "resource_exceeded", "quarantined"]>;emptyExecutionOutputSkipCounts
Empty Execution Output Skip Counts 函数,提供 1 个公开调用签名;参数与返回类型见下表。
- 种类: 函数
- 导入:
import { emptyExecutionOutputSkipCounts } from '@codesoul-co/hypha-core'; - 源码模块:
modules/execution-output/contracts
声明
export declare function emptyExecutionOutputSkipCounts(): Record<ExecutionOutputSkipReason, number>;调用签名
emptyExecutionOutputSkipCounts(): Record<ExecutionOutputSkipReason, number>参数
无参数。
返回值
- 类型:
Record<ExecutionOutputSkipReason, number> - 说明: 返回值契约由上述类型定义。
validateExecutionOutputCollectionPlan
Validate Execution Output Collection Plan 函数,提供 1 个公开调用签名;参数与返回类型见下表。
- 种类: 函数
- 导入:
import { validateExecutionOutputCollectionPlan } from '@codesoul-co/hypha-core'; - 源码模块:
modules/execution-output/contracts
声明
export declare function validateExecutionOutputCollectionPlan(input: unknown): ExecutionOutputCollectionPlan;调用签名
validateExecutionOutputCollectionPlan(input: unknown): ExecutionOutputCollectionPlan参数
| 参数 | 类型 | 必需 | 说明 |
|---|---|---|---|
input | unknown | 是 | 必需参数;接受的值由类型列定义。 |
返回值
- 类型:
ExecutionOutputCollectionPlan - 说明: 返回值契约由上述类型定义。
validateExecutionOutputCollectionPolicy
Validate Execution Output Collection Policy 函数,提供 1 个公开调用签名;参数与返回类型见下表。
- 种类: 函数
- 导入:
import { validateExecutionOutputCollectionPolicy } from '@codesoul-co/hypha-core'; - 源码模块:
modules/execution-output/contracts
声明
export declare function validateExecutionOutputCollectionPolicy(input: unknown): ExecutionOutputCollectionPolicy;调用签名
validateExecutionOutputCollectionPolicy(input: unknown): ExecutionOutputCollectionPolicy参数
| 参数 | 类型 | 必需 | 说明 |
|---|---|---|---|
input | unknown | 是 | 必需参数;接受的值由类型列定义。 |
返回值
- 类型:
ExecutionOutputCollectionPolicy - 说明: 返回值契约由上述类型定义。
validateExecutionOutputCollectionResult
Validate Execution Output Collection Result 函数,提供 1 个公开调用签名;参数与返回类型见下表。
- 种类: 函数
- 导入:
import { validateExecutionOutputCollectionResult } from '@codesoul-co/hypha-core'; - 源码模块:
modules/execution-output/contracts
声明
export declare function validateExecutionOutputCollectionResult(input: unknown): ExecutionOutputCollectionResult;调用签名
validateExecutionOutputCollectionResult(input: unknown): ExecutionOutputCollectionResult参数
| 参数 | 类型 | 必需 | 说明 |
|---|---|---|---|
input | unknown | 是 | 必需参数;接受的值由类型列定义。 |
返回值
- 类型:
ExecutionOutputCollectionResult - 说明: 返回值契约由上述类型定义。
