Skip to content

@codesoul-co/hypha-core / modules/artifact/events

Using this module

Use the Events module for creating, recording, or reading Event contracts. It exports 11 constants, 4 functions, 1 interface.

Import from the package entrypoint

ts
import {
  artifactEventJsonSchemas,
  artifactEventPayloadJsonSchema,
  artifactEventPayloadRequirements,
  artifactEventPayloadSchema,
  artifactEventPublicationJsonSchema,
  artifactEventPublicationSchema,
  artifactFrameworkEventEnvelopeSchema,
  artifactFrameworkEventExample,
} from '@codesoul-co/hypha-core';

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

// The complete export list is documented below.

Usage patterns

  • Use the 1 type/interface export as static contracts in application code, adapters, or tests. Import them with import type; they do not exist at runtime.
  • The module exposes 4 functions as direct operation entrypoints. Every overload, required/optional parameter, and return type is documented below.
  • The 11 constant/enum exports provide stable values, schemas, definitions, or defaults. Reuse these exports instead of copying internal values into an application.

Runtime validation example

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

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

Parse untrusted configuration, network, or persisted input with the runtime schema before passing it to functions or classes that expect a validated contract.

Public exports

SymbolKindSignatureDescription
artifactEventJsonSchemasconstantconst artifactEventJsonSchemas: Record<string, JsonSchema>Artifact Event JSON Schemas constant exported by the modules/artifact/events module.
artifactEventPayloadJsonSchemaconstantconst artifactEventPayloadJsonSchema: JsonSchemaJSON Schema for Artifact Event Payload.
artifactEventPayloadRequirementsconstantconst artifactEventPayloadRequirements: { readonly 'artifact.create.requested': { readonly required: readonly ["operationId", "workspaceId", "profileRef"]; }; readonly 'artifact.created': { readonly required: readonly ["operationId", "artifactId", "versionId", "logicalArtifactId", "contentHash", "status"]; readonly status: "draft"; }; readonly 'artifact.deduplicated': { readonly required: readonly ["operationId", ...Artifact Event Payload Requirements constant exported by the modules/artifact/events module.
artifactEventPayloadSchemaconstantconst artifactEventPayloadSchema: z.ZodEffects<z.ZodObject<{ operationId: z.ZodOptional<z.ZodString>; artifactId: z.ZodOptional<z.ZodString>; versionId: z.ZodOptional<z.ZodString>; logicalArtifactId: z.ZodOptional<z.ZodString>; profileRef: z.ZodOptional<z.ZodObject<{ id: z.ZodString; version: z.ZodOptional<z.ZodString>; revision: z.ZodOptional<z.ZodString>; }, "strip", z.ZodTypeAny, { id: string; version?: string ...Runtime schema for Artifact Event Payload.
artifactEventPublicationJsonSchemaconstantconst artifactEventPublicationJsonSchema: JsonSchemaJSON Schema for Artifact Event Publication.
artifactEventPublicationSchemaconstantconst artifactEventPublicationSchema: z.ZodObject<{ id: z.ZodString; type: z.ZodEnum<["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", "artif...Runtime schema for Artifact Event Publication.
artifactFrameworkEventEnvelopeSchemaconstantconst artifactFrameworkEventEnvelopeSchema: z.ZodObject<{ id: z.ZodString; type: z.ZodEnum<["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", ...Runtime schema for Artifact Framework Event Envelope.
artifactFrameworkEventExampleconstantconst artifactFrameworkEventExample: ArtifactFrameworkEvent<"artifact.created">Valid example value for Artifact Framework Event.
artifactFrameworkEventJsonSchemaconstantconst artifactFrameworkEventJsonSchema: JsonSchemaJSON Schema for Artifact Framework Event.
artifactFrameworkEventTypesconstantconst artifactFrameworkEventTypes: readonly ["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.rec...Artifact Framework Event Types constant exported by the modules/artifact/events module.
artifactFrameworkEventTypeSchemaconstantconst artifactFrameworkEventTypeSchema: z.ZodEnum<["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.linea...Runtime schema for Artifact Framework Event Type.
createArtifactFrameworkEventfunctioncreateArtifactFrameworkEvent<TType extends ArtifactFrameworkEventType>(input: ArtifactEventCreateInput<TType>): ArtifactFrameworkEvent<TType>Create Artifact Framework Event function with 1 public call signature; parameters and return types are listed below.
validateArtifactEventPayloadForTypefunctionvalidateArtifactEventPayloadForType<TType extends ArtifactFrameworkEventType>(type: TType, input: unknown): ArtifactEventPayloadMap[TType]Validate Artifact Event Payload For Type function with 1 public call signature; parameters and return types are listed below.
validateArtifactEventPublicationfunctionvalidateArtifactEventPublication(input: unknown): ArtifactEventPublicationValidate Artifact Event Publication function with 1 public call signature; parameters and return types are listed below.
validateArtifactFrameworkEventfunctionvalidateArtifactFrameworkEvent(input: unknown): ArtifactFrameworkEventValidate Artifact Framework Event function with 1 public call signature; parameters and return types are listed below.
ArtifactEventPayloadRequirementinterfaceinterface ArtifactEventPayloadRequirementArtifact Event Payload Requirement interface with 5 public fields or methods.

artifactEventJsonSchemas

Artifact Event JSON Schemas constant exported by the modules/artifact/events module.

  • Kind: constant
  • Import: import { artifactEventJsonSchemas } from '@codesoul-co/hypha-core';
  • Source module: modules/artifact/events

Declaration

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

artifactEventPayloadJsonSchema

JSON Schema for Artifact Event Payload.

  • Kind: constant
  • Import: import { artifactEventPayloadJsonSchema } from '@codesoul-co/hypha-core';
  • Source module: modules/artifact/events

Declaration

text
export declare const artifactEventPayloadJsonSchema: JsonSchema;

artifactEventPayloadRequirements

Artifact Event Payload Requirements constant exported by the modules/artifact/events module.

  • Kind: constant
  • Import: import { artifactEventPayloadRequirements } from '@codesoul-co/hypha-core';
  • Source module: modules/artifact/events

Declaration

text
export declare const artifactEventPayloadRequirements: { readonly 'artifact.create.requested': { readonly required: readonly ["operationId", "workspaceId", "profileRef"]; }; readonly 'artifact.created': { readonly required: readonly ["operationId", "artifactId", "versionId", "logicalArtifactId", "contentHash", "status"]; readonly status: "draft"; }; readonly 'artifact.deduplicated': { readonly required: readonly ["operationId", "artifactId", "versionId", "contentHash", "deduplicated"]; readonly deduplicated: true; }; readonly 'artifact.create.failed': { readonly required: readonly ["operationId", "error"]; }; readonly 'artifact.read.requested': { readonly required: readonly ["artifactId"]; }; readonly 'artifact.read.completed': { readonly required: readonly ["artifactId", "versionId", "contentHash", "sizeBytes"]; }; readonly 'artifact.version.created': { readonly required: readonly ["operationId", "artifactId", "versionId", "logicalArtifactId", "contentHash", "status"]; }; readonly 'artifact.finalized': { readonly required: readonly ["operationId", "artifactId", "versionId", "status"]; readonly status: "final"; }; readonly 'artifact.archived': { readonly required: readonly ["operationId", "artifactId", "versionId", "status"]; readonly status: "archived"; }; readonly 'artifact.invalidated': { readonly required: readonly ["operationId", "artifactId", "versionId", "status"]; readonly status: "invalidated"; }; readonly 'artifact.delete.requested': { readonly required: readonly ["operationId", "artifactId"]; }; readonly 'artifact.delete.blocked': { readonly required: readonly ["operationId", "artifactId", "error"]; readonly errorCodes: readonly ["ARTIFACT_DELETE_BLOCKED"]; }; readonly 'artifact.deleted': { readonly required: readonly ["operationId", "artifactId", "status"]; readonly status: "deleted"; }; readonly 'artifact.delete.failed': { readonly required: readonly ["operationId", "artifactId", "error"]; }; readonly 'artifact.lineage.recorded': { readonly required: readonly ["artifactId", "artifactRefs"]; readonly nonEmptyArtifactRefs: true; }; readonly 'artifact.retention.expired': { readonly required: readonly ["artifactId", "versionId"]; }; readonly 'artifact.gc.completed': { readonly required: readonly ["operationId", "candidateObjects", "deletedObjects", "missingObjects", "reclaimedBytes"]; }; readonly 'artifact.gc.failed': { readonly required: readonly ["operationId", "error"]; }; };

artifactEventPayloadSchema

Runtime schema for Artifact Event Payload.

  • Kind: constant
  • Import: import { artifactEventPayloadSchema } from '@codesoul-co/hypha-core';
  • Source module: modules/artifact/events

Declaration

text
// Exact type resolved from the package entrypoint; see source for the compiler expansion.
export declare const artifactEventPayloadSchema: (typeof import('@codesoul-co/hypha-core'))['artifactEventPayloadSchema'];

This compiler-expanded constant type is compacted. Its public name, top-level type, and source location remain here; use the module’s exported interfaces, types, or runtime schema for input/output fields.

artifactEventPublicationJsonSchema

JSON Schema for Artifact Event Publication.

  • Kind: constant
  • Import: import { artifactEventPublicationJsonSchema } from '@codesoul-co/hypha-core';
  • Source module: modules/artifact/events

Declaration

text
export declare const artifactEventPublicationJsonSchema: JsonSchema;

artifactEventPublicationSchema

Runtime schema for Artifact Event Publication.

  • Kind: constant
  • Import: import { artifactEventPublicationSchema } from '@codesoul-co/hypha-core';
  • Source module: modules/artifact/events

Declaration

text
export declare const artifactEventPublicationSchema: z.ZodObject<{ id: z.ZodString; type: z.ZodEnum<["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"]>; timestamp: z.ZodString; workspaceId: z.ZodOptional<z.ZodString>; sessionId: z.ZodOptional<z.ZodString>; runId: z.ZodOptional<z.ZodString>; agentId: z.ZodOptional<z.ZodString>; payload: z.ZodEffects<z.ZodUnknown, {} | null, unknown>; }, "strict", z.ZodTypeAny, { type: "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"; id: string; timestamp: string; payload: {} | null; workspaceId?: string | undefined; sessionId?: string | undefined; runId?: string | undefined; agentId?: string | undefined; }, { type: "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"; id: string; timestamp: string; workspaceId?: string | undefined; sessionId?: string | undefined; runId?: string | undefined; agentId?: string | undefined; payload?: unknown; }>;

artifactFrameworkEventEnvelopeSchema

Runtime schema for Artifact Framework Event Envelope.

  • Kind: constant
  • Import: import { artifactFrameworkEventEnvelopeSchema } from '@codesoul-co/hypha-core';
  • Source module: modules/artifact/events

Declaration

text
export declare const artifactFrameworkEventEnvelopeSchema: z.ZodObject<{ id: z.ZodString; type: z.ZodEnum<["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"]>; workspaceId: z.ZodOptional<z.ZodString>; sessionId: z.ZodOptional<z.ZodString>; runId: z.ZodString; stepId: z.ZodOptional<z.ZodString>; agentId: z.ZodOptional<z.ZodString>; fsmState: z.ZodOptional<z.ZodString>; timestamp: z.ZodString; payload: z.ZodEffects<z.ZodUnknown, {} | null, unknown>; metadata: z.ZodOptional<z.ZodEffects<z.ZodRecord<z.ZodString, z.ZodUnknown>, Record<string, unknown>, Record<string, unknown>>>; }, "strict", z.ZodTypeAny, { type: "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"; id: string; runId: string; timestamp: string; payload: {} | null; workspaceId?: string | undefined; metadata?: Record<string, unknown> | undefined; sessionId?: string | undefined; stepId?: string | undefined; agentId?: string | undefined; fsmState?: string | undefined; }, { type: "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"; id: string; runId: string; timestamp: string; workspaceId?: string | undefined; metadata?: Record<string, unknown> | undefined; sessionId?: string | undefined; stepId?: string | undefined; agentId?: string | undefined; fsmState?: string | undefined; payload?: unknown; }>;

artifactFrameworkEventExample

Valid example value for Artifact Framework Event.

  • Kind: constant
  • Import: import { artifactFrameworkEventExample } from '@codesoul-co/hypha-core';
  • Source module: modules/artifact/events

Declaration

text
export declare const artifactFrameworkEventExample: ArtifactFrameworkEvent<"artifact.created">;

artifactFrameworkEventJsonSchema

JSON Schema for Artifact Framework Event.

  • Kind: constant
  • Import: import { artifactFrameworkEventJsonSchema } from '@codesoul-co/hypha-core';
  • Source module: modules/artifact/events

Declaration

text
export declare const artifactFrameworkEventJsonSchema: JsonSchema;

artifactFrameworkEventTypes

Artifact Framework Event Types constant exported by the modules/artifact/events module.

  • Kind: constant
  • Import: import { artifactFrameworkEventTypes } from '@codesoul-co/hypha-core';
  • Source module: modules/artifact/events

Declaration

text
export declare const artifactFrameworkEventTypes: readonly ["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"];

artifactFrameworkEventTypeSchema

Runtime schema for Artifact Framework Event Type.

  • Kind: constant
  • Import: import { artifactFrameworkEventTypeSchema } from '@codesoul-co/hypha-core';
  • Source module: modules/artifact/events

Declaration

text
export declare const artifactFrameworkEventTypeSchema: z.ZodEnum<["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"]>;

createArtifactFrameworkEvent

Create Artifact Framework Event function with 1 public call signature; parameters and return types are listed below.

  • Kind: function
  • Import: import { createArtifactFrameworkEvent } from '@codesoul-co/hypha-core';
  • Source module: modules/artifact/events

Declaration

text
export declare function createArtifactFrameworkEvent<TType extends ArtifactFrameworkEventType>(input: ArtifactEventCreateInput<TType>): ArtifactFrameworkEvent<TType>;

Call signature

text
createArtifactFrameworkEvent<TType extends ArtifactFrameworkEventType>(input: ArtifactEventCreateInput<TType>): ArtifactFrameworkEvent<TType>

Parameters

ParameterTypeRequiredDescription
inputArtifactEventCreateInput<TType>YesRequired parameter; accepted values are defined by the type column.

Returns

  • Type: ArtifactFrameworkEvent<TType>
  • Description: The return contract is defined by the type shown above.

validateArtifactEventPayloadForType

Validate Artifact Event Payload For Type function with 1 public call signature; parameters and return types are listed below.

  • Kind: function
  • Import: import { validateArtifactEventPayloadForType } from '@codesoul-co/hypha-core';
  • Source module: modules/artifact/events

Declaration

text
export declare function validateArtifactEventPayloadForType<TType extends ArtifactFrameworkEventType>(type: TType, input: unknown): ArtifactEventPayloadMap[TType];

Call signature

text
validateArtifactEventPayloadForType<TType extends ArtifactFrameworkEventType>(type: TType, input: unknown): ArtifactEventPayloadMap[TType]

Parameters

ParameterTypeRequiredDescription
typeTTypeYesRequired parameter; accepted values are defined by the type column.
inputunknownYesRequired parameter; accepted values are defined by the type column.

Returns

  • Type: ArtifactEventPayloadMap[TType]
  • Description: The return contract is defined by the type shown above.

validateArtifactEventPublication

Validate Artifact Event Publication function with 1 public call signature; parameters and return types are listed below.

  • Kind: function
  • Import: import { validateArtifactEventPublication } from '@codesoul-co/hypha-core';
  • Source module: modules/artifact/events

Declaration

text
export declare function validateArtifactEventPublication(input: unknown): ArtifactEventPublication;

Call signature

text
validateArtifactEventPublication(input: unknown): ArtifactEventPublication

Parameters

ParameterTypeRequiredDescription
inputunknownYesRequired parameter; accepted values are defined by the type column.

Returns

  • Type: ArtifactEventPublication
  • Description: The return contract is defined by the type shown above.

validateArtifactFrameworkEvent

Validate Artifact Framework Event function with 1 public call signature; parameters and return types are listed below.

  • Kind: function
  • Import: import { validateArtifactFrameworkEvent } from '@codesoul-co/hypha-core';
  • Source module: modules/artifact/events

Declaration

text
export declare function validateArtifactFrameworkEvent(input: unknown): ArtifactFrameworkEvent;

Call signature

text
validateArtifactFrameworkEvent(input: unknown): ArtifactFrameworkEvent

Parameters

ParameterTypeRequiredDescription
inputunknownYesRequired parameter; accepted values are defined by the type column.

Returns

  • Type: ArtifactFrameworkEvent
  • Description: The return contract is defined by the type shown above.

ArtifactEventPayloadRequirement

Artifact Event Payload Requirement interface with 5 public fields or methods.

  • Kind: interface
  • Import: import type { ArtifactEventPayloadRequirement } from '@codesoul-co/hypha-core';
  • Source module: modules/artifact/events

Declaration

text
export interface ArtifactEventPayloadRequirement {
    required: readonly (keyof ArtifactEventPayload)[];
    status?: ArtifactEventPayload['status'];
    deduplicated?: true;
    nonEmptyArtifactRefs?: boolean;
    errorCodes?: readonly string[];
}

Contract members

MemberKindSignatureDescription
deduplicatedpropertydeduplicated?: truePublic property; its type, readonly modifier and optionality are shown in the signature.
errorCodespropertyerrorCodes?: readonly string[]Public property; its type, readonly modifier and optionality are shown in the signature.
nonEmptyArtifactRefspropertynonEmptyArtifactRefs?: booleanPublic property; its type, readonly modifier and optionality are shown in the signature.
requiredpropertyrequired: readonly (keyof ArtifactEventPayload)[]Public property; its type, readonly modifier and optionality are shown in the signature.
statuspropertystatus?: import("/Users/erwin/Downloads/codespace/Hypha/packages/core/dist/index").ArtifactStatusPublic property; its type, readonly modifier and optionality are shown in the signature.