Skip to content

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

Using this module

Use the Events module for declaring and enforcing workspace scope boundaries. It exports 6 constants, 3 functions.

Import from the package entrypoint

ts
import {
  workspaceEventJsonSchemas,
  workspaceEventPayloadRequirements,
  workspaceFrameworkEventExample,
  workspaceFrameworkEventJsonSchema,
  workspaceFrameworkEventTypes,
  workspaceFrameworkEventTypeSchema,
  createWorkspaceFrameworkEvent,
  validateWorkspaceEventPayloadForType,
} from '@codesoul-co/hypha-core';

// The complete export list is documented below.

Usage patterns

  • The module exposes 3 functions as direct operation entrypoints. Every overload, required/optional parameter, and return type is documented below.
  • The 6 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 { workspaceFrameworkEventTypeSchema } from '@codesoul-co/hypha-core';

declare function loadExternalInput(): unknown;
const input: unknown = loadExternalInput();
const parsed = workspaceFrameworkEventTypeSchema.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
workspaceEventJsonSchemasconstantconst workspaceEventJsonSchemas: Record<string, JsonSchema>Workspace Event JSON Schemas constant exported by the modules/workspace/events module.
workspaceEventPayloadRequirementsconstantconst workspaceEventPayloadRequirements: { readonly 'workspace.create.requested': { readonly required: readonly ["operationId", "profileRef"]; }; readonly 'workspace.created': { readonly required: readonly ["operationId", "profileRef", "status"]; }; readonly 'workspace.ready': { readonly required: readonly ["operationId", "status"]; readonly status: "ready"; }; readonly 'workspace.busy': { readonly required: reado...Workspace Event Payload Requirements constant exported by the modules/workspace/events module.
workspaceFrameworkEventExampleconstantconst workspaceFrameworkEventExample: WorkspaceFrameworkEvent<"workspace.ready">Valid example value for Workspace Framework Event.
workspaceFrameworkEventJsonSchemaconstantconst workspaceFrameworkEventJsonSchema: JsonSchemaJSON Schema for Workspace Framework Event.
workspaceFrameworkEventTypesconstantconst workspaceFrameworkEventTypes: readonly ["workspace.create.requested", "workspace.created", "workspace.ready", "workspace.busy", "workspace.path.resolved", "workspace.path.denied", "workspace.quota.exceeded", "workspace.snapshot.requested", "workspace.snapshot.created", "workspace.snapshot.failed", "workspace.restore.requested", "workspace.restored", "workspace.restore.failed", "workspace.patch.checked", "wor...Workspace Framework Event Types constant exported by the modules/workspace/events module.
workspaceFrameworkEventTypeSchemaconstantconst workspaceFrameworkEventTypeSchema: z.ZodEnum<["workspace.create.requested", "workspace.created", "workspace.ready", "workspace.busy", "workspace.path.resolved", "workspace.path.denied", "workspace.quota.exceeded", "workspace.snapshot.requested", "workspace.snapshot.created", "workspace.snapshot.failed", "workspace.restore.requested", "workspace.restored", "workspace.restore.failed", "workspace.patch.checked"...Runtime schema for Workspace Framework Event Type.
createWorkspaceFrameworkEventfunctioncreateWorkspaceFrameworkEvent<TType extends WorkspaceFrameworkEventType>(input: WorkspaceEventCreateInput<TType>): WorkspaceFrameworkEvent<TType>Create Workspace Framework Event function with 1 public call signature; parameters and return types are listed below.
validateWorkspaceEventPayloadForTypefunctionvalidateWorkspaceEventPayloadForType<TType extends WorkspaceFrameworkEventType>(type: TType, input: unknown): WorkspaceEventPayloadMap[TType]Validate Workspace Event Payload For Type function with 1 public call signature; parameters and return types are listed below.
validateWorkspaceFrameworkEventfunctionvalidateWorkspaceFrameworkEvent(input: unknown): WorkspaceFrameworkEventValidate Workspace Framework Event function with 1 public call signature; parameters and return types are listed below.

workspaceEventJsonSchemas

Workspace Event JSON Schemas constant exported by the modules/workspace/events module.

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

Declaration

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

workspaceEventPayloadRequirements

Workspace Event Payload Requirements constant exported by the modules/workspace/events module.

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

Declaration

text
export declare const workspaceEventPayloadRequirements: { readonly 'workspace.create.requested': { readonly required: readonly ["operationId", "profileRef"]; }; readonly 'workspace.created': { readonly required: readonly ["operationId", "profileRef", "status"]; }; readonly 'workspace.ready': { readonly required: readonly ["operationId", "status"]; readonly status: "ready"; }; readonly 'workspace.busy': { readonly required: readonly ["operationId", "status"]; readonly status: "busy"; }; readonly 'workspace.path.resolved': { readonly required: readonly ["operationId"]; }; readonly 'workspace.path.denied': { readonly required: readonly ["operationId", "error"]; }; readonly 'workspace.quota.exceeded': { readonly required: readonly ["operationId"]; readonly atLeastOne: readonly ["bytes", "files"]; }; readonly 'workspace.snapshot.requested': { readonly required: readonly ["operationId"]; }; readonly 'workspace.snapshot.created': { readonly required: readonly ["operationId", "snapshotManifestHash", "artifactRefs"]; readonly nonEmptyArtifactRefs: true; }; readonly 'workspace.snapshot.failed': { readonly required: readonly ["operationId", "error"]; }; readonly 'workspace.restore.requested': { readonly required: readonly ["operationId", "artifactRefs"]; readonly nonEmptyArtifactRefs: true; }; readonly 'workspace.restored': { readonly required: readonly ["operationId", "workspaceSnapshotHash"]; }; readonly 'workspace.restore.failed': { readonly required: readonly ["operationId", "error"]; }; readonly 'workspace.patch.checked': { readonly required: readonly ["operationId"]; }; readonly 'workspace.patch.applied': { readonly required: readonly ["operationId", "workspaceSnapshotHash"]; }; readonly 'workspace.patch.conflict': { readonly required: readonly ["operationId"]; }; readonly 'workspace.cleanup.started': { readonly required: readonly ["operationId"]; }; readonly 'workspace.cleanup.completed': { readonly required: readonly ["operationId"]; }; readonly 'workspace.cleanup.failed': { readonly required: readonly ["operationId", "error"]; }; };

workspaceFrameworkEventExample

Valid example value for Workspace Framework Event.

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

Declaration

text
export declare const workspaceFrameworkEventExample: WorkspaceFrameworkEvent<"workspace.ready">;

workspaceFrameworkEventJsonSchema

JSON Schema for Workspace Framework Event.

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

Declaration

text
export declare const workspaceFrameworkEventJsonSchema: JsonSchema;

workspaceFrameworkEventTypes

Workspace Framework Event Types constant exported by the modules/workspace/events module.

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

Declaration

text
export declare const workspaceFrameworkEventTypes: readonly ["workspace.create.requested", "workspace.created", "workspace.ready", "workspace.busy", "workspace.path.resolved", "workspace.path.denied", "workspace.quota.exceeded", "workspace.snapshot.requested", "workspace.snapshot.created", "workspace.snapshot.failed", "workspace.restore.requested", "workspace.restored", "workspace.restore.failed", "workspace.patch.checked", "workspace.patch.applied", "workspace.patch.conflict", "workspace.cleanup.started", "workspace.cleanup.completed", "workspace.cleanup.failed"];

workspaceFrameworkEventTypeSchema

Runtime schema for Workspace Framework Event Type.

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

Declaration

text
export declare const workspaceFrameworkEventTypeSchema: z.ZodEnum<["workspace.create.requested", "workspace.created", "workspace.ready", "workspace.busy", "workspace.path.resolved", "workspace.path.denied", "workspace.quota.exceeded", "workspace.snapshot.requested", "workspace.snapshot.created", "workspace.snapshot.failed", "workspace.restore.requested", "workspace.restored", "workspace.restore.failed", "workspace.patch.checked", "workspace.patch.applied", "workspace.patch.conflict", "workspace.cleanup.started", "workspace.cleanup.completed", "workspace.cleanup.failed"]>;

createWorkspaceFrameworkEvent

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

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

Declaration

text
export declare function createWorkspaceFrameworkEvent<TType extends WorkspaceFrameworkEventType>(input: WorkspaceEventCreateInput<TType>): WorkspaceFrameworkEvent<TType>;

Call signature

text
createWorkspaceFrameworkEvent<TType extends WorkspaceFrameworkEventType>(input: WorkspaceEventCreateInput<TType>): WorkspaceFrameworkEvent<TType>

Parameters

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

Returns

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

validateWorkspaceEventPayloadForType

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

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

Declaration

text
export declare function validateWorkspaceEventPayloadForType<TType extends WorkspaceFrameworkEventType>(type: TType, input: unknown): WorkspaceEventPayloadMap[TType];

Call signature

text
validateWorkspaceEventPayloadForType<TType extends WorkspaceFrameworkEventType>(type: TType, input: unknown): WorkspaceEventPayloadMap[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: WorkspaceEventPayloadMap[TType]
  • Description: The return contract is defined by the type shown above.

validateWorkspaceFrameworkEvent

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

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

Declaration

text
export declare function validateWorkspaceFrameworkEvent(input: unknown): WorkspaceFrameworkEvent;

Call signature

text
validateWorkspaceFrameworkEvent(input: unknown): WorkspaceFrameworkEvent

Parameters

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

Returns

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