Skip to content

Changelog

All notable changes to this project are documented in this file. The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.

Unreleased

Added

  • FlowNetworksClient (client.flowNetworks) — generic capacitated directed-graph resource. Persist a graph once, then create / get / clone / commit / solve it under any of five algorithms: max_flow, min_cost_max_flow, classify_edges, classify_edges_optimal, min_cut. Mirrors the lifecycle of the /spaces resource (create, clone, commit, solve) and exposes the same Dulmage–Mendelsohn edge trichotomy (always_used / never_used / sometimes_used) the scheduling engine returns over (agent, day, shift) cells, generalised to arbitrary edges.
  • New types: FlowAlgorithm, EdgeSpec, EdgeFlow, EdgeClass(ification), MinCutReport, EdgeCapacityUpdate, CreateFlowNetworkRequest, FlowNetworkResponse, CommitFlowNetworkRequest, SolveFlowNetworkRequest, SolveFlowNetworkResponse (exported under the FlowNetworks namespace).
  • New guide: Flow Networks.

Removed

  • BackwardChainRequest.expandBindings and BackwardChainResponse.referencedTerms (the Record<string, TermDto> sidecar map). These existed only to support a prior backend feature where scheduling was solved as a backward-chain query returning deeply-nested Ψ-term lists; the backend has dropped that path in favour of the dedicated scheduling and flow-network endpoints, and the SDK fields are no longer wired to anything.

    Note: TermDto.referencedTerms (a different field — Record<string, ReferencedTermSummary> on the term-retrieval surface) is unaffected.

[0.1.0] - Unreleased

Initial release of the @kortexya/reasoninglayer TypeScript SDK.

Added

Core infrastructure

  • ReasoningLayerClient main client with resource-as-property access pattern
  • ClientConfig with baseUrl, tenantId, and optional auth headers
  • HTTP layer with automatic retry (429, 503), exponential backoff with jitter, and configurable timeouts
  • Error hierarchy: ReasoningLayerError, ApiError, ConstraintViolationError, RateLimitError, TimeoutError, ValidationError, NetworkError
  • .withMetadata() on all resource clients for access to HTTP status, headers, and rate limit info
  • WebSocket client with auto-reconnect for real-time event subscriptions

Type system (types/)

  • ValueDto tagged discriminated union (10 variants: String, Integer, Real, Boolean, Uninstantiated, Reference, List, FuzzyScalar, FuzzyNumber, Set)
  • FeatureValueDto untagged union for homoiconic inference endpoints
  • FuzzyShapeDto with "kind" discriminator (Triangular, Trapezoidal, Gaussian, CyclicGaussian)
  • TermInputDto structural union (Reference, Inline by sort ID, Inline by sort name)
  • FeatureInputValueDto structural union (10 variants including ConstrainedVariable and Variable)
  • Full DTO types for all domains: sorts, terms, inference, query, fuzzy, cognitive, constraints, namespaces, collections, execution, causal, ingestion, reviews, visualization, ILP, reasoning, statistical, control, spaces, row, sources, communities, utilities, scenarios, action-reviews, discovery, extract, scheduling

Builders (builders/)

  • Value namespace: tagged value construction (Value.string(), Value.integer(), Value.fuzzyNumber(), etc.)
  • FuzzyShape namespace: membership function shapes (FuzzyShape.triangular(), FuzzyShape.gaussian(), etc.)
  • FeatureInput namespace: untagged value construction for inference (FeatureInput.string(), FeatureInput.variable(), FeatureInput.constrainedVar(), etc.)
  • TermInput namespace: term input construction (TermInput.byName(), TermInput.byId(), TermInput.ref())
  • guard() function: shorthand for guard constraints with 6 operators (lt, lte, gt, gte, eq, ne)
  • allen() function: Allen temporal interval constraints with 13 relations
  • SortBuilder fluent API: chained sort definition with parents, features, bound constraints, and descriptions
  • psi() shorthand for inline Psi-term construction with auto-coercion

Resource clients (resources/)

  • SortsClient: createSort, getSort, deleteSort, listSorts, bulkCreateSorts, isSubtype, computeGlb, computeLub, decodeGlb, compareSorts, getChildren, getParents, getAncestors, getDescendants, getCompatible, indexSorts, updateReviewStatus
  • TermsClient: createTerm, getTerm, updateTerm, deleteTerm, termExists, bulkCreateTerms
  • InferenceClient: addRule, addFact, bulkAddRules, bulkAddFacts, getFacts, clearFacts, backwardChain, forwardChain, forwardChainTagged, fuzzyProve, bayesianPredict, nafProve, createGoal, getGoals, getGoal, deleteGoal, getMetaSorts
  • QueryClient: findUnifiable, findBySort, osfSearch, validateTerm, validatedUnify, nlQuery
  • FuzzyClient: fuzzyUnify, fuzzyMerge, fuzzySubsumption, searchTopK, predictEffect
  • CognitiveClient: createAgent, getAgent, deleteAgent, getState, runCycle, addBelief, addGoal, addRule, addSort, recallEpisodes, getEpisodeStats, addHtnMethod, sendMessage, broadcastMessage, markMessagesRead, provideFeedback, subscribeToEvents (WebSocket)
  • ConstraintsClient: constraint sessions, one-shot solving, graph visualization
  • NamespacesClient: namespace hierarchy, imports, metadata
  • CollectionsClient: collection CRUD, tagging
  • ExecutionClient: Execution sessions, backtracking, goal stack
  • CausalClient: Pearl’s causal hierarchy, interventions, counterfactuals, root cause analysis
  • IngestionClient: document ingestion, markdown, RDF, session management
  • ReviewsClient: human-in-the-loop review operations (approve, reject, merge, re-extract)
  • VisualizationClient: lattice, hypergraph, GLB/LUB trace, residuation state, trigger dependency
  • IlpClient: inductive logic programming (pattern learning, evaluation, GFlowNet, synthesis)
  • ReasoningClient: entailment, evidence assessment, residuation, resource coordination, temporal planning
  • StatisticalClient: correlation, partial correlation, conditional independence, causal discovery
  • ControlClient: Prolog-style proof control (cut, findall, forall, NAF, conditionals, global state)
  • SpacesClient: computation spaces (create, clone, commit, search)
  • RowClient: row polymorphism (schema-flexible search, unification, integration, dynamic queries)
  • SourcesClient: data source registration, schema discovery, ingestion
  • CommunitiesClient: community detection, memberships, search
  • UtilitiesClient: string operations, relational arithmetic, term copying
  • ScenariosClient: scenario CRUD and verification
  • ActionReviewsClient: autonomous action approval (approve, reject, modify, bulk operations)
  • DiscoveryClient: causal effect discovery and prediction
  • ExtractClient: entity extraction from text
  • SchedulingClient: capacitated bipartite b-matching for staff rostering and assignment problems — feasibility() returns the per-cell trichotomy (confirmed_true / confirmed_false / free) under hard rules; optimize() adds soft preferences and returns the trichotomy across every optimal rota

SDK diagnostics

  • SDK_VERSION exported constant (0.1.0)
  • X-SDK-Version header sent on every HTTP request for backend diagnostics
  • scripts/generate-route-manifest.ts — generates endpoint manifest from OpenAPI spec
  • scripts/check-completeness.ts — reports SDK endpoint coverage vs. OpenAPI spec

Build and tooling

  • Dual ESM/CJS output via tsup
  • TypeScript strict mode with zero any types
  • Zero runtime dependencies
  • ES2022 target (Node 18+, modern browsers, Deno, Bun)
  • Vitest test framework
  • pnpm package manager with strict resolution