@kortexya/reasoninglayer 0.17.0 → 0.18.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.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  'use strict';
2
2
 
3
3
  // src/config.ts
4
- var SDK_VERSION = "0.17.0";
4
+ var SDK_VERSION = "0.18.0";
5
5
  function resolveConfig(config) {
6
6
  if (!config.baseUrl) {
7
7
  throw new Error("ClientConfig.baseUrl is required");
@@ -7379,6 +7379,30 @@ var Health = class {
7379
7379
  });
7380
7380
  };
7381
7381
 
7382
+ // src/api-spec/generated/Scheduling.ts
7383
+ var Scheduling = class {
7384
+ http;
7385
+ constructor(http) {
7386
+ this.http = http;
7387
+ }
7388
+ /**
7389
+ * @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.
7390
+ *
7391
+ * @tags scheduling
7392
+ * @name Feasibility
7393
+ * @summary `POST /api/v1/scheduling/feasibility`
7394
+ * @request POST:/api/v1/scheduling/feasibility
7395
+ */
7396
+ feasibility = (data, params = {}) => this.http.request({
7397
+ path: `/api/v1/scheduling/feasibility`,
7398
+ method: "POST",
7399
+ body: data,
7400
+ type: "application/json" /* Json */,
7401
+ format: "json",
7402
+ ...params
7403
+ });
7404
+ };
7405
+
7382
7406
  // src/api-spec/generated/Admin.ts
7383
7407
  var Admin = class {
7384
7408
  http;
@@ -20440,6 +20464,99 @@ function extractNumericValue(features, featureName) {
20440
20464
  return null;
20441
20465
  }
20442
20466
 
20467
+ // src/normalizers/scheduling.ts
20468
+ function AgentSpecFromFrontToApi(spec) {
20469
+ const dto = {
20470
+ id: spec.id,
20471
+ max_assignments: spec.maxAssignments
20472
+ };
20473
+ if (spec.roles !== void 0) {
20474
+ dto.roles = spec.roles;
20475
+ }
20476
+ if (spec.unavailableDays !== void 0) {
20477
+ dto.unavailable_days = spec.unavailableDays;
20478
+ }
20479
+ if (spec.restrictedToShift !== void 0 && spec.restrictedToShift !== null) {
20480
+ dto.restricted_to_shift = spec.restrictedToShift;
20481
+ }
20482
+ return dto;
20483
+ }
20484
+ function ShiftDemandFromFrontToApi(demand) {
20485
+ const dto = {
20486
+ day: demand.day,
20487
+ shift: demand.shift,
20488
+ total: demand.total
20489
+ };
20490
+ if (demand.roleMinimums !== void 0) {
20491
+ dto.role_minimums = demand.roleMinimums;
20492
+ }
20493
+ return dto;
20494
+ }
20495
+ function PinFromFrontToApi(pin) {
20496
+ return {
20497
+ agent_id: pin.agentId,
20498
+ day: pin.day,
20499
+ shift: pin.shift
20500
+ };
20501
+ }
20502
+ function SchedulingFeasibilityRequestFromFrontToApi(request) {
20503
+ const dto = {
20504
+ agents: request.agents.map(AgentSpecFromFrontToApi),
20505
+ days: request.days,
20506
+ shifts_per_day: request.shiftsPerDay,
20507
+ demands: request.demands.map(ShiftDemandFromFrontToApi)
20508
+ };
20509
+ if (request.pins !== void 0) {
20510
+ dto.pins = request.pins.map(PinFromFrontToApi);
20511
+ }
20512
+ return dto;
20513
+ }
20514
+ function AssignmentFromApiToFront(dto) {
20515
+ return {
20516
+ agentId: dto.agent_id,
20517
+ day: dto.day,
20518
+ shift: dto.shift,
20519
+ status: dto.status
20520
+ };
20521
+ }
20522
+ function SchedulingFeasibilityResponseFromApiToFront(dto) {
20523
+ return {
20524
+ status: dto.status,
20525
+ assignments: dto.assignments.map(AssignmentFromApiToFront)
20526
+ };
20527
+ }
20528
+
20529
+ // src/resources/scheduling.ts
20530
+ var SchedulingClient = class {
20531
+ /** @internal */
20532
+ api;
20533
+ /** @internal */
20534
+ constructor(api) {
20535
+ this.api = api;
20536
+ }
20537
+ /**
20538
+ * Classify every `(agent, day, shift)` cell in the input grid as
20539
+ * `confirmed_true`, `confirmed_false`, or `free`.
20540
+ *
20541
+ * @param request - the scheduling problem to analyse.
20542
+ * @returns a {@link SchedulingFeasibilityResponse} with per-cell classifications.
20543
+ * @throws If the backend rejects the input (HTTP 400): duplicate agent
20544
+ * IDs, pins referencing unknown agents, role minima exceeding total
20545
+ * demand, out-of-range day/shift indices, etc.
20546
+ *
20547
+ * @remarks
20548
+ * Infeasibility of a well-formed problem is a **valid answer** (HTTP 200
20549
+ * with `status === "infeasible"`), not an error. Only malformed input
20550
+ * raises.
20551
+ */
20552
+ async feasibility(request) {
20553
+ const response = await this.api.feasibility(
20554
+ SchedulingFeasibilityRequestFromFrontToApi(request)
20555
+ );
20556
+ return SchedulingFeasibilityResponseFromApiToFront(response.data);
20557
+ }
20558
+ };
20559
+
20443
20560
  // src/normalizers/osfql.ts
20444
20561
  function OsfqlResponseFromApiToFront(dto) {
20445
20562
  return {
@@ -21590,6 +21707,8 @@ var ReasoningLayerClient = class {
21590
21707
  rag;
21591
21708
  /** Linear program optimization (CLP(Q) simplex solver via backward chaining). */
21592
21709
  optimize;
21710
+ /** Scheduling feasibility via capacitated bipartite b-matching (staff rostering, assignment problems). */
21711
+ scheduling;
21593
21712
  /** OSFQL execution operations. */
21594
21713
  osfql;
21595
21714
  /** Conversational AI operations (NL → OSFQL with self-correction). */
@@ -21665,10 +21784,11 @@ var ReasoningLayerClient = class {
21665
21784
  rlTraining: this.rlTraining
21666
21785
  };
21667
21786
  }
21668
- /** Advanced reasoning operations — optimization, ILP, CDL, execution, preferences, discovery. */
21787
+ /** Advanced reasoning operations — optimization, ILP, CDL, execution, preferences, discovery, scheduling. */
21669
21788
  get reasoningOps() {
21670
21789
  return this._reasoning ??= {
21671
21790
  optimize: this.optimize,
21791
+ scheduling: this.scheduling,
21672
21792
  ilp: this.ilp,
21673
21793
  cdl: this.cdl,
21674
21794
  execution: this.execution,
@@ -21823,6 +21943,7 @@ var ReasoningLayerClient = class {
21823
21943
  this.generation = new GenerationClient(generatedGeneration);
21824
21944
  this.rag = new RagClient(generatedRag);
21825
21945
  this.optimize = new OptimizeClient(generatedInference, generatedSorts, generatedQuery, generatedTerms, resolved.tenantId);
21946
+ this.scheduling = new SchedulingClient(new Scheduling(generatedHttp));
21826
21947
  this.osfql = new OsfqlClient(generatedOsfql);
21827
21948
  this.conversation = new ConversationClient(generatedHttp);
21828
21949
  this.research = new ResearchClient(generatedHttp);
@@ -21967,6 +22088,9 @@ var rag_exports = {};
21967
22088
  // src/types/optimize.ts
21968
22089
  var optimize_exports = {};
21969
22090
 
22091
+ // src/types/scheduling.ts
22092
+ var scheduling_exports = {};
22093
+
21970
22094
  // src/types/ilp.ts
21971
22095
  var ilp_exports = {};
21972
22096
 
@@ -22711,6 +22835,7 @@ exports.Reviews = reviews_exports;
22711
22835
  exports.Row = row_exports;
22712
22836
  exports.SDK_VERSION = SDK_VERSION;
22713
22837
  exports.Scenarios = scenarios_exports;
22838
+ exports.Scheduling = scheduling_exports;
22714
22839
  exports.SortBuilder = SortBuilder;
22715
22840
  exports.Sorts = sorts_exports;
22716
22841
  exports.Sources = sources_exports;