export interface GraphenixMetadata { /** Optional dynamic client payload — core validates object shape only. */ data?: Record; [key: string]: unknown; } /** Graph-level metadata with first-class executable fields. */ export interface GraphMetadata extends GraphenixMetadata { graphEntry?: GraphEntryContract; graphResponse?: GraphResponseContract; /** Graph-wide AI model cases — validated by executable profile packages. */ modelConfig?: Record; name?: string; description?: string; [key: string]: unknown; } export interface PortDefinition { id: string; name?: string; direction: "input" | "output"; type: string; required?: boolean; default?: any | null; } export type GraphPort = PortDefinition; export interface EdgeEndpoint { nodeId: string; portId: string; } export interface Edge { id: string; from: EdgeEndpoint; to: EdgeEndpoint; metadata?: TMetadata; } export type GraphEdge = Edge; export interface Node, TMetadata extends GraphenixMetadata = GraphenixMetadata> { id: string; name?: string; kind: string; inputs?: PortDefinition[]; outputs?: PortDefinition[]; parameters?: TParameters; metadata?: TMetadata; /** Design-only canvas position. Ignored by compile; see docs/DESIGN-FORMAT-GAPS.md §3.8 */ layout?: { x?: number; y?: number; [key: string]: unknown; }; } export type GraphNode, TMetadata extends GraphenixMetadata = GraphenixMetadata> = Node; export type GraphInputSemanticKind = "record" | "query" | "user-input" | "content" | "metadata" | "execution" | (string & {}); export interface GraphInputResolver { kind?: string; graphId?: string; metadataFilter?: Record; [key: string]: unknown; } export interface GraphInputContract { semanticKind?: GraphInputSemanticKind; required?: boolean; schema?: JsonSchemaObject; resolver?: GraphInputResolver; [key: string]: unknown; } export type GraphOutputSemanticKind = "record" | "content" | "metadata" | "execution" | "final-output" | (string & {}); export interface GraphOutputContract { semanticKind?: GraphOutputSemanticKind; required?: boolean; schema?: JsonSchemaObject; description?: string; [key: string]: unknown; } export interface GraphInput { id: string; name?: string; type: string; target: EdgeEndpoint; contract?: GraphInputContract; metadata?: TMetadata; } export interface GraphOutput { id: string; name?: string; type: string; source?: EdgeEndpoint; contract?: GraphOutputContract; metadata?: TMetadata; } export interface Graph, TNodeMetadata extends GraphenixMetadata = GraphenixMetadata, TEdgeMetadata extends GraphenixMetadata = GraphenixMetadata> { nodes: Node[]; edges: Edge[]; inputs: GraphInput[]; outputs: GraphOutput[]; /** Executable response contract (shape, persistency target). */ response?: GraphResponseDefinition; metadata?: TGraphMetadata; } export interface TypeField { name: string; type: string; required?: boolean; } export interface TypeBase { id: string; kind: "object" | "union" | "alias"; description?: string; metadata?: TMetadata; } 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 type GraphType = TypeDefinition; export interface SubgraphDefinition, TNodeMetadata extends GraphenixMetadata = GraphenixMetadata, TEdgeMetadata extends GraphenixMetadata = GraphenixMetadata> { id: string; name?: string; graph: Graph; metadata?: GraphenixMetadata; } export type Subgraph, TNodeMetadata extends GraphenixMetadata = GraphenixMetadata, TEdgeMetadata extends GraphenixMetadata = GraphenixMetadata> = SubgraphDefinition; export type JsonSchemaObject = Record; /** Wildcard entity id — Source must not filter by entity type. */ export declare const GRAPH_ENTRY_ENTITY_ID_ANY: "any"; /** Write result to sibling collection in the same entity set as the input record. */ export declare const GRAPH_RESPONSE_SAME_AS_INPUT: "same-as-input"; /** @deprecated CR-006 — data source selection is operator/work-factory concern, not graph JSON. */ export interface GraphEntryInputSpec { kind: string; path: string; required?: boolean; entityIds?: string[]; inputTypes?: string[]; narrativeTypeIds?: string[]; scopingQuestionIds?: string[]; name?: string; } export declare const GRAPH_RESPONSE_PERSISTENCY_LINK_TYPES: readonly ["oneToOne", "oneToMany", "manyToOne", "manyToMany"]; export type GraphResponsePersistencyLinkType = (typeof GRAPH_RESPONSE_PERSISTENCY_LINK_TYPES)[number]; /** FK + relation intent when result is written to a different entity than the job source. */ export interface GraphResponsePersistencyLink { relationKey: string; fkPath: string; type: GraphResponsePersistencyLinkType; targetContentType: string; } export interface GraphResponsePersistency { entityId: string | typeof GRAPH_RESPONSE_SAME_AS_INPUT; contentType?: string; /** When true (default), each run inserts a new result record. false = legacy replace (deprecated). */ newRecord?: boolean; link?: GraphResponsePersistencyLink; } export interface GraphResponseDefinition { shape?: Record; missing?: unknown; persistency?: GraphResponsePersistency; } export interface GraphEntryContract { summary?: string; requiredExecutionPaths?: unknown[]; executionSchema?: JsonSchemaObject; notableExecutionPaths?: unknown[]; [key: string]: unknown; } export interface GraphResponseContract { summary?: string; finalOutputSchema?: JsonSchemaObject; /** @deprecated Authoring-only. Canonical persistency lives on graph.response.persistency. */ persistency?: GraphResponsePersistency; [key: string]: unknown; } export type WoroxCatalogRequest = Record; export type WoroxCatalogBinding = Record; export type WoroxCatalogRequests = WoroxCatalogRequest[] | Record; export type GraphDocumentMetadata = GraphenixMetadata & { graphEntry?: GraphEntryContract; graphResponse?: GraphResponseContract; catalogRequests?: WoroxCatalogRequests; }; export interface GraphDocument, TNodeMetadata extends GraphenixMetadata = GraphenixMetadata, TEdgeMetadata extends GraphenixMetadata = GraphenixMetadata> { formatVersion: "2.1.0"; id: string; revision?: string; name?: string; description?: string; tags?: string[]; graph: Graph; types?: TypeDefinition[]; subgraphs?: SubgraphDefinition[]; metadata?: TDocumentMetadata; } export declare const GRAPHENIX_FORMAT_VERSION: "2.1.0"; //# sourceMappingURL=types.d.ts.map