@kortexya/reasoninglayer 1.10.1 → 1.12.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
@@ -7,7 +7,7 @@ var __export = (target, all) => {
7
7
  };
8
8
 
9
9
  // src/config.ts
10
- var SDK_VERSION = "1.10.1";
10
+ var SDK_VERSION = "1.12.0";
11
11
  function resolveConfig(config) {
12
12
  if (!config.baseUrl) {
13
13
  throw new Error("ClientConfig.baseUrl is required");
@@ -22942,6 +22942,26 @@ function ResearchSessionResponseFromApiToFront(raw) {
22942
22942
  updatedAt: dto.updated_at
22943
22943
  };
22944
22944
  }
22945
+ function ResearchSessionSummaryFromApiToFront(raw) {
22946
+ const dto = raw;
22947
+ return {
22948
+ sessionId: dto.session_id,
22949
+ question: dto.question,
22950
+ status: dto.status,
22951
+ totalPapersIngested: dto.total_papers_ingested,
22952
+ totalFindings: dto.total_findings,
22953
+ totalContradictions: dto.total_contradictions,
22954
+ totalGaps: dto.total_gaps,
22955
+ createdAt: dto.created_at,
22956
+ updatedAt: dto.updated_at
22957
+ };
22958
+ }
22959
+ function ListResearchSessionsResponseFromApiToFront(raw) {
22960
+ const dto = raw;
22961
+ return {
22962
+ sessions: (dto.sessions ?? []).map(ResearchSessionSummaryFromApiToFront)
22963
+ };
22964
+ }
22945
22965
  function ResearchCycleResponseFromApiToFront(raw) {
22946
22966
  const dto = raw;
22947
22967
  return {
@@ -23188,6 +23208,30 @@ var ResearchClient = class {
23188
23208
  });
23189
23209
  return ResearchSessionResponseFromApiToFront(response.data);
23190
23210
  }
23211
+ /**
23212
+ * List the current tenant's research sessions, newest first.
23213
+ *
23214
+ * Tenant-scoped via the `X-Tenant-Id` header (set on the client), mirroring
23215
+ * how conversations are listed. Returns lightweight summaries — use
23216
+ * {@link getSession} / {@link getReport} for a session's full detail.
23217
+ *
23218
+ * @returns The tenant's session summaries.
23219
+ *
23220
+ * @example
23221
+ * ```ts
23222
+ * const { sessions } = await client.research.listSessions();
23223
+ * sessions.forEach((s) => console.log(s.sessionId, s.status, s.question));
23224
+ * ```
23225
+ */
23226
+ async listSessions() {
23227
+ const response = await this.http.request({
23228
+ path: `/api/v1/research/sessions`,
23229
+ method: "GET",
23230
+ secure: true,
23231
+ format: "json"
23232
+ });
23233
+ return ListResearchSessionsResponseFromApiToFront(response.data);
23234
+ }
23191
23235
  /**
23192
23236
  * Run a single research cycle within a session.
23193
23237
  *
@@ -23253,6 +23297,33 @@ var ResearchClient = class {
23253
23297
  });
23254
23298
  return ResearchSessionResponseFromApiToFront(response.data);
23255
23299
  }
23300
+ /**
23301
+ * Resume an interrupted or failed research session.
23302
+ *
23303
+ * A session left in a non-`Completed` state — e.g. swept to `Failed` after a
23304
+ * server restart killed its in-process pipeline — is otherwise stuck. Resuming
23305
+ * re-runs the pipeline, continuing from the session's persisted partial
23306
+ * progress (papers ingested, findings, cycles), and can reach `Completed`.
23307
+ * Like {@link runToCompletion} the run is long-lived server-side; the UI
23308
+ * typically calls this fire-and-forget and polls {@link getSession}.
23309
+ *
23310
+ * @param sessionId - The session ID (UUID) to resume.
23311
+ * @throws {ApiError} 409 if the session is already `Completed`, 404 if unknown.
23312
+ *
23313
+ * @example
23314
+ * ```ts
23315
+ * await client.research.resumeSession('session-uuid');
23316
+ * ```
23317
+ */
23318
+ async resumeSession(sessionId) {
23319
+ const response = await this.http.request({
23320
+ path: `/api/v1/research/sessions/${encodeURIComponent(sessionId)}/resume`,
23321
+ method: "POST",
23322
+ secure: true,
23323
+ format: "json"
23324
+ });
23325
+ return ResearchSessionResponseFromApiToFront(response.data);
23326
+ }
23256
23327
  /**
23257
23328
  * Delete a research session and all associated data.
23258
23329
  *