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