Skip to content

@codesoul-co/hypha-core / contracts/execution-output

Using this module

Use the Execution output module for declaring and runtime-validating contracts. It exports 9 interfaces, 2 types.

Import from the package entrypoint

ts
import type {
  CollectedExecutionOutput,
  ExecutionOutputArtifactManager,
  ExecutionOutputCollectionContext,
  ExecutionOutputCollectionItem,
  ExecutionOutputCollectionPlan,
  ExecutionOutputCollectionPolicy,
  ExecutionOutputCollectionResult,
  ExecutionOutputCollector,
} from '@codesoul-co/hypha-core';

// The complete export list is documented below.

Usage patterns

  • Use the 11 type/interface exports as static contracts in application code, adapters, or tests. Import them with import type; they do not exist at runtime.

Public exports

SymbolKindSignatureDescription
CollectedExecutionOutputinterfaceinterface CollectedExecutionOutputCollected Execution Output interface with 6 public fields or methods.
ExecutionOutputArtifactManagerinterfaceinterface ExecutionOutputArtifactManagerMinimal Artifact Manager port required by output collection.
ExecutionOutputCollectionContextinterfaceinterface ExecutionOutputCollectionContextIdentity and Artifact policy context supplied by the Execution composition root.
ExecutionOutputCollectionIteminterfaceinterface ExecutionOutputCollectionItemA bounded, content-addressed file that may be handed to Artifact collection.
ExecutionOutputCollectionPlaninterfaceinterface ExecutionOutputCollectionPlanDeterministic output of policy evaluation; creating Artifact records is a later side effect.
ExecutionOutputCollectionPolicyinterfaceinterface ExecutionOutputCollectionPolicyFramework-level rules for collecting files produced by an Execution.
ExecutionOutputCollectionResultinterfaceinterface ExecutionOutputCollectionResultExecution Output Collection Result interface with 5 public fields or methods.
ExecutionOutputCollectorinterfaceinterface ExecutionOutputCollectorExecution Output Collector interface with 1 public fields or methods.
ExecutionOutputPlannerinterfaceinterface ExecutionOutputPlannerExecution Output Planner interface with 1 public fields or methods.
ExecutionOutputSkipReasontypetype ExecutionOutputSkipReason = 'not_included' | 'excluded' | 'unsupported_mutation' | 'missing_integrity_evidence' | 'artifact_limit' | 'byte_limit'Public type alias for Execution Output Skip Reason; the declaration contains its complete type expression.
ExecutionOutputTerminalStatustypetype ExecutionOutputTerminalStatus = Exclude<CommandExecutionStatus, 'queued' | 'starting' | 'running' | 'cancelling'>Public type alias for Execution Output Terminal Status; the declaration contains its complete type expression.

CollectedExecutionOutput

Collected Execution Output interface with 6 public fields or methods.

  • Kind: interface
  • Import: import type { CollectedExecutionOutput } from '@codesoul-co/hypha-core';
  • Source module: contracts/execution-output

Declaration

text
export interface CollectedExecutionOutput {
    relativePath: string;
    artifactRef: string;
    versionId: string;
    contentHash: string;
    sizeBytes: number;
    status: ArtifactStatus;
}

Contract members

MemberKindSignatureDescription
artifactRefpropertyartifactRef: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
contentHashpropertycontentHash: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
relativePathpropertyrelativePath: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
sizeBytespropertysizeBytes: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
statuspropertystatus: ArtifactStatusPublic property; its type, readonly modifier and optionality are shown in the signature.
versionIdpropertyversionId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

ExecutionOutputArtifactManager

Minimal Artifact Manager port required by output collection.

  • Kind: interface
  • Import: import type { ExecutionOutputArtifactManager } from '@codesoul-co/hypha-core';
  • Source module: contracts/execution-output

Declaration

text
export interface ExecutionOutputArtifactManager {
    createFromWorkspace(request: ArtifactFromWorkspaceRequest): Promise<ArtifactRecord>;
    finalize(request: ArtifactFinalizeRequest): Promise<ArtifactRecord>;
}

Contract members

MemberKindSignatureDescription
createFromWorkspacemethodcreateFromWorkspace(request: ArtifactFromWorkspaceRequest): Promise<ArtifactRecord>Public method; parameters and return type are shown in the signature.
finalizemethodfinalize(request: ArtifactFinalizeRequest): Promise<ArtifactRecord>Public method; parameters and return type are shown in the signature.

ExecutionOutputCollectionContext

Identity and Artifact policy context supplied by the Execution composition root.

  • Kind: interface
  • Import: import type { ExecutionOutputCollectionContext } from '@codesoul-co/hypha-core';
  • Source module: contracts/execution-output

Declaration

text
export interface ExecutionOutputCollectionContext {
    operationId: string;
    principal: ExecutionPrincipal;
    profileRef: SpecRef;
    userId: string;
    tenantId?: string;
    workspaceId: string;
    sessionId?: string;
    runId?: string;
    agentId?: string;
    idempotencyKeyPrefix?: string;
}

Contract members

MemberKindSignatureDescription
agentIdpropertyagentId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
idempotencyKeyPrefixpropertyidempotencyKeyPrefix?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
operationIdpropertyoperationId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
principalpropertyprincipal: ExecutionPrincipalPublic property; its type, readonly modifier and optionality are shown in the signature.
profileRefpropertyprofileRef: SpecRefPublic property; its type, readonly modifier and optionality are shown in the signature.
runIdpropertyrunId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
sessionIdpropertysessionId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
tenantIdpropertytenantId?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
userIdpropertyuserId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
workspaceIdpropertyworkspaceId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.

ExecutionOutputCollectionItem

A bounded, content-addressed file that may be handed to Artifact collection.

  • Kind: interface
  • Import: import type { ExecutionOutputCollectionItem } from '@codesoul-co/hypha-core';
  • Source module: contracts/execution-output

Declaration

text
export interface ExecutionOutputCollectionItem {
    relativePath: string;
    contentHash: string;
    sizeBytes: number;
    kind: ArtifactKind;
    mimeType?: string;
    existingArtifactRef?: string;
}

Contract members

MemberKindSignatureDescription
contentHashpropertycontentHash: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
existingArtifactRefpropertyexistingArtifactRef?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
kindpropertykind: ArtifactKindPublic property; its type, readonly modifier and optionality are shown in the signature.
mimeTypepropertymimeType?: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
relativePathpropertyrelativePath: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
sizeBytespropertysizeBytes: numberPublic property; its type, readonly modifier and optionality are shown in the signature.

ExecutionOutputCollectionPlan

Deterministic output of policy evaluation; creating Artifact records is a later side effect.

  • Kind: interface
  • Import: import type { ExecutionOutputCollectionPlan } from '@codesoul-co/hypha-core';
  • Source module: contracts/execution-output

Declaration

text
export interface ExecutionOutputCollectionPlan {
    executionId: string;
    status: ExecutionOutputTerminalStatus;
    items: ExecutionOutputCollectionItem[];
    existingArtifactRefs: string[];
    totalBytes: number;
    finalize: boolean;
    skipped: Record<ExecutionOutputSkipReason, number>;
}

Contract members

MemberKindSignatureDescription
executionIdpropertyexecutionId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
existingArtifactRefspropertyexistingArtifactRefs: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
finalizepropertyfinalize: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
itemspropertyitems: ExecutionOutputCollectionItem[]Public property; its type, readonly modifier and optionality are shown in the signature.
skippedpropertyskipped: Record<ExecutionOutputSkipReason, number>Public property; its type, readonly modifier and optionality are shown in the signature.
statuspropertystatus: ExecutionOutputTerminalStatusPublic property; its type, readonly modifier and optionality are shown in the signature.
totalBytespropertytotalBytes: numberPublic property; its type, readonly modifier and optionality are shown in the signature.

ExecutionOutputCollectionPolicy

Framework-level rules for collecting files produced by an Execution.

  • Kind: interface
  • Import: import type { ExecutionOutputCollectionPolicy } from '@codesoul-co/hypha-core';
  • Source module: contracts/execution-output

Declaration

text
export interface ExecutionOutputCollectionPolicy {
    includePatterns?: string[];
    excludePatterns?: string[];
    maxArtifacts?: number;
    maxTotalBytes?: number;
    classifyByExtension?: boolean;
    finalizeOnSuccess?: boolean;
}

Contract members

MemberKindSignatureDescription
classifyByExtensionpropertyclassifyByExtension?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
excludePatternspropertyexcludePatterns?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
finalizeOnSuccesspropertyfinalizeOnSuccess?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
includePatternspropertyincludePatterns?: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
maxArtifactspropertymaxArtifacts?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.
maxTotalBytespropertymaxTotalBytes?: numberPublic property; its type, readonly modifier and optionality are shown in the signature.

ExecutionOutputCollectionResult

Execution Output Collection Result interface with 5 public fields or methods.

  • Kind: interface
  • Import: import type { ExecutionOutputCollectionResult } from '@codesoul-co/hypha-core';
  • Source module: contracts/execution-output

Declaration

text
export interface ExecutionOutputCollectionResult {
    executionId: string;
    collected: CollectedExecutionOutput[];
    existingArtifactRefs: string[];
    artifactRefs: string[];
    finalizedArtifactRefs: string[];
}

Contract members

MemberKindSignatureDescription
artifactRefspropertyartifactRefs: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
collectedpropertycollected: CollectedExecutionOutput[]Public property; its type, readonly modifier and optionality are shown in the signature.
executionIdpropertyexecutionId: stringPublic property; its type, readonly modifier and optionality are shown in the signature.
existingArtifactRefspropertyexistingArtifactRefs: string[]Public property; its type, readonly modifier and optionality are shown in the signature.
finalizedArtifactRefspropertyfinalizedArtifactRefs: string[]Public property; its type, readonly modifier and optionality are shown in the signature.

ExecutionOutputCollector

Execution Output Collector interface with 1 public fields or methods.

  • Kind: interface
  • Import: import type { ExecutionOutputCollector } from '@codesoul-co/hypha-core';
  • Source module: contracts/execution-output

Declaration

text
export interface ExecutionOutputCollector {
    collect(plan: ExecutionOutputCollectionPlan, context: ExecutionOutputCollectionContext): Promise<ExecutionOutputCollectionResult>;
}

Contract members

MemberKindSignatureDescription
collectmethodcollect(plan: ExecutionOutputCollectionPlan, context: ExecutionOutputCollectionContext): Promise<ExecutionOutputCollectionResult>Public method; parameters and return type are shown in the signature.

ExecutionOutputPlanner

Execution Output Planner interface with 1 public fields or methods.

  • Kind: interface
  • Import: import type { ExecutionOutputPlanner } from '@codesoul-co/hypha-core';
  • Source module: contracts/execution-output

Declaration

text
export interface ExecutionOutputPlanner {
    plan(result: CommandExecutionResult, policy: ExecutionOutputCollectionPolicy): ExecutionOutputCollectionPlan;
}

Contract members

MemberKindSignatureDescription
planmethodplan(result: CommandExecutionResult, policy: ExecutionOutputCollectionPolicy): ExecutionOutputCollectionPlanPublic method; parameters and return type are shown in the signature.

ExecutionOutputSkipReason

Public type alias for Execution Output Skip Reason; the declaration contains its complete type expression.

  • Kind: type
  • Import: import type { ExecutionOutputSkipReason } from '@codesoul-co/hypha-core';
  • Source module: contracts/execution-output

Declaration

text
export type ExecutionOutputSkipReason = 'not_included' | 'excluded' | 'unsupported_mutation' | 'missing_integrity_evidence' | 'artifact_limit' | 'byte_limit';

ExecutionOutputTerminalStatus

Public type alias for Execution Output Terminal Status; the declaration contains its complete type expression.

  • Kind: type
  • Import: import type { ExecutionOutputTerminalStatus } from '@codesoul-co/hypha-core';
  • Source module: contracts/execution-output

Declaration

text
export type ExecutionOutputTerminalStatus = Exclude<CommandExecutionStatus, 'queued' | 'starting' | 'running' | 'cancelling'>;