@codesoul-co/hypha-core / contracts/runtime-checkpoint
- Package index:
@codesoul-co/hypha-core - Source:
packages/core/src/contracts/runtime-checkpoint.ts - Exports: 16
Using this module
Use the Runtime checkpoint module for declaring and runtime-validating contracts. It exports 4 constants, 8 interfaces, 4 types.
Import from the package entrypoint
import {
RUNTIME_CHECKPOINT_COMPRESSIONS,
RUNTIME_CHECKPOINT_DISPOSITIONS,
RUNTIME_CHECKPOINT_MODES,
RUNTIME_CHECKPOINT_REASONS,
} from '@codesoul-co/hypha-core';
import type {
RuntimeCheckpointCreateCommand,
RuntimeCheckpointCreateResult,
RuntimeCheckpointLoadRequest,
RuntimeCheckpointLoadResult,
RuntimeCheckpointPolicySpec,
RuntimeCheckpointPutResult,
RuntimeCheckpointRecord,
RuntimeCheckpointStore,
} from '@codesoul-co/hypha-core';
// The complete export list is documented below.Usage patterns
- Use the 12 type/interface exports as static contracts in application code, adapters, or tests. Import them with
import type; they do not exist at runtime. - The 4 constant/enum exports provide stable values, schemas, definitions, or defaults. Reuse these exports instead of copying internal values into an application.
Public exports
| Symbol | Kind | Signature | Description |
|---|---|---|---|
RUNTIME_CHECKPOINT_COMPRESSIONS | constant | const RUNTIME_CHECKPOINT_COMPRESSIONS: readonly ["none", "gzip", "zstd"] | RUNTIME CHECKPOINT COMPRESSIONS constant exported by the contracts/runtime-checkpoint module. |
RUNTIME_CHECKPOINT_DISPOSITIONS | constant | const RUNTIME_CHECKPOINT_DISPOSITIONS: readonly ["applied", "reused", "lease_unavailable"] | RUNTIME CHECKPOINT DISPOSITIONS constant exported by the contracts/runtime-checkpoint module. |
RUNTIME_CHECKPOINT_MODES | constant | const RUNTIME_CHECKPOINT_MODES: readonly ["none", "state_boundary", "every_n_events", "wait_boundary", "custom"] | RUNTIME CHECKPOINT MODES constant exported by the contracts/runtime-checkpoint module. |
RUNTIME_CHECKPOINT_REASONS | constant | const RUNTIME_CHECKPOINT_REASONS: readonly ["state_boundary", "human_wait", "signal_wait", "timer_wait", "manual", "failure"] | RUNTIME CHECKPOINT REASONS constant exported by the contracts/runtime-checkpoint module. |
RuntimeCheckpointCreateCommand | interface | interface RuntimeCheckpointCreateCommand | Runtime Checkpoint Create Command interface with 15 public fields or methods. |
RuntimeCheckpointCreateResult | interface | interface RuntimeCheckpointCreateResult | Runtime Checkpoint Create Result interface with 4 public fields or methods. |
RuntimeCheckpointLoadRequest | interface | interface RuntimeCheckpointLoadRequest | Runtime Checkpoint Load Request interface with 3 public fields or methods. |
RuntimeCheckpointLoadResult | interface | interface RuntimeCheckpointLoadResult | Runtime Checkpoint Load Result interface with 4 public fields or methods. |
RuntimeCheckpointPolicySpec | interface | interface RuntimeCheckpointPolicySpec | Runtime Checkpoint Policy Spec interface with 6 public fields or methods. |
RuntimeCheckpointPutResult | interface | interface RuntimeCheckpointPutResult | Runtime Checkpoint Put Result interface with 2 public fields or methods. |
RuntimeCheckpointRecord | interface | interface RuntimeCheckpointRecord | Runtime Checkpoint Record interface with 20 public fields or methods. |
RuntimeCheckpointStore | interface | interface RuntimeCheckpointStore | Runtime Checkpoint Store interface with 4 public fields or methods. |
RuntimeCheckpointCompression | type | type RuntimeCheckpointCompression = (typeof RUNTIME_CHECKPOINT_COMPRESSIONS)[number] | Public type alias for Runtime Checkpoint Compression; the declaration contains its complete type expression. |
RuntimeCheckpointDisposition | type | type RuntimeCheckpointDisposition = (typeof RUNTIME_CHECKPOINT_DISPOSITIONS)[number] | Public type alias for Runtime Checkpoint Disposition; the declaration contains its complete type expression. |
RuntimeCheckpointMode | type | type RuntimeCheckpointMode = (typeof RUNTIME_CHECKPOINT_MODES)[number] | Public type alias for Runtime Checkpoint Mode; the declaration contains its complete type expression. |
RuntimeCheckpointReason | type | type RuntimeCheckpointReason = (typeof RUNTIME_CHECKPOINT_REASONS)[number] | Public type alias for Runtime Checkpoint Reason; the declaration contains its complete type expression. |
RUNTIME_CHECKPOINT_COMPRESSIONS
RUNTIME CHECKPOINT COMPRESSIONS constant exported by the contracts/runtime-checkpoint module.
- Kind: constant
- Import:
import { RUNTIME_CHECKPOINT_COMPRESSIONS } from '@codesoul-co/hypha-core'; - Source module:
contracts/runtime-checkpoint
Declaration
export declare const RUNTIME_CHECKPOINT_COMPRESSIONS: readonly ["none", "gzip", "zstd"];RUNTIME_CHECKPOINT_DISPOSITIONS
RUNTIME CHECKPOINT DISPOSITIONS constant exported by the contracts/runtime-checkpoint module.
- Kind: constant
- Import:
import { RUNTIME_CHECKPOINT_DISPOSITIONS } from '@codesoul-co/hypha-core'; - Source module:
contracts/runtime-checkpoint
Declaration
export declare const RUNTIME_CHECKPOINT_DISPOSITIONS: readonly ["applied", "reused", "lease_unavailable"];RUNTIME_CHECKPOINT_MODES
RUNTIME CHECKPOINT MODES constant exported by the contracts/runtime-checkpoint module.
- Kind: constant
- Import:
import { RUNTIME_CHECKPOINT_MODES } from '@codesoul-co/hypha-core'; - Source module:
contracts/runtime-checkpoint
Declaration
export declare const RUNTIME_CHECKPOINT_MODES: readonly ["none", "state_boundary", "every_n_events", "wait_boundary", "custom"];RUNTIME_CHECKPOINT_REASONS
RUNTIME CHECKPOINT REASONS constant exported by the contracts/runtime-checkpoint module.
- Kind: constant
- Import:
import { RUNTIME_CHECKPOINT_REASONS } from '@codesoul-co/hypha-core'; - Source module:
contracts/runtime-checkpoint
Declaration
export declare const RUNTIME_CHECKPOINT_REASONS: readonly ["state_boundary", "human_wait", "signal_wait", "timer_wait", "manual", "failure"];RuntimeCheckpointCreateCommand
Runtime Checkpoint Create Command interface with 15 public fields or methods.
- Kind: interface
- Import:
import type { RuntimeCheckpointCreateCommand } from '@codesoul-co/hypha-core'; - Source module:
contracts/runtime-checkpoint
Declaration
export interface RuntimeCheckpointCreateCommand {
checkpointId: string;
scope: RuntimeScope;
ownerId: string;
leaseTtlMs: number;
workflowRevision: string;
processHash: string;
variablesHash: string;
dependencySnapshotRef: string;
toolContractSnapshotRef?: string;
workspaceSnapshotRef?: string;
contextSnapshotRefs?: string[];
reason: RuntimeCheckpointReason;
createdAt: string;
idempotencyKey?: string;
metadata?: Record<string, RuntimeJsonValue>;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
checkpointId | property | checkpointId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
contextSnapshotRefs | property | contextSnapshotRefs?: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
createdAt | property | createdAt: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
dependencySnapshotRef | property | dependencySnapshotRef: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
idempotencyKey | property | idempotencyKey?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
leaseTtlMs | property | leaseTtlMs: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
metadata | property | metadata?: Record<string, RuntimeJsonValue> | Public property; its type, readonly modifier and optionality are shown in the signature. |
ownerId | property | ownerId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
processHash | property | processHash: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
reason | property | reason: "manual" | "state_boundary" | "human_wait" | "signal_wait" | "timer_wait" | "failure" | Public property; its type, readonly modifier and optionality are shown in the signature. |
scope | property | scope: RuntimeScope | Public property; its type, readonly modifier and optionality are shown in the signature. |
toolContractSnapshotRef | property | toolContractSnapshotRef?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
variablesHash | property | variablesHash: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
workflowRevision | property | workflowRevision: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
workspaceSnapshotRef | property | workspaceSnapshotRef?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
RuntimeCheckpointCreateResult
Runtime Checkpoint Create Result interface with 4 public fields or methods.
- Kind: interface
- Import:
import type { RuntimeCheckpointCreateResult } from '@codesoul-co/hypha-core'; - Source module:
contracts/runtime-checkpoint
Declaration
export interface RuntimeCheckpointCreateResult {
checkpointId: string;
disposition: RuntimeCheckpointDisposition;
eventIds: string[];
record?: RuntimeCheckpointRecord;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
checkpointId | property | checkpointId: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
disposition | property | disposition: "applied" | "reused" | "lease_unavailable" | Public property; its type, readonly modifier and optionality are shown in the signature. |
eventIds | property | eventIds: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
record | property | record?: RuntimeCheckpointRecord | Public property; its type, readonly modifier and optionality are shown in the signature. |
RuntimeCheckpointLoadRequest
Runtime Checkpoint Load Request interface with 3 public fields or methods.
- Kind: interface
- Import:
import type { RuntimeCheckpointLoadRequest } from '@codesoul-co/hypha-core'; - Source module:
contracts/runtime-checkpoint
Declaration
export interface RuntimeCheckpointLoadRequest {
scope: RuntimeScope;
checkpointId?: string;
checkedAt: string;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
checkedAt | property | checkedAt: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
checkpointId | property | checkpointId?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
scope | property | scope: RuntimeScope | Public property; its type, readonly modifier and optionality are shown in the signature. |
RuntimeCheckpointLoadResult
Runtime Checkpoint Load Result interface with 4 public fields or methods.
- Kind: interface
- Import:
import type { RuntimeCheckpointLoadResult } from '@codesoul-co/hypha-core'; - Source module:
contracts/runtime-checkpoint
Declaration
export interface RuntimeCheckpointLoadResult {
record: RuntimeCheckpointRecord;
currentHeadSequence: number;
deltaFromSequence: number;
deltaEventCount: number;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
currentHeadSequence | property | currentHeadSequence: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
deltaEventCount | property | deltaEventCount: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
deltaFromSequence | property | deltaFromSequence: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
record | property | record: RuntimeCheckpointRecord | Public property; its type, readonly modifier and optionality are shown in the signature. |
RuntimeCheckpointPolicySpec
Runtime Checkpoint Policy Spec interface with 6 public fields or methods.
- Kind: interface
- Import:
import type { RuntimeCheckpointPolicySpec } from '@codesoul-co/hypha-core'; - Source module:
contracts/runtime-checkpoint
Declaration
export interface RuntimeCheckpointPolicySpec {
mode: RuntimeCheckpointMode;
everyNEvents?: number;
retainLast?: number;
persistWorkspaceSnapshot?: boolean;
persistContextRefs?: boolean;
compression?: RuntimeCheckpointCompression;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
compression | property | compression?: "none" | "gzip" | "zstd" | Public property; its type, readonly modifier and optionality are shown in the signature. |
everyNEvents | property | everyNEvents?: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
mode | property | mode: "none" | "custom" | "state_boundary" | "every_n_events" | "wait_boundary" | Public property; its type, readonly modifier and optionality are shown in the signature. |
persistContextRefs | property | persistContextRefs?: boolean | Public property; its type, readonly modifier and optionality are shown in the signature. |
persistWorkspaceSnapshot | property | persistWorkspaceSnapshot?: boolean | Public property; its type, readonly modifier and optionality are shown in the signature. |
retainLast | property | retainLast?: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
RuntimeCheckpointPutResult
Runtime Checkpoint Put Result interface with 2 public fields or methods.
- Kind: interface
- Import:
import type { RuntimeCheckpointPutResult } from '@codesoul-co/hypha-core'; - Source module:
contracts/runtime-checkpoint
Declaration
export interface RuntimeCheckpointPutResult {
record: RuntimeCheckpointRecord;
reused: boolean;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
record | property | record: RuntimeCheckpointRecord | Public property; its type, readonly modifier and optionality are shown in the signature. |
reused | property | reused: boolean | Public property; its type, readonly modifier and optionality are shown in the signature. |
RuntimeCheckpointRecord
Runtime Checkpoint Record interface with 20 public fields or methods.
- Kind: interface
- Import:
import type { RuntimeCheckpointRecord } from '@codesoul-co/hypha-core'; - Source module:
contracts/runtime-checkpoint
Declaration
export interface RuntimeCheckpointRecord {
id: string;
scope: RuntimeScope;
sequence: number;
workflowRevision: string;
processHash: string;
currentState: string;
variablesHash: string;
projectionVersion: string;
projectionSnapshot: RuntimeOrchestrationProjection;
dependencySnapshotRef: string;
toolContractSnapshotRef?: string;
workspaceSnapshotRef?: string;
contextSnapshotRefs?: string[];
pendingWaitRef?: string;
lastEventSequence: number;
reason: RuntimeCheckpointReason;
requestHash: string;
checksum: string;
createdAt: string;
metadata?: Record<string, RuntimeJsonValue>;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
checksum | property | checksum: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
contextSnapshotRefs | property | contextSnapshotRefs?: string[] | Public property; its type, readonly modifier and optionality are shown in the signature. |
createdAt | property | createdAt: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
currentState | property | currentState: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
dependencySnapshotRef | property | dependencySnapshotRef: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
id | property | id: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
lastEventSequence | property | lastEventSequence: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
metadata | property | metadata?: Record<string, RuntimeJsonValue> | Public property; its type, readonly modifier and optionality are shown in the signature. |
pendingWaitRef | property | pendingWaitRef?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
processHash | property | processHash: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
projectionSnapshot | property | projectionSnapshot: RuntimeOrchestrationProjection | Public property; its type, readonly modifier and optionality are shown in the signature. |
projectionVersion | property | projectionVersion: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
reason | property | reason: "manual" | "state_boundary" | "human_wait" | "signal_wait" | "timer_wait" | "failure" | Public property; its type, readonly modifier and optionality are shown in the signature. |
requestHash | property | requestHash: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
scope | property | scope: RuntimeScope | Public property; its type, readonly modifier and optionality are shown in the signature. |
sequence | property | sequence: number | Public property; its type, readonly modifier and optionality are shown in the signature. |
toolContractSnapshotRef | property | toolContractSnapshotRef?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
variablesHash | property | variablesHash: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
workflowRevision | property | workflowRevision: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
workspaceSnapshotRef | property | workspaceSnapshotRef?: string | Public property; its type, readonly modifier and optionality are shown in the signature. |
RuntimeCheckpointStore
Runtime Checkpoint Store interface with 4 public fields or methods.
- Kind: interface
- Import:
import type { RuntimeCheckpointStore } from '@codesoul-co/hypha-core'; - Source module:
contracts/runtime-checkpoint
Declaration
export interface RuntimeCheckpointStore {
put(record: RuntimeCheckpointRecord, idempotencyKey: string): Promise<RuntimeCheckpointPutResult>;
get(scope: RuntimeScope, checkpointId: string): Promise<RuntimeCheckpointRecord | null>;
latest(scope: RuntimeScope): Promise<RuntimeCheckpointRecord | null>;
list(scope: RuntimeScope, limit?: number): Promise<RuntimeCheckpointRecord[]>;
}Contract members
| Member | Kind | Signature | Description |
|---|---|---|---|
get | method | get(scope: RuntimeScope, checkpointId: string): Promise<RuntimeCheckpointRecord | null> | Public method; parameters and return type are shown in the signature. |
latest | method | latest(scope: RuntimeScope): Promise<RuntimeCheckpointRecord | null> | Public method; parameters and return type are shown in the signature. |
list | method | list(scope: RuntimeScope, limit?: number): Promise<RuntimeCheckpointRecord[]> | Public method; parameters and return type are shown in the signature. |
put | method | put(record: RuntimeCheckpointRecord, idempotencyKey: string): Promise<RuntimeCheckpointPutResult> | Public method; parameters and return type are shown in the signature. |
RuntimeCheckpointCompression
Public type alias for Runtime Checkpoint Compression; the declaration contains its complete type expression.
- Kind: type
- Import:
import type { RuntimeCheckpointCompression } from '@codesoul-co/hypha-core'; - Source module:
contracts/runtime-checkpoint
Declaration
export type RuntimeCheckpointCompression = (typeof RUNTIME_CHECKPOINT_COMPRESSIONS)[number];RuntimeCheckpointDisposition
Public type alias for Runtime Checkpoint Disposition; the declaration contains its complete type expression.
- Kind: type
- Import:
import type { RuntimeCheckpointDisposition } from '@codesoul-co/hypha-core'; - Source module:
contracts/runtime-checkpoint
Declaration
export type RuntimeCheckpointDisposition = (typeof RUNTIME_CHECKPOINT_DISPOSITIONS)[number];RuntimeCheckpointMode
Public type alias for Runtime Checkpoint Mode; the declaration contains its complete type expression.
- Kind: type
- Import:
import type { RuntimeCheckpointMode } from '@codesoul-co/hypha-core'; - Source module:
contracts/runtime-checkpoint
Declaration
export type RuntimeCheckpointMode = (typeof RUNTIME_CHECKPOINT_MODES)[number];RuntimeCheckpointReason
Public type alias for Runtime Checkpoint Reason; the declaration contains its complete type expression.
- Kind: type
- Import:
import type { RuntimeCheckpointReason } from '@codesoul-co/hypha-core'; - Source module:
contracts/runtime-checkpoint
Declaration
export type RuntimeCheckpointReason = (typeof RUNTIME_CHECKPOINT_REASONS)[number];