Skip to content

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

Using this module

Use the Runtime control schemas module for declaring and runtime-validating contracts. It exports 13 constants, 2 functions.

Import from the package entrypoint

ts
import {
  runtimeControlContractDefinitions,
  runtimeControlContractJsonSchemas,
  runtimePauseCommandSchema,
  runtimeResumeCommandSchema,
  runtimeRunControlCommandDefinition,
  runtimeRunControlCommandExample,
  runtimeRunControlCommandJsonSchema,
  runtimeRunControlCommandSchema,
} from '@codesoul-co/hypha-core';

// The complete export list is documented below.

Usage patterns

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

declare function loadExternalInput(): unknown;
const input: unknown = loadExternalInput();
const parsed = runtimePauseCommandSchema.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
runtimeControlContractDefinitionsconstantconst runtimeControlContractDefinitions: readonly [SpecSchemaDefinition<RuntimeRunControlCommand>, SpecSchemaDefinition<RuntimeRunControlResult>]Runtime Control Contract Definitions constant exported by the contracts/runtime-control-schemas module.
runtimeControlContractJsonSchemasconstantconst runtimeControlContractJsonSchemas: Record<string, JsonSchema>Runtime Control Contract JSON Schemas constant exported by the contracts/runtime-control-schemas module.
runtimePauseCommandSchemaconstantconst runtimePauseCommandSchema: z.ZodObject<{ kind: z.ZodLiteral<"pause">; reason: z.ZodString; resumeKey: z.ZodOptional<z.ZodString>; requestedAt: z.ZodString; commandId: z.ZodString; 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, { ...Runtime schema for Runtime Pause Command.
runtimeResumeCommandSchemaconstantconst runtimeResumeCommandSchema: z.ZodObject<{ kind: z.ZodLiteral<"resume">; key: z.ZodOptional<z.ZodString>; payload: z.ZodOptional<z.ZodType<RuntimeJsonValue, z.ZodTypeDef, RuntimeJsonValue>>; requestedAt: z.ZodString; commandId: z.ZodString; scope: z.ZodObject<{ tenantId: z.ZodOptional<z.ZodString>; userId: z.ZodString; workspaceId: z.ZodOptional<z.ZodString>; sessionId: z.ZodString; runId: z.ZodString; agentI...Runtime schema for Runtime Resume Command.
runtimeRunControlCommandDefinitionconstantconst runtimeRunControlCommandDefinition: SpecSchemaDefinition<RuntimeRunControlCommand>Runtime Run Control Command Definition constant exported by the contracts/runtime-control-schemas module.
runtimeRunControlCommandExampleconstantconst runtimeRunControlCommandExample: RuntimeRunControlCommandValid example value for Runtime Run Control Command.
runtimeRunControlCommandJsonSchemaconstantconst runtimeRunControlCommandJsonSchema: JsonSchemaJSON Schema for Runtime Run Control Command.
runtimeRunControlCommandSchemaconstantconst runtimeRunControlCommandSchema: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{ kind: z.ZodLiteral<"pause">; reason: z.ZodString; resumeKey: z.ZodOptional<z.ZodString>; requestedAt: z.ZodString; commandId: z.ZodString; 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.Zod...Runtime schema for Runtime Run Control Command.
runtimeRunControlResultDefinitionconstantconst runtimeRunControlResultDefinition: SpecSchemaDefinition<RuntimeRunControlResult>Runtime Run Control Result Definition constant exported by the contracts/runtime-control-schemas module.
runtimeRunControlResultExampleconstantconst runtimeRunControlResultExample: RuntimeRunControlResultValid example value for Runtime Run Control Result.
runtimeRunControlResultJsonSchemaconstantconst runtimeRunControlResultJsonSchema: JsonSchemaJSON Schema for Runtime Run Control Result.
runtimeRunControlResultSchemaconstantconst runtimeRunControlResultSchema: z.ZodObject<{ commandId: z.ZodString; kind: z.ZodEnum<["pause", "resume", "signal"]>; disposition: z.ZodEnum<["applied", "reused", "lease_unavailable"]>; eventIds: z.ZodArray<z.ZodString, "many">; runRevision: z.ZodNumber; projection: z.ZodEffects<z.ZodObject<{ runId: z.ZodString; runStatus: z.ZodEnum<[import("./runtime-projection").RuntimeOrchestrationRunStatus, ...import("./r...Runtime schema for Runtime Run Control Result.
runtimeSignalCommandSchemaconstantconst runtimeSignalCommandSchema: z.ZodObject<{ kind: z.ZodLiteral<"signal">; key: z.ZodString; payload: z.ZodType<RuntimeJsonValue, z.ZodTypeDef, RuntimeJsonValue>; sentAt: z.ZodString; commandId: z.ZodString; 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>; }, "...Runtime schema for Runtime Signal Command.
validateRuntimeRunControlCommandfunctionvalidateRuntimeRunControlCommand(input: unknown): RuntimeRunControlCommandValidate Runtime Run Control Command function with 1 public call signature; parameters and return types are listed below.
validateRuntimeRunControlResultfunctionvalidateRuntimeRunControlResult(input: unknown): RuntimeRunControlResultValidate Runtime Run Control Result function with 1 public call signature; parameters and return types are listed below.

runtimeControlContractDefinitions

Runtime Control Contract Definitions constant exported by the contracts/runtime-control-schemas module.

Declaration

text
export declare const runtimeControlContractDefinitions: readonly [SpecSchemaDefinition<RuntimeRunControlCommand>, SpecSchemaDefinition<RuntimeRunControlResult>];

runtimeControlContractJsonSchemas

Runtime Control Contract JSON Schemas constant exported by the contracts/runtime-control-schemas module.

Declaration

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

runtimePauseCommandSchema

Runtime schema for Runtime Pause Command.

Declaration

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

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.

runtimeResumeCommandSchema

Runtime schema for Runtime Resume Command.

Declaration

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

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.

runtimeRunControlCommandDefinition

Runtime Run Control Command Definition constant exported by the contracts/runtime-control-schemas module.

Declaration

text
export declare const runtimeRunControlCommandDefinition: SpecSchemaDefinition<RuntimeRunControlCommand>;

runtimeRunControlCommandExample

Valid example value for Runtime Run Control Command.

Declaration

text
export declare const runtimeRunControlCommandExample: RuntimeRunControlCommand;

runtimeRunControlCommandJsonSchema

JSON Schema for Runtime Run Control Command.

Declaration

text
export declare const runtimeRunControlCommandJsonSchema: JsonSchema;

runtimeRunControlCommandSchema

Runtime schema for Runtime Run Control Command.

Declaration

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

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.

runtimeRunControlResultDefinition

Runtime Run Control Result Definition constant exported by the contracts/runtime-control-schemas module.

Declaration

text
export declare const runtimeRunControlResultDefinition: SpecSchemaDefinition<RuntimeRunControlResult>;

runtimeRunControlResultExample

Valid example value for Runtime Run Control Result.

Declaration

text
export declare const runtimeRunControlResultExample: RuntimeRunControlResult;

runtimeRunControlResultJsonSchema

JSON Schema for Runtime Run Control Result.

Declaration

text
export declare const runtimeRunControlResultJsonSchema: JsonSchema;

runtimeRunControlResultSchema

Runtime schema for Runtime Run Control Result.

Declaration

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

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.

runtimeSignalCommandSchema

Runtime schema for Runtime Signal Command.

Declaration

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

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.

validateRuntimeRunControlCommand

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

Declaration

text
export declare function validateRuntimeRunControlCommand(input: unknown): RuntimeRunControlCommand;

Call signature

text
validateRuntimeRunControlCommand(input: unknown): RuntimeRunControlCommand

Parameters

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

Returns

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

validateRuntimeRunControlResult

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

Declaration

text
export declare function validateRuntimeRunControlResult(input: unknown): RuntimeRunControlResult;

Call signature

text
validateRuntimeRunControlResult(input: unknown): RuntimeRunControlResult

Parameters

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

Returns

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