@kortexya/reasoninglayer 8.0.0 → 8.2.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.js CHANGED
@@ -5,7 +5,7 @@ var __export = (target, all) => {
5
5
  };
6
6
 
7
7
  // src/config.ts
8
- var SDK_VERSION = "8.0.0";
8
+ var SDK_VERSION = "8.2.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 of this engine process since `countedSince`.
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 authority is unavailable.
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
- * process-local and not durable; token savings are not measured
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
@@ -42157,6 +42190,7 @@ function IngestionConfigDtoFromFrontToApi(model) {
42157
42190
  previous_document_id: model.previousDocumentId,
42158
42191
  reject_anonymized_references: model.rejectAnonymizedReferences,
42159
42192
  skip_fingerprint: model.skipFingerprint,
42193
+ fresh_work: model.freshWork,
42160
42194
  skip_relation_completion: model.skipRelationCompletion
42161
42195
  };
42162
42196
  }
@@ -42247,6 +42281,7 @@ function IngestionWorkCacheDtoFromApiToFront(dto) {
42247
42281
  modelCalls: dto.model_calls,
42248
42282
  reusedModelCalls: dto.reused_model_calls,
42249
42283
  unkeyedModelCalls: dto.unkeyed_model_calls,
42284
+ bypassedModelCalls: dto.bypassed_model_calls ?? 0,
42250
42285
  reusedRecordedTokenUsage: TokenUsageDtoFromApiToFront(dto.reused_recorded_token_usage)
42251
42286
  };
42252
42287
  }
@@ -71819,6 +71854,7 @@ function VocabularyCandidateRevisionFromApiToFront(dto) {
71819
71854
  createdAt: dto.created_at,
71820
71855
  changeReason: dto.change_reason,
71821
71856
  recordCounts: dataMap(dto.record_counts),
71857
+ proposalCounts: dataMap(dto.proposal_counts),
71822
71858
  removals: dto.removals,
71823
71859
  mintedIds: dataMap(dto.minted_ids),
71824
71860
  advisoryFindings: dto.advisory_findings.map(VocabularyFindingFromApiToFront),
@@ -72007,6 +72043,15 @@ function VocabularyRevisionRecordPageFromApiToFront(dto) {
72007
72043
  if (present(dto.next_cursor)) out.nextCursor = dto.next_cursor;
72008
72044
  return out;
72009
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
+ }
72010
72055
  function VocabularyActivationResultFromApiToFront(dto) {
72011
72056
  const out = {
72012
72057
  releaseId: dto.release_id,
@@ -73143,13 +73188,16 @@ var VocabularyClient = class {
73143
73188
  *
73144
73189
  * @remarks
73145
73190
  * `GET /api/v1/vocabulary/revisions/{revision_id}`. The answer counts the
73146
- * records by kind (`recordCounts`); read the records with
73147
- * {@link VocabularyClient.listRevisionRecords}.
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}.
73148
73195
  *
73149
73196
  * @example
73150
73197
  * ```typescript
73151
73198
  * const revision = await client.vocabulary.getRevision(revisionId);
73152
73199
  * const conceptCount = revision.recordCounts['concept'] ?? 0;
73200
+ * const toAccept = Object.values(revision.proposalCounts).reduce((n, c) => n + c, 0);
73153
73201
  * ```
73154
73202
  */
73155
73203
  async getRevision(revisionId, requestOptions) {
@@ -73183,6 +73231,40 @@ var VocabularyClient = class {
73183
73231
  const response = await this.api.revisionRecords(revisionId, wire, toRequestParams(requestOptions)).catch(rethrowVocabularyRefusal);
73184
73232
  return decodeResponse(response, VocabularyRevisionRecordPageFromApiToFront);
73185
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
+ }
73186
73268
  /**
73187
73269
  * A revision against its baseline: records added, changed (with per-feature
73188
73270
  * before/after values) and removed.