@kortexya/reasoninglayer 8.0.0 → 8.1.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 +87 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +150 -20
- package/dist/index.d.ts +150 -20
- package/dist/index.js +87 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -7,7 +7,7 @@ var __export = (target, all) => {
|
|
|
7
7
|
};
|
|
8
8
|
|
|
9
9
|
// src/config.ts
|
|
10
|
-
var SDK_VERSION = "8.
|
|
10
|
+
var SDK_VERSION = "8.1.0";
|
|
11
11
|
function resolveConfig(config) {
|
|
12
12
|
if (!config.baseUrl) {
|
|
13
13
|
throw new Error("ClientConfig.baseUrl is required");
|
|
@@ -16968,6 +16968,23 @@ var Vocabulary = class {
|
|
|
16968
16968
|
format: "json",
|
|
16969
16969
|
...params
|
|
16970
16970
|
});
|
|
16971
|
+
/**
|
|
16972
|
+
* No description
|
|
16973
|
+
*
|
|
16974
|
+
* @tags vocabulary
|
|
16975
|
+
* @name LookupRecords
|
|
16976
|
+
* @summary `GET /api/v1/vocabulary/records` — the records of one view with the ids asked (#632). A client names the few records a finding, a conflict or a list cites without reading a whole release or change set; the view is the cached release or candidate view, so a lookup costs the ids asked.
|
|
16977
|
+
* @request GET:/api/v1/vocabulary/records
|
|
16978
|
+
* @secure
|
|
16979
|
+
*/
|
|
16980
|
+
lookupRecords = (query, params = {}) => this.http.request({
|
|
16981
|
+
path: `/api/v1/vocabulary/records`,
|
|
16982
|
+
method: "GET",
|
|
16983
|
+
query,
|
|
16984
|
+
secure: true,
|
|
16985
|
+
format: "json",
|
|
16986
|
+
...params
|
|
16987
|
+
});
|
|
16971
16988
|
/**
|
|
16972
16989
|
* No description
|
|
16973
16990
|
*
|
|
@@ -17111,7 +17128,7 @@ var Vocabulary = class {
|
|
|
17111
17128
|
*
|
|
17112
17129
|
* @tags vocabulary
|
|
17113
17130
|
* @name RevisionRecords
|
|
17114
|
-
* @summary `GET /api/v1/vocabulary/revisions/{revision_id}/records` — the records the revision's cumulative change set inserts or replaces, by id, optionally of one kind (#628). The revision answer counts them; this read pages them.
|
|
17131
|
+
* @summary `GET /api/v1/vocabulary/revisions/{revision_id}/records` — the records the revision's cumulative change set inserts or replaces, by id, optionally of one kind (#628). The revision answer counts them; this read pages them from the cached candidate view, so a page costs a page once the revision is indexed (#630).
|
|
17115
17132
|
* @request GET:/api/v1/vocabulary/revisions/{revision_id}/records
|
|
17116
17133
|
* @secure
|
|
17117
17134
|
*/
|
|
@@ -19590,6 +19607,7 @@ var RESPONSE_COMPONENTS = {
|
|
|
19590
19607
|
created_by: [1, 0],
|
|
19591
19608
|
minted_ids: [1, { object: {} }],
|
|
19592
19609
|
outcome: [1, 0],
|
|
19610
|
+
proposal_counts: [1, { object: {} }],
|
|
19593
19611
|
record_counts: [1, { object: {} }],
|
|
19594
19612
|
removals: [1, { array: 0 }],
|
|
19595
19613
|
replayed: [1, 0],
|
|
@@ -25353,6 +25371,14 @@ var RESPONSE_COMPONENTS = {
|
|
|
25353
25371
|
},
|
|
25354
25372
|
RecordEpisodeResponse: { object: { episode_id: [1, 0], message: [1, 0] } },
|
|
25355
25373
|
RecordFeatureChangeDto: { object: { feature: [1, 0] } },
|
|
25374
|
+
RecordLookupResponse: {
|
|
25375
|
+
object: {
|
|
25376
|
+
context: [2, "ContextRefDto"],
|
|
25377
|
+
items: [1, { array: 0 }],
|
|
25378
|
+
missing: [1, { array: 0 }],
|
|
25379
|
+
view: [1, "ViewRefDto"]
|
|
25380
|
+
}
|
|
25381
|
+
},
|
|
25356
25382
|
RecordPageResponse: { object: { items: [1, { array: 0 }], release_id: [1, 0] } },
|
|
25357
25383
|
RecordSafeHarborStatus: {
|
|
25358
25384
|
object: {
|
|
@@ -30580,6 +30606,11 @@ var RESPONSE_OPERATIONS = {
|
|
|
30580
30606
|
path: "/api/v1/workflows",
|
|
30581
30607
|
responses: { 200: "WorkflowListResponse" }
|
|
30582
30608
|
},
|
|
30609
|
+
lookupRecords: {
|
|
30610
|
+
method: "GET",
|
|
30611
|
+
path: "/api/v1/vocabulary/records",
|
|
30612
|
+
responses: { 200: "RecordLookupResponse" }
|
|
30613
|
+
},
|
|
30583
30614
|
markChoicePoint: {
|
|
30584
30615
|
method: "POST",
|
|
30585
30616
|
path: "/api/v1/execution/sessions/{session_id}/mark",
|
|
@@ -39307,14 +39338,16 @@ var NamespacesClient = class {
|
|
|
39307
39338
|
*
|
|
39308
39339
|
* @param namespaceId - Namespace UUID.
|
|
39309
39340
|
* @param requestOptions - Per-call options (timeout, retries, signal, headers).
|
|
39310
|
-
* @returns The counters
|
|
39341
|
+
* @returns The engine's durable counters for the namespace since `countedSince`.
|
|
39311
39342
|
* @throws {ForbiddenError} 403 without a native `manage_answer_cache` grant.
|
|
39312
39343
|
* @throws {NotFoundError} 404 for a namespace not in this tenant.
|
|
39313
|
-
* @throws {ServiceUnavailableError} 503 when the namespace state or
|
|
39344
|
+
* @throws {ServiceUnavailableError} 503 when the namespace state, authority or savings storage is unavailable.
|
|
39314
39345
|
*
|
|
39315
39346
|
* @remarks
|
|
39316
39347
|
* `GET /api/v1/namespaces/{id}/answer-cache-savings`. The counters are
|
|
39317
|
-
*
|
|
39348
|
+
* durable and summed across engine processes and restarts; another
|
|
39349
|
+
* process's counts arrive within its five-second write interval. Token
|
|
39350
|
+
* savings are not measured
|
|
39318
39351
|
* (`tokenUsageMeasured: false`). Response mapped from snake_case.
|
|
39319
39352
|
*
|
|
39320
39353
|
* @example
|
|
@@ -71821,6 +71854,7 @@ function VocabularyCandidateRevisionFromApiToFront(dto) {
|
|
|
71821
71854
|
createdAt: dto.created_at,
|
|
71822
71855
|
changeReason: dto.change_reason,
|
|
71823
71856
|
recordCounts: dataMap(dto.record_counts),
|
|
71857
|
+
proposalCounts: dataMap(dto.proposal_counts),
|
|
71824
71858
|
removals: dto.removals,
|
|
71825
71859
|
mintedIds: dataMap(dto.minted_ids),
|
|
71826
71860
|
advisoryFindings: dto.advisory_findings.map(VocabularyFindingFromApiToFront),
|
|
@@ -72009,6 +72043,15 @@ function VocabularyRevisionRecordPageFromApiToFront(dto) {
|
|
|
72009
72043
|
if (present(dto.next_cursor)) out.nextCursor = dto.next_cursor;
|
|
72010
72044
|
return out;
|
|
72011
72045
|
}
|
|
72046
|
+
function VocabularyRecordLookupFromApiToFront(dto) {
|
|
72047
|
+
const out = {
|
|
72048
|
+
view: ViewRefFromApiToFront(dto.view),
|
|
72049
|
+
items: dto.items.map(VocabularyRecordViewFromApiToFront),
|
|
72050
|
+
missing: dto.missing
|
|
72051
|
+
};
|
|
72052
|
+
if (present(dto.context)) out.context = VocabularyContextRefFromApiToFront(dto.context);
|
|
72053
|
+
return out;
|
|
72054
|
+
}
|
|
72012
72055
|
function VocabularyActivationResultFromApiToFront(dto) {
|
|
72013
72056
|
const out = {
|
|
72014
72057
|
releaseId: dto.release_id,
|
|
@@ -73145,13 +73188,16 @@ var VocabularyClient = class {
|
|
|
73145
73188
|
*
|
|
73146
73189
|
* @remarks
|
|
73147
73190
|
* `GET /api/v1/vocabulary/revisions/{revision_id}`. The answer counts the
|
|
73148
|
-
* records by kind (`recordCounts`)
|
|
73149
|
-
*
|
|
73191
|
+
* records by kind (`recordCounts`) and the proposals among them
|
|
73192
|
+
* (`proposalCounts`); read the records with
|
|
73193
|
+
* {@link VocabularyClient.listRevisionRecords} or
|
|
73194
|
+
* {@link VocabularyClient.lookupRecords}.
|
|
73150
73195
|
*
|
|
73151
73196
|
* @example
|
|
73152
73197
|
* ```typescript
|
|
73153
73198
|
* const revision = await client.vocabulary.getRevision(revisionId);
|
|
73154
73199
|
* const conceptCount = revision.recordCounts['concept'] ?? 0;
|
|
73200
|
+
* const toAccept = Object.values(revision.proposalCounts).reduce((n, c) => n + c, 0);
|
|
73155
73201
|
* ```
|
|
73156
73202
|
*/
|
|
73157
73203
|
async getRevision(revisionId, requestOptions) {
|
|
@@ -73185,6 +73231,40 @@ var VocabularyClient = class {
|
|
|
73185
73231
|
const response = await this.api.revisionRecords(revisionId, wire, toRequestParams(requestOptions)).catch(rethrowVocabularyRefusal);
|
|
73186
73232
|
return decodeResponse(response, VocabularyRevisionRecordPageFromApiToFront);
|
|
73187
73233
|
}
|
|
73234
|
+
/**
|
|
73235
|
+
* The records of one view with the ids asked: what a client needs to name
|
|
73236
|
+
* or open the few records a finding, a rebase conflict or a list cites,
|
|
73237
|
+
* without reading a whole release or change set.
|
|
73238
|
+
*
|
|
73239
|
+
* @param ids - The record ids (UUIDs): 1 to 500 distinct ids.
|
|
73240
|
+
* @param query - The view.
|
|
73241
|
+
* @param requestOptions - Per-call options (timeout, retries, signal, headers).
|
|
73242
|
+
* @returns The records the view holds, in the order asked and each once,
|
|
73243
|
+
* and the ids it does not hold.
|
|
73244
|
+
* @throws {@link NotFoundError} 404 for an unknown release or revision.
|
|
73245
|
+
* @throws {@link VocabularyRefusedError} 400 `invalid_request` (an id that is
|
|
73246
|
+
* not a UUID, no id, or more than 500); 409 `vocabulary_plugin_unavailable`.
|
|
73247
|
+
*
|
|
73248
|
+
* @remarks
|
|
73249
|
+
* `GET /api/v1/vocabulary/records?ids&view&release_id&revision_id`. An id
|
|
73250
|
+
* the candidate removes is `missing` in its candidate view. Duplicate ids
|
|
73251
|
+
* are answered once.
|
|
73252
|
+
*
|
|
73253
|
+
* @example
|
|
73254
|
+
* ```typescript
|
|
73255
|
+
* const { items, missing } = await client.vocabulary.lookupRecords(finding.subjects, {
|
|
73256
|
+
* view: { view: 'candidate', revisionId },
|
|
73257
|
+
* });
|
|
73258
|
+
* ```
|
|
73259
|
+
*/
|
|
73260
|
+
async lookupRecords(ids, query, requestOptions) {
|
|
73261
|
+
const wire = {
|
|
73262
|
+
...viewQuery(query?.view),
|
|
73263
|
+
ids: ids.join(",")
|
|
73264
|
+
};
|
|
73265
|
+
const response = await this.api.lookupRecords(wire, toRequestParams(requestOptions)).catch(rethrowVocabularyRefusal);
|
|
73266
|
+
return decodeResponse(response, VocabularyRecordLookupFromApiToFront);
|
|
73267
|
+
}
|
|
73188
73268
|
/**
|
|
73189
73269
|
* A revision against its baseline: records added, changed (with per-feature
|
|
73190
73270
|
* before/after values) and removed.
|