@kortexya/reasoninglayer 0.17.0 → 0.19.0

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.ts 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 = "0.17.0";
112
+ declare const SDK_VERSION = "0.19.0";
113
113
  /**
114
114
  * Configuration for the Reasoning Layer client.
115
115
  *
@@ -674,6 +674,31 @@ interface AgentGoalDto$1 {
674
674
  */
675
675
  term_id: string;
676
676
  }
677
+ /** A single agent's static properties. */
678
+ interface AgentInput {
679
+ /** Caller-chosen identifier. Must be unique within the request. */
680
+ id: string;
681
+ /**
682
+ * Maximum number of slots this agent may be assigned across the
683
+ * full horizon.
684
+ * @format int32
685
+ * @min 0
686
+ */
687
+ max_assignments: number;
688
+ /**
689
+ * When present, the agent may only be assigned to this shift
690
+ * index (all other shifts become unavailable).
691
+ * @min 0
692
+ */
693
+ restricted_to_shift?: number | null;
694
+ /**
695
+ * Role tags this agent carries (e.g. `"icu"`, `"senior"`). Used
696
+ * to satisfy per-role minimum-demand constraints.
697
+ */
698
+ roles?: string[];
699
+ /** Day indices on which the agent is unavailable for any shift. */
700
+ unavailable_days?: number[];
701
+ }
677
702
  /** Agent state DTO. */
678
703
  interface AgentStateDto$1 {
679
704
  /**
@@ -1012,6 +1037,27 @@ type AssignValueDto$1 = {
1012
1037
  term_id: string;
1013
1038
  type: "term_ref";
1014
1039
  };
1040
+ /** One entry per `(agent_id, day, shift)` in the input grid. */
1041
+ interface AssignmentDto {
1042
+ /** Echoes the `id` from [`AgentInput`]. */
1043
+ agent_id: string;
1044
+ /** @min 0 */
1045
+ day: number;
1046
+ /** @min 0 */
1047
+ shift: number;
1048
+ /**
1049
+ * Per-cell feasibility classification.
1050
+ *
1051
+ * Every cell in the input grid is classified as exactly one of these.
1052
+ */
1053
+ status: AssignmentStatusDto;
1054
+ }
1055
+ /**
1056
+ * Per-cell feasibility classification.
1057
+ *
1058
+ * Every cell in the input grid is classified as exactly one of these.
1059
+ */
1060
+ type AssignmentStatusDto = "confirmed_true" | "confirmed_false" | "free";
1015
1061
  /** Attention target DTO. */
1016
1062
  type AttentionTargetDto$1 = {
1017
1063
  /** @format uuid */
@@ -11427,6 +11473,14 @@ interface PendingReviewEntityDto {
11427
11473
  /** Original text span that was extracted */
11428
11474
  source_text?: string | null;
11429
11475
  }
11476
+ /** A pre-assigned `(agent, day, shift)` triple. */
11477
+ interface PinInput {
11478
+ agent_id: string;
11479
+ /** @min 0 */
11480
+ day: number;
11481
+ /** @min 0 */
11482
+ shift: number;
11483
+ }
11430
11484
  /** Pipeline quality statistics from validation gates and feedback loop */
11431
11485
  interface PipelineQualityStatsDto$1 {
11432
11486
  /**
@@ -13613,6 +13667,49 @@ interface ScenarioSummaryDto$1 {
13613
13667
  */
13614
13668
  sorts_created: number;
13615
13669
  }
13670
+ /**
13671
+ * A scheduling feasibility request.
13672
+ *
13673
+ * Agents are identified by opaque caller-chosen string IDs so the
13674
+ * response can be joined back to whatever identity the caller
13675
+ * maintains (e.g. employee numbers, user IDs, UUIDs).
13676
+ */
13677
+ interface SchedulingFeasibilityRequest$1 {
13678
+ /** All agents that may be assigned to slots. */
13679
+ agents: AgentInput[];
13680
+ /**
13681
+ * Number of days in the scheduling horizon. Valid day indices
13682
+ * are `0..days`.
13683
+ * @min 0
13684
+ */
13685
+ days: number;
13686
+ /** Per-slot demand. At most one entry per `(day, shift)` pair. */
13687
+ demands: ShiftDemandInput[];
13688
+ /**
13689
+ * Pre-assigned `(agent_id, day, shift)` triples the caller has
13690
+ * fixed; the engine treats each as confirmed-true and reduces
13691
+ * the remaining demand accordingly.
13692
+ */
13693
+ pins?: PinInput[];
13694
+ /**
13695
+ * Number of shifts per day. Valid shift indices are
13696
+ * `0..shifts_per_day`.
13697
+ * @min 0
13698
+ */
13699
+ shifts_per_day: number;
13700
+ }
13701
+ /** Response to [`SchedulingFeasibilityRequest`]. */
13702
+ interface SchedulingFeasibilityResponse$1 {
13703
+ /**
13704
+ * Empty when `status` is `infeasible`; otherwise contains one
13705
+ * entry per `(agent, day, shift)` triple in the input grid.
13706
+ */
13707
+ assignments: AssignmentDto[];
13708
+ /** Top-level request status. */
13709
+ status: SchedulingStatusDto;
13710
+ }
13711
+ /** Top-level request status. */
13712
+ type SchedulingStatusDto = "feasible" | "infeasible";
13616
13713
  /** Request to search communities */
13617
13714
  interface SearchCommunitiesRequest$1 {
13618
13715
  /**
@@ -13646,7 +13743,7 @@ interface SearchCommunitiesResponse$1 {
13646
13743
  * Defaults to `solutions` for full backward compatibility with existing clients
13647
13744
  * that do not send a `mode` field.
13648
13745
  */
13649
- type SearchModeDto$1 = "solutions" | "feasibility" | "scheduling";
13746
+ type SearchModeDto$1 = "solutions" | "feasibility";
13650
13747
  /** Request to search for solutions */
13651
13748
  interface SearchRequest {
13652
13749
  /**
@@ -13904,6 +14001,25 @@ interface SetSortSimilarityResponse$1 {
13904
14001
  /** Whether the operation succeeded */
13905
14002
  success: boolean;
13906
14003
  }
14004
+ /** Demand for a single `(day, shift)` slot. */
14005
+ interface ShiftDemandInput {
14006
+ /** @min 0 */
14007
+ day: number;
14008
+ /**
14009
+ * Minimum count per role. The remainder of `total` may be filled
14010
+ * by any eligible agent. Role names must match tags used in
14011
+ * [`AgentInput::roles`].
14012
+ */
14013
+ role_minimums?: Record<string, number>;
14014
+ /** @min 0 */
14015
+ shift: number;
14016
+ /**
14017
+ * Total number of agents required for this slot.
14018
+ * @format int32
14019
+ * @min 0
14020
+ */
14021
+ total: number;
14022
+ }
13907
14023
  /** A single similarity entry for bulk operations */
13908
14024
  interface SimilarityEntry {
13909
14025
  /**
@@ -31042,15 +31158,16 @@ interface CommitRequest {
31042
31158
  * - `"solutions"`: enumerate complete, valid assignments (default — backward compatible).
31043
31159
  * - `"feasibility"`: run 2×N per-variable SAT queries and return reachability info.
31044
31160
  * Much faster than full enumeration for large spaces.
31045
- * - `"scheduling"`: route the space through the specialised **bipartite network-flow
31046
- * engine** for scheduling-shaped problems (nurses × days × shifts with per-slot
31047
- * demand and role minimums). Orders of magnitude faster than `"feasibility"` for
31048
- * problems that fit this shape, and always returns fully `verified: true` results.
31049
- * If the underlying problem's constraint shape cannot be modelled by the flow
31050
- * engine, the backend responds with a 400 and the caller should fall back to
31051
- * `"feasibility"`.
31161
+ *
31162
+ * For scheduling-shaped problems (staff rostering, vehicle-to-route
31163
+ * assignment, task-to-worker matching, etc.) use the dedicated
31164
+ * {@link SchedulingClient.feasibility | `client.scheduling.feasibility()`}
31165
+ * endpoint instead of routing through `ComputationSpace`. It accepts a
31166
+ * native scheduling problem definition and returns structured per-cell
31167
+ * feasibility classifications — no string-encoded variable names on the
31168
+ * wire, and it preserves real role names end-to-end.
31052
31169
  */
31053
- type SearchModeDto = 'solutions' | 'feasibility' | 'scheduling';
31170
+ type SearchModeDto = 'solutions' | 'feasibility';
31054
31171
  /**
31055
31172
  * Reachability of a single binary choice-point variable.
31056
31173
  *
@@ -39136,6 +39253,223 @@ declare class OptimizeClient {
39136
39253
  private cleanupArtifacts;
39137
39254
  }
39138
39255
 
39256
+ declare class Scheduling<SecurityDataType = unknown> {
39257
+ http: HttpClient<SecurityDataType>;
39258
+ constructor(http: HttpClient<SecurityDataType>);
39259
+ /**
39260
+ * @description Classify every `(agent, day, shift)` cell in the input grid as confirmed-true, confirmed-false, or free. Input validation errors (duplicate agent IDs, out-of-range pins, role minima exceeding total demand, etc.) return HTTP 400. Infeasibility of a well-formed problem is a valid answer and returns HTTP 200 with `status = "infeasible"` and an empty `assignments` list.
39261
+ *
39262
+ * @tags scheduling
39263
+ * @name Feasibility
39264
+ * @summary `POST /api/v1/scheduling/feasibility`
39265
+ * @request POST:/api/v1/scheduling/feasibility
39266
+ */
39267
+ feasibility: (data: SchedulingFeasibilityRequest$1, params?: RequestParams) => Promise<HttpResponse<SchedulingFeasibilityResponse$1, void>>;
39268
+ }
39269
+
39270
+ /**
39271
+ * Per-cell feasibility classification produced by the scheduling engine.
39272
+ *
39273
+ * @remarks
39274
+ * Every `(agent, day, shift)` cell in the input grid is classified as
39275
+ * exactly one of these values. The flow engine is exact — there is no
39276
+ * "unverified" outcome.
39277
+ *
39278
+ * - `"confirmed_true"` — the agent MUST work this slot in every valid schedule.
39279
+ * - `"confirmed_false"` — the agent CANNOT work this slot in any valid schedule.
39280
+ * - `"free"` — the agent's assignment to this slot varies across valid schedules.
39281
+ */
39282
+ type AssignmentStatus = 'confirmed_true' | 'confirmed_false' | 'free';
39283
+ /**
39284
+ * Top-level scheduling request status.
39285
+ *
39286
+ * @remarks
39287
+ * - `"feasible"` — a valid schedule exists; `assignments` contains per-cell
39288
+ * classifications.
39289
+ * - `"infeasible"` — no valid schedule exists; `assignments` is empty.
39290
+ */
39291
+ type SchedulingStatus = 'feasible' | 'infeasible';
39292
+ /**
39293
+ * A single agent that may be assigned to slots.
39294
+ */
39295
+ interface AgentSpec {
39296
+ /** Caller-chosen identifier. Must be unique within the request. */
39297
+ id: string;
39298
+ /**
39299
+ * Role tags this agent carries (e.g. `"icu"`, `"senior"`). Used to
39300
+ * satisfy per-role minimum-demand constraints. Defaults to an empty
39301
+ * array if omitted.
39302
+ */
39303
+ roles?: string[];
39304
+ /**
39305
+ * Maximum number of slots this agent may be assigned across the full
39306
+ * horizon.
39307
+ */
39308
+ maxAssignments: number;
39309
+ /**
39310
+ * Day indices on which the agent is unavailable for any shift.
39311
+ * Defaults to an empty array if omitted.
39312
+ */
39313
+ unavailableDays?: number[];
39314
+ /**
39315
+ * When present, the agent may only be assigned to this shift index
39316
+ * (all other shifts become unavailable).
39317
+ */
39318
+ restrictedToShift?: number | null;
39319
+ }
39320
+ /**
39321
+ * Demand for a single `(day, shift)` slot.
39322
+ */
39323
+ interface ShiftDemand {
39324
+ /** Day index (0..days). */
39325
+ day: number;
39326
+ /** Shift index (0..shiftsPerDay). */
39327
+ shift: number;
39328
+ /** Total number of agents required for this slot. */
39329
+ total: number;
39330
+ /**
39331
+ * Minimum count per role. The remainder of `total` may be filled by
39332
+ * any eligible agent. Role names must match tags used in
39333
+ * {@link AgentSpec.roles}.
39334
+ */
39335
+ roleMinimums?: Record<string, number>;
39336
+ }
39337
+ /**
39338
+ * A pre-assigned `(agent, day, shift)` triple. The engine treats the
39339
+ * pin as confirmed-true and reduces the slot's remaining demand.
39340
+ */
39341
+ interface Pin {
39342
+ agentId: string;
39343
+ day: number;
39344
+ shift: number;
39345
+ }
39346
+ /**
39347
+ * Input to {@link SchedulingClient.feasibility}.
39348
+ *
39349
+ * @remarks
39350
+ * Agents are identified by opaque caller-chosen string IDs so the
39351
+ * response can be joined back to whatever identity the caller maintains
39352
+ * (employee numbers, user IDs, UUIDs, display names, …).
39353
+ */
39354
+ interface SchedulingFeasibilityRequest {
39355
+ /** All agents that may be assigned to slots. */
39356
+ agents: AgentSpec[];
39357
+ /** Number of days in the scheduling horizon. Valid day indices are `0..days`. */
39358
+ days: number;
39359
+ /** Number of shifts per day. Valid shift indices are `0..shiftsPerDay`. */
39360
+ shiftsPerDay: number;
39361
+ /** Per-slot demand. At most one entry per `(day, shift)` pair. */
39362
+ demands: ShiftDemand[];
39363
+ /** Pre-assigned `(agent, day, shift)` triples. Defaults to empty. */
39364
+ pins?: Pin[];
39365
+ }
39366
+ /**
39367
+ * One classified cell in the input grid.
39368
+ */
39369
+ interface Assignment {
39370
+ /** Echoes the `id` from {@link AgentSpec}. */
39371
+ agentId: string;
39372
+ day: number;
39373
+ shift: number;
39374
+ status: AssignmentStatus;
39375
+ }
39376
+ /**
39377
+ * Response from {@link SchedulingClient.feasibility}.
39378
+ *
39379
+ * @remarks
39380
+ * - When `status === "feasible"`: `assignments` contains one entry per
39381
+ * `(agent, day, shift)` triple in the input grid, sorted by
39382
+ * `(agentId, day, shift)`.
39383
+ * - When `status === "infeasible"`: `assignments` is empty.
39384
+ */
39385
+ interface SchedulingFeasibilityResponse {
39386
+ status: SchedulingStatus;
39387
+ assignments: Assignment[];
39388
+ }
39389
+
39390
+ type scheduling_AgentSpec = AgentSpec;
39391
+ type scheduling_Assignment = Assignment;
39392
+ type scheduling_AssignmentStatus = AssignmentStatus;
39393
+ type scheduling_Pin = Pin;
39394
+ type scheduling_SchedulingFeasibilityRequest = SchedulingFeasibilityRequest;
39395
+ type scheduling_SchedulingFeasibilityResponse = SchedulingFeasibilityResponse;
39396
+ type scheduling_SchedulingStatus = SchedulingStatus;
39397
+ type scheduling_ShiftDemand = ShiftDemand;
39398
+ declare namespace scheduling {
39399
+ export type { scheduling_AgentSpec as AgentSpec, scheduling_Assignment as Assignment, scheduling_AssignmentStatus as AssignmentStatus, scheduling_Pin as Pin, scheduling_SchedulingFeasibilityRequest as SchedulingFeasibilityRequest, scheduling_SchedulingFeasibilityResponse as SchedulingFeasibilityResponse, scheduling_SchedulingStatus as SchedulingStatus, scheduling_ShiftDemand as ShiftDemand };
39400
+ }
39401
+
39402
+ /**
39403
+ * Resource client for the scheduling feasibility engine.
39404
+ *
39405
+ * @remarks
39406
+ * The engine classifies every `(agent, day, shift)` cell in a rostering
39407
+ * problem as **confirmed-true**, **confirmed-false**, or **free** using a
39408
+ * capacitated bipartite b-matching (Dinic max-flow + Dulmage–Mendelsohn
39409
+ * residual decomposition). The structure fits staff rostering
39410
+ * (hospital nurses, call-centre agents, field crews), vehicle-to-route
39411
+ * assignment, and any "cover demand with capacity-limited resources"
39412
+ * problem.
39413
+ *
39414
+ * All agent identities are caller-chosen opaque strings — the SDK round-
39415
+ * trips whatever IDs you pass in, so you can plug employee numbers,
39416
+ * UUIDs, or display names directly into the request.
39417
+ *
39418
+ * @example Basic feasibility query
39419
+ * ```typescript
39420
+ * const report = await client.scheduling.feasibility({
39421
+ * agents: [
39422
+ * { id: 'alice', roles: ['icu'], maxAssignments: 3 },
39423
+ * { id: 'bob', roles: ['general'], maxAssignments: 3 },
39424
+ * ],
39425
+ * days: 7,
39426
+ * shiftsPerDay: 3,
39427
+ * demands: [
39428
+ * { day: 0, shift: 0, total: 2, roleMinimums: { icu: 1 } },
39429
+ * // ... one demand per (day, shift) slot you care about
39430
+ * ],
39431
+ * });
39432
+ *
39433
+ * if (report.status === 'feasible') {
39434
+ * for (const cell of report.assignments) {
39435
+ * console.log(cell.agentId, cell.day, cell.shift, '→', cell.status);
39436
+ * }
39437
+ * }
39438
+ * ```
39439
+ *
39440
+ * @example Pinning pre-decided assignments
39441
+ * ```typescript
39442
+ * const report = await client.scheduling.feasibility({
39443
+ * ...problem,
39444
+ * pins: [
39445
+ * { agentId: 'alice', day: 0, shift: 0 }, // Alice WILL work this slot
39446
+ * ],
39447
+ * });
39448
+ * ```
39449
+ */
39450
+ declare class SchedulingClient {
39451
+ /** @internal */
39452
+ private readonly api;
39453
+ /** @internal */
39454
+ constructor(api: Scheduling);
39455
+ /**
39456
+ * Classify every `(agent, day, shift)` cell in the input grid as
39457
+ * `confirmed_true`, `confirmed_false`, or `free`.
39458
+ *
39459
+ * @param request - the scheduling problem to analyse.
39460
+ * @returns a {@link SchedulingFeasibilityResponse} with per-cell classifications.
39461
+ * @throws If the backend rejects the input (HTTP 400): duplicate agent
39462
+ * IDs, pins referencing unknown agents, role minima exceeding total
39463
+ * demand, out-of-range day/shift indices, etc.
39464
+ *
39465
+ * @remarks
39466
+ * Infeasibility of a well-formed problem is a **valid answer** (HTTP 200
39467
+ * with `status === "infeasible"`), not an error. Only malformed input
39468
+ * raises.
39469
+ */
39470
+ feasibility(request: SchedulingFeasibilityRequest): Promise<SchedulingFeasibilityResponse>;
39471
+ }
39472
+
39139
39473
  declare class Osfql<SecurityDataType = unknown> {
39140
39474
  http: HttpClient<SecurityDataType>;
39141
39475
  constructor(http: HttpClient<SecurityDataType>);
@@ -40730,9 +41064,10 @@ interface AiGroup {
40730
41064
  readonly context: ContextClient;
40731
41065
  readonly rlTraining: RlTrainingClient;
40732
41066
  }
40733
- /** Advanced reasoning operations — optimization, ILP, CDL, execution, preferences, discovery. */
41067
+ /** Advanced reasoning operations — optimization, ILP, CDL, execution, preferences, discovery, scheduling. */
40734
41068
  interface ReasoningGroup {
40735
41069
  readonly optimize: OptimizeClient;
41070
+ readonly scheduling: SchedulingClient;
40736
41071
  readonly ilp: IlpClient;
40737
41072
  readonly cdl: CdlClient;
40738
41073
  readonly execution: ExecutionClient;
@@ -40880,6 +41215,8 @@ declare class ReasoningLayerClient {
40880
41215
  readonly rag: RagClient;
40881
41216
  /** Linear program optimization (CLP(Q) simplex solver via backward chaining). */
40882
41217
  readonly optimize: OptimizeClient;
41218
+ /** Scheduling feasibility via capacitated bipartite b-matching (staff rostering, assignment problems). */
41219
+ readonly scheduling: SchedulingClient;
40883
41220
  /** OSFQL execution operations. */
40884
41221
  readonly osfql: OsfqlClient;
40885
41222
  /** Conversational AI operations (NL → OSFQL with self-correction). */
@@ -40923,7 +41260,7 @@ declare class ReasoningLayerClient {
40923
41260
  get core(): CoreGroup;
40924
41261
  /** AI and machine learning operations — agents, oversight, neuro-symbolic, RAG, generation, context, RL training. */
40925
41262
  get ai(): AiGroup;
40926
- /** Advanced reasoning operations — optimization, ILP, CDL, execution, preferences, discovery. */
41263
+ /** Advanced reasoning operations — optimization, ILP, CDL, execution, preferences, discovery, scheduling. */
40927
41264
  get reasoningOps(): ReasoningGroup;
40928
41265
  /** Analysis operations — causal, statistical, fuzzy, scenarios, communities, visualization. */
40929
41266
  get analysisOps(): AnalysisGroup;
@@ -41997,4 +42334,4 @@ declare function toUntaggedFeatures(features: PlainFeatureMap): Record<string, F
41997
42334
  */
41998
42335
  declare function toTermInputDto(input: PsiTermInput | TermInputDto): TermInputDto;
41999
42336
 
42000
- export { actionReviews as ActionReviews, type AddFactRequest, type AddFactResponse, type AddRuleRequest, type AddRuleResponse, admin as Admin, type AiGroup, analysis as Analysis, type AnalysisGroup, ApiError, type ApiResponse, 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, 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, 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, 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 };
42337
+ export { actionReviews as ActionReviews, type AddFactRequest, type AddFactResponse, type AddRuleRequest, type AddRuleResponse, admin as Admin, type AiGroup, analysis as Analysis, type AnalysisGroup, ApiError, type ApiResponse, 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, 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, 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 };
package/dist/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  // src/config.ts
2
- var SDK_VERSION = "0.17.0";
2
+ var SDK_VERSION = "0.19.0";
3
3
  function resolveConfig(config) {
4
4
  if (!config.baseUrl) {
5
5
  throw new Error("ClientConfig.baseUrl is required");
@@ -7377,6 +7377,30 @@ var Health = class {
7377
7377
  });
7378
7378
  };
7379
7379
 
7380
+ // src/api-spec/generated/Scheduling.ts
7381
+ var Scheduling = class {
7382
+ http;
7383
+ constructor(http) {
7384
+ this.http = http;
7385
+ }
7386
+ /**
7387
+ * @description Classify every `(agent, day, shift)` cell in the input grid as confirmed-true, confirmed-false, or free. Input validation errors (duplicate agent IDs, out-of-range pins, role minima exceeding total demand, etc.) return HTTP 400. Infeasibility of a well-formed problem is a valid answer and returns HTTP 200 with `status = "infeasible"` and an empty `assignments` list.
7388
+ *
7389
+ * @tags scheduling
7390
+ * @name Feasibility
7391
+ * @summary `POST /api/v1/scheduling/feasibility`
7392
+ * @request POST:/api/v1/scheduling/feasibility
7393
+ */
7394
+ feasibility = (data, params = {}) => this.http.request({
7395
+ path: `/api/v1/scheduling/feasibility`,
7396
+ method: "POST",
7397
+ body: data,
7398
+ type: "application/json" /* Json */,
7399
+ format: "json",
7400
+ ...params
7401
+ });
7402
+ };
7403
+
7380
7404
  // src/api-spec/generated/Admin.ts
7381
7405
  var Admin = class {
7382
7406
  http;
@@ -20438,6 +20462,99 @@ function extractNumericValue(features, featureName) {
20438
20462
  return null;
20439
20463
  }
20440
20464
 
20465
+ // src/normalizers/scheduling.ts
20466
+ function AgentSpecFromFrontToApi(spec) {
20467
+ const dto = {
20468
+ id: spec.id,
20469
+ max_assignments: spec.maxAssignments
20470
+ };
20471
+ if (spec.roles !== void 0) {
20472
+ dto.roles = spec.roles;
20473
+ }
20474
+ if (spec.unavailableDays !== void 0) {
20475
+ dto.unavailable_days = spec.unavailableDays;
20476
+ }
20477
+ if (spec.restrictedToShift !== void 0 && spec.restrictedToShift !== null) {
20478
+ dto.restricted_to_shift = spec.restrictedToShift;
20479
+ }
20480
+ return dto;
20481
+ }
20482
+ function ShiftDemandFromFrontToApi(demand) {
20483
+ const dto = {
20484
+ day: demand.day,
20485
+ shift: demand.shift,
20486
+ total: demand.total
20487
+ };
20488
+ if (demand.roleMinimums !== void 0) {
20489
+ dto.role_minimums = demand.roleMinimums;
20490
+ }
20491
+ return dto;
20492
+ }
20493
+ function PinFromFrontToApi(pin) {
20494
+ return {
20495
+ agent_id: pin.agentId,
20496
+ day: pin.day,
20497
+ shift: pin.shift
20498
+ };
20499
+ }
20500
+ function SchedulingFeasibilityRequestFromFrontToApi(request) {
20501
+ const dto = {
20502
+ agents: request.agents.map(AgentSpecFromFrontToApi),
20503
+ days: request.days,
20504
+ shifts_per_day: request.shiftsPerDay,
20505
+ demands: request.demands.map(ShiftDemandFromFrontToApi)
20506
+ };
20507
+ if (request.pins !== void 0) {
20508
+ dto.pins = request.pins.map(PinFromFrontToApi);
20509
+ }
20510
+ return dto;
20511
+ }
20512
+ function AssignmentFromApiToFront(dto) {
20513
+ return {
20514
+ agentId: dto.agent_id,
20515
+ day: dto.day,
20516
+ shift: dto.shift,
20517
+ status: dto.status
20518
+ };
20519
+ }
20520
+ function SchedulingFeasibilityResponseFromApiToFront(dto) {
20521
+ return {
20522
+ status: dto.status,
20523
+ assignments: dto.assignments.map(AssignmentFromApiToFront)
20524
+ };
20525
+ }
20526
+
20527
+ // src/resources/scheduling.ts
20528
+ var SchedulingClient = class {
20529
+ /** @internal */
20530
+ api;
20531
+ /** @internal */
20532
+ constructor(api) {
20533
+ this.api = api;
20534
+ }
20535
+ /**
20536
+ * Classify every `(agent, day, shift)` cell in the input grid as
20537
+ * `confirmed_true`, `confirmed_false`, or `free`.
20538
+ *
20539
+ * @param request - the scheduling problem to analyse.
20540
+ * @returns a {@link SchedulingFeasibilityResponse} with per-cell classifications.
20541
+ * @throws If the backend rejects the input (HTTP 400): duplicate agent
20542
+ * IDs, pins referencing unknown agents, role minima exceeding total
20543
+ * demand, out-of-range day/shift indices, etc.
20544
+ *
20545
+ * @remarks
20546
+ * Infeasibility of a well-formed problem is a **valid answer** (HTTP 200
20547
+ * with `status === "infeasible"`), not an error. Only malformed input
20548
+ * raises.
20549
+ */
20550
+ async feasibility(request) {
20551
+ const response = await this.api.feasibility(
20552
+ SchedulingFeasibilityRequestFromFrontToApi(request)
20553
+ );
20554
+ return SchedulingFeasibilityResponseFromApiToFront(response.data);
20555
+ }
20556
+ };
20557
+
20441
20558
  // src/normalizers/osfql.ts
20442
20559
  function OsfqlResponseFromApiToFront(dto) {
20443
20560
  return {
@@ -21588,6 +21705,8 @@ var ReasoningLayerClient = class {
21588
21705
  rag;
21589
21706
  /** Linear program optimization (CLP(Q) simplex solver via backward chaining). */
21590
21707
  optimize;
21708
+ /** Scheduling feasibility via capacitated bipartite b-matching (staff rostering, assignment problems). */
21709
+ scheduling;
21591
21710
  /** OSFQL execution operations. */
21592
21711
  osfql;
21593
21712
  /** Conversational AI operations (NL → OSFQL with self-correction). */
@@ -21663,10 +21782,11 @@ var ReasoningLayerClient = class {
21663
21782
  rlTraining: this.rlTraining
21664
21783
  };
21665
21784
  }
21666
- /** Advanced reasoning operations — optimization, ILP, CDL, execution, preferences, discovery. */
21785
+ /** Advanced reasoning operations — optimization, ILP, CDL, execution, preferences, discovery, scheduling. */
21667
21786
  get reasoningOps() {
21668
21787
  return this._reasoning ??= {
21669
21788
  optimize: this.optimize,
21789
+ scheduling: this.scheduling,
21670
21790
  ilp: this.ilp,
21671
21791
  cdl: this.cdl,
21672
21792
  execution: this.execution,
@@ -21821,6 +21941,7 @@ var ReasoningLayerClient = class {
21821
21941
  this.generation = new GenerationClient(generatedGeneration);
21822
21942
  this.rag = new RagClient(generatedRag);
21823
21943
  this.optimize = new OptimizeClient(generatedInference, generatedSorts, generatedQuery, generatedTerms, resolved.tenantId);
21944
+ this.scheduling = new SchedulingClient(new Scheduling(generatedHttp));
21824
21945
  this.osfql = new OsfqlClient(generatedOsfql);
21825
21946
  this.conversation = new ConversationClient(generatedHttp);
21826
21947
  this.research = new ResearchClient(generatedHttp);
@@ -21965,6 +22086,9 @@ var rag_exports = {};
21965
22086
  // src/types/optimize.ts
21966
22087
  var optimize_exports = {};
21967
22088
 
22089
+ // src/types/scheduling.ts
22090
+ var scheduling_exports = {};
22091
+
21968
22092
  // src/types/ilp.ts
21969
22093
  var ilp_exports = {};
21970
22094
 
@@ -22654,6 +22778,6 @@ function discriminateFeatureValue(value) {
22654
22778
  );
22655
22779
  }
22656
22780
 
22657
- export { action_reviews_exports as ActionReviews, admin_exports as Admin, analysis_exports as Analysis, ApiError, AuthenticationError, BadRequestError, cdl_exports as CDL, causal_exports as Causal, cognitive_exports as Cognitive, collections_exports as Collections, communities_exports as Communities, ConstraintViolationError, constraints_exports as Constraints, control_exports as Control, conversation_exports as Conversation, discovery_exports as Discovery, execution_exports as Execution, extract_exports as Extract, ForbiddenError, functions_exports as Functions, fuzzy_exports as Fuzzy, FuzzyShape, generation_exports as Generation, health_exports as Health, homoiconic_exports as Homoiconic, ilp_exports as ILP, image_extraction_exports as ImageExtraction, inference_exports as Inference, ingestion_exports as Ingestion, IngestionFailedError, IngestionSession, InternalServerError, LP, namespaces_exports as Namespaces, NetworkError, neuro_symbolic_exports as NeuroSymbolic, NotFoundError, ontology_exports as Ontology, optimize_exports as Optimize, osfql_exports as Osfql, oversight_exports as Oversight, plain_values_exports as PlainValues, preferences_exports as Preferences, proof_engine_exports as ProofEngine, query_exports as Query, rag_exports as RAG, RateLimitError, reasoning_exports as Reasoning, ReasoningLayerClient, ReasoningLayerError, research_exports as Research, reviews_exports as Reviews, row_exports as Row, SDK_VERSION, scenarios_exports as Scenarios, SortBuilder, sorts_exports as Sorts, sources_exports as Sources, spaces_exports as Spaces, statistical_exports as Statistical, synthetic_exports as Synthetic, terms_exports as Terms, TimeoutError, utilities_exports as Utilities, ValidationError, Value, values_exports as Values, visualization_exports as Visualization, WebSocketClient, WebSocketConnection, webhook_actions_exports as WebhookActions, allen, constrained, discriminateFeatureValue, guard, isConstrainedPlainVar, isPsiTermInput, isTaggedValueDto, isUuid, psi, toTaggedFeatures, toTaggedValue, toTermInputDto, toUntaggedFeatures, toUntaggedValue };
22781
+ export { action_reviews_exports as ActionReviews, admin_exports as Admin, analysis_exports as Analysis, ApiError, AuthenticationError, BadRequestError, cdl_exports as CDL, causal_exports as Causal, cognitive_exports as Cognitive, collections_exports as Collections, communities_exports as Communities, ConstraintViolationError, constraints_exports as Constraints, control_exports as Control, conversation_exports as Conversation, discovery_exports as Discovery, execution_exports as Execution, extract_exports as Extract, ForbiddenError, functions_exports as Functions, fuzzy_exports as Fuzzy, FuzzyShape, generation_exports as Generation, health_exports as Health, homoiconic_exports as Homoiconic, ilp_exports as ILP, image_extraction_exports as ImageExtraction, inference_exports as Inference, ingestion_exports as Ingestion, IngestionFailedError, IngestionSession, InternalServerError, LP, namespaces_exports as Namespaces, NetworkError, neuro_symbolic_exports as NeuroSymbolic, NotFoundError, ontology_exports as Ontology, optimize_exports as Optimize, osfql_exports as Osfql, oversight_exports as Oversight, plain_values_exports as PlainValues, preferences_exports as Preferences, proof_engine_exports as ProofEngine, query_exports as Query, rag_exports as RAG, RateLimitError, reasoning_exports as Reasoning, ReasoningLayerClient, ReasoningLayerError, research_exports as Research, reviews_exports as Reviews, row_exports as Row, SDK_VERSION, scenarios_exports as Scenarios, scheduling_exports as Scheduling, SortBuilder, sorts_exports as Sorts, sources_exports as Sources, spaces_exports as Spaces, statistical_exports as Statistical, synthetic_exports as Synthetic, terms_exports as Terms, TimeoutError, utilities_exports as Utilities, ValidationError, Value, values_exports as Values, visualization_exports as Visualization, WebSocketClient, WebSocketConnection, webhook_actions_exports as WebhookActions, allen, constrained, discriminateFeatureValue, guard, isConstrainedPlainVar, isPsiTermInput, isTaggedValueDto, isUuid, psi, toTaggedFeatures, toTaggedValue, toTermInputDto, toUntaggedFeatures, toUntaggedValue };
22658
22782
  //# sourceMappingURL=index.js.map
22659
22783
  //# sourceMappingURL=index.js.map