@kortexya/reasoninglayer 1.1.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.cts CHANGED
@@ -109,7 +109,7 @@ type JsonValue$1 = string | number | boolean | null | JsonValue$1[] | object;
109
109
  * This is the single source of truth for the version constant.
110
110
  * The `scripts/release.sh` script updates this value alongside `package.json`.
111
111
  */
112
- declare const SDK_VERSION = "1.1.0";
112
+ declare const SDK_VERSION = "1.2.1";
113
113
  /**
114
114
  * Authentication mode for the SDK.
115
115
  *
@@ -1334,17 +1334,6 @@ interface BackwardChainRequest$1 {
1334
1334
  * Internally converted to Ψ-term constraints for TRUE HOMOICONICITY.
1335
1335
  */
1336
1336
  constraints?: ConstraintInputDto$1[];
1337
- /**
1338
- * When true, the response's `referenced_terms` field is populated
1339
- * with the full TermDto for every term transitively referenced by
1340
- * any solution's bindings. Lets the caller read complex bound
1341
- * values (lists of nested Ψ-terms etc.) in one request instead of
1342
- * chasing references via getTerm.
1343
- *
1344
- * Default: false (existing behaviour preserved).
1345
- * @default false
1346
- */
1347
- expand_bindings?: boolean;
1348
1337
  /**
1349
1338
  * The goal to prove (as a term).
1350
1339
  * Either `goal` or `goal_id` must be provided, but not both.
@@ -1411,17 +1400,6 @@ interface BackwardChainResponse$1 {
1411
1400
  * @min 0
1412
1401
  */
1413
1402
  query_time_ms: number;
1414
- /**
1415
- * Populated when the request had `expand_bindings: true`.
1416
- * Maps UUID-as-string → TermDto for every term transitively
1417
- * referenced by the solutions' bindings. Capped at
1418
- * MAX_EXPAND_TERMS to prevent runaway responses.
1419
- *
1420
- * Keys are stringified UUIDs because JSON object keys must be
1421
- * strings; this also matches the existing `referenced_terms`
1422
- * shape on `TermDto` for consistency.
1423
- */
1424
- referenced_terms?: object | null;
1425
1403
  /** Solutions found */
1426
1404
  solutions: SolutionDto$1[];
1427
1405
  }
@@ -2647,6 +2625,19 @@ interface CollectionResponse {
2647
2625
  /** Collection DTO */
2648
2626
  collection: CollectionDto$1;
2649
2627
  }
2628
+ /**
2629
+ * Request body for `POST /api/v1/flow-networks/{id}/commit` —
2630
+ * structural mutations applied in a single atomic step.
2631
+ */
2632
+ interface CommitFlowNetworkRequest$1 {
2633
+ /**
2634
+ * Edges to append. Source/destination must reference declared
2635
+ * nodes.
2636
+ */
2637
+ add_edges?: FlowEdgeDto[];
2638
+ /** Capacity updates keyed by edge label. */
2639
+ update_capacities?: EdgeCapacityUpdateDto[];
2640
+ }
2650
2641
  /** Request to commit to an alternative */
2651
2642
  interface CommitRequest$1 {
2652
2643
  /**
@@ -3518,6 +3509,22 @@ interface CreateExecutionSessionRequest$1 {
3518
3509
  /** @format uuid */
3519
3510
  tenant_id: string;
3520
3511
  }
3512
+ /** Request body for `POST /api/v1/flow-networks`. */
3513
+ interface CreateFlowNetworkRequest$1 {
3514
+ /**
3515
+ * Optional human-readable description. Stored only as part of the
3516
+ * response for inspection convenience.
3517
+ */
3518
+ description?: string | null;
3519
+ /** Initial edges. Order is preserved in inspection responses. */
3520
+ edges: FlowEdgeDto[];
3521
+ /** Node names. Must be unique. */
3522
+ nodes: string[];
3523
+ /** Sink node name. Must appear in `nodes`, distinct from `source`. */
3524
+ sink: string;
3525
+ /** Source node name. Must appear in `nodes`. */
3526
+ source: string;
3527
+ }
3521
3528
  /**
3522
3529
  * Request to create and persist a goal.
3523
3530
  *
@@ -5287,6 +5294,35 @@ interface E2ETrainingResponse$1 {
5287
5294
  /** Whether E2E training was triggered successfully. */
5288
5295
  triggered: boolean;
5289
5296
  }
5297
+ /** Replace the capacity of a labelled edge. */
5298
+ interface EdgeCapacityUpdateDto {
5299
+ /**
5300
+ * New capacity (must be ≥ 0).
5301
+ * @format int64
5302
+ */
5303
+ capacity: number;
5304
+ /** Edge label declared at construction or via a prior commit. */
5305
+ label: string;
5306
+ }
5307
+ /** Flow snapshot for a single forward edge. */
5308
+ interface EdgeFlowDto {
5309
+ /**
5310
+ * Original capacity.
5311
+ * @format int64
5312
+ */
5313
+ capacity: number;
5314
+ /**
5315
+ * Flow currently routed through this edge in the solver's output.
5316
+ * @format int64
5317
+ */
5318
+ flow: number;
5319
+ /** Source node name. */
5320
+ from: string;
5321
+ /** Caller-supplied label, if any. */
5322
+ label?: string | null;
5323
+ /** Destination node name. */
5324
+ to: string;
5325
+ }
5290
5326
  /** Edge type in the graph */
5291
5327
  type EdgeTypeDto$1 = "subtype" | "multiple_inheritance" | "glb_path" | "lub_path" | "constraint_dependency" | "propagation" | "feature" | "coreference" | "trigger_dependency" | "relation_source" | "relation_target" | "identity" | "derivation" | {
5292
5328
  custom: string;
@@ -6739,6 +6775,63 @@ interface FixSuggestionDto$1 {
6739
6775
  /** Type of fix (e.g., "add_fact", "modify_feature", "narrow_sort", "add_rule") */
6740
6776
  fix_type?: string | null;
6741
6777
  }
6778
+ /** Strategy chosen at solve time. */
6779
+ type FlowAlgorithmDto = {
6780
+ kind: "max_flow";
6781
+ } | {
6782
+ kind: "min_cost_max_flow";
6783
+ } | {
6784
+ kind: "classify_edges";
6785
+ } | {
6786
+ kind: "classify_edges_optimal";
6787
+ } | {
6788
+ kind: "min_cut";
6789
+ };
6790
+ /** A single directed edge specification. */
6791
+ interface FlowEdgeDto {
6792
+ /**
6793
+ * Capacity (must be ≥ 0).
6794
+ * @format int64
6795
+ */
6796
+ capacity: number;
6797
+ /**
6798
+ * Optional per-unit-flow cost. Defaults to zero — pure max-flow
6799
+ * algorithms ignore this field.
6800
+ * @format int64
6801
+ */
6802
+ cost?: number | null;
6803
+ /** Source node name. */
6804
+ from: string;
6805
+ /**
6806
+ * Optional caller-supplied label. Must be unique. Used to
6807
+ * reference the edge in `commit` requests and to identify it in
6808
+ * solver output.
6809
+ */
6810
+ label?: string | null;
6811
+ /** Destination node name. */
6812
+ to: string;
6813
+ }
6814
+ /** Status snapshot returned by every endpoint that does not solve. */
6815
+ interface FlowNetworkResponse$1 {
6816
+ /** Optional description echoed from the create request. */
6817
+ description?: string | null;
6818
+ /**
6819
+ * Number of declared forward edges.
6820
+ * @min 0
6821
+ */
6822
+ edge_count: number;
6823
+ /** Stable identifier assigned at creation; clones receive a new id. */
6824
+ id: string;
6825
+ /**
6826
+ * Number of declared nodes.
6827
+ * @min 0
6828
+ */
6829
+ node_count: number;
6830
+ /** Sink node name. */
6831
+ sink: string;
6832
+ /** Source node name. */
6833
+ source: string;
6834
+ }
6742
6835
  /** Request for forall */
6743
6836
  interface ForallRequest$1 {
6744
6837
  /** Generator goal that produces solutions */
@@ -11212,6 +11305,18 @@ interface MetaSortsResponse$1 {
11212
11305
  */
11213
11306
  variable: string;
11214
11307
  }
11308
+ /** Min-cut partition output. */
11309
+ interface MinCutDto {
11310
+ /**
11311
+ * Cut edges (saturated forward edges crossing source-side →
11312
+ * sink-side). Their summed `capacity` equals the max flow value.
11313
+ */
11314
+ cut_edges: EdgeFlowDto[];
11315
+ /** Names of nodes on the sink side of the cut. */
11316
+ sink_side: string[];
11317
+ /** Names of nodes on the source side of the cut. */
11318
+ source_side: string[];
11319
+ }
11215
11320
  /** Information about what's missing from a query */
11216
11321
  interface MissingInfoDto$1 {
11217
11322
  /** Human-readable description */
@@ -14991,6 +15096,35 @@ interface SolveConstraintResponse$1 {
14991
15096
  success: boolean;
14992
15097
  suspended_constraints: string[];
14993
15098
  }
15099
+ /** Request body for `POST /api/v1/flow-networks/{id}/solve`. */
15100
+ interface SolveFlowNetworkRequest$1 {
15101
+ /** Algorithm to dispatch. */
15102
+ algorithm: FlowAlgorithmDto;
15103
+ }
15104
+ /**
15105
+ * Solver output. Fields irrelevant to the chosen algorithm are
15106
+ * omitted via `skip_serializing_if`.
15107
+ */
15108
+ interface SolveFlowNetworkResponse$1 {
15109
+ /** Echo of the algorithm dispatched. */
15110
+ algorithm: FlowAlgorithmDto;
15111
+ /** Per-edge classification (classify_* algorithms only). */
15112
+ classifications?: any[] | null;
15113
+ /** Per-edge flow snapshot. */
15114
+ edge_flows: EdgeFlowDto[];
15115
+ /** Min-cut partition (min_cut algorithm only). */
15116
+ min_cut?: null | MinCutDto;
15117
+ /**
15118
+ * Total cost of the realised flow (mcmf only).
15119
+ * @format int64
15120
+ */
15121
+ total_cost?: number | null;
15122
+ /**
15123
+ * Total flow source → sink (max-flow / mcmf / min-cut).
15124
+ * @format int64
15125
+ */
15126
+ total_flow?: number | null;
15127
+ }
14994
15128
  /** Response with ancestor sorts */
14995
15129
  interface SortAncestorsResponse {
14996
15130
  ancestors: SortInfoDto$1[];
@@ -20980,16 +21114,6 @@ interface BackwardChainRequest {
20980
21114
  timeoutMs?: number | null;
20981
21115
  /** Additional constraints (deprecated — prefer ConstrainedVariable in goal). */
20982
21116
  constraints?: ConstraintInputDto[];
20983
- /**
20984
- * When true, the response's `referencedTerms` field is populated with the
20985
- * full {@link TermDto} for every term transitively referenced by any
20986
- * solution's bindings. Lets the caller read complex bound values
20987
- * (lists of nested Ψ-terms etc.) in one request instead of chasing
20988
- * references via {@link TermsResource.get}.
20989
- *
20990
- * @defaultValue `false`
20991
- */
20992
- expandBindings?: boolean;
20993
21117
  }
20994
21118
  /** Response from backward chaining inference. */
20995
21119
  interface BackwardChainResponse {
@@ -20999,13 +21123,6 @@ interface BackwardChainResponse {
20999
21123
  queryTimeMs: number;
21000
21124
  /** Goal ID if the goal was saved (when save_goal=true). */
21001
21125
  goalId?: string | null;
21002
- /**
21003
- * Populated when the request had `expandBindings: true`. Maps UUID →
21004
- * {@link TermDto} for every term transitively referenced by the solutions'
21005
- * bindings. Capped at the backend's MAX_EXPAND_TERMS to prevent runaway
21006
- * responses.
21007
- */
21008
- referencedTerms?: Record<string, TermDto>;
21009
21126
  }
21010
21127
  /**
21011
21128
  * Request for forward chaining inference.
@@ -21726,12 +21843,6 @@ declare class InferenceClient {
21726
21843
  *
21727
21844
  * The `timeout_ms` field on the request is a wall-clock timeout for the search.
21728
21845
  * When it fires, the backend returns whatever solutions have been found so far.
21729
- *
21730
- * Pass `expandBindings: true` to receive the full {@link TermDto} of every
21731
- * Ψ-term transitively referenced by a solution's bindings in the
21732
- * `referencedTerms` sidecar map of the response. Lets the caller read complex
21733
- * bound values (lists of nested Ψ-terms etc.) without follow-up
21734
- * `terms.get(uuid)` calls.
21735
21846
  */
21736
21847
  backwardChain(request: Omit<BackwardChainRequest, 'goal'> & {
21737
21848
  goal?: TermInputArg | null;
@@ -40922,6 +41033,362 @@ declare class SchedulingClient {
40922
41033
  optimize(request: SchedulingOptimizeRequest): Promise<SchedulingOptimizeResponse>;
40923
41034
  }
40924
41035
 
41036
+ declare class FlowNetworks<SecurityDataType = unknown> {
41037
+ http: HttpClient<SecurityDataType>;
41038
+ constructor(http: HttpClient<SecurityDataType>);
41039
+ /**
41040
+ * No description
41041
+ *
41042
+ * @tags flow-networks
41043
+ * @name CloneFlowNetwork
41044
+ * @summary Clone a flow network for what-if analysis.
41045
+ * @request POST:/api/v1/flow-networks/{network_id}/clone
41046
+ * @secure
41047
+ */
41048
+ cloneFlowNetwork: (networkId: string, params?: RequestParams) => Promise<HttpResponse<FlowNetworkResponse$1, void>>;
41049
+ /**
41050
+ * No description
41051
+ *
41052
+ * @tags flow-networks
41053
+ * @name CommitFlowNetwork
41054
+ * @summary Commit structural mutations (capacity updates and/or new edges).
41055
+ * @request POST:/api/v1/flow-networks/{network_id}/commit
41056
+ * @secure
41057
+ */
41058
+ commitFlowNetwork: (networkId: string, data: CommitFlowNetworkRequest$1, params?: RequestParams) => Promise<HttpResponse<FlowNetworkResponse$1, void>>;
41059
+ /**
41060
+ * No description
41061
+ *
41062
+ * @tags flow-networks
41063
+ * @name CreateFlowNetwork
41064
+ * @summary Create a new flow network.
41065
+ * @request POST:/api/v1/flow-networks
41066
+ * @secure
41067
+ */
41068
+ createFlowNetwork: (data: CreateFlowNetworkRequest$1, params?: RequestParams) => Promise<HttpResponse<FlowNetworkResponse$1, void>>;
41069
+ /**
41070
+ * No description
41071
+ *
41072
+ * @tags flow-networks
41073
+ * @name GetFlowNetwork
41074
+ * @summary Get a flow network's status.
41075
+ * @request GET:/api/v1/flow-networks/{network_id}
41076
+ * @secure
41077
+ */
41078
+ getFlowNetwork: (networkId: string, params?: RequestParams) => Promise<HttpResponse<FlowNetworkResponse$1, void>>;
41079
+ /**
41080
+ * No description
41081
+ *
41082
+ * @tags flow-networks
41083
+ * @name SolveFlowNetwork
41084
+ * @summary Solve a flow network with the chosen algorithm.
41085
+ * @request POST:/api/v1/flow-networks/{network_id}/solve
41086
+ * @secure
41087
+ */
41088
+ solveFlowNetwork: (networkId: string, data: SolveFlowNetworkRequest$1, params?: RequestParams) => Promise<HttpResponse<SolveFlowNetworkResponse$1, void>>;
41089
+ }
41090
+
41091
+ /**
41092
+ * Strategy chosen at solve time.
41093
+ *
41094
+ * The flow network is algorithm-agnostic — the same persisted graph
41095
+ * can be solved with different algorithms, and the response shape
41096
+ * narrows the relevant fields per algorithm.
41097
+ *
41098
+ * - `"max_flow"` — Dinic's algorithm. Returns `totalFlow` + per-edge flow.
41099
+ * - `"min_cost_max_flow"` — Successive-shortest-path MCMF. Returns
41100
+ * `totalFlow`, `totalCost`, per-edge flow. Edges should carry `cost`.
41101
+ * - `"classify_edges"` — Dulmage–Mendelsohn residual classification.
41102
+ * Returns per-edge `always_used` / `never_used` / `sometimes_used`.
41103
+ * - `"classify_edges_optimal"` — As above, but only over **optimal**
41104
+ * (min-cost) max-flow solutions.
41105
+ * - `"min_cut"` — Source-sink min cut. Returns the cut partition and
41106
+ * the saturated cut edges.
41107
+ */
41108
+ type FlowAlgorithm = {
41109
+ kind: 'max_flow';
41110
+ } | {
41111
+ kind: 'min_cost_max_flow';
41112
+ } | {
41113
+ kind: 'classify_edges';
41114
+ } | {
41115
+ kind: 'classify_edges_optimal';
41116
+ } | {
41117
+ kind: 'min_cut';
41118
+ };
41119
+ /**
41120
+ * A single directed edge in the flow network.
41121
+ */
41122
+ interface EdgeSpec {
41123
+ /** Source node name. Must appear in the network's node list. */
41124
+ from: string;
41125
+ /** Destination node name. Must appear in the network's node list. */
41126
+ to: string;
41127
+ /** Capacity (must be ≥ 0). */
41128
+ capacity: number;
41129
+ /**
41130
+ * Optional per-unit-flow cost. Defaults to zero — pure max-flow
41131
+ * algorithms ignore this field.
41132
+ */
41133
+ cost?: number | null;
41134
+ /**
41135
+ * Optional caller-supplied label. Must be unique across the
41136
+ * network when present. Used to reference the edge in commit
41137
+ * requests and to identify it in solver output.
41138
+ */
41139
+ label?: string | null;
41140
+ }
41141
+ /**
41142
+ * Input to {@link FlowNetworksClient.create}.
41143
+ */
41144
+ interface CreateFlowNetworkRequest {
41145
+ /** Node names. Must be unique. */
41146
+ nodes: string[];
41147
+ /** Source node name. Must appear in `nodes`. */
41148
+ source: string;
41149
+ /** Sink node name. Must appear in `nodes`, distinct from `source`. */
41150
+ sink: string;
41151
+ /** Initial edges. Order is preserved in inspection responses. */
41152
+ edges: EdgeSpec[];
41153
+ /**
41154
+ * Optional human-readable description. Stored only as part of the
41155
+ * response for inspection convenience.
41156
+ */
41157
+ description?: string | null;
41158
+ }
41159
+ /**
41160
+ * Status snapshot returned by every endpoint that does not solve
41161
+ * (create, get, clone, commit).
41162
+ */
41163
+ interface FlowNetworkResponse {
41164
+ /** Stable identifier assigned at creation; clones receive a new id. */
41165
+ id: string;
41166
+ /** Source node name. */
41167
+ source: string;
41168
+ /** Sink node name. */
41169
+ sink: string;
41170
+ /** Number of declared nodes. */
41171
+ nodeCount: number;
41172
+ /** Number of declared forward edges. */
41173
+ edgeCount: number;
41174
+ /** Optional description echoed from the create request. */
41175
+ description?: string | null;
41176
+ }
41177
+ /**
41178
+ * Replace the capacity of a labelled edge.
41179
+ */
41180
+ interface EdgeCapacityUpdate {
41181
+ /** Edge label declared at construction or via a prior commit. */
41182
+ label: string;
41183
+ /** New capacity (must be ≥ 0). */
41184
+ capacity: number;
41185
+ }
41186
+ /**
41187
+ * Input to {@link FlowNetworksClient.commit}.
41188
+ *
41189
+ * @remarks
41190
+ * Both fields are optional and may be supplied together. Capacity
41191
+ * updates apply before new edges are appended.
41192
+ */
41193
+ interface CommitFlowNetworkRequest {
41194
+ /** Capacity updates keyed by edge label. */
41195
+ updateCapacities?: EdgeCapacityUpdate[];
41196
+ /**
41197
+ * Edges to append. Source/destination must reference declared
41198
+ * nodes.
41199
+ */
41200
+ addEdges?: EdgeSpec[];
41201
+ }
41202
+ /**
41203
+ * Input to {@link FlowNetworksClient.solve}.
41204
+ */
41205
+ interface SolveFlowNetworkRequest {
41206
+ /** Algorithm to dispatch. */
41207
+ algorithm: FlowAlgorithm;
41208
+ }
41209
+ /**
41210
+ * Flow snapshot for a single forward edge.
41211
+ */
41212
+ interface EdgeFlow {
41213
+ /** Source node name. */
41214
+ from: string;
41215
+ /** Destination node name. */
41216
+ to: string;
41217
+ /** Caller-supplied label, if any. */
41218
+ label?: string | null;
41219
+ /** Original capacity. */
41220
+ capacity: number;
41221
+ /** Flow currently routed through this edge in the solver's output. */
41222
+ flow: number;
41223
+ }
41224
+ /** Edge feasibility class. */
41225
+ type EdgeClass = 'always_used' | 'never_used' | 'sometimes_used';
41226
+ /**
41227
+ * Per-edge classification produced by the `classify_edges` /
41228
+ * `classify_edges_optimal` algorithms.
41229
+ */
41230
+ interface EdgeClassification {
41231
+ from: string;
41232
+ to: string;
41233
+ label?: string | null;
41234
+ /** Class string: `"always_used"`, `"never_used"`, `"sometimes_used"`. */
41235
+ class: EdgeClass;
41236
+ }
41237
+ /**
41238
+ * Min-cut partition output (only populated when `algorithm.kind`
41239
+ * is `"min_cut"`).
41240
+ */
41241
+ interface MinCutReport {
41242
+ /** Names of nodes on the source side of the cut. */
41243
+ sourceSide: string[];
41244
+ /** Names of nodes on the sink side of the cut. */
41245
+ sinkSide: string[];
41246
+ /**
41247
+ * Cut edges (saturated forward edges crossing source-side →
41248
+ * sink-side). Their summed `capacity` equals the max flow value.
41249
+ */
41250
+ cutEdges: EdgeFlow[];
41251
+ }
41252
+ /**
41253
+ * Solver output. Fields irrelevant to the chosen algorithm are
41254
+ * undefined (the backend omits them via `skip_serializing_if`).
41255
+ */
41256
+ interface SolveFlowNetworkResponse {
41257
+ /** Echo of the algorithm dispatched. */
41258
+ algorithm: FlowAlgorithm;
41259
+ /** Per-edge flow snapshot. */
41260
+ edgeFlows: EdgeFlow[];
41261
+ /** Total flow source → sink (max-flow / mcmf / min-cut). */
41262
+ totalFlow?: number | null;
41263
+ /** Total cost of the realised flow (mcmf only). */
41264
+ totalCost?: number | null;
41265
+ /** Per-edge classification (classify_* algorithms only). */
41266
+ classifications?: EdgeClassification[] | null;
41267
+ /** Min-cut partition (min_cut algorithm only). */
41268
+ minCut?: MinCutReport | null;
41269
+ }
41270
+
41271
+ type flowNetworks_CommitFlowNetworkRequest = CommitFlowNetworkRequest;
41272
+ type flowNetworks_CreateFlowNetworkRequest = CreateFlowNetworkRequest;
41273
+ type flowNetworks_EdgeCapacityUpdate = EdgeCapacityUpdate;
41274
+ type flowNetworks_EdgeClass = EdgeClass;
41275
+ type flowNetworks_EdgeClassification = EdgeClassification;
41276
+ type flowNetworks_EdgeFlow = EdgeFlow;
41277
+ type flowNetworks_EdgeSpec = EdgeSpec;
41278
+ type flowNetworks_FlowAlgorithm = FlowAlgorithm;
41279
+ type flowNetworks_FlowNetworkResponse = FlowNetworkResponse;
41280
+ type flowNetworks_MinCutReport = MinCutReport;
41281
+ type flowNetworks_SolveFlowNetworkRequest = SolveFlowNetworkRequest;
41282
+ type flowNetworks_SolveFlowNetworkResponse = SolveFlowNetworkResponse;
41283
+ declare namespace flowNetworks {
41284
+ export type { flowNetworks_CommitFlowNetworkRequest as CommitFlowNetworkRequest, flowNetworks_CreateFlowNetworkRequest as CreateFlowNetworkRequest, flowNetworks_EdgeCapacityUpdate as EdgeCapacityUpdate, flowNetworks_EdgeClass as EdgeClass, flowNetworks_EdgeClassification as EdgeClassification, flowNetworks_EdgeFlow as EdgeFlow, flowNetworks_EdgeSpec as EdgeSpec, flowNetworks_FlowAlgorithm as FlowAlgorithm, flowNetworks_FlowNetworkResponse as FlowNetworkResponse, flowNetworks_MinCutReport as MinCutReport, flowNetworks_SolveFlowNetworkRequest as SolveFlowNetworkRequest, flowNetworks_SolveFlowNetworkResponse as SolveFlowNetworkResponse };
41285
+ }
41286
+
41287
+ /**
41288
+ * Resource client for the generic flow-network engine.
41289
+ *
41290
+ * @remarks
41291
+ * The engine persists a directed capacitated graph under a stable id
41292
+ * and dispatches a chosen algorithm (max-flow, min-cost max-flow,
41293
+ * edge-classification, min-cut) over it. Domain shapes (scheduling,
41294
+ * transportation, …) become translators that build a
41295
+ * {@link CreateFlowNetworkRequest}; the engine itself knows nothing
41296
+ * about agents, days, or shifts.
41297
+ *
41298
+ * Lifecycle mirrors the `/spaces` resource: `create` → optional
41299
+ * `clone` (for what-if branches) → optional `commit` (capacity tweaks
41300
+ * / edge appends) → `solve`.
41301
+ *
41302
+ * @example Solve max-flow on a tiny network
41303
+ * ```typescript
41304
+ * const network = await client.flowNetworks.create({
41305
+ * nodes: ['s', 'a', 'b', 't'],
41306
+ * source: 's',
41307
+ * sink: 't',
41308
+ * edges: [
41309
+ * { from: 's', to: 'a', capacity: 3 },
41310
+ * { from: 's', to: 'b', capacity: 2 },
41311
+ * { from: 'a', to: 't', capacity: 2 },
41312
+ * { from: 'b', to: 't', capacity: 3 },
41313
+ * ],
41314
+ * });
41315
+ *
41316
+ * const result = await client.flowNetworks.solve(network.id, {
41317
+ * algorithm: { kind: 'max_flow' },
41318
+ * });
41319
+ *
41320
+ * console.log(result.totalFlow); // 4
41321
+ * ```
41322
+ *
41323
+ * @example What-if branch via clone + commit
41324
+ * ```typescript
41325
+ * const branch = await client.flowNetworks.clone(network.id);
41326
+ * await client.flowNetworks.commit(branch.id, {
41327
+ * updateCapacities: [{ label: 'edge-a-t', capacity: 5 }],
41328
+ * });
41329
+ * const result = await client.flowNetworks.solve(branch.id, {
41330
+ * algorithm: { kind: 'max_flow' },
41331
+ * });
41332
+ * ```
41333
+ */
41334
+ declare class FlowNetworksClient {
41335
+ /** @internal */
41336
+ private readonly api;
41337
+ /** @internal */
41338
+ constructor(api: FlowNetworks);
41339
+ /**
41340
+ * Create and persist a new flow network.
41341
+ *
41342
+ * @param request - graph shape, source/sink, and initial edges.
41343
+ * @returns metadata for the new network (including its id).
41344
+ * @throws HTTP 400 if the input is malformed (duplicate node names,
41345
+ * source/sink not in `nodes`, edges referencing unknown nodes,
41346
+ * negative capacities, duplicate edge labels).
41347
+ */
41348
+ create(request: CreateFlowNetworkRequest): Promise<FlowNetworkResponse>;
41349
+ /**
41350
+ * Fetch the current status snapshot of a flow network.
41351
+ *
41352
+ * @throws HTTP 404 if the id is unknown.
41353
+ */
41354
+ get(networkId: string): Promise<FlowNetworkResponse>;
41355
+ /**
41356
+ * Clone an existing flow network for what-if analysis. The clone
41357
+ * receives a new id and its own mutable graph; the original is
41358
+ * unaffected.
41359
+ *
41360
+ * @throws HTTP 404 if the id is unknown.
41361
+ */
41362
+ clone(networkId: string): Promise<FlowNetworkResponse>;
41363
+ /**
41364
+ * Apply structural mutations to an existing network: replace
41365
+ * capacities of labelled edges and/or append new edges. Both
41366
+ * fields on the request are optional; capacity updates apply
41367
+ * before new edges are added.
41368
+ *
41369
+ * @throws HTTP 400 if a referenced label is unknown, an appended
41370
+ * edge references undeclared nodes, or capacities are negative.
41371
+ * @throws HTTP 404 if the id is unknown.
41372
+ */
41373
+ commit(networkId: string, request: CommitFlowNetworkRequest): Promise<FlowNetworkResponse>;
41374
+ /**
41375
+ * Run the chosen algorithm against the persisted network.
41376
+ *
41377
+ * @remarks
41378
+ * The response shape narrows per algorithm:
41379
+ *
41380
+ * - `max_flow` — `totalFlow` + `edgeFlows`.
41381
+ * - `min_cost_max_flow` — `totalFlow`, `totalCost`, `edgeFlows`.
41382
+ * - `classify_edges` / `classify_edges_optimal` — `classifications`.
41383
+ * - `min_cut` — `totalFlow`, `edgeFlows`, `minCut`.
41384
+ *
41385
+ * Fields irrelevant to the chosen algorithm are `undefined`.
41386
+ *
41387
+ * @throws HTTP 404 if the id is unknown.
41388
+ */
41389
+ solve(networkId: string, request: SolveFlowNetworkRequest): Promise<SolveFlowNetworkResponse>;
41390
+ }
41391
+
40925
41392
  declare class Osfql<SecurityDataType = unknown> {
40926
41393
  http: HttpClient<SecurityDataType>;
40927
41394
  constructor(http: HttpClient<SecurityDataType>);
@@ -42952,10 +43419,11 @@ interface AiGroup {
42952
43419
  readonly context: ContextClient;
42953
43420
  readonly rlTraining: RlTrainingClient;
42954
43421
  }
42955
- /** Advanced reasoning operations — optimization, ILP, CDL, execution, preferences, discovery, scheduling. */
43422
+ /** Advanced reasoning operations — optimization, ILP, CDL, execution, preferences, discovery, scheduling, flow networks. */
42956
43423
  interface ReasoningGroup {
42957
43424
  readonly optimize: OptimizeClient;
42958
43425
  readonly scheduling: SchedulingClient;
43426
+ readonly flowNetworks: FlowNetworksClient;
42959
43427
  readonly ilp: IlpClient;
42960
43428
  readonly cdl: CdlClient;
42961
43429
  readonly execution: ExecutionClient;
@@ -43105,6 +43573,8 @@ declare class ReasoningLayerClient {
43105
43573
  readonly optimize: OptimizeClient;
43106
43574
  /** Scheduling feasibility via capacitated bipartite b-matching (staff rostering, assignment problems). */
43107
43575
  readonly scheduling: SchedulingClient;
43576
+ /** Generic flow-network resource: max-flow, min-cost max-flow, edge classification, min-cut over a persisted graph. */
43577
+ readonly flowNetworks: FlowNetworksClient;
43108
43578
  /** OSFQL execution operations. */
43109
43579
  readonly osfql: OsfqlClient;
43110
43580
  /** Conversational AI operations (NL → OSFQL with self-correction). */
@@ -43152,7 +43622,7 @@ declare class ReasoningLayerClient {
43152
43622
  get core(): CoreGroup;
43153
43623
  /** AI and machine learning operations — agents, oversight, neuro-symbolic, RAG, generation, context, RL training. */
43154
43624
  get ai(): AiGroup;
43155
- /** Advanced reasoning operations — optimization, ILP, CDL, execution, preferences, discovery, scheduling. */
43625
+ /** Advanced reasoning operations — optimization, ILP, CDL, execution, preferences, discovery, scheduling, flow networks. */
43156
43626
  get reasoningOps(): ReasoningGroup;
43157
43627
  /** Analysis operations — causal, statistical, fuzzy, scenarios, communities, visualization. */
43158
43628
  get analysisOps(): AnalysisGroup;
@@ -44226,4 +44696,4 @@ declare function toUntaggedFeatures(features: PlainFeatureMap): Record<string, F
44226
44696
  */
44227
44697
  declare function toTermInputDto(input: PsiTermInput | TermInputDto): TermInputDto;
44228
44698
 
44229
- export { ANY_ROLE, actionReviews as ActionReviews, type AddFactRequest, type AddFactResponse, type AddRuleRequest, type AddRuleResponse, admin as Admin, type AiGroup, analysis as Analysis, type AnalysisGroup, ApiError, type ApiResponse, type AuthConfig, AuthenticationError, type BackwardChainRequest, type BackwardChainResponse, BadRequestError, type BulkAddTermsRequest, type BulkAddTermsResponse, type BulkCreateSortsRequest, type BulkCreateSortsResponse, cdl as CDL, causal as Causal, type ClearTermsResponse, type ClientConfig, cognitive as Cognitive, collections as Collections, communities as Communities, compliance as Compliance, type ConstrainedPlainVar, ConstraintViolationError, constraints as Constraints, control as Control, conversation as Conversation, type ConversationMessageRequest, type ConversationMessageResponse, type ConversationSummaryDto, type ConversationTurnsResponse, type CoreGroup, type CreateResearchSessionRequest, type CreateResearchSessionResponse, type CreateSortRequest, type CreateTermRequest, type DataGroup, discovery as Discovery, type ErrorResponse$1 as ErrorResponse, execution as Execution, extract as Extract, type FeatureInputValueDto, type FeatureValueDto, ForbiddenError, type ForwardChainRequest, type ForwardChainResponse, functions as Functions, fuzzy as Fuzzy, FuzzyShape, type FuzzyShapeDto, generation as Generation, type GlbRequest, type GlbResponse, health as Health, homoiconic as Homoiconic, ilp as ILP, imageExtraction as ImageExtraction, inference as Inference, type IngestPaperRequest, type IngestPaperResponse, ingestion as Ingestion, IngestionFailedError, IngestionSession, type IngestionSyncOptions, type Interceptor, InternalServerError, type JsonValue$1 as JsonValue, LP, type ListConversationsResponse, type LubRequest, type LubResponse, namespaces as Namespaces, NetworkError, neuroSymbolic as NeuroSymbolic, NotFoundError, ontology as Ontology, operations as Operations, optimize as Optimize, type OsfSearchRequest, type OsfSearchResponse, osfql as Osfql, type OsfqlRequest, type OsfqlResponse, type OsfqlValue, oversight as Oversight, type PaginationParams, type PaperMetadataDto, type PaperSource, type PlainFeatureMap, type PlainFeatureValue, plainValues as PlainValues, preferences as Preferences, proofEngine as ProofEngine, type PsiTermDto, type PsiTermInput, query as Query, rag as RAG, RateLimitError, type RateLimitInfo, reasoning as Reasoning, type ReasoningGroup, ReasoningLayerClient, ReasoningLayerError, type RequestOptions, research as Research, type ResearchContradictionsResponse, type ResearchCycleResponse, type ResearchFindingsResponse, type ResearchGapsResponse, type ResearchReportResponse, type ResearchSessionResponse, reviews as Reviews, row as Row, SDK_VERSION, scenarios as Scenarios, scheduling as Scheduling, type SearchPapersRequest, type SearchPapersResponse, SortBuilder, type SortDto, type SortInfoDto, sorts as Sorts, sources as Sources, spaces as Spaces, statistical as Statistical, synthetic as Synthetic, type SystemGroup, type TermDto, type TermInputArg, type TermInputDto, type TermListResponse, type TermPatternDto, type TermResponse, terms as Terms, TimeoutError, type TurnDto, type UpdateTermRequest, utilities as Utilities, ValidationError, Value, type ValueDto, values as Values, type VerifyClaimRequest, type VerifyClaimResponse, visualization as Visualization, WebSocketClient, WebSocketConnection, webhookActions as WebhookActions, type WorkflowGroup, allen, constrained, discriminateFeatureValue, guard, isConstrainedPlainVar, isPsiTermInput, isTaggedValueDto, isUuid, psi, toTaggedFeatures, toTaggedValue, toTermInputDto, toUntaggedFeatures, toUntaggedValue };
44699
+ export { ANY_ROLE, actionReviews as ActionReviews, type AddFactRequest, type AddFactResponse, type AddRuleRequest, type AddRuleResponse, admin as Admin, type AiGroup, analysis as Analysis, type AnalysisGroup, ApiError, type ApiResponse, type AuthConfig, AuthenticationError, type BackwardChainRequest, type BackwardChainResponse, BadRequestError, type BulkAddTermsRequest, type BulkAddTermsResponse, type BulkCreateSortsRequest, type BulkCreateSortsResponse, cdl as CDL, causal as Causal, type ClearTermsResponse, type ClientConfig, cognitive as Cognitive, collections as Collections, communities as Communities, compliance as Compliance, type ConstrainedPlainVar, ConstraintViolationError, constraints as Constraints, control as Control, conversation as Conversation, type ConversationMessageRequest, type ConversationMessageResponse, type ConversationSummaryDto, type ConversationTurnsResponse, type CoreGroup, type CreateResearchSessionRequest, type CreateResearchSessionResponse, type CreateSortRequest, type CreateTermRequest, type DataGroup, discovery as Discovery, type ErrorResponse$1 as ErrorResponse, execution as Execution, extract as Extract, type FeatureInputValueDto, type FeatureValueDto, flowNetworks as FlowNetworks, ForbiddenError, type ForwardChainRequest, type ForwardChainResponse, functions as Functions, fuzzy as Fuzzy, FuzzyShape, type FuzzyShapeDto, generation as Generation, type GlbRequest, type GlbResponse, health as Health, homoiconic as Homoiconic, ilp as ILP, imageExtraction as ImageExtraction, inference as Inference, type IngestPaperRequest, type IngestPaperResponse, ingestion as Ingestion, IngestionFailedError, IngestionSession, type IngestionSyncOptions, type Interceptor, InternalServerError, type JsonValue$1 as JsonValue, LP, type ListConversationsResponse, type LubRequest, type LubResponse, namespaces as Namespaces, NetworkError, neuroSymbolic as NeuroSymbolic, NotFoundError, ontology as Ontology, operations as Operations, optimize as Optimize, type OsfSearchRequest, type OsfSearchResponse, osfql as Osfql, type OsfqlRequest, type OsfqlResponse, type OsfqlValue, oversight as Oversight, type PaginationParams, type PaperMetadataDto, type PaperSource, type PlainFeatureMap, type PlainFeatureValue, plainValues as PlainValues, preferences as Preferences, proofEngine as ProofEngine, type PsiTermDto, type PsiTermInput, query as Query, rag as RAG, RateLimitError, type RateLimitInfo, reasoning as Reasoning, type ReasoningGroup, ReasoningLayerClient, ReasoningLayerError, type RequestOptions, research as Research, type ResearchContradictionsResponse, type ResearchCycleResponse, type ResearchFindingsResponse, type ResearchGapsResponse, type ResearchReportResponse, type ResearchSessionResponse, reviews as Reviews, row as Row, SDK_VERSION, scenarios as Scenarios, scheduling as Scheduling, type SearchPapersRequest, type SearchPapersResponse, SortBuilder, type SortDto, type SortInfoDto, sorts as Sorts, sources as Sources, spaces as Spaces, statistical as Statistical, synthetic as Synthetic, type SystemGroup, type TermDto, type TermInputArg, type TermInputDto, type TermListResponse, type TermPatternDto, type TermResponse, terms as Terms, TimeoutError, type TurnDto, type UpdateTermRequest, utilities as Utilities, ValidationError, Value, type ValueDto, values as Values, type VerifyClaimRequest, type VerifyClaimResponse, visualization as Visualization, WebSocketClient, WebSocketConnection, webhookActions as WebhookActions, type WorkflowGroup, allen, constrained, discriminateFeatureValue, guard, isConstrainedPlainVar, isPsiTermInput, isTaggedValueDto, isUuid, psi, toTaggedFeatures, toTaggedValue, toTermInputDto, toUntaggedFeatures, toUntaggedValue };