Skip to content

@codesoul-co/hypha-core / contracts/runtime-query-schemas

Using this module

Use the Runtime query schemas module for declaring and runtime-validating contracts. It exports 18 constants, 4 functions.

Import from the package entrypoint

ts
import {
  runtimeQueryContractDefinitions,
  runtimeQueryContractJsonSchemas,
  runtimeQueryRequestDefinition,
  runtimeQueryRequestExample,
  runtimeQueryRequestJsonSchema,
  runtimeQueryRequestSchema,
  runtimeRunViewDefinition,
  runtimeRunViewExample,
} from '@codesoul-co/hypha-core';

// The complete export list is documented below.

Usage patterns

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

declare function loadExternalInput(): unknown;
const input: unknown = loadExternalInput();
const parsed = runtimeQueryRequestSchema.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
runtimeQueryContractDefinitionsconstantconst runtimeQueryContractDefinitions: readonly [SpecSchemaDefinition<RuntimeQueryRequest>, SpecSchemaDefinition<RuntimeTimelineRequest>, SpecSchemaDefinition<RuntimeRunView>, SpecSchemaDefinition<RuntimeStateExplanation>]Runtime Query Contract Definitions constant exported by the contracts/runtime-query-schemas module.
runtimeQueryContractJsonSchemasconstantconst runtimeQueryContractJsonSchemas: Record<string, JsonSchema>Runtime Query Contract JSON Schemas constant exported by the contracts/runtime-query-schemas module.
runtimeQueryRequestDefinitionconstantconst runtimeQueryRequestDefinition: SpecSchemaDefinition<RuntimeQueryRequest>Runtime Query Request Definition constant exported by the contracts/runtime-query-schemas module.
runtimeQueryRequestExampleconstantconst runtimeQueryRequestExample: RuntimeQueryRequestValid example value for Runtime Query Request.
runtimeQueryRequestJsonSchemaconstantconst runtimeQueryRequestJsonSchema: JsonSchemaJSON Schema for Runtime Query Request.
runtimeQueryRequestSchemaconstantconst runtimeQueryRequestSchema: z.ZodObject<{ scope: z.ZodObject<{ tenantId: z.ZodOptional<z.ZodString>; userId: z.ZodString; workspaceId: z.ZodOptional<z.ZodString>; sessionId: z.ZodString; runId: z.ZodString; agentId: z.ZodOptional<z.ZodString>; }, "strict", z.ZodTypeAny, { sessionId: string; runId: string; userId: string; workspaceId?: string | undefined; agentId?: string | undefined; tenantId?: string | undef...Runtime schema for Runtime Query Request.
runtimeRunViewDefinitionconstantconst runtimeRunViewDefinition: SpecSchemaDefinition<RuntimeRunView>Runtime Run View Definition constant exported by the contracts/runtime-query-schemas module.
runtimeRunViewExampleconstantconst runtimeRunViewExample: RuntimeRunViewValid example value for Runtime Run View.
runtimeRunViewJsonSchemaconstantconst runtimeRunViewJsonSchema: JsonSchemaJSON Schema for Runtime Run View.
runtimeRunViewSchemaconstantconst runtimeRunViewSchema: z.ZodEffects<z.ZodObject<{ scope: z.ZodObject<{ tenantId: z.ZodOptional<z.ZodString>; userId: z.ZodString; workspaceId: z.ZodOptional<z.ZodString>; sessionId: z.ZodString; runId: z.ZodString; agentId: z.ZodOptional<z.ZodString>; }, "strict", z.ZodTypeAny, { sessionId: string; runId: string; userId: string; workspaceId?: string | undefined; agentId?: string | undefined; tenantId?: string...Runtime schema for Runtime Run View.
runtimeStateExplanationDefinitionconstantconst runtimeStateExplanationDefinition: SpecSchemaDefinition<RuntimeStateExplanation>Runtime State Explanation Definition constant exported by the contracts/runtime-query-schemas module.
runtimeStateExplanationExampleconstantconst runtimeStateExplanationExample: RuntimeStateExplanationValid example value for Runtime State Explanation.
runtimeStateExplanationJsonSchemaconstantconst runtimeStateExplanationJsonSchema: JsonSchemaJSON Schema for Runtime State Explanation.
runtimeStateExplanationSchemaconstantconst runtimeStateExplanationSchema: z.ZodObject<{ scope: z.ZodObject<{ tenantId: z.ZodOptional<z.ZodString>; userId: z.ZodString; workspaceId: z.ZodOptional<z.ZodString>; sessionId: z.ZodString; runId: z.ZodString; agentId: z.ZodOptional<z.ZodString>; }, "strict", z.ZodTypeAny, { sessionId: string; runId: string; userId: string; workspaceId?: string | undefined; agentId?: string | undefined; tenantId?: string | u...Runtime schema for Runtime State Explanation.
runtimeTimelineRequestDefinitionconstantconst runtimeTimelineRequestDefinition: SpecSchemaDefinition<RuntimeTimelineRequest>Runtime Timeline Request Definition constant exported by the contracts/runtime-query-schemas module.
runtimeTimelineRequestExampleconstantconst runtimeTimelineRequestExample: RuntimeTimelineRequestValid example value for Runtime Timeline Request.
runtimeTimelineRequestJsonSchemaconstantconst runtimeTimelineRequestJsonSchema: JsonSchemaJSON Schema for Runtime Timeline Request.
runtimeTimelineRequestSchemaconstantconst runtimeTimelineRequestSchema: z.ZodEffects<z.ZodObject<{ scope: z.ZodObject<{ tenantId: z.ZodOptional<z.ZodString>; userId: z.ZodString; workspaceId: z.ZodOptional<z.ZodString>; sessionId: z.ZodString; runId: z.ZodString; agentId: z.ZodOptional<z.ZodString>; }, "strict", z.ZodTypeAny, { sessionId: string; runId: string; userId: string; workspaceId?: string | undefined; agentId?: string | undefined; tenantId?...Runtime schema for Runtime Timeline Request.
validateRuntimeQueryRequestfunctionvalidateRuntimeQueryRequest(input: unknown): RuntimeQueryRequestValidate Runtime Query Request function with 1 public call signature; parameters and return types are listed below.
validateRuntimeRunViewfunctionvalidateRuntimeRunView(input: unknown): RuntimeRunViewValidate Runtime Run View function with 1 public call signature; parameters and return types are listed below.
validateRuntimeStateExplanationfunctionvalidateRuntimeStateExplanation(input: unknown): RuntimeStateExplanationValidate Runtime State Explanation function with 1 public call signature; parameters and return types are listed below.
validateRuntimeTimelineRequestfunctionvalidateRuntimeTimelineRequest(input: unknown): RuntimeTimelineRequestValidate Runtime Timeline Request function with 1 public call signature; parameters and return types are listed below.

runtimeQueryContractDefinitions

Runtime Query Contract Definitions constant exported by the contracts/runtime-query-schemas module.

Declaration

text
export declare const runtimeQueryContractDefinitions: readonly [SpecSchemaDefinition<RuntimeQueryRequest>, SpecSchemaDefinition<RuntimeTimelineRequest>, SpecSchemaDefinition<RuntimeRunView>, SpecSchemaDefinition<RuntimeStateExplanation>];

runtimeQueryContractJsonSchemas

Runtime Query Contract JSON Schemas constant exported by the contracts/runtime-query-schemas module.

Declaration

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

runtimeQueryRequestDefinition

Runtime Query Request Definition constant exported by the contracts/runtime-query-schemas module.

Declaration

text
export declare const runtimeQueryRequestDefinition: SpecSchemaDefinition<RuntimeQueryRequest>;

runtimeQueryRequestExample

Valid example value for Runtime Query Request.

Declaration

text
export declare const runtimeQueryRequestExample: RuntimeQueryRequest;

runtimeQueryRequestJsonSchema

JSON Schema for Runtime Query Request.

Declaration

text
export declare const runtimeQueryRequestJsonSchema: JsonSchema;

runtimeQueryRequestSchema

Runtime schema for Runtime Query Request.

Declaration

text
export declare const runtimeQueryRequestSchema: z.ZodObject<{ scope: z.ZodObject<{ tenantId: z.ZodOptional<z.ZodString>; userId: z.ZodString; workspaceId: z.ZodOptional<z.ZodString>; sessionId: z.ZodString; runId: z.ZodString; agentId: z.ZodOptional<z.ZodString>; }, "strict", z.ZodTypeAny, { sessionId: string; runId: string; userId: string; workspaceId?: string | undefined; agentId?: string | undefined; tenantId?: string | undefined; }, { sessionId: string; runId: string; userId: string; workspaceId?: string | undefined; agentId?: string | undefined; tenantId?: string | undefined; }>; }, "strict", z.ZodTypeAny, { scope: { sessionId: string; runId: string; userId: string; workspaceId?: string | undefined; agentId?: string | undefined; tenantId?: string | undefined; }; }, { scope: { sessionId: string; runId: string; userId: string; workspaceId?: string | undefined; agentId?: string | undefined; tenantId?: string | undefined; }; }>;

runtimeRunViewDefinition

Runtime Run View Definition constant exported by the contracts/runtime-query-schemas module.

Declaration

text
export declare const runtimeRunViewDefinition: SpecSchemaDefinition<RuntimeRunView>;

runtimeRunViewExample

Valid example value for Runtime Run View.

Declaration

text
export declare const runtimeRunViewExample: RuntimeRunView;

runtimeRunViewJsonSchema

JSON Schema for Runtime Run View.

Declaration

text
export declare const runtimeRunViewJsonSchema: JsonSchema;

runtimeRunViewSchema

Runtime schema for Runtime Run View.

Declaration

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

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.

runtimeStateExplanationDefinition

Runtime State Explanation Definition constant exported by the contracts/runtime-query-schemas module.

Declaration

text
export declare const runtimeStateExplanationDefinition: SpecSchemaDefinition<RuntimeStateExplanation>;

runtimeStateExplanationExample

Valid example value for Runtime State Explanation.

Declaration

text
export declare const runtimeStateExplanationExample: RuntimeStateExplanation;

runtimeStateExplanationJsonSchema

JSON Schema for Runtime State Explanation.

Declaration

text
export declare const runtimeStateExplanationJsonSchema: JsonSchema;

runtimeStateExplanationSchema

Runtime schema for Runtime State Explanation.

Declaration

text
export declare const runtimeStateExplanationSchema: z.ZodObject<{ scope: z.ZodObject<{ tenantId: z.ZodOptional<z.ZodString>; userId: z.ZodString; workspaceId: z.ZodOptional<z.ZodString>; sessionId: z.ZodString; runId: z.ZodString; agentId: z.ZodOptional<z.ZodString>; }, "strict", z.ZodTypeAny, { sessionId: string; runId: string; userId: string; workspaceId?: string | undefined; agentId?: string | undefined; tenantId?: string | undefined; }, { sessionId: string; runId: string; userId: string; workspaceId?: string | undefined; agentId?: string | undefined; tenantId?: string | undefined; }>; runStatus: z.ZodEnum<[import("./runtime-projection").RuntimeOrchestrationRunStatus, ...import("./runtime-projection").RuntimeOrchestrationRunStatus[]]>; currentState: z.ZodOptional<z.ZodString>; stateAttempt: z.ZodNumber; statePath: z.ZodArray<z.ZodString, "many">; pendingWaitId: z.ZodOptional<z.ZodString>; pendingTransitionEventId: z.ZodOptional<z.ZodString>; pendingActivityIds: z.ZodArray<z.ZodString, "many">; lastEventSequence: z.ZodNumber; source: z.ZodLiteral<"runtime.orchestration.projection">; }, "strict", z.ZodTypeAny, { scope: { sessionId: string; runId: string; userId: string; workspaceId?: string | undefined; agentId?: string | undefined; tenantId?: string | undefined; }; runStatus: import("./runtime-projection").RuntimeOrchestrationRunStatus; statePath: string[]; stateAttempt: number; pendingActivityIds: string[]; lastEventSequence: number; source: "runtime.orchestration.projection"; currentState?: string | undefined; pendingWaitId?: string | undefined; pendingTransitionEventId?: string | undefined; }, { scope: { sessionId: string; runId: string; userId: string; workspaceId?: string | undefined; agentId?: string | undefined; tenantId?: string | undefined; }; runStatus: import("./runtime-projection").RuntimeOrchestrationRunStatus; statePath: string[]; stateAttempt: number; pendingActivityIds: string[]; lastEventSequence: number; source: "runtime.orchestration.projection"; currentState?: string | undefined; pendingWaitId?: string | undefined; pendingTransitionEventId?: string | undefined; }>;

runtimeTimelineRequestDefinition

Runtime Timeline Request Definition constant exported by the contracts/runtime-query-schemas module.

Declaration

text
export declare const runtimeTimelineRequestDefinition: SpecSchemaDefinition<RuntimeTimelineRequest>;

runtimeTimelineRequestExample

Valid example value for Runtime Timeline Request.

Declaration

text
export declare const runtimeTimelineRequestExample: RuntimeTimelineRequest;

runtimeTimelineRequestJsonSchema

JSON Schema for Runtime Timeline Request.

Declaration

text
export declare const runtimeTimelineRequestJsonSchema: JsonSchema;

runtimeTimelineRequestSchema

Runtime schema for Runtime Timeline Request.

Declaration

text
export declare const runtimeTimelineRequestSchema: z.ZodEffects<z.ZodObject<{ scope: z.ZodObject<{ tenantId: z.ZodOptional<z.ZodString>; userId: z.ZodString; workspaceId: z.ZodOptional<z.ZodString>; sessionId: z.ZodString; runId: z.ZodString; agentId: z.ZodOptional<z.ZodString>; }, "strict", z.ZodTypeAny, { sessionId: string; runId: string; userId: string; workspaceId?: string | undefined; agentId?: string | undefined; tenantId?: string | undefined; }, { sessionId: string; runId: string; userId: string; workspaceId?: string | undefined; agentId?: string | undefined; tenantId?: string | undefined; }>; fromSequence: z.ZodOptional<z.ZodNumber>; toSequence: z.ZodOptional<z.ZodNumber>; types: z.ZodOptional<z.ZodArray<z.ZodType<FrameworkEventType, z.ZodTypeDef, FrameworkEventType>, "many">>; limit: z.ZodOptional<z.ZodNumber>; }, "strict", z.ZodTypeAny, { scope: { sessionId: string; runId: string; userId: string; workspaceId?: string | undefined; agentId?: string | undefined; tenantId?: string | undefined; }; fromSequence?: number | undefined; toSequence?: number | undefined; types?: FrameworkEventType[] | undefined; limit?: number | undefined; }, { scope: { sessionId: string; runId: string; userId: string; workspaceId?: string | undefined; agentId?: string | undefined; tenantId?: string | undefined; }; fromSequence?: number | undefined; toSequence?: number | undefined; types?: FrameworkEventType[] | undefined; limit?: number | undefined; }>, { scope: { sessionId: string; runId: string; userId: string; workspaceId?: string | undefined; agentId?: string | undefined; tenantId?: string | undefined; }; fromSequence?: number | undefined; toSequence?: number | undefined; types?: FrameworkEventType[] | undefined; limit?: number | undefined; }, { scope: { sessionId: string; runId: string; userId: string; workspaceId?: string | undefined; agentId?: string | undefined; tenantId?: string | undefined; }; fromSequence?: number | undefined; toSequence?: number | undefined; types?: FrameworkEventType[] | undefined; limit?: number | undefined; }>;

validateRuntimeQueryRequest

Validate Runtime Query Request function with 1 public call signature; parameters and return types are listed below.

Declaration

text
export declare function validateRuntimeQueryRequest(input: unknown): RuntimeQueryRequest;

Call signature

text
validateRuntimeQueryRequest(input: unknown): RuntimeQueryRequest

Parameters

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

Returns

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

validateRuntimeRunView

Validate Runtime Run View function with 1 public call signature; parameters and return types are listed below.

Declaration

text
export declare function validateRuntimeRunView(input: unknown): RuntimeRunView;

Call signature

text
validateRuntimeRunView(input: unknown): RuntimeRunView

Parameters

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

Returns

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

validateRuntimeStateExplanation

Validate Runtime State Explanation function with 1 public call signature; parameters and return types are listed below.

Declaration

text
export declare function validateRuntimeStateExplanation(input: unknown): RuntimeStateExplanation;

Call signature

text
validateRuntimeStateExplanation(input: unknown): RuntimeStateExplanation

Parameters

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

Returns

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

validateRuntimeTimelineRequest

Validate Runtime Timeline Request function with 1 public call signature; parameters and return types are listed below.

Declaration

text
export declare function validateRuntimeTimelineRequest(input: unknown): RuntimeTimelineRequest;

Call signature

text
validateRuntimeTimelineRequest(input: unknown): RuntimeTimelineRequest

Parameters

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

Returns

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