export interface PortDefinition { id: string; name?: string; direction: "input" | "output"; type: string; required?: boolean; default?: any | null; } export interface EdgeEndpoint { nodeId: string; portId: string; } export interface Edge { id: string; from: EdgeEndpoint; to: EdgeEndpoint; metadata?: Record; extensions?: Record; } export interface Node { id: string; name?: string; kind: string; inputs?: PortDefinition[]; outputs?: PortDefinition[]; parameters?: Record; metadata?: Record; extensions?: Record; } export interface GraphInput { id: string; name?: string; type: string; target: EdgeEndpoint; metadata?: Record; extensions?: Record; } export interface GraphOutput { id: string; name?: string; type: string; source: EdgeEndpoint; metadata?: Record; extensions?: Record; } export interface Graph { nodes: Node[]; edges: Edge[]; inputs: GraphInput[]; outputs: GraphOutput[]; metadata?: Record; } export interface TypeField { name: string; type: string; required?: boolean; } export interface TypeBase { id: string; kind: "object" | "union" | "alias"; description?: string; metadata?: Record; extensions?: Record; } export interface TypeObject extends TypeBase { kind: "object"; fields: TypeField[]; } export interface TypeUnion extends TypeBase { kind: "union"; options: string[]; } export interface TypeAlias extends TypeBase { kind: "alias"; target: string; } export type TypeDefinition = TypeObject | TypeUnion | TypeAlias; export interface SubgraphDefinition { id: string; name?: string; graph: Graph; metadata?: Record; extensions?: Record; } /** * JSON Schema object (typically draft-07) used by tooling to validate runtime payloads. * Kept as a generic object so authors can use `$ref`, `definitions`, etc. */ export type JsonSchemaObject = Record; /** * Worox-graph entry contract: describes expected execution inputs and structure. * Aligns with `@woroces/worox-graph` `GraphEntryContract` (I/O visibility **layer 01**). */ export interface GraphEntryContract { /** Short human-readable description of what the graph expects at entry. */ summary?: string; /** * Path descriptors for execution branches that must run (shape is engine-specific; * often node-id lists or segmented paths). */ requiredExecutionPaths?: unknown[]; /** * Optional JSON Schema for the merged **execution** object after graph entry * (validated separately with `validateExecutionAgainstContract` when tooling enables it). */ executionSchema?: JsonSchemaObject; /** Notable or optional execution paths for diagnostics or docs. */ notableExecutionPaths?: unknown[]; [key: string]: unknown; } /** * Worox-graph response contract: describes the final output shape. * Aligns with `@woroces/worox-graph` `GraphResponseContract` (I/O visibility **layer 08**). */ export interface GraphResponseContract { summary?: string; /** * JSON Schema for the graph **final output** value * (validated separately with `validateFinalOutputAgainstContract` when tooling enables it). */ finalOutputSchema?: JsonSchemaObject; [key: string]: unknown; } /** * Optional document-level metadata. Known keys `graphEntry` / `graphResponse` mirror * worox-graph graph JSON and are copied to `variables.__graphModel` by consumers. */ /** * Planning-only catalog request (worox-graph task `metadata.catalogRequest`). * Execution is unchanged. Canonical shape: `@woroces/worox-graph` `refs.ts`. */ export type WoroxCatalogRequest = Record; /** * Planning-only catalog binding (worox-graph task `metadata.catalogBinding`). * Execution is unchanged. Canonical shape: `@woroces/worox-graph` `refs.ts`. */ export type WoroxCatalogBinding = Record; /** * Document-level planning catalog requests (worox-graph `metadata.catalogRequests`). * Execution is unchanged. Canonical shape: `@woroces/worox-graph` `refs.ts`. */ export type WoroxCatalogRequests = WoroxCatalogRequest[] | Record; export type GraphDocumentMetadata = { graphEntry?: GraphEntryContract; graphResponse?: GraphResponseContract; /** Planning-only; aligns with worox-graph graph JSON `metadata.catalogRequests`. */ catalogRequests?: WoroxCatalogRequests; } & Record; export interface GraphDocument { formatVersion: string; id: string; name?: string; description?: string; tags?: string[]; /** Structural graph (ports, `GraphInput` / `GraphOutput`). */ graph: Graph; types?: TypeDefinition[]; subgraphs?: SubgraphDefinition[]; /** * Optional worox-graph-aligned contracts for planning and I/O documentation. * Prefer this surface over duplicating the same data only under `extensions`. */ metadata?: GraphDocumentMetadata; extensions?: Record; } //# sourceMappingURL=types.d.ts.map