@codesoul-co/hypha-core / contracts/artifact-events
- Package index:
@codesoul-co/hypha-core - Source:
packages/core/src/contracts/artifact-events.ts - Exports: 7
Using this module
Use the Artifact events module for declaring and runtime-validating contracts. It exports 2 interfaces, 5 types.
Import from the package entrypoint
import type {
ArtifactEventPayload,
ArtifactEventPublisher,
ArtifactEventCreateInput,
ArtifactEventPayloadMap,
ArtifactEventPublication,
ArtifactFrameworkEvent,
ArtifactFrameworkEventType,
} from '@codesoul-co/hypha-core';Usage patterns
- Use the 7 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
| Symbol | Kind | Signature | Description |
|---|---|---|---|
ArtifactEventPayload | interface | interface ArtifactEventPayload | Artifact Event Payload interface with 19 public fields or methods. |
ArtifactEventPublisher | interface | interface ArtifactEventPublisher | Runtime-owned adapters must durably and idempotently publish by publication ID. |
ArtifactEventCreateInput | type | type ArtifactEventCreateInput = Omit<EventCreateInput<ArtifactEventPayloadMap[TType]>, 'type'> & { type: TType; } | Public type alias for Artifact Event Create Input; the declaration contains its complete type expression. |
ArtifactEventPayloadMap | type | type ArtifactEventPayloadMap = { 'artifact.create.requested': ArtifactEventPayloadWithRequired<'operationId' | 'workspaceId' | 'profileRef'>; 'artifact.created': ArtifactStatusEventPayload<'draft'> & ArtifactEventPayloadWithRequired<'logicalArtifactId' | 'contentHash'>; 'artifact.deduplicated': ArtifactEventPayloadWithRequired<'operationId' | 'artifactId' | 'versionId' | 'contentHash' | 'deduplicated'> & { dedupli... | Public type alias for Artifact Event Payload Map; the declaration contains its complete type expression. |
ArtifactEventPublication | type | type ArtifactEventPublication = { id: string; type: TType; timestamp: string; payload: ArtifactEventPayloadMap[TType]; workspaceId?: string; sessionId?: string; runId?: string; agentId?: string; } | Public type alias for Artifact Event Publication; the declaration contains its complete type expression. |
ArtifactFrameworkEvent | type | type ArtifactFrameworkEvent = Omit<FrameworkEvent<ArtifactEventPayloadMap[TType]>, 'type'> & { type: TType; } | Public type alias for Artifact Framework Event; the declaration contains its complete type expression. |
ArtifactFrameworkEventType | type | type ArtifactFrameworkEventType = 'artifact.create.requested' | 'artifact.created' | 'artifact.deduplicated' | 'artifact.create.failed' | 'artifact.read.requested' | 'artifact.read.completed' | 'artifact.version.created' | 'artifact.finalized' | 'artifact.archived' | 'artifact.invalidated' | 'artifact.delete.requested' | 'artifact.delete.blocked' | 'artifact.deleted' | 'artifact.delete.failed' | 'artifact.lineage.... | Public type alias for Artifact Framework Event Type; the declaration contains its complete type expression. |
ArtifactEventPayload
Artifact Event Payload interface with 19 public fields or methods.
- Kind: interface
- Import:
import type { ArtifactEventPayload } from '@codesoul-co/hypha-core'; - Source module:
contracts/artifact-events
Declaration
export interface ArtifactEventPayload {
operationId?: string;
artifactId?: string;
versionId?: string;
logicalArtifactId?: string;
profileRef?: SpecRef;
workspaceId?: string;
executionId?: string;
artifactRefs?: string[];
contentHash?: string;
sizeBytes?: number;
status?: ArtifactStatus;
deduplicated?: boolean;
candidateObjects?: number;
deletedObjects?: number;
missingObjects?: number;
reclaimedBytes?: number;
reason?: string;
error?: NormalizedArtifactError;
metadata?: Record<string, unknown>;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
artifactId | property | artifactId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
artifactRefs | property | artifactRefs?: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
candidateObjects | property | candidateObjects?: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
contentHash | property | contentHash?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
deduplicated | property | deduplicated?: boolean | Public property; its type, readonly modifier and optionality are shown in the signature. |
deletedObjects | property | deletedObjects?: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
error | property | error?: NormalizedArtifactError | Public property; its type, readonly modifier and optionality are shown in the signature. |
executionId | property | executionId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
logicalArtifactId | property | logicalArtifactId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
metadata | property | metadata?: Record<string, unknown> | Public property; its type, readonly modifier and optionality are shown in the signature. |
missingObjects | property | missingObjects?: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
operationId | property | operationId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
profileRef | property | profileRef?: SpecRef | Public property; its type, readonly modifier and optionality are shown in the signature. |
reason | property | reason?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
reclaimedBytes | property | reclaimedBytes?: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
sizeBytes | property | sizeBytes?: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
status | property | status?: ArtifactStatus | Public property; its type, readonly modifier and optionality are shown in the signature. |
versionId | property | versionId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
workspaceId | property | workspaceId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
ArtifactEventPublisher
Runtime-owned adapters must durably and idempotently publish by publication ID.
- Kind: interface
- Import:
import type { ArtifactEventPublisher } from '@codesoul-co/hypha-core'; - Source module:
contracts/artifact-events
Declaration
export interface ArtifactEventPublisher {
publish(publication: ArtifactEventPublication): Promise<void>;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
publish | method | publish(publication: ArtifactEventPublication): Promise<void> | Public method; parameters and return type are shown in the signature. |
ArtifactEventCreateInput
Public type alias for Artifact Event Create Input; the declaration contains its complete type expression.
- Kind: type
- Import:
import type { ArtifactEventCreateInput } from '@codesoul-co/hypha-core'; - Source module:
contracts/artifact-events
Declaration
export type ArtifactEventCreateInput<TType extends ArtifactFrameworkEventType = ArtifactFrameworkEventType> = Omit<EventCreateInput<ArtifactEventPayloadMap[TType]>, 'type'> & {
type: TType;
};ArtifactEventPayloadMap
Public type alias for Artifact Event Payload Map; the declaration contains its complete type expression.
- Kind: type
- Import:
import type { ArtifactEventPayloadMap } from '@codesoul-co/hypha-core'; - Source module:
contracts/artifact-events
Declaration
export type ArtifactEventPayloadMap = {
'artifact.create.requested': ArtifactEventPayloadWithRequired<'operationId' | 'workspaceId' | 'profileRef'>;
'artifact.created': ArtifactStatusEventPayload<'draft'> & ArtifactEventPayloadWithRequired<'logicalArtifactId' | 'contentHash'>;
'artifact.deduplicated': ArtifactEventPayloadWithRequired<'operationId' | 'artifactId' | 'versionId' | 'contentHash' | 'deduplicated'> & {
deduplicated: true;
};
'artifact.create.failed': ArtifactEventPayloadWithRequired<'operationId' | 'error'>;
'artifact.read.requested': ArtifactEventPayloadWithRequired<'artifactId'>;
'artifact.read.completed': ArtifactEventPayloadWithRequired<'artifactId' | 'versionId' | 'contentHash' | 'sizeBytes'>;
'artifact.version.created': ArtifactEventPayloadWithRequired<'operationId' | 'artifactId' | 'versionId' | 'logicalArtifactId' | 'contentHash' | 'status'>;
'artifact.finalized': ArtifactStatusEventPayload<'final'>;
'artifact.archived': ArtifactStatusEventPayload<'archived'>;
'artifact.invalidated': ArtifactStatusEventPayload<'invalidated'>;
'artifact.delete.requested': ArtifactEventPayloadWithRequired<'operationId' | 'artifactId'>;
'artifact.delete.blocked': ArtifactEventPayloadWithRequired<'operationId' | 'artifactId' | 'error'>;
'artifact.deleted': ArtifactEventPayloadWithRequired<'operationId' | 'artifactId' | 'status'> & {
status: 'deleted';
};
'artifact.delete.failed': ArtifactEventPayloadWithRequired<'operationId' | 'artifactId' | 'error'>;
'artifact.lineage.recorded': ArtifactEventPayloadWithRequired<'artifactId' | 'artifactRefs'>;
'artifact.retention.expired': ArtifactEventPayloadWithRequired<'artifactId' | 'versionId'>;
'artifact.gc.completed': ArtifactEventPayloadWithRequired<'operationId' | 'candidateObjects' | 'deletedObjects' | 'missingObjects' | 'reclaimedBytes'>;
'artifact.gc.failed': ArtifactEventPayloadWithRequired<'operationId' | 'error'>;
};ArtifactEventPublication
Public type alias for Artifact Event Publication; the declaration contains its complete type expression.
- Kind: type
- Import:
import type { ArtifactEventPublication } from '@codesoul-co/hypha-core'; - Source module:
contracts/artifact-events
Declaration
export type ArtifactEventPublication<TType extends ArtifactFrameworkEventType = ArtifactFrameworkEventType> = {
id: string;
type: TType;
timestamp: string;
payload: ArtifactEventPayloadMap[TType];
workspaceId?: string;
sessionId?: string;
runId?: string;
agentId?: string;
};ArtifactFrameworkEvent
Public type alias for Artifact Framework Event; the declaration contains its complete type expression.
- Kind: type
- Import:
import type { ArtifactFrameworkEvent } from '@codesoul-co/hypha-core'; - Source module:
contracts/artifact-events
Declaration
export type ArtifactFrameworkEvent<TType extends ArtifactFrameworkEventType = ArtifactFrameworkEventType> = Omit<FrameworkEvent<ArtifactEventPayloadMap[TType]>, 'type'> & {
type: TType;
};ArtifactFrameworkEventType
Public type alias for Artifact Framework Event Type; the declaration contains its complete type expression.
- Kind: type
- Import:
import type { ArtifactFrameworkEventType } from '@codesoul-co/hypha-core'; - Source module:
contracts/artifact-events
Declaration
export type ArtifactFrameworkEventType = 'artifact.create.requested' | 'artifact.created' | 'artifact.deduplicated' | 'artifact.create.failed' | 'artifact.read.requested' | 'artifact.read.completed' | 'artifact.version.created' | 'artifact.finalized' | 'artifact.archived' | 'artifact.invalidated' | 'artifact.delete.requested' | 'artifact.delete.blocked' | 'artifact.deleted' | 'artifact.delete.failed' | 'artifact.lineage.recorded' | 'artifact.retention.expired' | 'artifact.gc.completed' | 'artifact.gc.failed';