@kortexya/reasoninglayer 0.22.0 → 0.22.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.cjs +19 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +63 -17
- package/dist/index.d.ts +63 -17
- package/dist/index.js +19 -2
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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 = "0.22.
|
|
112
|
+
declare const SDK_VERSION = "0.22.1";
|
|
113
113
|
/**
|
|
114
114
|
* Configuration for the Reasoning Layer client.
|
|
115
115
|
*
|
|
@@ -3469,14 +3469,38 @@ type CreateScenarioResponse$1 = {
|
|
|
3469
3469
|
/**
|
|
3470
3470
|
* Request body for `POST /api/v1/scheduling/problems`.
|
|
3471
3471
|
*
|
|
3472
|
-
*
|
|
3473
|
-
*
|
|
3474
|
-
*
|
|
3475
|
-
*
|
|
3476
|
-
*
|
|
3472
|
+
* Two mutually exclusive ways to identify the problem's agents:
|
|
3473
|
+
*
|
|
3474
|
+
* * **Inline** — set `agents` to a list of [`AgentInput`]s.
|
|
3475
|
+
* The problem term embeds frozen copies of the agent specs.
|
|
3476
|
+
* Convenient for ad-hoc demos but doesn't compose with other
|
|
3477
|
+
* KB-stored entities.
|
|
3478
|
+
*
|
|
3479
|
+
* * **Reference** — set `agent_ids` to a list of `TermId`
|
|
3480
|
+
* UUIDs pointing at agent Ψ-terms (sort `nurse` or any
|
|
3481
|
+
* tenant-defined agent sort) created via the regular
|
|
3482
|
+
* `POST /api/v1/terms` endpoint. The problem term carries
|
|
3483
|
+
* refs only; re-solving fetches the agent terms from the KB
|
|
3484
|
+
* at solve time, so updating an agent (e.g. adding a
|
|
3485
|
+
* certification, adding a personal_constraint sub-term)
|
|
3486
|
+
* immediately affects the next solve. This is the
|
|
3487
|
+
* OSF/LIFE-native flow and what multi-user collaboration
|
|
3488
|
+
* uses.
|
|
3489
|
+
*
|
|
3490
|
+
* Exactly one of `agents` / `agent_ids` must be supplied;
|
|
3491
|
+
* supplying both, or neither, returns HTTP 400.
|
|
3477
3492
|
*/
|
|
3478
3493
|
interface CreateSchedulingProblemRequest$1 {
|
|
3479
|
-
|
|
3494
|
+
/**
|
|
3495
|
+
* References to agent Ψ-terms in the KB (UUID strings).
|
|
3496
|
+
* Optional; mutually exclusive with `agents`.
|
|
3497
|
+
*/
|
|
3498
|
+
agent_ids?: any[] | null;
|
|
3499
|
+
/**
|
|
3500
|
+
* Inline agent specs (legacy / demo-friendly path). Optional;
|
|
3501
|
+
* see `agent_ids` for the reference-based alternative.
|
|
3502
|
+
*/
|
|
3503
|
+
agents?: any[] | null;
|
|
3480
3504
|
/** @min 0 */
|
|
3481
3505
|
days: number;
|
|
3482
3506
|
demands: ShiftDemandInput[];
|
|
@@ -39879,22 +39903,44 @@ interface SchedulingOptimizeResponse {
|
|
|
39879
39903
|
* Input to {@link SchedulingClient.createProblem}.
|
|
39880
39904
|
*
|
|
39881
39905
|
* @remarks
|
|
39882
|
-
*
|
|
39883
|
-
*
|
|
39884
|
-
*
|
|
39885
|
-
*
|
|
39886
|
-
*
|
|
39887
|
-
*
|
|
39888
|
-
*
|
|
39906
|
+
* Two mutually-exclusive ways to identify the problem's agents:
|
|
39907
|
+
*
|
|
39908
|
+
* - **Inline** — set `agents` to a list of {@link AgentSpec}s.
|
|
39909
|
+
* The server embeds frozen agent-spec copies on the problem
|
|
39910
|
+
* term. Convenient for ad-hoc demos.
|
|
39911
|
+
*
|
|
39912
|
+
* - **Reference** — set `agentIds` to a list of `TermId` UUIDs
|
|
39913
|
+
* pointing at agent Ψ-terms (sort `nurse` or any other
|
|
39914
|
+
* tenant-defined sort) created via the regular
|
|
39915
|
+
* `POST /api/v1/terms` endpoint. The problem term carries
|
|
39916
|
+
* refs only; re-solving fetches the agent terms from the KB
|
|
39917
|
+
* at solve time, so mutating an agent (adding a
|
|
39918
|
+
* `personal_constraints` sub-term, for instance) immediately
|
|
39919
|
+
* affects the next solve. This is the OSF/LIFE-native flow
|
|
39920
|
+
* and what multi-user collaboration uses.
|
|
39921
|
+
*
|
|
39922
|
+
* **Exactly one** of `agents` / `agentIds` must be supplied.
|
|
39923
|
+
* Sending both — or neither — returns HTTP 400.
|
|
39924
|
+
*
|
|
39925
|
+
* `pins` / `preferences` on the create payload are only honoured
|
|
39926
|
+
* for the inline path. In the reference path, create the problem
|
|
39927
|
+
* first and add pins / preferences via the mutation endpoints
|
|
39928
|
+
* (where `agentId` is then a TermId UUID).
|
|
39889
39929
|
*/
|
|
39890
39930
|
interface CreateSchedulingProblemRequest {
|
|
39891
|
-
|
|
39931
|
+
/** Inline agent specs. Mutually exclusive with `agentIds`. */
|
|
39932
|
+
agents?: AgentSpec[];
|
|
39933
|
+
/**
|
|
39934
|
+
* References to agent Ψ-terms in the KB (UUID strings).
|
|
39935
|
+
* Mutually exclusive with `agents`.
|
|
39936
|
+
*/
|
|
39937
|
+
agentIds?: string[];
|
|
39892
39938
|
days: number;
|
|
39893
39939
|
shiftsPerDay: number;
|
|
39894
39940
|
demands: ShiftDemand[];
|
|
39895
|
-
/** Pre-assigned `(agent, day, shift)` triples.
|
|
39941
|
+
/** Pre-assigned `(agent, day, shift)` triples. Inline path only. */
|
|
39896
39942
|
pins?: Pin[];
|
|
39897
|
-
/** Soft preferences applied to the optimum's objective.
|
|
39943
|
+
/** Soft preferences applied to the optimum's objective. Inline path only. */
|
|
39898
39944
|
preferences?: Preference[];
|
|
39899
39945
|
}
|
|
39900
39946
|
/**
|
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.22.
|
|
112
|
+
declare const SDK_VERSION = "0.22.1";
|
|
113
113
|
/**
|
|
114
114
|
* Configuration for the Reasoning Layer client.
|
|
115
115
|
*
|
|
@@ -3469,14 +3469,38 @@ type CreateScenarioResponse$1 = {
|
|
|
3469
3469
|
/**
|
|
3470
3470
|
* Request body for `POST /api/v1/scheduling/problems`.
|
|
3471
3471
|
*
|
|
3472
|
-
*
|
|
3473
|
-
*
|
|
3474
|
-
*
|
|
3475
|
-
*
|
|
3476
|
-
*
|
|
3472
|
+
* Two mutually exclusive ways to identify the problem's agents:
|
|
3473
|
+
*
|
|
3474
|
+
* * **Inline** — set `agents` to a list of [`AgentInput`]s.
|
|
3475
|
+
* The problem term embeds frozen copies of the agent specs.
|
|
3476
|
+
* Convenient for ad-hoc demos but doesn't compose with other
|
|
3477
|
+
* KB-stored entities.
|
|
3478
|
+
*
|
|
3479
|
+
* * **Reference** — set `agent_ids` to a list of `TermId`
|
|
3480
|
+
* UUIDs pointing at agent Ψ-terms (sort `nurse` or any
|
|
3481
|
+
* tenant-defined agent sort) created via the regular
|
|
3482
|
+
* `POST /api/v1/terms` endpoint. The problem term carries
|
|
3483
|
+
* refs only; re-solving fetches the agent terms from the KB
|
|
3484
|
+
* at solve time, so updating an agent (e.g. adding a
|
|
3485
|
+
* certification, adding a personal_constraint sub-term)
|
|
3486
|
+
* immediately affects the next solve. This is the
|
|
3487
|
+
* OSF/LIFE-native flow and what multi-user collaboration
|
|
3488
|
+
* uses.
|
|
3489
|
+
*
|
|
3490
|
+
* Exactly one of `agents` / `agent_ids` must be supplied;
|
|
3491
|
+
* supplying both, or neither, returns HTTP 400.
|
|
3477
3492
|
*/
|
|
3478
3493
|
interface CreateSchedulingProblemRequest$1 {
|
|
3479
|
-
|
|
3494
|
+
/**
|
|
3495
|
+
* References to agent Ψ-terms in the KB (UUID strings).
|
|
3496
|
+
* Optional; mutually exclusive with `agents`.
|
|
3497
|
+
*/
|
|
3498
|
+
agent_ids?: any[] | null;
|
|
3499
|
+
/**
|
|
3500
|
+
* Inline agent specs (legacy / demo-friendly path). Optional;
|
|
3501
|
+
* see `agent_ids` for the reference-based alternative.
|
|
3502
|
+
*/
|
|
3503
|
+
agents?: any[] | null;
|
|
3480
3504
|
/** @min 0 */
|
|
3481
3505
|
days: number;
|
|
3482
3506
|
demands: ShiftDemandInput[];
|
|
@@ -39879,22 +39903,44 @@ interface SchedulingOptimizeResponse {
|
|
|
39879
39903
|
* Input to {@link SchedulingClient.createProblem}.
|
|
39880
39904
|
*
|
|
39881
39905
|
* @remarks
|
|
39882
|
-
*
|
|
39883
|
-
*
|
|
39884
|
-
*
|
|
39885
|
-
*
|
|
39886
|
-
*
|
|
39887
|
-
*
|
|
39888
|
-
*
|
|
39906
|
+
* Two mutually-exclusive ways to identify the problem's agents:
|
|
39907
|
+
*
|
|
39908
|
+
* - **Inline** — set `agents` to a list of {@link AgentSpec}s.
|
|
39909
|
+
* The server embeds frozen agent-spec copies on the problem
|
|
39910
|
+
* term. Convenient for ad-hoc demos.
|
|
39911
|
+
*
|
|
39912
|
+
* - **Reference** — set `agentIds` to a list of `TermId` UUIDs
|
|
39913
|
+
* pointing at agent Ψ-terms (sort `nurse` or any other
|
|
39914
|
+
* tenant-defined sort) created via the regular
|
|
39915
|
+
* `POST /api/v1/terms` endpoint. The problem term carries
|
|
39916
|
+
* refs only; re-solving fetches the agent terms from the KB
|
|
39917
|
+
* at solve time, so mutating an agent (adding a
|
|
39918
|
+
* `personal_constraints` sub-term, for instance) immediately
|
|
39919
|
+
* affects the next solve. This is the OSF/LIFE-native flow
|
|
39920
|
+
* and what multi-user collaboration uses.
|
|
39921
|
+
*
|
|
39922
|
+
* **Exactly one** of `agents` / `agentIds` must be supplied.
|
|
39923
|
+
* Sending both — or neither — returns HTTP 400.
|
|
39924
|
+
*
|
|
39925
|
+
* `pins` / `preferences` on the create payload are only honoured
|
|
39926
|
+
* for the inline path. In the reference path, create the problem
|
|
39927
|
+
* first and add pins / preferences via the mutation endpoints
|
|
39928
|
+
* (where `agentId` is then a TermId UUID).
|
|
39889
39929
|
*/
|
|
39890
39930
|
interface CreateSchedulingProblemRequest {
|
|
39891
|
-
|
|
39931
|
+
/** Inline agent specs. Mutually exclusive with `agentIds`. */
|
|
39932
|
+
agents?: AgentSpec[];
|
|
39933
|
+
/**
|
|
39934
|
+
* References to agent Ψ-terms in the KB (UUID strings).
|
|
39935
|
+
* Mutually exclusive with `agents`.
|
|
39936
|
+
*/
|
|
39937
|
+
agentIds?: string[];
|
|
39892
39938
|
days: number;
|
|
39893
39939
|
shiftsPerDay: number;
|
|
39894
39940
|
demands: ShiftDemand[];
|
|
39895
|
-
/** Pre-assigned `(agent, day, shift)` triples.
|
|
39941
|
+
/** Pre-assigned `(agent, day, shift)` triples. Inline path only. */
|
|
39896
39942
|
pins?: Pin[];
|
|
39897
|
-
/** Soft preferences applied to the optimum's objective.
|
|
39943
|
+
/** Soft preferences applied to the optimum's objective. Inline path only. */
|
|
39898
39944
|
preferences?: Preference[];
|
|
39899
39945
|
}
|
|
39900
39946
|
/**
|
package/dist/index.js
CHANGED
|
@@ -5,7 +5,7 @@ var __export = (target, all) => {
|
|
|
5
5
|
};
|
|
6
6
|
|
|
7
7
|
// src/config.ts
|
|
8
|
-
var SDK_VERSION = "0.22.
|
|
8
|
+
var SDK_VERSION = "0.22.1";
|
|
9
9
|
function resolveConfig(config) {
|
|
10
10
|
if (!config.baseUrl) {
|
|
11
11
|
throw new Error("ClientConfig.baseUrl is required");
|
|
@@ -20696,12 +20696,29 @@ function SchedulingOptimizeResponseFromApiToFront(dto) {
|
|
|
20696
20696
|
};
|
|
20697
20697
|
}
|
|
20698
20698
|
function CreateSchedulingProblemRequestFromFrontToApi(request) {
|
|
20699
|
+
const hasInline = request.agents !== void 0;
|
|
20700
|
+
const hasRefs = request.agentIds !== void 0;
|
|
20701
|
+
if (hasInline && hasRefs) {
|
|
20702
|
+
throw new Error(
|
|
20703
|
+
"CreateSchedulingProblemRequest: supply exactly one of `agents` (inline) or `agentIds` (TermId refs), not both"
|
|
20704
|
+
);
|
|
20705
|
+
}
|
|
20706
|
+
if (!hasInline && !hasRefs) {
|
|
20707
|
+
throw new Error(
|
|
20708
|
+
"CreateSchedulingProblemRequest: must supply either `agents` (inline) or `agentIds` (TermId refs)"
|
|
20709
|
+
);
|
|
20710
|
+
}
|
|
20699
20711
|
const dto = {
|
|
20700
|
-
agents: request.agents.map(AgentSpecFromFrontToApi),
|
|
20701
20712
|
days: request.days,
|
|
20702
20713
|
shifts_per_day: request.shiftsPerDay,
|
|
20703
20714
|
demands: request.demands.map(ShiftDemandFromFrontToApi)
|
|
20704
20715
|
};
|
|
20716
|
+
if (request.agents !== void 0) {
|
|
20717
|
+
dto.agents = request.agents.map(AgentSpecFromFrontToApi);
|
|
20718
|
+
}
|
|
20719
|
+
if (request.agentIds !== void 0) {
|
|
20720
|
+
dto.agent_ids = request.agentIds;
|
|
20721
|
+
}
|
|
20705
20722
|
if (request.pins !== void 0) {
|
|
20706
20723
|
dto.pins = request.pins.map(PinFromFrontToApi);
|
|
20707
20724
|
}
|